From 4f8e6274790fcc5eb66ed3cb289b9b75bf3daac5 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 8 Sep 2020 13:16:45 -0600 Subject: [PATCH 01/52] QEq refactor --- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 31 +++-- src/USER-OMP/fix_qeq_reax_omp.cpp | 144 +++++------------------ src/USER-REAXC/fix_qeq_reax.cpp | 178 ++++++++++------------------- src/USER-REAXC/fix_qeq_reax.h | 4 +- 4 files changed, 109 insertions(+), 248 deletions(-) diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index eac044da2..a71b52e0f 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -112,7 +112,7 @@ void FixQEqReaxKokkos::init() ("FixQEqReax::params",ntypes+1); params = k_params.template view(); - for (n = 1; n <= ntypes; n++) { + for (int n = 1; n <= ntypes; n++) { k_params.h_view(n).chi = chi[n]; k_params.h_view(n).eta = eta[n]; k_params.h_view(n).gamma = gamma[n]; @@ -351,34 +351,35 @@ void FixQEqReaxKokkos::allocate_array() if (atom->nmax > nmax) { nmax = atom->nmax; - k_o = DAT::tdual_ffloat_1d("qeq/kk:h_o",nmax); + k_o = DAT::tdual_ffloat_1d("qeq/kk:o",nmax); d_o = k_o.template view(); h_o = k_o.h_view; - d_Hdia_inv = typename AT::t_ffloat_1d("qeq/kk:h_Hdia_inv",nmax); + d_Hdia_inv = typename AT::t_ffloat_1d("qeq/kk:Hdia_inv",nmax); - d_b_s = typename AT::t_ffloat_1d("qeq/kk:h_b_s",nmax); + d_b_s = typename AT::t_ffloat_1d("qeq/kk:b_s",nmax); - d_b_t = typename AT::t_ffloat_1d("qeq/kk:h_b_t",nmax); + d_b_t = typename AT::t_ffloat_1d("qeq/kk:b_t",nmax); - k_s = DAT::tdual_ffloat_1d("qeq/kk:h_s",nmax); + k_s = DAT::tdual_ffloat_1d("qeq/kk:s",nmax); d_s = k_s.template view(); h_s = k_s.h_view; - k_t = DAT::tdual_ffloat_1d("qeq/kk:h_t",nmax); + k_t = DAT::tdual_ffloat_1d("qeq/kk:t",nmax); d_t = k_t.template view(); h_t = k_t.h_view; - d_p = typename AT::t_ffloat_1d("qeq/kk:h_p",nmax); + d_p = typename AT::t_ffloat_1d("qeq/kk:p",nmax); - d_r = typename AT::t_ffloat_1d("qeq/kk:h_r",nmax); + d_r = typename AT::t_ffloat_1d("qeq/kk:r",nmax); - k_d = DAT::tdual_ffloat_1d("qeq/kk:h_d",nmax); + k_d = DAT::tdual_ffloat_1d("qeq/kk:d",nmax); d_d = k_d.template view(); h_d = k_d.h_view; } // init_storage + FixQEqReaxKokkosZeroFunctor zero_functor(this); Kokkos::parallel_for(ignum,zero_functor); @@ -779,8 +780,7 @@ void FixQEqReaxKokkos::cg_solve1() F_FLOAT sig_new = dot_sqr; int loop; - const int loopmax = 200; - for (loop = 1; (loop < loopmax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { + for (loop = 1; (loop < imax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { // comm->forward_comm_fix(this); //Dist_vector( d ); pack_flag = 1; @@ -848,7 +848,7 @@ void FixQEqReaxKokkos::cg_solve1() Kokkos::parallel_for(inum,vecsum2_functor); } - if (loop >= loopmax && comm->me == 0) { + if (loop >= imax && comm->me == 0) { char str[128]; sprintf(str,"Fix qeq/reax cg_solve1 convergence failed after %d iterations " "at " BIGINT_FORMAT " step: %f",loop,update->ntimestep,sqrt(sig_new)/b_norm); @@ -918,8 +918,7 @@ void FixQEqReaxKokkos::cg_solve2() F_FLOAT sig_new = dot_sqr; int loop; - const int loopmax = 200; - for (loop = 1; (loop < loopmax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { + for (loop = 1; (loop < imax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { // comm->forward_comm_fix(this); //Dist_vector( d ); pack_flag = 1; @@ -987,7 +986,7 @@ void FixQEqReaxKokkos::cg_solve2() Kokkos::parallel_for(inum,vecsum2_functor); } - if (loop >= loopmax && comm->me == 0) { + if (loop >= imax && comm->me == 0) { char str[128]; sprintf(str,"Fix qeq/reax cg_solve2 convergence failed after %d iterations " "at " BIGINT_FORMAT " step: %f",loop,update->ntimestep,sqrt(sig_new)/b_norm); diff --git a/src/USER-OMP/fix_qeq_reax_omp.cpp b/src/USER-OMP/fix_qeq_reax_omp.cpp index ef0f918cb..92c1b73e1 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.cpp +++ b/src/USER-OMP/fix_qeq_reax_omp.cpp @@ -63,8 +63,6 @@ using namespace FixConst; FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : FixQEqReax(lmp, narg, arg) { - if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax/omp command"); - b_temp = NULL; // ASPC: Kolafa, J. Comp. Chem., 25(3), 335 (2003) @@ -85,6 +83,11 @@ FixQEqReaxOMP::~FixQEqReaxOMP() void FixQEqReaxOMP::post_constructor() { + grow_arrays(atom->nmax); + for (int i = 0; i < atom->nmax; i++) + for (int j = 0; j < nprev; ++j) + s_hist[i][j] = t_hist[i][j] = 0; + pertype_parameters(pertype_option); } @@ -148,7 +151,6 @@ void FixQEqReaxOMP::init() void FixQEqReaxOMP::compute_H() { - int inum, *ilist, *numneigh, **firstneigh; double SMALL = 0.0001; int *type = atom->type; @@ -156,17 +158,6 @@ void FixQEqReaxOMP::compute_H() double **x = atom->x; int *mask = atom->mask; - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - } int ai, num_nbrs; // sumscan of the number of neighbors per atom to determine the offsets @@ -175,7 +166,7 @@ void FixQEqReaxOMP::compute_H() num_nbrs = 0; - for (int itr_i = 0; itr_i < inum; ++itr_i) { + for (int itr_i = 0; itr_i < nn; ++itr_i) { ai = ilist[itr_i]; H.firstnbr[ai] = num_nbrs; num_nbrs += numneigh[ai]; @@ -197,7 +188,7 @@ void FixQEqReaxOMP::compute_H() #if defined(_OPENMP) #pragma omp for schedule(guided) #endif - for (int ii = 0; ii < inum; ii++) { + for (int ii = 0; ii < nn; ii++) { int i = ilist[ii]; if (mask[i] & groupbit) { jlist = firstneigh[i]; @@ -214,7 +205,7 @@ void FixQEqReaxOMP::compute_H() flag = 0; if (r_sqr <= SQR(swb)) { - if (j < n) flag = 1; + if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { if (dz > SMALL) flag = 1; @@ -251,11 +242,6 @@ void FixQEqReaxOMP::compute_H() void FixQEqReaxOMP::init_storage() { - int NN; - - if (reaxc) NN = reaxc->list->inum + reaxc->list->gnum; - else NN = list->inum + list->gnum; - #if defined(_OPENMP) #pragma omp parallel for schedule(static) #endif @@ -284,8 +270,21 @@ void FixQEqReaxOMP::pre_force(int /* vflag */) if (update->ntimestep % nevery) return; if (comm->me == 0) t_start = MPI_Wtime(); - n = atom->nlocal; - N = atom->nlocal + atom->nghost; + int n = atom->nlocal; + + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } // grow arrays if necessary // need to be atom->nmax in length @@ -365,16 +364,7 @@ void FixQEqReaxOMP::init_matvec() /* fill-in H matrix */ compute_H(); - int nn,i; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int i; // Should really be more careful with initialization and first (aspc_order+2) MD steps if (do_aspc) { @@ -450,24 +440,12 @@ void FixQEqReaxOMP::init_matvec() int FixQEqReaxOMP::CG( double *b, double *x) { - int i, imax; + int i; double alpha, beta, b_norm; double sig_old, sig_new; double my_buf[2], buf[2]; - int nn; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; - pack_flag = 1; sparse_matvec( &H, x, q ); comm->reverse_comm_fix( this); //Coll_Vector( q ); @@ -579,8 +557,7 @@ void FixQEqReaxOMP::sparse_matvec( sparse_matrix *A, double *x, double *b) #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int nthreads = comm->nthreads; #if defined(_OPENMP) int tid = omp_get_thread_num(); @@ -588,16 +565,6 @@ void FixQEqReaxOMP::sparse_matvec( sparse_matrix *A, double *x, double *b) int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif @@ -655,17 +622,6 @@ void FixQEqReaxOMP::calculate_Q() int i; double *q = atom->q; - int nn; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - double tmp1, tmp2; tmp1 = tmp2 = 0.0; #if defined(_OPENMP) @@ -718,10 +674,6 @@ void FixQEqReaxOMP::vector_sum( double* dest, double c, double* v, double d, double* y, int k) { int i; - int *ilist; - - if (reaxc) ilist = reaxc->list->ilist; - else ilist = list->ilist; #if defined(_OPENMP) #pragma omp parallel for schedule(static) private(i) @@ -737,10 +689,6 @@ void FixQEqReaxOMP::vector_sum( double* dest, double c, double* v, void FixQEqReaxOMP::vector_add( double* dest, double c, double* v, int k) { int i; - int *ilist; - - if (reaxc) ilist = reaxc->list->ilist; - else ilist = list->ilist; #if defined(_OPENMP) #pragma omp parallel for schedule(static) private(i) @@ -765,24 +713,12 @@ int FixQEqReaxOMP::dual_CG( double *b1, double *b2, double *x1, double *x2) startTimeBase = MPI_Wtime(); #endif - int i, imax; + int i; double alpha_s, alpha_t, beta_s, beta_t, b_norm_s, b_norm_t; double sig_old_s, sig_old_t, sig_new_s, sig_new_t; double my_buf[4], buf[4]; - int nn; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; - pack_flag = 5; // forward 2x d and reverse 2x q dual_sparse_matvec( &H, x1, x2, q ); comm->reverse_comm_fix(this); //Coll_Vector( q ); @@ -975,8 +911,7 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x1, double *x2 #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int indxI, indxJ; int nthreads = comm->nthreads; @@ -986,16 +921,6 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x1, double *x2 int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif @@ -1077,8 +1002,7 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x, double *b ) #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int indxI, indxJ; int nthreads = comm->nthreads; @@ -1088,16 +1012,6 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x, double *b ) int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 4a61cfa03..28270b562 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -62,9 +62,7 @@ static const char cite_fix_qeq_reax[] = FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), pertype_option(NULL) { - if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); - - if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax command"); + if (narg<8 || narg>11) error->all(FLERR,"Illegal fix qeq/reax command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reax command"); @@ -79,14 +77,23 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // dual CG support only available for USER-OMP variant // check for compatibility is in Fix::post_constructor() dual_enabled = 0; - if (narg == 9) { - if (strcmp(arg[8],"dual") == 0) dual_enabled = 1; - else error->all(FLERR,"Illegal fix qeq/reax command"); + imax = 200; + + int iarg = 8; + while (iarg < narg) { + if (strcmp(arg[iarg],"dual") == 0) dual_enabled = 1; + else if (strcmp(arg[iarg],"imax") == 0) { + if (iarg+1 > narg-1) + error->all(FLERR,"Illegal fix qeq/reax command"); + imax = force->numeric(FLERR,arg[iarg+1]); + iarg++; + } else error->all(FLERR,"Illegal fix qeq/reax command"); + iarg++; } shld = NULL; - n = n_cap = 0; - N = nmax = 0; + nn = n_cap = 0; + NN = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; s = NULL; @@ -123,11 +130,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : reaxc = (PairReaxC *) force->pair_match("^reax/c",0); s_hist = t_hist = NULL; - grow_arrays(atom->nmax); atom->add_callback(0); - for (int i = 0; i < atom->nmax; i++) - for (int j = 0; j < nprev; ++j) - s_hist[i][j] = t_hist[i][j] = 0; } /* ---------------------------------------------------------------------- */ @@ -161,6 +164,13 @@ FixQEqReax::~FixQEqReax() void FixQEqReax::post_constructor() { + if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); + + grow_arrays(atom->nmax); + for (int i = 0; i < atom->nmax; i++) + for (int j = 0; j < nprev; ++j) + s_hist[i][j] = t_hist[i][j] = 0; + pertype_parameters(pertype_option); if (dual_enabled) error->all(FLERR,"Dual keyword only supported with fix qeq/reax/omp"); @@ -287,8 +297,7 @@ void FixQEqReax::reallocate_storage() void FixQEqReax::allocate_matrix() { - int i,ii,inum,m; - int *ilist, *numneigh; + int i,ii,n,m; int mincap; double safezone; @@ -306,18 +315,8 @@ void FixQEqReax::allocate_matrix() // determine the total space for the H matrix - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - } - m = 0; - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < nn; ii++) { i = ilist[ii]; m += numneigh[i]; } @@ -432,6 +431,20 @@ void FixQEqReax::init_taper() void FixQEqReax::setup_pre_force(int vflag) { + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } + deallocate_storage(); allocate_storage(); @@ -495,8 +508,21 @@ void FixQEqReax::pre_force(int /*vflag*/) if (update->ntimestep % nevery) return; if (comm->me == 0) t_start = MPI_Wtime(); - n = atom->nlocal; - N = atom->nlocal + atom->nghost; + int n = atom->nlocal; + + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } // grow arrays if necessary // need to be atom->nmax in length @@ -540,16 +566,7 @@ void FixQEqReax::init_matvec() /* fill-in H matrix */ compute_H(); - int nn, ii, i; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int ii, i; for (ii = 0; ii < nn; ++ii) { i = ilist[ii]; @@ -578,7 +595,7 @@ void FixQEqReax::init_matvec() void FixQEqReax::compute_H() { - int inum, jnum, *ilist, *jlist, *numneigh, **firstneigh; + int jnum; int i, j, ii, jj, flag; double dx, dy, dz, r_sqr; const double SMALL = 0.0001; @@ -588,22 +605,10 @@ void FixQEqReax::compute_H() double **x = atom->x; int *mask = atom->mask; - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - } - // fill in the H matrix m_fill = 0; r_sqr = 0; - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < nn; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { jlist = firstneigh[i]; @@ -621,7 +626,7 @@ void FixQEqReax::compute_H() flag = 0; if (r_sqr <= SQR(swb)) { - if (j < n) flag = 1; + if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { if (dz > SMALL) flag = 1; @@ -676,21 +681,11 @@ double FixQEqReax::calculate_H( double r, double gamma) int FixQEqReax::CG( double *b, double *x) { - int i, j, imax; + int i, j; double tmp, alpha, beta, b_norm; double sig_old, sig_new; - int nn, jj; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; + int jj; pack_flag = 1; sparse_matvec( &H, x, q); @@ -748,18 +743,7 @@ int FixQEqReax::CG( double *b, double *x) void FixQEqReax::sparse_matvec( sparse_matrix *A, double *x, double *b) { int i, j, itr_j; - int nn, NN, ii; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } + int ii; for (ii = 0; ii < nn; ++ii) { i = ilist[ii]; @@ -794,16 +778,7 @@ void FixQEqReax::calculate_Q() double u, s_sum, t_sum; double *q = atom->q; - int nn, ii; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int ii; s_sum = parallel_vector_acc( s, nn); t_sum = parallel_vector_acc( t, nn); @@ -988,12 +963,6 @@ double FixQEqReax::parallel_norm( double *v, int n) double my_sum, norm_sqr; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_sum = 0.0; norm_sqr = 0.0; @@ -1016,12 +985,6 @@ double FixQEqReax::parallel_dot( double *v1, double *v2, int n) double my_dot, res; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_dot = 0.0; res = 0.0; @@ -1044,12 +1007,6 @@ double FixQEqReax::parallel_vector_acc( double *v, int n) double my_acc, res; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_acc = 0.0; res = 0.0; @@ -1070,12 +1027,6 @@ void FixQEqReax::vector_sum( double* dest, double c, double* v, double d, double* y, int k) { int kk; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; for (--k; k>=0; --k) { kk = ilist[k]; @@ -1089,12 +1040,6 @@ void FixQEqReax::vector_sum( double* dest, double c, double* v, void FixQEqReax::vector_add( double* dest, double c, double* v, int k) { int kk; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; for (--k; k>=0; --k) { kk = ilist[k]; @@ -1102,3 +1047,4 @@ void FixQEqReax::vector_add( double* dest, double c, double* v, int k) dest[kk] += c * v[kk]; } } + diff --git a/src/USER-REAXC/fix_qeq_reax.h b/src/USER-REAXC/fix_qeq_reax.h index 96a174b90..5658167ac 100644 --- a/src/USER-REAXC/fix_qeq_reax.h +++ b/src/USER-REAXC/fix_qeq_reax.h @@ -57,12 +57,13 @@ class FixQEqReax : public Fix { protected: int nevery,reaxflag; - int n, N, m_fill; + int nn, NN, m_fill; int n_cap, nmax, m_cap; int pack_flag; int nlevels_respa; class NeighList *list; class PairReaxC *reaxc; + int *ilist, *jlist, *numneigh, **firstneigh; double swa, swb; // lower/upper Taper cutoff radius double Tap[8]; // Taper function @@ -94,6 +95,7 @@ class FixQEqReax : public Fix { //CG storage double *p, *q, *r, *d; + int imax; //GMRES storage //double *g,*y; -- GitLab From 1273179d03941f43505ead10354518edb12f852e Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 8 Sep 2020 13:42:25 -0600 Subject: [PATCH 02/52] Fix compile error --- src/USER-REAXC/fix_qeq_reax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 28270b562..8e6e11486 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -85,7 +85,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg],"imax") == 0) { if (iarg+1 > narg-1) error->all(FLERR,"Illegal fix qeq/reax command"); - imax = force->numeric(FLERR,arg[iarg+1]); + imax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg++; } else error->all(FLERR,"Illegal fix qeq/reax command"); iarg++; -- GitLab From 3d37fd05f4bedbc01dfaf210efbcfc9c9b4de797 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 10 Sep 2020 16:14:18 -0400 Subject: [PATCH 03/52] disable caching - for now - to avoid bad side effects from sphinx-tabs --- doc/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index d96b52391..61875cbaa 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -41,7 +41,10 @@ HAS_PDFLATEX = YES endif -SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E") +#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E") + +# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works +SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') # grab list of sources from doxygen config file. # we only want to use explicitly listed files. -- GitLab From 0d5f68bc309c2ac145a6a51f99f0e3fb278f6ed8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 10 Sep 2020 16:14:53 -0400 Subject: [PATCH 04/52] make "new in" and "changed in" leads boldface --- doc/utils/sphinx-config/_static/css/lammps.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/utils/sphinx-config/_static/css/lammps.css b/doc/utils/sphinx-config/_static/css/lammps.css index d2aa8a975..2efb1246b 100644 --- a/doc/utils/sphinx-config/_static/css/lammps.css +++ b/doc/utils/sphinx-config/_static/css/lammps.css @@ -14,3 +14,7 @@ display: block; margin-bottom: 0.405em; } + +.versionmodified { + font-weight: bold; +} -- GitLab From 4452109b60696c08da1482d6dfa750145cd92739 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 10 Sep 2020 16:15:03 -0400 Subject: [PATCH 05/52] address spelling issue --- doc/utils/sphinx-config/false_positives.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index e3cf7b78c..b13d7a3ff 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1003,6 +1003,7 @@ formatarg formulae Forschungszentrum Fortran +fortran Fosado fourier fp -- GitLab From ded57ba7495de6f7efccc8ee14fa92be722c8061 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 10 Sep 2020 16:16:58 -0400 Subject: [PATCH 06/52] move test to avoid issues with indentation from having tabs follow directly a list-table --- doc/src/Build_extras.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 79e38ab2b..7d778ada3 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -373,8 +373,8 @@ More information on Kokkos can be found on the Available Architecture settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -These are the possible choices for the Kokkos architecture ID as of -version 3.2 of the Kokkos library. They must be specified in uppercase. +These are the possible choices for the Kokkos architecture ID. +They must be specified in uppercase. .. list-table:: :header-rows: 0 @@ -486,6 +486,8 @@ version 3.2 of the Kokkos library. They must be specified in uppercase. - GPU - Intel GPUs Gen9+ +This list was last updated for version 3.2 of the Kokkos library. + .. tabs:: .. tab:: Basic CMake build settings: -- GitLab From 612f1d7ce3aab4be067c9047c934d728523acc17 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 11 Sep 2020 17:49:06 -0400 Subject: [PATCH 07/52] fix typo --- doc/src/Build_settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index d8ac39a0c..600bd084e 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -228,9 +228,9 @@ LAMMPS system size restrictions - :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`) - :math:`2^{31}` steps (= :math:`2.147 \cdot 10^9`) * - Atom ID values - - :math:`1 \le i \le 2^{31} (= 2.147 \dot 10^9)` + - :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)` - :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})` - - :math:`1 \le i \le 2^{31} (= 2.147 \dot 10^9)` + - :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)` * - Image flag values - :math:`-512 \le i \le 511` - :math:`- 1\,048\,576 \le i \le 1\,048\,575` -- GitLab From bc1b876a3d72f12a010ef29e5be21a8356c6c9cd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 11 Sep 2020 19:29:17 -0400 Subject: [PATCH 08/52] make fix widom errors and test output consistent with the fix name capitalization --- src/MC/fix_widom.cpp | 76 ++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 94b248174..6055ae844 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -62,10 +62,10 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), random_equal(NULL) { - if (narg < 8) error->all(FLERR,"Illegal fix Widom command"); + if (narg < 8) error->all(FLERR,"Illegal fix widom command"); if (atom->molecular == 2) - error->all(FLERR,"Fix Widom does not (yet) work with atom_style template"); + error->all(FLERR,"Fix widom does not (yet) work with atom_style template"); dynamic_group_allow = 1; @@ -86,11 +86,11 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : seed = utils::inumeric(FLERR,arg[6],false,lmp); insertion_temperature = utils::numeric(FLERR,arg[7],false,lmp); - if (nevery <= 0) error->all(FLERR,"Illegal fix Widom command"); - if (ninsertions < 0) error->all(FLERR,"Illegal fix Widom command"); - if (seed <= 0) error->all(FLERR,"Illegal fix Widom command"); + if (nevery <= 0) error->all(FLERR,"Illegal fix widom command"); + if (ninsertions < 0) error->all(FLERR,"Illegal fix widom command"); + if (seed <= 0) error->all(FLERR,"Illegal fix widom command"); if (insertion_temperature < 0.0) - error->all(FLERR,"Illegal fix Widom command"); + error->all(FLERR,"Illegal fix widom command"); // read options from end of input line @@ -106,9 +106,9 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : region_zlo = region_zhi = 0.0; if (regionflag) { if (domain->regions[iregion]->bboxflag == 0) - error->all(FLERR,"Fix Widom region does not support a bounding box"); + error->all(FLERR,"Fix widom region does not support a bounding box"); if (domain->regions[iregion]->dynamic_check()) - error->all(FLERR,"Fix Widom region cannot be dynamic"); + error->all(FLERR,"Fix widom region cannot be dynamic"); region_xlo = domain->regions[iregion]->extent_xlo; region_xhi = domain->regions[iregion]->extent_xhi; @@ -120,7 +120,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (region_xlo < domain->boxlo[0] || region_xhi > domain->boxhi[0] || region_ylo < domain->boxlo[1] || region_yhi > domain->boxhi[1] || region_zlo < domain->boxlo[2] || region_zhi > domain->boxhi[2]) - error->all(FLERR,"Fix Widom region extends outside simulation box"); + error->all(FLERR,"Fix widom region extends outside simulation box"); // estimate region volume using MC trials @@ -146,22 +146,22 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (exchmode == EXCHMOL) { if (onemols[imol]->xflag == 0) - error->all(FLERR,"Fix Widom molecule must have coordinates"); + error->all(FLERR,"Fix widom molecule must have coordinates"); if (onemols[imol]->typeflag == 0) - error->all(FLERR,"Fix Widom molecule must have atom types"); + error->all(FLERR,"Fix widom molecule must have atom types"); if (nwidom_type != 0) - error->all(FLERR,"Atom type must be zero in fix Widom mol command"); + error->all(FLERR,"Atom type must be zero in fix widom mol command"); if (onemols[imol]->qflag == 1 && atom->q == NULL) - error->all(FLERR,"Fix Widom molecule has charges, but atom style does not"); + error->all(FLERR,"Fix widom molecule has charges, but atom style does not"); if (atom->molecular == 2 && onemols != atom->avec->onemols) - error->all(FLERR,"Fix Widom molecule template ID must be same " + error->all(FLERR,"Fix widom molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); } if (charge_flag && atom->q == NULL) - error->all(FLERR,"Fix Widom atom has charge, but atom style does not"); + error->all(FLERR,"Fix widom atom has charge, but atom style does not"); // setup of array of coordinates for molecule insertion @@ -186,7 +186,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : void FixWidom::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal fix Widom command"); + if (narg < 0) error->all(FLERR,"Illegal fix widom command"); // defaults @@ -208,29 +208,29 @@ void FixWidom::options(int narg, char **arg) int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"mol") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); imol = atom->find_molecule(arg[iarg+1]); if (imol == -1) - error->all(FLERR,"Molecule template ID for fix Widom does not exist"); + error->all(FLERR,"Molecule template ID for fix widom does not exist"); if (atom->molecules[imol]->nset > 1 && comm->me == 0) error->warning(FLERR,"Molecule template for " - "fix Widom has multiple molecules"); + "fix widom has multiple molecules"); exchmode = EXCHMOL; onemols = atom->molecules; nmol = onemols[imol]->nset; iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) - error->all(FLERR,"Region ID for fix Widom does not exist"); + error->all(FLERR,"Region ID for fix widom does not exist"); int n = strlen(arg[iarg+1]) + 1; idregion = new char[n]; strcpy(idregion,arg[iarg+1]); regionflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; @@ -238,10 +238,10 @@ void FixWidom::options(int narg, char **arg) full_flag = true; iarg += 1; } else if (strcmp(arg[iarg],"intra_energy") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else error->all(FLERR,"Illegal fix Widom command"); + } else error->all(FLERR,"Illegal fix widom command"); } } @@ -291,7 +291,7 @@ void FixWidom::init() ) { full_flag = true; if (comm->me == 0) - error->warning(FLERR,"Fix Widom using full_energy option"); + error->warning(FLERR,"Fix widom using full_energy option"); } } @@ -299,7 +299,7 @@ void FixWidom::init() if (exchmode == EXCHATOM) { if (nwidom_type <= 0 || nwidom_type > atom->ntypes) - error->all(FLERR,"Invalid atom type in fix Widom command"); + error->all(FLERR,"Invalid atom type in fix widom command"); } // if molecules are exchanged or moved, check for unset mol IDs @@ -314,17 +314,17 @@ void FixWidom::init() MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall && comm->me == 0) error->all(FLERR, - "All mol IDs should be set for fix Widom group atoms"); + "All mol IDs should be set for fix widom group atoms"); } if (exchmode == EXCHMOL) if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style) error->all(FLERR, - "Fix Widom molecule command requires that " + "Fix widom molecule command requires that " "atoms have molecule attributes"); if (domain->dimension == 2) - error->all(FLERR,"Cannot use fix Widom in a 2d simulation"); + error->all(FLERR,"Cannot use fix widom in a 2d simulation"); // create a new group for interaction exclusions // used for attempted atom or molecule deletions @@ -387,7 +387,7 @@ void FixWidom::init() } else gas_mass = atom->mass[nwidom_type]; if (gas_mass <= 0.0) - error->all(FLERR,"Illegal fix Widom gas mass <= 0"); + error->all(FLERR,"Illegal fix widom gas mass <= 0"); // check that no deletable atoms are in atom->firstgroup // deleting such an atom would not leave firstgroup atoms first @@ -404,7 +404,7 @@ void FixWidom::init() MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall) - error->all(FLERR,"Cannot do Widom on atoms in atom_modify first group"); + error->all(FLERR,"Cannot use fix widom on atoms in atom_modify first group"); } // compute beta @@ -417,7 +417,7 @@ void FixWidom::init() // full_flag on molecules on more than one processor. // Print error if this is the current mode if (full_flag && (exchmode == EXCHMOL) && comm->nprocs > 1) - error->all(FLERR,"fix Widom does currently not support full_energy option with molecules on more than 1 MPI process."); + error->all(FLERR,"fix widom does currently not support full_energy option with molecules on more than 1 MPI process."); } @@ -535,7 +535,7 @@ void FixWidom::attempt_atomic_insertion() if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; @@ -648,7 +648,7 @@ void FixWidom::attempt_molecule_insertion() xtmp[2] = molcoords[i][2]; domain->remap(xtmp); if (!domain->inside(xtmp)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); procflag[i] = false; if (triclinic == 0) { @@ -737,7 +737,7 @@ void FixWidom::attempt_atomic_insertion_full() if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; @@ -803,7 +803,7 @@ void FixWidom::attempt_molecule_insertion_full() MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); maxmol_all++; if (maxmol_all >= MAXTAGINT) - error->all(FLERR,"Fix Widom ran out of available molecule IDs"); + error->all(FLERR,"Fix widom ran out of available molecule IDs"); int insertion_molecule = maxmol_all; tagint maxtag = 0; @@ -883,7 +883,7 @@ void FixWidom::attempt_molecule_insertion_full() imageint imagetmp = imagezero; domain->remap(xtmp,imagetmp); if (!domain->inside(xtmp)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); int proc_flag = 0; if (triclinic == 0) { @@ -904,7 +904,7 @@ void FixWidom::attempt_molecule_insertion_full() atom->image[m] = imagetmp; atom->molecule[m] = insertion_molecule; if (maxtag_all+i+1 >= MAXTAGINT) - error->all(FLERR,"Fix Widom ran out of available atom IDs"); + error->all(FLERR,"Fix widom ran out of available atom IDs"); atom->tag[m] = maxtag_all + i + 1; atom->v[m][0] = 0; atom->v[m][1] = 0; -- GitLab From 4a8d6016e412049e012359310c7d7da37478547c Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 11 Sep 2020 22:49:44 -0600 Subject: [PATCH 09/52] Update docs --- doc/src/fix_qeq_reax.rst | 8 ++++++-- src/USER-REAXC/fix_qeq_reax.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/fix_qeq_reax.rst b/doc/src/fix_qeq_reax.rst index 47dca8640..512c596b4 100644 --- a/doc/src/fix_qeq_reax.rst +++ b/doc/src/fix_qeq_reax.rst @@ -21,6 +21,7 @@ Syntax * tolerance = precision to which charges will be equilibrated * params = reax/c or a filename * args = *dual* (optional) +* args = *maxiter value* (optional) Examples """""""" @@ -28,7 +29,7 @@ Examples .. code-block:: LAMMPS fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c - fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq + fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq maxiter 500 Description """"""""""" @@ -69,6 +70,9 @@ The optional *dual* keyword allows to perform the optimization of the S and T matrices in parallel. This is only supported for the *qeq/reax/omp* style. Otherwise they are processed separately. +The optional *maxiter* keyword allows changing the max number +of iterations in the linear solver. The default value is 200. + Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -102,7 +106,7 @@ Related commands Default """"""" -none +maxiter 200 ---------- diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 8e6e11486..fea8b39f5 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -82,7 +82,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : int iarg = 8; while (iarg < narg) { if (strcmp(arg[iarg],"dual") == 0) dual_enabled = 1; - else if (strcmp(arg[iarg],"imax") == 0) { + else if (strcmp(arg[iarg],"maxiter") == 0) { if (iarg+1 > narg-1) error->all(FLERR,"Illegal fix qeq/reax command"); imax = utils::numeric(FLERR,arg[iarg+1],false,lmp); -- GitLab From 16d2fef5ade6c17ee5efccc80c1cb9a08db54761 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 11:06:20 -0400 Subject: [PATCH 10/52] add check that shrinkwrap boundaries are not use when reading a data file while a MSM kspace style is defined --- src/read_data.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 2a6801b3a..c80432f09 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -294,8 +294,11 @@ void ReadData::command(int narg, char **arg) // error checks - if (domain->dimension == 2 && domain->zperiodic == 0) + if ((domain->dimension == 2) && (domain->zperiodic == 0)) error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension"); + if ((domain->nonperiodic == 2) && utils::strmatch(force->kspace_style,"^msm")) + error->all(FLERR,"Reading a data file with shrinkwrap boundaries is " + "not compatible with a MSM KSpace style"); if (domain->box_exist && !addflag) error->all(FLERR,"Cannot read_data without add keyword " "after simulation box is defined"); -- GitLab From d7500c3e5abb9fa4242d4bc9106182b82335f796 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 11:09:33 -0400 Subject: [PATCH 11/52] MSM output format tweaks --- src/KSPACE/msm.cpp | 6 +++--- src/KSPACE/msm_cg.cpp | 2 +- src/USER-OMP/msm_cg_omp.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index d0f4d3868..2b025fbe3 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -206,9 +206,9 @@ void MSM::init() if (me == 0) { std::string mesg = fmt::format(" 3d grid size/proc = {}\n", ngrid_max); - mesg += fmt::format(" estimated absolute RMS force accuracy = {:.8g}\n", + mesg += fmt::format(" estimated absolute RMS force accuracy = {:.8}\n", estimated_error); - mesg += fmt::format(" estimated relative force accuracy = {:.8g}\n", + mesg += fmt::format(" estimated relative force accuracy = {:.8}\n", estimated_error/two_charge_force); mesg += fmt::format(" grid = {} {} {}\n",nx_msm[0],ny_msm[0],nz_msm[0]); mesg += fmt::format(" order = {}\n",order); @@ -1077,7 +1077,7 @@ void MSM::set_grid_global() if (me == 0) error->warning(FLERR,fmt::format("Adjusting Coulombic cutoff for " - "MSM, new cutoff = {}", cutoff)); + "MSM, new cutoff = {:.8}", cutoff)); } if (triclinic == 0) { diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index 79d33b869..bbd940f76 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -133,7 +133,7 @@ void MSMCG::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(lmp,fmt::format(" MSM/cg optimization cutoff: {:.8g}\n" + utils::logmesg(lmp,fmt::format(" MSM/cg optimization cutoff: {:.8}\n" " Total charged atoms: {:.1f}%\n" " Min/max charged atoms/proc: {:.1f}%" " {:.1f}%\n",smallq, diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index c42aa8e0c..976ea8361 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -137,7 +137,7 @@ void MSMCGOMP::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(MSM::lmp,fmt::format(" MSM/cg optimization cutoff: {:.8g}\n" + utils::logmesg(MSM::lmp,fmt::format(" MSM/cg optimization cutoff: {:.8}\n" " Total charged atoms: {:.1f}%\n" " Min/max charged atoms/proc: {:.1f}%" " {:.1f}%\n",smallq, -- GitLab From 3368eb79d843265d1a35570fb4f9965beae5de22 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 11:10:12 -0400 Subject: [PATCH 12/52] fix issue with local variable shadowing a global variable --- src/KSPACE/msm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 2b025fbe3..2634b7633 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -1028,6 +1028,7 @@ void MSM::set_grid_global() int flag = 0; int xlevels,ylevels,zlevels; + xlevels = ylevels = zlevels = 1; while (!factorable(nx_max,flag,xlevels)) { double k = log(nx_max)/log(2.0); @@ -1432,16 +1433,15 @@ void MSM::setup_grid() return 1 if yes, 0 if no ------------------------------------------------------------------------- */ -int MSM::factorable(int n, int &flag, int &levels) +int MSM::factorable(int n, int &flag, int &nlevels) { int i; - levels = 1; while (n > 1) { for (i = 0; i < nfactors; i++) { if (n % factors[i] == 0) { n /= factors[i]; - levels++; + nlevels++; break; } } -- GitLab From 69962b4de5b92c656b801e3bb08aaa1efec7b38d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 11:10:38 -0400 Subject: [PATCH 13/52] add test for MSM kspace without periodic boundaries --- .../force-styles/tests/kspace-msm_nopbc.yaml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 unittest/force-styles/tests/kspace-msm_nopbc.yaml diff --git a/unittest/force-styles/tests/kspace-msm_nopbc.yaml b/unittest/force-styles/tests/kspace-msm_nopbc.yaml new file mode 100644 index 000000000..99bbd2ae9 --- /dev/null +++ b/unittest/force-styles/tests/kspace-msm_nopbc.yaml @@ -0,0 +1,90 @@ +--- +lammps_version: 24 Aug 2020 +date_generated: Sat Sep 12 10:33:36 202 +epsilon: 5e-11 +prerequisites: ! | + atom full + pair coul/msm + kspace msm +pre_commands: ! | + boundary f f f +post_commands: ! | + pair_modify compute no + kspace_style msm 1.0e-4 + kspace_modify cutoff/adjust no + kspace_modify pressure/scalar no # required for USER-OMP with msm +input_file: in.fourmol +pair_style: coul/msm 12.0 +pair_coeff: ! | + * * +extract: ! "" +natoms: 29 +init_vdwl: 0 +init_coul: 0 +init_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +init_forces: ! |2 + 1 -1.0766173668302007e-01 3.3042340827626349e-01 -2.9550761278746868e-01 + 2 1.4576263044966863e-02 -2.2187776206184587e-01 2.1317727080129803e-01 + 3 -6.2277085668426338e-03 1.1652138650558974e-02 -1.3297461972937180e-02 + 4 2.8786238443846923e-02 -4.5768542246633188e-02 4.9349101662676420e-02 + 5 4.2979655856763686e-02 -5.4082950850616152e-02 5.4543059350179231e-02 + 6 4.0963202143681071e-02 -2.5177829287287617e-01 4.4685026134973971e-01 + 7 4.3752018459624321e-02 2.0781332786234075e-01 -4.5927449533997905e-01 + 8 1.7902097598623774e-02 2.1086807165304489e-01 -4.6243455927005356e-01 + 9 2.0355019954072114e-03 -1.5827691071752098e-01 2.7862824718724422e-01 + 10 -1.9772220824436811e-02 -2.2139108764682804e-02 7.8260376067917345e-02 + 11 -2.9153388383640691e-02 -2.2889984975802833e-02 1.0317906039578388e-01 + 12 1.2922943535921338e-01 9.7734055402007608e-02 -3.1908212769200051e-01 + 13 -5.4703693507262792e-02 -2.6149394426322036e-02 1.0994484599179440e-01 + 14 -4.2988225876533809e-02 -3.0099007171320122e-02 1.0262933028641755e-01 + 15 -3.7590864461845237e-02 -4.4176544191975885e-02 1.0017383244998040e-01 + 16 -1.9816142648538662e-01 -1.0441860078884198e-01 5.3904854977591932e-01 + 17 1.1181429866686794e-01 1.2719867318944633e-01 -4.3015678280050906e-01 + 18 3.1502200306647382e-01 4.1974825623470402e-01 -6.7479886734843464e-01 + 19 -1.6689905496966348e-01 -1.8680268140244130e-01 3.1219145983138630e-01 + 20 -1.5445789535736368e-01 -1.7976356547462513e-01 3.0246182814337153e-01 + 21 4.5519486932419828e-01 2.3683712353345862e-01 -8.7807403931732608e-01 + 22 -2.2220599724324458e-01 -1.2571032291855247e-01 3.9771867786752363e-01 + 23 -1.9325477274003933e-01 -1.2333786894453987e-01 4.0830652757809321e-01 + 24 -1.8286999844561756e-02 8.1021886775407503e-01 -3.7126337318324748e-01 + 25 5.5726795149239679e-02 -3.9672045025447300e-01 2.0847896698971494e-01 + 26 -2.7814896742372048e-02 -4.2032861857567699e-01 1.8697109800153439e-01 + 27 -5.3163776317893185e-01 2.5116155120314121e-01 -4.1286599443776800e-01 + 28 2.9735002262617338e-01 -1.6009440605268385e-01 2.2070546856483822e-01 + 29 2.5561709605369254e-01 -1.2916627825090182e-01 2.0454030119394306e-01 +run_vdwl: 0 +run_coul: 0 +run_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_forces: ! |2 + 1 -1.0348864007239668e-01 3.2761800817797082e-01 -2.7223154925249687e-01 + 2 1.1547721105281426e-02 -2.2227221129297944e-01 1.9829831292225819e-01 + 3 -6.1369788686855553e-03 1.1473670690755385e-02 -1.2235119385263003e-02 + 4 2.8809534480886322e-02 -4.5070713784827680e-02 4.5263724656363712e-02 + 5 4.2323185781698226e-02 -5.2976717776467216e-02 4.9736627529403242e-02 + 6 3.8194733647326694e-02 -2.4587855825158134e-01 4.1856615868672892e-01 + 7 4.5246314631942265e-02 2.0099417967365288e-01 -4.3512916657147588e-01 + 8 2.2478550451619471e-02 2.0362301286740869e-01 -4.3516590120465981e-01 + 9 -1.4178329999306901e-03 -1.5368030392367521e-01 2.6080100301013964e-01 + 10 -2.0495450209946312e-02 -2.0851530662446178e-02 7.4319850349891012e-02 + 11 -3.0029358892398838e-02 -2.0702279983167187e-02 9.8520949030575691e-02 + 12 1.3289689675296273e-01 9.3775108342107519e-02 -3.0419584939008770e-01 + 13 -5.5922486140088226e-02 -2.4843666409380370e-02 1.0515381624429042e-01 + 14 -4.4208019862361184e-02 -2.8633675987750289e-02 9.8140924300998925e-02 + 15 -3.8534805055538454e-02 -4.3447767456428393e-02 9.5052177465633700e-02 + 16 -2.0197663776900704e-01 -9.6067608908760441e-02 5.1267317994067874e-01 + 17 1.1536172816123620e-01 1.2150176721849106e-01 -4.0576909205923889e-01 + 18 3.2654836490027450e-01 4.3181659922436294e-01 -6.4631937847140064e-01 + 19 -1.7012391318923387e-01 -1.9294196901436866e-01 3.0171461650625692e-01 + 20 -1.6090393021018687e-01 -1.8797301084913640e-01 2.9016061976069074e-01 + 21 4.6464803590088510e-01 2.0966755173124815e-01 -8.4865286121979111e-01 + 22 -2.2714234064511640e-01 -1.1056430229170305e-01 3.8599855632265567e-01 + 23 -1.9865351580467286e-01 -1.1110079780224448e-01 3.9440435138483038e-01 + 24 -1.1755770692492392e-02 7.9361803570205403e-01 -3.4523386783293764e-01 + 25 5.0411795551073120e-02 -3.8916839645964540e-01 1.9278646898979940e-01 + 26 -2.9733815594164319e-02 -4.1142305819442143e-01 1.7495936527287648e-01 + 27 -5.2243746980854566e-01 2.4806539986837281e-01 -3.8666209074075969e-01 + 28 2.9308687168280761e-01 -1.5702803664966208e-01 2.0612286277862657e-01 + 29 2.5153793410884945e-01 -1.2745488321867574e-01 1.8930202039662150e-01 +... -- GitLab From f1ef7d85a89f4ac382b0634f752719357cf28870 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 07:39:46 -0600 Subject: [PATCH 14/52] =?UTF-8?q?T2345:=20Replace=20instances=20of=20NULL?= =?UTF-8?q?=20with=20nullptr=20The=20following=20changes=20have=20been=20a?= =?UTF-8?q?pplied=20to=20src=20and=20lib=20folders:=20regex=20replace:=20(?= =?UTF-8?q?[^"=5F])NULL=20=E2=87=92=20\1nullptr=20(8968=20chgs=20in=20src,?= =?UTF-8?q?=201153=20in=20lib)=20Manually=20find/change:=20(void=20\*)=20n?= =?UTF-8?q?ullptr=20=E2=87=92=20nullptr=20(1=20case)=20regex=20find:=20".*?= =?UTF-8?q?=3Fnullptr.*=3F"=20=20=20Manually=20~14=20cases=20back=20to=20"?= =?UTF-8?q?NULL"=20in=20src,=20~2=20in=20lib=20=20=20regex=20finds=20a=20f?= =?UTF-8?q?ew=20false=20positive=20where=20nullptr=20appears=20between=20t?= =?UTF-8?q?wo=20=20=20strings=20in=20a=20function=20call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/atc/ATC_Coupling.cpp | 50 +-- lib/atc/ATC_Coupling.h | 24 +- lib/atc/ATC_CouplingEnergy.cpp | 6 +- lib/atc/ATC_CouplingMomentumEnergy.cpp | 6 +- lib/atc/ATC_Method.cpp | 52 +-- lib/atc/ATC_Method.h | 2 +- lib/atc/ATC_Transfer.cpp | 22 +- lib/atc/Array.h | 28 +- lib/atc/Array2D.h | 20 +- lib/atc/AtomicRegulator.cpp | 36 +- lib/atc/AtomicRegulator.h | 2 +- lib/atc/CauchyBorn.cpp | 2 +- lib/atc/ChargeRegulator.cpp | 2 +- lib/atc/CloneVector.h | 6 +- lib/atc/ConcentrationRegulator.cpp | 8 +- lib/atc/DenseMatrix.h | 12 +- lib/atc/DenseVector.h | 8 +- lib/atc/DiagonalMatrix.h | 6 +- lib/atc/DislocationExtractor.h | 16 +- lib/atc/ElasticTimeIntegrator.cpp | 10 +- lib/atc/ElectronHeatFlux.h | 10 +- lib/atc/ExtrinsicModel.cpp | 6 +- lib/atc/ExtrinsicModelDriftDiffusion.cpp | 10 +- lib/atc/ExtrinsicModelElectrostatic.cpp | 10 +- lib/atc/ExtrinsicModelTwoTemperature.cpp | 4 +- lib/atc/FE_Element.cpp | 2 +- lib/atc/FE_Engine.cpp | 2 +- lib/atc/FE_Engine.h | 22 +- lib/atc/FE_Mesh.cpp | 12 +- lib/atc/FieldEulerIntegrator.cpp | 2 +- lib/atc/FieldManager.cpp | 2 +- lib/atc/FieldManager.h | 14 +- lib/atc/Function.cpp | 12 +- lib/atc/FundamentalAtomicQuantity.cpp | 2 +- lib/atc/FundamentalAtomicQuantity.h | 4 +- lib/atc/GhostManager.cpp | 26 +- lib/atc/InterscaleOperators.cpp | 8 +- lib/atc/InterscaleOperators.h | 4 +- lib/atc/KD_Tree.cpp | 14 +- lib/atc/KernelFunction.cpp | 6 +- lib/atc/KinetoThermostat.cpp | 48 +-- lib/atc/Kinetostat.cpp | 44 +-- lib/atc/LammpsInterface.cpp | 38 +-- lib/atc/LammpsInterface.h | 2 +- lib/atc/LinearSolver.cpp | 16 +- lib/atc/LinearSolver.h | 4 +- lib/atc/Material.cpp | 36 +- lib/atc/MoleculeSet.h | 8 +- lib/atc/NonLinearSolver.h | 2 +- lib/atc/OutputManager.cpp | 24 +- lib/atc/OutputManager.h | 6 +- lib/atc/PaqAtcUtility.cpp | 2 +- lib/atc/ParDenseMatrix.h | 2 +- lib/atc/ParSparseMatrix.cpp | 8 +- lib/atc/ParSparseMatrix.h | 6 +- lib/atc/PerAtomQuantity-inl.h | 10 +- lib/atc/PerAtomQuantity.h | 8 +- lib/atc/PerAtomQuantityLibrary.h | 130 +++---- lib/atc/PerPairQuantity.cpp | 2 +- lib/atc/PhysicsModel.h | 2 +- lib/atc/PoissonSolver.cpp | 6 +- lib/atc/PrescribedDataManager.cpp | 26 +- lib/atc/Quadrature.cpp | 6 +- lib/atc/SchrodingerSolver.cpp | 2 +- lib/atc/SparseMatrix-inl.h | 16 +- lib/atc/SparseVector.h | 2 +- lib/atc/SpeciesTimeIntegrator.cpp | 4 +- lib/atc/SpeciesTimeIntegrator.h | 2 +- lib/atc/Stress.cpp | 6 +- lib/atc/Stress.h | 2 +- lib/atc/ThermalTimeIntegrator.cpp | 4 +- lib/atc/Thermostat.cpp | 56 +-- lib/atc/TimeFilter.cpp | 2 +- lib/atc/TimeIntegrator.cpp | 12 +- lib/atc/TransferLibrary.cpp | 10 +- lib/atc/TransferLibrary.h | 34 +- lib/atc/TransferOperator.h | 6 +- lib/atc/Utility.h | 2 +- lib/awpmd/ivutils/include/logexc.h | 8 +- lib/awpmd/ivutils/include/pairhash.h | 28 +- lib/awpmd/ivutils/include/refobj.h | 20 +- lib/awpmd/ivutils/include/vector_3.h | 14 +- lib/awpmd/ivutils/src/logexc.cpp | 2 +- lib/awpmd/systems/interact/TCP/wpmd.h | 20 +- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 4 +- lib/awpmd/systems/interact/TCP/wpmd_split.h | 16 +- lib/colvars/colvar.cpp | 20 +- lib/colvars/colvaratoms.cpp | 8 +- lib/colvars/colvarbias.cpp | 26 +- lib/colvars/colvarbias.h | 4 +- lib/colvars/colvarbias_abf.cpp | 42 +-- lib/colvars/colvarbias_histogram.cpp | 4 +- lib/colvars/colvarbias_meta.cpp | 46 +-- lib/colvars/colvarcomp.cpp | 8 +- lib/colvars/colvarcomp_coordnums.cpp | 38 +-- lib/colvars/colvarcomp_distances.cpp | 2 +- lib/colvars/colvardeps.cpp | 2 +- lib/colvars/colvargrid.cpp | 14 +- lib/colvars/colvarmodule.cpp | 60 ++-- lib/colvars/colvarmodule.h | 6 +- lib/colvars/colvarparams.cpp | 6 +- lib/colvars/colvarparse.cpp | 10 +- lib/colvars/colvarparse.h | 8 +- lib/colvars/colvarproxy.cpp | 16 +- lib/colvars/colvarproxy.h | 2 +- lib/colvars/colvarscript.cpp | 20 +- lib/colvars/colvarscript.h | 2 +- lib/colvars/colvartypes.h | 4 +- lib/colvars/lepton/include/lepton/Operation.h | 12 +- lib/colvars/lepton/src/CompiledExpression.cpp | 8 +- lib/colvars/lepton/src/ExpressionTreeNode.cpp | 8 +- lib/colvars/lepton/src/ParsedExpression.cpp | 2 +- lib/gpu/cudpp_mini/cudpp.cpp | 14 +- lib/gpu/cudpp_mini/cudpp_plan.cpp | 2 +- lib/gpu/cudpp_mini/cudpp_plan_manager.cpp | 22 +- lib/gpu/cudpp_mini/cutil.h | 20 +- lib/gpu/geryon/hip_device.h | 4 +- lib/gpu/geryon/hip_kernel.h | 8 +- lib/gpu/geryon/hip_memory.h | 6 +- lib/gpu/geryon/hip_texture.h | 2 +- lib/gpu/geryon/nvd_kernel.h | 10 +- lib/gpu/geryon/nvd_memory.h | 6 +- lib/gpu/geryon/nvd_texture.h | 2 +- lib/gpu/geryon/ocl_device.h | 40 +-- lib/gpu/geryon/ocl_kernel.h | 26 +- lib/gpu/geryon/ocl_memory.h | 78 ++--- lib/gpu/geryon/ocl_timer.h | 6 +- lib/gpu/geryon/ucl_basemat.h | 4 +- lib/gpu/geryon/ucl_d_vec.h | 2 +- lib/gpu/lal_answer.cpp | 14 +- lib/gpu/lal_base_atomic.cpp | 10 +- lib/gpu/lal_base_charge.cpp | 10 +- lib/gpu/lal_base_dipole.cpp | 10 +- lib/gpu/lal_base_dpd.cpp | 10 +- lib/gpu/lal_base_ellipsoid.cpp | 16 +- lib/gpu/lal_base_three.cpp | 10 +- lib/gpu/lal_base_three.h | 2 +- lib/gpu/lal_device.cpp | 18 +- lib/gpu/lal_eam.cpp | 6 +- lib/gpu/lal_lj_tip4p_long.cpp | 4 +- lib/gpu/lal_neighbor.cpp | 2 +- lib/gpu/lal_pppm.cpp | 2 +- lib/gpu/lal_pppm_ext.cpp | 6 +- lib/gpu/lal_yukawa_colloid.cpp | 4 +- lib/kokkos/cmake/compile_tests/pthread.cpp | 6 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp | 2 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 2 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 2 +- lib/kokkos/core/unit_test/TestCTestDevice.cpp | 2 +- lib/message/cslib/src/STUBS_ZMQ/zmq.h | 6 +- lib/message/cslib/src/cslib.cpp | 28 +- lib/message/cslib/src/cslib_wrap.cpp | 2 +- lib/message/cslib/src/msg.cpp | 6 +- lib/message/cslib/src/msg_mpi_two.cpp | 2 +- lib/message/cslib/src/msg_zmq.cpp | 8 +- lib/molfile/molfile_plugin.h | 32 +- lib/poems/SystemProcessor.h | 30 +- lib/poems/poemsnodelib.h | 20 +- lib/poems/poemstree.h | 62 ++-- lib/poems/poemstreenode.cpp | 2 +- lib/poems/poemstreenode.h | 2 +- lib/poems/solver.cpp | 2 +- lib/poems/system.cpp | 10 +- lib/poems/workspace.cpp | 6 +- src/ASPHERE/compute_temp_asphere.cpp | 4 +- src/ASPHERE/pair_gayberne.cpp | 24 +- src/ASPHERE/pair_line_lj.cpp | 4 +- src/ASPHERE/pair_resquared.cpp | 16 +- src/ASPHERE/pair_tri_lj.cpp | 4 +- src/BODY/body_nparticle.cpp | 4 +- src/BODY/body_rounded_polygon.cpp | 2 +- src/BODY/body_rounded_polyhedron.cpp | 4 +- src/BODY/compute_body_local.cpp | 6 +- src/BODY/compute_temp_body.cpp | 4 +- src/BODY/fix_wall_body_polygon.cpp | 14 +- src/BODY/fix_wall_body_polyhedron.cpp | 18 +- src/BODY/pair_body_nparticle.cpp | 4 +- src/BODY/pair_body_rounded_polygon.cpp | 16 +- src/BODY/pair_body_rounded_polyhedron.cpp | 32 +- src/CLASS2/angle_class2.cpp | 26 +- src/CLASS2/bond_class2.cpp | 10 +- src/CLASS2/dihedral_class2.cpp | 78 ++--- src/CLASS2/improper_class2.cpp | 18 +- src/CLASS2/pair_lj_class2.cpp | 20 +- src/CLASS2/pair_lj_class2_coul_cut.cpp | 22 +- src/CLASS2/pair_lj_class2_coul_long.cpp | 32 +- src/COLLOID/pair_brownian.cpp | 32 +- src/COLLOID/pair_brownian_poly.cpp | 2 +- src/COLLOID/pair_colloid.cpp | 18 +- src/COLLOID/pair_lubricate.cpp | 26 +- src/COLLOID/pair_lubricateU.cpp | 28 +- src/COLLOID/pair_lubricateU_poly.cpp | 2 +- src/COLLOID/pair_lubricate_poly.cpp | 4 +- src/COMPRESS/dump_atom_gz.cpp | 12 +- src/COMPRESS/dump_cfg_gz.cpp | 12 +- src/COMPRESS/dump_custom_gz.cpp | 12 +- src/COMPRESS/dump_local_gz.cpp | 12 +- src/COMPRESS/dump_xyz_gz.cpp | 12 +- src/CORESHELL/compute_temp_cs.cpp | 4 +- src/CORESHELL/pair_born_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_buck_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_lj_class2_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_lj_cut_coul_long_cs.cpp | 2 +- src/DIPOLE/pair_lj_cut_dipole_cut.cpp | 18 +- src/DIPOLE/pair_lj_cut_dipole_long.cpp | 20 +- src/DIPOLE/pair_lj_long_dipole_long.cpp | 32 +- src/GPU/fix_gpu.cpp | 4 +- src/GPU/pair_born_coul_long_cs_gpu.cpp | 2 +- src/GPU/pair_born_coul_long_gpu.cpp | 2 +- src/GPU/pair_buck_coul_long_gpu.cpp | 2 +- src/GPU/pair_colloid_gpu.cpp | 2 +- src/GPU/pair_coul_long_cs_gpu.cpp | 4 +- src/GPU/pair_coul_long_gpu.cpp | 4 +- src/GPU/pair_eam_alloy_gpu.cpp | 4 +- src/GPU/pair_eam_alloy_gpu.h | 2 +- src/GPU/pair_eam_fs_gpu.cpp | 4 +- src/GPU/pair_eam_fs_gpu.h | 2 +- src/GPU/pair_eam_gpu.cpp | 2 +- src/GPU/pair_eam_gpu.h | 2 +- src/GPU/pair_gayberne_gpu.cpp | 2 +- src/GPU/pair_lj96_cut_gpu.cpp | 2 +- src/GPU/pair_lj_charmm_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_class2_coul_long_gpu.cpp | 2 +- src/GPU/pair_lj_cut_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_cut_coul_msm_gpu.cpp | 2 +- src/GPU/pair_lj_cut_dipole_long_gpu.cpp | 4 +- src/GPU/pair_lj_cut_gpu.cpp | 2 +- src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 8 +- src/GPU/pair_lj_expand_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_sdk_coul_long_gpu.cpp | 4 +- src/GPU/pair_mie_cut_gpu.cpp | 2 +- src/GPU/pair_resquared_gpu.cpp | 2 +- src/GPU/pair_sw_gpu.cpp | 8 +- src/GPU/pair_table_gpu.cpp | 4 +- src/GPU/pair_tersoff_gpu.cpp | 12 +- src/GPU/pair_tersoff_mod_gpu.cpp | 12 +- src/GPU/pair_tersoff_zbl_gpu.cpp | 12 +- src/GPU/pair_ufm_gpu.cpp | 2 +- src/GPU/pair_vashishta_gpu.cpp | 12 +- src/GPU/pppm_gpu.cpp | 10 +- src/GRANULAR/fix_pour.cpp | 24 +- src/GRANULAR/fix_wall_gran.cpp | 18 +- src/GRANULAR/fix_wall_gran.h | 2 +- src/GRANULAR/fix_wall_gran_region.cpp | 16 +- src/GRANULAR/pair_gran_hooke_history.cpp | 22 +- src/GRANULAR/pair_gran_hooke_history.h | 2 +- src/GRANULAR/pair_granular.cpp | 40 +-- src/GRANULAR/pair_granular.h | 2 +- src/KIM/fix_store_kim.cpp | 14 +- src/KIM/fix_store_kim.h | 4 +- src/KIM/kim_init.cpp | 8 +- src/KIM/kim_interactions.cpp | 10 +- src/KIM/kim_param.cpp | 12 +- src/KIM/kim_property.cpp | 4 +- src/KIM/pair_kim.cpp | 44 +-- src/KOKKOS/atom_kokkos.cpp | 12 +- src/KOKKOS/atom_vec_angle_kokkos.cpp | 2 +- src/KOKKOS/atom_vec_kokkos.cpp | 2 +- src/KOKKOS/comm_kokkos.cpp | 14 +- src/KOKKOS/fft3d_kokkos.cpp | 52 +-- src/KOKKOS/fix_langevin_kokkos.cpp | 26 +- src/KOKKOS/fix_minimize_kokkos.cpp | 2 +- src/KOKKOS/fix_neigh_history_kokkos.cpp | 6 +- src/KOKKOS/fix_nve_kokkos.cpp | 4 +- src/KOKKOS/fix_nve_sphere_kokkos.cpp | 4 +- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 2 +- src/KOKKOS/fix_reaxc_bonds_kokkos.cpp | 2 +- src/KOKKOS/fix_reaxc_species_kokkos.cpp | 2 +- src/KOKKOS/fix_rx_kokkos.cpp | 12 +- src/KOKKOS/fix_rx_kokkos.h | 2 +- src/KOKKOS/fix_setforce_kokkos.cpp | 4 +- src/KOKKOS/fix_shardlow_kokkos.cpp | 8 +- src/KOKKOS/gridcomm_kokkos.cpp | 14 +- src/KOKKOS/kokkos.cpp | 2 +- src/KOKKOS/memory_kokkos.h | 26 +- src/KOKKOS/min_kokkos.cpp | 2 +- src/KOKKOS/neighbor_kokkos.cpp | 10 +- src/KOKKOS/pair_buck_coul_cut_kokkos.cpp | 16 +- src/KOKKOS/pair_buck_coul_long_kokkos.cpp | 24 +- src/KOKKOS/pair_buck_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_cut_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_debye_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_long_kokkos.cpp | 16 +- src/KOKKOS/pair_eam_alloy_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_alloy_kokkos.h | 2 +- src/KOKKOS/pair_eam_fs_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_fs_kokkos.h | 2 +- src/KOKKOS/pair_eam_kokkos.h | 2 +- src/KOKKOS/pair_exp6_rx_kokkos.cpp | 12 +- src/KOKKOS/pair_gran_hooke_history_kokkos.cpp | 6 +- src/KOKKOS/pair_hybrid_kokkos.cpp | 2 +- src/KOKKOS/pair_kokkos.h | 2 +- ..._lj_charmm_coul_charmm_implicit_kokkos.cpp | 16 +- .../pair_lj_charmm_coul_charmm_kokkos.cpp | 16 +- .../pair_lj_charmm_coul_long_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp | 16 +- .../pair_lj_class2_coul_long_kokkos.cpp | 14 +- src/KOKKOS/pair_lj_class2_kokkos.cpp | 10 +- src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp | 18 +- src/KOKKOS/pair_lj_cut_kokkos.cpp | 14 +- src/KOKKOS/pair_lj_expand_kokkos.cpp | 10 +- .../pair_lj_gromacs_coul_gromacs_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_gromacs_kokkos.cpp | 26 +- src/KOKKOS/pair_lj_sdk_kokkos.cpp | 10 +- src/KOKKOS/pair_morse_kokkos.cpp | 14 +- src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 4 +- src/KOKKOS/pair_reaxc_kokkos.cpp | 6 +- src/KOKKOS/pair_sw_kokkos.cpp | 4 +- src/KOKKOS/pair_table_kokkos.cpp | 10 +- src/KOKKOS/pair_table_rx_kokkos.cpp | 10 +- src/KOKKOS/pair_vashishta_kokkos.cpp | 4 +- src/KOKKOS/pair_yukawa_kokkos.cpp | 14 +- src/KOKKOS/pair_zbl_kokkos.cpp | 12 +- src/KOKKOS/pppm_kokkos.cpp | 52 +-- src/KOKKOS/rand_pool_wrap_kokkos.cpp | 4 +- src/KOKKOS/rand_pool_wrap_kokkos.h | 2 +- src/KOKKOS/remap_kokkos.cpp | 26 +- src/KSPACE/ewald.cpp | 24 +- src/KSPACE/ewald_dipole.cpp | 8 +- src/KSPACE/ewald_dipole_spin.cpp | 2 +- src/KSPACE/ewald_disp.cpp | 58 ++-- src/KSPACE/fft3d.cpp | 58 ++-- src/KSPACE/fft3d_wrap.cpp | 2 +- src/KSPACE/gridcomm.cpp | 12 +- src/KSPACE/kissfft.h | 6 +- src/KSPACE/msm.cpp | 84 ++--- src/KSPACE/msm_cg.cpp | 2 +- src/KSPACE/pair_born_coul_long.cpp | 38 +-- src/KSPACE/pair_born_coul_msm.cpp | 4 +- src/KSPACE/pair_buck_coul_long.cpp | 30 +- src/KSPACE/pair_buck_coul_msm.cpp | 4 +- src/KSPACE/pair_buck_long_coul_long.cpp | 42 +-- src/KSPACE/pair_coul_long.cpp | 24 +- src/KSPACE/pair_coul_msm.cpp | 2 +- src/KSPACE/pair_lj_charmm_coul_long.cpp | 34 +- src/KSPACE/pair_lj_charmm_coul_msm.cpp | 4 +- src/KSPACE/pair_lj_charmmfsw_coul_long.cpp | 34 +- src/KSPACE/pair_lj_cut_coul_long.cpp | 32 +- src/KSPACE/pair_lj_cut_coul_msm.cpp | 4 +- src/KSPACE/pair_lj_cut_tip4p_long.cpp | 36 +- src/KSPACE/pair_lj_long_coul_long.cpp | 40 +-- src/KSPACE/pair_lj_long_tip4p_long.cpp | 44 +-- src/KSPACE/pair_tip4p_long.cpp | 20 +- src/KSPACE/pppm.cpp | 66 ++-- src/KSPACE/pppm_cg.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 34 +- src/KSPACE/pppm_dipole_spin.cpp | 12 +- src/KSPACE/pppm_disp.cpp | 322 +++++++++--------- src/KSPACE/pppm_stagger.cpp | 2 +- src/KSPACE/remap.cpp | 28 +- src/KSPACE/remap_wrap.cpp | 2 +- src/LATTE/fix_latte.cpp | 12 +- src/MANYBODY/fix_qeq_comb.cpp | 10 +- src/MANYBODY/pair_adp.cpp | 40 +-- src/MANYBODY/pair_airebo.cpp | 14 +- src/MANYBODY/pair_airebo.h | 2 +- src/MANYBODY/pair_atm.cpp | 8 +- src/MANYBODY/pair_bop.cpp | 232 ++++++------- src/MANYBODY/pair_comb.cpp | 42 +-- src/MANYBODY/pair_comb3.cpp | 62 ++-- src/MANYBODY/pair_eam.cpp | 42 +-- src/MANYBODY/pair_eam_alloy.cpp | 2 +- src/MANYBODY/pair_eam_cd.cpp | 10 +- src/MANYBODY/pair_eam_cd.h | 2 +- src/MANYBODY/pair_eam_fs.cpp | 2 +- src/MANYBODY/pair_eim.cpp | 32 +- src/MANYBODY/pair_gw.cpp | 14 +- src/MANYBODY/pair_gw_zbl.cpp | 2 +- src/MANYBODY/pair_lcbop.cpp | 18 +- src/MANYBODY/pair_lcbop.h | 2 +- src/MANYBODY/pair_nb3b_harmonic.cpp | 12 +- src/MANYBODY/pair_polymorphic.cpp | 4 +- src/MANYBODY/pair_sw.cpp | 14 +- src/MANYBODY/pair_tersoff.cpp | 14 +- src/MANYBODY/pair_vashishta.cpp | 14 +- src/MANYBODY/pair_vashishta_table.cpp | 8 +- src/MC/fix_atom_swap.cpp | 14 +- src/MC/fix_bond_break.cpp | 4 +- src/MC/fix_bond_create.cpp | 14 +- src/MC/fix_bond_swap.cpp | 12 +- src/MC/fix_gcmc.cpp | 28 +- src/MC/fix_tfmc.cpp | 6 +- src/MC/fix_widom.cpp | 14 +- src/MC/pair_dsmc.cpp | 20 +- src/MESSAGE/fix_client_md.cpp | 2 +- src/MESSAGE/message.cpp | 2 +- src/MESSAGE/server_mc.cpp | 4 +- src/MESSAGE/server_md.cpp | 28 +- src/MISC/compute_ti.cpp | 12 +- src/MISC/dump_xtc.cpp | 50 +-- src/MISC/fix_deposit.cpp | 20 +- src/MISC/fix_efield.cpp | 12 +- src/MISC/fix_evaporate.cpp | 6 +- src/MISC/fix_gld.cpp | 4 +- src/MISC/fix_oneway.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 6 +- src/MISC/fix_orient_fcc.cpp | 8 +- src/MISC/fix_thermal_conductivity.cpp | 2 +- src/MISC/fix_ttm.cpp | 16 +- src/MISC/fix_viscosity.cpp | 2 +- src/MISC/pair_nm_cut.cpp | 22 +- src/MISC/pair_nm_cut_coul_cut.cpp | 26 +- src/MISC/pair_nm_cut_coul_long.cpp | 34 +- src/MISC/xdr_compat.cpp | 14 +- src/MLIAP/compute_mliap.cpp | 6 +- src/MLIAP/mliap_data.cpp | 8 +- src/MLIAP/mliap_data.h | 2 +- src/MLIAP/mliap_descriptor_snap.cpp | 20 +- src/MLIAP/mliap_model.cpp | 10 +- src/MLIAP/mliap_model_quadratic.h | 2 +- src/MOLECULE/angle_charmm.cpp | 8 +- src/MOLECULE/angle_cosine.cpp | 2 +- src/MOLECULE/angle_cosine_periodic.cpp | 6 +- src/MOLECULE/angle_cosine_squared.cpp | 8 +- src/MOLECULE/angle_harmonic.cpp | 8 +- src/MOLECULE/angle_table.cpp | 16 +- src/MOLECULE/atom_vec_angle.cpp | 2 +- src/MOLECULE/atom_vec_bond.cpp | 2 +- src/MOLECULE/atom_vec_full.cpp | 2 +- src/MOLECULE/atom_vec_molecular.cpp | 2 +- src/MOLECULE/bond_fene.cpp | 10 +- src/MOLECULE/bond_fene_expand.cpp | 10 +- src/MOLECULE/bond_gromos.cpp | 6 +- src/MOLECULE/bond_harmonic.cpp | 6 +- src/MOLECULE/bond_morse.cpp | 8 +- src/MOLECULE/bond_nonlinear.cpp | 8 +- src/MOLECULE/bond_quartic.cpp | 12 +- src/MOLECULE/bond_table.cpp | 16 +- src/MOLECULE/dihedral_charmm.cpp | 12 +- src/MOLECULE/dihedral_charmmfsw.cpp | 16 +- src/MOLECULE/dihedral_harmonic.cpp | 6 +- src/MOLECULE/dihedral_helix.cpp | 6 +- src/MOLECULE/dihedral_multi_harmonic.cpp | 10 +- src/MOLECULE/dihedral_opls.cpp | 8 +- src/MOLECULE/fix_cmap.cpp | 46 +-- src/MOLECULE/improper_cvff.cpp | 6 +- src/MOLECULE/improper_harmonic.cpp | 4 +- src/MOLECULE/improper_umbrella.cpp | 6 +- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 2 +- src/MOLECULE/pair_lj_charmm_coul_charmm.cpp | 24 +- .../pair_lj_charmmfsw_coul_charmmfsh.cpp | 22 +- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 40 +-- src/MOLECULE/pair_tip4p_cut.cpp | 22 +- src/MPIIO/dump_atom_mpiio.cpp | 2 +- src/MPIIO/dump_cfg_mpiio.cpp | 2 +- src/MPIIO/dump_custom_mpiio.cpp | 6 +- src/MPIIO/dump_xyz_mpiio.cpp | 4 +- src/MSCG/fix_mscg.cpp | 2 +- src/PERI/compute_damage_atom.cpp | 2 +- src/PERI/compute_dilatation_atom.cpp | 2 +- src/PERI/compute_plasticity_atom.cpp | 2 +- src/PERI/fix_peri_neigh.cpp | 38 +-- src/PERI/pair_peri_eps.cpp | 32 +- src/PERI/pair_peri_lps.cpp | 24 +- src/PERI/pair_peri_pmb.cpp | 20 +- src/PERI/pair_peri_ves.cpp | 34 +- src/POEMS/fix_poems.cpp | 44 +-- src/PYTHON/fix_python_move.cpp | 10 +- src/PYTHON/pair_python.cpp | 10 +- src/PYTHON/python_compat.h | 4 +- src/PYTHON/python_impl.cpp | 32 +- src/QEQ/fix_qeq.cpp | 56 +-- src/QEQ/fix_qeq_fire.cpp | 4 +- src/QEQ/fix_qeq_shielded.cpp | 4 +- src/QEQ/fix_qeq_slater.cpp | 6 +- src/REPLICA/compute_event_displace.cpp | 14 +- src/REPLICA/fix_event.cpp | 4 +- src/REPLICA/fix_hyper.cpp | 2 +- src/REPLICA/fix_hyper_global.cpp | 10 +- src/REPLICA/fix_hyper_local.cpp | 40 +-- src/REPLICA/fix_neb.cpp | 18 +- src/REPLICA/hyper.cpp | 8 +- src/REPLICA/neb.cpp | 8 +- src/REPLICA/prd.cpp | 22 +- src/REPLICA/tad.cpp | 16 +- src/REPLICA/temper.cpp | 2 +- src/REPLICA/verlet_split.cpp | 6 +- src/RIGID/compute_erotate_rigid.cpp | 2 +- src/RIGID/compute_ke_rigid.cpp | 2 +- src/RIGID/compute_rigid_local.cpp | 10 +- src/RIGID/fix_ehex.cpp | 12 +- src/RIGID/fix_rattle.cpp | 2 +- src/RIGID/fix_rigid.cpp | 56 +-- src/RIGID/fix_rigid_nh.cpp | 20 +- src/RIGID/fix_rigid_nh_small.cpp | 20 +- src/RIGID/fix_rigid_small.cpp | 54 +-- src/RIGID/fix_shake.cpp | 42 +-- src/SHOCK/fix_append_atoms.cpp | 10 +- src/SHOCK/fix_msst.cpp | 16 +- src/SHOCK/fix_nphug.cpp | 2 +- src/SHOCK/fix_wall_piston.cpp | 6 +- src/SNAP/compute_sna_atom.cpp | 12 +- src/SNAP/compute_snad_atom.cpp | 12 +- src/SNAP/compute_snap.cpp | 12 +- src/SNAP/compute_snav_atom.cpp | 12 +- src/SNAP/pair_snap.cpp | 34 +- src/SNAP/sna.cpp | 20 +- src/SPIN/compute_spin.cpp | 2 +- src/SPIN/fix_langevin_spin.cpp | 2 +- src/SPIN/fix_neb_spin.cpp | 24 +- src/SPIN/fix_nve_spin.cpp | 6 +- src/SPIN/fix_precession_spin.cpp | 4 +- src/SPIN/fix_setforce_spin.cpp | 6 +- src/SPIN/min_spin_cg.cpp | 2 +- src/SPIN/min_spin_lbfgs.cpp | 2 +- src/SPIN/neb_spin.cpp | 8 +- src/SPIN/pair_spin.cpp | 2 +- src/SPIN/pair_spin.h | 2 +- src/SPIN/pair_spin_dipole_cut.cpp | 10 +- src/SPIN/pair_spin_dipole_long.cpp | 12 +- src/SPIN/pair_spin_dmi.cpp | 26 +- src/SPIN/pair_spin_exchange.cpp | 20 +- src/SPIN/pair_spin_magelec.cpp | 20 +- src/SPIN/pair_spin_neel.cpp | 28 +- src/SRD/fix_srd.cpp | 42 +-- src/SRD/fix_wall_srd.cpp | 2 +- src/STUBS/mpi.h | 4 +- src/USER-ADIOS/dump_atom_adios.cpp | 2 +- src/USER-ADIOS/dump_custom_adios.cpp | 2 +- src/USER-ADIOS/reader_adios.cpp | 4 +- src/USER-ATC/fix_atc.cpp | 2 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 20 +- src/USER-BOCS/compute_pressure_bocs.cpp | 16 +- src/USER-BOCS/fix_bocs.cpp | 30 +- src/USER-CGDNA/bond_oxdna_fene.cpp | 6 +- src/USER-CGDNA/pair_oxdna2_coaxstk.cpp | 82 ++--- src/USER-CGDNA/pair_oxdna2_dh.cpp | 20 +- src/USER-CGDNA/pair_oxdna_coaxstk.cpp | 94 ++--- src/USER-CGDNA/pair_oxdna_excv.cpp | 40 +-- src/USER-CGDNA/pair_oxdna_hbond.cpp | 104 +++--- src/USER-CGDNA/pair_oxdna_stk.cpp | 86 ++--- src/USER-CGDNA/pair_oxdna_xstk.cpp | 100 +++--- src/USER-CGDNA/pair_oxrna2_stk.cpp | 98 +++--- src/USER-CGDNA/pair_oxrna2_xstk.cpp | 88 ++--- src/USER-CGSDK/angle_sdk.cpp | 8 +- src/USER-CGSDK/pair_lj_sdk.cpp | 20 +- src/USER-CGSDK/pair_lj_sdk_coul_long.cpp | 32 +- src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp | 4 +- src/USER-COLVARS/colvarproxy_lammps.cpp | 4 +- src/USER-COLVARS/fix_colvars.cpp | 26 +- src/USER-COLVARS/group_ndx.cpp | 2 +- src/USER-COLVARS/ndx_group.cpp | 34 +- src/USER-DIFFRACTION/compute_saed.cpp | 2 +- src/USER-DIFFRACTION/compute_xrd.cpp | 2 +- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 18 +- src/USER-DPD/compute_dpd_atom.cpp | 2 +- src/USER-DPD/fix_dpd_energy.cpp | 6 +- src/USER-DPD/fix_eos_table.cpp | 20 +- src/USER-DPD/fix_eos_table_rx.cpp | 42 +-- src/USER-DPD/fix_rx.cpp | 98 +++--- src/USER-DPD/fix_shardlow.cpp | 16 +- src/USER-DPD/npair_half_bin_newton_ssa.cpp | 6 +- src/USER-DPD/pair_dpd_fdt.cpp | 18 +- src/USER-DPD/pair_dpd_fdt_energy.cpp | 22 +- src/USER-DPD/pair_exp6_rx.cpp | 50 +-- src/USER-DPD/pair_multi_lucy.cpp | 36 +- src/USER-DPD/pair_multi_lucy_rx.cpp | 44 +-- src/USER-DPD/pair_table_rx.cpp | 14 +- src/USER-DRUDE/compute_temp_drude.cpp | 6 +- src/USER-DRUDE/fix_drude.cpp | 12 +- src/USER-DRUDE/fix_drude_transform.cpp | 4 +- src/USER-DRUDE/fix_langevin_drude.cpp | 12 +- src/USER-DRUDE/pair_lj_cut_thole_long.cpp | 40 +-- src/USER-DRUDE/pair_thole.cpp | 20 +- src/USER-EFF/compute_ke_atom_eff.cpp | 2 +- src/USER-EFF/compute_temp_deform_eff.cpp | 2 +- src/USER-EFF/compute_temp_region_eff.cpp | 2 +- src/USER-EFF/fix_langevin_eff.cpp | 4 +- src/USER-EFF/pair_eff_cut.cpp | 14 +- src/USER-FEP/compute_fep.cpp | 24 +- src/USER-FEP/fix_adapt_fep.cpp | 16 +- src/USER-FEP/pair_coul_cut_soft.cpp | 18 +- src/USER-FEP/pair_coul_long_soft.cpp | 18 +- .../pair_lj_charmm_coul_long_soft.cpp | 36 +- src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp | 32 +- .../pair_lj_class2_coul_long_soft.cpp | 32 +- src/USER-FEP/pair_lj_class2_soft.cpp | 24 +- src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp | 32 +- src/USER-FEP/pair_lj_cut_coul_long_soft.cpp | 34 +- src/USER-FEP/pair_lj_cut_soft.cpp | 26 +- src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp | 32 +- src/USER-FEP/pair_morse_soft.cpp | 22 +- src/USER-FEP/pair_tip4p_long_soft.cpp | 20 +- src/USER-H5MD/dump_h5md.cpp | 40 +-- src/USER-INTEL/angle_charmm_intel.h | 2 +- src/USER-INTEL/angle_harmonic_intel.h | 2 +- src/USER-INTEL/bond_fene_intel.h | 2 +- src/USER-INTEL/bond_harmonic_intel.h | 2 +- src/USER-INTEL/dihedral_charmm_intel.h | 2 +- src/USER-INTEL/dihedral_fourier_intel.h | 2 +- src/USER-INTEL/dihedral_harmonic_intel.h | 2 +- src/USER-INTEL/dihedral_opls_intel.h | 2 +- src/USER-INTEL/fix_intel.cpp | 20 +- src/USER-INTEL/fix_intel.h | 4 +- src/USER-INTEL/improper_cvff_intel.h | 2 +- src/USER-INTEL/improper_harmonic_intel.h | 2 +- src/USER-INTEL/intel_buffers.cpp | 40 +-- src/USER-INTEL/intel_buffers.h | 4 +- src/USER-INTEL/intel_preprocess.h | 2 +- src/USER-INTEL/nbin_intel.cpp | 4 +- src/USER-INTEL/npair_full_bin_ghost_intel.cpp | 4 +- src/USER-INTEL/npair_intel.cpp | 4 +- src/USER-INTEL/pair_airebo_intel.cpp | 18 +- src/USER-INTEL/pair_buck_coul_cut_intel.cpp | 8 +- src/USER-INTEL/pair_buck_coul_cut_intel.h | 2 +- src/USER-INTEL/pair_buck_coul_long_intel.cpp | 16 +- src/USER-INTEL/pair_buck_coul_long_intel.h | 2 +- src/USER-INTEL/pair_buck_intel.cpp | 8 +- src/USER-INTEL/pair_buck_intel.h | 2 +- src/USER-INTEL/pair_dpd_intel.cpp | 2 +- src/USER-INTEL/pair_dpd_intel.h | 2 +- src/USER-INTEL/pair_eam_alloy_intel.cpp | 2 +- src/USER-INTEL/pair_eam_fs_intel.cpp | 2 +- src/USER-INTEL/pair_eam_intel.h | 2 +- src/USER-INTEL/pair_gayberne_intel.cpp | 16 +- src/USER-INTEL/pair_gayberne_intel.h | 2 +- .../pair_lj_charmm_coul_charmm_intel.cpp | 8 +- .../pair_lj_charmm_coul_charmm_intel.h | 2 +- .../pair_lj_charmm_coul_long_intel.cpp | 14 +- .../pair_lj_charmm_coul_long_intel.h | 2 +- .../pair_lj_cut_coul_long_intel.cpp | 18 +- src/USER-INTEL/pair_lj_cut_coul_long_intel.h | 2 +- src/USER-INTEL/pair_lj_cut_intel.cpp | 2 +- src/USER-INTEL/pair_lj_cut_intel.h | 2 +- .../pair_lj_long_coul_long_intel.cpp | 2 +- src/USER-INTEL/pair_sw_intel.cpp | 8 +- src/USER-INTEL/pair_sw_intel.h | 2 +- src/USER-INTEL/pair_tersoff_intel.cpp | 8 +- src/USER-INTEL/pair_tersoff_intel.h | 2 +- src/USER-INTEL/pppm_disp_intel.cpp | 24 +- src/USER-INTEL/pppm_intel.cpp | 6 +- src/USER-INTEL/verlet_lrt_intel.cpp | 10 +- src/USER-LB/fix_lb_fluid.cpp | 46 +-- src/USER-LB/fix_lb_pc.cpp | 6 +- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 4 +- src/USER-LB/fix_lb_viscous.cpp | 2 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.h | 4 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.h | 4 +- src/USER-MANIFOLD/manifold.h | 2 +- src/USER-MANIFOLD/manifold_factory.cpp | 2 +- src/USER-MANIFOLD/manifold_factory.h | 2 +- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 2 +- src/USER-MANIFOLD/manifold_thylakoid.cpp | 4 +- src/USER-MANIFOLD/manifold_thylakoid.h | 2 +- src/USER-MEAMC/meam_impl.cpp | 10 +- src/USER-MEAMC/meam_setup_done.cpp | 16 +- src/USER-MEAMC/pair_meamc.cpp | 26 +- src/USER-MESODPD/compute_edpd_temp_atom.cpp | 2 +- src/USER-MESODPD/compute_tdpd_cc_atom.cpp | 2 +- src/USER-MESODPD/pair_edpd.cpp | 30 +- src/USER-MESODPD/pair_mdpd.cpp | 22 +- src/USER-MESODPD/pair_tdpd.cpp | 28 +- src/USER-MESONT/compute_mesont.cpp | 6 +- src/USER-MESONT/pair_mesocnt.cpp | 8 +- src/USER-MESONT/pair_mesont_tpm.cpp | 18 +- src/USER-MGPT/mgpt_readpot.cpp | 6 +- src/USER-MGPT/mgpt_readpot.h | 6 +- src/USER-MGPT/pair_mgpt.cpp | 6 +- src/USER-MISC/angle_cosine_shift.cpp | 10 +- src/USER-MISC/angle_cosine_shift_exp.cpp | 24 +- src/USER-MISC/angle_dipole.cpp | 8 +- src/USER-MISC/angle_fourier.cpp | 16 +- src/USER-MISC/angle_fourier_simple.cpp | 12 +- src/USER-MISC/angle_quartic.cpp | 8 +- src/USER-MISC/bond_harmonic_shift.cpp | 6 +- src/USER-MISC/bond_harmonic_shift_cut.cpp | 6 +- src/USER-MISC/bond_special.cpp | 4 +- src/USER-MISC/compute_ackland_atom.cpp | 10 +- src/USER-MISC/compute_basal_atom.cpp | 10 +- src/USER-MISC/compute_cnp_atom.cpp | 4 +- src/USER-MISC/compute_entropy_atom.cpp | 4 +- src/USER-MISC/compute_gyration_shape.cpp | 2 +- .../compute_gyration_shape_chunk.cpp | 2 +- src/USER-MISC/compute_hma.cpp | 6 +- src/USER-MISC/compute_pressure_cylinder.cpp | 10 +- src/USER-MISC/compute_pressure_grem.cpp | 2 +- src/USER-MISC/compute_stress_mop.cpp | 14 +- src/USER-MISC/compute_stress_mop_profile.cpp | 16 +- src/USER-MISC/compute_temp_rotate.cpp | 2 +- src/USER-MISC/compute_viscosity_cos.cpp | 2 +- src/USER-MISC/dihedral_cosine_shift_exp.cpp | 10 +- src/USER-MISC/dihedral_fourier.cpp | 8 +- src/USER-MISC/dihedral_nharmonic.cpp | 4 +- src/USER-MISC/dihedral_quadratic.cpp | 4 +- src/USER-MISC/dihedral_spherical.cpp | 42 +-- src/USER-MISC/dihedral_table.cpp | 14 +- src/USER-MISC/dihedral_table_cut.cpp | 34 +- src/USER-MISC/fix_addtorque.cpp | 2 +- src/USER-MISC/fix_ave_correlate_long.cpp | 8 +- src/USER-MISC/fix_electron_stopping.cpp | 12 +- src/USER-MISC/fix_ffl.cpp | 6 +- src/USER-MISC/fix_filter_corotate.cpp | 32 +- src/USER-MISC/fix_gle.cpp | 26 +- src/USER-MISC/fix_grem.cpp | 8 +- src/USER-MISC/fix_imd.cpp | 72 ++-- src/USER-MISC/fix_ipi.cpp | 2 +- src/USER-MISC/fix_npt_cauchy.cpp | 18 +- src/USER-MISC/fix_orient_eco.cpp | 4 +- src/USER-MISC/fix_pafi.cpp | 4 +- src/USER-MISC/fix_pimd.cpp | 30 +- src/USER-MISC/fix_propel_self.cpp | 2 +- src/USER-MISC/fix_srp.cpp | 4 +- src/USER-MISC/fix_ti_spring.cpp | 2 +- src/USER-MISC/fix_ttm_mod.cpp | 16 +- src/USER-MISC/fix_wall_reflect_stochastic.cpp | 2 +- src/USER-MISC/improper_cossq.cpp | 4 +- src/USER-MISC/improper_distance.cpp | 4 +- src/USER-MISC/improper_fourier.cpp | 10 +- src/USER-MISC/improper_ring.cpp | 4 +- src/USER-MISC/pair_agni.cpp | 22 +- src/USER-MISC/pair_buck_mdf.cpp | 24 +- src/USER-MISC/pair_cosine_squared.cpp | 12 +- src/USER-MISC/pair_coul_diel.cpp | 14 +- src/USER-MISC/pair_coul_shield.cpp | 12 +- src/USER-MISC/pair_coul_slater_long.cpp | 8 +- src/USER-MISC/pair_drip.cpp | 26 +- src/USER-MISC/pair_e3b.cpp | 12 +- src/USER-MISC/pair_edip.cpp | 32 +- src/USER-MISC/pair_edip_multi.cpp | 20 +- src/USER-MISC/pair_extep.cpp | 38 +-- src/USER-MISC/pair_gauss_cut.cpp | 16 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 38 +-- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 38 +-- src/USER-MISC/pair_kolmogorov_crespi_z.cpp | 22 +- src/USER-MISC/pair_lebedeva_z.cpp | 22 +- src/USER-MISC/pair_lennard_mdf.cpp | 18 +- src/USER-MISC/pair_list.cpp | 34 +- src/USER-MISC/pair_lj_expand_coul_long.cpp | 34 +- src/USER-MISC/pair_lj_mdf.cpp | 14 +- src/USER-MISC/pair_lj_sf_dipole_sf.cpp | 20 +- src/USER-MISC/pair_local_density.cpp | 46 +-- src/USER-MISC/pair_meam_spline.cpp | 44 +-- src/USER-MISC/pair_meam_spline.h | 4 +- src/USER-MISC/pair_meam_sw_spline.cpp | 24 +- src/USER-MISC/pair_meam_sw_spline.h | 4 +- src/USER-MISC/pair_momb.cpp | 24 +- src/USER-MISC/pair_morse_smooth_linear.cpp | 16 +- src/USER-MISC/pair_srp.cpp | 20 +- src/USER-MISC/pair_tersoff_table.cpp | 4 +- src/USER-MISC/temper_grem.cpp | 2 +- src/USER-MISC/temper_npt.cpp | 2 +- src/USER-MOFFF/angle_class2_p6.cpp | 30 +- src/USER-MOFFF/angle_cosine_buck6d.cpp | 8 +- .../improper_inversion_harmonic.cpp | 4 +- src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp | 28 +- .../pair_buck6d_coul_gauss_long.cpp | 32 +- src/USER-MOLFILE/dump_molfile.cpp | 14 +- src/USER-MOLFILE/molfile_interface.cpp | 96 +++--- src/USER-MOLFILE/reader_molfile.cpp | 14 +- src/USER-NETCDF/dump_netcdf.cpp | 8 +- src/USER-NETCDF/dump_netcdf_mpiio.cpp | 10 +- src/USER-OMP/bond_class2_omp.cpp | 2 +- src/USER-OMP/bond_fene_expand_omp.cpp | 2 +- src/USER-OMP/bond_fene_omp.cpp | 2 +- src/USER-OMP/bond_gromos_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_shift_cut_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_shift_omp.cpp | 2 +- src/USER-OMP/bond_morse_omp.cpp | 2 +- src/USER-OMP/bond_nonlinear_omp.cpp | 2 +- src/USER-OMP/bond_quartic_omp.cpp | 2 +- src/USER-OMP/bond_table_omp.cpp | 2 +- src/USER-OMP/ewald_omp.cpp | 2 +- src/USER-OMP/fix_neigh_history_omp.cpp | 8 +- src/USER-OMP/fix_omp.cpp | 18 +- src/USER-OMP/fix_qeq_comb_omp.cpp | 6 +- src/USER-OMP/fix_qeq_reax_omp.cpp | 4 +- src/USER-OMP/msm_cg_omp.cpp | 2 +- src/USER-OMP/pair_adp_omp.cpp | 2 +- src/USER-OMP/pair_agni_omp.cpp | 2 +- src/USER-OMP/pair_airebo_omp.cpp | 2 +- src/USER-OMP/pair_beck_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_born_omp.cpp | 2 +- src/USER-OMP/pair_brownian_omp.cpp | 10 +- src/USER-OMP/pair_brownian_poly_omp.cpp | 10 +- src/USER-OMP/pair_buck_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_buck_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_buck_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_buck_long_coul_long_omp.cpp | 10 +- src/USER-OMP/pair_buck_omp.cpp | 2 +- src/USER-OMP/pair_colloid_omp.cpp | 2 +- src/USER-OMP/pair_comb_omp.cpp | 2 +- src/USER-OMP/pair_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_coul_cut_soft_omp.cpp | 2 +- src/USER-OMP/pair_coul_debye_omp.cpp | 2 +- src/USER-OMP/pair_coul_diel_omp.cpp | 2 +- src/USER-OMP/pair_coul_dsf_omp.cpp | 2 +- src/USER-OMP/pair_coul_long_omp.cpp | 4 +- src/USER-OMP/pair_coul_long_soft_omp.cpp | 2 +- src/USER-OMP/pair_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_dpd_omp.cpp | 10 +- src/USER-OMP/pair_dpd_tstat_omp.cpp | 10 +- src/USER-OMP/pair_eam_alloy_omp.cpp | 2 +- src/USER-OMP/pair_eam_fs_omp.cpp | 2 +- src/USER-OMP/pair_eam_omp.cpp | 2 +- src/USER-OMP/pair_edip_omp.cpp | 2 +- src/USER-OMP/pair_eim_omp.cpp | 2 +- src/USER-OMP/pair_gauss_cut_omp.cpp | 2 +- src/USER-OMP/pair_gauss_omp.cpp | 2 +- src/USER-OMP/pair_gayberne_omp.cpp | 2 +- src/USER-OMP/pair_gran_hertz_history_omp.cpp | 2 +- src/USER-OMP/pair_gran_hooke_history_omp.cpp | 2 +- src/USER-OMP/pair_gran_hooke_omp.cpp | 2 +- src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp | 4 +- .../pair_hbond_dreiding_morse_omp.cpp | 4 +- src/USER-OMP/pair_lj96_cut_omp.cpp | 4 +- ...air_lj_charmm_coul_charmm_implicit_omp.cpp | 2 +- .../pair_lj_charmm_coul_charmm_omp.cpp | 2 +- src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp | 4 +- .../pair_lj_charmm_coul_long_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_lj_class2_coul_long_omp.cpp | 4 +- src/USER-OMP/pair_lj_class2_omp.cpp | 2 +- src/USER-OMP/pair_lj_cubic_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp | 2 +- .../pair_lj_cut_coul_cut_soft_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_long_omp.cpp | 4 +- .../pair_lj_cut_coul_long_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_thole_long_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp | 6 +- src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp | 6 +- .../pair_lj_cut_tip4p_long_soft_omp.cpp | 6 +- src/USER-OMP/pair_lj_expand_omp.cpp | 2 +- .../pair_lj_gromacs_coul_gromacs_omp.cpp | 2 +- src/USER-OMP/pair_lj_gromacs_omp.cpp | 2 +- src/USER-OMP/pair_lj_long_coul_long_omp.cpp | 10 +- src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp | 14 +- src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_lj_sdk_omp.cpp | 2 +- src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp | 2 +- src/USER-OMP/pair_lj_smooth_linear_omp.cpp | 2 +- src/USER-OMP/pair_lj_smooth_omp.cpp | 2 +- src/USER-OMP/pair_lubricate_omp.cpp | 2 +- src/USER-OMP/pair_lubricate_poly_omp.cpp | 2 +- src/USER-OMP/pair_meam_spline_omp.cpp | 2 +- src/USER-OMP/pair_morse_omp.cpp | 2 +- src/USER-OMP/pair_morse_smooth_linear_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_omp.cpp | 2 +- src/USER-OMP/pair_peri_lps_omp.cpp | 2 +- src/USER-OMP/pair_peri_pmb_omp.cpp | 2 +- src/USER-OMP/pair_reaxc_omp.cpp | 4 +- src/USER-OMP/pair_resquared_omp.cpp | 2 +- src/USER-OMP/pair_soft_omp.cpp | 2 +- src/USER-OMP/pair_sw_omp.cpp | 2 +- src/USER-OMP/pair_table_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_mod_c_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_mod_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_table_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_cut_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_long_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_long_soft_omp.cpp | 6 +- src/USER-OMP/pair_ufm_omp.cpp | 2 +- src/USER-OMP/pair_vashishta_omp.cpp | 2 +- src/USER-OMP/pair_vashishta_table_omp.cpp | 2 +- src/USER-OMP/pair_yukawa_colloid_omp.cpp | 2 +- src/USER-OMP/pair_yukawa_omp.cpp | 2 +- src/USER-OMP/pair_zbl_omp.cpp | 2 +- src/USER-OMP/reaxc_bonds_omp.cpp | 2 +- src/USER-OMP/reaxc_forces_omp.cpp | 2 +- src/USER-OMP/thr_data.cpp | 18 +- src/USER-OMP/thr_data.h | 4 +- src/USER-OMP/thr_omp.cpp | 6 +- src/USER-PHONON/dynamical_matrix.cpp | 6 +- src/USER-PHONON/fix_phonon.cpp | 26 +- src/USER-PHONON/third_order.cpp | 6 +- src/USER-PLUMED/fix_plumed.cpp | 8 +- src/USER-PTM/compute_ptm_atom.cpp | 8 +- src/USER-PTM/ptm_index.cpp | 22 +- src/USER-PTM/ptm_initialize_data.h | 90 ++--- src/USER-QMMM/fix_qmmm.cpp | 18 +- src/USER-QTB/fix_qbmsst.cpp | 28 +- src/USER-QTB/fix_qtb.cpp | 22 +- src/USER-QUIP/pair_quip.cpp | 8 +- src/USER-REACTION/fix_bond_react.cpp | 64 ++-- src/USER-REAXC/compute_spec_atom.cpp | 4 +- src/USER-REAXC/fix_qeq_reax.cpp | 46 +-- src/USER-REAXC/fix_reaxc.cpp | 4 +- src/USER-REAXC/fix_reaxc_bonds.cpp | 12 +- src/USER-REAXC/fix_reaxc_species.cpp | 50 +-- src/USER-REAXC/pair_reaxc.cpp | 16 +- src/USER-REAXC/reaxc_allocate.cpp | 8 +- src/USER-REAXC/reaxc_control.cpp | 2 +- src/USER-REAXC/reaxc_io_tools.cpp | 8 +- src/USER-REAXC/reaxc_list.cpp | 18 +- src/USER-REAXC/reaxc_tool_box.cpp | 18 +- src/USER-REAXC/reaxc_traj.cpp | 4 +- src/USER-SCAFACOS/scafacos.cpp | 8 +- src/USER-SDPD/fix_meso_move.cpp | 26 +- .../pair_sdpd_taitwater_isothermal.cpp | 2 +- src/USER-SMD/compute_smd_contact_radius.cpp | 2 +- src/USER-SMD/compute_smd_damage.cpp | 2 +- src/USER-SMD/compute_smd_hourglass_error.cpp | 4 +- src/USER-SMD/compute_smd_internal_energy.cpp | 2 +- src/USER-SMD/compute_smd_plastic_strain.cpp | 2 +- .../compute_smd_plastic_strain_rate.cpp | 2 +- src/USER-SMD/compute_smd_rho.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_defgrad.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_dt.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_num_neighs.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_shape.cpp | 6 +- src/USER-SMD/compute_smd_tlsph_strain.cpp | 4 +- .../compute_smd_tlsph_strain_rate.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_stress.cpp | 4 +- .../compute_smd_triangle_vertices.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_effm.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_num_neighs.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_strain.cpp | 2 +- .../compute_smd_ulsph_strain_rate.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_stress.cpp | 4 +- src/USER-SMD/compute_smd_vol.cpp | 2 +- src/USER-SMD/fix_smd_adjust_dt.cpp | 14 +- src/USER-SMD/fix_smd_integrate_tlsph.cpp | 2 +- src/USER-SMD/fix_smd_integrate_ulsph.cpp | 6 +- src/USER-SMD/fix_smd_setvel.cpp | 6 +- .../fix_smd_tlsph_reference_configuration.cpp | 18 +- src/USER-SMD/fix_smd_wall_surface.cpp | 36 +- src/USER-SMD/pair_smd_hertz.cpp | 8 +- src/USER-SMD/pair_smd_tlsph.cpp | 30 +- .../pair_smd_triangulated_surface.cpp | 8 +- src/USER-SMD/pair_smd_ulsph.cpp | 30 +- src/USER-SMTBQ/pair_smtbq.cpp | 84 ++--- src/USER-SPH/compute_sph_e_atom.cpp | 2 +- src/USER-SPH/compute_sph_rho_atom.cpp | 2 +- src/USER-SPH/compute_sph_t_atom.cpp | 2 +- src/USER-TALLY/compute_force_tally.cpp | 4 +- src/USER-TALLY/compute_heat_flux_tally.cpp | 6 +- src/USER-TALLY/compute_pe_mol_tally.cpp | 2 +- src/USER-TALLY/compute_pe_tally.cpp | 4 +- src/USER-TALLY/compute_stress_tally.cpp | 4 +- src/USER-UEF/fix_nh_uef.cpp | 2 +- src/USER-VTK/dump_vtk.cpp | 44 +-- src/USER-YAFF/angle_cross.cpp | 12 +- src/USER-YAFF/angle_mm3.cpp | 4 +- src/USER-YAFF/bond_mm3.cpp | 4 +- src/USER-YAFF/improper_distharm.cpp | 4 +- src/USER-YAFF/improper_sqdistharm.cpp | 4 +- .../pair_lj_switch3_coulgauss_long.cpp | 34 +- .../pair_mm3_switch3_coulgauss_long.cpp | 34 +- src/VORONOI/compute_voronoi_atom.cpp | 28 +- src/angle.cpp | 8 +- src/angle_hybrid.cpp | 8 +- src/angle_zero.cpp | 2 +- src/atom.cpp | 238 ++++++------- src/atom.h | 2 +- src/atom_map.cpp | 8 +- src/atom_vec.cpp | 4 +- src/atom_vec_body.cpp | 8 +- src/atom_vec_ellipsoid.cpp | 4 +- src/atom_vec_hybrid.cpp | 10 +- src/atom_vec_line.cpp | 4 +- src/atom_vec_tri.cpp | 4 +- src/balance.cpp | 26 +- src/body.cpp | 4 +- src/bond.cpp | 10 +- src/bond.h | 2 +- src/bond_hybrid.cpp | 8 +- src/bond_zero.cpp | 4 +- src/citeme.cpp | 2 +- src/comm.cpp | 34 +- src/comm.h | 4 +- src/comm_brick.cpp | 28 +- src/comm_tiled.cpp | 48 +-- src/compute.cpp | 8 +- src/compute_adf.cpp | 24 +- src/compute_aggregate_atom.cpp | 6 +- src/compute_angle.cpp | 2 +- src/compute_angle_local.cpp | 10 +- src/compute_angmom_chunk.cpp | 2 +- src/compute_bond.cpp | 2 +- src/compute_bond_local.cpp | 10 +- src/compute_centro_atom.cpp | 4 +- src/compute_centroid_stress_atom.cpp | 6 +- src/compute_chunk_atom.cpp | 44 +-- src/compute_chunk_atom.h | 2 +- src/compute_chunk_spread_atom.cpp | 8 +- src/compute_cluster_atom.cpp | 4 +- src/compute_cna_atom.cpp | 4 +- src/compute_com_chunk.cpp | 2 +- src/compute_contact_atom.cpp | 4 +- src/compute_coord_atom.cpp | 6 +- src/compute_dihedral.cpp | 2 +- src/compute_dihedral_local.cpp | 10 +- src/compute_dipole_chunk.cpp | 6 +- src/compute_displace_atom.cpp | 6 +- src/compute_erotate_sphere_atom.cpp | 2 +- src/compute_fragment_atom.cpp | 8 +- src/compute_global_atom.cpp | 10 +- src/compute_group_group.cpp | 12 +- src/compute_gyration_chunk.cpp | 4 +- src/compute_heat_flux.cpp | 2 +- src/compute_hexorder_atom.cpp | 4 +- src/compute_improper.cpp | 2 +- src/compute_improper_local.cpp | 10 +- src/compute_inertia_chunk.cpp | 4 +- src/compute_ke_atom.cpp | 2 +- src/compute_msd.cpp | 2 +- src/compute_msd_chunk.cpp | 2 +- src/compute_omega_chunk.cpp | 4 +- src/compute_orientorder_atom.cpp | 6 +- src/compute_pair.cpp | 4 +- src/compute_pair_local.cpp | 8 +- src/compute_pe_atom.cpp | 2 +- src/compute_pressure.cpp | 12 +- src/compute_property_atom.cpp | 4 +- src/compute_property_chunk.cpp | 2 +- src/compute_property_local.cpp | 8 +- src/compute_rdf.cpp | 6 +- src/compute_reduce.cpp | 20 +- src/compute_reduce_chunk.cpp | 14 +- src/compute_slice.cpp | 2 +- src/compute_stress_atom.cpp | 6 +- src/compute_temp_chunk.cpp | 6 +- src/compute_temp_deform.cpp | 2 +- src/compute_temp_partial.cpp | 2 +- src/compute_temp_profile.cpp | 2 +- src/compute_temp_ramp.cpp | 2 +- src/compute_temp_region.cpp | 4 +- src/compute_temp_sphere.cpp | 2 +- src/compute_torque_chunk.cpp | 2 +- src/compute_vacf.cpp | 2 +- src/compute_vcm_chunk.cpp | 2 +- src/create_atoms.cpp | 6 +- src/create_atoms.h | 2 +- src/create_bonds.cpp | 4 +- src/delete_atoms.cpp | 6 +- src/delete_bonds.cpp | 2 +- src/dihedral.cpp | 8 +- src/dihedral_hybrid.cpp | 8 +- src/displace_atoms.cpp | 6 +- src/domain.cpp | 8 +- src/dump.cpp | 74 ++-- src/dump_atom.cpp | 2 +- src/dump_cfg.cpp | 4 +- src/dump_custom.cpp | 82 ++--- src/dump_dcd.cpp | 8 +- src/dump_image.cpp | 50 +-- src/dump_local.cpp | 22 +- src/dump_movie.cpp | 6 +- src/dump_xyz.cpp | 12 +- src/error.cpp | 12 +- src/fix.cpp | 4 +- src/fix.h | 2 +- src/fix_adapt.cpp | 28 +- src/fix_addforce.cpp | 6 +- src/fix_ave_atom.cpp | 12 +- src/fix_ave_chunk.cpp | 74 ++-- src/fix_ave_correlate.cpp | 14 +- src/fix_ave_histo.cpp | 42 +-- src/fix_ave_histo_weight.cpp | 8 +- src/fix_ave_time.cpp | 36 +- src/fix_aveforce.cpp | 10 +- src/fix_balance.cpp | 2 +- src/fix_box_relax.cpp | 4 +- src/fix_controller.cpp | 2 +- src/fix_deform.cpp | 6 +- src/fix_enforce2d.cpp | 2 +- src/fix_external.cpp | 8 +- src/fix_gravity.cpp | 8 +- src/fix_group.cpp | 10 +- src/fix_halt.cpp | 4 +- src/fix_heat.cpp | 6 +- src/fix_indent.cpp | 4 +- src/fix_langevin.cpp | 20 +- src/fix_minimize.cpp | 2 +- src/fix_move.cpp | 36 +- src/fix_neigh_history.cpp | 42 +-- src/fix_nh.cpp | 24 +- src/fix_numdiff.cpp | 4 +- src/fix_press_berendsen.cpp | 6 +- src/fix_print.cpp | 8 +- src/fix_property_atom.cpp | 16 +- src/fix_read_restart.cpp | 2 +- src/fix_respa.cpp | 6 +- src/fix_restrain.cpp | 6 +- src/fix_setforce.cpp | 10 +- src/fix_spring.cpp | 2 +- src/fix_spring_chunk.cpp | 6 +- src/fix_spring_rg.cpp | 2 +- src/fix_spring_self.cpp | 4 +- src/fix_store.cpp | 16 +- src/fix_store_force.cpp | 2 +- src/fix_store_state.cpp | 14 +- src/fix_temp_berendsen.cpp | 6 +- src/fix_temp_csld.cpp | 10 +- src/fix_temp_csvr.cpp | 6 +- src/fix_temp_rescale.cpp | 6 +- src/fix_tmd.cpp | 12 +- src/fix_vector.cpp | 6 +- src/fix_viscous.cpp | 2 +- src/fix_wall.cpp | 2 +- src/fix_wall_region.cpp | 2 +- src/force.cpp | 76 ++--- src/group.cpp | 30 +- src/image.cpp | 28 +- src/improper.cpp | 8 +- src/improper_hybrid.cpp | 8 +- src/info.cpp | 14 +- src/input.cpp | 84 ++--- src/integrate.cpp | 8 +- src/irregular.cpp | 10 +- src/irregular.h | 2 +- src/kspace.cpp | 8 +- src/lammps.cpp | 138 ++++---- src/lattice.cpp | 4 +- src/library.cpp | 244 ++++++------- src/lmppython.cpp | 2 +- src/memory.cpp | 12 +- src/memory.h | 74 ++-- src/min.cpp | 28 +- src/min_hftn.cpp | 24 +- src/min_linesearch.cpp | 8 +- src/modify.cpp | 106 +++--- src/molecule.cpp | 88 ++--- src/my_page.cpp | 4 +- src/my_page.h | 2 +- src/nbin.cpp | 6 +- src/neigh_list.cpp | 40 +-- src/neigh_request.cpp | 10 +- src/neighbor.cpp | 92 ++--- src/npair.cpp | 4 +- src/nstencil.cpp | 14 +- src/ntopo.cpp | 2 +- src/output.cpp | 40 +-- src/output.h | 2 +- src/pair.cpp | 36 +- src/pair.h | 2 +- src/pair_beck.cpp | 18 +- src/pair_born.cpp | 24 +- src/pair_born_coul_dsf.cpp | 24 +- src/pair_born_coul_wolf.cpp | 24 +- src/pair_buck.cpp | 20 +- src/pair_buck_coul_cut.cpp | 22 +- src/pair_coul_cut.cpp | 12 +- src/pair_coul_debye.cpp | 8 +- src/pair_coul_dsf.cpp | 12 +- src/pair_coul_streitz.cpp | 14 +- src/pair_coul_wolf.cpp | 10 +- src/pair_dpd.cpp | 18 +- src/pair_dpd_tstat.cpp | 16 +- src/pair_gauss.cpp | 16 +- src/pair_hybrid.cpp | 42 +-- src/pair_hybrid_overlay.cpp | 2 +- src/pair_lj96_cut.cpp | 20 +- src/pair_lj_cubic.cpp | 12 +- src/pair_lj_cut.cpp | 20 +- src/pair_lj_cut_coul_cut.cpp | 22 +- src/pair_lj_cut_coul_debye.cpp | 10 +- src/pair_lj_cut_coul_dsf.cpp | 22 +- src/pair_lj_cut_coul_wolf.cpp | 20 +- src/pair_lj_expand.cpp | 20 +- src/pair_lj_gromacs.cpp | 18 +- src/pair_lj_gromacs_coul_gromacs.cpp | 18 +- src/pair_lj_smooth.cpp | 18 +- src/pair_lj_smooth_linear.cpp | 12 +- src/pair_mie_cut.cpp | 26 +- src/pair_morse.cpp | 18 +- src/pair_soft.cpp | 12 +- src/pair_table.cpp | 32 +- src/pair_ufm.cpp | 18 +- src/pair_yukawa.cpp | 14 +- src/pair_zbl.cpp | 14 +- src/pair_zero.cpp | 8 +- src/procmap.cpp | 18 +- src/random_mars.cpp | 2 +- src/rcb.cpp | 28 +- src/read_data.cpp | 120 +++---- src/read_dump.cpp | 28 +- src/read_restart.cpp | 52 +-- src/reader.cpp | 10 +- src/reader_native.cpp | 12 +- src/reader_xyz.cpp | 12 +- src/region.cpp | 8 +- src/region_cylinder.cpp | 2 +- src/region_intersect.cpp | 2 +- src/region_sphere.cpp | 2 +- src/region_union.cpp | 2 +- src/replicate.cpp | 2 +- src/rerun.cpp | 4 +- src/reset_mol_ids.cpp | 4 +- src/respa.cpp | 4 +- src/run.cpp | 4 +- src/set.cpp | 6 +- src/special.cpp | 2 +- src/thermo.cpp | 32 +- src/universe.cpp | 14 +- src/update.cpp | 10 +- src/utils.cpp | 20 +- src/utils.h | 10 +- src/variable.cpp | 274 +++++++-------- src/variable.h | 4 +- src/velocity.cpp | 32 +- src/write_coeff.cpp | 14 +- src/write_data.cpp | 12 +- src/write_dump.cpp | 2 +- src/write_restart.cpp | 14 +- 1217 files changed, 8605 insertions(+), 8605 deletions(-) diff --git a/lib/atc/ATC_Coupling.cpp b/lib/atc/ATC_Coupling.cpp index db72b0cb0..552bb9bb3 100644 --- a/lib/atc/ATC_Coupling.cpp +++ b/lib/atc/ATC_Coupling.cpp @@ -30,26 +30,26 @@ namespace ATC { useFeMdMassMatrix_(false), trackCharge_(false), temperatureDef_(NONE), - prescribedDataMgr_(NULL), - physicsModel_(NULL), + prescribedDataMgr_(nullptr), + physicsModel_(nullptr), extrinsicModelManager_(this), - atomicRegulator_(NULL), + atomicRegulator_(nullptr), atomQuadForInternal_(true), - elementMask_(NULL), - elementMaskMass_(NULL), - elementMaskMassMd_(NULL), - nodalAtomicMass_(NULL), - nodalAtomicCount_(NULL), - nodalAtomicHeatCapacity_(NULL), - internalToMask_(NULL), - internalElement_(NULL), - ghostElement_(NULL), - nodalGeometryType_(NULL), + elementMask_(nullptr), + elementMaskMass_(nullptr), + elementMaskMassMd_(nullptr), + nodalAtomicMass_(nullptr), + nodalAtomicCount_(nullptr), + nodalAtomicHeatCapacity_(nullptr), + internalToMask_(nullptr), + internalElement_(nullptr), + ghostElement_(nullptr), + nodalGeometryType_(nullptr), bndyIntType_(NO_QUADRATURE), - bndyFaceSet_(NULL), - atomicWeightsMask_(NULL), - shpFcnMask_(NULL), - shpFcnDerivsMask_(NULL), + bndyFaceSet_(nullptr), + atomicWeightsMask_(nullptr), + shpFcnMask_(nullptr), + shpFcnDerivsMask_(nullptr), sourceIntegration_(FULL_DOMAIN) { // size the field mask @@ -68,7 +68,7 @@ namespace ATC { ATC_Coupling::~ATC_Coupling() { interscaleManager_.clear(); - if (feEngine_) { delete feEngine_; feEngine_ = NULL; } + if (feEngine_) { delete feEngine_; feEngine_ = nullptr; } if (physicsModel_) delete physicsModel_; if (atomicRegulator_) delete atomicRegulator_; if (prescribedDataMgr_) delete prescribedDataMgr_; @@ -127,7 +127,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -164,7 +164,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // fix current value if (narg == argIdx) { set nodeSet = (feEngine_->fe_mesh())->nodeset(nsetName); @@ -258,7 +258,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string esetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { string a(arg[argIdx]); @@ -367,7 +367,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -529,7 +529,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - UXT_Function * f = NULL; + UXT_Function * f = nullptr; // parse linear if (narg == argIdx+2) { f = UXT_Function_Mgr::instance()->linear_function(atof(arg[argIdx]),atof(arg[argIdx+1])); @@ -760,7 +760,7 @@ namespace ATC { WeakEquation::PDE_Type ATC_Coupling::pde_type(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return WeakEquation::PROJECTION_PDE; + if (weakEq == nullptr) return WeakEquation::PROJECTION_PDE; return weakEq->type(); } //-------------------------------------------------- @@ -768,7 +768,7 @@ namespace ATC { bool ATC_Coupling::is_dynamic(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return false; + if (weakEq == nullptr) return false; return (physicsModel_->weak_equation(fieldName)->type() == WeakEquation::DYNAMIC_PDE); } diff --git a/lib/atc/ATC_Coupling.h b/lib/atc/ATC_Coupling.h index 9f406febb..e119b6873 100644 --- a/lib/atc/ATC_Coupling.h +++ b/lib/atc/ATC_Coupling.h @@ -114,10 +114,10 @@ namespace ATC { FIELDS &rhs, const Array< std::set > atomMaterialGroups, const VectorDependencyManager * shpFcnDerivs, - const SPAR_MAN * shpFcn = NULL, - const DIAG_MAN * atomicWeights = NULL, - const MatrixDependencyManager * elementMask = NULL, - const SetDependencyManager * nodeSet = NULL); + const SPAR_MAN * shpFcn = nullptr, + const DIAG_MAN * atomicWeights = nullptr, + const MatrixDependencyManager * elementMask = nullptr, + const SetDependencyManager * nodeSet = nullptr); /** access to full right hand side / forcing vector */ FIELDS &rhs() {return rhs_;}; Array2D rhs_mask() const { @@ -152,14 +152,14 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, // = FULL_DOMAIN - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** wrapper for FE_Engine's compute_tangent_matrix */ void compute_rhs_tangent(const std::pair row_col, const RHS_MASK & rhsMask, const FIELDS & fields, SPAR_MAT & stiffness, const IntegrationDomainType integrationType, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); void tangent_matrix(const std::pair row_col, const RHS_MASK & rhsMask, const PhysicsModel * physicsModel, @@ -197,7 +197,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } else { @@ -206,7 +206,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } } @@ -233,7 +233,7 @@ namespace ATC { /** access to time integrator */ const TimeIntegrator * time_integrator(const FieldName & field) const { _ctiIt_ = timeIntegrators_.find(field); - if (_ctiIt_ == timeIntegrators_.end()) return NULL; + if (_ctiIt_ == timeIntegrators_.end()) return nullptr; return _ctiIt_->second; }; @@ -322,7 +322,7 @@ namespace ATC { void compute_flux(const Array2D & rhs_mask, const FIELDS &fields, GRAD_FIELD_MATS &flux, - const PhysicsModel * physicsModel=NULL, + const PhysicsModel * physicsModel=nullptr, const bool normalize = false); /** evaluate rhs on the atomic domain which is near the FE region */ void masked_atom_domain_rhs_integral(const Array2D & rhs_mask, @@ -334,7 +334,7 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** access to boundary fluxes */ DENS_MAT &get_boundary_flux(FieldName thisField){return boundaryFlux_[thisField].set_quantity();}; DENS_MAN &boundary_flux(FieldName thisField){return boundaryFlux_[thisField];}; @@ -352,7 +352,7 @@ namespace ATC { // mass matrix filtering void delete_mass_mat_time_filter(FieldName thisField); /** compute mass matrix for requested field */ - void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = NULL); + void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = nullptr); /** updates filtering of MD contributions */ void update_mass_matrix(FieldName thisField); /** compute the mass matrix components coming from MD integration */ diff --git a/lib/atc/ATC_CouplingEnergy.cpp b/lib/atc/ATC_CouplingEnergy.cpp index c3b07c242..8fae1f070 100644 --- a/lib/atc/ATC_CouplingEnergy.cpp +++ b/lib/atc/ATC_CouplingEnergy.cpp @@ -30,8 +30,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL) + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr) { // Allocate PhysicsModel create_physics_model(THERMAL, matParamFile); @@ -103,7 +103,7 @@ namespace ATC { // always need kinetic energy AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_CouplingMomentumEnergy.cpp b/lib/atc/ATC_CouplingMomentumEnergy.cpp index 1fc293197..32df5fd7b 100644 --- a/lib/atc/ATC_CouplingMomentumEnergy.cpp +++ b/lib/atc/ATC_CouplingMomentumEnergy.cpp @@ -32,8 +32,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL), + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr), refPE_(0) { // Allocate PhysicsModel @@ -190,7 +190,7 @@ namespace ATC { FieldManager fieldManager(this); PerAtomQuantity * fluctuatingAtomicVelocity = fieldManager.per_atom_quantity("AtomicFluctuatingVelocity"); // also creates ProlongedVelocity AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this,fluctuatingAtomicVelocity); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_Method.cpp b/lib/atc/ATC_Method.cpp index f2173e957..113d175e2 100644 --- a/lib/atc/ATC_Method.cpp +++ b/lib/atc/ATC_Method.cpp @@ -35,37 +35,37 @@ using std::pair; namespace ATC { ATC_Method::ATC_Method(string groupName, double ** & perAtomArray, LAMMPS_NS::Fix * thisFix) : - nodalAtomicVolume_(NULL), + nodalAtomicVolume_(nullptr), needReset_(true), lammpsInterface_(LammpsInterface::instance()), interscaleManager_(this), timeFilterManager_(this), integrateInternalAtoms_(false), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), ghostManager_(this), - feEngine_(NULL), + feEngine_(nullptr), initialized_(false), meshDataInitialized_(false), localStep_(0), sizeComm_(8), // 3 positions + 1 material id * 2 for output - atomCoarseGrainingPositions_(NULL), - atomGhostCoarseGrainingPositions_(NULL), - atomProcGhostCoarseGrainingPositions_(NULL), - atomReferencePositions_(NULL), + atomCoarseGrainingPositions_(nullptr), + atomGhostCoarseGrainingPositions_(nullptr), + atomProcGhostCoarseGrainingPositions_(nullptr), + atomReferencePositions_(nullptr), nNodes_(0), nsd_(lammpsInterface_->dimension()), - xref_(NULL), + xref_(nullptr), readXref_(false), needXrefProcessorGhosts_(false), trackDisplacement_(false), needsAtomToElementMap_(true), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalElementSet_(""), - atomMasses_(NULL), - atomPositions_(NULL), - atomVelocities_(NULL), - atomForces_(NULL), + atomMasses_(nullptr), + atomPositions_(nullptr), + atomVelocities_(nullptr), + atomForces_(nullptr), parallelConsistency_(true), outputNow_(false), outputTime_(true), @@ -79,13 +79,13 @@ namespace ATC { sizeVector_(0), scalarVectorFreq_(0), sizePerAtomCols_(4), - perAtomOutput_(NULL), + perAtomOutput_(nullptr), perAtomArray_(perAtomArray), extScalar_(0), extVector_(0), - extList_(NULL), + extList_(nullptr), thermoEnergyFlag_(0), - atomVolume_(NULL), + atomVolume_(nullptr), atomicWeightsWriteFlag_(false), atomicWeightsWriteFrequency_(0), atomWeightType_(LATTICE), @@ -103,12 +103,12 @@ namespace ATC { mdMassNormalization_(false), kernelBased_(false), kernelOnTheFly_(false), - kernelFunction_(NULL), + kernelFunction_(nullptr), bondOnTheFly_(false), - accumulant_(NULL), - accumulantMol_(NULL), - accumulantMolGrad_(NULL), - accumulantWeights_(NULL), + accumulant_(nullptr), + accumulantMol_(nullptr), + accumulantMolGrad_(nullptr), + accumulantWeights_(nullptr), accumulantInverseVolumes_(&invNodeVolumes_), accumulantBandwidth_(0), useRestart_(false), @@ -117,7 +117,7 @@ namespace ATC { setRefPEvalue_(false), refPEvalue_(0.), readRefPE_(false), - nodalRefPotentialEnergy_(NULL), + nodalRefPotentialEnergy_(nullptr), simTime_(0.0), stepCounter_(0) { @@ -1122,7 +1122,7 @@ pecified FieldName & thisField, int & thisIndex) { string thisName = args[argIdx++]; - if (args[argIdx] == NULL) { + if (args[argIdx] == nullptr) { throw ATC_Error("Need to give field '"+thisName+"' more args"); } thisField = string_to_field(thisName); @@ -1282,7 +1282,7 @@ pecified if (this->reset_methods()) { // clear memory manager interscaleManager_.clear_temporary_data(); - atomVolume_ = NULL; + atomVolume_ = nullptr; // reference positions and energy if (!initialized_) { @@ -1517,7 +1517,7 @@ pecified } else { // set variables to compute atomic weights - DENS_MAN * nodalVolume(NULL); + DENS_MAN * nodalVolume(nullptr); switch (atomWeightType_) { case USER: atomVolume_ = new AtomVolumeUser(this,Valpha_); diff --git a/lib/atc/ATC_Method.h b/lib/atc/ATC_Method.h index e356243e0..0779990a9 100644 --- a/lib/atc/ATC_Method.h +++ b/lib/atc/ATC_Method.h @@ -423,7 +423,7 @@ namespace ATC { bool use_md_mass_normalization() const { return mdMassNormalization_;} bool kernel_based() { return kernelBased_; } bool kernel_on_the_fly() const { return kernelOnTheFly_;} - bool has_kernel_function() { return kernelFunction_ != NULL; } + bool has_kernel_function() { return kernelFunction_ != nullptr; } KernelFunction * kernel_function() { return kernelFunction_; } std::vector & type_list() { return typeList_; } std::vector & group_list() { return groupList_; } diff --git a/lib/atc/ATC_Transfer.cpp b/lib/atc/ATC_Transfer.cpp index 833e1d1f2..a9e87e3ff 100644 --- a/lib/atc/ATC_Transfer.cpp +++ b/lib/atc/ATC_Transfer.cpp @@ -68,19 +68,19 @@ namespace ATC { LAMMPS_NS::Fix * thisFix, string matParamFile) : ATC_Method(groupName,perAtomArray,thisFix), - xPointer_(NULL), + xPointer_(nullptr), outputStepZero_(true), neighborReset_(false), - pairMap_(NULL), - bondMatrix_(NULL), - pairVirial_(NULL), - pairHeatFlux_(NULL), + pairMap_(nullptr), + bondMatrix_(nullptr), + pairVirial_(nullptr), + pairHeatFlux_(nullptr), nComputes_(0), hasPairs_(true), hasBonds_(false), resetKernelFunction_(false), dxaExactMode_(true), - cauchyBornStress_(NULL) + cauchyBornStress_(nullptr) { nTypes_ = lammpsInterface_->ntypes(); @@ -114,7 +114,7 @@ namespace ATC { rateFlags_ = false; outputFields_.resize(NUM_TOTAL_FIELDS); - for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = NULL; } + for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = nullptr; } // Hardy requires ref positions for processor ghosts for bond list @@ -491,7 +491,7 @@ namespace ATC { ComputedAtomQuantity * c = new ComputedAtomQuantity(this, tag); interscaleManager_.add_per_atom_quantity(c,tag); int projection = iter->second; - DIAG_MAN * w = NULL; + DIAG_MAN * w = nullptr; if (projection == VOLUME_NORMALIZATION ) { w = accumulantInverseVolumes_; } else if (projection == NUMBER_NORMALIZATION ) @@ -976,7 +976,7 @@ namespace ATC { DENS_MAT & H = hardyData_["displacement_gradient"].set_quantity(); DENS_MAT E(H.nRows(),1); ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); //DENS_MAT & T = hardyData_["temperature"]; //cauchy_born_entropic_energy(H,E,T); E += hardyData_["internal_energy"]; cauchy_born_energy(H, E, temp); @@ -988,14 +988,14 @@ namespace ATC { // compute: cauchy born stress if (fieldFlags_(CAUCHY_BORN_STRESS)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_stress(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_stress"].set_quantity(), temp); } // compute: cauchy born energy if (fieldFlags_(CAUCHY_BORN_ENERGY)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_energy(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_energy"].set_quantity(), temp); } diff --git a/lib/atc/Array.h b/lib/atc/Array.h index 21e66a955..c29729d32 100644 --- a/lib/atc/Array.h +++ b/lib/atc/Array.h @@ -78,7 +78,7 @@ protected: template Array::Array(void) { len_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -90,8 +90,8 @@ Array::Array(int len) { template Array::Array(const Array& A) { len_ = A.len_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[len_]; for(int i=0;i::Array(const Array& A) { template Array::~Array() { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; } template @@ -111,12 +111,12 @@ void Array::reset(int len) { } else { // size change, realloc memory len_ = len; - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; if (len_ > 0) data_ = new T[len_]; else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -130,7 +130,7 @@ void Array::resize(int len, bool copy) { else { // size change, realloc memory len_ = len; if (len_ > 0) { - if (copy && data_ != NULL) { + if (copy && data_ != nullptr) { Array temp(*this); delete[] data_; data_ = new T[len_]; @@ -140,12 +140,12 @@ void Array::resize(int len, bool copy) { } } else { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; data_ = new T[len_]; } } else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -158,10 +158,10 @@ T& Array::operator() (int i) { template Array& Array::operator= (const Array &other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS len_ = other.len_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[len_]; } @@ -250,7 +250,7 @@ T* Array::ptr() const { template void Array::print(std::string name) const { std::cout << "------- Begin "<::AliasArray(const Array& A) { template AliasArray::~AliasArray(void) { len_ = 0; - data_ = NULL; // trick base class into not deleting parent data + data_ = nullptr; // trick base class into not deleting parent data } template diff --git a/lib/atc/Array2D.h b/lib/atc/Array2D.h index 25f895f72..37b7dcb3c 100644 --- a/lib/atc/Array2D.h +++ b/lib/atc/Array2D.h @@ -57,7 +57,7 @@ template Array2D::Array2D() { nrows_ = 0; ncols_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -71,8 +71,8 @@ template Array2D::Array2D(const Array2D& A) { nrows_ = A.nrows_; ncols_ = A.ncols_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[nrows_ * ncols_]; for(int i=0;i::reset(int nrows, int ncols) { else { // size changed; realloc memory nrows_ = nrows; ncols_ = ncols; - if (data_ != NULL) + if (data_ != nullptr) delete [] data_; if (ncols_ > 0 && nrows_ > 0) data_ = new T[nrows_ * ncols_]; else { - data_ = NULL; + data_ = nullptr; nrows_ = 0; ncols_ = 0; } @@ -120,11 +120,11 @@ AliasArray Array2D::column(int col) const { template Array2D& Array2D::operator= (const Array2D& other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS nrows_ = other.nrows_; ncols_ = other.ncols_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[nrows_ * ncols_]; } @@ -170,14 +170,14 @@ void Array2D::write_restart(FILE *f) const { template Array2D::~Array2D() { - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; } template void Array2D::print(std::string name) const { std::cout << "------- Begin "< >::iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { data = new DENS_MAN(nNodes_,nCols); @@ -115,14 +115,14 @@ namespace ATC { //-------------------------------------------------------- // get_regulator_data: - // gets a pointer to the requested data, or NULL if + // gets a pointer to the requested data, or nullptr if // if doesn't exist //-------------------------------------------------------- const DENS_MAN * AtomicRegulator::regulator_data(const string tag) const { map >::const_iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { - return NULL; + return nullptr; } else { return const_cast((it->second).second); @@ -521,7 +521,7 @@ namespace ATC { fieldMask_(NUM_FIELDS,NUM_FLUX), nNodes_(atomicRegulator_->num_nodes()), regulatorPrefix_(atomicRegulator->regulator_prefix()+regulatorPrefix), - shpFcnDerivs_(NULL) + shpFcnDerivs_(nullptr) { fieldMask_ = false; } @@ -552,21 +552,21 @@ namespace ATC { RegulatorShapeFunction::RegulatorShapeFunction(AtomicRegulator * atomicRegulator, const string & regulatorPrefix) : RegulatorMethod(atomicRegulator,regulatorPrefix), - lambda_(NULL), - atomLambdas_(NULL), - shapeFunctionMatrix_(NULL), + lambda_(nullptr), + atomLambdas_(nullptr), + shapeFunctionMatrix_(nullptr), linearSolverType_(AtomicRegulator::NO_SOLVE), maxIterations_(atomicRegulator->max_iterations()), tolerance_(atomicRegulator->tolerance()), - matrixSolver_(NULL), - regulatedNodes_(NULL), - applicationNodes_(NULL), - boundaryNodes_(NULL), - shpFcn_(NULL), - atomicWeights_(NULL), - elementMask_(NULL), - lambdaAtomMap_(NULL), - weights_(NULL), + matrixSolver_(nullptr), + regulatedNodes_(nullptr), + applicationNodes_(nullptr), + boundaryNodes_(nullptr), + shpFcn_(nullptr), + atomicWeights_(nullptr), + elementMask_(nullptr), + lambdaAtomMap_(nullptr), + weights_(nullptr), nsd_(atomicRegulator_->nsd()), nLocal_(atomicRegulator_->nlocal()) { diff --git a/lib/atc/AtomicRegulator.h b/lib/atc/AtomicRegulator.h index b9fccb902..360af3a4f 100644 --- a/lib/atc/AtomicRegulator.h +++ b/lib/atc/AtomicRegulator.h @@ -143,7 +143,7 @@ namespace ATC { /** can externally set regulator dynamic contributions */ virtual void reset_lambda_contribution(const DENS_MAT & /* target */, const FieldName /* field */) {}; virtual void reset_lambda_contribution(const DENS_MAT & target) { reset_lambda_contribution(target,NUM_TOTAL_FIELDS); } - /** returns a const pointer to the DENS_MAN associated with the tag, or NULL */ + /** returns a const pointer to the DENS_MAN associated with the tag, or nullptr */ const DENS_MAN * regulator_data(const std::string tag) const; /** return the maximum number of iterations */ int max_iterations() {return maxIterations_;}; diff --git a/lib/atc/CauchyBorn.cpp b/lib/atc/CauchyBorn.cpp index 85b100ca6..81f7b4e1a 100644 --- a/lib/atc/CauchyBorn.cpp +++ b/lib/atc/CauchyBorn.cpp @@ -426,7 +426,7 @@ namespace ATC { for (INDEX j=i; j<3; j++) s(i,j) += factor * dd(i,j); - // If f_W is not NULL then append thermal contribution. + // If f_W is not nullptr then append thermal contribution. if (F_w) *F_w += 0.5*kb*T*log(detD); } //============================================================================ diff --git a/lib/atc/ChargeRegulator.cpp b/lib/atc/ChargeRegulator.cpp index bae78a761..972530829 100644 --- a/lib/atc/ChargeRegulator.cpp +++ b/lib/atc/ChargeRegulator.cpp @@ -164,7 +164,7 @@ namespace ATC { chargeRegulator_(chargeRegulator), lammpsInterface_(LammpsInterface::instance()), rC_(0), rCsq_(0), - targetValue_(NULL), + targetValue_(nullptr), targetPhi_(p.value), surface_(p.faceset), atomGroupBit_(p.groupBit), diff --git a/lib/atc/CloneVector.h b/lib/atc/CloneVector.h index 02db700f2..63d11636b 100644 --- a/lib/atc/CloneVector.h +++ b/lib/atc/CloneVector.h @@ -52,7 +52,7 @@ private: //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Vector &c) - : Vector(), _baseV(const_cast*>(&c)), _baseM(NULL) + : Vector(), _baseV(const_cast*>(&c)), _baseM(nullptr) {} //----------------------------------------------------------------------------- // Construct from a matrix, the const_cast isn't pretty @@ -65,7 +65,7 @@ CloneVector::CloneVector(const Vector &c) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(dim), _idx(idx) {} //----------------------------------------------------------------------------- @@ -73,7 +73,7 @@ CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const DiagonalMatrix &c, INDEX /* idx */) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(CLONE_DIAG), _idx(0) {} //----------------------------------------------------------------------------- diff --git a/lib/atc/ConcentrationRegulator.cpp b/lib/atc/ConcentrationRegulator.cpp index 4255b919b..499a5501c 100644 --- a/lib/atc/ConcentrationRegulator.cpp +++ b/lib/atc/ConcentrationRegulator.cpp @@ -186,14 +186,14 @@ const double kMinScale_ = 10000.; ConcentrationRegulator::ConcentrationRegulatorParameters & p) : ConcentrationRegulatorMethod(concReg), concentrationRegulator_(concReg), - interscaleManager_(NULL), + interscaleManager_(nullptr), lammpsInterface_(LammpsInterface::instance()), - list_(NULL), + list_(nullptr), targetConcentration_(p.value), targetCount_(0), elemset_(p.elemset), - p_(NULL), - randomNumberGenerator_(NULL), + p_(nullptr), + randomNumberGenerator_(nullptr), q0_(0), controlType_(p.type), controlIndex_(0), diff --git a/lib/atc/DenseMatrix.h b/lib/atc/DenseMatrix.h index e585289aa..e4759f02d 100644 --- a/lib/atc/DenseMatrix.h +++ b/lib/atc/DenseMatrix.h @@ -16,10 +16,10 @@ template class DenseMatrix : public Matrix { public: - DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); } - DenseMatrix(const DenseMatrix& c) : Matrix(), _data(NULL){ _copy(c); } - DenseMatrix(const SparseMatrix& c): Matrix(), _data(NULL){ c.dense_copy(*this);} - DenseMatrix(const Matrix& c) : Matrix(), _data(NULL){ _copy(c); } + DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(nullptr){ _create(rows, cols, z); } + DenseMatrix(const DenseMatrix& c) : Matrix(), _data(nullptr){ _copy(c); } + DenseMatrix(const SparseMatrix& c): Matrix(), _data(nullptr){ c.dense_copy(*this);} + DenseMatrix(const Matrix& c) : Matrix(), _data(nullptr){ _copy(c); } // const SparseMatrix * p = sparse_cast(&c); // (p) ? p->dense_copy(*this) : _copy(c); } ~DenseMatrix() { _delete();} @@ -261,7 +261,7 @@ void DenseMatrix::_delete() _nRows = _nCols = 0; if (_data){ delete [] _data; - _data = NULL; + _data = nullptr; } } //---------------------------------------------------------------------------- @@ -273,7 +273,7 @@ void DenseMatrix::_create(INDEX rows, INDEX cols, bool zero) _nRows=rows; _nCols=cols; - _data = (this->size() ? new T [_nCols*_nRows] : NULL); + _data = (this->size() ? new T [_nCols*_nRows] : nullptr); if (zero) this->zero(); } //---------------------------------------------------------------------------- diff --git a/lib/atc/DenseVector.h b/lib/atc/DenseVector.h index 38ed68f93..bab90bf3f 100644 --- a/lib/atc/DenseVector.h +++ b/lib/atc/DenseVector.h @@ -16,9 +16,9 @@ class DenseVector : public Vector { public: explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); } - DenseVector(const DenseVector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const Vector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(NULL) { copy(ptr,nrows); } + DenseVector(const DenseVector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const Vector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(nullptr) { copy(ptr,nrows); } virtual ~DenseVector() { _delete(); } //* resizes the Vector, ignores nCols, optionally copys what fits @@ -123,7 +123,7 @@ template inline void DenseVector::_create(INDEX n, bool zero) { _size=n; - _data = _size ? new T [_size] : NULL ; + _data = _size ? new T [_size] : nullptr ; if (zero) this->zero(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/lib/atc/DiagonalMatrix.h b/lib/atc/DiagonalMatrix.h index ca3001f22..b24e19dd4 100644 --- a/lib/atc/DiagonalMatrix.h +++ b/lib/atc/DiagonalMatrix.h @@ -205,7 +205,7 @@ DiagonalMatrix operator-(const DiagonalMatrix &A, const DiagonalMatrix //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) - : _data(NULL) + : _data(nullptr) { reset(rows, zero); } @@ -214,7 +214,7 @@ DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(c); } @@ -223,7 +223,7 @@ DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const Vector& v) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(v); } diff --git a/lib/atc/DislocationExtractor.h b/lib/atc/DislocationExtractor.h index c2bfe27e0..a0ba3aa99 100644 --- a/lib/atc/DislocationExtractor.h +++ b/lib/atc/DislocationExtractor.h @@ -197,7 +197,7 @@ protected: a.pos.Y = atom->x[i][1]; a.pos.Z = atom->x[i][2]; a.flags = 0; - a.cluster = NULL; + a.cluster = nullptr; a.numNeighbors = 0; a.setFlag(ATOM_IS_LOCAL_ATOM); } @@ -290,7 +290,7 @@ protected: currentAtom->pos.Y = atom->x[i][1]; currentAtom->pos.Z = atom->x[i][2]; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -302,7 +302,7 @@ protected: // Receive atoms from other processors. for(int iproc = 1; iproc < comm->nprocs; iproc++) { MPI_Status status; - MPI_Recv(buffer.empty() ? NULL : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); + MPI_Recv(buffer.empty() ? nullptr : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); int ndoubles; MPI_Get_count(&status, MPI_DOUBLE, &ndoubles); int nReceived = ndoubles / 3; @@ -314,7 +314,7 @@ protected: currentAtom->pos.Y = *data++; currentAtom->pos.Z = *data++; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -332,11 +332,11 @@ protected: *data++ = atom->x[i][2]; } // Send local atom coordinates to master proc. - MPI_Send(buffer.empty() ? NULL : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); + MPI_Send(buffer.empty() ? nullptr : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); } // Make sure all input atoms are wrapped at periodic boundary conditions. - wrapInputAtoms(NULL_VECTOR); + wrapInputAtoms(nullptr_VECTOR); // Build nearest neighbor lists. buildNearestNeighborLists(); @@ -376,7 +376,7 @@ protected: } } // Broadcast segments. - MPI_Bcast(segmentBuffer.empty() ? NULL : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(segmentBuffer.empty() ? nullptr : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract segments from receive buffer. @@ -402,7 +402,7 @@ protected: DISLOCATIONS_ASSERT(sendItem == pointBuffer.end()); } // Broadcast segments. - MPI_Bcast(pointBuffer.empty() ? NULL : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(pointBuffer.empty() ? nullptr : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract points from receive buffer. diff --git a/lib/atc/ElasticTimeIntegrator.cpp b/lib/atc/ElasticTimeIntegrator.cpp index 5e11f1584..785568cbb 100644 --- a/lib/atc/ElasticTimeIntegrator.cpp +++ b/lib/atc/ElasticTimeIntegrator.cpp @@ -184,8 +184,8 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicDisplacement_(NULL), - nodalAtomicForce_(NULL) + nodalAtomicDisplacement_(nullptr), + nodalAtomicForce_(nullptr) { // do nothing } @@ -410,9 +410,9 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), - nodalAtomicDisplacement_(NULL), + nodalAtomicDisplacement_(nullptr), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), nodalAtomicVelocityOld_(atc_->num_nodes(),atc_->nsd()) { @@ -633,7 +633,7 @@ namespace ATC { FluidsTimeIntegratorGear::FluidsTimeIntegratorGear(MomentumTimeIntegrator * momentumTimeIntegrator) : MomentumIntegrationMethod(momentumTimeIntegrator), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), atomicVelocityDelta_(atc_->num_nodes(),atc_->nsd()), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), diff --git a/lib/atc/ElectronHeatFlux.h b/lib/atc/ElectronHeatFlux.h index d0bc2a44f..4c5b6200d 100644 --- a/lib/atc/ElectronHeatFlux.h +++ b/lib/atc/ElectronHeatFlux.h @@ -17,7 +17,7 @@ namespace ATC { class ElectronHeatFlux { public: - ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFlux() {}; /** computes heat flux */ virtual void electron_heat_flux(const FIELD_MATS &fields, @@ -68,7 +68,7 @@ namespace ATC { { public: ElectronHeatFluxLinear(std::fstream &matfile,std::map & parameters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxLinear() {}; virtual void electron_heat_flux(const FIELD_MATS & /* fields */, const GRAD_FIELD_MATS &gradFields, @@ -95,7 +95,7 @@ namespace ATC { { public: ElectronHeatFluxPowerLaw(std::fstream &matfile,std::map ¶meters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxPowerLaw() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, @@ -134,8 +134,8 @@ ctivity proportional to the ratio of the electron and phonon temperatures with t public: ElectronHeatFluxThermopower(std::fstream &matfile, std::map & parameters, - /*const*/ ElectronFlux * electronFlux = NULL, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronFlux * electronFlux = nullptr, + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxThermopower() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, diff --git a/lib/atc/ExtrinsicModel.cpp b/lib/atc/ExtrinsicModel.cpp index b20b2a26d..8e0079d96 100644 --- a/lib/atc/ExtrinsicModel.cpp +++ b/lib/atc/ExtrinsicModel.cpp @@ -114,7 +114,7 @@ namespace ATC { ATC::LammpsInterface::instance()->print_msg_once(ss.str()); myModel = new ExtrinsicModelElectrostatic (this,modelType,matFileName); - } else myModel = NULL; + } else myModel = nullptr; extrinsicModels_.push_back(myModel); // add new fields to fields data @@ -157,7 +157,7 @@ namespace ATC { for(imodel=extrinsicModels_.begin(); imodel!=extrinsicModels_.end(); imodel++) { if ((*imodel)->model_type()==type) return *imodel; } - return NULL; + return nullptr; } @@ -343,7 +343,7 @@ namespace ATC { atc_(modelManager->atc()), modelManager_(modelManager), modelType_(modelType), - physicsModel_(NULL) + physicsModel_(nullptr) { rhsMaskIntrinsic_.reset(NUM_FIELDS,NUM_FLUX); rhsMaskIntrinsic_ = false; diff --git a/lib/atc/ExtrinsicModelDriftDiffusion.cpp b/lib/atc/ExtrinsicModelDriftDiffusion.cpp index f9b93a147..a9d8f2760 100644 --- a/lib/atc/ExtrinsicModelDriftDiffusion.cpp +++ b/lib/atc/ExtrinsicModelDriftDiffusion.cpp @@ -38,17 +38,17 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelTwoTemperature(modelManager,modelType,matFileName), - continuityIntegrator_(NULL), + continuityIntegrator_(nullptr), poissonSolverType_(DIRECT), // ITERATIVE | DIRECT - poissonSolver_(NULL), + poissonSolver_(nullptr), baseSize_(0), electronDensityEqn_(ELECTRON_CONTINUITY), fluxUpdateFreq_(1), schrodingerSolverType_(DIRECT), // ITERATIVE | DIRECT - schrodingerSolver_(NULL), + schrodingerSolver_(nullptr), schrodingerPoissonMgr_(), - schrodingerPoissonSolver_(NULL), + schrodingerPoissonSolver_(nullptr), maxConsistencyIter_(0), maxConstraintIter_(1), safe_dEf_(0.1), Ef_shift_(0.0), oneD_(false), oneDcoor_(0), oneDconserve_(0) @@ -351,7 +351,7 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelDriftDiffusion(modelManager,modelType,matFileName), - cddmPoissonSolver_(NULL), + cddmPoissonSolver_(nullptr), baseSize_(0) { // delete base class's version of the physics model diff --git a/lib/atc/ExtrinsicModelElectrostatic.cpp b/lib/atc/ExtrinsicModelElectrostatic.cpp index ef3aa52de..d0aa56d67 100644 --- a/lib/atc/ExtrinsicModelElectrostatic.cpp +++ b/lib/atc/ExtrinsicModelElectrostatic.cpp @@ -38,15 +38,15 @@ namespace ATC { poissonSolverType_(DIRECT), // ITERATIVE | DIRECT poissonSolverTol_(0), poissonSolverMaxIter_(0), - poissonSolver_(NULL), + poissonSolver_(nullptr), maxSolves_(0), baseSize_(0), - chargeRegulator_(NULL), + chargeRegulator_(nullptr), useSlab_(false), includeShortRange_(true), - atomForces_(NULL), - nodalAtomicCharge_(NULL), - nodalAtomicGhostCharge_(NULL) + atomForces_(nullptr), + nodalAtomicCharge_(nullptr), + nodalAtomicGhostCharge_(nullptr) { physicsModel_ = new PhysicsModelSpeciesElectrostatic(matFileName); // set up correct masks for coupling diff --git a/lib/atc/ExtrinsicModelTwoTemperature.cpp b/lib/atc/ExtrinsicModelTwoTemperature.cpp index 2be6cfeb3..35846fe49 100644 --- a/lib/atc/ExtrinsicModelTwoTemperature.cpp +++ b/lib/atc/ExtrinsicModelTwoTemperature.cpp @@ -26,7 +26,7 @@ namespace ATC { string matFileName) : ExtrinsicModel(modelManager,modelType,matFileName), electronTimeIntegration_(TimeIntegrator::IMPLICIT), - temperatureIntegrator_(NULL), + temperatureIntegrator_(nullptr), nsubcycle_(1), exchangeFlag_(true), baseSize_(0) @@ -164,7 +164,7 @@ namespace ATC { rhsMask(ELECTRON_TEMPERATURE,i) = atc_->fieldMask_(ELECTRON_TEMPERATURE,i); } if (electronTimeIntegration_ == TimeIntegrator::NONE) { - temperatureIntegrator_ = NULL; + temperatureIntegrator_ = nullptr; return; } if (temperatureIntegrator_) delete temperatureIntegrator_; diff --git a/lib/atc/FE_Element.cpp b/lib/atc/FE_Element.cpp index 0d2fc036c..299b9f191 100644 --- a/lib/atc/FE_Element.cpp +++ b/lib/atc/FE_Element.cpp @@ -36,7 +36,7 @@ static const double localCoordinatesTolerance = 1.e-09; tolerance_(localCoordinatesTolerance), projectionGuess_(COORDINATE_ALIGNED) { - feInterpolate_ = NULL; + feInterpolate_ = nullptr; } FE_Element::~FE_Element() diff --git a/lib/atc/FE_Engine.cpp b/lib/atc/FE_Engine.cpp index 5e01709b1..9e3c5180e 100644 --- a/lib/atc/FE_Engine.cpp +++ b/lib/atc/FE_Engine.cpp @@ -32,7 +32,7 @@ namespace ATC{ //----------------------------------------------------------------- FE_Engine::FE_Engine(MPI_Comm comm) : communicator_(comm), - feMesh_(NULL), + feMesh_(nullptr), initialized_(false), outputManager_() { diff --git a/lib/atc/FE_Engine.h b/lib/atc/FE_Engine.h index eb59f04ee..ade7626f8 100644 --- a/lib/atc/FE_Engine.h +++ b/lib/atc/FE_Engine.h @@ -90,7 +90,7 @@ namespace ATC { /** write data: data is arrayed over _unique_ nodes and then mapped by the engine */ - void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=NULL); + void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=nullptr); void write_data(double time, OUTPUT_LIST *data); void write_restart_file(std::string fileName, RESTART_LIST *data) @@ -150,7 +150,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute tangent matrix for a pair of fields - given quadrature */ void compute_tangent_matrix(const RHS_MASK &rhsMask, @@ -162,7 +162,7 @@ namespace ATC { const SPAR_MAT &N, const SPAR_MAT_VEC &dN, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a consistent mass matrix for a field */ void compute_mass_matrix( @@ -171,7 +171,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, CON_MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a dimensionless mass matrix */ void compute_mass_matrix(SPAR_MAT &mass_matrix) const; @@ -191,7 +191,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute dimensional lumped mass matrix using given quadrature */ void compute_lumped_mass_matrix( @@ -212,7 +212,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, FIELD_MATS &energy, - const DenseMatrix *elementMask=NULL, + const DenseMatrix *elementMask=nullptr, const IntegrationDomainType domain=FULL_DOMAIN) const; /** compute residual or RHS of the dynamic weak eqn */ @@ -223,7 +223,7 @@ namespace ATC { const Array &elementMaterials, FIELDS &rhs, bool freeOnly=false, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute RHS for given quadrature */ void compute_rhs_vector(const RHS_MASK &rhsMask, @@ -251,7 +251,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, GRAD_FIELD_MATS &flux, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute the flux on the MD/FE boundary */ void compute_boundary_flux(const RHS_MASK &rhsMask, @@ -272,8 +272,8 @@ namespace ATC { const SPAR_MAT_VEC &dN, const DIAG_MAT &flux_mask, FIELDS &rhs, - const DenseMatrix *elementMask=NULL, - const std::set *nodeSet=NULL) const; + const DenseMatrix *elementMask=nullptr, + const std::set *nodeSet=nullptr) const; /** compute prescribed flux given an array of functions of x & t */ void add_fluxes(const Array &fieldMask, @@ -465,7 +465,7 @@ namespace ATC { int nsd() const { return feMesh_->num_spatial_dimensions(); } /** return if the FE mesh has been created */ - int has_mesh() const { return feMesh_!=NULL; } + int has_mesh() const { return feMesh_!=nullptr; } /** get nodal coordinates for a given element */ void element_coordinates(const int eltIdx, DENS_MAT &coords) diff --git a/lib/atc/FE_Mesh.cpp b/lib/atc/FE_Mesh.cpp index 4ea10a681..6af29ee37 100644 --- a/lib/atc/FE_Mesh.cpp +++ b/lib/atc/FE_Mesh.cpp @@ -46,7 +46,7 @@ namespace ATC { partitioned_(false), nNodes_(0), nNodesUnique_(0), - feElement_(NULL), + feElement_(nullptr), twoDimensional_(false), hasPlanarFaces_(false) @@ -1708,7 +1708,7 @@ namespace ATC { const Array< pair< string, set > > *nodeSets): FE_Mesh(), minEltSize_(0), - tree_(NULL) + tree_(nullptr) { // Pick which element class to make if (elementType == "HEX8") { @@ -1774,7 +1774,7 @@ namespace ATC { } // Insert nodes and elements into KD-tree for PIE search. - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); } @@ -2107,7 +2107,7 @@ namespace ATC { // use the KD tree for partitioning, getting more blocks than // processors - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); @@ -2519,7 +2519,7 @@ namespace ATC { const double zscale) : hx_(hx), hy_(hy), hz_(hz) { - tree_ = NULL; + tree_ = nullptr; hasPlanarFaces_ = true; xscale_ = xscale; yscale_ = yscale; @@ -2820,7 +2820,7 @@ namespace ATC { const double zscale) { hasPlanarFaces_ = true; - tree_ = NULL; + tree_ = nullptr; xscale_ = xscale; yscale_ = yscale; zscale_ = zscale; diff --git a/lib/atc/FieldEulerIntegrator.cpp b/lib/atc/FieldEulerIntegrator.cpp index 0abc71cba..ba23af40c 100644 --- a/lib/atc/FieldEulerIntegrator.cpp +++ b/lib/atc/FieldEulerIntegrator.cpp @@ -112,7 +112,7 @@ FieldImplicitDirectEulerIntegrator::FieldImplicitDirectEulerIntegrator( const Array2D< bool > & rhsMask, // copy const double alpha ) : FieldEulerIntegrator(fieldName,physicsModel,feEngine,atc,rhsMask), - alpha_(alpha),solver_(NULL) + alpha_(alpha),solver_(nullptr) { rhsMask_(fieldName_,FLUX) = false; // handle laplacian term with stiffness const BC_SET & bcs = (atc_->prescribed_data_manager()->bcs(fieldName_))[0]; diff --git a/lib/atc/FieldManager.cpp b/lib/atc/FieldManager.cpp index 338f06aca..8a7fb0d50 100644 --- a/lib/atc/FieldManager.cpp +++ b/lib/atc/FieldManager.cpp @@ -271,7 +271,7 @@ typedef PerAtomQuantity PAQ; u = new AtfShapeFunctionMdProjection(atc_,restricted,VELOCITY); } else { - DENS_MAN * q = NULL; + DENS_MAN * q = nullptr; if (atc_->kernel_on_the_fly()) { if (atc_->kernel_based()) { q = new OnTheFlyKernelAccumulationNormalized(atc_, atomic, diff --git a/lib/atc/FieldManager.h b/lib/atc/FieldManager.h index 9a9867641..b12db230c 100644 --- a/lib/atc/FieldManager.h +++ b/lib/atc/FieldManager.h @@ -47,7 +47,7 @@ namespace ATC { case SPECIES_FLUX: return species_flux(name); case INTERNAL_ENERGY: return internal_energy(name); case ENERGY: return energy(name); - default: throw ATC_Error("FieldManager:: unknown field"); return NULL; + default: throw ATC_Error("FieldManager:: unknown field"); return nullptr; } } CanonicalName string_to_canonical_name(std::string name){ @@ -83,11 +83,11 @@ namespace ATC { case PROLONGED_VELOCITY: return prolonged_field(VELOCITY); default: - throw ATC_Error("FieldManager:: unknown PAQ"); return NULL; + throw ATC_Error("FieldManager:: unknown PAQ"); return nullptr; } } /** this function returns a restriction of atomic data */ - DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = NULL); + DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = nullptr); protected: ATC_Method * atc_; InterscaleManager & interscaleManager_; @@ -120,10 +120,10 @@ namespace ATC { PAQ * atomic_species_vector(); // internal functions - DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = NULL); - DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = NULL); - DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = NULL); - DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return NULL;}; + DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = nullptr); + DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = nullptr); + DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = nullptr); + DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return nullptr;}; PAQ * prolonged_field(FieldName field); private: FieldManager(void); diff --git a/lib/atc/Function.cpp b/lib/atc/Function.cpp index 062cbcb9b..e73d64aae 100644 --- a/lib/atc/Function.cpp +++ b/lib/atc/Function.cpp @@ -26,13 +26,13 @@ namespace ATC { //==================================================================== // UXT_Function_Mgr //==================================================================== - UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = NULL; + UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- UXT_Function_Mgr * UXT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new UXT_Function_Mgr(); } return myInstance_; @@ -90,7 +90,7 @@ namespace ATC { { string tag = other->tag(); - UXT_Function * returnFunction = NULL; + UXT_Function * returnFunction = nullptr; if (tag=="linear") { ScalarLinearFunction * other_cast = (ScalarLinearFunction*) other; returnFunction = new ScalarLinearFunction(*other_cast); @@ -144,14 +144,14 @@ namespace ATC { // XT_Function_Mgr //-------------------------------------------------------------------- //-------------------------------------------------------------------- -XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; +XT_Function_Mgr * XT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- XT_Function_Mgr * XT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new XT_Function_Mgr(); } return myInstance_; @@ -227,7 +227,7 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; { string tag = other->tag(); - XT_Function * returnFunction = NULL; + XT_Function * returnFunction = nullptr; if (tag=="linear") { LinearFunction * other_cast = (LinearFunction*) other; returnFunction = new LinearFunction(*other_cast); diff --git a/lib/atc/FundamentalAtomicQuantity.cpp b/lib/atc/FundamentalAtomicQuantity.cpp index 0ebb54e16..63824bd0d 100644 --- a/lib/atc/FundamentalAtomicQuantity.cpp +++ b/lib/atc/FundamentalAtomicQuantity.cpp @@ -126,7 +126,7 @@ namespace ATC { double unitsConversion, AtomType atomType) : ShallowAtomQuantity(atc,0,atomType), - computePointer_(NULL), + computePointer_(nullptr), computeTag_(tag), unitsConversion_(unitsConversion) { diff --git a/lib/atc/FundamentalAtomicQuantity.h b/lib/atc/FundamentalAtomicQuantity.h index 5fb525cd6..d5cf9f8a2 100644 --- a/lib/atc/FundamentalAtomicQuantity.h +++ b/lib/atc/FundamentalAtomicQuantity.h @@ -131,11 +131,11 @@ namespace ATC { /** gets appropriate pointer for lammps data */ virtual double * lammps_scalar() const - {return NULL;}; + {return nullptr;}; /** gets appropriate pointer for lammps data */ virtual double ** lammps_vector() const - {return NULL;}; + {return nullptr;}; private: diff --git a/lib/atc/GhostManager.cpp b/lib/atc/GhostManager.cpp index 77594ec40..1482a5a47 100644 --- a/lib/atc/GhostManager.cpp +++ b/lib/atc/GhostManager.cpp @@ -23,7 +23,7 @@ namespace ATC { // Constructor //-------------------------------------------------------- GhostManager::GhostManager(ATC_Method * atc) : - ghostModifier_(NULL), + ghostModifier_(nullptr), atc_(atc), boundaryDynamics_(NO_BOUNDARY_DYNAMICS), needReset_(true) @@ -116,7 +116,7 @@ namespace ATC { { if (ghostModifier_) { delete ghostModifier_; - ghostModifier_ = NULL; + ghostModifier_ = nullptr; } if (!atc_->groupbit_ghost()) { @@ -252,7 +252,7 @@ namespace ATC { //-------------------------------------------------------- GhostModifier::GhostModifier(GhostManager * ghostManager) : ghostManager_(ghostManager), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), integrateAtoms_(false) { // do nothing @@ -321,9 +321,9 @@ namespace ATC { //-------------------------------------------------------- GhostModifierPrescribed::GhostModifierPrescribed(GhostManager * ghostManager) : GhostModifier(ghostManager), - atomPositions_(NULL), - atomFeDisplacement_(NULL), - atomRefPositions_(NULL) + atomPositions_(nullptr), + atomFeDisplacement_(nullptr), + atomRefPositions_(nullptr) { // do nothing } @@ -382,9 +382,9 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierPrescribed(ghostManager), - atomVelocities_(NULL), - atomFeVelocity_(NULL), - atomForces_(NULL), + atomVelocities_(nullptr), + atomFeVelocity_(nullptr), + atomForces_(nullptr), kappa_(kappa), gamma_(gamma), mu_(mu) @@ -486,8 +486,8 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierDampedHarmonic(ghostManager,kappa,gamma,mu), - ghostToBoundaryDistance_(NULL), - layerId_(NULL) + ghostToBoundaryDistance_(nullptr), + layerId_(nullptr) { // do nothing @@ -731,8 +731,8 @@ namespace ATC { GhostModifier(ghostManager), lammpsInterface_(LammpsInterface::instance()), elementSet_((((ghostManager_->atc())->fe_engine())->fe_mesh())->elementset((ghostManager_->atc())->internal_element_set())), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalToAtom_((ghostManager_->atc())->internal_to_atom_map()), ghostToAtom_((ghostManager_->atc())->ghost_to_atom_map()), groupbit_((ghostManager_->atc())->groupbit()), diff --git a/lib/atc/InterscaleOperators.cpp b/lib/atc/InterscaleOperators.cpp index f1e5607b6..eeac14adf 100644 --- a/lib/atc/InterscaleOperators.cpp +++ b/lib/atc/InterscaleOperators.cpp @@ -30,7 +30,7 @@ namespace ATC{ for (unsigned int i = 0; i < NUM_ATOM_TYPES; i++) { fundamentalAtomQuantities_[i].resize(LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES); for (unsigned int j = 0; j < LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES; j++) - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } @@ -126,7 +126,7 @@ namespace ATC{ if (fundamentalAtomQuantities_[i][j]) { index = dfs_visit(fundamentalAtomQuantities_[i][j],index); if ((fundamentalAtomQuantities_[i][j])->memory_type()==TEMPORARY) { - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } } @@ -453,7 +453,7 @@ namespace ATC{ DependencyManager * InterscaleManager::find(const string & tag) { // REFACTOR add check for duplicate entries - DependencyManager * quantity = NULL; + DependencyManager * quantity = nullptr; quantity = find_in_list(perAtomQuantities_,tag); if (quantity) return quantity; @@ -482,7 +482,7 @@ namespace ATC{ quantity = find_in_list(smallMoleculeSets_,tag); if (quantity) return quantity; - return NULL; + return nullptr; } //-------------------------------------------------------- diff --git a/lib/atc/InterscaleOperators.h b/lib/atc/InterscaleOperators.h index 3a4d81212..40c5144bf 100644 --- a/lib/atc/InterscaleOperators.h +++ b/lib/atc/InterscaleOperators.h @@ -277,7 +277,7 @@ namespace ATC { data * return_quantity(std::map & list, const std::string & tag) { typename std::map::iterator it = list.find(tag); - if (it==list.end()) return NULL; + if (it==list.end()) return nullptr; return it->second; } @@ -310,7 +310,7 @@ namespace ATC { { typename std::map::iterator it = list.find(tag); if (it!=list.end()) return it->second; - return NULL; + return nullptr; } /** helper function to force the reset of all data in a list */ diff --git a/lib/atc/KD_Tree.cpp b/lib/atc/KD_Tree.cpp index 1432663e8..181be27dc 100644 --- a/lib/atc/KD_Tree.cpp +++ b/lib/atc/KD_Tree.cpp @@ -83,17 +83,17 @@ KD_Tree::KD_Tree(vector *points, vector *elements, if (foundElemRight) rightElems->push_back(*elit); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - leftElems->size() < 4 || leftElems->size() == 0) { - leftChild_ = NULL; + leftChild_ = nullptr; delete leftPts; delete leftElems; } else { leftChild_ = new KD_Tree(leftPts, leftElems, (dimension+1) % 3); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - rightElems->size() < 4 || rightElems->size() == 0) { - rightChild_ = NULL; + rightChild_ = nullptr; delete rightPts; delete rightElems; } else { @@ -109,7 +109,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { // tree, either recurse to the left or return this node's elements // if there is no left child. if (query.lessThanInDimension(value_, dimension)) { - if (leftChild_ == NULL) { + if (leftChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -119,7 +119,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { } return leftChild_->find_nearest_elements(query, (dimension+1) % 3); } else { - if (rightChild_ == NULL) { + if (rightChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -147,7 +147,7 @@ vector > KD_Tree::getElemIDs(int depth) { sort(candElemIDs.begin(), candElemIDs.end()); result.push_back(candElemIDs); - } else if (leftChild_ == NULL || rightChild_ == NULL) { + } else if (leftChild_ == nullptr || rightChild_ == nullptr) { // Insert all nodes at this level once, // then insert a bunch of empty vectors. temp = this->getElemIDs(0); diff --git a/lib/atc/KernelFunction.cpp b/lib/atc/KernelFunction.cpp index 70a1616e0..6095c1428 100644 --- a/lib/atc/KernelFunction.cpp +++ b/lib/atc/KernelFunction.cpp @@ -20,13 +20,13 @@ namespace ATC { //======================================================================== // KernelFunctionMgr //======================================================================== - KernelFunctionMgr * KernelFunctionMgr::myInstance_ = NULL; + KernelFunctionMgr * KernelFunctionMgr::myInstance_ = nullptr; //------------------------------------------------------------------------ // instance //------------------------------------------------------------------------ KernelFunctionMgr * KernelFunctionMgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new KernelFunctionMgr(); } return myInstance_; @@ -65,7 +65,7 @@ namespace ATC { No default */ int argIdx = 0; - KernelFunction * ptr = NULL; + KernelFunction * ptr = nullptr; char* type = arg[argIdx++]; if (strcmp(type,"step")==0) { double parameters[1] = {atof(arg[argIdx])}; // cutoff radius diff --git a/lib/atc/KinetoThermostat.cpp b/lib/atc/KinetoThermostat.cpp index c10f7eb45..89d598c10 100644 --- a/lib/atc/KinetoThermostat.cpp +++ b/lib/atc/KinetoThermostat.cpp @@ -151,7 +151,7 @@ namespace ATC { VelocityRescaleCombined::VelocityRescaleCombined(AtomicRegulator * kinetostat) : VelocityGlc(kinetostat), velocity_(atc_->field(VELOCITY)), - thermostatCorrection_(NULL) + thermostatCorrection_(nullptr) { // do nothing } @@ -188,7 +188,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleCombined::ThermostatRescaleCombined(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -226,14 +226,14 @@ namespace ATC { KinetoThermostatRescale::KinetoThermostatRescale(AtomicRegulator * kinetoThermostat, int couplingMaxIterations) : KinetoThermostatShapeFunction(kinetoThermostat,couplingMaxIterations), - atomVelocities_(NULL), + atomVelocities_(nullptr), nodalVelocities_(atc_->field(VELOCITY)), - lambdaMomentum_(NULL), - lambdaEnergy_(NULL), - atomicFluctuatingVelocityRescaled_(NULL), - atomicStreamingVelocity_(NULL), - thermostat_(NULL), - kinetostat_(NULL) + lambdaMomentum_(nullptr), + lambdaEnergy_(nullptr), + atomicFluctuatingVelocityRescaled_(nullptr), + atomicStreamingVelocity_(nullptr), + thermostat_(nullptr), + kinetostat_(nullptr) { thermostat_ = this->construct_rescale_thermostat(); kinetostat_ = new VelocityRescaleCombined(kinetoThermostat); @@ -389,7 +389,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePeCombined::ThermostatRescaleMixedKePeCombined(AtomicRegulator * thermostat) : ThermostatRescaleMixedKePe(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -458,21 +458,21 @@ namespace ATC { velocity_(atc_->field(VELOCITY)), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomRegulatorForces_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), - atomVelocities_(NULL), + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomRegulatorForces_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), + atomVelocities_(nullptr), isFirstTimestep_(true), - nodalAtomicMomentum_(NULL), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL), + nodalAtomicMomentum_(nullptr), + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr), dtFactor_(0.) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize diff --git a/lib/atc/Kinetostat.cpp b/lib/atc/Kinetostat.cpp index 7f95398dc..676896a2f 100644 --- a/lib/atc/Kinetostat.cpp +++ b/lib/atc/Kinetostat.cpp @@ -307,11 +307,11 @@ namespace ATC { RegulatorShapeFunction(kinetostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(VELOCITY)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - atomKinetostatForce_(NULL), - atomVelocities_(NULL), - atomMasses_(NULL) + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + atomKinetostatForce_(nullptr), + atomVelocities_(nullptr), + atomMasses_(nullptr) { // data associated with stage 3 in ATC_Method::initialize lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaMomentum",nsd_); @@ -376,7 +376,7 @@ namespace ATC { //-------------------------------------------------------- GlcKinetostat::GlcKinetostat(AtomicRegulator *kinetostat) : KinetostatShapeFunction(kinetostat), - atomPositions_(NULL) + atomPositions_(nullptr) { // do nothing } @@ -462,7 +462,7 @@ namespace ATC { //-------------------------------------------------------- DisplacementGlc::DisplacementGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMassWeightedDisplacement_(NULL), + nodalAtomicMassWeightedDisplacement_(nullptr), nodalDisplacements_(atc_->field(DISPLACEMENT)) { // do nothing @@ -763,7 +763,7 @@ namespace ATC { //-------------------------------------------------------- VelocityGlc::VelocityGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalVelocities_(atc_->field(VELOCITY)) { // do nothing @@ -1095,8 +1095,8 @@ namespace ATC { StressFlux::StressFlux(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), nodalForce_(atc_->field_rhs(VELOCITY)), - nodalAtomicForce_(NULL), - nodalGhostForce_(NULL), + nodalAtomicForce_(nullptr), + nodalGhostForce_(nullptr), momentumSource_(atc_->atomic_source(VELOCITY)) { // flag for performing boundary flux calculation @@ -1540,14 +1540,14 @@ namespace ATC { KinetostatShapeFunction(kinetostat,regulatorPrefix), velocity_(atc_->field(VELOCITY)), //timeFilter_(atomicRegulator_->time_filter()), - //nodalAtomicLambdaForce_(NULL), - //lambdaPowerFiltered_(NULL), - //atomKinetostatForces_(NULL), - //atomMasses_(NULL), - nodalAtomicMomentum_(NULL), + //nodalAtomicLambdaForce_(nullptr), + //lambdaPowerFiltered_(nullptr), + //atomKinetostatForces_(nullptr), + //atomMasses_(nullptr), + nodalAtomicMomentum_(nullptr), isFirstTimestep_(true), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), dtFactor_(0.) { // constuct/obtain data corresponding to stage 3 of ATC_Method::initialize @@ -1796,8 +1796,8 @@ namespace ATC { const string & regulatorPrefix) : KinetostatGlcFs(kinetostat,regulatorPrefix), momentumSource_(atc_->atomic_source(VELOCITY)), - nodalGhostForce_(NULL), - nodalGhostForceFiltered_(NULL) + nodalGhostForce_(nullptr), + nodalGhostForceFiltered_(nullptr) { // flag for performing boundary flux calculation fieldMask_(VELOCITY,FLUX) = true; @@ -2403,9 +2403,9 @@ namespace ATC { KinetostatFluxFixed::KinetostatFluxFixed(AtomicRegulator * kinetostat, bool constructKinetostats) : RegulatorMethod(kinetostat), - kinetostatFlux_(NULL), - kinetostatFixed_(NULL), - kinetostatBcs_(NULL) + kinetostatFlux_(nullptr), + kinetostatFixed_(nullptr), + kinetostatBcs_(nullptr) { if (constructKinetostats) { if (kinetostat->coupling_mode(VELOCITY) == AtomicRegulator::GHOST_FLUX) { diff --git a/lib/atc/LammpsInterface.cpp b/lib/atc/LammpsInterface.cpp index 9964a1c4b..5727af190 100644 --- a/lib/atc/LammpsInterface.cpp +++ b/lib/atc/LammpsInterface.cpp @@ -58,14 +58,14 @@ const static int MAX_GROUP_BIT = 2147483647; //4294967295; // pow(2,31)-1; double norm(double * v) {return sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); } -LammpsInterface * LammpsInterface::myInstance_ = NULL; +LammpsInterface * LammpsInterface::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- LammpsInterface * LammpsInterface::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new LammpsInterface(); } return myInstance_; @@ -77,7 +77,7 @@ LammpsInterface * LammpsInterface::instance() void LammpsInterface::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } @@ -85,13 +85,13 @@ void LammpsInterface::Destroy() // constructor // ----------------------------------------------------------------- LammpsInterface::LammpsInterface() - : lammps_(NULL), - fixPointer_(NULL), + : lammps_(nullptr), + fixPointer_(nullptr), commRank_(0), - atomPE_(NULL), + atomPE_(nullptr), refBoxIsSet_(false), - random_(NULL), - globalrandom_(NULL) + random_(nullptr), + globalrandom_(nullptr) { } @@ -225,7 +225,7 @@ void LammpsInterface::sparse_allsum(SparseMatrix &toShare) const std::string LammpsInterface::read_file(std::string filename) const { - FILE *fp = NULL; + FILE *fp = nullptr; if (! comm_rank()) { fp = fopen(filename.c_str(),"r"); if (!fp) throw ATC_Error("can't open file: "+filename); @@ -343,7 +343,7 @@ double * LammpsInterface::atom_scalar(FundamentalAtomQuantity quantityType) cons } else throw ATC_Error("BAD type requested in atom_scalar"); - return NULL; + return nullptr; } double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) const @@ -356,7 +356,7 @@ double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) con return fatom(); else throw ATC_Error("BAD type requested in atom_vector"); - return NULL; + return nullptr; } int LammpsInterface::atom_quantity_ndof(FundamentalAtomQuantity quantityType) const @@ -948,10 +948,10 @@ POTENTIAL LammpsInterface::potential() const "lj/cut/coul/long", "lj/cut/coul/cut", "lj/charmm/coul/long"}; - LAMMPS_NS::Pair *pair = NULL; + LAMMPS_NS::Pair *pair = nullptr; for (int i = 0; i < nStyles; i++){ pair = lammps_->force->pair_match(pairStyles[i].c_str(),1); - if (pair != NULL) break; + if (pair != nullptr) break; } return pair; } @@ -979,8 +979,8 @@ bool LammpsInterface::epsilons(int itype, POTENTIAL pair, double * epsilon0) con int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); int i1,i2; for (int i=1; i < ntypes()+1; i++) { if (i < itype) { i1 = i; i2 = itype; } @@ -998,8 +998,8 @@ bool LammpsInterface::set_epsilons(int itype, POTENTIAL pair, double * epsilon) int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); // scale interactions int i1,i2; for (int i = 1; i < ntypes()+1; i++) { @@ -1498,7 +1498,7 @@ double * LammpsInterface::compute_pe_peratom(void) const return atomPE_->vector_atom; } else { - return NULL; + return nullptr; } } @@ -1542,7 +1542,7 @@ LAMMPS_NS::PairEAM* LammpsInterface::pair_eam() const // return lammps_->force->pair; //} LAMMPS_NS::PairEAM* pair_eam = dynamic_cast (lammps_->force->pair); - if (pair_eam != NULL) { + if (pair_eam != nullptr) { return pair_eam; } else { diff --git a/lib/atc/LammpsInterface.h b/lib/atc/LammpsInterface.h index 2032571da..6883a9ca0 100644 --- a/lib/atc/LammpsInterface.h +++ b/lib/atc/LammpsInterface.h @@ -534,7 +534,7 @@ class LammpsInterface { /** Dulong-Petit heat capacity per volume in M,L,T,t units */ double heat_capacity(void) const; /** mass per volume in reference configuraturation in M,L units */ - double mass_density(int* numPerType=NULL) const; + double mass_density(int* numPerType=nullptr) const; /** permittivity of free space, converts from LAMMPS potential units implied by the electric field units to LAMMPS charge units/LAMMPS length units (e.g., V to elemental charge/A) */ double epsilon0(void) const; double coulomb_constant(void) const; diff --git a/lib/atc/LinearSolver.cpp b/lib/atc/LinearSolver.cpp index 655d6130c..0204ddd93 100644 --- a/lib/atc/LinearSolver.cpp +++ b/lib/atc/LinearSolver.cpp @@ -35,9 +35,9 @@ LinearSolver::LinearSolver( allowReinitialization_(false), homogeneousBCs_(false), bcs_(&bcs), - rhs_(NULL), + rhs_(nullptr), rhsDense_(), - b_(NULL), + b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -65,9 +65,9 @@ LinearSolver::LinearSolver( matrixModified_(false), allowReinitialization_(false), homogeneousBCs_(false), - bcs_(NULL), // null implies no constraints will be added later - rhs_(NULL), - rhsDense_(), b_(NULL), + bcs_(nullptr), // null implies no constraints will be added later + rhs_(nullptr), + rhsDense_(), b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -343,7 +343,7 @@ void LinearSolver::set_fixed_values(VECTOR & X) void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, const DENS_MAT * M) /* const */ { initialize_matrix(); // no inverse needed - const DENS_MAT * Kp = NULL; + const DENS_MAT * Kp = nullptr; const DENS_MAT * Mp =M; DENS_MAT MM; DENS_MAT KM; @@ -388,7 +388,7 @@ void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors bool LinearSolver::solve(VECTOR & x, const VECTOR & b) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; rhs_ = &b; initialized_ = false; @@ -479,7 +479,7 @@ bool LinearSolver::solve(VECTOR & x, const VECTOR & b) void LinearSolver::greens_function(int I, VECTOR & G_I) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; diff --git a/lib/atc/LinearSolver.h b/lib/atc/LinearSolver.h index 5f456b9a1..1d429d881 100644 --- a/lib/atc/LinearSolver.h +++ b/lib/atc/LinearSolver.h @@ -64,7 +64,7 @@ class LinearSolver { allow_reinitialization must be called before first solve, etc */ void allow_reinitialization(void); // depending on method save a copy of A void set_homogeneous_bcs(void) { homogeneousBCs_ = true;} // for nonlinear solver, solve for increment - void initialize(const BC_SET * bcs = NULL); + void initialize(const BC_SET * bcs = nullptr); /** solve - solves A x = b @@ -80,7 +80,7 @@ class LinearSolver { - returns the e-values & e-vectors for constrained system Ax + v x = 0 - if M is provided the eval problem : ( A + v M ) x = 0 is solved*/ void eigen_system(DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, - const DENS_MAT * M = NULL); + const DENS_MAT * M = nullptr); /** access to penalty coefficient - if a penalty method is not being used this returns zero */ diff --git a/lib/atc/Material.cpp b/lib/atc/Material.cpp index 676a87524..64673d799 100644 --- a/lib/atc/Material.cpp +++ b/lib/atc/Material.cpp @@ -28,21 +28,21 @@ namespace ATC { Material::Material() : rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { } //-------------------------------------------------------------- @@ -70,21 +70,21 @@ namespace ATC { : tag_(tag), rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { /*! \page man_material material \section syntax diff --git a/lib/atc/MoleculeSet.h b/lib/atc/MoleculeSet.h index cffafd950..763f08ef4 100644 --- a/lib/atc/MoleculeSet.h +++ b/lib/atc/MoleculeSet.h @@ -33,7 +33,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** reset the number of atoms/molecules on this processor */ void reset_nlocal() {this->set_reset();}; @@ -108,8 +108,8 @@ namespace ATC { public: SmallMoleculeSet(ATC_Method * atc, int groupBit, - PerAtomQuantity * bondList = NULL, - PerAtomQuantity * numBond = NULL); + PerAtomQuantity * bondList = nullptr, + PerAtomQuantity * numBond = nullptr); virtual ~SmallMoleculeSet(); @@ -117,7 +117,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** access molecule atoms by lammps id */ std::set atoms_by_global_molecule(int id) const; diff --git a/lib/atc/NonLinearSolver.h b/lib/atc/NonLinearSolver.h index 010e3ee72..299408c4c 100644 --- a/lib/atc/NonLinearSolver.h +++ b/lib/atc/NonLinearSolver.h @@ -43,7 +43,7 @@ class NonLinearSolver { /** Constructor */ NonLinearSolver( TangentOperator * f, // provides f and f' at x, pointer for polymorphism - const BC_SET * bcs = NULL, + const BC_SET * bcs = nullptr, const int dof = 0, bool parallel = false ); diff --git a/lib/atc/OutputManager.cpp b/lib/atc/OutputManager.cpp index 066c240ca..83257a3d2 100644 --- a/lib/atc/OutputManager.cpp +++ b/lib/atc/OutputManager.cpp @@ -48,8 +48,8 @@ OutputManager::OutputManager(string outputPrefix, set & otypes) firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_(outputPrefix), ensightOutput_(otypes.count(ENSIGHT)), @@ -68,8 +68,8 @@ OutputManager::OutputManager() firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_("NULL"), ensightOutput_(true), @@ -132,7 +132,7 @@ void OutputManager::print_custom_names() { // Dump text-based fields to disk for later restart void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"wb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -153,7 +153,7 @@ void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) void OutputManager::read_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"rb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -230,7 +230,7 @@ void OutputManager::write_geometry_ensight(void) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; + FILE * fp=nullptr; char buffer[80]; if ( ! initialized_ ) { fp=fopen(geom_file_name.c_str(),"wb"); // open @@ -240,7 +240,7 @@ void OutputManager::write_geometry_ensight(void) else { fp=fopen(geom_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight geometry file"); } @@ -491,14 +491,14 @@ void OutputManager::write_data_ensight(string field_name, const MATRIX *field_da // open or append data file string data_file_name = filenames[ifile]; - FILE * fp=NULL; + FILE * fp=nullptr; if ( outputTimes_.size() == 1 ) { fp=fopen(data_file_name.c_str(),"wb"); // open } else { fp=fopen(data_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight data file: "+data_file_name); } @@ -799,8 +799,8 @@ void OutputManager::write_dictionary(double /* time */, OUTPUT_LIST *data) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; - if ((fp=fopen(dict_file_name.c_str(),"w")) == NULL) + FILE * fp=nullptr; + if ((fp=fopen(dict_file_name.c_str(),"w")) == nullptr) { throw ATC_Error("can not create Ensight case file"); } diff --git a/lib/atc/OutputManager.h b/lib/atc/OutputManager.h index c5a901e9f..4454d6526 100644 --- a/lib/atc/OutputManager.h +++ b/lib/atc/OutputManager.h @@ -52,13 +52,13 @@ namespace ATC { coordinates : num _total_ points/nodes X num spatial dim connectivities : num elements X num nodes per element*/ void write_geometry(const MATRIX *coordinates, - const Array2D *connectivity=NULL); + const Array2D *connectivity=nullptr); /** write data from a time step specify node_map to handle periodic soln & data */ - void write_data(double time, OUTPUT_LIST *data, const int *node_map=NULL); + void write_data(double time, OUTPUT_LIST *data, const int *node_map=nullptr); void write_data(double time, FIELDS *soln, OUTPUT_LIST *data, - const int *node_map=NULL); + const int *node_map=nullptr); /** add custom names for any field */ void add_field_names(const std::string& name, const std::vector& list) { diff --git a/lib/atc/PaqAtcUtility.cpp b/lib/atc/PaqAtcUtility.cpp index b6a2ed287..bdcf26962 100644 --- a/lib/atc/PaqAtcUtility.cpp +++ b/lib/atc/PaqAtcUtility.cpp @@ -18,7 +18,7 @@ namespace ATC { AtomType atomType) : atc_(atc), atomType_(atomType), - myNlocal(NULL) + myNlocal(nullptr) { switch (atomType_) { case ALL: diff --git a/lib/atc/ParDenseMatrix.h b/lib/atc/ParDenseMatrix.h index 1c9e75f17..873bf0f41 100644 --- a/lib/atc/ParDenseMatrix.h +++ b/lib/atc/ParDenseMatrix.h @@ -148,7 +148,7 @@ namespace ATC_matrix { #endif // Clear out the local matrix's pointer so we don't double-free - A_local._data = NULL; + A_local._data = nullptr; delete [] majorCounts; delete [] offsets; diff --git a/lib/atc/ParSparseMatrix.cpp b/lib/atc/ParSparseMatrix.cpp index 69ab2453e..77c8eb33d 100644 --- a/lib/atc/ParSparseMatrix.cpp +++ b/lib/atc/ParSparseMatrix.cpp @@ -233,8 +233,8 @@ DenseMatrix ParSparseMatrix::transMat( SparseMatrix C_local = ((SparseMatrix)A_local) * B; // destroy newA intelligently - A_local._val = NULL; - A_local._ja = NULL; + A_local._val = nullptr; + A_local._ja = nullptr; // Add all the result vectors together on each processor. sumSparse(C_local, C); @@ -285,8 +285,8 @@ void ParSparseMatrix::partition( // Prepare an A_local matrix for deletion after it has been loaded with // data members from another matrix. void ParSparseMatrix::finalize() { - _val = NULL; - _ja = NULL; + _val = nullptr; + _ja = nullptr; } void ParSparseMatrix::operator=(const SparseMatrix &source) diff --git a/lib/atc/ParSparseMatrix.h b/lib/atc/ParSparseMatrix.h index 0985115d0..b2642e87b 100644 --- a/lib/atc/ParSparseMatrix.h +++ b/lib/atc/ParSparseMatrix.h @@ -135,9 +135,9 @@ namespace ATC_matrix { Avar.hasTemplate_ = Ap.hasTemplate_; // Avoid catastrophe - Ap._val = NULL; - Ap._ja = NULL; - Ap._ia = NULL; + Ap._val = nullptr; + Ap._ja = nullptr; + Ap._ia = nullptr; } diff --git a/lib/atc/PerAtomQuantity-inl.h b/lib/atc/PerAtomQuantity-inl.h index f95e5d306..b570e7645 100644 --- a/lib/atc/PerAtomQuantity-inl.h +++ b/lib/atc/PerAtomQuantity-inl.h @@ -24,8 +24,8 @@ namespace ATC { atomType_(atomType), nCols_(nCols), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL), - lammpsVector_(NULL) + lammpsScalar_(nullptr), + lammpsVector_(nullptr) { // do nothing } @@ -452,7 +452,7 @@ namespace ATC { lammpsInterface_(LammpsInterface::instance()), atomType_(atomType), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL) + lammpsScalar_(nullptr) { // do nothing } @@ -610,8 +610,8 @@ namespace ATC { nCols_(nCols), maxEntriesPerRow_(maxEntriesPerRow), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsVector_(NULL), - lammpsColIndices_(NULL) + lammpsVector_(nullptr), + lammpsColIndices_(nullptr) { // do nothing } diff --git a/lib/atc/PerAtomQuantity.h b/lib/atc/PerAtomQuantity.h index e6cb19981..a822b6a9b 100644 --- a/lib/atc/PerAtomQuantity.h +++ b/lib/atc/PerAtomQuantity.h @@ -441,10 +441,10 @@ namespace ATC { virtual void set_lammps_to_quantity() const {}; /** gets appropriate pointer for lammps data */ - virtual T * lammps_scalar() const {return NULL;}; + virtual T * lammps_scalar() const {return nullptr;}; /** gets appropriate pointer for lammps data */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; private: @@ -1452,10 +1452,10 @@ namespace ATC { virtual void set_quantity_to_lammps() const {}; /** gets appropriate data for lammps pointer */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; /** gets appropriate data for lammps pointer to column indices */ - virtual int ** lammps_column_indices() const {return NULL;}; + virtual int ** lammps_column_indices() const {return nullptr;}; private: diff --git a/lib/atc/PerAtomQuantityLibrary.h b/lib/atc/PerAtomQuantityLibrary.h index 0089df785..3e3cb78e9 100644 --- a/lib/atc/PerAtomQuantityLibrary.h +++ b/lib/atc/PerAtomQuantityLibrary.h @@ -125,7 +125,7 @@ namespace ATC { // constructor AtomToElementMap(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -304,7 +304,7 @@ namespace ATC { // constructor AtomVolumeElement(ATC_Method * atc, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -349,7 +349,7 @@ namespace ATC { // constructor AtomVolumeRegion(ATC_Method * atc, - DENS_MAN * atomCoarseGrainingPositions = NULL, + DENS_MAN * atomCoarseGrainingPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -422,9 +422,9 @@ namespace ATC { // constructor AtomicMassWeightedDisplacement(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomReferencePositions = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomReferencePositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -462,8 +462,8 @@ namespace ATC { // constructor FluctuatingVelocity(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -497,8 +497,8 @@ namespace ATC { // constructor ChargeVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - FundamentalAtomQuantity * atomCharges = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + FundamentalAtomQuantity * atomCharges = nullptr, AtomType atomType = INTERNAL); // destructor @@ -532,8 +532,8 @@ namespace ATC { // constructor SpeciesVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - PerAtomQuantity * atomTypeVector = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + PerAtomQuantity * atomTypeVector = nullptr, AtomType atomType = INTERNAL); // destructor @@ -567,8 +567,8 @@ namespace ATC { // constructor AtomicMomentum(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -631,8 +631,8 @@ namespace ATC { // constructor TwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -670,8 +670,8 @@ namespace ATC { // constructor KineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -707,9 +707,9 @@ namespace ATC { // constructor FluctuatingKineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -747,9 +747,9 @@ namespace ATC { // constructor TwiceFluctuatingKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -793,8 +793,8 @@ namespace ATC { MixedKePeEnergy(ATC_Method * atc, double keMultiplier, double peMultiplier, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -838,8 +838,8 @@ namespace ATC { // constructor TotalEnergy(ATC_Method * atc, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -871,8 +871,8 @@ namespace ATC { // constructor FluctuatingPotentialEnergy(ATC_Method * atc, - PerAtomQuantity * potentialEnergy = NULL, - PerAtomQuantity * referencePotential = NULL, + PerAtomQuantity * potentialEnergy = nullptr, + PerAtomQuantity * referencePotential = nullptr, AtomType atomType = INTERNAL); // destructor @@ -911,8 +911,8 @@ namespace ATC { // constructor DotTwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomForces = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomForces = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -948,7 +948,7 @@ namespace ATC { // constructor VelocitySquared(ATC_Method *atc, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -981,9 +981,9 @@ namespace ATC { // constructor LambdaSquared(ATC_Method *atc, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1149,7 +1149,7 @@ namespace ATC { // constructor AtomToNodeset(ATC_Method * atc, SetDependencyManager * subsetNodes, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1194,7 +1194,7 @@ namespace ATC { // constructor AtomToElementset(ATC_Method * atc, MatrixDependencyManager * elementMask, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1273,7 +1273,7 @@ namespace ATC { // constructor VelocitySquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1307,9 +1307,9 @@ namespace ATC { // constructor LambdaSquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1371,7 +1371,7 @@ namespace ATC { // constructor AtomicVelocityRescaleFactor(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1403,8 +1403,8 @@ namespace ATC { // constructor AtomicFluctuatingVelocityRescaled(ATC_Method * atc, - PerAtomQuantity * atomRescaleFactor = NULL, - PerAtomQuantity * atomFluctuatingVelocity = NULL, + PerAtomQuantity * atomRescaleFactor = nullptr, + PerAtomQuantity * atomFluctuatingVelocity = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1439,10 +1439,10 @@ namespace ATC { // constructor AtomicCombinedRescaleThermostatError(ATC_Method * atc, - PerAtomQuantity * atomFluctuatingMomentumRescaled = NULL, - PerAtomQuantity * atomMeanVelocity = NULL, - PerAtomQuantity * atomStreamingVelocity = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomFluctuatingMomentumRescaled = nullptr, + PerAtomQuantity * atomMeanVelocity = nullptr, + PerAtomQuantity * atomStreamingVelocity = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1483,8 +1483,8 @@ namespace ATC { // constructor AtomicThermostatForce(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomLambdas = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1519,8 +1519,8 @@ namespace ATC { // constructor AtomicKinetostatForceDisplacement(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1558,8 +1558,8 @@ namespace ATC { // constructor AtomicKinetostatForceVelocity(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL) : AtomicKinetostatForceDisplacement(atc,atomLambda,atomMass,atomType) {}; @@ -1589,7 +1589,7 @@ namespace ATC { // constructor AtomicKinetostatForceStress(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, + PerAtomQuantity * atomLambda = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1621,7 +1621,7 @@ namespace ATC { // constructor PerAtomKernelFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1656,8 +1656,8 @@ namespace ATC { // constructor PerAtomShapeFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomElements = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomElements = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1695,8 +1695,8 @@ namespace ATC { // constructor LambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LambdaCouplingMatrix() { @@ -1734,9 +1734,9 @@ namespace ATC { // constructor LocalLambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * lambdaAtomMap = NULL, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * lambdaAtomMap = nullptr, + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LocalLambdaCouplingMatrix() { @@ -1771,7 +1771,7 @@ namespace ATC { GhostCouplingMatrix(ATC_Method * atc, SPAR_MAN * shapeFunction, SetDependencyManager * subsetNodes, - MatrixDependencyManager * nodeToOverlapMap = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr); // destructor virtual ~GhostCouplingMatrix() { diff --git a/lib/atc/PerPairQuantity.cpp b/lib/atc/PerPairQuantity.cpp index 3632a87aa..01308e4b3 100644 --- a/lib/atc/PerPairQuantity.cpp +++ b/lib/atc/PerPairQuantity.cpp @@ -272,7 +272,7 @@ BondMatrixKernel::BondMatrixKernel(LammpsInterface * lammpsInterface, BondMatrix(lammpsInterface,pairMap,x,feMesh), kernelFunction_(kernelFunction) { - if (kernelFunction_ == NULL) + if (kernelFunction_ == nullptr) throw ATC_Error("No AtC kernel function initialized"); }; void BondMatrixKernel::reset(void) const diff --git a/lib/atc/PhysicsModel.h b/lib/atc/PhysicsModel.h index 50b327ce0..8479727a8 100644 --- a/lib/atc/PhysicsModel.h +++ b/lib/atc/PhysicsModel.h @@ -105,7 +105,7 @@ namespace ATC const WeakEquation * weak_equation(FieldName field) const { std::map::const_iterator itr = weakEqns_.find(field); - if (itr == weakEqns_.end()) return NULL; + if (itr == weakEqns_.end()) return nullptr; return (weakEqns_.find(field))->second; } diff --git a/lib/atc/PoissonSolver.cpp b/lib/atc/PoissonSolver.cpp index 86670ae21..52909fc45 100644 --- a/lib/atc/PoissonSolver.cpp +++ b/lib/atc/PoissonSolver.cpp @@ -33,9 +33,9 @@ PoissonSolver::PoissonSolver( fieldName_(fieldName), rhsMask_(rhsMask), linear_(false), - solver_(NULL), - solverNL_(NULL), - tangent_(NULL), + solver_(nullptr), + solverNL_(nullptr), + tangent_(nullptr), solverType_(solverType), solverTol_(0), solverMaxIter_(0), diff --git a/lib/atc/PrescribedDataManager.cpp b/lib/atc/PrescribedDataManager.cpp index bd649c8ac..947191a0e 100644 --- a/lib/atc/PrescribedDataManager.cpp +++ b/lib/atc/PrescribedDataManager.cpp @@ -34,8 +34,8 @@ namespace ATC { bcs_[thisField].reset(nNodes_,thisSize); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < thisSize ; ++idof) { - ics_[thisField](inode,idof) = NULL; - bcs_[thisField](inode,idof) = NULL; + ics_[thisField](inode,idof) = nullptr; + bcs_[thisField](inode,idof) = nullptr; } } // compact inode, value lists @@ -44,7 +44,7 @@ namespace ATC { elementSources_[thisField].reset(nElems_,thisSize); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < thisSize ; ++idof) { - elementSources_[thisField](ielem,idof) = NULL; + elementSources_[thisField](ielem,idof) = nullptr; } } // node based sources @@ -76,8 +76,8 @@ namespace ATC { bcs_[fieldName].reset(nNodes_,size); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < size ; ++idof) { - ics_[fieldName](inode,idof) = NULL; - bcs_[fieldName](inode,idof) = NULL; + ics_[fieldName](inode,idof) = nullptr; + bcs_[fieldName](inode,idof) = nullptr; } } @@ -85,7 +85,7 @@ namespace ATC { elementSources_[fieldName].reset(nElems_,size); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < size ; ++idof) { - elementSources_[fieldName](ielem,idof) = NULL; + elementSources_[fieldName](ielem,idof) = nullptr; } } } @@ -159,7 +159,7 @@ namespace ATC { set::const_iterator iset; for (iset = nodeSet.begin(); iset != nodeSet.end(); iset++) { int inode = *iset; - bcs_[thisField](inode,thisIndex) = NULL; + bcs_[thisField](inode,thisIndex) = nullptr; } } @@ -182,7 +182,7 @@ namespace ATC { const FieldName thisField, const int thisIndex) { - bcs_[thisField](nodeId,thisIndex) = NULL; + bcs_[thisField](nodeId,thisIndex) = nullptr; } //------------------------------------------------------------------------- // fix_flux @@ -203,7 +203,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (XT_Function*) f; } @@ -222,7 +222,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < XT_Function * > & dof = faceSources_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -244,7 +244,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (UXT_Function*) f; } @@ -263,7 +263,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < UXT_Function * > & dof = faceSourcesRobin_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -342,7 +342,7 @@ namespace ATC { set::const_iterator iset; for (iset = elemSet.begin(); iset != elemSet.end(); iset++) { int ielem = *iset; - elementSources_[thisField](ielem,thisIndex) = NULL; + elementSources_[thisField](ielem,thisIndex) = nullptr; } } //------------------------------------------------------------------------- diff --git a/lib/atc/Quadrature.cpp b/lib/atc/Quadrature.cpp index 8efe0e296..94fe4a701 100644 --- a/lib/atc/Quadrature.cpp +++ b/lib/atc/Quadrature.cpp @@ -5,14 +5,14 @@ using namespace std; namespace ATC { -Quadrature * Quadrature::myInstance_ = NULL; +Quadrature * Quadrature::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- Quadrature * Quadrature::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new Quadrature(); } return myInstance_; @@ -24,7 +24,7 @@ Quadrature * Quadrature::instance() void Quadrature::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } diff --git a/lib/atc/SchrodingerSolver.cpp b/lib/atc/SchrodingerSolver.cpp index d79fa8559..3819562a7 100644 --- a/lib/atc/SchrodingerSolver.cpp +++ b/lib/atc/SchrodingerSolver.cpp @@ -646,7 +646,7 @@ double fermi_dirac(const double E, const double T) double mu, double D ) : SliceSchrodingerPoissonSolver(atc,schrodingerSolver,poissonSolver,physicsModel,maxConsistencyIter,maxConstraintIter,oneDconserve,0,0), - solver_(NULL), + solver_(nullptr), mobility_(mu),diffusivity_(D) { Ef0_ = Ef0; diff --git a/lib/atc/SparseMatrix-inl.h b/lib/atc/SparseMatrix-inl.h index 36867ad8d..2923d6daa 100644 --- a/lib/atc/SparseMatrix-inl.h +++ b/lib/atc/SparseMatrix-inl.h @@ -17,14 +17,14 @@ TRI_COORD::TRI_COORD(INDEX row, INDEX col, T val, bool add_to) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(INDEX rows, INDEX cols) - : _val(NULL), _ia(NULL), _ja(NULL), _size(0), _nRowsCRS(0), hasTemplate_(false), + : _val(nullptr), _ia(nullptr), _ja(nullptr), _size(0), _nRowsCRS(0), hasTemplate_(false), _nRows(rows),_nCols(cols) {} //----------------------------------------------------------------------------- // copy constructor //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const SparseMatrix& C) - : Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) + : Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { _copy(C); } @@ -33,7 +33,7 @@ SparseMatrix::SparseMatrix(const SparseMatrix& C) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const DenseMatrix& C) -: Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) +: Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { reset(C); } @@ -67,9 +67,9 @@ void SparseMatrix::_create(INDEX size, INDEX nrows) // assign memory to hold matrix try { - _val = (_size && nrows) ? new T [_size] : NULL; - _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : NULL; - _ja = (_size && nrows) ? new INDEX [_size] : NULL; + _val = (_size && nrows) ? new T [_size] : nullptr; + _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : nullptr; + _ja = (_size && nrows) ? new INDEX [_size] : nullptr; } catch (std::exception &e) { @@ -94,8 +94,8 @@ void SparseMatrix::_delete() if (_ia) delete [] _ia; if (_ja) delete [] _ja; _size = _nRowsCRS = 0; - _val = NULL; - _ia = _ja = NULL; + _val = nullptr; + _ia = _ja = nullptr; } //----------------------------------------------------------------------------- // full memory copy of C into this diff --git a/lib/atc/SparseVector.h b/lib/atc/SparseVector.h index 5cb16af52..d387b45b6 100644 --- a/lib/atc/SparseVector.h +++ b/lib/atc/SparseVector.h @@ -88,7 +88,7 @@ protected: //@{ SparseVector(const Matrix &c); SparseVector& operator=(Matrix &c); - T* ptr() const {return NULL; } + T* ptr() const {return nullptr; } //@} STORE data_; //*> sparse data structure diff --git a/lib/atc/SpeciesTimeIntegrator.cpp b/lib/atc/SpeciesTimeIntegrator.cpp index 3a196e745..3215b159f 100644 --- a/lib/atc/SpeciesTimeIntegrator.cpp +++ b/lib/atc/SpeciesTimeIntegrator.cpp @@ -108,9 +108,9 @@ namespace ATC { timeFilter_(speciesTimeIntegrator->time_filter()), massDensity_(atc_->field(MASS_DENSITY)), nodalAtomicMassDensityOut_(atc_->nodal_atomic_field(MASS_DENSITY)), - nodalAtomicMassDensity_(NULL), + nodalAtomicMassDensity_(nullptr), speciesConcentration_(atc_->field(SPECIES_CONCENTRATION)), - nodalAtomicSpeciesConcentration_(NULL), + nodalAtomicSpeciesConcentration_(nullptr), nodalAtomicSpeciesConcentrationFiltered_(speciesTimeIntegrator->nodal_atomic_species_concentration_filtered()), moleculeIds_(moleculeIds) { diff --git a/lib/atc/SpeciesTimeIntegrator.h b/lib/atc/SpeciesTimeIntegrator.h index c8fbe97c5..64cc07022 100644 --- a/lib/atc/SpeciesTimeIntegrator.h +++ b/lib/atc/SpeciesTimeIntegrator.h @@ -71,7 +71,7 @@ namespace ATC { const std::map > & moleculeIds); // destructor - virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=NULL;}; + virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=nullptr;}; /** create and get necessary transfer operators */ virtual void construct_transfers(); diff --git a/lib/atc/Stress.cpp b/lib/atc/Stress.cpp index 72656c21e..a1445bd8e 100644 --- a/lib/atc/Stress.cpp +++ b/lib/atc/Stress.cpp @@ -299,10 +299,10 @@ void StressCubicElasticDamped::stress(const FIELD_MATS &fields, // cauchy born model //============================================================================== StressCauchyBorn::StressCauchyBorn(fstream &fileId, CbData &cb) - : cblattice_(NULL), - potential_(NULL), + : cblattice_(nullptr), + potential_(nullptr), makeLinear_(false), - cubicMat_(NULL), + cubicMat_(nullptr), initialized_(false), fixed_temperature_(0.), cbdata_(cb) diff --git a/lib/atc/Stress.h b/lib/atc/Stress.h index 513cdb2d9..5a7c9e30a 100644 --- a/lib/atc/Stress.h +++ b/lib/atc/Stress.h @@ -149,7 +149,7 @@ namespace ATC { DENS_VEC elasticity_tensor(const VECTOR &Fv, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; DENS_VEC elasticity_tensor(const MATRIX &F, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; protected: - void linearize(MATRIX *F=NULL); + void linearize(MATRIX *F=nullptr); CBLattice *cblattice_; //*> CbLattice -> makes atom clusters. CbPotential *potential_; //*> CbPotential -> interatomic forces. bool makeLinear_; diff --git a/lib/atc/ThermalTimeIntegrator.cpp b/lib/atc/ThermalTimeIntegrator.cpp index e74d46a20..8c0b8d6da 100644 --- a/lib/atc/ThermalTimeIntegrator.cpp +++ b/lib/atc/ThermalTimeIntegrator.cpp @@ -150,7 +150,7 @@ namespace ATC { temperatureRoc_(atc_->field_roc(TEMPERATURE)), temperature2Roc_(atc_->field_2roc(TEMPERATURE)), nodalAtomicTemperatureOut_(atc_->nodal_atomic_field(TEMPERATURE)), - nodalAtomicTemperature_(NULL), + nodalAtomicTemperature_(nullptr), temperatureRhs_(atc_->field_rhs(TEMPERATURE)), nodalAtomicPowerOut_(atc_->nodal_atomic_field_roc(TEMPERATURE)) { @@ -384,7 +384,7 @@ namespace ATC { nodalAtomicEnergyFiltered_(thermalTimeIntegrator->nodal_atomic_energy_filtered()), nodalAtomicPowerFiltered_(thermalTimeIntegrator->nodal_atomic_power_filtered()), atomicTemperatureDelta_(atc_->num_nodes(),1), - nodalAtomicEnergy_(NULL), + nodalAtomicEnergy_(nullptr), nodalAtomicEnergyOld_(atc_->num_nodes(),1), nodalAtomicTemperatureOld_(atc_->num_nodes(),1) { diff --git a/lib/atc/Thermostat.cpp b/lib/atc/Thermostat.cpp index a60210585..217f2394e 100644 --- a/lib/atc/Thermostat.cpp +++ b/lib/atc/Thermostat.cpp @@ -367,7 +367,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL) + atomVelocities_(nullptr) { fieldMask_(TEMPERATURE,FLUX) = true; lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaEnergy",1); // data associated with stage 3 in ATC_Method::initialize @@ -425,7 +425,7 @@ namespace ATC { ThermostatRescale::ThermostatRescale(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), nodalTemperature_(atc_->field(TEMPERATURE)), - atomVelocityRescalings_(NULL) + atomVelocityRescalings_(nullptr) { // do nothing } @@ -535,7 +535,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePe::ThermostatRescaleMixedKePe(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - nodalAtomicFluctuatingPotentialEnergy_(NULL) + nodalAtomicFluctuatingPotentialEnergy_(nullptr) { // do nothing } @@ -607,7 +607,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), lambdaMaxIterations_(lambdaMaxIterations), - rhsLambdaSquared_(NULL), + rhsLambdaSquared_(nullptr), dtFactor_(1.) { fieldMask_(TEMPERATURE,FLUX) = true; @@ -741,21 +741,21 @@ namespace ATC { int /* lambdaMaxIterations */, const string & regulatorPrefix) : RegulatorMethod(thermostat,regulatorPrefix), - lambdaSolver_(NULL), + lambdaSolver_(nullptr), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL), + atomVelocities_(nullptr), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomLambdas_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomLambdas_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), isFirstTimestep_(true), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL) + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize nodalAtomicLambdaPower_ = thermostat->regulator_data(regulatorPrefix_+"NodalAtomicLambdaPower",1); @@ -1389,7 +1389,7 @@ namespace ATC { int lambdaMaxIterations, const string & regulatorPrefix) : ThermostatGlcFs(thermostat,lambdaMaxIterations,regulatorPrefix), - atomThermostatForcesPredVel_(NULL), + atomThermostatForcesPredVel_(nullptr), filterCoefficient_(1.) { lambdaSolver_ = new ThermostatSolverFixed(thermostat, @@ -1887,9 +1887,9 @@ namespace ATC { int lambdaMaxIterations, bool constructThermostats) : RegulatorMethod(thermostat), - thermostatFlux_(NULL), - thermostatFixed_(NULL), - thermostatBcs_(NULL) + thermostatFlux_(nullptr), + thermostatFixed_(nullptr), + thermostatBcs_(nullptr) { if (constructThermostats) { thermostatFlux_ = new ThermostatIntegratorFlux(thermostat,lambdaMaxIterations,regulatorPrefix_+"Flux"); @@ -2022,10 +2022,10 @@ namespace ATC { ThermostatGlc::ThermostatGlc(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), timeFilter_(atomicRegulator_->time_filter()), - lambdaPowerFiltered_(NULL), - atomThermostatForces_(NULL), + lambdaPowerFiltered_(nullptr), + atomThermostatForces_(nullptr), prescribedDataMgr_(atc_->prescribed_data_manager()), - atomMasses_(NULL) + atomMasses_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaPowerFiltered_= atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaPowerFiltered",1); @@ -2080,8 +2080,8 @@ namespace ATC { ThermostatGlc(thermostat), nodalTemperatureRoc_(atc_->field_roc(TEMPERATURE)), heatSource_(atc_->atomic_source(TEMPERATURE)), - nodalAtomicPower_(NULL), - nodalAtomicLambdaPower_(NULL) + nodalAtomicPower_(nullptr), + nodalAtomicLambdaPower_(nullptr) { // do nothing } @@ -2287,8 +2287,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerlet::ThermostatHooverVerlet(AtomicRegulator * thermostat) : ThermostatPowerVerlet(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // set up data consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaHoover",1); @@ -2505,8 +2505,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerletFiltered::ThermostatHooverVerletFiltered(AtomicRegulator * thermostat) : ThermostatPowerVerletFiltered(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data("LambdaHoover",1); diff --git a/lib/atc/TimeFilter.cpp b/lib/atc/TimeFilter.cpp index 08cb64c8f..ece3429c8 100644 --- a/lib/atc/TimeFilter.cpp +++ b/lib/atc/TimeFilter.cpp @@ -210,7 +210,7 @@ namespace ATC { } else if (filterType_ == STEP_FILTER) { newTimeFilter = new TimeFilterStep(*this); - } else newTimeFilter = NULL; + } else newTimeFilter = nullptr; } else { // default to return base class newTimeFilter = new TimeFilter(*this); diff --git a/lib/atc/TimeIntegrator.cpp b/lib/atc/TimeIntegrator.cpp index 4e8dec8c6..f370d1717 100644 --- a/lib/atc/TimeIntegrator.cpp +++ b/lib/atc/TimeIntegrator.cpp @@ -17,10 +17,10 @@ namespace ATC { AtomTimeIntegratorType::AtomTimeIntegratorType(ATC_Method * atc, AtomType atomType) : atc_(atc), atomType_(atomType), - mass_(NULL), - position_(NULL), - velocity_(NULL), - force_(NULL) + mass_(nullptr), + position_(nullptr), + velocity_(nullptr), + force_(nullptr) { // do nothing } @@ -90,9 +90,9 @@ namespace ATC { //-------------------------------------------------------- TimeIntegrator::TimeIntegrator(ATC_Coupling * atc, TimeIntegrationType timeIntegrationType) : - timeIntegrationMethod_(NULL), + timeIntegrationMethod_(nullptr), atc_(atc), - timeFilter_(NULL), + timeFilter_(nullptr), timeFilterManager_(atc_->time_filter_manager()), timeIntegrationType_(timeIntegrationType), needReset_(true) diff --git a/lib/atc/TransferLibrary.cpp b/lib/atc/TransferLibrary.cpp index d0db0076d..b77a91fd2 100644 --- a/lib/atc/TransferLibrary.cpp +++ b/lib/atc/TransferLibrary.cpp @@ -816,7 +816,7 @@ namespace ATC { for (unsigned i = 0; i < quantity_.size(); ++i) { if (quantity_[i]) delete quantity_[i]; } - quantity_.resize(source.size(),NULL); + quantity_.resize(source.size(),nullptr); for (unsigned i = 0; i < source.size(); i++) { quantity_[i] = new SPAR_MAT(map_->size(),source[i]->nCols()); } @@ -1363,7 +1363,7 @@ namespace ATC { { pointToElementMap_->register_dependence(this); pointPositions_->register_dependence(this); - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } @@ -1428,7 +1428,7 @@ namespace ATC { atomPositions_->register_dependence(this); // storage container - matrices_.resize(atc->nsd(),NULL); + matrices_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { matrices_[i] = new AtcAtomSparseMatrix(atc,feEngine_->num_nodes(), feEngine_->num_nodes_per_element(), @@ -1440,7 +1440,7 @@ namespace ATC { matrices_[i]->register_dependence(this); } - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); } //-------------------------------------------------------- @@ -1926,7 +1926,7 @@ namespace ATC { VectorTransfer(), feEngine_(atc->fe_engine()) { - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } diff --git a/lib/atc/TransferLibrary.h b/lib/atc/TransferLibrary.h index 3a0f420f3..d1f27e5e6 100644 --- a/lib/atc/TransferLibrary.h +++ b/lib/atc/TransferLibrary.h @@ -115,7 +115,7 @@ namespace ATC { // constructor NodalAtomVolumeElement(ATC_Method * atc, SPAR_MAN * shapeFunction, - PerAtomQuantity * atomElement=NULL); + PerAtomQuantity * atomElement=nullptr); // destructor virtual ~NodalAtomVolumeElement() { @@ -173,7 +173,7 @@ namespace ATC { // constructor AtomTypeElement(ATC_Coupling * atc, - PerAtomQuantity * atomElement = NULL); + PerAtomQuantity * atomElement = nullptr); // destructor virtual ~AtomTypeElement() { @@ -211,8 +211,8 @@ namespace ATC { // constructor ElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~ElementMask() { @@ -251,7 +251,7 @@ namespace ATC { // constructor AtomElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasAtoms = NULL); + MatrixDependencyManager * hasAtoms = nullptr); // destructor virtual ~AtomElementMask() { @@ -287,8 +287,8 @@ namespace ATC { // constructor NodalGeometryType(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~NodalGeometryType() { @@ -338,7 +338,7 @@ namespace ATC { // constructor NodalGeometryTypeElementSet(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL); + MatrixDependencyManager * hasInternal = nullptr); // destructor virtual ~NodalGeometryTypeElementSet() { @@ -659,7 +659,7 @@ namespace ATC { // constructor RegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL); + MatrixDependencyManager * nodalGeometryType = nullptr); // destructor virtual ~RegulatedNodes() { @@ -721,7 +721,7 @@ namespace ATC { // constructor FluxNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -751,7 +751,7 @@ namespace ATC { // constructor BoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -781,7 +781,7 @@ namespace ATC { // constructor FluxBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -811,7 +811,7 @@ namespace ATC { // constructor AllRegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxBoundaryNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -841,7 +841,7 @@ namespace ATC { // constructor FixedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -871,7 +871,7 @@ namespace ATC { // constructor FixedBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FixedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -1052,8 +1052,8 @@ namespace ATC { // constructor PerAtomShapeFunctionGradient(ATC_Method * atc, - MatrixDependencyManager* atomToElementMap = NULL, - DENS_MAN* atomPositions = NULL, + MatrixDependencyManager* atomToElementMap = nullptr, + DENS_MAN* atomPositions = nullptr, const std::string & tag = "AtomicShapeFunctionGradient", AtomType atomType = INTERNAL); diff --git a/lib/atc/TransferOperator.h b/lib/atc/TransferOperator.h index 5f776d04c..5cf578b77 100644 --- a/lib/atc/TransferOperator.h +++ b/lib/atc/TransferOperator.h @@ -542,7 +542,7 @@ namespace ATC { AtfProjection(ATC_Method * atc, PerAtomQuantity * source, SPAR_MAN * accumulant, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjection(); @@ -587,7 +587,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, const double scale, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionScaled(); @@ -620,7 +620,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, DENS_MAN * reference, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionReferenced(); diff --git a/lib/atc/Utility.h b/lib/atc/Utility.h index 2c0ea7270..6693df932 100644 --- a/lib/atc/Utility.h +++ b/lib/atc/Utility.h @@ -226,7 +226,7 @@ namespace ATC_Utility { char *endptr; strtod(s.c_str(), &endptr); - if(endptr != NULL && *endptr == '\0') return true; + if(endptr != nullptr && *endptr == '\0') return true; return false; } diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 7bf6125bc..2eebfcc0c 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(NULL),next(NULL){ + :descriptor(descriptor_),prev(nullptr),next(nullptr){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=NULL; - prev=NULL; + glogp->next=nullptr; + prev=nullptr; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ set_out(out); set_err(err); } diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index c29f72773..0f79fc418 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(NULL,1) { + recmatrix(): parr(nullptr,1) { sizey=sizex=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(NULL,1) { + sqmatrix(): parr(nullptr,1) { size=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(NULL){ + sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not NULL, puts the found value there - virtual int Find(long i, long j, T *retval=NULL)=0; - virtual int Find(long i, long j, T **retval=NULL)=0; + //e if retval is not nullptr, puts the found value there + virtual int Find(long i, long j, T *retval=nullptr)=0; + virtual int Find(long i, long j, T **retval=nullptr)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=NULL){ + int Find(long i, long j, T *retval=nullptr){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index a1a4feb0f..8e5fc7df4 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=NULL, int managed=0){ + void reset(T* ptr=nullptr, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==NULL than p is not managed (as in mngptr) + int *num; //if num==nullptr than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=NULL; + else num=nullptr; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } public: - shptr(T* p=NULL, int managed=1){ + shptr(T* p=nullptr, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=NULL; + num=nullptr; } - p=NULL; + p=nullptr; } } bool valid() const { - return p!=NULL; + return p!=nullptr; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 468abbda9..534cea44a 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=NULL) const { + T maxcoord(int *ind=nullptr) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index 7e82af0f6..6e809dd65 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,7 +13,7 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=NULL; +message_logger *message_logger::glogp=nullptr; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); const char *logfmt(const char *format,...){ diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index e118b76f3..4c6544001 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -255,7 +255,7 @@ public: } //e Create NormDeriv object and calculate the derivatived for the given WP - void set2(const WavePacket& w2_, const cdouble *I0_=NULL){ + void set2(const WavePacket& w2_, const cdouble *I0_=nullptr){ w2=w2_; d2.set(w2); w12=conj(w1)*w2; @@ -558,13 +558,13 @@ public: //e if PBCs are used, the corresponding coordinates of electrons and ions //e in periodic directions must be within the range [0, cell[per_dir]) //e @returns 1 if OK - int set_pbc(const Vector_3P pcell=NULL, int pbc_=0x7); + int set_pbc(const Vector_3P pcell=nullptr, int pbc_=0x7); ///\en Setup electrons: forms internal wave packet representations. /// If PBCs are used the coords must be within a range [0, cell). /// Default electron mass is AWPMD::me. - /// Default (q=NULL )electron charges are -1. - int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=NULL); + /// Default (q=nullptr )electron charges are -1. + int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=nullptr); //e setup ion charges and coordinates //e if PBCs are used the coords must be within a range [0, cell) @@ -593,16 +593,16 @@ public: // 0x2 -- add ion forces to the existing set // 0x4 -- calculate derivatives for electronic time step (NOT IMPLEMENTED) //e if PBCs are used the coords must be within a range [0, cell) - virtual int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); //e same as interaction, but using Hartee factorization (no antisymmetrization) - virtual int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates ion-ion interactions and updates Eii and ion forces if requested. This function /// is called form intaraction() and interaction_hartree if calc_ii is set. - virtual int interaction_ii(int flag,Vector_3P fi=NULL); + virtual int interaction_ii(int flag,Vector_3P fi=nullptr); //e Calculates Norm matrix //e The result is saved in AWPMD::Norm[s] @@ -643,7 +643,7 @@ public: ///\en Prepares force arrays according to \a flag setting for interaction() virtual void clear_forces(int flagi,Vector_3P fi, Vector_3P fe_x, - Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=NULL); + Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=nullptr); ///\en Creates wave packet according to the given physical parameters. diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 2c58bdaf2..55105066d 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -312,7 +312,7 @@ void AWPMD_split::clear_forces(int flag,Vector_3P fi, Vector_3P fe_x, void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ if(flag&0x4) //need to replace the forces - clear_forces(0x4,NULL,fe_x,fe_p,fe_w,fe_pw,fe_c); + clear_forces(0x4,nullptr,fe_x,fe_p,fe_w,fe_pw,fe_c); // recalculating derivatives if(flag&(0x8|0x4)){ //electron forces needed @@ -622,7 +622,7 @@ void AWPMD_split::y_deriv(cdouble v,int s,int c2, int c1){ /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n -/// will not update electronic force arrays, which may be NULL, \n +/// will not update electronic force arrays, which may be nullptr, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.h b/lib/awpmd/systems/interact/TCP/wpmd_split.h index 44fb75757..0ffef2645 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.h +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.h @@ -116,8 +116,8 @@ public: /// \a n is the number of electrons of a given spin component /// Electron velocity v is multiplied by mass to obtain momentum. /// Default mass (-1) means me. - /// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split - int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL); + /// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split + int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr); ///\en Starts adding new electron: continue with \ref add_split functions. @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be NULL, \n + /// will not update electronic force arrays, which may be nullptr, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n diff --git a/lib/colvars/colvar.cpp b/lib/colvars/colvar.cpp index 1002dc35d..61e83f44a 100644 --- a/lib/colvars/colvar.cpp +++ b/lib/colvars/colvar.cpp @@ -22,7 +22,7 @@ colvar::colvar() { - runave_os = NULL; + runave_os = nullptr; prev_timestep = -1L; after_restart = false; @@ -62,7 +62,7 @@ int colvar::init(std::string const &conf) get_keyval(conf, "name", this->name, (std::string("colvar")+cvm::to_str(cv->variables()->size()))); - if ((cvm::colvar_by_name(this->name) != NULL) && + if ((cvm::colvar_by_name(this->name) != nullptr) && (cvm::colvar_by_name(this->name) != this)) { cvm::error("Error: this colvar cannot have the same name, \""+this->name+ "\", as another colvar.\n", @@ -744,7 +744,7 @@ template int colvar::init_components_type(std::string c : ".\n")); cvm::increase_depth(); cvc *cvcp = new def_class_name(def_conf); - if (cvcp != NULL) { + if (cvcp != nullptr) { cvcs.push_back(cvcp); cvcp->check_keywords(def_conf, def_config_key); cvcp->config_key = def_config_key; @@ -994,7 +994,7 @@ int colvar::parse_analysis(std::string const &conf) acf_type = acf_vel; enable(f_cv_fdiff_velocity); colvar *cv2 = cvm::colvar_by_name(acf_colvar_name); - if (cv2 == NULL) { + if (cv2 == nullptr) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -1215,14 +1215,14 @@ colvar::~colvar() for (std::vector::iterator cei = value_evaluators.begin(); cei != value_evaluators.end(); ++cei) { - if (*cei != NULL) delete (*cei); + if (*cei != nullptr) delete (*cei); } value_evaluators.clear(); for (std::vector::iterator gei = gradient_evaluators.begin(); gei != gradient_evaluators.end(); ++gei) { - if (*gei != NULL) delete (*gei); + if (*gei != nullptr) delete (*gei); } gradient_evaluators.clear(); #endif @@ -1972,7 +1972,7 @@ void const *colvar::get_cvc_param_ptr(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return NULL; + return nullptr; } @@ -1983,7 +1983,7 @@ colvarvalue const *colvar::get_cvc_param_grad(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param_grad() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return NULL; + return nullptr; } @@ -2422,7 +2422,7 @@ int colvar::calc_acf() // the pointer to each vector is changed at every step colvar const *cfcv = cvm::colvar_by_name(acf_colvar_name); - if (cfcv == NULL) { + if (cfcv == nullptr) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -2660,7 +2660,7 @@ int colvar::calc_runave() if ((*x_history_p).size() >= runave_length-1) { - if (runave_os == NULL) { + if (runave_os == nullptr) { if (runave_outfile.size() == 0) { runave_outfile = std::string(cvm::output_prefix()+"."+ this->name+".runave.traj"); diff --git a/lib/colvars/colvaratoms.cpp b/lib/colvars/colvaratoms.cpp index 180fc69a8..2796f3d28 100644 --- a/lib/colvars/colvaratoms.cpp +++ b/lib/colvars/colvaratoms.cpp @@ -105,7 +105,7 @@ cvm::atom_group::~atom_group() if (fitting_group) { delete fitting_group; - fitting_group = NULL; + fitting_group = nullptr; } cvm::main()->unregister_named_atom_group(this); @@ -217,7 +217,7 @@ int cvm::atom_group::init() b_center = false; b_rotate = false; b_user_defined_fit = false; - fitting_group = NULL; + fitting_group = nullptr; noforce = false; @@ -368,7 +368,7 @@ int cvm::atom_group::parse(std::string const &group_conf) // Optional group name will let other groups reuse atom definition if (get_keyval(group_conf, "name", name)) { - if ((cvm::atom_group_by_name(this->name) != NULL) && + if ((cvm::atom_group_by_name(this->name) != nullptr) && (cvm::atom_group_by_name(this->name) != this)) { cvm::error("Error: this atom group cannot have the same name, \""+this->name+ "\", as another atom group.\n", @@ -395,7 +395,7 @@ int cvm::atom_group::parse(std::string const &group_conf) std::string atoms_of = ""; if (get_keyval(group_conf, "atomsOfGroup", atoms_of)) { atom_group * ag = atom_group_by_name(atoms_of); - if (ag == NULL) { + if (ag == nullptr) { cvm::error("Error: cannot find atom group with name " + atoms_of + ".\n"); return COLVARS_ERROR; } diff --git a/lib/colvars/colvarbias.cpp b/lib/colvars/colvarbias.cpp index 09bcca01b..cdbc13699 100644 --- a/lib/colvars/colvarbias.cpp +++ b/lib/colvars/colvarbias.cpp @@ -47,7 +47,7 @@ int colvarbias::init(std::string const &conf) { colvarbias *bias_with_name = cvm::bias_by_name(this->name); - if (bias_with_name != NULL) { + if (bias_with_name != nullptr) { if ((bias_with_name->rank != this->rank) || (bias_with_name->bias_type != this->bias_type)) { cvm::error("Error: this bias cannot have the same name, \""+this->name+ @@ -295,8 +295,8 @@ int colvarbias::update() colvar_values[i] = colvars[i]->value(); } - error_code |= calc_energy(NULL); - error_code |= calc_forces(NULL); + error_code |= calc_energy(nullptr); + error_code |= calc_forces(nullptr); return error_code; } @@ -547,8 +547,8 @@ colvarbias_ti::colvarbias_ti(char const *key) : colvarbias(key) { provide(f_cvb_calc_ti_samples); - ti_avg_forces = NULL; - ti_count = NULL; + ti_avg_forces = nullptr; + ti_count = nullptr; } @@ -560,13 +560,13 @@ colvarbias_ti::~colvarbias_ti() int colvarbias_ti::clear_state_data() { - if (ti_avg_forces != NULL) { + if (ti_avg_forces != nullptr) { delete ti_avg_forces; - ti_avg_forces = NULL; + ti_avg_forces = nullptr; } - if (ti_count != NULL) { + if (ti_count != nullptr) { delete ti_count; - ti_count = NULL; + ti_count = nullptr; } return COLVARS_OK; } @@ -622,7 +622,7 @@ int colvarbias_ti::init(std::string const &conf) int colvarbias_ti::init_grids() { if (is_enabled(f_cvb_calc_ti_samples)) { - if (ti_avg_forces == NULL) { + if (ti_avg_forces == nullptr) { ti_bin.resize(num_variables()); ti_system_forces.resize(num_variables()); for (size_t icv = 0; icv < num_variables(); icv++) { @@ -643,7 +643,7 @@ int colvarbias_ti::init_grids() int colvarbias_ti::update() { - return update_system_forces(NULL); + return update_system_forces(nullptr); } @@ -679,7 +679,7 @@ int colvarbias_ti::update_system_forces(std::vector const ti_system_forces[i] = variables(i)->total_force(); } else { ti_system_forces[i] = variables(i)->total_force() - - ((subtract_forces != NULL) ? + ((subtract_forces != nullptr) ? (*subtract_forces)[i] : previous_colvar_forces[i]); } } @@ -759,7 +759,7 @@ int colvarbias_ti::write_output_files() std::string const ti_output_prefix = cvm::output_prefix()+"."+this->name; - std::ostream *os = NULL; + std::ostream *os = nullptr; if (is_enabled(f_cvb_write_ti_samples)) { std::string const ti_count_file_name(ti_output_prefix+".ti.count"); diff --git a/lib/colvars/colvarbias.h b/lib/colvars/colvarbias.h index 5179c4285..20c346f81 100644 --- a/lib/colvars/colvarbias.h +++ b/lib/colvars/colvarbias.h @@ -58,12 +58,12 @@ public: virtual int update(); /// Compute the energy of the bias - /// Uses the vector of colvar values provided if not NULL, and the values + /// Uses the vector of colvar values provided if not nullptr, and the values /// currently cached in the bias instance otherwise virtual int calc_energy(std::vector const *values); /// Compute the forces due to the bias - /// Uses the vector of colvar values provided if not NULL, and the values + /// Uses the vector of colvar values provided if not nullptr, and the values /// currently cached in the bias instance otherwise virtual int calc_forces(std::vector const *values); diff --git a/lib/colvars/colvarbias_abf.cpp b/lib/colvars/colvarbias_abf.cpp index 5382a828f..9926579a8 100644 --- a/lib/colvars/colvarbias_abf.cpp +++ b/lib/colvars/colvarbias_abf.cpp @@ -18,16 +18,16 @@ colvarbias_abf::colvarbias_abf(char const *key) b_UI_estimator(false), b_CZAR_estimator(false), pabf_freq(0), - system_force(NULL), - gradients(NULL), - samples(NULL), - pmf(NULL), - z_gradients(NULL), - z_samples(NULL), - czar_gradients(NULL), - czar_pmf(NULL), - last_gradients(NULL), - last_samples(NULL) + system_force(nullptr), + gradients(nullptr), + samples(nullptr), + pmf(nullptr), + z_gradients(nullptr), + z_samples(nullptr), + czar_gradients(nullptr), + czar_pmf(nullptr), + last_gradients(nullptr), + last_samples(nullptr) { } @@ -261,37 +261,37 @@ colvarbias_abf::~colvarbias_abf() { if (samples) { delete samples; - samples = NULL; + samples = nullptr; } if (gradients) { delete gradients; - gradients = NULL; + gradients = nullptr; } if (pmf) { delete pmf; - pmf = NULL; + pmf = nullptr; } if (z_samples) { delete z_samples; - z_samples = NULL; + z_samples = nullptr; } if (z_gradients) { delete z_gradients; - z_gradients = NULL; + z_gradients = nullptr; } if (czar_gradients) { delete czar_gradients; - czar_gradients = NULL; + czar_gradients = nullptr; } if (czar_pmf) { delete czar_pmf; - czar_pmf = NULL; + czar_pmf = nullptr; } // shared ABF @@ -299,17 +299,17 @@ colvarbias_abf::~colvarbias_abf() // but now we can call shared externally if (last_samples) { delete last_samples; - last_samples = NULL; + last_samples = nullptr; } if (last_gradients) { delete last_gradients; - last_gradients = NULL; + last_gradients = nullptr; } if (system_force) { delete [] system_force; - system_force = NULL; + system_force = nullptr; } } @@ -488,7 +488,7 @@ int colvarbias_abf::update() } /// Add the bias energy for 1D ABF - bias_energy = calc_energy(NULL); + bias_energy = calc_energy(nullptr); return COLVARS_OK; } diff --git a/lib/colvars/colvarbias_histogram.cpp b/lib/colvars/colvarbias_histogram.cpp index 92985b0f6..44862ba25 100644 --- a/lib/colvars/colvarbias_histogram.cpp +++ b/lib/colvars/colvarbias_histogram.cpp @@ -15,7 +15,7 @@ colvarbias_histogram::colvarbias_histogram(char const *key) : colvarbias(key), - grid(NULL), out_name("") + grid(nullptr), out_name("") { provide(f_cvb_bypass_ext_lagrangian); // Allow histograms of actual cv for extended-Lagrangian } @@ -105,7 +105,7 @@ colvarbias_histogram::~colvarbias_histogram() { if (grid) { delete grid; - grid = NULL; + grid = nullptr; } } diff --git a/lib/colvars/colvarbias_meta.cpp b/lib/colvars/colvarbias_meta.cpp index 05f293d87..03c1886a8 100644 --- a/lib/colvars/colvarbias_meta.cpp +++ b/lib/colvars/colvarbias_meta.cpp @@ -36,7 +36,7 @@ colvarbias_meta::colvarbias_meta(char const *key) : colvarbias(key), colvarbias_ti(key) { new_hills_begin = hills.end(); - hills_traj_os = NULL; + hills_traj_os = nullptr; hill_width = 0.0; @@ -45,8 +45,8 @@ colvarbias_meta::colvarbias_meta(char const *key) use_grids = true; grids_freq = 0; rebin_grids = false; - hills_energy = NULL; - hills_energy_gradients = NULL; + hills_energy = nullptr; + hills_energy_gradients = nullptr; dump_fes = true; keep_hills = false; @@ -153,7 +153,7 @@ int colvarbias_meta::init(std::string const &conf) get_keyval(conf, "keepHills", keep_hills, keep_hills); get_keyval(conf, "keepFreeEnergyFiles", dump_fes_save, dump_fes_save); - if (hills_energy == NULL) { + if (hills_energy == nullptr) { hills_energy = new colvar_grid_scalar(colvars); hills_energy_gradients = new colvar_grid_gradient(colvars); } @@ -262,7 +262,7 @@ int colvarbias_meta::init_well_tempered_params(std::string const &conf) int colvarbias_meta::init_ebmeta_params(std::string const &conf) { // for ebmeta - target_dist = NULL; + target_dist = nullptr; get_keyval(conf, "ebMeta", ebmeta, false); if(ebmeta){ if (use_grids && expand_grids) { @@ -328,12 +328,12 @@ colvarbias_meta::~colvarbias_meta() if (hills_traj_os) { proxy->close_output_stream(hills_traj_file_name()); - hills_traj_os = NULL; + hills_traj_os = nullptr; } if (target_dist) { delete target_dist; - target_dist = NULL; + target_dist = nullptr; } } @@ -342,12 +342,12 @@ int colvarbias_meta::clear_state_data() { if (hills_energy) { delete hills_energy; - hills_energy = NULL; + hills_energy = nullptr; } if (hills_energy_gradients) { delete hills_energy_gradients; - hills_energy_gradients = NULL; + hills_energy_gradients = nullptr; } hills.clear(); @@ -451,8 +451,8 @@ int colvarbias_meta::update() error_code |= replica_share(); } - error_code |= calc_energy(NULL); - error_code |= calc_forces(NULL); + error_code |= calc_energy(nullptr); + error_code |= calc_forces(nullptr); return error_code; } @@ -593,7 +593,7 @@ int colvarbias_meta::update_bias() std::vector curr_bin = hills_energy->get_colvars_index(); hills_energy_sum_here = hills_energy->value(curr_bin); } else { - calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, NULL); + calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, nullptr); } hills_scale *= cvm::exp(-1.0*hills_energy_sum_here/(bias_temperature*cvm::boltzmann())); } @@ -887,14 +887,14 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, std::vector colvar_forces_scalar(num_variables()); std::vector he_ix = he->new_index(); - std::vector hg_ix = (hg != NULL) ? hg->new_index() : std::vector (0); + std::vector hg_ix = (hg != nullptr) ? hg->new_index() : std::vector (0); cvm::real hills_energy_here = 0.0; std::vector hills_forces_here(num_variables(), 0.0); size_t count = 0; size_t const print_frequency = ((hills.size() >= 1000000) ? 1 : (1000000/(hills.size()+1))); - if (hg != NULL) { + if (hg != nullptr) { // loop over the points of the grid for ( ; @@ -1310,8 +1310,8 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) hills_energy_gradients = new colvar_grid_gradient(colvars); } - colvar_grid_scalar *hills_energy_backup = NULL; - colvar_grid_gradient *hills_energy_gradients_backup = NULL; + colvar_grid_scalar *hills_energy_backup = nullptr; + colvar_grid_gradient *hills_energy_gradients_backup = nullptr; if (has_data) { if (cvm::debug()) @@ -1327,7 +1327,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_pos = is.tellg(); std::string key; if (!(is >> key)) { - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1343,7 +1343,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == NULL) + if (hills_energy_backup == nullptr) cvm::fatal_error("Error: couldn't read the free energy grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1365,7 +1365,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_gradients_pos = is.tellg(); if (!(is >> key)) { - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1381,7 +1381,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_gradients_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == NULL) + if (hills_energy_backup == nullptr) cvm::fatal_error("Error: couldn't read the free energy gradients grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1406,7 +1406,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+"\n"); - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { // now that we have successfully updated the grids, delete the // backup copies if (cvm::debug()) @@ -1594,7 +1594,7 @@ int colvarbias_meta::setup_output() // TODO: one may want to specify the path manually for intricated filesystems? char *pwd = new char[3001]; - if (GETCWD(pwd, 3000) == NULL) + if (GETCWD(pwd, 3000) == nullptr) cvm::fatal_error("Error: cannot get the path of the current working directory.\n"); replica_list_file = (std::string(pwd)+std::string(PATHSEP)+ @@ -1885,7 +1885,7 @@ int colvarbias_meta::reopen_replica_buffer_file() { int error_code = COLVARS_OK; colvarproxy *proxy = cvm::proxy; - if (proxy->get_output_stream(replica_hills_file) != NULL) { + if (proxy->get_output_stream(replica_hills_file) != nullptr) { error_code |= proxy->close_output_stream(replica_hills_file); } error_code |= proxy->remove_file(replica_hills_file); diff --git a/lib/colvars/colvarcomp.cpp b/lib/colvars/colvarcomp.cpp index 05d1195d5..d45d85111 100644 --- a/lib/colvars/colvarcomp.cpp +++ b/lib/colvars/colvarcomp.cpp @@ -135,7 +135,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf, char const *group_key, bool optional) { - cvm::atom_group *group = NULL; + cvm::atom_group *group = nullptr; std::string group_conf; if (key_lookup(conf, group_key, &group_conf)) { @@ -298,7 +298,7 @@ colvar::cvc::~cvc() free_children_deps(); remove_all_children(); for (size_t i = 0; i < atom_groups.size(); i++) { - if (atom_groups[i] != NULL) delete atom_groups[i]; + if (atom_groups[i] != nullptr) delete atom_groups[i]; } } @@ -344,7 +344,7 @@ colvarvalue const *colvar::cvc::get_param_grad(std::string const ¶m_name) { colvarvalue const *ptr = reinterpret_cast(get_param_grad_ptr(param_name)); - return ptr != NULL ? ptr : NULL; + return ptr != nullptr ? ptr : nullptr; } @@ -553,7 +553,7 @@ void colvar::cvc::debug_gradients() } } - if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != NULL)) { + if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != nullptr)) { cvm::atom_group *ref_group = group->fitting_group; group->read_positions(); group->calc_required_properties(); diff --git a/lib/colvars/colvarcomp_coordnums.cpp b/lib/colvars/colvarcomp_coordnums.cpp index f0fbabfc4..f36d05552 100644 --- a/lib/colvars/colvarcomp_coordnums.cpp +++ b/lib/colvars/colvarcomp_coordnums.cpp @@ -91,7 +91,7 @@ cvm::real colvar::coordnum::switching_function(cvm::real const &r0, colvar::coordnum::coordnum(std::string const &conf) - : cvc(conf), b_anisotropic(false), pairlist(NULL) + : cvc(conf), b_anisotropic(false), pairlist(nullptr) { function_type = "coordnum"; @@ -102,7 +102,7 @@ colvar::coordnum::coordnum(std::string const &conf) group1 = parse_group(conf, "group1"); group2 = parse_group(conf, "group2"); - if (group1 == NULL || group2 == NULL) { + if (group1 == nullptr || group2 == nullptr) { cvm::error("Error: failed to initialize atom groups.\n", INPUT_ERROR); return; @@ -183,7 +183,7 @@ colvar::coordnum::coordnum(std::string const &conf) colvar::coordnum::~coordnum() { - if (pairlist != NULL) { + if (pairlist != nullptr) { delete [] pairlist; } } @@ -218,11 +218,11 @@ template void colvar::coordnum::main_loop(bool **pairlist_elem) template int colvar::coordnum::compute_coordnum() { - bool const use_pairlist = (pairlist != NULL); - bool const rebuild_pairlist = (pairlist != NULL) && + bool const use_pairlist = (pairlist != nullptr); + bool const rebuild_pairlist = (pairlist != nullptr) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : NULL; + bool *pairlist_elem = use_pairlist ? pairlist : nullptr; if (b_anisotropic) { @@ -239,7 +239,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags | ef_anisotropic; - main_loop(NULL); + main_loop(nullptr); } } else { @@ -257,7 +257,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags; - main_loop(NULL); + main_loop(nullptr); } } @@ -367,7 +367,7 @@ void colvar::h_bond::calc_value() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - NULL, 0.0); + nullptr, 0.0); } @@ -378,7 +378,7 @@ void colvar::h_bond::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - NULL, 0.0); + nullptr, 0.0); } @@ -393,7 +393,7 @@ simple_scalar_dist_functions(h_bond) colvar::selfcoordnum::selfcoordnum(std::string const &conf) - : cvc(conf), pairlist(NULL) + : cvc(conf), pairlist(nullptr) { function_type = "selfcoordnum"; x.type(colvarvalue::type_scalar); @@ -438,7 +438,7 @@ colvar::selfcoordnum::selfcoordnum(std::string const &conf) colvar::selfcoordnum::~selfcoordnum() { - if (pairlist != NULL) { + if (pairlist != nullptr) { delete [] pairlist; } } @@ -448,11 +448,11 @@ template int colvar::selfcoordnum::compute_selfcoordnum() { cvm::rvector const r0_vec(0.0); // TODO enable the flag? - bool const use_pairlist = (pairlist != NULL); - bool const rebuild_pairlist = (pairlist != NULL) && + bool const use_pairlist = (pairlist != nullptr); + bool const rebuild_pairlist = (pairlist != nullptr) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : NULL; + bool *pairlist_elem = use_pairlist ? pairlist : nullptr; size_t i = 0, j = 0; size_t const n = group1->size(); @@ -601,13 +601,13 @@ void colvar::groupcoordnum::calc_value() x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } else { int const flags = coordnum::ef_null; x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } } @@ -624,13 +624,13 @@ void colvar::groupcoordnum::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } else { int const flags = coordnum::ef_gradients; coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } group1->set_weighted_gradient(group1_com_atom.grad); diff --git a/lib/colvars/colvarcomp_distances.cpp b/lib/colvars/colvarcomp_distances.cpp index c3c1ee55d..88a5088aa 100644 --- a/lib/colvars/colvarcomp_distances.cpp +++ b/lib/colvars/colvarcomp_distances.cpp @@ -964,7 +964,7 @@ colvar::rmsd::rmsd(std::string const &conf) } bool b_Jacobian_derivative = true; - if (atoms->fitting_group != NULL && b_Jacobian_derivative) { + if (atoms->fitting_group != nullptr && b_Jacobian_derivative) { cvm::log("The option \"fittingGroup\" (alternative group for fitting) was enabled: " "Jacobian derivatives of the RMSD will not be calculated.\n"); b_Jacobian_derivative = false; diff --git a/lib/colvars/colvardeps.cpp b/lib/colvars/colvardeps.cpp index f83458b51..f647211f6 100644 --- a/lib/colvars/colvardeps.cpp +++ b/lib/colvars/colvardeps.cpp @@ -33,7 +33,7 @@ colvardeps::~colvardeps() { // Do not delete features if it's a static object // may change in the future though // for (i=0; i &colvars, {} colvar_grid_scalar::colvar_grid_scalar() - : colvar_grid(), samples(NULL) + : colvar_grid(), samples(nullptr) {} colvar_grid_scalar::colvar_grid_scalar(colvar_grid_scalar const &g) - : colvar_grid(g), samples(NULL) + : colvar_grid(g), samples(nullptr) { } colvar_grid_scalar::colvar_grid_scalar(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, 1), samples(NULL) + : colvar_grid(nx_i, 0.0, 1), samples(nullptr) { } colvar_grid_scalar::colvar_grid_scalar(std::vector &colvars, bool margin) - : colvar_grid(colvars, 0.0, 1, margin), samples(NULL) + : colvar_grid(colvars, 0.0, 1, margin), samples(nullptr) { } @@ -122,15 +122,15 @@ cvm::real colvar_grid_scalar::entropy() const colvar_grid_gradient::colvar_grid_gradient() - : colvar_grid(), samples(NULL) + : colvar_grid(), samples(nullptr) {} colvar_grid_gradient::colvar_grid_gradient(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, nx_i.size()), samples(NULL) + : colvar_grid(nx_i, 0.0, nx_i.size()), samples(nullptr) {} colvar_grid_gradient::colvar_grid_gradient(std::vector &colvars) - : colvar_grid(colvars, 0.0, colvars.size()), samples(NULL) + : colvar_grid(colvars, 0.0, colvars.size()), samples(nullptr) {} void colvar_grid_gradient::write_1D_integral(std::ostream &os) diff --git a/lib/colvars/colvarmodule.cpp b/lib/colvars/colvarmodule.cpp index 1d5f75bbc..48a38a607 100644 --- a/lib/colvars/colvarmodule.cpp +++ b/lib/colvars/colvarmodule.cpp @@ -30,11 +30,11 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) depth_s = 0; log_level_ = 10; - cv_traj_os = NULL; + cv_traj_os = nullptr; xyz_reader_use_count = 0; - if (proxy == NULL) { + if (proxy == nullptr) { proxy = proxy_in; // Pointer to the proxy object parse = new colvarparse(); // Parsing object for global options version_int = proxy->get_version_from_string(COLVARS_VERSION); @@ -573,7 +573,7 @@ colvarbias * colvarmodule::bias_by_name(std::string const &name) return (*bi); } } - return NULL; + return nullptr; } @@ -587,7 +587,7 @@ colvar *colvarmodule::colvar_by_name(std::string const &name) return (*cvi); } } - return NULL; + return nullptr; } @@ -601,7 +601,7 @@ cvm::atom_group *colvarmodule::atom_group_by_name(std::string const &name) return (*agi); } } - return NULL; + return nullptr; } @@ -631,7 +631,7 @@ int colvarmodule::change_configuration(std::string const &bias_name, cvm::increase_depth(); colvarbias *b; b = bias_by_name(bias_name); - if (b == NULL) { + if (b == nullptr) { cvm::error("Error: bias not found: " + bias_name); return COLVARS_ERROR; } @@ -647,7 +647,7 @@ std::string colvarmodule::read_colvar(std::string const &name) colvar *c; std::stringstream ss; c = colvar_by_name(name); - if (c == NULL) { + if (c == nullptr) { cvm::error("Error: colvar not found: " + name); return std::string(); } @@ -663,7 +663,7 @@ cvm::real colvarmodule::energy_difference(std::string const &bias_name, colvarbias *b; cvm::real energy_diff = 0.; b = bias_by_name(bias_name); - if (b == NULL) { + if (b == nullptr) { cvm::error("Error: bias not found: " + bias_name); return 0.; } @@ -678,7 +678,7 @@ int colvarmodule::bias_current_bin(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->current_bin(); } else { cvm::error("Error: bias not found.\n"); @@ -695,7 +695,7 @@ int colvarmodule::bias_bin_num(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->bin_num(); } else { cvm::error("Error: bias not found.\n"); @@ -712,7 +712,7 @@ int colvarmodule::bias_bin_count(std::string const &bias_name, size_t bin_index) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->bin_count(bin_index); } else { cvm::error("Error: bias not found.\n"); @@ -729,7 +729,7 @@ int colvarmodule::bias_share(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { b->replica_share(); ret = COLVARS_OK; } else { @@ -1037,7 +1037,7 @@ int colvarmodule::write_restart_file(std::string const &out_name) int colvarmodule::write_traj_files() { - if (cv_traj_os == NULL) { + if (cv_traj_os == nullptr) { if (open_traj_file(cv_traj_name) != COLVARS_OK) { return cvm::get_error(); } else { @@ -1057,7 +1057,7 @@ int colvarmodule::write_traj_files() write_traj(*cv_traj_os); } - if (restart_out_freq && (cv_traj_os != NULL)) { + if (restart_out_freq && (cv_traj_os != nullptr)) { // flush the trajectory file if we are at the restart frequency if ( (cvm::step_relative() > 0) && ((cvm::step_absolute() % restart_out_freq) == 0) ) { @@ -1151,8 +1151,8 @@ colvarmodule::~colvarmodule() atom_group::delete_features(); delete parse; - parse = NULL; - proxy = NULL; + parse = nullptr; + proxy = nullptr; } } @@ -1184,7 +1184,7 @@ int colvarmodule::reset() proxy->reset(); - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { // Do not close traj file here, as we might not be done with it yet. proxy->flush_output_stream(cv_traj_os); } @@ -1395,7 +1395,7 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) if (static_cast(is.tellg()) == pos) { // This block has not been read by any object: discard it and move on // to the next one - is >> colvarparse::read_block(word, NULL); + is >> colvarparse::read_block(word, nullptr); } if (!is) break; @@ -1456,7 +1456,7 @@ int colvarmodule::write_output_files() } cvm::decrease_depth(); - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { // do not close, there may be another run command proxy->flush_output_stream(cv_traj_os); } @@ -1575,7 +1575,7 @@ std::ostream & colvarmodule::write_restart(std::ostream &os) int colvarmodule::open_traj_file(std::string const &file_name) { - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { return COLVARS_OK; } @@ -1591,7 +1591,7 @@ int colvarmodule::open_traj_file(std::string const &file_name) cv_traj_os = (cvm::proxy)->output_stream(file_name); } - if (cv_traj_os == NULL) { + if (cv_traj_os == nullptr) { cvm::error("Error: cannot write to file \""+file_name+"\".\n", FILE_ERROR); } @@ -1602,9 +1602,9 @@ int colvarmodule::open_traj_file(std::string const &file_name) int colvarmodule::close_traj_file() { - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { proxy->close_output_stream(cv_traj_name); - cv_traj_os = NULL; + cv_traj_os = nullptr; } return cvm::get_error(); } @@ -1672,7 +1672,7 @@ void cvm::log(std::string const &message, int min_log_level) { if (cvm::log_level() < min_log_level) return; // allow logging when the module is not fully initialized - size_t const d = (cvm::main() != NULL) ? depth() : 0; + size_t const d = (cvm::main() != nullptr) ? depth() : 0; if (d > 0) { proxy->log((std::string(2*d, ' '))+message); } else { @@ -1780,7 +1780,7 @@ int cvm::read_index_file(char const *filename) } if (index_of_group < 0) { index_group_names.push_back(group_name); - index_groups.push_back(NULL); + index_groups.push_back(nullptr); index_of_group = index_groups.size()-1; } } else { @@ -1799,7 +1799,7 @@ int cvm::read_index_file(char const *filename) pos = is.tellg(); } - if (old_index_group != NULL) { + if (old_index_group != nullptr) { bool equal = false; if (new_index_group->size() == old_index_group->size()) { if (std::equal(new_index_group->begin(), new_index_group->end(), @@ -1810,13 +1810,13 @@ int cvm::read_index_file(char const *filename) if (! equal) { new_index_group->clear(); delete new_index_group; - new_index_group = NULL; + new_index_group = nullptr; return cvm::error("Error: the index group \""+group_name+ "\" was redefined.\n", INPUT_ERROR); } else { old_index_group->clear(); delete old_index_group; - old_index_group = NULL; + old_index_group = nullptr; } } @@ -1850,7 +1850,7 @@ int colvarmodule::reset_index_groups() size_t i = 0; for ( ; i < index_groups.size(); i++) { delete index_groups[i]; - index_groups[i] = NULL; + index_groups[i] = nullptr; } index_group_names.clear(); index_groups.clear(); @@ -2179,7 +2179,7 @@ std::string cvm::wrap_string(std::string const &s, size_t nchars) // shared pointer to the proxy object -colvarproxy *colvarmodule::proxy = NULL; +colvarproxy *colvarmodule::proxy = nullptr; // static runtime data cvm::real colvarmodule::debug_gradients_step_size = 1.0e-07; diff --git a/lib/colvars/colvarmodule.h b/lib/colvars/colvarmodule.h index 9346e8e1d..e06f05aca 100644 --- a/lib/colvars/colvarmodule.h +++ b/lib/colvars/colvarmodule.h @@ -459,13 +459,13 @@ public: /// Backup a file before writing it static int backup_file(char const *filename); - /// Look up a bias by name; returns NULL if not found + /// Look up a bias by name; returns nullptr if not found static colvarbias * bias_by_name(std::string const &name); - /// Look up a colvar by name; returns NULL if not found + /// Look up a colvar by name; returns nullptr if not found static colvar * colvar_by_name(std::string const &name); - /// Look up a named atom group by name; returns NULL if not found + /// Look up a named atom group by name; returns nullptr if not found static atom_group * atom_group_by_name(std::string const &name); /// Load new configuration for the given bias - diff --git a/lib/colvars/colvarparams.cpp b/lib/colvars/colvarparams.cpp index e957a1841..ea45c0110 100644 --- a/lib/colvars/colvarparams.cpp +++ b/lib/colvars/colvarparams.cpp @@ -76,7 +76,7 @@ void const *colvarparams::get_param_ptr(std::string const ¶m_name) return param_map[param_name]; } cvm::error("Error: parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return NULL; + return nullptr; } @@ -87,7 +87,7 @@ void const *colvarparams::get_param_grad_ptr(std::string const ¶m_name) } cvm::error("Error: gradient of parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return NULL; + return nullptr; } @@ -95,7 +95,7 @@ cvm::real colvarparams::get_param(std::string const ¶m_name) { cvm::real const *ptr = reinterpret_cast(get_param_ptr(param_name)); - return ptr != NULL ? *ptr : 0.0; + return ptr != nullptr ? *ptr : 0.0; } diff --git a/lib/colvars/colvarparse.cpp b/lib/colvars/colvarparse.cpp index a09d6be9e..e61ebf355 100644 --- a/lib/colvars/colvarparse.cpp +++ b/lib/colvars/colvarparse.cpp @@ -674,12 +674,12 @@ bool colvarparse::key_lookup(std::string const &conf, std::string const conf_lower(to_lower_cppstr(conf)); // by default, there is no value, unless we found one - if (data != NULL) { + if (data != nullptr) { data->clear(); } // start from the first occurrence of key - size_t pos = conf_lower.find(key, (save_pos != NULL) ? *save_pos : 0); + size_t pos = conf_lower.find(key, (save_pos != nullptr) ? *save_pos : 0); // iterate over all instances of the substring until it finds it as isolated keyword while (true) { @@ -727,7 +727,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != NULL) { + if (save_pos != nullptr) { // save the pointer for a future call (when iterating over multiple // valid instances of the same keyword) *save_pos = pos + key.size(); @@ -820,7 +820,7 @@ bool colvarparse::key_lookup(std::string const &conf, data_end) + 1; } - if (data != NULL) { + if (data != nullptr) { data->append(line, data_begin, (data_end-data_begin)); if (cvm::debug()) { @@ -834,7 +834,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != NULL) *save_pos = line_end; + if (save_pos != nullptr) *save_pos = line_end; return true; } diff --git a/lib/colvars/colvarparse.h b/lib/colvars/colvarparse.h index b7d42fdff..fc1362b2b 100644 --- a/lib/colvars/colvarparse.h +++ b/lib/colvars/colvarparse.h @@ -275,12 +275,12 @@ public: /// The keyword that identifies the block std::string const key; - /// Where to keep the data (may be NULL) + /// Where to keep the data (may be nullptr) std::string * const data; public: - read_block(std::string const &key_in, std::string *data_in = NULL); + read_block(std::string const &key_in, std::string *data_in = nullptr); ~read_block(); @@ -300,8 +300,8 @@ public: /// within "conf", useful when doing multiple calls bool key_lookup(std::string const &conf, char const *key, - std::string *data = NULL, - size_t *save_pos = NULL); + std::string *data = nullptr, + size_t *save_pos = nullptr); /// \brief Reads a configuration line, adds it to config_string, and returns /// the stream \param is Input stream \param line String that will hold the diff --git a/lib/colvars/colvarproxy.cpp b/lib/colvars/colvarproxy.cpp index 63ae07a57..7eb0b22cb 100644 --- a/lib/colvars/colvarproxy.cpp +++ b/lib/colvars/colvarproxy.cpp @@ -296,7 +296,7 @@ void colvarproxy_atom_groups::clear_atom_group(int index) colvarproxy_smp::colvarproxy_smp() { b_smp_active = true; // May be disabled by user option - omp_lock_state = NULL; + omp_lock_state = nullptr; #if defined(_OPENMP) if (smp_thread_id() == 0) { omp_lock_state = reinterpret_cast(new omp_lock_t); @@ -459,7 +459,7 @@ int colvarproxy_smp::smp_unlock() colvarproxy_script::colvarproxy_script() { - script = NULL; + script = nullptr; } @@ -507,7 +507,7 @@ int colvarproxy_script::run_colvar_gradient_callback(std::string const & /* name colvarproxy_tcl::colvarproxy_tcl() { - tcl_interp_ = NULL; + tcl_interp_ = nullptr; } @@ -528,7 +528,7 @@ char const *colvarproxy_tcl::tcl_obj_to_str(unsigned char *obj) #if defined(COLVARS_TCL) return Tcl_GetString(reinterpret_cast(obj)); #else - return NULL; + return nullptr; #endif } @@ -666,7 +666,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, } std::ostream *os = get_output_stream(output_name); - if (os != NULL) return os; + if (os != nullptr) return os; if (!(mode & (std::ios_base::app | std::ios_base::ate))) { backup_file(output_name); @@ -675,7 +675,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, if (!osf->is_open()) { cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", FILE_ERROR); - return NULL; + return nullptr; } output_stream_names.push_back(output_name); output_files.push_back(osf); @@ -692,7 +692,7 @@ std::ostream *colvarproxy_io::get_output_stream(std::string const &output_name) return *osi; } } - return NULL; + return nullptr; } @@ -794,7 +794,7 @@ int colvarproxy_io::rename_file(char const *filename, char const *newfilename) colvarproxy::colvarproxy() { - colvars = NULL; + colvars = nullptr; b_simulation_running = true; b_delete_requested = false; } diff --git a/lib/colvars/colvarproxy.h b/lib/colvars/colvarproxy.h index ba91afb40..a46589a52 100644 --- a/lib/colvars/colvarproxy.h +++ b/lib/colvars/colvarproxy.h @@ -607,7 +607,7 @@ public: std::ios_base::openmode mode = std::ios_base::out); - /// Returns a reference to output_name if it exists, NULL otherwise + /// Returns a reference to output_name if it exists, nullptr otherwise virtual std::ostream *get_output_stream(std::string const &output_name); /// \brief Flushes the given output channel diff --git a/lib/colvars/colvarscript.cpp b/lib/colvars/colvarscript.cpp index 10b276c89..a8b5d6ab2 100644 --- a/lib/colvars/colvarscript.cpp +++ b/lib/colvars/colvarscript.cpp @@ -97,7 +97,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvar *cv = cvm::colvar_by_name(name); - if (cv == NULL) { + if (cv == nullptr) { result = "Colvar not found: " + name; return COLVARSCRIPT_ERROR; } @@ -111,7 +111,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvarbias *b = cvm::bias_by_name(name); - if (b == NULL) { + if (b == nullptr) { result = "Bias not found: " + name; return COLVARSCRIPT_ERROR; } @@ -186,7 +186,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) /// Parse config from string if (cmd == "config") { - return exec_command(cv_config, NULL, objc, objv); + return exec_command(cv_config, nullptr, objc, objv); } /// Load an input state file @@ -247,7 +247,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } else if (objc == 3) { // Failure of this function does not trigger an error, but // returns nonzero, to let scripts detect available frames - int error = proxy->set_frame(strtol(obj_to_str(objv[2]), NULL, 10)); + int error = proxy->set_frame(strtol(obj_to_str(objv[2]), nullptr, 10)); result = cvm::to_str(error == COLVARS_OK ? 0 : -1); return COLVARS_OK; } else { @@ -258,7 +258,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) if (cmd == "addenergy") { if (objc == 3) { - colvars->total_bias_energy += strtod(obj_to_str(objv[2]), NULL); + colvars->total_bias_energy += strtod(obj_to_str(objv[2]), nullptr); return COLVARS_OK; } else { result = "Wrong arguments to command \"addenergy\"\n" + help_string(); @@ -267,7 +267,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } if (cmd == "help") { - return exec_command(cv_help, NULL, objc, objv); + return exec_command(cv_help, nullptr, objc, objv); } result = "Syntax error\n" + help_string(); @@ -320,7 +320,7 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) // colvar destructor is tasked with the cleanup delete cv; // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { + if (colvars->cv_traj_os != nullptr) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -513,7 +513,7 @@ int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[] // the bias destructor takes care of the cleanup at cvm level delete b; // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { + if (colvars->cv_traj_os != nullptr) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -564,7 +564,7 @@ int colvarscript::proc_features(colvardeps *obj, if ((subcmd == "get") || (subcmd == "set")) { std::vector const &features = obj->features(); std::string const req_feature(obj_to_str(objv[3])); - colvardeps::feature *f = NULL; + colvardeps::feature *f = nullptr; int fid = 0; for (fid = 0; fid < int(features.size()); fid++) { if (features[fid]->description == @@ -574,7 +574,7 @@ int colvarscript::proc_features(colvardeps *obj, } } - if (f == NULL) { + if (f == nullptr) { result = "Error: feature \""+req_feature+"\" does not exist.\n"; return COLVARSCRIPT_ERROR; diff --git a/lib/colvars/colvarscript.h b/lib/colvars/colvarscript.h index 69d52cbb5..04679b37a 100644 --- a/lib/colvars/colvarscript.h +++ b/lib/colvars/colvarscript.h @@ -278,7 +278,7 @@ extern "C" { 1, 1, { "E (float) - Amount of energy to add" }, cvm::main()->total_bias_energy += - strtod(script->obj_to_str(objv[2]), NULL); + strtod(script->obj_to_str(objv[2]), nullptr); return COLVARS_OK; ) diff --git a/lib/colvars/colvartypes.h b/lib/colvars/colvartypes.h index e5f12154e..55401576b 100644 --- a/lib/colvars/colvartypes.h +++ b/lib/colvars/colvartypes.h @@ -59,7 +59,7 @@ public: if (data.size() > 0) { return &(data[0]); } else { - return NULL; + return nullptr; } } @@ -520,7 +520,7 @@ public: if (rows.size() > 0) { return &(pointers[0]); } else { - return NULL; + return nullptr; } } diff --git a/lib/colvars/lepton/include/lepton/Operation.h b/lib/colvars/lepton/include/lepton/Operation.h index 1ddde0b8c..68474137f 100644 --- a/lib/colvars/lepton/include/lepton/Operation.h +++ b/lib/colvars/lepton/include/lepton/Operation.h @@ -186,7 +186,7 @@ public: } bool operator!=(const Operation& op) const { const Constant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -217,7 +217,7 @@ public: ExpressionTreeNode differentiate(const std::vector& children, const std::vector& childDerivs, const std::string& variable) const; bool operator!=(const Operation& op) const { const Variable* o = dynamic_cast(&op); - return (o == NULL || o->name != name); + return (o == nullptr || o->name != name); } private: std::string name; @@ -264,7 +264,7 @@ public: } bool operator!=(const Operation& op) const { const Custom* o = dynamic_cast(&op); - return (o == NULL || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); + return (o == nullptr || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); } private: std::string name; @@ -955,7 +955,7 @@ public: } bool operator!=(const Operation& op) const { const AddConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -988,7 +988,7 @@ public: } bool operator!=(const Operation& op) const { const MultiplyConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -1042,7 +1042,7 @@ public: } bool operator!=(const Operation& op) const { const PowerConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } bool isInfixOperator() const { return true; diff --git a/lib/colvars/lepton/src/CompiledExpression.cpp b/lib/colvars/lepton/src/CompiledExpression.cpp index 1ad348b47..6abcad2de 100644 --- a/lib/colvars/lepton/src/CompiledExpression.cpp +++ b/lib/colvars/lepton/src/CompiledExpression.cpp @@ -40,10 +40,10 @@ using namespace std; using namespace asmjit; #endif -CompiledExpression::CompiledExpression() : jitCode(NULL) { +CompiledExpression::CompiledExpression() : jitCode(nullptr) { } -CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(NULL) { +CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(nullptr) { ParsedExpression expr = expression.optimize(); // Just in case it wasn't already optimized. vector > temps; compileExpression(expr.getRootNode(), temps); @@ -59,11 +59,11 @@ CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jit CompiledExpression::~CompiledExpression() { for (int i = 0; i < (int) operation.size(); i++) - if (operation[i] != NULL) + if (operation[i] != nullptr) delete operation[i]; } -CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(NULL) { +CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(nullptr) { *this = expression; } diff --git a/lib/colvars/lepton/src/ExpressionTreeNode.cpp b/lib/colvars/lepton/src/ExpressionTreeNode.cpp index 851987826..09c5352d2 100644 --- a/lib/colvars/lepton/src/ExpressionTreeNode.cpp +++ b/lib/colvars/lepton/src/ExpressionTreeNode.cpp @@ -59,14 +59,14 @@ ExpressionTreeNode::ExpressionTreeNode(Operation* operation) : operation(operati throw Exception("wrong number of arguments to function: "+operation->getName()); } -ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == NULL ? NULL : node.operation->clone()), children(node.getChildren()) { +ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == nullptr ? nullptr : node.operation->clone()), children(node.getChildren()) { } -ExpressionTreeNode::ExpressionTreeNode() : operation(NULL) { +ExpressionTreeNode::ExpressionTreeNode() : operation(nullptr) { } ExpressionTreeNode::~ExpressionTreeNode() { - if (operation != NULL) + if (operation != nullptr) delete operation; } @@ -91,7 +91,7 @@ bool ExpressionTreeNode::operator==(const ExpressionTreeNode& node) const { } ExpressionTreeNode& ExpressionTreeNode::operator=(const ExpressionTreeNode& node) { - if (operation != NULL) + if (operation != nullptr) delete operation; operation = node.getOperation().clone(); children = node.getChildren(); diff --git a/lib/colvars/lepton/src/ParsedExpression.cpp b/lib/colvars/lepton/src/ParsedExpression.cpp index fd3b091d3..c25975634 100644 --- a/lib/colvars/lepton/src/ParsedExpression.cpp +++ b/lib/colvars/lepton/src/ParsedExpression.cpp @@ -46,7 +46,7 @@ ParsedExpression::ParsedExpression(const ExpressionTreeNode& rootNode) : rootNod } const ExpressionTreeNode& ParsedExpression::getRootNode() const { - if (&rootNode.getOperation() == NULL) + if (&rootNode.getOperation() == nullptr) throw Exception("Illegal call to an initialized ParsedExpression"); return rootNode; } diff --git a/lib/gpu/cudpp_mini/cudpp.cpp b/lib/gpu/cudpp_mini/cudpp.cpp index e2cd4621a..950632074 100644 --- a/lib/gpu/cudpp_mini/cudpp.cpp +++ b/lib/gpu/cudpp_mini/cudpp.cpp @@ -95,7 +95,7 @@ CUDPPResult cudppScan(CUDPPHandle planHandle, size_t numElements) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, 1, plan); return CUDPP_SUCCESS; @@ -159,7 +159,7 @@ CUDPPResult cudppSegmentedScan(CUDPPHandle planHandle, { CUDPPSegmentedScanPlan *plan = (CUDPPSegmentedScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSegmentedScanDispatch(d_out, d_idata, d_iflags, numElements, plan); return CUDPP_SUCCESS; @@ -200,7 +200,7 @@ CUDPPResult cudppMultiScan(CUDPPHandle planHandle, size_t numRows) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, numRows, plan); return CUDPP_SUCCESS; @@ -255,7 +255,7 @@ CUDPPResult cudppCompact(CUDPPHandle planHandle, size_t numElements) { CUDPPCompactPlan *plan = (CUDPPCompactPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppCompactDispatch(d_out, d_numValidElements, d_in, d_isValid, numElements, plan); @@ -300,7 +300,7 @@ CUDPPResult cudppSort(CUDPPHandle planHandle, size_t numElements) { CUDPPRadixSortPlan *plan = (CUDPPRadixSortPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppRadixSortDispatch(d_keys, d_values, numElements, keyBits, plan); return CUDPP_SUCCESS; @@ -331,7 +331,7 @@ CUDPPResult cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandl CUDPPSparseMatrixVectorMultiplyPlan *plan = (CUDPPSparseMatrixVectorMultiplyPlan*)CUDPPPlanManager::GetPlan(sparseMatrixHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSparseMatrixVectorMultiplyDispatch(d_y, d_x, plan); return CUDPP_SUCCESS; @@ -366,7 +366,7 @@ CUDPP_DLL CUDPPResult cudppRand(CUDPPHandle planHandle,void * d_out, size_t numElements) { CUDPPRandPlan * plan = (CUDPPRandPlan *) CUDPPPlanManager::GetPlan(planHandle); - if(plan != NULL) + if(plan != nullptr) { //dispatch the rand algorithm here cudppRandDispatch(d_out, numElements, plan); diff --git a/lib/gpu/cudpp_mini/cudpp_plan.cpp b/lib/gpu/cudpp_mini/cudpp_plan.cpp index e92a857dd..8ea99a23f 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan.cpp @@ -18,7 +18,7 @@ #include -CUDPPPlanManager* CUDPPPlanManager::m_instance = NULL; +CUDPPPlanManager* CUDPPPlanManager::m_instance = nullptr; CUDPPResult validateOptions(CUDPPConfiguration config, size_t /*numElements*/, size_t numRows, size_t /*rowPitch*/) { diff --git a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp index dd9d6eb9d..33c8621d2 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp @@ -26,17 +26,17 @@ extern "C" void compNumCTAs(KernelPointer kernel, size_t bytesDynamicSharedMem, //! @internal Instantiate the plan manager singleton object void CUDPPPlanManager::Instantiate() { - if (NULL == m_instance) + if (nullptr == m_instance) m_instance = new CUDPPPlanManager; } //! @internal Destroy the plan manager singleton object void CUDPPPlanManager::Destroy() { - if (NULL != m_instance) + if (nullptr != m_instance) { delete m_instance; - m_instance = NULL; + m_instance = nullptr; } } @@ -51,7 +51,7 @@ CUDPPPlanManager::~CUDPPPlanManager() { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; } m_instance->plans.clear(); @@ -85,7 +85,7 @@ CUDPPHandle CUDPPPlanManager::AddPlan(CUDPPPlan* plan) */ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { return false; } @@ -97,7 +97,7 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; m_instance->plans.erase(it); if (0 == m_instance->plans.size()) @@ -115,14 +115,14 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) /** @brief Get a plan from the plan manager by handle * -* @returns A pointer to the plan if found, or NULL otherwise +* @returns A pointer to the plan if found, or nullptr otherwise * @param handle The handle to the requested plan */ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { - return NULL; + return nullptr; } std::map::iterator it; @@ -133,13 +133,13 @@ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) } else { - return NULL; + return nullptr; } } size_t CUDPPPlanManager::numCTAs(KernelPointer kernel) { - if (m_instance == NULL) + if (m_instance == nullptr) { return 0; } diff --git a/lib/gpu/cudpp_mini/cutil.h b/lib/gpu/cudpp_mini/cutil.h index 7d1fcc17e..54f29f498 100644 --- a/lib/gpu/cudpp_mini/cutil.h +++ b/lib/gpu/cudpp_mini/cutil.h @@ -136,7 +136,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -152,7 +152,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -168,7 +168,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -183,7 +183,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -199,7 +199,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -215,7 +215,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -307,7 +307,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -350,7 +350,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -366,7 +366,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -381,7 +381,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index 93f38d28b..d2fb1919b 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -261,7 +261,7 @@ class UCL_Device { /// Select the platform that has accelerators (for compatibility with OpenCL) inline int set_platform_accelerator(int pid=-1) { return UCL_SUCCESS; } - inline int load_module(const void* program, hipModule_t& module, std::string *log=NULL){ + inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){ auto it = _loaded_modules.emplace(program, hipModule_t()); if(!it.second){ module = it.first->second; @@ -281,7 +281,7 @@ class UCL_Device { hipError_t err=hipModuleLoadDataEx(&module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != hipSuccess) { diff --git a/lib/gpu/geryon/hip_kernel.h b/lib/gpu/geryon/hip_kernel.h index 654eb4477..c5014b52e 100644 --- a/lib/gpu/geryon/hip_kernel.h +++ b/lib/gpu/geryon/hip_kernel.h @@ -30,7 +30,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _device_ptr = &device; _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _device_ptr = &device; _cq=device.cq(); init(device); load_string(program,flags,log); @@ -46,7 +46,7 @@ class UCL_Program { inline void clear() { } /// Load a program from a file and compile with flags - inline int load(const char *filename, const char *flags="", std::string *log=NULL) { + inline int load(const char *filename, const char *flags="", std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -64,7 +64,7 @@ class UCL_Program { } /// Load a program from a string and compile with flags - inline int load_string(const void *program, const char *flags="", std::string *log=NULL) { + inline int load_string(const void *program, const char *flags="", std::string *log=nullptr) { return _device_ptr->load_module(program, _module, log); } @@ -263,7 +263,7 @@ class UCL_Kernel { }; const auto res = hipModuleLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq, NULL, config); + _block_size[2],0,_cq, nullptr, config); CU_SAFE_CALL(res); //#endif } diff --git a/lib/gpu/geryon/hip_memory.h b/lib/gpu/geryon/hip_memory.h index 13f60ad93..a983ba322 100644 --- a/lib/gpu/geryon/hip_memory.h +++ b/lib/gpu/geryon/hip_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/hip_texture.h b/lib/gpu/geryon/hip_texture.h index e7aa4e146..ae16bee90 100644 --- a/lib/gpu/geryon/hip_texture.h +++ b/lib/gpu/geryon/hip_texture.h @@ -99,7 +99,7 @@ class UCL_Texture { else CU_SAFE_CALL(hipTexRefSetFormat(_tex,HIP_AD_FORMAT_SIGNED_INT32,numel*2)); } - CU_SAFE_CALL(hipTexRefSetAddress(NULL, _tex, vec.cbegin(), vec.numel()*vec.element_size())); + CU_SAFE_CALL(hipTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); #else void* data_ptr = (void*)vec.cbegin(); CU_SAFE_CALL(hipMemcpyHtoD(hipDeviceptr_t(_device_ptr_to_global_var), &data_ptr, sizeof(void*))); diff --git a/lib/gpu/geryon/nvd_kernel.h b/lib/gpu/geryon/nvd_kernel.h index 9293db2fe..d74b0e2dc 100644 --- a/lib/gpu/geryon/nvd_kernel.h +++ b/lib/gpu/geryon/nvd_kernel.h @@ -41,7 +41,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _cq=device.cq(); init(device); load_string(program,flags,log); @@ -58,7 +58,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -77,7 +77,7 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { if (std::string(flags)=="BINARY") return load_binary((const char *)program); const unsigned int num_opts=2; @@ -95,7 +95,7 @@ class UCL_Program { CUresult err=cuModuleLoadDataEx(&_module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != CUDA_SUCCESS) { @@ -361,7 +361,7 @@ class UCL_Kernel { #if CUDA_VERSION >= 4000 CU_SAFE_CALL(cuLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq,_kernel_args,NULL)); + _block_size[2],0,_cq,_kernel_args,nullptr)); #else CU_SAFE_CALL(cuParamSetSize(_kernel,_param_size)); CU_SAFE_CALL(cuLaunchGridAsync(_kernel,_num_blocks[0],_num_blocks[1],_cq)); diff --git a/lib/gpu/geryon/nvd_memory.h b/lib/gpu/geryon/nvd_memory.h index 0484e33de..bcfc055ac 100644 --- a/lib/gpu/geryon/nvd_memory.h +++ b/lib/gpu/geryon/nvd_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/nvd_texture.h b/lib/gpu/geryon/nvd_texture.h index 965595a44..c766af826 100644 --- a/lib/gpu/geryon/nvd_texture.h +++ b/lib/gpu/geryon/nvd_texture.h @@ -80,7 +80,7 @@ class UCL_Texture { #ifdef UCL_DEBUG assert(numel!=0 && numel<5); #endif - CU_SAFE_CALL(cuTexRefSetAddress(NULL, _tex, vec.cbegin(), + CU_SAFE_CALL(cuTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); if (vec.element_size()==sizeof(float)) CU_SAFE_CALL(cuTexRefSetFormat(_tex, CU_AD_FORMAT_FLOAT, numel)); diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index 10e84a436..de4def0bc 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -360,7 +360,7 @@ int UCL_Device::set_platform(int pid) { // --- Get Number of Devices cl_uint n; - errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,NULL,&n); + errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,nullptr,&n); _num_devices=n; if (errorv!=CL_SUCCESS || _num_devices==0) { _num_devices=0; @@ -385,7 +385,7 @@ int UCL_Device::create_context() { props[0]=CL_CONTEXT_PLATFORM; props[1]=_platform; props[2]=0; - _context=clCreateContext(0,1,&_cl_device,NULL,NULL,&errorv); + _context=clCreateContext(0,1,&_cl_device,nullptr,nullptr,&errorv); if (errorv!=CL_SUCCESS) { #ifndef UCL_NO_EXIT std::cerr << "UCL Error: Could not access accelerator number " << _device @@ -404,36 +404,36 @@ void UCL_Device::add_properties(cl_device_id device_list) { char buffer[1024]; cl_bool ans_bool; - CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,NULL)); + CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,nullptr)); op.name=buffer; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_GLOBAL_MEM_SIZE, - sizeof(op.global_mem),&op.global_mem,NULL)); + sizeof(op.global_mem),&op.global_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_LOCAL_MEM_SIZE, - sizeof(op.shared_mem),&op.shared_mem,NULL)); + sizeof(op.shared_mem),&op.shared_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, - sizeof(op.const_mem),&op.const_mem,NULL)); + sizeof(op.const_mem),&op.const_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_TYPE, - sizeof(op.device_type),&op.device_type,NULL)); + sizeof(op.device_type),&op.device_type,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(op.compute_units),&op.compute_units, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CLOCK_FREQUENCY, - sizeof(op.clock),&op.clock,NULL)); + sizeof(op.clock),&op.clock,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(op.work_group_size),&op.work_group_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_ITEM_SIZES, 3*sizeof(op.work_item_size[0]),op.work_item_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MEM_BASE_ADDR_ALIGN, - sizeof(cl_uint),&op.alignment,NULL)); + sizeof(cl_uint),&op.alignment,nullptr)); op.alignment/=8; // Determine if double precision is supported cl_uint double_width; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, - sizeof(double_width),&double_width,NULL)); + sizeof(double_width),&double_width,nullptr)); if (double_width==0) op.double_precision=false; else @@ -441,13 +441,13 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PROFILING_TIMER_RESOLUTION, - sizeof(size_t),&op.timer_resolution,NULL)); + sizeof(size_t),&op.timer_resolution,nullptr)); op.ecc_support=false; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_ERROR_CORRECTION_SUPPORT, - sizeof(ans_bool),&ans_bool,NULL)); + sizeof(ans_bool),&ans_bool,nullptr)); if (ans_bool==CL_TRUE) op.ecc_support=true; @@ -459,7 +459,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { #ifdef CL_VERSION_1_2 size_t return_bytes; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_OPENCL_C_VERSION,1024, - buffer,NULL)); + buffer,nullptr)); op.c_version=buffer; cl_device_partition_property pinfo[4]; @@ -479,7 +479,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, - sizeof(cl_uint),&op.max_sub_devices,NULL)); + sizeof(cl_uint),&op.max_sub_devices,nullptr)); #endif _properties.push_back(op); @@ -489,15 +489,15 @@ std::string UCL_Device::platform_name() { char info[1024]; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VENDOR,1024,info, - NULL)); + nullptr)); std::string ans=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_NAME,1024,info, - NULL)); + nullptr)); ans+=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VERSION,1024,info, - NULL)); + nullptr)); ans+=std::string(info); return ans; diff --git a/lib/gpu/geryon/ocl_kernel.h b/lib/gpu/geryon/ocl_kernel.h index b65049b9e..77593f451 100644 --- a/lib/gpu/geryon/ocl_kernel.h +++ b/lib/gpu/geryon/ocl_kernel.h @@ -42,7 +42,7 @@ class UCL_Program { inline UCL_Program() : _init_done(false) {} inline UCL_Program(UCL_Device &device) : _init_done(false) { init(device); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) : + const char *flags="", std::string *log=nullptr) : _init_done(false) { init(device); load_string(program,flags,log); @@ -74,7 +74,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -93,29 +93,29 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { cl_int error_flag; const char *prog=(const char *)program; - _program=clCreateProgramWithSource(_context,1,&prog,NULL,&error_flag); + _program=clCreateProgramWithSource(_context,1,&prog,nullptr,&error_flag); CL_CHECK_ERR(error_flag); - error_flag = clBuildProgram(_program,1,&_device,flags,NULL,NULL); + error_flag = clBuildProgram(_program,1,&_device,flags,nullptr,nullptr); if (error_flag!=-11) CL_CHECK_ERR(error_flag); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); - if (build_status != CL_SUCCESS || log!=NULL) { + if (build_status != CL_SUCCESS || log!=nullptr) { size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); - if (log!=NULL) + if (log!=nullptr) *log=std::string(build_log); if (build_status != CL_SUCCESS) { @@ -363,7 +363,7 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) _kernel_info_name=function; cl_uint nargs; CL_SAFE_CALL(clGetKernelInfo(_kernel,CL_KERNEL_NUM_ARGS,sizeof(cl_uint), - &nargs,NULL)); + &nargs,nullptr)); _kernel_info_nargs=nargs; #ifdef NOT_TEST_CL_VERSION_1_2 char tname[256]; @@ -380,8 +380,8 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) } void UCL_Kernel::run() { - CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,NULL, - _num_blocks,_block_size,0,NULL,NULL)); + CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,nullptr, + _num_blocks,_block_size,0,nullptr,nullptr)); } } // namespace diff --git a/lib/gpu/geryon/ocl_memory.h b/lib/gpu/geryon/ocl_memory.h index 9692f4dd7..740020ab1 100644 --- a/lib/gpu/geryon/ocl_memory.h +++ b/lib/gpu/geryon/ocl_memory.h @@ -58,7 +58,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; cl_map_flags map_perm; @@ -103,12 +103,12 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, map_perm=CL_MAP_READ | CL_MAP_WRITE; } - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=cm.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); @@ -120,10 +120,10 @@ inline int _host_view(mat_type &mat, copy_type &cm, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags orig_flags; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_FLAGS,sizeof(orig_flags), - &orig_flags,NULL)); + &orig_flags,nullptr)); orig_flags=orig_flags & ~CL_MEM_ALLOC_HOST_PTR; mat.cbegin()=clCreateBuffer(context, CL_MEM_USE_HOST_PTR | orig_flags, n, @@ -159,13 +159,13 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, } cl_int error_flag; - mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(dev.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=dev.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); return UCL_SUCCESS; @@ -194,10 +194,10 @@ inline int _host_resize(mat_type &mat, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_FLAGS,sizeof(buffer_perm), - &buffer_perm,NULL)); + &buffer_perm,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); @@ -209,12 +209,12 @@ inline int _host_resize(mat_type &mat, const size_t n) { else map_perm=CL_MAP_READ | CL_MAP_WRITE; - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(mat.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); return UCL_SUCCESS; } @@ -229,7 +229,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags flag; if (kind==UCL_READ_WRITE) flag=CL_MEM_READ_WRITE; @@ -247,7 +247,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); @@ -276,7 +276,7 @@ inline int _device_alloc(mat_type &mat, UCL_Device &dev, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(dev.context(),flag,n,NULL, + mat.cbegin()=clCreateBuffer(dev.context(),flag,n,nullptr, &error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; @@ -321,7 +321,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -341,7 +341,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -359,7 +359,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -379,7 +379,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -395,21 +395,21 @@ inline void _host_zero(void *ptr, const size_t n) { inline void _ocl_build(cl_program &program, cl_device_id &device, const char* options = "") { - clBuildProgram(program,1,&device,options,NULL,NULL); + clBuildProgram(program,1,&device,options,nullptr,nullptr); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); if (build_status == CL_SUCCESS) return; size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(program, device,CL_PROGRAM_BUILD_LOG, 0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); std::cerr << std::endl << "----------------------------------------------------------\n" @@ -426,7 +426,7 @@ inline void _ocl_kernel_from_source(cl_context &context, cl_device_id &device, cl_int error_flag; cl_program program=clCreateProgramWithSource(context,lines,source, - NULL,&error_flag); + nullptr,&error_flag); CL_CHECK_ERR(error_flag); _ocl_build(program,device,options); kernel=clCreateKernel(program,function,&error_flag); @@ -444,15 +444,15 @@ inline void _device_zero(mat_type &mat, const size_t n, command_queue &cq) { #ifdef UCL_CL_ZERO cl_int zeroint=0; CL_SAFE_CALL(clEnqueueFillBuffer(cq,mat.begin(),&zeroint,sizeof(cl_int), - mat.byteoff(),n,0,NULL,NULL)); + mat.byteoff(),n,0,nullptr,nullptr)); #else cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_device_id device; CL_SAFE_CALL(clGetContextInfo(context,CL_CONTEXT_DEVICES, - sizeof(cl_device_id),&device,NULL)); + sizeof(cl_device_id),&device,nullptr)); const char * szero[3]={ "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -585,7 +585,7 @@ template <> struct _ucl_memcpy<1,0> { std::cerr << "UCL_COPY 1NS\n"; #endif CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset,n, - dst.begin(),0,NULL,NULL)); + dst.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -607,13 +607,13 @@ template <> struct _ucl_memcpy<1,0> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset, spitch*rows, - (char *)dst.begin()+dst_offset,0,NULL, - NULL)); + (char *)dst.begin()+dst_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy<0,1> { std::cerr << "UCL_COPY 3NS\n"; #endif CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset,n, - src.begin(),0,NULL,NULL)); + src.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -659,13 +659,13 @@ template <> struct _ucl_memcpy<0,1> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset, spitch*rows, - (char *)src.begin()+src_offset,0,NULL, - NULL)); + (char *)src.begin()+src_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy { const size_t dst_offset, const size_t src_offset) { if (src.cbegin()!=dst.cbegin() || src_offset!=dst_offset) { CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,n,0,NULL,NULL)); + dst_offset,n,0,nullptr,nullptr)); #ifdef UCL_DBG_MEM_TRACE std::cerr << "UCL_COPY 6NS\n"; #endif @@ -704,13 +704,13 @@ template struct _ucl_memcpy { if (spitch==dpitch && dst.cols()==src.cols() && src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,spitch*rows,0,NULL,NULL)); + dst_offset,spitch*rows,0,nullptr,nullptr)); else for (size_t i=0; i AnswerT::Answer() : _allocated(false),_eflag(false),_vflag(false), - _inum(0),_ilist(NULL),_newton(false) { + _inum(0),_ilist(nullptr),_newton(false) { } template @@ -119,7 +119,7 @@ void AnswerT::clear() { engv.clear(); time_answer.clear(); _inum=0; - _ilist=NULL; + _ilist=nullptr; _eflag=false; _vflag=false; } @@ -180,7 +180,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=0; i<_inum; i++) evdwl+=engv[i]; if (_ef_atom) { - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) eatom[i]+=engv[i]; } else { @@ -196,7 +196,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=vstart; i void AnswerT::get_answers(double **f, double **tor) { int fl=0; - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) { f[i][0]+=force[fl]; f[i][1]+=force[fl+1]; diff --git a/lib/gpu/lal_base_atomic.cpp b/lib/gpu/lal_base_atomic.cpp index eb0eab87b..42925aaee 100644 --- a/lib/gpu/lal_base_atomic.cpp +++ b/lib/gpu/lal_base_atomic.cpp @@ -25,8 +25,8 @@ BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -135,7 +135,7 @@ int * BaseAtomicT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -231,7 +231,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -244,7 +244,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_charge.cpp b/lib/gpu/lal_base_charge.cpp index 52e8ae2d8..d5a6e0622 100644 --- a/lib/gpu/lal_base_charge.cpp +++ b/lib/gpu/lal_base_charge.cpp @@ -25,8 +25,8 @@ BaseChargeT::BaseCharge() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -137,7 +137,7 @@ int * BaseChargeT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -240,7 +240,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -253,7 +253,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_dipole.cpp b/lib/gpu/lal_base_dipole.cpp index ed71029e6..57773a3b8 100644 --- a/lib/gpu/lal_base_dipole.cpp +++ b/lib/gpu/lal_base_dipole.cpp @@ -25,8 +25,8 @@ BaseDipoleT::BaseDipole() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -139,7 +139,7 @@ int * BaseDipoleT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); atom->cast_quat_data(host_mu[0]); hd_balancer.start_timer(); diff --git a/lib/gpu/lal_base_dpd.cpp b/lib/gpu/lal_base_dpd.cpp index c0d7ad47b..e4fd80fcc 100644 --- a/lib/gpu/lal_base_dpd.cpp +++ b/lib/gpu/lal_base_dpd.cpp @@ -25,8 +25,8 @@ BaseDPDT::BaseDPD() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -138,7 +138,7 @@ int * BaseDPDT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_v_data(host_v,tag); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_ellipsoid.cpp b/lib/gpu/lal_base_ellipsoid.cpp index abc8807a8..524705ed4 100644 --- a/lib/gpu/lal_base_ellipsoid.cpp +++ b/lib/gpu/lal_base_ellipsoid.cpp @@ -33,10 +33,10 @@ BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - nbor_program=NULL; - ellipsoid_program=NULL; - lj_program=NULL; - ucl_device=NULL; + nbor_program=nullptr; + ellipsoid_program=nullptr; + lj_program=nullptr; + ucl_device=nullptr; } template @@ -356,7 +356,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } int ago=hd_balancer.ago_first(f_ago); @@ -369,7 +369,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, reset_nbors(nall, inum, inum_full, ilist, numj, host_type, firstneigh, success); if (!success) - return NULL; + return nullptr; } int *list; if (_multiple_forms) @@ -406,7 +406,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -420,7 +420,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_quat_data(host_quat[0]); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_three.cpp b/lib/gpu/lal_base_three.cpp index 0b4dbdc89..cfc138aea 100644 --- a/lib/gpu/lal_base_three.cpp +++ b/lib/gpu/lal_base_three.cpp @@ -27,8 +27,8 @@ BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) { #ifdef THREE_CONCURRENT ans2=new Answer(); #endif - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -176,7 +176,7 @@ int * BaseThreeT::reset_nbors(const int nall, const int inum, const int nlist, resize_atom(inum,nall,success); resize_local(nall,mn,success); if (!success) - return NULL; + return nullptr; _nall = nall; @@ -310,7 +310,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -326,7 +326,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, _max_nbors = build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_three.h b/lib/gpu/lal_base_three.h index 38af78b78..36129e616 100644 --- a/lib/gpu/lal_base_three.h +++ b/lib/gpu/lal_base_three.h @@ -59,7 +59,7 @@ class BaseThree { const double gpu_split, FILE *screen, const void *pair_program, const char *k_two, const char *k_three_center, const char *k_three_end, - const char *k_short_nbor=NULL); + const char *k_short_nbor=nullptr); /// Estimate the overhead for GPU context changes and CPU driver void estimate_gpu_overhead(); diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index aaf74ed28..6c6a20630 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -72,7 +72,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, // "0:generic" will select platform 0 and tune for generic device // "1:fermi" will select platform 1 and tune for Nvidia Fermi gpu if (ocl_vendor) { - char *sep = NULL; + char *sep = nullptr; if ((sep = strstr(ocl_vendor,":"))) { *sep = '\0'; _platform_id = atoi(ocl_vendor); @@ -182,7 +182,7 @@ template int DeviceT::set_ocl_params(char *ocl_vendor) { #ifdef USE_OPENCL std::string s_vendor=OCL_DEFAULT_VENDOR; - if (ocl_vendor!=NULL) + if (ocl_vendor!=nullptr) s_vendor=ocl_vendor; if (s_vendor=="none") s_vendor="generic"; @@ -215,14 +215,14 @@ int DeviceT::set_ocl_params(char *ocl_vendor) { int token_count=0; std::string params[13]; char *pch = strtok(ocl_vendor,","); - pch = strtok(NULL,","); - if (pch == NULL) return -11; - while (pch != NULL) { + pch = strtok(nullptr,","); + if (pch == nullptr) return -11; + while (pch != nullptr) { if (token_count==13) return -11; params[token_count]=pch; token_count++; - pch = strtok(NULL,","); + pch = strtok(nullptr,","); } _ocl_vendor_string+=" -DMEM_THREADS="+params[0]+ " -DTHREADS_PER_ATOM="+params[1]+ @@ -430,9 +430,9 @@ template void DeviceT::estimate_gpu_overhead(const int kernel_calls, double &gpu_overhead, double &gpu_driver_overhead) { - UCL_H_Vec *host_data_in=NULL, *host_data_out=NULL; - UCL_D_Vec *dev_data_in=NULL, *dev_data_out=NULL, *kernel_data=NULL; - UCL_Timer *timers_in=NULL, *timers_out=NULL, *timers_kernel=NULL; + UCL_H_Vec *host_data_in=nullptr, *host_data_out=nullptr; + UCL_D_Vec *dev_data_in=nullptr, *dev_data_out=nullptr, *kernel_data=nullptr; + UCL_Timer *timers_in=nullptr, *timers_out=nullptr, *timers_kernel=nullptr; UCL_Timer over_timer(*gpu); if (_data_in_estimate>0) { diff --git a/lib/gpu/lal_eam.cpp b/lib/gpu/lal_eam.cpp index 8c81353f3..03479cd16 100644 --- a/lib/gpu/lal_eam.cpp +++ b/lib/gpu/lal_eam.cpp @@ -380,7 +380,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -394,7 +394,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; } else { this->atom->cast_x_data(host_x,host_type); this->atom->add_x_data(host_x,host_type); @@ -429,7 +429,7 @@ void EAMT::compute2(int *ilist, const bool eflag, const bool vflag, time_fp2.stop(); loop2(eflag,vflag); - if (ilist == NULL) + if (ilist == nullptr) this->ans->copy_answers(eflag,vflag,eatom,vatom); else this->ans->copy_answers(eflag,vflag,eatom,vatom, ilist); diff --git a/lib/gpu/lal_lj_tip4p_long.cpp b/lib/gpu/lal_lj_tip4p_long.cpp index bb848ad5c..1f3b32248 100644 --- a/lib/gpu/lal_lj_tip4p_long.cpp +++ b/lib/gpu/lal_lj_tip4p_long.cpp @@ -340,7 +340,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } this->hd_balancer.balance(cpu_time); @@ -353,7 +353,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->atom->cast_q_data(host_q); this->hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 3e128bcf5..6c4890ef4 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -158,7 +158,7 @@ void Neighbor::alloc(bool &success) { } _c_bytes+=nbor_host.device.row_bytes()+dev_numj_host.row_bytes(); } else { - // Some OpenCL implementations return errors for NULL pointers as args + // Some OpenCL implementations return errors for nullptr pointers as args nbor_host.device.view(dev_nbor); dev_numj_host.view(dev_nbor); } diff --git a/lib/gpu/lal_pppm.cpp b/lib/gpu/lal_pppm.cpp index 84d6c16e1..6b5bf88ea 100644 --- a/lib/gpu/lal_pppm.cpp +++ b/lib/gpu/lal_pppm.cpp @@ -35,7 +35,7 @@ PPPMT::PPPM() : _allocated(false), _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); - pppm_program=NULL; + pppm_program=nullptr; } template diff --git a/lib/gpu/lal_pppm_ext.cpp b/lib/gpu/lal_pppm_ext.cpp index a75536eb1..b82688139 100644 --- a/lib/gpu/lal_pppm_ext.cpp +++ b/lib/gpu/lal_pppm_ext.cpp @@ -56,7 +56,7 @@ grdtyp * pppm_gpu_init(memtyp &pppm, const int nlocal, const int nall, } success=0; - grdtyp * host_brick=NULL; + grdtyp * host_brick=nullptr; if (world_me==0) host_brick=pppm.init(nlocal,nall,screen,order,nxlo_out,nylo_out,nzlo_out, nxhi_out,nyhi_out,nzhi_out,rho_coeff,vd_brick, @@ -129,7 +129,7 @@ double pppm_gpu_bytes_f() { void pppm_gpu_forces_f(double **f) { double etmp; PPPMF.atom->data_unavail(); - PPPMF.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMF.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } double * pppm_gpu_init_d(const int nlocal, const int nall, FILE *screen, @@ -173,6 +173,6 @@ double pppm_gpu_bytes_d() { void pppm_gpu_forces_d(double **f) { double etmp; PPPMD.atom->data_unavail(); - PPPMD.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMD.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } diff --git a/lib/gpu/lal_yukawa_colloid.cpp b/lib/gpu/lal_yukawa_colloid.cpp index e71e962ff..46d4d6432 100644 --- a/lib/gpu/lal_yukawa_colloid.cpp +++ b/lib/gpu/lal_yukawa_colloid.cpp @@ -213,7 +213,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -227,7 +227,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->cast_rad_data(rad); this->hd_balancer.start_timer(); } else { diff --git a/lib/kokkos/cmake/compile_tests/pthread.cpp b/lib/kokkos/cmake/compile_tests/pthread.cpp index 92310da02..7fa98611b 100644 --- a/lib/kokkos/cmake/compile_tests/pthread.cpp +++ b/lib/kokkos/cmake/compile_tests/pthread.cpp @@ -4,11 +4,11 @@ void* kokkos_test(void* args) { return args; } int main(void) { pthread_t thread; - /* Use NULL to avoid C++11. Some compilers + /* Use nullptr to avoid C++11. Some compilers do not have C++11 by default. Forcing C++11 in the compile tests can be done, but is unnecessary */ - pthread_create(&thread, NULL, kokkos_test, NULL); - pthread_join(thread, NULL); + pthread_create(&thread, nullptr, kokkos_test, nullptr); + pthread_join(thread, nullptr); return 0; } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index a97fb2f7c..d4db2c538 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -640,7 +640,7 @@ void SharedAllocationRecord:: /*--------------------------------------------------------------------------*/ void* hip_resize_scratch_space(size_t bytes, bool force_shrink) { - static void* ptr = NULL; + static void* ptr = nullptr; static size_t current_size = 0; if (current_size == 0) { current_size = bytes; diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index fad36c02f..613793fc6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -139,7 +139,7 @@ void *HBWSpace::allocate(const char *arg_label, const size_t arg_alloc_size, } msg << " ]( " << arg_alloc_size << " ) FAILED"; if (ptr == nullptr) { - msg << " nullptr"; + msg << " NULL"; } else { msg << " NOT ALIGNED " << ptr; } diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index a9a277881..2b11adbf6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -215,7 +215,7 @@ SharedAllocationRecord::SharedAllocationRecord( } else { Kokkos::Impl::throw_runtime_exception( - "Kokkos::Impl::SharedAllocationRecord given nullptr allocation"); + "Kokkos::Impl::SharedAllocationRecord given NULL allocation"); } } diff --git a/lib/kokkos/core/unit_test/TestCTestDevice.cpp b/lib/kokkos/core/unit_test/TestCTestDevice.cpp index b2ee79b85..c54c75f94 100644 --- a/lib/kokkos/core/unit_test/TestCTestDevice.cpp +++ b/lib/kokkos/core/unit_test/TestCTestDevice.cpp @@ -13,7 +13,7 @@ int setenv(const char *name, const char *value, int overwrite) { int errcode = 0; if (!overwrite) { size_t envsize = 0; - errcode = getenv_s(&envsize, NULL, 0, name); + errcode = getenv_s(&envsize, nullptr, 0, name); if (errcode || envsize) return errcode; } return _putenv_s(name, value); diff --git a/lib/message/cslib/src/STUBS_ZMQ/zmq.h b/lib/message/cslib/src/STUBS_ZMQ/zmq.h index a335ee5e0..98cb937ed 100644 --- a/lib/message/cslib/src/STUBS_ZMQ/zmq.h +++ b/lib/message/cslib/src/STUBS_ZMQ/zmq.h @@ -24,10 +24,10 @@ namespace CSLIB_NS { #define ZMQ_REQ 0 #define ZMQ_REP 0 -static void *zmq_ctx_new() {return NULL;} -static void *zmq_connect(void *, char *) {return NULL;} +static void *zmq_ctx_new() {return nullptr;} +static void *zmq_connect(void *, char *) {return nullptr;} static int zmq_bind(void *, char *) {return 0;} -static void *zmq_socket(void *,int) {return NULL;} +static void *zmq_socket(void *,int) {return nullptr;} static void zmq_close(void *) {} static void zmq_ctx_destroy(void *) {} static void zmq_send(void *, void *, int, int) {} diff --git a/lib/message/cslib/src/cslib.cpp b/lib/message/cslib/src/cslib.cpp index 7c75a3992..20292329a 100644 --- a/lib/message/cslib/src/cslib.cpp +++ b/lib/message/cslib/src/cslib.cpp @@ -57,7 +57,7 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) else if (csflag == 1) server = 1; else error_all("constructor(): Invalid client/server arg"); - if (pcomm == NULL) { + if (pcomm == nullptr) { me = 0; nprocs = 1; @@ -82,19 +82,19 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) } maxfield = 0; - fieldID = fieldtype = fieldlen = fieldoffset = NULL; + fieldID = fieldtype = fieldlen = fieldoffset = nullptr; maxheader = 0; - header = NULL; + header = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; - recvcounts = displs = NULL; + recvcounts = displs = nullptr; maxglobal = 0; - allids = NULL; + allids = nullptr; maxfieldbytes = 0; - fielddata = NULL; + fielddata = nullptr; - pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing NULL + pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing nullptr nsend = nrecv = 0; } @@ -218,7 +218,7 @@ void CSlib::pack_parallel(int id, int ftype, // nlocal datums, each of nper length, from all procs // final data in buf = datums for all natoms, ordered by ids - if (recvcounts == NULL) { + if (recvcounts == nullptr) { recvcounts = (int *) smalloc(nprocs*sizeof(int)); displs = (int *) smalloc(nprocs*sizeof(int)); } @@ -706,9 +706,9 @@ void CSlib::deallocate_fields() void *CSlib::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"malloc(): Failed to allocate %d bytes",nbytes); error_one(str); @@ -722,11 +722,11 @@ void *CSlib::srealloc(void *ptr, int nbytes) { if (nbytes == 0) { sfree(ptr); - return NULL; + return nullptr; } ptr = realloc(ptr,nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"realloc(): Failed to reallocate %d bytes",nbytes); error_one(str); @@ -738,7 +738,7 @@ void *CSlib::srealloc(void *ptr, int nbytes) void CSlib::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/cslib_wrap.cpp b/lib/message/cslib/src/cslib_wrap.cpp index 64b4d53b2..cb132c238 100644 --- a/lib/message/cslib/src/cslib_wrap.cpp +++ b/lib/message/cslib/src/cslib_wrap.cpp @@ -44,7 +44,7 @@ void cslib_open_fortran(int csflag, const char *mode, const char *str, const void *pcomm, void **csptr) { MPI_Comm ccomm; - void *pccomm = NULL; + void *pccomm = nullptr; if (pcomm) { MPI_Fint *fcomm = (MPI_Fint *) pcomm; diff --git a/lib/message/cslib/src/msg.cpp b/lib/message/cslib/src/msg.cpp index ff654ecbc..dcd78fb73 100644 --- a/lib/message/cslib/src/msg.cpp +++ b/lib/message/cslib/src/msg.cpp @@ -80,9 +80,9 @@ void Msg::allocate(int nheader, int &maxheader, int *&header, void *Msg::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = (void *) malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"Failed to allocate %d bytes",nbytes); } @@ -93,7 +93,7 @@ void *Msg::smalloc(int nbytes) void Msg::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/msg_mpi_two.cpp b/lib/message/cslib/src/msg_mpi_two.cpp index 2a4fa65ff..d365e2084 100644 --- a/lib/message/cslib/src/msg_mpi_two.cpp +++ b/lib/message/cslib/src/msg_mpi_two.cpp @@ -52,7 +52,7 @@ void MsgMPITwo::init(char *filename) { if (client) { if (me == 0) { - FILE *fp = NULL; + FILE *fp = nullptr; while (!fp) { fp = fopen(filename,"r"); if (!fp) sleep(1); diff --git a/lib/message/cslib/src/msg_zmq.cpp b/lib/message/cslib/src/msg_zmq.cpp index 8bee3aebd..07920c6b5 100644 --- a/lib/message/cslib/src/msg_zmq.cpp +++ b/lib/message/cslib/src/msg_zmq.cpp @@ -99,12 +99,12 @@ void MsgZMQ::send(int nheader, int *header, int nbuf, char *buf) if (me == 0) { zmq_send(socket,lengths,2*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) { zmq_send(socket,header,nheader*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) zmq_send(socket,buf,nbuf,0); @@ -125,7 +125,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) { if (me == 0) { zmq_recv(socket,lengths,2*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); @@ -135,7 +135,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) if (me == 0) { zmq_recv(socket,header,nheader*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); diff --git a/lib/molfile/molfile_plugin.h b/lib/molfile/molfile_plugin.h index 057c40336..2b7c57b84 100644 --- a/lib/molfile/molfile_plugin.h +++ b/lib/molfile/molfile_plugin.h @@ -193,7 +193,7 @@ typedef struct molfile_timestep_metadata { typedef struct { float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */ float *velocities; /**< space for velocities of all atoms; same layout */ - /**< NULL unless has_velocities is set */ + /**< nullptr unless has_velocities is set */ /*@{*/ /** @@ -517,7 +517,7 @@ typedef struct { * form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */ float *orbital_energies; /**< list of orbital energies for wavefunction */ float *occupancies; /**< orbital occupancies */ - int *orbital_ids; /**< orbital ID numbers; If NULL then VMD will + int *orbital_ids; /**< orbital ID numbers; If nullptr then VMD will * assume 1,2,3,...num_orbs. */ } molfile_qm_wavefunction_t; @@ -588,7 +588,7 @@ color r, g, b /** - * Main file reader API. Any function in this struct may be NULL + * Main file reader API. Any function in this struct may be nullptr * if not implemented by the plugin; the application checks this to determine * what functionality is present in the plugin. */ @@ -599,7 +599,7 @@ typedef struct { vmdplugin_HEAD /** - * Filename extension for this file type. May be NULL if no filename + * Filename extension for this file type. May be nullptr if no filename * extension exists and/or is known. For file types that match several * common extensions, list them in a comma separated list such as: * "pdb,ent,foo,bar,baz,ban" @@ -611,7 +611,7 @@ typedef struct { const char *filename_extension; /** - * Try to open the file for reading. Return an opaque handle, or NULL on + * Try to open the file for reading. Return an opaque handle, or nullptr on * failure. Set the number of atoms; if the number of atoms cannot be * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. * Filetype should be the name under which this plugin was registered; @@ -638,20 +638,20 @@ typedef struct { * the caller. * If the plugin provides bond information, but the file loaded doesn't * actually contain any bond info, the nbonds parameter should be - * set to 0 and from/to should be set to NULL to indicate that no bond + * set to 0 and from/to should be set to nullptr to indicate that no bond * information was actually present, and automatic bond search should be * performed. * * If the plugin provides bond order information, the bondorder array * will contain the bond order for each from/to pair. If not, the bondorder - * pointer should be set to NULL, in which case the caller will provide a + * pointer should be set to nullptr, in which case the caller will provide a * default bond order value of 1.0. * * If the plugin provides bond type information, the bondtype array * will contain the bond type index for each from/to pair. These numbers * are consecutive integers starting from 0. * the bondtypenames list, contains the corresponding names, if available, - * as a NULL string terminated list. nbondtypes is provided for convenience + * as a nullptr string terminated list. nbondtypes is provided for convenience * and consistency checking. * * These arrays must be freed by the plugin in the close_file_read function. @@ -666,7 +666,7 @@ typedef struct { * new QM-capable version named read_timestep(), when finished. * * Read the next timestep from the file. Return MOLFILE_SUCCESS, or - * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then + * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is nullptr, then * the frame should be skipped. Otherwise, the application must prepare * molfile_timestep_t by allocating space in coords for the corresponding * number of coordinates. @@ -684,7 +684,7 @@ typedef struct { /** * Open a coordinate file for writing using the given header information. - * Return an opaque handle, or NULL on failure. The application must + * Return an opaque handle, or nullptr on failure. The application must * specify the number of atoms to be written. * filetype should be the name under which this plugin was registered. */ @@ -757,7 +757,7 @@ typedef struct { * from/to and to/from versions of each. * This function must be called before write_structure(). * - * Like the read_bonds() routine, the bondorder pointer is set to NULL + * Like the read_bonds() routine, the bondorder pointer is set to nullptr * if the caller doesn't have such information, in which case the * plugin should assume a bond order of 1.0 if the file format requires * bond order information. @@ -767,7 +767,7 @@ typedef struct { * index (consecutive integers starting from 0) and bondtypenames * contain the corresponding strings, in case the naming/numbering * scheme is different from the index numbers. - * if the pointers are set to NULL, then this information is not available. + * if the pointers are set to nullptr, then this information is not available. * bondtypenames can only be used of bondtypes is also given. * Return MOLFILE_SUCCESS if no errors occur. */ @@ -842,13 +842,13 @@ typedef struct { /** * Read the next timestep from the file. Return MOLFILE_SUCCESS, or * MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t - * arguments are NULL, then the coordinate or qm data should be skipped. + * arguments are nullptr, then the coordinate or qm data should be skipped. * Otherwise, the application must prepare molfile_timestep_t and * molfile_qm_timestep_t by allocating space for the corresponding * number of coordinates, orbital wavefunction coefficients, etc. * Since it is common for users to want to load only the final timestep * data from a QM run, the application may provide any combination of - * valid, or NULL pointers for the molfile_timestep_t and + * valid, or nullptr pointers for the molfile_timestep_t and * molfile_qm_timestep_t parameters, depending on what information the * user is interested in. * The natoms and qm metadata parameters exist because some file formats @@ -886,9 +886,9 @@ typedef struct { * caller the ability to prioritize, buffer, and redirect console messages * to an appropriate output channel, window, etc. This enables the use of * graphical consoles like TkCon without losing console output from plugins. - * If the function pointer is NULL, no console output service is provided + * If the function pointer is nullptr, no console output service is provided * by the calling application, and the output should default to stdout - * stream. If the function pointer is non-NULL, all output will be + * stream. If the function pointer is non-nullptr, all output will be * subsequently dealt with by the calling application. * * XXX this should really be put into a separate block of diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index 4fc8785dd..c1c45a86a 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != NULL) + if(currentNode != nullptr) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != NULL); //repeat this until all chains have been added + while(currentNode != nullptr); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null + if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null { - return NULL; + return nullptr; } int * tmp; - POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = NULL; //temporary variable to hold data - while(tempNode != NULL) //when we have followed all links, stop + POEMSChain * tempChain = nullptr; //temporary variable to hold data + while(tempNode != nullptr) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == NULL) + if(aNode == nullptr) { - return NULL; + return nullptr; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == NULL) //and if we find nothing... + if(returnVal == nullptr) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == NULL) //if we could not find any chains + if(returnVal == nullptr) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be NULL if no new chains are + return returnVal; //return what we find (will be nullptr if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists + while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != NULL || tmp2->value != NULL) //go through the list + while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 446fa2013..04f0f4b79 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); +TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value NULL +// The pointers have default value nullptr TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == NULL) + if (p == nullptr) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=NULL) + if(t !=nullptr) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == NULL && t->Right() == NULL) + if (t->Left() == nullptr && t->Right() == nullptr) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == NULL) + if (t == nullptr) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=NULL - if (t != NULL) + //print tree with root t, as long as t!=nullptr + if (t != nullptr) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index ee07a3325..14f5fd400 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = NULL); + void Insert(const int& item, const int& data, void * AuxData = nullptr); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = NULL; + DeleteAuxData = nullptr; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return NULL +// address and a pointer to its parent; otherwise, return nullptr TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is NULL - parent = NULL; + // the parent of the root is nullptr + parent = nullptr; // terminate on empty subtree - while(t != NULL) + while(t != nullptr) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; NULL if not found + // return pointer to node; nullptr if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != NULL) + if (current != nullptr) { item = current->data; return current->GetAuxData(); } else // item not found in the tree. return False - return NULL; + return nullptr; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,NULL,NULL); + newNode = GetTreeNode(item,nullptr,nullptr); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == NULL) + if (tree == nullptr) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) + if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) return; - // If D has NULL pointer, the + // If D has nullptr pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == NULL) + if (DNodePtr->right == nullptr) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == NULL) + else if (DNodePtr->left == nullptr) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-NULL + // Both pointers of DNodePtr are non-nullptr else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != NULL) + while (RNodePtr->right != nullptr) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == NULL) + if (PNodePtr == nullptr) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=NULL && current->data == item) + if (current !=nullptr && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == NULL) - return NULL; + if (t == nullptr) + return nullptr; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns NULL. + // present it makes a copy of left child or returns nullptr. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=NULL) + if (t->Left() !=nullptr) newlptr = CopyTree(t->Left()); else - newlptr = NULL; + newlptr = nullptr; - if (t->Right() !=NULL) + if (t->Right() !=nullptr) newrptr = CopyTree(t->Right()); else - newrptr = NULL; + newrptr = nullptr; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != NULL) { + if (t != nullptr) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != NULL) { - if (DeleteAuxData != NULL) { + if (aux != nullptr) { + if (DeleteAuxData != nullptr) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to NULL +// set the root pointer back to nullptr void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = NULL; // root now NULL + t = nullptr; // root now nullptr } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 051e13d6e..52905fc40 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value NULL assigns a empty subtree +// The pointer value nullptr assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/poemstreenode.h b/lib/poems/poemstreenode.h index a1835ba02..e5673344a 100644 --- a/lib/poems/poemstreenode.h +++ b/lib/poems/poemstreenode.h @@ -18,7 +18,7 @@ #ifndef TREENODE_H #define TREENODE_H -//#define NULL 0 +//#define nullptr 0 //Tree depends on TreeNode diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 67f5b607e..7b1e718b9 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return NULL; + default: return nullptr; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 369213f7d..23554f411 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = NULL; + mappings = nullptr; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 2b3257b0d..21819d4c0 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = NULL; + system = nullptr; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != NULL) { + while(NodeValue != nullptr) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return NULL; + return nullptr; } } diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 889563f61..2242fba02 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -38,7 +38,7 @@ enum{ROTATE,ALL}; ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL), tbias(NULL), avec(NULL) + id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/asphere command"); @@ -49,7 +49,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 89350dd00..3878f7e4d 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -461,20 +461,20 @@ void PairGayBerne::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -506,12 +506,12 @@ void PairGayBerne::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&gamma,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&gamma,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&gamma,1,MPI_DOUBLE,0,world); MPI_Bcast(&upsilon,1,MPI_DOUBLE,0,world); diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index 6397e77f5..ba565c592 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -31,8 +31,8 @@ using namespace LAMMPS_NS; PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 81fb4d4b6..c234ce27b 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -439,20 +439,20 @@ void PairRESquared::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -480,8 +480,8 @@ void PairRESquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index cf89cf9d3..79253140c 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -32,8 +32,8 @@ using namespace LAMMPS_NS; PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index e63d50f81..2619f0cf1 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -30,7 +30,7 @@ enum{SPHERE,LINE,TRI}; // also in DumpImage /* ---------------------------------------------------------------------- */ BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) : - Body(lmp, narg, arg), imflag(NULL), imdata(NULL) + Body(lmp, narg, arg), imflag(nullptr), imdata(nullptr) { if (narg != 3) error->all(FLERR,"Invalid body nparticle command"); @@ -194,7 +194,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyNparticle::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index c43484dca..f2e798c93 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -321,7 +321,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index 18fd65c1d..b647c7e54 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -122,7 +122,7 @@ int BodyRoundedPolyhedron::nfaces(AtomVecBody::Bonus *bonus) double *BodyRoundedPolyhedron::faces(AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; - if (nvertices == 1 || nvertices == 2) return NULL; + if (nvertices == 1 || nvertices == 2) return nullptr; return bonus->dvalue+3*nsub(bonus)+2*nedges(bonus); } @@ -373,7 +373,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index cf570d71a..940250d16 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -31,7 +31,7 @@ enum{ID,TYPE,INDEX}; /* ---------------------------------------------------------------------- */ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), which(NULL), index(NULL), avec(NULL), bptr(NULL) + Compute(lmp, narg, arg), which(nullptr), index(nullptr), avec(nullptr), bptr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute body/local command"); @@ -66,8 +66,8 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index 18c301678..6903f7a25 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -36,7 +36,7 @@ enum{ROTATE,ALL}; /* ---------------------------------------------------------------------- */ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_bias(NULL), tbias(NULL), avec(NULL) + Compute(lmp, narg, arg), id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/body command"); @@ -47,7 +47,7 @@ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index ccfd37bbb..99ae8ed09 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -133,15 +133,15 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 161f8d6d6..2507b94d2 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -132,19 +132,19 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index ece23d952..92ae392cd 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; PairBodyNparticle::PairBodyNparticle(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index fa5a8e57d..b7fa88b74 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -53,16 +53,16 @@ enum {INVALID=0,NONE=1,VERTEXI=2,VERTEXJ=3,EDGE=4}; PairBodyRoundedPolygon::PairBodyRoundedPolygon(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -458,7 +458,7 @@ void PairBodyRoundedPolygon::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index d376ac759..1d7461199 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -58,20 +58,20 @@ enum {EF_INVALID=0,EF_NONE,EF_PARALLEL,EF_SAME_SIDE_OF_FACE, PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -81,8 +81,8 @@ PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) mu = 0.0; A_ua = 1.0; - k_n = NULL; - k_na = NULL; + k_n = nullptr; + k_na = nullptr; } /* ---------------------------------------------------------------------- */ @@ -440,7 +440,7 @@ void PairBodyRoundedPolyhedron::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = facnum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; @@ -884,7 +884,7 @@ void PairBodyRoundedPolyhedron::sphere_against_face(int ibody, int jbody, project_pt_plane(x[jbody], xi1, xi2, xi3, h, d, inside); - inside_polygon(ibody, ni, x[ibody], h, NULL, inside, tmp); + inside_polygon(ibody, ni, x[ibody], h, nullptr, inside, tmp); if (inside == 0) continue; delx = h[0] - x[jbody][0]; @@ -1880,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be NULL) for face-edge intersection + q2 = another point (can be nullptr) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise @@ -1929,7 +1929,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, anglesum1 += acos(costheta); } - if (q2 != NULL) { + if (q2 != nullptr) { MathExtra::sub3(xi1,q2,u); MathExtra::sub3(xi2,q2,v); magu = MathExtra::len3(u); @@ -1945,7 +1945,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, if (fabs(anglesum1 - MY_2PI) < EPSILON) inside1 = 1; else inside1 = 0; - if (q2 != NULL) { + if (q2 != nullptr) { if (fabs(anglesum2 - MY_2PI) < EPSILON) inside2 = 1; else inside2 = 0; } diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index eea43480e..28d081c5c 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -373,19 +373,19 @@ void AngleClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index a97b06a3c..8a8471722 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -184,10 +184,10 @@ void BondClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -228,5 +228,5 @@ void *BondClass2::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index 5be522f2c..5a0300359 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -834,45 +834,45 @@ void DihedralClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 0b07a7d60..801c21c3b 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -598,15 +598,15 @@ void ImproperClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - - utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + + utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index bb1dfe0ab..fdfaf158e 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -509,7 +509,7 @@ void PairLJClass2::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -612,13 +612,13 @@ void PairLJClass2::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -647,10 +647,10 @@ void PairLJClass2::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -707,5 +707,5 @@ void *PairLJClass2::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 8375043ed..df0019c25 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -364,14 +364,14 @@ void PairLJClass2CoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairLJClass2CoulCut::write_restart_settings(FILE *fp) void PairLJClass2CoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -478,6 +478,6 @@ void *PairLJClass2CoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 3b9ef8dea..68a5bd217 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -47,8 +47,8 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - cut_respa = NULL; + ftable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -691,11 +691,11 @@ void PairLJClass2CoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -807,13 +807,13 @@ void PairLJClass2CoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -844,13 +844,13 @@ void PairLJClass2CoulLong::write_restart_settings(FILE *fp) void PairLJClass2CoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -956,5 +956,5 @@ void *PairLJClass2CoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index 786be66c7..9ec25eecc 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -51,7 +51,7 @@ enum{EDGE,CONSTANT,VARIABLE}; PairBrownian::PairBrownian(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -497,7 +497,7 @@ void PairBrownian::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); @@ -603,12 +603,12 @@ void PairBrownian::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -643,17 +643,17 @@ void PairBrownian::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_target, sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed, sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_target, sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed, sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index 9c2593ffb..c71c0aa3e 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -358,7 +358,7 @@ void PairBrownianPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index f95645c61..3ac4d8f2b 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -395,15 +395,15 @@ void PairColloid::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (comm->me == 0) { - utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a12[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -433,9 +433,9 @@ void PairColloid::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 867bb9197..4e0bf3344 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -566,7 +566,7 @@ void PairLubricate::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate"); @@ -683,12 +683,12 @@ void PairLubricate::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -721,15 +721,15 @@ void PairLubricate::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index 2df1ecaaa..b3420154f 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -58,10 +58,10 @@ PairLubricateU::PairLubricateU(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nmax = 0; - fl = Tl = xl = NULL; + fl = Tl = xl = nullptr; cgmax = 0; - bcg = xcg = rcg = rcg1 = pcg = RU = NULL; + bcg = xcg = rcg = rcg1 = pcg = RU = nullptr; // set comm size needed by this Pair @@ -1794,7 +1794,7 @@ void PairLubricateU::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -1909,12 +1909,12 @@ void PairLubricateU::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -1946,14 +1946,14 @@ void PairLubricateU::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 8483bb0f5..501977187 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1158,7 +1158,7 @@ void PairLubricateUPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL){ + else if (strstr(modify->fix[i]->style,"wall") != nullptr){ if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index 351757e09..244b37457 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -468,7 +468,7 @@ void PairLubricatePoly::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -478,7 +478,7 @@ void PairLubricatePoly::init_style() if (wallfix->xflag) flagwall = 2; // Moving walls exist } - if (strstr(modify->fix[i]->style,"wall") != NULL){ + if (strstr(modify->fix[i]->style,"wall") != nullptr){ flagwall = 1; // Walls exist if (((FixWall *) modify->fix[i])->xflag ) { flagwall = 2; // Moving walls exist diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 484175762..9cc1439e6 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -38,8 +38,8 @@ DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtomGZ::~DumpAtomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -102,8 +102,8 @@ void DumpAtomGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -155,7 +155,7 @@ void DumpAtomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index 18f0fa56d..b6a94e587 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -41,8 +41,8 @@ DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFGGZ::~DumpCFGGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -106,8 +106,8 @@ void DumpCFGGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -163,7 +163,7 @@ void DumpCFGGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index fb2b121f7..af37ff0a1 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -39,8 +39,8 @@ DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustomGZ::~DumpCustomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -104,8 +104,8 @@ void DumpCustomGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -155,7 +155,7 @@ void DumpCustomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index 49a3c3bef..fc7b53472 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -39,8 +39,8 @@ DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocalGZ::~DumpLocalGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -104,8 +104,8 @@ void DumpLocalGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -170,7 +170,7 @@ void DumpLocalGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index cc07b1ce6..24b4a7a07 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -38,8 +38,8 @@ DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZGZ::~DumpXYZGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -103,8 +103,8 @@ void DumpXYZGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -134,7 +134,7 @@ void DumpXYZGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index 1b7eb1e43..06754003f 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), vint(NULL), id_fix(NULL), fix(NULL) + Compute(lmp, narg, arg), vint(nullptr), id_fix(nullptr), fix(nullptr) { if (narg != 5) error->all(FLERR,"Illegal compute temp/cs command"); @@ -94,7 +94,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : vector = new double[size_vector]; maxatom = 0; - vint = NULL; + vint = nullptr; // set comm size needed by this Compute diff --git a/src/CORESHELL/pair_born_coul_long_cs.cpp b/src/CORESHELL/pair_born_coul_long_cs.cpp index d50138145..58f58db1b 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.cpp +++ b/src/CORESHELL/pair_born_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairBornCoulLongCS::PairBornCoulLongCS(LAMMPS *lmp) : PairBornCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; writedata = 1; } diff --git a/src/CORESHELL/pair_buck_coul_long_cs.cpp b/src/CORESHELL/pair_buck_coul_long_cs.cpp index dd43f7f4b..f8a00a348 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.cpp +++ b/src/CORESHELL/pair_buck_coul_long_cs.cpp @@ -43,7 +43,7 @@ PairBuckCoulLongCS::PairBuckCoulLongCS(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 1; writedata = 1; single_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_coul_long_cs.cpp b/src/CORESHELL/pair_coul_long_cs.cpp index ee03780a0..6a2117149 100644 --- a/src/CORESHELL/pair_coul_long_cs.cpp +++ b/src/CORESHELL/pair_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairCoulLongCS::PairCoulLongCS(LAMMPS *lmp) : PairCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp index 75e3f5ed1..81336e681 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp @@ -40,7 +40,7 @@ PairLJClass2CoulLongCS::PairLJClass2CoulLongCS(LAMMPS *lmp) : PairLJClass2CoulLo respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp index 9d60dfdbf..89523032a 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp @@ -44,7 +44,7 @@ PairLJCutCoulLongCS::PairLJCutCoulLongCS(LAMMPS *lmp) : PairLJCutCoulLong(lmp) respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index 25fed599d..d7f320180 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -438,14 +438,14 @@ void PairLJCutDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -474,10 +474,10 @@ void PairLJCutDipoleCut::write_restart_settings(FILE *fp) void PairLJCutDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index 67d2e0aa3..e6fe0e8dc 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -446,7 +446,7 @@ void PairLJCutDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -490,13 +490,13 @@ void PairLJCutDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,10 +524,10 @@ void PairLJCutDipoleLong::write_restart_settings(FILE *fp) void PairLJCutDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -552,5 +552,5 @@ void *PairLJCutDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index 86e143626..33ee57b83 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -58,7 +58,7 @@ PairLJLongDipoleLong::PairLJLongDipoleLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongDipoleLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/dipole/long command"); @@ -168,10 +168,10 @@ void *PairLJLongDipoleLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_vdwl", NULL}; + "cut_coul", "cut_vdwl", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, &cut_coul, - &cut_lj_global, NULL}; + &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -220,8 +220,8 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg) void PairLJLongDipoleLong::init_style() { - const char *style3[] = {"ewald/disp", NULL}; - const char *style6[] = {"ewald/disp", NULL}; + const char *style3[] = {"ewald/disp", nullptr}; + const char *style6[] = {"ewald/disp", nullptr}; int i; if (strcmp(update->unit_style,"electron") == 0) @@ -242,14 +242,14 @@ void PairLJLongDipoleLong::init_style() // ensure use of KSpace long-range solver, set g_ewald if (ewald_order&(1<<3)) { // r^-1 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style3[i]&&strcmp(force->kspace_style, style3[i]); ++i); if (!style3[i]) error->all(FLERR,"Pair style requires use of kspace_style ewald/disp"); } if (ewald_order&(1<<6)) { // r^-6 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i); if (!style6[i]) @@ -343,13 +343,13 @@ void PairLJLongDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -378,11 +378,11 @@ void PairLJLongDipoleLong::write_restart_settings(FILE *fp) void PairLJLongDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 15bc42c37..c33b49615 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -118,7 +118,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : int newtonflag = 0; int threads_per_atom = -1; double binsize = 0.0; - char *opencl_flags = NULL; + char *opencl_flags = nullptr; int block_pair = -1; int iarg = 4; @@ -232,7 +232,7 @@ void FixGPU::init() // make sure fdotr virial is not accumulated multiple times - if (force->pair_match("^hybrid",0) != NULL) { + if (force->pair_match("^hybrid",0) != nullptr) { PairHybrid *hybrid = (PairHybrid *) force->pair; for (int i = 0; i < hybrid->nstyles; i++) if (!utils::strmatch(hybrid->keywords[i],"/gpu$")) diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index c27c670f2..dbcb3bcf3 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -189,7 +189,7 @@ void PairBornCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index a2524909e..3a6808d43 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -184,7 +184,7 @@ void PairBornCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 41823fc27..aa25fb4cb 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -180,7 +180,7 @@ void PairBuckCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index 39737ab18..0ced57d28 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -158,7 +158,7 @@ void PairColloidGPU::init_style() } double cell_size = sqrt(maxcut) + neighbor->skin; - int **_form = NULL; + int **_form = nullptr; int n=atom->ntypes; memory->create(_form,n+1,n+1,"colloid/gpu:_form"); for (int i = 1; i <= n; i++) { diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index da59873dd..3eb678fc7 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -154,7 +154,7 @@ void PairCoulLongCSGPU::compute(int eflag, int vflag) void PairCoulLongCSGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/cs/gpu requires atom attribute q"); @@ -175,7 +175,7 @@ void PairCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index 185d3a7f9..7eb502955 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -149,7 +149,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag) void PairCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q"); @@ -170,7 +170,7 @@ void PairCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 493953777..9dd5c85c4 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -143,7 +143,7 @@ void PairEAMAlloyGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_alloy_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_alloy_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_alloy_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 14d9a95c3..3cd78ea51 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index eb028bc77..10f6b4ebe 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -143,7 +143,7 @@ void PairEAMFSGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_fs_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_fs_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_fs_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index 70edf2164..53825f2e8 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 3965f27c6..d8058f11a 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -145,7 +145,7 @@ void PairEAMGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index e4742a3be..09566f7de 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -33,7 +33,7 @@ class PairEAMGPU : public PairEAM { void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index 451799027..58414f4e3 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -74,7 +74,7 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp), { quat_nmax = 0; reinitflag = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index 215998bc8..e4d20e23a 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -135,7 +135,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag) void PairLJ96CutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index 09ed17820..921018853 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag) void PairLJCharmmCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCharmmCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index f6d671d95..264ada0fd 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -177,7 +177,7 @@ void PairLJClass2CoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 2a9d431a4..135a2a7dd 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag) void PairLJCutCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCutCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index f5987c0dd..f8f4af5de 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -143,7 +143,7 @@ void PairLJCutCoulMSMGPU::compute(int eflag, int vflag) void PairLJCutCoulMSMGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/coul/msm/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index 7de9ae2aa..896a0b9d4 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -185,13 +185,13 @@ void PairLJCutDipoleLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 5656c2e18..3fc727a4f 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -139,7 +139,7 @@ void PairLJCutGPU::compute(int eflag, int vflag) void PairLJCutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 2bd7420e7..8e08075bc 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -168,15 +168,15 @@ void PairLJCutTIP4PLongGPU::compute(int eflag, int vflag) void PairLJCutTIP4PLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (atom->tag_enable == 0) error->all(FLERR,"Pair style lj/cut/tip4p/long/gpu requires atom IDs"); if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/gpu requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); if (atom->map_style == 2) @@ -202,7 +202,7 @@ void PairLJCutTIP4PLongGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index f13eea51e..86ff980c7 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJExpandCoulLongGPU::compute(int eflag, int vflag) void PairLJExpandCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJExpandCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index 4054f0852..d04a490ca 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -186,13 +186,13 @@ void PairLJSDKCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style is incompatible with KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index 60e6e935e..70e875291 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -136,7 +136,7 @@ void PairMIECutGPU::compute(int eflag, int vflag) void PairMIECutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with mie/cut/gpu pair style"); diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index ca70e3c33..4ce9730e0 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -76,7 +76,7 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), if (!avec) error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid"); quat_nmax = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index d544534c9..54312e411 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -76,7 +76,7 @@ PairSWGPU::PairSWGPU(LAMMPS *lmp) : PairSW(lmp), gpu_mode(GPU_FORCE) suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -162,9 +162,9 @@ void PairSWGPU::init_style() double *epsilon, *sigma, *lambda, *gamma; double *biga, *bigb, *powerp, *powerq; double *_cut, *_cutsq, *costheta; - epsilon = sigma = lambda = gamma = NULL; - biga = bigb = powerp = powerq = NULL; - _cut = _cutsq = costheta = NULL; + epsilon = sigma = lambda = gamma = nullptr; + biga = bigb = powerp = powerq = nullptr; + _cut = _cutsq = costheta = nullptr; memory->create(epsilon,nparams,"pair:epsilon"); memory->create(sigma,nparams,"pair:sigma"); diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index 4ac674aa9..20d21615a 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -165,8 +165,8 @@ void PairTableGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // pack tables and send them to device - double ***table_coeffs = NULL; - double **table_data = NULL; + double ***table_coeffs = nullptr; + double **table_data = nullptr; memory->create(table_coeffs, ntypes+1, ntypes+1, 6, "table:coeffs"); Table *tb; diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index 885dd73d9..b76bf99d5 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -80,7 +80,7 @@ PairTersoffGPU::PairTersoffGPU(LAMMPS *lmp) : PairTersoff(lmp), gpu_mode(GPU_FOR suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -168,11 +168,11 @@ void PairTersoffGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 35edd9ea2..57e13bb29 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -73,7 +73,7 @@ PairTersoffMODGPU::PairTersoffMODGPU(LAMMPS *lmp) : PairTersoffMOD(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -160,11 +160,11 @@ void PairTersoffMODGPU::init_style() double *biga, *bigb, *bigr, *bigd; double *c1, *c2, *c3, *c4, *c5, *h; double *beta, *powern, *ca1, *powern_del, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - powern_del = ca1 = NULL; - c1 = c2 = c3 = c4 = c5 = h = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + powern_del = ca1 = nullptr; + c1 = c2 = c3 = c4 = c5 = h = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index 73251ee72..5facd8625 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -81,7 +81,7 @@ PairTersoffZBLGPU::PairTersoffZBLGPU(LAMMPS *lmp) : PairTersoffZBL(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairTersoffZBLGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *Z_i, *Z_j, *ZBLcut, *ZBLexpscale, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index fe6adfef1..f462e579c 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -141,7 +141,7 @@ void PairUFMGPU::compute(int eflag, int vflag) void PairUFMGPU::init_style() { -// cut_respa = NULL; +// cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with ufm/gpu pair style"); diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index 868b8de0c..99a763bfb 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -77,7 +77,7 @@ PairVashishtaGPU::PairVashishtaGPU(LAMMPS *lmp) : PairVashishta(lmp), gpu_mode(G suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairVashishtaGPU::init_style() double *bigw, *c0, *costheta, *bigb; double *big2b, *bigc; - cutsq = r0 = gamma = eta = NULL; - lam1inv = lam4inv = zizj = mbigd = NULL; - dvrc = big6w = heta = bigh = NULL; - bigw = c0 = costheta = bigb = NULL; - big2b = bigc = NULL; + cutsq = r0 = gamma = eta = nullptr; + lam1inv = lam4inv = zizj = mbigd = nullptr; + dvrc = big6w = heta = bigh = nullptr; + bigw = c0 = costheta = bigb = nullptr; + big2b = bigc = nullptr; memory->create(cutsq,nparams,"pair:cutsq"); memory->create(r0,nparams,"pair:r0"); diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index cb5e08a46..9b753edd6 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -91,7 +91,7 @@ void PPPM_GPU_API(forces)(double **f); PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp) { - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; kspace_split = false; im_real_space = false; @@ -117,11 +117,11 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to NULL + // if do this, make sure to set them to nullptr destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; PPPM::init(); @@ -707,7 +707,7 @@ FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi, void PPPMGPU::destroy_3d_offset(FFT_SCALAR ***array, int n1_offset, int n2_offset) { - if (array == NULL) return; + if (array == nullptr) return; memory->sfree(&array[n1_offset][n2_offset]); memory->sfree(array + n1_offset); } @@ -797,7 +797,7 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) // extend size of per-atom arrays if necessary // part2grid needs to be allocated - if (atom->nmax > nmax || part2grid == NULL) { + if (atom->nmax > nmax || part2grid == nullptr) { memory->destroy(part2grid); nmax = atom->nmax; memory->create(part2grid,nmax,3,"pppm:part2grid"); diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index d449bb561..0bf900729 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -48,10 +48,10 @@ enum{CONSTANT,EQUAL}; // same as FixGravity /* ---------------------------------------------------------------------- */ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), radius_poly(NULL), frac_poly(NULL), - idrigid(NULL), idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), - imageflags(NULL), fixrigid(NULL), fixshake(NULL), recvcounts(NULL), - displs(NULL), random(NULL), random2(NULL) + Fix(lmp, narg, arg), radius_poly(nullptr), frac_poly(nullptr), + idrigid(nullptr), idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), + imageflags(nullptr), fixrigid(nullptr), fixshake(nullptr), recvcounts(nullptr), + displs(nullptr), random(nullptr), random2(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix pour command"); @@ -344,7 +344,7 @@ void FixPour::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix pour rigid fix does not exist"); @@ -359,7 +359,7 @@ void FixPour::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix pour shake fix does not exist"); @@ -456,7 +456,7 @@ void FixPour::pre_exchange() // perform allgatherv to acquire list of nearby particles on all procs - double *ptr = NULL; + double *ptr = nullptr; if (ncount) ptr = xmine[0]; MPI_Allgatherv(ptr,4*ncount,MPI_DOUBLE, xnear[0],recvcounts,displs,MPI_DOUBLE,world); @@ -889,16 +889,16 @@ void FixPour::options(int narg, char **arg) iregion = -1; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; ignoreflag = ignoreline = ignoretri = 0; dstyle = ONE; radius_max = radius_one = 0.5; - radius_poly = frac_poly = NULL; + radius_poly = frac_poly = nullptr; density_lo = density_hi = 1.0; volfrac = 0.25; maxattempt = 50; @@ -1091,5 +1091,5 @@ void *FixPour::extract(const char *str, int &itype) itype = 0; return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 9ec76b88f..25d271be9 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -63,8 +63,8 @@ enum {ROLL_NONE, ROLL_SDS}; /* ---------------------------------------------------------------------- */ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), history_one(NULL), - fix_rigid(NULL), mass_rigid(NULL) + Fix(lmp, narg, arg), idregion(nullptr), history_one(nullptr), + fix_rigid(nullptr), mass_rigid(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/gran command"); @@ -303,7 +303,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // wallstyle args - idregion = NULL; + idregion = nullptr; if (strcmp(arg[iarg],"xplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); @@ -407,16 +407,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - history_one = NULL; + history_one = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be NULL for wallstyle = REGION + // history_one will be nullptr for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -471,7 +471,7 @@ void FixWallGran::init() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history @@ -681,7 +681,7 @@ void FixWallGran::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 3aa518209..1b3be22e7 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 543df02fc..f91bac2c9 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -39,9 +39,9 @@ enum {NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR}; /* ---------------------------------------------------------------------- */ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : - FixWallGran(lmp, narg, arg), region(NULL), region_style(NULL), - ncontact(NULL), - walls(NULL), history_many(NULL), c2r(NULL) + FixWallGran(lmp, narg, arg), region(nullptr), region_style(nullptr), + ncontact(nullptr), + walls(nullptr), history_many(nullptr), c2r(nullptr) { restart_global = 1; motion_resetflag = 0; @@ -61,11 +61,11 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : // do not register with Atom class, since parent class did that memory->destroy(history_one); - history_one = NULL; + history_one = nullptr; - ncontact = NULL; - walls = NULL; - history_many = NULL; + ncontact = nullptr; + walls = nullptr; + history_many = nullptr; grow_arrays(atom->nmax); // initialize shear history as if particle is not touching region @@ -262,7 +262,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 68a7803f4..b296f8465 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -52,7 +52,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // set comm size needed by this Pair if used with fix rigid @@ -65,7 +65,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_HH_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -426,7 +426,7 @@ void PairGranHookeHistory::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -450,7 +450,7 @@ void PairGranHookeHistory::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -554,7 +554,7 @@ void PairGranHookeHistory::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -580,12 +580,12 @@ void PairGranHookeHistory::write_restart_settings(FILE *fp) void PairGranHookeHistory::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kn,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kt,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamman,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gammat,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&xmu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kn,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kt,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamman,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gammat,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&xmu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kn,1,MPI_DOUBLE,0,world); MPI_Bcast(&kt,1,MPI_DOUBLE,0,world); diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index 309af54ee..dd9a84314 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index ee0eb2ad7..5edc656a6 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -73,14 +73,14 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; - onerad_dynamic = NULL; - onerad_frozen = NULL; - maxrad_dynamic = NULL; - maxrad_frozen = NULL; + onerad_dynamic = nullptr; + onerad_frozen = nullptr; + maxrad_dynamic = nullptr; + maxrad_frozen = nullptr; - history_transfer_factors = NULL; + history_transfer_factors = nullptr; dt = update->dt; @@ -97,7 +97,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -1101,7 +1101,7 @@ void PairGranular::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (use_history && fix_history == NULL) { + if (use_history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -1125,7 +1125,7 @@ void PairGranular::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -1330,20 +1330,20 @@ void PairGranular::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,NULL,error); - utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,nullptr,error); + utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&normal_model[i][j],1,MPI_INT,0,world); MPI_Bcast(&damping_model[i][j],1,MPI_INT,0,world); diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index e9ba629b4..ce417812d 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.cpp b/src/KIM/fix_store_kim.cpp index 776d8aab9..5428b7509 100644 --- a/src/KIM/fix_store_kim.cpp +++ b/src/KIM/fix_store_kim.cpp @@ -67,8 +67,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixStoreKIM::FixStoreKIM(LAMMPS *lmp, int narg, char **arg) - : Fix(lmp, narg, arg), simulator_model(NULL), model_name(NULL), - model_units(NULL), user_units(NULL) + : Fix(lmp, narg, arg), simulator_model(nullptr), model_name(nullptr), + model_units(nullptr), user_units(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix STORE/KIM command"); } @@ -82,25 +82,25 @@ FixStoreKIM::~FixStoreKIM() if (simulator_model) { KIM_SimulatorModel *sm = (KIM_SimulatorModel *)simulator_model; KIM_SimulatorModel_Destroy(&sm); - simulator_model = NULL; + simulator_model = nullptr; } if (model_name) { char *mn = (char *)model_name; delete[] mn; - model_name = NULL; + model_name = nullptr; } if (model_units) { char *mu = (char *)model_units; delete[] mu; - model_units = NULL; + model_units = nullptr; } if (user_units) { char *uu = (char *)user_units; delete[] uu; - user_units = NULL; + user_units = nullptr; } } @@ -151,5 +151,5 @@ void *FixStoreKIM::getptr(const char *name) else if (strcmp(name,"model_name") == 0) return model_name; else if (strcmp(name,"model_units") == 0) return model_units; else if (strcmp(name,"user_units") == 0) return user_units; - else return NULL; + else return nullptr; } diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 6baf48099..4e4890ea6 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or NULL - void *user_units; // string of unit conversion target or NULL + void *model_units; // string of unit conversion origin or nullptr + void *user_units; // string of unit conversion target or nullptr }; } diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 684108be7..bbeffe2d8 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -96,7 +96,7 @@ void KimInit::command(int narg, char **arg) } else unit_conversion_mode = false; char *model_units; - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; if (universe->me == 0) std::remove("kim.log"); @@ -366,8 +366,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM if (numberOfParameters) { KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; mesg += std::to_string(numberOfParameters) + " mutable parameters. \n"; @@ -486,7 +486,7 @@ void KimInit::write_log_cite(char *model_name) int availableAsString; char const * fileString; err = KIM_Collections_GetItemMetadataFile( - coll,i,&fileName,NULL,NULL,&availableAsString,&fileString); + coll,i,&fileName,nullptr,nullptr,&availableAsString,&fileString); if (err) continue; if (0 == strncmp("kimcite",fileName,7)) { diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 5f45dd34d..755121607 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -103,12 +103,12 @@ void KimInteractions::do_setup(int narg, char **arg) fixed_types = false; } - char *model_name = NULL; - KIM_SimulatorModel *simulatorModel(NULL); + char *model_name = nullptr; + KIM_SimulatorModel *simulatorModel(nullptr); // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as NULL. + // validate model name if not given as nullptr. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { @@ -256,7 +256,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con FILE *fp; fp = fopen(filename.c_str(),"r"); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR,"Parameter file not found"); } @@ -266,7 +266,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 6f4ac5cc2..121f167ab 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -185,7 +185,7 @@ void KimParam::command(int narg, char **arg) input->write_echo(fmt::format("#=== BEGIN kim-param {} ===================" "==================\n",kim_param_get_set)); - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; std::string atom_type_list; @@ -251,9 +251,9 @@ void KimParam::command(int narg, char **arg) // Get the parameters if (kim_param_get_set == "get") { // Parameter name - char *paramname = NULL; + char *paramname = nullptr; // Variable name - char *varname = NULL; + char *varname = nullptr; // Loop over all the arguments for (int i = 1; i < narg;) { @@ -267,8 +267,8 @@ void KimParam::command(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kim_error = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -344,7 +344,7 @@ void KimParam::command(int narg, char **arg) } int const nvars = nubound - nlbound + 1; - char **varsname = NULL; + char **varsname = nullptr; if (i < narg) { // Get the variable/variable_base name diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index 95a127485..4a381fb8d 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -112,7 +112,7 @@ void kimProperty::command(int narg, char **arg) PyGILState_STATE gstate = PyGILState_Ensure(); // kim_property module - PyObject *kim_property = NULL; + PyObject *kim_property = nullptr; // import kim_property { @@ -438,7 +438,7 @@ void kimProperty::command(int narg, char **arg) "evaluation failed!"); } } else - pValue = NULL; + pValue = nullptr; // Destroy the variable input->variable->set("kim_property_str delete"); diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 7ed70972c..30b5e6cbb 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -78,9 +78,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(NULL), - lmps_map_species_to_unique(NULL), - lmps_unique_elements(NULL), + kim_modelname(nullptr), + lmps_map_species_to_unique(nullptr), + lmps_unique_elements(nullptr), lmps_num_unique_elements(0), lmps_units(METAL), lengthUnit(KIM_LENGTH_UNIT_unused), @@ -88,8 +88,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : chargeUnit(KIM_CHARGE_UNIT_unused), temperatureUnit(KIM_TEMPERATURE_UNIT_unused), timeUnit(KIM_TIME_UNIT_unused), - pkim(NULL), - pargs(NULL), + pkim(nullptr), + pargs(nullptr), kim_model_support_for_energy(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_forces(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_particleEnergy(KIM_SUPPORT_STATUS_notSupported), @@ -97,15 +97,15 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_neighbor_lists(0), - kim_cutoff_values(NULL), - modelWillNotRequestNeighborsOfNoncontributingParticles(NULL), - neighborLists(NULL), - kim_particle_codes(NULL), + kim_cutoff_values(nullptr), + modelWillNotRequestNeighborsOfNoncontributingParticles(nullptr), + neighborLists(nullptr), + kim_particle_codes(nullptr), lmps_maxalloc(0), - kim_particleSpecies(NULL), - kim_particleContributing(NULL), - lmps_stripped_neigh_list(NULL), - lmps_stripped_neigh_ptr(NULL) + kim_particleSpecies(nullptr), + kim_particleContributing(nullptr), + lmps_stripped_neigh_list(nullptr), + lmps_stripped_neigh_ptr(nullptr) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -137,7 +137,7 @@ PairKIM::~PairKIM() if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } @@ -393,7 +393,7 @@ void PairKIM::coeff(int narg, char **arg) // setup mapping between LAMMPS unique elements and KIM species codes if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } kim_particle_codes = new int[lmps_num_unique_elements]; @@ -430,7 +430,7 @@ void PairKIM::coeff(int narg, char **arg) int kimerror; // Parameter name - char *paramname = NULL; + char *paramname = nullptr; for (int i = 2 + atom->ntypes; i < narg;) { // Parameter name @@ -443,8 +443,8 @@ void PairKIM::coeff(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kimerror = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -903,7 +903,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs,KIM_COMPUTE_ARGUMENT_NAME_partialEnergy, - static_cast(NULL)); + static_cast(nullptr)); } } @@ -924,7 +924,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleEnergy, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( @@ -937,7 +937,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, - static_cast(NULL)); + static_cast(nullptr)); } else { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, &(atom->f[0][0])); @@ -960,7 +960,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index e826a7c39..ed0cfccd4 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -87,7 +87,7 @@ AtomKokkos::~AtomKokkos() memoryKK->destroy_kokkos(k_duChem,duChem); memoryKK->destroy_kokkos(k_dvector,dvector); - dvector = NULL; + dvector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to NULL + free memory for vector and name and set ptrs to nullptr ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ @@ -290,14 +290,14 @@ void AtomKokkos::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { //memoryKK->destroy_kokkos(dvector); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 662f09fe5..3090a62d1 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -48,7 +48,7 @@ AtomVecAngleKokkos::AtomVecAngleKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) k_count = DAT::tdual_int_1d("atom::k_count",1); atomKK = (AtomKokkos *) atom; commKK = (CommKokkos *) comm; - buffer = NULL; + buffer = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/atom_vec_kokkos.cpp b/src/KOKKOS/atom_vec_kokkos.cpp index 9e39f5373..f2dca9beb 100644 --- a/src/KOKKOS/atom_vec_kokkos.cpp +++ b/src/KOKKOS/atom_vec_kokkos.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; AtomVecKokkos::AtomVecKokkos(LAMMPS *lmp) : AtomVec(lmp) { kokkosable = 1; - buffer = NULL; + buffer = nullptr; buffer_size = 0; no_comm_vel_flag = 0; diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 51ba6bbdb..9e1bfcbc5 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -45,7 +45,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) { if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]); memory->sfree(sendlist); - sendlist = NULL; + sendlist = nullptr; k_sendlist = DAT::tdual_int_2d(); k_total_send = DAT::tdual_int_scalar("comm::k_total_send"); @@ -54,9 +54,9 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) // initialize comm buffers & exchange memory memory->destroy(buf_send); - buf_send = NULL; + buf_send = nullptr; memory->destroy(buf_recv); - buf_recv = NULL; + buf_recv = nullptr; k_exchange_lists = DAT::tdual_int_2d("comm:k_exchange_lists",2,100); k_exchange_sendlist = Kokkos::subview(k_exchange_lists,0,Kokkos::ALL); @@ -65,7 +65,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) k_sendflag = DAT::tdual_int_1d("comm:k_sendflag",100); memory->destroy(maxsendlist); - maxsendlist = NULL; + maxsendlist = nullptr; memory->create(maxsendlist,maxswap,"comm:maxsendlist"); for (int i = 0; i < maxswap; i++) { maxsendlist[i] = BUFMIN; @@ -82,11 +82,11 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) CommKokkos::~CommKokkos() { memoryKK->destroy_kokkos(k_sendlist,sendlist); - sendlist = NULL; + sendlist = nullptr; memoryKK->destroy_kokkos(k_buf_send,buf_send); - buf_send = NULL; + buf_send = nullptr; memoryKK->destroy_kokkos(k_buf_recv,buf_recv); - buf_recv = NULL; + buf_recv = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/fft3d_kokkos.cpp b/src/KOKKOS/fft3d_kokkos.cpp index ff95998e4..d7f556cf8 100644 --- a/src/KOKKOS/fft3d_kokkos.cpp +++ b/src/KOKKOS/fft3d_kokkos.cpp @@ -69,7 +69,7 @@ FFT3dKokkos::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective,nthreads,usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ @@ -403,7 +403,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan = new struct fft_plan_3d_kokkos; remapKK = new RemapKokkos(lmp); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -422,7 +422,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; @@ -436,7 +436,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -461,7 +461,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -502,7 +502,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -521,7 +521,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remapKK->remap_3d_create_plan_kokkos(comm, @@ -530,7 +530,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -648,39 +648,39 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #elif defined(FFT_CUFFT) @@ -704,16 +704,16 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl kissfftKK = new KissFFTKokkos(); - plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,NULL,NULL); - plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,NULL,NULL); + plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,NULL,NULL); - plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,NULL,NULL); + plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -725,8 +725,8 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,NULL,NULL); - plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,NULL,NULL); + plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index dadf9e4c8..8761b54d4 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -735,7 +735,7 @@ void FixLangevinKokkos::reset_dt() template double FixLangevinKokkos::compute_scalar() { - if (!tallyflag || flangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr) return 0.0; v = atomKK->k_v.template view(); mask = atomKK->k_mask.template view(); @@ -893,19 +893,19 @@ void FixLangevinKokkos::copy_arrays(int i, int j, int /*delflag*/) template void FixLangevinKokkos::cleanup_copy() { - random = NULL; - tstr = NULL; - gfactor1 = NULL; - gfactor2 = NULL; - ratio = NULL; - id_temp = NULL; - flangevin = NULL; - tforce = NULL; + random = nullptr; + tstr = nullptr; + gfactor1 = nullptr; + gfactor2 = nullptr; + ratio = nullptr; + id_temp = nullptr; + flangevin = nullptr; + tforce = nullptr; gjfflag = 0; - franprev = NULL; - lv = NULL; - id = style = NULL; - vatom = NULL; + franprev = nullptr; + lv = nullptr; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_minimize_kokkos.cpp b/src/KOKKOS/fix_minimize_kokkos.cpp index 13b9cb02a..f123a663d 100644 --- a/src/KOKKOS/fix_minimize_kokkos.cpp +++ b/src/KOKKOS/fix_minimize_kokkos.cpp @@ -34,7 +34,7 @@ FixMinimizeKokkos::FixMinimizeKokkos(LAMMPS *lmp, int narg, char **arg) : FixMinimizeKokkos::~FixMinimizeKokkos() { memoryKK->destroy_kokkos(k_vectors,vectors); - vectors = NULL; + vectors = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index d1f3f6632..56a37c8d1 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -35,9 +35,9 @@ FixNeighHistoryKokkos::FixNeighHistoryKokkos(LAMMPS *lmp, int narg, memory->destroy(npartner); memory->sfree(partner); memory->sfree(valuepartner); - npartner = NULL; - partner = NULL; - valuepartner = NULL; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; maxpartner = 8; grow_arrays(atom->nmax); diff --git a/src/KOKKOS/fix_nve_kokkos.cpp b/src/KOKKOS/fix_nve_kokkos.cpp index beabc5572..fe6aeaccf 100644 --- a/src/KOKKOS/fix_nve_kokkos.cpp +++ b/src/KOKKOS/fix_nve_kokkos.cpp @@ -163,8 +163,8 @@ void FixNVEKokkos::final_integrate_rmass_item(int i) const template void FixNVEKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.cpp b/src/KOKKOS/fix_nve_sphere_kokkos.cpp index 64298748d..f292f30d3 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.cpp +++ b/src/KOKKOS/fix_nve_sphere_kokkos.cpp @@ -39,8 +39,8 @@ FixNVESphereKokkos::FixNVESphereKokkos(LAMMPS *lmp, int narg, char * template void FixNVESphereKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index eac044da2..dfa0ff609 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1424,7 +1424,7 @@ void FixQEqReaxKokkos::unpack_reverse_comm(int n, int *list, double template void FixQEqReaxKokkos::cleanup_copy() { - id = style = NULL; + id = style = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp index f98ab0314..faa5a9831 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp @@ -51,7 +51,7 @@ FixReaxCBondsKokkos::~FixReaxCBondsKokkos() void FixReaxCBondsKokkos::init() { Pair *pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c/kk"); FixReaxCBonds::init(); diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxc_species_kokkos.cpp index f3bce2f9c..4674389ed 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_species_kokkos.cpp @@ -58,7 +58,7 @@ FixReaxCSpeciesKokkos::~FixReaxCSpeciesKokkos() void FixReaxCSpeciesKokkos::init() { Pair* pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/species/kk without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/species/kk without " "pair_style reax/c/kk"); FixReaxCSpecies::init(); diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index 18bc4225a..1ba227d53 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -62,7 +62,7 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; template FixRxKokkos::FixRxKokkos(LAMMPS *lmp, int narg, char **arg) : FixRX(lmp, narg, arg), - pairDPDEKK(NULL), + pairDPDEKK(nullptr), update_kinetics_data(true) { kokkosable = 1; @@ -117,14 +117,14 @@ void FixRxKokkos::init() //FixRX::init(); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); pairDPDEKK = dynamic_cast(pairDPDE); - if (pairDPDEKK == NULL) + if (pairDPDEKK == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy/kk with fix rx/kk"); bool eos_flag = false; @@ -964,7 +964,7 @@ int FixRxKokkos::rhs_sparse(double /*t*/, const double *y, double *d //const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) @@ -1111,7 +1111,7 @@ KOKKOS_INLINE_FUNCTION int FixRxKokkos::k_rhs_sparse(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const { #define kFor (userData.kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData.rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 26c6ae4ae..0033e6964 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -121,7 +121,7 @@ class FixRxKokkos : public FixRX { value_type *m_data; KOKKOS_INLINE_FUNCTION - StridedArrayType() : m_data(NULL) {} + StridedArrayType() : m_data(nullptr) {} KOKKOS_INLINE_FUNCTION StridedArrayType(value_type *ptr) : m_data(ptr) {} diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index a11e8b4bd..00d717c91 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -57,7 +57,7 @@ FixSetForceKokkos::~FixSetForceKokkos() if (copymode) return; memoryKK->destroy_kokkos(k_sforce,sforce); - sforce = NULL; + sforce = nullptr; } /* ---------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ void FixSetForceKokkos::post_force(int /*vflag*/) // update region if necessary - region = NULL; + region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 9be4321ff..1779ebc85 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -63,7 +63,7 @@ using namespace random_external_state; template FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **arg) : - FixShardlow(lmp, narg, arg), k_pairDPDE(NULL), ghostmax(0), nlocal(0) , nghost(0) + FixShardlow(lmp, narg, arg), k_pairDPDE(nullptr), ghostmax(0), nlocal(0) , nghost(0) { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -74,8 +74,8 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); -// k_pairDPD = NULL; - k_pairDPDE = NULL; +// k_pairDPD = nullptr; + k_pairDPDE = nullptr; // k_pairDPD = (PairDPDfdtKokkos *) force->pair_match("dpd/fdt",1); k_pairDPDE = dynamic_cast *>(force->pair_match("dpd/fdt/energy",0)); @@ -88,7 +88,7 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a // } - if(/* k_pairDPD == NULL &&*/ k_pairDPDE == NULL) + if(/* k_pairDPD == nullptr &&*/ k_pairDPDE == nullptr) error->all(FLERR,"Must use pair_style "/*"dpd/fdt/kk or "*/"dpd/fdt/energy/kk with fix shardlow/kk"); #ifdef DEBUG_SSA_PAIR_CT diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 909e3c854..0a175343c 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -91,21 +91,21 @@ GridCommKokkos::~GridCommKokkos() // regular comm data struct for (int i = 0; i < nswap; i++) { - swap[i].packlist = NULL; - swap[i].unpacklist = NULL; + swap[i].packlist = nullptr; + swap[i].unpacklist = nullptr; } // tiled comm data structs for (int i = 0; i < nsend; i++) - send[i].packlist = NULL; + send[i].packlist = nullptr; for (int i = 0; i < nrecv; i++) - recv[i].unpacklist = NULL; + recv[i].unpacklist = nullptr; for (int i = 0; i < ncopy; i++) { - copy[i].packlist = NULL; - copy[i].unpacklist = NULL; + copy[i].packlist = nullptr; + copy[i].unpacklist = nullptr; } } @@ -459,7 +459,7 @@ void GridCommKokkos::setup_tiled(int &nbuf1, int &nbuf2) memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); noverlap = maxoverlap = 0; - overlap = NULL; + overlap = nullptr; ghost_box_drop(ghostbox,pbc); diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 79fd0685b..16d906ba3 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -226,7 +226,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int len; char mpi_version[MPI_MAX_LIBRARY_VERSION_STRING]; MPI_Get_library_version(mpi_version, &len); - if (strstr(&mpi_version[0], "Spectrum") != NULL) { + if (strstr(&mpi_version[0], "Spectrum") != nullptr) { cuda_aware_flag = 0; char* str; if (str = getenv("OMPI_MCA_pml_pami_enable_cuda")) diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 83e8b9ec7..df85f72c6 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -78,7 +78,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); array = data.h_view.data(); @@ -88,9 +88,9 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -100,7 +100,7 @@ void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) template TYPE destroy_kokkos(TYPE &data) { - /*if(data.data()!=NULL) + /*if(data.data()!=nullptr) free(data.data());*/ data = TYPE(); return data; @@ -186,7 +186,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); n += n2; @@ -211,7 +211,7 @@ template bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &h_data(i,0); n += n2; @@ -228,14 +228,14 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, int n2, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,n2,name); + if (array == nullptr) return create_kokkos(data,array,n1,n2,name); data.resize(n1,n2); bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; array = (typename TYPE::value_type**) srealloc(array,nbytes,name); for (int i = 0; i < n1; i++) if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -252,7 +252,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -263,7 +263,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); @@ -272,7 +272,7 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -286,10 +286,10 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type** &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); sfree(array); - array = NULL; + array = nullptr; } }; diff --git a/src/KOKKOS/min_kokkos.cpp b/src/KOKKOS/min_kokkos.cpp index 032538fe6..759b00976 100644 --- a/src/KOKKOS/min_kokkos.cpp +++ b/src/KOKKOS/min_kokkos.cpp @@ -49,7 +49,7 @@ using namespace LAMMPS_NS; MinKokkos::MinKokkos(LAMMPS *lmp) : Min(lmp) { atomKK = (AtomKokkos *) atom; - fix_minimize_kk = NULL; + fix_minimize_kk = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index b21a7cb1e..cadfccfa6 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -41,10 +41,10 @@ NeighborKokkos::NeighborKokkos(LAMMPS *lmp) : Neighbor(lmp), neighbond_host(lmp),neighbond_device(lmp) { device_flag = 0; - bondlist = NULL; - anglelist = NULL; - dihedrallist = NULL; - improperlist = NULL; + bondlist = nullptr; + anglelist = nullptr; + dihedrallist = nullptr; + improperlist = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ NeighborKokkos::~NeighborKokkos() { if (!copymode) { memoryKK->destroy_kokkos(k_cutneighsq,cutneighsq); - cutneighsq = NULL; + cutneighsq = nullptr; memoryKK->destroy_kokkos(k_ex_type,ex_type); memoryKK->destroy_kokkos(k_ex1_type,ex1_type); diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index afa8bd649..8f874b9fe 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -48,9 +48,9 @@ PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCo execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -69,11 +69,11 @@ PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } } diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index a77ef291f..6a13254e8 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -55,8 +55,8 @@ PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuck execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -75,11 +75,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } } @@ -88,11 +88,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() template void PairBuckCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index 71f63a9f9..efddb43a9 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -46,7 +46,7 @@ PairBuckKokkos::PairBuckKokkos(LAMMPS *lmp) : PairBuck(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -59,9 +59,9 @@ PairBuckKokkos::~PairBuckKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index 8fae09e1e..a77f738a5 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -37,7 +37,7 @@ PairCoulCutKokkos::PairCoulCutKokkos(LAMMPS *lmp) : PairCoulCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,9 +55,9 @@ template void PairCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index e3326f305..b469a2b8c 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -46,7 +46,7 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } @@ -66,9 +66,9 @@ template void PairCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 780d57d92..aeba50c0a 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairCoulLongKokkos::PairCoulLongKokkos(LAMMPS *lmp):PairCoulLong(lmp execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_coulsq = 0.0; } @@ -71,9 +71,9 @@ PairCoulLongKokkos::~PairCoulLongKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -82,10 +82,10 @@ PairCoulLongKokkos::~PairCoulLongKokkos() template void PairCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 280e47b77..4e0c44acb 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMAlloyKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index aee94471c..2c4e4fdf9 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -61,7 +61,7 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMAlloyKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index a4828c00a..2714da9ca 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMFSKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index 5f1a912f5..104ecf1a0 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -61,7 +61,7 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMFSKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 5992b7ed6..99719bbe5 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -59,7 +59,7 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } KOKKOS_INLINE_FUNCTION void operator()(TagPairEAMPackForwardComm, const int&) const; diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index 035bf87ce..811589972 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -1715,16 +1715,16 @@ void PairExp6rxKokkos::read_file(char *file) char **words = new char*[params_per_line+1]; memoryKK->destroy_kokkos(k_params,params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -1741,7 +1741,7 @@ void PairExp6rxKokkos::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1763,7 +1763,7 @@ void PairExp6rxKokkos::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1783,7 +1783,7 @@ void PairExp6rxKokkos::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp index a442a987f..a1c376cdf 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp @@ -48,8 +48,8 @@ PairGranHookeHistoryKokkos::~PairGranHookeHistoryKokkos() if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } @@ -64,7 +64,7 @@ void PairGranHookeHistoryKokkos::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",3); char **fixarg = new char*[4]; diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index b5b0a9d02..23b8401fe 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -87,7 +87,7 @@ void PairHybridKokkos::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 396a5f2d4..1eaf20ead 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -94,7 +94,7 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations NULL which are destructed by the PairStyle + // Call cleanup_copy which sets allocations nullptr which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index 2ce056938..adfe095dc 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -54,7 +54,7 @@ PairLJCharmmCoulCharmmImplicitKokkos::PairLJCharmmCoulCharmmImplicit execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -74,9 +74,9 @@ PairLJCharmmCoulCharmmImplicitKokkos::~PairLJCharmmCoulCharmmImplici memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -88,11 +88,11 @@ template void PairLJCharmmCoulCharmmImplicitKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index e59da8d29..a20a6242c 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulCharmmKokkos::PairLJCharmmCoulCharmmKokkos(LAMMPS *l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulCharmmKokkos::~PairLJCharmmCoulCharmmKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulCharmmKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index a06e569eb..2f4a03e9b 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulLongKokkos::PairLJCharmmCoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulLongKokkos::~PairLJCharmmCoulLongKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index b45ff6d31..799f1a278 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -43,9 +43,9 @@ PairLJClass2CoulCutKokkos::PairLJClass2CoulCutKokkos(LAMMPS *lmp):Pa execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -67,11 +67,11 @@ template void PairLJClass2CoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index fc97c3491..7fafd865c 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -51,8 +51,8 @@ PairLJClass2CoulLongKokkos::PairLJClass2CoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -74,11 +74,11 @@ template void PairLJClass2CoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index a0d2fba58..6a66a8861 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -46,7 +46,7 @@ PairLJClass2Kokkos::PairLJClass2Kokkos(LAMMPS *lmp) : PairLJClass2(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJClass2Kokkos::~PairLJClass2Kokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJClass2Kokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index d269de45e..3749690b7 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -42,9 +42,9 @@ PairLJCutCoulCutKokkos::PairLJCutCoulCutKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -66,11 +66,11 @@ template void PairLJCutCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 05e0d15db..bd4530cf3 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -46,9 +46,9 @@ PairLJCutCoulDebyeKokkos::PairLJCutCoulDebyeKokkos(LAMMPS *lmp):Pair execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -70,11 +70,11 @@ template void PairLJCutCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index bdd167a29..47fa5cf11 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -56,9 +56,9 @@ PairLJCutCoulDSFKokkos::PairLJCutCoulDSFKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } @@ -80,11 +80,11 @@ template void PairLJCutCoulDSFKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index b6ea969d8..6f31a816d 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -53,8 +53,8 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -66,8 +66,8 @@ PairLJCutCoulLongKokkos::~PairLJCutCoulLongKokkos() { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; if (allocated){ memoryKK->destroy_kokkos(k_cutsq, cutsq); memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); @@ -80,11 +80,11 @@ template void PairLJCutCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index 8294d62f6..674c54fa4 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -41,7 +41,7 @@ PairLJCutKokkos::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,9 +54,9 @@ PairLJCutKokkos::~PairLJCutKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -66,9 +66,9 @@ template void PairLJCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index f17703e2d..5d47e5dab 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -46,7 +46,7 @@ PairLJExpandKokkos::PairLJExpandKokkos(LAMMPS *lmp) : PairLJExpand(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJExpandKokkos::~PairLJExpandKokkos() if (!copymode) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJExpandKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index 60d18519b..04d018257 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -46,7 +46,7 @@ PairLJGromacsCoulGromacsKokkos::PairLJGromacsCoulGromacsKokkos(LAMMP execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -66,9 +66,9 @@ PairLJGromacsCoulGromacsKokkos::~PairLJGromacsCoulGromacsKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -80,11 +80,11 @@ template void PairLJGromacsCoulGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index d27b9e1ec..dacf4d977 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -46,9 +46,9 @@ PairLJGromacsKokkos::PairLJGromacsKokkos(LAMMPS *lmp):PairLJGromacs( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } @@ -63,11 +63,11 @@ PairLJGromacsKokkos::~PairLJGromacsKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_inner_sq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } } @@ -77,11 +77,11 @@ template void PairLJGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 8b228f2c0..ddf4b4efd 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -46,7 +46,7 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJSDKKokkos::~PairLJSDKKokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJSDKKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index ba6e9ba97..b6cf4ed8d 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -48,7 +48,7 @@ PairMorseKokkos::PairMorseKokkos(LAMMPS *lmp) : PairMorse(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,9 +61,9 @@ PairMorseKokkos::~PairMorseKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -73,9 +73,9 @@ template void PairMorseKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index c4e1ae38c..f620d194a 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -83,7 +83,7 @@ PairMultiLucyRXKokkos::~PairMultiLucyRXKokkos() delete h_table; delete d_table; - tabindex = NULL; + tabindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -980,7 +980,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 3a7359df9..d76cb98ec 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -79,9 +79,9 @@ PairReaxCKokkos::~PairReaxCKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_tmpid,tmpid); - tmpid = NULL; + tmpid = nullptr; memoryKK->destroy_kokkos(k_tmpbo,tmpbo); - tmpbo = NULL; + tmpbo = nullptr; // deallocate views of views in serial to prevent race condition in profiling tools @@ -137,7 +137,7 @@ void PairReaxCKokkos::init_style() { PairReaxC::init_style(); if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version - fix_reax = NULL; + fix_reax = nullptr; // irequest = neigh request made by parent class diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 7a567e846..a8a79f968 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -61,8 +61,8 @@ PairSWKokkos::~PairSWKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index b5b59dc45..996dae5c1 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -462,7 +462,7 @@ void PairTableKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -522,10 +522,10 @@ template void PairTableKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 09e38e638..b2b8a7d60 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -995,7 +995,7 @@ void PairTableRXKokkos::settings(int narg, char **arg) for (int m = 0; m < ntables; m++) free_table(&tables[m]); memory->sfree(tables); ntables = 0; - tables = NULL; + tables = nullptr; if (allocated) { memory->destroy(setflag); @@ -1289,10 +1289,10 @@ template void PairTableRXKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_vashishta_kokkos.cpp b/src/KOKKOS/pair_vashishta_kokkos.cpp index b5dd43f12..106422a23 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.cpp +++ b/src/KOKKOS/pair_vashishta_kokkos.cpp @@ -61,8 +61,8 @@ PairVashishtaKokkos::~PairVashishtaKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 71236c807..03deb1ecf 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -45,7 +45,7 @@ PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,9 +58,9 @@ PairYukawaKokkos::~PairYukawaKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -70,9 +70,9 @@ template void PairYukawaKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index 8b583a75f..796dd5211 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -60,9 +60,9 @@ PairZBLKokkos::~PairZBLKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -416,9 +416,9 @@ template void PairZBLKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 4a795833f..f4e3955f3 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -77,25 +77,25 @@ PPPMKokkos::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = NULL; - //d_density_fft = NULL; - //d_u_brick = NULL; - //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = NULL; - //greensfn = NULL; - //d_work1 = d_work2 = NULL; - //vg = NULL; - //d_fkx = d_fky = d_fkz = NULL; + //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = nullptr; + //d_density_fft = nullptr; + //d_u_brick = nullptr; + //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = nullptr; + //greensfn = nullptr; + //d_work1 = d_work2 = nullptr; + //vg = nullptr; + //d_fkx = d_fky = d_fkz = nullptr; - //gf_b = NULL; - //rho1d = rho_coeff = drho1d = drho_coeff = NULL; + //gf_b = nullptr; + //rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - gc = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; nmax = 0; - //part2grid = NULL; + //part2grid = nullptr; peratom_allocate_flag = 0; @@ -160,8 +160,8 @@ PPPMKokkos::~PPPMKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- @@ -212,7 +212,7 @@ void PPPMKokkos::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -247,7 +247,7 @@ void PPPMKokkos::init() // or overlap is allowed, then done // else reduce order and try again - GridCommKokkos *gctmp = NULL; + GridCommKokkos *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -851,22 +851,22 @@ template void PPPMKokkos::deallocate() { memoryKK->destroy_kokkos(d_density_fft,density_fft); - density_fft = NULL; + density_fft = nullptr; memoryKK->destroy_kokkos(d_greensfn,greensfn); - greensfn = NULL; + greensfn = nullptr; memoryKK->destroy_kokkos(d_work1,work1); - work1 = NULL; + work1 = nullptr; memoryKK->destroy_kokkos(d_work2,work2); - work2 = NULL; + work2 = nullptr; delete fft1; - fft1 = NULL; + fft1 = nullptr; delete fft2; - fft2 = NULL; + fft2 = nullptr; delete remap; - remap = NULL; + remap = nullptr; delete gc; - gc = NULL; + gc = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.cpp b/src/KOKKOS/rand_pool_wrap_kokkos.cpp index 2d8865feb..51ea45e83 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.cpp +++ b/src/KOKKOS/rand_pool_wrap_kokkos.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; RandPoolWrap::RandPoolWrap(int, LAMMPS *lmp) : Pointers(lmp) { - random_thr = NULL; + random_thr = nullptr; nthreads = lmp->kokkos->nthreads; } @@ -42,7 +42,7 @@ void RandPoolWrap::destroy() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index 9124d8e9e..8ae90011a 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -26,7 +26,7 @@ struct RandWrap { KOKKOS_INLINE_FUNCTION RandWrap() { - rng = NULL; + rng = nullptr; } KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/remap_kokkos.cpp b/src/KOKKOS/remap_kokkos.cpp index af87ba364..1c72c9edc 100644 --- a/src/KOKKOS/remap_kokkos.cpp +++ b/src/KOKKOS/remap_kokkos.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; template RemapKokkos::RemapKokkos(LAMMPS *lmp) : Pointers(lmp) { - plan = NULL; + plan = nullptr; } template @@ -44,7 +44,7 @@ RemapKokkos::RemapKokkos(LAMMPS *lmp, MPI_Comm comm, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective, usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ @@ -235,7 +235,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // allocate memory for plan data struct plan = new struct remap_plan_3d_kokkos; - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; plan->usecuda_aware = usecuda_aware; @@ -268,10 +268,10 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -297,8 +297,8 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -379,9 +379,9 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -465,7 +465,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (size) { plan->d_sendbuf = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:sendbuf",size); - if (!plan->d_sendbuf.data()) return NULL; + if (!plan->d_sendbuf.data()) return nullptr; } // if requested, allocate internal scratch space for recvs, @@ -475,7 +475,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (nrecv > 0) { plan->d_scratch = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:scratch",nqty*out.isize*out.jsize*out.ksize); - if (!plan->d_scratch.data()) return NULL; + if (!plan->d_scratch.data()) return nullptr; } } @@ -495,7 +495,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat template void RemapKokkos::remap_3d_destroy_plan_kokkos(struct remap_plan_3d_kokkos *plan) { - if (plan == NULL) return; + if (plan == nullptr) return; // free MPI communicator diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 6133df398..51e19f763 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -39,11 +39,11 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), - kxvecs(NULL), kyvecs(NULL), kzvecs(NULL), ug(NULL), eg(NULL), vg(NULL), - ek(NULL), sfacrl(NULL), sfacim(NULL), sfacrl_all(NULL), sfacim_all(NULL), - cs(NULL), sn(NULL), sfacrl_A(NULL), sfacim_A(NULL), sfacrl_A_all(NULL), - sfacim_A_all(NULL), sfacrl_B(NULL), sfacim_B(NULL), sfacrl_B_all(NULL), - sfacim_B_all(NULL) + kxvecs(nullptr), kyvecs(nullptr), kzvecs(nullptr), ug(nullptr), eg(nullptr), vg(nullptr), + ek(nullptr), sfacrl(nullptr), sfacim(nullptr), sfacrl_all(nullptr), sfacim_all(nullptr), + cs(nullptr), sn(nullptr), sfacrl_A(nullptr), sfacim_A(nullptr), sfacrl_A_all(nullptr), + sfacim_A_all(nullptr), sfacrl_B(nullptr), sfacim_B(nullptr), sfacrl_B_all(nullptr), + sfacim_B_all(nullptr) { group_allocate_flag = 0; kmax_created = 0; @@ -53,14 +53,14 @@ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), accuracy_relative = 0.0; kmax = 0; - kxvecs = kyvecs = kzvecs = NULL; - ug = NULL; - eg = vg = NULL; - sfacrl = sfacim = sfacrl_all = sfacim_all = NULL; + kxvecs = kyvecs = kzvecs = nullptr; + ug = nullptr; + eg = vg = nullptr; + sfacrl = sfacim = sfacrl_all = sfacim_all = nullptr; nmax = 0; - ek = NULL; - cs = sn = NULL; + ek = nullptr; + cs = sn = nullptr; kcount = 0; } @@ -121,7 +121,7 @@ void Ewald::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole.cpp b/src/KSPACE/ewald_dipole.cpp index 33d21b416..ae2596ffe 100644 --- a/src/KSPACE/ewald_dipole.cpp +++ b/src/KSPACE/ewald_dipole.cpp @@ -40,12 +40,12 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDipole::EwaldDipole(LAMMPS *lmp) : Ewald(lmp), - tk(NULL), vc(NULL) + tk(nullptr), vc(nullptr) { ewaldflag = dipoleflag = 1; group_group_enable = 0; - tk = NULL; - vc = NULL; + tk = nullptr; + vc = nullptr; } /* ---------------------------------------------------------------------- @@ -112,7 +112,7 @@ void EwaldDipole::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index 94cacd3a7..67f49f87c 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -102,7 +102,7 @@ void EwaldDipoleSpin::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 546ac472c..4de393c8f 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -43,21 +43,21 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp), - kenergy(NULL), kvirial(NULL), energy_self_peratom(NULL), virial_self_peratom(NULL), - ekr_local(NULL), hvec(NULL), kvec(NULL), B(NULL), cek_local(NULL), cek_global(NULL) + kenergy(nullptr), kvirial(nullptr), energy_self_peratom(nullptr), virial_self_peratom(nullptr), + ekr_local(nullptr), hvec(nullptr), kvec(nullptr), B(nullptr), cek_local(nullptr), cek_global(nullptr) { ewaldflag = dispersionflag = dipoleflag = 1; memset(function, 0, EWALD_NFUNCS*sizeof(int)); - kenergy = kvirial = NULL; - cek_local = cek_global = NULL; - ekr_local = NULL; - hvec = NULL; - kvec = NULL; - B = NULL; + kenergy = kvirial = nullptr; + cek_local = cek_global = nullptr; + ekr_local = nullptr; + hvec = nullptr; + kvec = nullptr; + B = nullptr; first_output = 0; - energy_self_peratom = NULL; - virial_self_peratom = NULL; + energy_self_peratom = nullptr; + virial_self_peratom = nullptr; nmax = 0; q2 = 0; b2 = 0; @@ -109,8 +109,8 @@ void EwaldDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; if (!(ptr||cutoff)) error->all(FLERR,"KSpace style is incompatible with Pair style"); int ewald_order = ptr ? *((int *) ptr) : 1<<1; @@ -423,12 +423,12 @@ void EwaldDisp::deallocate_peratom() // free memory { if (energy_self_peratom) { memory->destroy(energy_self_peratom); - energy_self_peratom = NULL; + energy_self_peratom = nullptr; } if (virial_self_peratom) { memory->destroy(virial_self_peratom); - virial_self_peratom = NULL; + virial_self_peratom = nullptr; } } @@ -436,12 +436,12 @@ void EwaldDisp::deallocate_peratom() // free memory void EwaldDisp::deallocate() // free memory { - delete [] hvec; hvec = NULL; - delete [] kvec; kvec = NULL; - delete [] kenergy; kenergy = NULL; - delete [] kvirial; kvirial = NULL; - delete [] cek_local; cek_local = NULL; - delete [] cek_global; cek_global = NULL; + delete [] hvec; hvec = nullptr; + delete [] kvec; kvec = nullptr; + delete [] kenergy; kenergy = nullptr; + delete [] kvirial; kvirial = nullptr; + delete [] cek_local; cek_local = nullptr; + delete [] cek_global; cek_global = nullptr; } /* ---------------------------------------------------------------------- */ @@ -726,7 +726,7 @@ void EwaldDisp::compute_ek() { cvector *ekr = ekr_local; int lbytes = (2*nbox+1)*sizeof(cvector); - hvector *h = NULL; + hvector *h = nullptr; kvector *k, *nk = kvec+nkvec; cvector *z = new cvector[2*nbox+1]; cvector z1, *zx, *zy, *zz, *zn = z+2*nbox; @@ -734,7 +734,7 @@ void EwaldDisp::compute_ek() vector mui; double *x = atom->x[0], *xn = x+3*atom->nlocal, *q = atom->q, qi = 0.0; double bi = 0.0, ci[7]; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; int i, kx, ky, n = nkvec*nsums, *type = atom->type, tri = domain->triclinic; int func[EWALD_NFUNCS]; @@ -806,8 +806,8 @@ void EwaldDisp::compute_force() vector sum[EWALD_MAX_NSUMS], mui = COMPLEX_NULL; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { 8.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(12.0*volume), @@ -1002,7 +1002,7 @@ void EwaldDisp::compute_energy_peratom() complex *cek_coul; double *q = atom->q; double *eatomj = eatom; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke = kenergy; double c[EWALD_NFUNCS] = { @@ -1159,8 +1159,8 @@ void EwaldDisp::compute_virial_dipole() double sum_total[6]; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *mu = atom->mu ? atom->mu[0] : NULL; - double *vatomj = NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; + double *vatomj = nullptr; if (vflag_atom && vatom) vatomj = vatom[0]; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { @@ -1255,8 +1255,8 @@ void EwaldDisp::compute_virial_peratom() complex *cek_coul; double *kv; double *q = atom->q; - double *vatomj = vatom ? vatom[0] : NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *vatomj = vatom ? vatom[0] : nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double c[EWALD_NFUNCS] = { 4.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(24.0*volume), diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp index 477f8c759..d5ca88c0d 100644 --- a/src/KSPACE/fft3d.cpp +++ b/src/KSPACE/fft3d.cpp @@ -279,7 +279,7 @@ struct fft_plan_3d *fft_3d_create_plan( // allocate memory for plan data struct plan = (struct fft_plan_3d *) malloc(sizeof(struct fft_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -299,7 +299,7 @@ struct fft_plan_3d *fft_3d_create_plan( first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; first_ihi = nfast - 1; @@ -311,7 +311,7 @@ struct fft_plan_3d *fft_3d_create_plan( remap_3d_create_plan(comm,in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION,0); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -336,7 +336,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -377,7 +377,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi, third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION,usecollective); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -398,7 +398,7 @@ struct fft_plan_3d *fft_3d_create_plan( MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remap_3d_create_plan(comm, @@ -406,7 +406,7 @@ struct fft_plan_3d *fft_3d_create_plan( third_jlo,third_jhi, out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION,0); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -467,15 +467,15 @@ struct fft_plan_3d *fft_3d_create_plan( if (copy_size) { plan->copy = (FFT_DATA *) malloc(copy_size*sizeof(FFT_DATA)); - if (plan->copy == NULL) return NULL; + if (plan->copy == nullptr) return nullptr; } - else plan->copy = NULL; + else plan->copy = nullptr; if (scratch_size) { plan->scratch = (FFT_DATA *) malloc(scratch_size*sizeof(FFT_DATA)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } - else plan->scratch = NULL; + else plan->scratch = nullptr; // system specific pre-computation of 1d FFT coeffs // and scaling normalization @@ -527,47 +527,47 @@ struct fft_plan_3d *fft_3d_create_plan( plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #else /* FFT_KISS */ - plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,NULL,NULL); - plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,NULL,NULL); + plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,NULL,NULL); - plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,NULL,NULL); + plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -579,8 +579,8 @@ struct fft_plan_3d *fft_3d_create_plan( plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,NULL,NULL); - plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,NULL,NULL); + plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp index d0e3a2b50..28af7aabb 100644 --- a/src/KSPACE/fft3d_wrap.cpp +++ b/src/KSPACE/fft3d_wrap.cpp @@ -30,7 +30,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/KSPACE/gridcomm.cpp b/src/KSPACE/gridcomm.cpp index 0f899d31c..1c013716c 100644 --- a/src/KSPACE/gridcomm.cpp +++ b/src/KSPACE/gridcomm.cpp @@ -211,13 +211,13 @@ void GridComm::initialize(MPI_Comm gcomm, // internal data initializations nswap = maxswap = 0; - swap = NULL; + swap = nullptr; nsend = nrecv = ncopy = 0; - send = NULL; - recv = NULL; - copy = NULL; - requests = NULL; + send = nullptr; + recv = nullptr; + copy = nullptr; + requests = nullptr; } /* ---------------------------------------------------------------------- */ @@ -575,7 +575,7 @@ void GridComm::setup_tiled(int &nbuf1, int &nbuf2) memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); noverlap = maxoverlap = 0; - overlap = NULL; + overlap = nullptr; ghost_box_drop(ghostbox,pbc); diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h index c95b648dc..119dc17f6 100644 --- a/src/KSPACE/kissfft.h +++ b/src/KSPACE/kissfft.h @@ -420,14 +420,14 @@ static void kf_factor(int n, int *facbuf) */ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem) { - kiss_fft_cfg st=NULL; + kiss_fft_cfg st=nullptr; size_t memneeded = sizeof(struct kiss_fft_state) + sizeof(FFT_DATA)*(nfft-1); /* twiddle factors */ - if (lenmem==NULL) { + if (lenmem==nullptr) { st=(kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); } else { - if (mem != NULL && *lenmem >= memneeded) + if (mem != nullptr && *lenmem >= memneeded) st = (kiss_fft_cfg)mem; *lenmem = memneeded; } diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index d0f4d3868..4c5b615a1 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -45,19 +45,19 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; MSM::MSM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), delxinv(NULL), delyinv(NULL), delzinv(NULL), nx_msm(NULL), - ny_msm(NULL), nz_msm(NULL), nxlo_in(NULL), nylo_in(NULL), nzlo_in(NULL), - nxhi_in(NULL), nyhi_in(NULL), nzhi_in(NULL), nxlo_out(NULL), nylo_out(NULL), - nzlo_out(NULL), nxhi_out(NULL), nyhi_out(NULL), nzhi_out(NULL), ngrid(NULL), - active_flag(NULL), alpha(NULL), betax(NULL), betay(NULL), betaz(NULL), - peratom_allocate_flag(0),levels(0),world_levels(NULL),qgrid(NULL),egrid(NULL), - v0grid(NULL), v1grid(NULL),v2grid(NULL),v3grid(NULL),v4grid(NULL),v5grid(NULL), - g_direct(NULL),v0_direct(NULL),v1_direct(NULL),v2_direct(NULL),v3_direct(NULL), - v4_direct(NULL),v5_direct(NULL),g_direct_top(NULL),v0_direct_top(NULL), - v1_direct_top(NULL),v2_direct_top(NULL),v3_direct_top(NULL),v4_direct_top(NULL), - v5_direct_top(NULL),phi1d(NULL),dphi1d(NULL),procneigh_levels(NULL),gcall(NULL), - gc(NULL),gcall_buf1(NULL),gcall_buf2(NULL),gc_buf1(NULL),gc_buf2(NULL), - ngc_buf1(NULL),ngc_buf2(NULL),part2grid(NULL),boxlo(NULL) + factors(nullptr), delxinv(nullptr), delyinv(nullptr), delzinv(nullptr), nx_msm(nullptr), + ny_msm(nullptr), nz_msm(nullptr), nxlo_in(nullptr), nylo_in(nullptr), nzlo_in(nullptr), + nxhi_in(nullptr), nyhi_in(nullptr), nzhi_in(nullptr), nxlo_out(nullptr), nylo_out(nullptr), + nzlo_out(nullptr), nxhi_out(nullptr), nyhi_out(nullptr), nzhi_out(nullptr), ngrid(nullptr), + active_flag(nullptr), alpha(nullptr), betax(nullptr), betay(nullptr), betaz(nullptr), + peratom_allocate_flag(0),levels(0),world_levels(nullptr),qgrid(nullptr),egrid(nullptr), + v0grid(nullptr), v1grid(nullptr),v2grid(nullptr),v3grid(nullptr),v4grid(nullptr),v5grid(nullptr), + g_direct(nullptr),v0_direct(nullptr),v1_direct(nullptr),v2_direct(nullptr),v3_direct(nullptr), + v4_direct(nullptr),v5_direct(nullptr),g_direct_top(nullptr),v0_direct_top(nullptr), + v1_direct_top(nullptr),v2_direct_top(nullptr),v3_direct_top(nullptr),v4_direct_top(nullptr), + v5_direct_top(nullptr),phi1d(nullptr),dphi1d(nullptr),procneigh_levels(nullptr),gcall(nullptr), + gc(nullptr),gcall_buf1(nullptr),gcall_buf2(nullptr),gc_buf1(nullptr),gc_buf2(nullptr), + ngc_buf1(nullptr),ngc_buf2(nullptr),part2grid(nullptr),boxlo(nullptr) { msmflag = 1; @@ -67,32 +67,32 @@ MSM::MSM(LAMMPS *lmp) MPI_Comm_rank(world,&me); - phi1d = dphi1d = NULL; + phi1d = dphi1d = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; - g_direct = NULL; - g_direct_top = NULL; + g_direct = nullptr; + g_direct_top = nullptr; - v0_direct = v1_direct = v2_direct = NULL; - v3_direct = v4_direct = v5_direct = NULL; + v0_direct = v1_direct = v2_direct = nullptr; + v3_direct = v4_direct = v5_direct = nullptr; - v0_direct_top = v1_direct_top = v2_direct_top = NULL; - v3_direct_top = v4_direct_top = v5_direct_top = NULL; + v0_direct_top = v1_direct_top = v2_direct_top = nullptr; + v3_direct_top = v4_direct_top = v5_direct_top = nullptr; - ngrid = NULL; + ngrid = nullptr; - alpha = betax = betay = betaz = NULL; - nx_msm = ny_msm = nz_msm = NULL; - nxlo_in = nylo_in = nzlo_in = NULL; - nxhi_in = nyhi_in = nzhi_in = NULL; - nxlo_out = nylo_out = nzlo_out = NULL; - nxhi_out = nyhi_out = nzhi_out = NULL; - delxinv = delyinv = delzinv = NULL; - qgrid = NULL; - egrid = NULL; - v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = NULL; + alpha = betax = betay = betaz = nullptr; + nx_msm = ny_msm = nz_msm = nullptr; + nxlo_in = nylo_in = nzlo_in = nullptr; + nxhi_in = nyhi_in = nzhi_in = nullptr; + nxlo_out = nylo_out = nzlo_out = nullptr; + nxhi_out = nyhi_out = nzhi_out = nullptr; + delxinv = delyinv = delzinv = nullptr; + qgrid = nullptr; + egrid = nullptr; + v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = nullptr; peratom_allocate_flag = 0; scalar_pressure_flag = 1; @@ -176,7 +176,7 @@ void MSM::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -825,18 +825,18 @@ void MSM::allocate_levels() v5grid = new double***[levels]; for (int n=0; nkspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -383,7 +383,7 @@ void PairBornCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -423,16 +423,16 @@ void PairBornCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -466,13 +466,13 @@ void PairBornCoulLong::write_restart_settings(FILE *fp) void PairBornCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -577,5 +577,5 @@ void *PairBornCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_born_coul_msm.cpp b/src/KSPACE/pair_born_coul_msm.cpp index 7300cd92e..707f7f795 100644 --- a/src/KSPACE/pair_born_coul_msm.cpp +++ b/src/KSPACE/pair_born_coul_msm.cpp @@ -34,7 +34,7 @@ PairBornCoulMSM::PairBornCoulMSM(LAMMPS *lmp) : PairBornCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -251,5 +251,5 @@ void *PairBornCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 8d15a6480..2733bc31c 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -364,7 +364,7 @@ void PairBuckCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -372,7 +372,7 @@ void PairBuckCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -410,14 +410,14 @@ void PairBuckCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -449,13 +449,13 @@ void PairBuckCoulLong::write_restart_settings(FILE *fp) void PairBuckCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -558,5 +558,5 @@ void *PairBuckCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_msm.cpp b/src/KSPACE/pair_buck_coul_msm.cpp index 1355a2f13..87c852b5a 100644 --- a/src/KSPACE/pair_buck_coul_msm.cpp +++ b/src/KSPACE/pair_buck_coul_msm.cpp @@ -31,7 +31,7 @@ PairBuckCoulMSM::PairBuckCoulMSM(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,5 +246,5 @@ void *PairBuckCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index a845ddd1d..744232dd8 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -50,9 +50,9 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; - cut_respa = NULL; + ftable = nullptr; + fdisptable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -61,7 +61,7 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairBuckLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style buck/long/coul/long command"); @@ -177,10 +177,10 @@ void PairBuckLongCoulLong::allocate() void *PairBuckLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { - "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", NULL}; + "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { buck_c, &ewald_order, &cut_coul, &mix_flag, &cut_coul, &cut_buck_global, - NULL}; + nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -240,7 +240,7 @@ void PairBuckLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -250,7 +250,7 @@ void PairBuckLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -359,14 +359,14 @@ void PairBuckLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck_a_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck_rho_read[i][j],1,MPI_DOUBLE,0,world); @@ -399,14 +399,14 @@ void PairBuckLongCoulLong::write_restart_settings(FILE *fp) void PairBuckLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_buck_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 2520da265..68b9a8cbe 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -44,9 +44,9 @@ using namespace LAMMPS_NS; PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -242,13 +242,13 @@ void PairCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -291,10 +291,10 @@ void PairCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&scale[i][j],1,MPI_DOUBLE,0,world); } } @@ -320,11 +320,11 @@ void PairCoulLong::write_restart_settings(FILE *fp) void PairCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -393,5 +393,5 @@ void *PairCoulLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_coul_msm.cpp b/src/KSPACE/pair_coul_msm.cpp index 5d42e1f04..bf689d403 100644 --- a/src/KSPACE/pair_coul_msm.cpp +++ b/src/KSPACE/pair_coul_msm.cpp @@ -217,5 +217,5 @@ void *PairCoulMSM::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 261e93fbc..b4455ff9b 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -47,11 +47,11 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -738,11 +738,11 @@ void PairLJCharmmCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -824,14 +824,14 @@ void PairLJCharmmCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -863,13 +863,13 @@ void PairLJCharmmCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -994,5 +994,5 @@ void *PairLJCharmmCoulLong::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.cpp b/src/KSPACE/pair_lj_charmm_coul_msm.cpp index a93a1275f..fe3ce441a 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_msm.cpp @@ -35,7 +35,7 @@ PairLJCharmmCoulMSM::PairLJCharmmCoulMSM(LAMMPS *lmp) : ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -537,5 +537,5 @@ void *PairLJCharmmCoulMSM::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 9df9862c1..abc8888e5 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -51,11 +51,11 @@ PairLJCharmmfswCoulLong::PairLJCharmmfswCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; // short-range/long-range flag accessed by DihedralCharmmfsw @@ -786,11 +786,11 @@ void PairLJCharmmfswCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -872,14 +872,14 @@ void PairLJCharmmfswCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -911,13 +911,13 @@ void PairLJCharmmfswCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -1055,5 +1055,5 @@ void *PairLJCharmmfswCoulLong::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 7fd8a7255..7ae60acc8 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -51,9 +51,9 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -676,11 +676,11 @@ void PairLJCutCoulLong::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -792,13 +792,13 @@ void PairLJCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -829,13 +829,13 @@ void PairLJCutCoulLong::write_restart_settings(FILE *fp) void PairLJCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -943,5 +943,5 @@ void *PairLJCutCoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_msm.cpp b/src/KSPACE/pair_lj_cut_coul_msm.cpp index 4ebbcb9a3..00aa88152 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.cpp +++ b/src/KSPACE/pair_lj_cut_coul_msm.cpp @@ -34,7 +34,7 @@ PairLJCutCoulMSM::PairLJCutCoulMSM(LAMMPS *lmp) : PairLJCutCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -478,5 +478,5 @@ void *PairLJCutCoulMSM::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index a62c1bd55..0d7778c93 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -55,8 +55,8 @@ PairLJCutTIP4PLong::PairLJCutTIP4PLong(LAMMPS *lmp) : writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -464,9 +464,9 @@ void PairLJCutTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLong::init_style(); @@ -529,19 +529,19 @@ void PairLJCutTIP4PLong::write_restart_settings(FILE *fp) void PairLJCutTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -594,7 +594,7 @@ void *PairLJCutTIP4PLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index b6727c2c9..960a47e68 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -53,10 +53,10 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -65,7 +65,7 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/coul/long command"); @@ -176,10 +176,10 @@ void *PairLJLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_LJ", NULL}; + "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, - &cut_coul, &cut_lj_global, NULL}; + &cut_coul, &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -235,7 +235,7 @@ void PairLJLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -245,7 +245,7 @@ void PairLJLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -360,13 +360,13 @@ void PairLJLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -398,14 +398,14 @@ void PairLJLongCoulLong::write_restart_settings(FILE *fp) void PairLJLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index 8f17bda00..790e31816 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -52,8 +52,8 @@ PairLJLongTIP4PLong::PairLJLongTIP4PLong(LAMMPS *lmp) : respa_enable = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to find_M() finding bonded H atoms which are not near O atom @@ -1479,9 +1479,9 @@ void PairLJLongTIP4PLong::init_style() error->all(FLERR,"Pair style lj/long/tip4p/long requires newton pair on"); if (!atom->q_flag) error->all(FLERR,"Pair style lj/long/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJLongCoulLong::init_style(); @@ -1544,20 +1544,20 @@ void PairLJLongTIP4PLong::write_restart_settings(FILE *fp) void PairLJLongTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -1611,14 +1611,14 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "cut_coul", - "ewald_mix", "cut_LJ", NULL}; + "ewald_mix", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &cut_coul, - &mix_flag, &cut_lj_global, NULL}; + &mix_flag, &cut_lj_global, nullptr}; int i; i=0; - while (ids[i] != NULL) { + while (ids[i] != nullptr) { if (i <=2) dim = 2; else dim = 0; @@ -1627,7 +1627,7 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) ++i; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index 54973c69c..80785d355 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -51,8 +51,8 @@ PairTIP4PLong::PairTIP4PLong(LAMMPS *lmp) : PairCoulLong(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -421,9 +421,9 @@ void PairTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLong::init_style(); @@ -468,11 +468,11 @@ void PairTIP4PLong::read_restart_settings(FILE *fp) PairCoulLong::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -514,7 +514,7 @@ void *PairTIP4PLong::extract(const char *str, int &dim) if (strcmp(str,"typeA") == 0) return (void *) &typeA; if (strcmp(str,"typeB") == 0) return (void *) &typeB; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 41ffec4f3..89d308eaa 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -63,16 +63,16 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), density_brick(NULL), vdx_brick(NULL), vdy_brick(NULL), vdz_brick(NULL), - u_brick(NULL), v0_brick(NULL), v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), - v4_brick(NULL), v5_brick(NULL), greensfn(NULL), vg(NULL), fkx(NULL), fky(NULL), - fkz(NULL), density_fft(NULL), work1(NULL), work2(NULL), gf_b(NULL), rho1d(NULL), - rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), - sf_precoeff1(NULL), sf_precoeff2(NULL), sf_precoeff3(NULL), - sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), - acons(NULL), fft1(NULL), fft2(NULL), remap(NULL), gc(NULL), - gc_buf1(NULL), gc_buf2(NULL), density_A_brick(NULL), density_B_brick(NULL), density_A_fft(NULL), - density_B_fft(NULL), part2grid(NULL), boxlo(NULL) + factors(nullptr), density_brick(nullptr), vdx_brick(nullptr), vdy_brick(nullptr), vdz_brick(nullptr), + u_brick(nullptr), v0_brick(nullptr), v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), + v4_brick(nullptr), v5_brick(nullptr), greensfn(nullptr), vg(nullptr), fkx(nullptr), fky(nullptr), + fkz(nullptr), density_fft(nullptr), work1(nullptr), work2(nullptr), gf_b(nullptr), rho1d(nullptr), + rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), + acons(nullptr), fft1(nullptr), fft2(nullptr), remap(nullptr), gc(nullptr), + gc_buf1(nullptr), gc_buf2(nullptr), density_A_brick(nullptr), density_B_brick(nullptr), density_A_fft(nullptr), + density_B_fft(nullptr), part2grid(nullptr), boxlo(nullptr) { peratom_allocate_flag = 0; group_allocate_flag = 0; @@ -95,31 +95,31 @@ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), nyhi_in = nylo_in = nyhi_out = nylo_out = 0; nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; - u_brick = NULL; - v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = NULL; - greensfn = NULL; - work1 = work2 = NULL; - vg = NULL; - fkx = fky = fkz = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; + u_brick = nullptr; + v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = nullptr; + greensfn = nullptr; + work1 = work2 = nullptr; + vg = nullptr; + fkx = fky = fkz = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = - sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; - density_A_brick = density_B_brick = NULL; - density_A_fft = density_B_fft = NULL; + density_A_brick = density_B_brick = nullptr; + density_A_fft = density_B_fft = nullptr; - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - gc = NULL; - gc_buf1 = gc_buf2 = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; + gc_buf1 = gc_buf2 = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; // define acons coefficients for estimation of kspace errors // see JCP 109, pg 7698 for derivation of coefficients @@ -229,7 +229,7 @@ void PPPM::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -254,8 +254,8 @@ void PPPM::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL || - force->angle->setflag == NULL || force->bond->setflag == NULL) + if (force->angle == nullptr || force->bond == nullptr || + force->angle->setflag == nullptr || force->bond->setflag == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -292,7 +292,7 @@ void PPPM::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -867,7 +867,7 @@ void PPPM::deallocate() } memory->destroy(gf_b); - if (stagger_flag) gf_b = NULL; + if (stagger_flag) gf_b = nullptr; memory->destroy2d_offset(rho1d,-order_allocated/2); memory->destroy2d_offset(drho1d,-order_allocated/2); memory->destroy2d_offset(rho_coeff,(1-order_allocated)/2); diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index b319014c7..62f816a94 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -47,7 +47,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMCG::PPPMCG(LAMMPS *lmp) : PPPM(lmp), - is_charged(NULL) + is_charged(nullptr) { num_charged = -1; group_group_enable = 1; diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 1b7d32532..feb17e522 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -58,25 +58,25 @@ enum{FORWARD_MU,FORWARD_MU_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMDipole::PPPMDipole(LAMMPS *lmp) : PPPM(lmp), - densityx_brick_dipole(NULL), densityy_brick_dipole(NULL), - densityz_brick_dipole(NULL), - vdxx_brick_dipole(NULL), vdyy_brick_dipole(NULL), vdzz_brick_dipole(NULL), - vdxy_brick_dipole(NULL), vdxz_brick_dipole(NULL), vdyz_brick_dipole(NULL), - ux_brick_dipole(NULL), uy_brick_dipole(NULL), uz_brick_dipole(NULL), - v0x_brick_dipole(NULL), v1x_brick_dipole(NULL), - v2x_brick_dipole(NULL), v3x_brick_dipole(NULL), v4x_brick_dipole(NULL), - v5x_brick_dipole(NULL), v0y_brick_dipole(NULL), v1y_brick_dipole(NULL), - v2y_brick_dipole(NULL), v3y_brick_dipole(NULL), v4y_brick_dipole(NULL), - v5y_brick_dipole(NULL), v0z_brick_dipole(NULL), v1z_brick_dipole(NULL), - v2z_brick_dipole(NULL), v3z_brick_dipole(NULL), v4z_brick_dipole(NULL), - v5z_brick_dipole(NULL), work3(NULL), work4(NULL), - densityx_fft_dipole(NULL), densityy_fft_dipole(NULL), - densityz_fft_dipole(NULL) + densityx_brick_dipole(nullptr), densityy_brick_dipole(nullptr), + densityz_brick_dipole(nullptr), + vdxx_brick_dipole(nullptr), vdyy_brick_dipole(nullptr), vdzz_brick_dipole(nullptr), + vdxy_brick_dipole(nullptr), vdxz_brick_dipole(nullptr), vdyz_brick_dipole(nullptr), + ux_brick_dipole(nullptr), uy_brick_dipole(nullptr), uz_brick_dipole(nullptr), + v0x_brick_dipole(nullptr), v1x_brick_dipole(nullptr), + v2x_brick_dipole(nullptr), v3x_brick_dipole(nullptr), v4x_brick_dipole(nullptr), + v5x_brick_dipole(nullptr), v0y_brick_dipole(nullptr), v1y_brick_dipole(nullptr), + v2y_brick_dipole(nullptr), v3y_brick_dipole(nullptr), v4y_brick_dipole(nullptr), + v5y_brick_dipole(nullptr), v0z_brick_dipole(nullptr), v1z_brick_dipole(nullptr), + v2z_brick_dipole(nullptr), v3z_brick_dipole(nullptr), v4z_brick_dipole(nullptr), + v5z_brick_dipole(nullptr), work3(nullptr), work4(nullptr), + densityx_fft_dipole(nullptr), densityy_fft_dipole(nullptr), + densityz_fft_dipole(nullptr) { dipoleflag = 1; group_group_enable = 0; - gc_dipole = NULL; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -153,7 +153,7 @@ void PPPMDipole::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -187,7 +187,7 @@ void PPPMDipole::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index 595c25733..a3f7aa29c 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -75,10 +75,10 @@ PPPMDipoleSpin::~PPPMDipoleSpin() deallocate(); if (peratom_allocate_flag) deallocate_peratom(); - fft1 = NULL; - fft2 = NULL; - remap = NULL; - gc_dipole = NULL; + fft1 = nullptr; + fft2 = nullptr; + remap = nullptr; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -139,7 +139,7 @@ void PPPMDipoleSpin::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); // check the correct extract here - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -172,7 +172,7 @@ void PPPMDipoleSpin::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index a484751a8..a88a0892b 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -63,47 +63,47 @@ enum{FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM, /* ---------------------------------------------------------------------- */ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), csumi(NULL), cii(NULL), B(NULL), density_brick(NULL), vdx_brick(NULL), - vdy_brick(NULL), vdz_brick(NULL), density_fft(NULL), u_brick(NULL), v0_brick(NULL), - v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), v4_brick(NULL), v5_brick(NULL), - density_brick_g(NULL), vdx_brick_g(NULL), vdy_brick_g(NULL), vdz_brick_g(NULL), - density_fft_g(NULL), u_brick_g(NULL), v0_brick_g(NULL), v1_brick_g(NULL), v2_brick_g(NULL), - v3_brick_g(NULL), v4_brick_g(NULL), v5_brick_g(NULL), density_brick_a0(NULL), - vdx_brick_a0(NULL), vdy_brick_a0(NULL), vdz_brick_a0(NULL), density_fft_a0(NULL), - u_brick_a0(NULL), v0_brick_a0(NULL), v1_brick_a0(NULL), v2_brick_a0(NULL), - v3_brick_a0(NULL), v4_brick_a0(NULL), v5_brick_a0(NULL), density_brick_a1(NULL), - vdx_brick_a1(NULL), vdy_brick_a1(NULL), vdz_brick_a1(NULL), density_fft_a1(NULL), - u_brick_a1(NULL), v0_brick_a1(NULL), v1_brick_a1(NULL), v2_brick_a1(NULL), - v3_brick_a1(NULL), v4_brick_a1(NULL), v5_brick_a1(NULL), density_brick_a2(NULL), - vdx_brick_a2(NULL), vdy_brick_a2(NULL), vdz_brick_a2(NULL), density_fft_a2(NULL), - u_brick_a2(NULL), v0_brick_a2(NULL), v1_brick_a2(NULL), v2_brick_a2(NULL), - v3_brick_a2(NULL), v4_brick_a2(NULL), v5_brick_a2(NULL), density_brick_a3(NULL), - vdx_brick_a3(NULL), vdy_brick_a3(NULL), vdz_brick_a3(NULL), density_fft_a3(NULL), - u_brick_a3(NULL), v0_brick_a3(NULL), v1_brick_a3(NULL), v2_brick_a3(NULL), - v3_brick_a3(NULL), v4_brick_a3(NULL), v5_brick_a3(NULL), density_brick_a4(NULL), - vdx_brick_a4(NULL), vdy_brick_a4(NULL), vdz_brick_a4(NULL), density_fft_a4(NULL), - u_brick_a4(NULL), v0_brick_a4(NULL), v1_brick_a4(NULL), v2_brick_a4(NULL), - v3_brick_a4(NULL), v4_brick_a4(NULL), v5_brick_a4(NULL), density_brick_a5(NULL), - vdx_brick_a5(NULL), vdy_brick_a5(NULL), vdz_brick_a5(NULL), density_fft_a5(NULL), - u_brick_a5(NULL), v0_brick_a5(NULL), v1_brick_a5(NULL), v2_brick_a5(NULL), - v3_brick_a5(NULL), v4_brick_a5(NULL), v5_brick_a5(NULL), density_brick_a6(NULL), - vdx_brick_a6(NULL), vdy_brick_a6(NULL), vdz_brick_a6(NULL), density_fft_a6(NULL), - u_brick_a6(NULL), v0_brick_a6(NULL), v1_brick_a6(NULL), v2_brick_a6(NULL), - v3_brick_a6(NULL), v4_brick_a6(NULL), v5_brick_a6(NULL), density_brick_none(NULL), - vdx_brick_none(NULL), vdy_brick_none(NULL), vdz_brick_none(NULL), - density_fft_none(NULL), u_brick_none(NULL), v0_brick_none(NULL), v1_brick_none(NULL), - v2_brick_none(NULL), v3_brick_none(NULL), v4_brick_none(NULL), v5_brick_none(NULL), - greensfn(NULL), vg(NULL), vg2(NULL), greensfn_6(NULL), vg_6(NULL), vg2_6(NULL), - fkx(NULL), fky(NULL), fkz(NULL), fkx2(NULL), fky2(NULL), fkz2(NULL), fkx_6(NULL), - fky_6(NULL), fkz_6(NULL), fkx2_6(NULL), fky2_6(NULL), fkz2_6(NULL), gf_b(NULL), - gf_b_6(NULL), sf_precoeff1(NULL), sf_precoeff2(NULL), sf_precoeff3(NULL), - sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), sf_precoeff1_6(NULL), - sf_precoeff2_6(NULL), sf_precoeff3_6(NULL), sf_precoeff4_6(NULL), sf_precoeff5_6(NULL), - sf_precoeff6_6(NULL), rho1d(NULL), rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), - rho1d_6(NULL), rho_coeff_6(NULL), drho1d_6(NULL), drho_coeff_6(NULL), work1(NULL), - work2(NULL), work1_6(NULL), work2_6(NULL), fft1(NULL), fft2(NULL), fft1_6(NULL), - fft2_6(NULL), remap(NULL), remap_6(NULL), gc(NULL), gc6(NULL), - part2grid(NULL), part2grid_6(NULL), boxlo(NULL) + factors(nullptr), csumi(nullptr), cii(nullptr), B(nullptr), density_brick(nullptr), vdx_brick(nullptr), + vdy_brick(nullptr), vdz_brick(nullptr), density_fft(nullptr), u_brick(nullptr), v0_brick(nullptr), + v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), v4_brick(nullptr), v5_brick(nullptr), + density_brick_g(nullptr), vdx_brick_g(nullptr), vdy_brick_g(nullptr), vdz_brick_g(nullptr), + density_fft_g(nullptr), u_brick_g(nullptr), v0_brick_g(nullptr), v1_brick_g(nullptr), v2_brick_g(nullptr), + v3_brick_g(nullptr), v4_brick_g(nullptr), v5_brick_g(nullptr), density_brick_a0(nullptr), + vdx_brick_a0(nullptr), vdy_brick_a0(nullptr), vdz_brick_a0(nullptr), density_fft_a0(nullptr), + u_brick_a0(nullptr), v0_brick_a0(nullptr), v1_brick_a0(nullptr), v2_brick_a0(nullptr), + v3_brick_a0(nullptr), v4_brick_a0(nullptr), v5_brick_a0(nullptr), density_brick_a1(nullptr), + vdx_brick_a1(nullptr), vdy_brick_a1(nullptr), vdz_brick_a1(nullptr), density_fft_a1(nullptr), + u_brick_a1(nullptr), v0_brick_a1(nullptr), v1_brick_a1(nullptr), v2_brick_a1(nullptr), + v3_brick_a1(nullptr), v4_brick_a1(nullptr), v5_brick_a1(nullptr), density_brick_a2(nullptr), + vdx_brick_a2(nullptr), vdy_brick_a2(nullptr), vdz_brick_a2(nullptr), density_fft_a2(nullptr), + u_brick_a2(nullptr), v0_brick_a2(nullptr), v1_brick_a2(nullptr), v2_brick_a2(nullptr), + v3_brick_a2(nullptr), v4_brick_a2(nullptr), v5_brick_a2(nullptr), density_brick_a3(nullptr), + vdx_brick_a3(nullptr), vdy_brick_a3(nullptr), vdz_brick_a3(nullptr), density_fft_a3(nullptr), + u_brick_a3(nullptr), v0_brick_a3(nullptr), v1_brick_a3(nullptr), v2_brick_a3(nullptr), + v3_brick_a3(nullptr), v4_brick_a3(nullptr), v5_brick_a3(nullptr), density_brick_a4(nullptr), + vdx_brick_a4(nullptr), vdy_brick_a4(nullptr), vdz_brick_a4(nullptr), density_fft_a4(nullptr), + u_brick_a4(nullptr), v0_brick_a4(nullptr), v1_brick_a4(nullptr), v2_brick_a4(nullptr), + v3_brick_a4(nullptr), v4_brick_a4(nullptr), v5_brick_a4(nullptr), density_brick_a5(nullptr), + vdx_brick_a5(nullptr), vdy_brick_a5(nullptr), vdz_brick_a5(nullptr), density_fft_a5(nullptr), + u_brick_a5(nullptr), v0_brick_a5(nullptr), v1_brick_a5(nullptr), v2_brick_a5(nullptr), + v3_brick_a5(nullptr), v4_brick_a5(nullptr), v5_brick_a5(nullptr), density_brick_a6(nullptr), + vdx_brick_a6(nullptr), vdy_brick_a6(nullptr), vdz_brick_a6(nullptr), density_fft_a6(nullptr), + u_brick_a6(nullptr), v0_brick_a6(nullptr), v1_brick_a6(nullptr), v2_brick_a6(nullptr), + v3_brick_a6(nullptr), v4_brick_a6(nullptr), v5_brick_a6(nullptr), density_brick_none(nullptr), + vdx_brick_none(nullptr), vdy_brick_none(nullptr), vdz_brick_none(nullptr), + density_fft_none(nullptr), u_brick_none(nullptr), v0_brick_none(nullptr), v1_brick_none(nullptr), + v2_brick_none(nullptr), v3_brick_none(nullptr), v4_brick_none(nullptr), v5_brick_none(nullptr), + greensfn(nullptr), vg(nullptr), vg2(nullptr), greensfn_6(nullptr), vg_6(nullptr), vg2_6(nullptr), + fkx(nullptr), fky(nullptr), fkz(nullptr), fkx2(nullptr), fky2(nullptr), fkz2(nullptr), fkx_6(nullptr), + fky_6(nullptr), fkz_6(nullptr), fkx2_6(nullptr), fky2_6(nullptr), fkz2_6(nullptr), gf_b(nullptr), + gf_b_6(nullptr), sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), sf_precoeff1_6(nullptr), + sf_precoeff2_6(nullptr), sf_precoeff3_6(nullptr), sf_precoeff4_6(nullptr), sf_precoeff5_6(nullptr), + sf_precoeff6_6(nullptr), rho1d(nullptr), rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + rho1d_6(nullptr), rho_coeff_6(nullptr), drho1d_6(nullptr), drho_coeff_6(nullptr), work1(nullptr), + work2(nullptr), work1_6(nullptr), work2_6(nullptr), fft1(nullptr), fft2(nullptr), fft1_6(nullptr), + fft2_6(nullptr), remap(nullptr), remap_6(nullptr), gc(nullptr), gc6(nullptr), + part2grid(nullptr), part2grid_6(nullptr), boxlo(nullptr) { triclinic_support = 0; pppmflag = dispersionflag = 1; @@ -125,98 +125,98 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), nzhi_in_6 = nzlo_in_6 = nzhi_out_6 = nzlo_out_6 = 0; csumflag = 0; - B = NULL; - cii = NULL; - csumi = NULL; + B = nullptr; + cii = nullptr; + csumi = nullptr; peratom_allocate_flag = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; u_brick = v0_brick = v1_brick = v2_brick = v3_brick = - v4_brick = v5_brick = NULL; + v4_brick = v5_brick = nullptr; - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = v3_brick_g = - v4_brick_g = v5_brick_g = NULL; + v4_brick_g = v5_brick_g = nullptr; - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = v3_brick_a0 = - v4_brick_a0 = v5_brick_a0 = NULL; + v4_brick_a0 = v5_brick_a0 = nullptr; - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = v3_brick_a1 = - v4_brick_a1 = v5_brick_a1 = NULL; + v4_brick_a1 = v5_brick_a1 = nullptr; - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = - v4_brick_a2 = v5_brick_a2 = NULL; + v4_brick_a2 = v5_brick_a2 = nullptr; - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = - v4_brick_a3 = v5_brick_a3 = NULL; + v4_brick_a3 = v5_brick_a3 = nullptr; - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = v3_brick_a4 = - v4_brick_a4 = v5_brick_a4 = NULL; + v4_brick_a4 = v5_brick_a4 = nullptr; - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = v3_brick_a5 = - v4_brick_a5 = v5_brick_a5 = NULL; + v4_brick_a5 = v5_brick_a5 = nullptr; - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = v3_brick_a6 = - v4_brick_a6 = v5_brick_a6 = NULL; + v4_brick_a6 = v5_brick_a6 = nullptr; - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = v3_brick_none = - v4_brick_none = v5_brick_none = NULL; - - greensfn = NULL; - greensfn_6 = NULL; - work1 = work2 = NULL; - work1_6 = work2_6 = NULL; - vg = NULL; - vg2 = NULL; - vg_6 = NULL; - vg2_6 = NULL; - fkx = fky = fkz = NULL; - fkx2 = fky2 = fkz2 = NULL; - fkx_6 = fky_6 = fkz_6 = NULL; - fkx2_6 = fky2_6 = fkz2_6 = NULL; + v4_brick_none = v5_brick_none = nullptr; + + greensfn = nullptr; + greensfn_6 = nullptr; + work1 = work2 = nullptr; + work1_6 = work2_6 = nullptr; + vg = nullptr; + vg2 = nullptr; + vg_6 = nullptr; + vg2_6 = nullptr; + fkx = fky = fkz = nullptr; + fkx2 = fky2 = fkz2 = nullptr; + fkx_6 = fky_6 = fkz_6 = nullptr; + fkx2_6 = fky2_6 = fkz2_6 = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = sf_precoeff4 = - sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff5 = sf_precoeff6 = nullptr; sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = sf_precoeff4_6 = - sf_precoeff5_6 = sf_precoeff6_6 = NULL; - - gf_b = NULL; - gf_b_6 = NULL; - rho1d = rho_coeff = NULL; - drho1d = drho_coeff = NULL; - rho1d_6 = rho_coeff_6 = NULL; - drho1d_6 = drho_coeff_6 = NULL; - fft1 = fft2 = NULL; - fft1_6 = fft2_6 = NULL; - remap = NULL; - remap_6 = NULL; - gc = gc6 = NULL; - gc_buf1 = gc_buf2 = NULL; - gc6_buf1 = gc6_buf2 = NULL; + sf_precoeff5_6 = sf_precoeff6_6 = nullptr; + + gf_b = nullptr; + gf_b_6 = nullptr; + rho1d = rho_coeff = nullptr; + drho1d = drho_coeff = nullptr; + rho1d_6 = rho_coeff_6 = nullptr; + drho1d_6 = drho_coeff_6 = nullptr; + fft1 = fft2 = nullptr; + fft1_6 = fft2_6 = nullptr; + remap = nullptr; + remap_6 = nullptr; + gc = gc6 = nullptr; + gc_buf1 = gc_buf2 = nullptr; + gc6_buf1 = gc6_buf2 = nullptr; ngc_buf1 = ngc_buf2 = ngc6_buf1 = ngc6_buf2 = 0; ngrid = ngrid_6 = npergrid = npergrid6 = 0; nmax = 0; - part2grid = NULL; - part2grid_6 = NULL; + part2grid = nullptr; + part2grid_6 = nullptr; memset(function,0,EWALD_FUNCS*sizeof(int)); } @@ -237,16 +237,16 @@ PPPMDisp::~PPPMDisp() { delete [] factors; delete [] B; - B = NULL; + B = nullptr; delete [] cii; - cii = NULL; + cii = nullptr; delete [] csumi; - csumi = NULL; + csumi = nullptr; deallocate(); deallocate_peratom(); memory->destroy(part2grid); memory->destroy(part2grid_6); - part2grid = part2grid_6 = NULL; + part2grid = part2grid_6 = nullptr; } /* ---------------------------------------------------------------------- @@ -295,9 +295,9 @@ void PPPMDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; - double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; + double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : nullptr; if (!(ptr||p_cutoff||p_cutoff_lj)) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -377,7 +377,7 @@ void PPPMDisp::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL) + if (force->angle == nullptr || force->bond == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -411,7 +411,7 @@ void PPPMDisp::init() int iteration = 0; if (function[0]) { - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; while (order >= minorder) { if (iteration && me == 0) @@ -492,7 +492,7 @@ void PPPMDisp::init() iteration = 0; if (function[1] + function[2] + function[3]) { - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; while (order_6 >= minorder) { if (iteration && me == 0) @@ -1281,14 +1281,14 @@ void PPPMDisp::init_coeffs() // local pair coeffs int n = atom->ntypes; int converged; delete [] B; - B = NULL; + B = nullptr; if (function[3] + function[2]) { // no mixing rule or arithmetic if (function[2] && me == 0) utils::logmesg(lmp," Optimizing splitting of Dispersion coefficients\n"); // allocate data for eigenvalue decomposition - double **A=NULL; - double **Q=NULL; + double **A=nullptr; + double **Q=nullptr; if ( n > 1 ) { // get dispersion coefficients double **b = (double **) force->pair->extract("B",tmp); @@ -2299,80 +2299,80 @@ void PPPMDisp::deallocate() memory->destroy3d_offset(vdy_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy3d_offset(vdz_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy(density_fft); - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; memory->destroy3d_offset(density_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_g); - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; memory->destroy3d_offset(density_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a0); - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; memory->destroy3d_offset(density_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a1); - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; memory->destroy3d_offset(density_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a2); - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; memory->destroy3d_offset(density_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a3); - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; memory->destroy3d_offset(density_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a4); - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; memory->destroy3d_offset(density_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a5); - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; memory->destroy3d_offset(density_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a6); - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; memory->destroy4d_offset(density_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdx_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdy_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdz_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_none); - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; memory->destroy(sf_precoeff1); memory->destroy(sf_precoeff2); @@ -2381,7 +2381,7 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff5); memory->destroy(sf_precoeff6); sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = - sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; memory->destroy(sf_precoeff1_6); memory->destroy(sf_precoeff2_6); @@ -2390,7 +2390,7 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff5_6); memory->destroy(sf_precoeff6_6); sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = - sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = NULL; + sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = nullptr; memory->destroy(greensfn); memory->destroy(greensfn_6); @@ -2402,45 +2402,45 @@ void PPPMDisp::deallocate() memory->destroy(vg2); memory->destroy(vg_6); memory->destroy(vg2_6); - greensfn = greensfn_6 = NULL; - work1 = work2 = work1_6 = work2_6 = NULL; - vg = vg2 = vg_6 = vg2_6 = NULL; + greensfn = greensfn_6 = nullptr; + work1 = work2 = work1_6 = work2_6 = nullptr; + vg = vg2 = vg_6 = vg2_6 = nullptr; memory->destroy1d_offset(fkx,nxlo_fft); memory->destroy1d_offset(fky,nylo_fft); memory->destroy1d_offset(fkz,nzlo_fft); - fkx = fky = fkz = NULL; + fkx = fky = fkz = nullptr; memory->destroy1d_offset(fkx2,nxlo_fft); memory->destroy1d_offset(fky2,nylo_fft); memory->destroy1d_offset(fkz2,nzlo_fft); - fkx2 = fky2 = fkz2 = NULL; + fkx2 = fky2 = fkz2 = nullptr; memory->destroy1d_offset(fkx_6,nxlo_fft_6); memory->destroy1d_offset(fky_6,nylo_fft_6); memory->destroy1d_offset(fkz_6,nzlo_fft_6); - fkx_6 = fky_6 = fkz_6 = NULL; + fkx_6 = fky_6 = fkz_6 = nullptr; memory->destroy1d_offset(fkx2_6,nxlo_fft_6); memory->destroy1d_offset(fky2_6,nylo_fft_6); memory->destroy1d_offset(fkz2_6,nzlo_fft_6); - fkx2_6 = fky2_6 = fkz2_6 = NULL; + fkx2_6 = fky2_6 = fkz2_6 = nullptr; memory->destroy(gf_b); memory->destroy2d_offset(rho1d,-order/2); memory->destroy2d_offset(rho_coeff,(1-order)/2); memory->destroy2d_offset(drho1d,-order/2); memory->destroy2d_offset(drho_coeff, (1-order)/2); - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; memory->destroy(gf_b_6); memory->destroy2d_offset(rho1d_6,-order_6/2); memory->destroy2d_offset(rho_coeff_6,(1-order_6)/2); memory->destroy2d_offset(drho1d_6,-order_6/2); memory->destroy2d_offset(drho_coeff_6,(1-order_6)/2); - gf_b_6 = NULL; - rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = NULL; + gf_b_6 = nullptr; + rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = nullptr; memory->destroy(gc_buf1); memory->destroy(gc_buf2); @@ -2474,7 +2474,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick, nzlo_out, nylo_out, nxlo_out); memory->destroy3d_offset(v5_brick, nzlo_out, nylo_out, nxlo_out); u_brick = v0_brick = v1_brick = v2_brick = - v3_brick = v4_brick = v5_brick = NULL; + v3_brick = v4_brick = v5_brick = nullptr; memory->destroy3d_offset(u_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2484,7 +2484,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = - v3_brick_g = v4_brick_g = v5_brick_g = NULL; + v3_brick_g = v4_brick_g = v5_brick_g = nullptr; memory->destroy3d_offset(u_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2494,7 +2494,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = - v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = NULL; + v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = nullptr; memory->destroy3d_offset(u_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2504,7 +2504,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = - v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = NULL; + v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = nullptr; memory->destroy3d_offset(u_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2513,7 +2513,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = NULL; + u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = nullptr; memory->destroy3d_offset(u_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2522,7 +2522,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = NULL; + u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = nullptr; memory->destroy3d_offset(u_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2532,7 +2532,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = - v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = NULL; + v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = nullptr; memory->destroy3d_offset(u_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2542,7 +2542,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = - v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = NULL; + v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = nullptr; memory->destroy3d_offset(u_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2552,7 +2552,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = - v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = NULL; + v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = nullptr; memory->destroy4d_offset(u_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v0_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2562,7 +2562,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy4d_offset(v4_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v5_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = - v3_brick_none = v4_brick_none = v5_brick_none = NULL; + v3_brick_none = v4_brick_none = v5_brick_none = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp index f71529ae8..afdc97e37 100644 --- a/src/KSPACE/pppm_stagger.cpp +++ b/src/KSPACE/pppm_stagger.cpp @@ -50,7 +50,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; PPPMStagger::PPPMStagger(LAMMPS *lmp) : PPPM(lmp), - gf_b2(NULL) + gf_b2(nullptr) { stagger_flag = 1; group_group_enable = 0; diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index d4cfdea2b..41ba1a678 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -252,7 +252,7 @@ struct remap_plan_3d *remap_3d_create_plan( // allocate memory for plan data struct plan = (struct remap_plan_3d *) malloc(sizeof(struct remap_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; // store parameters in local data structs @@ -284,10 +284,10 @@ struct remap_plan_3d *remap_3d_create_plan( // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -313,8 +313,8 @@ struct remap_plan_3d *remap_3d_create_plan( plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -395,9 +395,9 @@ struct remap_plan_3d *remap_3d_create_plan( plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -456,7 +456,7 @@ struct remap_plan_3d *remap_3d_create_plan( // create sub-comm rank list if (plan->usecollective) { - plan->commringlist = NULL; + plan->commringlist = nullptr; // merge recv and send rank lists // ask Steve Plimpton about method to more accurately determine @@ -578,7 +578,7 @@ struct remap_plan_3d *remap_3d_create_plan( // find biggest send message (not including self) and malloc space for it - plan->sendbuf = NULL; + plan->sendbuf = nullptr; size = 0; for (nsend = 0; nsend < plan->nsend; nsend++) @@ -586,20 +586,20 @@ struct remap_plan_3d *remap_3d_create_plan( if (size) { plan->sendbuf = (FFT_SCALAR *) malloc(size*sizeof(FFT_SCALAR)); - if (plan->sendbuf == NULL) return NULL; + if (plan->sendbuf == nullptr) return nullptr; } // if requested, allocate internal scratch space for recvs, // only need it if I will receive any data (including self) - plan->scratch = NULL; + plan->scratch = nullptr; if (memory == 1) { if (nrecv > 0) { plan->scratch = (FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize * sizeof(FFT_SCALAR)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } } @@ -643,7 +643,7 @@ void remap_3d_destroy_plan(struct remap_plan_3d *plan) MPI_Comm_free(&plan->comm); if (plan->usecollective) { - if (plan->commringlist != NULL) + if (plan->commringlist != nullptr) free(plan->commringlist); } diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp index 4aaaa1329..de8533947 100644 --- a/src/KSPACE/remap_wrap.cpp +++ b/src/KSPACE/remap_wrap.cpp @@ -31,7 +31,7 @@ Remap::Remap(LAMMPS *lmp, MPI_Comm comm, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 7d4e89272..0581f1e35 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,10 +74,10 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // NULL means LATTE will compute Coulombic potential + // nullptr means LATTE will compute Coulombic potential coulomb = 0; - id_pe = NULL; + id_pe = nullptr; if (strcmp(arg[3],"NULL") != 0) { coulomb = 1; @@ -97,8 +97,8 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : // initializations nmax = 0; - qpotential = NULL; - flatte = NULL; + qpotential = nullptr; + flatte = nullptr; latte_energy = 0.0; } @@ -136,7 +136,7 @@ void FixLatte::init() error->all(FLERR,"Fix latte requires 3d problem"); if (coulomb) { - if (atom->q_flag == 0 || force->pair == NULL || force->kspace == NULL) + if (atom->q_flag == 0 || force->pair == nullptr || force->kspace == nullptr) error->all(FLERR,"Fix latte cannot compute Coulomb potential"); int ipe = modify->find_compute(id_pe); @@ -154,7 +154,7 @@ void FixLatte::init() // create qpotential & flatte if needed // for now, assume nlocal will never change - if (coulomb && qpotential == NULL) { + if (coulomb && qpotential == nullptr) { memory->create(qpotential,atom->nlocal,"latte:qpotential"); memory->create(flatte,atom->nlocal,3,"latte:flatte"); } diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 54169d08d..bddec9e2e 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -39,7 +39,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), comb(NULL), comb3(NULL), qf(NULL), q1(NULL), q2(NULL) + fp(nullptr), comb(nullptr), comb3(nullptr), qf(nullptr), q1(nullptr), q2(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command"); @@ -65,7 +65,7 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,std::string("Cannot open fix qeq/comb file ") + arg[iarg+1]); } @@ -85,8 +85,8 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) qf[i] = 0.0; - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; comm_forward = 1; } @@ -121,7 +121,7 @@ void FixQEQComb::init() comb = (PairComb *) force->pair_match("^comb",0); comb3 = (PairComb3 *) force->pair_match("^comb3",0); - if (comb == NULL && comb3 == NULL) + if (comb == nullptr && comb3 == nullptr) error->all(FLERR,"Must use pair_style comb or comb3 with fix qeq/comb"); if (utils::strmatch(update->integrate_style,"^respa")) { diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index ff30ac7b1..4eeab8938 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -41,25 +41,25 @@ PairADP::PairADP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nmax = 0; - rho = NULL; - fp = NULL; - mu = NULL; - lambda = NULL; - map = NULL; - - setfl = NULL; - - frho = NULL; - rhor = NULL; - z2r = NULL; - u2r = NULL; - w2r = NULL; - - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; - u2r_spline = NULL; - w2r_spline = NULL; + rho = nullptr; + fp = nullptr; + mu = nullptr; + lambda = nullptr; + map = nullptr; + + setfl = nullptr; + + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + u2r = nullptr; + w2r = nullptr; + + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; + u2r_spline = nullptr; + w2r_spline = nullptr; // set comm size needed by this Pair @@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 7ab2eaa27..8643f5481 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -61,13 +61,13 @@ PairAIREBO::PairAIREBO(LAMMPS *lmp) pvector = new double[nextra]; maxlocal = 0; - REBO_numneigh = NULL; - REBO_firstneigh = NULL; - ipage = NULL; + REBO_numneigh = nullptr; + REBO_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - nC = nH = NULL; - map = NULL; + nC = nH = nullptr; + map = nullptr; manybody_flag = 1; sigwid = 0.84; @@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to C and H - // map[i] = which element (0,1) the Ith atom type is, -1 if NULL + // map[i] = which element (0,1) the Ith atom type is, -1 if nullptr for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -245,7 +245,7 @@ void PairAIREBO::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index ab02533ce..d605ddc2d 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -40,7 +40,7 @@ class PairAIREBO : public Pair { enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code protected: - int *map; // 0 (C), 1 (H), or -1 (NULL) for each type + int *map; // 0 (C), 1 (H), or -1 (nullptr) for each type int variant; int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index 2a69e70b8..a6bf0ac40 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -311,10 +311,10 @@ void PairATM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) for (k = j; k <= atom->ntypes; k++) { - if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&nu[i][j][k],1,MPI_DOUBLE,0,world); } } @@ -339,8 +339,8 @@ void PairATM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_triple,1,MPI_DOUBLE,0,world); diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index e7c2f6467..4c7d30e45 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -64,114 +64,114 @@ PairBOP::PairBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; allocated = 0; - BOP_index = NULL; - BOP_index3 = NULL; - BOP_total = NULL; - BOP_total3 = NULL; - map = NULL; - pi_a = NULL; - pro_delta = NULL; - pi_delta = NULL; - pi_p = NULL; - pi_c = NULL; - r1 = NULL; - sigma_r0 = NULL; - pi_r0 = NULL; - phi_r0 = NULL; - sigma_rc = NULL; - pi_rc = NULL; - phi_rc = NULL; - sigma_beta0 = NULL; - pi_beta0 = NULL; - phi0 = NULL; - sigma_n = NULL; - pi_n = NULL; - phi_m = NULL; - sigma_nc = NULL; - pi_nc = NULL; - phi_nc = NULL; - pro = NULL; - sigma_delta = NULL; - sigma_c = NULL; - sigma_a = NULL; - sigma_f = NULL; - sigma_k = NULL; - small3 = NULL; - rcut = NULL; - rcut3 = NULL; - rcutsq = NULL; - rcutsq3 = NULL; - dr = NULL; - rdr = NULL; - dr3 = NULL; - rdr3 = NULL; - disij = NULL; - rij = NULL; - neigh_index = NULL; - neigh_index3 = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - cosAng = NULL; - betaS = NULL; - dBetaS = NULL; - betaP = NULL; - dBetaP = NULL; - repul = NULL; - dRepul = NULL; - itypeSigBk = NULL; - itypePiBk = NULL; - pBetaS = NULL; - pBetaS1 = NULL; - pBetaS2 = NULL; - pBetaS3 = NULL; - pBetaS4 = NULL; - pBetaS5 = NULL; - pBetaS6 = NULL; - pLong = NULL; - pLong1 = NULL; - pLong2 = NULL; - pLong3 = NULL; - pLong4 = NULL; - pLong5 = NULL; - pLong6 = NULL; - pBetaP = NULL; - pBetaP1 = NULL; - pBetaP2 = NULL; - pBetaP3 = NULL; - pBetaP4 = NULL; - pBetaP5 = NULL; - pBetaP6 = NULL; - pRepul = NULL; - pRepul1 = NULL; - pRepul2 = NULL; - pRepul3 = NULL; - pRepul4 = NULL; - pRepul5 = NULL; - pRepul6 = NULL; - FsigBO = NULL; - FsigBO1 = NULL; - FsigBO2 = NULL; - FsigBO3 = NULL; - FsigBO4 = NULL; - FsigBO5 = NULL; - FsigBO6 = NULL; - rcmin = NULL; - rcmax = NULL; - rcmaxp = NULL; - setflag = NULL; - cutsq = NULL; - cutghost = NULL; - - gfunc = NULL; - gfunc1 = NULL; - gfunc2 = NULL; - gfunc3 = NULL; - gfunc4 = NULL; - gfunc5 = NULL; - gfunc6 = NULL; - gpara = NULL; - bt_sg=NULL; - bt_pi=NULL; + BOP_index = nullptr; + BOP_index3 = nullptr; + BOP_total = nullptr; + BOP_total3 = nullptr; + map = nullptr; + pi_a = nullptr; + pro_delta = nullptr; + pi_delta = nullptr; + pi_p = nullptr; + pi_c = nullptr; + r1 = nullptr; + sigma_r0 = nullptr; + pi_r0 = nullptr; + phi_r0 = nullptr; + sigma_rc = nullptr; + pi_rc = nullptr; + phi_rc = nullptr; + sigma_beta0 = nullptr; + pi_beta0 = nullptr; + phi0 = nullptr; + sigma_n = nullptr; + pi_n = nullptr; + phi_m = nullptr; + sigma_nc = nullptr; + pi_nc = nullptr; + phi_nc = nullptr; + pro = nullptr; + sigma_delta = nullptr; + sigma_c = nullptr; + sigma_a = nullptr; + sigma_f = nullptr; + sigma_k = nullptr; + small3 = nullptr; + rcut = nullptr; + rcut3 = nullptr; + rcutsq = nullptr; + rcutsq3 = nullptr; + dr = nullptr; + rdr = nullptr; + dr3 = nullptr; + rdr3 = nullptr; + disij = nullptr; + rij = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + cosAng = nullptr; + betaS = nullptr; + dBetaS = nullptr; + betaP = nullptr; + dBetaP = nullptr; + repul = nullptr; + dRepul = nullptr; + itypeSigBk = nullptr; + itypePiBk = nullptr; + pBetaS = nullptr; + pBetaS1 = nullptr; + pBetaS2 = nullptr; + pBetaS3 = nullptr; + pBetaS4 = nullptr; + pBetaS5 = nullptr; + pBetaS6 = nullptr; + pLong = nullptr; + pLong1 = nullptr; + pLong2 = nullptr; + pLong3 = nullptr; + pLong4 = nullptr; + pLong5 = nullptr; + pLong6 = nullptr; + pBetaP = nullptr; + pBetaP1 = nullptr; + pBetaP2 = nullptr; + pBetaP3 = nullptr; + pBetaP4 = nullptr; + pBetaP5 = nullptr; + pBetaP6 = nullptr; + pRepul = nullptr; + pRepul1 = nullptr; + pRepul2 = nullptr; + pRepul3 = nullptr; + pRepul4 = nullptr; + pRepul5 = nullptr; + pRepul6 = nullptr; + FsigBO = nullptr; + FsigBO1 = nullptr; + FsigBO2 = nullptr; + FsigBO3 = nullptr; + FsigBO4 = nullptr; + FsigBO5 = nullptr; + FsigBO6 = nullptr; + rcmin = nullptr; + rcmax = nullptr; + rcmaxp = nullptr; + setflag = nullptr; + cutsq = nullptr; + cutghost = nullptr; + + gfunc = nullptr; + gfunc1 = nullptr; + gfunc2 = nullptr; + gfunc3 = nullptr; + gfunc4 = nullptr; + gfunc5 = nullptr; + gfunc6 = nullptr; + gpara = nullptr; + bt_sg=nullptr; + bt_pi=nullptr; } /* ---------------------------------------------------------------------- @@ -5627,12 +5627,12 @@ void PairBOP::memory_theta_destroy() memory->destroy(neigh_flag3); memory->destroy(neigh_index); memory->destroy(neigh_index3); - itypeSigBk = NULL; - itypePiBk = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - neigh_index = NULL; - neigh_index3 = NULL; + itypeSigBk = nullptr; + itypePiBk = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; if(otfly==0) { memory->destroy(cosAng); memory->destroy(dcAng); @@ -5680,7 +5680,7 @@ void PairBOP::grow_pi(int n1, int n2) } } memory->destroy(bt_pi); - bt_pi=NULL; + bt_pi=nullptr; bt_pi = (B_PI *) memory->smalloc(n2*sizeof(B_PI),"BOP:bt_pi"); for(i=0;idestroy(bt_sg); - bt_sg=NULL; + bt_sg=nullptr; bt_sg = (B_SG *) memory->smalloc(n2*sizeof(B_SG),"BOP:bt_sg"); for(i=0;iall(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -465,7 +465,7 @@ void PairComb::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -542,7 +542,7 @@ void PairComb::init_style() //for (i = 0; i < modify->nfix; i++) // if (strcmp(modify->fix[i]->style,"qeq") == 0) break; //if (i < modify->nfix) fixqeq = (FixQEQ *) modify->fix[i]; - //else fixqeq = NULL; + //else fixqeq = nullptr; // need a full neighbor list @@ -554,7 +554,7 @@ void PairComb::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 265d30c6f..fd4f1b382 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -54,38 +54,38 @@ PairComb3::PairComb3(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nmax = 0; - NCo = NULL; - bbij = NULL; - map = NULL; - esm = NULL; + NCo = nullptr; + bbij = nullptr; + map = nullptr; + esm = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; - - intype = NULL; - afb = NULL; - dafb = NULL; - fafb = NULL; - dfafb = NULL; - ddfafb = NULL; - phin = NULL; - dphin = NULL; - erpaw = NULL; - vvdw = NULL; - vdvdw = NULL; - dpl = NULL; - xcctmp = NULL; - xchtmp = NULL; - xcotmp = NULL; - - sht_num = NULL; - sht_first = NULL; - - ipage = NULL; + params = nullptr; + elem2param = nullptr; + + intype = nullptr; + afb = nullptr; + dafb = nullptr; + fafb = nullptr; + dfafb = nullptr; + ddfafb = nullptr; + phin = nullptr; + dphin = nullptr; + erpaw = nullptr; + vvdw = nullptr; + vdvdw = nullptr; + dpl = nullptr; + xcctmp = nullptr; + xchtmp = nullptr; + xcotmp = nullptr; + + sht_num = nullptr; + sht_first = nullptr; + + ipage = nullptr; pgsize = oneatom = 0; cflag = 0; @@ -192,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -201,7 +201,7 @@ void PairComb3::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -277,7 +277,7 @@ void PairComb3::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 999384ea2..ac96c040b 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -46,26 +46,26 @@ PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nmax = 0; - rho = NULL; - fp = NULL; - numforce = NULL; - map = NULL; - type2frho = NULL; + rho = nullptr; + fp = nullptr; + numforce = nullptr; + map = nullptr; + type2frho = nullptr; nfuncfl = 0; - funcfl = NULL; + funcfl = nullptr; - setfl = NULL; - fs = NULL; + setfl = nullptr; + fs = nullptr; - frho = NULL; - rhor = NULL; - z2r = NULL; - scale = NULL; + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + scale = nullptr; - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; // set comm size needed by this Pair @@ -90,8 +90,8 @@ PairEAM::~PairEAM() memory->destroy(cutsq); delete [] map; delete [] type2frho; - map = NULL; - type2frho = NULL; + map = nullptr; + type2frho = nullptr; memory->destroy(type2rhor); memory->destroy(type2z2r); memory->destroy(scale); @@ -105,7 +105,7 @@ PairEAM::~PairEAM() memory->destroy(funcfl[i].zr); } memory->sfree(funcfl); - funcfl = NULL; + funcfl = nullptr; } if (setfl) { @@ -116,7 +116,7 @@ PairEAM::~PairEAM() memory->destroy(setfl->rhor); memory->destroy(setfl->z2r); delete setfl; - setfl = NULL; + setfl = nullptr; } if (fs) { @@ -127,7 +127,7 @@ PairEAM::~PairEAM() memory->destroy(fs->rhor); memory->destroy(fs->z2r); delete fs; - fs = NULL; + fs = nullptr; } memory->destroy(frho); @@ -937,5 +937,5 @@ void *PairEAM::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index d30f46aa3..055a2baf1 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -70,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index dc36c7327..01ec02dd2 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -44,9 +44,9 @@ PairEAMCD::PairEAMCD(LAMMPS *lmp, int _cdeamVersion) restartinfo = 0; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - rhoB = NULL; - D_values = NULL; - hcoeff = NULL; + rhoB = nullptr; + D_values = nullptr; + hcoeff = nullptr; // Set communication buffer sizes needed by this pair style. @@ -505,14 +505,14 @@ void PairEAMCD::read_h_coeff(char *filename) char nextline[MAXLINE]; int convert_flag = unit_convert_flag; fptr = utils::open_potential(filename, lmp, &convert_flag); - if (fptr == NULL) + if (fptr == nullptr) error->one(FLERR,fmt::format("Cannot open EAMCD potential file {}", filename)); // h coefficients are stored at the end of the file. // Skip to last line of file. - while(fgets(nextline, MAXLINE, fptr) != NULL) { + while(fgets(nextline, MAXLINE, fptr) != nullptr) { strcpy(line, nextline); } diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index ee84fb09c..8f306d101 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -49,7 +49,7 @@ public: /// Reports the memory usage of this pair style to LAMMPS. double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. void read_h_coeff(char* filename); diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index dd45d12da..90c24bb25 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -70,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index cb5a95faa..69e2832b3 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -41,25 +41,25 @@ PairEIM::PairEIM(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - setfl = NULL; + setfl = nullptr; nmax = 0; - rho = NULL; - fp = NULL; - map = NULL; + rho = nullptr; + fp = nullptr; + map = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; - negativity = NULL; - q0 = NULL; - cutforcesq = NULL; - Fij = NULL; - Gij = NULL; - phiij = NULL; + negativity = nullptr; + q0 = nullptr; + cutforcesq = nullptr; + Fij = nullptr; + Gij = nullptr; + phiij = nullptr; - Fij_spline = NULL; - Gij_spline = NULL; - phiij_spline = NULL; + Fij_spline = nullptr; + Gij_spline = nullptr; + phiij_spline = nullptr; // set comm size needed by this Pair @@ -388,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg) read_file(arg[2+nelements]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3 + nelements; i < narg; i++) { m = i - (3+nelements) + 1; @@ -1062,7 +1062,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp, FILE *fp = utils::open_potential(filename, lmp, &unit_convert); conversion_factor = utils::get_conversion_factor(utils::ENERGY,unit_convert); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR, fmt::format("cannot open eim potential file {}", filename)); } diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index 051c30f87..dd9b55b7b 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -51,11 +51,11 @@ PairGW::PairGW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -292,7 +292,7 @@ void PairGW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -370,7 +370,7 @@ double PairGW::init_one(int i, int j) void PairGW::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 diff --git a/src/MANYBODY/pair_gw_zbl.cpp b/src/MANYBODY/pair_gw_zbl.cpp index ee3bebda1..69c677d0c 100644 --- a/src/MANYBODY/pair_gw_zbl.cpp +++ b/src/MANYBODY/pair_gw_zbl.cpp @@ -61,7 +61,7 @@ PairGWZBL::PairGWZBL(LAMMPS *lmp) : PairGW(lmp) void PairGWZBL::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index d2e478b37..c84361d7a 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -48,13 +48,13 @@ PairLCBOP::PairLCBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - N = NULL; - M = NULL; + N = nullptr; + M = nullptr; } /* ---------------------------------------------------------------------- @@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg) if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // read args that map atom types to C and NULL - // map[i] = which element (0 for C) the Ith atom type is, -1 if NULL + // read args that map atom types to C and nullptr + // map[i] = which element (0 for C) the Ith atom type is, -1 if nullptr for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -193,7 +193,7 @@ void PairLCBOP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -970,7 +970,7 @@ void PairLCBOP::read_file(char *filename) if (me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open LCBOP potential file %s",filename); error->one(FLERR,str); diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index c7a7fab46..9ca2e3d55 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -39,7 +39,7 @@ class PairLCBOP : public Pair { protected: int **pages; // neighbor list pages - int *map; // 0 (C) or -1 (NULL) for each type + int *map; // 0 (C) or -1 (nullptr) for each type int me; diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index 0a197a157..a361955fa 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -50,11 +50,11 @@ PairNb3bHarmonic::PairNb3bHarmonic(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -207,7 +207,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index 0f7fd7a1c..cdf9a7f23 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -479,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -909,7 +909,7 @@ void PairPolymorphic::write_tables(int npts) { char tag[6] = ""; if (comm->me != 0) sprintf(tag,"%d",comm->me); - FILE* fp = NULL; + FILE* fp = nullptr; double xmin,xmax,x,uf,vf,wf,pf,gf,ff,ufp,vfp,wfp,pfp,gfp,ffp; char line[MAXLINE]; for (int i = 0; i < nelements; i++) { diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 2deb45ac7..9db9adf42 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -46,14 +46,14 @@ PairSW::PairSW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -262,7 +262,7 @@ void PairSW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -271,7 +271,7 @@ void PairSW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index c08c722e5..21a8f7de6 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -50,14 +50,14 @@ PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -306,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -315,7 +315,7 @@ void PairTersoff::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index 63765234b..fea414f5f 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -48,15 +48,15 @@ PairVashishta::PairVashishta(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; r0max = 0.0; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -278,7 +278,7 @@ void PairVashishta::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index 5e0c2c16f..8939efc78 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; PairVashishtaTable::PairVashishtaTable(LAMMPS *lmp) : PairVashishta(lmp) { - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; } /* ---------------------------------------------------------------------- @@ -252,8 +252,8 @@ void PairVashishtaTable::create_tables() { memory->destroy(forceTable); memory->destroy(potentialTable); - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; tabinnersq = tabinner*tabinner; diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index f786179aa..217646b92 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -50,10 +50,10 @@ using namespace FixConst; FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), type_list(NULL), mu(NULL), qtype(NULL), - sqrt_mass_ratio(NULL), local_swap_iatom_list(NULL), - local_swap_jatom_list(NULL), local_swap_atom_list(NULL), - random_equal(NULL), random_unequal(NULL), c_pe(NULL) + idregion(nullptr), type_list(nullptr), mu(nullptr), qtype(nullptr), + sqrt_mass_ratio(nullptr), local_swap_iatom_list(nullptr), + local_swap_jatom_list(nullptr), local_swap_atom_list(nullptr), + random_equal(nullptr), random_unequal(nullptr), c_pe(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix atom/swap command"); @@ -105,9 +105,9 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : nswap_successes = 0.0; atom_swap_nmax = 0; - local_swap_atom_list = NULL; - local_swap_iatom_list = NULL; - local_swap_jatom_list = NULL; + local_swap_atom_list = nullptr; + local_swap_iatom_list = nullptr; + local_swap_jatom_list = nullptr; // set comm size needed by this Fix diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 8a7cd20b0..a024bc20d 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -33,8 +33,8 @@ using namespace FixConst; FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - partner(NULL), finalpartner(NULL), distsq(NULL), probability(NULL), - broken(NULL), copy(NULL), random(NULL) + partner(nullptr), finalpartner(nullptr), distsq(nullptr), probability(nullptr), + broken(nullptr), copy(nullptr), random(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix bond/break command"); diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index a2c2eee2c..e485d370d 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -40,8 +40,8 @@ using namespace MathConst; FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - bondcount(NULL), partner(NULL), finalpartner(NULL), distsq(NULL), - probability(NULL), created(NULL), copy(NULL), random(NULL), list(NULL) + bondcount(nullptr), partner(nullptr), finalpartner(nullptr), distsq(nullptr), + probability(nullptr), created(nullptr), copy(nullptr), random(nullptr), list(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix bond/create command"); @@ -163,7 +163,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // register with Atom class // bondcount values will be initialized in setup() - bondcount = NULL; + bondcount = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); countflag = 0; @@ -177,11 +177,11 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; maxcreate = 0; - created = NULL; + created = nullptr; // copy = special list for one atom // size = ms^2 + ms is sufficient @@ -237,7 +237,7 @@ void FixBondCreate::init() // check cutoff for iatomtype,jatomtype - if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype]) + if (force->pair == nullptr || cutsq > force->pair->cutsq[iatomtype][jatomtype]) error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff"); // warn if more than one fix bond/create or also a fix bond/break diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 270a49777..9b1f14516 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -52,8 +52,8 @@ static const char cite_fix_bond_swap[] = FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tflag(0), alist(NULL), id_temp(NULL), type(NULL), x(NULL), list(NULL), - temperature(NULL), random(NULL) + tflag(0), alist(nullptr), id_temp(nullptr), type(nullptr), x(nullptr), list(nullptr), + temperature(nullptr), random(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_swap); @@ -96,7 +96,7 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : // initialize atom list nmax = 0; - alist = NULL; + alist = nullptr; naccept = foursome = 0; } @@ -130,7 +130,7 @@ void FixBondSwap::init() { // require an atom style with molecule IDs - if (atom->molecule == NULL) + if (atom->molecule == nullptr) error->all(FLERR, "Must use atom style with molecule IDs with fix bond/swap"); @@ -143,13 +143,13 @@ void FixBondSwap::init() // no dihedral or improper potentials allowed // special bonds must be 0 1 1 - if (force->pair == NULL || force->bond == NULL) + if (force->pair == nullptr || force->bond == nullptr) error->all(FLERR,"Fix bond/swap requires pair and bond styles"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support fix bond/swap"); - if (force->angle == NULL && atom->nangles > 0 && comm->me == 0) + if (force->angle == nullptr && atom->nangles > 0 && comm->me == 0) error->warning(FLERR,"Fix bond/swap will ignore defined angles"); if (force->dihedral || force->improper) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index fc306696e..670a1ff58 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -66,10 +66,10 @@ enum{MOVEATOM,MOVEMOL}; // movemode FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), ngroups(0), groupstrings(NULL), ngrouptypes(0), grouptypestrings(NULL), - grouptypebits(NULL), grouptypes(NULL), local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL), random_unequal(NULL), - fixrigid(NULL), fixshake(NULL), idrigid(NULL), idshake(NULL) + idregion(nullptr), full_flag(0), ngroups(0), groupstrings(nullptr), ngrouptypes(0), grouptypestrings(nullptr), + grouptypebits(nullptr), grouptypes(nullptr), local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr), random_unequal(nullptr), + fixrigid(nullptr), fixshake(nullptr), idrigid(nullptr), idshake(nullptr) { if (narg < 11) error->all(FLERR,"Illegal fix gcmc command"); @@ -167,7 +167,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix gcmc molecule must have atom types"); if (ngcmc_type != 0) error->all(FLERR,"Atom type must be zero in fix gcmc mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) + if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix gcmc molecule has charges, but atom style does not"); if (atom->molecular == 2 && onemols != atom->avec->onemols) @@ -176,7 +176,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix gcmc atom has charge, but atom style does not"); if (rigidflag && exchmode == EXCHATOM) @@ -219,7 +219,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : ninsertion_successes = 0.0; gcmc_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -258,12 +258,12 @@ void FixGCMC::options(int narg, char **arg) full_flag = false; ngroups = 0; int ngroupsmax = 0; - groupstrings = NULL; + groupstrings = nullptr; ngrouptypes = 0; int ngrouptypesmax = 0; - grouptypestrings = NULL; - grouptypes = NULL; - grouptypebits = NULL; + grouptypestrings = nullptr; + grouptypes = nullptr; + grouptypebits = nullptr; energy_intra = 0.0; tfac_insert = 1.0; overlap_cutoffsq = 0.0; @@ -481,7 +481,7 @@ void FixGCMC::init() if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("^hybrid",0)) || (force->pair_match("^eam",0)) || @@ -542,7 +542,7 @@ void FixGCMC::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix gcmc rigid fix does not exist"); @@ -557,7 +557,7 @@ void FixGCMC::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix gcmc shake fix does not exist"); diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index b855c0b79..20b72dc26 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -37,7 +37,7 @@ using namespace FixConst; FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xd(NULL), rotflag(0), random_num(NULL) + xd(nullptr), rotflag(0), random_num(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tfmc command"); @@ -83,7 +83,7 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : comflag = 0; if (rotflag) { - xd = NULL; + xd = nullptr; nmax = -1; } @@ -97,7 +97,7 @@ FixTFMC::~FixTFMC() delete random_num; if (rotflag) { memory->destroy(xd); - xd = NULL; + xd = nullptr; nmax = -1; } } diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 94b248174..919cf6d3c 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -58,9 +58,9 @@ enum{EXCHATOM,EXCHMOL}; // exchmode FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), - local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL) + idregion(nullptr), full_flag(0), + local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix Widom command"); @@ -151,7 +151,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix Widom molecule must have atom types"); if (nwidom_type != 0) error->all(FLERR,"Atom type must be zero in fix Widom mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) + if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix Widom molecule has charges, but atom style does not"); if (atom->molecular == 2 && onemols != atom->avec->onemols) @@ -160,7 +160,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix Widom atom has charge, but atom style does not"); // setup of array of coordinates for molecule insertion @@ -177,7 +177,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : // zero out counters widom_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -283,7 +283,7 @@ void FixWidom::init() // decide whether to switch to the full_energy option if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("hybrid",0)) || (force->pair_match("eam",0)) || diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 588d57f32..f4bac9b8c 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -38,8 +38,8 @@ PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp) total_number_of_collisions = 0; max_particles = max_particle_list = 0; - next_particle = NULL; - random = NULL; + next_particle = nullptr; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -342,12 +342,12 @@ void PairDSMC::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -375,11 +375,11 @@ void PairDSMC::write_restart_settings(FILE *fp) void PairDSMC::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 1cbce3a7f..aee8b2a06 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -62,7 +62,7 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : box[0][2] = box[1][2] = box[2][0] = box[2][1] = box[2][2] = 0.0; maxatom = 0; - xpbc = NULL; + xpbc = nullptr; // unit conversion factors for REAL // otherwise not needed diff --git a/src/MESSAGE/message.cpp b/src/MESSAGE/message.cpp index b83be0339..b43a2686a 100644 --- a/src/MESSAGE/message.cpp +++ b/src/MESSAGE/message.cpp @@ -116,6 +116,6 @@ void Message::quit() // clean-up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; lmp->clientserver = 0; } diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp index af7850a0e..44e4a628a 100644 --- a/src/MESSAGE/server_mc.cpp +++ b/src/MESSAGE/server_mc.cpp @@ -77,7 +77,7 @@ void ServerMC::loop() cs->send(msgID,2); cs->pack_double(1,dval); - double *coords = NULL; + double *coords = nullptr; if (atom->nlocal) coords = &atom->x[0][0]; cs->pack_parallel(2,4,atom->nlocal,atom->tag,3,coords); @@ -143,5 +143,5 @@ void ServerMC::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp index 418162e5d..d2bbb088b 100644 --- a/src/MESSAGE/server_md.cpp +++ b/src/MESSAGE/server_md.cpp @@ -64,7 +64,7 @@ ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) pconvert = 1.0 / 0.986923; // atmospheres -> bars } - fcopy = NULL; + fcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -107,15 +107,15 @@ void ServerMD::loop() if (msgID == SETUP) { int dim = 0; - int *periodicity = NULL; + int *periodicity = nullptr; int natoms = -1; int ntypes = -1; - double *origin = NULL; - double *box = NULL; - int *types = NULL; - double *coords = NULL; - char *unit_style = NULL; - double *charge = NULL; + double *origin = nullptr; + double *box = nullptr; + int *types = nullptr; + double *coords = nullptr; + char *unit_style = nullptr; + double *charge = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == DIM) { @@ -185,7 +185,7 @@ void ServerMD::loop() int nlocal = 0; for (int i = 0; i < natoms; i++) { - if (!domain->ownatom(i+1,&coords[3*i],NULL,0)) continue; + if (!domain->ownatom(i+1,&coords[3*i],nullptr,0)) continue; atom->avec->create_atom(types[i],&coords[3*i]); atom->tag[nlocal] = i+1; if (charge) atom->q[nlocal] = charge[i]; @@ -226,9 +226,9 @@ void ServerMD::loop() } else if (msgID == STEP) { - double *coords = NULL; - double *origin = NULL; - double *box = NULL; + double *coords = nullptr; + double *origin = nullptr; + double *box = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == COORDS) { @@ -314,7 +314,7 @@ void ServerMD::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } /* ---------------------------------------------------------------------- @@ -349,7 +349,7 @@ void ServerMD::send_fev(int msgID) cs->send(msgID,3); - double *forces = NULL; + double *forces = nullptr; if (atom->nlocal) { if (units != REAL) forces = &atom->f[0][0]; else { diff --git a/src/MISC/compute_ti.cpp b/src/MISC/compute_ti.cpp index d8be8679c..f984aeac2 100644 --- a/src/MISC/compute_ti.cpp +++ b/src/MISC/compute_ti.cpp @@ -36,8 +36,8 @@ enum{PAIR,TAIL,KSPACE}; /* ---------------------------------------------------------------------- */ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), nterms(0), which(NULL), ivar1(NULL), ivar2(NULL), - ilo(NULL), ihi(NULL), var1(NULL), var2(NULL), pptr(NULL), pstyle(NULL) + Compute(lmp, narg, arg), nterms(0), which(nullptr), ivar1(nullptr), ivar2(nullptr), + ilo(nullptr), ihi(nullptr), var1(nullptr), var2(nullptr), pptr(nullptr), pstyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute ti command"); @@ -64,7 +64,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : pptr = new Pair*[nterms]; pstyle = new char*[nterms]; - for (int m = 0; m < nterms; m++) pstyle[m] = NULL; + for (int m = 0; m < nterms; m++) pstyle[m] = nullptr; // parse keywords @@ -136,16 +136,16 @@ void ComputeTI::init() if (which[m] == PAIR) { pptr[m] = force->pair_match(pstyle[m],1); - if (pptr[m] == NULL) + if (pptr[m] == nullptr) error->all(FLERR,"Compute ti pair style does not exist"); } else if (which[m] == TAIL) { - if (force->pair == NULL || force->pair->tail_flag == 0) + if (force->pair == nullptr || force->pair->tail_flag == 0) error->all(FLERR,"Compute ti tail when pair style does not " "compute tail corrections"); } else if (which[m] == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Compute ti kspace style does not exist"); } } diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 9f2bbfe42..5c3ca7264 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -53,7 +53,7 @@ int xdr3dfcoord(XDR *, float *, int *, float *); /* ---------------------------------------------------------------------- */ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xtc command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), size_one = 3; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; precision = 1000.0; @@ -137,9 +137,9 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to NULL so parent dump class will not use it + // set fp to nullptr so parent dump class will not use it - fp = NULL; + fp = nullptr; if (me == 0) if (xdropen(&xd,filename,"w") == 0) error->one(FLERR,"Cannot open dump file"); } @@ -364,8 +364,8 @@ void DumpXTC::write_frame() static FILE *xdrfiles[MAXID]; static XDR *xdridptr[MAXID]; static char xdrmodes[MAXID]; -static int *ip = NULL; -static int *buf = NULL; +static int *ip = nullptr; +static int *buf = nullptr; /*___________________________________________________________________________ | @@ -414,12 +414,12 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) if (init_done == 0) { for (xdrid = 1; xdrid < MAXID; xdrid++) { - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; } init_done = 1; } xdrid = 1; - while (xdrid < MAXID && xdridptr[xdrid] != NULL) { + while (xdrid < MAXID && xdridptr[xdrid] != nullptr) { xdrid++; } if (xdrid == MAXID) { @@ -433,8 +433,8 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) lmode = XDR_DECODE; } xdrfiles[xdrid] = fopen(filename, type); - if (xdrfiles[xdrid] == NULL) { - xdrs = NULL; + if (xdrfiles[xdrid] == nullptr) { + xdrs = nullptr; return 0; } xdrmodes[xdrid] = *type; @@ -444,7 +444,7 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) * (C users are expected to pass the address of an already allocated * XDR staructure) */ - if (xdrs == NULL) { + if (xdrs == nullptr) { xdridptr[xdrid] = (XDR *) malloc(sizeof(XDR)); xdrstdio_create(xdridptr[xdrid], xdrfiles[xdrid], lmode); } else { @@ -468,7 +468,7 @@ int xdrclose(XDR *xdrs) { int xdrid; - if (xdrs == NULL) { + if (xdrs == nullptr) { fprintf(stderr, "xdrclose: passed a NULL pointer\n"); exit(1); } @@ -477,7 +477,7 @@ int xdrclose(XDR *xdrs) xdr_destroy(xdrs); fclose(xdrfiles[xdrid]); - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; return 1; } } @@ -495,8 +495,8 @@ void xdrfreebuf() { if (ip) free(ip); if (buf) free(buf); - ip = NULL; - buf = NULL; + ip = nullptr; + buf = nullptr; } @@ -815,28 +815,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *) realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } @@ -1059,28 +1059,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) (xdrproc_t)xdr_float)); } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *)realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *)realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index 7ee6fce1b..35b5e0e40 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -44,9 +44,9 @@ enum{DIST_UNIFORM,DIST_GAUSSIAN}; /* ---------------------------------------------------------------------- */ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), idrigid(NULL), - idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), imageflags(NULL), - fixrigid(NULL), fixshake(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), idrigid(nullptr), + idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), imageflags(nullptr), + fixrigid(nullptr), fixshake(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix deposit command"); @@ -233,7 +233,7 @@ void FixDeposit::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix deposit rigid fix does not exist"); @@ -248,7 +248,7 @@ void FixDeposit::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix deposit shake fix does not exist"); @@ -658,13 +658,13 @@ void FixDeposit::options(int narg, char **arg) // defaults iregion = -1; - idregion = NULL; + idregion = nullptr; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; globalflag = localflag = 0; lo = hi = deltasq = 0.0; @@ -904,5 +904,5 @@ void *FixDeposit::extract(const char *str, int &itype) return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index bd2f9acfb..d3836f52a 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -40,8 +40,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), - estr(NULL), idregion(NULL), efield(NULL) + Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), + estr(nullptr), idregion(nullptr), efield(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix efield command"); @@ -57,7 +57,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : virial_flag = 1; qe2f = force->qe2f; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -89,8 +89,8 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; - estr = NULL; + idregion = nullptr; + estr = nullptr; int iarg = 6; while (iarg < narg) { @@ -272,7 +272,7 @@ void FixEfield::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index 6396d139a..0d3b40010 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -33,7 +33,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), list(NULL), mark(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), list(nullptr), mark(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix evaporate command"); @@ -84,8 +84,8 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : ndeleted = 0; nmax = 0; - list = NULL; - mark = NULL; + list = nullptr; + mark = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 75642b632..6f56eb4d5 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -41,7 +41,7 @@ using namespace FixConst; FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - step_respa(NULL), prony_c(NULL), prony_tau(NULL), s_gld(NULL), random(NULL) + step_respa(nullptr), prony_c(nullptr), prony_tau(nullptr), s_gld(nullptr), random(nullptr) { int narg_min = 8; // Check to make sure we have the minimal number of inputs @@ -89,7 +89,7 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : // allocate memory for Prony series timescale coefficients memory->create(prony_tau, prony_terms, "gld:prony_tau"); // allocate memory for Prony series extended variables - s_gld = NULL; + s_gld = nullptr; grow_arrays(atom->nmax); // add callbacks to enable restarts atom->add_callback(0); diff --git a/src/MISC/fix_oneway.cpp b/src/MISC/fix_oneway.cpp index 1ca24a590..3508c2fd7 100644 --- a/src/MISC/fix_oneway.cpp +++ b/src/MISC/fix_oneway.cpp @@ -35,7 +35,7 @@ FixOneWay::FixOneWay(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { direction = NONE; regionidx = 0; - regionstr = NULL; + regionstr = nullptr; if (narg < 6) error->all(FLERR,"Illegal fix oneway command"); diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index cc22a509b..7d9463f77 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -56,7 +56,7 @@ static const char cite_fix_orient_bcc[] = FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_bcc); @@ -114,7 +114,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); @@ -124,7 +124,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f391eab91..0677b8d57 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -53,8 +53,8 @@ static const char cite_fix_orient_fcc[] = FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), - sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), + sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_fcc); @@ -112,7 +112,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); @@ -122,7 +122,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); diff --git a/src/MISC/fix_thermal_conductivity.cpp b/src/MISC/fix_thermal_conductivity.cpp index 115045db8..ac86162e3 100644 --- a/src/MISC/fix_thermal_conductivity.cpp +++ b/src/MISC/fix_thermal_conductivity.cpp @@ -35,7 +35,7 @@ using namespace FixConst; FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - index_lo(NULL), index_hi(NULL), ke_lo(NULL), ke_hi(NULL) + index_lo(nullptr), index_hi(nullptr), ke_lo(nullptr), ke_hi(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix thermal/conductivity command"); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 2d38f3c6c..31585cea9 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -42,11 +42,11 @@ using namespace FixConst; FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (narg < 15) error->all(FLERR,"Illegal fix ttm command"); @@ -74,7 +74,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : if (narg != 16) error->all(FLERR,"Illegal fix ttm command"); if (comm->me == 0) { fp = fopen(arg[15],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open output file {}: {}", arg[15], utils::getsyserror())); } @@ -128,7 +128,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "TTM:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -341,7 +341,7 @@ void FixTTM::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); diff --git a/src/MISC/fix_viscosity.cpp b/src/MISC/fix_viscosity.cpp index 5dcd2d291..90e6fcda6 100644 --- a/src/MISC/fix_viscosity.cpp +++ b/src/MISC/fix_viscosity.cpp @@ -37,7 +37,7 @@ using namespace FixConst; FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pos_index(NULL), neg_index(NULL), pos_delta(NULL), neg_delta(NULL) + pos_index(nullptr), neg_index(nullptr), pos_delta(nullptr), neg_delta(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix viscosity command"); diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index 4fc1fb062..4090677a0 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -319,15 +319,15 @@ void PairNMCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -357,10 +357,10 @@ void PairNMCut::write_restart_settings(FILE *fp) void PairNMCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -422,5 +422,5 @@ void *PairNMCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 4a1868041..1f0ae9632 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -370,16 +370,16 @@ void PairNMCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -411,11 +411,11 @@ void PairNMCutCoulCut::write_restart_settings(FILE *fp) void PairNMCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -493,5 +493,5 @@ void *PairNMCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index 576637c59..a981204af 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -46,7 +46,7 @@ using namespace MathConst; PairNMCutCoulLong::PairNMCutCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -308,13 +308,13 @@ void PairNMCutCoulLong::init_style() cut_coulsq = cut_coul * cut_coul; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -414,15 +414,15 @@ void PairNMCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -455,13 +455,13 @@ void PairNMCutCoulLong::write_restart_settings(FILE *fp) void PairNMCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -576,5 +576,5 @@ void *PairNMCutCoulLong::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/xdr_compat.cpp b/src/MISC/xdr_compat.cpp index 9806b0bbd..7483b4aa1 100644 --- a/src/MISC/xdr_compat.cpp +++ b/src/MISC/xdr_compat.cpp @@ -352,7 +352,7 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt) /* * XDR null terminated ASCII strings * xdr_string deals with "C strings" - arrays of bytes that are - * terminated by a NULL character. The parameter cpp references a + * terminated by a nullptr character. The parameter cpp references a * pointer to storage; If the pointer is null, then the necessary * storage is allocated. The last parameter is the max allowed length * of the string as specified by a protocol. @@ -370,13 +370,13 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) switch (xdrs->x_op) { case XDR_FREE: - if (sp == NULL) + if (sp == nullptr) { return TRUE; /* already free */ } /* fall through... */ case XDR_ENCODE: - if (sp == NULL) + if (sp == nullptr) return FALSE; size = strlen (sp); break; @@ -404,9 +404,9 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) { return TRUE; } - if (sp == NULL) + if (sp == nullptr) *cpp = sp = (char *) malloc (nodesize); - if (sp == NULL) + if (sp == nullptr) { (void) fputs ("xdr_string: out of memory\n", stderr); return FALSE; @@ -419,7 +419,7 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) case XDR_FREE: free (sp); - *cpp = NULL; + *cpp = nullptr; return TRUE; } return FALSE; @@ -660,7 +660,7 @@ xdrstdio_inline (XDR * /*xdrs*/, int /*len*/) * most of the gains to be had here and require storage * management on this buffer, so we don't do this. */ - return NULL; + return nullptr; } static bool_t diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 956cb0196..fe406772c 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeMLIAP::ComputeMLIAP(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), mliaparray(NULL), - mliaparrayall(NULL), map(NULL) + Compute(lmp, narg, arg), mliaparray(nullptr), + mliaparrayall(nullptr), map(nullptr) { array_flag = 1; extarray = 0; @@ -127,7 +127,7 @@ ComputeMLIAP::~ComputeMLIAP() void ComputeMLIAP::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute mliap requires a pair style be defined"); if (descriptor->cutmax > force->pair->cutforce) diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index a7e50012c..cb29dffd4 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -25,10 +25,10 @@ MLIAPData::MLIAPData(LAMMPS *lmp, int gradgradflag_in, int *map_in, class MLIAPModel* model_in, class MLIAPDescriptor* descriptor_in, class PairMLIAP* pairmliap_in) : - Pointers(lmp), gradforce(NULL), betas(NULL), descriptors(NULL), gamma(NULL), - gamma_row_index(NULL), gamma_col_index(NULL), egradient(NULL), - numneighs(NULL), iatoms(NULL), ielems(NULL), jatoms(NULL), jelems(NULL), - rij(NULL), graddesc(NULL), model(NULL), descriptor(NULL), list(NULL) + Pointers(lmp), gradforce(nullptr), betas(nullptr), descriptors(nullptr), gamma(nullptr), + gamma_row_index(nullptr), gamma_col_index(nullptr), egradient(nullptr), + numneighs(nullptr), iatoms(nullptr), ielems(nullptr), jatoms(nullptr), jelems(nullptr), + rij(nullptr), graddesc(nullptr), model(nullptr), descriptor(nullptr), list(nullptr) { gradgradflag = gradgradflag_in; map = map_in; diff --git a/src/MLIAP/mliap_data.h b/src/MLIAP/mliap_data.h index 0307d93ae..ffac9ccd4 100644 --- a/src/MLIAP/mliap_data.h +++ b/src/MLIAP/mliap_data.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPData : protected Pointers { public: - MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = NULL); + MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = nullptr); ~MLIAPData(); void init(); diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 5f0ee33c8..21ba68e9a 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -35,10 +35,10 @@ MLIAPDescriptorSNAP::MLIAPDescriptorSNAP(LAMMPS *lmp, char *paramfilename): MLIAPDescriptor(lmp) { nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - snaptr = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + snaptr = nullptr; read_paramfile(paramfilename); snaptr = new SNA(lmp, rfac0, twojmax, @@ -374,7 +374,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) FILE *fpparam; if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); - if (fpparam == NULL) + if (fpparam == nullptr) error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}", paramfilename, utils::getsyserror())); } @@ -386,7 +386,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -406,7 +406,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { utils::logmesg(lmp, fmt::format("SNAP keyword {} {} \n", keywd, keyval)); @@ -427,19 +427,19 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) int n = strlen(elemtmp) + 1; elements[ielem] = new char[n]; strcpy(elements[ielem],elemtmp); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } elementsflag = 1; } else if (strcmp(keywd,"radelems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { radelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } radelemflag = 1; } else if (strcmp(keywd,"welems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { wjelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } wjelemflag = 1; } diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index b731e1c9f..7ac1013c4 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; MLIAPModel::MLIAPModel(LAMMPS* lmp, char* coefffilename) : Pointers(lmp) { - coeffelem = NULL; + coeffelem = nullptr; if (coefffilename) read_coeffs(coefffilename); else { nparams = 0; @@ -81,7 +81,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) FILE *fpcoeff; if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); - if (fpcoeff == NULL) + if (fpcoeff == nullptr) error->one(FLERR,fmt::format("Cannot open MLIAPModel coeff file {}: {}", coefffilename,utils::getsyserror())); } @@ -94,7 +94,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -119,7 +119,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); nparams = atoi(words[1]); @@ -134,7 +134,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) for (int icoeff = 0; icoeff < nparams; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; diff --git a/src/MLIAP/mliap_model_quadratic.h b/src/MLIAP/mliap_model_quadratic.h index 188d78661..b41df18a0 100644 --- a/src/MLIAP/mliap_model_quadratic.h +++ b/src/MLIAP/mliap_model_quadratic.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModel { public: - MLIAPModelQuadratic(LAMMPS*, char* = NULL); + MLIAPModelQuadratic(LAMMPS*, char* = nullptr); ~MLIAPModelQuadratic(); virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData*); diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp index 6cd550384..61051084b 100644 --- a/src/MOLECULE/angle_charmm.cpp +++ b/src/MOLECULE/angle_charmm.cpp @@ -246,10 +246,10 @@ void AngleCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp index 0288a61d8..b4190d902 100644 --- a/src/MOLECULE/angle_cosine.cpp +++ b/src/MOLECULE/angle_cosine.cpp @@ -194,7 +194,7 @@ void AngleCosine::read_restart(FILE *fp) { allocate(); - if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp index 1a05edc20..1cf0cb887 100644 --- a/src/MOLECULE/angle_cosine_periodic.cpp +++ b/src/MOLECULE/angle_cosine_periodic.cpp @@ -247,9 +247,9 @@ void AngleCosinePeriodic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp index 5fb40b54c..dc1a20fd8 100644 --- a/src/MOLECULE/angle_cosine_squared.cpp +++ b/src/MOLECULE/angle_cosine_squared.cpp @@ -37,8 +37,8 @@ using namespace MathConst; AngleCosineSquared::AngleCosineSquared(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -216,8 +216,8 @@ void AngleCosineSquared::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp index eb5e48ec9..19142f94c 100644 --- a/src/MOLECULE/angle_harmonic.cpp +++ b/src/MOLECULE/angle_harmonic.cpp @@ -33,8 +33,8 @@ using namespace MathConst; AngleHarmonic::AngleHarmonic(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -216,8 +216,8 @@ void AngleHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 100b75cb0..6e47bf787 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -47,7 +47,7 @@ AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -205,7 +205,7 @@ void AngleTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -311,8 +311,8 @@ void AngleTable::write_restart_settings(FILE *fp) void AngleTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -351,10 +351,10 @@ double AngleTable::single(int type, int i1, int i2, int i3) void AngleTable::null_table(Table *tb) { - tb->afile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->ang = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->afile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->ang = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 3dc8c9088..5e3e2df07 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -55,7 +55,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = 0; - bond_negative = angle_negative = NULL; + bond_negative = angle_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 2fa445c8e..22f47e569 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -50,7 +50,7 @@ AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = 0; - bond_negative = NULL; + bond_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 866cf796c..a69007cea 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -75,7 +75,7 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index e90bec510..da75316a7 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -75,7 +75,7 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index b2271d45f..f79c56b63 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -215,10 +215,10 @@ void BondFENE::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -279,5 +279,5 @@ void *BondFENE::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index 676d5f687..8166e63e2 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -225,11 +225,11 @@ void BondFENEExpand::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index 89b3830cb..85653a60f 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -167,8 +167,8 @@ void BondGromos::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -204,5 +204,5 @@ void *BondGromos::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index 28100512a..6e523b492 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -168,8 +168,8 @@ void BondHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -208,7 +208,7 @@ void *BondHarmonic::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index 49074e1cd..f7e4e6c91 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -173,9 +173,9 @@ void BondMorse::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&d0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -213,5 +213,5 @@ void *BondMorse::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index 63b640730..7c74d8f41 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -168,9 +168,9 @@ void BondNonlinear::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&epsilon[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -211,5 +211,5 @@ void *BondNonlinear::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"epsilon")==0) return (void*) epsilon; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index c8d182e4f..4fd22f377 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -229,7 +229,7 @@ void BondQuartic::coeff(int narg, char **arg) void BondQuartic::init_style() { - if (force->pair == NULL || force->pair->single_enable == 0) + if (force->pair == nullptr || force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support bond_style quartic"); if (force->angle || force->dihedral || force->improper) error->all(FLERR, @@ -276,11 +276,11 @@ void BondQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&b1[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 5cc91ceae..a7fbbb84d 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -43,7 +43,7 @@ BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -157,7 +157,7 @@ void BondTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -254,8 +254,8 @@ void BondTable::write_restart_settings(FILE *fp) void BondTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -278,10 +278,10 @@ double BondTable::single(int type, double rsq, int /*i*/, int /*j*/, void BondTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index 11422e082..cc615213a 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -389,7 +389,7 @@ void DihedralCharmm::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmm is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -424,11 +424,11 @@ void DihedralCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 408be8ef9..a12421211 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -407,7 +407,7 @@ void DihedralCharmmfsw::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -428,8 +428,8 @@ void DihedralCharmmfsw::init_style() double *p_cutlj = (double *) force->pair->extract("cut_lj",itmp); double *p_cutcoul = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutcoul == NULL || p_cutljinner == NULL || - p_cutlj == NULL || p_dihedflag == NULL) + if (p_cutcoul == nullptr || p_cutljinner == nullptr || + p_cutlj == nullptr || p_dihedflag == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); dihedflag = *p_dihedflag; @@ -467,11 +467,11 @@ void DihedralCharmmfsw::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index 55e2f2500..87ade01be 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -328,9 +328,9 @@ void DihedralHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index 40e026c2f..8c4ba07fb 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -323,9 +323,9 @@ void DihedralHelix::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&aphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&bphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index 963304da8..57c017bd9 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -319,11 +319,11 @@ void DihedralMultiHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&a1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index fe05dc7c3..39b979ff2 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -331,10 +331,10 @@ void DihedralOPLS::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 2de6dd418..0de406120 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -62,11 +62,11 @@ using namespace MathConst; FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - crosstermlist(NULL), num_crossterm(NULL), crossterm_type(NULL), - crossterm_atom1(NULL), crossterm_atom2(NULL), crossterm_atom3(NULL), - crossterm_atom4(NULL), crossterm_atom5(NULL), - g_axis(NULL), cmapgrid(NULL), d1cmapgrid(NULL), d2cmapgrid(NULL), - d12cmapgrid(NULL) + crosstermlist(nullptr), num_crossterm(nullptr), crossterm_type(nullptr), + crossterm_atom1(nullptr), crossterm_atom2(nullptr), crossterm_atom3(nullptr), + crossterm_atom4(nullptr), crossterm_atom5(nullptr), + g_axis(nullptr), cmapgrid(nullptr), d1cmapgrid(nullptr), d2cmapgrid(nullptr), + d12cmapgrid(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix cmap command"); @@ -101,13 +101,13 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - num_crossterm = NULL; - crossterm_type = NULL; - crossterm_atom1 = NULL; - crossterm_atom2 = NULL; - crossterm_atom3 = NULL; - crossterm_atom4 = NULL; - crossterm_atom5 = NULL; + num_crossterm = nullptr; + crossterm_type = nullptr; + crossterm_atom1 = nullptr; + crossterm_atom2 = nullptr; + crossterm_atom3 = nullptr; + crossterm_atom4 = nullptr; + crossterm_atom5 = nullptr; nmax_previous = 0; grow_arrays(atom->nmax); @@ -118,7 +118,7 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : ncmap = 0; maxcrossterm = 0; - crosstermlist = NULL; + crosstermlist = nullptr; } /* --------------------------------------------------------------------- */ @@ -631,10 +631,10 @@ void FixCMAP::read_grid_map(char *cmapfile) char *chunk,*line; int i1, i2, i3, i4, i5, i6, j1, j2, j3, j4, j5, j6, counter; - FILE *fp = NULL; + FILE *fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(cmapfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix cmap file {}: {}", cmapfile, utils::getsyserror())); @@ -654,7 +654,7 @@ void FixCMAP::read_grid_map(char *cmapfile) while (!done) { // only read on rank 0 and broadcast to all other ranks if (comm->me == 0) - done = (fgets(linebuf,MAXLINE,fp) == NULL); + done = (fgets(linebuf,MAXLINE,fp) == nullptr); MPI_Bcast(&done,1,MPI_INT,0,world); if (done) continue; @@ -681,13 +681,13 @@ void FixCMAP::read_grid_map(char *cmapfile) // 6. Glycine before proline map chunk = strtok(line, " \r\n"); - while (chunk != NULL) { + while (chunk != nullptr) { // alanine map if (counter < CMAPDIM*CMAPDIM) { cmapgrid[0][i1][j1] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j1++; if (j1 == CMAPDIM) { j1 = 0; @@ -701,7 +701,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= CMAPDIM*CMAPDIM && counter < 2*CMAPDIM*CMAPDIM) { cmapgrid[1][i2][j2]= atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j2++; if (j2 == CMAPDIM) { j2 = 0; @@ -715,7 +715,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 2*CMAPDIM*CMAPDIM && counter < 3*CMAPDIM*CMAPDIM) { cmapgrid[2][i3][j3] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j3++; if (j3 == CMAPDIM) { j3 = 0; @@ -729,7 +729,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 3*CMAPDIM*CMAPDIM && counter < 4*CMAPDIM*CMAPDIM) { cmapgrid[3][i4][j4] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j4++; if (j4 == CMAPDIM) { j4 = 0; @@ -743,7 +743,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 4*CMAPDIM*CMAPDIM && counter < 5*CMAPDIM*CMAPDIM) { cmapgrid[4][i5][j5] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j5++; if (j5 == CMAPDIM) { j5 = 0; @@ -757,7 +757,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 5*CMAPDIM*CMAPDIM && counter < 6*CMAPDIM*CMAPDIM) { cmapgrid[5][i6][j6] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j6++; if (j6 == CMAPDIM) { j6 = 0; diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 90cf3eee3..75eeb4a45 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -334,9 +334,9 @@ void ImproperCvff::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->nimpropertypes,MPI_INT,0,world); diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index 6327ea8b0..159574a12 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -275,8 +275,8 @@ void ImproperHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 7b2c4e0b0..7a7c07ab0 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -316,9 +316,9 @@ void ImproperUmbrella::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 6d9c85142..307fe3772 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -50,7 +50,7 @@ PairHbondDreidingLJ::PairHbondDreidingLJ(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nparams = maxparam = 0; - params = NULL; + params = nullptr; nextra = 2; pvector = new double[2]; diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index dea6bd625..9b3805a8b 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -375,14 +375,14 @@ void PairLJCharmmCoulCharmm::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -436,12 +436,12 @@ void PairLJCharmmCoulCharmm::write_restart_settings(FILE *fp) void PairLJCharmmCoulCharmm::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -523,5 +523,5 @@ void *PairLJCharmmCoulCharmm::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"implicit") == 0) return (void *) &implicit; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index 31083312a..c311c76f5 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -433,14 +433,14 @@ void PairLJCharmmfswCoulCharmmfsh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -470,11 +470,11 @@ void PairLJCharmmfswCoulCharmmfsh::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulCharmmfsh::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -560,5 +560,5 @@ void *PairLJCharmmfswCoulCharmmfsh::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index b5ed25578..d8ab817e7 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -43,8 +43,8 @@ PairLJCutTIP4PCut::PairLJCutTIP4PCut(LAMMPS *lmp) : Pair(lmp) writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -494,9 +494,9 @@ void PairLJCutTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -618,13 +618,13 @@ void PairLJCutTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -660,17 +660,17 @@ void PairLJCutTIP4PCut::write_restart_settings(FILE *fp) void PairLJCutTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -740,7 +740,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- memory usage of hneigh diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 8d8f5ec78..7757e9649 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -39,8 +39,8 @@ PairTIP4PCut::PairTIP4PCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -423,9 +423,9 @@ void PairTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -475,7 +475,7 @@ void PairTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -502,13 +502,13 @@ void PairTIP4PCut::write_restart_settings(FILE *fp) void PairTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 62d940af3..812cec21a 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -186,7 +186,7 @@ void DumpAtomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 6d5fc3da8..f598f2599 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -207,7 +207,7 @@ void DumpCFGMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index b623df82d..065b04801 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -202,7 +202,7 @@ void DumpCustomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -247,8 +247,8 @@ void DumpCustomMPIIO::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index 139245e4b..959a45410 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -198,7 +198,7 @@ void DumpXYZMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -239,7 +239,7 @@ void DumpXYZMPIIO::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; diff --git a/src/MSCG/fix_mscg.cpp b/src/MSCG/fix_mscg.cpp index 29d6d550e..650c25cd4 100644 --- a/src/MSCG/fix_mscg.cpp +++ b/src/MSCG/fix_mscg.cpp @@ -65,7 +65,7 @@ FixMSCG::FixMSCG(LAMMPS *lmp, int narg, char **arg) : nframes = n_frames = block_size = 0; range_flag = 0; name_flag = 0; - f = NULL; + f = nullptr; type_names = new char*[natoms]; for (int i = 0; i < natoms; i++) type_names[i] = new char[24]; diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 8bea52f1c..9e4c88690 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), damage(NULL) + Compute(lmp, narg, arg), damage(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute damage/atom command"); diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 65a25cda0..bf8d345f2 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -43,7 +43,7 @@ ComputeDilatationAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dilatation = NULL; + dilatation = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index d90e21150..5d0d55498 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -44,7 +44,7 @@ ComputePlasticityAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - plasticity = NULL; + plasticity = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 295038119..d741aca85 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -56,15 +56,15 @@ FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : // set maxpartner = 1 as placeholder maxpartner = 1; - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; - vinter = NULL; - wvolume = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; + vinter = nullptr; + wvolume = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -228,13 +228,13 @@ void FixPeriNeigh::setup(int /*vflag*/) memory->destroy(r0); memory->destroy(npartner); - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; grow_arrays(atom->nmax); // create partner list and r0 values from neighbor list @@ -301,9 +301,9 @@ void FixPeriNeigh::setup(int /*vflag*/) double **x0 = atom->x0; double half_lc = 0.5*(domain->lattice->xlattice); double vfrac_scale; - PairPeriLPS *pairlps = NULL; - PairPeriVES *pairves = NULL; - PairPeriEPS *paireps = NULL; + PairPeriLPS *pairlps = nullptr; + PairPeriVES *pairves = nullptr; + PairPeriEPS *paireps = nullptr; if (isLPS) pairlps = static_cast(anypair); else if (isVES) diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index 0e5760ac8..c6f3c1ada 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -47,14 +47,14 @@ PairPeriEPS::PairPeriEPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = -1; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_yieldstress = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_yieldstress = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -219,7 +219,7 @@ void PairPeriEPS::compute(int eflag, int vflag) // ******** temp array to store Plastic extension *********** /// // create on heap to reduce stack use and to allow for faster zeroing - double **deviatorPlasticExtTemp = NULL; + double **deviatorPlasticExtTemp = nullptr; if (nlocal*maxpartner > 0) { memory->create(deviatorPlasticExtTemp,nlocal,maxpartner,"pair:plastext"); memset(&(deviatorPlasticExtTemp[0][0]),0,sizeof(double)*nlocal*maxpartner); @@ -505,7 +505,7 @@ void PairPeriEPS::init_style() if (atom->map_style == 0) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -559,16 +559,16 @@ void PairPeriEPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index b60f28d9f..65f43ad66 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -45,13 +45,13 @@ PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -481,15 +481,15 @@ void PairPeriLPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 5d6973a91..f29671a42 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -44,12 +44,12 @@ PairPeriPMB::PairPeriPMB(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; + s0_new = nullptr; - kspring = NULL; - s00 = NULL; - alpha = NULL; - cut = NULL; + kspring = nullptr; + s00 = nullptr; + alpha = nullptr; + cut = nullptr; } /* ---------------------------------------------------------------------- */ @@ -410,14 +410,14 @@ void PairPeriPMB::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&kspring[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index 93c980702..ff131eae5 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -45,15 +45,15 @@ PairPeriVES::PairPeriVES(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_lambdai = NULL; - m_taubi = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_lambdai = nullptr; + m_taubi = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -484,7 +484,7 @@ void PairPeriVES::init_style() if (atom->map_style == 0) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -539,17 +539,17 @@ void PairPeriVES::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 12dc59c28..6dadb2866 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -62,12 +62,12 @@ static const char cite_fix_poems[] = ------------------------------------------------------------------------- */ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), natom2body(NULL), - atom2body(NULL), displace(NULL), nrigid(NULL), masstotal(NULL), - xcm(NULL), vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), sum(NULL), all(NULL), jointbody(NULL), - xjoint(NULL), freelist(NULL), poems(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), natom2body(nullptr), + atom2body(nullptr), displace(nullptr), nrigid(nullptr), masstotal(nullptr), + xcm(nullptr), vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), sum(nullptr), all(nullptr), jointbody(nullptr), + xjoint(nullptr), freelist(nullptr), poems(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_poems); @@ -84,9 +84,9 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with atom class - natom2body = NULL; - atom2body = NULL; - displace = NULL; + natom2body = nullptr; + atom2body = nullptr; + displace = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -944,7 +944,7 @@ void FixPOEMS::readfile(char *file) if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix poems file %s",file); error->one(FLERR,str); @@ -952,7 +952,7 @@ void FixPOEMS::readfile(char *file) } nbody = 0; - char *line = NULL; + char *line = nullptr; int maxline = 0; char *ptr; int nlocal = atom->nlocal; @@ -965,10 +965,10 @@ void FixPOEMS::readfile(char *file) MPI_Bcast(line,nlen,MPI_CHAR,0,world); ptr = strtok(line," ,\t\n\0"); - if (ptr == NULL || ptr[0] == '#') continue; - ptr = strtok(NULL," ,\t\n\0"); + if (ptr == nullptr || ptr[0] == '#') continue; + ptr = strtok(nullptr," ,\t\n\0"); - while ((ptr = strtok(NULL," ,\t\n\0"))) { + while ((ptr = strtok(nullptr," ,\t\n\0"))) { id = atoi(ptr); i = atom->map(id); if (i < 0 || i >= nlocal) continue; @@ -995,7 +995,7 @@ int FixPOEMS::readline(FILE *fp, char **pline, int *pmaxline) maxline += DELTA; memory->grow(line,maxline,"fix_poems:line"); } - if (fgets(&line[n],maxline-n,fp) == NULL) { + if (fgets(&line[n],maxline-n,fp) == nullptr) { n = 0; break; } @@ -1030,7 +1030,7 @@ void FixPOEMS::jointbuild() mjoint += natom2body[i]-1; } - tagint **mylist = NULL; + tagint **mylist = nullptr; if (mjoint) memory->create(mylist,mjoint,3,"poems:mylist"); mjoint = 0; @@ -1047,7 +1047,7 @@ void FixPOEMS::jointbuild() // jlist = mylist concatenated across all procs via MPI_Allgatherv MPI_Allreduce(&mjoint,&njoint,1,MPI_INT,MPI_SUM,world); - tagint **jlist = NULL; + tagint **jlist = nullptr; if (njoint) memory->create(jlist,njoint,3,"poems:jlist"); int nprocs; @@ -1069,7 +1069,7 @@ void FixPOEMS::jointbuild() MPI_Allgatherv(mylist[0],3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); else - MPI_Allgatherv(NULL,3*mjoint,MPI_LMP_TAGINT,jlist[0], + MPI_Allgatherv(nullptr,3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); } @@ -1107,9 +1107,9 @@ void FixPOEMS::jointbuild() // each proc sets myjoint if it owns joint atom // MPI_Allreduce gives all procs the xjoint coords - jointbody = NULL; - xjoint = NULL; - double **myjoint = NULL; + jointbody = nullptr; + xjoint = nullptr; + double **myjoint = nullptr; if (njoint) { memory->create(jointbody,njoint,2,"poems:jointbody"); memory->create(xjoint,njoint,3,"poems:xjoint"); @@ -1146,7 +1146,7 @@ void FixPOEMS::jointbuild() for (i = 0; i < nbody; i++) if (mark[i]) nfree++; if (nfree) freelist = new int[nfree]; - else freelist = NULL; + else freelist = nullptr; nfree = 0; for (i = 0; i < nbody; i++) if (mark[i]) freelist[nfree++] = i + 1; diff --git a/src/PYTHON/fix_python_move.cpp b/src/PYTHON/fix_python_move.cpp index 53bde5e80..6aec1d785 100644 --- a/src/PYTHON/fix_python_move.cpp +++ b/src/PYTHON/fix_python_move.cpp @@ -37,7 +37,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : python->init(); - py_move = NULL; + py_move = nullptr; PyGILState_STATE gstate = PyGILState_Ensure(); @@ -50,7 +50,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : char * full_cls_name = arg[3]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Fix python/integrate requires fully qualified class name"); } @@ -138,7 +138,7 @@ void FixPythonMove::init() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'init' method'"); } - PyObject * result = PyEval_CallObject(py_init, NULL); + PyObject * result = PyEval_CallObject(py_init, nullptr); PyGILState_Release(gstate); } @@ -174,7 +174,7 @@ void FixPythonMove::final_integrate() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'final_integrate' method'"); } - PyObject * result = PyEval_CallObject(py_final_integrate, NULL); + PyObject * result = PyEval_CallObject(py_final_integrate, nullptr); PyGILState_Release(gstate); } @@ -229,6 +229,6 @@ void FixPythonMove::reset_dt() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'reset_dt' method'"); } - PyObject * result = PyEval_CallObject(py_reset_dt, NULL); + PyObject * result = PyEval_CallObject(py_reset_dt, nullptr); PyGILState_Release(gstate); } diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 074de2f39..e24daf311 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -43,8 +43,8 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { cut_global = 0.0; centroidstressflag = 1; - py_potential = NULL; - skip_types = NULL; + py_potential = nullptr; + skip_types = nullptr; python->init(); @@ -54,7 +54,7 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { // if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well const char * potentials_path = getenv("LAMMPS_POTENTIALS"); - if (potentials_path != NULL) { + if (potentials_path != nullptr) { PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path)); } } @@ -259,7 +259,7 @@ void PairPython::coeff(int narg, char **arg) char * full_cls_name = arg[2]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Python pair style requires fully qualified class name"); } @@ -297,7 +297,7 @@ void PairPython::coeff(int narg, char **arg) delete [] module_name; delete [] cls_name; - PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, NULL); + PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, nullptr); if (!py_pair_instance) { PyErr_Print(); PyErr_Clear(); diff --git a/src/PYTHON/python_compat.h b/src/PYTHON/python_compat.h index effac81ce..97946349b 100644 --- a/src/PYTHON/python_compat.h +++ b/src/PYTHON/python_compat.h @@ -21,14 +21,14 @@ #define PY_INT_FROM_LONG(X) PyInt_FromLong(X) #define PY_INT_AS_LONG(X) PyInt_AsLong(X) #define PY_STRING_FROM_STRING(X) PyString_FromString(X) -#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, NULL) +#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, nullptr) #define PY_STRING_AS_STRING(X) PyString_AsString(X) #elif PY_MAJOR_VERSION == 3 #define PY_INT_FROM_LONG(X) PyLong_FromLong(X) #define PY_INT_AS_LONG(X) PyLong_AsLong(X) #define PY_STRING_FROM_STRING(X) PyUnicode_FromString(X) -#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, NULL, NULL) +#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, nullptr, nullptr) #define PY_STRING_AS_STRING(X) PyUnicode_AsUTF8(X) #endif diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index cb35cba85..5a94d33e9 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -38,15 +38,15 @@ enum{NONE,INT,DOUBLE,STRING,PTR}; PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) { ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; // pfuncs stores interface info for each Python function nfunc = 0; - pfuncs = NULL; + pfuncs = nullptr; // one-time initialization of Python interpreter // pyMain stores pointer to main module @@ -104,7 +104,7 @@ void PythonImpl::command(int narg, char **arg) int ifunc = find(arg[0]); if (ifunc < 0) error->all(FLERR,"Python invoke of undefined function"); - char *str = NULL; + char *str = nullptr; if (noutput) { str = input->variable->pythonstyle(pfuncs[ifunc].ovarname, pfuncs[ifunc].name); @@ -122,7 +122,7 @@ void PythonImpl::command(int narg, char **arg) int err; FILE *fp = fopen(arg[2],"r"); - if (fp == NULL) + if (fp == nullptr) err = execute_string(arg[2]); else err = execute_file(arg[2]); @@ -136,12 +136,12 @@ void PythonImpl::command(int narg, char **arg) // parse optional args, invoke is not allowed in this mode ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; - char *pyfile = NULL; - char *herestr = NULL; + char *pyfile = nullptr; + char *herestr = nullptr; int existflag = 0; int iarg = 1; @@ -206,7 +206,7 @@ void PythonImpl::command(int narg, char **arg) if (pyfile) { FILE *fp = fopen(pyfile,"r"); - if (fp == NULL) { + if (fp == nullptr) { PyGILState_Release(gstate); error->all(FLERR,"Could not open Python file"); } @@ -422,7 +422,7 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].svalue = new char*[ninput]; for (int i = 0; i < ninput; i++) { - pfuncs[ifunc].svalue[i] = NULL; + pfuncs[ifunc].svalue[i] = nullptr; char type = format[i]; if (type == 'i') { pfuncs[ifunc].itype[i] = INT; @@ -470,8 +470,8 @@ int PythonImpl::create_entry(char *name) // process output as value or variable - pfuncs[ifunc].ovarname = NULL; - pfuncs[ifunc].longstr = NULL; + pfuncs[ifunc].ovarname = nullptr; + pfuncs[ifunc].longstr = nullptr; if (!noutput) return ifunc; char type = format[ninput]; @@ -512,7 +512,7 @@ int PythonImpl::execute_string(char *cmd) int PythonImpl::execute_file(char *fname) { FILE *fp = fopen(fname,"r"); - if (fp == NULL) return -1; + if (fp == nullptr) return -1; PyGILState_STATE gstate = PyGILState_Ensure(); int err = PyRun_SimpleFile(fp,fname); diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 5cadce617..9f8b6c344 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -37,11 +37,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), list(NULL), chi(NULL), eta(NULL), - gamma(NULL), zeta(NULL), zcore(NULL), chizj(NULL), shld(NULL), - s(NULL), t(NULL), s_hist(NULL), t_hist(NULL), Hdia_inv(NULL), b_s(NULL), - b_t(NULL), p(NULL), q(NULL), r(NULL), d(NULL), - qf(NULL), q1(NULL), q2(NULL), qv(NULL) + Fix(lmp, narg, arg), list(nullptr), chi(nullptr), eta(nullptr), + gamma(nullptr), zeta(nullptr), zcore(nullptr), chizj(nullptr), shld(nullptr), + s(nullptr), t(nullptr), s_hist(nullptr), t_hist(nullptr), Hdia_inv(nullptr), b_s(nullptr), + b_t(nullptr), p(nullptr), q(nullptr), r(nullptr), d(nullptr), + qf(nullptr), q1(nullptr), q2(nullptr), qv(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix qeq command"); @@ -58,48 +58,48 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : swa = 0.0; swb = cutoff; - shld = NULL; + shld = nullptr; nlocal = n_cap = 0; nall = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 5; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // others cutoff_sq = cutoff*cutoff; - chizj = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; + chizj = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; streitz_flag = 0; reax_flag = 0; - qv = NULL; + qv = nullptr; comm_forward = comm_reverse = 1; // perform initial allocation of atom-based arrays // register with Atom class - s_hist = t_hist = NULL; + s_hist = t_hist = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -708,7 +708,7 @@ void FixQEq::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix qeq parameter file %s",file); error->one(FLERR,str); @@ -726,7 +726,7 @@ void FixQEq::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -751,7 +751,7 @@ void FixQEq::read_file(char *file) for (n=0, words[n] = strtok(line," \t\n\r\f"); n < 6; - words[++n] = strtok(NULL," \t\n\r\f")); + words[++n] = strtok(nullptr," \t\n\r\f")); utils::bounds(FLERR,words[0],1,ntypes,nlo,nhi,error); for (n=nlo; n <=nhi; ++n) { diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 6dcc5e9cd..10cdc5d3c 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -66,8 +66,8 @@ FixQEqFire::FixQEqFire(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix qeq/fire command"); } - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index 37951adb1..306f3f61e 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -78,12 +78,12 @@ void FixQEqShielded::init() void FixQEqShielded::extract_reax() { Pair *pair = force->pair_match("^reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair reax/c"); } diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 327a9c5b3..7c7dc159b 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -88,15 +88,15 @@ void FixQEqSlater::init() void FixQEqSlater::extract_streitz() { Pair *pair = force->pair_match("coul/streitz",1); - if (pair == NULL) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); + if (pair == nullptr) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); zeta = (double *) pair->extract("zeta",tmp); zcore = (double *) pair->extract("zcore",tmp); - if (chi == NULL || eta == NULL || gamma == NULL - || zeta == NULL || zcore == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr + || zeta == nullptr || zcore == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair coul/streitz"); diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index 531f488e6..8efaab7c7 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_event(NULL), fix_event(NULL) + Compute(lmp, narg, arg), id_event(nullptr), fix_event(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute event/displace command"); @@ -47,7 +47,7 @@ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : // fix event ID will be set later by accelerated dynamics method - id_event = NULL; + id_event = nullptr; } /* ---------------------------------------------------------------------- */ @@ -65,7 +65,7 @@ void ComputeEventDisplace::init() // if set by PRD, then find fix which stores original atom coords // check if it is correct style - if (id_event != NULL) { + if (id_event != nullptr) { int ifix = modify->find_fix(id_event); if (ifix < 0) error->all(FLERR, "Could not find compute event/displace fix ID"); @@ -88,7 +88,7 @@ double ComputeEventDisplace::compute_scalar() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; double event = 0.0; double **xevent = fix_event->array_atom; @@ -150,7 +150,7 @@ int ComputeEventDisplace::all_events() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; int event = 0; double **xevent = fix_event->array_atom; @@ -204,8 +204,8 @@ int ComputeEventDisplace::all_events() void ComputeEventDisplace::reset_extra_compute_fix(const char *id_new) { delete [] id_event; - id_event = NULL; - if (id_new == NULL) return; + id_event = nullptr; + if (id_new == nullptr) return; int n = strlen(id_new) + 1; id_event = new char[n]; diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 41f91332c..7e6a82bdd 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -27,8 +27,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xevent(NULL), xold(NULL), vold(NULL), - imageold(NULL), xorig(NULL), vorig(NULL), imageorig(NULL) + Fix(lmp, narg, arg), xevent(nullptr), xold(nullptr), vold(nullptr), + imageold(nullptr), xorig(nullptr), vorig(nullptr), imageorig(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix event command"); diff --git a/src/REPLICA/fix_hyper.cpp b/src/REPLICA/fix_hyper.cpp index 472d0bbb4..733578caa 100644 --- a/src/REPLICA/fix_hyper.cpp +++ b/src/REPLICA/fix_hyper.cpp @@ -35,6 +35,6 @@ void *FixHyper::extract(const char *str, int &dim) if (strcmp(str,"hyperflag") == 0) { return &hyperflag; } - return NULL; + return nullptr; } diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index f104d14c2..abc16618c 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -41,7 +41,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), xold(NULL), tagold(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), xold(nullptr), tagold(nullptr) { if (atom->map_style == 0) error->all(FLERR,"Fix hyper/global command requires atom map"); @@ -70,12 +70,12 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : maxbond = 0; nblocal = 0; - blist = NULL; + blist = nullptr; maxold = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; me = comm->me; firstflag = 1; diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index da444bc45..2eb18a0c8 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -47,10 +47,10 @@ enum{IGNORE,WARN,ERROR}; /* ---------------------------------------------------------------------- */ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), biascoeff(NULL), numbond(NULL), - maxhalf(NULL), eligible(NULL), maxhalfstrain(NULL), old2now(NULL), - tagold(NULL), xold(NULL), maxstrain(NULL), maxstrain_domain(NULL), - biasflag(NULL), bias(NULL), cpage(NULL), clist(NULL), numcoeff(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), biascoeff(nullptr), numbond(nullptr), + maxhalf(nullptr), eligible(nullptr), maxhalfstrain(nullptr), old2now(nullptr), + tagold(nullptr), xold(nullptr), maxstrain(nullptr), maxstrain_domain(nullptr), + biasflag(nullptr), bias(nullptr), cpage(nullptr), clist(nullptr), numcoeff(nullptr) { // error checks @@ -132,28 +132,28 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : // per-atom data structs maxbond = nblocal = 0; - blist = NULL; - biascoeff = NULL; + blist = nullptr; + biascoeff = nullptr; allbonds = 0; maxatom = 0; - maxstrain = NULL; - maxstrain_domain = NULL; - biasflag = NULL; + maxstrain = nullptr; + maxstrain_domain = nullptr; + biasflag = nullptr; maxlocal = nlocal_old = 0; - numbond = NULL; - maxhalf = NULL; - eligible = NULL; - maxhalfstrain = NULL; + numbond = nullptr; + maxhalf = nullptr; + eligible = nullptr; + maxhalfstrain = nullptr; maxall = nall_old = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; nbias = maxbias = 0; - bias = NULL; + bias = nullptr; // data structs for persisting bias coeffs when bond list is reformed // maxbondperatom = max # of bonds any atom is part of @@ -162,8 +162,8 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : maxcoeff = 0; maxbondperatom = FCCBONDS; - numcoeff = NULL; - clist = NULL; + numcoeff = nullptr; + clist = nullptr; cpage = new MyPage; cpage->init(maxbondperatom,1024*maxbondperatom,1); @@ -983,7 +983,7 @@ void FixHyperLocal::build_bond_list(int natom) while (1) { if (firstflag) break; for (i = 0; i < nall; i++) numcoeff[i] = 0; - for (i = 0; i < nall; i++) clist[i] = NULL; + for (i = 0; i < nall; i++) clist[i] = nullptr; cpage->reset(); for (m = 0; m < nblocal; m++) { diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index b8fd0f644..a739ec754 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -45,12 +45,12 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), xnext(NULL), - fnext(NULL), springF(NULL), tangent(NULL), xsend(NULL), xrecv(NULL), - fsend(NULL), frecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), - tagsendall(NULL), tagrecvall(NULL), counts(NULL), - displacements(NULL) + id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), xnext(nullptr), + fnext(nullptr), springF(nullptr), tangent(nullptr), xsend(nullptr), xrecv(nullptr), + fsend(nullptr), frecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), + tagsendall(nullptr), tagrecvall(nullptr), counts(nullptr), + displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb command"); @@ -237,7 +237,7 @@ void FixNEB::init() if (atom->nmax > maxlocal) reallocate(); - if ((cmode == MULTI_PROC) && (counts == NULL)) { + if ((cmode == MULTI_PROC) && (counts == nullptr)) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -785,9 +785,9 @@ void FixNEB::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 6c4cba4ab..b015839f6 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -38,7 +38,7 @@ enum{NOHYPER,GLOBAL,LOCAL}; /* ---------------------------------------------------------------------- */ -Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(NULL) {} +Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(nullptr) {} /* ---------------------------------------------------------------------- perform hyperdynamics simulation @@ -91,7 +91,7 @@ void Hyper::command(int narg, char **arg) fix_hyper = (FixHyper *) modify->fix[ifix]; int dim; int *hyperflag = (int *) fix_hyper->extract("hyperflag",dim); - if (hyperflag == NULL || *hyperflag == 0) + if (hyperflag == nullptr || *hyperflag == 0) error->all(FLERR,"Hyper fix is not a valid hyperdynamics fix"); if (*hyperflag == 1) hyperstyle = GLOBAL; if (*hyperflag == 2) hyperstyle = LOCAL; @@ -353,7 +353,7 @@ void Hyper::command(int narg, char **arg) delete finish; modify->delete_fix("hyper_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -449,7 +449,7 @@ void Hyper::options(int narg, char **arg) maxeval = 50; dumpflag = 0; ndump = 0; - dumplist = NULL; + dumplist = nullptr; rebond = 0; int iarg = 0; diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 2d1dd6eea..31ce61f4c 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -391,7 +391,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -407,7 +407,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -460,7 +460,7 @@ void NEB::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust atom coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -561,7 +561,7 @@ void NEB::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index cdb1eb9b0..641714115 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -117,9 +117,9 @@ void PRD::command(int narg, char **arg) natoms = atom->natoms; - tagall = NULL; - xall = NULL; - imageall = NULL; + tagall = nullptr; + xall = nullptr; + imageall = nullptr; if (cmode != SINGLE_PROC_DIRECT) { memory->create(tagall,natoms,"prd:tagall"); @@ -127,8 +127,8 @@ void PRD::command(int narg, char **arg) memory->create(imageall,natoms,"prd:imageall"); } - counts = NULL; - displacements = NULL; + counts = nullptr; + displacements = nullptr; if (cmode == MULTI_PROC) { memory->create(counts,nprocs,"prd:counts"); @@ -465,7 +465,7 @@ void PRD::command(int narg, char **arg) modify->delete_compute("prd_temp"); modify->delete_fix("prd_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -908,16 +908,16 @@ void PRD::options(int narg, char **arg) delete [] loop_setting; delete [] dist_setting; - if (strcmp(arg[iarg+1],"all") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = NULL; + if (strcmp(arg[iarg+1],"all") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = nullptr; else error->all(FLERR,"Illegal prd command"); int n = strlen(arg[iarg+1]) + 1; loop_setting = new char[n]; strcpy(loop_setting,arg[iarg+1]); - if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = NULL; - else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = NULL; + if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = nullptr; + else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = nullptr; else error->all(FLERR,"Illegal prd command"); n = strlen(arg[iarg+2]) + 1; dist_setting = new char[n]; diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index db74b63c3..3deda0c50 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -50,7 +50,7 @@ TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {} TAD::~TAD() { memory->sfree(fix_event_list); - if (neb_logfilename != NULL) delete [] neb_logfilename; + if (neb_logfilename != nullptr) delete [] neb_logfilename; delete [] min_style; delete [] min_style_neb; } @@ -62,7 +62,7 @@ TAD::~TAD() void TAD::command(int narg, char **arg) { - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; nmin_event_list = 10; @@ -226,8 +226,8 @@ void TAD::command(int narg, char **arg) ulogfile_lammps = universe->ulogfile; uscreen_lammps = universe->uscreen; - ulogfile_neb = NULL; - uscreen_neb = NULL; + ulogfile_neb = nullptr; + uscreen_neb = nullptr; if (me_universe == 0 && neb_logfilename) ulogfile_neb = fopen(neb_logfilename,"w"); @@ -421,7 +421,7 @@ void TAD::command(int narg, char **arg) modify->delete_fix("tad_revert"); delete_event_list(); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -586,7 +586,7 @@ void TAD::options(int narg, char **arg) min_style_neb = new char[n]; strcpy(min_style_neb,"quickmin"); dt_neb = update->dt; - neb_logfilename = NULL; + neb_logfilename = nullptr; int iarg = 0; while (iarg < narg) { @@ -630,7 +630,7 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb_log") == 0) { delete [] neb_logfilename; if (iarg+2 > narg) error->all(FLERR,"Illegal tad command"); - if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL; + if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = nullptr; else { int n = strlen(arg[iarg+1]) + 1; neb_logfilename = new char[n]; @@ -885,7 +885,7 @@ void TAD::delete_event_list() { modify->delete_fix(str); } memory->sfree(fix_event_list); - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index 0cce389bf..0d15be2aa 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -147,7 +147,7 @@ void Temper::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index a5ed1a671..f6a8f5994 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -42,7 +42,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : - Verlet(lmp, narg, arg), qsize(NULL), qdisp(NULL), xsize(NULL), xdisp(NULL), f_kspace(NULL) + Verlet(lmp, narg, arg), qsize(nullptr), qdisp(nullptr), xsize(nullptr), xdisp(nullptr), f_kspace(nullptr) { // error checks on partitions @@ -194,7 +194,7 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : // allocate dummy version for Kspace partition maxatom = 0; - f_kspace = NULL; + f_kspace = nullptr; if (!master) memory->create(f_kspace,1,1,"verlet/split:f_kspace"); } @@ -289,7 +289,7 @@ void VerletSplit::run(int n) Fix *fix_omp; int ifix = modify->find_fix("package_omp"); - if (ifix < 0) fix_omp = NULL; + if (ifix < 0) fix_omp = nullptr; else fix_omp = modify->fix[ifix]; // flags for timestepping iterations diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index e15c0deb8..43e636963 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeERotateRigid::ComputeERotateRigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute erotate/rigid command"); diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 031919b7a..6ce4440d0 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeKERigid::ComputeKERigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute ke/rigid command"); diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 57f69a64e..c100db82e 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -33,7 +33,7 @@ enum{ID,MOL,MASS,X,Y,Z,XU,YU,ZU,VX,VY,VZ,FX,FY,FZ,IX,IY,IZ, ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rstyle(NULL), idrigid(NULL), fixrigid(NULL), vlocal(NULL), alocal(NULL) + rstyle(nullptr), idrigid(nullptr), fixrigid(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute rigid/local command"); @@ -89,8 +89,8 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; ncount = nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -115,8 +115,8 @@ void ComputeRigidLocal::init() fixrigid = (FixRigidSmall *) modify->fix[ifix]; int flag = 0; - if (strstr(fixrigid->style,"rigid/") == NULL) flag = 1; - if (strstr(fixrigid->style,"/small") == NULL) flag = 1; + if (strstr(fixrigid->style,"rigid/") == nullptr) flag = 1; + if (strstr(fixrigid->style,"/small") == nullptr) flag = 1; if (flag) error->all(FLERR,"Compute rigid/local does not use fix rigid/small fix"); diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 03b79cc75..6b283b2f8 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -45,8 +45,8 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), x(NULL), f(NULL), v(NULL), - mass(NULL), rmass(NULL), type(NULL), scalingmask(NULL) + idregion(nullptr), x(nullptr), f(nullptr), v(nullptr), + mass(nullptr), rmass(nullptr), type(nullptr), scalingmask(nullptr) { MPI_Comm_rank(world, &me); @@ -127,7 +127,7 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), error->all(FLERR, "You can only use the keyword 'com' together with the keyword 'constrain' "); scale = 1.0; - scalingmask = NULL; + scalingmask = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -177,7 +177,7 @@ void FixEHEX::init() if (group->count(igroup) == 0) error->all(FLERR,"Fix ehex group has no atoms"); - fshake = NULL; + fshake = nullptr; if (constraints) { // check if constraining algorithm is used (FixRattle inherits from FixShake) @@ -335,7 +335,7 @@ void FixEHEX::update_scalingmask() { // prematch region - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -354,7 +354,7 @@ void FixEHEX::update_scalingmask() { m = fshake->list[i]; // check if the centre of mass of the cluster is inside the region - // if region == NULL, just check the group information of all sites + // if region == nullptr, just check the group information of all sites if (fshake->shake_flag[m] == 1) nsites = 3; else if (fshake->shake_flag[m] == 2) nsites = 2; diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 436b2191f..07787bcbf 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -59,7 +59,7 @@ FixRattle::FixRattle(LAMMPS *lmp, int narg, char **arg) : // allocate memory for unconstrained velocity update - vp = NULL; + vp = nullptr; grow_arrays(atom->nmax); // default communication mode diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index f74cce823..c40c3b13d 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -46,16 +46,16 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), nrigid(NULL), mol2body(NULL), body2mol(NULL), - body(NULL), displace(NULL), masstotal(NULL), xcm(NULL), - vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), quat(NULL), imagebody(NULL), fflag(NULL), - tflag(NULL), langextra(NULL), sum(NULL), all(NULL), - remapflag(NULL), xcmimage(NULL), eflags(NULL), orient(NULL), - dorient(NULL), id_dilate(NULL), id_gravity(NULL), random(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), nrigid(nullptr), mol2body(nullptr), body2mol(nullptr), + body(nullptr), displace(nullptr), masstotal(nullptr), xcm(nullptr), + vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), quat(nullptr), imagebody(nullptr), fflag(nullptr), + tflag(nullptr), langextra(nullptr), sum(nullptr), all(nullptr), + remapflag(nullptr), xcmimage(nullptr), eflags(nullptr), orient(nullptr), + dorient(nullptr), id_dilate(nullptr), id_gravity(nullptr), random(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr) { int i,ibody; @@ -76,12 +76,12 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = 0; - body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -91,8 +91,8 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix rigid command"); int iarg; - mol2body = NULL; - body2mol = NULL; + mol2body = nullptr; + body2mol = nullptr; // single rigid body // nbody = 1 @@ -322,9 +322,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : t_order = 3; p_chain = 10; - inpfile = NULL; - id_gravity = NULL; - id_dilate = NULL; + inpfile = nullptr; + id_gravity = nullptr; + id_dilate = nullptr; pcouple = NONE; pstyle = ANISO; @@ -567,7 +567,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed if (langflag) random = new RanMars(lmp,seed + me); - else random = NULL; + else random = nullptr; // initialize vector output quantities in case accessed before run @@ -1930,7 +1930,7 @@ void FixRigid::setup_bodies_static() // overwrite Cartesian inertia tensor with file values - if (inpfile) readfile(1,NULL,all,NULL,NULL,NULL,inbody); + if (inpfile) readfile(1,nullptr,all,nullptr,nullptr,nullptr,inbody); // diagonalize inertia tensor for each body via Jacobi rotations // inertia = 3 eigenvalues = principal moments of inertia @@ -2281,12 +2281,12 @@ void FixRigid::readfile(int which, double *vec, if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of fix rigid file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -2327,7 +2327,7 @@ void FixRigid::readfile(int which, double *vec, values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = atoi(values[0]); if (rstyle == MOLECULE) { @@ -2390,7 +2390,7 @@ void FixRigid::write_restart_file(const char *file) auto outfile = std::string(file) + ".rigid"; FILE *fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -2711,7 +2711,7 @@ void *FixRigid::extract(const char *str, int &dim) return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 1df7f3453..0aa5f9976 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -42,12 +42,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : - FixRigid(lmp, narg, arg), conjqm(NULL), w(NULL), - wdti1(NULL), wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), - eta_t(NULL), eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), - f_eta_t(NULL), f_eta_r(NULL), q_b(NULL), eta_b(NULL), - eta_dot_b(NULL), f_eta_b(NULL), rfix(NULL), id_temp(NULL), - id_press(NULL), temperature(NULL), pressure(NULL) + FixRigid(lmp, narg, arg), conjqm(nullptr), w(nullptr), + wdti1(nullptr), wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), + eta_t(nullptr), eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), + f_eta_t(nullptr), f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), + eta_dot_b(nullptr), f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), + id_press(nullptr), temperature(nullptr), pressure(nullptr) { // error checks: could be moved up to FixRigid @@ -145,7 +145,7 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -153,8 +153,8 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -304,7 +304,7 @@ void FixRigidNH::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index d1204e2bb..b599868ec 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -44,12 +44,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : - FixRigidSmall(lmp, narg, arg), w(NULL), wdti1(NULL), - wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), eta_t(NULL), - eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), f_eta_t(NULL), - f_eta_r(NULL), q_b(NULL), eta_b(NULL), eta_dot_b(NULL), - f_eta_b(NULL), rfix(NULL), id_temp(NULL), id_press(NULL), - temperature(NULL), pressure(NULL) + FixRigidSmall(lmp, narg, arg), w(nullptr), wdti1(nullptr), + wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), eta_t(nullptr), + eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), f_eta_t(nullptr), + f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), eta_dot_b(nullptr), + f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), + temperature(nullptr), pressure(nullptr) { // error checks @@ -159,7 +159,7 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -167,8 +167,8 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -301,7 +301,7 @@ void FixRigidNHSmall::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 85cadc826..e7f67ab2b 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -54,12 +54,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), body(NULL), bodyown(NULL), bodytag(NULL), atom2body(NULL), - xcmimage(NULL), displace(NULL), eflags(NULL), orient(NULL), dorient(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL), counts(NULL), - itensor(NULL), mass_body(NULL), langextra(NULL), random(NULL), - id_dilate(NULL), id_gravity(NULL), onemols(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), body(nullptr), bodyown(nullptr), bodytag(nullptr), atom2body(nullptr), + xcmimage(nullptr), displace(nullptr), eflags(nullptr), orient(nullptr), dorient(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr), counts(nullptr), + itensor(nullptr), mass_body(nullptr), langextra(nullptr), random(nullptr), + id_dilate(nullptr), id_gravity(nullptr), onemols(nullptr) { int i; @@ -82,21 +82,21 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = customflag = 0; - bodyown = NULL; - bodytag = NULL; - atom2body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + bodyown = nullptr; + bodytag = nullptr; + atom2body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); // parse args for rigid body specification int *mask = atom->mask; - tagint *bodyID = NULL; + tagint *bodyID = nullptr; int nlocal = atom->nlocal; if (narg < 4) error->all(FLERR,"Illegal fix rigid/small command"); @@ -178,14 +178,14 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : int seed; langflag = 0; - inpfile = NULL; - onemols = NULL; + inpfile = nullptr; + onemols = nullptr; reinitflag = 1; tstat_flag = 0; pstat_flag = 0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; t_chain = 10; t_iter = 1; t_order = 3; @@ -477,13 +477,13 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed maxlang = 0; - langextra = NULL; - random = NULL; + langextra = nullptr; + random = nullptr; if (langflag) random = new RanMars(lmp,seed + comm->me); // mass vector for granular pair styles - mass_body = NULL; + mass_body = nullptr; nmax_mass = 0; // wait to setup bodies until comm stencils are defined @@ -1965,7 +1965,7 @@ void FixRigidSmall::setup_bodies_static() if (inpfile) { memory->create(inbody,nlocal_body,"rigid/small:inbody"); for (ibody = 0; ibody < nlocal_body; ibody++) inbody[ibody] = 0; - readfile(0,NULL,inbody); + readfile(0,nullptr,inbody); } // remap the xcm of each body back into simulation box @@ -2445,12 +2445,12 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid/small file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid/small file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; @@ -2490,7 +2490,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = ATOTAGINT(values[0]); if (id <= 0 || id > maxmol) @@ -2559,7 +2559,7 @@ void FixRigidSmall::write_restart_file(const char *file) if (me == 0) { auto outfile = std::string(file) + ".rigid"; fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -3432,7 +3432,7 @@ void *FixRigidSmall::extract(const char *str, int &dim) return mass_body; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index ee88f5734..c4b0c68f3 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -47,16 +47,16 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), bond_flag(NULL), angle_flag(NULL), - type_flag(NULL), mass_list(NULL), bond_distance(NULL), angle_distance(NULL), - loop_respa(NULL), step_respa(NULL), x(NULL), v(NULL), f(NULL), ftmp(NULL), - vtmp(NULL), mass(NULL), rmass(NULL), type(NULL), shake_flag(NULL), - shake_atom(NULL), shake_type(NULL), xshake(NULL), nshake(NULL), - list(NULL), b_count(NULL), b_count_all(NULL), b_ave(NULL), b_max(NULL), - b_min(NULL), b_ave_all(NULL), b_max_all(NULL), b_min_all(NULL), - a_count(NULL), a_count_all(NULL), a_ave(NULL), a_max(NULL), a_min(NULL), - a_ave_all(NULL), a_max_all(NULL), a_min_all(NULL), atommols(NULL), - onemols(NULL) + Fix(lmp, narg, arg), bond_flag(nullptr), angle_flag(nullptr), + type_flag(nullptr), mass_list(nullptr), bond_distance(nullptr), angle_distance(nullptr), + loop_respa(nullptr), step_respa(nullptr), x(nullptr), v(nullptr), f(nullptr), ftmp(nullptr), + vtmp(nullptr), mass(nullptr), rmass(nullptr), type(nullptr), shake_flag(nullptr), + shake_atom(nullptr), shake_type(nullptr), xshake(nullptr), nshake(nullptr), + list(nullptr), b_count(nullptr), b_count_all(nullptr), b_ave(nullptr), b_max(nullptr), + b_min(nullptr), b_ave_all(nullptr), b_max_all(nullptr), b_min_all(nullptr), + a_count(nullptr), a_count_all(nullptr), a_ave(nullptr), a_max(nullptr), a_min(nullptr), + a_ave_all(nullptr), a_max_all(nullptr), a_min_all(nullptr), atommols(nullptr), + onemols(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -76,13 +76,13 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; - xshake = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; + xshake = nullptr; - ftmp = NULL; - vtmp = NULL; + ftmp = nullptr; + vtmp = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -161,7 +161,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // parse optional args - onemols = NULL; + onemols = nullptr; int iarg = next; while (iarg < narg) { @@ -233,7 +233,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // initialize list of SHAKE clusters to constrain maxlist = 0; - list = NULL; + list = nullptr; } /* ---------------------------------------------------------------------- */ @@ -367,7 +367,7 @@ void FixShake::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for SHAKE"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -378,7 +378,7 @@ void FixShake::init() for (i = 1; i <= atom->nangletypes; i++) { if (angle_flag[i] == 0) continue; - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle potential must be defined for SHAKE"); // scan all atoms for a SHAKE angle cluster @@ -2976,7 +2976,7 @@ void *FixShake::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"onemol") == 0) return onemols; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 509e45202..306196210 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -35,8 +35,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomx(NULL), randomt(NULL), basistype(NULL), - spatialid(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomx(nullptr), randomt(nullptr), basistype(nullptr), + spatialid(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; @@ -48,7 +48,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : scaleflag = 1; spatflag=0; - spatialid = NULL; + spatialid = nullptr; xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0; tempflag = 0; @@ -58,8 +58,8 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : rany = 0.0; ranz = 0.0; - randomx = NULL; - randomt = NULL; + randomx = nullptr; + randomt = nullptr; if (domain->lattice->nbasis == 0) error->all(FLERR,"Fix append/atoms requires a lattice be defined"); diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 393013322..1b2e73726 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -41,9 +41,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), old_velocity(NULL), rfix(NULL), - id_temp(NULL), id_press(NULL), id_pe(NULL), temperature(NULL), - pressure(NULL), pe(NULL) + Fix(lmp, narg, arg), old_velocity(nullptr), rfix(nullptr), + id_temp(nullptr), id_press(nullptr), id_pe(nullptr), temperature(nullptr), + pressure(nullptr), pe(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix msst command"); @@ -206,10 +206,10 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : omega[0] = omega[1] = omega[2] = 0.0; nrigid = 0; - rfix = NULL; + rfix = nullptr; maxold = -1; - old_velocity = NULL; + old_velocity = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,7 +246,7 @@ int FixMSST::setmask() void FixMSST::init() { - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); // set compute ptrs @@ -287,7 +287,7 @@ void FixMSST::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^rigid") || @@ -306,7 +306,7 @@ void FixMSST::init() for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^external$")) fix_external = (FixExternal *) modify->fix[i]; - if (fix_external == NULL) + if (fix_external == nullptr) error->all(FLERR,"Fix msst dftb cannot be used w/out fix external"); } } diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 1179bb6b3..20fa909af 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -30,7 +30,7 @@ enum{ISO,ANISO,TRICLINIC}; // same as fix_nh.cpp /* ---------------------------------------------------------------------- */ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), pe(NULL), id_pe(NULL) + FixNH(lmp, narg, arg), pe(nullptr), id_pe(nullptr) { // Prevent masses from being updated every timestep diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index a796c1a4b..b37537022 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -31,15 +31,15 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomt(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomt(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; if (narg < 4) error->all(FLERR,"Illegal fix wall/piston command"); - randomt = NULL; - gfactor1 = gfactor2 = NULL; + randomt = nullptr; + gfactor1 = gfactor2 = nullptr; tempflag = 0; scaleflag = 1; roughflag = 0; diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 37b82b86f..66d6abfb7 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), sna(nullptr), + radelem(nullptr), wjelem(nullptr) { double rmin0, rfac0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -145,7 +145,7 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - sna = NULL; + sna = nullptr; } /* ---------------------------------------------------------------------- */ @@ -163,7 +163,7 @@ ComputeSNAAtom::~ComputeSNAAtom() void ComputeSNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute sna/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index bb546708b..e08679a37 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snad(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -147,7 +147,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snad = NULL; + snad = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeSNADAtom::~ComputeSNADAtom() void ComputeSNADAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snad/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index ca989a75b..5537d2c93 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -32,9 +32,9 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snap(NULL), - snapall(NULL), snap_peratom(NULL), radelem(NULL), wjelem(NULL), - snaptr(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snap(nullptr), + snapall(nullptr), snap_peratom(nullptr), radelem(nullptr), wjelem(nullptr), + snaptr(nullptr) { array_flag = 1; @@ -42,8 +42,8 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -180,7 +180,7 @@ ComputeSnap::~ComputeSnap() void ComputeSnap::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snap requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index dd562cac5..cace5e532 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -29,13 +29,13 @@ using namespace LAMMPS_NS; ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snav(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -140,7 +140,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snav = NULL; + snav = nullptr; } @@ -160,7 +160,7 @@ ComputeSNAVAtom::~ComputeSNAVAtom() void ComputeSNAVAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snav/atom requires a pair style be defined"); // TODO: Not sure what to do with this error check since cutoff radius is not // a single number diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index cb1a71aa4..e3b8fdfa9 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -42,15 +42,15 @@ PairSNAP::PairSNAP(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - coeffelem = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + coeffelem = nullptr; beta_max = 0; - beta = NULL; - bispectrum = NULL; - snaptr = NULL; + beta = nullptr; + bispectrum = nullptr; + snaptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -516,7 +516,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpcoeff; if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); - if (fpcoeff == NULL) { + if (fpcoeff == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP coefficient file %s",coefffilename); error->one(FLERR,str); @@ -531,7 +531,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -556,7 +556,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); ncoeffall = atoi(words[1]); @@ -574,7 +574,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -592,9 +592,9 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); iword = 2; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); char* elemtmp = words[0]; int n = strlen(elemtmp) + 1; @@ -615,7 +615,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) for (int icoeff = 0; icoeff < ncoeffall; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -663,7 +663,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpparam; if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); - if (fpparam == NULL) { + if (fpparam == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP parameter file %s",paramfilename); error->one(FLERR,str); @@ -674,7 +674,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -697,7 +697,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { if (screen) fprintf(screen,"SNAP keyword %s %s \n",keywd,keyval); diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index e003ec7ca..ae250c6f7 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -134,16 +134,16 @@ SNA::SNA(LAMMPS* lmp, double rfac0_in, int twojmax_in, compute_ncoeff(); - rij = NULL; - inside = NULL; - wj = NULL; - rcutij = NULL; - element = NULL; + rij = nullptr; + inside = nullptr; + wj = nullptr; + rcutij = nullptr; + element = nullptr; nmax = 0; - idxz = NULL; - idxb = NULL; - ulist_r_ij = NULL; - ulist_i_ij = NULL; + idxz = nullptr; + idxb = nullptr; + ulist_r_ij = nullptr; + ulist_i_ij = nullptr; build_indexlist(); create_twojmax_arrays(); @@ -1332,7 +1332,7 @@ void SNA::create_twojmax_arrays() if (bzero_flag) memory->create(bzero, twojmax+1,"sna:bzero"); else - bzero = NULL; + bzero = nullptr; } diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 281100740..32f9e7351 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -41,7 +41,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeSpin::ComputeSpin(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), pair(NULL), spin_pairs(NULL) + Compute(lmp, narg, arg), pair(nullptr), spin_pairs(nullptr) { if ((narg != 3) && (narg != 4)) error->all(FLERR,"Illegal compute compute/spin command"); diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 82bf83ac1..2b3aa363f 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_temp(NULL), random(NULL) + Fix(lmp, narg, arg), id_temp(nullptr), random(nullptr) { if (narg != 6) error->all(FLERR,"Illegal langevin/spin command"); diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 0b2e86e46..b2982e7bc 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -46,13 +46,13 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; /* ---------------------------------------------------------------------- */ FixNEBSpin::FixNEBSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), - xnext(NULL), fnext(NULL), spprev(NULL), spnext(NULL), fmnext(NULL), springF(NULL), - tangent(NULL), xsend(NULL), xrecv(NULL), fsend(NULL), frecv(NULL), spsend(NULL), - sprecv(NULL), fmsend(NULL), fmrecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), spsendall(NULL), - sprecvall(NULL), fmsendall(NULL), fmrecvall(NULL), tagsendall(NULL), tagrecvall(NULL), - counts(NULL), displacements(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), + xnext(nullptr), fnext(nullptr), spprev(nullptr), spnext(nullptr), fmnext(nullptr), springF(nullptr), + tangent(nullptr), xsend(nullptr), xrecv(nullptr), fsend(nullptr), frecv(nullptr), spsend(nullptr), + sprecv(nullptr), fmsend(nullptr), fmrecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), spsendall(nullptr), + sprecvall(nullptr), fmsendall(nullptr), fmrecvall(nullptr), tagsendall(nullptr), tagrecvall(nullptr), + counts(nullptr), displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb_spin command"); @@ -229,7 +229,7 @@ void FixNEBSpin::init() if (atom->nmax > maxlocal) reallocate(); - if (MULTI_PROC && counts == NULL) { + if (MULTI_PROC && counts == nullptr) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -861,9 +861,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } if (spsend) { @@ -872,9 +872,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fmsend[0],3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, spsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 462a359d9..d74e82e50 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -60,9 +60,9 @@ enum{NONE}; FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), spin_pairs(NULL), - rsec(NULL), stack_head(NULL), stack_foot(NULL), - backward_stacks(NULL), forward_stacks(NULL) + pair(nullptr), spin_pairs(nullptr), + rsec(nullptr), stack_head(nullptr), stack_foot(nullptr), + backward_stacks(nullptr), forward_stacks(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_nve_spin); diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index cbb367e43..f4dfddd3c 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -44,7 +44,7 @@ enum{CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ -FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(NULL) +FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(nullptr) { if (narg < 7) error->all(FLERR,"Illegal precession/spin command"); @@ -59,7 +59,7 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm respa_level_support = 1; ilevel_respa = 0; - magstr = NULL; + magstr = nullptr; magfieldstyle = CONSTANT; H_field = 0.0; diff --git a/src/SPIN/fix_setforce_spin.cpp b/src/SPIN/fix_setforce_spin.cpp index ec738b752..1f38ee43e 100644 --- a/src/SPIN/fix_setforce_spin.cpp +++ b/src/SPIN/fix_setforce_spin.cpp @@ -52,7 +52,7 @@ void FixSetForceSpin::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -124,7 +124,7 @@ void FixSetForceSpin::single_setforce_spin(int i, double fmi[3]) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -195,7 +195,7 @@ void FixSetForceSpin::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index 4b8b74541..817c14939 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -60,7 +60,7 @@ static const char cite_minstyle_spin_cg[] = /* ---------------------------------------------------------------------- */ MinSpinCG::MinSpinCG(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_cg); nlocal_max = 0; diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index 40029b7e7..edabcf6bb 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -60,7 +60,7 @@ static const char cite_minstyle_spin_lbfgs[] = /* ---------------------------------------------------------------------- */ MinSpinLBFGS::MinSpinLBFGS(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), rho(NULL), ds(NULL), dy(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), rho(nullptr), ds(nullptr), dy(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_lbfgs); nlocal_max = 0; diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index a89ca403c..322249e02 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -384,7 +384,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -398,7 +398,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -452,7 +452,7 @@ void NEBSpin::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust spin coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -705,7 +705,7 @@ void NEBSpin::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index b0965d127..53dd6530b 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -42,7 +42,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(NULL) +PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(nullptr) { hbar = force->hplanck/MY_2PI; single_enable = 0; diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 8bbb27ed0..9db2bd417 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -27,7 +27,7 @@ friend class FixNVESpin; virtual void coeff(int, char **) {} virtual void init_style(); virtual double init_one(int, int) {return 0.0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void compute(int, int) {} virtual void compute_single_pair(int, double *) {} diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index b27c9736b..7444be347 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -154,7 +154,7 @@ void *PairSpinDipoleCut::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -448,11 +448,11 @@ void PairSpinDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -477,8 +477,8 @@ void PairSpinDipoleCut::write_restart_settings(FILE *fp) void PairSpinDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dipole_long.cpp b/src/SPIN/pair_spin_dipole_long.cpp index d4b1b8e43..28a70a047 100644 --- a/src/SPIN/pair_spin_dipole_long.cpp +++ b/src/SPIN/pair_spin_dipole_long.cpp @@ -133,7 +133,7 @@ void PairSpinDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -174,7 +174,7 @@ void *PairSpinDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -527,11 +527,11 @@ void PairSpinDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -556,8 +556,8 @@ void PairSpinDipoleLong::write_restart_settings(FILE *fp) void PairSpinDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index e27f9fad7..e2ddd708d 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -156,7 +156,7 @@ void *PairSpinDmi::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_dmi_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -477,18 +477,18 @@ void PairSpinDmi::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&DM[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_dmx[i][j],1,MPI_DOUBLE,0,world); @@ -522,9 +522,9 @@ void PairSpinDmi::write_restart_settings(FILE *fp) void PairSpinDmi::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_dmi_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 27da47dd0..ba9bddb7c 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -141,7 +141,7 @@ void *PairSpinExchange::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_exchange_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -467,15 +467,15 @@ void PairSpinExchange::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&J1_mag[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&J1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -506,9 +506,9 @@ void PairSpinExchange::write_restart_settings(FILE *fp) void PairSpinExchange::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_exchange_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 2242cf985..849590bad 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -149,7 +149,7 @@ void *PairSpinMagelec::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_magelec_global; - return NULL; + return nullptr; } @@ -465,15 +465,15 @@ void PairSpinMagelec::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&ME[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_mex[i][j],1,MPI_DOUBLE,0,world); @@ -503,9 +503,9 @@ void PairSpinMagelec::write_restart_settings(FILE *fp) void PairSpinMagelec::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_magelec_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 33ea904c0..1e50ee48a 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -156,7 +156,7 @@ void *PairSpinNeel::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_neel_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -681,19 +681,19 @@ void PairSpinNeel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&g1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&g1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -727,9 +727,9 @@ void PairSpinNeel::write_restart_settings(FILE *fp) void PairSpinNeel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_neel_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 688522c1b..50a27b5fa 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -77,12 +77,12 @@ static const char cite_fix_srd[] = /* ---------------------------------------------------------------------- */ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - wallfix(NULL), wallwhich(NULL), xwall(NULL), xwallhold(NULL), - vwall(NULL), fwall(NULL), avec_ellipsoid(NULL), avec_line(NULL), - avec_tri(NULL), random(NULL), randomshift(NULL), flocal(NULL), - tlocal(NULL), biglist(NULL), binhead(NULL), binnext(NULL), sbuf1(NULL), - sbuf2(NULL), rbuf1(NULL), rbuf2(NULL), nbinbig(NULL), binbig(NULL), - binsrd(NULL), stencil(NULL) + wallfix(nullptr), wallwhich(nullptr), xwall(nullptr), xwallhold(nullptr), + vwall(nullptr), fwall(nullptr), avec_ellipsoid(nullptr), avec_line(nullptr), + avec_tri(nullptr), random(nullptr), randomshift(nullptr), flocal(nullptr), + tlocal(nullptr), biglist(nullptr), binhead(nullptr), binnext(nullptr), sbuf1(nullptr), + sbuf2(nullptr), rbuf1(nullptr), rbuf2(nullptr), nbinbig(nullptr), binbig(nullptr), + binsrd(nullptr), stencil(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_srd); @@ -232,7 +232,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) randomshift = new RanPark(lmp,shiftseed); - else randomshift = NULL; + else randomshift = nullptr; // initialize data structs and flags @@ -240,31 +240,31 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), else biggroupbit = 0; nmax = 0; - binhead = NULL; + binhead = nullptr; maxbin1 = 0; - binnext = NULL; + binnext = nullptr; maxbuf = 0; - sbuf1 = sbuf2 = rbuf1 = rbuf2 = NULL; + sbuf1 = sbuf2 = rbuf1 = rbuf2 = nullptr; shifts[0].maxvbin = shifts[1].maxvbin = 0; - shifts[0].vbin = shifts[1].vbin = NULL; + shifts[0].vbin = shifts[1].vbin = nullptr; shifts[0].maxbinsq = shifts[1].maxbinsq = 0; for (int ishift = 0; ishift < 2; ishift++) for (int iswap = 0; iswap < 6; iswap++) shifts[ishift].bcomm[iswap].sendlist = - shifts[ishift].bcomm[iswap].recvlist = NULL; + shifts[ishift].bcomm[iswap].recvlist = nullptr; maxbin2 = 0; - nbinbig = NULL; - binbig = NULL; - binsrd = NULL; + nbinbig = nullptr; + binbig = nullptr; + binsrd = nullptr; nstencil = maxstencil = 0; - stencil = NULL; + stencil = nullptr; maxbig = 0; - biglist = NULL; + biglist = nullptr; stats_flag = 1; for (int i = 0; i < size_vector; i++) stats_all[i] = 0.0; @@ -1367,7 +1367,7 @@ void FixSRD::collisions_single() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1, xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1387,7 +1387,7 @@ void FixSRD::collisions_single() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) @@ -1557,7 +1557,7 @@ void FixSRD::collisions_multi() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1,xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1576,7 +1576,7 @@ void FixSRD::collisions_multi() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index 8ffd76444..aa8a4140a 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -34,7 +34,7 @@ enum{NONE,EDGE,CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), nwall(0), fwall(NULL), fwall_all(NULL) + Fix(lmp, narg, arg), nwall(0), fwall(nullptr), fwall_all(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/srd command"); diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 063dc542b..5df63682b 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -50,7 +50,7 @@ extern "C" { #define MPI_GROUP_EMPTY -1 #define MPI_ANY_SOURCE -1 -#define MPI_STATUS_IGNORE NULL +#define MPI_STATUS_IGNORE nullptr #define MPI_Comm int #define MPI_Request int @@ -60,7 +60,7 @@ extern "C" { #define MPI_Group int #define MPI_Offset long -#define MPI_IN_PLACE NULL +#define MPI_IN_PLACE nullptr #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 diff --git a/src/USER-ADIOS/dump_atom_adios.cpp b/src/USER-ADIOS/dump_atom_adios.cpp index 3012223ac..121bb193e 100644 --- a/src/USER-ADIOS/dump_atom_adios.cpp +++ b/src/USER-ADIOS/dump_atom_adios.cpp @@ -190,7 +190,7 @@ void DumpAtomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); diff --git a/src/USER-ADIOS/dump_custom_adios.cpp b/src/USER-ADIOS/dump_custom_adios.cpp index f7015ef69..921c725bc 100644 --- a/src/USER-ADIOS/dump_custom_adios.cpp +++ b/src/USER-ADIOS/dump_custom_adios.cpp @@ -274,7 +274,7 @@ void DumpCustomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); diff --git a/src/USER-ADIOS/reader_adios.cpp b/src/USER-ADIOS/reader_adios.cpp index d1e731343..89a9ae698 100644 --- a/src/USER-ADIOS/reader_adios.cpp +++ b/src/USER-ADIOS/reader_adios.cpp @@ -73,7 +73,7 @@ public: ReaderADIOS::ReaderADIOS(LAMMPS *lmp) : Reader(lmp) { - fieldindex = NULL; + fieldindex = nullptr; nAtoms = 0; nAtomsTotal = 0; atomOffset = 0; @@ -230,7 +230,7 @@ void ReaderADIOS::skip() { internal->fh.EndStep(); } match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index dd0267646..e5e42115f 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -48,7 +48,7 @@ using std::string; /* ------------------------------------------------------------------------- */ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - lammps_(lmp), atc_(NULL) + lammps_(lmp), atc_(nullptr) { // ID GROUP atc PHYSICSTYPE [PARAMETERFILE] if (narg < 4 || narg > 5) lmp->error->all(FLERR,"Illegal fix atc command"); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 5e23b7fc6..870a15407 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -49,8 +49,8 @@ PairAWPMDCut::PairAWPMDCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_var = NULL; - min_varforce = NULL; + min_var = nullptr; + min_varforce = nullptr; nextra = 4; pvector = new double[nextra]; @@ -82,7 +82,7 @@ PairAWPMDCut::~PairAWPMDCut() struct cmp_x{ double **xx; double tol; - cmp_x(double **xx_=NULL, double tol_=1e-12):xx(xx_),tol(tol_){} + cmp_x(double **xx_=nullptr, double tol_=1e-12):xx(xx_),tol(tol_){} bool operator()(const pair &left, const pair &right) const { if(left.first==right.first){ double d=xx[left.second][0]-xx[right.second][0]; @@ -241,7 +241,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) error->all(FLERR,logfmt("Invalid spin value (%d) for particle %d !",spin[i],i)); } // ion force vector - Vector_3 *fi=NULL; + Vector_3 *fi=nullptr; if(wpmd->ni) fi= new Vector_3[wpmd->ni]; @@ -269,7 +269,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) atom->ervel[i]=pv/(m*ermscale); } } - wpmd->set_pbc(NULL); // not required for LAMMPS + wpmd->set_pbc(nullptr); // not required for LAMMPS wpmd->interaction(0x1|0x4|0x10,fi); // get forces from the AWPMD solver object @@ -602,10 +602,10 @@ void PairAWPMDCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -629,9 +629,9 @@ void PairAWPMDCut::write_restart_settings(FILE *fp) void PairAWPMDCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index a4b8de84b..46aabf790 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -39,7 +39,7 @@ using namespace LAMMPS_NS; ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure/bocs command"); if (igroup) error->all(FLERR,"Compute pressure/bocs must use group all"); @@ -52,12 +52,12 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : timeflag = 1; p_match_flag = 0; - phi_coeff = NULL; + phi_coeff = nullptr; // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -104,15 +104,15 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure/bocs requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; - splines = NULL; + splines = nullptr; spline_length = 0; } @@ -149,7 +149,7 @@ void ComputePressureBocs::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairflag && force->pair) nvirial++; if (bondflag && atom->molecular && force->bond) nvirial++; @@ -179,7 +179,7 @@ void ComputePressureBocs::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* Extra functions added for BOCS */ diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 6f7962c83..0dad793fd 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -75,10 +75,10 @@ const int MAX_MESSAGE_LENGTH = 255; FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_bocs_package); @@ -98,7 +98,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -113,12 +113,12 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; - p_match_coeffs = NULL; + p_match_coeffs = nullptr; - splines = NULL; + splines = nullptr; spline_length = 0; // turn on tilt factor scaling, whenever applicable @@ -385,10 +385,10 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -481,7 +481,7 @@ FixBocs::~FixBocs() if (p_match_coeffs) free(p_match_coeffs); // Free splines memory structure - if (splines != NULL) { + if (splines != nullptr) { memory->destroy(splines); spline_length = 0; } @@ -629,7 +629,7 @@ void FixBocs::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -918,7 +918,7 @@ void FixBocs::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1924,7 +1924,7 @@ void *FixBocs::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index c9540bf0c..f135c6b7e 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -359,9 +359,9 @@ void BondOxdnaFene::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&Delta[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index 662d55c59..6ddf03518 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -815,47 +815,47 @@ void PairOxdna2Coaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,nullptr,error); } @@ -919,9 +919,9 @@ void PairOxdna2Coaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1023,5 +1023,5 @@ void *PairOxdna2Coaxstk::extract(const char *str, int &dim) if (strcmp(str,"AA_cxst1") == 0) return (void *) AA_cxst1; if (strcmp(str,"BB_cxst1") == 0) return (void *) BB_cxst1; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna2_dh.cpp b/src/USER-CGDNA/pair_oxdna2_dh.cpp index f23ca4fbf..1c4bd3bf0 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxdna2_dh.cpp @@ -437,16 +437,16 @@ void PairOxdna2Dh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -479,9 +479,9 @@ void PairOxdna2Dh::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -531,5 +531,5 @@ void *PairOxdna2Dh::extract(const char *str, int &dim) if (strcmp(str,"cut_dh_ast") == 0) return (void *) cut_dh_ast; if (strcmp(str,"cut_dh_c") == 0) return (void *) cut_dh_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp index f1d425a0b..3a1ee3d12 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp @@ -974,53 +974,53 @@ void PairOxdnaCoaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1090,9 +1090,9 @@ void PairOxdnaCoaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1205,5 +1205,5 @@ void *PairOxdnaCoaxstk::extract(const char *str, int &dim) if (strcmp(str,"b_cxst4p") == 0) return (void *) b_cxst4p; if (strcmp(str,"cosphi_cxst4p_c") == 0) return (void *) cosphi_cxst4p_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_excv.cpp b/src/USER-CGDNA/pair_oxdna_excv.cpp index ad96186b6..64881cae2 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna_excv.cpp @@ -696,26 +696,26 @@ void PairOxdnaExcv::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -758,9 +758,9 @@ void PairOxdnaExcv::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -824,5 +824,5 @@ void *PairOxdnaExcv::extract(const char *str, int &dim) if (strcmp(str,"b_bb") == 0) return (void *) b_bb; if (strcmp(str,"cut_bb_c") == 0) return (void *) cut_bb_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_hbond.cpp b/src/USER-CGDNA/pair_oxdna_hbond.cpp index 7987210d7..009b96717 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.cpp +++ b/src/USER-CGDNA/pair_oxdna_hbond.cpp @@ -986,58 +986,58 @@ void PairOxdnaHbond::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1112,9 +1112,9 @@ void PairOxdnaHbond::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1232,5 +1232,5 @@ void *PairOxdnaHbond::extract(const char *str, int &dim) if (strcmp(str,"b_hb8") == 0) return (void *) b_hb8; if (strcmp(str,"dtheta_hb8_c") == 0) return (void *) dtheta_hb8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_stk.cpp b/src/USER-CGDNA/pair_oxdna_stk.cpp index bf52d6118..87b22f446 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.cpp +++ b/src/USER-CGDNA/pair_oxdna_stk.cpp @@ -1094,49 +1094,49 @@ void PairOxdnaStk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1202,9 +1202,9 @@ void PairOxdnaStk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1308,5 +1308,5 @@ void *PairOxdnaStk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_xstk.cpp b/src/USER-CGDNA/pair_oxdna_xstk.cpp index 175149968..29c78c103 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_xstk.cpp @@ -933,56 +933,56 @@ void PairOxdnaXstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1055,9 +1055,9 @@ void PairOxdnaXstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1173,5 +1173,5 @@ void *PairOxdnaXstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_stk.cpp b/src/USER-CGDNA/pair_oxrna2_stk.cpp index fd0294613..fff552908 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_stk.cpp @@ -1191,55 +1191,55 @@ void PairOxrna2Stk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1311,9 +1311,9 @@ void PairOxrna2Stk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1427,5 +1427,5 @@ void *PairOxrna2Stk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.cpp b/src/USER-CGDNA/pair_oxrna2_xstk.cpp index 673ef1c9a..9fe4bebab 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_xstk.cpp @@ -855,50 +855,50 @@ void PairOxrna2Xstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -965,9 +965,9 @@ void PairOxrna2Xstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1073,5 +1073,5 @@ void *PairOxrna2Xstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGSDK/angle_sdk.cpp b/src/USER-CGSDK/angle_sdk.cpp index 6f97d2104..bdcb03c3c 100644 --- a/src/USER-CGSDK/angle_sdk.cpp +++ b/src/USER-CGSDK/angle_sdk.cpp @@ -290,7 +290,7 @@ void AngleSDK::init_style() if (repflag) { int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle style SDK requires use of a compatible with Pair style"); lj1 = (double **) force->pair->extract("lj1",itmp); @@ -333,9 +333,9 @@ void AngleSDK::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index 8185e2487..6c3e15089 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -374,14 +374,14 @@ void PairLJSDK::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -411,10 +411,10 @@ void PairLJSDK::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -484,7 +484,7 @@ void *PairLJSDK::extract(const char *str, int &dim) if (strcmp(str,"lj4") == 0) return (void *) lj4; if (strcmp(str,"rminsq") == 0) return (void *) rminsq; if (strcmp(str,"emin") == 0) return (void *) emin; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 42f1ff3ce..2e21bdd10 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -51,7 +51,7 @@ PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -361,13 +361,13 @@ void PairLJSDKCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables (no rRESPA support yet) - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -466,14 +466,14 @@ void PairLJSDKCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -505,13 +505,13 @@ void PairLJSDKCoulLong::write_restart_settings(FILE *fp) void PairLJSDKCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -643,7 +643,7 @@ void *PairLJSDKCoulLong::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp index 8aa16b4ad..9818b7c51 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp @@ -37,7 +37,7 @@ PairLJSDKCoulMSM::PairLJSDKCoulMSM(LAMMPS *lmp) : PairLJSDKCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; respa_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,6 +308,6 @@ void *PairLJSDKCoulMSM::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"cut_msm") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp index dabb0bf92..f265271bb 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.cpp +++ b/src/USER-COLVARS/colvarproxy_lammps.cpp @@ -179,9 +179,9 @@ int colvarproxy_lammps::read_state_file(char const *state_filename) colvarproxy_lammps::~colvarproxy_lammps() { delete _random; - if (colvars != NULL) { + if (colvars != nullptr) { delete colvars; - colvars = NULL; + colvars = nullptr; } } diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index fcbfb5845..eaa0d272c 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -194,7 +194,7 @@ int inthash_lookup(void *ptr, int key) { /* find the entry in the hash table */ h=inthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -246,7 +246,7 @@ void inthash_destroy(inthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -254,7 +254,7 @@ void inthash_destroy(inthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(inthash_t)); } @@ -276,7 +276,7 @@ int FixColvars::instances=0; optional keyword value pairs: input (for restarting/continuing, defaults to - NULL, but set to at end) + nullptr, but set to at end) output (defaults to 'out') seed (seed for RNG, defaults to '1966') tstat (label of thermostatting fix) @@ -305,9 +305,9 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : rng_seed = 1966; unwrap_flag = 1; - inp_name = NULL; - out_name = NULL; - tmp_name = NULL; + inp_name = nullptr; + out_name = nullptr; + tmp_name = nullptr; /* parse optional arguments */ int argsdone = 4; @@ -346,10 +346,10 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : nlevels_respa = 0; init_flag = 0; num_coords = 0; - comm_buf = NULL; - force_buf = NULL; - proxy = NULL; - idmap = NULL; + comm_buf = nullptr; + force_buf = nullptr; + proxy = nullptr; + idmap = nullptr; /* storage required to communicate a single coordinate or force. */ size_one = sizeof(struct commdata); @@ -445,7 +445,7 @@ void FixColvars::one_time_init() if (inp_name) { if (strcmp(inp_name,"NULL") == 0) { memory->sfree(inp_name); - inp_name = NULL; + inp_name = nullptr; } } @@ -961,7 +961,7 @@ void FixColvars::write_restart(FILE *fp) proxy->serialize_status(rest_text); // TODO call write_output_files() const char *cvm_state = rest_text.c_str(); - int len = strlen(cvm_state) + 1; // need to include terminating NULL byte. + int len = strlen(cvm_state) + 1; // need to include terminating nullptr byte. fwrite(&len,sizeof(int),1,fp); fwrite(cvm_state,1,len,fp); } diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 07a8ac2d5..37b853ba9 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -143,7 +143,7 @@ void Group2Ndx::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for writing"); if (screen) diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index bab1592b1..e09084ebf 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -36,13 +36,13 @@ static char *find_section(FILE *fp, const char *name) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - if ((t != NULL) && *t == '[') { - t = strtok(NULL," \t\n\r\f"); - if (t != NULL) { + if ((t != nullptr) && *t == '[') { + t = strtok(nullptr," \t\n\r\f"); + if (t != nullptr) { n = t; - t = strtok(NULL," \t\n\r\f"); - if ((t != NULL) && *t == ']') { - if ((name == NULL) || strcmp(name,n) == 0) { + t = strtok(nullptr," \t\n\r\f"); + if ((t != nullptr) && *t == ']') { + if ((name == nullptr) || strcmp(name,n) == 0) { int l = strlen(n); r = new char[l+1]; strncpy(r,n,l+1); @@ -52,7 +52,7 @@ static char *find_section(FILE *fp, const char *name) } } } - return NULL; + return nullptr; } static tagint *read_section(FILE *fp, bigint &num) @@ -68,7 +68,7 @@ static tagint *read_section(FILE *fp, bigint &num) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - while (t != NULL) { + while (t != nullptr) { // start of a new section. we are done here. if (*t == '[') return tagbuf; @@ -77,7 +77,7 @@ static tagint *read_section(FILE *fp, bigint &num) nmax += DELTA; tagbuf = (tagint *)realloc(tagbuf,sizeof(tagint)*nmax); } - t = strtok(NULL," \t\n\r\f"); + t = strtok(nullptr," \t\n\r\f"); } } return tagbuf; @@ -90,7 +90,7 @@ void Ndx2Group::command(int narg, char **arg) int len; bigint num; FILE *fp; - char *name = NULL; + char *name = nullptr; tagint *tags; if (narg < 1) error->all(FLERR,"Illegal ndx2group command"); @@ -100,7 +100,7 @@ void Ndx2Group::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for reading"); if (screen) @@ -117,15 +117,15 @@ void Ndx2Group::command(int narg, char **arg) // find the next section. // if we had processed a section, before we need to step back - if (name != NULL) { + if (name != nullptr) { rewind(fp); char *tmp = find_section(fp,name); delete[] tmp; delete[] name; - name = NULL; + name = nullptr; } - name = find_section(fp,NULL); - if (name != NULL) { + name = find_section(fp,nullptr); + if (name != nullptr) { len=strlen(name)+1; // skip over group "all", which is called "System" in gromacs @@ -171,10 +171,10 @@ void Ndx2Group::command(int narg, char **arg) len = 0; // find named section, search from beginning of file - if (name != NULL) delete[] name; + if (name != nullptr) delete[] name; rewind(fp); name = find_section(fp,arg[idx]); - if (name != NULL) len=strlen(name)+1; + if (name != nullptr) len=strlen(name)+1; if (screen) fprintf(screen," %s group '%s'\n", diff --git a/src/USER-DIFFRACTION/compute_saed.cpp b/src/USER-DIFFRACTION/compute_saed.cpp index d16fbf287..f35ea6679 100644 --- a/src/USER-DIFFRACTION/compute_saed.cpp +++ b/src/USER-DIFFRACTION/compute_saed.cpp @@ -49,7 +49,7 @@ static const char cite_compute_saed_c[] = /* ---------------------------------------------------------------------- */ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_saed_c); diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp index b48de49c8..633467fe3 100644 --- a/src/USER-DIFFRACTION/compute_xrd.cpp +++ b/src/USER-DIFFRACTION/compute_xrd.cpp @@ -50,7 +50,7 @@ static const char cite_compute_xrd_c[] = /* ---------------------------------------------------------------------- */ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_xrd_c); diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 39382264c..00cfcbf91 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -40,8 +40,8 @@ enum{FIRST,MULTI}; /* ---------------------------------------------------------------------- */ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ids(NULL), fp(NULL), vector(NULL), - vector_total(NULL), vector_list(NULL), compute_saed(NULL), filename(NULL) + Fix(lmp, narg, arg), ids(nullptr), fp(nullptr), vector(nullptr), + vector_total(nullptr), vector_list(nullptr), compute_saed(nullptr), filename(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix saed/vtk command"); @@ -66,7 +66,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : options(narg,arg); which = 0; - ids = NULL; + ids = nullptr; nvalues = 0; @@ -136,8 +136,8 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; if (ave == WINDOW) memory->create(vector_list,nwindow,nvalues,"saed/vtk:vector_list"); @@ -145,7 +145,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : memory->create(vector,nrows,"saed/vtk:vector"); memory->create(vector_total,nrows,"saed/vtk:vector_total"); - extlist = NULL; + extlist = nullptr; vector_flag = 1; size_vector = nrows; @@ -425,7 +425,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); @@ -531,7 +531,7 @@ void FixSAEDVTK::options(int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; overwrite = 0; @@ -552,7 +552,7 @@ void FixSAEDVTK::options(int narg, char **arg) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); diff --git a/src/USER-DPD/compute_dpd_atom.cpp b/src/USER-DPD/compute_dpd_atom.cpp index 0fd732f66..95141e2de 100644 --- a/src/USER-DPD/compute_dpd_atom.cpp +++ b/src/USER-DPD/compute_dpd_atom.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDpdAtom::ComputeDpdAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), dpdAtom(NULL) + Compute(lmp, narg, arg), dpdAtom(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dpd/atom command"); diff --git a/src/USER-DPD/fix_dpd_energy.cpp b/src/USER-DPD/fix_dpd_energy.cpp index 6ee88ea88..674bf0e13 100644 --- a/src/USER-DPD/fix_dpd_energy.cpp +++ b/src/USER-DPD/fix_dpd_energy.cpp @@ -28,12 +28,12 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) : { if (narg != 3 ) error->all(FLERR,"Illegal fix dpd/energy command"); - pairDPDE = NULL; + pairDPDE = nullptr; pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy"); if (!(atom->dpd_flag)) error->all(FLERR,"Must use atom_style dpd/fdt/energy with fix dpd/energy"); diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index 57cfe03dc..00cbda167 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -31,7 +31,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix eos/table command"); nevery = 1; @@ -43,7 +43,7 @@ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : if (tablength < 2) error->all(FLERR,"Illegal number of eos/table entries"); ntables = 0; - tables = NULL; + tables = nullptr; int me; MPI_Comm_rank(world,&me); tables = (Table *) @@ -167,10 +167,10 @@ void FixEOStable::end_of_step() void FixEOStable::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -198,7 +198,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -207,7 +207,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -305,13 +305,13 @@ void FixEOStable::param_extract(Table *tb, Table *tb2, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); tb2->ninput = atoi(word); } else { error->one(FLERR,"Invalid keyword in fix eos/table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"fix eos/table parameters did not set N"); diff --git a/src/USER-DPD/fix_eos_table_rx.cpp b/src/USER-DPD/fix_eos_table_rx.cpp index c220d84a5..d01b2015d 100644 --- a/src/USER-DPD/fix_eos_table_rx.cpp +++ b/src/USER-DPD/fix_eos_table_rx.cpp @@ -42,8 +42,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL), - tables2(NULL), dHf(NULL), eosSpecies(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr), + tables2(nullptr), dHf(nullptr), eosSpecies(nullptr) { if (narg != 8 && narg != 10) error->all(FLERR,"Illegal fix eos/table/rx command"); nevery = 1; @@ -64,9 +64,9 @@ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : if (tablength < 2) error->all(FLERR,"Illegal number of eos/table/rx entries"); ntables = 0; - tables = NULL; - tables2 = NULL; - eosSpecies = NULL; + tables = nullptr; + tables2 = nullptr; + eosSpecies = nullptr; int me; MPI_Comm_rank(world,&me); @@ -306,10 +306,10 @@ void FixEOStableRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open eos table/rx potential file %s",file); error->one(FLERR,str); @@ -324,7 +324,7 @@ void FixEOStableRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -346,7 +346,7 @@ void FixEOStableRX::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -366,7 +366,7 @@ void FixEOStableRX::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -388,10 +388,10 @@ void FixEOStableRX::read_file(char *file) void FixEOStableRX::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -419,7 +419,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -428,7 +428,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -482,7 +482,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) } nwords = 0; word = strtok(line," \t\n\r\f"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); rtmp = atof(word); for (int icolumn=0;icolumnrfile[i] = rtmp; @@ -574,11 +574,11 @@ void FixEOStableRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); if(rx_flag){ while (word) { @@ -592,7 +592,7 @@ void FixEOStableRX::param_extract(Table *tb, char *line) printf("name=%s not found in species list\n",word); error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } for (int icolumn = 0; icolumn < ncolumn; icolumn++) diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp index d974d1247..07d39d0de 100644 --- a/src/USER-DPD/fix_rx.cpp +++ b/src/USER-DPD/fix_rx.cpp @@ -67,23 +67,23 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; /* ---------------------------------------------------------------------- */ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mol2param(NULL), nreactions(0), - params(NULL), Arr(NULL), nArr(NULL), Ea(NULL), tempExp(NULL), - stoich(NULL), stoichReactants(NULL), stoichProducts(NULL), kR(NULL), - pairDPDE(NULL), dpdThetaLocal(NULL), sumWeights(NULL), sparseKinetics_nu(NULL), - sparseKinetics_nuk(NULL), sparseKinetics_inu(NULL), sparseKinetics_isIntegralReaction(NULL), - kineticsFile(NULL), id_fix_species(NULL), - id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL) + Fix(lmp, narg, arg), mol2param(nullptr), nreactions(0), + params(nullptr), Arr(nullptr), nArr(nullptr), Ea(nullptr), tempExp(nullptr), + stoich(nullptr), stoichReactants(nullptr), stoichProducts(nullptr), kR(nullptr), + pairDPDE(nullptr), dpdThetaLocal(nullptr), sumWeights(nullptr), sparseKinetics_nu(nullptr), + sparseKinetics_nuk(nullptr), sparseKinetics_inu(nullptr), sparseKinetics_isIntegralReaction(nullptr), + kineticsFile(nullptr), id_fix_species(nullptr), + id_fix_species_old(nullptr), fix_species(nullptr), fix_species_old(nullptr) { if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command"); nevery = 1; nreactions = maxparam = 0; - params = NULL; - mol2param = NULL; - pairDPDE = NULL; - id_fix_species = NULL; - id_fix_species_old = NULL; + params = nullptr; + mol2param = nullptr; + pairDPDE = nullptr; + id_fix_species = nullptr; + id_fix_species_old = nullptr; const int Verbosity = 1; @@ -166,7 +166,7 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : diagnosticFrequency = 0; for (int i = 0; i < numDiagnosticCounters; ++i){ diagnosticCounter[i] = 0; - diagnosticCounterPerODE[i] = NULL; + diagnosticCounterPerODE[i] = nullptr; } if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg==8){ @@ -189,8 +189,8 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : minSteps = atoi( arg[iarg++] ); maxIters = atoi( arg[iarg++] ); - relTol = strtod( arg[iarg++], NULL); - absTol = strtod( arg[iarg++], NULL); + relTol = strtod( arg[iarg++], nullptr); + absTol = strtod( arg[iarg++], nullptr); if (iarg < narg) diagnosticFrequency = atoi( arg[iarg++] ); @@ -207,10 +207,10 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : } // Initialize/Create the sparse matrix database. - sparseKinetics_nu = NULL; - sparseKinetics_nuk = NULL; - sparseKinetics_inu = NULL; - sparseKinetics_isIntegralReaction = NULL; + sparseKinetics_nu = nullptr; + sparseKinetics_nuk = nullptr; + sparseKinetics_inu = nullptr; + sparseKinetics_isIntegralReaction = nullptr; sparseKinetics_maxReactants = 0; sparseKinetics_maxProducts = 0; sparseKinetics_maxSpecies = 0; @@ -259,15 +259,15 @@ void FixRX::post_constructor() char **tmpspecies = new char*[maxspecies]; int tmpmaxstrlen = 0; for(int jj=0; jj < maxspecies; jj++) - tmpspecies[jj] = NULL; + tmpspecies[jj] = nullptr; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(kineticsFile,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",kineticsFile); error->one(FLERR,str); @@ -284,7 +284,7 @@ void FixRX::post_constructor() while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -304,8 +304,8 @@ void FixRX::post_constructor() nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ - word = strtok(NULL, " \t\n\r\f"); + while (word != nullptr){ + word = strtok(nullptr, " \t\n\r\f"); match=false; for(int jj=0;jjnspecies_dpd = nUniqueSpecies; @@ -332,8 +332,8 @@ void FixRX::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_species = NULL; - id_fix_species_old = NULL; + id_fix_species = nullptr; + id_fix_species_old = nullptr; n = strlen(id) + strlen("_SPECIES") + 1; id_fix_species = new char[n]; @@ -637,10 +637,10 @@ int FixRX::setmask() void FixRX::init() { pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); bool eos_flag = false; @@ -853,10 +853,10 @@ void FixRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",file); error->one(FLERR,str); @@ -872,7 +872,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -926,7 +926,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -946,9 +946,9 @@ void FixRX::read_file(char *file) nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ + while (word != nullptr){ tmpStoich = atof(word); - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); for (ispecies = 0; ispecies < nspecies; ispecies++){ if (strcmp(word,&atom->dname[ispecies][0]) == 0){ stoich[nreactions][ispecies] += sign*tmpStoich; @@ -965,22 +965,22 @@ void FixRX::read_file(char *file) } error->all(FLERR,"Illegal fix rx command"); } - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); if(strcmp(word,"=") == 0) sign = 1.0; if(strcmp(word,"+") != 0 && strcmp(word,"=") != 0){ - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Arr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); nArr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Ea[nreactions] = atof(word); sign = -1.0; break; } - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); } nreactions++; } @@ -1434,7 +1434,7 @@ void FixRX::odeDiagnostics(void) my_max[i] = 0; my_min[i] = DBL_MAX; - if (diagnosticCounterPerODE[i] != NULL){ + if (diagnosticCounterPerODE[i] != nullptr){ for (int j = 0; j < nlocal; ++j) if (mask[j] & groupbit){ double diff = double(diagnosticCounterPerODE[i][j]) - avg_per_atom[i]; @@ -1637,8 +1637,8 @@ void FixRX::rkf45(int id, double *rwork, void *v_param, int ode_counter[]) ode_counter[1] += nit; ode_counter[2] += nfe; - //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != NULL) - if (diagnosticCounterPerODE[StepSum] != NULL){ + //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != nullptr) + if (diagnosticCounterPerODE[StepSum] != nullptr){ diagnosticCounterPerODE[StepSum][id] = nst; diagnosticCounterPerODE[FuncSum][id] = nfe; } @@ -1708,7 +1708,7 @@ int FixRX::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_param const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) diff --git a/src/USER-DPD/fix_shardlow.cpp b/src/USER-DPD/fix_shardlow.cpp index c4480a037..6db13d394 100644 --- a/src/USER-DPD/fix_shardlow.cpp +++ b/src/USER-DPD/fix_shardlow.cpp @@ -84,18 +84,18 @@ static const char cite_fix_shardlow[] = /* ---------------------------------------------------------------------- */ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pairDPD(NULL), pairDPDE(NULL), v_t0(NULL) - ,rand_state(NULL) + Fix(lmp, narg, arg), pairDPD(nullptr), pairDPDE(nullptr), v_t0(nullptr) + ,rand_state(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_shardlow); if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); - pairDPD = NULL; - pairDPDE = NULL; + pairDPD = nullptr; + pairDPDE = nullptr; pairDPD = (PairDPDfdt *) force->pair_match("dpd/fdt",1); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); maxRNG = 0; @@ -107,7 +107,7 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; } - if(pairDPD == NULL && pairDPDE == NULL) + if(pairDPD == nullptr && pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt or dpd/fdt/energy with fix shardlow"); } @@ -533,7 +533,7 @@ void FixShardlow::initial_integrate(int /*vflag*/) const int nlocal = atom->nlocal; const int nghost = atom->nghost; - const bool useDPDE = (pairDPDE != NULL); + const bool useDPDE = (pairDPDE != nullptr); // NOTE: this logic is specific to orthogonal boxes, not triclinic @@ -640,7 +640,7 @@ fprintf(stdout, "\n%6d %6d,%6d %6d: " #endif memory->sfree(v_t0); - v_t0 = NULL; + v_t0 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.cpp b/src/USER-DPD/npair_half_bin_newton_ssa.cpp index 4fb5714d1..e3f6f4e20 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.cpp +++ b/src/USER-DPD/npair_half_bin_newton_ssa.cpp @@ -37,9 +37,9 @@ NPairHalfBinNewtonSSA::NPairHalfBinNewtonSSA(LAMMPS *lmp) : NPair(lmp) ssa_maxPhaseCt = 0; ssa_maxPhaseLen = 0; ssa_phaseCt = 0; - ssa_phaseLen = NULL; - ssa_itemLoc = NULL; - ssa_itemLen = NULL; + ssa_phaseLen = nullptr; + ssa_itemLoc = nullptr; + ssa_itemLen = nullptr; ssa_gphaseCt = 7; memory->create(ssa_gphaseLen,ssa_gphaseCt,"NPairHalfBinNewtonSSA:ssa_gphaseLen"); memory->create(ssa_gitemLoc,ssa_gphaseCt,1,"NPairHalfBinNewtonSSA:ssa_gitemLoc"); diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index 1d3d952e9..822444f8c 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -39,7 +39,7 @@ using namespace LAMMPS_NS; PairDPDfdt::PairDPDfdt(LAMMPS *lmp) : Pair(lmp) { - random = NULL; + random = nullptr; splitFDT_flag = false; a0_is_zero = false; } @@ -375,13 +375,13 @@ void PairDPDfdt::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -410,10 +410,10 @@ void PairDPDfdt::write_restart_settings(FILE *fp) void PairDPDfdt::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index b843e4601..094e5732c 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -39,9 +39,9 @@ using namespace LAMMPS_NS; PairDPDfdtEnergy::PairDPDfdtEnergy(LAMMPS *lmp) : Pair(lmp) { - random = NULL; - duCond = NULL; - duMech = NULL; + random = nullptr; + duCond = nullptr; + duMech = nullptr; splitFDT_flag = false; a0_is_zero = false; @@ -476,14 +476,14 @@ void PairDPDfdtEnergy::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -513,9 +513,9 @@ void PairDPDfdtEnergy::write_restart_settings(FILE *fp) void PairDPDfdtEnergy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 666a1b0ea..9d7fcc1ab 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -59,10 +59,10 @@ struct PairExp6ParamDataType // Default constructor -- nullify everything. PairExp6ParamDataType(void) - : n(0), epsilon1(NULL), alpha1(NULL), rm1(NULL), mixWtSite1(NULL), - epsilon2(NULL), alpha2(NULL), rm2(NULL), mixWtSite2(NULL), - epsilonOld1(NULL), alphaOld1(NULL), rmOld1(NULL), mixWtSite1old(NULL), - epsilonOld2(NULL), alphaOld2(NULL), rmOld2(NULL), mixWtSite2old(NULL) + : n(0), epsilon1(nullptr), alpha1(nullptr), rm1(nullptr), mixWtSite1(nullptr), + epsilon2(nullptr), alpha2(nullptr), rm2(nullptr), mixWtSite2(nullptr), + epsilonOld1(nullptr), alphaOld1(nullptr), rmOld1(nullptr), mixWtSite1old(nullptr), + epsilonOld2(nullptr), alphaOld2(nullptr), rmOld2(nullptr), mixWtSite2old(nullptr) {} }; @@ -74,8 +74,8 @@ PairExp6rx::PairExp6rx(LAMMPS *lmp) : Pair(lmp) nspecies = 0; nparams = maxparam = 0; - params = NULL; - mol2param = NULL; + params = nullptr; + mol2param = nullptr; fractionalWeighting = true; } @@ -85,7 +85,7 @@ PairExp6rx::~PairExp6rx() { if (copymode) return; - if (params != NULL) { + if (params != nullptr) { for (int i=0; i < nparams; ++i) { delete[] params[i].name; delete[] params[i].potential; @@ -659,7 +659,7 @@ void PairExp6rx::coeff(int narg, char **arg) } delete[] site1; delete[] site2; - site1 = site2 = NULL; + site1 = site2 = nullptr; setup(); @@ -717,16 +717,16 @@ void PairExp6rx::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -743,7 +743,7 @@ void PairExp6rx::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -765,7 +765,7 @@ void PairExp6rx::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -785,7 +785,7 @@ void PairExp6rx::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -839,10 +839,10 @@ void PairExp6rx::read_file2(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open polynomial file %s",file); error->one(FLERR,str); @@ -857,7 +857,7 @@ void PairExp6rx::read_file2(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -879,7 +879,7 @@ void PairExp6rx::read_file2(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -899,7 +899,7 @@ void PairExp6rx::read_file2(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; if (strcmp(words[0],"alpha") == 0){ for (int ii=1; iime; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -1004,10 +1004,10 @@ void PairExp6rx::write_restart_settings(FILE *fp) void PairExp6rx::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index ceb5c78ea..2e556d82e 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -57,14 +57,14 @@ static const char cite_pair_multi_lucy[] = /* ---------------------------------------------------------------------- */ PairMultiLucy::PairMultiLucy(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL) + ntables(0), tables(nullptr), tabindex(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -256,7 +256,7 @@ void PairMultiLucy::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -349,7 +349,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -358,7 +358,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -481,26 +481,26 @@ void PairMultiLucy::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -582,15 +582,15 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -707,8 +707,8 @@ void PairMultiLucy::write_restart_settings(FILE *fp) void PairMultiLucy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index d769d9478..e56743ea1 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -68,14 +68,14 @@ static const char cite_pair_multi_lucy_rx[] = /* ---------------------------------------------------------------------- */ PairMultiLucyRX::PairMultiLucyRX(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL), site1(NULL), site2(NULL) + ntables(0), tables(nullptr), tabindex(nullptr), site1(nullptr), site2(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy_rx); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy/rx command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -134,10 +134,10 @@ void PairMultiLucyRX::compute(int eflag, int vflag) int jtable; double *rho = atom->rho; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = nlocal + nghost; @@ -355,7 +355,7 @@ void PairMultiLucyRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -494,7 +494,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -503,7 +503,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -626,26 +626,26 @@ void PairMultiLucyRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -727,15 +727,15 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -852,8 +852,8 @@ void PairMultiLucyRX::write_restart_settings(FILE *fp) void PairMultiLucyRX::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index f791107f1..05467346c 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -46,8 +46,8 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTableRX::PairTableRX(LAMMPS *lmp) : PairTable(lmp) { fractionalWeighting = true; - site1 = NULL; - site2 = NULL; + site1 = nullptr; + site2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -93,10 +93,10 @@ void PairTableRX::compute(int eflag, int vflag) double *uCG = atom->uCG; double *uCGnew = atom->uCGnew; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = atom->nlocal + atom->nghost; @@ -290,7 +290,7 @@ void PairTableRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-DRUDE/compute_temp_drude.cpp b/src/USER-DRUDE/compute_temp_drude.cpp index b806b4434..1c60805db 100644 --- a/src/USER-DRUDE/compute_temp_drude.cpp +++ b/src/USER-DRUDE/compute_temp_drude.cpp @@ -43,9 +43,9 @@ ComputeTempDrude::ComputeTempDrude(LAMMPS *lmp, int narg, char **arg) : tempflag = 0; // because does not compute a single temperature (scalar and vector) vector = new double[size_vector]; - fix_drude = NULL; - id_temp = NULL; - temperature = NULL; + fix_drude = nullptr; + id_temp = nullptr; + temperature = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_drude.cpp b/src/USER-DRUDE/fix_drude.cpp index 313ac249d..ea9373142 100644 --- a/src/USER-DRUDE/fix_drude.cpp +++ b/src/USER-DRUDE/fix_drude.cpp @@ -53,7 +53,7 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal fix drude command"); } - drudeid = NULL; + drudeid = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); @@ -147,7 +147,7 @@ void FixDrude::build_drudeid(){ // Loop on procs to fill my atoms' sets of bond partners comm->ring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 4, ring_build_partner, NULL, (void *)this, 1); + 4, ring_build_partner, nullptr, (void *)this, 1); // Build the list of my Drudes' tags // The only bond partners of a Drude particle is its core, @@ -163,7 +163,7 @@ void FixDrude::build_drudeid(){ // so that each core finds its Drude. comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 3, ring_search_drudeid, NULL, (void *)this, 1); + 3, ring_search_drudeid, nullptr, (void *)this, 1); delete [] partner_set; } @@ -338,11 +338,11 @@ void FixDrude::rebuild_special(){ // Remove Drude particles from the special lists of each proc comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 9, ring_remove_drude, NULL, (void *)this, 1); + 9, ring_remove_drude, nullptr, (void *)this, 1); // Add back Drude particles in the lists just after their core comm->ring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 10, ring_add_drude, NULL, (void *)this, 1); + 10, ring_add_drude, nullptr, (void *)this, 1); // Check size of special list nspecmax_loc = 0; @@ -373,7 +373,7 @@ void FixDrude::rebuild_special(){ // Copy core's list into their drude list comm->ring(core_special_vec.size(), sizeof(tagint), (char *) core_special_vec.data(), - 11, ring_copy_drude, NULL, (void *)this, 1); + 11, ring_copy_drude, nullptr, (void *)this, 1); } /* ---------------------------------------------------------------------- diff --git a/src/USER-DRUDE/fix_drude_transform.cpp b/src/USER-DRUDE/fix_drude_transform.cpp index bdccaaebc..fc8936732 100644 --- a/src/USER-DRUDE/fix_drude_transform.cpp +++ b/src/USER-DRUDE/fix_drude_transform.cpp @@ -29,11 +29,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ template FixDrudeTransform::FixDrudeTransform(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mcoeff(NULL) + Fix(lmp, narg, arg), mcoeff(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix drude/transform command"); comm_forward = 9; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index da7451082..3fd017444 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -48,7 +48,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; // core temperature - tstr_core = NULL; + tstr_core = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr_core = new char[n]; @@ -63,7 +63,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : int seed_core = utils::inumeric(FLERR,arg[5],false,lmp); // drude temperature - tstr_drude = NULL; + tstr_drude = nullptr; if (strstr(arg[7],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; tstr_drude = new char[n]; @@ -102,9 +102,9 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : tflag = 0; // no external compute/temp is specified yet (for bias) energy = 0.; - fix_drude = NULL; - temperature = NULL; - id_temp = NULL; + fix_drude = nullptr; + temperature = nullptr; + id_temp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -379,7 +379,7 @@ void *FixLangevinDrude::extract(const char *str, int &dim) } else if (strcmp(str,"t_target_drude") == 0) { return &t_target_drude; } else error->all(FLERR, "Illegal extract string in fix langevin/drude"); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 461f97288..c6662c423 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -56,9 +56,9 @@ PairLJCutTholeLong::PairLJCutTholeLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; single_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -371,11 +371,11 @@ void PairLJCutTholeLong::init_style() // set rRESPA cutoffs - cut_respa = NULL; + cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -496,16 +496,16 @@ void PairLJCutTholeLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -541,15 +541,15 @@ void PairLJCutTholeLong::write_restart_settings(FILE *fp) void PairLJCutTholeLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -602,5 +602,5 @@ void *PairLJCutTholeLong::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index 281317c07..e9c4f396d 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairThole::PairThole(LAMMPS *lmp) : Pair(lmp) { - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -312,13 +312,13 @@ void PairThole::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); } MPI_Bcast(&polar[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairThole::write_restart_settings(FILE *fp) void PairThole::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&thole_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -400,5 +400,5 @@ void *PairThole::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp index 001e1d4c4..e25f239ad 100644 --- a/src/USER-EFF/compute_ke_atom_eff.cpp +++ b/src/USER-EFF/compute_ke_atom_eff.cpp @@ -40,7 +40,7 @@ ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - ke = NULL; + ke = nullptr; // error check diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index 90e25ca3c..979b47f50 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -52,7 +52,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index c95cf0de2..f7c1bd5b6 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -55,7 +55,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 3966bc7b9..a0aabb68a 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -45,7 +45,7 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevinEff::FixLangevinEff(LAMMPS *lmp, int narg, char **arg) : FixLangevin(lmp, narg, arg) { - erforcelangevin = NULL; + erforcelangevin = nullptr; } /* ---------------------------------------------------------------------- */ @@ -399,7 +399,7 @@ void FixLangevinEff::end_of_step() double FixLangevinEff::compute_scalar() { - if (!tallyflag || flangevin == NULL || erforcelangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr || erforcelangevin == nullptr) return 0.0; // capture the very first energy transfer to thermal reservoir diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index f4e7af658..817b2eb6e 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -42,8 +42,8 @@ PairEffCut::PairEffCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_eradius = NULL; - min_erforce = NULL; + min_eradius = nullptr; + min_erforce = nullptr; nextra = 4; pvector = new double[nextra]; } @@ -979,10 +979,10 @@ void PairEffCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -1006,9 +1006,9 @@ void PairEffCut::write_restart_settings(FILE *fp) void PairEffCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index ff1e303a3..6ecf0795d 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -158,14 +158,14 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : // allocate space for charge, force, energy, virial arrays - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; allocate_storage(); - fixgpu = NULL; + fixgpu = nullptr; } /* ---------------------------------------------------------------------- */ @@ -210,17 +210,17 @@ void ComputeFEP::init() if (!input->variable->equalstyle(pert->ivar)) error->all(FLERR,"Variable for compute fep is of invalid style"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"compute fep pair requires pair interactions"); if (pert->which == PAIR) { pairflag = 1; Pair *pair = force->pair_match(pert->pstyle,1); - if (pair == NULL) error->all(FLERR,"compute fep pair style " + if (pair == nullptr) error->all(FLERR,"compute fep pair style " "does not exist"); void *ptr = pair->extract(pert->pparam,pert->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"compute fep pair style param not supported"); pert->array = (double **) ptr; @@ -497,10 +497,10 @@ void ComputeFEP::deallocate_storage() memory->destroy(keatom_orig); memory->destroy(kvatom_orig); - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; } diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 2f97b5a0e..ca9088836 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -172,7 +172,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : if (adapt[m].which == PAIR) memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig"); - id_fix_diam = id_fix_chg = NULL; + id_fix_diam = id_fix_chg = nullptr; } /* ---------------------------------------------------------------------- */ @@ -220,8 +220,8 @@ void FixAdaptFEP::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; char **newarg = new char*[6]; newarg[1] = group->names[igroup]; @@ -307,7 +307,7 @@ void FixAdaptFEP::init() if (ad->which == PAIR) { anypair = 1; - Pair *pair = NULL; + Pair *pair = nullptr; if (lmp->suffix_enable) { char psuffix[128]; @@ -316,11 +316,11 @@ void FixAdaptFEP::init() strcat(psuffix,lmp->suffix); pair = force->pair_match(psuffix,1); } - if (pair == NULL) pair = force->pair_match(ad->pstyle,1); - if (pair == NULL) + if (pair == nullptr) pair = force->pair_match(ad->pstyle,1); + if (pair == nullptr) error->all(FLERR, "Fix adapt/fep pair style does not exist"); void *ptr = pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt/fep pair style param not supported"); ad->pdim = 2; @@ -340,7 +340,7 @@ void FixAdaptFEP::init() } } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt/fep kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index b0a099a56..a68c13699 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -275,12 +275,12 @@ void PairCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -309,12 +309,12 @@ void PairCoulCutSoft::write_restart_settings(FILE *fp) void PairCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -373,5 +373,5 @@ void *PairCoulCutSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_coul_long_soft.cpp b/src/USER-FEP/pair_coul_long_soft.cpp index 80173f3f0..2749fe8c7 100644 --- a/src/USER-FEP/pair_coul_long_soft.cpp +++ b/src/USER-FEP/pair_coul_long_soft.cpp @@ -236,7 +236,7 @@ void PairCoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -295,11 +295,11 @@ void PairCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); } } @@ -326,12 +326,12 @@ void PairCoulLongSoft::write_restart_settings(FILE *fp) void PairCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -388,5 +388,5 @@ void *PairCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"scale") == 0) return (void *) scale; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index e13b98329..e6783b022 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -728,11 +728,11 @@ void PairLJCharmmCoulLongSoft::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -819,15 +819,15 @@ void PairLJCharmmCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -862,15 +862,15 @@ void PairLJCharmmCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCharmmCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -990,5 +990,5 @@ void *PairLJCharmmCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp index bfd5a630f..f8719b890 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp @@ -382,15 +382,15 @@ void PairLJClass2CoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -425,15 +425,15 @@ void PairLJClass2CoulCutSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -515,5 +515,5 @@ void *PairLJClass2CoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp index e027a3018..9741dd24c 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp @@ -285,7 +285,7 @@ void PairLJClass2CoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -397,14 +397,14 @@ void PairLJClass2CoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -438,15 +438,15 @@ void PairLJClass2CoulLongSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -537,5 +537,5 @@ void *PairLJClass2CoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_soft.cpp b/src/USER-FEP/pair_lj_class2_soft.cpp index 0cd1fc9e8..81319d715 100644 --- a/src/USER-FEP/pair_lj_class2_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_soft.cpp @@ -321,14 +321,14 @@ void PairLJClass2Soft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -360,12 +360,12 @@ void PairLJClass2Soft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -432,5 +432,5 @@ void *PairLJClass2Soft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index a18256f98..53f39523e 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -378,15 +378,15 @@ void PairLJCutCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -421,15 +421,15 @@ void PairLJCutCoulCutSoft::write_restart_settings(FILE *fp) void PairLJCutCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -512,5 +512,5 @@ void *PairLJCutCoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index 4b3fae77b..61db28fe1 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -656,11 +656,11 @@ void PairLJCutCoulLongSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -775,14 +775,14 @@ void PairLJCutCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -816,15 +816,15 @@ void PairLJCutCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCutCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -923,5 +923,5 @@ void *PairLJCutCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 786715d6c..589e03642 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -532,7 +532,7 @@ void PairLJCutSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -636,14 +636,14 @@ void PairLJCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -676,13 +676,13 @@ void PairLJCutSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -748,5 +748,5 @@ void *PairLJCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 18f8db502..748c616d6 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -53,8 +53,8 @@ PairLJCutTIP4PLongSoft::PairLJCutTIP4PLongSoft(LAMMPS *lmp) : respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -450,9 +450,9 @@ void PairLJCutTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/soft requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLongSoft::init_style(); @@ -517,17 +517,17 @@ void PairLJCutTIP4PLongSoft::read_restart_settings(FILE *fp) PairLJCutCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -579,7 +579,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 85a30a541..5154907ec 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -313,15 +313,15 @@ void PairMorseSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -353,10 +353,10 @@ void PairMorseSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&shift_range,1,MPI_DOUBLE,0,world); @@ -450,5 +450,5 @@ void *PairMorseSoft::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index 9578befd3..18e266715 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -52,8 +52,8 @@ PairTIP4PLongSoft::PairTIP4PLongSoft(LAMMPS *lmp) : PairCoulLongSoft(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -407,9 +407,9 @@ void PairTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLongSoft::init_style(); @@ -454,11 +454,11 @@ void PairTIP4PLongSoft::read_restart_settings(FILE *fp) PairCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); MPI_Bcast(&typeH,1,MPI_INT,0,world); @@ -501,7 +501,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-H5MD/dump_h5md.cpp b/src/USER-H5MD/dump_h5md.cpp index e9daf7186..11a490626 100644 --- a/src/USER-H5MD/dump_h5md.cpp +++ b/src/USER-H5MD/dump_h5md.cpp @@ -68,11 +68,11 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) size_one = 6; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; datafile_from_dump = -1; - author_name=NULL; + author_name=nullptr; every_dump = utils::inumeric(FLERR,arg[3],false,lmp); every_position = every_image = -1; @@ -175,7 +175,7 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) if (iarg+1>=narg) { error->all(FLERR, "Invalid number of arguments in dump h5md"); } - if (author_name==NULL) { + if (author_name==nullptr) { author_name = new char[strlen(arg[iarg])+1]; strcpy(author_name, arg[iarg+1]); } else { @@ -271,10 +271,10 @@ void DumpH5MD::openfile() if (me == 0) { if (datafile_from_dump<0) { - if (author_name==NULL) { - datafile = h5md_create_file(filename, "N/A", NULL, "lammps", LAMMPS_VERSION); + if (author_name==nullptr) { + datafile = h5md_create_file(filename, "N/A", nullptr, "lammps", LAMMPS_VERSION); } else { - datafile = h5md_create_file(filename, author_name, NULL, "lammps", LAMMPS_VERSION); + datafile = h5md_create_file(filename, author_name, nullptr, "lammps", LAMMPS_VERSION); } group_name_length = strlen(group->names[igroup])+1; group_name = new char[group_name_length]; @@ -288,19 +288,19 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } else { @@ -318,26 +318,26 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } } - if (author_name!=NULL) delete [] author_name; + if (author_name!=nullptr) delete [] author_name; for (int i=0; i<3; i++) { delete [] boundary[i]; } @@ -536,7 +536,7 @@ void DumpH5MD::write_fixed_frame() edges[2] = boxzhi - boxzlo; if (every_position==0) { particles_data.position = h5md_create_fixed_data_simple(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, dump_position); - h5md_create_box(&particles_data, dims[1], boundary, false, edges, NULL); + h5md_create_box(&particles_data, dims[1], boundary, false, edges, nullptr); if (every_image==0) particles_data.image = h5md_create_fixed_data_simple(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, dump_image); } diff --git a/src/USER-INTEL/angle_charmm_intel.h b/src/USER-INTEL/angle_charmm_intel.h index 155ecfaff..798e3d152 100644 --- a/src/USER-INTEL/angle_charmm_intel.h +++ b/src/USER-INTEL/angle_charmm_intel.h @@ -61,7 +61,7 @@ class AngleCharmmIntel : public AngleCharmm { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/angle_harmonic_intel.h b/src/USER-INTEL/angle_harmonic_intel.h index c00292f7c..7df4a9887 100644 --- a/src/USER-INTEL/angle_harmonic_intel.h +++ b/src/USER-INTEL/angle_harmonic_intel.h @@ -61,7 +61,7 @@ class AngleHarmonicIntel : public AngleHarmonic { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/bond_fene_intel.h b/src/USER-INTEL/bond_fene_intel.h index 58fcdb866..92ec4097c 100644 --- a/src/USER-INTEL/bond_fene_intel.h +++ b/src/USER-INTEL/bond_fene_intel.h @@ -61,7 +61,7 @@ class BondFENEIntel : public BondFENE { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/bond_harmonic_intel.h b/src/USER-INTEL/bond_harmonic_intel.h index 3c1d050a3..449df3b7a 100644 --- a/src/USER-INTEL/bond_harmonic_intel.h +++ b/src/USER-INTEL/bond_harmonic_intel.h @@ -61,7 +61,7 @@ class BondHarmonicIntel : public BondHarmonic { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_charmm_intel.h b/src/USER-INTEL/dihedral_charmm_intel.h index d80b32c8a..bb830b729 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.h +++ b/src/USER-INTEL/dihedral_charmm_intel.h @@ -66,7 +66,7 @@ class DihedralCharmmIntel : public DihedralCharmm { flt_t *weight; ForceConst() : _npairtypes(0), _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, 0, NULL); } + ~ForceConst() { set_ntypes(0, 0, nullptr); } void set_ntypes(const int npairtypes, const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_fourier_intel.h b/src/USER-INTEL/dihedral_fourier_intel.h index 26007f411..f91d89f6b 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.h +++ b/src/USER-INTEL/dihedral_fourier_intel.h @@ -63,7 +63,7 @@ class DihedralFourierIntel : public DihedralFourier { fc_packed1 **bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, NULL, NULL); } + ~ForceConst() { set_ntypes(0, nullptr, nullptr, nullptr); } void set_ntypes(const int nbondtypes, int *setflag, int *nterms, Memory *memory); diff --git a/src/USER-INTEL/dihedral_harmonic_intel.h b/src/USER-INTEL/dihedral_harmonic_intel.h index 0a9cfaa04..cdbae365f 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.h +++ b/src/USER-INTEL/dihedral_harmonic_intel.h @@ -63,7 +63,7 @@ class DihedralHarmonicIntel : public DihedralHarmonic { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_opls_intel.h b/src/USER-INTEL/dihedral_opls_intel.h index 1080bfa6c..77fd8c4b9 100644 --- a/src/USER-INTEL/dihedral_opls_intel.h +++ b/src/USER-INTEL/dihedral_opls_intel.h @@ -62,7 +62,7 @@ class DihedralOPLSIntel : public DihedralOPLS { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index eacbc7ddc..21cc106e3 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -303,7 +303,7 @@ void FixIntel::init() #endif const int nstyles = _pair_intel_count; - if (force->pair_match("^hybrid", 0) != NULL) { + if (force->pair_match("^hybrid", 0) != nullptr) { _pair_hybrid_flag = 1; if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute) error->all(FLERR, @@ -513,9 +513,9 @@ void FixIntel::bond_init_check() "USER-INTEL package requires same setting for newton bond and non-bond."); int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -530,9 +530,9 @@ void FixIntel::bond_init_check() void FixIntel::kspace_init_check() { int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -855,7 +855,7 @@ void FixIntel::add_oresults(const ft * _noalias const f_in, } } - if (ev_global != NULL) { + if (ev_global != nullptr) { force->pair->eng_vdwl += ev_global[0]; force->pair->eng_coul += ev_global[1]; force->pair->virial[0] += ev_global[2]; @@ -1168,7 +1168,7 @@ int FixIntel::set_host_affinity(const int nomp) sprintf(cmd, "lscpu -p | grep -v '#' |" "sort -t, -k 3,3n -k 2,2n | awk -F, '{print $1}'"); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; ncores = 0; while(fgets(readbuf, 512, p)) { proc_list[ncores] = atoi(readbuf); @@ -1190,7 +1190,7 @@ int FixIntel::set_host_affinity(const int nomp) int nthreads = nomp; if (nthreads == 0) { estring = getenv("OMP_NUM_THREADS"); - if (estring != NULL) { + if (estring != nullptr) { nthreads = atoi(estring); if (nthreads < 2) nthreads = 1; } else @@ -1222,7 +1222,7 @@ int FixIntel::set_host_affinity(const int nomp) if (coi_cores) { sprintf(cmd, "ps -Lp %d -o lwp | awk ' (NR > 2) {print}'", pid); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); @@ -1258,7 +1258,7 @@ int FixIntel::set_host_affinity(const int nomp) free(buf1); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); diff --git a/src/USER-INTEL/fix_intel.h b/src/USER-INTEL/fix_intel.h index 4c50164d3..df3aecbc8 100644 --- a/src/USER-INTEL/fix_intel.h +++ b/src/USER-INTEL/fix_intel.h @@ -167,8 +167,8 @@ class FixIntel : public Fix { inline void zero_timers() {} inline void start_watch(const int /*which*/) {} inline double stop_watch(const int /*which*/) { return 0.0; } - double * off_watch_pair() { return NULL; } - double * off_watch_neighbor() { return NULL; } + double * off_watch_pair() { return nullptr; } + double * off_watch_neighbor() { return nullptr; } inline void balance_stamp() {} inline void acc_timers() {} inline int separate_buffers() { return 0; } diff --git a/src/USER-INTEL/improper_cvff_intel.h b/src/USER-INTEL/improper_cvff_intel.h index 812b49d50..94aa29c55 100644 --- a/src/USER-INTEL/improper_cvff_intel.h +++ b/src/USER-INTEL/improper_cvff_intel.h @@ -62,7 +62,7 @@ class ImproperCvffIntel : public ImproperCvff { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/improper_harmonic_intel.h b/src/USER-INTEL/improper_harmonic_intel.h index 6d7c82996..ce1da11a3 100644 --- a/src/USER-INTEL/improper_harmonic_intel.h +++ b/src/USER-INTEL/improper_harmonic_intel.h @@ -62,7 +62,7 @@ class ImproperHarmonicIntel : public ImproperHarmonic { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/intel_buffers.cpp b/src/USER-INTEL/intel_buffers.cpp index dc5b0fad5..168074eb3 100644 --- a/src/USER-INTEL/intel_buffers.cpp +++ b/src/USER-INTEL/intel_buffers.cpp @@ -123,9 +123,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, _buf_local_size = static_cast(nlocal) * 1.1 + 1; const int f_stride = get_stride(_buf_local_size); lmp->memory->create(_x, _buf_size,"intel_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_q, _buf_size, "intel_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_quat, _buf_size, "intel_quat"); #ifdef _LMP_INTEL_OFFLOAD if (lmp->force->newton_pair) @@ -139,9 +139,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, #ifdef _LMP_INTEL_OFFLOAD if (_separate_buffers) { lmp->memory->create(_host_x, _buf_size,"intel_host_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_host_q, _buf_size, "intel_host_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_host_quat, _buf_size, "intel_host_quat"); } @@ -154,24 +154,24 @@ void IntelBuffers::_grow(const int nall, const int nlocal, const flt_t * const q = get_q(); const vec3_acc_t * f_start = get_off_f(); acc_t * ev_global = get_ev_global(); - if (lmp->atom->q != NULL) { - if (x != NULL && q != NULL && f_start != NULL && ev_global != NULL) { + if (lmp->atom->q != nullptr) { + if (x != nullptr && q != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x,q:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } else { - if (x != NULL && f_start != NULL && ev_global != NULL) { + if (x != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } - if (lmp->atom->ellipsoid != NULL) { + if (lmp->atom->ellipsoid != nullptr) { const quat_t * const quat = get_quat(); - if (quat != NULL) { + if (quat != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(quat:length(_buf_size) alloc_if(1) free_if(0)) } @@ -252,7 +252,7 @@ void IntelBuffers::free_list_local() int * cnumneigh = _neigh_list_ptrs[0].cnumneigh; _neigh_list_ptrs[0].cnumneigh = 0; #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cnumneigh:alloc_if(0) free_if(1)) } @@ -261,11 +261,11 @@ void IntelBuffers::free_list_local() } #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { const int * ilist = _off_map_ilist; const int * numneigh = _off_map_numneigh; const int ** firstneigh = (const int **)_off_map_firstneigh; - _off_map_ilist = NULL; + _off_map_ilist = nullptr; #pragma offload_transfer target(mic:_cop) \ nocopy(ilist,firstneigh,numneigh:alloc_if(0) free_if(1)) } @@ -402,7 +402,7 @@ void IntelBuffers::_grow_nbor_list(NeighList * /*list*/, if (offload_end > 0) { int * list_alloc =_list_alloc; - if (list_alloc != NULL) { + if (list_alloc != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(list_alloc:length(list_alloc_size) alloc_if(1) free_if(0)) _off_list_alloc = true; @@ -497,8 +497,8 @@ void IntelBuffers::grow_ccache(const int off_flag, int *ccachei = _ccachei; int *ccachej = _ccachej; - if (ccachex != NULL && ccachey !=NULL && ccachez != NULL && - ccachew != NULL && ccachei != NULL && ccachej !=NULL) { + if (ccachex != nullptr && ccachey !=nullptr && ccachez != nullptr && + ccachew != nullptr && ccachei != nullptr && ccachej !=nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachex,ccachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ccachez,ccachew:length(vsize) alloc_if(1) free_if(0)) \ @@ -506,7 +506,7 @@ void IntelBuffers::grow_ccache(const int off_flag, in(ccachej:length(vsize) alloc_if(1) free_if(0)) } #ifdef LMP_USE_AVXCD - if (ccachef != NULL) { + if (ccachef != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachef:length(_ccache_stride3 * nt) alloc_if(1) free_if(0)) } @@ -595,8 +595,8 @@ void IntelBuffers::grow_ncache(const int off_flag, int *ncachej = _ncachej; int *ncachejtype = _ncachejtype; - if (ncachex != NULL && ncachey !=NULL && ncachez != NULL && - ncachej != NULL && ncachejtype != NULL) { + if (ncachex != nullptr && ncachey !=nullptr && ncachez != nullptr && + ncachej != nullptr && ncachejtype != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ncachex,ncachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ncachez,ncachej:length(vsize) alloc_if(1) free_if(0)) \ @@ -674,13 +674,13 @@ void IntelBuffers::set_ntypes(const int ntypes, #ifdef _LMP_INTEL_OFFLOAD flt_t * cutneighsqo = _cutneighsq[0]; const int ntypes2 = ntypes * ntypes; - if (_off_threads > 0 && cutneighsqo != NULL) { + if (_off_threads > 0 && cutneighsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighsqo:length(ntypes2) alloc_if(1) free_if(0)) } if (use_ghost_cut) { flt_t * cutneighghostsqo = _cutneighghostsq[0]; - if (_off_threads > 0 && cutneighghostsqo != NULL) { + if (_off_threads > 0 && cutneighghostsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighghostsqo:length(ntypes2) alloc_if(1) free_if(0)) } diff --git a/src/USER-INTEL/intel_buffers.h b/src/USER-INTEL/intel_buffers.h index f3c07da7c..86fc921c9 100644 --- a/src/USER-INTEL/intel_buffers.h +++ b/src/USER-INTEL/intel_buffers.h @@ -211,7 +211,7 @@ class IntelBuffers { _x[i].z = lmp->atom->x[i][2]; _x[i].w = lmp->atom->type[i]; } - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) #if defined(LMP_SIMD_COMPILER) #pragma vector aligned #pragma ivdep @@ -296,7 +296,7 @@ class IntelBuffers { _host_x[nall].y = INTEL_BIGP; _host_x[nall].z = INTEL_BIGP; _host_x[nall].w = 1; - if (lmp->atom->q != NULL) { + if (lmp->atom->q != nullptr) { memcpy(_host_q + host_min_local, _q + host_min_local, used_local * sizeof(flt_t)); memcpy(_host_q + host_min_local + used_local, _q + host_min_ghost, diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 2515e47c5..3e547b58a 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -528,7 +528,7 @@ inline double MIC_Wtime() { double time; struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec; return time; } diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 4a046bc84..9dfc3b899 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -35,8 +35,8 @@ NBinIntel::NBinIntel(LAMMPS *lmp) : NBinStandard(lmp) { "The 'package intel' command is required for /intel styles"); _fix = static_cast(modify->fix[ifix]); _precision_mode = _fix->precision(); - _atombin = NULL; - _binpacked = NULL; + _atombin = nullptr; + _binpacked = nullptr; #ifdef _LMP_INTEL_OFFLOAD _cop = _fix->coprocessor_number(); _offload_alloc = 0; diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index bd4a95f77..737c2d133 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -119,8 +119,8 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; if (molecular) { diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index 9aae0d27b..392e7bd8c 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -125,8 +125,8 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; if (molecular) { diff --git a/src/USER-INTEL/pair_airebo_intel.cpp b/src/USER-INTEL/pair_airebo_intel.cpp index 6b576220f..d5192f200 100644 --- a/src/USER-INTEL/pair_airebo_intel.cpp +++ b/src/USER-INTEL/pair_airebo_intel.cpp @@ -159,10 +159,10 @@ void aut_frebo(KernelArgsAIREBOT * ka, int torsion_flag); PairAIREBOIntel::PairAIREBOIntel(LAMMPS *lmp) : PairAIREBO(lmp) { suffix_flag |= Suffix::INTEL; - REBO_cnumneigh = NULL; - REBO_num_skin = NULL; - REBO_list_data = NULL; - fix = NULL; + REBO_cnumneigh = nullptr; + REBO_num_skin = nullptr; + REBO_list_data = nullptr; + fix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -697,7 +697,7 @@ inline flt_t gSpline(KernelArgsAIREBOT * ka, int itype, flt_t cos, flt_t NCmin = ka->params.NCmin; flt_t NCmax = ka->params.NCmax; int index = 0; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; int offs = 0; if (itype == 0) { @@ -921,7 +921,7 @@ inline flt_t frebo_pij(KernelArgsAIREBOT * ka, int i, int j, if (pass == 0) { sum_pij += wik * g * ex_lam; sum_dpij_dN += wik * dgdN * ex_lam; - flt_t cutN = Sp(Nki, Nmin, Nmax, NULL); + flt_t cutN = Sp(Nki, Nmin, Nmax, nullptr); *sum_N += (1 - ktype) * wik * cutN; } else { flt_t tmp = -0.5 * pij * pij * pij; @@ -1583,9 +1583,9 @@ void ref_rebo_neigh(KernelArgsAIREBOT * ka) { flt_t rcmin = ka->params.rcmin[itype][jtype]; flt_t rcmax = ka->params.rcmax[itype][jtype]; if (jtype == CARBON) - ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); else - ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); } } ka->neigh_rebo.num[i] = n; @@ -2408,7 +2408,7 @@ static fvec aut_mask_gSpline_pd_2(KernelArgsAIREBOT * ka, bvec /*active_mask*/, int itype, fvec cosjik, fvec Nij, fvec *dgdc, fvec *dgdN) { int i; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; ivec offs = ivec::setzero(); fvec NCmin = fvec::set1(ka->params.NCmin); diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp index a67db0ad3..41af529ca 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp @@ -502,8 +502,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -531,8 +531,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.h b/src/USER-INTEL/pair_buck_coul_cut_intel.h index 720432390..4bc19ac15 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.h +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.h @@ -72,7 +72,7 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut { c_cut_t **c_cut; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.cpp b/src/USER-INTEL/pair_buck_coul_long_intel.cpp index d0cb1837c..11ee79e5f 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_long_intel.cpp @@ -617,10 +617,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -662,10 +662,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.h b/src/USER-INTEL/pair_buck_coul_long_intel.h index ec37c699c..95492cd4e 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.h +++ b/src/USER-INTEL/pair_buck_coul_long_intel.h @@ -73,7 +73,7 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_intel.cpp b/src/USER-INTEL/pair_buck_intel.cpp index bb5b44d26..b4f57d2fa 100644 --- a/src/USER-INTEL/pair_buck_intel.cpp +++ b/src/USER-INTEL/pair_buck_intel.cpp @@ -449,8 +449,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: alloc_if(0) free_if(1)) \ @@ -473,8 +473,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_intel.h b/src/USER-INTEL/pair_buck_intel.h index ab5e13526..0e473c7c3 100644 --- a/src/USER-INTEL/pair_buck_intel.h +++ b/src/USER-INTEL/pair_buck_intel.h @@ -69,7 +69,7 @@ private: c_energy_t **c_energy; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_dpd_intel.cpp b/src/USER-INTEL/pair_dpd_intel.cpp index 690496d54..40b6c891d 100644 --- a/src/USER-INTEL/pair_dpd_intel.cpp +++ b/src/USER-INTEL/pair_dpd_intel.cpp @@ -37,7 +37,7 @@ PairDPDIntel::PairDPDIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - random_thread = NULL; + random_thread = nullptr; _nrandom_thread = 0; } diff --git a/src/USER-INTEL/pair_dpd_intel.h b/src/USER-INTEL/pair_dpd_intel.h index bce90a36b..409e123f2 100644 --- a/src/USER-INTEL/pair_dpd_intel.h +++ b/src/USER-INTEL/pair_dpd_intel.h @@ -83,7 +83,7 @@ class PairDPDIntel : public PairDPD { int *rngi; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nthreads, const int max_nbors, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index 084714daf..b93c9bc8c 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index 8786c0d78..2165f10af 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -69,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_intel.h b/src/USER-INTEL/pair_eam_intel.h index a9590f6b3..b9ad11597 100644 --- a/src/USER-INTEL/pair_eam_intel.h +++ b/src/USER-INTEL/pair_eam_intel.h @@ -76,7 +76,7 @@ class PairEAMIntel : public PairEAM { fc_packed2 *z2r_spline_t; ForceConst() : _ntypes(0), _nr(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nr, const int nrho, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_gayberne_intel.cpp b/src/USER-INTEL/pair_gayberne_intel.cpp index 30e61f67b..423631ae8 100644 --- a/src/USER-INTEL/pair_gayberne_intel.cpp +++ b/src/USER-INTEL/pair_gayberne_intel.cpp @@ -958,7 +958,7 @@ void PairGayBerneIntel::pack_force_const(ForceConst &fc, FC_PACKED2_T *olj34 = fc.lj34[0]; FC_PACKED3_T *oic = fc.ic; int tp1sq = tp1 * tp1; - if (oijc != NULL && oic != NULL) { + if (oijc != nullptr && oic != nullptr) { #pragma offload_transfer target(mic:_cop) \ in(special_lj: length(4) alloc_if(0) free_if(0)) \ in(oijc,olj34: length(tp1sq) alloc_if(0) free_if(0)) \ @@ -990,9 +990,9 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int * ojtype_form = jtype_form[0]; int * ojlist_form = jlist_form[0]; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - orsq_form != NULL && odelx_form != NULL && odely_form != NULL && - odelz_form != NULL && ojtype_form != NULL && ojlist_form != NULL && + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + orsq_form != nullptr && odelx_form != nullptr && odely_form != nullptr && + odelz_form != nullptr && ojtype_form != nullptr && ojlist_form != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(ospecial_lj, oijc, olj34, oic: alloc_if(0) free_if(1)) \ @@ -1048,10 +1048,10 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int off_onel = one_length * nthreads; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - oic != NULL && orsq_form != NULL && odelx_form != NULL && - odely_form != NULL && odelz_form != NULL && ojtype_form !=NULL && - ojlist_form !=NULL && cop >= 0) { + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + oic != nullptr && orsq_form != nullptr && odelx_form != nullptr && + odely_form != nullptr && odelz_form != nullptr && ojtype_form !=nullptr && + ojlist_form !=nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(oijc,olj34: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_gayberne_intel.h b/src/USER-INTEL/pair_gayberne_intel.h index 07dfba14d..ecdd93d35 100644 --- a/src/USER-INTEL/pair_gayberne_intel.h +++ b/src/USER-INTEL/pair_gayberne_intel.h @@ -74,7 +74,7 @@ class PairGayBerneIntel : public PairGayBerne { int **jtype_form, **jlist_form; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int one_length, const int nthreads, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp index c8e4a3d0e..71f2e2455 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -555,8 +555,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ospecial_coul = special_coul; flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(ocutsq, olj: alloc_if(0) free_if(1)) @@ -577,8 +577,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h index a48a84b5c..006dbaade 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -69,7 +69,7 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm { typename IntelBuffers::vec4_t **lj; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp index 5a4069e19..8f106d860 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -38,7 +38,7 @@ PairLJCharmmCoulLongIntel::PairLJCharmmCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -652,9 +652,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable != NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable != nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -693,9 +693,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable !=NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable !=nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h index 31b2182cb..f5b46eaf7 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h @@ -72,7 +72,7 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong { typename IntelBuffers::vec2_t **lj; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp index 34ab97fd3..ead3d5b5b 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongIntel::PairLJCutCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -611,10 +611,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -652,10 +652,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h index 288a6a7bc..617231363 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h @@ -73,7 +73,7 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_intel.cpp b/src/USER-INTEL/pair_lj_cut_intel.cpp index b484cb68d..281eef52d 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_intel.cpp @@ -36,7 +36,7 @@ PairLJCutIntel::PairLJCutIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-INTEL/pair_lj_cut_intel.h b/src/USER-INTEL/pair_lj_cut_intel.h index b577a0465..b88d21321 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.h +++ b/src/USER-INTEL/pair_lj_cut_intel.h @@ -67,7 +67,7 @@ class PairLJCutIntel : public PairLJCut { fc_packed2 **lj34; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp index 533252d01..ccde2d3a5 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp @@ -36,7 +36,7 @@ PairLJLongCoulLongIntel::PairLJLongCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } diff --git a/src/USER-INTEL/pair_sw_intel.cpp b/src/USER-INTEL/pair_sw_intel.cpp index 4ec2af40b..d2a481a76 100644 --- a/src/USER-INTEL/pair_sw_intel.cpp +++ b/src/USER-INTEL/pair_sw_intel.cpp @@ -1277,8 +1277,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; #ifdef _LMP_INTEL_OFFLOAD - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && _cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(op2, op2f, op2f2, op2e, op3: alloc_if(0) free_if(1)) } @@ -1306,8 +1306,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; int tp1sq = ntypes * ntypes; int tp1cu = tp1sq * ntypes; - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(op2,op2f,op2f2,op2e: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(op3: length(tp1cu) alloc_if(1) free_if(0)) diff --git a/src/USER-INTEL/pair_sw_intel.h b/src/USER-INTEL/pair_sw_intel.h index 5f7a511c9..f345b3d4f 100644 --- a/src/USER-INTEL/pair_sw_intel.h +++ b/src/USER-INTEL/pair_sw_intel.h @@ -88,7 +88,7 @@ class PairSWIntel : public PairSW { fc_packed3 ***p3; ForceConst() : p2(0), p2f(0), p2f2(0), p2e(0), p3(0), _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_tersoff_intel.cpp b/src/USER-INTEL/pair_tersoff_intel.cpp index 75f5f85f2..db24692b6 100644 --- a/src/USER-INTEL/pair_tersoff_intel.cpp +++ b/src/USER-INTEL/pair_tersoff_intel.cpp @@ -576,8 +576,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, c_cutoff_t * oc_cutoff_outer = c_cutoff_outer[0]; c_inner_t * oc_inner = c_inner[0][0]; c_outer_t * oc_outer = c_outer[0]; - if (c_first_loop != NULL && c_second_loop != NULL && - c_inner_loop != NULL && _cop >= 0) { + if (c_first_loop != nullptr && c_second_loop != nullptr && + c_inner_loop != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop, oc_second_loop, oc_inner_loop: alloc_if(0) free_if(1)) \ @@ -615,8 +615,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, int tp1sq = ntypes * ntypes; int tp1cb = ntypes * ntypes * ntypes; int tp1cb_pad = ntypes * ntypes * ntypes_pad; - if (oc_first_loop != NULL && oc_second_loop != NULL && - oc_inner_loop != NULL && cop >= 0) { + if (oc_first_loop != nullptr && oc_second_loop != nullptr && + oc_inner_loop != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(oc_second_loop: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h index 6da478c10..195efa74d 100644 --- a/src/USER-INTEL/pair_tersoff_intel.h +++ b/src/USER-INTEL/pair_tersoff_intel.h @@ -65,7 +65,7 @@ class PairTersoffIntel : public PairTersoff { c_outer_t * * c_outer; c_inner_t * * * c_inner; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pppm_disp_intel.cpp b/src/USER-INTEL/pppm_disp_intel.cpp index 1149c9b2c..8e958bf23 100644 --- a/src/USER-INTEL/pppm_disp_intel.cpp +++ b/src/USER-INTEL/pppm_disp_intel.cpp @@ -68,18 +68,18 @@ PPPMDispIntel::PPPMDispIntel(LAMMPS *lmp) : PPPMDisp(lmp) order = 7; order_6 = 7; //sets default stencil sizes to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; - particle_ekx0 = particle_eky0 = particle_ekz0 = NULL; - particle_ekx1 = particle_eky1 = particle_ekz1 = NULL; - particle_ekx2 = particle_eky2 = particle_ekz2 = NULL; - particle_ekx3 = particle_eky3 = particle_ekz3 = NULL; - particle_ekx4 = particle_eky4 = particle_ekz4 = NULL; - particle_ekx5 = particle_eky5 = particle_ekz5 = NULL; - particle_ekx6 = particle_eky6 = particle_ekz6 = NULL; - - rho_lookup = drho_lookup = NULL; - rho6_lookup = drho6_lookup = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; + particle_ekx0 = particle_eky0 = particle_ekz0 = nullptr; + particle_ekx1 = particle_eky1 = particle_ekz1 = nullptr; + particle_ekx2 = particle_eky2 = particle_ekz2 = nullptr; + particle_ekx3 = particle_eky3 = particle_ekz3 = nullptr; + particle_ekx4 = particle_eky4 = particle_ekz4 = nullptr; + particle_ekx5 = particle_eky5 = particle_ekz5 = nullptr; + particle_ekx6 = particle_eky6 = particle_ekz6 = nullptr; + + rho_lookup = drho_lookup = nullptr; + rho6_lookup = drho6_lookup = nullptr; rho_points = 0; _use_table = _use_packing = _use_lrt = 0; diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index d596df449..1a09522a2 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -65,10 +65,10 @@ PPPMIntel::PPPMIntel(LAMMPS *lmp) : PPPM(lmp) order = 7; //sets default stencil size to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; - rho_lookup = drho_lookup = NULL; + rho_lookup = drho_lookup = nullptr; rho_points = 0; _use_table = _use_lrt = 0; diff --git a/src/USER-INTEL/verlet_lrt_intel.cpp b/src/USER-INTEL/verlet_lrt_intel.cpp index 4efed0d33..869330ead 100644 --- a/src/USER-INTEL/verlet_lrt_intel.cpp +++ b/src/USER-INTEL/verlet_lrt_intel.cpp @@ -45,7 +45,7 @@ using namespace LAMMPS_NS; VerletLRTIntel::VerletLRTIntel(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) { #if defined(_LMP_INTEL_LRT_PTHREAD) - pthread_mutex_init(&_kmutex,NULL); + pthread_mutex_init(&_kmutex,nullptr); #endif } @@ -119,7 +119,7 @@ void VerletLRTIntel::setup(int flag) _kspace_ready = 0; _kspace_done = 0; - pthread_cond_init(&_kcond, NULL); + pthread_cond_init(&_kcond, nullptr); pthread_attr_init(&_kspace_attr); pthread_attr_setdetachstate(&_kspace_attr, PTHREAD_CREATE_JOINABLE); #endif @@ -377,7 +377,7 @@ void VerletLRTIntel::run(int n) _kspace_done = 0; pthread_cond_signal(&_kcond); pthread_mutex_unlock(&_kmutex); - pthread_join(_kspace_thread, NULL); + pthread_join(_kspace_thread, nullptr); pthread_attr_destroy(&_kspace_attr); } #endif @@ -428,8 +428,8 @@ void * VerletLRTIntel::k_launch_loop(void *context) pthread_mutex_unlock(&(c->_kmutex)); } - pthread_exit(NULL); - return NULL; + pthread_exit(nullptr); + return nullptr; } #endif diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 204a9c073..652b142b9 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -116,8 +116,8 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setArea = 0; numvel = 15; - Gamma = NULL; - NodeArea = NULL; + Gamma = nullptr; + NodeArea = nullptr; int iarg = 7; while (iarg < narg){ @@ -129,7 +129,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : double areafactor = atof(arg[iarg+2]); if(itype <= 0 || itype > atom->ntypes || areafactor < 0.0) error->all(FLERR,"Illegal fix lb/fluid command: setArea"); - if(NodeArea == NULL){ + if(NodeArea == nullptr){ NodeArea = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) NodeArea[i] = -1.0; } @@ -142,7 +142,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setGamma = 1; double Gammaone; Gammaone = atof(arg[iarg+1]); - if(Gamma == NULL) + if(Gamma == nullptr) Gamma = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) Gamma[i] = Gammaone; iarg += 2; @@ -240,7 +240,7 @@ a z wall velocity without implementing fixed BCs in z"); // perform initial allocation of atom-based array register // with Atom class //-------------------------------------------------------------------------- - hydroF = NULL; + hydroF = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -248,24 +248,24 @@ a z wall velocity without implementing fixed BCs in z"); for(int j=0; j<3; j++) hydroF[i][j] = 0.0; - Ng_lb = NULL; - w_lb = NULL; - mg_lb = NULL; - e = NULL; - feq = NULL; - feqold = NULL; - feqn = NULL; - feqoldn = NULL; - f_lb = NULL; - fnew = NULL; - density_lb = NULL; - u_lb = NULL; - altogether = NULL; - buf = NULL; - Ff = NULL; - Fftempx = NULL; - Fftempy = NULL; - Fftempz = NULL; + Ng_lb = nullptr; + w_lb = nullptr; + mg_lb = nullptr; + e = nullptr; + feq = nullptr; + feqold = nullptr; + feqn = nullptr; + feqoldn = nullptr; + f_lb = nullptr; + fnew = nullptr; + density_lb = nullptr; + u_lb = nullptr; + altogether = nullptr; + buf = nullptr; + Ff = nullptr; + Fftempx = nullptr; + Fftempy = nullptr; + Fftempz = nullptr; //-------------------------------------------------------------------------- // Set the lattice Boltzmann dt. diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 2c7e8dbf4..3c31dc93f 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -45,9 +45,9 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - force_old = NULL; - up = NULL; - up_old = NULL; + force_old = nullptr; + up = nullptr; + up_old = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index f714e3171..741a23c29 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -54,8 +54,8 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - body = NULL; - up = NULL; + body = nullptr; + up = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-LB/fix_lb_viscous.cpp b/src/USER-LB/fix_lb_viscous.cpp index 59fddebd6..602ec29f0 100644 --- a/src/USER-LB/fix_lb_viscous.cpp +++ b/src/USER-LB/fix_lb_viscous.cpp @@ -88,7 +88,7 @@ void FixLbViscous::init() void FixLbViscous::setup(int vflag) { - if (strstr(update->integrate_style,"verlet") != NULL) + if (strstr(update->integrate_style,"verlet") != nullptr) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 732ba0909..3193b23d6 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -76,7 +76,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : } ptr_m->params = new double[nvars]; - if (ptr_m->params == NULL) { + if (ptr_m->params == nullptr) { error->all(FLERR,"Parameter pointer was NULL!"); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index b3122a68d..abe903125 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -129,7 +129,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, is_var[i] = 0; } tstrs[i] = new char[len]; - if (tstrs[i] == NULL ) error->all(FLERR,"Error allocating space for args."); + if (tstrs[i] == nullptr ) error->all(FLERR,"Error allocating space for args."); strcpy( tstrs[i], arg[i+6] + offset ); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h index 42da240ab..7ed1f75fa 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h @@ -125,7 +125,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -136,7 +136,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h index f42902f72..69e4eb13e 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h @@ -112,7 +112,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -123,7 +123,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/manifold.h b/src/USER-MANIFOLD/manifold.h index b0727c346..9adf7055c 100644 --- a/src/USER-MANIFOLD/manifold.h +++ b/src/USER-MANIFOLD/manifold.h @@ -46,7 +46,7 @@ namespace user_manifold { // Abstract base class. class manifold : protected Pointers { public: - manifold(class LAMMPS* lmp) : Pointers(lmp), params(NULL){ } + manifold(class LAMMPS* lmp) : Pointers(lmp), params(nullptr){ } virtual ~manifold(){ delete[] params; } virtual double g( const double * ) = 0; virtual void n( const double *, double * ) = 0; diff --git a/src/USER-MANIFOLD/manifold_factory.cpp b/src/USER-MANIFOLD/manifold_factory.cpp index 7df3e52ed..fe9b7615b 100644 --- a/src/USER-MANIFOLD/manifold_factory.cpp +++ b/src/USER-MANIFOLD/manifold_factory.cpp @@ -54,7 +54,7 @@ manifold* LAMMPS_NS::user_manifold::create_manifold(const char *mname, LAMMPS *lmp, int narg, char **arg ) { - manifold *man = NULL; + manifold *man = nullptr; make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); diff --git a/src/USER-MANIFOLD/manifold_factory.h b/src/USER-MANIFOLD/manifold_factory.h index 85ee4011b..1eac8bf64 100644 --- a/src/USER-MANIFOLD/manifold_factory.h +++ b/src/USER-MANIFOLD/manifold_factory.h @@ -94,7 +94,7 @@ class manifold; LAMMPS *lmp, int narg, char **arg ) { if( strcmp( m_type::type(), name ) == 0 ){ - if( *man_ptr == NULL ){ + if( *man_ptr == nullptr ){ *man_ptr = new m_type(lmp, narg, arg); } } diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index ef2699929..7b0d7d4d3 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -136,7 +136,7 @@ public: // Manifold itself: manifold_gaussian_bump::manifold_gaussian_bump(class LAMMPS* lmp, int /*narg*/, char **/*arg*/) - : manifold(lmp), lut_z(NULL), lut_zp(NULL) {} + : manifold(lmp), lut_z(nullptr), lut_zp(nullptr) {} manifold_gaussian_bump::~manifold_gaussian_bump() diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index ee86a50bf..a1d2c7a62 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -123,14 +123,14 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla for( std::size_t i = 0; i < parts.size(); ++i ){ thyla_part *p = parts[i]; if (is_in_domain(p,x)) { - if (idx != NULL) *idx = i; + if (idx != nullptr) *idx = i; return p; } } char msg[2048]; sprintf(msg,"Could not find thyla_part for x = (%f,%f,%f)", x[0],x[1],x[2]); error->one(FLERR,msg); - return NULL; + return nullptr; } diff --git a/src/USER-MANIFOLD/manifold_thylakoid.h b/src/USER-MANIFOLD/manifold_thylakoid.h index 35ad4dfd9..d3ffa6776 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.h +++ b/src/USER-MANIFOLD/manifold_thylakoid.h @@ -29,7 +29,7 @@ namespace user_manifold { private: void init_domains(); - thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = NULL ); + thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = nullptr ); int is_in_domain( thyla_part *p, const double *x ); void check_overlap(); std::vector parts; diff --git a/src/USER-MEAMC/meam_impl.cpp b/src/USER-MEAMC/meam_impl.cpp index a546aa0c7..147be9246 100644 --- a/src/USER-MEAMC/meam_impl.cpp +++ b/src/USER-MEAMC/meam_impl.cpp @@ -28,15 +28,15 @@ using namespace LAMMPS_NS; MEAM::MEAM(Memory* mem) : memory(mem) { - phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = NULL; + phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = nullptr; nmax = 0; - rho = rho0 = rho1 = rho2 = rho3 = frhop = NULL; - gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = NULL; - arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = NULL; + rho = rho0 = rho1 = rho2 = rho3 = frhop = nullptr; + gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = nullptr; + arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = nullptr; maxneigh = 0; - scrfcn = dscrfcn = fcpair = NULL; + scrfcn = dscrfcn = fcpair = nullptr; neltypes = 0; for (int i = 0; i < maxelt; i++) { diff --git a/src/USER-MEAMC/meam_setup_done.cpp b/src/USER-MEAMC/meam_setup_done.cpp index ddbb40310..f8703f10e 100644 --- a/src/USER-MEAMC/meam_setup_done.cpp +++ b/src/USER-MEAMC/meam_setup_done.cpp @@ -186,21 +186,21 @@ MEAM::compute_pair_meam(void) double C, s111, s112, s221, S11, S22; // check for previously allocated arrays and free them - if (this->phir != NULL) + if (this->phir != nullptr) memory->destroy(this->phir); - if (this->phirar != NULL) + if (this->phirar != nullptr) memory->destroy(this->phirar); - if (this->phirar1 != NULL) + if (this->phirar1 != nullptr) memory->destroy(this->phirar1); - if (this->phirar2 != NULL) + if (this->phirar2 != nullptr) memory->destroy(this->phirar2); - if (this->phirar3 != NULL) + if (this->phirar3 != nullptr) memory->destroy(this->phirar3); - if (this->phirar4 != NULL) + if (this->phirar4 != nullptr) memory->destroy(this->phirar4); - if (this->phirar5 != NULL) + if (this->phirar5 != nullptr) memory->destroy(this->phirar5); - if (this->phirar6 != NULL) + if (this->phirar6 != nullptr) memory->destroy(this->phirar6); // allocate memory for array that defines the potential diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 6f674c9f4..133bb611c 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -56,10 +56,10 @@ PairMEAMC::PairMEAMC(LAMMPS *lmp) : Pair(lmp) allocated = 0; nelements = 0; - elements = NULL; - mass = NULL; + elements = nullptr; + mass = nullptr; meam_inst = new MEAM(memory); - scale = NULL; + scale = nullptr; // set comm size needed by this Pair @@ -161,7 +161,7 @@ void PairMEAMC::compute(int eflag, int vflag) double **vptr; if (vflag_atom) vptr = vatom; - else vptr = NULL; + else vptr = nullptr; for (ii = 0; ii < inum_half; ii++) { i = ilist_half[ii]; @@ -365,7 +365,7 @@ void PairMEAMC::read_files(const std::string &globalfile, FILE *fp; if (comm->me == 0) { fp = utils::open_potential(globalfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", globalfile)); } @@ -408,7 +408,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (1) { char *ptr; ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -424,7 +424,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (nwords < params_per_line) { int n = strlen(line); ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -440,7 +440,7 @@ void PairMEAMC::read_files(const std::string &globalfile, nwords = 0; words[nwords++] = strtok(line,"' \t\n\r\f"); - while ((words[nwords++] = strtok(NULL,"' \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr,"' \t\n\r\f"))) continue; // skip if element name isn't in element list @@ -556,7 +556,7 @@ void PairMEAMC::read_files(const std::string &globalfile, delete [] rozero; delete [] found; - // done if user param file is NULL + // done if user param file is nullptr if (userfile == "NULL") return; @@ -564,7 +564,7 @@ void PairMEAMC::read_files(const std::string &globalfile, if (comm->me == 0) { fp = utils::open_potential(userfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", userfile)); } @@ -584,7 +584,7 @@ void PairMEAMC::read_files(const std::string &globalfile, char *ptr; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); nline = -1; } else nline = strlen(line) + 1; @@ -603,7 +603,7 @@ void PairMEAMC::read_files(const std::string &globalfile, int nparams = 0; params[nparams++] = strtok(line,"=(), '\t\n\r\f"); while (nparams < maxparams && - (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f"))) + (params[nparams++] = strtok(nullptr,"=(), '\t\n\r\f"))) continue; nparams--; @@ -837,5 +837,5 @@ void *PairMEAMC::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.cpp b/src/USER-MESODPD/compute_edpd_temp_atom.cpp index 9eb6e9752..02aa3e731 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.cpp +++ b/src/USER-MESODPD/compute_edpd_temp_atom.cpp @@ -34,7 +34,7 @@ ComputeEDPDTempAtom::ComputeEDPDTempAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - temp_vector = NULL; + temp_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index 7e9d5eb29..d87d645b6 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -38,7 +38,7 @@ ComputeTDPDCCAtom::ComputeTDPDCCAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - cc_vector = NULL; + cc_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index 9c2e74b88..36ad434f4 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -65,8 +65,8 @@ PairEDPD::PairEDPD(LAMMPS *lmp) : Pair(lmp) { if (lmp->citeme) lmp->citeme->add(cite_pair_edpd); writedata = 1; - random = NULL; - randomT = NULL; + random = nullptr; + randomT = nullptr; } /* ---------------------------------------------------------------------- */ @@ -453,24 +453,24 @@ void PairEDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,nullptr,error); if(power_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,nullptr,error); if(kappa_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -508,9 +508,9 @@ void PairEDPD::write_restart_settings(FILE *fp) void PairEDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-MESODPD/pair_mdpd.cpp b/src/USER-MESODPD/pair_mdpd.cpp index 88b6724a0..62a2ca8d1 100644 --- a/src/USER-MESODPD/pair_mdpd.cpp +++ b/src/USER-MESODPD/pair_mdpd.cpp @@ -54,7 +54,7 @@ PairMDPD::PairMDPD(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_pair_mdpd); writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -348,15 +348,15 @@ void PairMDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&A_att[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&B_rep[i][j],1,MPI_DOUBLE,0,world); @@ -386,10 +386,10 @@ void PairMDPD::write_restart_settings(FILE *fp) void PairMDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESODPD/pair_tdpd.cpp b/src/USER-MESODPD/pair_tdpd.cpp index 65a518c07..b1ffb5ce8 100644 --- a/src/USER-MESODPD/pair_tdpd.cpp +++ b/src/USER-MESODPD/pair_tdpd.cpp @@ -57,7 +57,7 @@ PairTDPD::PairTDPD(LAMMPS *lmp) : Pair(lmp) cc_species = atom->cc_species; writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -395,19 +395,19 @@ void PairTDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,nullptr,error); for(int k=0; kme == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESONT/compute_mesont.cpp b/src/USER-MESONT/compute_mesont.cpp index 96792c898..0321be7c5 100644 --- a/src/USER-MESONT/compute_mesont.cpp +++ b/src/USER-MESONT/compute_mesont.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMesoNT::ComputeMesoNT(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), energy(NULL) { + Compute(lmp, narg, arg), energy(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute mesont command"); std::string ctype = arg[3]; if (ctype == "estretch") compute_type = ES; @@ -62,7 +62,7 @@ double ComputeMesoNT::compute_scalar() { error->all(FLERR,"Energy was not tallied on needed timestep"); int i; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es_tot",i)); else if (compute_type == EB) @@ -104,7 +104,7 @@ void ComputeMesoNT::compute_peratom() { int i; // clear local energy array for (int i = 0; i < ntotal; i++) energy[i] = 0.0; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es",i)); else if (compute_type == EB) diff --git a/src/USER-MESONT/pair_mesocnt.cpp b/src/USER-MESONT/pair_mesocnt.cpp index 96d53bd41..a7b4bf057 100644 --- a/src/USER-MESONT/pair_mesocnt.cpp +++ b/src/USER-MESONT/pair_mesocnt.cpp @@ -244,7 +244,7 @@ void PairMesoCNT::compute(int eflag, int vflag) // infinite CNT case if (endflag == 0) { - geometry(r1,r2,p1,p2,NULL,p,m,param,basis); + geometry(r1,r2,p1,p2,nullptr,p,m,param,basis); if (param[0] > cutoff) continue; finf(param,evdwl,flocal); @@ -760,7 +760,7 @@ void PairMesoCNT::read_file() // open file fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open mesocnt file: {}",file)); utils::sfgets(FLERR,line,MAXLINE,fp,file,error); @@ -846,7 +846,7 @@ void PairMesoCNT::read_data(FILE *fp, double *data, double x,xtemp,dxtemp; for (int i = 0; i < ninput; i++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (i > 0) xtemp = x; @@ -899,7 +899,7 @@ void PairMesoCNT::read_data(FILE *fp, double **data, for (int i = 0; i < ninput; i++) { if (i > 0) xtemp = x; for (int j = 0; j < ninput; j++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (j > 0) ytemp = y; diff --git a/src/USER-MESONT/pair_mesont_tpm.cpp b/src/USER-MESONT/pair_mesont_tpm.cpp index 6d8c8126a..4e5f31c66 100644 --- a/src/USER-MESONT/pair_mesont_tpm.cpp +++ b/src/USER-MESONT/pair_mesont_tpm.cpp @@ -166,7 +166,7 @@ void vector_union(std::vector& v1, std::vector& v2, } MESONTList::MESONTList(const Atom* atom, const NeighList* nblist, double /* rc2 */){ - if (atom == NULL || nblist == NULL) return; + if (atom == nullptr || nblist == nullptr) return; //number of local atoms at the node int nlocal = atom->nlocal; //total number of atoms in the node and ghost shell @@ -305,12 +305,12 @@ PairMESONTTPM::PairMESONTTPM(LAMMPS *lmp) : Pair(lmp) { writedata=1; BendingMode = 0; // Harmonic bending model TPMType = 0; // Inter-tube segment-segment interaction - tab_path = NULL; + tab_path = nullptr; tab_path_length = 0; - eatom_s = NULL; - eatom_b = NULL; - eatom_t = NULL; + eatom_s = nullptr; + eatom_b = nullptr; + eatom_t = nullptr; instance_count++; if(instance_count > 1) error->all(FLERR, "only a single instance of mesont/tpm pair style can be created"); @@ -330,7 +330,7 @@ PairMESONTTPM::~PairMESONTTPM() memory->destroy(eatom_t); } instance_count--; - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); } /* ---------------------------------------------------------------------- */ @@ -597,7 +597,7 @@ void PairMESONTTPM::settings(int narg, char **arg){ } std::string TPMAFile = (narg > 1) ? arg[1] : "MESONT-TABTP.xrs"; tab_path_length = TPMAFile.length(); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); //c_str returns '\0' terminated string memory->create(tab_path,tab_path_length+1,"pair:path"); std::memcpy(tab_path, TPMAFile.c_str(), tab_path_length+1); @@ -738,7 +738,7 @@ void PairMESONTTPM::read_restart_settings(FILE *fp){ MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&tab_path_length,1,MPI_INT,0,world); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); memory->create(tab_path,tab_path_length+1,"pair:path"); if (me == 0) fread(tab_path,tab_path_length+1,1,fp); MPI_Bcast(tab_path,tab_path_length+1,MPI_CHAR,0,world); @@ -793,5 +793,5 @@ void* PairMESONTTPM::extract(const char *str, int &){ else if (strcmp(str,"mesonttpm_Es") == 0) return eatom_s; else if (strcmp(str,"mesonttpm_Eb") == 0) return eatom_b; else if (strcmp(str,"mesonttpm_Et") == 0) return eatom_t; - else return NULL; + else return nullptr; }; diff --git a/src/USER-MGPT/mgpt_readpot.cpp b/src/USER-MGPT/mgpt_readpot.cpp index 144c661b0..c5f7c75d7 100644 --- a/src/USER-MGPT/mgpt_readpot.cpp +++ b/src/USER-MGPT/mgpt_readpot.cpp @@ -66,7 +66,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub FILE *in = fopen(potin_file,"r"); char line[1024]; - if(in == NULL) { + if(in == nullptr) { fprintf(stderr,"@%s:%d: Error reading potin file. Can not open file \'%s\'.\n", __FILE__,__LINE__,potin_file); exit(1); @@ -75,7 +75,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub vsize = 10; volarr = (double *) malloc(sizeof(double) * vsize); n = 0; - while(fgets(line,sizeof(line),in) != NULL) { + while(fgets(line,sizeof(line),in) != nullptr) { double zval,ivol,rws,mass; double r0x,r1x,drx; int nrx,i; @@ -408,7 +408,7 @@ void potdata::readpot(const char *parmin_file,const char *potin_file,const doubl vpairtab[i*nr+j] = vpairtab[i*nr+j]*fscr + v2a - v2b; if(0) if(fabs(vol-ivol) < 0.01) { - static FILE *xfile = NULL; + static FILE *xfile = nullptr; if(j == 0) { xfile = fopen("mgpt5-pot.dat","w"); fprintf(xfile,"%%%% vol = %15.5e ivol = %15.5e i = %d ii = %d\n", diff --git a/src/USER-MGPT/mgpt_readpot.h b/src/USER-MGPT/mgpt_readpot.h index 8f46592e8..c2a6feabe 100644 --- a/src/USER-MGPT/mgpt_readpot.h +++ b/src/USER-MGPT/mgpt_readpot.h @@ -172,7 +172,7 @@ struct potdata2 { strcpy(s,nametemplate); p = strchr(s,'{'); - if(p != NULL) { + if(p != nullptr) { if(sscanf(p+1,"%d:%d:%d",i0,stride,i1) != 3) { fprintf(stderr,"Error in template (\'%s\'), can not parse range.\n",nametemplate); exit(1); @@ -217,12 +217,12 @@ struct potdata2 { const char *parmin_suffix = strchr(parmin_template,'}')+1; const char * potin_suffix = strchr( potin_template,'}')+1; - if(parmin_suffix-1 == NULL) { + if(parmin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. parmin_template=\'%s\'\n", parmin_template); exit(1); } - if(potin_suffix-1 == NULL) { + if(potin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. potin_template=\'%s\'\n", potin_template); exit(1); diff --git a/src/USER-MGPT/pair_mgpt.cpp b/src/USER-MGPT/pair_mgpt.cpp index 070e3cb61..dd4829535 100644 --- a/src/USER-MGPT/pair_mgpt.cpp +++ b/src/USER-MGPT/pair_mgpt.cpp @@ -54,7 +54,7 @@ static double gettime(int x = 0) { if(1) { /* struct timeval tv; - gettimeofday(&tv,NULL); + gettimeofday(&tv,nullptr); return tv.tv_sec + 1e-6 * tv.tv_usec; */ /* @@ -1859,7 +1859,7 @@ void PairMGPT::coeff(int narg, char **arg) if(strspn(arg[iarg+1],"1234") == strlen(arg[iarg+1])) { nbody_flag = 0; for(int i = 0; i<4; i++) - if(strchr(arg[iarg+1],'1'+i) != NULL) { + if(strchr(arg[iarg+1],'1'+i) != nullptr) { nbody_flag = nbody_flag + (1<me == 0) printf("Explicitly adding %d-tuple forces.\n",i+1); } @@ -1906,7 +1906,7 @@ void PairMGPT::coeff(int narg, char **arg) if(comm->me == 0) { FILE *parmin_fp = utils::open_potential(arg[2],lmp,nullptr); FILE *potin_fp = utils::open_potential(arg[3],lmp,nullptr); - if (parmin_fp == NULL || potin_fp == NULL) { + if (parmin_fp == nullptr || potin_fp == nullptr) { char str[128]; sprintf(str,"Cannot open MGPT potential files %s %s",arg[2],arg[3]); error->one(FLERR,str); diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp index a986cb832..f6427171a 100644 --- a/src/USER-MISC/angle_cosine_shift.cpp +++ b/src/USER-MISC/angle_cosine_shift.cpp @@ -37,7 +37,7 @@ using namespace MathConst; AngleCosineShift::AngleCosineShift(LAMMPS *lmp) : Angle(lmp) { - kcost = NULL; + kcost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -225,10 +225,10 @@ void AngleCosineShift::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&kcost[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp index 52bfe751f..9e98c319f 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.cpp +++ b/src/USER-MISC/angle_cosine_shift_exp.cpp @@ -37,13 +37,13 @@ using namespace MathConst; AngleCosineShiftExp::AngleCosineShiftExp(LAMMPS *lmp) : Angle(lmp) { - doExpansion = NULL; - umin = NULL; - a = NULL; - opt1 = NULL; - theta0 = NULL; - sint = NULL; - cost = NULL; + doExpansion = nullptr; + umin = nullptr; + a = nullptr; + opt1 = nullptr; + theta0 = nullptr; + sint = nullptr; + cost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -257,11 +257,11 @@ void AngleCosineShiftExp::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp index 336638f25..6715bd118 100644 --- a/src/USER-MISC/angle_dipole.cpp +++ b/src/USER-MISC/angle_dipole.cpp @@ -35,8 +35,8 @@ using namespace MathConst; AngleDipole::AngleDipole(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - gamma0 = NULL; + k = nullptr; + gamma0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -206,8 +206,8 @@ void AngleDipole::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&gamma0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier.cpp b/src/USER-MISC/angle_fourier.cpp index 907ee973b..fc14736a0 100644 --- a/src/USER-MISC/angle_fourier.cpp +++ b/src/USER-MISC/angle_fourier.cpp @@ -38,10 +38,10 @@ using namespace MathConst; AngleFourier::AngleFourier(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C0 = NULL; - C1 = NULL; - C2 = NULL; + k = nullptr; + C0 = nullptr; + C1 = nullptr; + C2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -232,10 +232,10 @@ void AngleFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier_simple.cpp b/src/USER-MISC/angle_fourier_simple.cpp index 8894f7b4c..abd02535c 100644 --- a/src/USER-MISC/angle_fourier_simple.cpp +++ b/src/USER-MISC/angle_fourier_simple.cpp @@ -38,9 +38,9 @@ using namespace MathConst; AngleFourierSimple::AngleFourierSimple(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C = NULL; - N = NULL; + k = nullptr; + C = nullptr; + N = nullptr; } /* ---------------------------------------------------------------------- */ @@ -238,9 +238,9 @@ void AngleFourierSimple::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp index 93f45f956..50a73af7b 100644 --- a/src/USER-MISC/angle_quartic.cpp +++ b/src/USER-MISC/angle_quartic.cpp @@ -233,10 +233,10 @@ void AngleQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&k3[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp index 5889400b9..28badce91 100644 --- a/src/USER-MISC/bond_harmonic_shift.cpp +++ b/src/USER-MISC/bond_harmonic_shift.cpp @@ -177,9 +177,9 @@ void BondHarmonicShift::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp index 86e6263f9..b875fb71b 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.cpp +++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp @@ -179,9 +179,9 @@ void BondHarmonicShiftCut::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 87671655b..4f79fea51 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -44,7 +44,7 @@ BondSpecial::~BondSpecial() void BondSpecial::init_style() { - if (force->pair == NULL) error->all(FLERR,"No pair style defined"); + if (force->pair == nullptr) error->all(FLERR,"No pair style defined"); else if ((force->pair->single_enable == 0) || force->pair->manybody_flag) error->all(FLERR,"Pair style does not support bond style special"); @@ -59,7 +59,7 @@ void BondSpecial::init_style() force->special_coul[3] != 1.0)) error->all(FLERR,"Invalid 1-4 setting for bond style special."); - if (force->kspace != NULL) + if (force->kspace != nullptr) error->all(FLERR,"Bond style special is not compatible with long range " "Coulombic interactions"); } diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp index bcf41591e..df0636d7b 100644 --- a/src/USER-MISC/compute_ackland_atom.cpp +++ b/src/USER-MISC/compute_ackland_atom.cpp @@ -48,13 +48,13 @@ ComputeAcklandAtom::ComputeAcklandAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - structure = NULL; + structure = nullptr; maxneigh = 0; legacy = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; int iarg = 3; while (narg > iarg) { diff --git a/src/USER-MISC/compute_basal_atom.cpp b/src/USER-MISC/compute_basal_atom.cpp index 3b9b38343..fa59a0257 100644 --- a/src/USER-MISC/compute_basal_atom.cpp +++ b/src/USER-MISC/compute_basal_atom.cpp @@ -44,12 +44,12 @@ ComputeBasalAtom::ComputeBasalAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 3; nmax = 0; - BPV = NULL; + BPV = nullptr; maxneigh = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 52656ec9d..5efab292b 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -49,7 +49,7 @@ enum{NCOMMON}; ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), cnpv(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), cnpv(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cnp/atom command"); @@ -92,7 +92,7 @@ ComputeCNPAtom::~ComputeCNPAtom() void ComputeCNPAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cnp/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/USER-MISC/compute_entropy_atom.cpp b/src/USER-MISC/compute_entropy_atom.cpp index d539d51e9..2a308c427 100644 --- a/src/USER-MISC/compute_entropy_atom.cpp +++ b/src/USER-MISC/compute_entropy_atom.cpp @@ -40,7 +40,7 @@ using namespace MathConst; ComputeEntropyAtom:: ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pair_entropy(NULL), pair_entropy_avg(NULL) + pair_entropy(nullptr), pair_entropy_avg(nullptr) { if (narg < 5 || narg > 10) error->all(FLERR,"Illegal compute entropy/atom command; wrong number" @@ -118,7 +118,7 @@ ComputeEntropyAtom::~ComputeEntropyAtom() void ComputeEntropyAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute entropy/atom requires a pair style be" " defined"); diff --git a/src/USER-MISC/compute_gyration_shape.cpp b/src/USER-MISC/compute_gyration_shape.cpp index aef5ef91a..6aef8c80e 100644 --- a/src/USER-MISC/compute_gyration_shape.cpp +++ b/src/USER-MISC/compute_gyration_shape.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShape::ComputeGyrationShape(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration(NULL) + Compute(lmp, narg, arg), id_gyration(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape command"); diff --git a/src/USER-MISC/compute_gyration_shape_chunk.cpp b/src/USER-MISC/compute_gyration_shape_chunk.cpp index 116d85102..2c9bf9d3e 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.cpp +++ b/src/USER-MISC/compute_gyration_shape_chunk.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShapeChunk::ComputeGyrationShapeChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration_chunk(NULL), shape_parameters(NULL) + Compute(lmp, narg, arg), id_gyration_chunk(nullptr), shape_parameters(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape/chunk command"); diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index f2ccf2694..f7a9f9fcf 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -73,7 +73,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_temp(NULL), deltaR(NULL) + Compute(lmp, narg, arg), id_temp(nullptr), deltaR(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute hma command"); if (igroup) error->all(FLERR,"Compute hma must use group all"); @@ -199,7 +199,7 @@ ComputeHMA::~ComputeHMA() void ComputeHMA::init() { if (computeCv>-1) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute hma cv"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute hma cv"); @@ -222,7 +222,7 @@ void ComputeHMA::setup() int ifix = modify->find_fix(id_temp); if (ifix < 0) error->all(FLERR,"Could not find compute hma temperature ID"); double * temperat = (double *) modify->fix[ifix]->extract("t_target",dummy); - if (temperat==NULL) error->all(FLERR,"Could not find compute hma temperature ID"); + if (temperat==nullptr) error->all(FLERR,"Could not find compute hma temperature ID"); finaltemp = * temperat; // set fix which stores original atom coords diff --git a/src/USER-MISC/compute_pressure_cylinder.cpp b/src/USER-MISC/compute_pressure_cylinder.cpp index 6cf375dd1..e050275f7 100644 --- a/src/USER-MISC/compute_pressure_cylinder.cpp +++ b/src/USER-MISC/compute_pressure_cylinder.cpp @@ -48,10 +48,10 @@ static const char cite_compute_pressure_cylinder[] = ComputePressureCyl::ComputePressureCyl(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - Pr_temp(NULL), Pr_all(NULL), Pz_temp(NULL), Pz_all(NULL), Pphi_temp(NULL), - Pphi_all(NULL), R(NULL), Rinv(NULL), R2(NULL), PrAinv(NULL), PzAinv(NULL), - R2kin(NULL), density_temp(NULL), invVbin(NULL), density_all(NULL), - tangent(NULL), ephi_x(NULL), ephi_y(NULL), binz(NULL) + Pr_temp(nullptr), Pr_all(nullptr), Pz_temp(nullptr), Pz_all(nullptr), Pphi_temp(nullptr), + Pphi_all(nullptr), R(nullptr), Rinv(nullptr), R2(nullptr), PrAinv(nullptr), PzAinv(nullptr), + R2kin(nullptr), density_temp(nullptr), invVbin(nullptr), density_all(nullptr), + tangent(nullptr), ephi_x(nullptr), ephi_y(nullptr), binz(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_pressure_cylinder); if (narg != 7) error->all(FLERR,"Illegal compute pressure/cylinder command"); @@ -143,7 +143,7 @@ ComputePressureCyl::~ComputePressureCyl() void ComputePressureCyl::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pressure/cylinder"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pressure/cylinder"); diff --git a/src/USER-MISC/compute_pressure_grem.cpp b/src/USER-MISC/compute_pressure_grem.cpp index ba949727b..6a5c36a06 100644 --- a/src/USER-MISC/compute_pressure_grem.cpp +++ b/src/USER-MISC/compute_pressure_grem.cpp @@ -55,7 +55,7 @@ void ComputePressureGrem::init() int dim; scale_grem = (double *)modify->fix[ifix]->extract("scale_grem",dim); - if (scale_grem == NULL || dim != 0) + if (scale_grem == nullptr || dim != 0) error->all(FLERR,"Cannot extract gREM scale factor from fix grem"); } diff --git a/src/USER-MISC/compute_stress_mop.cpp b/src/USER-MISC/compute_stress_mop.cpp index c733c929b..2abe812f1 100644 --- a/src/USER-MISC/compute_stress_mop.cpp +++ b/src/USER-MISC/compute_stress_mop.cpp @@ -117,7 +117,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // Initialize some variables - values_local = values_global = vector = NULL; + values_local = values_global = vector = nullptr; // this fix produces a global vector @@ -173,7 +173,7 @@ void ComputeStressMop::init() // This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop"); @@ -185,15 +185,15 @@ void ComputeStressMop::init() //Compute stress/mop only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_stress_mop_profile.cpp b/src/USER-MISC/compute_stress_mop_profile.cpp index 323aee851..6beb3ffd8 100644 --- a/src/USER-MISC/compute_stress_mop_profile.cpp +++ b/src/USER-MISC/compute_stress_mop_profile.cpp @@ -112,8 +112,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a // initialize some variables nbins = 0; - coord = coordp = NULL; - values_local = values_global = array = NULL; + coord = coordp = nullptr; + values_local = values_global = array = nullptr; // bin setup @@ -173,7 +173,7 @@ void ComputeStressMopProfile::init() //This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop/profile"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop/profile"); @@ -185,15 +185,15 @@ void ComputeStressMopProfile::init() //Compute stress/mop/profile only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp index c333357a9..5aafe1903 100644 --- a/src/USER-MISC/compute_temp_rotate.cpp +++ b/src/USER-MISC/compute_temp_rotate.cpp @@ -42,7 +42,7 @@ ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-MISC/compute_viscosity_cos.cpp b/src/USER-MISC/compute_viscosity_cos.cpp index dae93a8d8..4a798eb15 100644 --- a/src/USER-MISC/compute_viscosity_cos.cpp +++ b/src/USER-MISC/compute_viscosity_cos.cpp @@ -45,7 +45,7 @@ ComputeViscosityCos::ComputeViscosityCos(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[7]; } diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp index 7c131682f..d5cd27189 100644 --- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp +++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp @@ -322,11 +322,11 @@ void DihedralCosineShiftExp::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp index 066447f92..cb620ae7d 100644 --- a/src/USER-MISC/dihedral_fourier.cpp +++ b/src/USER-MISC/dihedral_fourier.cpp @@ -365,7 +365,7 @@ void DihedralFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -380,9 +380,9 @@ void DihedralFourier::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,NULL,error); - utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index bde8d8407..bf1b2fa75 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -320,7 +320,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -330,7 +330,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) if (comm->me == 0) { for(int i = 1; i <= atom->ndihedraltypes; i++) - utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,nullptr,error); } for (int i = 1; i <= atom->ndihedraltypes; i++ ) diff --git a/src/USER-MISC/dihedral_quadratic.cpp b/src/USER-MISC/dihedral_quadratic.cpp index deafc8391..68be19833 100644 --- a/src/USER-MISC/dihedral_quadratic.cpp +++ b/src/USER-MISC/dihedral_quadratic.cpp @@ -326,8 +326,8 @@ void DihedralQuadratic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&phi0[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_spherical.cpp b/src/USER-MISC/dihedral_spherical.cpp index 15bb458c4..d20048299 100644 --- a/src/USER-MISC/dihedral_spherical.cpp +++ b/src/USER-MISC/dihedral_spherical.cpp @@ -654,16 +654,16 @@ void DihedralSpherical::allocate() theta2_shift = new double * [n+1]; theta2_offset = new double * [n+1]; for (int i = 1; i <= n; i++) { - Ccoeff[i] = NULL; - phi_mult[i] = NULL; - phi_shift[i] = NULL; - phi_offset[i] = NULL; - theta1_mult[i] = NULL; - theta1_shift[i] = NULL; - theta1_offset[i] = NULL; - theta2_mult[i] = NULL; - theta2_shift[i] = NULL; - theta2_offset[i] = NULL; + Ccoeff[i] = nullptr; + phi_mult[i] = nullptr; + phi_shift[i] = nullptr; + phi_offset[i] = nullptr; + theta1_mult[i] = nullptr; + theta1_shift[i] = nullptr; + theta1_offset[i] = nullptr; + theta2_mult[i] = nullptr; + theta2_shift[i] = nullptr; + theta2_offset[i] = nullptr; } memory->create(setflag,n+1,"dihedral:setflag"); @@ -755,7 +755,7 @@ void DihedralSpherical::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -775,16 +775,16 @@ void DihedralSpherical::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 91a8642b1..d09684df9 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -788,7 +788,7 @@ void DihedralTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } @@ -1014,8 +1014,8 @@ void DihedralTable::write_restart_settings(FILE *fp) void DihedralTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1027,10 +1027,10 @@ void DihedralTable::read_restart_settings(FILE *fp) void DihedralTable::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index f8a2f0259..3933e3934 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -412,8 +412,8 @@ DihedralTableCut::DihedralTableCut(LAMMPS *lmp) : Dihedral(lmp) { if (lmp->citeme) lmp->citeme->add(cite_dihedral_tablecut); ntables = 0; - tables = NULL; - checkU_fname = checkF_fname = NULL; + tables = nullptr; + checkU_fname = checkF_fname = nullptr; } /* ---------------------------------------------------------------------- */ @@ -779,7 +779,7 @@ void DihedralTableCut::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -1029,8 +1029,8 @@ void DihedralTableCut::write_restart_settings(FILE *fp) void DihedralTableCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1041,10 +1041,10 @@ void DihedralTableCut::read_restart_settings(FILE *fp) void DihedralTableCut::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1079,7 +1079,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { string err_msg = string("Cannot open file ") + string(file); error->one(FLERR,err_msg); } @@ -1087,7 +1087,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) { + if (fgets(line,MAXLINE,fp) == nullptr) { string err_msg=string("Did not find keyword \"") +string(keyword)+string("\" in dihedral table file."); error->one(FLERR, err_msg); @@ -1121,7 +1121,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // Skip blank lines and delete text following a '#' character char *pe = strchr(line, '#'); - if (pe != NULL) *pe = '\0'; //terminate string at '#' character + if (pe != nullptr) *pe = '\0'; //terminate string at '#' character char *pc = line; while ((*pc != '\0') && isspace(*pc)) pc++; @@ -1344,7 +1344,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"NOF") == 0) { @@ -1357,20 +1357,20 @@ void DihedralTableCut::param_extract(Table *tb, char *line) tb->use_degrees = false; } else if (strcmp(word,"CHECKU") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkU_fname); memory->create(checkU_fname,strlen(word)+1,"dihedral_table:checkU"); strcpy(checkU_fname, word); } else if (strcmp(word,"CHECKF") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkF_fname); memory->create(checkF_fname,strlen(word)+1,"dihedral_table:checkF"); strcpy(checkF_fname, word); } // COMMENTING OUT: equilibrium angles are not supported //else if (strcmp(word,"EQ") == 0) { - // word = strtok(NULL," \t\n\r\f"); + // word = strtok(nullptr," \t\n\r\f"); // tb->theta0 = atof(word); //} else { @@ -1378,7 +1378,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) err_msg += string(" (") + string(word) + string(")"); error->one(FLERR, err_msg); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index ed796280e..f1b64817b 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -51,7 +51,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index d92789f03..57eb9705b 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -118,13 +118,13 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): type = AUTO; startstep = 0; - fp = NULL; + fp = nullptr; overwrite = 0; numcorrelators=20; p = 16; m = 2; - char *title1 = NULL; - char *title2 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"type") == 0) { @@ -163,7 +163,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Illegal fix ave/correlate/long command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ave/correlate/long file %s",arg[iarg+1]); error->one(FLERR,str); diff --git a/src/USER-MISC/fix_electron_stopping.cpp b/src/USER-MISC/fix_electron_stopping.cpp index 952ffe758..52ab44b0c 100644 --- a/src/USER-MISC/fix_electron_stopping.cpp +++ b/src/USER-MISC/fix_electron_stopping.cpp @@ -242,7 +242,7 @@ void FixElectronStopping::read_table(const char *file) char line[MAXLINE]; FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str, 128, "Cannot open stopping range table %s", file); error->one(FLERR, str); @@ -252,21 +252,21 @@ void FixElectronStopping::read_table(const char *file) int l = 0; while (true) { - if (fgets(line, MAXLINE, fp) == NULL) break; // end of file + if (fgets(line, MAXLINE, fp) == nullptr) break; // end of file if (line[0] == '#') continue; // comment char *pch = strtok(line, " \t\n\r"); - if (pch == NULL) continue; // blank line + if (pch == nullptr) continue; // blank line if (l >= maxlines) grow_table(); int i = 0; - for ( ; i < ncol && pch != NULL; i++) { + for ( ; i < ncol && pch != nullptr; i++) { elstop_ranges[i][l] = utils::numeric(FLERR, pch,false,lmp); - pch = strtok(NULL, " \t\n\r"); + pch = strtok(nullptr, " \t\n\r"); } - if (i != ncol || pch != NULL) // too short or too long + if (i != ncol || pch != nullptr) // too short or too long error->one(FLERR, "fix electron/stopping: Invalid table line"); if (l >= 1 && elstop_ranges[0][l] <= elstop_ranges[0][l-1]) diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index fb111c1f2..c0f79869b 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -106,11 +106,11 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"ffl:sqrt_m"); // allocates space for temporaries - ffl_tmp1=ffl_tmp2=NULL; + ffl_tmp1=ffl_tmp2=nullptr; grow_arrays(atom->nmax); @@ -426,7 +426,7 @@ void *FixFFL::extract(const char *str, int &dim) { if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 86650cd50..6ed2632b4 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -149,22 +149,22 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : angle_distance = new double[atom->nangletypes+1]; //grow_arrays - array_atom = NULL; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + array_atom = nullptr; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); //calls grow_arrays - x_store = NULL; + x_store = nullptr; //STUFF - g = NULL; - help2 = NULL; + g = nullptr; + help2 = nullptr; - dn1dx = dn2dx = dn3dx = NULL; - n1 = n2 = n3 = del1 = del2 = del3 = NULL; + dn1dx = dn2dx = dn3dx = nullptr; + n1 = n2 = n3 = del1 = del2 = del3 = nullptr; memory->grow(help2,15,15,"FilterCorotate:help2"); memory->grow(n1,3,"FilterCorotate:n1"); @@ -188,11 +188,11 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : // initialize list of clusters to constrain maxlist = 0; - list = NULL; - clist_derv = NULL; - clist_q0 = NULL; //list for derivative and ref. config - clist_nselect1 = clist_nselect2 = NULL; - clist_select1 = clist_select2 = NULL; + list = nullptr; + clist_derv = nullptr; + clist_q0 = nullptr; //list for derivative and ref. config + clist_nselect1 = clist_nselect2 = nullptr; + clist_select1 = clist_select2 = nullptr; } @@ -284,7 +284,7 @@ void FixFilterCorotate::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for fix filter/corotate"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -1225,7 +1225,7 @@ void FixFilterCorotate::find_clusters() // cycle buffer around ring of procs back to self - comm->ring(size,sizeof(tagint),buf,3,ring_shake,NULL,(void *)this); + comm->ring(size,sizeof(tagint),buf,3,ring_shake,nullptr,(void *)this); memory->destroy(buf); diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index f4776c3d6..04be66521 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -218,11 +218,11 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : int seed = utils::inumeric(FLERR,arg[6],false,lmp); // LOADING A matrix - FILE *fgle = NULL; + FILE *fgle = nullptr; char *fname = arg[7]; if (comm->me == 0) { fgle = utils::open_potential(fname,lmp,nullptr); - if (fgle == NULL) { + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open A-matrix file %s",fname); error->one(FLERR,str); @@ -238,7 +238,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -258,9 +258,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { A[ndone] = atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } fnoneq=0; gle_every=1; gle_step=0; @@ -292,7 +292,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : } else { if (comm->me == 0) { fgle = utils::open_potential(fname,lmp,nullptr); - if (fgle == NULL) { + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open C-matrix file %s",fname); error->one(FLERR,str); @@ -310,7 +310,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -330,9 +330,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { C[ndone] = cfac*atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } } @@ -349,13 +349,13 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"gle:sqrt_m"); // allocates space for additional degrees of freedom - gle_s=NULL; + gle_s=nullptr; // allocates space for temporaries - gle_tmp1=gle_tmp2=NULL; + gle_tmp1=gle_tmp2=nullptr; grow_arrays(atom->nmax); init_gles(); @@ -720,7 +720,7 @@ void *FixGLE::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index b17c601f0..0a283522e 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -132,7 +132,7 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : pressflag = 0; int *p_flag = (int *)nh->extract("p_flag",ifix); - if ((p_flag == NULL) || (ifix != 1) || (p_flag[0] == 0) + if ((p_flag == nullptr) || (ifix != 1) || (p_flag[0] == 0) || (p_flag[1] == 0) || (p_flag[2] == 0)) { pressflag = 0; } else if ((p_flag[0] == 1) && (p_flag[1] == 1) @@ -203,7 +203,7 @@ void FixGrem::init() double *t_start = (double *)nh->extract("t_start",ifix); double *t_stop = (double *)nh->extract("t_stop",ifix); - if ((t_start != NULL) && (t_stop != NULL) && (ifix == 0)) { + if ((t_start != nullptr) && (t_stop != nullptr) && (ifix == 0)) { tbath = *t_start; if (*t_start != *t_stop) error->all(FLERR,"Thermostat temperature ramp not allowed"); @@ -215,7 +215,7 @@ void FixGrem::init() int *p_flag = (int *)nh->extract("p_flag",ifix); double *p_start = (double *) nh->extract("p_start",ifix); double *p_stop = (double *) nh->extract("p_stop",ifix); - if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL) + if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr) && (ifix == 1)) { ifix = 0; pressref = p_start[0]; @@ -291,5 +291,5 @@ void *FixGrem::extract(const char *str, int &dim) if (strcmp(str,"scale_grem") == 0) { return &scale_grem; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 7c3fac9c3..d772998b1 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -207,7 +207,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -229,7 +229,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -280,7 +280,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -288,7 +288,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -492,25 +492,25 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); /* initialize various imd state variables. */ - clientsock = NULL; - localsock = NULL; + clientsock = nullptr; + localsock = nullptr; nlevels_respa = 0; imd_inactive = 0; imd_terminate = 0; imd_forces = 0; - force_buf = NULL; + force_buf = nullptr; maxbuf = 0; - msgdata = NULL; + msgdata = nullptr; msglen = 0; - comm_buf = NULL; - idmap = NULL; - rev_idmap = NULL; + comm_buf = nullptr; + idmap = nullptr; + rev_idmap = nullptr; if (me == 0) { /* set up incoming socket on MPI rank 0. */ imdsock_init(); localsock = imdsock_create(); - clientsock = NULL; + clientsock = nullptr; if (imdsock_bind(localsock,imd_port)) { perror("bind to socket failed"); imdsock_destroy(localsock); @@ -536,9 +536,9 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : /* set up mutex and condition variable for i/o thread */ /* hold mutex before creating i/o thread to keep it waiting. */ - pthread_mutex_init(&read_mutex, NULL); - pthread_mutex_init(&write_mutex, NULL); - pthread_cond_init(&write_cond, NULL); + pthread_mutex_init(&read_mutex, nullptr); + pthread_mutex_init(&write_mutex, nullptr); + pthread_cond_init(&write_cond, nullptr); pthread_mutex_lock(&write_mutex); buf_has_data=0; @@ -564,7 +564,7 @@ FixIMD::~FixIMD() buf_has_data=-1; pthread_cond_signal(&write_cond); pthread_mutex_unlock(&write_mutex); - pthread_join(iothread, NULL); + pthread_join(iothread, nullptr); /* cleanup */ pthread_attr_destroy(&iot_attr); @@ -584,8 +584,8 @@ FixIMD::~FixIMD() imdsock_destroy(clientsock); imdsock_shutdown(localsock); imdsock_destroy(localsock); - clientsock=NULL; - localsock=NULL; + clientsock=nullptr; + localsock=nullptr; return; } @@ -627,7 +627,7 @@ int FixIMD::reconnect() } } connect_msg = 0; - clientsock = NULL; + clientsock = nullptr; if (nowait_flag) { int retval = imdsock_selread(localsock,0); if (retval > 0) { @@ -774,7 +774,7 @@ void *fix_imd_ioworker(void *t) { FixIMD *imd=(FixIMD *)t; imd->ioworker(); - return NULL; + return nullptr; } /* the real i/o worker thread */ @@ -787,7 +787,7 @@ void FixIMD::ioworker() fprintf(screen,"Asynchronous I/O thread is exiting.\n"); buf_has_data=0; pthread_mutex_unlock(&write_mutex); - pthread_exit(NULL); + pthread_exit(nullptr); } else if (buf_has_data > 0) { /* send coordinate data, if client is able to accept */ if (clientsock && imdsock_selwrite(clientsock,0)) { @@ -855,9 +855,9 @@ void FixIMD::post_force(int /*vflag*/) imd_paused = 0; imd_forces = 0; memory->destroy(force_buf); - force_buf = NULL; + force_buf = nullptr; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; if (screen) fprintf(screen, "IMD client detached. LAMMPS run continues.\n"); @@ -875,7 +875,7 @@ void FixIMD::post_force(int /*vflag*/) imd_terminate = 1; imd_paused = 0; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; break; case IMD_PAUSE: @@ -958,7 +958,7 @@ void FixIMD::post_force(int /*vflag*/) /* check if we need to readjust the forces comm buffer on the receiving nodes. */ if (me != 0) { if (old_imd_forces < imd_forces) { /* grow holding space for forces, if needed. */ - if (force_buf != NULL) + if (force_buf != nullptr) memory->sfree(force_buf); force_buf = memory->smalloc(imd_forces*size_one, "imd:force_buf"); } @@ -1200,14 +1200,14 @@ void * imdsock_create(void) { imdsocket * s; s = (imdsocket *) malloc(sizeof(imdsocket)); - if (s != NULL) + if (s != nullptr) memset(s, 0, sizeof(imdsocket)); - else return NULL; + else return nullptr; if ((s->sd = socket(PF_INET, SOCK_STREAM, 0)) == -1) { printf("Failed to open socket."); free(s); - return NULL; + return nullptr; } return (void *) s; @@ -1229,7 +1229,7 @@ int imdsock_listen(void * v) { void *imdsock_accept(void * v) { int rc; - imdsocket *new_s = NULL, *s = (imdsocket *) v; + imdsocket *new_s = nullptr, *s = (imdsocket *) v; #if defined(ARCH_AIX5) || defined(ARCH_AIX5_64) || defined(ARCH_AIX6_64) unsigned int len; #define _SOCKLEN_TYPE unsigned int @@ -1248,7 +1248,7 @@ void *imdsock_accept(void * v) { rc = accept(s->sd, (struct sockaddr *) &s->addr, ( _SOCKLEN_TYPE * ) &len); if (rc >= 0) { new_s = (imdsocket *) malloc(sizeof(imdsocket)); - if (new_s != NULL) { + if (new_s != nullptr) { *new_s = *s; new_s->sd = rc; } @@ -1277,7 +1277,7 @@ int imdsock_read(void * v, void *buf, int len) { void imdsock_shutdown(void *v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1289,7 +1289,7 @@ void imdsock_shutdown(void *v) { void imdsock_destroy(void * v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1306,14 +1306,14 @@ int imdsock_selread(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&rfd); FD_SET(s->sd, &rfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd+1, &rfd, NULL, NULL, &tv); + rc = select(s->sd+1, &rfd, nullptr, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; @@ -1325,14 +1325,14 @@ int imdsock_selwrite(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&wfd); FD_SET(s->sd, &wfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd + 1, NULL, &wfd, NULL, &tv); + rc = select(s->sd + 1, nullptr, &wfd, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; } diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index b8045a9ff..2ddc965bb 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -167,7 +167,7 @@ static void readbuffer(int sockfd, char *data, int len, Error* error) /* ---------------------------------------------------------------------- */ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), irregular(NULL) + Fix(lmp, narg, arg), irregular(nullptr) { /* format for fix: * fix num group_id ipi host port [unix] diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 9361d9ebd..a613ceb9b 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -53,10 +53,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL), id_store(NULL),init_store(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr), id_store(nullptr),init_store(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix npt/cauchy command"); @@ -583,10 +583,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -794,7 +794,7 @@ void FixNPTCauchy::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -821,7 +821,7 @@ void FixNPTCauchy::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1812,7 +1812,7 @@ void *FixNPTCauchy::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 5f1582d58..2d8d16e40 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -61,7 +61,7 @@ struct FixOrientECO::Nbr { FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - dir_filename(NULL), order(NULL), nbr(NULL), list(NULL) + dir_filename(nullptr), order(nullptr), nbr(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_eco); @@ -96,7 +96,7 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : int count; FILE *infile = utils::open_potential(dir_filename,lmp,nullptr); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open fix orient/eco file {}: {}", dir_filename, utils::getsyserror())); for (int i = 0; i < 6; ++i) { diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp index 1ac0ffb18..4b107c648 100644 --- a/src/USER-MISC/fix_pafi.cpp +++ b/src/USER-MISC/fix_pafi.cpp @@ -58,8 +58,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixPAFI::FixPAFI(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), computename(NULL), random(NULL), - h(NULL), step_respa(NULL) + Fix(lmp, narg, arg), computename(nullptr), random(nullptr), + h(nullptr), step_respa(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_pafi_package); diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 5be9bf162..998dcdadf 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -87,27 +87,27 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) /* Initiation */ max_nsend = 0; - tag_send = NULL; - buf_send = NULL; + tag_send = nullptr; + buf_send = nullptr; max_nlocal = 0; - buf_recv = NULL; - buf_beads = NULL; + buf_recv = nullptr; + buf_beads = nullptr; size_plan = 0; - plan_send = plan_recv = NULL; + plan_send = plan_recv = nullptr; - M_x2xp = M_xp2x = M_f2fp = M_fp2f = NULL; - lam = NULL; - mode_index = NULL; + M_x2xp = M_xp2x = M_f2fp = M_fp2f = nullptr; + lam = nullptr; + mode_index = nullptr; - mass = NULL; + mass = nullptr; - array_atom = NULL; - nhc_eta = NULL; - nhc_eta_dot = NULL; - nhc_eta_dotdot = NULL; - nhc_eta_mass = NULL; + array_atom = nullptr; + nhc_eta = nullptr; + nhc_eta_dot = nullptr; + nhc_eta_dotdot = nullptr; + nhc_eta_mass = nullptr; size_peratom_cols = 12 * nhc_nchain + 3; @@ -601,7 +601,7 @@ void FixPIMD::comm_init() } buf_beads = new double* [np]; - for(int i=0; iall(FLERR, "Illegal fix propel/self command"); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 97bf1fb07..ad96ec712 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -55,7 +55,7 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // initial allocation of atom-based array // register with Atom class - array = NULL; + array = nullptr; grow_arrays(atom->nmax); // extends pack_exchange() @@ -100,7 +100,7 @@ int FixSRP::setmask() void FixSRP::init() { - if (force->pair_match("hybrid",1) == NULL && force->pair_match("hybrid/overlay",1) == NULL) + if (force->pair_match("hybrid",1) == nullptr && force->pair_match("hybrid/overlay",1) == nullptr) error->all(FLERR,"Cannot use pair srp without pair_style hybrid"); int has_rigid = 0; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index bc10b5284..f2638f8a9 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -74,7 +74,7 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : // Perform initial allocation of atom-based array // Register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index c12019528..728a50999 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -67,11 +67,11 @@ static const char cite_fix_ttm_mod[] = FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_ttm_mod); @@ -103,7 +103,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : if (narg != 11) error->all(FLERR,"Illegal fix ttm/mod command"); if (comm->me == 0) { fp = fopen(arg[10],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ttm/mod file %s",arg[10]); error->one(FLERR,str); @@ -151,7 +151,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : "ttm/mod:net_energy_transfer"); memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "ttm/mod:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -560,7 +560,7 @@ void FixTTMMod::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 9a8454b01..6c3a58bc3 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -38,7 +38,7 @@ enum{NONE,DIFFUSIVE,MAXWELL,CCL}; FixWallReflectStochastic:: FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : - FixWallReflect(lmp, narg, arg), random(NULL) + FixWallReflect(lmp, narg, arg), random(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/reflect/stochastic command"); diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp index 571493121..9f6e7f114 100644 --- a/src/USER-MISC/improper_cossq.cpp +++ b/src/USER-MISC/improper_cossq.cpp @@ -302,8 +302,8 @@ void ImproperCossq::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_distance.cpp b/src/USER-MISC/improper_distance.cpp index 476cf8ab4..cbdb5130e 100644 --- a/src/USER-MISC/improper_distance.cpp +++ b/src/USER-MISC/improper_distance.cpp @@ -248,8 +248,8 @@ void ImproperDistance::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp index 85f7809a0..8f54c8b7a 100644 --- a/src/USER-MISC/improper_fourier.cpp +++ b/src/USER-MISC/improper_fourier.cpp @@ -326,11 +326,11 @@ void ImproperFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp index c85e4850c..b2a71b10a 100644 --- a/src/USER-MISC/improper_ring.cpp +++ b/src/USER-MISC/improper_ring.cpp @@ -326,8 +326,8 @@ void ImproperRing::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index 41f9bc953..afd600594 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -85,11 +85,11 @@ PairAGNI::PairAGNI(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nelements = 0; - elements = NULL; - elem2param = NULL; + elements = nullptr; + elem2param = nullptr; nparams = 0; - params = NULL; - map = NULL; + params = nullptr; + map = nullptr; cutmax = 0.0; } @@ -114,7 +114,7 @@ PairAGNI::~PairAGNI() delete [] params[i].yU; } memory->destroy(params); - params = NULL; + params = nullptr; } if (allocated) { @@ -266,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -275,7 +275,7 @@ void PairAGNI::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -348,7 +348,7 @@ double PairAGNI::init_one(int i, int j) void PairAGNI::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = 0; // open file on proc 0 only @@ -357,7 +357,7 @@ void PairAGNI::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open AGNI potential file %s",file); error->one(FLERR,str); @@ -373,7 +373,7 @@ void PairAGNI::read_file(char *file) n = 0; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -396,7 +396,7 @@ void PairAGNI::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; --nwords; if ((nwords == 2) && (strcmp(words[0],"generation") == 0)) { diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 9ef96f118..8c1114c4d 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -304,15 +304,15 @@ void PairBuckMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -343,11 +343,11 @@ void PairBuckMDF::write_restart_settings(FILE *fp) void PairBuckMDF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); @@ -396,5 +396,5 @@ void *PairBuckMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index 1203cea5f..84383c102 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -271,14 +271,14 @@ void PairCosineSquared::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { if (me == 0) - utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,nullptr,error); MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,nullptr,error); } MPI_Bcast(&epsilon[i][j], 1, MPI_DOUBLE, 0, world); MPI_Bcast(&sigma[i][j], 1, MPI_DOUBLE, 0, world); @@ -306,7 +306,7 @@ void PairCosineSquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,NULL,error); + utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,nullptr,error); } MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world); } diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index 5a3e12f1a..35995717b 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -281,13 +281,13 @@ void PairCoulDiel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&rme[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairCoulDiel::write_restart_settings(FILE *fp) void PairCoulDiel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_shield.cpp b/src/USER-MISC/pair_coul_shield.cpp index 44ab555b0..54e3dbddb 100644 --- a/src/USER-MISC/pair_coul_shield.cpp +++ b/src/USER-MISC/pair_coul_shield.cpp @@ -297,12 +297,12 @@ void PairCoulShield::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -328,9 +328,9 @@ void PairCoulShield::write_restart_settings(FILE *fp) void PairCoulShield::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index 0c94254f4..0f5ee9bd1 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -44,7 +44,7 @@ using namespace LAMMPS_NS; PairCoulSlaterLong::PairCoulSlaterLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - //ftable = NULL; + //ftable = nullptr; qdist = 0.0; } @@ -250,13 +250,13 @@ void PairCoulSlaterLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - // if (ncoultablebits) init_tables(cut_coul,NULL); + // if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -415,5 +415,5 @@ void *PairCoulSlaterLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 7b56caa20..449cf8669 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -49,11 +49,11 @@ PairDRIP::PairDRIP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; manybody_flag = 1; - params = NULL; - nearest3neigh = NULL; - elements = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + nearest3neigh = nullptr; + elements = nullptr; + elem2param = nullptr; + map = nullptr; nelements = 0; cutmax = 0.0; } @@ -68,10 +68,10 @@ PairDRIP::~PairDRIP() delete [] map; } - if (elements != NULL) { + if (elements != nullptr) { for (int i = 0; i < nelements; i++) delete [] elements[i]; delete [] elements; - elements = NULL; + elements = nullptr; } memory->destroy(params); memory->destroy(elem2param); @@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -148,7 +148,7 @@ void PairDRIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -224,7 +224,7 @@ void PairDRIP::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open DRIP potential file %s",filename); error->one(FLERR,str); @@ -241,7 +241,7 @@ void PairDRIP::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -263,7 +263,7 @@ void PairDRIP::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -283,7 +283,7 @@ void PairDRIP::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index a7ed0fcaa..96aeea66f 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -50,12 +50,12 @@ PairE3B::PairE3B(LAMMPS *lmp) : Pair(lmp),pairPerAtom(10) pvector = new double[nextra]; allocatedE3B = false; - pairO = NULL; - pairH = NULL; - exps = NULL; - del3 = NULL; - fpair3 = NULL; - sumExp = NULL; + pairO = nullptr; + pairH = nullptr; + exps = nullptr; + del3 = nullptr; + fpair3 = nullptr; + sumExp = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 6ccaded35..31dda8bb0 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -52,12 +52,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairEDIP::PairEDIP(LAMMPS *lmp) : - Pair(lmp), preInvR_ij(NULL), preExp3B_ij(NULL), preExp3BDerived_ij(NULL), - preExp2B_ij(NULL), preExp2BDerived_ij(NULL), prePow2B_ij(NULL), - preForceCoord(NULL), cutoffFunction(NULL), cutoffFunctionDerived(NULL), - pow2B(NULL), exp2B(NULL), exp3B(NULL), qFunctionGrid(NULL), - expMinusBetaZeta_iZeta_iGrid(NULL), tauFunctionGrid(NULL), - tauFunctionDerivedGrid(NULL) + Pair(lmp), preInvR_ij(nullptr), preExp3B_ij(nullptr), preExp3BDerived_ij(nullptr), + preExp2B_ij(nullptr), preExp2BDerived_ij(nullptr), prePow2B_ij(nullptr), + preForceCoord(nullptr), cutoffFunction(nullptr), cutoffFunctionDerived(nullptr), + pow2B(nullptr), exp2B(nullptr), exp3B(nullptr), qFunctionGrid(nullptr), + expMinusBetaZeta_iZeta_iGrid(nullptr), tauFunctionGrid(nullptr), + tauFunctionDerivedGrid(nullptr) { single_enable = 0; restartinfo = 0; @@ -65,10 +65,10 @@ PairEDIP::PairEDIP(LAMMPS *lmp) : manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -788,7 +788,7 @@ void PairEDIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -876,7 +876,7 @@ void PairEDIP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -884,7 +884,7 @@ void PairEDIP::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -902,7 +902,7 @@ void PairEDIP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -924,7 +924,7 @@ void PairEDIP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -944,7 +944,7 @@ void PairEDIP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 4a81a41a2..1a5d4925d 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -70,10 +70,10 @@ PairEDIPMulti::PairEDIPMulti(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -548,7 +548,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -633,7 +633,7 @@ void PairEDIPMulti::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -641,7 +641,7 @@ void PairEDIPMulti::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -659,7 +659,7 @@ void PairEDIPMulti::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -681,7 +681,7 @@ void PairEDIPMulti::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -701,7 +701,7 @@ void PairEDIPMulti::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index 0db7f8739..6d9f74de8 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -52,20 +52,20 @@ PairExTeP::PairExTeP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - map = NULL; + map = nullptr; - Nt = NULL; - Nd = NULL; + Nt = nullptr; + Nd = nullptr; } /* ---------------------------------------------------------------------- @@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -476,7 +476,7 @@ void PairExTeP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -544,7 +544,7 @@ void PairExTeP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -582,7 +582,7 @@ void PairExTeP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -590,7 +590,7 @@ void PairExTeP::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ExTeP potential file %s",file); error->one(FLERR,str); @@ -607,7 +607,7 @@ void PairExTeP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -629,7 +629,7 @@ void PairExTeP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -649,7 +649,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line @@ -737,7 +737,7 @@ void PairExTeP::read_file(char *file) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); //fputs(line,stdout); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -758,7 +758,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); while ((nwords < params_per_line) - && (words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + && (words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // skip line if it is a leftover from the previous section, // which can be identified by having 3 elements (instead of 2) diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index c9601c416..d7d7f6864 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -301,14 +301,14 @@ void PairGaussCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&hgauss[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rmh[i][j],1,MPI_DOUBLE,0,world); @@ -337,9 +337,9 @@ void PairGaussCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index 671dcb309..f0c197ca3 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -54,23 +54,23 @@ PairILPGrapheneHBN::PairILPGrapheneHBN(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutILPsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutILPsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - ILP_numneigh = NULL; - ILP_firstneigh = NULL; - ipage = NULL; + ILP_numneigh = nullptr; + ILP_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -176,7 +176,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -249,7 +249,7 @@ void PairILPGrapheneHBN::read_file(char *filename) int params_per_line = 13; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -257,7 +257,7 @@ void PairILPGrapheneHBN::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ILP potential file %s",filename); error->one(FLERR,str); @@ -274,7 +274,7 @@ void PairILPGrapheneHBN::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -296,7 +296,7 @@ void PairILPGrapheneHBN::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -316,7 +316,7 @@ void PairILPGrapheneHBN::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -414,7 +414,7 @@ void PairILPGrapheneHBN::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 9f986fa10..c30899083 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -54,23 +54,23 @@ PairKolmogorovCrespiFull::PairKolmogorovCrespiFull(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutKCsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutKCsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - KC_numneigh = NULL; - KC_firstneigh = NULL; - ipage = NULL; + KC_numneigh = nullptr; + KC_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -177,7 +177,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -250,7 +250,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -258,7 +258,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -275,7 +275,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -297,7 +297,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -317,7 +317,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -415,7 +415,7 @@ void PairKolmogorovCrespiFull::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 7ce6f8652..80f57fb5d 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -48,11 +48,11 @@ PairKolmogorovCrespiZ::PairKolmogorovCrespiZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -232,7 +232,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -241,7 +241,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -308,7 +308,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) int params_per_line = 11; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -316,7 +316,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -333,7 +333,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -355,7 +355,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -375,7 +375,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index b8f9e5c38..cb65dc85f 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -49,11 +49,11 @@ PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -228,7 +228,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -237,7 +237,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -304,7 +304,7 @@ void PairLebedevaZ::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -312,7 +312,7 @@ void PairLebedevaZ::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; sprintf(str,"Cannot open Lebedeva potential file %s",filename); error->one(FLERR,str); @@ -329,7 +329,7 @@ void PairLebedevaZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -351,7 +351,7 @@ void PairLebedevaZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -371,7 +371,7 @@ void PairLebedevaZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 31d32db50..23c12ea9d 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -304,14 +304,14 @@ void PairLennardMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&aparm[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&bparm[i][j],1,MPI_DOUBLE,0,world); @@ -340,9 +340,9 @@ void PairLennardMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -413,5 +413,5 @@ void *PairLennardMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) aparm; if (strcmp(str,"b") == 0) return (void *) bparm; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index a93e0a81a..f46c061e4 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; static const char * const stylename[] = { - "none", "harmonic", "morse", "lj126", NULL + "none", "harmonic", "morse", "lj126", nullptr }; // fast power function for integer exponent > 0 @@ -54,8 +54,8 @@ PairList::PairList(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; respa_enable = 0; cut_global = 0.0; - style = NULL; - params = NULL; + style = nullptr; + params = nullptr; check_flag = 1; } @@ -211,7 +211,7 @@ void PairList::settings(int narg, char **arg) FILE *fp = utils::open_potential(arg[0],lmp,nullptr); char line[1024]; - if (fp == NULL) + if (fp == nullptr) error->all(FLERR,"Cannot open pair list file"); // count lines in file for upper limit of storage needed @@ -238,13 +238,13 @@ void PairList::settings(int narg, char **arg) // get atom ids of pair id1 = ATOTAGINT(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); id2 = ATOTAGINT(ptr); // get potential type - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); @@ -257,13 +257,13 @@ void PairList::settings(int narg, char **arg) if (strcmp(ptr,stylename[HARM]) == 0) { style[npairs] = HARM; - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); par.parm.harm.k = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); par.parm.harm.r0 = utils::numeric(FLERR,ptr,false,lmp); @@ -273,17 +273,17 @@ void PairList::settings(int narg, char **arg) } else if (strcmp(ptr,stylename[MORSE]) == 0) { style[npairs] = MORSE; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.d0 = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.alpha = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.r0 = utils::numeric(FLERR,ptr,false,lmp); @@ -294,12 +294,12 @@ void PairList::settings(int narg, char **arg) // 12-6 lj potential style[npairs] = LJ126; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); par.parm.lj126.epsilon = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); par.parm.lj126.sigma = utils::numeric(FLERR,ptr,false,lmp); @@ -311,8 +311,8 @@ void PairList::settings(int narg, char **arg) } // optional cutoff parameter. if not specified use global value - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr != NULL) && (*ptr != '#')) { + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr != nullptr) && (*ptr != '#')) { double cut = utils::numeric(FLERR,ptr,false,lmp); par.cutsq = cut*cut; } else { diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 92e869e58..8951af77c 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -51,9 +51,9 @@ PairLJExpandCoulLong::PairLJExpandCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -710,11 +710,11 @@ void PairLJExpandCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -838,14 +838,14 @@ void PairLJExpandCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -877,13 +877,13 @@ void PairLJExpandCoulLong::write_restart_settings(FILE *fp) void PairLJExpandCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -997,5 +997,5 @@ void *PairLJExpandCoulLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index baa0e233f..07f58aced 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -311,14 +311,14 @@ void PairLJMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -345,7 +345,7 @@ void PairLJMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } @@ -414,5 +414,5 @@ void *PairLJMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index ab845e69d..42a2d4bb7 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -487,15 +487,15 @@ void PairLJSFDipoleSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,9 +524,9 @@ void PairLJSFDipoleSF::write_restart_settings(FILE *fp) void PairLJSFDipoleSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -638,5 +638,5 @@ void *PairLJSFDipoleSF::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index 404f6e2db..61346a7fd 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -62,28 +62,28 @@ PairLocalDensity::PairLocalDensity(LAMMPS *lmp) : Pair(lmp) // stuff read from tabulated file nLD = 0; nrho = 0; - rho_min = NULL; - rho_max = NULL; - a = NULL; - b = NULL; - c0 = NULL; - c2 = NULL; - c4 = NULL; - c6 = NULL; - uppercut = NULL; - lowercut = NULL; - uppercutsq = NULL; - lowercutsq = NULL; - frho = NULL; - rho = NULL; + rho_min = nullptr; + rho_max = nullptr; + a = nullptr; + b = nullptr; + c0 = nullptr; + c2 = nullptr; + c4 = nullptr; + c6 = nullptr; + uppercut = nullptr; + lowercut = nullptr; + uppercutsq = nullptr; + lowercutsq = nullptr; + frho = nullptr; + rho = nullptr; // splined arrays - frho_spline = NULL; + frho_spline = nullptr; // per-atom arrays nmax = 0; - fp = NULL; - localrho = NULL; + fp = nullptr; + localrho = nullptr; // set comm size needed by this pair comm_forward = 1; @@ -667,7 +667,7 @@ void PairLocalDensity::parse_file(char *filename) { if (me == 0) { fptr = fopen(filename, "r"); - if (fptr == NULL) { + if (fptr == nullptr) { char str[128]; sprintf(str,"Cannot open Local Density potential file %s",filename); error->one(FLERR,str); @@ -724,23 +724,23 @@ void PairLocalDensity::parse_file(char *filename) { for (k = 0; k < nLD; k++) { // parse upper and lower cut values - if (fgets(line,MAXLINE,fptr)==NULL) break; + if (fgets(line,MAXLINE,fptr)==nullptr) break; sscanf(line, "%lf %lf", &lowercut[k], &uppercut[k]); // parse and broadcast central atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); char *tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { a[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse neighbor atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { b[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse min, max and delta rho values diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index 4d9b3866b..455a21ada 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -56,24 +56,24 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp) one_coeff = 1; nelements = 0; - elements = NULL; - map = NULL; + elements = nullptr; + map = nullptr; - Uprime_values = NULL; + Uprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; - phis = NULL; - Us = NULL; - rhos = NULL; - fs = NULL; - gs = NULL; + phis = nullptr; + Us = nullptr; + rhos = nullptr; + fs = nullptr; + gs = nullptr; - zero_atom_energies = NULL; + zero_atom_energies = nullptr; } /* ---------------------------------------------------------------------- */ @@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -459,7 +459,7 @@ void PairMEAMSpline::read_file(const char* filename) if(comm->me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if(fp == NULL) { + if(fp == nullptr) { char str[1024]; snprintf(str,128,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -480,8 +480,8 @@ void PairMEAMSpline::read_file(const char* filename) if (strcmp(ptr, "meam/spline") == 0) { isNewFormat = true; // parse the rest of the line! - ptr = strtok(NULL," \t\n\r\f"); - if (ptr == NULL) + ptr = strtok(nullptr," \t\n\r\f"); + if (ptr == nullptr) error->one(FLERR,"Need to include number of atomic species on" " meam/spline line in multi-element potential file"); nelements = atoi(ptr); @@ -493,8 +493,8 @@ void PairMEAMSpline::read_file(const char* filename) delete [] elements; elements = new char*[nelements]; for (int i=0; ione(FLERR, "Not enough atomic species in meam/spline" " line of multi-element potential file"); elements[i] = new char[strlen(ptr)+1]; @@ -674,27 +674,27 @@ void PairMEAMSpline::SplineFunction::parse(FILE* fp, Error* error, // If new format, read the spline format. Should always be "spline3eq" for now. if (isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line in old format if (!isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h index 2e6e7e00f..31be826d0 100644 --- a/src/USER-MISC/pair_meam_spline.h +++ b/src/USER-MISC/pair_meam_spline.h @@ -74,7 +74,7 @@ protected: class SplineFunction { public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -205,7 +205,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 0a8aae233..0013fa557 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -49,13 +49,13 @@ PairMEAMSWSpline::PairMEAMSWSpline(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; - Uprime_values = NULL; - //ESWprime_values = NULL; + Uprime_values = nullptr; + //ESWprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; @@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -402,7 +402,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -461,7 +461,7 @@ void PairMEAMSWSpline::read_file(const char* filename) { if(comm->me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if(fp == NULL) { + if(fp == nullptr) { char str[1024]; snprintf(str,1024,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -601,23 +601,23 @@ void PairMEAMSWSpline::SplineFunction::parse(FILE* fp, Error* error) char line[MAXLINE]; // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_sw_spline.h b/src/USER-MISC/pair_meam_sw_spline.h index b4480050d..1fd59b34a 100644 --- a/src/USER-MISC/pair_meam_sw_spline.h +++ b/src/USER-MISC/pair_meam_sw_spline.h @@ -62,7 +62,7 @@ protected: public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -188,7 +188,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index d534284b5..997e33453 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -308,16 +308,16 @@ void PairMomb::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -349,11 +349,11 @@ void PairMomb::write_restart_settings(FILE *fp) void PairMomb::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&sscale,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 9f895800d..73e0bb3c6 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -269,14 +269,14 @@ void PairMorseSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -303,8 +303,8 @@ void PairMorseSmoothLinear::write_restart_settings(FILE *fp) void PairMorseSmoothLinear::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairMorseSmoothLinear::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 150895108..d26a0b28d 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -76,7 +76,7 @@ PairSRP::PairSRP(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_srp); nextra = 1; - segment = NULL; + segment = nullptr; // generate unique fix-id for this pair style instance @@ -704,12 +704,12 @@ void PairSRP::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -737,12 +737,12 @@ void PairSRP::write_restart_settings(FILE *fp) void PairSRP::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bptype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&btype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&min,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&exclude,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bptype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&btype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&min,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&exclude,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); } diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index 1f5cfddff..6e0cacaff 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -764,7 +764,7 @@ void PairTersoffTable::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index 8d7a4ee2c..c3c6d89fb 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -167,7 +167,7 @@ void TemperGrem::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index 69f4559ca..288be333f 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -148,7 +148,7 @@ void TemperNPT::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MOFFF/angle_class2_p6.cpp b/src/USER-MOFFF/angle_class2_p6.cpp index 7ef134405..490974657 100644 --- a/src/USER-MOFFF/angle_class2_p6.cpp +++ b/src/USER-MOFFF/angle_class2_p6.cpp @@ -386,21 +386,21 @@ void AngleClass2P6::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/angle_cosine_buck6d.cpp b/src/USER-MOFFF/angle_cosine_buck6d.cpp index 1bede5875..7d08467be 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.cpp +++ b/src/USER-MOFFF/angle_cosine_buck6d.cpp @@ -281,7 +281,7 @@ void AngleCosineBuck6d::init_style() { // set local ptrs to buck6d 13 arrays setup by Pair int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle cosine/buck6d is incompatible with Pair style"); cut_ljsq = (double **) force->pair->extract("cut_ljsq",itmp); buck6d1 = (double **) force->pair->extract("buck6d1",itmp); @@ -332,9 +332,9 @@ void AngleCosineBuck6d::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/improper_inversion_harmonic.cpp b/src/USER-MOFFF/improper_inversion_harmonic.cpp index bbe6e48a3..96faebc85 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.cpp +++ b/src/USER-MOFFF/improper_inversion_harmonic.cpp @@ -313,8 +313,8 @@ void ImproperInversionHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp index 0de5423d3..1e6a0417e 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp @@ -415,16 +415,16 @@ void PairBuck6dCoulGaussDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -457,12 +457,12 @@ void PairBuck6dCoulGaussDSF::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -584,5 +584,5 @@ void *PairBuck6dCoulGaussDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp index c6ba832ff..3286abe77 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp @@ -331,7 +331,7 @@ void PairBuck6dCoulGaussLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -447,16 +447,16 @@ void PairBuck6dCoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -490,13 +490,13 @@ void PairBuck6dCoulGaussLong::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&coul_smooth,1,MPI_DOUBLE,0,world); @@ -639,5 +639,5 @@ void *PairBuck6dCoulGaussLong::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index e0e92f933..a06d83a78 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -72,10 +72,10 @@ DumpMolfile::DumpMolfile(LAMMPS *lmp, int narg, char **arg) ntotal = 0; me = comm->me; - coords = vels = masses = charges = radiuses = NULL; - types = molids = NULL; + coords = vels = masses = charges = radiuses = nullptr; + types = molids = nullptr; ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; // allocate global array for atom coords @@ -132,7 +132,7 @@ DumpMolfile::~DumpMolfile() delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -146,7 +146,7 @@ void DumpMolfile::init_style() if (me == 0) { /* initialize typenames array to numeric types by default */ - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { /* a 32-bit int can be maximally 10 digits plus sign */ @@ -408,7 +408,7 @@ void DumpMolfile::write_data(int n, double *mybuf) need_structure = 0; } double simtime = update->ntimestep * update->dt; - mf->timestep(coords,NULL,cell,&simtime); + mf->timestep(coords,nullptr,cell,&simtime); } } } @@ -433,7 +433,7 @@ int DumpMolfile::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; diff --git a/src/USER-MOLFILE/molfile_interface.cpp b/src/USER-MOLFILE/molfile_interface.cpp index 90a5781ff..485be5172 100644 --- a/src/USER-MOLFILE/molfile_interface.cpp +++ b/src/USER-MOLFILE/molfile_interface.cpp @@ -175,7 +175,7 @@ extern "C" { int i, ind; char atom[3]; - if (label != NULL) { + if (label != nullptr) { /* zap string */ atom[0] = atom[1] = atom[2] = '\0'; @@ -217,8 +217,8 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) - return NULL; + if (dirname == nullptr) + return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -237,7 +237,7 @@ extern "C" { delete[] d->searchname; delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -248,13 +248,13 @@ extern "C" { if (FindNextFile(d->h, &(d->fd))) { return d->fd.cFileName; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->h != NULL) { + if (d->h != nullptr) { FindClose(d->h); } delete[] d->searchname; @@ -293,7 +293,7 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) return NULL; + if (dirname == nullptr) return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -303,10 +303,10 @@ extern "C" { d->dlen = len; d->d = opendir(d->name); - if (d->d == NULL) { + if (d->d == nullptr) { delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -316,17 +316,17 @@ extern "C" { { struct dirent *p; - if ((p = readdir(d->d)) != NULL) { + if ((p = readdir(d->d)) != nullptr) { return p->d_name; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->d != NULL) { + if (d->d != nullptr) { closedir(d->d); } delete[] d->name; @@ -374,7 +374,7 @@ MolfileInterface::~MolfileInterface() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } delete[] _name; delete[] _type; @@ -392,7 +392,7 @@ int MolfileInterface::find_plugin(const char *pluginpath) #else #define MY_PATHSEP ':' #endif - if (pluginpath == NULL) return E_DIR; + if (pluginpath == nullptr) return E_DIR; plugindir = path = strdup(pluginpath); while (plugindir) { @@ -413,11 +413,11 @@ int MolfileInterface::find_plugin(const char *pluginpath) int len; filename = my_readdir(dir); - if (filename == NULL) break; + if (filename == nullptr) break; // only look at .so files ext = strrchr(filename, '.'); - if (ext == NULL) continue; + if (ext == nullptr) continue; if (strcasecmp(ext,".so") != 0) continue; // construct full pathname of potential DSO @@ -450,14 +450,14 @@ int MolfileInterface::load_plugin(const char *filename) // access shared object dso = my_dlopen(filename); - if (dso == NULL) + if (dso == nullptr) return E_FILE; // check for required plugin symbols void *ifunc = my_dlsym(dso,"vmdplugin_init"); void *rfunc = my_dlsym(dso,"vmdplugin_register"); void *ffunc = my_dlsym(dso,"vmdplugin_fini"); - if (ifunc == NULL || rfunc == NULL || ffunc == NULL) { + if (ifunc == nullptr || rfunc == nullptr || ffunc == nullptr) { my_dlclose(dso); return E_SYMBOL; } @@ -472,7 +472,7 @@ int MolfileInterface::load_plugin(const char *filename) // the callback will be called for each plugin in the DSO and // check the file type. plugin->name will change if successful. plugin_reginfo_t reginfo; - reginfo.p = NULL; + reginfo.p = nullptr; reginfo.name=_type; ((regfunc)rfunc)(®info, plugin_register_cb); @@ -481,7 +481,7 @@ int MolfileInterface::load_plugin(const char *filename) // if the callback found a matching plugin and copied the struct, // its name element will point to a different location now. - if (plugin == NULL) { + if (plugin == nullptr) { retval = E_TYPE; // check if the ABI matches the one used to compile this code @@ -490,16 +490,16 @@ int MolfileInterface::load_plugin(const char *filename) // check if (basic) reading is supported } else if ((_mode & M_READ) && - ( (plugin->open_file_read == NULL) || - (plugin->read_next_timestep == NULL) || - (plugin->close_file_read == NULL) )) { + ( (plugin->open_file_read == nullptr) || + (plugin->read_next_timestep == nullptr) || + (plugin->close_file_read == nullptr) )) { retval = E_MODE; // check if (basic) writing is supported } else if ( (_mode & M_WRITE) && - ( (plugin->open_file_write == NULL) || - (plugin->write_timestep == NULL) || - (plugin->close_file_write == NULL) )) { + ( (plugin->open_file_write == nullptr) || + (plugin->write_timestep == nullptr) || + (plugin->close_file_write == nullptr) )) { retval = E_MODE; // make some additional check, if we @@ -579,7 +579,7 @@ void MolfileInterface::forget_plugin() close(); if (_plugin) - _plugin = NULL; + _plugin = nullptr; if (_dso) { void *ffunc = my_dlsym(_dso,"vmdplugin_fini"); @@ -587,7 +587,7 @@ void MolfileInterface::forget_plugin() ((finifunc)ffunc)(); my_dlclose(_dso); } - _dso = NULL; + _dso = nullptr; delete[] _name; _name = new char[5]; @@ -608,7 +608,7 @@ int MolfileInterface::open(const char *name, int *natoms) else if (_mode & M_READ) _ptr = p->open_file_read(name,_type,natoms); - if (_ptr == NULL) + if (_ptr == nullptr) return E_FILE; _natoms = *natoms; @@ -681,9 +681,9 @@ int MolfileInterface::close() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } - _ptr = NULL; + _ptr = nullptr; _natoms = 0; return E_NONE; @@ -704,7 +704,7 @@ int MolfileInterface::timestep(float *coords, float *vels, if (_mode & M_WRITE) { t->coords = coords; t->velocities = vels; - if (cell != NULL) { + if (cell != nullptr) { t->A = cell[0]; t->B = cell[1]; t->C = cell[2]; @@ -729,8 +729,8 @@ int MolfileInterface::timestep(float *coords, float *vels, } else { // no coordinate storage => skip step - if (coords == NULL) { - rv = p->read_next_timestep(_ptr, _natoms, NULL); + if (coords == nullptr) { + rv = p->read_next_timestep(_ptr, _natoms, nullptr); } else { t->coords = coords; t->velocities = vels; @@ -742,7 +742,7 @@ int MolfileInterface::timestep(float *coords, float *vels, t->gamma = 90.0f; t->physical_time = 0.0; rv = p->read_next_timestep(_ptr, _natoms, t); - if (cell != NULL) { + if (cell != nullptr) { cell[0] = t->A; cell[1] = t->B; cell[2] = t->C; @@ -823,7 +823,7 @@ static int read_int_property(molfile_atom_t &a, const int propid) static const char *read_string_property(molfile_atom_t &a, const int propid) { - const char *prop = NULL; + const char *prop = nullptr; int iprop = 0; PROPUPDATE(MolfileInterface::P_NAME,name,prop); PROPUPDATE(MolfileInterface::P_TYPE,type,prop); @@ -910,7 +910,7 @@ static int write_atom_property(molfile_atom_t &a, // set/get atom floating point property int MolfileInterface::property(int propid, int idx, float *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -927,7 +927,7 @@ int MolfileInterface::property(int propid, int idx, float *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, float *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -947,7 +947,7 @@ int MolfileInterface::property(int propid, int *types, float *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, float *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -968,7 +968,7 @@ int MolfileInterface::property(int propid, float *prop) // set/get atom floating point property int MolfileInterface::property(int propid, int idx, double *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -985,7 +985,7 @@ int MolfileInterface::property(int propid, int idx, double *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, double *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1005,7 +1005,7 @@ int MolfileInterface::property(int propid, int *types, double *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, double *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1040,7 +1040,7 @@ int MolfileInterface::property(int propid, double *prop) // set/get atom integer property int MolfileInterface::property(int propid, int idx, int *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1065,7 +1065,7 @@ int MolfileInterface::property(int propid, int idx, int *prop) // set/get per type integer property int MolfileInterface::property(int propid, int *types, int *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1094,7 +1094,7 @@ int MolfileInterface::property(int propid, int *types, int *prop) // set/get per atom integer property int MolfileInterface::property(int propid, int *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1125,7 +1125,7 @@ int MolfileInterface::property(int propid, int *prop) // set/get atom string property int MolfileInterface::property(int propid, int idx, char *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1143,7 +1143,7 @@ int MolfileInterface::property(int propid, int idx, char *prop) // set/get per type string property int MolfileInterface::property(int propid, int *types, char **prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1164,7 +1164,7 @@ int MolfileInterface::property(int propid, int *types, char **prop) // set/get per atom string property int MolfileInterface::property(int propid, char **prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); diff --git a/src/USER-MOLFILE/reader_molfile.cpp b/src/USER-MOLFILE/reader_molfile.cpp index d26a4d4ba..c99131811 100644 --- a/src/USER-MOLFILE/reader_molfile.cpp +++ b/src/USER-MOLFILE/reader_molfile.cpp @@ -42,11 +42,11 @@ static bool is_smalldiff(const float &val1, const float &val2) ReaderMolfile::ReaderMolfile(LAMMPS *lmp) : Reader(lmp) { - mf = NULL; - coords = NULL; - vels = NULL; - types = NULL; - fieldindex = NULL; + mf = nullptr; + coords = nullptr; + vels = nullptr; + types = nullptr; + fieldindex = nullptr; nstep = 0; needvels = 0; me = comm->me; @@ -156,7 +156,7 @@ int ReaderMolfile::read_time(bigint &ntimestep) int rv; // try to read in the time step (coordinates, velocities and cell only) - rv = mf->timestep(coords, vels, cell, NULL); + rv = mf->timestep(coords, vels, cell, nullptr); if (rv != 0) return 1; // we fake time step numbers. @@ -187,7 +187,7 @@ void ReaderMolfile::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index f936de6d0..c48688df4 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -193,13 +193,13 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 19b063292..4288bf6ba 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -190,13 +190,13 @@ DumpNetCDFMPIIO::DumpNetCDFMPIIO(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } @@ -767,7 +767,7 @@ void DumpNetCDFMPIIO::write() // pack my data into buf - pack(NULL); + pack(nullptr); // each process writes its data diff --git a/src/USER-OMP/bond_class2_omp.cpp b/src/USER-OMP/bond_class2_omp.cpp index 9c52bdb28..866538dac 100644 --- a/src/USER-OMP/bond_class2_omp.cpp +++ b/src/USER-OMP/bond_class2_omp.cpp @@ -56,7 +56,7 @@ void BondClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_expand_omp.cpp b/src/USER-OMP/bond_fene_expand_omp.cpp index 38df4f50d..b881ae3b1 100644 --- a/src/USER-OMP/bond_fene_expand_omp.cpp +++ b/src/USER-OMP/bond_fene_expand_omp.cpp @@ -57,7 +57,7 @@ void BondFENEExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_omp.cpp b/src/USER-OMP/bond_fene_omp.cpp index 5dde355a7..54a6cd5b3 100644 --- a/src/USER-OMP/bond_fene_omp.cpp +++ b/src/USER-OMP/bond_fene_omp.cpp @@ -57,7 +57,7 @@ void BondFENEOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_gromos_omp.cpp b/src/USER-OMP/bond_gromos_omp.cpp index 012737f77..2469329a5 100644 --- a/src/USER-OMP/bond_gromos_omp.cpp +++ b/src/USER-OMP/bond_gromos_omp.cpp @@ -53,7 +53,7 @@ void BondGromosOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_omp.cpp b/src/USER-OMP/bond_harmonic_omp.cpp index e8f17d5ea..e9b2d5b10 100644 --- a/src/USER-OMP/bond_harmonic_omp.cpp +++ b/src/USER-OMP/bond_harmonic_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp index 61a60fa99..3d81098d4 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicShiftCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_omp.cpp b/src/USER-OMP/bond_harmonic_shift_omp.cpp index 50b4ed98a..ff85a9f00 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicShiftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_morse_omp.cpp b/src/USER-OMP/bond_morse_omp.cpp index 51586370f..352a7e1e4 100644 --- a/src/USER-OMP/bond_morse_omp.cpp +++ b/src/USER-OMP/bond_morse_omp.cpp @@ -55,7 +55,7 @@ void BondMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_nonlinear_omp.cpp b/src/USER-OMP/bond_nonlinear_omp.cpp index 720d660ea..f7330d1f3 100644 --- a/src/USER-OMP/bond_nonlinear_omp.cpp +++ b/src/USER-OMP/bond_nonlinear_omp.cpp @@ -55,7 +55,7 @@ void BondNonlinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_quartic_omp.cpp b/src/USER-OMP/bond_quartic_omp.cpp index bc1ae96ac..c48c8ae65 100644 --- a/src/USER-OMP/bond_quartic_omp.cpp +++ b/src/USER-OMP/bond_quartic_omp.cpp @@ -61,7 +61,7 @@ void BondQuarticOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_table_omp.cpp b/src/USER-OMP/bond_table_omp.cpp index 3ccc65441..34f678a22 100644 --- a/src/USER-OMP/bond_table_omp.cpp +++ b/src/USER-OMP/bond_table_omp.cpp @@ -55,7 +55,7 @@ void BondTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/ewald_omp.cpp b/src/USER-OMP/ewald_omp.cpp index d5480d2a9..5f27c04e6 100644 --- a/src/USER-OMP/ewald_omp.cpp +++ b/src/USER-OMP/ewald_omp.cpp @@ -120,7 +120,7 @@ void EwaldOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, nlocal, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, 0, NULL, NULL, NULL, thr); + ev_setup_thr(eflag, vflag, 0, nullptr, nullptr, nullptr, thr); for (i = ifrom; i < ito; i++) { ek[i][0] = 0.0; diff --git a/src/USER-OMP/fix_neigh_history_omp.cpp b/src/USER-OMP/fix_neigh_history_omp.cpp index 7acded0ab..02da93ab7 100644 --- a/src/USER-OMP/fix_neigh_history_omp.cpp +++ b/src/USER-OMP/fix_neigh_history_omp.cpp @@ -138,7 +138,7 @@ void FixNeighHistoryOMP::pre_exchange_onesided() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -276,7 +276,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -289,7 +289,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -444,7 +444,7 @@ void FixNeighHistoryOMP::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index f3c86a774..7c3591322 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -61,7 +61,7 @@ static int get_tid() FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - thr(NULL), last_omp_style(NULL), last_pair_hybrid(NULL), + thr(nullptr), last_omp_style(nullptr), last_pair_hybrid(nullptr), _nthr(-1), _neighbor(true), _mixed(false), _reduced(true), _pair_compute_flag(false), _kspace_compute_flag(false) { @@ -203,8 +203,8 @@ void FixOMP::init() thr[i]->_timer_active=-1; } - if ((strstr(update->integrate_style,"respa") != NULL) - && (strstr(update->integrate_style,"respa/omp") == NULL)) + if ((strstr(update->integrate_style,"respa") != nullptr) + && (strstr(update->integrate_style,"respa/omp") == nullptr)) error->all(FLERR,"Need to use respa/omp for r-RESPA with /omp styles"); if (force->pair && force->pair->compute_flag) _pair_compute_flag = true; @@ -213,18 +213,18 @@ void FixOMP::init() else _kspace_compute_flag = false; int check_hybrid, kspace_split; - last_pair_hybrid = NULL; - last_omp_style = NULL; - const char *last_omp_name = NULL; - const char *last_hybrid_name = NULL; - const char *last_force_name = NULL; + last_pair_hybrid = nullptr; + last_omp_style = nullptr; + const char *last_omp_name = nullptr; + const char *last_hybrid_name = nullptr; + const char *last_force_name = nullptr; // support for verlet/split operation. // kspace_split == 0 : regular processing // kspace_split < 0 : master partition, does not do kspace // kspace_split > 0 : slave partition, only does kspace - if (strstr(update->integrate_style,"verlet/split") != NULL) { + if (strstr(update->integrate_style,"verlet/split") != nullptr) { if (universe->iworld == 0) kspace_split = -1; else kspace_split = 1; } else { diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index 5b2ee8842..f88dada70 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -48,13 +48,13 @@ void FixQEQCombOMP::init() if (!atom->q_flag) error->all(FLERR,"Fix qeq/comb/omp requires atom attribute q"); - if (NULL != force->pair_match("comb3",0)) + if (nullptr != force->pair_match("comb3",0)) error->all(FLERR,"No support for comb3 currently available in USER-OMP"); comb = (PairComb *) force->pair_match("comb/omp",1); - if (comb == NULL) + if (comb == nullptr) comb = (PairComb *) force->pair_match("comb",1); - if (comb == NULL) + if (comb == nullptr) error->all(FLERR,"Must use pair_style comb or " "comb/omp with fix qeq/comb/omp"); diff --git a/src/USER-OMP/fix_qeq_reax_omp.cpp b/src/USER-OMP/fix_qeq_reax_omp.cpp index ef0f918cb..5d6f244e7 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.cpp +++ b/src/USER-OMP/fix_qeq_reax_omp.cpp @@ -65,7 +65,7 @@ FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : { if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax/omp command"); - b_temp = NULL; + b_temp = nullptr; // ASPC: Kolafa, J. Comp. Chem., 25(3), 335 (2003) do_aspc = 0; @@ -73,7 +73,7 @@ FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : // Must be consistent with nprev to store history: nprev = aspc_order + 2 aspc_order_max = nprev - 2; aspc_omega = 0.0; - aspc_b = NULL; + aspc_b = nullptr; } FixQEqReaxOMP::~FixQEqReaxOMP() diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index c42aa8e0c..81aa380ce 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -46,7 +46,7 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ MSMCGOMP::MSMCGOMP(LAMMPS *lmp) : MSMOMP(lmp), - is_charged(NULL) + is_charged(nullptr) { triclinic_support = 0; diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index 97d94e551..1197e9ebb 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -71,7 +71,7 @@ void PairADPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_adp(nall, rho, mu, lambda); diff --git a/src/USER-OMP/pair_agni_omp.cpp b/src/USER-OMP/pair_agni_omp.cpp index de6903aab..401f4a668 100644 --- a/src/USER-OMP/pair_agni_omp.cpp +++ b/src/USER-OMP/pair_agni_omp.cpp @@ -56,7 +56,7 @@ void PairAGNIOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) eval<1>(ifrom, ito, thr); else eval<0>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_airebo_omp.cpp b/src/USER-OMP/pair_airebo_omp.cpp index 837734d6e..d2c3ef6a0 100644 --- a/src/USER-OMP/pair_airebo_omp.cpp +++ b/src/USER-OMP/pair_airebo_omp.cpp @@ -67,7 +67,7 @@ void PairAIREBOOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); FREBO_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv0,thr); if (ljflag) FLJ_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv1,thr); diff --git a/src/USER-OMP/pair_beck_omp.cpp b/src/USER-OMP/pair_beck_omp.cpp index 01e33dc5c..617c237dd 100644 --- a/src/USER-OMP/pair_beck_omp.cpp +++ b/src/USER-OMP/pair_beck_omp.cpp @@ -54,7 +54,7 @@ void PairBeckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_long_omp.cpp b/src/USER-OMP/pair_born_coul_long_omp.cpp index b410c998e..be88df3e7 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.cpp +++ b/src/USER-OMP/pair_born_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairBornCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_msm_omp.cpp b/src/USER-OMP/pair_born_coul_msm_omp.cpp index 4adba396e..b161250df 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_born_coul_msm_omp.cpp @@ -59,7 +59,7 @@ void PairBornCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.cpp b/src/USER-OMP/pair_born_coul_wolf_omp.cpp index 9bc6507c6..a426bc93d 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_born_coul_wolf_omp.cpp @@ -54,7 +54,7 @@ void PairBornCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_omp.cpp b/src/USER-OMP/pair_born_omp.cpp index e74f0139c..237685b9d 100644 --- a/src/USER-OMP/pair_born_omp.cpp +++ b/src/USER-OMP/pair_born_omp.cpp @@ -52,7 +52,7 @@ void PairBornOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index b7b82c3da..afd41668a 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -48,7 +48,7 @@ PairBrownianOMP::PairBrownianOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -61,7 +61,7 @@ PairBrownianOMP::~PairBrownianOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -127,7 +127,7 @@ void PairBrownianOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial Brownian style // we use is random number generator instance for thread 0 @@ -143,11 +143,11 @@ void PairBrownianOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index 4d8b45728..6abd276bf 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -48,7 +48,7 @@ PairBrownianPolyOMP::PairBrownianPolyOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -61,7 +61,7 @@ PairBrownianPolyOMP::~PairBrownianPolyOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -128,7 +128,7 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial BrownianPoly style // we use is random number generator instance for thread 0 @@ -144,11 +144,11 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.cpp b/src/USER-OMP/pair_buck_coul_cut_omp.cpp index 1c433f808..20a4953ef 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairBuckCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_long_omp.cpp b/src/USER-OMP/pair_buck_coul_long_omp.cpp index 264073a07..f0e7edf71 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairBuckCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.cpp b/src/USER-OMP/pair_buck_coul_msm_omp.cpp index 631a1ee61..dd112ba99 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_msm_omp.cpp @@ -59,7 +59,7 @@ void PairBuckCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp index 00ab1c248..2b5570097 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp @@ -41,7 +41,7 @@ PairBuckLongCoulLongOMP::PairBuckLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ void PairBuckLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -330,7 +330,7 @@ void PairBuckLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -355,7 +355,7 @@ void PairBuckLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -385,7 +385,7 @@ void PairBuckLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_buck_omp.cpp b/src/USER-OMP/pair_buck_omp.cpp index bddacaf5b..ab037a204 100644 --- a/src/USER-OMP/pair_buck_omp.cpp +++ b/src/USER-OMP/pair_buck_omp.cpp @@ -52,7 +52,7 @@ void PairBuckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_colloid_omp.cpp b/src/USER-OMP/pair_colloid_omp.cpp index 94325232f..450957954 100644 --- a/src/USER-OMP/pair_colloid_omp.cpp +++ b/src/USER-OMP/pair_colloid_omp.cpp @@ -56,7 +56,7 @@ void PairColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp index 9a0155d6d..c07a6948a 100644 --- a/src/USER-OMP/pair_comb_omp.cpp +++ b/src/USER-OMP/pair_comb_omp.cpp @@ -63,7 +63,7 @@ void PairCombOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_omp.cpp b/src/USER-OMP/pair_coul_cut_omp.cpp index 57b821cb8..5f4a792c9 100644 --- a/src/USER-OMP/pair_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_omp.cpp @@ -52,7 +52,7 @@ void PairCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_coul_cut_soft_omp.cpp index f8b3a36e3..36453b1b3 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_soft_omp.cpp @@ -53,7 +53,7 @@ void PairCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_debye_omp.cpp b/src/USER-OMP/pair_coul_debye_omp.cpp index 1bb867699..8a3549b73 100644 --- a/src/USER-OMP/pair_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_coul_debye_omp.cpp @@ -52,7 +52,7 @@ void PairCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_diel_omp.cpp b/src/USER-OMP/pair_coul_diel_omp.cpp index 62f258042..f6bdcf8cf 100644 --- a/src/USER-OMP/pair_coul_diel_omp.cpp +++ b/src/USER-OMP/pair_coul_diel_omp.cpp @@ -53,7 +53,7 @@ void PairCoulDielOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_dsf_omp.cpp b/src/USER-OMP/pair_coul_dsf_omp.cpp index 3a8db4563..f7bb7adac 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_coul_dsf_omp.cpp @@ -61,7 +61,7 @@ void PairCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_omp.cpp b/src/USER-OMP/pair_coul_long_omp.cpp index 92cb51f7a..12b8fdb2f 100644 --- a/src/USER-OMP/pair_coul_long_omp.cpp +++ b/src/USER-OMP/pair_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairCoulLongOMP::PairCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_soft_omp.cpp b/src/USER-OMP/pair_coul_long_soft_omp.cpp index 28ba13d5c..0d4dd729d 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_long_soft_omp.cpp @@ -61,7 +61,7 @@ void PairCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_msm_omp.cpp b/src/USER-OMP/pair_coul_msm_omp.cpp index e907d63eb..4c77b85ae 100644 --- a/src/USER-OMP/pair_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairCoulMSMOMP::PairCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp index 71e8148a5..20d45102b 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_coul_wolf_omp.cpp @@ -54,7 +54,7 @@ void PairCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index 6e3da77cb..615908f06 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -35,7 +35,7 @@ PairDPDOMP::PairDPDOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -48,7 +48,7 @@ PairDPDOMP::~PairDPDOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -73,7 +73,7 @@ void PairDPDOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -89,11 +89,11 @@ void PairDPDOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 823367109..844c79771 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -36,7 +36,7 @@ PairDPDTstatOMP::PairDPDTstatOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -49,7 +49,7 @@ PairDPDTstatOMP::~PairDPDTstatOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -74,7 +74,7 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -89,11 +89,11 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index c7559420b..9a797dafa 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index 66a7581c2..d474e039b 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -69,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_omp.cpp b/src/USER-OMP/pair_eam_omp.cpp index e6ba299a4..cbdf03a41 100644 --- a/src/USER-OMP/pair_eam_omp.cpp +++ b/src/USER-OMP/pair_eam_omp.cpp @@ -67,7 +67,7 @@ void PairEAMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eam(nall, rho); diff --git a/src/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp index 864ff68f7..d0e84be4c 100644 --- a/src/USER-OMP/pair_edip_omp.cpp +++ b/src/USER-OMP/pair_edip_omp.cpp @@ -58,7 +58,7 @@ void PairEDIPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_eim_omp.cpp b/src/USER-OMP/pair_eim_omp.cpp index 74b460a78..7e25a14a0 100644 --- a/src/USER-OMP/pair_eim_omp.cpp +++ b/src/USER-OMP/pair_eim_omp.cpp @@ -65,7 +65,7 @@ void PairEIMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eim(nall, rho, fp); diff --git a/src/USER-OMP/pair_gauss_cut_omp.cpp b/src/USER-OMP/pair_gauss_cut_omp.cpp index a45391573..d2a197291 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.cpp +++ b/src/USER-OMP/pair_gauss_cut_omp.cpp @@ -53,7 +53,7 @@ void PairGaussCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gauss_omp.cpp b/src/USER-OMP/pair_gauss_omp.cpp index 3e5777e4e..919ffbe79 100644 --- a/src/USER-OMP/pair_gauss_omp.cpp +++ b/src/USER-OMP/pair_gauss_omp.cpp @@ -55,7 +55,7 @@ void PairGaussOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp index 991c72a9b..d4ee5b268 100644 --- a/src/USER-OMP/pair_gayberne_omp.cpp +++ b/src/USER-OMP/pair_gayberne_omp.cpp @@ -53,7 +53,7 @@ void PairGayBerneOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 9ad84afb9..2506c4e5b 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -78,7 +78,7 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index 3e519fc0d..ec8710871 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -79,7 +79,7 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_omp.cpp b/src/USER-OMP/pair_gran_hooke_omp.cpp index 8de959a91..1965c1676 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_omp.cpp @@ -74,7 +74,7 @@ void PairGranHookeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (force->newton_pair) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 338eb5245..8b8dea2a1 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -41,7 +41,7 @@ PairHbondDreidingLJOMP::PairHbondDreidingLJOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingLJOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 5094d5c19..9731972a4 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -41,7 +41,7 @@ PairHbondDreidingMorseOMP::PairHbondDreidingMorseOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj96_cut_omp.cpp b/src/USER-OMP/pair_lj96_cut_omp.cpp index 5aeec25d1..ddbb7ae8e 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.cpp +++ b/src/USER-OMP/pair_lj96_cut_omp.cpp @@ -32,7 +32,7 @@ PairLJ96CutOMP::PairLJ96CutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJ96CutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp index 3ff02b610..a7cd7aa76 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp @@ -51,7 +51,7 @@ void PairLJCharmmCoulCharmmImplicitOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp index 77caf63f1..03d33a6a8 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp @@ -53,7 +53,7 @@ void PairLJCharmmCoulCharmmOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp index 56cf0a68d..ed199dbfd 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp @@ -32,7 +32,7 @@ PairLJCharmmCoulLongOMP::PairLJCharmmCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJCharmmCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp index e19632dc7..932460a6b 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp @@ -32,7 +32,7 @@ PairLJCharmmCoulLongSoftOMP::PairLJCharmmCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJCharmmCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp index a39ef0aa8..1d9391206 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairLJCharmmCoulMSMOMP::PairLJCharmmCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairLJCharmmCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp index 63fb4fe52..50baa7eb8 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJClass2CoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp index f618f7f42..85712f22c 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairLJClass2CoulLongOMP::PairLJClass2CoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJClass2CoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_omp.cpp b/src/USER-OMP/pair_lj_class2_omp.cpp index 39cc320e4..ae2243daa 100644 --- a/src/USER-OMP/pair_lj_class2_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_omp.cpp @@ -53,7 +53,7 @@ void PairLJClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cubic_omp.cpp b/src/USER-OMP/pair_lj_cubic_omp.cpp index 27f613249..1ccade4e6 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.cpp +++ b/src/USER-OMP/pair_lj_cubic_omp.cpp @@ -54,7 +54,7 @@ void PairLJCubicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp index 2f46e0bfe..2ab0a4e8c 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp index 03f0852b0..d8080656b 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp index 82031f91a..d15456334 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp index 7ab6f31b3..fe47e947e 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp @@ -63,7 +63,7 @@ void PairLJCutCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp index c7b6de802..1edeb94b1 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongOMP::PairLJCutCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp index 6e804bd8a..a024db5fc 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongSoftOMP::PairLJCutCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJCutCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp index 0e6d11327..04afd428a 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairLJCutCoulMSMOMP::PairLJCutCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairLJCutCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp index 0e9a33312..9f0577dac 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp @@ -55,7 +55,7 @@ void PairLJCutCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp index 2cc915a43..b486ba33d 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutDipoleCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_omp.cpp index 2aa71026e..4f8c95a97 100644 --- a/src/USER-OMP/pair_lj_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_omp.cpp @@ -30,7 +30,7 @@ PairLJCutOMP::PairLJCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ void PairLJCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_soft_omp.cpp index 406c5f41d..dc2441fed 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_soft_omp.cpp @@ -30,7 +30,7 @@ PairLJCutSoftOMP::PairLJCutSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ void PairLJCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp index b921c8f1c..d79980493 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp @@ -53,7 +53,7 @@ PairLJCutTholeLongOMP::PairLJCutTholeLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -75,7 +75,7 @@ void PairLJCutTholeLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp index 2d1b82882..d11a018a8 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PCutOMP::PairLJCutTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp index a60f9d6a5..b712ef843 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongOMP::PairLJCutTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp index f4a75b9af..d498da3e8 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongSoftOMP::PairLJCutTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_expand_omp.cpp b/src/USER-OMP/pair_lj_expand_omp.cpp index 89077ba6a..ba624ae7d 100644 --- a/src/USER-OMP/pair_lj_expand_omp.cpp +++ b/src/USER-OMP/pair_lj_expand_omp.cpp @@ -53,7 +53,7 @@ void PairLJExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp index 26a6e979b..7e8a38935 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp @@ -53,7 +53,7 @@ void PairLJGromacsCoulGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_omp.cpp index 308209153..d179831e3 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_omp.cpp @@ -53,7 +53,7 @@ void PairLJGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp index cdd62ff96..76768276c 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp @@ -42,7 +42,7 @@ PairLJLongCoulLongOMP::PairLJLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ void PairLJLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -329,7 +329,7 @@ void PairLJLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -354,7 +354,7 @@ void PairLJLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -384,7 +384,7 @@ void PairLJLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp index af24e93a4..4ba412c66 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp @@ -44,9 +44,9 @@ PairLJLongTIP4PLongOMP::PairLJLongTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; - newsite_thr = NULL; - hneigh_thr = NULL; + cut_respa = nullptr; + newsite_thr = nullptr; + hneigh_thr = nullptr; tip4pflag = dispersionflag = 1; no_virial_fdotr_compute = 1; single_enable = 0; @@ -106,7 +106,7 @@ void PairLJLongTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -389,7 +389,7 @@ void PairLJLongTIP4PLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -414,7 +414,7 @@ void PairLJLongTIP4PLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -468,7 +468,7 @@ void PairLJLongTIP4PLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp index 4a53f2c08..f3af43cd5 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp @@ -54,7 +54,7 @@ void PairLJSDKCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp index 4b89375b5..f05f5e120 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp @@ -60,7 +60,7 @@ void PairLJSDKCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_omp.cpp b/src/USER-OMP/pair_lj_sdk_omp.cpp index d5146c679..a88a1ded0 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_omp.cpp @@ -56,7 +56,7 @@ void PairLJSDKOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp index 8828b40b9..130ac6e5e 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp @@ -53,7 +53,7 @@ void PairLJSFDipoleSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp index 2c0c02818..d69cfea0a 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp @@ -53,7 +53,7 @@ void PairLJSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_omp.cpp b/src/USER-OMP/pair_lj_smooth_omp.cpp index 0b4ea4e5f..1adccbf3c 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_omp.cpp @@ -53,7 +53,7 @@ void PairLJSmoothOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lubricate_omp.cpp b/src/USER-OMP/pair_lubricate_omp.cpp index caf5a1112..17496830f 100644 --- a/src/USER-OMP/pair_lubricate_omp.cpp +++ b/src/USER-OMP/pair_lubricate_omp.cpp @@ -116,7 +116,7 @@ void PairLubricateOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (evflag) { diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp index feb110194..227c94300 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.cpp +++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp @@ -113,7 +113,7 @@ void PairLubricatePolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (shearing) { diff --git a/src/USER-OMP/pair_meam_spline_omp.cpp b/src/USER-OMP/pair_meam_spline_omp.cpp index 782371e84..e093e925f 100644 --- a/src/USER-OMP/pair_meam_spline_omp.cpp +++ b/src/USER-OMP/pair_meam_spline_omp.cpp @@ -65,7 +65,7 @@ void PairMEAMSplineOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); thr->init_eam(nall,Uprime_values); diff --git a/src/USER-OMP/pair_morse_omp.cpp b/src/USER-OMP/pair_morse_omp.cpp index 48687781e..aa79a0f05 100644 --- a/src/USER-OMP/pair_morse_omp.cpp +++ b/src/USER-OMP/pair_morse_omp.cpp @@ -53,7 +53,7 @@ void PairMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp index 220fb9481..1896fdcba 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp @@ -55,7 +55,7 @@ void PairMorseSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp index 1cfe576a3..ecdba46e0 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairNMCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp index d9e123182..09ec46d1c 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairNMCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_omp.cpp index a232da1a9..faa3acefb 100644 --- a/src/USER-OMP/pair_nm_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_omp.cpp @@ -53,7 +53,7 @@ void PairNMCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_lps_omp.cpp b/src/USER-OMP/pair_peri_lps_omp.cpp index 9bf707ad9..b2be37391 100644 --- a/src/USER-OMP/pair_peri_lps_omp.cpp +++ b/src/USER-OMP/pair_peri_lps_omp.cpp @@ -71,7 +71,7 @@ void PairPeriLPSOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_pmb_omp.cpp b/src/USER-OMP/pair_peri_pmb_omp.cpp index 28df45b67..b58cadc20 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.cpp +++ b/src/USER-OMP/pair_peri_pmb_omp.cpp @@ -67,7 +67,7 @@ void PairPeriPMBOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index dfc1f428e..54417f953 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -92,7 +92,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) system->pair_ptr = this; system->omp_active = 1; - num_nbrs_offset = NULL; + num_nbrs_offset = nullptr; #ifdef OMP_TIMING for (int i=0;iget_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_soft_omp.cpp b/src/USER-OMP/pair_soft_omp.cpp index f733b5106..382a995e2 100644 --- a/src/USER-OMP/pair_soft_omp.cpp +++ b/src/USER-OMP/pair_soft_omp.cpp @@ -57,7 +57,7 @@ void PairSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_sw_omp.cpp b/src/USER-OMP/pair_sw_omp.cpp index c2eb4cb15..dac252705 100644 --- a/src/USER-OMP/pair_sw_omp.cpp +++ b/src/USER-OMP/pair_sw_omp.cpp @@ -51,7 +51,7 @@ void PairSWOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp index f5fbabcca..79128bea8 100644 --- a/src/USER-OMP/pair_table_omp.cpp +++ b/src/USER-OMP/pair_table_omp.cpp @@ -51,7 +51,7 @@ void PairTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp index 83baa56e4..6d2cbf71a 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp @@ -50,7 +50,7 @@ void PairTersoffMODCOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_omp.cpp b/src/USER-OMP/pair_tersoff_mod_omp.cpp index ab2f07322..45669dc60 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_omp.cpp @@ -52,7 +52,7 @@ void PairTersoffMODOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp index a36774997..efafa7949 100644 --- a/src/USER-OMP/pair_tersoff_omp.cpp +++ b/src/USER-OMP/pair_tersoff_omp.cpp @@ -53,7 +53,7 @@ void PairTersoffOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp index 8321ad9d9..277b79b9e 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.cpp +++ b/src/USER-OMP/pair_tersoff_table_omp.cpp @@ -43,8 +43,8 @@ PairTersoffTableOMP::PairTersoffTableOMP(LAMMPS *lmp) : suffix_flag |= Suffix::OMP; respa_enable = 0; - thrGtetaFunction = thrGtetaFunctionDerived = NULL; - thrCutoffFunction = thrCutoffFunctionDerived = NULL; + thrGtetaFunction = thrGtetaFunctionDerived = nullptr; + thrCutoffFunction = thrCutoffFunctionDerived = nullptr; } /* ---------------------------------------------------------------------- */ @@ -76,7 +76,7 @@ void PairTersoffTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (vflag_atom) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_tip4p_cut_omp.cpp b/src/USER-OMP/pair_tip4p_cut_omp.cpp index 5b983d3db..a7e087e20 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PCutOMP::PairTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -101,7 +101,7 @@ void PairTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tip4p_long_omp.cpp b/src/USER-OMP/pair_tip4p_long_omp.cpp index 86bebdbef..75f6850ac 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongOMP::PairTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (!ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp index 26e042095..e408cb7cc 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongSoftOMP::PairTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_ufm_omp.cpp b/src/USER-OMP/pair_ufm_omp.cpp index e1c2ff457..202cce567 100644 --- a/src/USER-OMP/pair_ufm_omp.cpp +++ b/src/USER-OMP/pair_ufm_omp.cpp @@ -55,7 +55,7 @@ void PairUFMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_omp.cpp b/src/USER-OMP/pair_vashishta_omp.cpp index 0637fe3df..c1dd45d8b 100644 --- a/src/USER-OMP/pair_vashishta_omp.cpp +++ b/src/USER-OMP/pair_vashishta_omp.cpp @@ -53,7 +53,7 @@ void PairVashishtaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_table_omp.cpp b/src/USER-OMP/pair_vashishta_table_omp.cpp index 9650a57e7..caf4bb493 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.cpp +++ b/src/USER-OMP/pair_vashishta_table_omp.cpp @@ -51,7 +51,7 @@ void PairVashishtaTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.cpp b/src/USER-OMP/pair_yukawa_colloid_omp.cpp index 227ec0744..4b595365f 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.cpp +++ b/src/USER-OMP/pair_yukawa_colloid_omp.cpp @@ -53,7 +53,7 @@ void PairYukawaColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_omp.cpp b/src/USER-OMP/pair_yukawa_omp.cpp index 347575e28..78f2a1213 100644 --- a/src/USER-OMP/pair_yukawa_omp.cpp +++ b/src/USER-OMP/pair_yukawa_omp.cpp @@ -53,7 +53,7 @@ void PairYukawaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_zbl_omp.cpp b/src/USER-OMP/pair_zbl_omp.cpp index 9679a00b2..2faf6d1bb 100644 --- a/src/USER-OMP/pair_zbl_omp.cpp +++ b/src/USER-OMP/pair_zbl_omp.cpp @@ -54,7 +54,7 @@ void PairZBLOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index 80e9b90ec..bcef3a3c8 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -88,7 +88,7 @@ void BondsOMP( reax_system *system, control_params * /* control */, pair_reax_ptr->ev_setup_thr_proxy(system->pair_ptr->eflag_either, system->pair_ptr->vflag_either, system->N, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index ad6ea35eb..ad474a1cc 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -165,7 +165,7 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); pair_reax_ptr->ev_setup_thr_proxy(0, 1, natoms, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 612c36053..0ce2c3718 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -82,33 +82,33 @@ void ThrData::init_force(int nall, double **f, double **torque, memset(virial_imprp,0,6*sizeof(double)); memset(virial_kspce,0,6*sizeof(double)); - eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=NULL; - vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=NULL; + eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=nullptr; + vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=nullptr; if (nall >= 0 && f) { _f = f + _tid*nall; memset(&(_f[0][0]),0,nall*3*sizeof(double)); - } else _f = NULL; + } else _f = nullptr; if (nall >= 0 && torque) { _torque = torque + _tid*nall; memset(&(_torque[0][0]),0,nall*3*sizeof(double)); - } else _torque = NULL; + } else _torque = nullptr; if (nall >= 0 && erforce) { _erforce = erforce + _tid*nall; memset(&(_erforce[0]),0,nall*sizeof(double)); - } else _erforce = NULL; + } else _erforce = nullptr; if (nall >= 0 && de) { _de = de + _tid*nall; memset(&(_de[0]),0,nall*sizeof(double)); - } else _de = NULL; + } else _de = nullptr; if (nall >= 0 && drho) { _drho = drho + _tid*nall; memset(&(_drho[0]),0,nall*sizeof(double)); - } else _drho = NULL; + } else _drho = nullptr; } /* ---------------------------------------------------------------------- @@ -191,8 +191,8 @@ void ThrData::init_pppm(int order, Memory *memory) drho1d = static_cast(_drho1d); if (rho1d) memory->destroy2d_offset(rho1d,-order/2); if (drho1d) memory->destroy2d_offset(drho1d,-order/2); - _rho1d = NULL; - _drho1d = NULL; + _rho1d = nullptr; + _drho1d = nullptr; } } diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h index 4b8735710..c942083ef 100644 --- a/src/USER-OMP/thr_data.h +++ b/src/USER-OMP/thr_data.h @@ -31,7 +31,7 @@ class ThrData { public: ThrData(int tid, class Timer *t); - ~ThrData() { delete _timer; _timer = NULL; }; + ~ThrData() { delete _timer; _timer = nullptr; }; void check_tid(int); // thread id consistency check int get_tid() const { return _tid; }; // our thread id. @@ -140,7 +140,7 @@ class ThrData { // disabled default methods private: - ThrData() : _tid(-1), _timer(NULL) {}; + ThrData() : _tid(-1), _timer(nullptr) {}; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index 6e096defa..01e54d3bd 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ThrOMP::ThrOMP(LAMMPS *ptr, int style) - : lmp(ptr), fix(NULL), thr_style(style), thr_error(0) + : lmp(ptr), fix(nullptr), thr_style(style), thr_error(0) { // register fix omp with this class int ifix = lmp->modify->find_fix("package_omp"); @@ -88,7 +88,7 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom, if (nall > 0) memset(&(thr->cvatom_pair[0][0]),0,nall*9*sizeof(double)); } else { - thr->cvatom_pair = NULL; + thr->cvatom_pair = nullptr; } } @@ -199,7 +199,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, if (lmp->force->pair->vflag_fdotr) { // this is a non-hybrid pair style. compute per thread fdotr - if (fix->last_pair_hybrid == NULL) { + if (fix->last_pair_hybrid == nullptr) { if (lmp->neighbor->includegroup == 0) thr->virial_fdotr_compute(x, nlocal, nghost, -1); else diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 238aa7c96..5451ffba5 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -32,7 +32,7 @@ enum{REGULAR,ESKM}; /* ---------------------------------------------------------------------- */ -DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -43,7 +43,7 @@ DynamicalMatrix::~DynamicalMatrix() { if (fp && me == 0) fclose(fp); memory->destroy(groupmap); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -223,7 +223,7 @@ void DynamicalMatrix::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 382eabe82..c80073f3c 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because NULL buffer will result in error for MPI + // allocate variables; MAX(1,... is used because nullptr buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); @@ -184,7 +184,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // output some information on the system to log file if (me == 0){ flog = fopen(logfile, "w"); - if (flog == NULL) { + if (flog == nullptr) { char str[MAXLINE]; sprintf(str,"Can not open output file %s",logfile); error->one(FLERR,str); @@ -563,34 +563,34 @@ void FixPhonon::readmap() // read from map file for others char line[MAXLINE]; FILE *fp = fopen(mapfile, "r"); - if (fp == NULL){ + if (fp == nullptr){ sprintf(line,"Cannot open input map file %s", mapfile); error->all(FLERR,line); } - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading header of mapping file!"); nx = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); - ny = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - nz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - nucell = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + ny = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nucell = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); ntotal = nx*ny*nz; if (ntotal*nucell != ngroup) error->all(FLERR,"FFT mesh and number of atoms in group mismatch!"); // second line of mapfile is comment - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading comment of mapping file!"); int ix, iy, iz, iu; // the remaining lines carry the mapping info for (int i = 0; i < ngroup; ++i){ - if (fgets(line,MAXLINE,fp) == NULL) {info = 1; break;} + if (fgets(line,MAXLINE,fp) == nullptr) {info = 1; break;} ix = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); - iy = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - iz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - iu = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - itag = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + iy = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iu = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + itag = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); // check if index is in correct range if (ix < 0 || ix >= nx || iy < 0 || iy >= ny || diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index e7997d639..e72ac0fdf 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -32,7 +32,7 @@ enum{REGULAR,BALLISTICO}; /* ---------------------------------------------------------------------- */ -ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -42,7 +42,7 @@ ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) ThirdOrder::~ThirdOrder() { if (fp && me == 0) fclose(fp); - fp = NULL; + fp = nullptr; memory->destroy(groupmap); } @@ -220,7 +220,7 @@ void ThirdOrder::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index b7a29c7bc..3d2acacc1 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -53,8 +53,8 @@ using namespace FixConst; FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - p(NULL), nlocal(0), gatindex(NULL), masses(NULL), charges(NULL), - id_pe(NULL), id_press(NULL) + p(nullptr), nlocal(0), gatindex(nullptr), masses(nullptr), charges(nullptr), + id_pe(nullptr), id_press(nullptr) { if (!atom->tag_enable) @@ -68,7 +68,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : "Group will be ignored."); #if defined(__PLUMED_DEFAULT_KERNEL) - if (getenv("PLUMED_KERNEL") == NULL) + if (getenv("PLUMED_KERNEL") == nullptr) putenv(plumed_default_kernel); #endif @@ -101,7 +101,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : // it is defined inside plumed. p->cmd("GREX setMPIIntercomm",&inter_comm); } - p->cmd("GREX init",NULL); + p->cmd("GREX init",nullptr); } // The general communicator is independent of the existence of partitions, diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index 309dd75c1..508c3d0ff 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -61,7 +61,7 @@ static const char cite_user_ptm_package[] = /* ---------------------------------------------------------------------- */ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) - : Compute(lmp, narg, arg), list(NULL), output(NULL) { + : Compute(lmp, narg, arg), list(nullptr), output(nullptr) { if (narg < 5 || narg > 6) error->all(FLERR, "Illegal compute ptm/atom command"); @@ -144,7 +144,7 @@ ComputePTMAtom::~ComputePTMAtom() { memory->destroy(output); } /* ---------------------------------------------------------------------- */ void ComputePTMAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR, "Compute ptm/atom requires a pair style be defined"); int count = 0; @@ -201,7 +201,7 @@ static int get_neighbours(void* vdata, size_t central_index, size_t atom_index, double **x = data->x; double *pos = x[atom_index]; - int *jlist = NULL; + int *jlist = nullptr; int jnum = 0; if (atom_index < data->nlocal) { jlist = data->firstneigh[atom_index]; @@ -307,7 +307,7 @@ void ComputePTMAtom::compute_peratom() { ptm_index(local_handle, i, get_neighbours, (void*)&nbrlist, input_flags, standard_orientations, &type, &alloy_type, &scale, &rmsd, q, - NULL, NULL, NULL, NULL, &interatomic_distance, NULL, NULL); + nullptr, nullptr, nullptr, nullptr, &interatomic_distance, nullptr, nullptr); if (rmsd > rmsd_threshold) { type = PTM_MATCH_NONE; diff --git a/src/USER-PTM/ptm_index.cpp b/src/USER-PTM/ptm_index.cpp index cedd35126..7c912ed5b 100644 --- a/src/USER-PTM/ptm_index.cpp +++ b/src/USER-PTM/ptm_index.cpp @@ -95,11 +95,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], double *P, double *p_interatomic_distance, double *p_lattice_constant, size_t *output_indices) { const ptm::refdata_t *ref = res->ref_struct; - if (ref == NULL) + if (ref == nullptr) return; *p_type = ref->type; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = ptm::find_alloy_type(ref, res->mapping, numbers); int8_t temp[PTM_MAX_POINTS]; @@ -123,7 +123,7 @@ static void output_data(ptm::result_t *res, double (*points)[3], memcpy(res->mapping, temp, (ref->num_nbrs + 1) * sizeof(int8_t)); - if (F != NULL && F_res != NULL) { + if (F != nullptr && F_res != nullptr) { double scaled_points[PTM_MAX_INPUT_POINTS][3]; ptm::subtract_barycentre(ref->num_nbrs + 1, points, scaled_points); @@ -160,11 +160,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], if (ref->type == PTM_MATCH_GRAPHENE) // hack for pseudo-2d structures F[8] = 1; - if (P != NULL && U != NULL) + if (P != nullptr && U != nullptr) ptm::polar_decomposition_3x3(F, false, U, P); } - if (output_indices != NULL) + if (output_indices != nullptr) for (int i = 0; i < ref->num_nbrs + 1; i++) output_indices[i] = ordering[res->mapping[i]]; @@ -173,10 +173,10 @@ static void output_data(ptm::result_t *res, double (*points)[3], double lattice_constant = calculate_lattice_constant(ref->type, interatomic_distance); - if (p_interatomic_distance != NULL) + if (p_interatomic_distance != nullptr) *p_interatomic_distance = interatomic_distance; - if (p_lattice_constant != NULL) + if (p_lattice_constant != nullptr) *p_lattice_constant = lattice_constant; *p_rmsd = res->rmsd; @@ -200,7 +200,7 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, int ret = 0; ptm::result_t res; - res.ref_struct = NULL; + res.ref_struct = nullptr; res.rmsd = INFINITY; size_t ordering[PTM_MAX_INPUT_POINTS]; @@ -269,13 +269,13 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, } *p_type = PTM_MATCH_NONE; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = PTM_ALLOY_NONE; - if (output_indices != NULL) + if (output_indices != nullptr) memset(output_indices, -1, PTM_MAX_INPUT_POINTS * sizeof(size_t)); - if (res.ref_struct == NULL) + if (res.ref_struct == nullptr) return PTM_NO_ERROR; if (res.ref_struct->type == PTM_MATCH_DCUB || diff --git a/src/USER-PTM/ptm_initialize_data.h b/src/USER-PTM/ptm_initialize_data.h index 87111b128..dd1cddd9f 100644 --- a/src/USER-PTM/ptm_initialize_data.h +++ b/src/USER-PTM/ptm_initialize_data.h @@ -50,17 +50,17 @@ const refdata_t structure_sc = { PTM_MATCH_SC, //. NUM_SC_GRAPHS, //.num_graphs graphs_sc, //.graphs ptm_template_sc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_sc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_sc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_fcc = { PTM_MATCH_FCC, //.type @@ -70,17 +70,17 @@ const refdata_t structure_fcc = { PTM_MATCH_FCC, / NUM_FCC_GRAPHS, //.num_graphs graphs_fcc, //.graphs ptm_template_fcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_fcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_fcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_hcp = { PTM_MATCH_HCP, //.type @@ -91,12 +91,12 @@ const refdata_t structure_hcp = { PTM_MATCH_HCP, / graphs_hcp, //.graphs ptm_template_hcp, //.points ptm_template_hcp_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_hcp, //.penrose penrose_hcp_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_HEX_MAPPINGS, //.num_mappings mapping_hcp, //.mapping mapping_hcp_conventional, //.mapping_conventional @@ -110,17 +110,17 @@ const refdata_t structure_ico = { PTM_MATCH_ICO, / NUM_ICO_GRAPHS, //.num_graphs graphs_ico, //.graphs ptm_template_ico, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_ico, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_ICO_MAPPINGS, //.num_mappings mapping_ico, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_bcc = { PTM_MATCH_BCC, //.type @@ -130,17 +130,17 @@ const refdata_t structure_bcc = { PTM_MATCH_BCC, / NUM_BCC_GRAPHS, //.num_graphs graphs_bcc, //.graphs ptm_template_bcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_bcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_bcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_dcub = { PTM_MATCH_DCUB, //.type @@ -151,12 +151,12 @@ const refdata_t structure_dcub = { PTM_MATCH_DCUB, graphs_dcub, //.graphs ptm_template_dcub, //.points ptm_template_dcub_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_dcub, //.penrose penrose_dcub_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_DCUB_MAPPINGS, //.num_mappings mapping_dcub, //.mapping mapping_dcub_conventional, //.mapping_conventional @@ -188,15 +188,15 @@ const refdata_t structure_graphene = { PTM_MATCH_GRAPHENE, -1, //.num_facets -1, //.max_degree -1, //.num_graphs - NULL, //.graphs + nullptr, //.graphs ptm_template_graphene, //.points ptm_template_graphene_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_graphene, //.penrose penrose_graphene_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 -1, //.num_mappings mapping_graphene, //.mapping mapping_graphene_conventional, //.mapping_conventional diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index 9f0703000..f6d0f9300 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -169,7 +169,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -191,7 +191,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -242,7 +242,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -250,7 +250,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -353,11 +353,11 @@ FixQMMM::FixQMMM(LAMMPS *lmp, int narg, char **arg) : mm_comm = MPI_Comm_f2c(qmmmcfg.mm_comm); /* initialize storage */ - qm_idmap = mm_idmap = NULL; - qm_remap = mm_remap = NULL; - qm_coord = mm_coord = qm_force = mm_force = NULL; - qm_charge =NULL; - mm_type = NULL; + qm_idmap = mm_idmap = nullptr; + qm_remap = mm_remap = nullptr; + qm_coord = mm_coord = qm_force = mm_force = nullptr; + qm_charge =nullptr; + mm_type = nullptr; do_init = 1; diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 034738023..2b05ce543 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -246,19 +246,19 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : peflag = 1; // allocate qbmsst - temperature = NULL; - pressure = NULL; - pe = NULL; - old_velocity = NULL; - rfix = NULL; - gfactor = NULL; - random = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; + old_velocity = nullptr; + rfix = nullptr; + gfactor = nullptr; + random = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; // initialize Marsagxlia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -331,7 +331,7 @@ void FixQBMSST::init() boltz = force->boltz; nktv2p = force->nktv2p; mvv2e = force->mvv2e; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix qbmsst without per-type mass defined"); // set compute ptrs diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 3f29229be..ff36326ed 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -94,16 +94,16 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : maxexchange = 6*N_f+3; // allocate qtb - gfactor1 = NULL; - gfactor3 = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; - id_temp = NULL; - temperature = NULL; + gfactor1 = nullptr; + gfactor3 = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; + id_temp = nullptr; + temperature = nullptr; // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -158,7 +158,7 @@ void FixQTB::init() { // copy parameters from other classes double dtv = update->dt; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); //initiate the counter \mu diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 5511efe68..d2093941a 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -45,10 +45,10 @@ PairQUIP::PairQUIP(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; manybody_flag = 1; - map = NULL; - quip_potential = NULL; - quip_file = NULL; - quip_string = NULL; + map = nullptr; + quip_potential = nullptr; + quip_file = nullptr; + quip_string = nullptr; } PairQUIP::~PairQUIP() diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 5d57b7405..41a2244d4 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -92,10 +92,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_react); - fix1 = NULL; - fix2 = NULL; - fix3 = NULL; - reset_mol_ids = NULL; + fix1 = nullptr; + fix2 = nullptr; + fix3 = nullptr; + reset_mol_ids = nullptr; if (narg < 8) error->all(FLERR,"Illegal fix bond/react command: " "too few arguments"); @@ -116,12 +116,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : narrhenius = 0; status = PROCEED; - nxspecial = NULL; - onemol_nxspecial = NULL; - twomol_nxspecial = NULL; - xspecial = NULL; - onemol_xspecial = NULL; - twomol_xspecial = NULL; + nxspecial = nullptr; + onemol_nxspecial = nullptr; + twomol_nxspecial = nullptr; + xspecial = nullptr; + onemol_xspecial = nullptr; + twomol_xspecial = nullptr; // these group names are reserved for use exclusively by bond/react master_group = (char *) "bond_react_MASTER_group"; @@ -472,16 +472,16 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; - probability = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; + probability = nullptr; maxcreate = 0; - created = NULL; - ncreate = NULL; + created = nullptr; + ncreate = nullptr; allncreate = 0; local_num_mega = 0; ghostly_num_mega = 0; - restore = NULL; + restore = nullptr; // zero out stats global_megasize = 0; @@ -489,17 +489,17 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : glove_counter = 0; guess_branch = new int[MAXGUESS](); pioneer_count = new int[max_natoms]; - local_mega_glove = NULL; - ghostly_mega_glove = NULL; - global_mega_glove = NULL; + local_mega_glove = nullptr; + ghostly_mega_glove = nullptr; + global_mega_glove = nullptr; // these are merely loop indices that became important pion = neigh = trace = 0; - id_fix1 = NULL; - id_fix2 = NULL; - id_fix3 = NULL; - statted_id = NULL; + id_fix1 = nullptr; + id_fix2 = nullptr; + id_fix3 = nullptr; + statted_id = nullptr; custom_exclude_flag = 0; // used to store restart info @@ -708,7 +708,7 @@ void FixBondReact::post_constructor() int unused; char * idprop; idprop = (char *) fix->extract("property",unused); - if (idprop == NULL) + if (idprop == nullptr) error->all(FLERR,"Exclude group must be a per-atom property group"); len = strlen(idprop) + 1; @@ -750,7 +750,7 @@ void FixBondReact::init() // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { - if (force->pair == NULL || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) + if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); } @@ -3132,7 +3132,7 @@ void FixBondReact::read(int myrxn) // skip 1st line of file eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); + if (eof == nullptr) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); // read header lines // skip blank lines or lines that start with "#" @@ -3403,7 +3403,7 @@ void FixBondReact::readID(char *strarg, int iconstr, int mode, int myID) void FixBondReact::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Bond/react: Cannot open map file %s",file); error->one(FLERR,str); @@ -3414,7 +3414,7 @@ void FixBondReact::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -3431,11 +3431,11 @@ void FixBondReact::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return @@ -3477,7 +3477,7 @@ int FixBondReact::parse(char *line, char **words, int max) int nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((ptr = strtok(NULL," \t\n\r\f"))) { + while ((ptr = strtok(nullptr," \t\n\r\f"))) { if (nwords < max) words[nwords] = ptr; nwords++; } diff --git a/src/USER-REAXC/compute_spec_atom.cpp b/src/USER-REAXC/compute_spec_atom.cpp index bc5b26b69..1c4856d72 100644 --- a/src/USER-REAXC/compute_spec_atom.cpp +++ b/src/USER-REAXC/compute_spec_atom.cpp @@ -117,8 +117,8 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 4a61cfa03..71a84a413 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -60,7 +60,7 @@ static const char cite_fix_qeq_reax[] = /* ---------------------------------------------------------------------- */ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pertype_option(NULL) + Fix(lmp, narg, arg), pertype_option(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); @@ -83,33 +83,33 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[8],"dual") == 0) dual_enabled = 1; else error->all(FLERR,"Illegal fix qeq/reax command"); } - shld = NULL; + shld = nullptr; n = n_cap = 0; N = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 4; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; - b_prc = NULL; - b_prm = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; + b_prc = nullptr; + b_prm = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // dual CG support // Update comm sizes for this fix @@ -119,10 +119,10 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxc = NULL; + reaxc = nullptr; reaxc = (PairReaxC *) force->pair_match("^reax/c",0); - s_hist = t_hist = NULL; + s_hist = t_hist = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); for (int i = 0; i < atom->nmax; i++) @@ -184,13 +184,13 @@ void FixQEqReax::pertype_parameters(char *arg) if (strcmp(arg,"reax/c") == 0) { reaxflag = 1; Pair *pair = force->pair_match("reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/reax"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/reax"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/reax could not extract params from pair reax/c"); return; @@ -208,7 +208,7 @@ void FixQEqReax::pertype_parameters(char *arg) memory->create(gamma,ntypes+1,"qeq/reax:gamma"); if (comm->me == 0) { - if ((pf = fopen(arg,"r")) == NULL) + if ((pf = fopen(arg,"r")) == nullptr) error->one(FLERR,"Fix qeq/reax parameter file could not be found"); for (i = 1; i <= ntypes && !feof(pf); i++) { @@ -390,7 +390,7 @@ void FixQEqReax::init_shielding() int ntypes; ntypes = atom->ntypes; - if (shld == NULL) + if (shld == nullptr) memory->create(shld,ntypes+1,ntypes+1,"qeq:shielding"); for (i = 1; i <= ntypes; ++i) diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c98adf5b4..14f4762ce 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -41,8 +41,8 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : // register with atom class oldnmax = 0; - num_bonds = NULL; - num_hbonds = NULL; + num_bonds = nullptr; + num_hbonds = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index c0ffd4c17..a16446e76 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -65,7 +65,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[4],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/bonds file %s",arg[4]); error->one(FLERR,str); @@ -75,9 +75,9 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : if (atom->tag_consecutive() == 0) error->all(FLERR,"Atom IDs must be consecutive for fix reax/c bonds"); - abo = NULL; - neighid = NULL; - numneigh = NULL; + abo = nullptr; + neighid = nullptr; + numneigh = nullptr; allocate(); } @@ -114,7 +114,7 @@ void FixReaxCBonds::setup(int /*vflag*/) void FixReaxCBonds::init() { reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); } @@ -235,7 +235,7 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) } j += (5+numbonds); - if (atom->molecule == NULL ) buf[j] = 0.0; + if (atom->molecule == nullptr ) buf[j] = 0.0; else buf[j] = atom->molecule[i]; j ++; diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp index ec03ab180..952748570 100644 --- a/src/USER-REAXC/fix_reaxc_species.cpp +++ b/src/USER-REAXC/fix_reaxc_species.cpp @@ -97,7 +97,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : error->warning(FLERR,"Resetting reneighboring criteria for fix reax/c/species"); } - tmparg = NULL; + tmparg = nullptr; memory->create(tmparg,4,4,"reax/c/species:tmparg"); strcpy(tmparg[0],arg[3]); strcpy(tmparg[1],arg[4]); @@ -119,28 +119,28 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[6],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/species file %s",arg[6]); error->one(FLERR,str); } } - x0 = NULL; - clusterID = NULL; + x0 = nullptr; + clusterID = nullptr; int ntmp = 1; memory->create(x0,ntmp,"reax/c/species:x0"); memory->create(clusterID,ntmp,"reax/c/species:clusterID"); vector_atom = clusterID; - BOCut = NULL; - Name = NULL; - MolName = NULL; - MolType = NULL; - NMol = NULL; - nd = NULL; - molmap = NULL; + BOCut = nullptr; + Name = nullptr; + MolName = nullptr; + MolType = nullptr; + NMol = nullptr; + nd = nullptr; + molmap = nullptr; nmax = 0; setupflag = 0; @@ -156,8 +156,8 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : BOCut[i][j] = bg_cut; // optional args - eletype = NULL; - ele = filepos = NULL; + eletype = nullptr; + ele = filepos = nullptr; eleflag = posflag = padflag = 0; singlepos_opened = multipos_opened = 0; @@ -213,7 +213,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } else { if (me == 0) { pos = fopen(filepos, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); } singlepos_opened = 1; multipos = 0; @@ -278,7 +278,7 @@ int FixReaxCSpecies::setmask() void FixReaxCSpecies::setup(int /*vflag*/) { ntotal = static_cast (atom->natoms); - if (Name == NULL) + if (Name == nullptr) memory->create(Name,ntypes,"reax/c/species:Name"); post_integrate(); @@ -292,7 +292,7 @@ void FixReaxCSpecies::init() error->all(FLERR,"Cannot use fix reax/c/species unless atoms have IDs"); reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/species without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/species without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); reaxc->fixspecies_flag = 1; @@ -579,7 +579,7 @@ void FixReaxCSpecies::FindMolecule () void FixReaxCSpecies::SortMolecule(int &Nmole) { memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; int n, idlo, idhi; int *mask =atom->mask; @@ -641,7 +641,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) } memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; } @@ -656,11 +656,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) int *Nameall, *NMolall; memory->destroy(MolName); - MolName = NULL; + MolName = nullptr; memory->create(MolName,Nmole*(ntypes+1),"reax/c/species:MolName"); memory->destroy(NMol); - NMol = NULL; + NMol = nullptr; memory->create(NMol,Nmole,"reax/c/species:NMol"); for (m = 0; m < Nmole; m ++) NMol[m] = 1; @@ -705,11 +705,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(Nameall); memory->destroy(nd); - nd = NULL; + nd = nullptr; memory->create(nd,Nspec,"reax/c/species:nd"); memory->destroy(MolType); - MolType = NULL; + MolType = nullptr; memory->create(MolType,Nspec*(ntypes+2),"reax/c/species:MolType"); } @@ -793,8 +793,8 @@ void FixReaxCSpecies::OpenPos() if (me == 0) { pos = fopen(filecurrent, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); - } else pos = NULL; + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); + } else pos = nullptr; multipos_opened = 1; free(filecurrent); @@ -831,7 +831,7 @@ void FixReaxCSpecies::WritePos(int Nmole, int Nspec) fprintf(pos,"ID\tAtom_Count\tType\tAve_q\t\tCoM_x\t\tCoM_y\t\tCoM_z\n"); } - Nameall = NULL; + Nameall = nullptr; memory->create(Nameall,ntypes,"reax/c/species:Nameall"); for (m = 1; m <= Nmole; m ++) { diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index c38257ae3..6a2ba7d75 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -117,16 +117,16 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) system->bndry_cuts.ghost_hbond = 0; system->bndry_cuts.ghost_bond = 0; system->bndry_cuts.ghost_cutoff = 0; - system->my_atoms = NULL; + system->my_atoms = nullptr; system->pair_ptr = this; system->error_ptr = error; control->error_ptr = error; system->omp_active = 0; - fix_reax = NULL; - tmpid = NULL; - tmpbo = NULL; + fix_reax = nullptr; + tmpid = nullptr; + tmpbo = nullptr; nextra = 14; pvector = new double[nextra]; @@ -318,7 +318,7 @@ void PairReaxC::coeff( int nargs, char **args ) char *file = args[2]; FILE *fp; fp = utils::open_potential(file,lmp,nullptr); - if (fp != NULL) + if (fp != nullptr) Read_Force_Field(fp, &(system->reax_param), control); else { char str[128]; @@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args ) } // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr int itmp = 0; int nreax_types = system->reax_param.num_atom_types; @@ -424,7 +424,7 @@ void PairReaxC::init_style( ) if (lists[i].allocated != 1) lists[i].allocated = 0; - if (fix_reax == NULL) { + if (fix_reax == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) fix_id; fixarg[1] = (char *) "all"; @@ -819,7 +819,7 @@ void *PairReaxC::extract(const char *str, int &dim) else gamma[i] = 0.0; return (void *) gamma; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index f0b0e8229..0390769b5 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -57,10 +57,10 @@ int PreAllocate_Space( reax_system *system, control_params * /*control*/, // Nullify some arrays only used in omp styles // Should be safe to do here since called in pair->setup(); #ifdef LMP_USER_OMP - workspace->CdDeltaReduction = NULL; - workspace->forceReduction = NULL; - workspace->valence_angle_atom_myoffset = NULL; - workspace->my_ext_pressReduction = NULL; + workspace->CdDeltaReduction = nullptr; + workspace->forceReduction = nullptr; + workspace->valence_angle_atom_myoffset = nullptr; + workspace->my_ext_pressReduction = nullptr; #else LMP_UNUSED_PARAM(workspace); #endif diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp index 12aa989fa..1c8c24c31 100644 --- a/src/USER-REAXC/reaxc_control.cpp +++ b/src/USER-REAXC/reaxc_control.cpp @@ -41,7 +41,7 @@ char Read_Control_File( char *control_file, control_params* control, double val; /* open control file */ - if ( (fp = fopen( control_file, "r" ) ) == NULL ) { + if ( (fp = fopen( control_file, "r" ) ) == nullptr ) { control->error_ptr->all(FLERR, "The control file cannot be opened"); } diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index f68a2a2ab..866e3c989 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -50,7 +50,7 @@ int Init_Output_Files( reax_system *system, control_params *control, /* init potentials file */ sprintf( temp, "%s.pot", control->sim_name ); - if ((out_control->pot = fopen( temp, "w" )) != NULL) { + if ((out_control->pot = fopen( temp, "w" )) != nullptr) { fflush( out_control->pot ); } else { strcpy( msg, "init_out_controls: .pot file could not be opened\n" ); @@ -65,7 +65,7 @@ int Init_Output_Files( reax_system *system, control_params *control, control->ensemble == iNPT || control->ensemble == sNPT ) { sprintf( temp, "%s.prs", control->sim_name ); - if ((out_control->prs = fopen( temp, "w" )) != NULL) { + if ((out_control->prs = fopen( temp, "w" )) != nullptr) { fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n", "step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]", "Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" ); @@ -91,12 +91,12 @@ int Close_Output_Files( reax_system *system, control_params * /* control */, if (system->my_rank == MASTER_NODE) { if (out_control->pot) { fclose( out_control->pot ); - out_control->pot = NULL; + out_control->pot = nullptr; } if (out_control->prs) { fclose(out_control->prs); - out_control->prs = NULL; + out_control->prs = nullptr; } } diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp index 0880d9631..ea59b84ff 100644 --- a/src/USER-REAXC/reaxc_list.cpp +++ b/src/USER-REAXC/reaxc_list.cpp @@ -106,37 +106,37 @@ void Delete_List( reax_list *l ) sfree(l->error_ptr, l->index, "list:index" ); sfree(l->error_ptr, l->end_index, "list:end_index" ); - l->index = NULL; - l->end_index = NULL; + l->index = nullptr; + l->end_index = nullptr; switch(l->type) { case TYP_VOID: sfree(l->error_ptr, l->select.v, "list:v" ); - l->select.v = NULL; + l->select.v = nullptr; break; case TYP_HBOND: sfree(l->error_ptr, l->select.hbond_list, "list:hbonds" ); - l->select.hbond_list = NULL; + l->select.hbond_list = nullptr; break; case TYP_FAR_NEIGHBOR: sfree(l->error_ptr, l->select.far_nbr_list, "list:far_nbrs" ); - l->select.far_nbr_list = NULL; + l->select.far_nbr_list = nullptr; break; case TYP_BOND: sfree(l->error_ptr, l->select.bond_list, "list:bonds" ); - l->select.bond_list = NULL; + l->select.bond_list = nullptr; break; case TYP_DBO: sfree(l->error_ptr, l->select.dbo_list, "list:dbos" ); - l->select.dbo_list = NULL; + l->select.dbo_list = nullptr; break; case TYP_DDELTA: sfree(l->error_ptr, l->select.dDelta_list, "list:dDeltas" ); - l->select.dDelta_list = NULL; + l->select.dDelta_list = nullptr; break; case TYP_THREE_BODY: sfree(l->error_ptr, l->select.three_body_list, "list:three_bodies" ); - l->select.three_body_list = NULL; + l->select.three_body_list = nullptr; break; default: diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index 07a45b946..b78b00568 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -48,7 +48,7 @@ double Get_Time( ) t /= 1000.0; return t; #else - gettimeofday(&tim, NULL ); + gettimeofday(&tim, nullptr ); return( tim.tv_sec + (tim.tv_usec / 1000000.0) ); #endif } @@ -62,7 +62,7 @@ int Tokenize( char* s, char*** tok ) strncpy( test, s, MAX_LINE-1); - for( word = strtok(test, sep); word; word = strtok(NULL, sep) ) { + for( word = strtok(test, sep); word; word = strtok(nullptr, sep) ) { strncpy( (*tok)[count], word, MAX_LINE ); count++; } @@ -84,11 +84,11 @@ void *smalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, const char *name ) if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = malloc( n ); - if (ptr == NULL) { + if (ptr == nullptr) { snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n, name); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); @@ -109,7 +109,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL.\n", n, name ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } if (size <= 0) { @@ -117,11 +117,11 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL", name, size ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = calloc( n, size ); - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n*size, name); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -135,7 +135,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c /* safe free */ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) { - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Trying to free the already NULL pointer %s", name ); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -144,6 +144,6 @@ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) } free( ptr ); - ptr = NULL; + ptr = nullptr; } diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 717bf741e..698715de2 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -41,7 +41,7 @@ int Reallocate_Output_Buffer( LAMMPS_NS::Error *error_ptr, output_controls *out_ out_control->buffer_len = (int)(req_space*REAX_SAFE_ZONE); out_control->buffer = (char*) malloc(out_control->buffer_len*sizeof(char)); - if (out_control->buffer == NULL) { + if (out_control->buffer == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Insufficient memory for required buffer size %d", (int) (req_space*REAX_SAFE_ZONE)); error_ptr->one(FLERR,errmsg); @@ -341,7 +341,7 @@ int Init_Traj( reax_system *system, control_params *control, /* allocate line & buffer space */ out_control->line = (char*) calloc( MAX_TRJ_LINE_LEN + 1, sizeof(char) ); out_control->buffer_len = 0; - out_control->buffer = NULL; + out_control->buffer = nullptr; /* write trajectory header and atom info, if applicable */ if (out_control->traj_method == REG_TRAJ) { diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index c49f99a5a..4dd796a34 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -42,10 +42,10 @@ Scafacos::Scafacos(LAMMPS *lmp) : KSpace(lmp) initialized = 0; maxatom = 0; - xpbc = NULL; - epot = NULL; - efield = NULL; - fcs = NULL; + xpbc = nullptr; + epot = nullptr; + efield = nullptr; + fcs = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index c39d142a6..45843268f 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -43,9 +43,9 @@ enum{EQUAL,ATOM}; FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), - vxvarstr(NULL), vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), displace(NULL), velocity(NULL) { + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), + vxvarstr(nullptr), vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), displace(nullptr), velocity(nullptr) { if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all(FLERR, "fix meso/move command requires atom_style with both energy and density"); @@ -126,37 +126,37 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (narg < 10) error->all(FLERR,"Illegal fix meso/move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -237,7 +237,7 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : atom->add_callback(0); atom->add_callback(1); - displace = velocity = NULL; + displace = velocity = nullptr; // xoriginal = initial unwrapped positions of atoms @@ -353,9 +353,9 @@ void FixMesoMove::init () { memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; } void FixMesoMove::setup_pre_force (int /*vflag*/) { @@ -731,7 +731,7 @@ void FixMesoMove::initial_integrate (int /*vflag*/) { } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMesoMove::final_integrate () { diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp index bf2fc73b0..b3a084ab1 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp @@ -307,7 +307,7 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) { void PairSDPDTaitwaterIsothermal::init_style() { - if ((!atom->rho_flag) || (atom->drho == NULL)) + if ((!atom->rho_flag) || (atom->drho == nullptr)) error->all(FLERR,"Pair style dpd/taitwater/isothermal requires atom " "attributes rho and drho"); diff --git a/src/USER-SMD/compute_smd_contact_radius.cpp b/src/USER-SMD/compute_smd_contact_radius.cpp index 46cbc602f..ccab79f85 100644 --- a/src/USER-SMD/compute_smd_contact_radius.cpp +++ b/src/USER-SMD/compute_smd_contact_radius.cpp @@ -46,7 +46,7 @@ ComputeSMDContactRadius::ComputeSMDContactRadius(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - contact_radius_vector = NULL; + contact_radius_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_damage.cpp b/src/USER-SMD/compute_smd_damage.cpp index 96a936cd8..9e58903c9 100644 --- a/src/USER-SMD/compute_smd_damage.cpp +++ b/src/USER-SMD/compute_smd_damage.cpp @@ -46,7 +46,7 @@ ComputeSMDDamage::ComputeSMDDamage(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - damage_vector = NULL; + damage_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_hourglass_error.cpp b/src/USER-SMD/compute_smd_hourglass_error.cpp index 3b6b90000..411802503 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.cpp +++ b/src/USER-SMD/compute_smd_hourglass_error.cpp @@ -49,7 +49,7 @@ ComputeSMDHourglassError::ComputeSMDHourglassError(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - hourglass_error_vector = NULL; + hourglass_error_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ void ComputeSMDHourglassError::compute_peratom() { int itmp = 0; double *hourglass_error = (double *) force->pair->extract("smd/tlsph/hourglass_error_ptr", itmp); - if (hourglass_error == NULL) { + if (hourglass_error == nullptr) { error->all(FLERR, "compute smd/hourglass_error failed to access hourglass_error array"); } diff --git a/src/USER-SMD/compute_smd_internal_energy.cpp b/src/USER-SMD/compute_smd_internal_energy.cpp index 90ddb7483..c7b11e22c 100644 --- a/src/USER-SMD/compute_smd_internal_energy.cpp +++ b/src/USER-SMD/compute_smd_internal_energy.cpp @@ -46,7 +46,7 @@ ComputeSMDInternalEnergy::ComputeSMDInternalEnergy(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - internal_energy_vector = NULL; + internal_energy_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain.cpp b/src/USER-SMD/compute_smd_plastic_strain.cpp index c1c001a5d..842d84889 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrain::ComputeSMDPlasticStrain(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - plastic_strain_vector = NULL; + plastic_strain_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp index 272a2c59e..907e503f5 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrainRate::ComputeSMDPlasticStrainRate(LAMMPS *lmp, int narg, size_peratom_cols = 0; nmax = 0; - plastic_strain_rate_vector = NULL; + plastic_strain_rate_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_rho.cpp b/src/USER-SMD/compute_smd_rho.cpp index d9c0a99b0..89db0b0ac 100644 --- a/src/USER-SMD/compute_smd_rho.cpp +++ b/src/USER-SMD/compute_smd_rho.cpp @@ -46,7 +46,7 @@ ComputeSMDRho::ComputeSMDRho(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp index 81792355e..b283a41c4 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp @@ -49,7 +49,7 @@ ComputeSMDTLSPHDefgrad::ComputeSMDTLSPHDefgrad(LAMMPS *lmp, int narg, char **arg size_peratom_cols = 10; nmax = 0; - defgradVector = NULL; + defgradVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_dt.cpp b/src/USER-SMD/compute_smd_tlsph_dt.cpp index 7752436b8..a02ff838d 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.cpp +++ b/src/USER-SMD/compute_smd_tlsph_dt.cpp @@ -49,7 +49,7 @@ ComputeSMDTlsphDt::ComputeSMDTlsphDt(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMDTlsphDt::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/tlsph/particle_dt_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/tlsph_dt failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp index 347b13841..f5f14fa50 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDTLSPHNumNeighs::ComputeSMDTLSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsRefConfigOutput = NULL; + numNeighsRefConfigOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDTLSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighsRefConfig = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (numNeighsRefConfig == NULL) { + if (numNeighsRefConfig == nullptr) { error->all(FLERR, "compute smd/tlsph_num_neighs failed to access numNeighsRefConfig array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_shape.cpp b/src/USER-SMD/compute_smd_tlsph_shape.cpp index a3727871d..a978fd2e9 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.cpp +++ b/src/USER-SMD/compute_smd_tlsph_shape.cpp @@ -51,7 +51,7 @@ ComputeSmdTlsphShape::ComputeSmdTlsphShape(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 7; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -89,12 +89,12 @@ void ComputeSmdTlsphShape::compute_peratom() { int itmp = 0; Matrix3d *R = (Matrix3d *) force->pair->extract("smd/tlsph/rotation_ptr", itmp); - if (R == NULL) { + if (R == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access rotation array"); } Matrix3d *F = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (F == NULL) { + if (F == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access deformation gradient array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain.cpp b/src/USER-SMD/compute_smd_tlsph_strain.cpp index db51ca412..5e86f4fd3 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain.cpp @@ -52,7 +52,7 @@ ComputeSMDTLSPHstrain::ComputeSMDTLSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -92,7 +92,7 @@ void ComputeSMDTLSPHstrain::compute_peratom() { // copy data to output array int itmp = 0; Matrix3d *Fincr = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (Fincr == NULL) { + if (Fincr == nullptr) { error->all(FLERR, "compute smd/tlsph_strain failed to access Fincr array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp index 577dc0e40..3d9f46769 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp @@ -52,7 +52,7 @@ ComputeSMDTLSPHStrainRate::ComputeSMDTLSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -89,7 +89,7 @@ void ComputeSMDTLSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *D = (Matrix3d *) force->pair->extract("smd/tlsph/strain_rate_ptr", itmp); - if (D == NULL) { + if (D == nullptr) { error->all(FLERR, "compute smd/tlsph_strain_rate could not access strain rate. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_tlsph_stress.cpp b/src/USER-SMD/compute_smd_tlsph_stress.cpp index 9c78b192c..f668a7f82 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.cpp +++ b/src/USER-SMD/compute_smd_tlsph_stress.cpp @@ -60,7 +60,7 @@ ComputeSMDTLSPHStress::ComputeSMDTLSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDTLSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/tlsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/tlsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_triangle_vertices.cpp b/src/USER-SMD/compute_smd_triangle_vertices.cpp index 06706a85a..46555559d 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.cpp +++ b/src/USER-SMD/compute_smd_triangle_vertices.cpp @@ -46,7 +46,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch size_peratom_cols = 9; nmax = 0; - outputVector = NULL; + outputVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_effm.cpp b/src/USER-SMD/compute_smd_ulsph_effm.cpp index fc8637bbf..4285d1c98 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.cpp +++ b/src/USER-SMD/compute_smd_ulsph_effm.cpp @@ -49,7 +49,7 @@ ComputeSMD_Ulsph_Effm::ComputeSMD_Ulsph_Effm(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMD_Ulsph_Effm::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/ulsph/effective_modulus_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/ulsph_effm failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp index 4ef339db9..57460c292 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDULSPHNumNeighs::ComputeSMDULSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsOutput = NULL; + numNeighsOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDULSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighs = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (numNeighs == NULL) { + if (numNeighs == nullptr) { error->all(FLERR, "compute smd/ulsph_num_neighs failed to access numNeighs array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_strain.cpp b/src/USER-SMD/compute_smd_ulsph_strain.cpp index cf1535759..a4211a6b6 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDULSPHstrain::ComputeSMDULSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp index f5ff4fef9..9118e6dde 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp @@ -49,7 +49,7 @@ ComputeSMDULSPHStrainRate::ComputeSMDULSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ void ComputeSMDULSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->all(FLERR, "compute smd/ulsph_strain_rate could not access any velocity gradients. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_ulsph_stress.cpp b/src/USER-SMD/compute_smd_ulsph_stress.cpp index ea477375c..c7078a574 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.cpp +++ b/src/USER-SMD/compute_smd_ulsph_stress.cpp @@ -59,7 +59,7 @@ ComputeSMDULSPHStress::ComputeSMDULSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDULSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/ulsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/ulsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_vol.cpp b/src/USER-SMD/compute_smd_vol.cpp index 5999dfaa5..46aa7ea3c 100644 --- a/src/USER-SMD/compute_smd_vol.cpp +++ b/src/USER-SMD/compute_smd_vol.cpp @@ -48,7 +48,7 @@ ComputeSMDVol::ComputeSMDVol(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - volVector = NULL; + volVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/fix_smd_adjust_dt.cpp b/src/USER-SMD/fix_smd_adjust_dt.cpp index b5dab3d3a..ccb64b8f2 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.cpp +++ b/src/USER-SMD/fix_smd_adjust_dt.cpp @@ -108,28 +108,28 @@ void FixSMDTlsphDtReset::end_of_step() { double *dt_HERTZ = (double *) force->pair->extract("smd/hertz/stable_time_increment_ptr", itmp); double *dt_PERI_IPMB = (double *) force->pair->extract("smd/peri_ipmb/stable_time_increment_ptr", itmp); - if ((dtCFL_TLSPH == NULL) && (dtCFL_ULSPH == NULL) && (dt_TRI == NULL) && (dt_HERTZ == NULL) - && (dt_PERI_IPMB == NULL)) { + if ((dtCFL_TLSPH == nullptr) && (dtCFL_ULSPH == nullptr) && (dt_TRI == nullptr) && (dt_HERTZ == nullptr) + && (dt_PERI_IPMB == nullptr)) { error->all(FLERR, "fix smd/adjust_dt failed to access a valid dtCFL"); } - if (dtCFL_TLSPH != NULL) { + if (dtCFL_TLSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_TLSPH); } - if (dtCFL_ULSPH != NULL) { + if (dtCFL_ULSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_ULSPH); } - if (dt_TRI != NULL) { + if (dt_TRI != nullptr) { dtmin = MIN(dtmin, *dt_TRI); } - if (dt_HERTZ != NULL) { + if (dt_HERTZ != nullptr) { dtmin = MIN(dtmin, *dt_HERTZ); } - if (dt_PERI_IPMB != NULL) { + if (dt_PERI_IPMB != nullptr) { dtmin = MIN(dtmin, *dt_PERI_IPMB); } diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index 7d5e89f89..743cd09f0 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -139,7 +139,7 @@ void FixSMDIntegrateTlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVelDifference = (Vector3d *) force->pair->extract("smd/tlsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVelDifference == NULL) { + if (smoothVelDifference == nullptr) { error->one(FLERR, "fix smd/integrate_tlsph failed to access smoothVel array. Check if a pair style exist which calculates this quantity."); } diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 215759331..c261537df 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -171,7 +171,7 @@ void FixSMDIntegrateUlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVel = (Vector3d *) force->pair->extract("smd/ulsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVel == NULL) { + if (smoothVel == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to access smoothVel array"); } } @@ -259,12 +259,12 @@ void FixSMDIntegrateUlsph::final_integrate() { int itmp; int *nn = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss num_neighs array"); } Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss velocityGradient array"); } diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index d3e71f0e5..330199927 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -57,7 +57,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3], "v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -93,7 +93,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -241,7 +241,7 @@ void FixSMDSetVel::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 3e63de08f..f0b405f94 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -59,12 +59,12 @@ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); maxpartner = 1; - npartner = NULL; - partner = NULL; - wfd_list = NULL; - wf_list = NULL; - energy_per_bond = NULL; - degradation_ij = NULL; + npartner = nullptr; + partner = nullptr; + wfd_list = nullptr; + wf_list = nullptr; + energy_per_bond = nullptr; + degradation_ij = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -130,13 +130,13 @@ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { } int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); - if (updateFlag_ptr == NULL) { + if (updateFlag_ptr == nullptr) { error->one(FLERR, "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); } int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); } @@ -468,7 +468,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*nth*/) { -// ipage = NULL if being called from granular pair style init() +// ipage = nullptr if being called from granular pair style init() // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 10f248c39..26190a5a9 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -69,7 +69,7 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : FixSMDWallSurface::~FixSMDWallSurface() { free(filename); - filename = NULL; + filename = nullptr; // unregister this fix so atom class doesn't invoke it any more //atom->delete_callback(id, 0); @@ -198,12 +198,12 @@ int FixSMDWallSurface::count_words(const char *line) { if ((ptr = strchr(copy, '#'))) *ptr = '\0'; - if (strtok(copy, " \t\n\r\f") == NULL) { + if (strtok(copy, " \t\n\r\f") == nullptr) { memory->destroy(copy); return 0; } n = 1; - while (strtok(NULL, " \t\n\r\f")) + while (strtok(nullptr, " \t\n\r\f")) n++; memory->destroy(copy); @@ -229,7 +229,7 @@ void FixSMDWallSurface::read_triangles(int pass) { Vector3d normal, center; FILE *fp = fopen(filename, "r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128, "Cannot open file %s", filename); error->one(FLERR, str); @@ -261,7 +261,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read STL solid name retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading number of triangle pairs"); } @@ -272,11 +272,11 @@ void FixSMDWallSurface::read_triangles(int pass) { // values = new char*[nwords]; // values[0] = strtok(line, " \t\n\r\f"); -// if (values[0] == NULL) +// if (values[0] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // for (m = 1; m < nwords; m++) { -// values[m] = strtok(NULL, " \t\n\r\f"); -// if (values[m] == NULL) +// values[m] = strtok(nullptr, " \t\n\r\f"); +// if (values[m] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // } // delete[] values; @@ -301,11 +301,11 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); } @@ -318,7 +318,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read outer loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading outer loop"); } @@ -331,7 +331,7 @@ void FixSMDWallSurface::read_triangles(int pass) { for (int k = 0; k < 3; k++) { retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading vertex line"); } @@ -342,11 +342,11 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect vertex line"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect vertex line"); } @@ -362,7 +362,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading endloop"); } @@ -373,7 +373,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end facet line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading endfacet"); } diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index 8d3c06d5e..c966f5ba7 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -51,9 +51,9 @@ using namespace LAMMPS_NS; PairHertz::PairHertz(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -374,6 +374,6 @@ void *PairHertz::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index 25301685a..3c8711955 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -63,28 +63,28 @@ using namespace SMD_Math; PairTlsph::PairTlsph(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; - failureModel = NULL; - strengthModel = eos = NULL; + failureModel = nullptr; + strengthModel = eos = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - Fdot = Fincr = K = PK1 = NULL; - R = FincrInv = W = D = NULL; - detF = NULL; - smoothVelDifference = NULL; - numNeighsRefConfig = NULL; - CauchyStress = NULL; - hourglass_error = NULL; - Lookup = NULL; - particle_dt = NULL; + Fdot = Fincr = K = PK1 = nullptr; + R = FincrInv = W = D = nullptr; + detF = nullptr; + smoothVelDifference = nullptr; + numNeighsRefConfig = nullptr; + CauchyStress = nullptr; + hourglass_error = nullptr; + Lookup = nullptr; + particle_dt = nullptr; updateFlag = 0; first = true; dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight - fix_tlsph_reference_configuration = NULL; + fix_tlsph_reference_configuration = nullptr; cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. } @@ -1748,7 +1748,7 @@ void PairTlsph::init_style() { if (igroup == -1) error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); - if (fix_tlsph_reference_configuration == NULL) { + if (fix_tlsph_reference_configuration == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; fixarg[1] = (char *) "tlsph"; @@ -1824,7 +1824,7 @@ void *PairTlsph::extract(const char *str, int &/*i*/) { return (void *) R; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index 8ccba562e..6e702ef82 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -54,9 +54,9 @@ using namespace Eigen; PairTriSurf::PairTriSurf(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -833,6 +833,6 @@ void *PairTriSurf::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index 3a6cdf5d2..bbb8cf372 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -56,22 +56,22 @@ PairULSPH::PairULSPH(LAMMPS *lmp) : Pair(lmp) { // per-type arrays - Q1 = NULL; - eos = viscosity = strength = NULL; - c0_type = NULL; - c0 = NULL; - Lookup = NULL; - artificial_stress = NULL; - artificial_pressure = NULL; + Q1 = nullptr; + eos = viscosity = strength = nullptr; + c0_type = nullptr; + c0 = nullptr; + Lookup = nullptr; + artificial_stress = nullptr; + artificial_pressure = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - stressTensor = L = K = NULL; - shepardWeight = NULL; - smoothVel = NULL; - numNeighs = NULL; - F = NULL; - rho = NULL; - effm = NULL; + stressTensor = L = K = nullptr; + shepardWeight = nullptr; + smoothVel = nullptr; + numNeighs = nullptr; + F = nullptr; + rho = nullptr; + effm = nullptr; velocity_gradient_required = false; // turn off computation of velocity gradient by default density_summation = velocity_gradient = false; @@ -1575,7 +1575,7 @@ void *PairULSPH::extract(const char *str, int &/*i*/) { return (void *) K; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 875d254ac..a40f676ff 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -101,50 +101,50 @@ PairSMTBQ::PairSMTBQ(LAMMPS *lmp) : Pair(lmp) kmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - intparams = NULL; - - intype = NULL; - coultype = NULL; - fafb = NULL; - dfafb = NULL; - potqn = NULL; - dpotqn = NULL; + params = nullptr; + intparams = nullptr; + + intype = nullptr; + coultype = nullptr; + fafb = nullptr; + dfafb = nullptr; + potqn = nullptr; + dpotqn = nullptr; Vself = 0.0; - tabsmb = NULL; - tabsmr = NULL; - dtabsmb = NULL; - dtabsmr = NULL; - - sbcov = NULL; - coord = NULL; - sbmet = NULL; - ecov = NULL; - - potmad = NULL; - potself = NULL; - potcov = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; - tab_comm = NULL; - - nvsm = NULL; - vsm = NULL; - flag_QEq = NULL; - nQEqaall = NULL; - nQEqcall = NULL; - nQEqall = NULL; + tabsmb = nullptr; + tabsmr = nullptr; + dtabsmb = nullptr; + dtabsmr = nullptr; + + sbcov = nullptr; + coord = nullptr; + sbmet = nullptr; + ecov = nullptr; + + potmad = nullptr; + potself = nullptr; + potcov = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; + tab_comm = nullptr; + + nvsm = nullptr; + vsm = nullptr; + flag_QEq = nullptr; + nQEqaall = nullptr; + nQEqcall = nullptr; + nQEqall = nullptr; nteam = 0; cluster = 0; Nevery = 0.0; Neverypot = 0.0; - fct = NULL; + fct = nullptr; maxpage = 0; @@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -286,7 +286,7 @@ void PairSMTBQ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -392,9 +392,9 @@ void PairSMTBQ::read_file(char *file) char **words; memory->sfree(params); - params = NULL; + params = nullptr; memory->sfree(intparams); - intparams = NULL; + intparams = nullptr; nparams = 0; maxparam = 0; maxintparam = 0; @@ -411,7 +411,7 @@ void PairSMTBQ::read_file(char *file) // open file on all processors FILE *fp; fp = utils::open_potential(file,lmp,nullptr); - if ( fp == NULL ) { + if ( fp == nullptr ) { char str[128]; snprintf(str,128,"Cannot open SMTBQ potential file %s",file); error->one(FLERR,str); @@ -3562,12 +3562,12 @@ int PairSMTBQ::Tokenize( char* s, char*** tok ) const char *sep = "' "; char *mot; int count=0; - mot = NULL; + mot = nullptr; strncpy( test, s, MAXLINE-1 ); - for( mot = strtok(test, sep); mot; mot = strtok(NULL, sep) ) { + for( mot = strtok(test, sep); mot; mot = strtok(nullptr, sep) ) { strncpy( (*tok)[count], mot, MAXLINE ); count++; } diff --git a/src/USER-SPH/compute_sph_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp index 8869dae5f..d8142fd79 100644 --- a/src/USER-SPH/compute_sph_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHEAtom::ComputeSPHEAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - evector = NULL; + evector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp index 1d6d03811..edc788a1a 100644 --- a/src/USER-SPH/compute_sph_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -35,7 +35,7 @@ ComputeSPHRhoAtom::ComputeSPHRhoAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp index 063af7002..253e63748 100644 --- a/src/USER-SPH/compute_sph_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHTAtom::ComputeSPHTAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - tvector = NULL; + tvector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-TALLY/compute_force_tally.cpp b/src/USER-TALLY/compute_force_tally.cpp index d010b004d..a5ad46e77 100644 --- a/src/USER-TALLY/compute_force_tally.cpp +++ b/src/USER-TALLY/compute_force_tally.cpp @@ -49,7 +49,7 @@ ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - fatom = NULL; + fatom = nullptr; vector = new double[size_peratom_cols]; } @@ -66,7 +66,7 @@ ComputeForceTally::~ComputeForceTally() void ComputeForceTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute force/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_heat_flux_tally.cpp b/src/USER-TALLY/compute_heat_flux_tally.cpp index 1a2dd3628..f57899c59 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.cpp +++ b/src/USER-TALLY/compute_heat_flux_tally.cpp @@ -48,8 +48,8 @@ ComputeHeatFluxTally::ComputeHeatFluxTally(LAMMPS *lmp, int narg, char **arg) : did_setup = 0; invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; - eatom = NULL; + stress = nullptr; + eatom = nullptr; vector = new double[size_vector]; heatj = new double[size_vector]; } @@ -69,7 +69,7 @@ ComputeHeatFluxTally::~ComputeHeatFluxTally() void ComputeHeatFluxTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute heat/flux/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_mol_tally.cpp b/src/USER-TALLY/compute_pe_mol_tally.cpp index 835d1e80b..77bf7973d 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.cpp +++ b/src/USER-TALLY/compute_pe_mol_tally.cpp @@ -59,7 +59,7 @@ ComputePEMolTally::~ComputePEMolTally() void ComputePEMolTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/mol/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_tally.cpp b/src/USER-TALLY/compute_pe_tally.cpp index ef7c13fed..e330b56a8 100644 --- a/src/USER-TALLY/compute_pe_tally.cpp +++ b/src/USER-TALLY/compute_pe_tally.cpp @@ -48,7 +48,7 @@ ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - eatom = NULL; + eatom = nullptr; vector = new double[size_peratom_cols]; } @@ -65,7 +65,7 @@ ComputePETally::~ComputePETally() void ComputePETally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/tally without a pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_stress_tally.cpp b/src/USER-TALLY/compute_stress_tally.cpp index 2a0cbc8e4..58d42cd93 100644 --- a/src/USER-TALLY/compute_stress_tally.cpp +++ b/src/USER-TALLY/compute_stress_tally.cpp @@ -49,7 +49,7 @@ ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; + stress = nullptr; vector = new double[size_peratom_cols]; virial = new double[size_peratom_cols]; } @@ -68,7 +68,7 @@ ComputeStressTally::~ComputeStressTally() void ComputeStressTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute stress/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-UEF/fix_nh_uef.cpp b/src/USER-UEF/fix_nh_uef.cpp index f910caac5..e83350295 100644 --- a/src/USER-UEF/fix_nh_uef.cpp +++ b/src/USER-UEF/fix_nh_uef.cpp @@ -57,7 +57,7 @@ static const char cite_user_uef_package[] = * temp/pressure fixes ---------------------------------------------------------------------- */ FixNHUef::FixNHUef(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), uefbox(NULL) + FixNH(lmp, narg, arg), uefbox(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_uef_package); diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 59dba0d90..cb468fc3d 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -128,11 +128,11 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : if (filewriter) reset_vtk_data_containers(); - label = NULL; + label = nullptr; { // parallel vtp/vtu requires proc number to be preceded by underscore '_' - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { multiname_ex = new char[strlen(filename) + 16]; @@ -160,12 +160,12 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : nclusterprocs = nprocs; } - filecurrent = NULL; - domainfilecurrent = NULL; - parallelfilecurrent = NULL; - header_choice = NULL; - write_choice = NULL; - boxcorners = NULL; + filecurrent = nullptr; + domainfilecurrent = nullptr; + parallelfilecurrent = nullptr; + header_choice = nullptr; + write_choice = nullptr; + boxcorners = nullptr; } /* ---------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ void DumpVTK::init_style() { // default for element names = C - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[2]; @@ -880,7 +880,7 @@ void DumpVTK::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // filewriter = 1 = this proc writes to file @@ -939,13 +939,13 @@ void DumpVTK::write_data(int n, double *mybuf) void DumpVTK::setFileCurrent() { delete [] filecurrent; - filecurrent = NULL; + filecurrent = nullptr; char *filestar = filename; if (multiproc) { if (multiproc > 1) { // if dump_modify fileper or nfile was used delete [] multiname_ex; - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { int id; @@ -983,7 +983,7 @@ void DumpVTK::setFileCurrent() { // filename of domain box data file delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multiproc) { // remove '%' character char *ptr = strchr(filename,'%'); @@ -997,7 +997,7 @@ void DumpVTK::setFileCurrent() { *ptr = '\0'; sprintf(filestar,"%s_boundingBox.%s",domainfilecurrent,ptr+1); delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multifile == 0) { domainfilecurrent = new char[strlen(filestar) + 1]; @@ -1018,7 +1018,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } else { domainfilecurrent = new char[strlen(filecurrent) + 16]; char *ptr = strrchr(filecurrent,'.'); @@ -1030,7 +1030,7 @@ void DumpVTK::setFileCurrent() { // filename of parallel file if (multiproc && me == 0) { delete [] parallelfilecurrent; - parallelfilecurrent = NULL; + parallelfilecurrent = nullptr; // remove '%' character and add 'p' to file extension // -> string length stays the same @@ -1066,7 +1066,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } } @@ -1995,7 +1995,7 @@ int DumpVTK::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -2075,7 +2075,7 @@ int DumpVTK::modify_param(int narg, char **arg) if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; @@ -2094,9 +2094,9 @@ int DumpVTK::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; } nthresh = 0; return 2; diff --git a/src/USER-YAFF/angle_cross.cpp b/src/USER-YAFF/angle_cross.cpp index c45af1d19..69dac7f58 100644 --- a/src/USER-YAFF/angle_cross.cpp +++ b/src/USER-YAFF/angle_cross.cpp @@ -279,12 +279,12 @@ void AngleCross::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&kss[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/angle_mm3.cpp b/src/USER-YAFF/angle_mm3.cpp index 34de77267..d165a2d17 100644 --- a/src/USER-YAFF/angle_mm3.cpp +++ b/src/USER-YAFF/angle_mm3.cpp @@ -226,8 +226,8 @@ void AngleMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/bond_mm3.cpp b/src/USER-YAFF/bond_mm3.cpp index f5d5fed94..2c310c631 100644 --- a/src/USER-YAFF/bond_mm3.cpp +++ b/src/USER-YAFF/bond_mm3.cpp @@ -179,8 +179,8 @@ void BondMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_distharm.cpp b/src/USER-YAFF/improper_distharm.cpp index 37039b27e..757695c3c 100644 --- a/src/USER-YAFF/improper_distharm.cpp +++ b/src/USER-YAFF/improper_distharm.cpp @@ -257,8 +257,8 @@ void ImproperDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_sqdistharm.cpp b/src/USER-YAFF/improper_sqdistharm.cpp index ddc4d78c9..79245d341 100644 --- a/src/USER-YAFF/improper_sqdistharm.cpp +++ b/src/USER-YAFF/improper_sqdistharm.cpp @@ -257,8 +257,8 @@ void ImproperSQDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index 98fd31779..5508ffbfd 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -51,7 +51,7 @@ PairLJSwitch3CoulGaussLong::PairLJSwitch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -358,11 +358,11 @@ void PairLJSwitch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairLJSwitch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairLJSwitch3CoulGaussLong::write_restart_settings(FILE *fp) void PairLJSwitch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairLJSwitch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index e1ee0e0b9..d63f42cf3 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -51,7 +51,7 @@ PairMM3Switch3CoulGaussLong::PairMM3Switch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -360,11 +360,11 @@ void PairMM3Switch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairMM3Switch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairMM3Switch3CoulGaussLong::write_restart_settings(FILE *fp) void PairMM3Switch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairMM3Switch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index be77b8457..aa8488e86 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -41,10 +41,10 @@ using namespace voro; /* ---------------------------------------------------------------------- */ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), con_mono(NULL), con_poly(NULL), - radstr(NULL), voro(NULL), edge(NULL), sendvector(NULL), - rfield(NULL), tags(NULL), occvec(NULL), sendocc(NULL), - lroot(NULL), lnext(NULL), faces(NULL) + Compute(lmp, narg, arg), con_mono(nullptr), con_poly(nullptr), + radstr(nullptr), voro(nullptr), edge(nullptr), sendvector(nullptr), + rfield(nullptr), tags(nullptr), occvec(nullptr), sendocc(nullptr), + lroot(nullptr), lnext(nullptr), faces(nullptr) { int sgroup; @@ -56,16 +56,16 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : surface = VOROSURF_NONE; maxedge = 0; fthresh = ethresh = 0.0; - radstr = NULL; + radstr = nullptr; onlyGroup = false; occupation = false; - con_mono = NULL; - con_poly = NULL; - tags = NULL; + con_mono = nullptr; + con_poly = nullptr; + tags = nullptr; oldmaxtag = 0; - occvec = sendocc = lroot = lnext = NULL; - faces = NULL; + occvec = sendocc = lroot = lnext = nullptr; + faces = nullptr; int iarg = 3; while ( iargall(FLERR,"Compute voronoi/atom occupation requires an atom map, see atom_modify"); nmax = rmax = 0; - edge = rfield = sendvector = NULL; - voro = NULL; + edge = rfield = sendvector = nullptr; + voro = nullptr; if ( maxedge > 0 ) { vector_flag = 1; @@ -207,7 +207,7 @@ void ComputeVoronoi::compute_peratom() if (occupation) { // build cells only once int i, nall = atom->nlocal + atom->nghost; - if (con_mono==NULL && con_poly==NULL) { + if (con_mono==nullptr && con_poly==nullptr) { // generate the voronoi cell network for the initial structure buildCells(); @@ -218,7 +218,7 @@ void ComputeVoronoi::compute_peratom() // linked list structure for cell occupation count on the atoms oldnall= nall; memory->create(lroot,nall,"voronoi/atom:lroot"); // point to first atom index in cell (or -1 for empty cell) - lnext = NULL; + lnext = nullptr; lmax = 0; // build the occupation buffer. diff --git a/src/angle.cpp b/src/angle.cpp index 2796ae01b..4eedd7c69 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -36,10 +36,10 @@ Angle::Angle(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 56590d675..70779aa7b 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -174,7 +174,7 @@ void AngleHybrid::allocate() maxangle = new int[nstyles]; anglelist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxangle[m] = 0; - for (int m = 0; m < nstyles; m++) anglelist[m] = NULL; + for (int m = 0; m < nstyles; m++) anglelist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -358,7 +358,7 @@ void AngleHybrid::write_restart(FILE *fp) void AngleHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Angle*[nstyles]; keywords = new char*[nstyles]; @@ -367,10 +367,10 @@ void AngleHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_angle(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index e087b774e..9d8255e84 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -128,7 +128,7 @@ void AngleZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/atom.cpp b/src/atom.cpp index 49ff26276..a58e1e318 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -83,113 +83,113 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; nbonds = nangles = ndihedrals = nimpropers = 0; - firstgroupname = NULL; + firstgroupname = nullptr; sortfreq = 1000; nextsort = 0; userbinsize = 0.0; maxbin = maxnext = 0; - binhead = NULL; - next = permute = NULL; + binhead = nullptr; + next = permute = nullptr; // data structure with info on per-atom vectors/arrays nperatom = maxperatom = 0; - peratom = NULL; + peratom = nullptr; // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variables - tag = NULL; - type = mask = NULL; - image = NULL; - x = v = f = NULL; + tag = nullptr; + type = mask = nullptr; + image = nullptr; + x = v = f = nullptr; // charged and dipolar particles - q = NULL; - mu = NULL; + q = nullptr; + mu = nullptr; // finite-size particles - omega = angmom = torque = NULL; - radius = rmass = NULL; - ellipsoid = line = tri = body = NULL; + omega = angmom = torque = nullptr; + radius = rmass = nullptr; + ellipsoid = line = tri = body = nullptr; // molecular systems - molecule = NULL; - molindex = molatom = NULL; + molecule = nullptr; + molindex = molatom = nullptr; bond_per_atom = extra_bond_per_atom = 0; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; angle_per_atom = extra_angle_per_atom = 0; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; dihedral_per_atom = extra_dihedral_per_atom = 0; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; improper_per_atom = extra_improper_per_atom = 0; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; maxspecial = 1; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; // PERI package - vfrac = s0 = NULL; - x0 = NULL; + vfrac = s0 = nullptr; + x0 = nullptr; // SPIN package - sp = fm = fm_long = NULL; + sp = fm = fm_long = nullptr; // USER-EFF and USER-AWPMD packages - spin = NULL; - eradius = ervel = erforce = NULL; - ervelforce = NULL; - cs = csforce = vforce = NULL; - etag = NULL; + spin = nullptr; + eradius = ervel = erforce = nullptr; + ervelforce = nullptr; + cs = csforce = vforce = nullptr; + etag = nullptr; // USER-DPD package - uCond = uMech = uChem = uCG = uCGnew = NULL; - duChem = dpdTheta = NULL; + uCond = uMech = uChem = uCG = uCGnew = nullptr; + duChem = dpdTheta = nullptr; // USER-MESO package - cc = cc_flux = NULL; - edpd_temp = edpd_flux = edpd_cv = NULL; + cc = cc_flux = nullptr; + edpd_temp = edpd_flux = edpd_cv = nullptr; // USER-MESONT package - length = NULL; - buckling = NULL; - bond_nt = NULL; + length = nullptr; + buckling = nullptr; + bond_nt = nullptr; // USER-SMD package - contact_radius = NULL; - smd_data_9 = NULL; - smd_stress = NULL; - eff_plastic_strain = NULL; - eff_plastic_strain_rate = NULL; - damage = NULL; + contact_radius = nullptr; + smd_data_9 = nullptr; + smd_stress = nullptr; + eff_plastic_strain = nullptr; + eff_plastic_strain_rate = nullptr; + damage = nullptr; // USER-SPH package - rho = drho = esph = desph = cv = NULL; - vest = NULL; + rho = drho = esph = desph = cv = nullptr; + vest = nullptr; // end of customization section // -------------------------------------------------------------------- @@ -197,14 +197,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // user-defined molecules nmolecule = 0; - molecules = NULL; + molecules = nullptr; // custom atom arrays nivector = ndvector = 0; - ivector = NULL; - dvector = NULL; - iname = dname = NULL; + ivector = nullptr; + dvector = nullptr; + iname = dname = nullptr; // initialize atom style and array existence flags @@ -216,16 +216,16 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // ntype-length arrays - mass = NULL; - mass_setflag = NULL; + mass = nullptr; + mass_setflag = nullptr; // callback lists & extra restart info nextra_grow = nextra_restart = nextra_border = 0; - extra_grow = extra_restart = extra_border = NULL; + extra_grow = extra_restart = extra_border = nullptr; nextra_grow_max = nextra_restart_max = nextra_border_max = 0; nextra_store = 0; - extra = NULL; + extra = nullptr; // default atom ID and mapping values @@ -235,15 +235,15 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) map_maxarray = map_nhash = map_nbucket = -1; max_same = 0; - sametag = NULL; - map_array = NULL; - map_bucket = NULL; - map_hash = NULL; + sametag = nullptr; + map_array = nullptr; + map_bucket = nullptr; + map_hash = nullptr; unique_tags = nullptr; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; avec_map = new AtomVecCreatorMap(); @@ -288,7 +288,7 @@ Atom::~Atom() delete [] iname[i]; memory->destroy(ivector[i]); } - if (dvector != NULL) { + if (dvector != nullptr) { for (int i = 0; i < ndvector; i++) { delete [] dname[i]; memory->destroy(dvector[i]); @@ -352,7 +352,7 @@ void Atom::peratom_create() delete [] peratom[i].name; memory->sfree(peratom); - peratom = NULL; + peratom = nullptr; nperatom = maxperatom = 0; // -------------------------------------------------------------------- @@ -533,7 +533,7 @@ void Atom::add_peratom(const char *name, void *address, peratom[nperatom].datatype = datatype; peratom[nperatom].cols = cols; peratom[nperatom].threadflag = threadflag; - peratom[nperatom].address_length = NULL; + peratom[nperatom].address_length = nullptr; nperatom++; } @@ -629,8 +629,8 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu { delete [] atom_style; if (avec) delete avec; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; // unset atom style and array existence flags // may have been set by old avec @@ -702,7 +702,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag) } error->all(FLERR,utils::check_packages_for_style("atom",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -723,7 +723,7 @@ void Atom::init() if (nextra_store) { memory->destroy(extra); - extra = NULL; + extra = nullptr; nextra_store = 0; } @@ -756,7 +756,7 @@ void Atom::setup() /* ---------------------------------------------------------------------- return ptr to AtomVec class if matches style or to matching hybrid sub-class - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ AtomVec *Atom::style_match(const char *style) @@ -768,7 +768,7 @@ AtomVec *Atom::style_match(const char *style) if (strcmp(avec_hybrid->keywords[i],style) == 0) return avec_hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -807,7 +807,7 @@ void Atom::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command"); if (strcmp(arg[iarg+1],"all") == 0) { delete [] firstgroupname; - firstgroupname = NULL; + firstgroupname = nullptr; } else { int n = strlen(arg[iarg+1]) + 1; firstgroupname = new char[n]; @@ -983,33 +983,33 @@ void Atom::deallocate_topology() { memory->destroy(atom->bond_type); memory->destroy(atom->bond_atom); - atom->bond_type = NULL; - atom->bond_atom = NULL; + atom->bond_type = nullptr; + atom->bond_atom = nullptr; memory->destroy(atom->angle_type); memory->destroy(atom->angle_atom1); memory->destroy(atom->angle_atom2); memory->destroy(atom->angle_atom3); - atom->angle_type = NULL; - atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL; + atom->angle_type = nullptr; + atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = nullptr; memory->destroy(atom->dihedral_type); memory->destroy(atom->dihedral_atom1); memory->destroy(atom->dihedral_atom2); memory->destroy(atom->dihedral_atom3); memory->destroy(atom->dihedral_atom4); - atom->dihedral_type = NULL; + atom->dihedral_type = nullptr; atom->dihedral_atom1 = atom->dihedral_atom2 = - atom->dihedral_atom3 = atom->dihedral_atom4 = NULL; + atom->dihedral_atom3 = atom->dihedral_atom4 = nullptr; memory->destroy(atom->improper_type); memory->destroy(atom->improper_atom1); memory->destroy(atom->improper_atom2); memory->destroy(atom->improper_atom3); memory->destroy(atom->improper_atom4); - atom->improper_type = NULL; + atom->improper_type = nullptr; atom->improper_atom1 = atom->improper_atom2 = - atom->improper_atom3 = atom->improper_atom4 = NULL; + atom->improper_atom3 = atom->improper_atom4 = nullptr; } /* ---------------------------------------------------------------------- @@ -1108,11 +1108,11 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL," \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr," \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); } @@ -1195,7 +1195,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1210,7 +1210,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) /* ---------------------------------------------------------------------- process N bonds read into buf from data files - if count is non-NULL, just count bonds per atom + if count is non-nullptr, just count bonds per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1265,7 +1265,7 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N angles read into buf from data files - if count is non-NULL, just count angles per atom + if count is non-nullptr, just count angles per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1337,7 +1337,7 @@ void Atom::data_angles(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N dihedrals read into buf from data files - if count is non-NULL, just count diihedrals per atom + if count is non-nullptr, just count diihedrals per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1428,7 +1428,7 @@ void Atom::data_dihedrals(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N impropers read into buf from data files - if count is non-NULL, just count impropers per atom + if count is non-nullptr, just count impropers per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1547,7 +1547,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1577,8 +1577,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) int maxint = 0; int maxdouble = 0; - int *ivalues = NULL; - double *dvalues = NULL; + int *ivalues = nullptr; + double *dvalues = nullptr; if (!unique_tags) unique_tags = new std::set; @@ -1588,7 +1588,7 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) for (int i = 0; i < n; i++) { if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset; - else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset; + else tagdata = ATOTAGINT(strtok(nullptr," \t\n\r\f")) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) error->one(FLERR,"Invalid atom ID in Bodies section of data file"); @@ -1598,8 +1598,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) else error->one(FLERR,"Duplicate atom ID in Bodies section of data file"); - ninteger = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); - ndouble = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + ninteger = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); + ndouble = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); if ((m = map(tagdata)) >= 0) { if (ninteger > maxint) { @@ -1614,16 +1614,16 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) } for (j = 0; j < ninteger; j++) - ivalues[j] = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + ivalues[j] = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); for (j = 0; j < ndouble; j++) - dvalues[j] = utils::numeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + dvalues[j] = utils::numeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues); } else { nvalues = ninteger + ndouble; // number of values to skip for (j = 0; j < nvalues; j++) - strtok(NULL," \t\n\r\f"); + strtok(nullptr," \t\n\r\f"); } } @@ -1680,7 +1680,7 @@ void Atom::allocate_type_arrays() void Atom::set_mass(const char *file, int line, const char *str, int type_offset) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int itype; double mass_one; @@ -1704,7 +1704,7 @@ void Atom::set_mass(const char *file, int line, const char *str, int type_offset void Atom::set_mass(const char *file, int line, int itype, double value) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); if (itype < 1 || itype > ntypes) error->all(file,line,"Invalid type for mass set"); @@ -1721,7 +1721,7 @@ void Atom::set_mass(const char *file, int line, int itype, double value) void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int lo,hi; utils::bounds(file,line,arg[0],1,ntypes,lo,hi,error); @@ -1754,7 +1754,7 @@ void Atom::set_mass(double *values) void Atom::check_mass(const char *file, int line) { - if (mass == NULL) return; + if (mass == nullptr) return; if (rmass_flag) return; for (int itype = 1; itype <= ntypes; itype++) if (mass_setflag[itype] == 0) @@ -1864,7 +1864,7 @@ void Atom::add_molecule(int narg, char **arg) int Atom::find_molecule(char *id) { - if(id == NULL) return -1; + if(id == nullptr) return -1; int imol; for (imol = 0; imol < nmolecule; imol++) if (strcmp(id,molecules[imol]->id) == 0) return imol; @@ -2201,14 +2201,14 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find NULL ptr: + // if find nullptr ptr: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find NULL ptr: + // if don't find nullptr ptr: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix] == NULL) break; + if (modify->fix[ifix] == nullptr) break; // add callback to lists and sort, reallocating if necessary // sorting is required in cases where fixes were replaced as it ensures atom @@ -2249,7 +2249,7 @@ void Atom::add_callback(int flag) void Atom::delete_callback(const char *id, int flag) { - if (id == NULL) return; + if (id == nullptr) return; int ifix = modify->find_fix(id); @@ -2310,7 +2310,7 @@ void Atom::update_callback(int ifix) int Atom::find_custom(const char *name, int &flag) { - if(name == NULL) return -1; + if(name == nullptr) return -1; for (int i = 0; i < nivector; i++) if (iname[i] && strcmp(iname[i],name) == 0) { @@ -2374,7 +2374,7 @@ int Atom::add_custom(const char *name, int flag) \verbatim embed:rst This will remove a property that was requested e.g. by the :doc:`fix property/atom ` command. It frees the -allocated memory and sets the pointer to ``NULL`` to the entry in +allocated memory and sets the pointer to ``nullptr`` to the entry in the list can be reused. The lists of those pointers will never be compacted or never shrink, so that index to name mappings remain valid. \endverbatim @@ -2386,14 +2386,14 @@ void Atom::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { memory->destroy(dvector[index]); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } @@ -2483,7 +2483,7 @@ length of the data area, and a short description. * - rmass - double - 1 - - per-atom mass of the particles. ``NULL`` if per-type masses are + - per-atom mass of the particles. ``nullptr`` if per-type masses are used. See the :cpp:func:`rmass_flag` setting. * - ellipsoid - int @@ -2506,7 +2506,7 @@ length of the data area, and a short description. * * \param name string with the keyword of the desired property. Typically the name of the pointer variable returned - * \return pointer to the requested data cast to ``void *`` or NULL */ + * \return pointer to the requested data cast to ``void *`` or nullptr */ void *Atom::extract(char *name) { @@ -2577,7 +2577,7 @@ void *Atom::extract(char *name) // end of customization section // -------------------------------------------------------------------- - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/atom.h b/src/atom.h index 21b9c06f8..841d224d2 100644 --- a/src/atom.h +++ b/src/atom.h @@ -55,7 +55,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, NULL if unset + char *firstgroupname; // group-ID to store first, nullptr if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable diff --git a/src/atom_map.cpp b/src/atom_map.cpp index 02b97a113..45808d086 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -323,18 +323,18 @@ int Atom::map_style_set() void Atom::map_delete() { memory->destroy(sametag); - sametag = NULL; + sametag = nullptr; max_same = 0; if (map_style == 1) { memory->destroy(map_array); - map_array = NULL; + map_array = nullptr; } else { if (map_nhash) { delete [] map_bucket; delete [] map_hash; - map_bucket = NULL; - map_hash = NULL; + map_bucket = nullptr; + map_hash = nullptr; } map_nhash = map_nbucket = 0; } diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 4a00e5852..8dcec3a78 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -2060,7 +2060,7 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf) } /* ---------------------------------------------------------------------- - pack bond info for data file into buf if non-NULL + pack bond info for data file into buf if non-nullptr return count of bonds from this proc do not count/pack bonds with bondtype = 0 if bondtype is negative, flip back to positive @@ -2118,7 +2118,7 @@ void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index) } /* ---------------------------------------------------------------------- - pack angle info for data file into buf if non-NULL + pack angle info for data file into buf if non-nullptr return count of angles from this proc do not count/pack angles with angletype = 0 if angletype is negative, flip back to positive diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index e9044519c..9f5ec26cc 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -49,9 +49,9 @@ AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) atom->radius_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; - bptr = NULL; + bptr = nullptr; if (sizeof(double) == sizeof(int)) intdoubleratio = 1; else if (sizeof(double) == 2*sizeof(int)) intdoubleratio = 2; @@ -104,7 +104,7 @@ void AtomVecBody::process_args(int narg, char **arg) if (narg < 1) error->all(FLERR,"Invalid atom_style body command"); - if (0) bptr = NULL; + if (0) bptr = nullptr; #define BODY_CLASS #define BodyStyle(key,Class) \ @@ -582,7 +582,7 @@ void AtomVecBody::pack_data_pre(int ilocal) /* ---------------------------------------------------------------------- pack bonus body info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecBody::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index c22111f48..e673ac295 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -46,7 +46,7 @@ AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp) atom->rmass_flag = atom->angmom_flag = atom->torque_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -484,7 +484,7 @@ void AtomVecEllipsoid::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus ellipsoid info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecEllipsoid::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7a8c73570..e343bcbdb 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -30,13 +30,13 @@ enum{ELLIPSOID,LINE,TRIANGLE,BODY}; // also in WriteData AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp) : AtomVec(lmp) { nstyles = 0; - styles = NULL; - keywords = NULL; - fieldstrings = NULL; + styles = nullptr; + keywords = nullptr; + fieldstrings = nullptr; bonus_flag = 0; nstyles_bonus = 0; - styles_bonus = NULL; + styles_bonus = nullptr; // these strings will be concatenated from sub-style strings // fields_data_atom & fields_data_vel start with fields common to all styles @@ -187,7 +187,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) // save concat_grow to check for duplicates of special-case fields char *concat_grow;; - char *null = NULL; + char *null = nullptr; fields_grow = merge_fields(0,fields_grow,1,concat_grow); fields_copy = merge_fields(1,fields_copy,0,null); diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 88dcb8c2f..8776c33e5 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -47,7 +47,7 @@ AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -457,7 +457,7 @@ void AtomVecLine::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus line info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e391a7321..abcd628e5 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -49,7 +49,7 @@ AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -688,7 +688,7 @@ void AtomVecTri::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus tri info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/balance.cpp b/src/balance.cpp index af8d90481..494d43cf8 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -52,17 +52,17 @@ Balance::Balance(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - user_xsplit = user_ysplit = user_zsplit = NULL; + user_xsplit = user_ysplit = user_zsplit = nullptr; shift_allocate = 0; - proccost = allproccost = NULL; + proccost = allproccost = nullptr; - rcb = NULL; + rcb = nullptr; nimbalance = 0; - imbalances = NULL; - fixstore = NULL; + imbalances = nullptr; + fixstore = nullptr; - fp = NULL; + fp = nullptr; firststep = 1; } @@ -97,7 +97,7 @@ Balance::~Balance() // check nfix in case all fixes have already been deleted if (fixstore && modify->nfix) modify->delete_fix(fixstore->id); - fixstore = NULL; + fixstore = nullptr; if (fp) fclose(fp); } @@ -246,7 +246,7 @@ void Balance::command(int narg, char **arg) // process remaining optional args options(iarg,narg,arg); - if (wtflag) weight_storage(NULL); + if (wtflag) weight_storage(nullptr); // insure particles are in current box & update box via shrink-wrap // init entire system since comm->setup is done @@ -425,7 +425,7 @@ void Balance::options(int iarg, int narg, char **arg) oldrcb = 0; outflag = 0; int outarg = 0; - fp = NULL; + fp = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"weight") == 0) { @@ -473,7 +473,7 @@ void Balance::options(int iarg, int narg, char **arg) if (outflag && comm->me == 0) { fp = fopen(arg[outarg],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open (fix) balance output file {}: {}", arg[outarg], utils::getsyserror())); } @@ -639,12 +639,12 @@ int *Balance::bisection(int sortflag) if (wtflag) { weight = fixstore->vstore; rcb->compute_old(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute_old(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute_old(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } else { if (wtflag) { weight = fixstore->vstore; rcb->compute(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } if (triclinic) domain->lamda2x(nlocal); @@ -1273,7 +1273,7 @@ void Balance::dumpout(bigint tstep) void Balance::debug_shift_output(int idim, int m, int np, double *split) { int i; - const char *dim = NULL; + const char *dim = nullptr; double *boxlo = domain->boxlo; double *prd = domain->prd; diff --git a/src/body.cpp b/src/body.cpp index c0e58d3f4..9bc0bfc04 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -23,8 +23,8 @@ Body::Body(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) int n = strlen(arg[0]) + 1; style = new char[n]; strcpy(style,arg[0]); - icp = NULL; - dcp = NULL; + icp = nullptr; + dcp = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/bond.cpp b/src/bond.cpp index 1f953bbd1..1ff701713 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -44,9 +44,9 @@ Bond::Bond(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -276,7 +276,7 @@ void Bond::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -284,7 +284,7 @@ void Bond::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by bond_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open bond_write file {}: {}", arg[4], utils::getsyserror())); } diff --git a/src/bond.h b/src/bond.h index 8d7585b38..5406aa3f0 100644 --- a/src/bond.h +++ b/src/bond.h @@ -52,7 +52,7 @@ class Bond : protected Pointers { virtual void write_data(FILE *) {} virtual double single(int, double, int, int, double &) = 0; virtual double memory_usage(); - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void reinit(); void write_file(int, char**); diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index b42683c30..46eeab580 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -166,7 +166,7 @@ void BondHybrid::allocate() maxbond = new int[nstyles]; bondlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxbond[m] = 0; - for (int m = 0; m < nstyles; m++) bondlist[m] = NULL; + for (int m = 0; m < nstyles; m++) bondlist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -351,7 +351,7 @@ void BondHybrid::write_restart(FILE *fp) void BondHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Bond*[nstyles]; keywords = new char*[nstyles]; @@ -360,10 +360,10 @@ void BondHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_bond(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index 71146ec4d..06e554916 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -126,7 +126,7 @@ void BondZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -157,5 +157,5 @@ void *BondZero::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/citeme.cpp b/src/citeme.cpp index c8745891c..b638eaf47 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -28,7 +28,7 @@ static const char cite_nagline[] = "\nPlease see the log.cite file " CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; cs = new citeset(); } diff --git a/src/comm.cpp b/src/comm.cpp index 7b351e12f..becb52df9 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -57,15 +57,15 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) mode = 0; bordergroup = 0; cutghostuser = 0.0; - cutusermulti = NULL; + cutusermulti = nullptr; ghost_velocity = 0; user_procgrid[0] = user_procgrid[1] = user_procgrid[2] = 0; coregrid[0] = coregrid[1] = coregrid[2] = 1; gridflag = ONELEVEL; mapflag = CART; - customfile = NULL; - outfile = NULL; + customfile = nullptr; + outfile = nullptr; recv_from_partition = send_to_partition = -1; otherflag = 0; @@ -73,8 +73,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) maxexchange_fix_dynamic = 0; bufextra = BUFEXTRA; - grid2proc = NULL; - xsplit = ysplit = zsplit = NULL; + grid2proc = nullptr; + xsplit = ysplit = zsplit = nullptr; rcbnew = 0; // use of OpenMP threads @@ -88,7 +88,7 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) #ifdef _OPENMP if (lmp->kokkos) { nthreads = lmp->kokkos->nthreads * lmp->kokkos->numa; - } else if (getenv("OMP_NUM_THREADS") == NULL) { + } else if (getenv("OMP_NUM_THREADS") == nullptr) { nthreads = 1; if (me == 0) error->message(FLERR,"OMP_NUM_THREADS environment is not set. " @@ -276,7 +276,7 @@ void Comm::modify_params(int narg, char **arg) // need to reset cutghostuser when switching comm mode if (mode == Comm::MULTI) cutghostuser = 0.0; memory->destroy(cutusermulti); - cutusermulti = NULL; + cutusermulti = nullptr; mode = Comm::SINGLE; } else if (strcmp(arg[iarg+1],"multi") == 0) { // need to reset cutghostuser when switching comm mode @@ -289,7 +289,7 @@ void Comm::modify_params(int narg, char **arg) bordergroup = group->find(arg[iarg+1]); if (bordergroup < 0) error->all(FLERR,"Invalid group in comm_modify command"); - if (bordergroup && (atom->firstgroupname == NULL || + if (bordergroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR,"Comm_modify group != atom_modify first group"); iarg += 2; @@ -313,7 +313,7 @@ void Comm::modify_params(int narg, char **arg) const int ntypes = atom->ntypes; if (iarg+3 > narg) error->all(FLERR,"Illegal comm_modify command"); - if (cutusermulti == NULL) { + if (cutusermulti == nullptr) { memory->create(cutusermulti,ntypes+1,"comm:cutusermulti"); for (i=0; i < ntypes+1; ++i) cutusermulti[i] = -1.0; @@ -770,7 +770,7 @@ int Comm::binary(double value, int n, double *vec) callback() is invoked to allow caller to process/update each proc's inbuf if self=1 (default), then callback() is invoked on final iteration using original inbuf, which may have been updated - for non-NULL outbuf, final updated inbuf is copied to it + for non-nullptr outbuf, final updated inbuf is copied to it ok to specify outbuf = inbuf the ptr argument is a pointer to the instance of calling class ------------------------------------------------------------------------- */ @@ -792,7 +792,7 @@ void Comm::ring(int n, int nper, void *inbuf, int messtag, // sanity check - if ((nbytes > 0) && inbuf == NULL) + if ((nbytes > 0) && inbuf == nullptr) error->one(FLERR,"Cannot put data on ring from NULL pointer"); char *buf,*bufcopy; @@ -888,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -925,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -967,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1032,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1074,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1135,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/comm.h b/src/comm.h index 1743436e2..7ba79843d 100644 --- a/src/comm.h +++ b/src/comm.h @@ -118,7 +118,7 @@ class Comm : protected Pointers { int read_lines_from_file_universe(FILE *, int, int, char *); // extract data useful to other classes - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} protected: int bordergroup; // only communicate this group in borders @@ -242,7 +242,7 @@ E: Processor count in z must be 1 for 2d simulation Self-explanatory. -E: Cannot put data on ring from NULL pointer +E: Cannot put data on ring from nullptr pointer W: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 37a4f0ae3..bce069fb3 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -41,17 +41,17 @@ using namespace LAMMPS_NS; CommBrick::CommBrick(LAMMPS *lmp) : Comm(lmp), - sendnum(NULL), recvnum(NULL), sendproc(NULL), recvproc(NULL), - size_forward_recv(NULL), - size_reverse_send(NULL), size_reverse_recv(NULL), - slablo(NULL), slabhi(NULL), multilo(NULL), multihi(NULL), - cutghostmulti(NULL), pbc_flag(NULL), pbc(NULL), firstrecv(NULL), - sendlist(NULL), localsendlist(NULL), maxsendlist(NULL), - buf_send(NULL), buf_recv(NULL) + sendnum(nullptr), recvnum(nullptr), sendproc(nullptr), recvproc(nullptr), + size_forward_recv(nullptr), + size_reverse_send(nullptr), size_reverse_recv(nullptr), + slablo(nullptr), slabhi(nullptr), multilo(nullptr), multihi(nullptr), + cutghostmulti(nullptr), pbc_flag(nullptr), pbc(nullptr), firstrecv(nullptr), + sendlist(nullptr), localsendlist(nullptr), maxsendlist(nullptr), + buf_send(nullptr), buf_recv(nullptr) { style = 0; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; + pbc_flag = nullptr; init_buffers(); } @@ -98,10 +98,10 @@ CommBrick::CommBrick(LAMMPS * /*lmp*/, Comm *oldcomm) : Comm(*oldcomm) void CommBrick::init_buffers() { - multilo = multihi = NULL; - cutghostmulti = NULL; + multilo = multihi = nullptr; + cutghostmulti = nullptr; - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); @@ -130,7 +130,7 @@ void CommBrick::init() // memory for multi-style communication - if (mode == Comm::MULTI && multilo == NULL) { + if (mode == Comm::MULTI && multilo == nullptr) { allocate_multi(maxswap); memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti"); } @@ -1463,7 +1463,7 @@ void CommBrick::free_multi() { memory->destroy(multilo); memory->destroy(multihi); - multilo = multihi = NULL; + multilo = multihi = nullptr; } /* ---------------------------------------------------------------------- @@ -1492,7 +1492,7 @@ void *CommBrick::extract(const char *str, int &dim) return (void *) localsendlist; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 48c9680d2..cb236fd72 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -47,12 +47,12 @@ CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp) { style = 1; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; - buf_send = NULL; - buf_recv = NULL; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; + pbc_flag = nullptr; + buf_send = nullptr; + buf_recv = nullptr; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; init_buffers(); } @@ -89,16 +89,16 @@ CommTiled::~CommTiled() void CommTiled::init_buffers() { - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); maxoverlap = 0; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; - sendbox_multi = NULL; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; + sendbox_multi = nullptr; maxswap = 6; allocate_swap(maxswap); @@ -2085,22 +2085,22 @@ void CommTiled::allocate_swap(int n) sendlist = new int**[n]; for (int i = 0; i < n; i++) { - sendproc[i] = recvproc[i] = NULL; - sendnum[i] = recvnum[i] = NULL; - size_forward_recv[i] = firstrecv[i] = NULL; - size_reverse_send[i] = size_reverse_recv[i] = NULL; - forward_recv_offset[i] = reverse_recv_offset[i] = NULL; - - pbc_flag[i] = NULL; - pbc[i] = NULL; - sendbox[i] = NULL; - sendbox_multi[i] = NULL; - maxsendlist[i] = NULL; - sendlist[i] = NULL; + sendproc[i] = recvproc[i] = nullptr; + sendnum[i] = recvnum[i] = nullptr; + size_forward_recv[i] = firstrecv[i] = nullptr; + size_reverse_send[i] = size_reverse_recv[i] = nullptr; + forward_recv_offset[i] = reverse_recv_offset[i] = nullptr; + + pbc_flag[i] = nullptr; + pbc[i] = nullptr; + sendbox[i] = nullptr; + sendbox_multi[i] = nullptr; + maxsendlist[i] = nullptr; + sendlist[i] = nullptr; } maxrequest = 0; - requests = NULL; + requests = nullptr; for (int i = 0; i < n; i++) { nprocmax[i] = DELTA_PROCS; diff --git a/src/compute.cpp b/src/compute.cpp index 4cde9ff56..bd07b0c6d 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -37,10 +37,10 @@ int Compute::instance_total = 0; Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp), - id(NULL), style(NULL), - vector(NULL), array(NULL), vector_atom(NULL), - array_atom(NULL), vector_local(NULL), array_local(NULL), extlist(NULL), - tlist(NULL), vbiasall(NULL) + id(nullptr), style(nullptr), + vector(nullptr), array(nullptr), vector_atom(nullptr), + array_atom(nullptr), vector_local(nullptr), array_local(nullptr), extlist(nullptr), + tlist(nullptr), vbiasall(nullptr) { instance_me = instance_total++; diff --git a/src/compute_adf.cpp b/src/compute_adf.cpp index 5d55f1fbb..e0213872d 100644 --- a/src/compute_adf.cpp +++ b/src/compute_adf.cpp @@ -43,18 +43,18 @@ enum{DEGREE, RADIAN, COSINE}; ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), klo(NULL), khi(NULL), - hist(NULL), histall(NULL), - rcutinnerj(NULL), rcutinnerk(NULL), - rcutouterj(NULL), rcutouterk(NULL), - list(NULL), - iatomcount(NULL), iatomcountall(NULL), iatomflag(NULL), - maxjatom(NULL), maxkatom(NULL), - numjatom(NULL), numkatom(NULL), - neighjatom(NULL),neighkatom(NULL), - jatomflag(NULL), katomflag(NULL), - maxjkatom(NULL), numjkatom(NULL), - neighjkatom(NULL), bothjkatom(NULL), delrjkatom(NULL) + ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), klo(nullptr), khi(nullptr), + hist(nullptr), histall(nullptr), + rcutinnerj(nullptr), rcutinnerk(nullptr), + rcutouterj(nullptr), rcutouterk(nullptr), + list(nullptr), + iatomcount(nullptr), iatomcountall(nullptr), iatomflag(nullptr), + maxjatom(nullptr), maxkatom(nullptr), + numjatom(nullptr), numkatom(nullptr), + neighjatom(nullptr),neighkatom(nullptr), + jatomflag(nullptr), katomflag(nullptr), + maxjkatom(nullptr), numjkatom(nullptr), + neighjkatom(nullptr), bothjkatom(nullptr), delrjkatom(nullptr) { int nargsperadf = 7; diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index 6b6f376b4..97f8c6ff9 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -40,7 +40,7 @@ using namespace LAMMPS_NS; ComputeAggregateAtom::ComputeAggregateAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - aggregateID(NULL) + aggregateID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute aggregate/atom command"); @@ -71,10 +71,10 @@ void ComputeAggregateAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute aggregate/atom unless atoms have IDs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Compute aggregate/atom requires a bond style to be defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index e3e44efbb..83daeedb9 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeAngle::ComputeAngle(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute angle command"); diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index b100824ea..8f9f728cf 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -38,7 +38,7 @@ enum{THETA,ENG,VARIABLE}; ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), tstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), tstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute angle/local command"); @@ -77,7 +77,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - tstr = NULL; + tstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -123,8 +123,8 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ ComputeAngleLocal::~ComputeAngleLocal() void ComputeAngleLocal::init() { - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"No angle style is defined for compute angle/local"); if (nvar) { diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 6c9f1d65a..eb22dcee5 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), angmom(nullptr), angmomall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute angmom/chunk command"); diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 503582bc6..f7c420685 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeBond::ComputeBond(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute bond command"); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 010e8db62..c201a9886 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -39,7 +39,7 @@ enum{DIST,VELVIB,OMEGA,ENGTRANS,ENGVIB,ENGROT,ENGPOT,FORCE,FX,FY,FZ,VARIABLE}; ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), dstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), dstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute bond/local command"); @@ -84,7 +84,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - dstr = NULL; + dstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -142,8 +142,8 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeBondLocal::~ComputeBondLocal() void ComputeBondLocal::init() { - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"No bond style is defined for compute bond/local"); if (nvar) { diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index f88dea9eb..af32a8e9a 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), centro(NULL) + distsq(nullptr), nearest(nullptr), centro(nullptr) { if (narg < 4 || narg > 6) error->all(FLERR,"Illegal compute centro/atom command"); @@ -88,7 +88,7 @@ ComputeCentroAtom::~ComputeCentroAtom() void ComputeCentroAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute centro/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 7c979c66d..499d90345 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute centroid/stress/atom command"); @@ -49,7 +49,7 @@ ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -237,7 +237,7 @@ void ComputeCentroidStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index d0044410d..7fe9394b4 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -54,10 +54,10 @@ enum{LIMITMAX,LIMITEXACT}; ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL), - cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL), - varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL), - exclude(NULL), hash(NULL) + chunk_volume_vec(nullptr), coord(nullptr), ichunk(nullptr), chunkID(nullptr), + cfvid(nullptr), idregion(nullptr), region(nullptr), cchunk(nullptr), fchunk(nullptr), + varatom(nullptr), id_fix(nullptr), fixstore(nullptr), lockfix(nullptr), chunk(nullptr), + exclude(nullptr), hash(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command"); @@ -73,7 +73,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : binflag = 0; ncoord = 0; - cfvid = NULL; + cfvid = nullptr; if (strcmp(arg[3],"bin/1d") == 0) { binflag = 1; @@ -177,7 +177,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // optional args regionflag = 0; - idregion = NULL; + idregion = nullptr; nchunksetflag = 0; nchunkflag = EVERY; limit = 0; @@ -448,16 +448,16 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // initialize chunk vector and per-chunk info nmax = 0; - chunk = NULL; + chunk = nullptr; nmaxint = -1; - ichunk = NULL; - exclude = NULL; + ichunk = nullptr; + exclude = nullptr; nchunk = 0; chunk_volume_scalar = 1.0; - chunk_volume_vec = NULL; - coord = NULL; - chunkID = NULL; + chunk_volume_vec = nullptr; + coord = nullptr; + chunkID = nullptr; // computeflag = 1 if this compute might invoke another compute // during assign_chunk_ids() @@ -470,17 +470,17 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : invoked_setup = -1; invoked_ichunk = -1; - id_fix = NULL; - fixstore = NULL; + id_fix = nullptr; + fixstore = nullptr; if (compress) hash = new std::map(); - else hash = NULL; + else hash = nullptr; maxvar = 0; - varatom = NULL; + varatom = nullptr; lockcount = 0; - lockfix = NULL; + lockfix = nullptr; if (which == MOLECULE) molcheck = 1; else molcheck = 0; @@ -593,7 +593,7 @@ void ComputeChunkAtom::init() if ((idsflag != ONCE && !lockcount) && fixstore) { modify->delete_fix(id_fix); - fixstore = NULL; + fixstore = nullptr; } } @@ -665,7 +665,7 @@ double ComputeChunkAtom::compute_scalar() void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) { - if (lockfix == NULL) { + if (lockfix == nullptr) { lockfix = fixptr; lockstart = startstep; lockstop = stopstep; @@ -689,7 +689,7 @@ void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) void ComputeChunkAtom::unlock(Fix *fixptr) { if (fixptr != lockfix) return; - lockfix = NULL; + lockfix = nullptr; } /* ---------------------------------------------------------------------- @@ -1049,7 +1049,7 @@ void ComputeChunkAtom::compress_chunk_ids() // create my list of populated IDs - int *list = NULL; + int *list = nullptr; memory->create(list,n,"chunk/atom:list"); n = 0; @@ -1094,7 +1094,7 @@ void ComputeChunkAtom::compress_chunk_ids() memory->destroy(listall); } else { - comm->ring(n,sizeof(int),list,1,idring,NULL,(void *)this,0); + comm->ring(n,sizeof(int),list,1,idring,nullptr,(void *)this,0); } memory->destroy(list); diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 98a3ea9a2..14c86383b 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // NULL if no lock currently in place + // nullptr if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 953ae3a8c..b3b57d75d 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -37,7 +37,7 @@ enum{COMPUTE,FIX}; ComputeChunkSpreadAtom:: ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), ids(NULL), which(NULL), argindex(NULL), value2index(NULL) + idchunk(nullptr), ids(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute chunk/spread/atom command"); @@ -68,7 +68,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0) { @@ -161,8 +161,8 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom vector or array nmax = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index 8086ef3f4..fa31e738b 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -37,7 +37,7 @@ enum{CLUSTER,MASK,COORDS}; ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - clusterID(NULL) + clusterID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command"); @@ -64,7 +64,7 @@ void ComputeClusterAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute cluster/atom unless atoms have IDs"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index e9b6f1699..9a7a9b5d1 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -44,7 +44,7 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND}; ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), pattern(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), pattern(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command"); @@ -71,7 +71,7 @@ ComputeCNAAtom::~ComputeCNAAtom() void ComputeCNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cna/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR,"Compute cna/atom cutoff is longer than pairwise cutoff"); diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 8398311a0..39ea6cfa8 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -31,7 +31,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) + idchunk(nullptr), masstotal(nullptr), massproc(nullptr), com(nullptr), comall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index 7a288afb4..11f0c1489 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - contact(NULL) + contact(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command"); @@ -57,7 +57,7 @@ ComputeContactAtom::~ComputeContactAtom() void ComputeContactAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute contact/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index cb919d3a8..05d299fa2 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -38,8 +38,8 @@ using namespace LAMMPS_NS; ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - typelo(NULL), typehi(NULL), cvec(NULL), carray(NULL), - group2(NULL), id_orientorder(NULL), normv(NULL) + typelo(nullptr), typehi(nullptr), cvec(nullptr), carray(nullptr), + group2(nullptr), id_orientorder(nullptr), normv(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute coord/atom command"); @@ -147,7 +147,7 @@ void ComputeCoordAtom::init() "option in compute orientorder/atom"); } - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute coord/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index 8853887f1..64d9c8b37 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeDihedral::ComputeDihedral(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dihedral command"); diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index ac2c884c3..d1ff05194 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -38,7 +38,7 @@ enum{PHI,VARIABLE}; ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), pstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), pstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command"); @@ -74,7 +74,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - pstr = NULL; + pstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -122,8 +122,8 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -145,7 +145,7 @@ ComputeDihedralLocal::~ComputeDihedralLocal() void ComputeDihedralLocal::init() { - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"No dihedral style is defined for compute dihedral/local"); if (nvar) { diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 361ee36c1..f387786b8 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -34,9 +34,9 @@ enum { MASSCENTER, GEOMCENTER }; ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), chrgproc(NULL), - chrgtotal(NULL), com(NULL), - comall(NULL), dipole(NULL), dipoleall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), chrgproc(nullptr), + chrgtotal(nullptr), com(nullptr), + comall(nullptr), dipole(nullptr), dipoleall(nullptr) { if ((narg != 4) && (narg != 5)) error->all(FLERR,"Illegal compute dipole/chunk command"); diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 4b194cfab..bd939f140 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - displace(NULL), id_fix(NULL) + displace(nullptr), id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute displace/atom command"); @@ -44,7 +44,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // optional args refreshflag = 0; - rvar = NULL; + rvar = nullptr; int iarg = 3; while (iarg < narg) { @@ -102,7 +102,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom displacement array nmax = nvmax = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index 78664a912..d3f0d723c 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeErotateSphereAtom:: ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - erot(NULL) + erot(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere//atom command"); diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index db003c93e..85497bce0 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - fragmentID(NULL) + fragmentID(nullptr) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Compute fragment/atom used when bonds are not allowed"); @@ -61,9 +61,9 @@ ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - stack = NULL; - clist = NULL; - markflag = NULL; + stack = nullptr; + clist = nullptr; + markflag = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index b3e4f88bf..03d9ba4ec 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -39,8 +39,8 @@ enum{VECTOR,ARRAY}; ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idref(NULL), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - indices(NULL), varatom(NULL), vecglobal(NULL) + idref(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + indices(nullptr), varatom(nullptr), vecglobal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute global/atom command"); @@ -96,7 +96,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || strncmp(arg[iarg],"v_",2) == 0) { @@ -234,8 +234,8 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = nvalues; nmax = maxvector = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index ca0483fce..90956c6b1 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -45,7 +45,7 @@ enum{OFF,INTER,INTRA}; ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute group/group command"); @@ -122,15 +122,15 @@ void ComputeGroupGroup::init() // if non-hybrid, then error if single_enable = 0 // if hybrid, let hybrid determine if sub-style sets single_enable = 0 - if (pairflag && force->pair == NULL) + if (pairflag && force->pair == nullptr) error->all(FLERR,"No pair style defined for compute group/group"); - if (force->pair_match("^hybrid",0) == NULL + if (force->pair_match("^hybrid",0) == nullptr && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute group/group"); // error if Kspace style does not compute group/group interactions - if (kspaceflag && force->kspace == NULL) + if (kspaceflag && force->kspace == nullptr) error->all(FLERR,"No Kspace style defined for compute group/group"); if (kspaceflag && force->kspace->group_group_enable == 0) error->all(FLERR,"Kspace style does not support compute group/group"); @@ -138,10 +138,10 @@ void ComputeGroupGroup::init() if (pairflag) { pair = force->pair; cutsq = force->pair->cutsq; - } else pair = NULL; + } else pair = nullptr; if (kspaceflag) kspace = force->kspace; - else kspace = NULL; + else kspace = nullptr; // compute Kspace correction terms diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index ad0520bc0..f7e7c8ced 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -29,8 +29,8 @@ using namespace LAMMPS_NS; ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - rg(NULL), rgall(NULL), rgt(NULL), rgtall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + rg(nullptr), rgall(nullptr), rgt(nullptr), rgtall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute gyration/chunk command"); diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index 15a17949e..bcb10c833 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_ke(NULL), id_pe(NULL), id_stress(NULL) + id_ke(nullptr), id_pe(nullptr), id_stress(nullptr) { if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command"); diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index 00f81dc84..736a7e64c 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -45,7 +45,7 @@ using namespace MathConst; ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), qnarray(NULL) + distsq(nullptr), nearest(nullptr), qnarray(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute hexorder/atom command"); @@ -104,7 +104,7 @@ ComputeHexOrderAtom::~ComputeHexOrderAtom() void ComputeHexOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute hexorder/atom requires a pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; else if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 3721dbfd4..aa65bde66 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute improper command"); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index e363749b6..4d230cd1e 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -35,7 +35,7 @@ using namespace MathConst; ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL) + vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute improper/local command"); @@ -57,8 +57,8 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ ComputeImproperLocal::~ComputeImproperLocal() void ComputeImproperLocal::init() { - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"No improper style is defined for compute improper/local"); // do initial memory allocation so that memory_usage() is correct @@ -135,7 +135,7 @@ int ComputeImproperLocal::compute_impropers(int flag) if (cflag >= 0) cbuf = vlocal; } else { if (cflag >= 0 && alocal) cbuf = &alocal[0][cflag]; - else cbuf = NULL; + else cbuf = nullptr; } } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index 65de1d7bb..ba7c4f36f 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -28,8 +28,8 @@ using namespace LAMMPS_NS; ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - inertia(NULL), inertiaall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + inertia(nullptr), inertiaall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command"); diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index 102d6364f..65b3140d7 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ke(NULL) + ke(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command"); diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index d23c389ab..41ffa95fe 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute msd command"); diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index b0e2520f9..2c3c2811d 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), id_fix(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), msd(NULL) + idchunk(nullptr), id_fix(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), msd(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command"); diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 4151b2cdb..40f13f748 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -31,8 +31,8 @@ using namespace LAMMPS_NS; ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL), - inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL) + idchunk(nullptr),massproc(nullptr),masstotal(nullptr),com(nullptr),comall(nullptr), + inertia(nullptr),inertiaall(nullptr),angmom(nullptr),angmomall(nullptr),omega(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command"); diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 7323b6ef0..e76081e0b 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -49,8 +49,8 @@ using namespace MathConst; ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - qlist(NULL), distsq(NULL), nearest(NULL), rlist(NULL), - qnarray(NULL), qnm_r(NULL), qnm_i(NULL), cglist(NULL) + qlist(nullptr), distsq(nullptr), nearest(nullptr), rlist(nullptr), + qnarray(nullptr), qnm_r(nullptr), qnm_i(nullptr), cglist(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute orientorder/atom command"); @@ -186,7 +186,7 @@ ComputeOrientOrderAtom::~ComputeOrientOrderAtom() void ComputeOrientOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute orientorder/atom requires a " "pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index 7ace5615a..15b5bec19 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -28,7 +28,7 @@ enum{EPAIR,EVDWL,ECOUL}; ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pair(NULL), one(NULL) + pstyle(nullptr), pair(nullptr), one(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair command"); @@ -82,7 +82,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : extvector = 1; one = new double[npair]; vector = new double[npair]; - } else one = vector = NULL; + } else one = vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index e41221f70..a8fa247e4 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -37,7 +37,7 @@ enum{TYPE,RADIUS}; ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pindex(NULL), vlocal(NULL), alocal(NULL) + pstyle(nullptr), pindex(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair/local command"); @@ -97,8 +97,8 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -115,7 +115,7 @@ ComputePairLocal::~ComputePairLocal() void ComputePairLocal::init() { - if (singleflag && force->pair == NULL) + if (singleflag && force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pair/local"); if (singleflag && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pair/local"); diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 6bdd72950..374a3151c 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - energy(NULL) + energy(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command"); diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index 90e4f9b39..ae1bb4747 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure command"); if (igroup) error->all(FLERR,"Compute pressure must use group all"); @@ -51,7 +51,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -130,13 +130,13 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ void ComputePressure::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairhybridflag && force->pair) nvirial++; if (pairflag && force->pair) nvirial++; @@ -221,7 +221,7 @@ void ComputePressure::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 9c637edc1..e23458d20 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - index(NULL), pack_choice(NULL) + index(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/atom command"); @@ -441,7 +441,7 @@ void ComputePropertyAtom::compute_peratom() (this->*pack_choice[0])(0); } else { if (nmax) buf = &array_atom[0][0]; - else buf = NULL; + else buf = nullptr; for (int n = 0; n < nvalues; n++) (this->*pack_choice[n])(n); } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index c27cfc409..ad21e8029 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), count_one(NULL), count_all(NULL) + idchunk(nullptr), count_one(nullptr), count_all(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute property/chunk command"); diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 651e1190b..8478535e9 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -35,7 +35,7 @@ enum{TYPE,RADIUS}; ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL), indices(NULL), pack_choice(NULL) + vlocal(nullptr), alocal(nullptr), indices(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/local command"); @@ -254,8 +254,8 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute property/local requires atom attribute radius"); nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -273,7 +273,7 @@ ComputePropertyLocal::~ComputePropertyLocal() void ComputePropertyLocal::init() { if (kindflag == NEIGH || kindflag == PAIR) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute property/local"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute property/local"); diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index a28223b3a..f4d553d2d 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -41,9 +41,9 @@ using namespace MathConst; ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rdfpair(NULL), nrdfpair(NULL), ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), - hist(NULL), histall(NULL), typecount(NULL), icount(NULL), jcount(NULL), - duplicates(NULL) + rdfpair(nullptr), nrdfpair(nullptr), ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), + hist(nullptr), histall(nullptr), typecount(nullptr), icount(nullptr), jcount(nullptr), + duplicates(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute rdf command"); diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index b024b4365..66af301e4 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -44,14 +44,14 @@ enum{PERATOM,LOCAL}; ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), flavor(NULL), - value2index(NULL), ids(NULL), onevec(NULL), replace(NULL), indices(NULL), - owner(NULL), idregion(NULL), varatom(NULL) + nvalues(0), which(nullptr), argindex(nullptr), flavor(nullptr), + value2index(nullptr), ids(nullptr), onevec(nullptr), replace(nullptr), indices(nullptr), + owner(nullptr), idregion(nullptr), varatom(nullptr) { int iarg = 0; if (strcmp(style,"reduce") == 0) { if (narg < 5) error->all(FLERR,"Illegal compute reduce command"); - idregion = NULL; + idregion = nullptr; iarg = 3; } else if (strcmp(style,"reduce/region") == 0) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/region command"); @@ -93,13 +93,13 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"x") == 0) { which[nvalues] = X; @@ -190,7 +190,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : if (replace[i] >= 0) flag = 1; if (!flag) { delete [] replace; - replace = NULL; + replace = nullptr; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -285,8 +285,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; if (mode == SUM || mode == SUMSQ) extscalar = 1; else extscalar = 0; - vector = onevec = NULL; - indices = owner = NULL; + vector = onevec = nullptr; + indices = owner = nullptr; } else { vector_flag = 1; size_vector = nvalues; @@ -299,7 +299,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : } maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 6e8aa4841..fbcf82619 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -40,8 +40,8 @@ enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), argindex(NULL), value2index(NULL), idchunk(NULL), ids(NULL), - vlocal(NULL), vglobal(NULL), alocal(NULL), aglobal(NULL), varatom(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), idchunk(nullptr), ids(nullptr), + vlocal(nullptr), vglobal(nullptr), alocal(nullptr), aglobal(nullptr), varatom(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/chunk command"); @@ -78,13 +78,13 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || @@ -193,11 +193,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : else if (mode == MAXX) initvalue = -BIG; maxchunk = 0; - vlocal = vglobal = NULL; - alocal = aglobal = NULL; + vlocal = vglobal = nullptr; + alocal = aglobal = nullptr; maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index ca4b735d6..036a9bb28 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -34,7 +34,7 @@ enum{COMPUTE,FIX,VARIABLE}; ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute slice command"); diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 9c65ee86c..279d2af07 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command"); @@ -49,7 +49,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -213,7 +213,7 @@ void ComputeStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 54f052900..f3110cfec 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -31,8 +31,8 @@ enum{TEMP,KECOM,INTERNAL}; ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), idchunk(NULL), id_bias(NULL), sum(NULL), sumall(NULL), count(NULL), - countall(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + which(nullptr), idchunk(nullptr), id_bias(nullptr), sum(nullptr), sumall(nullptr), count(nullptr), + countall(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command"); @@ -71,7 +71,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : comflag = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index b50962a2c..75b784c85 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -47,7 +47,7 @@ ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index 85e51d2a5..5ce62dfeb 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -47,7 +47,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx"); maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index eacca87e1..0344880e1 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -30,7 +30,7 @@ enum{TENSOR,BIN}; ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bin(NULL), vbin(NULL), binave(NULL), tbin(NULL), tbinall(NULL) + bin(nullptr), vbin(nullptr), binave(nullptr), tbin(nullptr), tbinall(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command"); diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index 3874c1f28..17509b85a 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -98,7 +98,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : } maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index 74955da42..8a8d671df 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute temp/region command"); @@ -48,7 +48,7 @@ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp index 6ef3038d6..42dc790a3 100644 --- a/src/compute_temp_sphere.cpp +++ b/src/compute_temp_sphere.cpp @@ -32,7 +32,7 @@ enum{ROTATE,ALL}; ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL) + id_bias(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command"); diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index c0b648418..df2559145 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), torque(NULL), torqueall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), torque(nullptr), torqueall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute torque/chunk command"); diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index 635c3e416..a34c4bac8 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute vacf command"); diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index 6651110e7..7edab91d5 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -29,7 +29,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute vcm/chunk command"); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 7e84e9cce..d7f862de9 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -130,7 +130,7 @@ void CreateAtoms::command(int narg, char **arg) mode = ATOM; int molseed; varflag = 0; - vstr = xstr = ystr = zstr = NULL; + vstr = xstr = ystr = zstr = nullptr; quatone[0] = quatone[1] = quatone[2] = 0.0; subsetflag = NONE; int subsetseed; @@ -245,7 +245,7 @@ void CreateAtoms::command(int narg, char **arg) // error check and further setup for mode = MOLECULE - ranmol = NULL; + ranmol = nullptr; if (mode == MOLECULE) { if (onemol->xflag == 0) error->all(FLERR,"Create_atoms molecule must have coordinates"); @@ -267,7 +267,7 @@ void CreateAtoms::command(int narg, char **arg) ranmol = new RanMars(lmp,molseed+me); } - ranlatt = NULL; + ranlatt = nullptr; if (subsetflag != NONE) ranlatt = new RanMars(lmp,subsetseed+me); // error check and further setup for variable test diff --git a/src/create_atoms.h b/src/create_atoms.h index 87d15d00b..5508752f0 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -62,7 +62,7 @@ class CreateAtoms : protected Pointers { void add_random(); void add_lattice(); void loop_lattice(int); - void add_molecule(double *, double * = NULL); + void add_molecule(double *, double * = nullptr); int vartest(double *); // evaluate a variable with new atom position }; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 9e3eb6580..7bface4d0 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -197,14 +197,14 @@ void CreateBonds::many() // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Create_bonds requires a pair style be defined"); if (rmax > neighbor->cutneighmax) error->all(FLERR,"Create_bonds max distance > neighbor cutoff"); if (rmax > neighbor->cutneighmin && comm->me == 0) error->warning(FLERR,"Create_bonds max distance > minimum neighbor cutoff"); - // require special_bonds 1-2 weights = 0.0 and KSpace = NULL + // require special_bonds 1-2 weights = 0.0 and KSpace = nullptr // so that already bonded atom pairs do not appear in neighbor list // otherwise with newton_bond = 1, // would be hard to check if I-J bond already existed diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 8baee645c..9f73a64f7 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -299,7 +299,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Delete_atoms requires a pair style be defined"); if (cut > neighbor->cutneighmax) error->all(FLERR,"Delete_atoms cutoff > max neighbor cutoff"); @@ -476,7 +476,7 @@ void DeleteAtoms::delete_bond() for (int i = 0; i < nlocal; i++) if (dlist[i]) list[n++] = tag[i]; - comm->ring(n,sizeof(tagint),list,1,bondring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,bondring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -514,7 +514,7 @@ void DeleteAtoms::delete_molecule() std::map::iterator pos; for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index b8ec5f788..4b68a461f 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -75,7 +75,7 @@ void DeleteBonds::command(int narg, char **arg) // use utils::bounds(FLERR,) to allow setting of range of types // range can be 0 to ntypes inclusive - int *tlist = NULL; + int *tlist = nullptr; int iarg = 2; if (style != MULTI && style != STATS) { diff --git a/src/dihedral.cpp b/src/dihedral.cpp index ac2d432cf..f75b89139 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -36,10 +36,10 @@ Dihedral::Dihedral(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index 61e0fdc72..83feb2f84 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -161,7 +161,7 @@ void DihedralHybrid::allocate() maxdihedral = new int[nstyles]; dihedrallist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxdihedral[m] = 0; - for (int m = 0; m < nstyles; m++) dihedrallist[m] = NULL; + for (int m = 0; m < nstyles; m++) dihedrallist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -329,7 +329,7 @@ void DihedralHybrid::write_restart(FILE *fp) void DihedralHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Dihedral*[nstyles]; keywords = new char*[nstyles]; @@ -338,10 +338,10 @@ void DihedralHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_dihedral(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 018288d47..4f8495699 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -44,7 +44,7 @@ enum{MOVE,RAMP,RANDOM,ROTATE}; DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp) { - mvec = NULL; + mvec = nullptr; } /* ---------------------------------------------------------------------- */ @@ -313,7 +313,7 @@ void DisplaceAtoms::command(int narg, char **arg) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -384,7 +384,7 @@ void DisplaceAtoms::move(int idim, char *arg, double scale) for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += delta; } else if (input->variable->atomstyle(ivar)) { - if (mvec == NULL) memory->create(mvec,nlocal,"displace_atoms:mvec"); + if (mvec == nullptr) memory->create(mvec,nlocal,"displace_atoms:mvec"); input->variable->compute_atom(ivar,igroup,mvec,1,0); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += scale*mvec[i]; diff --git a/src/domain.cpp b/src/domain.cpp index 984c735a2..086f0228b 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -89,7 +89,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) boxlo_lamda[0] = boxlo_lamda[1] = boxlo_lamda[2] = 0.0; boxhi_lamda[0] = boxhi_lamda[1] = boxhi_lamda[2] = 1.0; - lattice = NULL; + lattice = nullptr; char **args = new char*[2]; args[0] = (char *) "none"; args[1] = (char *) "1.0"; @@ -97,7 +97,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) delete [] args; nregion = maxregion = 0; - regions = NULL; + regions = nullptr; copymode = 0; @@ -1640,7 +1640,7 @@ void Domain::image_flip(int m, int n, int p) return 1 if this proc owns atom with coords x, else return 0 x is returned remapped into periodic box if image flag is passed, flag is updated via remap(x,image) - if image = NULL is passed, no update with remap(x) + if image = nullptr is passed, no update with remap(x) if shrinkexceed, atom can be outside shrinkwrap boundaries called from create_atoms() in library.cpp ------------------------------------------------------------------------- */ @@ -1727,7 +1727,7 @@ int Domain::ownatom(int /*id*/, double *x, imageint *image, int shrinkexceed) void Domain::set_lattice(int narg, char **arg) { if (lattice) delete lattice; - lattice = NULL; + lattice = nullptr; lattice = new Lattice(lmp,narg,arg); } diff --git a/src/dump.cpp b/src/dump.cpp index febc3d082..3f1e997d1 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -66,17 +66,17 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) first_flag = 0; flush_flag = 1; - format = NULL; - format_default = NULL; + format = nullptr; + format_default = nullptr; - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_column_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_column_user = nullptr; refreshflag = 0; - refresh = NULL; + refresh = nullptr; clearstep = 0; sort_flag = 0; @@ -93,20 +93,20 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) maxfiles = -1; numfiles = 0; fileidx = 0; - nameslist = NULL; + nameslist = nullptr; maxbuf = maxids = maxsort = maxproc = 0; - buf = bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + buf = bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; maxsbuf = 0; - sbuf = NULL; + sbuf = nullptr; maxpbc = 0; - xpbc = vpbc = NULL; - imagepbc = NULL; + xpbc = vpbc = nullptr; + imagepbc = nullptr; // parse filename for special syntax // if contains '%', write one file per proc and replace % with proc-ID @@ -117,7 +117,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) // else if ends in .zst = Zstd compressed text file // else ASCII text file - fp = NULL; + fp = nullptr; singlefile_opened = 0; compressed = 0; binary = 0; @@ -128,7 +128,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) filewriter = 0; if (me == 0) filewriter = 1; fileproc = 0; - multiname = NULL; + multiname = nullptr; char *ptr; if ((ptr = strchr(filename,'%'))) { @@ -202,15 +202,15 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to NULL since it closes file in its destructor + // XTC style sets fp to nullptr since it closes file in its destructor - if (multifile == 0 && fp != NULL) { + if (multifile == 0 && fp != nullptr) { if (compressed) { if (filewriter) pclose(fp); } else { if (filewriter) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -229,10 +229,10 @@ void Dump::init() delete irregular; maxids = maxsort = maxproc = 0; - bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; } if (sort_flag) { @@ -243,7 +243,7 @@ void Dump::init() error->all(FLERR,"Cannot dump sort on atom IDs with no atom IDs defined"); if (sortcol && sortcol > size_one) error->all(FLERR,"Dump sort column is invalid"); - if (nprocs > 1 && irregular == NULL) + if (nprocs > 1 && irregular == nullptr) irregular = new Irregular(lmp); bigint size = group->count(igroup); @@ -438,7 +438,7 @@ void Dump::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // if buffering, convert doubles into strings @@ -528,11 +528,11 @@ void Dump::write() if (multifile) { if (compressed) { - if (filewriter && fp != NULL) pclose(fp); + if (filewriter && fp != nullptr) pclose(fp); } else { - if (filewriter && fp != NULL) fclose(fp); + if (filewriter && fp != nullptr) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -609,8 +609,8 @@ void Dump::openfile() fp = fopen(filecurrent,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); - } else fp = NULL; + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else fp = nullptr; // delete string with timestep replaced @@ -1013,10 +1013,10 @@ void Dump::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; // pass format none to child classes which may use it // not an error if they don't modify_param(narg-iarg,&arg[iarg]); @@ -1055,7 +1055,7 @@ void Dump::modify_params(int narg, char **arg) nameslist = new char*[maxfiles]; numfiles = 0; for (int idx=0; idx < maxfiles; ++idx) - nameslist[idx] = NULL; + nameslist[idx] = nullptr; fileidx = 0; } iarg += 2; diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index a68e95059..f8d02904f 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -34,7 +34,7 @@ DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) image_flag = 0; buffer_allow = 1; buffer_flag = 1; - format_default = NULL; + format_default = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index da9740d9c..ffff1e85c 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), auxname(NULL) + DumpCustom(lmp, narg, arg), auxname(nullptr) { multifile_override = 0; @@ -63,7 +63,7 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : // convert 'X_ID[m]' (X=c,f,v) to 'X_ID_m' if (nfield > 5) auxname = new char*[nfield]; - else auxname = NULL; + else auxname = nullptr; int i = 0; for (int iarg = 5; iarg < nfield; iarg++, i++) { diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 167d88789..1439e68ce 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -53,13 +53,13 @@ enum{LT,LE,GT,GE,EQ,NEQ,XOR}; DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - idregion(NULL), thresh_array(NULL), thresh_op(NULL), thresh_value(NULL), - thresh_last(NULL), thresh_fix(NULL), thresh_fixID(NULL), thresh_first(NULL), - earg(NULL), vtype(NULL), vformat(NULL), columns(NULL), choose(NULL), - dchoose(NULL), clist(NULL), field2index(NULL), argindex(NULL), id_compute(NULL), - compute(NULL), id_fix(NULL), fix(NULL), id_variable(NULL), variable(NULL), - vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL), - pack_choice(NULL) + idregion(nullptr), thresh_array(nullptr), thresh_op(nullptr), thresh_value(nullptr), + thresh_last(nullptr), thresh_fix(nullptr), thresh_fixID(nullptr), thresh_first(nullptr), + earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), choose(nullptr), + dchoose(nullptr), clist(nullptr), field2index(nullptr), argindex(nullptr), id_compute(nullptr), + compute(nullptr), id_fix(nullptr), fix(nullptr), id_variable(nullptr), variable(nullptr), + vbuf(nullptr), id_custom(nullptr), flag_custom(nullptr), typenames(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); @@ -87,37 +87,37 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : buffer_allow = 1; buffer_flag = 1; iregion = -1; - idregion = NULL; + idregion = nullptr; nthresh = 0; - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; nthreshlast = 0; - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; // computes, fixes, variables which the dump accesses ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; nvariable = 0; - id_variable = NULL; - variable = NULL; - vbuf = NULL; + id_variable = nullptr; + variable = nullptr; + vbuf = nullptr; ncustom = 0; - id_custom = NULL; - flag_custom = NULL; + id_custom = nullptr; + flag_custom = nullptr; // process attributes // ioptional = start of additional optional args in expanded args @@ -142,9 +142,9 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // atom selection arrays maxlocal = 0; - choose = NULL; - dchoose = NULL; - clist = NULL; + choose = nullptr; + dchoose = nullptr; + clist = nullptr; // default element name for all types = C @@ -167,11 +167,11 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : else if (vtype[i] == Dump::DOUBLE) strcat(format_default,"%g "); else if (vtype[i] == Dump::STRING) strcat(format_default,"%s "); else if (vtype[i] == Dump::BIGINT) strcat(format_default,BIGINT_FORMAT " "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -279,8 +279,8 @@ void DumpCustom::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { @@ -1648,7 +1648,7 @@ int DumpCustom::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -1711,7 +1711,7 @@ int DumpCustom::modify_param(int narg, char **arg) // just clear format_column_user allocated by this dump child class for (int i = 0; i < size_one; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } return 2; } @@ -1729,7 +1729,7 @@ int DumpCustom::modify_param(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Dump_modify int format does not contain d character"); char str[8]; @@ -1791,17 +1791,17 @@ int DumpCustom::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; for (int i = 0; i < nthreshlast; i++) { modify->delete_fix(thresh_fixID[i]); delete [] thresh_fixID[i]; } - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; } nthresh = nthreshlast = 0; return 2; diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 254b371e2..8c848d261 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -51,7 +51,7 @@ static inline void fwrite_int32(FILE* fd, uint32_t i) /* ---------------------------------------------------------------------- */ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump dcd command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), sortcol = 0; unwrap_flag = 0; - format_default = NULL; + format_default = nullptr; // allocate global array for atom coords @@ -115,7 +115,7 @@ void DumpDCD::openfile() { if (me == 0) { fp = fopen(filename,"wb"); - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); } } @@ -342,7 +342,7 @@ void DumpDCD::write_dcd_header(const char *remarks) strncpy(title_string,remarks,80); title_string[79] = '\0'; fwrite(title_string,80,1,fp); - cur_time=time(NULL); + cur_time=time(nullptr); tmbuf=localtime(&cur_time); memset(title_string,' ',81); strftime(title_string,80,"REMARKS Created %d %B,%Y at %H:%M",tmbuf); diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 96a338950..bbaa9038b 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -50,12 +50,12 @@ enum{NO,YES}; /* ---------------------------------------------------------------------- */ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), thetastr(NULL), phistr(NULL), cxstr(NULL), - cystr(NULL), czstr(NULL), upxstr(NULL), upystr(NULL), upzstr(NULL), - zoomstr(NULL), perspstr(NULL), diamtype(NULL), diamelement(NULL), - bdiamtype(NULL), colortype(NULL), colorelement(NULL), bcolortype(NULL), - avec_line(NULL), avec_tri(NULL), avec_body(NULL), fixptr(NULL), image(NULL), - chooseghost(NULL), bufcopy(NULL) + DumpCustom(lmp, narg, arg), thetastr(nullptr), phistr(nullptr), cxstr(nullptr), + cystr(nullptr), czstr(nullptr), upxstr(nullptr), upystr(nullptr), upzstr(nullptr), + zoomstr(nullptr), perspstr(nullptr), diamtype(nullptr), diamelement(nullptr), + bdiamtype(nullptr), colortype(nullptr), colorelement(nullptr), bcolortype(nullptr), + avec_line(nullptr), avec_tri(nullptr), avec_body(nullptr), fixptr(nullptr), image(nullptr), + chooseghost(nullptr), bufcopy(nullptr) { if (binary || multiproc) error->all(FLERR,"Invalid dump image filename"); @@ -124,16 +124,16 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : bdiam = NUMERIC; bdiamvalue = 0.5; } - char *fixID = NULL; + char *fixID = nullptr; - thetastr = phistr = NULL; + thetastr = phistr = nullptr; cflag = STATIC; cx = cy = cz = 0.5; - cxstr = cystr = czstr = NULL; + cxstr = cystr = czstr = nullptr; - upxstr = upystr = upzstr = NULL; - zoomstr = NULL; - perspstr = NULL; + upxstr = upystr = upzstr = nullptr; + zoomstr = nullptr; + perspstr = nullptr; boxflag = YES; boxdiam = 0.02; axesflag = NO; @@ -441,8 +441,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else if (i % 6 == 0) bcolortype[i] = image->color2rgb("cyan"); } } else { - bdiamtype = NULL; - bcolortype = NULL; + bdiamtype = nullptr; + bcolortype = nullptr; } // viewflag = DYNAMIC if any view parameter is dynamic @@ -458,8 +458,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : // local data maxbufcopy = 0; - chooseghost = NULL; - bufcopy = NULL; + chooseghost = nullptr; + bufcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -566,7 +566,7 @@ void DumpImage::init_style() if (atomflag && acolor == ELEMENT) { for (int i = 1; i <= ntypes; i++) { colorelement[i] = image->element2color(typenames[i]); - if (colorelement[i] == NULL) + if (colorelement[i] == nullptr) error->all(FLERR,"Invalid dump image element name"); } } @@ -606,7 +606,7 @@ void DumpImage::write() // pack buf with color & diameter - pack(NULL); + pack(nullptr); // set minmax color range if using dynamic atom color map @@ -641,7 +641,7 @@ void DumpImage::write() else image->write_PPM(fp); if (multifile) { fclose(fp); - fp = NULL; + fp = nullptr; } } } @@ -1261,7 +1261,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1269,7 +1269,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { colortype[i] = image->color2rgb(ptrs[m%ncount]); - if (colortype[i] == NULL) + if (colortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1324,7 +1324,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1332,7 +1332,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { bcolortype[i] = image->color2rgb(ptrs[m%ncount]); - if (bcolortype[i] == NULL) + if (bcolortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1356,7 +1356,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"backcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); double *color = image->color2rgb(arg[1]); - if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command"); + if (color == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); image->background[0] = static_cast (color[0]*255.0); image->background[1] = static_cast (color[1]*255.0); image->background[2] = static_cast (color[2]*255.0); @@ -1366,7 +1366,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"boxcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); image->boxcolor = image->color2rgb(arg[1]); - if (image->boxcolor == NULL) + if (image->boxcolor == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); return 2; } diff --git a/src/dump_local.cpp b/src/dump_local.cpp index a71166ec5..988ff269d 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -35,9 +35,9 @@ enum{INT,DOUBLE}; DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - label(NULL), vtype(NULL), vformat(NULL), columns(NULL), field2index(NULL), - argindex(NULL), id_compute(NULL), compute(NULL), id_fix(NULL), fix(NULL), - pack_choice(NULL) + label(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), field2index(nullptr), + argindex(nullptr), id_compute(nullptr), compute(nullptr), id_fix(nullptr), fix(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump local arguments specified"); @@ -73,12 +73,12 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : argindex = new int[nfield]; ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; // process attributes @@ -95,11 +95,11 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < size_one; i++) { if (vtype[i] == INT) strcat(format_default,"%d "); else if (vtype[i] == DOUBLE) strcat(format_default,"%g "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -180,8 +180,8 @@ void DumpLocal::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index 5f6d0b80d..951768978 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -35,7 +35,7 @@ DumpMovie::DumpMovie(LAMMPS *lmp, int narg, char **arg) : filetype = PPM; bitrate = 2000; framerate = 24; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -44,7 +44,7 @@ void DumpMovie::openfile() { char moviecmd[1024]; - if ((comm->me == 0) && (fp == NULL)) { + if ((comm->me == 0) && (fp == nullptr)) { #ifdef LAMMPS_FFMPEG sprintf(moviecmd,"ffmpeg -v error -y -r %.2f -f image2pipe -c:v ppm -i - " @@ -59,7 +59,7 @@ void DumpMovie::openfile() fp = popen(moviecmd,"w"); #endif - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Failed to open FFmpeg pipeline to " "file {}",filename)); } diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index 10ba10f99..d4352b074 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - typenames(NULL) + typenames(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xyz command"); if (binary || multiproc) error->all(FLERR,"Invalid dump xyz filename"); @@ -46,7 +46,7 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), strcpy(format_default,str); ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,13 +54,13 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), DumpXYZ::~DumpXYZ() { delete[] format_default; - format_default = NULL; + format_default = nullptr; if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -83,7 +83,7 @@ void DumpXYZ::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; @@ -114,7 +114,7 @@ int DumpXYZ::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; diff --git a/src/error.cpp b/src/error.cpp index 0ea218887..d89ea5b68 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -69,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -95,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -143,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -169,7 +169,7 @@ void Error::all(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - write to world screen only if non-NULL on this proc + write to world screen only if non-nullptr on this proc always write to universe screen forces abort of entire world (and universe) if any proc in world calls ------------------------------------------------------------------------- */ @@ -192,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -207,7 +207,7 @@ void Error::one(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - only write to screen if non-NULL on this proc since could be file + only write to screen if non-nullptr on this proc since could be file ------------------------------------------------------------------------- */ void Error::warning(const std::string &file, int line, const std::string &str, int logflag) diff --git a/src/fix.cpp b/src/fix.cpp index 03313739a..8d6d3f882 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -33,8 +33,8 @@ int Fix::instance_total = 0; Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), extlist(NULL), vector_atom(NULL), array_atom(NULL), - vector_local(NULL), array_local(NULL), eatom(NULL), vatom(NULL) + id(nullptr), style(nullptr), extlist(nullptr), vector_atom(nullptr), array_atom(nullptr), + vector_local(nullptr), array_local(nullptr), eatom(nullptr), vatom(nullptr) { instance_me = instance_total++; diff --git a/src/fix.h b/src/fix.h index ab8dddf1d..07a222063 100644 --- a/src/fix.h +++ b/src/fix.h @@ -215,7 +215,7 @@ class Fix : protected Pointers { virtual int image(int *&, double **&) {return 0;} virtual int modify_param(int, char **) {return 0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual double memory_usage() {return 0.0;} diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index dba4fde07..52f423698 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -43,7 +43,7 @@ enum{DIAMETER,CHARGE}; /* ---------------------------------------------------------------------- */ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) +nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix adapt command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); @@ -96,7 +96,7 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].pstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].pparam = new char[n]; - adapt[nadapt].pair = NULL; + adapt[nadapt].pair = nullptr; strcpy(adapt[nadapt].pparam,arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); @@ -118,7 +118,7 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].bstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].bparam = new char[n]; - adapt[nadapt].bond = NULL; + adapt[nadapt].bond = nullptr; strcpy(adapt[nadapt].bparam,arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->nbondtypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); @@ -263,8 +263,8 @@ void FixAdapt::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; if (diamflag && atom->radius_flag) { std::string fixcmd = id + std::string("_FIX_STORE_DIAM"); @@ -340,7 +340,7 @@ void FixAdapt::init() if (ad->which == PAIR) { anypair = 1; - ad->pair = NULL; + ad->pair = nullptr; // if ad->pstyle has trailing sub-style annotation ":N", // strip it for pstyle arg to pair_match() and set nsub = N @@ -366,12 +366,12 @@ void FixAdapt::init() ad->pair = force->pair_match(psuffix,1,nsub); delete[] psuffix; } - if (ad->pair == NULL) ad->pair = force->pair_match(pstyle,1,nsub); - if (ad->pair == NULL) + if (ad->pair == nullptr) ad->pair = force->pair_match(pstyle,1,nsub); + if (ad->pair == nullptr) error->all(FLERR,"Fix adapt pair style does not exist"); void *ptr = ad->pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt pair style param not supported"); // for pair styles only parameters that are 2-d arrays in atom types or @@ -396,7 +396,7 @@ void FixAdapt::init() delete [] pstyle; } else if (ad->which == BOND){ - ad->bond = NULL; + ad->bond = nullptr; anybond = 1; int n = strlen(ad->bstyle) + 1; @@ -412,13 +412,13 @@ void FixAdapt::init() ad->bond = force->bond_match(bsuffix); delete [] bsuffix; } - if (ad->bond == NULL) ad->bond = force->bond_match(bstyle); - if (ad->bond == NULL ) + if (ad->bond == nullptr) ad->bond = force->bond_match(bstyle); + if (ad->bond == nullptr ) error->all(FLERR,"Fix adapt bond style does not exist"); void *ptr = ad->bond->extract(ad->bparam,ad->bdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt bond style param not supported"); // for bond styles, use a vector @@ -431,7 +431,7 @@ void FixAdapt::init() delete [] bstyle; } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 0983728ea..a8b7a46e4 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -36,7 +36,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), estr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix addforce command"); @@ -52,7 +52,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : ilevel_respa = 0; virial_flag = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -253,7 +253,7 @@ void FixAddForce::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index da009c55d..e4a04c6f9 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -35,8 +35,8 @@ enum{X,V,F,COMPUTE,FIX,VARIABLE}; FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), array(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command"); @@ -64,7 +64,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nvalues]; for (int i = 0; i < nvalues; i++) { - ids[i] = NULL; + ids[i] = nullptr; if (strcmp(arg[i],"x") == 0) { which[i] = X; @@ -376,7 +376,7 @@ void FixAveAtom::end_of_step() } else if (which[m] == VARIABLE) { if (array) input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1); - else input->variable->compute_atom(n,igroup,NULL,nvalues,1); + else input->variable->compute_atom(n,igroup,nullptr,nvalues,1); } } @@ -394,7 +394,7 @@ void FixAveAtom::end_of_step() nvalid = ntimestep+peratom_freq - (nrepeat-1)*nevery; modify->addstep_compute(nvalid); - if (array == NULL) return; + if (array == nullptr) return; // average the final result for the Nfreq timestep @@ -424,7 +424,7 @@ void FixAveAtom::grow_arrays(int nmax) memory->grow(array,nmax,nvalues,"fix_ave/atom:array"); array_atom = array; if (array) vector_atom = array[0]; - else vector_atom = NULL; + else vector_atom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 18fb33527..c178cf63c 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -46,12 +46,12 @@ enum{ONE,RUNNING,WINDOW}; FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), nvalues(0), nrepeat(0), - which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - fp(NULL), idchunk(NULL), varatom(NULL), - count_one(NULL), count_many(NULL), count_sum(NULL), - values_one(NULL), values_many(NULL), values_sum(NULL), - count_total(NULL), count_list(NULL), - values_total(NULL), values_list(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + fp(nullptr), idchunk(nullptr), varatom(nullptr), + count_one(nullptr), count_many(nullptr), count_sum(nullptr), + values_one(nullptr), values_many(nullptr), values_sum(nullptr), + count_total(nullptr), count_list(nullptr), + values_total(nullptr), values_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command"); @@ -88,7 +88,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : int iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"vx") == 0) { which[nvalues] = V; @@ -164,15 +164,15 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : ave = ONE; nwindow = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"norm") == 0) { @@ -225,7 +225,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/chunk file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -409,12 +409,12 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : normcount = 0; maxvar = 0; - varatom = NULL; + varatom = nullptr; - count_one = count_many = count_sum = count_total = NULL; - count_list = NULL; - values_one = values_many = values_sum = values_total = NULL; - values_list = NULL; + count_one = count_many = count_sum = count_total = nullptr; + count_list = nullptr; + values_one = values_many = values_sum = values_total = nullptr; + values_list = nullptr; maxchunk = 0; nchunk = 1; @@ -466,24 +466,24 @@ FixAveChunk::~FixAveChunk() } delete [] idchunk; - which = NULL; - argindex = NULL; - ids = NULL; - value2index = NULL; - fp = NULL; - varatom = NULL; - count_one = NULL; - count_many = NULL; - count_sum = NULL; - count_total = NULL; - count_list = NULL; - values_one = NULL; - values_many = NULL; - values_sum = NULL; - values_total = NULL; - values_list = NULL; - idchunk = NULL; - cchunk = NULL; + which = nullptr; + argindex = nullptr; + ids = nullptr; + value2index = nullptr; + fp = nullptr; + varatom = nullptr; + count_one = nullptr; + count_many = nullptr; + count_sum = nullptr; + count_total = nullptr; + count_list = nullptr; + values_one = nullptr; + values_many = nullptr; + values_sum = nullptr; + values_total = nullptr; + values_list = nullptr; + idchunk = nullptr; + cchunk = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1110,7 +1110,7 @@ void FixAveChunk::allocate() double FixAveChunk::compute_array(int i, int j) { - if (values_total == NULL) return 0.0; + if (values_total == nullptr) return 0.0; if (i >= nchunk) return 0.0; if (j < colextra) { if (cchunk->compress) { diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 031dfc26b..5576c7fb6 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -45,8 +45,8 @@ enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): Fix (lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL), - count(NULL), values(NULL), corr(NULL), save_count(NULL), save_corr(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), fp(nullptr), + count(nullptr), values(nullptr), corr(nullptr), save_count(nullptr), save_corr(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/correlate command"); @@ -112,11 +112,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): ave = ONE; startstep = 0; prefactor = 1.0; - fp = NULL; + fp = nullptr; overwrite = 0; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"type") == 0) { @@ -147,7 +147,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/correlate file {}:"" {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 3a9346498..4d1cd5b2d 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -45,10 +45,10 @@ enum{IGNORE,END,EXTRA}; FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), fp(NULL), stats_list(NULL), - bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL), - coord(NULL), vector(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), fp(nullptr), stats_list(nullptr), + bin(nullptr), bin_total(nullptr), bin_all(nullptr), bin_list(nullptr), + coord(nullptr), vector(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command"); @@ -120,41 +120,41 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[i],"x") == 0) { which[i] = X; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"y") == 0) { which[i] = X; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"z") == 0) { which[i] = X; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vx") == 0) { which[i] = V; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vy") == 0) { which[i] = V; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vz") == 0) { which[i] = V; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fx") == 0) { which[i] = F; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fy") == 0) { which[i] = F; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fz") == 0) { which[i] = F; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if ((strncmp(arg[i],"c_",2) == 0) || (strncmp(arg[i],"f_",2) == 0) || @@ -467,9 +467,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : bin_all = new double[nbins]; coord = new double[nbins]; - stats_list = NULL; - bin_list = NULL; - vector = NULL; + stats_list = nullptr; + bin_list = nullptr; + vector = nullptr; maxatom = 0; if (ave == WINDOW) { @@ -944,16 +944,16 @@ void FixAveHisto::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; kind = DEFAULT; ave = ONE; startstep = 0; mode = SCALAR; beyond = IGNORE; overwrite = 0; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -962,7 +962,7 @@ void FixAveHisto::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/histo file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 5e93df031..586c36af8 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -126,7 +126,7 @@ void FixAveHistoWeight::end_of_step() // calculate weight factors which are 2nd value (i = 1) double weight = 0.0; - double *weights = NULL; + double *weights = nullptr; int stride = 0; i = 1; @@ -270,11 +270,11 @@ void FixAveHistoWeight::end_of_step() // atom attributes - if (which[i] == X && weights != NULL) + if (which[i] == X && weights != nullptr) bin_atoms_weights(&atom->x[0][j],3,weights,stride); - else if (which[i] == V && weights != NULL) + else if (which[i] == V && weights != nullptr) bin_atoms_weights(&atom->v[0][j],3,weights,stride); - else if (which[i] == F && weights != NULL) + else if (which[i] == F && weights != nullptr) bin_atoms_weights(&atom->f[0][j],3,weights,stride); // invoke compute if not previously invoked diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 9c493b984..b40a7eb00 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -43,11 +43,11 @@ enum{SCALAR,VECTOR}; FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - offcol(NULL), varlen(NULL), ids(NULL), - fp(NULL), offlist(NULL), format(NULL), format_user(NULL), - vector(NULL), vector_total(NULL), vector_list(NULL), - column(NULL), array(NULL), array_total(NULL), array_list(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + offcol(nullptr), varlen(nullptr), ids(nullptr), + fp(nullptr), offlist(nullptr), format(nullptr), format_user(nullptr), + vector(nullptr), vector_total(nullptr), vector_list(nullptr), + column(nullptr), array(nullptr), array_total(nullptr), array_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/time command"); @@ -243,7 +243,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // nrows = # of rows in output array // if all columns are variable length, just set nrows = 1 for now - column = NULL; + column = nullptr; if (mode == VECTOR) { if (all_variable_length == 0) nrows = column_length(0); else nrows = 1; @@ -304,10 +304,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; - array = array_total = NULL; - array_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; + array = array_total = nullptr; + array_list = nullptr; if (mode == SCALAR) { vector = new double[nvalues]; @@ -321,7 +321,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // VECTOR mode produces either a vector or array // intensive/extensive flags set by compute,fix,variable that produces value - extlist = NULL; + extlist = nullptr; if (mode == SCALAR) { if (nvalues == 1) { @@ -1022,18 +1022,18 @@ void FixAveTime::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; mode = SCALAR; noff = 0; - offlist = NULL; + offlist = nullptr; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -1042,7 +1042,7 @@ void FixAveTime::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/time file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 00ec0d67b..324f6eaa6 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL}; FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix aveforce command"); @@ -46,7 +46,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -82,7 +82,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -197,7 +197,7 @@ void FixAveForce::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -265,7 +265,7 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index 7cee83537..735b6b3bd 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -35,7 +35,7 @@ enum{SHIFT,BISECTION}; /* ---------------------------------------------------------------------- */ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), balance(NULL), irregular(NULL) + Fix(lmp, narg, arg), balance(nullptr), irregular(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix balance command"); diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 5fd9ef190..8d8b4af10 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -43,7 +43,7 @@ enum{ISO,ANISO,TRICLINIC}; FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix box/relax command"); @@ -395,7 +395,7 @@ void FixBoxRelax::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index 92fd42f3d..edeaf60f4 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -34,7 +34,7 @@ enum{COMPUTE,FIX,VARIABLE}; FixController::FixController(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pvID(NULL), cvID(NULL) + pvID(nullptr), cvID(nullptr) { if (narg != 11) error->all(FLERR,"Illegal fix controller command"); diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index b4c36ca43..4d3b1c647 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -42,7 +42,7 @@ enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE}; /* ---------------------------------------------------------------------- */ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -rfix(NULL), irregular(NULL), set(NULL) +rfix(nullptr), irregular(nullptr), set(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix deform command"); @@ -353,7 +353,7 @@ rfix(NULL), irregular(NULL), set(NULL) flip = 0; if (force_reneighbor) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; TWOPI = 2.0*MY_PI; } @@ -618,7 +618,7 @@ void FixDeform::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index be2a74d81..02d76b8c2 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -28,7 +28,7 @@ using namespace FixConst; FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - flist(NULL) + flist(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command"); diff --git a/src/fix_external.cpp b/src/fix_external.cpp index 1db7e1529..c44261b33 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -29,7 +29,7 @@ enum{PF_CALLBACK,PF_ARRAY}; FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fexternal(NULL), caller_vector(NULL) + fexternal(nullptr), caller_vector(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix external command"); @@ -53,7 +53,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : if (napply <= 0) error->all(FLERR,"Illegal fix external command"); } else error->all(FLERR,"Illegal fix external command"); - callback = NULL; + callback = nullptr; // perform initial allocation of atom-based array // register with Atom class @@ -66,7 +66,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : // optional vector of values provided by caller // vector_flag and size_vector are setup via set_vector_length() - caller_vector = NULL; + caller_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ int FixExternal::setmask() void FixExternal::init() { - if (mode == PF_CALLBACK && callback == NULL) + if (mode == PF_CALLBACK && callback == nullptr) error->all(FLERR,"Fix external callback function not set"); } diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 6dff93738..abef474b4 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -37,8 +37,8 @@ enum{CONSTANT,EQUAL}; // same as FixPour FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL), - xstr(NULL), ystr(NULL), zstr(NULL) + mstr(nullptr), vstr(nullptr), pstr(nullptr), tstr(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix gravity command"); @@ -49,7 +49,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - mstr = vstr = pstr = tstr = xstr = ystr = zstr = NULL; + mstr = vstr = pstr = tstr = xstr = ystr = zstr = nullptr; mstyle = vstyle = pstyle = tstyle = xstyle = ystyle = zstyle = CONSTANT; if (strstr(arg[3],"v_") == arg[3]) { @@ -394,5 +394,5 @@ void *FixGravity::extract(const char *name, int &dim) dim = 1; return (void *) gvec; } - return NULL; + return nullptr; } diff --git a/src/fix_group.cpp b/src/fix_group.cpp index bb51fafa1..108a97157 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -34,7 +34,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), idvar(NULL), idprop(NULL) +idregion(nullptr), idvar(nullptr), idprop(nullptr) { // dgroupbit = bitmask of dynamic group // group ID is last part of fix ID @@ -210,9 +210,9 @@ void FixGroup::set_group() // operate differently due to invocation this early in timestep // e.g. perform ghost comm update due to atoms having just moved - double *var = NULL; - int *ivector = NULL; - double *dvector = NULL; + double *var = nullptr; + int *ivector = nullptr; + double *dvector = nullptr; if (varflag) { update->post_integrate = 1; @@ -265,5 +265,5 @@ void *FixGroup::extract(const char *str, int &/*unused*/) if (strcmp(str,"property") == 0 && propflag) return (void *) idprop; if (strcmp(str,"variable") == 0 && varflag) return (void *) idvar; if (strcmp(str,"region") == 0 && regionflag) return (void *) idregion; - return NULL; + return nullptr; } diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index f8222e3ec..42f5c46a8 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -37,7 +37,7 @@ enum{NOMSG,YESMSG}; /* ---------------------------------------------------------------------- */ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idvar(NULL), dlimit_path(NULL) + Fix(lmp, narg, arg), idvar(nullptr), dlimit_path(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix halt command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); @@ -45,7 +45,7 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : // comparison args - idvar = NULL; + idvar = nullptr; int iarg = 4; if (strcmp(arg[iarg],"tlimit") == 0) { diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index e2eb39932..3c9134194 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -39,7 +39,7 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) +idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix heat command"); @@ -50,7 +50,7 @@ idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix heat command"); - hstr = NULL; + hstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; @@ -192,7 +192,7 @@ void FixHeat::end_of_step() // vsub = velocity subtracted from each atom to preserve momentum // overall KE cannot go negative - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index ae58f2791..e96ad7ab8 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -40,7 +40,7 @@ enum{INSIDE,OUTSIDE}; FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL), pstr(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr), pstr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix indent command"); @@ -407,7 +407,7 @@ void FixIndent::options(int narg, char **arg) if (narg < 0) error->all(FLERR,"Illegal fix indent command"); istyle = NONE; - xstr = ystr = zstr = rstr = pstr = NULL; + xstr = ystr = zstr = rstr = pstr = nullptr; xvalue = yvalue = zvalue = rvalue = pvalue = 0.0; scaleflag = 1; side = OUTSIDE; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 9d0b5f28f..5cfb860b5 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -53,8 +53,8 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gjfflag(0), gfactor1(NULL), gfactor2(NULL), ratio(NULL), tstr(NULL), - flangevin(NULL), tforce(NULL), franprev(NULL), lv(NULL), id_temp(NULL), random(NULL) + gjfflag(0), gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), tstr(nullptr), + flangevin(nullptr), tforce(nullptr), franprev(nullptr), lv(nullptr), id_temp(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix langevin command"); @@ -154,10 +154,10 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix langevin command"); } - // set temperature = NULL, user can override via fix_modify if wants bias + // set temperature = nullptr, user can override via fix_modify if wants bias - id_temp = NULL; - temperature = NULL; + id_temp = nullptr; + temperature = nullptr; energy = 0.0; @@ -165,11 +165,11 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : // compute_scalar checks for this and returns 0.0 // if flangevin_allocated is not set - flangevin = NULL; + flangevin = nullptr; flangevin_allocated = 0; - franprev = NULL; - lv = NULL; - tforce = NULL; + franprev = nullptr; + lv = nullptr; + tforce = nullptr; maxatom1 = maxatom2 = 0; // setup atom-based array for franprev @@ -1104,7 +1104,7 @@ void *FixLangevin::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 93b13fac4..a3814f185 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -23,7 +23,7 @@ using namespace FixConst; FixMinimize::FixMinimize(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvector(0), peratom(NULL), vectors(NULL) + nvector(0), peratom(nullptr), vectors(nullptr) { // register callback to this fix from Atom class // don't perform initial allocation here, must wait until add_vector() diff --git a/src/fix_move.cpp b/src/fix_move.cpp index d6f61af09..aaa2422fa 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -46,10 +46,10 @@ enum{EQUAL,ATOM}; FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), vxvarstr(NULL), - vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), toriginal(NULL), qoriginal(NULL), - displace(NULL), velocity(NULL) + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), vxvarstr(nullptr), + vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), toriginal(nullptr), qoriginal(nullptr), + displace(nullptr), velocity(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix move command"); @@ -127,37 +127,37 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (narg < 10) error->all(FLERR,"Illegal fix move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -259,7 +259,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : atom->add_callback(0); atom->add_callback(1); - displace = velocity = NULL; + displace = velocity = nullptr; // AtomVec pointers to retrieve per-atom storage of extra quantities @@ -297,7 +297,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (quat_flag) { double *quat; for (int i = 0; i < nlocal; i++) { - quat = NULL; + quat = nullptr; if (mask[i] & groupbit) { if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; @@ -439,9 +439,9 @@ void FixMove::init() memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; if (strstr(update->integrate_style,"respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; @@ -664,7 +664,7 @@ void FixMove::initial_integrate(int /*vflag*/) // angmom for ellipsoids, tris, and bodies if (angmom_flag) { - quat = inertia = NULL; + quat = inertia = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) { quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; shape = avec_ellipsoid->bonus[ellipsoid[i]].shape; @@ -701,7 +701,7 @@ void FixMove::initial_integrate(int /*vflag*/) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -873,7 +873,7 @@ void FixMove::initial_integrate(int /*vflag*/) } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMove::final_integrate() @@ -1121,7 +1121,7 @@ void FixMove::set_arrays(int i) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 43415a6ef..766d4de14 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -34,8 +34,8 @@ enum{DEFAULT,NPARTNER,PERPARTNER}; // also set in fix neigh/history/omp FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), npartner(NULL), partner(NULL), valuepartner(NULL), - ipage_atom(NULL), dpage_atom(NULL), ipage_neigh(NULL), dpage_neigh(NULL) + pair(nullptr), npartner(nullptr), partner(nullptr), valuepartner(nullptr), + ipage_atom(nullptr), dpage_atom(nullptr), ipage_neigh(nullptr), dpage_neigh(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command"); @@ -70,16 +70,16 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : // other per-atom vectors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; maxatom = 0; // per-atom and per-neighbor data structs - ipage_atom = NULL; - dpage_atom = NULL; - ipage_neigh = NULL; - dpage_neigh = NULL; + ipage_atom = nullptr; + dpage_atom = nullptr; + ipage_neigh = nullptr; + dpage_neigh = nullptr; // initialize npartner to 0 so neighbor list creation is OK the 1st time @@ -120,13 +120,13 @@ FixNeighHistory::~FixNeighHistory() // to better detect use-after-delete errors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; - pair = NULL; - npartner = NULL; - partner = NULL; - valuepartner = NULL; + pair = nullptr; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,7 +172,7 @@ void FixNeighHistory::init() void FixNeighHistory::allocate_pages() { int create = 0; - if (ipage_atom == NULL) create = 1; + if (ipage_atom == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -279,7 +279,7 @@ void FixNeighHistory::pre_exchange_onesided() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -383,7 +383,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -392,7 +392,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -506,7 +506,7 @@ void FixNeighHistory::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -864,9 +864,9 @@ int FixNeighHistory::pack_restart(int i, double *buf) void FixNeighHistory::unpack_restart(int nlocal, int nth) { - // ipage_atom = NULL if being called from granular pair style init() + // ipage_atom = nullptr if being called from granular pair style init() - if (ipage_atom == NULL) allocate_pages(); + if (ipage_atom == nullptr) allocate_pages(); // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 0e3dc8931..aa353b19a 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -51,10 +51,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command"); @@ -72,7 +72,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -88,8 +88,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; // turn on tilt factor scaling, whenever applicable @@ -579,10 +579,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -740,7 +740,7 @@ void FixNH::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -767,7 +767,7 @@ void FixNH::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1768,7 +1768,7 @@ void *FixNH::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 145d60e8d..cd186eb9a 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -40,8 +40,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), numdiff_forces(NULL), - temp_x(NULL), temp_f(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), + temp_x(nullptr), temp_f(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix numdiff command"); diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index a90bf86c5..a156c0d58 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -37,7 +37,7 @@ enum{ISO,ANISO}; FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command"); @@ -239,7 +239,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : pflag = 1; nrigid = 0; - rfix = NULL; + rfix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,7 +308,7 @@ void FixPressBerendsen::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_print.cpp b/src/fix_print.cpp index 78fceea18..c8a7c8e61 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -29,7 +29,7 @@ using namespace FixConst; FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), string(NULL), copy(NULL), work(NULL), var_print(NULL) + fp(nullptr), string(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix print command"); if (strstr(arg[3],"v_") == arg[3]) { @@ -54,9 +54,9 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : // parse optional args - fp = NULL; + fp = nullptr; screenflag = 1; - char *title = NULL; + char *title = nullptr; int iarg = 5; while (iarg < narg) { @@ -65,7 +65,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : if (me == 0) { if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix print file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 07108721c..35ac20e37 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -30,7 +30,7 @@ enum{MOLECULE,CHARGE,RMASS,INTEGER,DOUBLE}; FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalue(0), style(NULL), index(NULL), astyle(NULL) + nvalue(0), style(nullptr), index(nullptr), astyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix property/atom command"); @@ -152,21 +152,21 @@ FixPropertyAtom::~FixPropertyAtom() if (border) atom->delete_callback(id,2); // deallocate per-atom vectors in Atom class - // set ptrs to NULL, so they no longer exist for Atom class + // set ptrs to nullptr, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { atom->molecule_flag = 0; memory->destroy(atom->molecule); - atom->molecule = NULL; + atom->molecule = nullptr; } else if (style[m] == CHARGE) { atom->q_flag = 0; memory->destroy(atom->q); - atom->q = NULL; + atom->q = nullptr; } else if (style[m] == RMASS) { atom->rmass_flag = 0; memory->destroy(atom->rmass); - atom->rmass = NULL; + atom->rmass = nullptr; } else if (style[m] == INTEGER) { atom->remove_custom(0,index[m]); } else if (style[m] == DOUBLE) { @@ -237,13 +237,13 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,fmt::format("Too few lines in {} section of data file",keyword)); int format_ok = 1; for (j = 1; j < nwords; j++) { - values[j] = strtok(NULL," \t\n\r\f"); - if (values[j] == NULL) format_ok = 0; + values[j] = strtok(nullptr," \t\n\r\f"); + if (values[j] == nullptr) format_ok = 0; } if (!format_ok) error->all(FLERR,fmt::format("Incorrect {} format in data file",keyword)); diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 2e10b15ff..cee1ed4cc 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -23,7 +23,7 @@ using namespace FixConst; FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - count(NULL), extra(NULL) + count(nullptr), extra(nullptr) { nextra = utils::inumeric(FLERR,arg[3],false,lmp); int nfix = utils::inumeric(FLERR,arg[4],false,lmp); diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index b116f8cca..abed4b477 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -25,7 +25,7 @@ using namespace FixConst; FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - store_torque(0), f_level(NULL), t_level(NULL) + store_torque(0), f_level(nullptr), t_level(nullptr) { // nlevels = # of rRESPA levels @@ -41,8 +41,8 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - f_level = NULL; - t_level = NULL; + f_level = nullptr; + t_level = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); } diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 4f675bf7b..31e32a478 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -45,9 +45,9 @@ enum{BOND,LBOUND,ANGLE,DIHEDRAL}; FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rstyle(NULL), mult(NULL), ids(NULL), kstart(NULL), kstop(NULL), - deqstart(NULL), deqstop(NULL), target(NULL), cos_target(NULL), - sin_target(NULL) + rstyle(nullptr), mult(nullptr), ids(nullptr), kstart(nullptr), kstop(nullptr), + deqstart(nullptr), deqstop(nullptr), target(nullptr), cos_target(nullptr), + sin_target(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix restrain command"); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 229890c5d..3acd44964 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -35,7 +35,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix setforce command"); @@ -46,7 +46,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : extvector = 1; respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -82,7 +82,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -228,7 +228,7 @@ void FixSetForce::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -305,7 +305,7 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) foriginal[1] += foriginal_saved[1]; foriginal[2] += foriginal_saved[2]; } else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 2d695add2..ac08cbb49 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -37,7 +37,7 @@ enum{TETHER,COUPLE}; FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 9) error->all(FLERR,"Illegal fix spring command"); diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index d8de88bd6..b7ffea3d6 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -35,7 +35,7 @@ using namespace FixConst; FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idchunk(NULL), idcom(NULL), com0(NULL), fcom(NULL) + idchunk(nullptr), idcom(nullptr), com0(nullptr), fcom(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix spring/chunk command"); @@ -155,7 +155,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // will be unlocked in destructor // necessary b/c this fix stores original COM - if (com0 == NULL) cchunk->lock(this,update->ntimestep,-1); + if (com0 == nullptr) cchunk->lock(this,update->ntimestep,-1); // calculate current centers of mass for each chunk // extract pointers from idchunk and idcom @@ -170,7 +170,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // check if first time cchunk was queried via ccom // if so, allocate com0,fcom and store initial COM - if (com0 == NULL) { + if (com0 == nullptr) { memory->create(com0,nchunk,3,"spring/chunk:com0"); memory->create(fcom,nchunk,3,"spring/chunk:fcom"); diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 5715e7eb8..280539505 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -67,7 +67,7 @@ void FixSpringRG::init() { masstotal = group->mass(igroup); - // if rg0 was specified as NULL, compute current Rg + // if rg0 was specified as nullptr, compute current Rg // only occurs on 1st run if (rg0_flag) { diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 8e7b3eb92..12e933cd0 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -33,7 +33,7 @@ using namespace FixConst; FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xoriginal(NULL) + xoriginal(nullptr) { if ((narg < 4) || (narg > 5)) error->all(FLERR,"Illegal fix spring/self command"); @@ -70,7 +70,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3eb207525..d8d6dbf90 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -28,7 +28,7 @@ enum{UNKNOWN,GLOBAL,PERATOM}; /* ---------------------------------------------------------------------- */ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -vstore(NULL), astore(NULL), rbuf(NULL) +vstore(nullptr), astore(nullptr), rbuf(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix store command"); @@ -69,8 +69,8 @@ vstore(NULL), astore(NULL), rbuf(NULL) if (nvalues == 1) vecflag = 1; } - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; // allocate vector or array and restart buffer rbuf // for PERATOM, register with Atom class @@ -84,7 +84,7 @@ vstore(NULL), astore(NULL), rbuf(NULL) grow_arrays(atom->nmax); atom->add_callback(0); if (restart_peratom) atom->add_callback(1); - rbuf = NULL; + rbuf = nullptr; } // zero the storage @@ -145,8 +145,8 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_caller == 1) vecflag = 1; @@ -199,8 +199,8 @@ void FixStore::restart(char *buf) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_restart == 1) vecflag = 1; diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 5c25f0e16..ae01848d7 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -26,7 +26,7 @@ using namespace FixConst; FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - foriginal(NULL) + foriginal(nullptr) { if (narg < 3) error->all(FLERR,"Illegal fix store/coord command"); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index fd4563b7a..4ce65195b 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -38,9 +38,9 @@ enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME}; FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), values(NULL), - vbuf(NULL), pack_choice(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), values(nullptr), + vbuf(nullptr), pack_choice(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix store/state command"); @@ -64,7 +64,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : int iarg = 4; while (iarg < narg) { which[nvalues] = KEYWORD; - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"id") == 0) { pack_choice[nvalues++] = &FixStoreState::pack_id; @@ -348,7 +348,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - values = NULL; + values = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); @@ -479,7 +479,7 @@ void FixStoreState::end_of_step() // fill vector or array with per-atom values if (values) vbuf = &values[0][0]; - else vbuf = NULL; + else vbuf = nullptr; for (int m = 0; m < nvalues; m++) { if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); @@ -572,7 +572,7 @@ void FixStoreState::grow_arrays(int nmax) memory->grow(values,nmax,nvalues,"store/state:values"); if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; - else vector_atom = NULL; + else vector_atom = nullptr; } else array_atom = values; } diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index ec2965d07..610cc7310 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -37,7 +37,7 @@ enum{CONSTANT,EQUAL}; FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg != 6) error->all(FLERR,"Illegal fix temp/berendsen command"); @@ -50,7 +50,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : global_freq = nevery; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -280,5 +280,5 @@ void *FixTempBerendsen::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index cf7e9e9fe..c8016f320 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -43,7 +43,7 @@ enum{CONSTANT,EQUAL}; FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - vhold(NULL), tstr(NULL), id_temp(NULL), random(NULL) + vhold(nullptr), tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csld command"); @@ -56,7 +56,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -90,7 +90,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - vhold = NULL; + vhold = nullptr; nmax = -1; energy = 0.0; } @@ -108,7 +108,7 @@ FixTempCSLD::~FixTempCSLD() delete random; memory->destroy(vhold); - vhold = NULL; + vhold = nullptr; nmax = -1; } @@ -350,5 +350,5 @@ void *FixTempCSLD::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index c62090510..649f0d987 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -120,7 +120,7 @@ double FixTempCSVR::resamplekin(double ekin_old, double ekin_new){ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), random(NULL) + tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csvr command"); @@ -133,7 +133,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -383,5 +383,5 @@ void *FixTempCSVR::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index b5cb9c9a1..bd3ae9ecd 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -37,7 +37,7 @@ enum{CONSTANT,EQUAL}; FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command"); @@ -50,7 +50,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; dynamic_group_allow = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; tstr = new char[n]; @@ -278,5 +278,5 @@ void *FixTempRescale::extract(const char *str, int &dim) dim = 0; return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 12e36d890..17520d191 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -41,7 +41,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nfileevery(0), fp(NULL), xf(NULL), xold(NULL) +nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tmd command"); @@ -74,7 +74,7 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) if (narg != 7) error->all(FLERR,"Illegal fix tmd command"); if (me == 0) { fp = fopen(arg[6],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix tmd file {}: {}", arg[6], utils::getsyserror())); fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back", @@ -396,7 +396,7 @@ void FixTMD::readfile(char *file) int firstline = 1; int ncount = 0; - char *eof = NULL; + char *eof = nullptr; xprd = yprd = zprd = -1.0; do { @@ -404,7 +404,7 @@ void FixTMD::readfile(char *file) m = 0; for (nlines = 0; nlines < CHUNK; nlines++) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) break; + if (eof == nullptr) break; m += strlen(&buffer[m]); } if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); @@ -486,7 +486,7 @@ void FixTMD::readfile(char *file) } bufptr = next + 1; } - } while (eof != NULL); + } while (eof != nullptr); // clean up @@ -540,7 +540,7 @@ void FixTMD::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 6bcdfe948..141f00e65 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -38,7 +38,7 @@ enum{SCALAR,VECTOR}; FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), vector(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), vector(nullptr), array(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix vector command"); @@ -154,8 +154,8 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : // ncount = current size of vector or array - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; ncount = ncountmax = 0; if (nvalues == 1) size_vector = 0; else size_array_rows = 0; diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index 08649280d..d07d547c2 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -27,7 +27,7 @@ using namespace FixConst; FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gamma(NULL) + gamma(nullptr) { dynamic_group_allow = 1; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index cb822f109..2394922e2 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -51,7 +51,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : fldflag = 0; int pbcflag = 0; - for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = NULL; + for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = nullptr; int iarg = 3; while (iarg < narg) { diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index fc3735cfb..6ec3a27a5 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -34,7 +34,7 @@ enum{LJ93,LJ126,LJ1043,COLLOID,HARMONIC,MORSE}; FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/region command"); diff --git a/src/force.cpp b/src/force.cpp index 701113d7e..68cf5b247 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -54,12 +54,12 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) qqr2e_lammps_real = 332.06371; // these constants are toggled qqr2e_charmm_real = 332.0716; // by new CHARMM pair styles - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; char *str = (char *) "none"; int n = strlen(str) + 1; @@ -76,7 +76,7 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) kspace_style = new char[n]; strcpy(kspace_style,str); - pair_restart = NULL; + pair_restart = nullptr; create_factories(); } @@ -159,12 +159,12 @@ Force::~Force() if (improper) delete improper; if (kspace) delete kspace; - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; delete pair_map; delete bond_map; @@ -233,9 +233,9 @@ void Force::create_pair(const std::string &style, int trysuffix) delete [] pair_style; if (pair) delete pair; if (pair_restart) delete [] pair_restart; - pair_style = NULL; - pair = NULL; - pair_restart = NULL; + pair_style = nullptr; + pair = nullptr; + pair_restart = nullptr; int sflag; pair = new_pair(style,trysuffix,sflag); @@ -270,7 +270,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (pair_map->find(style) != pair_map->end()) { PairCreator &pair_creator = (*pair_map)[style]; return pair_creator(lmp); @@ -278,7 +278,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("pair",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -296,7 +296,7 @@ Pair *Force::pair_creator(LAMMPS *lmp) if exact, then style name must be exact match to word if not exact, style name must contain word if nsub > 0, match Nth hybrid sub-style - return NULL if no match or if nsub=0 and multiple sub-styles match + return nullptr if no match or if nsub=0 and multiple sub-styles match ------------------------------------------------------------------------- */ Pair *Force::pair_match(const std::string &word, int exact, int nsub) @@ -318,13 +318,13 @@ Pair *Force::pair_match(const std::string &word, int exact, int nsub) if (count == 1) return hybrid->styles[iwhich]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- return style name of Pair class that matches Pair ptr called by Neighbor::print_neigh_info() - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ char *Force::pair_match_ptr(Pair *ptr) @@ -337,7 +337,7 @@ char *Force::pair_match_ptr(Pair *ptr) if (ptr == hybrid->styles[i]) return hybrid->keywords[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -381,7 +381,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (bond_map->find(style) != bond_map->end()) { BondCreator &bond_creator = (*bond_map)[style]; return bond_creator(lmp); @@ -389,7 +389,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("bond",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -414,7 +414,7 @@ Bond *Force::bond_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -458,7 +458,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (angle_map->find(style) != angle_map->end()) { AngleCreator &angle_creator = (*angle_map)[style]; return angle_creator(lmp); @@ -466,7 +466,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("angle",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -491,7 +491,7 @@ Angle *Force::angle_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -535,7 +535,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (dihedral_map->find(style) != dihedral_map->end()) { DihedralCreator &dihedral_creator = (*dihedral_map)[style]; return dihedral_creator(lmp); @@ -543,7 +543,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("dihedral",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -568,7 +568,7 @@ Dihedral *Force::dihedral_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -612,7 +612,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (improper_map->find(style) != improper_map->end()) { ImproperCreator &improper_creator = (*improper_map)[style]; return improper_creator(lmp); @@ -620,7 +620,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("improper",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -645,7 +645,7 @@ Improper *Force::improper_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -689,7 +689,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (kspace_map->find(style) != kspace_map->end()) { KSpaceCreator &kspace_creator = (*kspace_map)[style]; return kspace_creator(lmp); @@ -697,7 +697,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("kspace",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -714,14 +714,14 @@ KSpace *Force::kspace_creator(LAMMPS *lmp) return ptr to Kspace class if matches word if exact, then style name must be exact match to word if not exact, style name must contain word - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ KSpace *Force::kspace_match(const std::string &word, int exact) { if (exact && (word == kspace_style)) return kspace; else if (!exact && utils::strmatch(kspace_style,word)) return kspace; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/group.cpp b/src/group.cpp index a2e20a6ab..6b9121f50 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -58,7 +58,7 @@ Group::Group(LAMMPS *lmp) : Pointers(lmp) inversemask = new int[MAX_GROUP]; dynamic = new int[MAX_GROUP]; - for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL; + for (int i = 0; i < MAX_GROUP; i++) names[i] = nullptr; for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i; for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0; for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0; @@ -126,7 +126,7 @@ void Group::assign(int narg, char **arg) modify->delete_fix(std::string("GROUP_") + names[igroup]); delete [] names[igroup]; - names[igroup] = NULL; + names[igroup] = nullptr; dynamic[igroup] = 0; ngroup--; @@ -235,8 +235,8 @@ void Group::assign(int narg, char **arg) bound2 = utils::tnumeric(FLERR,arg[4],false,lmp); } else if (narg != 4) error->all(FLERR,"Illegal group command"); - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -296,8 +296,8 @@ void Group::assign(int narg, char **arg) // args = list of values } else { - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -310,9 +310,9 @@ void Group::assign(int narg, char **arg) if (strchr(arg[iarg],':')) { ptr = strtok(arg[iarg],":"); start = utils::tnumeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL,":"); + ptr = strtok(nullptr,":"); stop = utils::tnumeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL,":"); + ptr = strtok(nullptr,":"); if (ptr) delta = utils::tnumeric(FLERR,ptr,false,lmp); } else { start = stop = utils::tnumeric(FLERR,arg[iarg],false,lmp); @@ -617,7 +617,7 @@ int Group::find_or_create(const char *name) int Group::find_unused() { for (int igroup = 0; igroup < MAX_GROUP; igroup++) - if (names[igroup] == NULL) return igroup; + if (names[igroup] == nullptr) return igroup; return -1; } @@ -654,7 +654,7 @@ void Group::add_molecules(int /*igroup*/, int bit) for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; molbit = bit; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -724,7 +724,7 @@ void Group::read_restart(FILE *fp) for (i = 0; i < MAX_GROUP; i++) delete [] names[i]; - if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&ngroup,1,MPI_INT,0,world); // use count to not change restart format with deleted groups @@ -733,17 +733,17 @@ void Group::read_restart(FILE *fp) int count = 0; for (i = 0; i < MAX_GROUP; i++) { if (count == ngroup) { - names[i] = NULL; + names[i] = nullptr; continue; } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n) { names[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(names[i],n,MPI_CHAR,0,world); count++; - } else names[i] = NULL; + } else names[i] = nullptr; } } diff --git a/src/image.cpp b/src/image.cpp index 755be587d..6912bdee8 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -74,8 +74,8 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) // colors ncolors = 0; - username = NULL; - userrgb = NULL; + username = nullptr; + userrgb = nullptr; boxcolor = color2rgb("yellow"); background[0] = background[1] = background[2] = 0; @@ -112,7 +112,7 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) backLightColor[1] = 0.9; backLightColor[2] = 0.9; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1029,13 +1029,13 @@ void Image::write_PNG(FILE *fp) png_structp png_ptr; png_infop info_ptr; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (!png_ptr) return; info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, NULL); + png_destroy_write_struct(&png_ptr, nullptr); return; } @@ -1166,7 +1166,7 @@ int Image::addcolor(char *name, double r, double g, double b) if index < 0, return ptr to -index-1 color from userrgb if index = 0, search the 2 lists of color names for the string color search user-defined color names first, then the list of NCOLORS names - return a pointer to the 3 floating point RGB values or NULL if didn't find + return a pointer to the 3 floating point RGB values or nullptr if didn't find ------------------------------------------------------------------------- */ double *Image::color2rgb(const char *color, int index) @@ -1458,11 +1458,11 @@ double *Image::color2rgb(const char *color, int index) }; if (index > 0) { - if (index > NCOLORS) return NULL; + if (index > NCOLORS) return nullptr; return rgb[index-1]; } if (index < 0) { - if (-index > ncolors) return NULL; + if (-index > ncolors) return nullptr; return userrgb[-index-1]; } @@ -1472,7 +1472,7 @@ double *Image::color2rgb(const char *color, int index) for (int i = 0; i < NCOLORS; i++) if (strcmp(color,name[i]) == 0) return rgb[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1620,7 +1620,7 @@ double *Image::element2color(char *element) for (int i = 0; i < NELEMENTS; i++) if (strcmp(element,name[i]) == 0) return rgb[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1791,13 +1791,13 @@ int ColorMap::reset(int narg, char **arg) if (n+1 > narg) return 1; mentry[i].color = image->color2rgb(arg[n]); } else if (expandflag == 1) { - mentry[i].color = image->color2rgb(NULL,i+1); + mentry[i].color = image->color2rgb(nullptr,i+1); } else if (expandflag == 2) { - mentry[i].color = image->color2rgb(NULL,-(i+1)); + mentry[i].color = image->color2rgb(nullptr,-(i+1)); } n += 1; } - if (mentry[i].color == NULL) return 1; + if (mentry[i].color == nullptr) return 1; } if (mstyle == CONTINUOUS) { @@ -1915,5 +1915,5 @@ double *ColorMap::value2color(double value) return mentry[ibin%nentry].color; } - return NULL; + return nullptr; } diff --git a/src/improper.cpp b/src/improper.cpp index ad79a1a97..c657530a4 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -33,10 +33,10 @@ Improper::Improper(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 096e0c361..474d8c0c5 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -160,7 +160,7 @@ void ImproperHybrid::allocate() maximproper = new int[nstyles]; improperlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maximproper[m] = 0; - for (int m = 0; m < nstyles; m++) improperlist[m] = NULL; + for (int m = 0; m < nstyles; m++) improperlist[m] = nullptr; } /* ---------------------------------------------------------------------- */ @@ -325,7 +325,7 @@ void ImproperHybrid::write_restart(FILE *fp) void ImproperHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Improper*[nstyles]; keywords = new char*[nstyles]; @@ -334,10 +334,10 @@ void ImproperHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_improper(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/info.cpp b/src/info.cpp index 87161e9ca..3c0003db0 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -259,10 +259,10 @@ void Info::command(int narg, char **arg) } } - if (out == NULL) return; + if (out == nullptr) return; fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n",out); - time_t now = time(NULL); + time_t now = time(nullptr); fmt::print(out,"Printed on {}\n",ctime(&now)); if (flags & CONFIG) { @@ -792,7 +792,7 @@ void Info::command_styles(FILE *out) bool Info::is_active(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; const char *style = "none"; if (strcmp(category,"package") == 0) { @@ -813,7 +813,7 @@ bool Info::is_active(const char *category, const char *name) else error->all(FLERR,"Unknown name for info newton category"); } else if (strcmp(category,"pair") == 0) { - if (force->pair == NULL) return false; + if (force->pair == nullptr) return false; if (strcmp(name,"single") == 0) return (force->pair->single_enable != 0); else if (strcmp(name,"respa") == 0) return (force->pair->respa_enable != 0); else if (strcmp(name,"manybody") == 0) return (force->pair->manybody_flag != 0); @@ -867,7 +867,7 @@ bool Info::is_active(const char *category, const char *name) bool Info::is_available(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (has_style(category, name)) { return true; @@ -897,7 +897,7 @@ bool Info::is_available(const char *category, const char *name) bool Info::is_defined(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (strcmp(category,"compute") == 0) { int ncompute = modify->ncompute; @@ -1137,7 +1137,7 @@ bool Info::has_exceptions() { } bool Info::has_package(const char * package_name) { - for(int i = 0; LAMMPS::installed_packages[i] != NULL; ++i) { + for(int i = 0; LAMMPS::installed_packages[i] != nullptr; ++i) { if(strcmp(package_name, LAMMPS::installed_packages[i]) == 0) { return true; } diff --git a/src/input.cpp b/src/input.cpp index 6456f6c22..5efbdfba3 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -96,15 +96,15 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) MPI_Comm_rank(world,&me); maxline = maxcopy = maxwork = 0; - line = copy = work = NULL; + line = copy = work = nullptr; narg = maxarg = 0; - arg = NULL; + arg = nullptr; echo_screen = 0; echo_log = 1; label_active = 0; - labelstr = NULL; + labelstr = nullptr; jump_skip = 0; if (me == 0) { @@ -112,7 +112,7 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) maxfile = 16; infiles = new FILE *[maxfile]; infiles[0] = infile; - } else infiles = NULL; + } else infiles = nullptr; variable = new Variable(lmp); @@ -196,7 +196,7 @@ void Input::file() // end of file reached, so break // n == 0 if nothing read, else n = line with str terminator - if (fgets(&line[m],maxline-m,infile) == NULL) { + if (fgets(&line[m],maxline-m,infile) == nullptr) { if (m) n = strlen(line) + 1; else n = 0; break; @@ -252,7 +252,7 @@ void Input::file() // if no command, skip to next line in input script parse(); - if (command == NULL) continue; + if (command == nullptr) continue; // if scanning for label, skip command unless it's a label command @@ -292,7 +292,7 @@ void Input::file(const char *filename) error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(filename,"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", filename, utils::getsyserror())); @@ -317,7 +317,7 @@ void Input::file(const char *filename) This function takes the text in *single*, makes a copy, parses that, executes the command and returns the name of the command (without the arguments). If there was no command in *single* it will return -``NULL``. +``nullptr``. \endverbatim * @@ -338,14 +338,14 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return NULL + // if no command, just return nullptr parse(); - if (command == NULL) return NULL; + if (command == nullptr) return nullptr; // if scanning for label, skip command unless it's a label command - if (label_active && strcmp(command,"label") != 0) return NULL; + if (label_active && strcmp(command,"label") != 0) return nullptr; // execute the command and return its name @@ -423,7 +423,7 @@ void Input::parse() char *next; command = nextword(copy,&next); - if (command == NULL) return; + if (command == nullptr) return; // point arg[] at each subsequent arg in copy string // nextword() inserts string terminators into copy string to delimit args @@ -450,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or NULL if no word in string + return ptr to start of word or nullptr if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ @@ -461,16 +461,16 @@ char *Input::nextword(char *str, char **next) // start = first non-whitespace char start = &str[strspn(str," \t\n\v\f\r")]; - if (*start == '\0') return NULL; + if (*start == '\0') return nullptr; // if start is single/double/triple quote: // start = first char beyond quote // stop = first char of matching quote // next = first char beyond matching quote - // next must be NULL or whitespace + // next must be nullptr or whitespace // if start is not single/double/triple quote: // stop = first whitespace char after start - // next = char after stop, or stop itself if stop is NULL + // next = char after stop, or stop itself if stop is nullptr if (strstr(start,"\"\"\"") == start) { stop = strstr(&start[3],"\"\"\""); @@ -492,7 +492,7 @@ char *Input::nextword(char *str, char **next) else *next = stop+1; } - // set stop to NULL to terminate word + // set stop to nullptr to terminate word *stop = '\0'; return start; @@ -510,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) // use str2 as scratch space to expand str, then copy back to str // reallocate str and str2 as necessary // do not replace $ inside single/double/triple quotes - // var = pts at variable name, ended by NULL - // if $ is followed by '{', trailing '}' becomes NULL - // else $x becomes x followed by NULL + // var = pts at variable name, ended by nullptr + // if $ is followed by '{', trailing '}' becomes nullptr + // else $x becomes x followed by nullptr // beyond = points to text following variable int i,n,paren_count; @@ -593,7 +593,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) value = variable->retrieve(var); } - if (value == NULL) + if (value == nullptr) error->one(FLERR,fmt::format("Substitution for illegal " "variable {}",var)); @@ -950,7 +950,7 @@ void Input::include() error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -984,7 +984,7 @@ void Input::jump() else { if (infile && infile != stdin) fclose(infile); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -1023,12 +1023,12 @@ void Input::log() if (me == 0) { if (logfile) fclose(logfile); - if (strcmp(arg[0],"none") == 0) logfile = NULL; + if (strcmp(arg[0],"none") == 0) logfile = nullptr; else { if (appendflag) logfile = fopen(arg[0],"a"); else logfile = fopen(arg[0],"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", arg[0], utils::getsyserror())); @@ -1063,8 +1063,8 @@ void Input::partition() strcpy(copy,line); char *ptr = strtok(copy," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ptr += strlen(ptr) + 1; ptr += strspn(ptr," \t\n\r\f"); @@ -1094,7 +1094,7 @@ void Input::print() // parse optional args - FILE *fp = NULL; + FILE *fp = nullptr; int screenflag = 1; int universeflag = 0; @@ -1103,10 +1103,10 @@ void Input::print() if (strcmp(arg[iarg],"file") == 0 || strcmp(arg[iarg],"append") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal print command"); if (me == 0) { - if (fp != NULL) fclose(fp); + if (fp != nullptr) fclose(fp); if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open print file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -1237,9 +1237,9 @@ void Input::shell() char *ptr = strdup(arg[i]); rv = 0; #ifdef _WIN32 - if (ptr != NULL) rv = _putenv(ptr); + if (ptr != nullptr) rv = _putenv(ptr); #else - if (ptr != NULL) rv = putenv(ptr); + if (ptr != nullptr) rv = putenv(ptr); #endif rv = (rv < 0) ? errno : 0; MPI_Reduce(&rv,&err,1,MPI_INT,MPI_MAX,0,world); @@ -1291,7 +1291,7 @@ void Input::angle_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Angle_coeff command before simulation box is defined"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle_coeff command before angle_style is defined"); if (atom->avec->angles_allow == 0) error->all(FLERR,"Angle_coeff command when no angles allowed"); @@ -1332,7 +1332,7 @@ void Input::bond_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Bond_coeff command before simulation box is defined"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_coeff command before bond_style is defined"); if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_coeff command when no bonds allowed"); @@ -1356,7 +1356,7 @@ void Input::bond_write() { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_write command when no bonds allowed"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_write command before bond_style is defined"); else force->bond->write_file(narg,arg); } @@ -1435,7 +1435,7 @@ void Input::dihedral_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Dihedral_coeff command before simulation box is defined"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined"); if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed"); @@ -1512,7 +1512,7 @@ void Input::improper_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Improper_coeff command before simulation box is defined"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Improper_coeff command before improper_style is defined"); if (atom->avec->impropers_allow == 0) error->all(FLERR,"Improper_coeff command when no impropers allowed"); @@ -1534,7 +1534,7 @@ void Input::improper_style() void Input::kspace_modify() { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"KSpace style has not yet been set"); force->kspace->modify_params(narg,arg); } @@ -1650,7 +1650,7 @@ void Input::package() modify->add_fix(fixcmd); } else if (strcmp(arg[0],"kokkos") == 0) { - if (lmp->kokkos == NULL || lmp->kokkos->kokkos_exists == 0) + if (lmp->kokkos == nullptr || lmp->kokkos->kokkos_exists == 0) error->all(FLERR, "Package kokkos command without KOKKOS package enabled"); lmp->kokkos->accelerator(narg-1,&arg[1]); @@ -1682,7 +1682,7 @@ void Input::pair_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Pair_coeff command before simulation box is defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_coeff command before pair_style is defined"); force->pair->coeff(narg,arg); } @@ -1691,7 +1691,7 @@ void Input::pair_coeff() void Input::pair_modify() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_modify command before pair_style is defined"); force->pair->modify_params(narg,arg); } @@ -1729,7 +1729,7 @@ void Input::pair_style() void Input::pair_write() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_write command before pair_style is defined"); force->pair->write_file(narg,arg); } diff --git a/src/integrate.cpp b/src/integrate.cpp index 1f50ff76c..720e8ba27 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -25,8 +25,8 @@ using namespace LAMMPS_NS; Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char **/*arg*/) : Pointers(lmp) { - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; external_force_clear = 0; } @@ -74,8 +74,8 @@ void Integrate::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/irregular.cpp b/src/irregular.cpp index fbb572fd8..c5ce94e40 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -52,15 +52,15 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // migrate work vectors maxlocal = 0; - mproclist = NULL; - msizes = NULL; + mproclist = nullptr; + msizes = nullptr; // send buffers maxdbuf = 0; - dbuf = NULL; + dbuf = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; // universal work vectors @@ -70,7 +70,7 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // initialize buffers for migrate atoms, not used for datum comm // these can persist for multiple irregular operations - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; bufextra = BUFEXTRA; grow_send(maxsend,2); diff --git a/src/irregular.h b/src/irregular.h index 01fe40c46..d601f1586 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -30,7 +30,7 @@ class Irregular : protected Pointers { Irregular(class LAMMPS *); ~Irregular(); void migrate_atoms(int sortflag = 0, int preassign = 0, - int *procassign = NULL); + int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); int create_data_grouped(int, int *, int sortflag = 0); diff --git a/src/kspace.cpp b/src/kspace.cpp index e51cc54c9..117ae5465 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -86,8 +86,8 @@ KSpace::KSpace(LAMMPS *lmp) : Pointers(lmp) splittol = 1.0e-6; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -188,7 +188,7 @@ void KSpace::compute_dummy(int eflag, int vflag) void KSpace::pair_check() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"KSpace solver requires a pair style"); if (ewaldflag && !force->pair->ewaldflag) @@ -610,5 +610,5 @@ void KSpace::modify_params(int narg, char **arg) void *KSpace::extract(const char *str) { if (strcmp(str,"scale") == 0) return (void *) &scale; - return NULL; + return nullptr; } diff --git a/src/lammps.cpp b/src/lammps.cpp index f6952354b..1d655f6fc 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -105,22 +105,22 @@ using namespace LAMMPS_NS; * \param communicator MPI communicator used by this LAMMPS instance */ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : - memory(NULL), error(NULL), universe(NULL), input(NULL), atom(NULL), - update(NULL), neighbor(NULL), comm(NULL), domain(NULL), force(NULL), - modify(NULL), group(NULL), output(NULL), timer(NULL), kokkos(NULL), - atomKK(NULL), memoryKK(NULL), python(NULL), citeme(NULL) + memory(nullptr), error(nullptr), universe(nullptr), input(nullptr), atom(nullptr), + update(nullptr), neighbor(nullptr), comm(nullptr), domain(nullptr), force(nullptr), + modify(nullptr), group(nullptr), output(nullptr), timer(nullptr), kokkos(nullptr), + atomKK(nullptr), memoryKK(nullptr), python(nullptr), citeme(nullptr) { memory = new Memory(this); error = new Error(this); universe = new Universe(this,communicator); clientserver = 0; - cslib = NULL; + cslib = nullptr; cscomm = 0; - screen = NULL; - logfile = NULL; - infile = NULL; + screen = nullptr; + logfile = nullptr; + infile = nullptr; initclock = MPI_Wtime(); @@ -170,19 +170,19 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : int citeflag = 1; int helpflag = 0; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 0; if (arg) exename = arg[0]; - else exename = NULL; - packargs = NULL; + else exename = nullptr; + packargs = nullptr; num_package = 0; - char *restartfile = NULL; + char *restartfile = nullptr; int wfirst,wlast; int kkfirst,kklast; int npack = 0; - int *pfirst = NULL; - int *plast = NULL; + int *pfirst = nullptr; + int *plast = nullptr; iarg = 1; while (iarg < narg) { @@ -348,7 +348,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : error->universe_all(FLERR,"Invalid command-line argument"); delete [] suffix; delete [] suffix2; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 1; // hybrid option to set fall-back for suffix2 if (strcmp(arg[iarg+1],"hybrid") == 0) { @@ -380,7 +380,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // if no partition command-line switch, universe is one world with all procs - if (universe->existflag == 0) universe->add_world(NULL); + if (universe->existflag == 0) universe->add_world(nullptr); // sum of procs in all worlds must equal total # of procs @@ -409,10 +409,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (screenflag == 0) universe->uscreen = stdout; else if (strcmp(arg[screenflag],"none") == 0) - universe->uscreen = NULL; + universe->uscreen = nullptr; else { universe->uscreen = fopen(arg[screenflag],"w"); - if (universe->uscreen == NULL) + if (universe->uscreen == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe screen " "file {}: {}",arg[screenflag], utils::getsyserror())); @@ -420,15 +420,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { if (helpflag == 0) { universe->ulogfile = fopen("log.lammps","w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_warn(FLERR,"Cannot open log.lammps for writing: " + utils::getsyserror()); } } else if (strcmp(arg[logflag],"none") == 0) - universe->ulogfile = NULL; + universe->ulogfile = nullptr; else { universe->ulogfile = fopen(arg[logflag],"w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe log " "file {}: {}",arg[logflag], utils::getsyserror())); @@ -437,8 +437,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me > 0) { if (screenflag == 0) universe->uscreen = stdout; - else universe->uscreen = NULL; - universe->ulogfile = NULL; + else universe->uscreen = nullptr; + universe->ulogfile = nullptr; } // make universe and single world the same, since no partition switch @@ -454,7 +454,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me == 0) { if (inflag == 0) infile = stdin; else infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } @@ -472,31 +472,31 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : MPI_Comm_split(universe->uworld,universe->iworld,0,&world); MPI_Comm_rank(world,&me); - screen = logfile = infile = NULL; + screen = logfile = infile = nullptr; if (me == 0) { std::string str; if (partscreenflag == 0) { if (screenflag == 0) { str = fmt::format("screen.{}",universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } else if (strcmp(arg[screenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[screenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", arg[screenflag],utils::getsyserror())); } } else if (strcmp(arg[partscreenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[partscreenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } @@ -505,30 +505,30 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { str = fmt::format("log.lammps.{}",universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } else if (strcmp(arg[logflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[logflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } } else if (strcmp(arg[partlogflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[partlogflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } @@ -590,7 +590,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // instantiation creates dummy Kokkos class if KOKKOS is not installed // add args between kkfirst and kklast to Kokkos instantiation - kokkos = NULL; + kokkos = nullptr; if (kokkosflag == 1) { kokkos = new KokkosLMP(this,kklast-kkfirst,&arg[kkfirst]); if (!kokkos->kokkos_exists) @@ -600,7 +600,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // allocate CiteMe class if enabled if (citeflag) citeme = new CiteMe(this); - else citeme = NULL; + else citeme = nullptr; // allocate input class now that MPI is fully setup @@ -616,7 +616,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : packargs[i] = new char*[n+1]; for (int j=0; j < n; ++j) packargs[i][j] = strdup(arg[pfirst[i]+j]); - packargs[i][n] = NULL; + packargs[i][n] = nullptr; } memory->destroy(pfirst); memory->destroy(plast); @@ -668,14 +668,14 @@ LAMMPS::~LAMMPS() if (num_package) { for (int i = 0; i < num_package; i++) { - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) free(*ptr); delete[] packargs[i]; } delete[] packargs; } num_package = 0; - packargs = NULL; + packargs = nullptr; double totalclock = MPI_Wtime() - initclock; if ((me == 0) && (screen || logfile)) { @@ -690,14 +690,14 @@ LAMMPS::~LAMMPS() if (universe->nworlds == 1) { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } else { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); if (universe->ulogfile) fclose(universe->ulogfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } if (infile && infile != stdin) fclose(infile); @@ -733,7 +733,7 @@ LAMMPS::~LAMMPS() void LAMMPS::create() { - force = NULL; // Domain->Lattice checks if Force exists + force = nullptr; // Domain->Lattice checks if Force exists // Comm class must be created before Atom class // so that nthreads is defined when create_avec invokes grow() @@ -755,9 +755,9 @@ void LAMMPS::create() else atom = new Atom(this); if (kokkos) - atom->create_avec("atomic/kk",0,NULL,1); + atom->create_avec("atomic/kk",0,nullptr,1); else - atom->create_avec("atomic",0,NULL,1); + atom->create_avec("atomic",0,nullptr,1); group = new Group(this); force = new Force(this); // must be after group, to create temperature @@ -799,7 +799,7 @@ void LAMMPS::post_create() if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); if (strcmp(suffix,"kk") == 0 && - (kokkos == NULL || kokkos->kokkos_exists == 0)) + (kokkos == nullptr || kokkos->kokkos_exists == 0)) error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) error->all(FLERR,"Using suffix omp without USER-OMP package installed"); @@ -821,7 +821,7 @@ void LAMMPS::post_create() char str[256]; for (int i = 0; i < num_package; i++) { strcpy(str,"package"); - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) { + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) { if (strlen(str) + strlen(*ptr) + 2 > 256) error->all(FLERR,"Too many -pk arguments in command line"); strcat(str," "); @@ -861,41 +861,41 @@ void LAMMPS::init() void LAMMPS::destroy() { delete update; - update = NULL; + update = nullptr; delete neighbor; - neighbor = NULL; + neighbor = nullptr; delete force; - force = NULL; + force = nullptr; delete group; - group = NULL; + group = nullptr; delete output; - output = NULL; + output = nullptr; delete modify; // modify must come after output, force, update // since they delete fixes - modify = NULL; + modify = nullptr; delete comm; // comm must come after modify // since fix destructors may access comm - comm = NULL; + comm = nullptr; delete domain; // domain must come after modify // since fix destructors access domain - domain = NULL; + domain = nullptr; delete atom; // atom must come after modify, neighbor // since fixes delete callbacks in atom - atom = NULL; + atom = nullptr; delete timer; - timer = NULL; + timer = nullptr; delete python; - python = NULL; + python = nullptr; } /* ---------------------------------------------------------------------- @@ -1011,7 +1011,7 @@ void _noopt LAMMPS::init_pkg_lists() */ bool LAMMPS::is_installed_pkg(const char *pkg) { - for (int i=0; installed_packages[i] != NULL; ++i) + for (int i=0; installed_packages[i] != nullptr; ++i) if (strcmp(installed_packages[i],pkg) == 0) return true; return false; @@ -1053,7 +1053,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) check_for_match(pair,style,name); check_for_match(reader,style,name); check_for_match(region,style,name); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1063,7 +1063,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) void _noopt LAMMPS::help() { FILE *fp = screen; - const char *pager = NULL; + const char *pager = nullptr; // if output is "stdout", use a pipe to a pager for paged output. // this will avoid the most important help text to rush past the @@ -1072,7 +1072,7 @@ void _noopt LAMMPS::help() if (fp == stdout) { pager = getenv("PAGER"); - if (pager == NULL) pager = "more"; + if (pager == nullptr) pager = "more"; #if defined(_WIN32) fp = _popen(pager,"w"); #else @@ -1080,9 +1080,9 @@ void _noopt LAMMPS::help() #endif // reset to original state, if pipe command failed - if (fp == NULL) { + if (fp == nullptr) { fp = stdout; - pager = NULL; + pager = nullptr; } } @@ -1236,7 +1236,7 @@ void _noopt LAMMPS::help() // close pipe to pager, if active - if (pager != NULL) pclose(fp); + if (pager != nullptr) pclose(fp); } /* ---------------------------------------------------------------------- @@ -1309,7 +1309,7 @@ void LAMMPS::print_config(FILE *fp) sizeof(tagint)*8, sizeof(bigint)*8); fputs("\nInstalled packages:\n\n",fp); - for (int i = 0; NULL != (pkg = installed_packages[i]); ++i) { + for (int i = 0; nullptr != (pkg = installed_packages[i]); ++i) { ncword = strlen(pkg); if (ncline + ncword > 78) { ncline = 0; diff --git a/src/lattice.cpp b/src/lattice.cpp index 68f3e7abe..625e243d6 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { nbasis = 0; - basis = NULL; + basis = nullptr; // parse style arg @@ -164,7 +164,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) else if (strcmp(arg[iarg+1],"y") == 0) dim = 1; else if (strcmp(arg[iarg+1],"z") == 0) dim = 2; else error->all(FLERR,"Illegal lattice command"); - int *orient = NULL; + int *orient = nullptr; if (dim == 0) orient = orientx; else if (dim == 1) orient = orienty; else if (dim == 2) orient = orientz; diff --git a/src/library.cpp b/src/library.cpp index 0e0c4070e..2e3545783 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -105,7 +105,7 @@ LAMMPS executable, and an MPI communicator for LAMMPS to run under. Since the list of arguments is **exactly** as when called from the command line, the first argument would be the name of the executable and thus is otherwise ignored. However ``argc`` may be set to 0 and then -``argv`` may be ``NULL``. If MPI is not yet initialized, ``MPI_Init()`` +``argv`` may be ``nullptr``. If MPI is not yet initialized, ``MPI_Init()`` will be called during creation of the LAMMPS class instance. If for some reason the creation or initialization of the LAMMPS instance @@ -117,7 +117,7 @@ fails a null pointer is returned. instance as return value. For backward compatibility it is still possible to provide the address of a pointer variable as final argument *ptr*\ . This use is deprecated and may be removed in - the future. The *ptr* argument may be ``NULL`` and is then ignored. + the future. The *ptr* argument may be ``nullptr`` and is then ignored. .. note:: @@ -133,12 +133,12 @@ fails a null pointer is returned. * \param argv list of command line argument strings * \param comm MPI communicator for this LAMMPS instance * \param ptr pointer to a void pointer variable which serves - * as a handle; may be ``NULL`` + * as a handle; may be ``nullptr`` * \return pointer to new LAMMPS instance cast to ``void *`` */ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) { - LAMMPS *lmp = NULL; + LAMMPS *lmp = nullptr; lammps_mpi_init(); #ifdef LAMMPS_EXCEPTIONS @@ -149,7 +149,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) } catch(LAMMPSException & e) { fmt::print(stderr, "LAMMPS Exception: {}", e.message); - *ptr = (void *) NULL; + *ptr = nullptr; } #else lmp = new LAMMPS(argc, argv, comm); @@ -183,14 +183,14 @@ fails a null pointer is returned. instance as return value. For backward compatibility it is still possible to provide the address of a pointer variable as final argument *ptr*\ . This use is deprecated and may be removed in - the future. The *ptr* argument may be ``NULL`` and is then ignored. + the future. The *ptr* argument may be ``nullptr`` and is then ignored. \endverbatim * * \param argc number of command line arguments * \param argv list of command line argument strings * \param ptr pointer to a void pointer variable - * which serves as a handle; may be ``NULL`` + * which serves as a handle; may be ``nullptr`` * \return pointer to new LAMMPS instance cast to ``void *`` */ void *lammps_open_no_mpi(int argc, char **argv, void **ptr) @@ -275,7 +275,7 @@ void lammps_mpi_init() if (!flag) { // provide a dummy argc and argv for MPI_Init(). int argc = 1; - char *args[] = { (char *)"liblammps" , NULL }; + char *args[] = { (char *)"liblammps" , nullptr }; char **argv = args; MPI_Init(&argc,&argv); } @@ -375,19 +375,19 @@ string, however, will be treated as part of the command and will **not** start a second command. The function :cpp:func:`lammps_commands_string` processes a string with multiple command lines. -The function returns the name of the command on success or ``NULL`` when +The function returns the name of the command on success or ``nullptr`` when passing a string without a command. \endverbatim * * \param handle pointer to a previously created LAMMPS instance * \param cmd string with a single LAMMPS command - * \return string with parsed command name or ``NULL`` */ + * \return string with parsed command name or ``nullptr`` */ char *lammps_command(void *handle, const char *cmd) { LAMMPS *lmp = (LAMMPS *) handle; - char *result = NULL; + char *result = nullptr; BEGIN_CAPTURE { @@ -639,7 +639,7 @@ double lammps_get_thermo(void *handle, char *keyword) This function (re-)initializes the simulation box and boundary information and then assign the designated data to the locations in the pointers passed as arguments. Any argument (except the first) may be -a NULL pointer and then will not be assigned. +a nullptr pointer and then will not be assigned. \endverbatim * @@ -1071,7 +1071,7 @@ to be either an ``int`` or an ``int64_t``. This is selected at * \param handle pointer to a previously created LAMMPS instance * \param name string with the name of the extracted property * \return pointer (cast to ``void *``) to the location of the - requested property. NULL if name is not known. */ + requested property. nullptr if name is not known. */ void *lammps_extract_global(void *handle, char *name) { @@ -1134,7 +1134,7 @@ void *lammps_extract_global(void *handle, char *name) if (strcmp(name,"femtosecond") == 0) return (void *) &lmp->force->femtosecond; if (strcmp(name,"qelectron") == 0) return (void *) &lmp->force->qelectron; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1163,7 +1163,7 @@ of the :cpp:func:`Atom::extract() ` function. * \param handle pointer to a previously created LAMMPS instance * \param name string with the name of the extracted property * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_atom(void *handle, char *name) { @@ -1213,13 +1213,13 @@ X(1),Y(1),Z(1),X(2),Y(2),Z(2),...,X(N),Y(N),Z(N). * * \param handle pointer to a previously created LAMMPS instance * \param n number of atoms, N, to be added to the system - * \param id pointer to N atom IDs; ``NULL`` will generate IDs + * \param id pointer to N atom IDs; ``nullptr`` will generate IDs * \param type pointer to N atom types (required) * \param x pointer to 3N doubles with x-,y-,z- positions of the new atoms (required) * \param v pointer to 3N doubles with x-,y-,z- velocities - of the new atoms (set to 0.0 if ``NULL``) - * \param image pointer to N imageint sets of image flags, or ``NULL`` + of the new atoms (set to 0.0 if ``nullptr``) + * \param image pointer to N imageint sets of image flags, or ``nullptr`` * \param bexpand if 1, atoms outside of shrink-wrap boundaries will still be created and not dropped and the box extended * \return number of atoms created on success; @@ -1267,7 +1267,7 @@ int lammps_create_atoms(void *handle, int n, tagint *id, int *type, xdata[0] = x[3*i]; xdata[1] = x[3*i+1]; xdata[2] = x[3*i+2]; - imageint * img = image ? image + i : NULL; + imageint * img = image ? image + i : nullptr; tagint tag = id ? id[i] : 0; // create atom only on MPI rank that would own it @@ -1288,7 +1288,7 @@ int lammps_create_atoms(void *handle, int n, tagint *id, int *type, // if no tags are given explicitly, create new and unique tags - if (id == NULL) atom->tag_extend(); + if (id == nullptr) atom->tag_extend(); // reset box info, if extended when adding atoms. @@ -1332,7 +1332,7 @@ dimensions of the respective data. Since computes may provide multiple kinds of data, it is required to set style and type flags representing what specific data is desired. This also determines to what kind of pointer the returned pointer needs to be cast to access the data -correctly. The function returns ``NULL`` if the compute ID is not found +correctly. The function returns ``nullptr`` if the compute ID is not found or the requested data is not available or current. The following table lists the available options. @@ -1420,7 +1420,7 @@ be used after other LAMMPS commands have been issued. * \param type constant indicating type of data (scalar, vector, or array) or size of rows or columns * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_compute(void *handle, char *id, int style, int type) { @@ -1429,18 +1429,18 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) BEGIN_CAPTURE { int icompute = lmp->modify->find_compute(id); - if (icompute < 0) return NULL; + if (icompute < 0) return nullptr; Compute *compute = lmp->modify->compute[icompute]; if (style == LMP_STYLE_GLOBAL) { if (type == LMP_TYPE_SCALAR) { - if (!compute->scalar_flag) return NULL; + if (!compute->scalar_flag) return nullptr; if (compute->invoked_scalar != lmp->update->ntimestep) compute->compute_scalar(); return (void *) &compute->scalar; } if ((type == LMP_TYPE_VECTOR) || (type == LMP_SIZE_VECTOR)) { - if (!compute->vector_flag) return NULL; + if (!compute->vector_flag) return nullptr; if (compute->invoked_vector != lmp->update->ntimestep) compute->compute_vector(); if (type == LMP_TYPE_VECTOR) @@ -1449,7 +1449,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) return (void *) &compute->size_vector; } if ((type == LMP_TYPE_ARRAY) || (type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { - if (!compute->array_flag) return NULL; + if (!compute->array_flag) return nullptr; if (compute->invoked_array != lmp->update->ntimestep) compute->compute_array(); if (type == LMP_TYPE_ARRAY) @@ -1462,7 +1462,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } if (style == LMP_STYLE_ATOM) { - if (!compute->peratom_flag) return NULL; + if (!compute->peratom_flag) return nullptr; if (compute->invoked_peratom != lmp->update->ntimestep) compute->compute_peratom(); if (type == LMP_TYPE_VECTOR) return (void *) compute->vector_atom; @@ -1471,7 +1471,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } if (style == LMP_STYLE_LOCAL) { - if (!compute->local_flag) return NULL; + if (!compute->local_flag) return nullptr; if (compute->invoked_local != lmp->update->ntimestep) compute->compute_local(); if (type == LMP_TYPE_SCALAR) return (void *) &compute->size_local_rows; /* for backward compatibility */ @@ -1483,7 +1483,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1500,7 +1500,7 @@ Since individual fixes may provide multiple kinds of data, it is required to set style and type flags representing what specific data is desired. This also determines to what kind of pointer the returned pointer needs to be cast to access the data correctly. The function -returns ``NULL`` if the fix ID is not found or the requested data is not +returns ``nullptr`` if the fix ID is not found or the requested data is not available. .. note:: @@ -1604,7 +1604,7 @@ been issued. * \param nrow row index (only used for global vectors and arrays) * \param ncol column index (only used for global arrays) * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_fix(void *handle, char *id, int style, int type, int nrow, int ncol) @@ -1614,34 +1614,34 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, BEGIN_CAPTURE { int ifix = lmp->modify->find_fix(id); - if (ifix < 0) return NULL; + if (ifix < 0) return nullptr; Fix *fix = lmp->modify->fix[ifix]; if (style == LMP_STYLE_GLOBAL) { if (type == LMP_TYPE_SCALAR) { - if (!fix->scalar_flag) return NULL; + if (!fix->scalar_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_scalar(); return (void *) dptr; } if (type == LMP_TYPE_VECTOR) { - if (!fix->vector_flag) return NULL; + if (!fix->vector_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_vector(nrow); return (void *) dptr; } if (type == LMP_TYPE_ARRAY) { - if (!fix->array_flag) return NULL; + if (!fix->array_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_array(nrow,ncol); return (void *) dptr; } if (type == LMP_SIZE_VECTOR) { - if (!fix->vector_flag) return NULL; + if (!fix->vector_flag) return nullptr; return (void *) &fix->size_vector; } if ((type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { - if (!fix->array_flag) return NULL; + if (!fix->array_flag) return nullptr; if (type == LMP_SIZE_ROWS) return (void *) &fix->size_array_rows; else @@ -1650,14 +1650,14 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, } if (style == LMP_STYLE_ATOM) { - if (!fix->peratom_flag) return NULL; + if (!fix->peratom_flag) return nullptr; if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_atom; if (type == LMP_TYPE_ARRAY) return (void *) fix->array_atom; if (type == LMP_SIZE_COLS) return (void *) &fix->size_peratom_cols; } if (style == LMP_STYLE_LOCAL) { - if (!fix->local_flag) return NULL; + if (!fix->local_flag) return nullptr; if (type == LMP_TYPE_SCALAR) return (void *) &fix->size_local_rows; if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_local; if (type == LMP_TYPE_ARRAY) return (void *) fix->array_local; @@ -1667,7 +1667,7 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1681,9 +1681,9 @@ identified by its name. The variable must be either an *equal*\ -style compatible or an *atom*\ -style variable. Variables of style *internal* are compatible with *equal*\ -style variables and so are *python*\ -style variables, if they return a numeric value. The function returns -``NULL`` when a variable of the provided *name* is not found or of an +``nullptr`` when a variable of the provided *name* is not found or of an incompatible style. The *group* argument is only used for *atom*\ --style variables and ignored otherwise. If set to ``NULL`` when +-style variables and ignored otherwise. If set to ``nullptr`` when extracting data from and *atom*\ -style variable, the group is assumed to be "all". @@ -1697,7 +1697,7 @@ to be "all". .. code-block:: c - double *dptr = (double *) lammps_extract_variable(handle,name,NULL); + double *dptr = (double *) lammps_extract_variable(handle,name,nullptr); double value = *dptr; lammps_free((void *)dptr); @@ -1720,9 +1720,9 @@ values will not be updated, in case the variable is re-evaluated. * * \param handle pointer to a previously created LAMMPS instance * \param name name of the variable - * \param group group-ID for atom style variable or ``NULL`` + * \param group group-ID for atom style variable or ``nullptr`` * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_variable(void *handle, char *name, char *group) { @@ -1731,7 +1731,7 @@ void *lammps_extract_variable(void *handle, char *name, char *group) BEGIN_CAPTURE { int ivar = lmp->input->variable->find(name); - if (ivar < 0) return NULL; + if (ivar < 0) return nullptr; if (lmp->input->variable->equalstyle(ivar)) { double *dptr = (double *) malloc(sizeof(double)); @@ -1740,9 +1740,9 @@ void *lammps_extract_variable(void *handle, char *name, char *group) } if (lmp->input->variable->atomstyle(ivar)) { - if (group == NULL) group = (char *)"all"; + if (group == nullptr) group = (char *)"all"; int igroup = lmp->group->find(group); - if (igroup < 0) return NULL; + if (igroup < 0) return nullptr; int nlocal = lmp->atom->nlocal; double *vector = (double *) malloc(nlocal*sizeof(double)); lmp->input->variable->compute_atom(ivar,igroup,vector,1,0); @@ -1751,7 +1751,7 @@ void *lammps_extract_variable(void *handle, char *name, char *group) } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1845,7 +1845,7 @@ void lammps_gather_atoms(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -1855,8 +1855,8 @@ void lammps_gather_atoms(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -1894,8 +1894,8 @@ void lammps_gather_atoms(void *handle, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -1985,7 +1985,7 @@ void lammps_gather_atoms_concat(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -1999,8 +1999,8 @@ void lammps_gather_atoms_concat(void *handle, char *name, lmp->memory->create(displs,nprocs,"lib/gather:displs"); if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2050,8 +2050,8 @@ void lammps_gather_atoms_concat(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2145,7 +2145,7 @@ void lammps_gather_atoms_subset(void *handle, char *name, } void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms_subset: " "unknown property name"); return; @@ -2156,8 +2156,8 @@ void lammps_gather_atoms_subset(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2203,8 +2203,8 @@ void lammps_gather_atoms_subset(void *handle, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2296,7 +2296,7 @@ void lammps_scatter_atoms(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms: unknown property name"); return; @@ -2307,8 +2307,8 @@ void lammps_scatter_atoms(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -2340,8 +2340,8 @@ void lammps_scatter_atoms(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -2424,7 +2424,7 @@ void lammps_scatter_atoms_subset(void *handle, char *name, } void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms_subset: unknown property name"); return; @@ -2435,8 +2435,8 @@ void lammps_scatter_atoms_subset(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -2474,8 +2474,8 @@ void lammps_scatter_atoms_subset(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -2565,7 +2565,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2596,7 +2596,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2624,7 +2624,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -2645,7 +2645,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather: unknown property name"); return; } @@ -2654,8 +2654,8 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) // use atom ID to insert each atom's values into copy // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type==0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); @@ -2695,8 +2695,8 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2786,7 +2786,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2818,7 +2818,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2846,7 +2846,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -2869,7 +2869,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_concat: unknown property name"); return; } @@ -2883,8 +2883,8 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data lmp->memory->create(displs,nprocs,"lib/gather:displs"); if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2934,8 +2934,8 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -3031,7 +3031,7 @@ void lammps_gather_subset(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3063,7 +3063,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3091,7 +3091,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3114,7 +3114,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_subset: " "unknown property name"); return; @@ -3125,8 +3125,8 @@ void lammps_gather_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -3172,8 +3172,8 @@ void lammps_gather_subset(void *ptr, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -3273,7 +3273,7 @@ void lammps_scatter(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3298,7 +3298,7 @@ void lammps_scatter(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3326,7 +3326,7 @@ void lammps_scatter(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3346,7 +3346,7 @@ void lammps_scatter(void *ptr, char *name, } - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR,"lammps_scatter: unknown property name"); return; } @@ -3356,8 +3356,8 @@ void lammps_scatter(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -3389,8 +3389,8 @@ void lammps_scatter(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -3475,7 +3475,7 @@ void lammps_scatter_subset(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3500,7 +3500,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3528,7 +3528,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3551,7 +3551,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR,"lammps_scatter_atoms_subset: " "unknown property name"); return; @@ -3562,8 +3562,8 @@ void lammps_scatter_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -3601,8 +3601,8 @@ void lammps_scatter_subset(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -3741,7 +3741,7 @@ included in the LAMMPS library in use. */ int lammps_config_package_count() { int i = 0; - while(LAMMPS::installed_packages[i] != NULL) { + while(LAMMPS::installed_packages[i] != nullptr) { ++i; } return i; @@ -3987,7 +3987,7 @@ int lammps_find_pair_neighlist(void* handle, char * style, int exact, int nsub, LAMMPS * lmp = (LAMMPS *) handle; Pair* pair = lmp->force->pair_match(style, exact, nsub); - if (pair != NULL) { + if (pair != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4013,7 +4013,7 @@ int lammps_find_pair_neighlist(void* handle, char * style, int exact, int nsub, */ int lammps_find_fix_neighlist(void* handle, char * id, int request) { LAMMPS * lmp = (LAMMPS *) handle; - Fix* fix = NULL; + Fix* fix = nullptr; const int nfix = lmp->modify->nfix; // find fix with name @@ -4024,7 +4024,7 @@ int lammps_find_fix_neighlist(void* handle, char * id, int request) { } } - if (fix != NULL) { + if (fix != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4050,7 +4050,7 @@ int lammps_find_fix_neighlist(void* handle, char * id, int request) { */ int lammps_find_compute_neighlist(void* handle, char * id, int request) { LAMMPS * lmp = (LAMMPS *) handle; - Compute* compute = NULL; + Compute* compute = nullptr; const int ncompute = lmp->modify->ncompute; // find compute with name @@ -4061,7 +4061,7 @@ int lammps_find_compute_neighlist(void* handle, char * id, int request) { } } - if (compute == NULL) { + if (compute == nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4108,14 +4108,14 @@ int lammps_neighlist_num_elements(void * handle, int idx) { invalid idx or element value * \param[out] numneigh number of neighbors of atom iatom or 0 * \param[out] neighbors pointer to array of neighbor atom local indices or - * NULL + * nullptr */ void lammps_neighlist_element_neighbors(void * handle, int idx, int element, int * iatom, int * numneigh, int ** neighbors) { LAMMPS * lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; *iatom = -1; *numneigh = 0; - *neighbors = NULL; + *neighbors = nullptr; if(idx < 0 || idx >= neighbor->nlist) { return; diff --git a/src/lmppython.cpp b/src/lmppython.cpp index 67bbca15b..080a22cb6 100644 --- a/src/lmppython.cpp +++ b/src/lmppython.cpp @@ -26,7 +26,7 @@ Python::Python(LAMMPS *lmp) : Pointers(lmp) { // implementation of Python interface is only loaded on demand // and only if PYTHON package has been installed and compiled into binary - impl = NULL; + impl = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/memory.cpp b/src/memory.cpp index bbbc233bb..f0d8976ad 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -45,7 +45,7 @@ Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {} void *Memory::smalloc(bigint nbytes, const char *name) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; #if defined(LAMMPS_MEMALIGN) void *ptr; @@ -54,13 +54,13 @@ void *Memory::smalloc(bigint nbytes, const char *name) ptr = scalable_aligned_malloc(nbytes, LAMMPS_MEMALIGN); #else int retval = posix_memalign(&ptr, LAMMPS_MEMALIGN, nbytes); - if (retval) ptr = NULL; + if (retval) ptr = nullptr; #endif #else void *ptr = malloc(nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to allocate {} bytes for array {}", nbytes,name)); return ptr; @@ -74,7 +74,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) { if (nbytes == 0) { destroy(ptr); - return NULL; + return nullptr; } #if defined(LMP_USE_TBB_ALLOCATOR) @@ -99,7 +99,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) #else ptr = realloc(ptr,nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to reallocate {} bytes for array {}", nbytes,name)); return ptr; @@ -111,7 +111,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) void Memory::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; #if defined(LMP_USE_TBB_ALLOCATOR) scalable_aligned_free(ptr); #else diff --git a/src/memory.h b/src/memory.h index 42c9bf6ab..1fc82c990 100644 --- a/src/memory.h +++ b/src/memory.h @@ -50,7 +50,7 @@ class Memory : protected Pointers { template TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1d array @@ -59,7 +59,7 @@ class Memory : protected Pointers { template TYPE *grow(TYPE *&array, int n, const char *name) { - if (array == NULL) return create(array,n,name); + if (array == nullptr) return create(array,n,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n; array = (TYPE *) srealloc(array,nbytes,name); @@ -68,7 +68,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array @@ -77,7 +77,7 @@ class Memory : protected Pointers { template void destroy(TYPE *&array) { sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -96,7 +96,7 @@ class Memory : protected Pointers { template TYPE **create1d_offset(TYPE **& /*array*/, int /*nlo*/, int /*nhi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array with index offset @@ -106,7 +106,7 @@ class Memory : protected Pointers { void destroy1d_offset(TYPE *&array, int offset) { if (array) sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -131,7 +131,7 @@ class Memory : protected Pointers { template TYPE ***create(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 2d array @@ -141,7 +141,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **&array, int n1, int n2, const char *name) { - if (array == NULL) return create(array,n1,n2,name); + if (array == nullptr) return create(array,n1,n2,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; TYPE *data = (TYPE *) srealloc(array[0],nbytes,name); @@ -158,7 +158,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array @@ -167,10 +167,10 @@ class Memory : protected Pointers { template void destroy(TYPE **&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ class Memory : protected Pointers { template TYPE ***create_ragged(TYPE ***& /*array*/, int /*n1*/, int * /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- create a 2d array with 2nd index from n2lo to n2hi inclusive @@ -217,7 +217,7 @@ class Memory : protected Pointers { template TYPE ***create2d_offset(TYPE ***& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - const char *name) {fail(name); return NULL;} + const char *name) {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array with 2nd index offset @@ -226,10 +226,10 @@ class Memory : protected Pointers { template void destroy2d_offset(TYPE **&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -262,7 +262,7 @@ class Memory : protected Pointers { template TYPE ****create(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 3d array @@ -272,7 +272,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) { - if (array == NULL) return create(array,n1,n2,n3,name); + if (array == nullptr) return create(array,n1,n2,n3,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name); @@ -297,7 +297,7 @@ class Memory : protected Pointers { template TYPE ****grow(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 3d array @@ -306,11 +306,11 @@ class Memory : protected Pointers { template void destroy(TYPE ***&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -331,7 +331,7 @@ class Memory : protected Pointers { template TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with 1st index offset @@ -340,11 +340,11 @@ class Memory : protected Pointers { template void destroy3d_offset(TYPE ***&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[offset][0][0]); sfree(&array[offset][0]); sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -376,7 +376,7 @@ class Memory : protected Pointers { TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with all 3 indices offset @@ -386,11 +386,11 @@ class Memory : protected Pointers { void destroy3d_offset(TYPE ***&array, int n1_offset, int n2_offset, int n3_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[n1_offset][n2_offset][n3_offset]); sfree(&array[n1_offset][n2_offset]); sfree(&array[n1_offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -433,7 +433,7 @@ class Memory : protected Pointers { template TYPE *****create(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 4d array @@ -444,7 +444,7 @@ class Memory : protected Pointers { TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - if (array == NULL) return create(array, n1, n2, n3, n4, name); + if (array == nullptr) return create(array, n1, n2, n3, n4, name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; TYPE *data = (TYPE *)srealloc(array[0][0][0], nbytes, name); @@ -479,7 +479,7 @@ class Memory : protected Pointers { TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) { - fail(name); return NULL; + fail(name); return nullptr; } /* ---------------------------------------------------------------------- @@ -489,12 +489,12 @@ class Memory : protected Pointers { template void destroy(TYPE ****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -527,7 +527,7 @@ class Memory : protected Pointers { TYPE ****create4d_offset(TYPE *****& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 4d array with indices 2,3, and 4 offset @@ -537,12 +537,12 @@ class Memory : protected Pointers { void destroy4d_offset(TYPE ****&array, int n2_offset, int n3_offset, int n4_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][n2_offset][n3_offset][n4_offset]); sfree(&array[0][n2_offset][n3_offset]); sfree(&array[0][n2_offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -594,7 +594,7 @@ class Memory : protected Pointers { template TYPE ******create(TYPE ******& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, int /*n5*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 5d array @@ -603,13 +603,13 @@ class Memory : protected Pointers { template void destroy(TYPE *****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0][0]); sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/min.cpp b/src/min.cpp index 6bcb4b4e2..ea07820e5 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -71,17 +71,17 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp) delaystep_start_flag = 1; max_vdotf_negatif = 2000; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nextra_global = 0; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; external_force_clear = 0; @@ -128,7 +128,7 @@ void Min::init() nextra_global = 0; delete [] fextra; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; memory->sfree(xextra_atom); @@ -137,10 +137,10 @@ void Min::init() memory->destroy(extra_nlen); memory->destroy(extra_max); memory->sfree(requestor); - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; // virial_style: // 1 if computed explicitly by pair->compute via sum over pair interactions @@ -760,8 +760,8 @@ void Min::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp index 909f0b068..54b1ee636 100644 --- a/src/min_hftn.cpp +++ b/src/min_hftn.cpp @@ -81,11 +81,11 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) searchflag = 1; for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; - _fpPrint = NULL; + _fpPrint = nullptr; return; } @@ -97,10 +97,10 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) MinHFTN::~MinHFTN (void) { for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; return; @@ -118,14 +118,14 @@ void MinHFTN::init() error->all(FLERR,"Incorrect min_modify option"); for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; } for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; } return; @@ -1618,7 +1618,7 @@ void MinHFTN::open_hftn_print_file_(void) char szTmp[50]; sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank); _fpPrint = fopen (szTmp, "w"); - if (_fpPrint == NULL) { + if (_fpPrint == nullptr) { printf ("*** MinHFTN cannot open file '%s'\n", szTmp); printf ("*** continuing...\n"); return; @@ -1655,7 +1655,7 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, const char sFormatR[] = "r %4d %5d %14.8f %11.5e %3s %9.3e %8.2e %10.3e %10.3e\n"; - if (_fpPrint == NULL) + if (_fpPrint == nullptr) return; char sStepType[4]; @@ -1701,6 +1701,6 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, void MinHFTN::close_hftn_print_file_(void) { - if (_fpPrint != NULL) fclose (_fpPrint); + if (_fpPrint != nullptr) fclose (_fpPrint); return; } diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp index 7226f6161..4ae887312 100644 --- a/src/min_linesearch.cpp +++ b/src/min_linesearch.cpp @@ -54,8 +54,8 @@ using namespace LAMMPS_NS; MinLineSearch::MinLineSearch(LAMMPS *lmp) : Min(lmp) { searchflag = 1; - gextra = hextra = NULL; - x0extra_atom = gextra_atom = hextra_atom = NULL; + gextra = hextra = nullptr; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -81,12 +81,12 @@ void MinLineSearch::init() delete [] gextra; delete [] hextra; - gextra = hextra = NULL; + gextra = hextra = nullptr; delete [] x0extra_atom; delete [] gextra_atom; delete [] hextra_atom; - x0extra_atom = gextra_atom = hextra_atom = NULL; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index c88d52b62..a908cfc7a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -54,34 +54,34 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) n_min_post_force = n_min_energy = 0; n_timeflag = -1; - fix = NULL; - fmask = NULL; - list_initial_integrate = list_post_integrate = NULL; - list_pre_exchange = list_pre_neighbor = list_post_neighbor = NULL; - list_pre_force = list_pre_reverse = list_post_force = NULL; - list_final_integrate = list_end_of_step = NULL; - list_thermo_energy = list_thermo_energy_atom = NULL; - list_initial_integrate_respa = list_post_integrate_respa = NULL; - list_pre_force_respa = list_post_force_respa = NULL; - list_final_integrate_respa = NULL; - list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = NULL; - list_min_pre_force = list_min_pre_reverse = list_min_post_force = NULL; - list_min_energy = NULL; - - end_of_step_every = NULL; - - list_timeflag = NULL; + fix = nullptr; + fmask = nullptr; + list_initial_integrate = list_post_integrate = nullptr; + list_pre_exchange = list_pre_neighbor = list_post_neighbor = nullptr; + list_pre_force = list_pre_reverse = list_post_force = nullptr; + list_final_integrate = list_end_of_step = nullptr; + list_thermo_energy = list_thermo_energy_atom = nullptr; + list_initial_integrate_respa = list_post_integrate_respa = nullptr; + list_pre_force_respa = list_post_force_respa = nullptr; + list_final_integrate_respa = nullptr; + list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = nullptr; + list_min_pre_force = list_min_pre_reverse = list_min_post_force = nullptr; + list_min_energy = nullptr; + + end_of_step_every = nullptr; + + list_timeflag = nullptr; nfix_restart_global = 0; - id_restart_global = style_restart_global = NULL; - state_restart_global = NULL; - used_restart_global = NULL; + id_restart_global = style_restart_global = nullptr; + state_restart_global = nullptr; + used_restart_global = nullptr; nfix_restart_peratom = 0; - id_restart_peratom = style_restart_peratom = NULL; - index_restart_peratom = used_restart_peratom = NULL; + id_restart_peratom = style_restart_peratom = nullptr; + index_restart_peratom = used_restart_peratom = nullptr; ncompute = maxcompute = 0; - compute = NULL; + compute = nullptr; create_factories(); } @@ -795,17 +795,17 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // but can't think of better way // too late if instantiate fix, then check flag set in fix constructor, // since some fixes access domain settings in their constructor - // NULL must be last entry in this list + // nullptr must be last entry in this list const char *exceptions[] = {"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx", - "deprecated", "STORE/KIM", NULL}; + "deprecated", "STORE/KIM", nullptr}; if (domain->box_exist == 0) { int m; - for (m = 0; exceptions[m] != NULL; m++) + for (m = 0; exceptions[m] != nullptr; m++) if (strcmp(arg[2],exceptions[m]) == 0) break; - if (exceptions[m] == NULL) + if (exceptions[m] == nullptr) error->all(FLERR,"Fix command before simulation box is defined"); } @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to NULL in case new fix scans list of fixes, + // set ptr to nullptr in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix @@ -852,7 +852,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) if (fix[ifix]->igroup != igroup && comm->me == 0) error->warning(FLERR,"Replacing a fix, but new group != old group"); delete fix[ifix]; - fix[ifix] = NULL; + fix[ifix] = nullptr; } else { newflag = 1; @@ -866,7 +866,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // create the Fix // try first with suffix appended - fix[ifix] = NULL; + fix[ifix] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -879,7 +879,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) strcpy(fix[ifix]->style,estyle.c_str()); } } - if (fix[ifix] == NULL && lmp->suffix2) { + if (fix[ifix] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (fix_map->find(estyle) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[estyle]; @@ -891,12 +891,12 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) } } - if (fix[ifix] == NULL && fix_map->find(arg[2]) != fix_map->end()) { + if (fix[ifix] == nullptr && fix_map->find(arg[2]) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[arg[2]]; fix[ifix] = fix_creator(lmp,narg,arg); } - if (fix[ifix] == NULL) + if (fix[ifix] == nullptr) error->all(FLERR,utils::check_packages_for_style("fix",arg[2],lmp)); // check if Fix is in restart_global list @@ -1105,7 +1105,7 @@ int Modify::check_rigid_group_overlap(int groupbit) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0)) ++n; @@ -1137,7 +1137,7 @@ int Modify::check_rigid_region_overlap(int groupbit, Region *reg) for (int ifix = 0; ifix < nfix; ifix++) { if (strncmp("rigid",fix[ifix]->style,5) == 0) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0) @@ -1167,7 +1167,7 @@ int Modify::check_rigid_list_overlap(int *select) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((body[i] >= 0) && select[i]) ++n; @@ -1206,7 +1206,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) // create the Compute // try first with suffix appended - compute[ncompute] = NULL; + compute[ncompute] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -1219,7 +1219,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) strcpy(compute[ncompute]->style,estyle.c_str()); } } - if (compute[ncompute] == NULL && lmp->suffix2) { + if (compute[ncompute] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (compute_map->find(estyle) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[estyle]; @@ -1231,13 +1231,13 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) } } - if (compute[ncompute] == NULL && + if (compute[ncompute] == nullptr && compute_map->find(arg[2]) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[arg[2]]; compute[ncompute] = compute_creator(lmp,narg,arg); } - if (compute[ncompute] == NULL) + if (compute[ncompute] == nullptr) error->all(FLERR,utils::check_packages_for_style("compute",arg[2],lmp)); ncompute++; @@ -1428,7 +1428,7 @@ int Modify::read_restart(FILE *fp) // nfix_restart_global = # of restart entries with global state info int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world); // allocate space for each entry @@ -1445,22 +1445,22 @@ int Modify::read_restart(FILE *fp) int n; for (int i = 0; i < nfix_restart_global; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); state_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world); used_restart_global[i] = 0; @@ -1470,7 +1470,7 @@ int Modify::read_restart(FILE *fp) int maxsize = 0; - if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world); // allocate space for each entry @@ -1487,19 +1487,19 @@ int Modify::read_restart(FILE *fp) // set index = which set of extra data this fix represents for (int i = 0; i < nfix_restart_peratom; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); maxsize += n; diff --git a/src/molecule.cpp b/src/molecule.cpp index 0d81f49a5..6957dbdc0 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -39,16 +39,16 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : - Pointers(lmp), id(NULL), x(NULL), type(NULL), molecule(NULL), q(NULL), radius(NULL), - rmass(NULL), num_bond(NULL), bond_type(NULL), bond_atom(NULL), - num_angle(NULL), angle_type(NULL), angle_atom1(NULL), angle_atom2(NULL), - angle_atom3(NULL), num_dihedral(NULL), dihedral_type(NULL), dihedral_atom1(NULL), - dihedral_atom2(NULL), dihedral_atom3(NULL), dihedral_atom4(NULL), num_improper(NULL), - improper_type(NULL), improper_atom1(NULL), improper_atom2(NULL), - improper_atom3(NULL), improper_atom4(NULL), nspecial(NULL), special(NULL), - shake_flag(NULL), shake_atom(NULL), shake_type(NULL), avec_body(NULL), ibodyparams(NULL), - dbodyparams(NULL), fragmentmask(NULL), - dx(NULL), dxcom(NULL), dxbody(NULL), quat_external(NULL), fp(NULL), count(NULL) + Pointers(lmp), id(nullptr), x(nullptr), type(nullptr), molecule(nullptr), q(nullptr), radius(nullptr), + rmass(nullptr), num_bond(nullptr), bond_type(nullptr), bond_atom(nullptr), + num_angle(nullptr), angle_type(nullptr), angle_atom1(nullptr), angle_atom2(nullptr), + angle_atom3(nullptr), num_dihedral(nullptr), dihedral_type(nullptr), dihedral_atom1(nullptr), + dihedral_atom2(nullptr), dihedral_atom3(nullptr), dihedral_atom4(nullptr), num_improper(nullptr), + improper_type(nullptr), improper_atom1(nullptr), improper_atom2(nullptr), + improper_atom3(nullptr), improper_atom4(nullptr), nspecial(nullptr), special(nullptr), + shake_flag(nullptr), shake_atom(nullptr), shake_type(nullptr), avec_body(nullptr), ibodyparams(nullptr), + dbodyparams(nullptr), fragmentmask(nullptr), + dx(nullptr), dxcom(nullptr), dxbody(nullptr), quat_external(nullptr), fp(nullptr), count(nullptr) { me = comm->me; @@ -406,7 +406,7 @@ void Molecule::read(int flag) if (me == 0) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of molecule file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of molecule file"); } // read header lines @@ -511,7 +511,7 @@ void Molecule::read(int flag) // count = vector for tallying bonds,angles,etc per atom if (flag == 0) memory->create(count,natoms,"molecule:count"); - else count = NULL; + else count = nullptr; // grab keyword and skip next line @@ -1703,41 +1703,41 @@ void Molecule::initialize() centerflag = massflag = comflag = inertiaflag = 0; tag_require = 0; - x = NULL; - type = NULL; - q = NULL; - radius = NULL; - rmass = NULL; + x = nullptr; + type = nullptr; + q = nullptr; + radius = nullptr; + rmass = nullptr; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; - ibodyparams = NULL; - dbodyparams = NULL; + ibodyparams = nullptr; + dbodyparams = nullptr; - dx = NULL; - dxcom = NULL; - dxbody = NULL; + dx = nullptr; + dxcom = nullptr; + dxbody = nullptr; } /* ---------------------------------------------------------------------- @@ -1901,7 +1901,7 @@ void Molecule::deallocate() void Molecule::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open molecule file {}: {}", file, utils::getsyserror())); } @@ -1914,7 +1914,7 @@ void Molecule::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1937,11 +1937,11 @@ void Molecule::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return diff --git a/src/my_page.cpp b/src/my_page.cpp index 95dd56fec..2416c7e76 100644 --- a/src/my_page.cpp +++ b/src/my_page.cpp @@ -113,7 +113,7 @@ template T *MyPage::get(int n) { if (n > maxchunk) { errorflag = 1; - return NULL; + return nullptr; } ndatum += n; nchunk++; @@ -129,7 +129,7 @@ T *MyPage::get(int n) { ipage++; if (ipage == npage) { allocate(); - if (errorflag) return NULL; + if (errorflag) return nullptr; } page = pages[ipage]; index = n; diff --git a/src/my_page.h b/src/my_page.h index 4beb397ae..0e4375ed7 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -53,7 +53,7 @@ class MyPage { ipage++; if (ipage == npage) { allocate(); - if (errorflag) return NULL; + if (errorflag) return nullptr; } page = pages[ipage]; index = 0; diff --git a/src/nbin.cpp b/src/nbin.cpp index 1092311f6..d3211cd62 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -27,9 +27,9 @@ NBin::NBin(LAMMPS *lmp) : Pointers(lmp) { last_bin = -1; mbins = maxbin = maxatom = 0; - binhead = NULL; - bins = NULL; - atom2bin = NULL; + binhead = nullptr; + bins = nullptr; + atom2bin = nullptr; neighbor->last_setup_bins = -1; diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index c01f8ca59..fae1a2941 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -33,9 +33,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) maxatom = 0; inum = gnum = 0; - ilist = NULL; - numneigh = NULL; - firstneigh = NULL; + ilist = nullptr; + numneigh = nullptr; + firstneigh = nullptr; // defaults, but may be reset by post_constructor() @@ -51,31 +51,31 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // ptrs - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; - listcopy = NULL; - listskip = NULL; - listfull = NULL; + listcopy = nullptr; + listskip = nullptr; + listfull = nullptr; - fix_bond = NULL; + fix_bond = nullptr; - ipage = NULL; + ipage = nullptr; // extra rRESPA lists inum_inner = gnum_inner = 0; - ilist_inner = NULL; - numneigh_inner = NULL; - firstneigh_inner = NULL; + ilist_inner = nullptr; + numneigh_inner = nullptr; + firstneigh_inner = nullptr; inum_middle = gnum_middle = 0; - ilist_middle = NULL; - numneigh_middle = NULL; - firstneigh_middle = NULL; + ilist_middle = nullptr; + numneigh_middle = nullptr; + firstneigh_middle = nullptr; - ipage_inner = NULL; - ipage_middle = NULL; + ipage_inner = nullptr; + ipage_middle = nullptr; // Kokkos package @@ -85,9 +85,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // USER-DPD package - np = NULL; + np = nullptr; - requestor = NULL; + requestor = nullptr; requestor_type = NeighList::NONE; } diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 006ff5e87..f4c7e7e0b 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -71,12 +71,12 @@ NeighRequest::NeighRequest(LAMMPS *lmp) : Pointers(lmp) // skip info, default is no skipping skip = 0; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; // only set when command = 1; - command_style = NULL; + command_style = nullptr; // info set by Neighbor class when morphing original requests @@ -217,8 +217,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) cut = other->cut; cutoff = other->cutoff; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; if (!skipflag) return; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 66ab92496..26e7d6b74 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -76,7 +76,7 @@ static const char cite_neigh_multi[] = /* ---------------------------------------------------------------------- */ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp), -pairclass(NULL), pairnames(NULL), pairmasks(NULL) +pairclass(nullptr), pairnames(nullptr), pairmasks(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -95,62 +95,62 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) ago = -1; cutneighmax = 0.0; - cutneighsq = NULL; - cutneighghostsq = NULL; - cuttype = NULL; - cuttypesq = NULL; - fixchecklist = NULL; + cutneighsq = nullptr; + cutneighghostsq = nullptr; + cuttype = nullptr; + cuttypesq = nullptr; + fixchecklist = nullptr; // pairwise neighbor lists and associated data structs nlist = 0; - lists = NULL; + lists = nullptr; nbin = 0; - neigh_bin = NULL; + neigh_bin = nullptr; nstencil = 0; - neigh_stencil = NULL; + neigh_stencil = nullptr; - neigh_pair = NULL; + neigh_pair = nullptr; nstencil_perpetual = 0; - slist = NULL; + slist = nullptr; npair_perpetual = 0; - plist = NULL; + plist = nullptr; nrequest = maxrequest = 0; - requests = NULL; + requests = nullptr; old_nrequest = 0; - old_requests = NULL; + old_requests = nullptr; old_style = style; old_triclinic = 0; old_pgsize = pgsize; old_oneatom = oneatom; - binclass = NULL; - binnames = NULL; - binmasks = NULL; - stencilclass = NULL; - stencilnames = NULL; - stencilmasks = NULL; + binclass = nullptr; + binnames = nullptr; + binmasks = nullptr; + stencilclass = nullptr; + stencilnames = nullptr; + stencilmasks = nullptr; // topology lists bondwhich = anglewhich = dihedralwhich = improperwhich = NONE; - neigh_bond = NULL; - neigh_angle = NULL; - neigh_dihedral = NULL; - neigh_improper = NULL; + neigh_bond = nullptr; + neigh_angle = nullptr; + neigh_dihedral = nullptr; + neigh_improper = nullptr; // coords at last neighboring maxhold = 0; - xhold = NULL; + xhold = nullptr; lastcall = -1; last_setup_bins = -1; @@ -159,14 +159,14 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) includegroup = 0; nex_type = maxex_type = 0; - ex1_type = ex2_type = NULL; - ex_type = NULL; + ex1_type = ex2_type = nullptr; + ex_type = nullptr; nex_group = maxex_group = 0; - ex1_group = ex2_group = ex1_bit = ex2_bit = NULL; + ex1_group = ex2_group = ex1_bit = ex2_bit = nullptr; nex_mol = maxex_mol = 0; - ex_mol_group = ex_mol_bit = ex_mol_intra = NULL; + ex_mol_group = ex_mol_bit = ex_mol_intra = nullptr; // Kokkos setting @@ -270,7 +270,7 @@ void Neighbor::init() // set neighbor cutoffs (force cutoff + skin) // trigger determines when atoms migrate and neighbor lists are rebuilt // needs to be non-zero for migration distance check - // even if pair = NULL and no neighbor lists are used + // even if pair = nullptr and no neighbor lists are used // cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0 // cutneighghost = pair cutghost if it requests it, else same as cutneigh @@ -281,7 +281,7 @@ void Neighbor::init() boxcheck = 1; n = atom->ntypes; - if (cutneighsq == NULL) { + if (cutneighsq == nullptr) { if (lmp->kokkos) init_cutneighsq_kokkos(n); else memory->create(cutneighsq,n+1,n+1,"neigh:cutneighsq"); memory->create(cutneighghostsq,n+1,n+1,"neigh:cutneighghostsq"); @@ -338,7 +338,7 @@ void Neighbor::init() if (output->restart_flag) restart_check = 1; delete [] fixchecklist; - fixchecklist = NULL; + fixchecklist = nullptr; fixchecklist = new int[modify->nfix]; fix_check = 0; @@ -378,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-NULL pointer if there is only one substyle of the kind. + // will only return a non-nullptr pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; @@ -410,7 +410,7 @@ void Neighbor::init() if (dist_check == 0) { memory->destroy(xhold); maxhold = 0; - xhold = NULL; + xhold = nullptr; } // first time allocation @@ -515,7 +515,7 @@ void Neighbor::init() for (int i = 0; i < nrequest; i++) { delete requests[i]; - requests[i] = NULL; + requests[i] = nullptr; } nrequest = 0; @@ -809,7 +809,7 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_stencil[nstencil]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_stencil[nstencil]->nb == NULL) + if (neigh_stencil[nstencil]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor stencil"); } @@ -823,7 +823,7 @@ int Neighbor::init_pair() requests[i]->index_pair = -1; flag = lists[i]->pair_method; if (flag == 0) { - neigh_pair[i] = NULL; + neigh_pair[i] = nullptr; continue; } @@ -834,12 +834,12 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_pair[i]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_pair[i]->nb == NULL) + if (neigh_pair[i]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor pair"); } if (lists[i]->stencil_method > 0) { neigh_pair[i]->ns = neigh_stencil[requests[i]->index_stencil]; - if (neigh_pair[i]->ns == NULL) + if (neigh_pair[i]->ns == nullptr) error->all(FLERR,"Could not assign stencil method to neighbor pair"); } @@ -905,11 +905,11 @@ int Neighbor::init_pair() done = 1; for (i = 0; i < npair_perpetual; i++) { for (k = 0; k < 3; k++) { - ptr = NULL; + ptr = nullptr; if (k == 0) ptr = lists[plist[i]]->listcopy; if (k == 1) ptr = lists[plist[i]]->listskip; if (k == 2) ptr = lists[plist[i]]->listfull; - if (ptr == NULL) continue; + if (ptr == nullptr) continue; for (m = 0; m < nrequest; m++) if (ptr == lists[m]) break; for (j = 0; j < npair_perpetual; j++) @@ -1575,17 +1575,17 @@ void Neighbor::requests_new2old() /* ---------------------------------------------------------------------- find and return request made by classptr - if not found or classpt = NULL, return NULL + if not found or classpt = nullptr, return nullptr ------------------------------------------------------------------------- */ NeighRequest *Neighbor::find_request(void *classptr) { - if (classptr == NULL) return NULL; + if (classptr == nullptr) return nullptr; for (int i = 0; i < nrequest; i++) if (requests[i]->requestor == classptr) return requests[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -2138,7 +2138,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) { // check if list structure is initialized - if (mylist == NULL) + if (mylist == nullptr) error->all(FLERR,"Trying to build an occasional neighbor list " "before initialization completed"); @@ -2283,7 +2283,7 @@ void Neighbor::modify_params(int narg, char **arg) includegroup = group->find(arg[iarg+1]); if (includegroup < 0) error->all(FLERR,"Invalid group ID in neigh_modify command"); - if (includegroup && (atom->firstgroupname == NULL || + if (includegroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR, "Neigh_modify include group != atom_modify first group"); diff --git a/src/npair.cpp b/src/npair.cpp index b63135fad..698ff2806 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -27,10 +27,10 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ NPair::NPair(LAMMPS *lmp) - : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL) + : Pointers(lmp), nb(nullptr), ns(nullptr), bins(nullptr), stencil(nullptr) { last_build = -1; - mycutneighsq = NULL; + mycutneighsq = nullptr; molecular = atom->molecular; copymode = 0; execution_space = Host; diff --git a/src/nstencil.cpp b/src/nstencil.cpp index 431906e89..aae6c9b1d 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -59,11 +59,11 @@ NStencil::NStencil(LAMMPS *lmp) : Pointers(lmp) xyzflag = 0; maxstencil = maxstencil_multi = 0; - stencil = NULL; - stencilxyz = NULL; - nstencil_multi = NULL; - stencil_multi = NULL; - distsq_multi = NULL; + stencil = nullptr; + stencilxyz = nullptr; + nstencil_multi = nullptr; + stencil_multi = nullptr; + distsq_multi = nullptr; dimension = domain->dimension; } @@ -179,8 +179,8 @@ void NStencil::create_setup() distsq_multi = new double*[n+1]; for (i = 1; i <= n; i++) { nstencil_multi[i] = 0; - stencil_multi[i] = NULL; - distsq_multi[i] = NULL; + stencil_multi[i] = nullptr; + distsq_multi[i] = nullptr; } } if (smax > maxstencil_multi) { diff --git a/src/ntopo.cpp b/src/ntopo.cpp index d4ddcc7fc..02a86e33c 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -33,7 +33,7 @@ NTopo::NTopo(LAMMPS *lmp) : Pointers(lmp) nbondlist = nanglelist = ndihedrallist = nimproperlist = 0; maxbond = maxangle = maxdihedral = maximproper = 0; - bondlist = anglelist = dihedrallist = improperlist = NULL; + bondlist = anglelist = dihedrallist = improperlist = nullptr; cluster_check = neighbor->cluster_check; } diff --git a/src/output.cpp b/src/output.cpp index 6c90198de..13261396d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -56,23 +56,23 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp) delete [] newarg; thermo_every = 0; - var_thermo = NULL; + var_thermo = nullptr; ndump = 0; max_dump = 0; - every_dump = NULL; - next_dump = NULL; - last_dump = NULL; - var_dump = NULL; - ivar_dump = NULL; - dump = NULL; + every_dump = nullptr; + next_dump = nullptr; + last_dump = nullptr; + var_dump = nullptr; + ivar_dump = nullptr; + dump = nullptr; restart_flag = restart_flag_single = restart_flag_double = 0; restart_every_single = restart_every_double = 0; last_restart = -1; - restart1 = restart2a = restart2b = NULL; - var_restart_single = var_restart_double = NULL; - restart = NULL; + restart1 = restart2a = restart2b = nullptr; + var_restart_single = var_restart_double = nullptr; + restart = nullptr; dump_map = new DumpCreatorMap(); @@ -560,7 +560,7 @@ void Output::add_dump(int narg, char **arg) every_dump[ndump] = 0; last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ivar_dump[ndump] = -1; // create the Dump @@ -573,7 +573,7 @@ void Output::add_dump(int narg, char **arg) every_dump[ndump] = utils::inumeric(FLERR,arg[3],false,lmp); if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command"); last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ndump++; } @@ -641,7 +641,7 @@ void Output::delete_dump(char *id) int Output::find_dump(const char *id) { - if (id == NULL) return -1; + if (id == nullptr) return -1; int idump; for (idump = 0; idump < ndump; idump++) if (strcmp(id,dump[idump]->id) == 0) break; @@ -661,7 +661,7 @@ void Output::set_thermo(int narg, char **arg) // variable spaced thermo outputs to constant spaced ones. delete [] var_thermo; - var_thermo = NULL; + var_thermo = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; @@ -692,10 +692,10 @@ void Output::create_thermo(int narg, char **arg) error->warning(FLERR,"New thermo_style command, " "previous thermo_modify settings will be lost"); - // set thermo = NULL in case new Thermo throws an error + // set thermo = nullptr in case new Thermo throws an error delete thermo; - thermo = NULL; + thermo = nullptr; thermo = new Thermo(lmp,narg,arg); } @@ -721,14 +721,14 @@ void Output::create_restart(int narg, char **arg) last_restart = -1; delete restart; - restart = NULL; + restart = nullptr; delete [] restart1; delete [] restart2a; delete [] restart2b; - restart1 = restart2a = restart2b = NULL; + restart1 = restart2a = restart2b = nullptr; delete [] var_restart_single; delete [] var_restart_double; - var_restart_single = var_restart_double = NULL; + var_restart_single = var_restart_double = nullptr; return; } @@ -754,7 +754,7 @@ void Output::create_restart(int narg, char **arg) delete [] restart1; restart1 = new char[n]; strcpy(restart1,arg[1]); - if (strchr(restart1,'*') == NULL) strcat(restart1,".*"); + if (strchr(restart1,'*') == nullptr) strcat(restart1,".*"); } if (nfile == 2) { diff --git a/src/output.h b/src/output.h index 06be7b244..6a64e67c9 100644 --- a/src/output.h +++ b/src/output.h @@ -29,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, NULL if every + char *var_thermo; // variable name for thermo freq, nullptr if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations diff --git a/src/pair.cpp b/src/pair.cpp index d869bbe8d..60a5c0d8b 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -67,12 +67,12 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) unit_convert_flag = utils::NOCONVERT; nextra = 0; - pvector = NULL; + pvector = nullptr; single_extra = 0; - svector = NULL; + svector = nullptr; - setflag = NULL; - cutsq = NULL; + setflag = nullptr; + cutsq = nullptr; ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = dipoleflag = spinflag = 0; reinitflag = 1; @@ -91,19 +91,19 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) ndisptablebits = 12; tabinner = sqrt(2.0); tabinner_disp = sqrt(2.0); - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; allocated = 0; suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; num_tally_compute = 0; - list_tally_compute = NULL; + list_tally_compute = nullptr; nondefault_history_transfer = 0; beyond_contact = 0; @@ -123,7 +123,7 @@ Pair::~Pair() { num_tally_compute = 0; memory->sfree((void *) list_tally_compute); - list_tally_compute = NULL; + list_tally_compute = nullptr; if (copymode) return; @@ -331,7 +331,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) double r,grij,expm2,derfc,egamma,fgamma,rsw; double qqrd2e = force->qqrd2e; - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); double g_ewald = force->kspace->g_ewald; @@ -359,8 +359,8 @@ void Pair::init_tables(double cut_coul, double *cut_respa) memory->create(dctable,ntable,"pair:dctable"); memory->create(detable,ntable,"pair:detable"); - if (cut_respa == NULL) { - vtable = ptable = dvtable = dptable = NULL; + if (cut_respa == nullptr) { + vtable = ptable = dvtable = dptable = nullptr; } else { memory->create(vtable,ntable,"pair:vtable"); memory->create(ptable,ntable,"pair:ptable"); @@ -391,7 +391,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { rtable[i] = rsq_lookup.f; ctable[i] = qqrd2e/r; if (msmflag) { @@ -488,7 +488,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { c_tmp = qqrd2e/r; if (msmflag) { f_tmp = qqrd2e/r * fgamma; @@ -1664,7 +1664,7 @@ void Pair::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -1672,7 +1672,7 @@ void Pair::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by pair_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open pair_write file {}: {}", table_file, utils::getsyserror())); fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n", diff --git a/src/pair.h b/src/pair.h index 00f433233..ace233539 100644 --- a/src/pair.h +++ b/src/pair.h @@ -197,7 +197,7 @@ class Pair : protected Pointers { // specific child-class methods for certain Pair styles - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void swap_eam(double *, double **) {} virtual void reset_dt() {} virtual void min_xf_pointers(int, double **, double **) {} diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index 87aa0bab5..777c7e4c4 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -281,16 +281,16 @@ void PairBeck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world); @@ -320,8 +320,8 @@ void PairBeck::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_born.cpp b/src/pair_born.cpp index 5b0d3a656..fee494fd9 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -330,16 +330,16 @@ void PairBorn::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -370,10 +370,10 @@ void PairBorn::write_restart_settings(FILE *fp) void PairBorn::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -433,5 +433,5 @@ void *PairBorn::extract(const char *str, int &dim) if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; if (strcmp(str,"d") == 0) return (void *) d; - return NULL; + return nullptr; } diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index e4617b5c4..abe3d1e07 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -361,16 +361,16 @@ void PairBornCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -402,11 +402,11 @@ void PairBornCoulDSF::write_restart_settings(FILE *fp) void PairBornCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index 30fe8fcde..a873ec6c6 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -360,16 +360,16 @@ void PairBornCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairBornCoulWolf::write_restart_settings(FILE *fp) void PairBornCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 1abdbcc68..6de115a0e 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -309,14 +309,14 @@ void PairBuck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -345,10 +345,10 @@ void PairBuck::write_restart_settings(FILE *fp) void PairBuck::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -405,5 +405,5 @@ void *PairBuck::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 9fac17aed..9cc90ebc8 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -364,15 +364,15 @@ void PairBuckCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -403,11 +403,11 @@ void PairBuckCoulCut::write_restart_settings(FILE *fp) void PairBuckCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index 67c471a5e..5aa281190 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -247,10 +247,10 @@ void PairCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -274,9 +274,9 @@ void PairCoulCut::write_restart_settings(FILE *fp) void PairCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -307,5 +307,5 @@ void *PairCoulCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"cut_coul") == 0) return (void *) &cut; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index 209371824..31838fbee 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -146,10 +146,10 @@ void PairCoulDebye::write_restart_settings(FILE *fp) void PairCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_dsf.cpp b/src/pair_coul_dsf.cpp index ee124c7f5..94106405b 100644 --- a/src/pair_coul_dsf.cpp +++ b/src/pair_coul_dsf.cpp @@ -254,7 +254,7 @@ void PairCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -278,10 +278,10 @@ void PairCoulDSF::write_restart_settings(FILE *fp) void PairCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -327,5 +327,5 @@ void *PairCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index e538275b3..6ff958483 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -51,11 +51,11 @@ PairCoulStreitz::PairCoulStreitz(LAMMPS *lmp) : Pair(lmp) nmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -152,7 +152,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -215,7 +215,7 @@ void PairCoulStreitz::init_style() // insure use of KSpace long-range solver when ewald specified, set g_ewald if (ewaldflag) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -799,5 +799,5 @@ void *PairCoulStreitz::extract(const char *str, int &dim) if (kspacetype == 1) return (void *) &g_wolf; if (kspacetype == 2) return (void *) &g_ewald; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp index e3079dcaf..994e74fc9 100644 --- a/src/pair_coul_wolf.cpp +++ b/src/pair_coul_wolf.cpp @@ -250,7 +250,7 @@ void PairCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -274,10 +274,10 @@ void PairCoulWolf::write_restart_settings(FILE *fp) void PairCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index d0d9b98fc..d92f4b7cc 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) { writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -314,13 +314,13 @@ void PairDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairDPD::write_restart_settings(FILE *fp) void PairDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index dd0e14495..4b9c186da 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -232,12 +232,12 @@ void PairDPDTstat::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -265,11 +265,11 @@ void PairDPDTstat::write_restart_settings(FILE *fp) void PairDPDTstat::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&t_start,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&t_start,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&t_start,1,MPI_DOUBLE,0,world); MPI_Bcast(&t_stop,1,MPI_DOUBLE,0,world); diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index 673229676..39c8caa73 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -280,13 +280,13 @@ void PairGauss::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world); @@ -313,9 +313,9 @@ void PairGauss::write_restart_settings(FILE *fp) void PairGauss::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairGauss::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) a; - return NULL; + return nullptr; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 0b1882f12..7f7f795b8 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -35,8 +35,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp), - styles(NULL), keywords(NULL), multiple(NULL), nmap(NULL), - map(NULL), special_lj(NULL), special_coul(NULL), compute_tally(NULL) + styles(nullptr), keywords(nullptr), multiple(nullptr), nmap(nullptr), + map(nullptr), special_lj(nullptr), special_coul(nullptr), compute_tally(nullptr) { nstyles = 0; @@ -116,7 +116,7 @@ void PairHybrid::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; @@ -324,7 +324,7 @@ void PairHybrid::settings(int narg, char **arg) styles[nstyles] = force->new_pair(arg[iarg],1,dummy); force->store_style(keywords[nstyles],arg[iarg],0); - special_lj[nstyles] = special_coul[nstyles] = NULL; + special_lj[nstyles] = special_coul[nstyles] = nullptr; compute_tally[nstyles] = 1; // determine list of arguments for pair style settings @@ -706,10 +706,10 @@ void PairHybrid::write_restart(FILE *fp) fwrite(keywords[m],sizeof(char),n,fp); styles[m]->write_restart_settings(fp); // write out per style special settings, if present - n = (special_lj[m] == NULL) ? 0 : 1; + n = (special_lj[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_lj[m],sizeof(double),4,fp); - n = (special_coul[m] == NULL) ? 0 : 1; + n = (special_coul[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_coul[m],sizeof(double),4,fp); } @@ -722,7 +722,7 @@ void PairHybrid::write_restart(FILE *fp) void PairHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); // allocate list of sub-styles @@ -745,32 +745,32 @@ void PairHybrid::read_restart(FILE *fp) // each sub-style is created via new_pair() // each reads its settings, but no coeff info - if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,nullptr,error); MPI_Bcast(compute_tally,nstyles,MPI_INT,0,world); int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_pair(keywords[m],1,dummy); styles[m]->read_restart_settings(fp); // read back per style special settings, if present - special_lj[m] = special_coul[m] = NULL; - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + special_lj[m] = special_coul[m] = nullptr; + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_lj[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_lj[m],4,MPI_DOUBLE,0,world); } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_coul[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_coul[m],4,MPI_DOUBLE,0,world); } } @@ -813,8 +813,8 @@ double PairHybrid::single(int i, int j, int itype, int jtype, if (styles[map[itype][jtype][m]]->single_enable == 0) error->one(FLERR,"Pair hybrid sub-style does not support single call"); - if ((special_lj[map[itype][jtype][m]] != NULL) || - (special_coul[map[itype][jtype][m]] != NULL)) + if ((special_lj[map[itype][jtype][m]] != nullptr) || + (special_coul[map[itype][jtype][m]] != nullptr)) error->one(FLERR,"Pair hybrid single calls do not support" " per sub-style special bond values"); @@ -1006,13 +1006,13 @@ void PairHybrid::restore_special(double *saved) /* ---------------------------------------------------------------------- extract a ptr to a particular quantity stored by pair pass request thru to sub-styles - return first non-NULL result except for cut_coul request - for cut_coul, insure all non-NULL results are equal since required by Kspace + return first non-nullptr result except for cut_coul request + for cut_coul, insure all non-nullptr results are equal since required by Kspace ------------------------------------------------------------------------- */ void *PairHybrid::extract(const char *str, int &dim) { - void *cutptr = NULL; + void *cutptr = nullptr; void *ptr; double cutvalue = 0.0; int couldim = -1; @@ -1037,7 +1037,7 @@ void *PairHybrid::extract(const char *str, int &dim) } if (strcmp(str,"cut_coul") == 0) return cutptr; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index 34c4cfe41..8d352e9f2 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -140,7 +140,7 @@ void PairHybridOverlay::copy_svector(int itype, int jtype) if (m == map[itype][jtype][k]) { this_style = styles[m]; } else { - this_style = NULL; + this_style = nullptr; } } for (int l = 0; l < styles[m]->single_extra; ++l) { diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index a4ba3b858..444538b25 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -41,7 +41,7 @@ PairLJ96Cut::PairLJ96Cut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -508,7 +508,7 @@ void PairLJ96Cut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -607,13 +607,13 @@ void PairLJ96Cut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -642,10 +642,10 @@ void PairLJ96Cut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index b6c91cafe..f5f8038be 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -279,14 +279,14 @@ void PairLJCubic::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -313,7 +313,7 @@ void PairLJCubic::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index bd42801f3..f9b5a2552 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -502,7 +502,7 @@ void PairLJCut::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -601,13 +601,13 @@ void PairLJCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -636,10 +636,10 @@ void PairLJCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -693,5 +693,5 @@ void *PairLJCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 669d48c86..38f4316d2 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -354,14 +354,14 @@ void PairLJCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -391,11 +391,11 @@ void PairLJCutCoulCut::write_restart_settings(FILE *fp) void PairLJCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -466,5 +466,5 @@ void *PairLJCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp index 3ddb898c8..ed09e9806 100644 --- a/src/pair_lj_cut_coul_debye.cpp +++ b/src/pair_lj_cut_coul_debye.cpp @@ -171,11 +171,11 @@ void PairLJCutCoulDebye::write_restart_settings(FILE *fp) void PairLJCutCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index 952a14003..f2c48b222 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -377,13 +377,13 @@ void PairLJCutCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJCutCoulDSF::write_restart_settings(FILE *fp) void PairLJCutCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -477,5 +477,5 @@ void *PairLJCutCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_wolf.cpp b/src/pair_lj_cut_coul_wolf.cpp index 749cc9e6a..e6b00b9a5 100644 --- a/src/pair_lj_cut_coul_wolf.cpp +++ b/src/pair_lj_cut_coul_wolf.cpp @@ -370,13 +370,13 @@ void PairLJCutCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -407,12 +407,12 @@ void PairLJCutCoulWolf::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index 3f711e2a1..c68c2298e 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -325,14 +325,14 @@ void PairLJExpand::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -361,10 +361,10 @@ void PairLJExpand::write_restart_settings(FILE *fp) void PairLJExpand::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -423,5 +423,5 @@ void *PairLJExpand::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index 0818c60f3..05f30bcdd 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -339,14 +339,14 @@ void PairLJGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -376,10 +376,10 @@ void PairLJGromacs::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index 005bc4406..481e65723 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -379,12 +379,12 @@ void PairLJGromacsCoulGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJGromacsCoulGromacs::write_restart_settings(FILE *fp) void PairLJGromacsCoulGromacs::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index a53d703b8..7afc66735 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -353,14 +353,14 @@ void PairLJSmooth::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -390,10 +390,10 @@ void PairLJSmooth::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 3697208d4..78a538f13 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -286,13 +286,13 @@ void PairLJSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -319,8 +319,8 @@ void PairLJSmoothLinear::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 7447e143f..5030ffc2a 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -40,7 +40,7 @@ using namespace MathConst; PairMIECut::PairMIECut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -517,7 +517,7 @@ void PairMIECut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -628,15 +628,15 @@ void PairMIECut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -667,10 +667,10 @@ void PairMIECut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -706,5 +706,5 @@ void *PairMIECut::extract(const char *str, int &dim) if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamR") == 0) return (void *) gamR; if (strcmp(str,"gamA") == 0) return (void *) gamA; - return NULL; + return nullptr; } diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index efcc1aa81..b55fc7a85 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -266,14 +266,14 @@ void PairMorse::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -301,9 +301,9 @@ void PairMorse::write_restart_settings(FILE *fp) void PairMorse::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -357,5 +357,5 @@ void *PairMorse::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index f3dd139b6..b6a315198 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -245,12 +245,12 @@ void PairSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -275,8 +275,8 @@ void PairSoft::write_restart_settings(FILE *fp) void PairSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -326,5 +326,5 @@ void *PairSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) prefactor; - return NULL; + return nullptr; } diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 1711465ff..c0fad544d 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -43,7 +43,7 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTable::PairTable(LAMMPS *lmp) : Pair(lmp) { ntables = 0; - tables = NULL; + tables = nullptr; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); } @@ -246,7 +246,7 @@ void PairTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -821,15 +821,15 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -951,13 +951,13 @@ void PairTable::write_restart_settings(FILE *fp) void PairTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -1029,7 +1029,7 @@ double PairTable::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq, void *PairTable::extract(const char *str, int &dim) { - if (strcmp(str,"cut_coul") != 0) return NULL; + if (strcmp(str,"cut_coul") != 0) return nullptr; if (ntables == 0) error->all(FLERR,"All pair coeffs are not set"); // only check for cutoff consistency if claiming to be KSpace compatible @@ -1042,5 +1042,5 @@ void *PairTable::extract(const char *str, int &dim) "Pair table cutoffs must all be equal to use with KSpace"); dim = 0; return &tables[0].cut; - } else return NULL; + } else return nullptr; } diff --git a/src/pair_ufm.cpp b/src/pair_ufm.cpp index 50cc87cf9..e1e378155 100644 --- a/src/pair_ufm.cpp +++ b/src/pair_ufm.cpp @@ -278,14 +278,14 @@ void PairUFM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairUFM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -365,5 +365,5 @@ void *PairUFM::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 642949234..6118e5f36 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -253,12 +253,12 @@ void PairYukawa::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -285,10 +285,10 @@ void PairYukawa::write_restart_settings(FILE *fp) void PairYukawa::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index 68c63c980..7b028de65 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -285,10 +285,10 @@ void PairZBL::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][i],1,MPI_INT,0,world); if (setflag[i][i]) { - if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&z[i],1,MPI_DOUBLE,0,world); } } @@ -319,11 +319,11 @@ void PairZBL::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index 976bb1ba3..a45fef67a 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -178,11 +178,11 @@ void PairZero::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -207,8 +207,8 @@ void PairZero::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&coeffflag,1,MPI_INT,0,world); diff --git a/src/procmap.cpp b/src/procmap.cpp index f80af9330..b85b0abd0 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -49,7 +49,7 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid, // factors = list of all possible 3 factors of processor count - int npossible = factor(nprocs,NULL); + int npossible = factor(nprocs,nullptr); memory->create(factors,npossible,3,"procmap:factors"); npossible = factor(nprocs,factors); @@ -93,7 +93,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // nfactors = list of all possible 3 factors of node count // constrain by 2d - int nnpossible = factor(nprocs/ncores,NULL); + int nnpossible = factor(nprocs/ncores,nullptr); memory->create(nfactors,nnpossible,3,"procmap:nfactors"); nnpossible = factor(nprocs/ncores,nfactors); @@ -102,7 +102,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // cfactors = list of all possible 3 factors of core count // constrain by 2d - int ncpossible = factor(ncores,NULL); + int ncpossible = factor(ncores,nullptr); memory->create(cfactors,ncpossible,3,"procmap:cfactors"); ncpossible = factor(ncores,cfactors); @@ -205,7 +205,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, // initial factorization within NUMA node int **numafactors; - int numapossible = factor(procs_per_numa,NULL); + int numapossible = factor(procs_per_numa,nullptr); memory->create(numafactors,numapossible,3,"procmap:numafactors"); numapossible = factor(procs_per_numa,numafactors); @@ -230,7 +230,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, int node_count = nprocs / procs_per_numa; int **nodefactors; - int nodepossible = factor(node_count,NULL); + int nodepossible = factor(node_count,nullptr); memory->create(nodefactors,nodepossible,3,"procmap:nodefactors"); nodepossible = factor(node_count,nodefactors); @@ -281,11 +281,11 @@ void ProcMap::custom_grid(char *cfile, int nprocs, MPI_Comm_rank(world,&me); char line[MAXLINE]; - FILE *fp = NULL; + FILE *fp = nullptr; if (me == 0) { fp = fopen(cfile,"r"); - if (fp == NULL) error->one(FLERR,"Cannot open custom file"); + if (fp == nullptr) error->one(FLERR,"Cannot open custom file"); // skip header = blank and comment lines @@ -662,7 +662,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) FILE *fp; if (me == 0) { fp = fopen(file,"w"); - if (fp == NULL) error->one(FLERR,"Cannot open processors output file"); + if (fp == nullptr) error->one(FLERR,"Cannot open processors output file"); fprintf(fp,"LAMMPS mapping of processors to 3d grid\n"); fprintf(fp,"partition = %d\n",universe->iworld+1); fprintf(fp,"Px Py Pz = %d %d %d\n",procgrid[0],procgrid[1],procgrid[2]); @@ -722,7 +722,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) /* ---------------------------------------------------------------------- generate all possible 3-integer factorizations of N - store them in factors if non-NULL + store them in factors if non-nullptr return # of factorizations ------------------------------------------------------------------------- */ diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 29314525a..3f5bd7a62 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -27,7 +27,7 @@ enum{ADD,SUBTRACT}; /* ---------------------------------------------------------------------- */ RanMars::RanMars(LAMMPS *lmp, int seed) : Pointers(lmp), - u(NULL) + u(nullptr) { int ij,kl,i,j,k,l,ii,jj,m; double s,t; diff --git a/src/rcb.cpp b/src/rcb.cpp index 03c99560b..36e1a5474 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -39,19 +39,19 @@ RCB::RCB(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); ndot = maxdot = 0; - dots = NULL; + dots = nullptr; nlist = maxlist = 0; - dotlist = dotmark = dotmark_select = NULL; + dotlist = dotmark = dotmark_select = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; maxrecv = maxsend = 0; - recvproc = recvindex = sendproc = sendindex = NULL; + recvproc = recvindex = sendproc = sendindex = nullptr; - tree = NULL; - irregular = NULL; + tree = nullptr; + irregular = nullptr; // create MPI data and function types for box and median AllReduce ops @@ -95,7 +95,7 @@ RCB::~RCB() NEW version: each RCB cut is tested in all dimensions dimeension that produces 2 boxes with largest min size is selected this is to prevent very narrow boxes from being produced - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -573,10 +573,10 @@ void RCB::compute(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner @@ -632,7 +632,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt, /* ---------------------------------------------------------------------- perform RCB balancing of N particles at coords X in bounding box LO/HI OLD version: each RCB cut is made in longest dimension of sub-box - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -1065,10 +1065,10 @@ void RCB::compute_old(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner diff --git a/src/read_data.cpp b/src/read_data.cpp index 2a6801b3a..231871c47 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -62,7 +62,7 @@ enum{NONE,APPEND,VALUE,MERGE}; const char *suffixes[] = {"/cuda","/gpu","/opt","/omp","/kk", "/coul/cut","/coul/long","/coul/msm", "/coul/dsf","/coul/debye","/coul/charmm", - NULL}; + nullptr}; /* ---------------------------------------------------------------------- */ @@ -74,8 +74,8 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp) style = new char[MAXLINE]; buffer = new char[CHUNK*MAXLINE]; narg = maxarg = 0; - arg = NULL; - fp = NULL; + arg = nullptr; + fp = nullptr; // customize for new sections // pointers to atom styles that store bonus info @@ -132,9 +132,9 @@ void ReadData::command(int narg, char **arg) groupbit = 0; nfix = 0; - fix_index = NULL; - fix_header = NULL; - fix_section = NULL; + fix_index = nullptr; + fix_header = nullptr; + fix_section = nullptr; int iarg = 1; while (iarg < narg) { @@ -277,7 +277,7 @@ void ReadData::command(int narg, char **arg) fix_index[nfix] = modify->find_fix(arg[iarg+1]); if (fix_index[nfix] < 0) error->all(FLERR,"Fix ID for read_data does not exist"); - if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = NULL; + if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = nullptr; else { int n = strlen(arg[iarg+2]) + 1; fix_header[nfix] = new char[n]; @@ -334,12 +334,12 @@ void ReadData::command(int narg, char **arg) // set up pointer to hold original styles while we replace them with "zero" - Pair *saved_pair = NULL; - Bond *saved_bond = NULL; - Angle *saved_angle = NULL; - Dihedral *saved_dihedral = NULL; - Improper *saved_improper = NULL; - KSpace *saved_kspace = NULL; + Pair *saved_pair = nullptr; + Bond *saved_bond = nullptr; + Angle *saved_angle = nullptr; + Dihedral *saved_dihedral = nullptr; + Improper *saved_improper = nullptr; + KSpace *saved_kspace = nullptr; if (coeffflag == 0) { char *coeffs[2]; @@ -347,33 +347,33 @@ void ReadData::command(int narg, char **arg) coeffs[1] = (char *) "nocoeff"; saved_pair = force->pair; - force->pair = NULL; + force->pair = nullptr; force->create_pair("zero",0); if (force->pair) force->pair->settings(2,coeffs); coeffs[0] = coeffs[1]; saved_bond = force->bond; - force->bond = NULL; + force->bond = nullptr; force->create_bond("zero",0); if (force->bond) force->bond->settings(1,coeffs); saved_angle = force->angle; - force->angle = NULL; + force->angle = nullptr; force->create_angle("zero",0); if (force->angle) force->angle->settings(1,coeffs); saved_dihedral = force->dihedral; - force->dihedral = NULL; + force->dihedral = nullptr; force->create_dihedral("zero",0); if (force->dihedral) force->dihedral->settings(1,coeffs); saved_improper = force->improper; - force->improper = NULL; + force->improper = nullptr; force->create_improper("zero",0); if (force->improper) force->improper->settings(1,coeffs); saved_kspace = force->kspace; - force->kspace = NULL; + force->kspace = nullptr; } // ----------------------------------------------------------------- @@ -414,7 +414,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (firstpass) utils::logmesg(lmp,"Reading data file ...\n"); open(arg[0]); - } else fp = NULL; + } else fp = nullptr; // read header info @@ -578,7 +578,7 @@ void ReadData::command(int narg, char **arg) if (firstpass) mass(); else skip_lines(ntypes); } else if (strcmp(keyword,"Pair Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before Pair Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -587,7 +587,7 @@ void ReadData::command(int narg, char **arg) paircoeffs(); } else skip_lines(ntypes); } else if (strcmp(keyword,"PairIJ Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before PairIJ Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -598,7 +598,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Bond Coeffs") == 0) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Invalid data file section: Bond Coeffs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must define bond_style before Bond Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->bond_style)) @@ -609,7 +609,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Angle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: Angle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before Angle Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->angle_style)) @@ -620,7 +620,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Dihedral Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: Dihedral Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->dihedral_style)) @@ -631,7 +631,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Improper Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: Improper Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Must define improper_style before Improper Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->improper_style)) @@ -643,14 +643,14 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondBond Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondBond Coeffs"); if (firstpass) anglecoeffs(1); else skip_lines(nangletypes); } else if (strcmp(keyword,"BondAngle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondAngle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondAngle Coeffs"); if (firstpass) anglecoeffs(2); else skip_lines(nangletypes); @@ -659,7 +659,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: MiddleBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "MiddleBondTorsion Coeffs"); @@ -668,7 +668,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before EndBondTorsion Coeffs"); if (firstpass) dihedralcoeffs(2); @@ -676,7 +676,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before AngleTorsion Coeffs"); if (firstpass) dihedralcoeffs(3); @@ -685,7 +685,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: AngleAngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "AngleAngleTorsion Coeffs"); @@ -694,7 +694,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: BondBond13 Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before BondBond13 Coeffs"); if (firstpass) dihedralcoeffs(5); @@ -703,7 +703,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: AngleAngle Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR, "Must define improper_style before AngleAngle Coeffs"); if (firstpass) impropercoeffs(1); @@ -725,7 +725,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } // done if this was 2nd pass @@ -929,7 +929,7 @@ void ReadData::header(int firstpass) if (me == 0) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } while (1) { @@ -937,7 +937,7 @@ void ReadData::header(int firstpass) // read a line and bcast length if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1289,7 +1289,7 @@ void ReadData::bonds(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1363,7 +1363,7 @@ void ReadData::angles(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1437,7 +1437,7 @@ void ReadData::dihedrals(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1511,7 +1511,7 @@ void ReadData::impropers(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1641,7 +1641,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) while (nchunk < nmax && nline <= CHUNK-MAXBODY) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); rv = sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble); if (rv != 3) error->one(FLERR,"Incorrect format in Bodies section of data file"); @@ -1655,7 +1655,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ninteger) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1669,7 +1669,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ndouble) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1743,7 +1743,7 @@ void ReadData::paircoeffs() for (int i = 0; i < ntypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,1,2,toffset); + parse_coeffs(buf,nullptr,1,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1770,7 +1770,7 @@ void ReadData::pairIJcoeffs() for (j = i; j < ntypes; j++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,2,toffset); + parse_coeffs(buf,nullptr,0,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1795,7 +1795,7 @@ void ReadData::bondcoeffs() for (int i = 0; i < nbondtypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,1,boffset); + parse_coeffs(buf,nullptr,0,1,boffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in BondCoeffs section"); force->bond->coeff(narg,arg); @@ -1820,7 +1820,7 @@ void ReadData::anglecoeffs(int which) for (int i = 0; i < nangletypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,aoffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,aoffset); else if (which == 1) parse_coeffs(buf,"bb",0,1,aoffset); else if (which == 2) parse_coeffs(buf,"ba",0,1,aoffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in AngleCoeffs section"); @@ -1846,7 +1846,7 @@ void ReadData::dihedralcoeffs(int which) for (int i = 0; i < ndihedraltypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,doffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,doffset); else if (which == 1) parse_coeffs(buf,"mbt",0,1,doffset); else if (which == 2) parse_coeffs(buf,"ebt",0,1,doffset); else if (which == 3) parse_coeffs(buf,"at",0,1,doffset); @@ -1876,7 +1876,7 @@ void ReadData::impropercoeffs(int which) for (int i = 0; i < nimpropertypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,ioffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,ioffset); else if (which == 1) parse_coeffs(buf,"aa",0,1,ioffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in ImproperCoeffs section"); force->improper->coeff(narg,arg); @@ -1945,7 +1945,7 @@ void ReadData::open(char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -1970,15 +1970,15 @@ void ReadData::parse_keyword(int first) if (me == 0) { if (!first) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } while (eof == 0 && done == 0) { int blank = strspn(line," \t\n\r"); if ((blank == (int)strlen(line)) || (line[blank] == '#')) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } else done = 1; } - if (fgets(buffer,MAXLINE,fp) == NULL) { + if (fgets(buffer,MAXLINE,fp) == nullptr) { eof = 1; buffer[0] = '\0'; } @@ -2031,16 +2031,16 @@ void ReadData::skip_lines(bigint n) { if (me) return; if (n <= 0) return; - char *eof = NULL; + char *eof = nullptr; for (bigint i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } /* ---------------------------------------------------------------------- parse a line of coeffs into words, storing them in narg,arg trim anything from '#' onward word strings remain in line, are not copied - if addstr != NULL, add addstr as extra arg for class2 angle/dihedral/improper + if addstr != nullptr, add addstr as extra arg for class2 angle/dihedral/improper if 2nd word starts with letter, then is hybrid style, add addstr after it else add addstr before 2nd word if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2" @@ -2065,7 +2065,7 @@ void ReadData::parse_coeffs(char *line, const char *addstr, arg[narg++] = word; if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr; if (dupflag && narg == 1) arg[narg++] = word; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } // to avoid segfaults on empty lines @@ -2094,12 +2094,12 @@ int ReadData::style_match(const char *one, const char *two) { int i,delta,len,len1,len2; - if ((one == NULL) || (two == NULL)) return 1; + if ((one == nullptr) || (two == nullptr)) return 1; len1 = strlen(one); len2 = strlen(two); - for (i = 0; suffixes[i] != NULL; i++) { + for (i = 0; suffixes[i] != nullptr; i++) { len = strlen(suffixes[i]); if ((delta = len1 - len) > 0) if (strcmp(one+delta,suffixes[i]) == 0) len1 = delta; diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 10218fe61..2fd14b547 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -55,22 +55,22 @@ ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp) triclinic = domain->triclinic; nfile = 0; - files = NULL; + files = nullptr; nnew = maxnew = 0; nfield = 0; - fieldtype = NULL; - fieldlabel = NULL; - fields = NULL; - buf = NULL; + fieldtype = nullptr; + fieldlabel = nullptr; + fields = nullptr; + buf = nullptr; int n = strlen("native") + 1; readerstyle = new char[n]; strcpy(readerstyle,"native"); nreader = 0; - readers = NULL; - nsnapatoms = NULL; + readers = nullptr; + nsnapatoms = nullptr; clustercomm = MPI_COMM_NULL; filereader = 0; parallel = 0; @@ -111,9 +111,9 @@ void ReadDump::command(int narg, char **arg) int nremain = narg - 2; if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = fields_and_keywords(0,NULL); + else nremain = fields_and_keywords(0,nullptr); if (nremain) setup_reader(nremain,&arg[narg-nremain]); - else setup_reader(0,NULL); + else setup_reader(0,nullptr); // find the snapshot and read/bcast/process header info @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid NULL ptr + newmaxnew = MAX(newmaxnew,1); // avoid nullptr ptr memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); @@ -1207,7 +1207,7 @@ int ReadDump::fields_and_keywords(int narg, char **arg) purgeflag = 0; trimflag = 0; addflag = NOADD; - for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; + for (int i = 0; i < nfield; i++) fieldlabel[i] = nullptr; scaleflag = 0; wrapflag = 1; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index dcab9f834..81a686223 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -108,7 +108,7 @@ void ReadRestart::command(int narg, char **arg) hfile.replace(hfile.find("%"),1,"base"); } fp = fopen(hfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", hfile, utils::getsyserror())); } @@ -166,7 +166,7 @@ void ReadRestart::command(int narg, char **arg) if (multiproc && me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // read per-proc info @@ -174,7 +174,7 @@ void ReadRestart::command(int narg, char **arg) AtomVec *avec = atom->avec; int maxbuf = 0; - double *buf = NULL; + double *buf = nullptr; int m,flag; // MPI-IO input from single file @@ -255,7 +255,7 @@ void ReadRestart::command(int narg, char **arg) if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -270,34 +270,34 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",iproc)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); int procsperfile; - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); for (int i = 0; i < procsperfile; i++) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); m = 0; while (m < n) m += avec->unpack_restart(&buf[m]); } fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -334,7 +334,7 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",icluster)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); } @@ -342,10 +342,10 @@ void ReadRestart::command(int narg, char **arg) int flag,procsperfile; if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&procsperfile,1,MPI_INT,0,clustercomm); @@ -354,17 +354,17 @@ void ReadRestart::command(int narg, char **arg) for (int i = 0; i < procsperfile; i++) { if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); if (i % nclusterprocs) { iproc = me + (i % nclusterprocs); @@ -391,9 +391,9 @@ void ReadRestart::command(int narg, char **arg) } } - if (filereader && fp != NULL) { + if (filereader && fp != nullptr) { fclose(fp); - fp = NULL; + fp = nullptr; } MPI_Comm_free(&clustercomm); } @@ -570,11 +570,11 @@ void ReadRestart::file_search(char *inpfile, char *outfile) struct dirent *ep; DIR *dp = opendir(dirname); - if (dp == NULL) + if (dp == nullptr) error->one(FLERR,"Cannot open dir to search for restart file"); while ((ep = readdir(dp))) { if (strstr(ep->d_name,begin) != ep->d_name) continue; - if ((ptr = strstr(&ep->d_name[nbegin],end)) == NULL) continue; + if ((ptr = strstr(&ep->d_name[nbegin],end)) == nullptr) continue; if (strlen(end) == 0) ptr = ep->d_name + strlen(ep->d_name); *ptr = '\0'; if ((int)strlen(&ep->d_name[nbegin]) < n) { @@ -1034,7 +1034,7 @@ void ReadRestart::file_layout() memory->create(nproc_chunk_number,nprocs, "write_restart:nproc_chunk_number"); - utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,NULL,error); + utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,nullptr,error); if ((nprocs != nprocs_file) && !(atom->nextra_store)) { // nprocs differ, but atom sizes are fixed length, yeah! @@ -1232,7 +1232,7 @@ double ReadRestart::read_double() } /* ---------------------------------------------------------------------- - read a char string (including NULL) and bcast it + read a char string (including nullptr) and bcast it str is allocated here, ptr is returned, caller must deallocate ------------------------------------------------------------------------- */ @@ -1241,7 +1241,7 @@ char *ReadRestart::read_string() int n = read_int(); if (n < 0) error->all(FLERR,"Illegal size string or corrupt restart"); char *value = new char[n]; - if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,nullptr,error); MPI_Bcast(value,n,MPI_CHAR,0,world); return value; } @@ -1253,7 +1253,7 @@ char *ReadRestart::read_string() void ReadRestart::read_int_vec(int n, int *vec) { if (n < 0) error->all(FLERR,"Illegal size integer vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_INT,0,world); } @@ -1264,6 +1264,6 @@ void ReadRestart::read_int_vec(int n, int *vec) void ReadRestart::read_double_vec(int n, double *vec) { if (n < 0) error->all(FLERR,"Illegal size double vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_DOUBLE,0,world); } diff --git a/src/reader.cpp b/src/reader.cpp index 8230fa3ed..218fd75df 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; Reader::Reader(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -35,7 +35,7 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) void Reader::open_file(const char *file) { - if (fp != NULL) close_file(); + if (fp != nullptr) close_file(); compressed = 0; const char *suffix = file + strlen(file) - 3; @@ -55,7 +55,7 @@ void Reader::open_file(const char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -67,10 +67,10 @@ void Reader::open_file(const char *file) void Reader::close_file() { - if (fp == NULL) return; + if (fp == nullptr) return; if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/reader_native.cpp b/src/reader_native.cpp index e0f0d7792..11241047a 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -34,7 +34,7 @@ enum{UNSET,NOSCALE_NOWRAP,NOSCALE_WRAP,SCALE_NOWRAP,SCALE_WRAP}; ReaderNative::ReaderNative(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - fieldindex = NULL; + fieldindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ ReaderNative::~ReaderNative() int ReaderNative::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // skip over unit and time information, if present. @@ -110,7 +110,7 @@ void ReaderNative::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flags = scaleflag+wrapflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 @@ -315,7 +315,7 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); // tokenize the line std::vector words = Tokenizer(line).as_vector(); @@ -351,8 +351,8 @@ int ReaderNative::find_label(const std::string & label, const std::mapone(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp index 8a2f7a398..82fe756c2 100644 --- a/src/reader_xyz.cpp +++ b/src/reader_xyz.cpp @@ -31,7 +31,7 @@ enum{ID,TYPE,X,Y,Z}; ReaderXYZ::ReaderXYZ(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - fieldindex = NULL; + fieldindex = nullptr; nstep = 0; } @@ -52,7 +52,7 @@ ReaderXYZ::~ReaderXYZ() int ReaderXYZ::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // first line has to have the number of atoms // truncate the string to the first whitespace, @@ -109,7 +109,7 @@ void ReaderXYZ::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ @@ -174,7 +174,7 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); ++nid; rv = sscanf(line,"%*s%lg%lg%lg", &myx, &myy, &myz); @@ -216,8 +216,8 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) void ReaderXYZ::read_lines(int n) { - char *eof = NULL; + char *eof = nullptr; if (n <= 0) return; for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/region.cpp b/src/region.cpp index 15b6fee27..c7c262788 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), contact(NULL), list(NULL), - xstr(NULL), ystr(NULL), zstr(NULL), tstr(NULL) + id(nullptr), style(nullptr), contact(nullptr), list(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr), tstr(nullptr) { int n = strlen(arg[0]) + 1; id = new char[n]; @@ -42,13 +42,13 @@ Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : strcpy(style,arg[1]); varshape = 0; - xstr = ystr = zstr = tstr = NULL; + xstr = ystr = zstr = tstr = nullptr; dx = dy = dz = 0.0; size_restart = 5; reset_vel(); copymode = 0; - list = NULL; + list = nullptr; nregion = 1; } diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index f7676a3d7..2d40052e0 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -30,7 +30,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), c1str(NULL), c2str(NULL), rstr(NULL) + Region(lmp, narg, arg), c1str(nullptr), c2str(nullptr), rstr(nullptr) { options(narg-8,&arg[8]); diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index a61e2556b..35c6c502a 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -23,7 +23,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), idsub(NULL) + Region(lmp, narg, arg), idsub(nullptr) { nregion = 0; diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 4256af421..5282095c8 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -28,7 +28,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL) + Region(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr) { options(narg-6,&arg[6]); diff --git a/src/region_union.cpp b/src/region_union.cpp index 677f1022f..3ee0765f0 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), - idsub(NULL) + idsub(nullptr) { nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); diff --git a/src/replicate.cpp b/src/replicate.cpp index 374d7113b..471af6934 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -154,7 +154,7 @@ void Replicate::command(int narg, char **arg) // also set atomKK for Kokkos version of Atom class Atom *old = atom; - atomKK = NULL; + atomKK = nullptr; if (lmp->kokkos) atom = atomKK = new AtomKokkos(lmp); else atom = new Atom(lmp); diff --git a/src/rerun.cpp b/src/rerun.cpp index 51c0f6fdb..00cd1d408 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -120,9 +120,9 @@ void Rerun::command(int narg, char **arg) rd->store_files(nfile,arg); if (nremain) nremain = rd->fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = rd->fields_and_keywords(0,NULL); + else nremain = rd->fields_and_keywords(0,nullptr); if (nremain) rd->setup_reader(nremain,&arg[narg-nremain]); - else rd->setup_reader(0,NULL); + else rd->setup_reader(0,nullptr); // perform the pseudo run // invoke lmp->init() only once diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index ad2caad65..10337fd18 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -33,8 +33,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) { - cfa = NULL; - cca = NULL; + cfa = nullptr; + cca = nullptr; // default settings diff --git a/src/respa.cpp b/src/respa.cpp index c970c63a1..ecc6cc58f 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -46,8 +46,8 @@ using namespace LAMMPS_NS; Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg), - step(NULL), loop(NULL), hybrid_level(NULL), hybrid_compute(NULL), - newton(NULL), fix_respa(NULL) + step(nullptr), loop(nullptr), hybrid_level(nullptr), hybrid_compute(nullptr), + newton(nullptr), fix_respa(nullptr) { nhybrid_styles = 0; if (narg < 1) error->all(FLERR,"Illegal run_style respa command"); diff --git a/src/run.cpp b/src/run.cpp index 166955d6a..f5b571844 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -91,7 +91,7 @@ void Run::command(int narg, char **arg) // all remaining args are commands // first,last = arg index of first/last commands - // set ncommands = 0 if single command and it is NULL + // set ncommands = 0 if single command and it is nullptr } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); @@ -140,7 +140,7 @@ void Run::command(int narg, char **arg) // if nevery, make copies of arg strings that are commands // required because re-parsing commands via input->one() will wipe out args - char **commands = NULL; + char **commands = nullptr; if (nevery && ncommands > 0) { commands = new char*[ncommands]; ncommands = 0; diff --git a/src/set.cpp b/src/set.cpp index 3b2cd44ad..f66de96e9 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -74,7 +74,7 @@ void Set::command(int narg, char **arg) int n = strlen(arg[1]) + 1; id = new char[n]; strcpy(id,arg[1]); - select = NULL; + select = nullptr; selection(atom->nlocal); // loop over keyword/value pairs @@ -689,7 +689,7 @@ void Set::set(int keyword) { // evaluate atom-style variable(s) if necessary - vec1 = vec2 = vec3 = vec4 = NULL; + vec1 = vec2 = vec3 = vec4 = nullptr; if (varflag) { int nlocal = atom->nlocal; @@ -907,7 +907,7 @@ void Set::set(int keyword) // enforce quat rotation vector in z dir for 2d systems else if (keyword == QUAT) { - double *quat = NULL; + double *quat = nullptr; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) diff --git a/src/special.cpp b/src/special.cpp index eb74f534f..9661fa5ad 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -34,7 +34,7 @@ Special::Special(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - onetwo = onethree = onefour = NULL; + onetwo = onethree = onefour = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/thermo.cpp b/src/thermo.cpp index 787b0cdda..485974cc8 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -147,9 +147,9 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // ptrs, flags, IDs for compute objects thermo may use or create - temperature = NULL; - pressure = NULL; - pe = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; index_temp = index_press_scalar = index_press_vector = index_pe = -1; @@ -179,10 +179,10 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]); sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]); - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; } /* ---------------------------------------------------------------------- */ @@ -563,13 +563,13 @@ void Thermo::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; for (int i = 0; i < nfield_initial+1; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } iarg += 2; continue; @@ -593,7 +593,7 @@ void Thermo::modify_params(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Thermo_modify int format does not contain d character"); char str[8]; @@ -632,14 +632,14 @@ void Thermo::allocate() int n = nfield_initial + 1; keyword = new char*[n]; - for (int i = 0; i < n; i++) keyword[i] = NULL; + for (int i = 0; i < n; i++) keyword[i] = nullptr; vfunc = new FnPtr[n]; vtype = new int[n]; format = new char*[n]; for (int i = 0; i < n; i++) format[i] = new char[32]; format_column_user = new char*[n]; - for (int i = 0; i < n; i++) format_column_user[i] = NULL; + for (int i = 0; i < n; i++) format_column_user[i] = nullptr; field2index = new int[n]; argindex1 = new int[n]; @@ -893,7 +893,7 @@ void Thermo::parse_fields(char *str) // argindex1,argindex2 = int inside each bracket pair, 0 if no bracket char *ptr = strchr(id,'['); - if (ptr == NULL) argindex1[nfield] = argindex2[nfield] = 0; + if (ptr == nullptr) argindex1[nfield] = argindex2[nfield] = 0; else { *ptr = '\0'; argindex1[nfield] = diff --git a/src/universe.cpp b/src/universe.cpp index cd079a45c..ecdd5aa04 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -40,12 +40,12 @@ Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : Pointers(lmp) MPI_Comm_size(uworld,&nprocs); uscreen = stdout; - ulogfile = NULL; + ulogfile = nullptr; existflag = 0; nworlds = 0; - procs_per_world = NULL; - root_proc = NULL; + procs_per_world = nullptr; + root_proc = nullptr; memory->create(uni2orig,nprocs,"universe:uni2orig"); for (int i = 0; i < nprocs; i++) uni2orig[i] = i; @@ -95,7 +95,7 @@ void Universe::reorder(char *style, char *arg) if (me == 0) { FILE *fp = fopen(arg,"r"); - if (fp == NULL) + if (fp == nullptr) error->universe_one(FLERR,fmt::format("Cannot open -reorder " "file {}: {}",arg, utils::getsyserror())); @@ -156,7 +156,7 @@ void Universe::reorder(char *style, char *arg) /* ---------------------------------------------------------------------- add 1 or more worlds to universe - str == NULL -> add 1 world with all procs in universe + str == nullptr -> add 1 world with all procs in universe str = NxM -> add N worlds, each with M procs str = P -> add 1 world with P procs ------------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ void Universe::add_world(char *str) n = 1; nper = 0; - if (str != NULL) { + if (str != nullptr) { // check for valid partition argument @@ -184,7 +184,7 @@ void Universe::add_world(char *str) else valid = false; if (valid) { - if ((ptr = strchr(str,'x')) != NULL) { + if ((ptr = strchr(str,'x')) != nullptr) { // 'x' may not be the first or last character diff --git a/src/update.cpp b/src/update.cpp index 399584473..00e396c6a 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -48,13 +48,13 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) eflag_global = vflag_global = -1; - unit_style = NULL; + unit_style = nullptr; set_units("lj"); - integrate_style = NULL; - integrate = NULL; - minimize_style = NULL; - minimize = NULL; + integrate_style = nullptr; + integrate = nullptr; + minimize_style = nullptr; + minimize = nullptr; integrate_map = new IntegrateCreatorMap(); diff --git a/src/utils.cpp b/src/utils.cpp index f63deac0d..e985f9e6e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -152,7 +152,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, Error *error) { char *rv = fgets(s,size,fp); - if (rv == NULL) { // something went wrong + if (rv == nullptr) { // something went wrong char buf[MAXPATHLENBUF]; std::string errmsg; @@ -171,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is NULL + if (s) *s = '\0'; // truncate string to empty in case error is nullptr } return; } @@ -377,19 +377,19 @@ void utils::bounds(const char *file, int line, const std::string &str, nlo = nhi = -1; if (found == std::string::npos) { // contains no '*' - nlo = nhi = strtol(str.c_str(),NULL,10); + nlo = nhi = strtol(str.c_str(),nullptr,10); } else if (str.size() == 1) { // is only '*' nlo = nmin; nhi = nmax; } else if (found == 0) { // is '*j' nlo = nmin; - nhi = strtol(str.substr(1).c_str(),NULL,10); + nhi = strtol(str.substr(1).c_str(),nullptr,10); } else if (str.size() == found+1) { // is 'i*' - nlo = strtol(str.c_str(),NULL,10); + nlo = strtol(str.c_str(),nullptr,10); nhi = nmax; } else { // is 'i*j' - nlo = strtol(str.c_str(),NULL,10); - nhi = strtol(str.substr(found+1).c_str(),NULL,10); + nlo = strtol(str.c_str(),nullptr,10); + nhi = strtol(str.substr(found+1).c_str(),nullptr,10); } if (error) { @@ -422,7 +422,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int n,iarg,index,nlo,nhi,nmax,expandflag,icompute,ifix; char *ptr1,*ptr2,*str; - ptr1 = NULL; + ptr1 = nullptr; for (iarg = 0; iarg < narg; iarg++) { ptr1 = strchr(arg[iarg],'*'); if (ptr1) break; @@ -1000,10 +1000,10 @@ double utils::timespec2seconds(const std::string ×pec) int utils::date2num(const std::string &date) { std::size_t found = date.find_first_not_of("0123456789 "); - int num = strtol(date.substr(0,found).c_str(),NULL,10); + int num = strtol(date.substr(0,found).c_str(),nullptr,10); auto month = date.substr(found); found = month.find_first_of("0123456789 "); - num += strtol(month.substr(found).c_str(),NULL,10)*10000; + num += strtol(month.substr(found).c_str(),nullptr,10)*10000; if (num < 1000000) num += 20000000; if (strmatch(month,"^Jan")) num += 100; diff --git a/src/utils.h b/src/utils.h index 06aef4654..cf8952b8a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -60,7 +60,7 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfgets(const char *srcname, int srcline, char *s, int size, @@ -75,7 +75,7 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfread(const char *srcname, int srcline, void *s, size_t size, @@ -354,7 +354,7 @@ namespace LAMMPS_NS { * If the potential file has a ``UNITS`` tag in the first line, the * tag's value is compared to the current unit style setting. * The behavior of the function then depends on the value of the - * *auto_convert* parameter. If it is ``NULL``, then the unit values + * *auto_convert* parameter. If it is ``nullptr``, then the unit values * must match or else the open will fail with an error. Otherwise * the bitmask that *auto_convert* points to is used check for * compatibility with possible automatic conversions by the calling @@ -363,8 +363,8 @@ namespace LAMMPS_NS { * * \param name file- or pathname of the potential file * \param lmp pointer to top-level LAMMPS class instance - * \param auto_convert pointer to unit conversion bitmask or NULL - * \return FILE pointer of the opened potential file or NULL*/ + * \param auto_convert pointer to unit conversion bitmask or nullptr + * \return FILE pointer of the opened potential file or nullptr*/ FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); diff --git a/src/variable.cpp b/src/variable.cpp index 8d4416dfa..5ceed4dd3 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -86,20 +86,20 @@ Variable::Variable(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); nvar = maxvar = 0; - names = NULL; - style = NULL; - num = NULL; - which = NULL; - pad = NULL; - reader = NULL; - data = NULL; - dvalue = NULL; - vecs = NULL; + names = nullptr; + style = nullptr; + num = nullptr; + which = nullptr; + pad = nullptr; + reader = nullptr; + data = nullptr; + dvalue = nullptr; + vecs = nullptr; - eval_in_progress = NULL; + eval_in_progress = nullptr; - randomequal = NULL; - randomatom = NULL; + randomequal = nullptr; + randomatom = nullptr; // customize by assigning a precedence level @@ -207,7 +207,7 @@ void Variable::set(int narg, char **arg) num[nvar] = nlast; which[nvar] = nfirst-1; data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; // WORLD // num = listed args, which = partition this proc is in, data = copied args @@ -251,7 +251,7 @@ void Variable::set(int narg, char **arg) style[nvar] = ULOOP; num[nvar] = utils::inumeric(FLERR,arg[2],false,lmp); data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; if (narg == 4) { char digits[12]; sprintf(digits,"%d",num[nvar]); @@ -265,12 +265,12 @@ void Variable::set(int narg, char **arg) if (universe->me == 0) { FILE *fp = fopen("tmp.lammps.variable","w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open temporary file for world counter: " + utils::getsyserror()); fprintf(fp,"%d\n",universe->nworlds); fclose(fp); - fp = NULL; + fp = nullptr; } for (int jvar = 0; jvar < nvar; jvar++) @@ -355,7 +355,7 @@ void Variable::set(int narg, char **arg) // ATOMFILE for numbers // which = 1st value - // data = NULL + // data = nullptr } else if (strcmp(arg[1],"atomfile") == 0) { if (narg != 3) error->all(FLERR,"Illegal variable command"); @@ -366,7 +366,7 @@ void Variable::set(int narg, char **arg) which[nvar] = 0; pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; reader[nvar] = new VarReader(lmp,arg[0],arg[2],ATOMFILE); int flag = reader[nvar]->read_peratom(); if (flag) error->all(FLERR,"Atomfile variable could not read values"); @@ -706,7 +706,7 @@ int Variable::next(int narg, char **arg) char buf[64]; for (int loopmax = 0; loopmax < 100; ++loopmax) { fp = fopen("tmp.lammps.variable.lock","r"); - if (fp == NULL) goto uloop_again; + if (fp == nullptr) goto uloop_again; buf[0] = buf[1] = '\0'; fread(buf,1,64,fp); @@ -731,7 +731,7 @@ int Variable::next(int narg, char **arg) fprintf(fp,"%d\n",nextindex+1); //printf("WRITE %d %d\n",universe->me,nextindex+1); fclose(fp); - fp = NULL; + fp = nullptr; rename("tmp.lammps.variable.lock","tmp.lammps.variable"); if (universe->uscreen) fprintf(universe->uscreen, @@ -840,15 +840,15 @@ int Variable::vectorstyle(int ivar) check if variable with name is PYTHON and matches funcname called by Python class before it invokes a Python function return data storage so Python function can return a value for this variable - return NULL if not a match + return nullptr if not a match ------------------------------------------------------------------------- */ char *Variable::pythonstyle(char *name, char *funcname) { int ivar = find(name); - if (ivar < 0) return NULL; - if (style[ivar] != PYTHON) return NULL; - if (strcmp(data[ivar][0],funcname) != 0) return NULL; + if (ivar < 0) return nullptr; + if (style[ivar] != PYTHON) return nullptr; + if (strcmp(data[ivar][0],funcname) != 0) return nullptr; return data[ivar][1]; } @@ -873,23 +873,23 @@ int Variable::internalstyle(int ivar) if GETENV, query environment and put result in str if PYTHON, evaluate Python function, it will put result in str if INTERNAL, convert dvalue and put result in str - if ATOM or ATOMFILE or VECTOR, return NULL - return NULL if no variable with name, or which value is bad, + if ATOM or ATOMFILE or VECTOR, return nullptr + return nullptr if no variable with name, or which value is bad, caller must respond ------------------------------------------------------------------------- */ char *Variable::retrieve(const char *name) { int ivar = find(name); - if (ivar < 0) return NULL; - if (which[ivar] >= num[ivar]) return NULL; + if (ivar < 0) return nullptr; + if (which[ivar] >= num[ivar]) return nullptr; if (eval_in_progress[ivar]) print_var_error(FLERR,"Variable has a circular dependency",ivar); eval_in_progress[ivar] = 1; - char *str = NULL; + char *str = nullptr; if (style[ivar] == INDEX || style[ivar] == WORLD || style[ivar] == UNIVERSE || style[ivar] == STRING || style[ivar] == SCALARFILE) { @@ -908,19 +908,19 @@ char *Variable::retrieve(const char *name) strcpy(data[ivar][0],result); str = data[ivar][0]; } else if (style[ivar] == EQUAL) { - double answer = evaluate(data[ivar][0],NULL,ivar); + double answer = evaluate(data[ivar][0],nullptr,ivar); sprintf(data[ivar][1],"%.15g",answer); str = data[ivar][1]; } else if (style[ivar] == FORMAT) { int jvar = find(data[ivar][0]); - if (jvar == -1) return NULL; - if (!equalstyle(jvar)) return NULL; + if (jvar == -1) return nullptr; + if (!equalstyle(jvar)) return nullptr; double answer = compute_equal(jvar); sprintf(data[ivar][2],data[ivar][1],answer); str = data[ivar][2]; } else if (style[ivar] == GETENV) { const char *result = getenv(data[ivar][0]); - if (result == NULL) result = (const char *) ""; + if (result == nullptr) result = (const char *) ""; int n = strlen(result) + 1; if (n > VALUELENGTH) { delete [] data[ivar][1]; @@ -943,7 +943,7 @@ char *Variable::retrieve(const char *name) sprintf(data[ivar][0],"%.15g",dvalue[ivar]); str = data[ivar][0]; } else if (style[ivar] == ATOM || style[ivar] == ATOMFILE || - style[ivar] == VECTOR) return NULL; + style[ivar] == VECTOR) return nullptr; eval_in_progress[ivar] = 0; @@ -965,7 +965,7 @@ double Variable::compute_equal(int ivar) eval_in_progress[ivar] = 1; double value = 0.0; - if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL,ivar); + if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],nullptr,ivar); else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == PYTHON) { int ifunc = python->find(data[ivar][0]); @@ -987,7 +987,7 @@ double Variable::compute_equal(int ivar) double Variable::compute_equal(char *str) { - return evaluate(str,NULL,-1); + return evaluate(str,nullptr,-1); } /* ---------------------------------------------------------------------- @@ -1000,7 +1000,7 @@ double Variable::compute_equal(char *str) void Variable::compute_atom(int ivar, int igroup, double *result, int stride, int sumflag) { - Tree *tree = NULL; + Tree *tree = nullptr; double *vstore; if (eval_in_progress[ivar]) @@ -1014,7 +1014,7 @@ void Variable::compute_atom(int ivar, int igroup, collapse_tree(tree); } else vstore = reader[ivar]->fixstore->vstore; - if (result == NULL) { + if (result == nullptr) { if (style[ivar] == ATOM) free_tree(tree); eval_in_progress[ivar] = 0; return; @@ -1073,7 +1073,7 @@ void Variable::compute_atom(int ivar, int igroup, int Variable::compute_vector(int ivar, double **result) { - Tree *tree = NULL; + Tree *tree = nullptr; if (vecs[ivar].currentstep == update->ntimestep) { *result = vecs[ivar].values; return vecs[ivar].n; @@ -1166,7 +1166,7 @@ void Variable::grow() reader = (VarReader **) memory->srealloc(reader,maxvar*sizeof(VarReader *),"var:reader"); - for (int i = old; i < maxvar; i++) reader[i] = NULL; + for (int i = old; i < maxvar; i++) reader[i] = nullptr; data = (char ***) memory->srealloc(data,maxvar*sizeof(char **),"var:data"); memory->grow(dvalue,maxvar,"var:dvalue"); @@ -1175,7 +1175,7 @@ void Variable::grow() for (int i = old; i < maxvar; i++) { vecs[i].nmax = 0; vecs[i].currentstep = -1; - vecs[i].values = NULL; + vecs[i].values = nullptr; } memory->grow(eval_in_progress,maxvar,"var:eval_in_progress"); @@ -1214,9 +1214,9 @@ void Variable::copy(int narg, char **from, char **to) compute = c_ID, c_ID[i], c_ID[i][j] fix = f_ID, f_ID[i], f_ID[i][j] variable = v_name, v_name[i] - equal-style variables passes in tree = NULL: + equal-style variables passes in tree = nullptr: evaluate the formula, return result as a double - atom-style and vector-style variables pass in tree = non-NULL: + atom-style and vector-style variables pass in tree = non-nullptr: parse the formula but do not evaluate it create a parse tree and return it ------------------------------------------------------------------------- */ @@ -1261,10 +1261,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) // evaluate contents and push on stack if (tree) { - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(contents,&newtree,ivar); treestack[ntreestack++] = newtree; - } else argstack[nargstack++] = evaluate(contents,NULL,ivar); + } else argstack[nargstack++] = evaluate(contents,nullptr,ivar); delete [] contents; @@ -1297,7 +1297,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(number); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->extra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(number); @@ -1389,7 +1389,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1418,7 +1418,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1450,7 +1450,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1459,7 +1459,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->vector_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1483,7 +1483,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_vector; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1491,7 +1491,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->array_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1515,7 +1515,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_array_rows; newtree->nstride = compute->size_array_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1533,7 +1533,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= INVOKED_PERATOM; } - peratom2global(1,NULL,compute->vector_atom,1,index1, + peratom2global(1,nullptr,compute->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // c_ID[i][j] = scalar from per-atom array @@ -1554,11 +1554,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } if (compute->array_atom) - peratom2global(1,NULL,&compute->array_atom[0][index2-1], + peratom2global(1,nullptr,&compute->array_atom[0][index2-1], compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1567,7 +1567,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->peratom_flag && compute->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1587,7 +1587,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = compute->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1596,7 +1596,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->peratom_flag && compute->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1619,10 +1619,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->array_atom) newtree->array = &compute->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = compute->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1686,7 +1686,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1708,7 +1708,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1733,7 +1733,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1745,7 +1745,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed at " "compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1767,7 +1767,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1778,7 +1778,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1800,7 +1800,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1814,7 +1814,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - peratom2global(1,NULL,fix->vector_atom,1,index1, + peratom2global(1,nullptr,fix->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // f_ID[i][j] = scalar from per-atom array @@ -1831,11 +1831,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) "at a compatible time",ivar); if (fix->array_atom) - peratom2global(1,NULL,&fix->array_atom[0][index2-1], + peratom2global(1,nullptr,&fix->array_atom[0][index2-1], fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1844,7 +1844,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && fix->peratom_flag && fix->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (update->whichflag > 0 && @@ -1857,7 +1857,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = fix->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1866,7 +1866,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && fix->peratom_flag && fix->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (index1 > fix->size_peratom_cols) @@ -1882,10 +1882,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (fix->array_atom) newtree->array = &fix->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = fix->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1929,7 +1929,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1941,14 +1941,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) style[ivar] != ATOMFILE && style[ivar] != VECTOR) { char *var = retrieve(word+2); - if (var == NULL) + if (var == nullptr) print_var_error(FLERR,"Invalid variable evaluation in " "variable formula",ivar); if (tree) { Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(var); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(var); @@ -1958,14 +1958,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOM) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atom-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) print_var_error(FLERR,"Atom-style variable in " "vector-style variable formula",ivar); - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(data[ivar][0],&newtree,ivar); treestack[ntreestack++] = newtree; @@ -1973,7 +1973,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1985,7 +1985,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = reader[ivar]->fixstore->vstore; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1994,7 +1994,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == VECTOR) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Vector-style variable in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -2010,7 +2010,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -2023,7 +2023,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) double *result; memory->create(result,atom->nlocal,"variable:result"); compute_atom(ivar,0,result,1,0); - peratom2global(1,NULL,result,1,index, + peratom2global(1,nullptr,result,1,index, tree,treestack,ntreestack,argstack,nargstack); memory->destroy(result); @@ -2031,7 +2031,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket && style[ivar] == ATOMFILE) { - peratom2global(1,NULL,reader[ivar]->fixstore->vstore,1,index, + peratom2global(1,nullptr,reader[ivar]->fixstore->vstore,1,index, tree,treestack,ntreestack,argstack,nargstack); // v_name[N] = scalar from vector-style variable @@ -2050,7 +2050,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = vec[m-1]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = vec[m-1]; @@ -2098,7 +2098,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) tagint id = int_between_brackets(ptr,1); i = ptr-str+1; - peratom2global(0,word,NULL,0,id, + peratom2global(0,word,nullptr,0,id, tree,treestack,ntreestack,argstack,nargstack); // ---------------- @@ -2122,7 +2122,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2144,7 +2144,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2224,7 +2224,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->type = opprevious; if ((opprevious == UNARY) || (opprevious == NOT)) { newtree->first = treestack[--ntreestack]; - newtree->second = NULL; + newtree->second = nullptr; newtree->nextra = 0; } else { newtree->second = treestack[--ntreestack]; @@ -2627,7 +2627,7 @@ double Variable::collapse_tree(Tree *tree) if (tree->type == RANDOM) { collapse_tree(tree->first); collapse_tree(tree->second); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -2641,7 +2641,7 @@ double Variable::collapse_tree(Tree *tree) double sigma = collapse_tree(tree->second); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3021,7 +3021,7 @@ double Variable::eval_tree(Tree *tree, int i) if (tree->type == RANDOM) { double lower = eval_tree(tree->first,i); double upper = eval_tree(tree->second,i); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3034,7 +3034,7 @@ double Variable::eval_tree(Tree *tree, int i) double sigma = eval_tree(tree->second,i); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3344,7 +3344,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) error->all(FLERR,"Invalid variable name in variable formula"); char *var = retrieve(id); - if (var == NULL) + if (var == nullptr) error->all(FLERR,"Invalid variable evaluation in variable formula"); index = static_cast (atof(var)); @@ -3399,15 +3399,15 @@ int Variable::math_function(char *word, char *contents, Tree **tree, char *args[MAXFUNCARG]; int narg = parse_args(contents,args); - Tree *newtree = NULL; + Tree *newtree = nullptr; double value1,value2; double values[MAXFUNCARG-2]; if (tree) { newtree = new Tree(); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; - Tree *argtree = NULL; + Tree *argtree = nullptr; evaluate(args[0],&argtree,ivar); newtree->first = argtree; if (narg > 1) { @@ -3425,12 +3425,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, treestack[ntreestack++] = newtree; } else { - value1 = evaluate(args[0],NULL,ivar); + value1 = evaluate(args[0],nullptr,ivar); if (narg > 1) { - value2 = evaluate(args[1],NULL,ivar); + value2 = evaluate(args[1],nullptr,ivar); if (narg > 2) { for (int i = 2; i < narg; i++) - values[i-2] = evaluate(args[i],NULL,ivar); + values[i-2] = evaluate(args[i],nullptr,ivar); } } } @@ -3530,7 +3530,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = RANDOM; else { - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -3545,7 +3545,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, else { if (value2 < 0.0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -4029,7 +4029,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4107,8 +4107,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (narg != 1) print_var_error(FLERR,"Invalid special function in variable formula",ivar); - Compute *compute = NULL; - Fix *fix = NULL; + Compute *compute = nullptr; + Fix *fix = nullptr; int ivar = -1; int index,nvec,nstride; char *ptr1,*ptr2; @@ -4239,7 +4239,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, double *vec; if (index) { if (compute->array) vec = &compute->array[0][index-1]; - else vec = NULL; + else vec = nullptr; } else vec = compute->vector; int j = 0; @@ -4320,7 +4320,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4328,7 +4328,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // mask special functions } else if (strcmp(word,"gmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Gmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4341,12 +4341,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = GMASK; newtree->ivalue1 = group->bitmask[igroup]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"rmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Rmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4358,12 +4358,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = RMASK; newtree->ivalue1 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"grmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Grmask function in equal-style " "variable formula",ivar); if (narg != 2) @@ -4379,7 +4379,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->type = GRMASK; newtree->ivalue1 = group->bitmask[igroup]; newtree->ivalue2 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4409,7 +4409,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4419,7 +4419,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // set selfalloc = 1 so result will be deleted by free_tree() after eval } else if (style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile variable in " "equal-style variable formula",ivar); @@ -4435,7 +4435,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->array = result; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4456,7 +4456,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4475,7 +4475,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4494,7 +4494,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4579,7 +4579,7 @@ void Variable::peratom2global(int flag, char *word, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4622,14 +4622,14 @@ int Variable::is_atom_vector(char *word) void Variable::atom_vector(char *word, Tree **tree, Tree **treestack, int &ntreestack) { - if (tree == NULL) + if (tree == nullptr) error->all(FLERR,"Atom vector in equal-style variable formula"); Tree *newtree = new Tree(); newtree->type = ATOMARRAY; newtree->nstride = 3; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4756,7 +4756,7 @@ int Variable::parse_args(char *str, char **args) /* ---------------------------------------------------------------------- find next comma in str skip commas inside one or more nested parenthesis - only return ptr to comma at level 0, else NULL if not found + only return ptr to comma at level 0, else nullptr if not found ------------------------------------------------------------------------- */ char *Variable::find_next_comma(char *str) @@ -4767,7 +4767,7 @@ char *Variable::find_next_comma(char *str) else if (')' == *p) level--; else if (',' == *p && !level) return p; } - return NULL; + return nullptr; } @@ -5069,11 +5069,11 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : { me = comm->me; style = flag; - fp = NULL; + fp = nullptr; if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file variable file {}: {}", file, utils::getsyserror())); } @@ -5082,9 +5082,9 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : // allocate a new fix STORE, so they persist // id = variable-ID + VARIABLE_STORE, fix group = all - fixstore = NULL; - id_fix = NULL; - buffer = NULL; + fixstore = nullptr; + id_fix = nullptr; + buffer = nullptr; if (style == ATOMFILE) { if (atom->map_style == 0) @@ -5109,7 +5109,7 @@ VarReader::~VarReader() { if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // check modify in case all fixes have already been deleted @@ -5137,12 +5137,12 @@ int VarReader::read_scalar(char *str) if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } @@ -5180,12 +5180,12 @@ int VarReader::read_peratom() char str[MAXLINE]; if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } diff --git a/src/variable.h b/src/variable.h index efffacc7b..58548bc27 100644 --- a/src/variable.h +++ b/src/variable.h @@ -93,9 +93,9 @@ class Variable : protected Pointers { Tree **extra; // ptrs further down tree for nextra args Tree() : - array(NULL), iarray(NULL), barray(NULL), + array(nullptr), iarray(nullptr), barray(nullptr), selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), - first(NULL), second(NULL), extra(NULL) {} + first(nullptr), second(nullptr), extra(nullptr) {} }; int compute_python(int); diff --git a/src/velocity.cpp b/src/velocity.cpp index eafa98cb7..db396fb7e 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -82,7 +82,7 @@ void Velocity::command(int narg, char **arg) // set defaults - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -147,7 +147,7 @@ void Velocity::init_external(const char *extgroup) if (igroup == -1) error->all(FLERR,"Could not find velocity group ID"); groupbit = group->bitmask[igroup]; - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -179,18 +179,18 @@ void Velocity::create(double t_desired, int seed) } } - // if temperature = NULL or bias_flag set, + // if temperature = nullptr or bias_flag set, // create a new ComputeTemp with the velocity group int tcreate_flag = 0; - Compute *temperature_nobias = NULL; + Compute *temperature_nobias = nullptr; - if (temperature == NULL || bias_flag) { + if (temperature == nullptr || bias_flag) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; arg[2] = (char *) "temp"; - if (temperature == NULL) { + if (temperature == nullptr) { temperature = new ComputeTemp(lmp,3,arg); tcreate_flag = 1; } else temperature_nobias = new ComputeTemp(lmp,3,arg); @@ -245,7 +245,7 @@ void Velocity::create(double t_desired, int seed) int m; double vx,vy,vz,factor; - RanPark *random = NULL; + RanPark *random = nullptr; if (loop_flag == ALL) { @@ -368,7 +368,7 @@ void Velocity::create(double t_desired, int seed) // no-bias compute calculates temp only for new thermal velocities double t; - if ((bias_flag == 0) || (temperature_nobias == NULL)) + if ((bias_flag == 0) || (temperature_nobias == nullptr)) t = temperature->compute_scalar(); else t = temperature_nobias->compute_scalar(); rescale(t,t_desired); @@ -417,7 +417,7 @@ void Velocity::set(int /*narg*/, char **arg) // parse 3 args xstyle = ystyle = zstyle = CONSTANT; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; @@ -501,7 +501,7 @@ void Velocity::set(int /*narg*/, char **arg) // allocate vfield array if necessary - double **vfield = NULL; + double **vfield = nullptr; if (varflag == ATOM) memory->create(vfield,atom->nlocal,3,"velocity:vfield"); // set velocities via constants @@ -531,17 +531,17 @@ void Velocity::set(int /*narg*/, char **arg) if (xstyle == EQUAL) vx = input->variable->compute_equal(xvar); else if (xstyle == ATOM) { if (vfield) input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0); - else input->variable->compute_atom(xvar,igroup,NULL,3,0); + else input->variable->compute_atom(xvar,igroup,nullptr,3,0); } if (ystyle == EQUAL) vy = input->variable->compute_equal(yvar); else if (ystyle == ATOM) { if (vfield) input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0); - else input->variable->compute_atom(yvar,igroup,NULL,3,0); + else input->variable->compute_atom(yvar,igroup,nullptr,3,0); } if (zstyle == EQUAL) vz = input->variable->compute_equal(zvar); else if (zstyle == ATOM) { if (vfield) input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0); - else input->variable->compute_atom(zvar,igroup,NULL,3,0); + else input->variable->compute_atom(zvar,igroup,nullptr,3,0); } for (int i = 0; i < nlocal; i++) @@ -580,10 +580,10 @@ void Velocity::scale(int /*narg*/, char **arg) { double t_desired = utils::numeric(FLERR,arg[0],false,lmp); - // if temperature = NULL, create a new ComputeTemp with the velocity group + // if temperature = nullptr, create a new ComputeTemp with the velocity group int tflag = 0; - if (temperature == NULL) { + if (temperature == nullptr) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; @@ -901,7 +901,7 @@ void Velocity::options(int narg, char **arg) // error check - if (bias_flag && temperature == NULL) + if (bias_flag && temperature == nullptr) error->all(FLERR,"Cannot use velocity bias command without temp keyword"); if (bias_flag && temperature->tempbias == 0) error->all(FLERR,"Velocity temperature ID does calculate a velocity bias"); diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 121a2ed1f..3e247f19c 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -56,7 +56,7 @@ void WriteCoeff::command(int narg, char **arg) char str[256], coeff[256]; FILE *one = fopen(file,"wb+"); - if (one == NULL) + if (one == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file, utils::getsyserror())); @@ -90,7 +90,7 @@ void WriteCoeff::command(int narg, char **arg) rewind(one); FILE *two = fopen(file+4,"w"); - if (two == NULL) + if (two == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file+4, utils::getsyserror())); @@ -99,15 +99,15 @@ void WriteCoeff::command(int narg, char **arg) while(1) { int coeff_mode = REGULAR_MODE; - if (fgets(str,256,one) == NULL) break; + if (fgets(str,256,one) == nullptr) break; // some coeffs need special treatment - if (strstr(str,"class2") != NULL) { - if (strstr(str,"angle_style") != NULL) + if (strstr(str,"class2") != nullptr) { + if (strstr(str,"angle_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"dihedral_style") != NULL) + else if (strstr(str,"dihedral_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"improper_style") != NULL) + else if (strstr(str,"improper_style") != nullptr) coeff_mode = CLASS2_MODE; } diff --git a/src/write_data.cpp b/src/write_data.cpp index 53d277b72..6f22547b8 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -153,21 +153,21 @@ void WriteData::write(const std::string &file) // may be different than atom->nbonds,nangles, etc. if broken/turned-off if (atom->molecular == 1 && (atom->nbonds || atom->nbondtypes)) { - nbonds_local = atom->avec->pack_bond(NULL); + nbonds_local = atom->avec->pack_bond(nullptr); MPI_Allreduce(&nbonds_local,&nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->nangles || atom->nangletypes)) { - nangles_local = atom->avec->pack_angle(NULL); + nangles_local = atom->avec->pack_angle(nullptr); MPI_Allreduce(&nangles_local,&nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->ndihedrals || atom->ndihedraltypes)) { - ndihedrals_local = atom->avec->pack_dihedral(NULL); + ndihedrals_local = atom->avec->pack_dihedral(nullptr); MPI_Allreduce(&ndihedrals_local,&ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->nimpropers || atom->nimpropertypes)) { - nimpropers_local = atom->avec->pack_improper(NULL); + nimpropers_local = atom->avec->pack_improper(nullptr); MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); } @@ -175,7 +175,7 @@ void WriteData::write(const std::string &file) if (me == 0) { fp = fopen(file.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open data file {}: {}", file, utils::getsyserror())); } @@ -665,7 +665,7 @@ void WriteData::bonus(int flag) // communication buffer for all my Bonus info // maxvalues = largest buffer needed by any proc - int nvalues = atom->avec->pack_data_bonus(NULL,flag); + int nvalues = atom->avec->pack_data_bonus(nullptr,flag); int maxvalues; MPI_Allreduce(&nvalues,&maxvalues,1,MPI_INT,MPI_MAX,world); diff --git a/src/write_dump.cpp b/src/write_dump.cpp index 56839a2f5..fd359ec2b 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -45,7 +45,7 @@ void WriteDump::command(int narg, char **arg) // create the Dump instance // create dump command line with extra required args - Dump *dump = NULL; + Dump *dump = nullptr; char **dumpargs = new char*[modindex+2]; dumpargs[0] = (char *) "WRITE_DUMP"; // dump id diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 256d7a377..01ad917e8 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -49,7 +49,7 @@ WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); multiproc = 0; noinit = 0; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -231,7 +231,7 @@ void WriteRestart::write(std::string file) if (multiproc) base.replace(base.find("%"),1,"base"); fp = fopen(base.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", base, utils::getsyserror())); } @@ -286,7 +286,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } std::string multiname = file; @@ -294,7 +294,7 @@ void WriteRestart::write(std::string file) if (filewriter) { fp = fopen(multiname.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", multiname, utils::getsyserror())); write_int(PROCSPERFILE,nclusterprocs); @@ -363,7 +363,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } mpiio->openForWrite(file.c_str()); mpiio->write(headerOffset,send_size,buf); @@ -393,7 +393,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } else { MPI_Recv(&tmp,0,MPI_INT,fileproc,0,world,MPI_STATUS_IGNORE); @@ -661,7 +661,7 @@ void WriteRestart::write_double(int flag, double value) } /* ---------------------------------------------------------------------- - write a flag and a char string (including NULL) into restart file + write a flag and a char string (including nullptr) into restart file ------------------------------------------------------------------------- */ void WriteRestart::write_string(int flag, const char *value) -- GitLab From 13be8085e5948669cd8c250c846744028bfa4bc2 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 08:53:44 -0600 Subject: [PATCH 15/52] T2345: Replace instances of NULL with nullptr Per guidance from Axel, revert lib/kokkos and lib/colvars to remove nullptr changes. --- lib/colvars/colvar.cpp | 20 +++---- lib/colvars/colvaratoms.cpp | 8 +-- lib/colvars/colvarbias.cpp | 26 ++++---- lib/colvars/colvarbias.h | 4 +- lib/colvars/colvarbias_abf.cpp | 42 ++++++------- lib/colvars/colvarbias_histogram.cpp | 4 +- lib/colvars/colvarbias_meta.cpp | 46 +++++++------- lib/colvars/colvarcomp.cpp | 8 +-- lib/colvars/colvarcomp_coordnums.cpp | 38 ++++++------ lib/colvars/colvarcomp_distances.cpp | 2 +- lib/colvars/colvardeps.cpp | 2 +- lib/colvars/colvargrid.cpp | 14 ++--- lib/colvars/colvarmodule.cpp | 60 +++++++++---------- lib/colvars/colvarmodule.h | 6 +- lib/colvars/colvarparams.cpp | 6 +- lib/colvars/colvarparse.cpp | 10 ++-- lib/colvars/colvarparse.h | 8 +-- lib/colvars/colvarproxy.cpp | 16 ++--- lib/colvars/colvarproxy.h | 2 +- lib/colvars/colvarscript.cpp | 20 +++---- lib/colvars/colvarscript.h | 2 +- lib/colvars/colvartypes.h | 4 +- lib/colvars/lepton/include/lepton/Operation.h | 12 ++-- lib/colvars/lepton/src/CompiledExpression.cpp | 8 +-- lib/colvars/lepton/src/ExpressionTreeNode.cpp | 8 +-- lib/colvars/lepton/src/ParsedExpression.cpp | 2 +- lib/kokkos/cmake/compile_tests/pthread.cpp | 6 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp | 2 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 2 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 2 +- lib/kokkos/core/unit_test/TestCTestDevice.cpp | 2 +- 31 files changed, 196 insertions(+), 196 deletions(-) diff --git a/lib/colvars/colvar.cpp b/lib/colvars/colvar.cpp index 61e83f44a..1002dc35d 100644 --- a/lib/colvars/colvar.cpp +++ b/lib/colvars/colvar.cpp @@ -22,7 +22,7 @@ colvar::colvar() { - runave_os = nullptr; + runave_os = NULL; prev_timestep = -1L; after_restart = false; @@ -62,7 +62,7 @@ int colvar::init(std::string const &conf) get_keyval(conf, "name", this->name, (std::string("colvar")+cvm::to_str(cv->variables()->size()))); - if ((cvm::colvar_by_name(this->name) != nullptr) && + if ((cvm::colvar_by_name(this->name) != NULL) && (cvm::colvar_by_name(this->name) != this)) { cvm::error("Error: this colvar cannot have the same name, \""+this->name+ "\", as another colvar.\n", @@ -744,7 +744,7 @@ template int colvar::init_components_type(std::string c : ".\n")); cvm::increase_depth(); cvc *cvcp = new def_class_name(def_conf); - if (cvcp != nullptr) { + if (cvcp != NULL) { cvcs.push_back(cvcp); cvcp->check_keywords(def_conf, def_config_key); cvcp->config_key = def_config_key; @@ -994,7 +994,7 @@ int colvar::parse_analysis(std::string const &conf) acf_type = acf_vel; enable(f_cv_fdiff_velocity); colvar *cv2 = cvm::colvar_by_name(acf_colvar_name); - if (cv2 == nullptr) { + if (cv2 == NULL) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -1215,14 +1215,14 @@ colvar::~colvar() for (std::vector::iterator cei = value_evaluators.begin(); cei != value_evaluators.end(); ++cei) { - if (*cei != nullptr) delete (*cei); + if (*cei != NULL) delete (*cei); } value_evaluators.clear(); for (std::vector::iterator gei = gradient_evaluators.begin(); gei != gradient_evaluators.end(); ++gei) { - if (*gei != nullptr) delete (*gei); + if (*gei != NULL) delete (*gei); } gradient_evaluators.clear(); #endif @@ -1972,7 +1972,7 @@ void const *colvar::get_cvc_param_ptr(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return nullptr; + return NULL; } @@ -1983,7 +1983,7 @@ colvarvalue const *colvar::get_cvc_param_grad(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param_grad() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return nullptr; + return NULL; } @@ -2422,7 +2422,7 @@ int colvar::calc_acf() // the pointer to each vector is changed at every step colvar const *cfcv = cvm::colvar_by_name(acf_colvar_name); - if (cfcv == nullptr) { + if (cfcv == NULL) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -2660,7 +2660,7 @@ int colvar::calc_runave() if ((*x_history_p).size() >= runave_length-1) { - if (runave_os == nullptr) { + if (runave_os == NULL) { if (runave_outfile.size() == 0) { runave_outfile = std::string(cvm::output_prefix()+"."+ this->name+".runave.traj"); diff --git a/lib/colvars/colvaratoms.cpp b/lib/colvars/colvaratoms.cpp index 2796f3d28..180fc69a8 100644 --- a/lib/colvars/colvaratoms.cpp +++ b/lib/colvars/colvaratoms.cpp @@ -105,7 +105,7 @@ cvm::atom_group::~atom_group() if (fitting_group) { delete fitting_group; - fitting_group = nullptr; + fitting_group = NULL; } cvm::main()->unregister_named_atom_group(this); @@ -217,7 +217,7 @@ int cvm::atom_group::init() b_center = false; b_rotate = false; b_user_defined_fit = false; - fitting_group = nullptr; + fitting_group = NULL; noforce = false; @@ -368,7 +368,7 @@ int cvm::atom_group::parse(std::string const &group_conf) // Optional group name will let other groups reuse atom definition if (get_keyval(group_conf, "name", name)) { - if ((cvm::atom_group_by_name(this->name) != nullptr) && + if ((cvm::atom_group_by_name(this->name) != NULL) && (cvm::atom_group_by_name(this->name) != this)) { cvm::error("Error: this atom group cannot have the same name, \""+this->name+ "\", as another atom group.\n", @@ -395,7 +395,7 @@ int cvm::atom_group::parse(std::string const &group_conf) std::string atoms_of = ""; if (get_keyval(group_conf, "atomsOfGroup", atoms_of)) { atom_group * ag = atom_group_by_name(atoms_of); - if (ag == nullptr) { + if (ag == NULL) { cvm::error("Error: cannot find atom group with name " + atoms_of + ".\n"); return COLVARS_ERROR; } diff --git a/lib/colvars/colvarbias.cpp b/lib/colvars/colvarbias.cpp index cdbc13699..09bcca01b 100644 --- a/lib/colvars/colvarbias.cpp +++ b/lib/colvars/colvarbias.cpp @@ -47,7 +47,7 @@ int colvarbias::init(std::string const &conf) { colvarbias *bias_with_name = cvm::bias_by_name(this->name); - if (bias_with_name != nullptr) { + if (bias_with_name != NULL) { if ((bias_with_name->rank != this->rank) || (bias_with_name->bias_type != this->bias_type)) { cvm::error("Error: this bias cannot have the same name, \""+this->name+ @@ -295,8 +295,8 @@ int colvarbias::update() colvar_values[i] = colvars[i]->value(); } - error_code |= calc_energy(nullptr); - error_code |= calc_forces(nullptr); + error_code |= calc_energy(NULL); + error_code |= calc_forces(NULL); return error_code; } @@ -547,8 +547,8 @@ colvarbias_ti::colvarbias_ti(char const *key) : colvarbias(key) { provide(f_cvb_calc_ti_samples); - ti_avg_forces = nullptr; - ti_count = nullptr; + ti_avg_forces = NULL; + ti_count = NULL; } @@ -560,13 +560,13 @@ colvarbias_ti::~colvarbias_ti() int colvarbias_ti::clear_state_data() { - if (ti_avg_forces != nullptr) { + if (ti_avg_forces != NULL) { delete ti_avg_forces; - ti_avg_forces = nullptr; + ti_avg_forces = NULL; } - if (ti_count != nullptr) { + if (ti_count != NULL) { delete ti_count; - ti_count = nullptr; + ti_count = NULL; } return COLVARS_OK; } @@ -622,7 +622,7 @@ int colvarbias_ti::init(std::string const &conf) int colvarbias_ti::init_grids() { if (is_enabled(f_cvb_calc_ti_samples)) { - if (ti_avg_forces == nullptr) { + if (ti_avg_forces == NULL) { ti_bin.resize(num_variables()); ti_system_forces.resize(num_variables()); for (size_t icv = 0; icv < num_variables(); icv++) { @@ -643,7 +643,7 @@ int colvarbias_ti::init_grids() int colvarbias_ti::update() { - return update_system_forces(nullptr); + return update_system_forces(NULL); } @@ -679,7 +679,7 @@ int colvarbias_ti::update_system_forces(std::vector const ti_system_forces[i] = variables(i)->total_force(); } else { ti_system_forces[i] = variables(i)->total_force() - - ((subtract_forces != nullptr) ? + ((subtract_forces != NULL) ? (*subtract_forces)[i] : previous_colvar_forces[i]); } } @@ -759,7 +759,7 @@ int colvarbias_ti::write_output_files() std::string const ti_output_prefix = cvm::output_prefix()+"."+this->name; - std::ostream *os = nullptr; + std::ostream *os = NULL; if (is_enabled(f_cvb_write_ti_samples)) { std::string const ti_count_file_name(ti_output_prefix+".ti.count"); diff --git a/lib/colvars/colvarbias.h b/lib/colvars/colvarbias.h index 20c346f81..5179c4285 100644 --- a/lib/colvars/colvarbias.h +++ b/lib/colvars/colvarbias.h @@ -58,12 +58,12 @@ public: virtual int update(); /// Compute the energy of the bias - /// Uses the vector of colvar values provided if not nullptr, and the values + /// Uses the vector of colvar values provided if not NULL, and the values /// currently cached in the bias instance otherwise virtual int calc_energy(std::vector const *values); /// Compute the forces due to the bias - /// Uses the vector of colvar values provided if not nullptr, and the values + /// Uses the vector of colvar values provided if not NULL, and the values /// currently cached in the bias instance otherwise virtual int calc_forces(std::vector const *values); diff --git a/lib/colvars/colvarbias_abf.cpp b/lib/colvars/colvarbias_abf.cpp index 9926579a8..5382a828f 100644 --- a/lib/colvars/colvarbias_abf.cpp +++ b/lib/colvars/colvarbias_abf.cpp @@ -18,16 +18,16 @@ colvarbias_abf::colvarbias_abf(char const *key) b_UI_estimator(false), b_CZAR_estimator(false), pabf_freq(0), - system_force(nullptr), - gradients(nullptr), - samples(nullptr), - pmf(nullptr), - z_gradients(nullptr), - z_samples(nullptr), - czar_gradients(nullptr), - czar_pmf(nullptr), - last_gradients(nullptr), - last_samples(nullptr) + system_force(NULL), + gradients(NULL), + samples(NULL), + pmf(NULL), + z_gradients(NULL), + z_samples(NULL), + czar_gradients(NULL), + czar_pmf(NULL), + last_gradients(NULL), + last_samples(NULL) { } @@ -261,37 +261,37 @@ colvarbias_abf::~colvarbias_abf() { if (samples) { delete samples; - samples = nullptr; + samples = NULL; } if (gradients) { delete gradients; - gradients = nullptr; + gradients = NULL; } if (pmf) { delete pmf; - pmf = nullptr; + pmf = NULL; } if (z_samples) { delete z_samples; - z_samples = nullptr; + z_samples = NULL; } if (z_gradients) { delete z_gradients; - z_gradients = nullptr; + z_gradients = NULL; } if (czar_gradients) { delete czar_gradients; - czar_gradients = nullptr; + czar_gradients = NULL; } if (czar_pmf) { delete czar_pmf; - czar_pmf = nullptr; + czar_pmf = NULL; } // shared ABF @@ -299,17 +299,17 @@ colvarbias_abf::~colvarbias_abf() // but now we can call shared externally if (last_samples) { delete last_samples; - last_samples = nullptr; + last_samples = NULL; } if (last_gradients) { delete last_gradients; - last_gradients = nullptr; + last_gradients = NULL; } if (system_force) { delete [] system_force; - system_force = nullptr; + system_force = NULL; } } @@ -488,7 +488,7 @@ int colvarbias_abf::update() } /// Add the bias energy for 1D ABF - bias_energy = calc_energy(nullptr); + bias_energy = calc_energy(NULL); return COLVARS_OK; } diff --git a/lib/colvars/colvarbias_histogram.cpp b/lib/colvars/colvarbias_histogram.cpp index 44862ba25..92985b0f6 100644 --- a/lib/colvars/colvarbias_histogram.cpp +++ b/lib/colvars/colvarbias_histogram.cpp @@ -15,7 +15,7 @@ colvarbias_histogram::colvarbias_histogram(char const *key) : colvarbias(key), - grid(nullptr), out_name("") + grid(NULL), out_name("") { provide(f_cvb_bypass_ext_lagrangian); // Allow histograms of actual cv for extended-Lagrangian } @@ -105,7 +105,7 @@ colvarbias_histogram::~colvarbias_histogram() { if (grid) { delete grid; - grid = nullptr; + grid = NULL; } } diff --git a/lib/colvars/colvarbias_meta.cpp b/lib/colvars/colvarbias_meta.cpp index 03c1886a8..05f293d87 100644 --- a/lib/colvars/colvarbias_meta.cpp +++ b/lib/colvars/colvarbias_meta.cpp @@ -36,7 +36,7 @@ colvarbias_meta::colvarbias_meta(char const *key) : colvarbias(key), colvarbias_ti(key) { new_hills_begin = hills.end(); - hills_traj_os = nullptr; + hills_traj_os = NULL; hill_width = 0.0; @@ -45,8 +45,8 @@ colvarbias_meta::colvarbias_meta(char const *key) use_grids = true; grids_freq = 0; rebin_grids = false; - hills_energy = nullptr; - hills_energy_gradients = nullptr; + hills_energy = NULL; + hills_energy_gradients = NULL; dump_fes = true; keep_hills = false; @@ -153,7 +153,7 @@ int colvarbias_meta::init(std::string const &conf) get_keyval(conf, "keepHills", keep_hills, keep_hills); get_keyval(conf, "keepFreeEnergyFiles", dump_fes_save, dump_fes_save); - if (hills_energy == nullptr) { + if (hills_energy == NULL) { hills_energy = new colvar_grid_scalar(colvars); hills_energy_gradients = new colvar_grid_gradient(colvars); } @@ -262,7 +262,7 @@ int colvarbias_meta::init_well_tempered_params(std::string const &conf) int colvarbias_meta::init_ebmeta_params(std::string const &conf) { // for ebmeta - target_dist = nullptr; + target_dist = NULL; get_keyval(conf, "ebMeta", ebmeta, false); if(ebmeta){ if (use_grids && expand_grids) { @@ -328,12 +328,12 @@ colvarbias_meta::~colvarbias_meta() if (hills_traj_os) { proxy->close_output_stream(hills_traj_file_name()); - hills_traj_os = nullptr; + hills_traj_os = NULL; } if (target_dist) { delete target_dist; - target_dist = nullptr; + target_dist = NULL; } } @@ -342,12 +342,12 @@ int colvarbias_meta::clear_state_data() { if (hills_energy) { delete hills_energy; - hills_energy = nullptr; + hills_energy = NULL; } if (hills_energy_gradients) { delete hills_energy_gradients; - hills_energy_gradients = nullptr; + hills_energy_gradients = NULL; } hills.clear(); @@ -451,8 +451,8 @@ int colvarbias_meta::update() error_code |= replica_share(); } - error_code |= calc_energy(nullptr); - error_code |= calc_forces(nullptr); + error_code |= calc_energy(NULL); + error_code |= calc_forces(NULL); return error_code; } @@ -593,7 +593,7 @@ int colvarbias_meta::update_bias() std::vector curr_bin = hills_energy->get_colvars_index(); hills_energy_sum_here = hills_energy->value(curr_bin); } else { - calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, nullptr); + calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, NULL); } hills_scale *= cvm::exp(-1.0*hills_energy_sum_here/(bias_temperature*cvm::boltzmann())); } @@ -887,14 +887,14 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, std::vector colvar_forces_scalar(num_variables()); std::vector he_ix = he->new_index(); - std::vector hg_ix = (hg != nullptr) ? hg->new_index() : std::vector (0); + std::vector hg_ix = (hg != NULL) ? hg->new_index() : std::vector (0); cvm::real hills_energy_here = 0.0; std::vector hills_forces_here(num_variables(), 0.0); size_t count = 0; size_t const print_frequency = ((hills.size() >= 1000000) ? 1 : (1000000/(hills.size()+1))); - if (hg != nullptr) { + if (hg != NULL) { // loop over the points of the grid for ( ; @@ -1310,8 +1310,8 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) hills_energy_gradients = new colvar_grid_gradient(colvars); } - colvar_grid_scalar *hills_energy_backup = nullptr; - colvar_grid_gradient *hills_energy_gradients_backup = nullptr; + colvar_grid_scalar *hills_energy_backup = NULL; + colvar_grid_gradient *hills_energy_gradients_backup = NULL; if (has_data) { if (cvm::debug()) @@ -1327,7 +1327,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_pos = is.tellg(); std::string key; if (!(is >> key)) { - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1343,7 +1343,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == nullptr) + if (hills_energy_backup == NULL) cvm::fatal_error("Error: couldn't read the free energy grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1365,7 +1365,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_gradients_pos = is.tellg(); if (!(is >> key)) { - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1381,7 +1381,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_gradients_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == nullptr) + if (hills_energy_backup == NULL) cvm::fatal_error("Error: couldn't read the free energy gradients grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1406,7 +1406,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+"\n"); - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { // now that we have successfully updated the grids, delete the // backup copies if (cvm::debug()) @@ -1594,7 +1594,7 @@ int colvarbias_meta::setup_output() // TODO: one may want to specify the path manually for intricated filesystems? char *pwd = new char[3001]; - if (GETCWD(pwd, 3000) == nullptr) + if (GETCWD(pwd, 3000) == NULL) cvm::fatal_error("Error: cannot get the path of the current working directory.\n"); replica_list_file = (std::string(pwd)+std::string(PATHSEP)+ @@ -1885,7 +1885,7 @@ int colvarbias_meta::reopen_replica_buffer_file() { int error_code = COLVARS_OK; colvarproxy *proxy = cvm::proxy; - if (proxy->get_output_stream(replica_hills_file) != nullptr) { + if (proxy->get_output_stream(replica_hills_file) != NULL) { error_code |= proxy->close_output_stream(replica_hills_file); } error_code |= proxy->remove_file(replica_hills_file); diff --git a/lib/colvars/colvarcomp.cpp b/lib/colvars/colvarcomp.cpp index d45d85111..05d1195d5 100644 --- a/lib/colvars/colvarcomp.cpp +++ b/lib/colvars/colvarcomp.cpp @@ -135,7 +135,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf, char const *group_key, bool optional) { - cvm::atom_group *group = nullptr; + cvm::atom_group *group = NULL; std::string group_conf; if (key_lookup(conf, group_key, &group_conf)) { @@ -298,7 +298,7 @@ colvar::cvc::~cvc() free_children_deps(); remove_all_children(); for (size_t i = 0; i < atom_groups.size(); i++) { - if (atom_groups[i] != nullptr) delete atom_groups[i]; + if (atom_groups[i] != NULL) delete atom_groups[i]; } } @@ -344,7 +344,7 @@ colvarvalue const *colvar::cvc::get_param_grad(std::string const ¶m_name) { colvarvalue const *ptr = reinterpret_cast(get_param_grad_ptr(param_name)); - return ptr != nullptr ? ptr : nullptr; + return ptr != NULL ? ptr : NULL; } @@ -553,7 +553,7 @@ void colvar::cvc::debug_gradients() } } - if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != nullptr)) { + if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != NULL)) { cvm::atom_group *ref_group = group->fitting_group; group->read_positions(); group->calc_required_properties(); diff --git a/lib/colvars/colvarcomp_coordnums.cpp b/lib/colvars/colvarcomp_coordnums.cpp index f36d05552..f0fbabfc4 100644 --- a/lib/colvars/colvarcomp_coordnums.cpp +++ b/lib/colvars/colvarcomp_coordnums.cpp @@ -91,7 +91,7 @@ cvm::real colvar::coordnum::switching_function(cvm::real const &r0, colvar::coordnum::coordnum(std::string const &conf) - : cvc(conf), b_anisotropic(false), pairlist(nullptr) + : cvc(conf), b_anisotropic(false), pairlist(NULL) { function_type = "coordnum"; @@ -102,7 +102,7 @@ colvar::coordnum::coordnum(std::string const &conf) group1 = parse_group(conf, "group1"); group2 = parse_group(conf, "group2"); - if (group1 == nullptr || group2 == nullptr) { + if (group1 == NULL || group2 == NULL) { cvm::error("Error: failed to initialize atom groups.\n", INPUT_ERROR); return; @@ -183,7 +183,7 @@ colvar::coordnum::coordnum(std::string const &conf) colvar::coordnum::~coordnum() { - if (pairlist != nullptr) { + if (pairlist != NULL) { delete [] pairlist; } } @@ -218,11 +218,11 @@ template void colvar::coordnum::main_loop(bool **pairlist_elem) template int colvar::coordnum::compute_coordnum() { - bool const use_pairlist = (pairlist != nullptr); - bool const rebuild_pairlist = (pairlist != nullptr) && + bool const use_pairlist = (pairlist != NULL); + bool const rebuild_pairlist = (pairlist != NULL) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : nullptr; + bool *pairlist_elem = use_pairlist ? pairlist : NULL; if (b_anisotropic) { @@ -239,7 +239,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags | ef_anisotropic; - main_loop(nullptr); + main_loop(NULL); } } else { @@ -257,7 +257,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags; - main_loop(nullptr); + main_loop(NULL); } } @@ -367,7 +367,7 @@ void colvar::h_bond::calc_value() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - nullptr, 0.0); + NULL, 0.0); } @@ -378,7 +378,7 @@ void colvar::h_bond::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - nullptr, 0.0); + NULL, 0.0); } @@ -393,7 +393,7 @@ simple_scalar_dist_functions(h_bond) colvar::selfcoordnum::selfcoordnum(std::string const &conf) - : cvc(conf), pairlist(nullptr) + : cvc(conf), pairlist(NULL) { function_type = "selfcoordnum"; x.type(colvarvalue::type_scalar); @@ -438,7 +438,7 @@ colvar::selfcoordnum::selfcoordnum(std::string const &conf) colvar::selfcoordnum::~selfcoordnum() { - if (pairlist != nullptr) { + if (pairlist != NULL) { delete [] pairlist; } } @@ -448,11 +448,11 @@ template int colvar::selfcoordnum::compute_selfcoordnum() { cvm::rvector const r0_vec(0.0); // TODO enable the flag? - bool const use_pairlist = (pairlist != nullptr); - bool const rebuild_pairlist = (pairlist != nullptr) && + bool const use_pairlist = (pairlist != NULL); + bool const rebuild_pairlist = (pairlist != NULL) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : nullptr; + bool *pairlist_elem = use_pairlist ? pairlist : NULL; size_t i = 0, j = 0; size_t const n = group1->size(); @@ -601,13 +601,13 @@ void colvar::groupcoordnum::calc_value() x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } else { int const flags = coordnum::ef_null; x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } } @@ -624,13 +624,13 @@ void colvar::groupcoordnum::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } else { int const flags = coordnum::ef_gradients; coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } group1->set_weighted_gradient(group1_com_atom.grad); diff --git a/lib/colvars/colvarcomp_distances.cpp b/lib/colvars/colvarcomp_distances.cpp index 88a5088aa..c3c1ee55d 100644 --- a/lib/colvars/colvarcomp_distances.cpp +++ b/lib/colvars/colvarcomp_distances.cpp @@ -964,7 +964,7 @@ colvar::rmsd::rmsd(std::string const &conf) } bool b_Jacobian_derivative = true; - if (atoms->fitting_group != nullptr && b_Jacobian_derivative) { + if (atoms->fitting_group != NULL && b_Jacobian_derivative) { cvm::log("The option \"fittingGroup\" (alternative group for fitting) was enabled: " "Jacobian derivatives of the RMSD will not be calculated.\n"); b_Jacobian_derivative = false; diff --git a/lib/colvars/colvardeps.cpp b/lib/colvars/colvardeps.cpp index f647211f6..f83458b51 100644 --- a/lib/colvars/colvardeps.cpp +++ b/lib/colvars/colvardeps.cpp @@ -33,7 +33,7 @@ colvardeps::~colvardeps() { // Do not delete features if it's a static object // may change in the future though // for (i=0; i &colvars, {} colvar_grid_scalar::colvar_grid_scalar() - : colvar_grid(), samples(nullptr) + : colvar_grid(), samples(NULL) {} colvar_grid_scalar::colvar_grid_scalar(colvar_grid_scalar const &g) - : colvar_grid(g), samples(nullptr) + : colvar_grid(g), samples(NULL) { } colvar_grid_scalar::colvar_grid_scalar(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, 1), samples(nullptr) + : colvar_grid(nx_i, 0.0, 1), samples(NULL) { } colvar_grid_scalar::colvar_grid_scalar(std::vector &colvars, bool margin) - : colvar_grid(colvars, 0.0, 1, margin), samples(nullptr) + : colvar_grid(colvars, 0.0, 1, margin), samples(NULL) { } @@ -122,15 +122,15 @@ cvm::real colvar_grid_scalar::entropy() const colvar_grid_gradient::colvar_grid_gradient() - : colvar_grid(), samples(nullptr) + : colvar_grid(), samples(NULL) {} colvar_grid_gradient::colvar_grid_gradient(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, nx_i.size()), samples(nullptr) + : colvar_grid(nx_i, 0.0, nx_i.size()), samples(NULL) {} colvar_grid_gradient::colvar_grid_gradient(std::vector &colvars) - : colvar_grid(colvars, 0.0, colvars.size()), samples(nullptr) + : colvar_grid(colvars, 0.0, colvars.size()), samples(NULL) {} void colvar_grid_gradient::write_1D_integral(std::ostream &os) diff --git a/lib/colvars/colvarmodule.cpp b/lib/colvars/colvarmodule.cpp index 48a38a607..1d5f75bbc 100644 --- a/lib/colvars/colvarmodule.cpp +++ b/lib/colvars/colvarmodule.cpp @@ -30,11 +30,11 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) depth_s = 0; log_level_ = 10; - cv_traj_os = nullptr; + cv_traj_os = NULL; xyz_reader_use_count = 0; - if (proxy == nullptr) { + if (proxy == NULL) { proxy = proxy_in; // Pointer to the proxy object parse = new colvarparse(); // Parsing object for global options version_int = proxy->get_version_from_string(COLVARS_VERSION); @@ -573,7 +573,7 @@ colvarbias * colvarmodule::bias_by_name(std::string const &name) return (*bi); } } - return nullptr; + return NULL; } @@ -587,7 +587,7 @@ colvar *colvarmodule::colvar_by_name(std::string const &name) return (*cvi); } } - return nullptr; + return NULL; } @@ -601,7 +601,7 @@ cvm::atom_group *colvarmodule::atom_group_by_name(std::string const &name) return (*agi); } } - return nullptr; + return NULL; } @@ -631,7 +631,7 @@ int colvarmodule::change_configuration(std::string const &bias_name, cvm::increase_depth(); colvarbias *b; b = bias_by_name(bias_name); - if (b == nullptr) { + if (b == NULL) { cvm::error("Error: bias not found: " + bias_name); return COLVARS_ERROR; } @@ -647,7 +647,7 @@ std::string colvarmodule::read_colvar(std::string const &name) colvar *c; std::stringstream ss; c = colvar_by_name(name); - if (c == nullptr) { + if (c == NULL) { cvm::error("Error: colvar not found: " + name); return std::string(); } @@ -663,7 +663,7 @@ cvm::real colvarmodule::energy_difference(std::string const &bias_name, colvarbias *b; cvm::real energy_diff = 0.; b = bias_by_name(bias_name); - if (b == nullptr) { + if (b == NULL) { cvm::error("Error: bias not found: " + bias_name); return 0.; } @@ -678,7 +678,7 @@ int colvarmodule::bias_current_bin(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->current_bin(); } else { cvm::error("Error: bias not found.\n"); @@ -695,7 +695,7 @@ int colvarmodule::bias_bin_num(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->bin_num(); } else { cvm::error("Error: bias not found.\n"); @@ -712,7 +712,7 @@ int colvarmodule::bias_bin_count(std::string const &bias_name, size_t bin_index) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->bin_count(bin_index); } else { cvm::error("Error: bias not found.\n"); @@ -729,7 +729,7 @@ int colvarmodule::bias_share(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { b->replica_share(); ret = COLVARS_OK; } else { @@ -1037,7 +1037,7 @@ int colvarmodule::write_restart_file(std::string const &out_name) int colvarmodule::write_traj_files() { - if (cv_traj_os == nullptr) { + if (cv_traj_os == NULL) { if (open_traj_file(cv_traj_name) != COLVARS_OK) { return cvm::get_error(); } else { @@ -1057,7 +1057,7 @@ int colvarmodule::write_traj_files() write_traj(*cv_traj_os); } - if (restart_out_freq && (cv_traj_os != nullptr)) { + if (restart_out_freq && (cv_traj_os != NULL)) { // flush the trajectory file if we are at the restart frequency if ( (cvm::step_relative() > 0) && ((cvm::step_absolute() % restart_out_freq) == 0) ) { @@ -1151,8 +1151,8 @@ colvarmodule::~colvarmodule() atom_group::delete_features(); delete parse; - parse = nullptr; - proxy = nullptr; + parse = NULL; + proxy = NULL; } } @@ -1184,7 +1184,7 @@ int colvarmodule::reset() proxy->reset(); - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { // Do not close traj file here, as we might not be done with it yet. proxy->flush_output_stream(cv_traj_os); } @@ -1395,7 +1395,7 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) if (static_cast(is.tellg()) == pos) { // This block has not been read by any object: discard it and move on // to the next one - is >> colvarparse::read_block(word, nullptr); + is >> colvarparse::read_block(word, NULL); } if (!is) break; @@ -1456,7 +1456,7 @@ int colvarmodule::write_output_files() } cvm::decrease_depth(); - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { // do not close, there may be another run command proxy->flush_output_stream(cv_traj_os); } @@ -1575,7 +1575,7 @@ std::ostream & colvarmodule::write_restart(std::ostream &os) int colvarmodule::open_traj_file(std::string const &file_name) { - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { return COLVARS_OK; } @@ -1591,7 +1591,7 @@ int colvarmodule::open_traj_file(std::string const &file_name) cv_traj_os = (cvm::proxy)->output_stream(file_name); } - if (cv_traj_os == nullptr) { + if (cv_traj_os == NULL) { cvm::error("Error: cannot write to file \""+file_name+"\".\n", FILE_ERROR); } @@ -1602,9 +1602,9 @@ int colvarmodule::open_traj_file(std::string const &file_name) int colvarmodule::close_traj_file() { - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { proxy->close_output_stream(cv_traj_name); - cv_traj_os = nullptr; + cv_traj_os = NULL; } return cvm::get_error(); } @@ -1672,7 +1672,7 @@ void cvm::log(std::string const &message, int min_log_level) { if (cvm::log_level() < min_log_level) return; // allow logging when the module is not fully initialized - size_t const d = (cvm::main() != nullptr) ? depth() : 0; + size_t const d = (cvm::main() != NULL) ? depth() : 0; if (d > 0) { proxy->log((std::string(2*d, ' '))+message); } else { @@ -1780,7 +1780,7 @@ int cvm::read_index_file(char const *filename) } if (index_of_group < 0) { index_group_names.push_back(group_name); - index_groups.push_back(nullptr); + index_groups.push_back(NULL); index_of_group = index_groups.size()-1; } } else { @@ -1799,7 +1799,7 @@ int cvm::read_index_file(char const *filename) pos = is.tellg(); } - if (old_index_group != nullptr) { + if (old_index_group != NULL) { bool equal = false; if (new_index_group->size() == old_index_group->size()) { if (std::equal(new_index_group->begin(), new_index_group->end(), @@ -1810,13 +1810,13 @@ int cvm::read_index_file(char const *filename) if (! equal) { new_index_group->clear(); delete new_index_group; - new_index_group = nullptr; + new_index_group = NULL; return cvm::error("Error: the index group \""+group_name+ "\" was redefined.\n", INPUT_ERROR); } else { old_index_group->clear(); delete old_index_group; - old_index_group = nullptr; + old_index_group = NULL; } } @@ -1850,7 +1850,7 @@ int colvarmodule::reset_index_groups() size_t i = 0; for ( ; i < index_groups.size(); i++) { delete index_groups[i]; - index_groups[i] = nullptr; + index_groups[i] = NULL; } index_group_names.clear(); index_groups.clear(); @@ -2179,7 +2179,7 @@ std::string cvm::wrap_string(std::string const &s, size_t nchars) // shared pointer to the proxy object -colvarproxy *colvarmodule::proxy = nullptr; +colvarproxy *colvarmodule::proxy = NULL; // static runtime data cvm::real colvarmodule::debug_gradients_step_size = 1.0e-07; diff --git a/lib/colvars/colvarmodule.h b/lib/colvars/colvarmodule.h index e06f05aca..9346e8e1d 100644 --- a/lib/colvars/colvarmodule.h +++ b/lib/colvars/colvarmodule.h @@ -459,13 +459,13 @@ public: /// Backup a file before writing it static int backup_file(char const *filename); - /// Look up a bias by name; returns nullptr if not found + /// Look up a bias by name; returns NULL if not found static colvarbias * bias_by_name(std::string const &name); - /// Look up a colvar by name; returns nullptr if not found + /// Look up a colvar by name; returns NULL if not found static colvar * colvar_by_name(std::string const &name); - /// Look up a named atom group by name; returns nullptr if not found + /// Look up a named atom group by name; returns NULL if not found static atom_group * atom_group_by_name(std::string const &name); /// Load new configuration for the given bias - diff --git a/lib/colvars/colvarparams.cpp b/lib/colvars/colvarparams.cpp index ea45c0110..e957a1841 100644 --- a/lib/colvars/colvarparams.cpp +++ b/lib/colvars/colvarparams.cpp @@ -76,7 +76,7 @@ void const *colvarparams::get_param_ptr(std::string const ¶m_name) return param_map[param_name]; } cvm::error("Error: parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return nullptr; + return NULL; } @@ -87,7 +87,7 @@ void const *colvarparams::get_param_grad_ptr(std::string const ¶m_name) } cvm::error("Error: gradient of parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return nullptr; + return NULL; } @@ -95,7 +95,7 @@ cvm::real colvarparams::get_param(std::string const ¶m_name) { cvm::real const *ptr = reinterpret_cast(get_param_ptr(param_name)); - return ptr != nullptr ? *ptr : 0.0; + return ptr != NULL ? *ptr : 0.0; } diff --git a/lib/colvars/colvarparse.cpp b/lib/colvars/colvarparse.cpp index e61ebf355..a09d6be9e 100644 --- a/lib/colvars/colvarparse.cpp +++ b/lib/colvars/colvarparse.cpp @@ -674,12 +674,12 @@ bool colvarparse::key_lookup(std::string const &conf, std::string const conf_lower(to_lower_cppstr(conf)); // by default, there is no value, unless we found one - if (data != nullptr) { + if (data != NULL) { data->clear(); } // start from the first occurrence of key - size_t pos = conf_lower.find(key, (save_pos != nullptr) ? *save_pos : 0); + size_t pos = conf_lower.find(key, (save_pos != NULL) ? *save_pos : 0); // iterate over all instances of the substring until it finds it as isolated keyword while (true) { @@ -727,7 +727,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != nullptr) { + if (save_pos != NULL) { // save the pointer for a future call (when iterating over multiple // valid instances of the same keyword) *save_pos = pos + key.size(); @@ -820,7 +820,7 @@ bool colvarparse::key_lookup(std::string const &conf, data_end) + 1; } - if (data != nullptr) { + if (data != NULL) { data->append(line, data_begin, (data_end-data_begin)); if (cvm::debug()) { @@ -834,7 +834,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != nullptr) *save_pos = line_end; + if (save_pos != NULL) *save_pos = line_end; return true; } diff --git a/lib/colvars/colvarparse.h b/lib/colvars/colvarparse.h index fc1362b2b..b7d42fdff 100644 --- a/lib/colvars/colvarparse.h +++ b/lib/colvars/colvarparse.h @@ -275,12 +275,12 @@ public: /// The keyword that identifies the block std::string const key; - /// Where to keep the data (may be nullptr) + /// Where to keep the data (may be NULL) std::string * const data; public: - read_block(std::string const &key_in, std::string *data_in = nullptr); + read_block(std::string const &key_in, std::string *data_in = NULL); ~read_block(); @@ -300,8 +300,8 @@ public: /// within "conf", useful when doing multiple calls bool key_lookup(std::string const &conf, char const *key, - std::string *data = nullptr, - size_t *save_pos = nullptr); + std::string *data = NULL, + size_t *save_pos = NULL); /// \brief Reads a configuration line, adds it to config_string, and returns /// the stream \param is Input stream \param line String that will hold the diff --git a/lib/colvars/colvarproxy.cpp b/lib/colvars/colvarproxy.cpp index 7eb0b22cb..63ae07a57 100644 --- a/lib/colvars/colvarproxy.cpp +++ b/lib/colvars/colvarproxy.cpp @@ -296,7 +296,7 @@ void colvarproxy_atom_groups::clear_atom_group(int index) colvarproxy_smp::colvarproxy_smp() { b_smp_active = true; // May be disabled by user option - omp_lock_state = nullptr; + omp_lock_state = NULL; #if defined(_OPENMP) if (smp_thread_id() == 0) { omp_lock_state = reinterpret_cast(new omp_lock_t); @@ -459,7 +459,7 @@ int colvarproxy_smp::smp_unlock() colvarproxy_script::colvarproxy_script() { - script = nullptr; + script = NULL; } @@ -507,7 +507,7 @@ int colvarproxy_script::run_colvar_gradient_callback(std::string const & /* name colvarproxy_tcl::colvarproxy_tcl() { - tcl_interp_ = nullptr; + tcl_interp_ = NULL; } @@ -528,7 +528,7 @@ char const *colvarproxy_tcl::tcl_obj_to_str(unsigned char *obj) #if defined(COLVARS_TCL) return Tcl_GetString(reinterpret_cast(obj)); #else - return nullptr; + return NULL; #endif } @@ -666,7 +666,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, } std::ostream *os = get_output_stream(output_name); - if (os != nullptr) return os; + if (os != NULL) return os; if (!(mode & (std::ios_base::app | std::ios_base::ate))) { backup_file(output_name); @@ -675,7 +675,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, if (!osf->is_open()) { cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", FILE_ERROR); - return nullptr; + return NULL; } output_stream_names.push_back(output_name); output_files.push_back(osf); @@ -692,7 +692,7 @@ std::ostream *colvarproxy_io::get_output_stream(std::string const &output_name) return *osi; } } - return nullptr; + return NULL; } @@ -794,7 +794,7 @@ int colvarproxy_io::rename_file(char const *filename, char const *newfilename) colvarproxy::colvarproxy() { - colvars = nullptr; + colvars = NULL; b_simulation_running = true; b_delete_requested = false; } diff --git a/lib/colvars/colvarproxy.h b/lib/colvars/colvarproxy.h index a46589a52..ba91afb40 100644 --- a/lib/colvars/colvarproxy.h +++ b/lib/colvars/colvarproxy.h @@ -607,7 +607,7 @@ public: std::ios_base::openmode mode = std::ios_base::out); - /// Returns a reference to output_name if it exists, nullptr otherwise + /// Returns a reference to output_name if it exists, NULL otherwise virtual std::ostream *get_output_stream(std::string const &output_name); /// \brief Flushes the given output channel diff --git a/lib/colvars/colvarscript.cpp b/lib/colvars/colvarscript.cpp index a8b5d6ab2..10b276c89 100644 --- a/lib/colvars/colvarscript.cpp +++ b/lib/colvars/colvarscript.cpp @@ -97,7 +97,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvar *cv = cvm::colvar_by_name(name); - if (cv == nullptr) { + if (cv == NULL) { result = "Colvar not found: " + name; return COLVARSCRIPT_ERROR; } @@ -111,7 +111,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvarbias *b = cvm::bias_by_name(name); - if (b == nullptr) { + if (b == NULL) { result = "Bias not found: " + name; return COLVARSCRIPT_ERROR; } @@ -186,7 +186,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) /// Parse config from string if (cmd == "config") { - return exec_command(cv_config, nullptr, objc, objv); + return exec_command(cv_config, NULL, objc, objv); } /// Load an input state file @@ -247,7 +247,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } else if (objc == 3) { // Failure of this function does not trigger an error, but // returns nonzero, to let scripts detect available frames - int error = proxy->set_frame(strtol(obj_to_str(objv[2]), nullptr, 10)); + int error = proxy->set_frame(strtol(obj_to_str(objv[2]), NULL, 10)); result = cvm::to_str(error == COLVARS_OK ? 0 : -1); return COLVARS_OK; } else { @@ -258,7 +258,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) if (cmd == "addenergy") { if (objc == 3) { - colvars->total_bias_energy += strtod(obj_to_str(objv[2]), nullptr); + colvars->total_bias_energy += strtod(obj_to_str(objv[2]), NULL); return COLVARS_OK; } else { result = "Wrong arguments to command \"addenergy\"\n" + help_string(); @@ -267,7 +267,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } if (cmd == "help") { - return exec_command(cv_help, nullptr, objc, objv); + return exec_command(cv_help, NULL, objc, objv); } result = "Syntax error\n" + help_string(); @@ -320,7 +320,7 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) // colvar destructor is tasked with the cleanup delete cv; // TODO this could be done by the destructors - if (colvars->cv_traj_os != nullptr) { + if (colvars->cv_traj_os != NULL) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -513,7 +513,7 @@ int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[] // the bias destructor takes care of the cleanup at cvm level delete b; // TODO this could be done by the destructors - if (colvars->cv_traj_os != nullptr) { + if (colvars->cv_traj_os != NULL) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -564,7 +564,7 @@ int colvarscript::proc_features(colvardeps *obj, if ((subcmd == "get") || (subcmd == "set")) { std::vector const &features = obj->features(); std::string const req_feature(obj_to_str(objv[3])); - colvardeps::feature *f = nullptr; + colvardeps::feature *f = NULL; int fid = 0; for (fid = 0; fid < int(features.size()); fid++) { if (features[fid]->description == @@ -574,7 +574,7 @@ int colvarscript::proc_features(colvardeps *obj, } } - if (f == nullptr) { + if (f == NULL) { result = "Error: feature \""+req_feature+"\" does not exist.\n"; return COLVARSCRIPT_ERROR; diff --git a/lib/colvars/colvarscript.h b/lib/colvars/colvarscript.h index 04679b37a..69d52cbb5 100644 --- a/lib/colvars/colvarscript.h +++ b/lib/colvars/colvarscript.h @@ -278,7 +278,7 @@ extern "C" { 1, 1, { "E (float) - Amount of energy to add" }, cvm::main()->total_bias_energy += - strtod(script->obj_to_str(objv[2]), nullptr); + strtod(script->obj_to_str(objv[2]), NULL); return COLVARS_OK; ) diff --git a/lib/colvars/colvartypes.h b/lib/colvars/colvartypes.h index 55401576b..e5f12154e 100644 --- a/lib/colvars/colvartypes.h +++ b/lib/colvars/colvartypes.h @@ -59,7 +59,7 @@ public: if (data.size() > 0) { return &(data[0]); } else { - return nullptr; + return NULL; } } @@ -520,7 +520,7 @@ public: if (rows.size() > 0) { return &(pointers[0]); } else { - return nullptr; + return NULL; } } diff --git a/lib/colvars/lepton/include/lepton/Operation.h b/lib/colvars/lepton/include/lepton/Operation.h index 68474137f..1ddde0b8c 100644 --- a/lib/colvars/lepton/include/lepton/Operation.h +++ b/lib/colvars/lepton/include/lepton/Operation.h @@ -186,7 +186,7 @@ public: } bool operator!=(const Operation& op) const { const Constant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -217,7 +217,7 @@ public: ExpressionTreeNode differentiate(const std::vector& children, const std::vector& childDerivs, const std::string& variable) const; bool operator!=(const Operation& op) const { const Variable* o = dynamic_cast(&op); - return (o == nullptr || o->name != name); + return (o == NULL || o->name != name); } private: std::string name; @@ -264,7 +264,7 @@ public: } bool operator!=(const Operation& op) const { const Custom* o = dynamic_cast(&op); - return (o == nullptr || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); + return (o == NULL || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); } private: std::string name; @@ -955,7 +955,7 @@ public: } bool operator!=(const Operation& op) const { const AddConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -988,7 +988,7 @@ public: } bool operator!=(const Operation& op) const { const MultiplyConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -1042,7 +1042,7 @@ public: } bool operator!=(const Operation& op) const { const PowerConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } bool isInfixOperator() const { return true; diff --git a/lib/colvars/lepton/src/CompiledExpression.cpp b/lib/colvars/lepton/src/CompiledExpression.cpp index 6abcad2de..1ad348b47 100644 --- a/lib/colvars/lepton/src/CompiledExpression.cpp +++ b/lib/colvars/lepton/src/CompiledExpression.cpp @@ -40,10 +40,10 @@ using namespace std; using namespace asmjit; #endif -CompiledExpression::CompiledExpression() : jitCode(nullptr) { +CompiledExpression::CompiledExpression() : jitCode(NULL) { } -CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(nullptr) { +CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(NULL) { ParsedExpression expr = expression.optimize(); // Just in case it wasn't already optimized. vector > temps; compileExpression(expr.getRootNode(), temps); @@ -59,11 +59,11 @@ CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jit CompiledExpression::~CompiledExpression() { for (int i = 0; i < (int) operation.size(); i++) - if (operation[i] != nullptr) + if (operation[i] != NULL) delete operation[i]; } -CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(nullptr) { +CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(NULL) { *this = expression; } diff --git a/lib/colvars/lepton/src/ExpressionTreeNode.cpp b/lib/colvars/lepton/src/ExpressionTreeNode.cpp index 09c5352d2..851987826 100644 --- a/lib/colvars/lepton/src/ExpressionTreeNode.cpp +++ b/lib/colvars/lepton/src/ExpressionTreeNode.cpp @@ -59,14 +59,14 @@ ExpressionTreeNode::ExpressionTreeNode(Operation* operation) : operation(operati throw Exception("wrong number of arguments to function: "+operation->getName()); } -ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == nullptr ? nullptr : node.operation->clone()), children(node.getChildren()) { +ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == NULL ? NULL : node.operation->clone()), children(node.getChildren()) { } -ExpressionTreeNode::ExpressionTreeNode() : operation(nullptr) { +ExpressionTreeNode::ExpressionTreeNode() : operation(NULL) { } ExpressionTreeNode::~ExpressionTreeNode() { - if (operation != nullptr) + if (operation != NULL) delete operation; } @@ -91,7 +91,7 @@ bool ExpressionTreeNode::operator==(const ExpressionTreeNode& node) const { } ExpressionTreeNode& ExpressionTreeNode::operator=(const ExpressionTreeNode& node) { - if (operation != nullptr) + if (operation != NULL) delete operation; operation = node.getOperation().clone(); children = node.getChildren(); diff --git a/lib/colvars/lepton/src/ParsedExpression.cpp b/lib/colvars/lepton/src/ParsedExpression.cpp index c25975634..fd3b091d3 100644 --- a/lib/colvars/lepton/src/ParsedExpression.cpp +++ b/lib/colvars/lepton/src/ParsedExpression.cpp @@ -46,7 +46,7 @@ ParsedExpression::ParsedExpression(const ExpressionTreeNode& rootNode) : rootNod } const ExpressionTreeNode& ParsedExpression::getRootNode() const { - if (&rootNode.getOperation() == nullptr) + if (&rootNode.getOperation() == NULL) throw Exception("Illegal call to an initialized ParsedExpression"); return rootNode; } diff --git a/lib/kokkos/cmake/compile_tests/pthread.cpp b/lib/kokkos/cmake/compile_tests/pthread.cpp index 7fa98611b..92310da02 100644 --- a/lib/kokkos/cmake/compile_tests/pthread.cpp +++ b/lib/kokkos/cmake/compile_tests/pthread.cpp @@ -4,11 +4,11 @@ void* kokkos_test(void* args) { return args; } int main(void) { pthread_t thread; - /* Use nullptr to avoid C++11. Some compilers + /* Use NULL to avoid C++11. Some compilers do not have C++11 by default. Forcing C++11 in the compile tests can be done, but is unnecessary */ - pthread_create(&thread, nullptr, kokkos_test, nullptr); - pthread_join(thread, nullptr); + pthread_create(&thread, NULL, kokkos_test, NULL); + pthread_join(thread, NULL); return 0; } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index d4db2c538..a97fb2f7c 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -640,7 +640,7 @@ void SharedAllocationRecord:: /*--------------------------------------------------------------------------*/ void* hip_resize_scratch_space(size_t bytes, bool force_shrink) { - static void* ptr = nullptr; + static void* ptr = NULL; static size_t current_size = 0; if (current_size == 0) { current_size = bytes; diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index 613793fc6..fad36c02f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -139,7 +139,7 @@ void *HBWSpace::allocate(const char *arg_label, const size_t arg_alloc_size, } msg << " ]( " << arg_alloc_size << " ) FAILED"; if (ptr == nullptr) { - msg << " NULL"; + msg << " nullptr"; } else { msg << " NOT ALIGNED " << ptr; } diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index 2b11adbf6..a9a277881 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -215,7 +215,7 @@ SharedAllocationRecord::SharedAllocationRecord( } else { Kokkos::Impl::throw_runtime_exception( - "Kokkos::Impl::SharedAllocationRecord given NULL allocation"); + "Kokkos::Impl::SharedAllocationRecord given nullptr allocation"); } } diff --git a/lib/kokkos/core/unit_test/TestCTestDevice.cpp b/lib/kokkos/core/unit_test/TestCTestDevice.cpp index c54c75f94..b2ee79b85 100644 --- a/lib/kokkos/core/unit_test/TestCTestDevice.cpp +++ b/lib/kokkos/core/unit_test/TestCTestDevice.cpp @@ -13,7 +13,7 @@ int setenv(const char *name, const char *value, int overwrite) { int errcode = 0; if (!overwrite) { size_t envsize = 0; - errcode = getenv_s(&envsize, nullptr, 0, name); + errcode = getenv_s(&envsize, NULL, 0, name); if (errcode || envsize) return errcode; } return _putenv_s(name, value); -- GitLab From 05d41cd50de992fe806e4f4a3d8b42b6e39579a4 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 09:54:15 -0600 Subject: [PATCH 16/52] T2345: Replace instances of NULL with nullptr revert lib/poems to remove nullptr changes. Walking back changes to lib as needed. --- lib/poems/SystemProcessor.h | 30 +++++++++--------- lib/poems/poemsnodelib.h | 20 ++++++------ lib/poems/poemstree.h | 62 ++++++++++++++++++------------------- lib/poems/poemstreenode.cpp | 2 +- lib/poems/poemstreenode.h | 2 +- lib/poems/solver.cpp | 2 +- lib/poems/system.cpp | 10 +++--- lib/poems/workspace.cpp | 6 ++-- 8 files changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index c1c45a86a..4fc8785dd 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != nullptr) + if(currentNode != NULL) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != nullptr); //repeat this until all chains have been added + while(currentNode != NULL); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null + if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null { - return nullptr; + return NULL; } int * tmp; - POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = nullptr; //temporary variable to hold data - while(tempNode != nullptr) //when we have followed all links, stop + POEMSChain * tempChain = NULL; //temporary variable to hold data + while(tempNode != NULL) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == nullptr) + if(aNode == NULL) { - return nullptr; + return NULL; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == nullptr) //and if we find nothing... + if(returnVal == NULL) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == nullptr) //if we could not find any chains + if(returnVal == NULL) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be nullptr if no new chains are + return returnVal; //return what we find (will be NULL if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists + while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list + while(tmp->value != NULL || tmp2->value != NULL) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 04f0f4b79..446fa2013 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); +TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != nullptr) + if (t != NULL) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != nullptr) + if (t != NULL) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value nullptr +// The pointers have default value NULL TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == nullptr) + if (p == NULL) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=nullptr) + if(t !=NULL) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == nullptr && t->Right() == nullptr) + if (t->Left() == NULL && t->Right() == NULL) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == nullptr) + if (t == NULL) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=nullptr - if (t != nullptr) + //print tree with root t, as long as t!=NULL + if (t != NULL) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index 14f5fd400..ee07a3325 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = nullptr); + void Insert(const int& item, const int& data, void * AuxData = NULL); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = nullptr; + DeleteAuxData = NULL; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return nullptr +// address and a pointer to its parent; otherwise, return NULL TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is nullptr - parent = nullptr; + // the parent of the root is NULL + parent = NULL; // terminate on empty subtree - while(t != nullptr) + while(t != NULL) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; nullptr if not found + // return pointer to node; NULL if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != nullptr) + if (current != NULL) { item = current->data; return current->GetAuxData(); } else // item not found in the tree. return False - return nullptr; + return NULL; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,nullptr,nullptr); + newNode = GetTreeNode(item,NULL,NULL); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == nullptr) + if (tree == NULL) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) + if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) return; - // If D has nullptr pointer, the + // If D has NULL pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == nullptr) + if (DNodePtr->right == NULL) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == nullptr) + else if (DNodePtr->left == NULL) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-nullptr + // Both pointers of DNodePtr are non-NULL else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != nullptr) + while (RNodePtr->right != NULL) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == nullptr) + if (PNodePtr == NULL) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=nullptr && current->data == item) + if (current !=NULL && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == nullptr) - return nullptr; + if (t == NULL) + return NULL; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns nullptr. + // present it makes a copy of left child or returns NULL. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=nullptr) + if (t->Left() !=NULL) newlptr = CopyTree(t->Left()); else - newlptr = nullptr; + newlptr = NULL; - if (t->Right() !=nullptr) + if (t->Right() !=NULL) newrptr = CopyTree(t->Right()); else - newrptr = nullptr; + newrptr = NULL; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != nullptr) { + if (t != NULL) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != nullptr) { - if (DeleteAuxData != nullptr) { + if (aux != NULL) { + if (DeleteAuxData != NULL) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to nullptr +// set the root pointer back to NULL void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = nullptr; // root now nullptr + t = NULL; // root now NULL } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 52905fc40..051e13d6e 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value nullptr assigns a empty subtree +// The pointer value NULL assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/poemstreenode.h b/lib/poems/poemstreenode.h index e5673344a..a1835ba02 100644 --- a/lib/poems/poemstreenode.h +++ b/lib/poems/poemstreenode.h @@ -18,7 +18,7 @@ #ifndef TREENODE_H #define TREENODE_H -//#define nullptr 0 +//#define NULL 0 //Tree depends on TreeNode diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 7b1e718b9..67f5b607e 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return nullptr; + default: return NULL; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 23554f411..369213f7d 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = nullptr; + mappings = NULL; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = nullptr; + Body* body = NULL; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = nullptr; + Point* point_ch = NULL; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = nullptr; + Body* body = NULL; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = nullptr; + Point* point_ch = NULL; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 21819d4c0..2b3257b0d 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = nullptr; + system = NULL; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != nullptr) { + while(NodeValue != NULL) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return nullptr; + return NULL; } } -- GitLab From 14dfd3876ac4a53855804baa7f27abfb6a1a9d46 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 10:24:51 -0600 Subject: [PATCH 17/52] T2345: Walking back nullptr changes to lib/awpmd --- lib/awpmd/ivutils/include/logexc.h | 8 +++--- lib/awpmd/ivutils/include/pairhash.h | 28 +++++++++---------- lib/awpmd/ivutils/include/refobj.h | 20 ++++++------- lib/awpmd/ivutils/include/vector_3.h | 14 +++++----- lib/awpmd/ivutils/src/logexc.cpp | 2 +- lib/awpmd/systems/interact/TCP/wpmd.h | 20 ++++++------- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 4 +-- lib/awpmd/systems/interact/TCP/wpmd_split.h | 16 +++++------ 8 files changed, 56 insertions(+), 56 deletions(-) diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 2eebfcc0c..7bf6125bc 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(nullptr),next(nullptr){ + :descriptor(descriptor_),prev(NULL),next(NULL){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=nullptr; - prev=nullptr; + glogp->next=NULL; + prev=NULL; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ set_out(out); set_err(err); } diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index 0f79fc418..c29f72773 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(nullptr),incr(0){} + iterator():ptr(NULL),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(nullptr,1) { + recmatrix(): parr(NULL,1) { sizey=sizex=0; - arr=nullptr; + arr=NULL; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(nullptr,0); + parr.reset(NULL,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(nullptr),incr(0){} + iterator():ptr(NULL),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(nullptr,1) { + sqmatrix(): parr(NULL,1) { size=0; - arr=nullptr; + arr=NULL; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ + sqmatrix(const sqmatrix &other):size(0),arr(NULL){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(nullptr,0); + parr.reset(NULL,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not nullptr, puts the found value there - virtual int Find(long i, long j, T *retval=nullptr)=0; - virtual int Find(long i, long j, T **retval=nullptr)=0; + //e if retval is not NULL, puts the found value there + virtual int Find(long i, long j, T *retval=NULL)=0; + virtual int Find(long i, long j, T **retval=NULL)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=nullptr){ + int Find(long i, long j, T *retval=NULL){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index 8e5fc7df4..a1a4feb0f 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=nullptr, int managed=0){ + void reset(T* ptr=NULL, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==nullptr than p is not managed (as in mngptr) + int *num; //if num==NULL than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=nullptr; + else num=NULL; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=nullptr; + else num=NULL; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=nullptr; + else num=NULL; } public: - shptr(T* p=nullptr, int managed=1){ + shptr(T* p=NULL, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=nullptr; + num=NULL; } - p=nullptr; + p=NULL; } } bool valid() const { - return p!=nullptr; + return p!=NULL; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 534cea44a..468abbda9 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=nullptr) const { + T maxcoord(int *ind=NULL) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index 6e809dd65..7e82af0f6 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,7 +13,7 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=nullptr; +message_logger *message_logger::glogp=NULL; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); const char *logfmt(const char *format,...){ diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index 4c6544001..e118b76f3 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -255,7 +255,7 @@ public: } //e Create NormDeriv object and calculate the derivatived for the given WP - void set2(const WavePacket& w2_, const cdouble *I0_=nullptr){ + void set2(const WavePacket& w2_, const cdouble *I0_=NULL){ w2=w2_; d2.set(w2); w12=conj(w1)*w2; @@ -558,13 +558,13 @@ public: //e if PBCs are used, the corresponding coordinates of electrons and ions //e in periodic directions must be within the range [0, cell[per_dir]) //e @returns 1 if OK - int set_pbc(const Vector_3P pcell=nullptr, int pbc_=0x7); + int set_pbc(const Vector_3P pcell=NULL, int pbc_=0x7); ///\en Setup electrons: forms internal wave packet representations. /// If PBCs are used the coords must be within a range [0, cell). /// Default electron mass is AWPMD::me. - /// Default (q=nullptr )electron charges are -1. - int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=nullptr); + /// Default (q=NULL )electron charges are -1. + int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=NULL); //e setup ion charges and coordinates //e if PBCs are used the coords must be within a range [0, cell) @@ -593,16 +593,16 @@ public: // 0x2 -- add ion forces to the existing set // 0x4 -- calculate derivatives for electronic time step (NOT IMPLEMENTED) //e if PBCs are used the coords must be within a range [0, cell) - virtual int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + virtual int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); //e same as interaction, but using Hartee factorization (no antisymmetrization) - virtual int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + virtual int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Calculates ion-ion interactions and updates Eii and ion forces if requested. This function /// is called form intaraction() and interaction_hartree if calc_ii is set. - virtual int interaction_ii(int flag,Vector_3P fi=nullptr); + virtual int interaction_ii(int flag,Vector_3P fi=NULL); //e Calculates Norm matrix //e The result is saved in AWPMD::Norm[s] @@ -643,7 +643,7 @@ public: ///\en Prepares force arrays according to \a flag setting for interaction() virtual void clear_forces(int flagi,Vector_3P fi, Vector_3P fe_x, - Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=nullptr); + Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=NULL); ///\en Creates wave packet according to the given physical parameters. diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 55105066d..2c58bdaf2 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -312,7 +312,7 @@ void AWPMD_split::clear_forces(int flag,Vector_3P fi, Vector_3P fe_x, void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ if(flag&0x4) //need to replace the forces - clear_forces(0x4,nullptr,fe_x,fe_p,fe_w,fe_pw,fe_c); + clear_forces(0x4,NULL,fe_x,fe_p,fe_w,fe_pw,fe_c); // recalculating derivatives if(flag&(0x8|0x4)){ //electron forces needed @@ -622,7 +622,7 @@ void AWPMD_split::y_deriv(cdouble v,int s,int c2, int c1){ /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n -/// will not update electronic force arrays, which may be nullptr, \n +/// will not update electronic force arrays, which may be NULL, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.h b/lib/awpmd/systems/interact/TCP/wpmd_split.h index 0ffef2645..44fb75757 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.h +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.h @@ -116,8 +116,8 @@ public: /// \a n is the number of electrons of a given spin component /// Electron velocity v is multiplied by mass to obtain momentum. /// Default mass (-1) means me. - /// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split - int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr); + /// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split + int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL); ///\en Starts adding new electron: continue with \ref add_split functions. @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be nullptr, \n + /// will not update electronic force arrays, which may be NULL, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n -- GitLab From 9f0354f8160040d896fc62760b92c8c70ae0de36 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 10:48:48 -0600 Subject: [PATCH 18/52] T2345: Walking back nullptr changes in #defines in STUBS/mpi.h --- src/STUBS/mpi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 5df63682b..063dc542b 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -50,7 +50,7 @@ extern "C" { #define MPI_GROUP_EMPTY -1 #define MPI_ANY_SOURCE -1 -#define MPI_STATUS_IGNORE nullptr +#define MPI_STATUS_IGNORE NULL #define MPI_Comm int #define MPI_Request int @@ -60,7 +60,7 @@ extern "C" { #define MPI_Group int #define MPI_Offset long -#define MPI_IN_PLACE nullptr +#define MPI_IN_PLACE NULL #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 -- GitLab From 1597cd5dcb87a0cb4e83492403ec3dd1fe4f5a72 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Sat, 12 Sep 2020 09:02:31 -0600 Subject: [PATCH 19/52] T2345: After examining comments changed by batch conversion of NULL to nullptr, I've corrected a small number where it seemed clear that the previous NULL should have been either "NULL" (where the code is looking for a string with that value), or null char / null byte (where the comment is talking about the char/byte that terminates a c-style string). Also changed 6 places where the batch change had changed 'NULL ptr' to 'nullptr ptr'. Now they simply say 'nullptr'. --- src/GPU/pair_eam_alloy_gpu.cpp | 2 +- src/GPU/pair_eam_fs_gpu.cpp | 2 +- src/KOKKOS/pair_eam_alloy_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_fs_kokkos.cpp | 2 +- src/MANYBODY/pair_adp.cpp | 2 +- src/MANYBODY/pair_airebo.cpp | 2 +- src/MANYBODY/pair_airebo.h | 2 +- src/MANYBODY/pair_comb.cpp | 2 +- src/MANYBODY/pair_comb3.cpp | 2 +- src/MANYBODY/pair_eam_alloy.cpp | 2 +- src/MANYBODY/pair_eam_fs.cpp | 2 +- src/MANYBODY/pair_eim.cpp | 2 +- src/MANYBODY/pair_gw.cpp | 2 +- src/MANYBODY/pair_lcbop.cpp | 4 ++-- src/MANYBODY/pair_lcbop.h | 2 +- src/MANYBODY/pair_nb3b_harmonic.cpp | 2 +- src/MANYBODY/pair_polymorphic.cpp | 2 +- src/MANYBODY/pair_sw.cpp | 2 +- src/MANYBODY/pair_tersoff.cpp | 2 +- src/MANYBODY/pair_vashishta.cpp | 2 +- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-INTEL/pair_eam_alloy_intel.cpp | 2 +- src/USER-INTEL/pair_eam_fs_intel.cpp | 2 +- src/USER-MEAMC/pair_meamc.cpp | 2 +- src/USER-MISC/pair_agni.cpp | 2 +- src/USER-MISC/pair_drip.cpp | 2 +- src/USER-MISC/pair_edip.cpp | 2 +- src/USER-MISC/pair_edip_multi.cpp | 2 +- src/USER-MISC/pair_extep.cpp | 2 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 2 +- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 2 +- src/USER-MISC/pair_kolmogorov_crespi_z.cpp | 2 +- src/USER-MISC/pair_lebedeva_z.cpp | 2 +- src/USER-MISC/pair_meam_spline.cpp | 2 +- src/USER-MISC/pair_meam_sw_spline.cpp | 2 +- src/USER-MISC/pair_tersoff_table.cpp | 2 +- src/USER-OMP/pair_eam_alloy_omp.cpp | 2 +- src/USER-OMP/pair_eam_fs_omp.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 2 +- src/USER-SMTBQ/pair_smtbq.cpp | 2 +- src/atom.cpp | 4 ++-- src/fix_spring_rg.cpp | 2 +- src/input.cpp | 12 ++++++------ src/pair_coul_streitz.cpp | 2 +- src/read_dump.cpp | 8 ++++---- src/run.cpp | 2 +- 46 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 9dd5c85c4..998ca9293 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index 10f6b4ebe..5559bb470 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 4e0c44acb..52882c8be 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMAlloyKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index 2714da9ca..d697cfbe9 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMFSKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index 4eeab8938..3b98c91cb 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 8643f5481..eb92e0c58 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to C and H - // map[i] = which element (0,1) the Ith atom type is, -1 if nullptr + // map[i] = which element (0,1) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index d605ddc2d..7539cc5e7 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -40,7 +40,7 @@ class PairAIREBO : public Pair { enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code protected: - int *map; // 0 (C), 1 (H), or -1 (nullptr) for each type + int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type int variant; int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 0e2ac8dac..95b49b98f 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -456,7 +456,7 @@ void PairComb::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index fd4f1b382..01a1538f7 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -192,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index 055a2baf1..f17d500a4 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -70,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index 90c24bb25..1c055e1bc 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -70,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index 69e2832b3..8f229060c 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -388,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg) read_file(arg[2+nelements]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3 + nelements; i < narg; i++) { m = i - (3+nelements) + 1; diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index dd9b55b7b..6a97975d4 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index c84361d7a..760ffc8cd 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg) if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // read args that map atom types to C and nullptr - // map[i] = which element (0 for C) the Ith atom type is, -1 if nullptr + // read args that map atom types to C and "NULL" + // map[i] = which element (0 for C) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index 9ca2e3d55..dacbe7415 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -39,7 +39,7 @@ class PairLCBOP : public Pair { protected: int **pages; // neighbor list pages - int *map; // 0 (C) or -1 (nullptr) for each type + int *map; // 0 (C) or -1 ("NULL") for each type int me; diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index a361955fa..859652dd1 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index cdf9a7f23..99eb2fec5 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -479,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 9db9adf42..b74eda0f8 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -262,7 +262,7 @@ void PairSW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index 21a8f7de6..b8379d15c 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -306,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index fea414f5f..10ac2c418 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index eaa0d272c..57162df24 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -961,7 +961,7 @@ void FixColvars::write_restart(FILE *fp) proxy->serialize_status(rest_text); // TODO call write_output_files() const char *cvm_state = rest_text.c_str(); - int len = strlen(cvm_state) + 1; // need to include terminating nullptr byte. + int len = strlen(cvm_state) + 1; // need to include terminating null byte. fwrite(&len,sizeof(int),1,fp); fwrite(cvm_state,1,len,fp); } diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index b93c9bc8c..b78baf896 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index 2165f10af..84cfcb8a1 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -69,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 133bb611c..4c4a3dcf6 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -556,7 +556,7 @@ void PairMEAMC::read_files(const std::string &globalfile, delete [] rozero; delete [] found; - // done if user param file is nullptr + // done if user param file is "NULL" if (userfile == "NULL") return; diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index afd600594..0361942af 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -266,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 449cf8669..b5b39a65a 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 31dda8bb0..62d09e0c4 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 1a5d4925d..07245b172 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index 6d9f74de8..d8fa565ae 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index f0c197ca3..63ba47448 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index c30899083..0804f42b8 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 80f57fb5d..617a48c0f 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -232,7 +232,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index cb65dc85f..3168a35ab 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -228,7 +228,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index 455a21ada..3be2a3858 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 0013fa557..a8977a09d 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index 6e0cacaff..bc6be2d39 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index 9a797dafa..2f29aced6 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index d474e039b..a7fd0cac5 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -69,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 6a2ba7d75..fd97a2635 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args ) } // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" int itmp = 0; int nreax_types = system->reax_param.num_atom_types; diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index a40f676ff..d84f30230 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/atom.cpp b/src/atom.cpp index a58e1e318..539bf6fc0 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find nullptr ptr: + // if find nullptr: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find nullptr ptr: + // if don't find nullptr: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 280539505..6cd8637a5 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -67,7 +67,7 @@ void FixSpringRG::init() { masstotal = group->mass(igroup); - // if rg0 was specified as nullptr, compute current Rg + // Compute current Rg // only occurs on 1st run if (rg0_flag) { diff --git a/src/input.cpp b/src/input.cpp index 5efbdfba3..5e40d2ded 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -467,10 +467,10 @@ char *Input::nextword(char *str, char **next) // start = first char beyond quote // stop = first char of matching quote // next = first char beyond matching quote - // next must be nullptr or whitespace + // next must be null char or whitespace // if start is not single/double/triple quote: // stop = first whitespace char after start - // next = char after stop, or stop itself if stop is nullptr + // next = char after stop, or stop itself if stop is null char if (strstr(start,"\"\"\"") == start) { stop = strstr(&start[3],"\"\"\""); @@ -492,7 +492,7 @@ char *Input::nextword(char *str, char **next) else *next = stop+1; } - // set stop to nullptr to terminate word + // set stop to null char to terminate word *stop = '\0'; return start; @@ -510,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) // use str2 as scratch space to expand str, then copy back to str // reallocate str and str2 as necessary // do not replace $ inside single/double/triple quotes - // var = pts at variable name, ended by nullptr - // if $ is followed by '{', trailing '}' becomes nullptr - // else $x becomes x followed by nullptr + // var = pts at variable name, ended by null char + // if $ is followed by '{', trailing '}' becomes null char + // else $x becomes x followed by null char // beyond = points to text following variable int i,n,paren_count; diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 6ff958483..101aaf36a 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 2fd14b547..dcbb95fcc 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid nullptr ptr + newmaxnew = MAX(newmaxnew,1); // avoid nullptr memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); diff --git a/src/run.cpp b/src/run.cpp index f5b571844..2e55fba43 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -91,7 +91,7 @@ void Run::command(int narg, char **arg) // all remaining args are commands // first,last = arg index of first/last commands - // set ncommands = 0 if single command and it is nullptr + // set ncommands = 0 if single command and it is "NULL" } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); -- GitLab From bc850bcd97706e88185a4718bf47550586f76b6a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 14:04:23 -0400 Subject: [PATCH 20/52] update molfile plugin headers with latest versions from VMD --- lib/molfile/molfile_plugin.h | 127 +++++++++++++++++++++++++++++------ lib/molfile/vmdplugin.h | 4 +- 2 files changed, 109 insertions(+), 22 deletions(-) diff --git a/lib/molfile/molfile_plugin.h b/lib/molfile/molfile_plugin.h index 2b7c57b84..491cd375b 100644 --- a/lib/molfile/molfile_plugin.h +++ b/lib/molfile/molfile_plugin.h @@ -11,7 +11,7 @@ * * $RCSfile: molfile_plugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.108 $ $Date: 2016/02/26 03:17:01 $ + * $Revision: 1.112 $ $Date: 2019/10/17 06:12:24 $ * ***************************************************************************/ @@ -111,7 +111,7 @@ typedef struct { char resname[8]; /**< required residue name string */ int resid; /**< required integer residue ID */ char segid[8]; /**< required segment name string, or "" */ -#if 0 && vmdplugin_ABIVERSION > 17 +#if 0 && vmdplugin_ABIVERSION > 10000 /* The new PDB file formats allows for much larger structures, */ /* which can therefore require longer chain ID strings. The */ /* new PDBx/mmCIF file formats do not have length limits on */ @@ -187,13 +187,58 @@ typedef struct molfile_timestep_metadata { int has_velocities; /**< if timesteps have velocities */ } molfile_timestep_metadata_t; + /* - * Per-timestep atom coordinates and periodic cell information + * + * Per-timestep atom coordinates, velocities, forces, energies, + * and periodic cell information + * + */ + +#if 0 +/** + * Periodically stored energies of various kinds + */ +typedef struct { + int energyflags; // XXX indicate use and semantics of data fields + + double total_energy; // XXX these copied from DESRES_READ_TIMESTEP2 case + double potential_energy; + double kinetic_energy; + double extended_energy; + double force_energy; + double total_pressure; + + // Alchemical free energy methods need to store individual energy samples. + // We don't really want pre-averaged quantities, they lead to problems later. + double lambda; // data gen sim parm: + aux scheduling + soft core parm + double temperature; // temp set by thermostat + // either we use deltaU, or we store U and Uprime... + double deltaU; // Ulambda - Ulambdaprime + double Ulambda; // U for lambda + double Ulambdaprime; // U for lambdaprime + + // IDWS methods + // XXX both values of lambdaprime and required de-interleaving information + + // Replica exchange methods + // XXX rectangle sample params? + + // REST2 method + // XXX + +} molfile_energies_t; +#endif + + +/** + * Per-timestep atom coordinates, velocities, time, energies + * and periodic cell info */ typedef struct { float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */ float *velocities; /**< space for velocities of all atoms; same layout */ - /**< nullptr unless has_velocities is set */ + /**< NULL unless has_velocities is set */ /*@{*/ /** @@ -517,7 +562,7 @@ typedef struct { * form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */ float *orbital_energies; /**< list of orbital energies for wavefunction */ float *occupancies; /**< orbital occupancies */ - int *orbital_ids; /**< orbital ID numbers; If nullptr then VMD will + int *orbital_ids; /**< orbital ID numbers; If NULL then VMD will * assume 1,2,3,...num_orbs. */ } molfile_qm_wavefunction_t; @@ -588,7 +633,7 @@ color r, g, b /** - * Main file reader API. Any function in this struct may be nullptr + * Main file reader API. Any function in this struct may be NULL * if not implemented by the plugin; the application checks this to determine * what functionality is present in the plugin. */ @@ -599,7 +644,7 @@ typedef struct { vmdplugin_HEAD /** - * Filename extension for this file type. May be nullptr if no filename + * Filename extension for this file type. May be NULL if no filename * extension exists and/or is known. For file types that match several * common extensions, list them in a comma separated list such as: * "pdb,ent,foo,bar,baz,ban" @@ -611,7 +656,7 @@ typedef struct { const char *filename_extension; /** - * Try to open the file for reading. Return an opaque handle, or nullptr on + * Try to open the file for reading. Return an opaque handle, or NULL on * failure. Set the number of atoms; if the number of atoms cannot be * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. * Filetype should be the name under which this plugin was registered; @@ -638,20 +683,20 @@ typedef struct { * the caller. * If the plugin provides bond information, but the file loaded doesn't * actually contain any bond info, the nbonds parameter should be - * set to 0 and from/to should be set to nullptr to indicate that no bond + * set to 0 and from/to should be set to NULL to indicate that no bond * information was actually present, and automatic bond search should be * performed. * * If the plugin provides bond order information, the bondorder array * will contain the bond order for each from/to pair. If not, the bondorder - * pointer should be set to nullptr, in which case the caller will provide a + * pointer should be set to NULL, in which case the caller will provide a * default bond order value of 1.0. * * If the plugin provides bond type information, the bondtype array * will contain the bond type index for each from/to pair. These numbers * are consecutive integers starting from 0. * the bondtypenames list, contains the corresponding names, if available, - * as a nullptr string terminated list. nbondtypes is provided for convenience + * as a NULL string terminated list. nbondtypes is provided for convenience * and consistency checking. * * These arrays must be freed by the plugin in the close_file_read function. @@ -662,11 +707,11 @@ typedef struct { int **bondtype, int *nbondtypes, char ***bondtypename); /** - * XXX this function will be augmented and possibly superseded by a + * XXX this function will be augmented and possibly superceded by a * new QM-capable version named read_timestep(), when finished. * * Read the next timestep from the file. Return MOLFILE_SUCCESS, or - * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is nullptr, then + * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then * the frame should be skipped. Otherwise, the application must prepare * molfile_timestep_t by allocating space in coords for the corresponding * number of coordinates. @@ -684,7 +729,7 @@ typedef struct { /** * Open a coordinate file for writing using the given header information. - * Return an opaque handle, or nullptr on failure. The application must + * Return an opaque handle, or NULL on failure. The application must * specify the number of atoms to be written. * filetype should be the name under which this plugin was registered. */ @@ -757,7 +802,7 @@ typedef struct { * from/to and to/from versions of each. * This function must be called before write_structure(). * - * Like the read_bonds() routine, the bondorder pointer is set to nullptr + * Like the read_bonds() routine, the bondorder pointer is set to NULL * if the caller doesn't have such information, in which case the * plugin should assume a bond order of 1.0 if the file format requires * bond order information. @@ -767,7 +812,7 @@ typedef struct { * index (consecutive integers starting from 0) and bondtypenames * contain the corresponding strings, in case the naming/numbering * scheme is different from the index numbers. - * if the pointers are set to nullptr, then this information is not available. + * if the pointers are set to NULL, then this information is not available. * bondtypenames can only be used of bondtypes is also given. * Return MOLFILE_SUCCESS if no errors occur. */ @@ -839,16 +884,39 @@ typedef struct { int (* read_qm_rundata)(void *, molfile_qm_t *qmdata); + /** + * Query the molfile plugin to determine whether or not memory + * allocations used for atomic coordinates and PBC unit cell information + * need to be aligned to a particular virtual memory or filesystem + * page size boundary to facilitate kernel-bypass unbuffered I/O, + * e.g., as used by jsplugin. This API should be called prior to the + * first call to read a timestep. The required page alignment size + * (in bytes) is returned to the caller. If this API has not been + * called, then the molfile plugin should revert to standard + * kernel-buffered I/O and suffer the associated performance loss. + * The caller can be assured that the plugin will not request any + * page alignment size that is greater than the value of + * MOLFILE_DIRECTIO_MAX_BLOCK_SIZE, both as a runtime sanity check, + * and to ensure that a caller that is unable to perform the max + * aligned allocation doesn't call the API in the first place. + * If a page-aligned allocation is not required for the file being read, + * the plugin will return an alignment size of 1. + */ +#if vmdplugin_ABIVERSION > 17 + int (* read_timestep_pagealign_size)(void *, int *pagealignsize); +#endif + + /** * Read the next timestep from the file. Return MOLFILE_SUCCESS, or * MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t - * arguments are nullptr, then the coordinate or qm data should be skipped. + * arguments are NULL, then the coordinate or qm data should be skipped. * Otherwise, the application must prepare molfile_timestep_t and * molfile_qm_timestep_t by allocating space for the corresponding * number of coordinates, orbital wavefunction coefficients, etc. * Since it is common for users to want to load only the final timestep * data from a QM run, the application may provide any combination of - * valid, or nullptr pointers for the molfile_timestep_t and + * valid, or NULL pointers for the molfile_timestep_t and * molfile_qm_timestep_t parameters, depending on what information the * user is interested in. * The natoms and qm metadata parameters exist because some file formats @@ -862,6 +930,25 @@ typedef struct { int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *); int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *); + +#if defined(EXPERIMENTAL_DIRECTIO_APIS) + /** + * Calculate file offsets and I/O lengths for performing + * kernel-bypass direct I/O or using GPU-Direct Storage APIs, + * thereby enabling peak I/O rates to be achieved for analysis + * worksloads like clustering of trajectories. + */ + int (* calc_fileoffsets_timestep)(void *, + molfile_ssize_t frameindex, + int firstatom, + int lastatom, + int *firstatom, + int *pageoffset, + molfile_ssize_t *startoffset, + molfile_ssize_t *readlen); +#endif + + #if defined(DESRES_READ_TIMESTEP2) /** * Read a specified timestep! @@ -886,9 +973,9 @@ typedef struct { * caller the ability to prioritize, buffer, and redirect console messages * to an appropriate output channel, window, etc. This enables the use of * graphical consoles like TkCon without losing console output from plugins. - * If the function pointer is nullptr, no console output service is provided + * If the function pointer is NULL, no console output service is provided * by the calling application, and the output should default to stdout - * stream. If the function pointer is non-nullptr, all output will be + * stream. If the function pointer is non-NULL, all output will be * subsequently dealt with by the calling application. * * XXX this should really be put into a separate block of diff --git a/lib/molfile/vmdplugin.h b/lib/molfile/vmdplugin.h index 842d1e431..7afc358e9 100644 --- a/lib/molfile/vmdplugin.h +++ b/lib/molfile/vmdplugin.h @@ -11,7 +11,7 @@ * * $RCSfile: vmdplugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.33 $ $Date: 2015/10/29 05:10:54 $ + * $Revision: 1.34 $ $Date: 2018/05/02 03:12:56 $ * ***************************************************************************/ @@ -144,7 +144,7 @@ typedef struct { /** * Use this macro to initialize the abiversion member of each plugin */ -#define vmdplugin_ABIVERSION 17 +#define vmdplugin_ABIVERSION 18 /*@{*/ /** Use this macro to indicate a plugin's thread-safety at registration time */ -- GitLab From 93a0d4c096d15ef7953565924b24958e24528a07 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 14:26:34 -0400 Subject: [PATCH 21/52] fix up some comments --- src/BODY/body_rounded_polygon.cpp | 2 +- src/BODY/body_rounded_polyhedron.cpp | 2 +- src/BODY/fix_wall_body_polygon.cpp | 2 +- src/BODY/fix_wall_body_polyhedron.cpp | 2 +- src/BODY/pair_body_rounded_polyhedron.cpp | 2 +- src/GPU/pppm_gpu.cpp | 2 +- src/GRANULAR/fix_wall_gran.cpp | 4 ++-- src/GRANULAR/fix_wall_gran.h | 2 +- src/GRANULAR/pair_gran_hooke_history.h | 2 +- src/GRANULAR/pair_granular.h | 2 +- src/KIM/fix_store_kim.h | 4 ++-- src/KIM/kim_interactions.cpp | 2 +- src/KOKKOS/atom_kokkos.cpp | 2 +- src/KOKKOS/pair_kokkos.h | 2 +- src/LATTE/fix_latte.cpp | 2 +- src/MISC/dump_xtc.cpp | 2 +- src/USER-DPD/pair_multi_lucy.cpp | 2 +- src/USER-DPD/pair_multi_lucy_rx.cpp | 2 +- src/USER-PHONON/fix_phonon.cpp | 2 +- src/atom.cpp | 4 ++-- src/atom.h | 2 +- src/comm.cpp | 12 ++++++------ src/compute_chunk_atom.h | 2 +- src/dump.cpp | 2 +- src/error.cpp | 8 ++++---- src/fix_property_atom.cpp | 2 +- src/input.cpp | 4 ++-- src/modify.cpp | 2 +- src/neighbor.cpp | 2 +- src/output.h | 2 +- src/pair_table.cpp | 2 +- src/read_dump.cpp | 8 ++++---- src/utils.cpp | 2 +- src/utils.h | 4 ++-- 34 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index f2e798c93..c7d006c67 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -321,7 +321,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index b647c7e54..423a3b344 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -373,7 +373,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 99ae8ed09..2e69f70af 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 2507b94d2..472fe5fb2 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index 1d7461199..a3cffef9c 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -1880,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be nullptr) for face-edge intersection + q2 = another point (can be a null pointer) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 9b753edd6..a2e3e3ab9 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -117,7 +117,7 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to nullptr + // if do this, make sure to set them to a null pointer destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 25d271be9..9482aae3e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -416,7 +416,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be nullptr for wallstyle = REGION + // history_one will be a null pointer for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 1b3be22e7..a81a4c787 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index dd9a84314..c27ce8a9a 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index ce417812d..7ef4f2af9 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 4e4890ea6..577505687 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or nullptr - void *user_units; // string of unit conversion target or nullptr + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; } diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 755121607..c5ae2ec38 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -108,7 +108,7 @@ void KimInteractions::do_setup(int narg, char **arg) // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as nullptr. + // validate model name if not given as null pointer. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index ed0cfccd4..e9093ee0a 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to nullptr + free memory for vector and name and set ptrs to a null pointer ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 1eaf20ead..cb55dd314 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -94,7 +94,7 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations nullptr which are destructed by the PairStyle + // Call cleanup_copy which sets allocations to null which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 0581f1e35..055e62c41 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,7 +74,7 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // nullptr means LATTE will compute Coulombic potential + // null pointer means LATTE will compute Coulombic potential coulomb = 0; id_pe = nullptr; diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 5c3ca7264..35cca3287 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -137,7 +137,7 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to nullptr so parent dump class will not use it + // set fp to a null pointer so parent dump class will not use it fp = nullptr; if (me == 0) diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 2e556d82e..a266e94cc 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -582,7 +582,7 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index e56743ea1..d8356d20c 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -727,7 +727,7 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index c80073f3c..d8900d234 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because nullptr buffer will result in error for MPI + // allocate variables; MAX(1,... is used because a null buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); diff --git a/src/atom.cpp b/src/atom.cpp index 539bf6fc0..e140d2e47 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find nullptr: + // if find null pointer: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find nullptr: + // if don't find null pointer: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) diff --git a/src/atom.h b/src/atom.h index 841d224d2..4ea4157fa 100644 --- a/src/atom.h +++ b/src/atom.h @@ -55,7 +55,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, nullptr if unset + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable diff --git a/src/comm.cpp b/src/comm.cpp index becb52df9..32a415229 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -888,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -925,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -967,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1032,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1074,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1135,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 14c86383b..392179043 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // nullptr if no lock currently in place + // null pointer if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/dump.cpp b/src/dump.cpp index 3f1e997d1..2259f9ef3 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -202,7 +202,7 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to nullptr since it closes file in its destructor + // XTC style sets fp to a null pointer since it closes file in its destructor if (multifile == 0 && fp != nullptr) { if (compressed) { diff --git a/src/error.cpp b/src/error.cpp index d89ea5b68..fff3072bb 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -69,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -95,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -143,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -192,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 35ac20e37..e6ed9ea02 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -152,7 +152,7 @@ FixPropertyAtom::~FixPropertyAtom() if (border) atom->delete_callback(id,2); // deallocate per-atom vectors in Atom class - // set ptrs to nullptr, so they no longer exist for Atom class + // set ptrs to a null pointer, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { diff --git a/src/input.cpp b/src/input.cpp index 5e40d2ded..4539dfabf 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -338,7 +338,7 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return nullptr + // if no command, just return a null pointer parse(); if (command == nullptr) return nullptr; @@ -450,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or nullptr if no word in string + return ptr to start of word or null pointer if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index a908cfc7a..0f0a86cdd 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to nullptr in case new fix scans list of fixes, + // set ptr to a null pointer in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 26e7d6b74..db67f7154 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -378,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-nullptr pointer if there is only one substyle of the kind. + // will only return a non-null pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; diff --git a/src/output.h b/src/output.h index 6a64e67c9..1af03df22 100644 --- a/src/output.h +++ b/src/output.h @@ -29,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, nullptr if every + char *var_thermo; // variable name for thermo freq, null pointer if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations diff --git a/src/pair_table.cpp b/src/pair_table.cpp index c0fad544d..a92d2e491 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -821,7 +821,7 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index dcbb95fcc..426d0f5a9 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid nullptr + newmaxnew = MAX(newmaxnew,1); // avoid null pointer memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); diff --git a/src/utils.cpp b/src/utils.cpp index e985f9e6e..b0928fd18 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -171,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is nullptr + if (s) *s = '\0'; // truncate string to empty in case error is null pointer } return; } diff --git a/src/utils.h b/src/utils.h index cf8952b8a..c9e958365 100644 --- a/src/utils.h +++ b/src/utils.h @@ -60,7 +60,7 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfgets(const char *srcname, int srcline, char *s, int size, @@ -75,7 +75,7 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfread(const char *srcname, int srcline, void *s, size_t size, -- GitLab From eda04dac984f585ca0ede9f4c79b119e480abc30 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 15:13:23 -0400 Subject: [PATCH 22/52] update conventions and guidelines about C++ standard and requirements --- .github/CONTRIBUTING.md | 1 + doc/github-development-workflow.md | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b61a75351..60fe82d86 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -67,6 +67,7 @@ How quickly your contribution will be integrated depends largely on how much eff Here is a checklist of steps you need to follow to submit a single file or user package for our consideration. Following these steps will save both you and us time. See existing files in packages in the source directory for examples. If you are uncertain, please ask on the lammps-users mailing list. +* C++ source code must be compatible with the C++-11 standard. Packages may require a later standard, if justified. * All source files you provide must compile with the most current version of LAMMPS with multiple configurations. In particular you need to test compiling LAMMPS from scratch with `-DLAMMPS_BIGBIG` set in addition to the default `-DLAMMPS_SMALLBIG` setting. Your code will need to work correctly in serial and in parallel using MPI. * For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no trailing whitespace, no lines over 80 characters. I/O is done via the C-style stdio library, style class header files should not import any system headers, STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. There MUST NOT be any "using namespace XXX;" statements in headers. In the implementation file (.cpp) system includes should be placed in angular brackets (<>) and for c-library functions the C++ style header files should be included ( instead of , or instead of ). This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages. * Source, style name, and documentation file should follow the following naming convention: style names should be lowercase and words separated by a forward slash; for a new fix style 'foo/bar', the class should be named FixFooBar, the name of the source files should be 'fix_foo_bar.h' and 'fix_foo_bar.cpp' and the corresponding documentation should be in a file 'fix_foo_bar.rst'. diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index fd38c983a..a7d41dd32 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -136,7 +136,8 @@ Here are some items to check: * string.h -> cstring * time.h -> ctime * Do NOT replace (as they are C++-11): `inttypes.h` and `stdint.h`. - * Code should follow the C++-98 standard. C++-11 is only accepted + * Code must follow the C++-11 standard. C++98-only is no longer accepted + * Code should use `nullptr` instead of `NULL` where applicable. in individual special purpose packages * indentation is 2 spaces per level * there should be NO tabs and no trailing whitespace (review the "checkstyle" test on pull requests) @@ -145,6 +146,8 @@ Here are some items to check: Forward declarations should be used instead when possible. * iostreams should be avoided. LAMMPS uses stdio from the C-library. * use of STL in headers and class definitions should be avoided. + exception is , but it won't need to be explicitly included + since pointers.h already includes it. so std::string can be used directly. * there MUST NOT be any "using namespace XXX;" statements in headers. * static class members should be avoided at all cost. * anything storing atom IDs should be using `tagint` and not `int`. @@ -152,6 +155,8 @@ Here are some items to check: compiling LAMMPS with `-DLAMMPS_BIGBIG`. * when including both `lmptype.h` (and using defines or macros from it) and `mpi.h`, `lmptype.h` must be included first. + * see https://github.com/lammps/lammps/blob/master/doc/include-file-conventions.md + for general include file conventions and best practices * when pair styles are added, check if settings for flags like `single_enable`, `writedata`, `reinitflag`, `manybody_flag` and others are correctly set and supported. -- GitLab From da0cdb0de42bcd06c6367a719402d7a4303b49fc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 19:06:30 -0400 Subject: [PATCH 23/52] update formatting of keyword summary --- doc/src/fix_qeq_reax.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_qeq_reax.rst b/doc/src/fix_qeq_reax.rst index 512c596b4..8752888c4 100644 --- a/doc/src/fix_qeq_reax.rst +++ b/doc/src/fix_qeq_reax.rst @@ -20,8 +20,14 @@ Syntax * cutlo,cuthi = lo and hi cutoff for Taper radius * tolerance = precision to which charges will be equilibrated * params = reax/c or a filename -* args = *dual* (optional) -* args = *maxiter value* (optional) +* one or more keywords or keyword/value pairs may be appended + + .. parsed-literal:: + + keyword = *dual* or *maxiter* + *dual* = process S and T matrix in parallel (only for qeq/reax/omp) + *maxiter* N = limit the number of iterations to *N* + Examples """""""" -- GitLab From b702298e83ba964a5ef479fe7a8ce63f9543c51e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 19:06:58 -0400 Subject: [PATCH 24/52] fix typo --- doc/src/fix_nh.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_nh.rst b/doc/src/fix_nh.rst index 84b497dc3..988a147ab 100644 --- a/doc/src/fix_nh.rst +++ b/doc/src/fix_nh.rst @@ -51,7 +51,7 @@ Syntax *couple* = *none* or *xyz* or *xy* or *yz* or *xz* *tchain* value = N N = length of thermostat chain (1 = single thermostat) - *pchain* values = N + *pchain* value = N N length of thermostat chain on barostat (0 = no thermostat) *mtk* value = *yes* or *no* = add in MTK adjustment term or not *tloop* value = M -- GitLab From 3655919c7c837a06a8731da9387d6da2ae1dae77 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 09:09:22 -0400 Subject: [PATCH 25/52] tweak minimize summary output format --- src/finish.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/finish.cpp b/src/finish.cpp index 3bfe3a7bb..c48027fea 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -202,12 +202,12 @@ void Finish::end(int flag) update->minimize->einitial, update->minimize->eprevious, update->minimize->efinal); - mesg += fmt::format(" Force two-norm initial, final = {} {}\n", + mesg += fmt::format(" Force two-norm initial, final = {:.8} {:.8}\n", update->minimize->fnorm2_init,update->minimize->fnorm2_final); - mesg += fmt::format(" Force max component initial, final = {} {}\n", + mesg += fmt::format(" Force max component initial, final = {:.8} {:.8}\n", update->minimize->fnorminf_init, update->minimize->fnorminf_final); - mesg += fmt::format(" Final line search alpha, max atom move = {} {}\n", + mesg += fmt::format(" Final line search alpha, max atom move = {:.8} {:.8}\n", update->minimize->alpha_final, update->minimize->alpha_final* update->minimize->fnorminf_final); -- GitLab From a5740d75cf055cc614e3d27ffff19a0cd3b96d7a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 09:27:49 -0400 Subject: [PATCH 26/52] add missing option --- doc/src/min_modify.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/min_modify.rst b/doc/src/min_modify.rst index e541571b7..731d2ace6 100644 --- a/doc/src/min_modify.rst +++ b/doc/src/min_modify.rst @@ -19,7 +19,7 @@ Syntax max = maximum distance for line search to move (distance units) *line* value = *backtrack* or *quadratic* or *forcezero* or *spin_cubic* or *spin_none* backtrack,quadratic,forcezero,spin_cubic,spin_none = style of linesearch to use - *norm* value = *two* or *max* + *norm* value = *two* or *inf* or *max* two = Euclidean two-norm (length of 3N vector) inf = max force component across all 3-vectors max = max force norm across all 3-vectors -- GitLab From 9a5d8fd18b2969afaa2767d710b71e76e1875e3d Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 07:39:46 -0600 Subject: [PATCH 27/52] Manually resolve two rebase conflicts. --- lib/atc/ATC_Coupling.cpp | 50 +-- lib/atc/ATC_Coupling.h | 24 +- lib/atc/ATC_CouplingEnergy.cpp | 6 +- lib/atc/ATC_CouplingMomentumEnergy.cpp | 6 +- lib/atc/ATC_Method.cpp | 52 +-- lib/atc/ATC_Method.h | 2 +- lib/atc/ATC_Transfer.cpp | 22 +- lib/atc/Array.h | 28 +- lib/atc/Array2D.h | 20 +- lib/atc/AtomicRegulator.cpp | 36 +- lib/atc/AtomicRegulator.h | 2 +- lib/atc/CauchyBorn.cpp | 2 +- lib/atc/ChargeRegulator.cpp | 2 +- lib/atc/CloneVector.h | 6 +- lib/atc/ConcentrationRegulator.cpp | 8 +- lib/atc/DenseMatrix.h | 12 +- lib/atc/DenseVector.h | 8 +- lib/atc/DiagonalMatrix.h | 6 +- lib/atc/DislocationExtractor.h | 16 +- lib/atc/ElasticTimeIntegrator.cpp | 10 +- lib/atc/ElectronHeatFlux.h | 10 +- lib/atc/ExtrinsicModel.cpp | 6 +- lib/atc/ExtrinsicModelDriftDiffusion.cpp | 10 +- lib/atc/ExtrinsicModelElectrostatic.cpp | 10 +- lib/atc/ExtrinsicModelTwoTemperature.cpp | 4 +- lib/atc/FE_Element.cpp | 2 +- lib/atc/FE_Engine.cpp | 2 +- lib/atc/FE_Engine.h | 22 +- lib/atc/FE_Mesh.cpp | 12 +- lib/atc/FieldEulerIntegrator.cpp | 2 +- lib/atc/FieldManager.cpp | 2 +- lib/atc/FieldManager.h | 14 +- lib/atc/Function.cpp | 12 +- lib/atc/FundamentalAtomicQuantity.cpp | 2 +- lib/atc/FundamentalAtomicQuantity.h | 4 +- lib/atc/GhostManager.cpp | 26 +- lib/atc/InterscaleOperators.cpp | 8 +- lib/atc/InterscaleOperators.h | 4 +- lib/atc/KD_Tree.cpp | 14 +- lib/atc/KernelFunction.cpp | 6 +- lib/atc/KinetoThermostat.cpp | 48 +-- lib/atc/Kinetostat.cpp | 44 +-- lib/atc/LammpsInterface.cpp | 38 +-- lib/atc/LammpsInterface.h | 2 +- lib/atc/LinearSolver.cpp | 16 +- lib/atc/LinearSolver.h | 4 +- lib/atc/Material.cpp | 36 +- lib/atc/MoleculeSet.h | 8 +- lib/atc/NonLinearSolver.h | 2 +- lib/atc/OutputManager.cpp | 24 +- lib/atc/OutputManager.h | 6 +- lib/atc/PaqAtcUtility.cpp | 2 +- lib/atc/ParDenseMatrix.h | 2 +- lib/atc/ParSparseMatrix.cpp | 8 +- lib/atc/ParSparseMatrix.h | 6 +- lib/atc/PerAtomQuantity-inl.h | 10 +- lib/atc/PerAtomQuantity.h | 8 +- lib/atc/PerAtomQuantityLibrary.h | 130 +++---- lib/atc/PerPairQuantity.cpp | 2 +- lib/atc/PhysicsModel.h | 2 +- lib/atc/PoissonSolver.cpp | 6 +- lib/atc/PrescribedDataManager.cpp | 26 +- lib/atc/Quadrature.cpp | 6 +- lib/atc/SchrodingerSolver.cpp | 2 +- lib/atc/SparseMatrix-inl.h | 16 +- lib/atc/SparseVector.h | 2 +- lib/atc/SpeciesTimeIntegrator.cpp | 4 +- lib/atc/SpeciesTimeIntegrator.h | 2 +- lib/atc/Stress.cpp | 6 +- lib/atc/Stress.h | 2 +- lib/atc/ThermalTimeIntegrator.cpp | 4 +- lib/atc/Thermostat.cpp | 56 +-- lib/atc/TimeFilter.cpp | 2 +- lib/atc/TimeIntegrator.cpp | 12 +- lib/atc/TransferLibrary.cpp | 10 +- lib/atc/TransferLibrary.h | 34 +- lib/atc/TransferOperator.h | 6 +- lib/atc/Utility.h | 2 +- lib/awpmd/ivutils/include/logexc.h | 8 +- lib/awpmd/ivutils/include/pairhash.h | 28 +- lib/awpmd/ivutils/include/refobj.h | 20 +- lib/awpmd/ivutils/include/vector_3.h | 14 +- lib/awpmd/ivutils/src/logexc.cpp | 2 +- lib/awpmd/systems/interact/TCP/wpmd.h | 20 +- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 4 +- lib/awpmd/systems/interact/TCP/wpmd_split.h | 16 +- lib/colvars/colvar.cpp | 20 +- lib/colvars/colvaratoms.cpp | 8 +- lib/colvars/colvarbias.cpp | 26 +- lib/colvars/colvarbias.h | 4 +- lib/colvars/colvarbias_abf.cpp | 42 +-- lib/colvars/colvarbias_histogram.cpp | 4 +- lib/colvars/colvarbias_meta.cpp | 46 +-- lib/colvars/colvarcomp.cpp | 8 +- lib/colvars/colvarcomp_coordnums.cpp | 38 +-- lib/colvars/colvarcomp_distances.cpp | 2 +- lib/colvars/colvardeps.cpp | 2 +- lib/colvars/colvargrid.cpp | 14 +- lib/colvars/colvarmodule.cpp | 60 ++-- lib/colvars/colvarmodule.h | 6 +- lib/colvars/colvarparams.cpp | 6 +- lib/colvars/colvarparse.cpp | 10 +- lib/colvars/colvarparse.h | 8 +- lib/colvars/colvarproxy.cpp | 16 +- lib/colvars/colvarproxy.h | 2 +- lib/colvars/colvarscript.cpp | 20 +- lib/colvars/colvarscript.h | 2 +- lib/colvars/colvartypes.h | 4 +- lib/colvars/lepton/include/lepton/Operation.h | 12 +- lib/colvars/lepton/src/CompiledExpression.cpp | 8 +- lib/colvars/lepton/src/ExpressionTreeNode.cpp | 8 +- lib/colvars/lepton/src/ParsedExpression.cpp | 2 +- lib/gpu/cudpp_mini/cudpp.cpp | 14 +- lib/gpu/cudpp_mini/cudpp_plan.cpp | 2 +- lib/gpu/cudpp_mini/cudpp_plan_manager.cpp | 22 +- lib/gpu/cudpp_mini/cutil.h | 20 +- lib/gpu/geryon/hip_device.h | 4 +- lib/gpu/geryon/hip_kernel.h | 8 +- lib/gpu/geryon/hip_memory.h | 6 +- lib/gpu/geryon/hip_texture.h | 2 +- lib/gpu/geryon/nvd_kernel.h | 10 +- lib/gpu/geryon/nvd_memory.h | 6 +- lib/gpu/geryon/nvd_texture.h | 2 +- lib/gpu/geryon/ocl_device.h | 40 +-- lib/gpu/geryon/ocl_kernel.h | 26 +- lib/gpu/geryon/ocl_memory.h | 78 ++--- lib/gpu/geryon/ocl_timer.h | 6 +- lib/gpu/geryon/ucl_basemat.h | 4 +- lib/gpu/geryon/ucl_d_vec.h | 2 +- lib/gpu/lal_answer.cpp | 14 +- lib/gpu/lal_base_atomic.cpp | 10 +- lib/gpu/lal_base_charge.cpp | 10 +- lib/gpu/lal_base_dipole.cpp | 10 +- lib/gpu/lal_base_dpd.cpp | 10 +- lib/gpu/lal_base_ellipsoid.cpp | 16 +- lib/gpu/lal_base_three.cpp | 10 +- lib/gpu/lal_base_three.h | 2 +- lib/gpu/lal_device.cpp | 18 +- lib/gpu/lal_eam.cpp | 6 +- lib/gpu/lal_lj_tip4p_long.cpp | 4 +- lib/gpu/lal_neighbor.cpp | 2 +- lib/gpu/lal_pppm.cpp | 2 +- lib/gpu/lal_pppm_ext.cpp | 6 +- lib/gpu/lal_yukawa_colloid.cpp | 4 +- lib/kokkos/cmake/compile_tests/pthread.cpp | 6 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp | 2 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 2 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 2 +- lib/kokkos/core/unit_test/TestCTestDevice.cpp | 2 +- lib/message/cslib/src/STUBS_ZMQ/zmq.h | 6 +- lib/message/cslib/src/cslib.cpp | 28 +- lib/message/cslib/src/cslib_wrap.cpp | 2 +- lib/message/cslib/src/msg.cpp | 6 +- lib/message/cslib/src/msg_mpi_two.cpp | 2 +- lib/message/cslib/src/msg_zmq.cpp | 8 +- lib/molfile/molfile_plugin.h | 32 +- lib/poems/SystemProcessor.h | 30 +- lib/poems/poemsnodelib.h | 20 +- lib/poems/poemstree.h | 62 ++-- lib/poems/poemstreenode.cpp | 2 +- lib/poems/poemstreenode.h | 2 +- lib/poems/solver.cpp | 2 +- lib/poems/system.cpp | 10 +- lib/poems/workspace.cpp | 6 +- src/ASPHERE/compute_temp_asphere.cpp | 4 +- src/ASPHERE/pair_gayberne.cpp | 24 +- src/ASPHERE/pair_line_lj.cpp | 4 +- src/ASPHERE/pair_resquared.cpp | 16 +- src/ASPHERE/pair_tri_lj.cpp | 4 +- src/BODY/body_nparticle.cpp | 4 +- src/BODY/body_rounded_polygon.cpp | 2 +- src/BODY/body_rounded_polyhedron.cpp | 4 +- src/BODY/compute_body_local.cpp | 6 +- src/BODY/compute_temp_body.cpp | 4 +- src/BODY/fix_wall_body_polygon.cpp | 14 +- src/BODY/fix_wall_body_polyhedron.cpp | 18 +- src/BODY/pair_body_nparticle.cpp | 4 +- src/BODY/pair_body_rounded_polygon.cpp | 16 +- src/BODY/pair_body_rounded_polyhedron.cpp | 32 +- src/CLASS2/angle_class2.cpp | 26 +- src/CLASS2/bond_class2.cpp | 10 +- src/CLASS2/dihedral_class2.cpp | 78 ++--- src/CLASS2/improper_class2.cpp | 18 +- src/CLASS2/pair_lj_class2.cpp | 20 +- src/CLASS2/pair_lj_class2_coul_cut.cpp | 22 +- src/CLASS2/pair_lj_class2_coul_long.cpp | 32 +- src/COLLOID/pair_brownian.cpp | 32 +- src/COLLOID/pair_brownian_poly.cpp | 2 +- src/COLLOID/pair_colloid.cpp | 18 +- src/COLLOID/pair_lubricate.cpp | 26 +- src/COLLOID/pair_lubricateU.cpp | 28 +- src/COLLOID/pair_lubricateU_poly.cpp | 2 +- src/COLLOID/pair_lubricate_poly.cpp | 4 +- src/COMPRESS/dump_atom_gz.cpp | 12 +- src/COMPRESS/dump_cfg_gz.cpp | 12 +- src/COMPRESS/dump_custom_gz.cpp | 12 +- src/COMPRESS/dump_local_gz.cpp | 12 +- src/COMPRESS/dump_xyz_gz.cpp | 12 +- src/CORESHELL/compute_temp_cs.cpp | 4 +- src/CORESHELL/pair_born_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_buck_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_lj_class2_coul_long_cs.cpp | 2 +- src/CORESHELL/pair_lj_cut_coul_long_cs.cpp | 2 +- src/DIPOLE/pair_lj_cut_dipole_cut.cpp | 18 +- src/DIPOLE/pair_lj_cut_dipole_long.cpp | 20 +- src/DIPOLE/pair_lj_long_dipole_long.cpp | 32 +- src/GPU/fix_gpu.cpp | 4 +- src/GPU/pair_born_coul_long_cs_gpu.cpp | 2 +- src/GPU/pair_born_coul_long_gpu.cpp | 2 +- src/GPU/pair_buck_coul_long_gpu.cpp | 2 +- src/GPU/pair_colloid_gpu.cpp | 2 +- src/GPU/pair_coul_long_cs_gpu.cpp | 4 +- src/GPU/pair_coul_long_gpu.cpp | 4 +- src/GPU/pair_eam_alloy_gpu.cpp | 4 +- src/GPU/pair_eam_alloy_gpu.h | 2 +- src/GPU/pair_eam_fs_gpu.cpp | 4 +- src/GPU/pair_eam_fs_gpu.h | 2 +- src/GPU/pair_eam_gpu.cpp | 2 +- src/GPU/pair_eam_gpu.h | 2 +- src/GPU/pair_gayberne_gpu.cpp | 2 +- src/GPU/pair_lj96_cut_gpu.cpp | 2 +- src/GPU/pair_lj_charmm_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_class2_coul_long_gpu.cpp | 2 +- src/GPU/pair_lj_cut_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_cut_coul_msm_gpu.cpp | 2 +- src/GPU/pair_lj_cut_dipole_long_gpu.cpp | 4 +- src/GPU/pair_lj_cut_gpu.cpp | 2 +- src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 8 +- src/GPU/pair_lj_expand_coul_long_gpu.cpp | 4 +- src/GPU/pair_lj_sdk_coul_long_gpu.cpp | 4 +- src/GPU/pair_mie_cut_gpu.cpp | 2 +- src/GPU/pair_resquared_gpu.cpp | 2 +- src/GPU/pair_sw_gpu.cpp | 8 +- src/GPU/pair_table_gpu.cpp | 4 +- src/GPU/pair_tersoff_gpu.cpp | 12 +- src/GPU/pair_tersoff_mod_gpu.cpp | 12 +- src/GPU/pair_tersoff_zbl_gpu.cpp | 12 +- src/GPU/pair_ufm_gpu.cpp | 2 +- src/GPU/pair_vashishta_gpu.cpp | 12 +- src/GPU/pppm_gpu.cpp | 10 +- src/GRANULAR/fix_pour.cpp | 24 +- src/GRANULAR/fix_wall_gran.cpp | 18 +- src/GRANULAR/fix_wall_gran.h | 2 +- src/GRANULAR/fix_wall_gran_region.cpp | 16 +- src/GRANULAR/pair_gran_hooke_history.cpp | 22 +- src/GRANULAR/pair_gran_hooke_history.h | 2 +- src/GRANULAR/pair_granular.cpp | 40 +-- src/GRANULAR/pair_granular.h | 2 +- src/KIM/fix_store_kim.cpp | 14 +- src/KIM/fix_store_kim.h | 4 +- src/KIM/kim_init.cpp | 8 +- src/KIM/kim_interactions.cpp | 10 +- src/KIM/kim_param.cpp | 12 +- src/KIM/kim_property.cpp | 4 +- src/KIM/pair_kim.cpp | 44 +-- src/KOKKOS/atom_kokkos.cpp | 12 +- src/KOKKOS/atom_vec_angle_kokkos.cpp | 2 +- src/KOKKOS/atom_vec_kokkos.cpp | 2 +- src/KOKKOS/comm_kokkos.cpp | 14 +- src/KOKKOS/fft3d_kokkos.cpp | 52 +-- src/KOKKOS/fix_langevin_kokkos.cpp | 26 +- src/KOKKOS/fix_minimize_kokkos.cpp | 2 +- src/KOKKOS/fix_neigh_history_kokkos.cpp | 6 +- src/KOKKOS/fix_nve_kokkos.cpp | 4 +- src/KOKKOS/fix_nve_sphere_kokkos.cpp | 4 +- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 2 +- src/KOKKOS/fix_reaxc_bonds_kokkos.cpp | 2 +- src/KOKKOS/fix_reaxc_species_kokkos.cpp | 2 +- src/KOKKOS/fix_rx_kokkos.cpp | 12 +- src/KOKKOS/fix_rx_kokkos.h | 2 +- src/KOKKOS/fix_setforce_kokkos.cpp | 4 +- src/KOKKOS/fix_shardlow_kokkos.cpp | 8 +- src/KOKKOS/gridcomm_kokkos.cpp | 14 +- src/KOKKOS/kokkos.cpp | 2 +- src/KOKKOS/memory_kokkos.h | 26 +- src/KOKKOS/min_kokkos.cpp | 2 +- src/KOKKOS/neighbor_kokkos.cpp | 10 +- src/KOKKOS/pair_buck_coul_cut_kokkos.cpp | 16 +- src/KOKKOS/pair_buck_coul_long_kokkos.cpp | 24 +- src/KOKKOS/pair_buck_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_cut_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_debye_kokkos.cpp | 8 +- src/KOKKOS/pair_coul_long_kokkos.cpp | 16 +- src/KOKKOS/pair_eam_alloy_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_alloy_kokkos.h | 2 +- src/KOKKOS/pair_eam_fs_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_fs_kokkos.h | 2 +- src/KOKKOS/pair_eam_kokkos.h | 2 +- src/KOKKOS/pair_exp6_rx_kokkos.cpp | 12 +- src/KOKKOS/pair_gran_hooke_history_kokkos.cpp | 6 +- src/KOKKOS/pair_hybrid_kokkos.cpp | 2 +- src/KOKKOS/pair_kokkos.h | 2 +- ..._lj_charmm_coul_charmm_implicit_kokkos.cpp | 16 +- .../pair_lj_charmm_coul_charmm_kokkos.cpp | 16 +- .../pair_lj_charmm_coul_long_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp | 16 +- .../pair_lj_class2_coul_long_kokkos.cpp | 14 +- src/KOKKOS/pair_lj_class2_kokkos.cpp | 10 +- src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp | 18 +- src/KOKKOS/pair_lj_cut_kokkos.cpp | 14 +- src/KOKKOS/pair_lj_expand_kokkos.cpp | 10 +- .../pair_lj_gromacs_coul_gromacs_kokkos.cpp | 16 +- src/KOKKOS/pair_lj_gromacs_kokkos.cpp | 26 +- src/KOKKOS/pair_lj_sdk_kokkos.cpp | 10 +- src/KOKKOS/pair_morse_kokkos.cpp | 14 +- src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 4 +- src/KOKKOS/pair_reaxc_kokkos.cpp | 6 +- src/KOKKOS/pair_sw_kokkos.cpp | 4 +- src/KOKKOS/pair_table_kokkos.cpp | 10 +- src/KOKKOS/pair_table_rx_kokkos.cpp | 10 +- src/KOKKOS/pair_vashishta_kokkos.cpp | 4 +- src/KOKKOS/pair_yukawa_kokkos.cpp | 14 +- src/KOKKOS/pair_zbl_kokkos.cpp | 12 +- src/KOKKOS/pppm_kokkos.cpp | 52 +-- src/KOKKOS/rand_pool_wrap_kokkos.cpp | 4 +- src/KOKKOS/rand_pool_wrap_kokkos.h | 2 +- src/KOKKOS/remap_kokkos.cpp | 26 +- src/KSPACE/ewald.cpp | 24 +- src/KSPACE/ewald_dipole.cpp | 8 +- src/KSPACE/ewald_dipole_spin.cpp | 2 +- src/KSPACE/ewald_disp.cpp | 58 ++-- src/KSPACE/fft3d.cpp | 58 ++-- src/KSPACE/fft3d_wrap.cpp | 2 +- src/KSPACE/gridcomm.cpp | 12 +- src/KSPACE/kissfft.h | 6 +- src/KSPACE/msm.cpp | 84 ++--- src/KSPACE/msm_cg.cpp | 2 +- src/KSPACE/pair_born_coul_long.cpp | 38 +-- src/KSPACE/pair_born_coul_msm.cpp | 4 +- src/KSPACE/pair_buck_coul_long.cpp | 30 +- src/KSPACE/pair_buck_coul_msm.cpp | 4 +- src/KSPACE/pair_buck_long_coul_long.cpp | 42 +-- src/KSPACE/pair_coul_long.cpp | 24 +- src/KSPACE/pair_coul_msm.cpp | 2 +- src/KSPACE/pair_lj_charmm_coul_long.cpp | 34 +- src/KSPACE/pair_lj_charmm_coul_msm.cpp | 4 +- src/KSPACE/pair_lj_charmmfsw_coul_long.cpp | 34 +- src/KSPACE/pair_lj_cut_coul_long.cpp | 32 +- src/KSPACE/pair_lj_cut_coul_msm.cpp | 4 +- src/KSPACE/pair_lj_cut_tip4p_long.cpp | 36 +- src/KSPACE/pair_lj_long_coul_long.cpp | 40 +-- src/KSPACE/pair_lj_long_tip4p_long.cpp | 44 +-- src/KSPACE/pair_tip4p_long.cpp | 20 +- src/KSPACE/pppm.cpp | 66 ++-- src/KSPACE/pppm_cg.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 34 +- src/KSPACE/pppm_dipole_spin.cpp | 12 +- src/KSPACE/pppm_disp.cpp | 322 +++++++++--------- src/KSPACE/pppm_stagger.cpp | 2 +- src/KSPACE/remap.cpp | 28 +- src/KSPACE/remap_wrap.cpp | 2 +- src/LATTE/fix_latte.cpp | 12 +- src/MANYBODY/fix_qeq_comb.cpp | 10 +- src/MANYBODY/pair_adp.cpp | 40 +-- src/MANYBODY/pair_airebo.cpp | 14 +- src/MANYBODY/pair_airebo.h | 2 +- src/MANYBODY/pair_atm.cpp | 8 +- src/MANYBODY/pair_bop.cpp | 232 ++++++------- src/MANYBODY/pair_comb.cpp | 42 +-- src/MANYBODY/pair_comb3.cpp | 62 ++-- src/MANYBODY/pair_eam.cpp | 42 +-- src/MANYBODY/pair_eam_alloy.cpp | 2 +- src/MANYBODY/pair_eam_cd.cpp | 10 +- src/MANYBODY/pair_eam_cd.h | 2 +- src/MANYBODY/pair_eam_fs.cpp | 2 +- src/MANYBODY/pair_eim.cpp | 32 +- src/MANYBODY/pair_gw.cpp | 14 +- src/MANYBODY/pair_gw_zbl.cpp | 2 +- src/MANYBODY/pair_lcbop.cpp | 18 +- src/MANYBODY/pair_lcbop.h | 2 +- src/MANYBODY/pair_nb3b_harmonic.cpp | 12 +- src/MANYBODY/pair_polymorphic.cpp | 4 +- src/MANYBODY/pair_sw.cpp | 14 +- src/MANYBODY/pair_tersoff.cpp | 14 +- src/MANYBODY/pair_vashishta.cpp | 14 +- src/MANYBODY/pair_vashishta_table.cpp | 8 +- src/MC/fix_atom_swap.cpp | 14 +- src/MC/fix_bond_break.cpp | 4 +- src/MC/fix_bond_create.cpp | 14 +- src/MC/fix_bond_swap.cpp | 12 +- src/MC/fix_gcmc.cpp | 28 +- src/MC/fix_tfmc.cpp | 6 +- src/MC/fix_widom.cpp | 14 +- src/MC/pair_dsmc.cpp | 20 +- src/MESSAGE/fix_client_md.cpp | 2 +- src/MESSAGE/message.cpp | 2 +- src/MESSAGE/server_mc.cpp | 4 +- src/MESSAGE/server_md.cpp | 28 +- src/MISC/compute_ti.cpp | 12 +- src/MISC/dump_xtc.cpp | 50 +-- src/MISC/fix_deposit.cpp | 20 +- src/MISC/fix_efield.cpp | 12 +- src/MISC/fix_evaporate.cpp | 6 +- src/MISC/fix_gld.cpp | 4 +- src/MISC/fix_oneway.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 6 +- src/MISC/fix_orient_fcc.cpp | 8 +- src/MISC/fix_thermal_conductivity.cpp | 2 +- src/MISC/fix_ttm.cpp | 16 +- src/MISC/fix_viscosity.cpp | 2 +- src/MISC/pair_nm_cut.cpp | 22 +- src/MISC/pair_nm_cut_coul_cut.cpp | 26 +- src/MISC/pair_nm_cut_coul_long.cpp | 34 +- src/MISC/xdr_compat.cpp | 14 +- src/MLIAP/compute_mliap.cpp | 6 +- src/MLIAP/mliap_data.cpp | 8 +- src/MLIAP/mliap_data.h | 2 +- src/MLIAP/mliap_descriptor_snap.cpp | 20 +- src/MLIAP/mliap_model.cpp | 10 +- src/MLIAP/mliap_model_quadratic.h | 2 +- src/MOLECULE/angle_charmm.cpp | 8 +- src/MOLECULE/angle_cosine.cpp | 2 +- src/MOLECULE/angle_cosine_periodic.cpp | 6 +- src/MOLECULE/angle_cosine_squared.cpp | 8 +- src/MOLECULE/angle_harmonic.cpp | 8 +- src/MOLECULE/angle_table.cpp | 16 +- src/MOLECULE/atom_vec_angle.cpp | 2 +- src/MOLECULE/atom_vec_bond.cpp | 2 +- src/MOLECULE/atom_vec_full.cpp | 2 +- src/MOLECULE/atom_vec_molecular.cpp | 2 +- src/MOLECULE/bond_fene.cpp | 10 +- src/MOLECULE/bond_fene_expand.cpp | 10 +- src/MOLECULE/bond_gromos.cpp | 6 +- src/MOLECULE/bond_harmonic.cpp | 6 +- src/MOLECULE/bond_morse.cpp | 8 +- src/MOLECULE/bond_nonlinear.cpp | 8 +- src/MOLECULE/bond_quartic.cpp | 12 +- src/MOLECULE/bond_table.cpp | 16 +- src/MOLECULE/dihedral_charmm.cpp | 12 +- src/MOLECULE/dihedral_charmmfsw.cpp | 16 +- src/MOLECULE/dihedral_harmonic.cpp | 6 +- src/MOLECULE/dihedral_helix.cpp | 6 +- src/MOLECULE/dihedral_multi_harmonic.cpp | 10 +- src/MOLECULE/dihedral_opls.cpp | 8 +- src/MOLECULE/fix_cmap.cpp | 46 +-- src/MOLECULE/improper_cvff.cpp | 6 +- src/MOLECULE/improper_harmonic.cpp | 4 +- src/MOLECULE/improper_umbrella.cpp | 6 +- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 2 +- src/MOLECULE/pair_lj_charmm_coul_charmm.cpp | 24 +- .../pair_lj_charmmfsw_coul_charmmfsh.cpp | 22 +- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 40 +-- src/MOLECULE/pair_tip4p_cut.cpp | 22 +- src/MPIIO/dump_atom_mpiio.cpp | 2 +- src/MPIIO/dump_cfg_mpiio.cpp | 2 +- src/MPIIO/dump_custom_mpiio.cpp | 6 +- src/MPIIO/dump_xyz_mpiio.cpp | 4 +- src/MSCG/fix_mscg.cpp | 2 +- src/PERI/compute_damage_atom.cpp | 2 +- src/PERI/compute_dilatation_atom.cpp | 2 +- src/PERI/compute_plasticity_atom.cpp | 2 +- src/PERI/fix_peri_neigh.cpp | 38 +-- src/PERI/pair_peri_eps.cpp | 32 +- src/PERI/pair_peri_lps.cpp | 24 +- src/PERI/pair_peri_pmb.cpp | 20 +- src/PERI/pair_peri_ves.cpp | 34 +- src/POEMS/fix_poems.cpp | 44 +-- src/PYTHON/fix_python_move.cpp | 10 +- src/PYTHON/pair_python.cpp | 10 +- src/PYTHON/python_compat.h | 4 +- src/PYTHON/python_impl.cpp | 32 +- src/QEQ/fix_qeq.cpp | 56 +-- src/QEQ/fix_qeq_fire.cpp | 4 +- src/QEQ/fix_qeq_shielded.cpp | 4 +- src/QEQ/fix_qeq_slater.cpp | 6 +- src/REPLICA/compute_event_displace.cpp | 14 +- src/REPLICA/fix_event.cpp | 4 +- src/REPLICA/fix_hyper.cpp | 2 +- src/REPLICA/fix_hyper_global.cpp | 10 +- src/REPLICA/fix_hyper_local.cpp | 40 +-- src/REPLICA/fix_neb.cpp | 18 +- src/REPLICA/hyper.cpp | 8 +- src/REPLICA/neb.cpp | 8 +- src/REPLICA/prd.cpp | 22 +- src/REPLICA/tad.cpp | 16 +- src/REPLICA/temper.cpp | 2 +- src/REPLICA/verlet_split.cpp | 6 +- src/RIGID/compute_erotate_rigid.cpp | 2 +- src/RIGID/compute_ke_rigid.cpp | 2 +- src/RIGID/compute_rigid_local.cpp | 10 +- src/RIGID/fix_ehex.cpp | 12 +- src/RIGID/fix_rattle.cpp | 2 +- src/RIGID/fix_rigid.cpp | 56 +-- src/RIGID/fix_rigid_nh.cpp | 20 +- src/RIGID/fix_rigid_nh_small.cpp | 20 +- src/RIGID/fix_rigid_small.cpp | 54 +-- src/RIGID/fix_shake.cpp | 42 +-- src/SHOCK/fix_append_atoms.cpp | 10 +- src/SHOCK/fix_msst.cpp | 16 +- src/SHOCK/fix_nphug.cpp | 2 +- src/SHOCK/fix_wall_piston.cpp | 6 +- src/SNAP/compute_sna_atom.cpp | 12 +- src/SNAP/compute_snad_atom.cpp | 12 +- src/SNAP/compute_snap.cpp | 12 +- src/SNAP/compute_snav_atom.cpp | 12 +- src/SNAP/pair_snap.cpp | 34 +- src/SNAP/sna.cpp | 20 +- src/SPIN/compute_spin.cpp | 2 +- src/SPIN/fix_langevin_spin.cpp | 2 +- src/SPIN/fix_neb_spin.cpp | 24 +- src/SPIN/fix_nve_spin.cpp | 6 +- src/SPIN/fix_precession_spin.cpp | 4 +- src/SPIN/fix_setforce_spin.cpp | 6 +- src/SPIN/min_spin_cg.cpp | 2 +- src/SPIN/min_spin_lbfgs.cpp | 2 +- src/SPIN/neb_spin.cpp | 8 +- src/SPIN/pair_spin.cpp | 2 +- src/SPIN/pair_spin.h | 2 +- src/SPIN/pair_spin_dipole_cut.cpp | 10 +- src/SPIN/pair_spin_dipole_long.cpp | 12 +- src/SPIN/pair_spin_dmi.cpp | 26 +- src/SPIN/pair_spin_exchange.cpp | 20 +- src/SPIN/pair_spin_magelec.cpp | 20 +- src/SPIN/pair_spin_neel.cpp | 28 +- src/SRD/fix_srd.cpp | 42 +-- src/SRD/fix_wall_srd.cpp | 2 +- src/STUBS/mpi.h | 4 +- src/USER-ADIOS/dump_atom_adios.cpp | 2 +- src/USER-ADIOS/dump_custom_adios.cpp | 2 +- src/USER-ADIOS/reader_adios.cpp | 4 +- src/USER-ATC/fix_atc.cpp | 2 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 20 +- src/USER-BOCS/compute_pressure_bocs.cpp | 16 +- src/USER-BOCS/fix_bocs.cpp | 30 +- src/USER-CGDNA/bond_oxdna_fene.cpp | 6 +- src/USER-CGDNA/pair_oxdna2_coaxstk.cpp | 82 ++--- src/USER-CGDNA/pair_oxdna2_dh.cpp | 20 +- src/USER-CGDNA/pair_oxdna_coaxstk.cpp | 94 ++--- src/USER-CGDNA/pair_oxdna_excv.cpp | 40 +-- src/USER-CGDNA/pair_oxdna_hbond.cpp | 104 +++--- src/USER-CGDNA/pair_oxdna_stk.cpp | 86 ++--- src/USER-CGDNA/pair_oxdna_xstk.cpp | 100 +++--- src/USER-CGDNA/pair_oxrna2_stk.cpp | 98 +++--- src/USER-CGDNA/pair_oxrna2_xstk.cpp | 88 ++--- src/USER-CGSDK/angle_sdk.cpp | 8 +- src/USER-CGSDK/pair_lj_sdk.cpp | 20 +- src/USER-CGSDK/pair_lj_sdk_coul_long.cpp | 32 +- src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp | 4 +- src/USER-COLVARS/colvarproxy_lammps.cpp | 4 +- src/USER-COLVARS/fix_colvars.cpp | 26 +- src/USER-COLVARS/group_ndx.cpp | 2 +- src/USER-COLVARS/ndx_group.cpp | 34 +- src/USER-DIFFRACTION/compute_saed.cpp | 2 +- src/USER-DIFFRACTION/compute_xrd.cpp | 2 +- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 18 +- src/USER-DPD/compute_dpd_atom.cpp | 2 +- src/USER-DPD/fix_dpd_energy.cpp | 6 +- src/USER-DPD/fix_eos_table.cpp | 20 +- src/USER-DPD/fix_eos_table_rx.cpp | 42 +-- src/USER-DPD/fix_rx.cpp | 98 +++--- src/USER-DPD/fix_shardlow.cpp | 16 +- src/USER-DPD/npair_half_bin_newton_ssa.cpp | 6 +- src/USER-DPD/pair_dpd_fdt.cpp | 18 +- src/USER-DPD/pair_dpd_fdt_energy.cpp | 22 +- src/USER-DPD/pair_exp6_rx.cpp | 50 +-- src/USER-DPD/pair_multi_lucy.cpp | 36 +- src/USER-DPD/pair_multi_lucy_rx.cpp | 44 +-- src/USER-DPD/pair_table_rx.cpp | 14 +- src/USER-DRUDE/compute_temp_drude.cpp | 6 +- src/USER-DRUDE/fix_drude.cpp | 12 +- src/USER-DRUDE/fix_drude_transform.cpp | 4 +- src/USER-DRUDE/fix_langevin_drude.cpp | 12 +- src/USER-DRUDE/pair_lj_cut_thole_long.cpp | 40 +-- src/USER-DRUDE/pair_thole.cpp | 20 +- src/USER-EFF/compute_ke_atom_eff.cpp | 2 +- src/USER-EFF/compute_temp_deform_eff.cpp | 2 +- src/USER-EFF/compute_temp_region_eff.cpp | 2 +- src/USER-EFF/fix_langevin_eff.cpp | 4 +- src/USER-EFF/pair_eff_cut.cpp | 14 +- src/USER-FEP/compute_fep.cpp | 24 +- src/USER-FEP/fix_adapt_fep.cpp | 16 +- src/USER-FEP/pair_coul_cut_soft.cpp | 18 +- src/USER-FEP/pair_coul_long_soft.cpp | 18 +- .../pair_lj_charmm_coul_long_soft.cpp | 36 +- src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp | 32 +- .../pair_lj_class2_coul_long_soft.cpp | 32 +- src/USER-FEP/pair_lj_class2_soft.cpp | 24 +- src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp | 32 +- src/USER-FEP/pair_lj_cut_coul_long_soft.cpp | 34 +- src/USER-FEP/pair_lj_cut_soft.cpp | 26 +- src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp | 32 +- src/USER-FEP/pair_morse_soft.cpp | 22 +- src/USER-FEP/pair_tip4p_long_soft.cpp | 20 +- src/USER-H5MD/dump_h5md.cpp | 40 +-- src/USER-INTEL/angle_charmm_intel.h | 2 +- src/USER-INTEL/angle_harmonic_intel.h | 2 +- src/USER-INTEL/bond_fene_intel.h | 2 +- src/USER-INTEL/bond_harmonic_intel.h | 2 +- src/USER-INTEL/dihedral_charmm_intel.h | 2 +- src/USER-INTEL/dihedral_fourier_intel.h | 2 +- src/USER-INTEL/dihedral_harmonic_intel.h | 2 +- src/USER-INTEL/dihedral_opls_intel.h | 2 +- src/USER-INTEL/fix_intel.cpp | 20 +- src/USER-INTEL/fix_intel.h | 4 +- src/USER-INTEL/improper_cvff_intel.h | 2 +- src/USER-INTEL/improper_harmonic_intel.h | 2 +- src/USER-INTEL/intel_buffers.cpp | 40 +-- src/USER-INTEL/intel_buffers.h | 4 +- src/USER-INTEL/intel_preprocess.h | 2 +- src/USER-INTEL/nbin_intel.cpp | 4 +- src/USER-INTEL/npair_full_bin_ghost_intel.cpp | 4 +- src/USER-INTEL/npair_intel.cpp | 4 +- src/USER-INTEL/pair_airebo_intel.cpp | 18 +- src/USER-INTEL/pair_buck_coul_cut_intel.cpp | 8 +- src/USER-INTEL/pair_buck_coul_cut_intel.h | 2 +- src/USER-INTEL/pair_buck_coul_long_intel.cpp | 16 +- src/USER-INTEL/pair_buck_coul_long_intel.h | 2 +- src/USER-INTEL/pair_buck_intel.cpp | 8 +- src/USER-INTEL/pair_buck_intel.h | 2 +- src/USER-INTEL/pair_dpd_intel.cpp | 2 +- src/USER-INTEL/pair_dpd_intel.h | 2 +- src/USER-INTEL/pair_eam_alloy_intel.cpp | 2 +- src/USER-INTEL/pair_eam_fs_intel.cpp | 2 +- src/USER-INTEL/pair_eam_intel.h | 2 +- src/USER-INTEL/pair_gayberne_intel.cpp | 16 +- src/USER-INTEL/pair_gayberne_intel.h | 2 +- .../pair_lj_charmm_coul_charmm_intel.cpp | 8 +- .../pair_lj_charmm_coul_charmm_intel.h | 2 +- .../pair_lj_charmm_coul_long_intel.cpp | 14 +- .../pair_lj_charmm_coul_long_intel.h | 2 +- .../pair_lj_cut_coul_long_intel.cpp | 18 +- src/USER-INTEL/pair_lj_cut_coul_long_intel.h | 2 +- src/USER-INTEL/pair_lj_cut_intel.cpp | 2 +- src/USER-INTEL/pair_lj_cut_intel.h | 2 +- .../pair_lj_long_coul_long_intel.cpp | 2 +- src/USER-INTEL/pair_sw_intel.cpp | 8 +- src/USER-INTEL/pair_sw_intel.h | 2 +- src/USER-INTEL/pair_tersoff_intel.cpp | 8 +- src/USER-INTEL/pair_tersoff_intel.h | 2 +- src/USER-INTEL/pppm_disp_intel.cpp | 24 +- src/USER-INTEL/pppm_intel.cpp | 6 +- src/USER-INTEL/verlet_lrt_intel.cpp | 10 +- src/USER-LB/fix_lb_fluid.cpp | 46 +-- src/USER-LB/fix_lb_pc.cpp | 6 +- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 4 +- src/USER-LB/fix_lb_viscous.cpp | 2 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.h | 4 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.h | 4 +- src/USER-MANIFOLD/manifold.h | 2 +- src/USER-MANIFOLD/manifold_factory.cpp | 2 +- src/USER-MANIFOLD/manifold_factory.h | 2 +- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 2 +- src/USER-MANIFOLD/manifold_thylakoid.cpp | 4 +- src/USER-MANIFOLD/manifold_thylakoid.h | 2 +- src/USER-MEAMC/meam_impl.cpp | 10 +- src/USER-MEAMC/meam_setup_done.cpp | 16 +- src/USER-MEAMC/pair_meamc.cpp | 26 +- src/USER-MESODPD/compute_edpd_temp_atom.cpp | 2 +- src/USER-MESODPD/compute_tdpd_cc_atom.cpp | 2 +- src/USER-MESODPD/pair_edpd.cpp | 30 +- src/USER-MESODPD/pair_mdpd.cpp | 22 +- src/USER-MESODPD/pair_tdpd.cpp | 28 +- src/USER-MESONT/compute_mesont.cpp | 6 +- src/USER-MESONT/pair_mesocnt.cpp | 8 +- src/USER-MESONT/pair_mesont_tpm.cpp | 18 +- src/USER-MGPT/mgpt_readpot.cpp | 6 +- src/USER-MGPT/mgpt_readpot.h | 6 +- src/USER-MGPT/pair_mgpt.cpp | 6 +- src/USER-MISC/angle_cosine_shift.cpp | 10 +- src/USER-MISC/angle_cosine_shift_exp.cpp | 24 +- src/USER-MISC/angle_dipole.cpp | 8 +- src/USER-MISC/angle_fourier.cpp | 16 +- src/USER-MISC/angle_fourier_simple.cpp | 12 +- src/USER-MISC/angle_quartic.cpp | 8 +- src/USER-MISC/bond_harmonic_shift.cpp | 6 +- src/USER-MISC/bond_harmonic_shift_cut.cpp | 6 +- src/USER-MISC/bond_special.cpp | 4 +- src/USER-MISC/compute_ackland_atom.cpp | 10 +- src/USER-MISC/compute_basal_atom.cpp | 10 +- src/USER-MISC/compute_cnp_atom.cpp | 4 +- src/USER-MISC/compute_entropy_atom.cpp | 4 +- src/USER-MISC/compute_gyration_shape.cpp | 2 +- .../compute_gyration_shape_chunk.cpp | 2 +- src/USER-MISC/compute_hma.cpp | 6 +- src/USER-MISC/compute_pressure_cylinder.cpp | 10 +- src/USER-MISC/compute_pressure_grem.cpp | 2 +- src/USER-MISC/compute_stress_mop.cpp | 14 +- src/USER-MISC/compute_stress_mop_profile.cpp | 16 +- src/USER-MISC/compute_temp_rotate.cpp | 2 +- src/USER-MISC/compute_viscosity_cos.cpp | 2 +- src/USER-MISC/dihedral_cosine_shift_exp.cpp | 10 +- src/USER-MISC/dihedral_fourier.cpp | 8 +- src/USER-MISC/dihedral_nharmonic.cpp | 4 +- src/USER-MISC/dihedral_quadratic.cpp | 4 +- src/USER-MISC/dihedral_spherical.cpp | 42 +-- src/USER-MISC/dihedral_table.cpp | 14 +- src/USER-MISC/dihedral_table_cut.cpp | 34 +- src/USER-MISC/fix_addtorque.cpp | 2 +- src/USER-MISC/fix_ave_correlate_long.cpp | 8 +- src/USER-MISC/fix_electron_stopping.cpp | 12 +- src/USER-MISC/fix_ffl.cpp | 6 +- src/USER-MISC/fix_filter_corotate.cpp | 32 +- src/USER-MISC/fix_gle.cpp | 26 +- src/USER-MISC/fix_grem.cpp | 8 +- src/USER-MISC/fix_imd.cpp | 72 ++-- src/USER-MISC/fix_ipi.cpp | 2 +- src/USER-MISC/fix_npt_cauchy.cpp | 18 +- src/USER-MISC/fix_orient_eco.cpp | 4 +- src/USER-MISC/fix_pafi.cpp | 4 +- src/USER-MISC/fix_pimd.cpp | 30 +- src/USER-MISC/fix_propel_self.cpp | 2 +- src/USER-MISC/fix_srp.cpp | 4 +- src/USER-MISC/fix_ti_spring.cpp | 2 +- src/USER-MISC/fix_ttm_mod.cpp | 16 +- src/USER-MISC/fix_wall_reflect_stochastic.cpp | 2 +- src/USER-MISC/improper_cossq.cpp | 4 +- src/USER-MISC/improper_distance.cpp | 4 +- src/USER-MISC/improper_fourier.cpp | 10 +- src/USER-MISC/improper_ring.cpp | 4 +- src/USER-MISC/pair_agni.cpp | 22 +- src/USER-MISC/pair_buck_mdf.cpp | 24 +- src/USER-MISC/pair_cosine_squared.cpp | 12 +- src/USER-MISC/pair_coul_diel.cpp | 14 +- src/USER-MISC/pair_coul_shield.cpp | 12 +- src/USER-MISC/pair_coul_slater_long.cpp | 8 +- src/USER-MISC/pair_drip.cpp | 26 +- src/USER-MISC/pair_e3b.cpp | 12 +- src/USER-MISC/pair_edip.cpp | 32 +- src/USER-MISC/pair_edip_multi.cpp | 20 +- src/USER-MISC/pair_extep.cpp | 38 +-- src/USER-MISC/pair_gauss_cut.cpp | 16 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 38 +-- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 38 +-- src/USER-MISC/pair_kolmogorov_crespi_z.cpp | 22 +- src/USER-MISC/pair_lebedeva_z.cpp | 22 +- src/USER-MISC/pair_lennard_mdf.cpp | 18 +- src/USER-MISC/pair_list.cpp | 34 +- src/USER-MISC/pair_lj_expand_coul_long.cpp | 34 +- src/USER-MISC/pair_lj_mdf.cpp | 14 +- src/USER-MISC/pair_lj_sf_dipole_sf.cpp | 20 +- src/USER-MISC/pair_local_density.cpp | 46 +-- src/USER-MISC/pair_meam_spline.cpp | 44 +-- src/USER-MISC/pair_meam_spline.h | 4 +- src/USER-MISC/pair_meam_sw_spline.cpp | 24 +- src/USER-MISC/pair_meam_sw_spline.h | 4 +- src/USER-MISC/pair_momb.cpp | 24 +- src/USER-MISC/pair_morse_smooth_linear.cpp | 16 +- src/USER-MISC/pair_srp.cpp | 20 +- src/USER-MISC/pair_tersoff_table.cpp | 4 +- src/USER-MISC/temper_grem.cpp | 2 +- src/USER-MISC/temper_npt.cpp | 2 +- src/USER-MOFFF/angle_class2_p6.cpp | 30 +- src/USER-MOFFF/angle_cosine_buck6d.cpp | 8 +- .../improper_inversion_harmonic.cpp | 4 +- src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp | 28 +- .../pair_buck6d_coul_gauss_long.cpp | 32 +- src/USER-MOLFILE/dump_molfile.cpp | 14 +- src/USER-MOLFILE/molfile_interface.cpp | 96 +++--- src/USER-MOLFILE/reader_molfile.cpp | 14 +- src/USER-NETCDF/dump_netcdf.cpp | 8 +- src/USER-NETCDF/dump_netcdf_mpiio.cpp | 10 +- src/USER-OMP/bond_class2_omp.cpp | 2 +- src/USER-OMP/bond_fene_expand_omp.cpp | 2 +- src/USER-OMP/bond_fene_omp.cpp | 2 +- src/USER-OMP/bond_gromos_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_shift_cut_omp.cpp | 2 +- src/USER-OMP/bond_harmonic_shift_omp.cpp | 2 +- src/USER-OMP/bond_morse_omp.cpp | 2 +- src/USER-OMP/bond_nonlinear_omp.cpp | 2 +- src/USER-OMP/bond_quartic_omp.cpp | 2 +- src/USER-OMP/bond_table_omp.cpp | 2 +- src/USER-OMP/ewald_omp.cpp | 2 +- src/USER-OMP/fix_neigh_history_omp.cpp | 8 +- src/USER-OMP/fix_omp.cpp | 18 +- src/USER-OMP/fix_qeq_comb_omp.cpp | 6 +- src/USER-OMP/fix_qeq_reax_omp.cpp | 4 +- src/USER-OMP/msm_cg_omp.cpp | 2 +- src/USER-OMP/pair_adp_omp.cpp | 2 +- src/USER-OMP/pair_agni_omp.cpp | 2 +- src/USER-OMP/pair_airebo_omp.cpp | 2 +- src/USER-OMP/pair_beck_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_born_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_born_omp.cpp | 2 +- src/USER-OMP/pair_brownian_omp.cpp | 10 +- src/USER-OMP/pair_brownian_poly_omp.cpp | 10 +- src/USER-OMP/pair_buck_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_buck_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_buck_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_buck_long_coul_long_omp.cpp | 10 +- src/USER-OMP/pair_buck_omp.cpp | 2 +- src/USER-OMP/pair_colloid_omp.cpp | 2 +- src/USER-OMP/pair_comb_omp.cpp | 2 +- src/USER-OMP/pair_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_coul_cut_soft_omp.cpp | 2 +- src/USER-OMP/pair_coul_debye_omp.cpp | 2 +- src/USER-OMP/pair_coul_diel_omp.cpp | 2 +- src/USER-OMP/pair_coul_dsf_omp.cpp | 2 +- src/USER-OMP/pair_coul_long_omp.cpp | 4 +- src/USER-OMP/pair_coul_long_soft_omp.cpp | 2 +- src/USER-OMP/pair_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_dpd_omp.cpp | 10 +- src/USER-OMP/pair_dpd_tstat_omp.cpp | 10 +- src/USER-OMP/pair_eam_alloy_omp.cpp | 2 +- src/USER-OMP/pair_eam_fs_omp.cpp | 2 +- src/USER-OMP/pair_eam_omp.cpp | 2 +- src/USER-OMP/pair_edip_omp.cpp | 2 +- src/USER-OMP/pair_eim_omp.cpp | 2 +- src/USER-OMP/pair_gauss_cut_omp.cpp | 2 +- src/USER-OMP/pair_gauss_omp.cpp | 2 +- src/USER-OMP/pair_gayberne_omp.cpp | 2 +- src/USER-OMP/pair_gran_hertz_history_omp.cpp | 2 +- src/USER-OMP/pair_gran_hooke_history_omp.cpp | 2 +- src/USER-OMP/pair_gran_hooke_omp.cpp | 2 +- src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp | 4 +- .../pair_hbond_dreiding_morse_omp.cpp | 4 +- src/USER-OMP/pair_lj96_cut_omp.cpp | 4 +- ...air_lj_charmm_coul_charmm_implicit_omp.cpp | 2 +- .../pair_lj_charmm_coul_charmm_omp.cpp | 2 +- src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp | 4 +- .../pair_lj_charmm_coul_long_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_lj_class2_coul_long_omp.cpp | 4 +- src/USER-OMP/pair_lj_class2_omp.cpp | 2 +- src/USER-OMP/pair_lj_cubic_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp | 2 +- .../pair_lj_cut_coul_cut_soft_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_coul_long_omp.cpp | 4 +- .../pair_lj_cut_coul_long_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp | 2 +- src/USER-OMP/pair_lj_cut_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_soft_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_thole_long_omp.cpp | 4 +- src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp | 6 +- src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp | 6 +- .../pair_lj_cut_tip4p_long_soft_omp.cpp | 6 +- src/USER-OMP/pair_lj_expand_omp.cpp | 2 +- .../pair_lj_gromacs_coul_gromacs_omp.cpp | 2 +- src/USER-OMP/pair_lj_gromacs_omp.cpp | 2 +- src/USER-OMP/pair_lj_long_coul_long_omp.cpp | 10 +- src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp | 14 +- src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp | 2 +- src/USER-OMP/pair_lj_sdk_omp.cpp | 2 +- src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp | 2 +- src/USER-OMP/pair_lj_smooth_linear_omp.cpp | 2 +- src/USER-OMP/pair_lj_smooth_omp.cpp | 2 +- src/USER-OMP/pair_lubricate_omp.cpp | 2 +- src/USER-OMP/pair_lubricate_poly_omp.cpp | 2 +- src/USER-OMP/pair_meam_spline_omp.cpp | 2 +- src/USER-OMP/pair_morse_omp.cpp | 2 +- src/USER-OMP/pair_morse_smooth_linear_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_coul_long_omp.cpp | 2 +- src/USER-OMP/pair_nm_cut_omp.cpp | 2 +- src/USER-OMP/pair_peri_lps_omp.cpp | 2 +- src/USER-OMP/pair_peri_pmb_omp.cpp | 2 +- src/USER-OMP/pair_reaxc_omp.cpp | 4 +- src/USER-OMP/pair_resquared_omp.cpp | 2 +- src/USER-OMP/pair_soft_omp.cpp | 2 +- src/USER-OMP/pair_sw_omp.cpp | 2 +- src/USER-OMP/pair_table_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_mod_c_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_mod_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_omp.cpp | 2 +- src/USER-OMP/pair_tersoff_table_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_cut_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_long_omp.cpp | 6 +- src/USER-OMP/pair_tip4p_long_soft_omp.cpp | 6 +- src/USER-OMP/pair_ufm_omp.cpp | 2 +- src/USER-OMP/pair_vashishta_omp.cpp | 2 +- src/USER-OMP/pair_vashishta_table_omp.cpp | 2 +- src/USER-OMP/pair_yukawa_colloid_omp.cpp | 2 +- src/USER-OMP/pair_yukawa_omp.cpp | 2 +- src/USER-OMP/pair_zbl_omp.cpp | 2 +- src/USER-OMP/reaxc_bonds_omp.cpp | 2 +- src/USER-OMP/reaxc_forces_omp.cpp | 2 +- src/USER-OMP/thr_data.cpp | 18 +- src/USER-OMP/thr_data.h | 4 +- src/USER-OMP/thr_omp.cpp | 6 +- src/USER-PHONON/dynamical_matrix.cpp | 6 +- src/USER-PHONON/fix_phonon.cpp | 26 +- src/USER-PHONON/third_order.cpp | 6 +- src/USER-PLUMED/fix_plumed.cpp | 8 +- src/USER-PTM/compute_ptm_atom.cpp | 8 +- src/USER-PTM/ptm_index.cpp | 22 +- src/USER-PTM/ptm_initialize_data.h | 90 ++--- src/USER-QMMM/fix_qmmm.cpp | 18 +- src/USER-QTB/fix_qbmsst.cpp | 28 +- src/USER-QTB/fix_qtb.cpp | 22 +- src/USER-QUIP/pair_quip.cpp | 8 +- src/USER-REACTION/fix_bond_react.cpp | 64 ++-- src/USER-REAXC/compute_spec_atom.cpp | 4 +- src/USER-REAXC/fix_qeq_reax.cpp | 46 +-- src/USER-REAXC/fix_reaxc.cpp | 4 +- src/USER-REAXC/fix_reaxc_bonds.cpp | 12 +- src/USER-REAXC/fix_reaxc_species.cpp | 50 +-- src/USER-REAXC/pair_reaxc.cpp | 16 +- src/USER-REAXC/reaxc_allocate.cpp | 8 +- src/USER-REAXC/reaxc_control.cpp | 2 +- src/USER-REAXC/reaxc_io_tools.cpp | 8 +- src/USER-REAXC/reaxc_list.cpp | 18 +- src/USER-REAXC/reaxc_tool_box.cpp | 18 +- src/USER-REAXC/reaxc_traj.cpp | 4 +- src/USER-SCAFACOS/scafacos.cpp | 8 +- src/USER-SDPD/fix_meso_move.cpp | 26 +- .../pair_sdpd_taitwater_isothermal.cpp | 2 +- src/USER-SMD/compute_smd_contact_radius.cpp | 2 +- src/USER-SMD/compute_smd_damage.cpp | 2 +- src/USER-SMD/compute_smd_hourglass_error.cpp | 4 +- src/USER-SMD/compute_smd_internal_energy.cpp | 2 +- src/USER-SMD/compute_smd_plastic_strain.cpp | 2 +- .../compute_smd_plastic_strain_rate.cpp | 2 +- src/USER-SMD/compute_smd_rho.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_defgrad.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_dt.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_num_neighs.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_shape.cpp | 6 +- src/USER-SMD/compute_smd_tlsph_strain.cpp | 4 +- .../compute_smd_tlsph_strain_rate.cpp | 4 +- src/USER-SMD/compute_smd_tlsph_stress.cpp | 4 +- .../compute_smd_triangle_vertices.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_effm.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_num_neighs.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_strain.cpp | 2 +- .../compute_smd_ulsph_strain_rate.cpp | 4 +- src/USER-SMD/compute_smd_ulsph_stress.cpp | 4 +- src/USER-SMD/compute_smd_vol.cpp | 2 +- src/USER-SMD/fix_smd_adjust_dt.cpp | 14 +- src/USER-SMD/fix_smd_integrate_tlsph.cpp | 2 +- src/USER-SMD/fix_smd_integrate_ulsph.cpp | 6 +- src/USER-SMD/fix_smd_setvel.cpp | 6 +- .../fix_smd_tlsph_reference_configuration.cpp | 18 +- src/USER-SMD/fix_smd_wall_surface.cpp | 36 +- src/USER-SMD/pair_smd_hertz.cpp | 8 +- src/USER-SMD/pair_smd_tlsph.cpp | 30 +- .../pair_smd_triangulated_surface.cpp | 8 +- src/USER-SMD/pair_smd_ulsph.cpp | 30 +- src/USER-SMTBQ/pair_smtbq.cpp | 84 ++--- src/USER-SPH/compute_sph_e_atom.cpp | 2 +- src/USER-SPH/compute_sph_rho_atom.cpp | 2 +- src/USER-SPH/compute_sph_t_atom.cpp | 2 +- src/USER-TALLY/compute_force_tally.cpp | 4 +- src/USER-TALLY/compute_heat_flux_tally.cpp | 6 +- src/USER-TALLY/compute_pe_mol_tally.cpp | 2 +- src/USER-TALLY/compute_pe_tally.cpp | 4 +- src/USER-TALLY/compute_stress_tally.cpp | 4 +- src/USER-UEF/fix_nh_uef.cpp | 2 +- src/USER-VTK/dump_vtk.cpp | 44 +-- src/USER-YAFF/angle_cross.cpp | 12 +- src/USER-YAFF/angle_mm3.cpp | 4 +- src/USER-YAFF/bond_mm3.cpp | 4 +- src/USER-YAFF/improper_distharm.cpp | 4 +- src/USER-YAFF/improper_sqdistharm.cpp | 4 +- .../pair_lj_switch3_coulgauss_long.cpp | 34 +- .../pair_mm3_switch3_coulgauss_long.cpp | 34 +- src/VORONOI/compute_voronoi_atom.cpp | 28 +- src/angle.cpp | 8 +- src/angle_hybrid.cpp | 8 +- src/angle_zero.cpp | 2 +- src/atom.cpp | 238 ++++++------- src/atom.h | 2 +- src/atom_map.cpp | 8 +- src/atom_vec.cpp | 4 +- src/atom_vec_body.cpp | 8 +- src/atom_vec_ellipsoid.cpp | 4 +- src/atom_vec_hybrid.cpp | 10 +- src/atom_vec_line.cpp | 4 +- src/atom_vec_tri.cpp | 4 +- src/balance.cpp | 26 +- src/body.cpp | 4 +- src/bond.cpp | 10 +- src/bond.h | 2 +- src/bond_hybrid.cpp | 8 +- src/bond_zero.cpp | 4 +- src/citeme.cpp | 2 +- src/comm.cpp | 34 +- src/comm.h | 4 +- src/comm_brick.cpp | 28 +- src/comm_tiled.cpp | 48 +-- src/compute.cpp | 8 +- src/compute_adf.cpp | 24 +- src/compute_aggregate_atom.cpp | 6 +- src/compute_angle.cpp | 2 +- src/compute_angle_local.cpp | 10 +- src/compute_angmom_chunk.cpp | 2 +- src/compute_bond.cpp | 2 +- src/compute_bond_local.cpp | 10 +- src/compute_centro_atom.cpp | 4 +- src/compute_centroid_stress_atom.cpp | 6 +- src/compute_chunk_atom.cpp | 44 +-- src/compute_chunk_atom.h | 2 +- src/compute_chunk_spread_atom.cpp | 8 +- src/compute_cluster_atom.cpp | 4 +- src/compute_cna_atom.cpp | 4 +- src/compute_com_chunk.cpp | 2 +- src/compute_contact_atom.cpp | 4 +- src/compute_coord_atom.cpp | 6 +- src/compute_dihedral.cpp | 2 +- src/compute_dihedral_local.cpp | 10 +- src/compute_dipole_chunk.cpp | 6 +- src/compute_displace_atom.cpp | 6 +- src/compute_erotate_sphere_atom.cpp | 2 +- src/compute_fragment_atom.cpp | 8 +- src/compute_global_atom.cpp | 10 +- src/compute_group_group.cpp | 12 +- src/compute_gyration_chunk.cpp | 4 +- src/compute_heat_flux.cpp | 2 +- src/compute_hexorder_atom.cpp | 4 +- src/compute_improper.cpp | 2 +- src/compute_improper_local.cpp | 10 +- src/compute_inertia_chunk.cpp | 4 +- src/compute_ke_atom.cpp | 2 +- src/compute_msd.cpp | 2 +- src/compute_msd_chunk.cpp | 2 +- src/compute_omega_chunk.cpp | 4 +- src/compute_orientorder_atom.cpp | 6 +- src/compute_pair.cpp | 4 +- src/compute_pair_local.cpp | 8 +- src/compute_pe_atom.cpp | 2 +- src/compute_pressure.cpp | 12 +- src/compute_property_atom.cpp | 4 +- src/compute_property_chunk.cpp | 2 +- src/compute_property_local.cpp | 8 +- src/compute_rdf.cpp | 6 +- src/compute_reduce.cpp | 20 +- src/compute_reduce_chunk.cpp | 14 +- src/compute_slice.cpp | 2 +- src/compute_stress_atom.cpp | 6 +- src/compute_temp_chunk.cpp | 6 +- src/compute_temp_deform.cpp | 2 +- src/compute_temp_partial.cpp | 2 +- src/compute_temp_profile.cpp | 2 +- src/compute_temp_ramp.cpp | 2 +- src/compute_temp_region.cpp | 4 +- src/compute_temp_sphere.cpp | 2 +- src/compute_torque_chunk.cpp | 2 +- src/compute_vacf.cpp | 2 +- src/compute_vcm_chunk.cpp | 2 +- src/create_atoms.cpp | 6 +- src/create_atoms.h | 2 +- src/create_bonds.cpp | 4 +- src/delete_atoms.cpp | 6 +- src/delete_bonds.cpp | 2 +- src/dihedral.cpp | 8 +- src/dihedral_hybrid.cpp | 8 +- src/displace_atoms.cpp | 6 +- src/domain.cpp | 8 +- src/dump.cpp | 74 ++-- src/dump_atom.cpp | 2 +- src/dump_cfg.cpp | 4 +- src/dump_custom.cpp | 82 ++--- src/dump_dcd.cpp | 8 +- src/dump_image.cpp | 50 +-- src/dump_local.cpp | 22 +- src/dump_movie.cpp | 6 +- src/dump_xyz.cpp | 12 +- src/error.cpp | 12 +- src/fix.cpp | 4 +- src/fix.h | 2 +- src/fix_adapt.cpp | 28 +- src/fix_addforce.cpp | 6 +- src/fix_ave_atom.cpp | 12 +- src/fix_ave_chunk.cpp | 74 ++-- src/fix_ave_correlate.cpp | 14 +- src/fix_ave_histo.cpp | 42 +-- src/fix_ave_histo_weight.cpp | 8 +- src/fix_ave_time.cpp | 36 +- src/fix_aveforce.cpp | 10 +- src/fix_balance.cpp | 2 +- src/fix_box_relax.cpp | 4 +- src/fix_controller.cpp | 2 +- src/fix_deform.cpp | 6 +- src/fix_enforce2d.cpp | 2 +- src/fix_external.cpp | 8 +- src/fix_gravity.cpp | 8 +- src/fix_group.cpp | 10 +- src/fix_halt.cpp | 4 +- src/fix_heat.cpp | 6 +- src/fix_indent.cpp | 4 +- src/fix_langevin.cpp | 20 +- src/fix_minimize.cpp | 2 +- src/fix_move.cpp | 36 +- src/fix_neigh_history.cpp | 42 +-- src/fix_nh.cpp | 24 +- src/fix_numdiff.cpp | 4 +- src/fix_press_berendsen.cpp | 6 +- src/fix_print.cpp | 8 +- src/fix_property_atom.cpp | 16 +- src/fix_read_restart.cpp | 2 +- src/fix_respa.cpp | 6 +- src/fix_restrain.cpp | 6 +- src/fix_setforce.cpp | 10 +- src/fix_spring.cpp | 2 +- src/fix_spring_chunk.cpp | 6 +- src/fix_spring_rg.cpp | 2 +- src/fix_spring_self.cpp | 4 +- src/fix_store.cpp | 16 +- src/fix_store_force.cpp | 2 +- src/fix_store_state.cpp | 14 +- src/fix_temp_berendsen.cpp | 6 +- src/fix_temp_csld.cpp | 10 +- src/fix_temp_csvr.cpp | 6 +- src/fix_temp_rescale.cpp | 6 +- src/fix_tmd.cpp | 12 +- src/fix_vector.cpp | 6 +- src/fix_viscous.cpp | 2 +- src/fix_wall.cpp | 2 +- src/fix_wall_region.cpp | 2 +- src/force.cpp | 76 ++--- src/group.cpp | 30 +- src/image.cpp | 28 +- src/improper.cpp | 8 +- src/improper_hybrid.cpp | 8 +- src/info.cpp | 14 +- src/input.cpp | 84 ++--- src/integrate.cpp | 8 +- src/irregular.cpp | 10 +- src/irregular.h | 2 +- src/kspace.cpp | 8 +- src/lammps.cpp | 138 ++++---- src/lattice.cpp | 4 +- src/library.cpp | 244 ++++++------- src/lmppython.cpp | 2 +- src/memory.cpp | 12 +- src/memory.h | 74 ++-- src/min.cpp | 28 +- src/min_hftn.cpp | 24 +- src/min_linesearch.cpp | 8 +- src/modify.cpp | 106 +++--- src/molecule.cpp | 88 ++--- src/my_page.cpp | 4 +- src/my_page.h | 2 +- src/nbin.cpp | 6 +- src/neigh_list.cpp | 40 +-- src/neigh_request.cpp | 10 +- src/neighbor.cpp | 92 ++--- src/npair.cpp | 4 +- src/nstencil.cpp | 14 +- src/ntopo.cpp | 2 +- src/output.cpp | 40 +-- src/output.h | 2 +- src/pair.cpp | 36 +- src/pair.h | 2 +- src/pair_beck.cpp | 18 +- src/pair_born.cpp | 24 +- src/pair_born_coul_dsf.cpp | 24 +- src/pair_born_coul_wolf.cpp | 24 +- src/pair_buck.cpp | 20 +- src/pair_buck_coul_cut.cpp | 22 +- src/pair_coul_cut.cpp | 12 +- src/pair_coul_debye.cpp | 8 +- src/pair_coul_dsf.cpp | 12 +- src/pair_coul_streitz.cpp | 14 +- src/pair_coul_wolf.cpp | 10 +- src/pair_dpd.cpp | 18 +- src/pair_dpd_tstat.cpp | 16 +- src/pair_gauss.cpp | 16 +- src/pair_hybrid.cpp | 42 +-- src/pair_hybrid_overlay.cpp | 2 +- src/pair_lj96_cut.cpp | 20 +- src/pair_lj_cubic.cpp | 12 +- src/pair_lj_cut.cpp | 20 +- src/pair_lj_cut_coul_cut.cpp | 22 +- src/pair_lj_cut_coul_debye.cpp | 10 +- src/pair_lj_cut_coul_dsf.cpp | 22 +- src/pair_lj_cut_coul_wolf.cpp | 20 +- src/pair_lj_expand.cpp | 20 +- src/pair_lj_gromacs.cpp | 18 +- src/pair_lj_gromacs_coul_gromacs.cpp | 18 +- src/pair_lj_smooth.cpp | 18 +- src/pair_lj_smooth_linear.cpp | 12 +- src/pair_mie_cut.cpp | 26 +- src/pair_morse.cpp | 18 +- src/pair_soft.cpp | 12 +- src/pair_table.cpp | 32 +- src/pair_ufm.cpp | 18 +- src/pair_yukawa.cpp | 14 +- src/pair_zbl.cpp | 14 +- src/pair_zero.cpp | 8 +- src/procmap.cpp | 18 +- src/random_mars.cpp | 2 +- src/rcb.cpp | 28 +- src/read_data.cpp | 120 +++---- src/read_dump.cpp | 28 +- src/read_restart.cpp | 52 +-- src/reader.cpp | 10 +- src/reader_native.cpp | 12 +- src/reader_xyz.cpp | 12 +- src/region.cpp | 8 +- src/region_cylinder.cpp | 2 +- src/region_intersect.cpp | 2 +- src/region_sphere.cpp | 2 +- src/region_union.cpp | 2 +- src/replicate.cpp | 2 +- src/rerun.cpp | 4 +- src/reset_mol_ids.cpp | 4 +- src/respa.cpp | 4 +- src/run.cpp | 4 +- src/set.cpp | 6 +- src/special.cpp | 2 +- src/thermo.cpp | 32 +- src/universe.cpp | 14 +- src/update.cpp | 10 +- src/utils.cpp | 20 +- src/utils.h | 10 +- src/variable.cpp | 274 +++++++-------- src/variable.h | 4 +- src/velocity.cpp | 32 +- src/write_coeff.cpp | 14 +- src/write_data.cpp | 12 +- src/write_dump.cpp | 2 +- src/write_restart.cpp | 14 +- 1217 files changed, 8605 insertions(+), 8605 deletions(-) diff --git a/lib/atc/ATC_Coupling.cpp b/lib/atc/ATC_Coupling.cpp index db72b0cb0..552bb9bb3 100644 --- a/lib/atc/ATC_Coupling.cpp +++ b/lib/atc/ATC_Coupling.cpp @@ -30,26 +30,26 @@ namespace ATC { useFeMdMassMatrix_(false), trackCharge_(false), temperatureDef_(NONE), - prescribedDataMgr_(NULL), - physicsModel_(NULL), + prescribedDataMgr_(nullptr), + physicsModel_(nullptr), extrinsicModelManager_(this), - atomicRegulator_(NULL), + atomicRegulator_(nullptr), atomQuadForInternal_(true), - elementMask_(NULL), - elementMaskMass_(NULL), - elementMaskMassMd_(NULL), - nodalAtomicMass_(NULL), - nodalAtomicCount_(NULL), - nodalAtomicHeatCapacity_(NULL), - internalToMask_(NULL), - internalElement_(NULL), - ghostElement_(NULL), - nodalGeometryType_(NULL), + elementMask_(nullptr), + elementMaskMass_(nullptr), + elementMaskMassMd_(nullptr), + nodalAtomicMass_(nullptr), + nodalAtomicCount_(nullptr), + nodalAtomicHeatCapacity_(nullptr), + internalToMask_(nullptr), + internalElement_(nullptr), + ghostElement_(nullptr), + nodalGeometryType_(nullptr), bndyIntType_(NO_QUADRATURE), - bndyFaceSet_(NULL), - atomicWeightsMask_(NULL), - shpFcnMask_(NULL), - shpFcnDerivsMask_(NULL), + bndyFaceSet_(nullptr), + atomicWeightsMask_(nullptr), + shpFcnMask_(nullptr), + shpFcnDerivsMask_(nullptr), sourceIntegration_(FULL_DOMAIN) { // size the field mask @@ -68,7 +68,7 @@ namespace ATC { ATC_Coupling::~ATC_Coupling() { interscaleManager_.clear(); - if (feEngine_) { delete feEngine_; feEngine_ = NULL; } + if (feEngine_) { delete feEngine_; feEngine_ = nullptr; } if (physicsModel_) delete physicsModel_; if (atomicRegulator_) delete atomicRegulator_; if (prescribedDataMgr_) delete prescribedDataMgr_; @@ -127,7 +127,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -164,7 +164,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // fix current value if (narg == argIdx) { set nodeSet = (feEngine_->fe_mesh())->nodeset(nsetName); @@ -258,7 +258,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string esetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { string a(arg[argIdx]); @@ -367,7 +367,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -529,7 +529,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - UXT_Function * f = NULL; + UXT_Function * f = nullptr; // parse linear if (narg == argIdx+2) { f = UXT_Function_Mgr::instance()->linear_function(atof(arg[argIdx]),atof(arg[argIdx+1])); @@ -760,7 +760,7 @@ namespace ATC { WeakEquation::PDE_Type ATC_Coupling::pde_type(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return WeakEquation::PROJECTION_PDE; + if (weakEq == nullptr) return WeakEquation::PROJECTION_PDE; return weakEq->type(); } //-------------------------------------------------- @@ -768,7 +768,7 @@ namespace ATC { bool ATC_Coupling::is_dynamic(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return false; + if (weakEq == nullptr) return false; return (physicsModel_->weak_equation(fieldName)->type() == WeakEquation::DYNAMIC_PDE); } diff --git a/lib/atc/ATC_Coupling.h b/lib/atc/ATC_Coupling.h index 9f406febb..e119b6873 100644 --- a/lib/atc/ATC_Coupling.h +++ b/lib/atc/ATC_Coupling.h @@ -114,10 +114,10 @@ namespace ATC { FIELDS &rhs, const Array< std::set > atomMaterialGroups, const VectorDependencyManager * shpFcnDerivs, - const SPAR_MAN * shpFcn = NULL, - const DIAG_MAN * atomicWeights = NULL, - const MatrixDependencyManager * elementMask = NULL, - const SetDependencyManager * nodeSet = NULL); + const SPAR_MAN * shpFcn = nullptr, + const DIAG_MAN * atomicWeights = nullptr, + const MatrixDependencyManager * elementMask = nullptr, + const SetDependencyManager * nodeSet = nullptr); /** access to full right hand side / forcing vector */ FIELDS &rhs() {return rhs_;}; Array2D rhs_mask() const { @@ -152,14 +152,14 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, // = FULL_DOMAIN - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** wrapper for FE_Engine's compute_tangent_matrix */ void compute_rhs_tangent(const std::pair row_col, const RHS_MASK & rhsMask, const FIELDS & fields, SPAR_MAT & stiffness, const IntegrationDomainType integrationType, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); void tangent_matrix(const std::pair row_col, const RHS_MASK & rhsMask, const PhysicsModel * physicsModel, @@ -197,7 +197,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } else { @@ -206,7 +206,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } } @@ -233,7 +233,7 @@ namespace ATC { /** access to time integrator */ const TimeIntegrator * time_integrator(const FieldName & field) const { _ctiIt_ = timeIntegrators_.find(field); - if (_ctiIt_ == timeIntegrators_.end()) return NULL; + if (_ctiIt_ == timeIntegrators_.end()) return nullptr; return _ctiIt_->second; }; @@ -322,7 +322,7 @@ namespace ATC { void compute_flux(const Array2D & rhs_mask, const FIELDS &fields, GRAD_FIELD_MATS &flux, - const PhysicsModel * physicsModel=NULL, + const PhysicsModel * physicsModel=nullptr, const bool normalize = false); /** evaluate rhs on the atomic domain which is near the FE region */ void masked_atom_domain_rhs_integral(const Array2D & rhs_mask, @@ -334,7 +334,7 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** access to boundary fluxes */ DENS_MAT &get_boundary_flux(FieldName thisField){return boundaryFlux_[thisField].set_quantity();}; DENS_MAN &boundary_flux(FieldName thisField){return boundaryFlux_[thisField];}; @@ -352,7 +352,7 @@ namespace ATC { // mass matrix filtering void delete_mass_mat_time_filter(FieldName thisField); /** compute mass matrix for requested field */ - void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = NULL); + void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = nullptr); /** updates filtering of MD contributions */ void update_mass_matrix(FieldName thisField); /** compute the mass matrix components coming from MD integration */ diff --git a/lib/atc/ATC_CouplingEnergy.cpp b/lib/atc/ATC_CouplingEnergy.cpp index c3b07c242..8fae1f070 100644 --- a/lib/atc/ATC_CouplingEnergy.cpp +++ b/lib/atc/ATC_CouplingEnergy.cpp @@ -30,8 +30,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL) + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr) { // Allocate PhysicsModel create_physics_model(THERMAL, matParamFile); @@ -103,7 +103,7 @@ namespace ATC { // always need kinetic energy AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_CouplingMomentumEnergy.cpp b/lib/atc/ATC_CouplingMomentumEnergy.cpp index 1fc293197..32df5fd7b 100644 --- a/lib/atc/ATC_CouplingMomentumEnergy.cpp +++ b/lib/atc/ATC_CouplingMomentumEnergy.cpp @@ -32,8 +32,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL), + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr), refPE_(0) { // Allocate PhysicsModel @@ -190,7 +190,7 @@ namespace ATC { FieldManager fieldManager(this); PerAtomQuantity * fluctuatingAtomicVelocity = fieldManager.per_atom_quantity("AtomicFluctuatingVelocity"); // also creates ProlongedVelocity AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this,fluctuatingAtomicVelocity); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_Method.cpp b/lib/atc/ATC_Method.cpp index f2173e957..113d175e2 100644 --- a/lib/atc/ATC_Method.cpp +++ b/lib/atc/ATC_Method.cpp @@ -35,37 +35,37 @@ using std::pair; namespace ATC { ATC_Method::ATC_Method(string groupName, double ** & perAtomArray, LAMMPS_NS::Fix * thisFix) : - nodalAtomicVolume_(NULL), + nodalAtomicVolume_(nullptr), needReset_(true), lammpsInterface_(LammpsInterface::instance()), interscaleManager_(this), timeFilterManager_(this), integrateInternalAtoms_(false), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), ghostManager_(this), - feEngine_(NULL), + feEngine_(nullptr), initialized_(false), meshDataInitialized_(false), localStep_(0), sizeComm_(8), // 3 positions + 1 material id * 2 for output - atomCoarseGrainingPositions_(NULL), - atomGhostCoarseGrainingPositions_(NULL), - atomProcGhostCoarseGrainingPositions_(NULL), - atomReferencePositions_(NULL), + atomCoarseGrainingPositions_(nullptr), + atomGhostCoarseGrainingPositions_(nullptr), + atomProcGhostCoarseGrainingPositions_(nullptr), + atomReferencePositions_(nullptr), nNodes_(0), nsd_(lammpsInterface_->dimension()), - xref_(NULL), + xref_(nullptr), readXref_(false), needXrefProcessorGhosts_(false), trackDisplacement_(false), needsAtomToElementMap_(true), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalElementSet_(""), - atomMasses_(NULL), - atomPositions_(NULL), - atomVelocities_(NULL), - atomForces_(NULL), + atomMasses_(nullptr), + atomPositions_(nullptr), + atomVelocities_(nullptr), + atomForces_(nullptr), parallelConsistency_(true), outputNow_(false), outputTime_(true), @@ -79,13 +79,13 @@ namespace ATC { sizeVector_(0), scalarVectorFreq_(0), sizePerAtomCols_(4), - perAtomOutput_(NULL), + perAtomOutput_(nullptr), perAtomArray_(perAtomArray), extScalar_(0), extVector_(0), - extList_(NULL), + extList_(nullptr), thermoEnergyFlag_(0), - atomVolume_(NULL), + atomVolume_(nullptr), atomicWeightsWriteFlag_(false), atomicWeightsWriteFrequency_(0), atomWeightType_(LATTICE), @@ -103,12 +103,12 @@ namespace ATC { mdMassNormalization_(false), kernelBased_(false), kernelOnTheFly_(false), - kernelFunction_(NULL), + kernelFunction_(nullptr), bondOnTheFly_(false), - accumulant_(NULL), - accumulantMol_(NULL), - accumulantMolGrad_(NULL), - accumulantWeights_(NULL), + accumulant_(nullptr), + accumulantMol_(nullptr), + accumulantMolGrad_(nullptr), + accumulantWeights_(nullptr), accumulantInverseVolumes_(&invNodeVolumes_), accumulantBandwidth_(0), useRestart_(false), @@ -117,7 +117,7 @@ namespace ATC { setRefPEvalue_(false), refPEvalue_(0.), readRefPE_(false), - nodalRefPotentialEnergy_(NULL), + nodalRefPotentialEnergy_(nullptr), simTime_(0.0), stepCounter_(0) { @@ -1122,7 +1122,7 @@ pecified FieldName & thisField, int & thisIndex) { string thisName = args[argIdx++]; - if (args[argIdx] == NULL) { + if (args[argIdx] == nullptr) { throw ATC_Error("Need to give field '"+thisName+"' more args"); } thisField = string_to_field(thisName); @@ -1282,7 +1282,7 @@ pecified if (this->reset_methods()) { // clear memory manager interscaleManager_.clear_temporary_data(); - atomVolume_ = NULL; + atomVolume_ = nullptr; // reference positions and energy if (!initialized_) { @@ -1517,7 +1517,7 @@ pecified } else { // set variables to compute atomic weights - DENS_MAN * nodalVolume(NULL); + DENS_MAN * nodalVolume(nullptr); switch (atomWeightType_) { case USER: atomVolume_ = new AtomVolumeUser(this,Valpha_); diff --git a/lib/atc/ATC_Method.h b/lib/atc/ATC_Method.h index e356243e0..0779990a9 100644 --- a/lib/atc/ATC_Method.h +++ b/lib/atc/ATC_Method.h @@ -423,7 +423,7 @@ namespace ATC { bool use_md_mass_normalization() const { return mdMassNormalization_;} bool kernel_based() { return kernelBased_; } bool kernel_on_the_fly() const { return kernelOnTheFly_;} - bool has_kernel_function() { return kernelFunction_ != NULL; } + bool has_kernel_function() { return kernelFunction_ != nullptr; } KernelFunction * kernel_function() { return kernelFunction_; } std::vector & type_list() { return typeList_; } std::vector & group_list() { return groupList_; } diff --git a/lib/atc/ATC_Transfer.cpp b/lib/atc/ATC_Transfer.cpp index 833e1d1f2..a9e87e3ff 100644 --- a/lib/atc/ATC_Transfer.cpp +++ b/lib/atc/ATC_Transfer.cpp @@ -68,19 +68,19 @@ namespace ATC { LAMMPS_NS::Fix * thisFix, string matParamFile) : ATC_Method(groupName,perAtomArray,thisFix), - xPointer_(NULL), + xPointer_(nullptr), outputStepZero_(true), neighborReset_(false), - pairMap_(NULL), - bondMatrix_(NULL), - pairVirial_(NULL), - pairHeatFlux_(NULL), + pairMap_(nullptr), + bondMatrix_(nullptr), + pairVirial_(nullptr), + pairHeatFlux_(nullptr), nComputes_(0), hasPairs_(true), hasBonds_(false), resetKernelFunction_(false), dxaExactMode_(true), - cauchyBornStress_(NULL) + cauchyBornStress_(nullptr) { nTypes_ = lammpsInterface_->ntypes(); @@ -114,7 +114,7 @@ namespace ATC { rateFlags_ = false; outputFields_.resize(NUM_TOTAL_FIELDS); - for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = NULL; } + for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = nullptr; } // Hardy requires ref positions for processor ghosts for bond list @@ -491,7 +491,7 @@ namespace ATC { ComputedAtomQuantity * c = new ComputedAtomQuantity(this, tag); interscaleManager_.add_per_atom_quantity(c,tag); int projection = iter->second; - DIAG_MAN * w = NULL; + DIAG_MAN * w = nullptr; if (projection == VOLUME_NORMALIZATION ) { w = accumulantInverseVolumes_; } else if (projection == NUMBER_NORMALIZATION ) @@ -976,7 +976,7 @@ namespace ATC { DENS_MAT & H = hardyData_["displacement_gradient"].set_quantity(); DENS_MAT E(H.nRows(),1); ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); //DENS_MAT & T = hardyData_["temperature"]; //cauchy_born_entropic_energy(H,E,T); E += hardyData_["internal_energy"]; cauchy_born_energy(H, E, temp); @@ -988,14 +988,14 @@ namespace ATC { // compute: cauchy born stress if (fieldFlags_(CAUCHY_BORN_STRESS)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_stress(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_stress"].set_quantity(), temp); } // compute: cauchy born energy if (fieldFlags_(CAUCHY_BORN_ENERGY)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_energy(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_energy"].set_quantity(), temp); } diff --git a/lib/atc/Array.h b/lib/atc/Array.h index 21e66a955..c29729d32 100644 --- a/lib/atc/Array.h +++ b/lib/atc/Array.h @@ -78,7 +78,7 @@ protected: template Array::Array(void) { len_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -90,8 +90,8 @@ Array::Array(int len) { template Array::Array(const Array& A) { len_ = A.len_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[len_]; for(int i=0;i::Array(const Array& A) { template Array::~Array() { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; } template @@ -111,12 +111,12 @@ void Array::reset(int len) { } else { // size change, realloc memory len_ = len; - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; if (len_ > 0) data_ = new T[len_]; else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -130,7 +130,7 @@ void Array::resize(int len, bool copy) { else { // size change, realloc memory len_ = len; if (len_ > 0) { - if (copy && data_ != NULL) { + if (copy && data_ != nullptr) { Array temp(*this); delete[] data_; data_ = new T[len_]; @@ -140,12 +140,12 @@ void Array::resize(int len, bool copy) { } } else { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; data_ = new T[len_]; } } else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -158,10 +158,10 @@ T& Array::operator() (int i) { template Array& Array::operator= (const Array &other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS len_ = other.len_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[len_]; } @@ -250,7 +250,7 @@ T* Array::ptr() const { template void Array::print(std::string name) const { std::cout << "------- Begin "<::AliasArray(const Array& A) { template AliasArray::~AliasArray(void) { len_ = 0; - data_ = NULL; // trick base class into not deleting parent data + data_ = nullptr; // trick base class into not deleting parent data } template diff --git a/lib/atc/Array2D.h b/lib/atc/Array2D.h index 25f895f72..37b7dcb3c 100644 --- a/lib/atc/Array2D.h +++ b/lib/atc/Array2D.h @@ -57,7 +57,7 @@ template Array2D::Array2D() { nrows_ = 0; ncols_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -71,8 +71,8 @@ template Array2D::Array2D(const Array2D& A) { nrows_ = A.nrows_; ncols_ = A.ncols_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[nrows_ * ncols_]; for(int i=0;i::reset(int nrows, int ncols) { else { // size changed; realloc memory nrows_ = nrows; ncols_ = ncols; - if (data_ != NULL) + if (data_ != nullptr) delete [] data_; if (ncols_ > 0 && nrows_ > 0) data_ = new T[nrows_ * ncols_]; else { - data_ = NULL; + data_ = nullptr; nrows_ = 0; ncols_ = 0; } @@ -120,11 +120,11 @@ AliasArray Array2D::column(int col) const { template Array2D& Array2D::operator= (const Array2D& other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS nrows_ = other.nrows_; ncols_ = other.ncols_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[nrows_ * ncols_]; } @@ -170,14 +170,14 @@ void Array2D::write_restart(FILE *f) const { template Array2D::~Array2D() { - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; } template void Array2D::print(std::string name) const { std::cout << "------- Begin "< >::iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { data = new DENS_MAN(nNodes_,nCols); @@ -115,14 +115,14 @@ namespace ATC { //-------------------------------------------------------- // get_regulator_data: - // gets a pointer to the requested data, or NULL if + // gets a pointer to the requested data, or nullptr if // if doesn't exist //-------------------------------------------------------- const DENS_MAN * AtomicRegulator::regulator_data(const string tag) const { map >::const_iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { - return NULL; + return nullptr; } else { return const_cast((it->second).second); @@ -521,7 +521,7 @@ namespace ATC { fieldMask_(NUM_FIELDS,NUM_FLUX), nNodes_(atomicRegulator_->num_nodes()), regulatorPrefix_(atomicRegulator->regulator_prefix()+regulatorPrefix), - shpFcnDerivs_(NULL) + shpFcnDerivs_(nullptr) { fieldMask_ = false; } @@ -552,21 +552,21 @@ namespace ATC { RegulatorShapeFunction::RegulatorShapeFunction(AtomicRegulator * atomicRegulator, const string & regulatorPrefix) : RegulatorMethod(atomicRegulator,regulatorPrefix), - lambda_(NULL), - atomLambdas_(NULL), - shapeFunctionMatrix_(NULL), + lambda_(nullptr), + atomLambdas_(nullptr), + shapeFunctionMatrix_(nullptr), linearSolverType_(AtomicRegulator::NO_SOLVE), maxIterations_(atomicRegulator->max_iterations()), tolerance_(atomicRegulator->tolerance()), - matrixSolver_(NULL), - regulatedNodes_(NULL), - applicationNodes_(NULL), - boundaryNodes_(NULL), - shpFcn_(NULL), - atomicWeights_(NULL), - elementMask_(NULL), - lambdaAtomMap_(NULL), - weights_(NULL), + matrixSolver_(nullptr), + regulatedNodes_(nullptr), + applicationNodes_(nullptr), + boundaryNodes_(nullptr), + shpFcn_(nullptr), + atomicWeights_(nullptr), + elementMask_(nullptr), + lambdaAtomMap_(nullptr), + weights_(nullptr), nsd_(atomicRegulator_->nsd()), nLocal_(atomicRegulator_->nlocal()) { diff --git a/lib/atc/AtomicRegulator.h b/lib/atc/AtomicRegulator.h index b9fccb902..360af3a4f 100644 --- a/lib/atc/AtomicRegulator.h +++ b/lib/atc/AtomicRegulator.h @@ -143,7 +143,7 @@ namespace ATC { /** can externally set regulator dynamic contributions */ virtual void reset_lambda_contribution(const DENS_MAT & /* target */, const FieldName /* field */) {}; virtual void reset_lambda_contribution(const DENS_MAT & target) { reset_lambda_contribution(target,NUM_TOTAL_FIELDS); } - /** returns a const pointer to the DENS_MAN associated with the tag, or NULL */ + /** returns a const pointer to the DENS_MAN associated with the tag, or nullptr */ const DENS_MAN * regulator_data(const std::string tag) const; /** return the maximum number of iterations */ int max_iterations() {return maxIterations_;}; diff --git a/lib/atc/CauchyBorn.cpp b/lib/atc/CauchyBorn.cpp index 85b100ca6..81f7b4e1a 100644 --- a/lib/atc/CauchyBorn.cpp +++ b/lib/atc/CauchyBorn.cpp @@ -426,7 +426,7 @@ namespace ATC { for (INDEX j=i; j<3; j++) s(i,j) += factor * dd(i,j); - // If f_W is not NULL then append thermal contribution. + // If f_W is not nullptr then append thermal contribution. if (F_w) *F_w += 0.5*kb*T*log(detD); } //============================================================================ diff --git a/lib/atc/ChargeRegulator.cpp b/lib/atc/ChargeRegulator.cpp index bae78a761..972530829 100644 --- a/lib/atc/ChargeRegulator.cpp +++ b/lib/atc/ChargeRegulator.cpp @@ -164,7 +164,7 @@ namespace ATC { chargeRegulator_(chargeRegulator), lammpsInterface_(LammpsInterface::instance()), rC_(0), rCsq_(0), - targetValue_(NULL), + targetValue_(nullptr), targetPhi_(p.value), surface_(p.faceset), atomGroupBit_(p.groupBit), diff --git a/lib/atc/CloneVector.h b/lib/atc/CloneVector.h index 02db700f2..63d11636b 100644 --- a/lib/atc/CloneVector.h +++ b/lib/atc/CloneVector.h @@ -52,7 +52,7 @@ private: //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Vector &c) - : Vector(), _baseV(const_cast*>(&c)), _baseM(NULL) + : Vector(), _baseV(const_cast*>(&c)), _baseM(nullptr) {} //----------------------------------------------------------------------------- // Construct from a matrix, the const_cast isn't pretty @@ -65,7 +65,7 @@ CloneVector::CloneVector(const Vector &c) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(dim), _idx(idx) {} //----------------------------------------------------------------------------- @@ -73,7 +73,7 @@ CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const DiagonalMatrix &c, INDEX /* idx */) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(CLONE_DIAG), _idx(0) {} //----------------------------------------------------------------------------- diff --git a/lib/atc/ConcentrationRegulator.cpp b/lib/atc/ConcentrationRegulator.cpp index 4255b919b..499a5501c 100644 --- a/lib/atc/ConcentrationRegulator.cpp +++ b/lib/atc/ConcentrationRegulator.cpp @@ -186,14 +186,14 @@ const double kMinScale_ = 10000.; ConcentrationRegulator::ConcentrationRegulatorParameters & p) : ConcentrationRegulatorMethod(concReg), concentrationRegulator_(concReg), - interscaleManager_(NULL), + interscaleManager_(nullptr), lammpsInterface_(LammpsInterface::instance()), - list_(NULL), + list_(nullptr), targetConcentration_(p.value), targetCount_(0), elemset_(p.elemset), - p_(NULL), - randomNumberGenerator_(NULL), + p_(nullptr), + randomNumberGenerator_(nullptr), q0_(0), controlType_(p.type), controlIndex_(0), diff --git a/lib/atc/DenseMatrix.h b/lib/atc/DenseMatrix.h index e585289aa..e4759f02d 100644 --- a/lib/atc/DenseMatrix.h +++ b/lib/atc/DenseMatrix.h @@ -16,10 +16,10 @@ template class DenseMatrix : public Matrix { public: - DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); } - DenseMatrix(const DenseMatrix& c) : Matrix(), _data(NULL){ _copy(c); } - DenseMatrix(const SparseMatrix& c): Matrix(), _data(NULL){ c.dense_copy(*this);} - DenseMatrix(const Matrix& c) : Matrix(), _data(NULL){ _copy(c); } + DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(nullptr){ _create(rows, cols, z); } + DenseMatrix(const DenseMatrix& c) : Matrix(), _data(nullptr){ _copy(c); } + DenseMatrix(const SparseMatrix& c): Matrix(), _data(nullptr){ c.dense_copy(*this);} + DenseMatrix(const Matrix& c) : Matrix(), _data(nullptr){ _copy(c); } // const SparseMatrix * p = sparse_cast(&c); // (p) ? p->dense_copy(*this) : _copy(c); } ~DenseMatrix() { _delete();} @@ -261,7 +261,7 @@ void DenseMatrix::_delete() _nRows = _nCols = 0; if (_data){ delete [] _data; - _data = NULL; + _data = nullptr; } } //---------------------------------------------------------------------------- @@ -273,7 +273,7 @@ void DenseMatrix::_create(INDEX rows, INDEX cols, bool zero) _nRows=rows; _nCols=cols; - _data = (this->size() ? new T [_nCols*_nRows] : NULL); + _data = (this->size() ? new T [_nCols*_nRows] : nullptr); if (zero) this->zero(); } //---------------------------------------------------------------------------- diff --git a/lib/atc/DenseVector.h b/lib/atc/DenseVector.h index 38ed68f93..bab90bf3f 100644 --- a/lib/atc/DenseVector.h +++ b/lib/atc/DenseVector.h @@ -16,9 +16,9 @@ class DenseVector : public Vector { public: explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); } - DenseVector(const DenseVector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const Vector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(NULL) { copy(ptr,nrows); } + DenseVector(const DenseVector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const Vector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(nullptr) { copy(ptr,nrows); } virtual ~DenseVector() { _delete(); } //* resizes the Vector, ignores nCols, optionally copys what fits @@ -123,7 +123,7 @@ template inline void DenseVector::_create(INDEX n, bool zero) { _size=n; - _data = _size ? new T [_size] : NULL ; + _data = _size ? new T [_size] : nullptr ; if (zero) this->zero(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/lib/atc/DiagonalMatrix.h b/lib/atc/DiagonalMatrix.h index ca3001f22..b24e19dd4 100644 --- a/lib/atc/DiagonalMatrix.h +++ b/lib/atc/DiagonalMatrix.h @@ -205,7 +205,7 @@ DiagonalMatrix operator-(const DiagonalMatrix &A, const DiagonalMatrix //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) - : _data(NULL) + : _data(nullptr) { reset(rows, zero); } @@ -214,7 +214,7 @@ DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(c); } @@ -223,7 +223,7 @@ DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const Vector& v) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(v); } diff --git a/lib/atc/DislocationExtractor.h b/lib/atc/DislocationExtractor.h index c2bfe27e0..a0ba3aa99 100644 --- a/lib/atc/DislocationExtractor.h +++ b/lib/atc/DislocationExtractor.h @@ -197,7 +197,7 @@ protected: a.pos.Y = atom->x[i][1]; a.pos.Z = atom->x[i][2]; a.flags = 0; - a.cluster = NULL; + a.cluster = nullptr; a.numNeighbors = 0; a.setFlag(ATOM_IS_LOCAL_ATOM); } @@ -290,7 +290,7 @@ protected: currentAtom->pos.Y = atom->x[i][1]; currentAtom->pos.Z = atom->x[i][2]; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -302,7 +302,7 @@ protected: // Receive atoms from other processors. for(int iproc = 1; iproc < comm->nprocs; iproc++) { MPI_Status status; - MPI_Recv(buffer.empty() ? NULL : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); + MPI_Recv(buffer.empty() ? nullptr : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); int ndoubles; MPI_Get_count(&status, MPI_DOUBLE, &ndoubles); int nReceived = ndoubles / 3; @@ -314,7 +314,7 @@ protected: currentAtom->pos.Y = *data++; currentAtom->pos.Z = *data++; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -332,11 +332,11 @@ protected: *data++ = atom->x[i][2]; } // Send local atom coordinates to master proc. - MPI_Send(buffer.empty() ? NULL : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); + MPI_Send(buffer.empty() ? nullptr : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); } // Make sure all input atoms are wrapped at periodic boundary conditions. - wrapInputAtoms(NULL_VECTOR); + wrapInputAtoms(nullptr_VECTOR); // Build nearest neighbor lists. buildNearestNeighborLists(); @@ -376,7 +376,7 @@ protected: } } // Broadcast segments. - MPI_Bcast(segmentBuffer.empty() ? NULL : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(segmentBuffer.empty() ? nullptr : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract segments from receive buffer. @@ -402,7 +402,7 @@ protected: DISLOCATIONS_ASSERT(sendItem == pointBuffer.end()); } // Broadcast segments. - MPI_Bcast(pointBuffer.empty() ? NULL : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(pointBuffer.empty() ? nullptr : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract points from receive buffer. diff --git a/lib/atc/ElasticTimeIntegrator.cpp b/lib/atc/ElasticTimeIntegrator.cpp index 5e11f1584..785568cbb 100644 --- a/lib/atc/ElasticTimeIntegrator.cpp +++ b/lib/atc/ElasticTimeIntegrator.cpp @@ -184,8 +184,8 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicDisplacement_(NULL), - nodalAtomicForce_(NULL) + nodalAtomicDisplacement_(nullptr), + nodalAtomicForce_(nullptr) { // do nothing } @@ -410,9 +410,9 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), - nodalAtomicDisplacement_(NULL), + nodalAtomicDisplacement_(nullptr), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), nodalAtomicVelocityOld_(atc_->num_nodes(),atc_->nsd()) { @@ -633,7 +633,7 @@ namespace ATC { FluidsTimeIntegratorGear::FluidsTimeIntegratorGear(MomentumTimeIntegrator * momentumTimeIntegrator) : MomentumIntegrationMethod(momentumTimeIntegrator), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), atomicVelocityDelta_(atc_->num_nodes(),atc_->nsd()), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), diff --git a/lib/atc/ElectronHeatFlux.h b/lib/atc/ElectronHeatFlux.h index d0bc2a44f..4c5b6200d 100644 --- a/lib/atc/ElectronHeatFlux.h +++ b/lib/atc/ElectronHeatFlux.h @@ -17,7 +17,7 @@ namespace ATC { class ElectronHeatFlux { public: - ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFlux() {}; /** computes heat flux */ virtual void electron_heat_flux(const FIELD_MATS &fields, @@ -68,7 +68,7 @@ namespace ATC { { public: ElectronHeatFluxLinear(std::fstream &matfile,std::map & parameters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxLinear() {}; virtual void electron_heat_flux(const FIELD_MATS & /* fields */, const GRAD_FIELD_MATS &gradFields, @@ -95,7 +95,7 @@ namespace ATC { { public: ElectronHeatFluxPowerLaw(std::fstream &matfile,std::map ¶meters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxPowerLaw() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, @@ -134,8 +134,8 @@ ctivity proportional to the ratio of the electron and phonon temperatures with t public: ElectronHeatFluxThermopower(std::fstream &matfile, std::map & parameters, - /*const*/ ElectronFlux * electronFlux = NULL, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronFlux * electronFlux = nullptr, + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxThermopower() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, diff --git a/lib/atc/ExtrinsicModel.cpp b/lib/atc/ExtrinsicModel.cpp index b20b2a26d..8e0079d96 100644 --- a/lib/atc/ExtrinsicModel.cpp +++ b/lib/atc/ExtrinsicModel.cpp @@ -114,7 +114,7 @@ namespace ATC { ATC::LammpsInterface::instance()->print_msg_once(ss.str()); myModel = new ExtrinsicModelElectrostatic (this,modelType,matFileName); - } else myModel = NULL; + } else myModel = nullptr; extrinsicModels_.push_back(myModel); // add new fields to fields data @@ -157,7 +157,7 @@ namespace ATC { for(imodel=extrinsicModels_.begin(); imodel!=extrinsicModels_.end(); imodel++) { if ((*imodel)->model_type()==type) return *imodel; } - return NULL; + return nullptr; } @@ -343,7 +343,7 @@ namespace ATC { atc_(modelManager->atc()), modelManager_(modelManager), modelType_(modelType), - physicsModel_(NULL) + physicsModel_(nullptr) { rhsMaskIntrinsic_.reset(NUM_FIELDS,NUM_FLUX); rhsMaskIntrinsic_ = false; diff --git a/lib/atc/ExtrinsicModelDriftDiffusion.cpp b/lib/atc/ExtrinsicModelDriftDiffusion.cpp index f9b93a147..a9d8f2760 100644 --- a/lib/atc/ExtrinsicModelDriftDiffusion.cpp +++ b/lib/atc/ExtrinsicModelDriftDiffusion.cpp @@ -38,17 +38,17 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelTwoTemperature(modelManager,modelType,matFileName), - continuityIntegrator_(NULL), + continuityIntegrator_(nullptr), poissonSolverType_(DIRECT), // ITERATIVE | DIRECT - poissonSolver_(NULL), + poissonSolver_(nullptr), baseSize_(0), electronDensityEqn_(ELECTRON_CONTINUITY), fluxUpdateFreq_(1), schrodingerSolverType_(DIRECT), // ITERATIVE | DIRECT - schrodingerSolver_(NULL), + schrodingerSolver_(nullptr), schrodingerPoissonMgr_(), - schrodingerPoissonSolver_(NULL), + schrodingerPoissonSolver_(nullptr), maxConsistencyIter_(0), maxConstraintIter_(1), safe_dEf_(0.1), Ef_shift_(0.0), oneD_(false), oneDcoor_(0), oneDconserve_(0) @@ -351,7 +351,7 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelDriftDiffusion(modelManager,modelType,matFileName), - cddmPoissonSolver_(NULL), + cddmPoissonSolver_(nullptr), baseSize_(0) { // delete base class's version of the physics model diff --git a/lib/atc/ExtrinsicModelElectrostatic.cpp b/lib/atc/ExtrinsicModelElectrostatic.cpp index ef3aa52de..d0aa56d67 100644 --- a/lib/atc/ExtrinsicModelElectrostatic.cpp +++ b/lib/atc/ExtrinsicModelElectrostatic.cpp @@ -38,15 +38,15 @@ namespace ATC { poissonSolverType_(DIRECT), // ITERATIVE | DIRECT poissonSolverTol_(0), poissonSolverMaxIter_(0), - poissonSolver_(NULL), + poissonSolver_(nullptr), maxSolves_(0), baseSize_(0), - chargeRegulator_(NULL), + chargeRegulator_(nullptr), useSlab_(false), includeShortRange_(true), - atomForces_(NULL), - nodalAtomicCharge_(NULL), - nodalAtomicGhostCharge_(NULL) + atomForces_(nullptr), + nodalAtomicCharge_(nullptr), + nodalAtomicGhostCharge_(nullptr) { physicsModel_ = new PhysicsModelSpeciesElectrostatic(matFileName); // set up correct masks for coupling diff --git a/lib/atc/ExtrinsicModelTwoTemperature.cpp b/lib/atc/ExtrinsicModelTwoTemperature.cpp index 2be6cfeb3..35846fe49 100644 --- a/lib/atc/ExtrinsicModelTwoTemperature.cpp +++ b/lib/atc/ExtrinsicModelTwoTemperature.cpp @@ -26,7 +26,7 @@ namespace ATC { string matFileName) : ExtrinsicModel(modelManager,modelType,matFileName), electronTimeIntegration_(TimeIntegrator::IMPLICIT), - temperatureIntegrator_(NULL), + temperatureIntegrator_(nullptr), nsubcycle_(1), exchangeFlag_(true), baseSize_(0) @@ -164,7 +164,7 @@ namespace ATC { rhsMask(ELECTRON_TEMPERATURE,i) = atc_->fieldMask_(ELECTRON_TEMPERATURE,i); } if (electronTimeIntegration_ == TimeIntegrator::NONE) { - temperatureIntegrator_ = NULL; + temperatureIntegrator_ = nullptr; return; } if (temperatureIntegrator_) delete temperatureIntegrator_; diff --git a/lib/atc/FE_Element.cpp b/lib/atc/FE_Element.cpp index 0d2fc036c..299b9f191 100644 --- a/lib/atc/FE_Element.cpp +++ b/lib/atc/FE_Element.cpp @@ -36,7 +36,7 @@ static const double localCoordinatesTolerance = 1.e-09; tolerance_(localCoordinatesTolerance), projectionGuess_(COORDINATE_ALIGNED) { - feInterpolate_ = NULL; + feInterpolate_ = nullptr; } FE_Element::~FE_Element() diff --git a/lib/atc/FE_Engine.cpp b/lib/atc/FE_Engine.cpp index 5e01709b1..9e3c5180e 100644 --- a/lib/atc/FE_Engine.cpp +++ b/lib/atc/FE_Engine.cpp @@ -32,7 +32,7 @@ namespace ATC{ //----------------------------------------------------------------- FE_Engine::FE_Engine(MPI_Comm comm) : communicator_(comm), - feMesh_(NULL), + feMesh_(nullptr), initialized_(false), outputManager_() { diff --git a/lib/atc/FE_Engine.h b/lib/atc/FE_Engine.h index eb59f04ee..ade7626f8 100644 --- a/lib/atc/FE_Engine.h +++ b/lib/atc/FE_Engine.h @@ -90,7 +90,7 @@ namespace ATC { /** write data: data is arrayed over _unique_ nodes and then mapped by the engine */ - void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=NULL); + void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=nullptr); void write_data(double time, OUTPUT_LIST *data); void write_restart_file(std::string fileName, RESTART_LIST *data) @@ -150,7 +150,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute tangent matrix for a pair of fields - given quadrature */ void compute_tangent_matrix(const RHS_MASK &rhsMask, @@ -162,7 +162,7 @@ namespace ATC { const SPAR_MAT &N, const SPAR_MAT_VEC &dN, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a consistent mass matrix for a field */ void compute_mass_matrix( @@ -171,7 +171,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, CON_MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a dimensionless mass matrix */ void compute_mass_matrix(SPAR_MAT &mass_matrix) const; @@ -191,7 +191,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute dimensional lumped mass matrix using given quadrature */ void compute_lumped_mass_matrix( @@ -212,7 +212,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, FIELD_MATS &energy, - const DenseMatrix *elementMask=NULL, + const DenseMatrix *elementMask=nullptr, const IntegrationDomainType domain=FULL_DOMAIN) const; /** compute residual or RHS of the dynamic weak eqn */ @@ -223,7 +223,7 @@ namespace ATC { const Array &elementMaterials, FIELDS &rhs, bool freeOnly=false, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute RHS for given quadrature */ void compute_rhs_vector(const RHS_MASK &rhsMask, @@ -251,7 +251,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, GRAD_FIELD_MATS &flux, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute the flux on the MD/FE boundary */ void compute_boundary_flux(const RHS_MASK &rhsMask, @@ -272,8 +272,8 @@ namespace ATC { const SPAR_MAT_VEC &dN, const DIAG_MAT &flux_mask, FIELDS &rhs, - const DenseMatrix *elementMask=NULL, - const std::set *nodeSet=NULL) const; + const DenseMatrix *elementMask=nullptr, + const std::set *nodeSet=nullptr) const; /** compute prescribed flux given an array of functions of x & t */ void add_fluxes(const Array &fieldMask, @@ -465,7 +465,7 @@ namespace ATC { int nsd() const { return feMesh_->num_spatial_dimensions(); } /** return if the FE mesh has been created */ - int has_mesh() const { return feMesh_!=NULL; } + int has_mesh() const { return feMesh_!=nullptr; } /** get nodal coordinates for a given element */ void element_coordinates(const int eltIdx, DENS_MAT &coords) diff --git a/lib/atc/FE_Mesh.cpp b/lib/atc/FE_Mesh.cpp index 4ea10a681..6af29ee37 100644 --- a/lib/atc/FE_Mesh.cpp +++ b/lib/atc/FE_Mesh.cpp @@ -46,7 +46,7 @@ namespace ATC { partitioned_(false), nNodes_(0), nNodesUnique_(0), - feElement_(NULL), + feElement_(nullptr), twoDimensional_(false), hasPlanarFaces_(false) @@ -1708,7 +1708,7 @@ namespace ATC { const Array< pair< string, set > > *nodeSets): FE_Mesh(), minEltSize_(0), - tree_(NULL) + tree_(nullptr) { // Pick which element class to make if (elementType == "HEX8") { @@ -1774,7 +1774,7 @@ namespace ATC { } // Insert nodes and elements into KD-tree for PIE search. - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); } @@ -2107,7 +2107,7 @@ namespace ATC { // use the KD tree for partitioning, getting more blocks than // processors - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); @@ -2519,7 +2519,7 @@ namespace ATC { const double zscale) : hx_(hx), hy_(hy), hz_(hz) { - tree_ = NULL; + tree_ = nullptr; hasPlanarFaces_ = true; xscale_ = xscale; yscale_ = yscale; @@ -2820,7 +2820,7 @@ namespace ATC { const double zscale) { hasPlanarFaces_ = true; - tree_ = NULL; + tree_ = nullptr; xscale_ = xscale; yscale_ = yscale; zscale_ = zscale; diff --git a/lib/atc/FieldEulerIntegrator.cpp b/lib/atc/FieldEulerIntegrator.cpp index 0abc71cba..ba23af40c 100644 --- a/lib/atc/FieldEulerIntegrator.cpp +++ b/lib/atc/FieldEulerIntegrator.cpp @@ -112,7 +112,7 @@ FieldImplicitDirectEulerIntegrator::FieldImplicitDirectEulerIntegrator( const Array2D< bool > & rhsMask, // copy const double alpha ) : FieldEulerIntegrator(fieldName,physicsModel,feEngine,atc,rhsMask), - alpha_(alpha),solver_(NULL) + alpha_(alpha),solver_(nullptr) { rhsMask_(fieldName_,FLUX) = false; // handle laplacian term with stiffness const BC_SET & bcs = (atc_->prescribed_data_manager()->bcs(fieldName_))[0]; diff --git a/lib/atc/FieldManager.cpp b/lib/atc/FieldManager.cpp index 338f06aca..8a7fb0d50 100644 --- a/lib/atc/FieldManager.cpp +++ b/lib/atc/FieldManager.cpp @@ -271,7 +271,7 @@ typedef PerAtomQuantity PAQ; u = new AtfShapeFunctionMdProjection(atc_,restricted,VELOCITY); } else { - DENS_MAN * q = NULL; + DENS_MAN * q = nullptr; if (atc_->kernel_on_the_fly()) { if (atc_->kernel_based()) { q = new OnTheFlyKernelAccumulationNormalized(atc_, atomic, diff --git a/lib/atc/FieldManager.h b/lib/atc/FieldManager.h index 9a9867641..b12db230c 100644 --- a/lib/atc/FieldManager.h +++ b/lib/atc/FieldManager.h @@ -47,7 +47,7 @@ namespace ATC { case SPECIES_FLUX: return species_flux(name); case INTERNAL_ENERGY: return internal_energy(name); case ENERGY: return energy(name); - default: throw ATC_Error("FieldManager:: unknown field"); return NULL; + default: throw ATC_Error("FieldManager:: unknown field"); return nullptr; } } CanonicalName string_to_canonical_name(std::string name){ @@ -83,11 +83,11 @@ namespace ATC { case PROLONGED_VELOCITY: return prolonged_field(VELOCITY); default: - throw ATC_Error("FieldManager:: unknown PAQ"); return NULL; + throw ATC_Error("FieldManager:: unknown PAQ"); return nullptr; } } /** this function returns a restriction of atomic data */ - DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = NULL); + DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = nullptr); protected: ATC_Method * atc_; InterscaleManager & interscaleManager_; @@ -120,10 +120,10 @@ namespace ATC { PAQ * atomic_species_vector(); // internal functions - DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = NULL); - DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = NULL); - DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = NULL); - DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return NULL;}; + DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = nullptr); + DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = nullptr); + DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = nullptr); + DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return nullptr;}; PAQ * prolonged_field(FieldName field); private: FieldManager(void); diff --git a/lib/atc/Function.cpp b/lib/atc/Function.cpp index 062cbcb9b..e73d64aae 100644 --- a/lib/atc/Function.cpp +++ b/lib/atc/Function.cpp @@ -26,13 +26,13 @@ namespace ATC { //==================================================================== // UXT_Function_Mgr //==================================================================== - UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = NULL; + UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- UXT_Function_Mgr * UXT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new UXT_Function_Mgr(); } return myInstance_; @@ -90,7 +90,7 @@ namespace ATC { { string tag = other->tag(); - UXT_Function * returnFunction = NULL; + UXT_Function * returnFunction = nullptr; if (tag=="linear") { ScalarLinearFunction * other_cast = (ScalarLinearFunction*) other; returnFunction = new ScalarLinearFunction(*other_cast); @@ -144,14 +144,14 @@ namespace ATC { // XT_Function_Mgr //-------------------------------------------------------------------- //-------------------------------------------------------------------- -XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; +XT_Function_Mgr * XT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- XT_Function_Mgr * XT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new XT_Function_Mgr(); } return myInstance_; @@ -227,7 +227,7 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; { string tag = other->tag(); - XT_Function * returnFunction = NULL; + XT_Function * returnFunction = nullptr; if (tag=="linear") { LinearFunction * other_cast = (LinearFunction*) other; returnFunction = new LinearFunction(*other_cast); diff --git a/lib/atc/FundamentalAtomicQuantity.cpp b/lib/atc/FundamentalAtomicQuantity.cpp index 0ebb54e16..63824bd0d 100644 --- a/lib/atc/FundamentalAtomicQuantity.cpp +++ b/lib/atc/FundamentalAtomicQuantity.cpp @@ -126,7 +126,7 @@ namespace ATC { double unitsConversion, AtomType atomType) : ShallowAtomQuantity(atc,0,atomType), - computePointer_(NULL), + computePointer_(nullptr), computeTag_(tag), unitsConversion_(unitsConversion) { diff --git a/lib/atc/FundamentalAtomicQuantity.h b/lib/atc/FundamentalAtomicQuantity.h index 5fb525cd6..d5cf9f8a2 100644 --- a/lib/atc/FundamentalAtomicQuantity.h +++ b/lib/atc/FundamentalAtomicQuantity.h @@ -131,11 +131,11 @@ namespace ATC { /** gets appropriate pointer for lammps data */ virtual double * lammps_scalar() const - {return NULL;}; + {return nullptr;}; /** gets appropriate pointer for lammps data */ virtual double ** lammps_vector() const - {return NULL;}; + {return nullptr;}; private: diff --git a/lib/atc/GhostManager.cpp b/lib/atc/GhostManager.cpp index 77594ec40..1482a5a47 100644 --- a/lib/atc/GhostManager.cpp +++ b/lib/atc/GhostManager.cpp @@ -23,7 +23,7 @@ namespace ATC { // Constructor //-------------------------------------------------------- GhostManager::GhostManager(ATC_Method * atc) : - ghostModifier_(NULL), + ghostModifier_(nullptr), atc_(atc), boundaryDynamics_(NO_BOUNDARY_DYNAMICS), needReset_(true) @@ -116,7 +116,7 @@ namespace ATC { { if (ghostModifier_) { delete ghostModifier_; - ghostModifier_ = NULL; + ghostModifier_ = nullptr; } if (!atc_->groupbit_ghost()) { @@ -252,7 +252,7 @@ namespace ATC { //-------------------------------------------------------- GhostModifier::GhostModifier(GhostManager * ghostManager) : ghostManager_(ghostManager), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), integrateAtoms_(false) { // do nothing @@ -321,9 +321,9 @@ namespace ATC { //-------------------------------------------------------- GhostModifierPrescribed::GhostModifierPrescribed(GhostManager * ghostManager) : GhostModifier(ghostManager), - atomPositions_(NULL), - atomFeDisplacement_(NULL), - atomRefPositions_(NULL) + atomPositions_(nullptr), + atomFeDisplacement_(nullptr), + atomRefPositions_(nullptr) { // do nothing } @@ -382,9 +382,9 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierPrescribed(ghostManager), - atomVelocities_(NULL), - atomFeVelocity_(NULL), - atomForces_(NULL), + atomVelocities_(nullptr), + atomFeVelocity_(nullptr), + atomForces_(nullptr), kappa_(kappa), gamma_(gamma), mu_(mu) @@ -486,8 +486,8 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierDampedHarmonic(ghostManager,kappa,gamma,mu), - ghostToBoundaryDistance_(NULL), - layerId_(NULL) + ghostToBoundaryDistance_(nullptr), + layerId_(nullptr) { // do nothing @@ -731,8 +731,8 @@ namespace ATC { GhostModifier(ghostManager), lammpsInterface_(LammpsInterface::instance()), elementSet_((((ghostManager_->atc())->fe_engine())->fe_mesh())->elementset((ghostManager_->atc())->internal_element_set())), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalToAtom_((ghostManager_->atc())->internal_to_atom_map()), ghostToAtom_((ghostManager_->atc())->ghost_to_atom_map()), groupbit_((ghostManager_->atc())->groupbit()), diff --git a/lib/atc/InterscaleOperators.cpp b/lib/atc/InterscaleOperators.cpp index f1e5607b6..eeac14adf 100644 --- a/lib/atc/InterscaleOperators.cpp +++ b/lib/atc/InterscaleOperators.cpp @@ -30,7 +30,7 @@ namespace ATC{ for (unsigned int i = 0; i < NUM_ATOM_TYPES; i++) { fundamentalAtomQuantities_[i].resize(LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES); for (unsigned int j = 0; j < LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES; j++) - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } @@ -126,7 +126,7 @@ namespace ATC{ if (fundamentalAtomQuantities_[i][j]) { index = dfs_visit(fundamentalAtomQuantities_[i][j],index); if ((fundamentalAtomQuantities_[i][j])->memory_type()==TEMPORARY) { - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } } @@ -453,7 +453,7 @@ namespace ATC{ DependencyManager * InterscaleManager::find(const string & tag) { // REFACTOR add check for duplicate entries - DependencyManager * quantity = NULL; + DependencyManager * quantity = nullptr; quantity = find_in_list(perAtomQuantities_,tag); if (quantity) return quantity; @@ -482,7 +482,7 @@ namespace ATC{ quantity = find_in_list(smallMoleculeSets_,tag); if (quantity) return quantity; - return NULL; + return nullptr; } //-------------------------------------------------------- diff --git a/lib/atc/InterscaleOperators.h b/lib/atc/InterscaleOperators.h index 3a4d81212..40c5144bf 100644 --- a/lib/atc/InterscaleOperators.h +++ b/lib/atc/InterscaleOperators.h @@ -277,7 +277,7 @@ namespace ATC { data * return_quantity(std::map & list, const std::string & tag) { typename std::map::iterator it = list.find(tag); - if (it==list.end()) return NULL; + if (it==list.end()) return nullptr; return it->second; } @@ -310,7 +310,7 @@ namespace ATC { { typename std::map::iterator it = list.find(tag); if (it!=list.end()) return it->second; - return NULL; + return nullptr; } /** helper function to force the reset of all data in a list */ diff --git a/lib/atc/KD_Tree.cpp b/lib/atc/KD_Tree.cpp index 1432663e8..181be27dc 100644 --- a/lib/atc/KD_Tree.cpp +++ b/lib/atc/KD_Tree.cpp @@ -83,17 +83,17 @@ KD_Tree::KD_Tree(vector *points, vector *elements, if (foundElemRight) rightElems->push_back(*elit); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - leftElems->size() < 4 || leftElems->size() == 0) { - leftChild_ = NULL; + leftChild_ = nullptr; delete leftPts; delete leftElems; } else { leftChild_ = new KD_Tree(leftPts, leftElems, (dimension+1) % 3); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - rightElems->size() < 4 || rightElems->size() == 0) { - rightChild_ = NULL; + rightChild_ = nullptr; delete rightPts; delete rightElems; } else { @@ -109,7 +109,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { // tree, either recurse to the left or return this node's elements // if there is no left child. if (query.lessThanInDimension(value_, dimension)) { - if (leftChild_ == NULL) { + if (leftChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -119,7 +119,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { } return leftChild_->find_nearest_elements(query, (dimension+1) % 3); } else { - if (rightChild_ == NULL) { + if (rightChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -147,7 +147,7 @@ vector > KD_Tree::getElemIDs(int depth) { sort(candElemIDs.begin(), candElemIDs.end()); result.push_back(candElemIDs); - } else if (leftChild_ == NULL || rightChild_ == NULL) { + } else if (leftChild_ == nullptr || rightChild_ == nullptr) { // Insert all nodes at this level once, // then insert a bunch of empty vectors. temp = this->getElemIDs(0); diff --git a/lib/atc/KernelFunction.cpp b/lib/atc/KernelFunction.cpp index 70a1616e0..6095c1428 100644 --- a/lib/atc/KernelFunction.cpp +++ b/lib/atc/KernelFunction.cpp @@ -20,13 +20,13 @@ namespace ATC { //======================================================================== // KernelFunctionMgr //======================================================================== - KernelFunctionMgr * KernelFunctionMgr::myInstance_ = NULL; + KernelFunctionMgr * KernelFunctionMgr::myInstance_ = nullptr; //------------------------------------------------------------------------ // instance //------------------------------------------------------------------------ KernelFunctionMgr * KernelFunctionMgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new KernelFunctionMgr(); } return myInstance_; @@ -65,7 +65,7 @@ namespace ATC { No default */ int argIdx = 0; - KernelFunction * ptr = NULL; + KernelFunction * ptr = nullptr; char* type = arg[argIdx++]; if (strcmp(type,"step")==0) { double parameters[1] = {atof(arg[argIdx])}; // cutoff radius diff --git a/lib/atc/KinetoThermostat.cpp b/lib/atc/KinetoThermostat.cpp index c10f7eb45..89d598c10 100644 --- a/lib/atc/KinetoThermostat.cpp +++ b/lib/atc/KinetoThermostat.cpp @@ -151,7 +151,7 @@ namespace ATC { VelocityRescaleCombined::VelocityRescaleCombined(AtomicRegulator * kinetostat) : VelocityGlc(kinetostat), velocity_(atc_->field(VELOCITY)), - thermostatCorrection_(NULL) + thermostatCorrection_(nullptr) { // do nothing } @@ -188,7 +188,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleCombined::ThermostatRescaleCombined(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -226,14 +226,14 @@ namespace ATC { KinetoThermostatRescale::KinetoThermostatRescale(AtomicRegulator * kinetoThermostat, int couplingMaxIterations) : KinetoThermostatShapeFunction(kinetoThermostat,couplingMaxIterations), - atomVelocities_(NULL), + atomVelocities_(nullptr), nodalVelocities_(atc_->field(VELOCITY)), - lambdaMomentum_(NULL), - lambdaEnergy_(NULL), - atomicFluctuatingVelocityRescaled_(NULL), - atomicStreamingVelocity_(NULL), - thermostat_(NULL), - kinetostat_(NULL) + lambdaMomentum_(nullptr), + lambdaEnergy_(nullptr), + atomicFluctuatingVelocityRescaled_(nullptr), + atomicStreamingVelocity_(nullptr), + thermostat_(nullptr), + kinetostat_(nullptr) { thermostat_ = this->construct_rescale_thermostat(); kinetostat_ = new VelocityRescaleCombined(kinetoThermostat); @@ -389,7 +389,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePeCombined::ThermostatRescaleMixedKePeCombined(AtomicRegulator * thermostat) : ThermostatRescaleMixedKePe(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -458,21 +458,21 @@ namespace ATC { velocity_(atc_->field(VELOCITY)), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomRegulatorForces_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), - atomVelocities_(NULL), + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomRegulatorForces_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), + atomVelocities_(nullptr), isFirstTimestep_(true), - nodalAtomicMomentum_(NULL), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL), + nodalAtomicMomentum_(nullptr), + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr), dtFactor_(0.) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize diff --git a/lib/atc/Kinetostat.cpp b/lib/atc/Kinetostat.cpp index 7f95398dc..676896a2f 100644 --- a/lib/atc/Kinetostat.cpp +++ b/lib/atc/Kinetostat.cpp @@ -307,11 +307,11 @@ namespace ATC { RegulatorShapeFunction(kinetostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(VELOCITY)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - atomKinetostatForce_(NULL), - atomVelocities_(NULL), - atomMasses_(NULL) + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + atomKinetostatForce_(nullptr), + atomVelocities_(nullptr), + atomMasses_(nullptr) { // data associated with stage 3 in ATC_Method::initialize lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaMomentum",nsd_); @@ -376,7 +376,7 @@ namespace ATC { //-------------------------------------------------------- GlcKinetostat::GlcKinetostat(AtomicRegulator *kinetostat) : KinetostatShapeFunction(kinetostat), - atomPositions_(NULL) + atomPositions_(nullptr) { // do nothing } @@ -462,7 +462,7 @@ namespace ATC { //-------------------------------------------------------- DisplacementGlc::DisplacementGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMassWeightedDisplacement_(NULL), + nodalAtomicMassWeightedDisplacement_(nullptr), nodalDisplacements_(atc_->field(DISPLACEMENT)) { // do nothing @@ -763,7 +763,7 @@ namespace ATC { //-------------------------------------------------------- VelocityGlc::VelocityGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalVelocities_(atc_->field(VELOCITY)) { // do nothing @@ -1095,8 +1095,8 @@ namespace ATC { StressFlux::StressFlux(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), nodalForce_(atc_->field_rhs(VELOCITY)), - nodalAtomicForce_(NULL), - nodalGhostForce_(NULL), + nodalAtomicForce_(nullptr), + nodalGhostForce_(nullptr), momentumSource_(atc_->atomic_source(VELOCITY)) { // flag for performing boundary flux calculation @@ -1540,14 +1540,14 @@ namespace ATC { KinetostatShapeFunction(kinetostat,regulatorPrefix), velocity_(atc_->field(VELOCITY)), //timeFilter_(atomicRegulator_->time_filter()), - //nodalAtomicLambdaForce_(NULL), - //lambdaPowerFiltered_(NULL), - //atomKinetostatForces_(NULL), - //atomMasses_(NULL), - nodalAtomicMomentum_(NULL), + //nodalAtomicLambdaForce_(nullptr), + //lambdaPowerFiltered_(nullptr), + //atomKinetostatForces_(nullptr), + //atomMasses_(nullptr), + nodalAtomicMomentum_(nullptr), isFirstTimestep_(true), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), dtFactor_(0.) { // constuct/obtain data corresponding to stage 3 of ATC_Method::initialize @@ -1796,8 +1796,8 @@ namespace ATC { const string & regulatorPrefix) : KinetostatGlcFs(kinetostat,regulatorPrefix), momentumSource_(atc_->atomic_source(VELOCITY)), - nodalGhostForce_(NULL), - nodalGhostForceFiltered_(NULL) + nodalGhostForce_(nullptr), + nodalGhostForceFiltered_(nullptr) { // flag for performing boundary flux calculation fieldMask_(VELOCITY,FLUX) = true; @@ -2403,9 +2403,9 @@ namespace ATC { KinetostatFluxFixed::KinetostatFluxFixed(AtomicRegulator * kinetostat, bool constructKinetostats) : RegulatorMethod(kinetostat), - kinetostatFlux_(NULL), - kinetostatFixed_(NULL), - kinetostatBcs_(NULL) + kinetostatFlux_(nullptr), + kinetostatFixed_(nullptr), + kinetostatBcs_(nullptr) { if (constructKinetostats) { if (kinetostat->coupling_mode(VELOCITY) == AtomicRegulator::GHOST_FLUX) { diff --git a/lib/atc/LammpsInterface.cpp b/lib/atc/LammpsInterface.cpp index 9964a1c4b..5727af190 100644 --- a/lib/atc/LammpsInterface.cpp +++ b/lib/atc/LammpsInterface.cpp @@ -58,14 +58,14 @@ const static int MAX_GROUP_BIT = 2147483647; //4294967295; // pow(2,31)-1; double norm(double * v) {return sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); } -LammpsInterface * LammpsInterface::myInstance_ = NULL; +LammpsInterface * LammpsInterface::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- LammpsInterface * LammpsInterface::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new LammpsInterface(); } return myInstance_; @@ -77,7 +77,7 @@ LammpsInterface * LammpsInterface::instance() void LammpsInterface::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } @@ -85,13 +85,13 @@ void LammpsInterface::Destroy() // constructor // ----------------------------------------------------------------- LammpsInterface::LammpsInterface() - : lammps_(NULL), - fixPointer_(NULL), + : lammps_(nullptr), + fixPointer_(nullptr), commRank_(0), - atomPE_(NULL), + atomPE_(nullptr), refBoxIsSet_(false), - random_(NULL), - globalrandom_(NULL) + random_(nullptr), + globalrandom_(nullptr) { } @@ -225,7 +225,7 @@ void LammpsInterface::sparse_allsum(SparseMatrix &toShare) const std::string LammpsInterface::read_file(std::string filename) const { - FILE *fp = NULL; + FILE *fp = nullptr; if (! comm_rank()) { fp = fopen(filename.c_str(),"r"); if (!fp) throw ATC_Error("can't open file: "+filename); @@ -343,7 +343,7 @@ double * LammpsInterface::atom_scalar(FundamentalAtomQuantity quantityType) cons } else throw ATC_Error("BAD type requested in atom_scalar"); - return NULL; + return nullptr; } double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) const @@ -356,7 +356,7 @@ double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) con return fatom(); else throw ATC_Error("BAD type requested in atom_vector"); - return NULL; + return nullptr; } int LammpsInterface::atom_quantity_ndof(FundamentalAtomQuantity quantityType) const @@ -948,10 +948,10 @@ POTENTIAL LammpsInterface::potential() const "lj/cut/coul/long", "lj/cut/coul/cut", "lj/charmm/coul/long"}; - LAMMPS_NS::Pair *pair = NULL; + LAMMPS_NS::Pair *pair = nullptr; for (int i = 0; i < nStyles; i++){ pair = lammps_->force->pair_match(pairStyles[i].c_str(),1); - if (pair != NULL) break; + if (pair != nullptr) break; } return pair; } @@ -979,8 +979,8 @@ bool LammpsInterface::epsilons(int itype, POTENTIAL pair, double * epsilon0) con int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); int i1,i2; for (int i=1; i < ntypes()+1; i++) { if (i < itype) { i1 = i; i2 = itype; } @@ -998,8 +998,8 @@ bool LammpsInterface::set_epsilons(int itype, POTENTIAL pair, double * epsilon) int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); // scale interactions int i1,i2; for (int i = 1; i < ntypes()+1; i++) { @@ -1498,7 +1498,7 @@ double * LammpsInterface::compute_pe_peratom(void) const return atomPE_->vector_atom; } else { - return NULL; + return nullptr; } } @@ -1542,7 +1542,7 @@ LAMMPS_NS::PairEAM* LammpsInterface::pair_eam() const // return lammps_->force->pair; //} LAMMPS_NS::PairEAM* pair_eam = dynamic_cast (lammps_->force->pair); - if (pair_eam != NULL) { + if (pair_eam != nullptr) { return pair_eam; } else { diff --git a/lib/atc/LammpsInterface.h b/lib/atc/LammpsInterface.h index 2032571da..6883a9ca0 100644 --- a/lib/atc/LammpsInterface.h +++ b/lib/atc/LammpsInterface.h @@ -534,7 +534,7 @@ class LammpsInterface { /** Dulong-Petit heat capacity per volume in M,L,T,t units */ double heat_capacity(void) const; /** mass per volume in reference configuraturation in M,L units */ - double mass_density(int* numPerType=NULL) const; + double mass_density(int* numPerType=nullptr) const; /** permittivity of free space, converts from LAMMPS potential units implied by the electric field units to LAMMPS charge units/LAMMPS length units (e.g., V to elemental charge/A) */ double epsilon0(void) const; double coulomb_constant(void) const; diff --git a/lib/atc/LinearSolver.cpp b/lib/atc/LinearSolver.cpp index 655d6130c..0204ddd93 100644 --- a/lib/atc/LinearSolver.cpp +++ b/lib/atc/LinearSolver.cpp @@ -35,9 +35,9 @@ LinearSolver::LinearSolver( allowReinitialization_(false), homogeneousBCs_(false), bcs_(&bcs), - rhs_(NULL), + rhs_(nullptr), rhsDense_(), - b_(NULL), + b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -65,9 +65,9 @@ LinearSolver::LinearSolver( matrixModified_(false), allowReinitialization_(false), homogeneousBCs_(false), - bcs_(NULL), // null implies no constraints will be added later - rhs_(NULL), - rhsDense_(), b_(NULL), + bcs_(nullptr), // null implies no constraints will be added later + rhs_(nullptr), + rhsDense_(), b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -343,7 +343,7 @@ void LinearSolver::set_fixed_values(VECTOR & X) void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, const DENS_MAT * M) /* const */ { initialize_matrix(); // no inverse needed - const DENS_MAT * Kp = NULL; + const DENS_MAT * Kp = nullptr; const DENS_MAT * Mp =M; DENS_MAT MM; DENS_MAT KM; @@ -388,7 +388,7 @@ void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors bool LinearSolver::solve(VECTOR & x, const VECTOR & b) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; rhs_ = &b; initialized_ = false; @@ -479,7 +479,7 @@ bool LinearSolver::solve(VECTOR & x, const VECTOR & b) void LinearSolver::greens_function(int I, VECTOR & G_I) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; diff --git a/lib/atc/LinearSolver.h b/lib/atc/LinearSolver.h index 5f456b9a1..1d429d881 100644 --- a/lib/atc/LinearSolver.h +++ b/lib/atc/LinearSolver.h @@ -64,7 +64,7 @@ class LinearSolver { allow_reinitialization must be called before first solve, etc */ void allow_reinitialization(void); // depending on method save a copy of A void set_homogeneous_bcs(void) { homogeneousBCs_ = true;} // for nonlinear solver, solve for increment - void initialize(const BC_SET * bcs = NULL); + void initialize(const BC_SET * bcs = nullptr); /** solve - solves A x = b @@ -80,7 +80,7 @@ class LinearSolver { - returns the e-values & e-vectors for constrained system Ax + v x = 0 - if M is provided the eval problem : ( A + v M ) x = 0 is solved*/ void eigen_system(DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, - const DENS_MAT * M = NULL); + const DENS_MAT * M = nullptr); /** access to penalty coefficient - if a penalty method is not being used this returns zero */ diff --git a/lib/atc/Material.cpp b/lib/atc/Material.cpp index 676a87524..64673d799 100644 --- a/lib/atc/Material.cpp +++ b/lib/atc/Material.cpp @@ -28,21 +28,21 @@ namespace ATC { Material::Material() : rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { } //-------------------------------------------------------------- @@ -70,21 +70,21 @@ namespace ATC { : tag_(tag), rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { /*! \page man_material material \section syntax diff --git a/lib/atc/MoleculeSet.h b/lib/atc/MoleculeSet.h index cffafd950..763f08ef4 100644 --- a/lib/atc/MoleculeSet.h +++ b/lib/atc/MoleculeSet.h @@ -33,7 +33,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** reset the number of atoms/molecules on this processor */ void reset_nlocal() {this->set_reset();}; @@ -108,8 +108,8 @@ namespace ATC { public: SmallMoleculeSet(ATC_Method * atc, int groupBit, - PerAtomQuantity * bondList = NULL, - PerAtomQuantity * numBond = NULL); + PerAtomQuantity * bondList = nullptr, + PerAtomQuantity * numBond = nullptr); virtual ~SmallMoleculeSet(); @@ -117,7 +117,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** access molecule atoms by lammps id */ std::set atoms_by_global_molecule(int id) const; diff --git a/lib/atc/NonLinearSolver.h b/lib/atc/NonLinearSolver.h index 010e3ee72..299408c4c 100644 --- a/lib/atc/NonLinearSolver.h +++ b/lib/atc/NonLinearSolver.h @@ -43,7 +43,7 @@ class NonLinearSolver { /** Constructor */ NonLinearSolver( TangentOperator * f, // provides f and f' at x, pointer for polymorphism - const BC_SET * bcs = NULL, + const BC_SET * bcs = nullptr, const int dof = 0, bool parallel = false ); diff --git a/lib/atc/OutputManager.cpp b/lib/atc/OutputManager.cpp index 066c240ca..83257a3d2 100644 --- a/lib/atc/OutputManager.cpp +++ b/lib/atc/OutputManager.cpp @@ -48,8 +48,8 @@ OutputManager::OutputManager(string outputPrefix, set & otypes) firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_(outputPrefix), ensightOutput_(otypes.count(ENSIGHT)), @@ -68,8 +68,8 @@ OutputManager::OutputManager() firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_("NULL"), ensightOutput_(true), @@ -132,7 +132,7 @@ void OutputManager::print_custom_names() { // Dump text-based fields to disk for later restart void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"wb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -153,7 +153,7 @@ void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) void OutputManager::read_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"rb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -230,7 +230,7 @@ void OutputManager::write_geometry_ensight(void) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; + FILE * fp=nullptr; char buffer[80]; if ( ! initialized_ ) { fp=fopen(geom_file_name.c_str(),"wb"); // open @@ -240,7 +240,7 @@ void OutputManager::write_geometry_ensight(void) else { fp=fopen(geom_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight geometry file"); } @@ -491,14 +491,14 @@ void OutputManager::write_data_ensight(string field_name, const MATRIX *field_da // open or append data file string data_file_name = filenames[ifile]; - FILE * fp=NULL; + FILE * fp=nullptr; if ( outputTimes_.size() == 1 ) { fp=fopen(data_file_name.c_str(),"wb"); // open } else { fp=fopen(data_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight data file: "+data_file_name); } @@ -799,8 +799,8 @@ void OutputManager::write_dictionary(double /* time */, OUTPUT_LIST *data) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; - if ((fp=fopen(dict_file_name.c_str(),"w")) == NULL) + FILE * fp=nullptr; + if ((fp=fopen(dict_file_name.c_str(),"w")) == nullptr) { throw ATC_Error("can not create Ensight case file"); } diff --git a/lib/atc/OutputManager.h b/lib/atc/OutputManager.h index c5a901e9f..4454d6526 100644 --- a/lib/atc/OutputManager.h +++ b/lib/atc/OutputManager.h @@ -52,13 +52,13 @@ namespace ATC { coordinates : num _total_ points/nodes X num spatial dim connectivities : num elements X num nodes per element*/ void write_geometry(const MATRIX *coordinates, - const Array2D *connectivity=NULL); + const Array2D *connectivity=nullptr); /** write data from a time step specify node_map to handle periodic soln & data */ - void write_data(double time, OUTPUT_LIST *data, const int *node_map=NULL); + void write_data(double time, OUTPUT_LIST *data, const int *node_map=nullptr); void write_data(double time, FIELDS *soln, OUTPUT_LIST *data, - const int *node_map=NULL); + const int *node_map=nullptr); /** add custom names for any field */ void add_field_names(const std::string& name, const std::vector& list) { diff --git a/lib/atc/PaqAtcUtility.cpp b/lib/atc/PaqAtcUtility.cpp index b6a2ed287..bdcf26962 100644 --- a/lib/atc/PaqAtcUtility.cpp +++ b/lib/atc/PaqAtcUtility.cpp @@ -18,7 +18,7 @@ namespace ATC { AtomType atomType) : atc_(atc), atomType_(atomType), - myNlocal(NULL) + myNlocal(nullptr) { switch (atomType_) { case ALL: diff --git a/lib/atc/ParDenseMatrix.h b/lib/atc/ParDenseMatrix.h index 1c9e75f17..873bf0f41 100644 --- a/lib/atc/ParDenseMatrix.h +++ b/lib/atc/ParDenseMatrix.h @@ -148,7 +148,7 @@ namespace ATC_matrix { #endif // Clear out the local matrix's pointer so we don't double-free - A_local._data = NULL; + A_local._data = nullptr; delete [] majorCounts; delete [] offsets; diff --git a/lib/atc/ParSparseMatrix.cpp b/lib/atc/ParSparseMatrix.cpp index 69ab2453e..77c8eb33d 100644 --- a/lib/atc/ParSparseMatrix.cpp +++ b/lib/atc/ParSparseMatrix.cpp @@ -233,8 +233,8 @@ DenseMatrix ParSparseMatrix::transMat( SparseMatrix C_local = ((SparseMatrix)A_local) * B; // destroy newA intelligently - A_local._val = NULL; - A_local._ja = NULL; + A_local._val = nullptr; + A_local._ja = nullptr; // Add all the result vectors together on each processor. sumSparse(C_local, C); @@ -285,8 +285,8 @@ void ParSparseMatrix::partition( // Prepare an A_local matrix for deletion after it has been loaded with // data members from another matrix. void ParSparseMatrix::finalize() { - _val = NULL; - _ja = NULL; + _val = nullptr; + _ja = nullptr; } void ParSparseMatrix::operator=(const SparseMatrix &source) diff --git a/lib/atc/ParSparseMatrix.h b/lib/atc/ParSparseMatrix.h index 0985115d0..b2642e87b 100644 --- a/lib/atc/ParSparseMatrix.h +++ b/lib/atc/ParSparseMatrix.h @@ -135,9 +135,9 @@ namespace ATC_matrix { Avar.hasTemplate_ = Ap.hasTemplate_; // Avoid catastrophe - Ap._val = NULL; - Ap._ja = NULL; - Ap._ia = NULL; + Ap._val = nullptr; + Ap._ja = nullptr; + Ap._ia = nullptr; } diff --git a/lib/atc/PerAtomQuantity-inl.h b/lib/atc/PerAtomQuantity-inl.h index f95e5d306..b570e7645 100644 --- a/lib/atc/PerAtomQuantity-inl.h +++ b/lib/atc/PerAtomQuantity-inl.h @@ -24,8 +24,8 @@ namespace ATC { atomType_(atomType), nCols_(nCols), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL), - lammpsVector_(NULL) + lammpsScalar_(nullptr), + lammpsVector_(nullptr) { // do nothing } @@ -452,7 +452,7 @@ namespace ATC { lammpsInterface_(LammpsInterface::instance()), atomType_(atomType), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL) + lammpsScalar_(nullptr) { // do nothing } @@ -610,8 +610,8 @@ namespace ATC { nCols_(nCols), maxEntriesPerRow_(maxEntriesPerRow), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsVector_(NULL), - lammpsColIndices_(NULL) + lammpsVector_(nullptr), + lammpsColIndices_(nullptr) { // do nothing } diff --git a/lib/atc/PerAtomQuantity.h b/lib/atc/PerAtomQuantity.h index e6cb19981..a822b6a9b 100644 --- a/lib/atc/PerAtomQuantity.h +++ b/lib/atc/PerAtomQuantity.h @@ -441,10 +441,10 @@ namespace ATC { virtual void set_lammps_to_quantity() const {}; /** gets appropriate pointer for lammps data */ - virtual T * lammps_scalar() const {return NULL;}; + virtual T * lammps_scalar() const {return nullptr;}; /** gets appropriate pointer for lammps data */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; private: @@ -1452,10 +1452,10 @@ namespace ATC { virtual void set_quantity_to_lammps() const {}; /** gets appropriate data for lammps pointer */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; /** gets appropriate data for lammps pointer to column indices */ - virtual int ** lammps_column_indices() const {return NULL;}; + virtual int ** lammps_column_indices() const {return nullptr;}; private: diff --git a/lib/atc/PerAtomQuantityLibrary.h b/lib/atc/PerAtomQuantityLibrary.h index 0089df785..3e3cb78e9 100644 --- a/lib/atc/PerAtomQuantityLibrary.h +++ b/lib/atc/PerAtomQuantityLibrary.h @@ -125,7 +125,7 @@ namespace ATC { // constructor AtomToElementMap(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -304,7 +304,7 @@ namespace ATC { // constructor AtomVolumeElement(ATC_Method * atc, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -349,7 +349,7 @@ namespace ATC { // constructor AtomVolumeRegion(ATC_Method * atc, - DENS_MAN * atomCoarseGrainingPositions = NULL, + DENS_MAN * atomCoarseGrainingPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -422,9 +422,9 @@ namespace ATC { // constructor AtomicMassWeightedDisplacement(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomReferencePositions = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomReferencePositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -462,8 +462,8 @@ namespace ATC { // constructor FluctuatingVelocity(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -497,8 +497,8 @@ namespace ATC { // constructor ChargeVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - FundamentalAtomQuantity * atomCharges = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + FundamentalAtomQuantity * atomCharges = nullptr, AtomType atomType = INTERNAL); // destructor @@ -532,8 +532,8 @@ namespace ATC { // constructor SpeciesVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - PerAtomQuantity * atomTypeVector = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + PerAtomQuantity * atomTypeVector = nullptr, AtomType atomType = INTERNAL); // destructor @@ -567,8 +567,8 @@ namespace ATC { // constructor AtomicMomentum(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -631,8 +631,8 @@ namespace ATC { // constructor TwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -670,8 +670,8 @@ namespace ATC { // constructor KineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -707,9 +707,9 @@ namespace ATC { // constructor FluctuatingKineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -747,9 +747,9 @@ namespace ATC { // constructor TwiceFluctuatingKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -793,8 +793,8 @@ namespace ATC { MixedKePeEnergy(ATC_Method * atc, double keMultiplier, double peMultiplier, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -838,8 +838,8 @@ namespace ATC { // constructor TotalEnergy(ATC_Method * atc, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -871,8 +871,8 @@ namespace ATC { // constructor FluctuatingPotentialEnergy(ATC_Method * atc, - PerAtomQuantity * potentialEnergy = NULL, - PerAtomQuantity * referencePotential = NULL, + PerAtomQuantity * potentialEnergy = nullptr, + PerAtomQuantity * referencePotential = nullptr, AtomType atomType = INTERNAL); // destructor @@ -911,8 +911,8 @@ namespace ATC { // constructor DotTwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomForces = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomForces = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -948,7 +948,7 @@ namespace ATC { // constructor VelocitySquared(ATC_Method *atc, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -981,9 +981,9 @@ namespace ATC { // constructor LambdaSquared(ATC_Method *atc, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1149,7 +1149,7 @@ namespace ATC { // constructor AtomToNodeset(ATC_Method * atc, SetDependencyManager * subsetNodes, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1194,7 +1194,7 @@ namespace ATC { // constructor AtomToElementset(ATC_Method * atc, MatrixDependencyManager * elementMask, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1273,7 +1273,7 @@ namespace ATC { // constructor VelocitySquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1307,9 +1307,9 @@ namespace ATC { // constructor LambdaSquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1371,7 +1371,7 @@ namespace ATC { // constructor AtomicVelocityRescaleFactor(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1403,8 +1403,8 @@ namespace ATC { // constructor AtomicFluctuatingVelocityRescaled(ATC_Method * atc, - PerAtomQuantity * atomRescaleFactor = NULL, - PerAtomQuantity * atomFluctuatingVelocity = NULL, + PerAtomQuantity * atomRescaleFactor = nullptr, + PerAtomQuantity * atomFluctuatingVelocity = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1439,10 +1439,10 @@ namespace ATC { // constructor AtomicCombinedRescaleThermostatError(ATC_Method * atc, - PerAtomQuantity * atomFluctuatingMomentumRescaled = NULL, - PerAtomQuantity * atomMeanVelocity = NULL, - PerAtomQuantity * atomStreamingVelocity = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomFluctuatingMomentumRescaled = nullptr, + PerAtomQuantity * atomMeanVelocity = nullptr, + PerAtomQuantity * atomStreamingVelocity = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1483,8 +1483,8 @@ namespace ATC { // constructor AtomicThermostatForce(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomLambdas = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1519,8 +1519,8 @@ namespace ATC { // constructor AtomicKinetostatForceDisplacement(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1558,8 +1558,8 @@ namespace ATC { // constructor AtomicKinetostatForceVelocity(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL) : AtomicKinetostatForceDisplacement(atc,atomLambda,atomMass,atomType) {}; @@ -1589,7 +1589,7 @@ namespace ATC { // constructor AtomicKinetostatForceStress(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, + PerAtomQuantity * atomLambda = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1621,7 +1621,7 @@ namespace ATC { // constructor PerAtomKernelFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1656,8 +1656,8 @@ namespace ATC { // constructor PerAtomShapeFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomElements = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomElements = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1695,8 +1695,8 @@ namespace ATC { // constructor LambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LambdaCouplingMatrix() { @@ -1734,9 +1734,9 @@ namespace ATC { // constructor LocalLambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * lambdaAtomMap = NULL, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * lambdaAtomMap = nullptr, + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LocalLambdaCouplingMatrix() { @@ -1771,7 +1771,7 @@ namespace ATC { GhostCouplingMatrix(ATC_Method * atc, SPAR_MAN * shapeFunction, SetDependencyManager * subsetNodes, - MatrixDependencyManager * nodeToOverlapMap = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr); // destructor virtual ~GhostCouplingMatrix() { diff --git a/lib/atc/PerPairQuantity.cpp b/lib/atc/PerPairQuantity.cpp index 3632a87aa..01308e4b3 100644 --- a/lib/atc/PerPairQuantity.cpp +++ b/lib/atc/PerPairQuantity.cpp @@ -272,7 +272,7 @@ BondMatrixKernel::BondMatrixKernel(LammpsInterface * lammpsInterface, BondMatrix(lammpsInterface,pairMap,x,feMesh), kernelFunction_(kernelFunction) { - if (kernelFunction_ == NULL) + if (kernelFunction_ == nullptr) throw ATC_Error("No AtC kernel function initialized"); }; void BondMatrixKernel::reset(void) const diff --git a/lib/atc/PhysicsModel.h b/lib/atc/PhysicsModel.h index 50b327ce0..8479727a8 100644 --- a/lib/atc/PhysicsModel.h +++ b/lib/atc/PhysicsModel.h @@ -105,7 +105,7 @@ namespace ATC const WeakEquation * weak_equation(FieldName field) const { std::map::const_iterator itr = weakEqns_.find(field); - if (itr == weakEqns_.end()) return NULL; + if (itr == weakEqns_.end()) return nullptr; return (weakEqns_.find(field))->second; } diff --git a/lib/atc/PoissonSolver.cpp b/lib/atc/PoissonSolver.cpp index 86670ae21..52909fc45 100644 --- a/lib/atc/PoissonSolver.cpp +++ b/lib/atc/PoissonSolver.cpp @@ -33,9 +33,9 @@ PoissonSolver::PoissonSolver( fieldName_(fieldName), rhsMask_(rhsMask), linear_(false), - solver_(NULL), - solverNL_(NULL), - tangent_(NULL), + solver_(nullptr), + solverNL_(nullptr), + tangent_(nullptr), solverType_(solverType), solverTol_(0), solverMaxIter_(0), diff --git a/lib/atc/PrescribedDataManager.cpp b/lib/atc/PrescribedDataManager.cpp index bd649c8ac..947191a0e 100644 --- a/lib/atc/PrescribedDataManager.cpp +++ b/lib/atc/PrescribedDataManager.cpp @@ -34,8 +34,8 @@ namespace ATC { bcs_[thisField].reset(nNodes_,thisSize); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < thisSize ; ++idof) { - ics_[thisField](inode,idof) = NULL; - bcs_[thisField](inode,idof) = NULL; + ics_[thisField](inode,idof) = nullptr; + bcs_[thisField](inode,idof) = nullptr; } } // compact inode, value lists @@ -44,7 +44,7 @@ namespace ATC { elementSources_[thisField].reset(nElems_,thisSize); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < thisSize ; ++idof) { - elementSources_[thisField](ielem,idof) = NULL; + elementSources_[thisField](ielem,idof) = nullptr; } } // node based sources @@ -76,8 +76,8 @@ namespace ATC { bcs_[fieldName].reset(nNodes_,size); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < size ; ++idof) { - ics_[fieldName](inode,idof) = NULL; - bcs_[fieldName](inode,idof) = NULL; + ics_[fieldName](inode,idof) = nullptr; + bcs_[fieldName](inode,idof) = nullptr; } } @@ -85,7 +85,7 @@ namespace ATC { elementSources_[fieldName].reset(nElems_,size); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < size ; ++idof) { - elementSources_[fieldName](ielem,idof) = NULL; + elementSources_[fieldName](ielem,idof) = nullptr; } } } @@ -159,7 +159,7 @@ namespace ATC { set::const_iterator iset; for (iset = nodeSet.begin(); iset != nodeSet.end(); iset++) { int inode = *iset; - bcs_[thisField](inode,thisIndex) = NULL; + bcs_[thisField](inode,thisIndex) = nullptr; } } @@ -182,7 +182,7 @@ namespace ATC { const FieldName thisField, const int thisIndex) { - bcs_[thisField](nodeId,thisIndex) = NULL; + bcs_[thisField](nodeId,thisIndex) = nullptr; } //------------------------------------------------------------------------- // fix_flux @@ -203,7 +203,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (XT_Function*) f; } @@ -222,7 +222,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < XT_Function * > & dof = faceSources_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -244,7 +244,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (UXT_Function*) f; } @@ -263,7 +263,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < UXT_Function * > & dof = faceSourcesRobin_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -342,7 +342,7 @@ namespace ATC { set::const_iterator iset; for (iset = elemSet.begin(); iset != elemSet.end(); iset++) { int ielem = *iset; - elementSources_[thisField](ielem,thisIndex) = NULL; + elementSources_[thisField](ielem,thisIndex) = nullptr; } } //------------------------------------------------------------------------- diff --git a/lib/atc/Quadrature.cpp b/lib/atc/Quadrature.cpp index 8efe0e296..94fe4a701 100644 --- a/lib/atc/Quadrature.cpp +++ b/lib/atc/Quadrature.cpp @@ -5,14 +5,14 @@ using namespace std; namespace ATC { -Quadrature * Quadrature::myInstance_ = NULL; +Quadrature * Quadrature::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- Quadrature * Quadrature::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new Quadrature(); } return myInstance_; @@ -24,7 +24,7 @@ Quadrature * Quadrature::instance() void Quadrature::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } diff --git a/lib/atc/SchrodingerSolver.cpp b/lib/atc/SchrodingerSolver.cpp index d79fa8559..3819562a7 100644 --- a/lib/atc/SchrodingerSolver.cpp +++ b/lib/atc/SchrodingerSolver.cpp @@ -646,7 +646,7 @@ double fermi_dirac(const double E, const double T) double mu, double D ) : SliceSchrodingerPoissonSolver(atc,schrodingerSolver,poissonSolver,physicsModel,maxConsistencyIter,maxConstraintIter,oneDconserve,0,0), - solver_(NULL), + solver_(nullptr), mobility_(mu),diffusivity_(D) { Ef0_ = Ef0; diff --git a/lib/atc/SparseMatrix-inl.h b/lib/atc/SparseMatrix-inl.h index 36867ad8d..2923d6daa 100644 --- a/lib/atc/SparseMatrix-inl.h +++ b/lib/atc/SparseMatrix-inl.h @@ -17,14 +17,14 @@ TRI_COORD::TRI_COORD(INDEX row, INDEX col, T val, bool add_to) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(INDEX rows, INDEX cols) - : _val(NULL), _ia(NULL), _ja(NULL), _size(0), _nRowsCRS(0), hasTemplate_(false), + : _val(nullptr), _ia(nullptr), _ja(nullptr), _size(0), _nRowsCRS(0), hasTemplate_(false), _nRows(rows),_nCols(cols) {} //----------------------------------------------------------------------------- // copy constructor //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const SparseMatrix& C) - : Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) + : Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { _copy(C); } @@ -33,7 +33,7 @@ SparseMatrix::SparseMatrix(const SparseMatrix& C) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const DenseMatrix& C) -: Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) +: Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { reset(C); } @@ -67,9 +67,9 @@ void SparseMatrix::_create(INDEX size, INDEX nrows) // assign memory to hold matrix try { - _val = (_size && nrows) ? new T [_size] : NULL; - _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : NULL; - _ja = (_size && nrows) ? new INDEX [_size] : NULL; + _val = (_size && nrows) ? new T [_size] : nullptr; + _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : nullptr; + _ja = (_size && nrows) ? new INDEX [_size] : nullptr; } catch (std::exception &e) { @@ -94,8 +94,8 @@ void SparseMatrix::_delete() if (_ia) delete [] _ia; if (_ja) delete [] _ja; _size = _nRowsCRS = 0; - _val = NULL; - _ia = _ja = NULL; + _val = nullptr; + _ia = _ja = nullptr; } //----------------------------------------------------------------------------- // full memory copy of C into this diff --git a/lib/atc/SparseVector.h b/lib/atc/SparseVector.h index 5cb16af52..d387b45b6 100644 --- a/lib/atc/SparseVector.h +++ b/lib/atc/SparseVector.h @@ -88,7 +88,7 @@ protected: //@{ SparseVector(const Matrix &c); SparseVector& operator=(Matrix &c); - T* ptr() const {return NULL; } + T* ptr() const {return nullptr; } //@} STORE data_; //*> sparse data structure diff --git a/lib/atc/SpeciesTimeIntegrator.cpp b/lib/atc/SpeciesTimeIntegrator.cpp index 3a196e745..3215b159f 100644 --- a/lib/atc/SpeciesTimeIntegrator.cpp +++ b/lib/atc/SpeciesTimeIntegrator.cpp @@ -108,9 +108,9 @@ namespace ATC { timeFilter_(speciesTimeIntegrator->time_filter()), massDensity_(atc_->field(MASS_DENSITY)), nodalAtomicMassDensityOut_(atc_->nodal_atomic_field(MASS_DENSITY)), - nodalAtomicMassDensity_(NULL), + nodalAtomicMassDensity_(nullptr), speciesConcentration_(atc_->field(SPECIES_CONCENTRATION)), - nodalAtomicSpeciesConcentration_(NULL), + nodalAtomicSpeciesConcentration_(nullptr), nodalAtomicSpeciesConcentrationFiltered_(speciesTimeIntegrator->nodal_atomic_species_concentration_filtered()), moleculeIds_(moleculeIds) { diff --git a/lib/atc/SpeciesTimeIntegrator.h b/lib/atc/SpeciesTimeIntegrator.h index c8fbe97c5..64cc07022 100644 --- a/lib/atc/SpeciesTimeIntegrator.h +++ b/lib/atc/SpeciesTimeIntegrator.h @@ -71,7 +71,7 @@ namespace ATC { const std::map > & moleculeIds); // destructor - virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=NULL;}; + virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=nullptr;}; /** create and get necessary transfer operators */ virtual void construct_transfers(); diff --git a/lib/atc/Stress.cpp b/lib/atc/Stress.cpp index 72656c21e..a1445bd8e 100644 --- a/lib/atc/Stress.cpp +++ b/lib/atc/Stress.cpp @@ -299,10 +299,10 @@ void StressCubicElasticDamped::stress(const FIELD_MATS &fields, // cauchy born model //============================================================================== StressCauchyBorn::StressCauchyBorn(fstream &fileId, CbData &cb) - : cblattice_(NULL), - potential_(NULL), + : cblattice_(nullptr), + potential_(nullptr), makeLinear_(false), - cubicMat_(NULL), + cubicMat_(nullptr), initialized_(false), fixed_temperature_(0.), cbdata_(cb) diff --git a/lib/atc/Stress.h b/lib/atc/Stress.h index 513cdb2d9..5a7c9e30a 100644 --- a/lib/atc/Stress.h +++ b/lib/atc/Stress.h @@ -149,7 +149,7 @@ namespace ATC { DENS_VEC elasticity_tensor(const VECTOR &Fv, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; DENS_VEC elasticity_tensor(const MATRIX &F, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; protected: - void linearize(MATRIX *F=NULL); + void linearize(MATRIX *F=nullptr); CBLattice *cblattice_; //*> CbLattice -> makes atom clusters. CbPotential *potential_; //*> CbPotential -> interatomic forces. bool makeLinear_; diff --git a/lib/atc/ThermalTimeIntegrator.cpp b/lib/atc/ThermalTimeIntegrator.cpp index e74d46a20..8c0b8d6da 100644 --- a/lib/atc/ThermalTimeIntegrator.cpp +++ b/lib/atc/ThermalTimeIntegrator.cpp @@ -150,7 +150,7 @@ namespace ATC { temperatureRoc_(atc_->field_roc(TEMPERATURE)), temperature2Roc_(atc_->field_2roc(TEMPERATURE)), nodalAtomicTemperatureOut_(atc_->nodal_atomic_field(TEMPERATURE)), - nodalAtomicTemperature_(NULL), + nodalAtomicTemperature_(nullptr), temperatureRhs_(atc_->field_rhs(TEMPERATURE)), nodalAtomicPowerOut_(atc_->nodal_atomic_field_roc(TEMPERATURE)) { @@ -384,7 +384,7 @@ namespace ATC { nodalAtomicEnergyFiltered_(thermalTimeIntegrator->nodal_atomic_energy_filtered()), nodalAtomicPowerFiltered_(thermalTimeIntegrator->nodal_atomic_power_filtered()), atomicTemperatureDelta_(atc_->num_nodes(),1), - nodalAtomicEnergy_(NULL), + nodalAtomicEnergy_(nullptr), nodalAtomicEnergyOld_(atc_->num_nodes(),1), nodalAtomicTemperatureOld_(atc_->num_nodes(),1) { diff --git a/lib/atc/Thermostat.cpp b/lib/atc/Thermostat.cpp index a60210585..217f2394e 100644 --- a/lib/atc/Thermostat.cpp +++ b/lib/atc/Thermostat.cpp @@ -367,7 +367,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL) + atomVelocities_(nullptr) { fieldMask_(TEMPERATURE,FLUX) = true; lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaEnergy",1); // data associated with stage 3 in ATC_Method::initialize @@ -425,7 +425,7 @@ namespace ATC { ThermostatRescale::ThermostatRescale(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), nodalTemperature_(atc_->field(TEMPERATURE)), - atomVelocityRescalings_(NULL) + atomVelocityRescalings_(nullptr) { // do nothing } @@ -535,7 +535,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePe::ThermostatRescaleMixedKePe(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - nodalAtomicFluctuatingPotentialEnergy_(NULL) + nodalAtomicFluctuatingPotentialEnergy_(nullptr) { // do nothing } @@ -607,7 +607,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), lambdaMaxIterations_(lambdaMaxIterations), - rhsLambdaSquared_(NULL), + rhsLambdaSquared_(nullptr), dtFactor_(1.) { fieldMask_(TEMPERATURE,FLUX) = true; @@ -741,21 +741,21 @@ namespace ATC { int /* lambdaMaxIterations */, const string & regulatorPrefix) : RegulatorMethod(thermostat,regulatorPrefix), - lambdaSolver_(NULL), + lambdaSolver_(nullptr), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL), + atomVelocities_(nullptr), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomLambdas_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomLambdas_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), isFirstTimestep_(true), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL) + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize nodalAtomicLambdaPower_ = thermostat->regulator_data(regulatorPrefix_+"NodalAtomicLambdaPower",1); @@ -1389,7 +1389,7 @@ namespace ATC { int lambdaMaxIterations, const string & regulatorPrefix) : ThermostatGlcFs(thermostat,lambdaMaxIterations,regulatorPrefix), - atomThermostatForcesPredVel_(NULL), + atomThermostatForcesPredVel_(nullptr), filterCoefficient_(1.) { lambdaSolver_ = new ThermostatSolverFixed(thermostat, @@ -1887,9 +1887,9 @@ namespace ATC { int lambdaMaxIterations, bool constructThermostats) : RegulatorMethod(thermostat), - thermostatFlux_(NULL), - thermostatFixed_(NULL), - thermostatBcs_(NULL) + thermostatFlux_(nullptr), + thermostatFixed_(nullptr), + thermostatBcs_(nullptr) { if (constructThermostats) { thermostatFlux_ = new ThermostatIntegratorFlux(thermostat,lambdaMaxIterations,regulatorPrefix_+"Flux"); @@ -2022,10 +2022,10 @@ namespace ATC { ThermostatGlc::ThermostatGlc(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), timeFilter_(atomicRegulator_->time_filter()), - lambdaPowerFiltered_(NULL), - atomThermostatForces_(NULL), + lambdaPowerFiltered_(nullptr), + atomThermostatForces_(nullptr), prescribedDataMgr_(atc_->prescribed_data_manager()), - atomMasses_(NULL) + atomMasses_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaPowerFiltered_= atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaPowerFiltered",1); @@ -2080,8 +2080,8 @@ namespace ATC { ThermostatGlc(thermostat), nodalTemperatureRoc_(atc_->field_roc(TEMPERATURE)), heatSource_(atc_->atomic_source(TEMPERATURE)), - nodalAtomicPower_(NULL), - nodalAtomicLambdaPower_(NULL) + nodalAtomicPower_(nullptr), + nodalAtomicLambdaPower_(nullptr) { // do nothing } @@ -2287,8 +2287,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerlet::ThermostatHooverVerlet(AtomicRegulator * thermostat) : ThermostatPowerVerlet(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // set up data consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaHoover",1); @@ -2505,8 +2505,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerletFiltered::ThermostatHooverVerletFiltered(AtomicRegulator * thermostat) : ThermostatPowerVerletFiltered(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data("LambdaHoover",1); diff --git a/lib/atc/TimeFilter.cpp b/lib/atc/TimeFilter.cpp index 08cb64c8f..ece3429c8 100644 --- a/lib/atc/TimeFilter.cpp +++ b/lib/atc/TimeFilter.cpp @@ -210,7 +210,7 @@ namespace ATC { } else if (filterType_ == STEP_FILTER) { newTimeFilter = new TimeFilterStep(*this); - } else newTimeFilter = NULL; + } else newTimeFilter = nullptr; } else { // default to return base class newTimeFilter = new TimeFilter(*this); diff --git a/lib/atc/TimeIntegrator.cpp b/lib/atc/TimeIntegrator.cpp index 4e8dec8c6..f370d1717 100644 --- a/lib/atc/TimeIntegrator.cpp +++ b/lib/atc/TimeIntegrator.cpp @@ -17,10 +17,10 @@ namespace ATC { AtomTimeIntegratorType::AtomTimeIntegratorType(ATC_Method * atc, AtomType atomType) : atc_(atc), atomType_(atomType), - mass_(NULL), - position_(NULL), - velocity_(NULL), - force_(NULL) + mass_(nullptr), + position_(nullptr), + velocity_(nullptr), + force_(nullptr) { // do nothing } @@ -90,9 +90,9 @@ namespace ATC { //-------------------------------------------------------- TimeIntegrator::TimeIntegrator(ATC_Coupling * atc, TimeIntegrationType timeIntegrationType) : - timeIntegrationMethod_(NULL), + timeIntegrationMethod_(nullptr), atc_(atc), - timeFilter_(NULL), + timeFilter_(nullptr), timeFilterManager_(atc_->time_filter_manager()), timeIntegrationType_(timeIntegrationType), needReset_(true) diff --git a/lib/atc/TransferLibrary.cpp b/lib/atc/TransferLibrary.cpp index d0db0076d..b77a91fd2 100644 --- a/lib/atc/TransferLibrary.cpp +++ b/lib/atc/TransferLibrary.cpp @@ -816,7 +816,7 @@ namespace ATC { for (unsigned i = 0; i < quantity_.size(); ++i) { if (quantity_[i]) delete quantity_[i]; } - quantity_.resize(source.size(),NULL); + quantity_.resize(source.size(),nullptr); for (unsigned i = 0; i < source.size(); i++) { quantity_[i] = new SPAR_MAT(map_->size(),source[i]->nCols()); } @@ -1363,7 +1363,7 @@ namespace ATC { { pointToElementMap_->register_dependence(this); pointPositions_->register_dependence(this); - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } @@ -1428,7 +1428,7 @@ namespace ATC { atomPositions_->register_dependence(this); // storage container - matrices_.resize(atc->nsd(),NULL); + matrices_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { matrices_[i] = new AtcAtomSparseMatrix(atc,feEngine_->num_nodes(), feEngine_->num_nodes_per_element(), @@ -1440,7 +1440,7 @@ namespace ATC { matrices_[i]->register_dependence(this); } - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); } //-------------------------------------------------------- @@ -1926,7 +1926,7 @@ namespace ATC { VectorTransfer(), feEngine_(atc->fe_engine()) { - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } diff --git a/lib/atc/TransferLibrary.h b/lib/atc/TransferLibrary.h index 3a0f420f3..d1f27e5e6 100644 --- a/lib/atc/TransferLibrary.h +++ b/lib/atc/TransferLibrary.h @@ -115,7 +115,7 @@ namespace ATC { // constructor NodalAtomVolumeElement(ATC_Method * atc, SPAR_MAN * shapeFunction, - PerAtomQuantity * atomElement=NULL); + PerAtomQuantity * atomElement=nullptr); // destructor virtual ~NodalAtomVolumeElement() { @@ -173,7 +173,7 @@ namespace ATC { // constructor AtomTypeElement(ATC_Coupling * atc, - PerAtomQuantity * atomElement = NULL); + PerAtomQuantity * atomElement = nullptr); // destructor virtual ~AtomTypeElement() { @@ -211,8 +211,8 @@ namespace ATC { // constructor ElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~ElementMask() { @@ -251,7 +251,7 @@ namespace ATC { // constructor AtomElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasAtoms = NULL); + MatrixDependencyManager * hasAtoms = nullptr); // destructor virtual ~AtomElementMask() { @@ -287,8 +287,8 @@ namespace ATC { // constructor NodalGeometryType(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~NodalGeometryType() { @@ -338,7 +338,7 @@ namespace ATC { // constructor NodalGeometryTypeElementSet(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL); + MatrixDependencyManager * hasInternal = nullptr); // destructor virtual ~NodalGeometryTypeElementSet() { @@ -659,7 +659,7 @@ namespace ATC { // constructor RegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL); + MatrixDependencyManager * nodalGeometryType = nullptr); // destructor virtual ~RegulatedNodes() { @@ -721,7 +721,7 @@ namespace ATC { // constructor FluxNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -751,7 +751,7 @@ namespace ATC { // constructor BoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -781,7 +781,7 @@ namespace ATC { // constructor FluxBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -811,7 +811,7 @@ namespace ATC { // constructor AllRegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxBoundaryNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -841,7 +841,7 @@ namespace ATC { // constructor FixedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -871,7 +871,7 @@ namespace ATC { // constructor FixedBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FixedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -1052,8 +1052,8 @@ namespace ATC { // constructor PerAtomShapeFunctionGradient(ATC_Method * atc, - MatrixDependencyManager* atomToElementMap = NULL, - DENS_MAN* atomPositions = NULL, + MatrixDependencyManager* atomToElementMap = nullptr, + DENS_MAN* atomPositions = nullptr, const std::string & tag = "AtomicShapeFunctionGradient", AtomType atomType = INTERNAL); diff --git a/lib/atc/TransferOperator.h b/lib/atc/TransferOperator.h index 5f776d04c..5cf578b77 100644 --- a/lib/atc/TransferOperator.h +++ b/lib/atc/TransferOperator.h @@ -542,7 +542,7 @@ namespace ATC { AtfProjection(ATC_Method * atc, PerAtomQuantity * source, SPAR_MAN * accumulant, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjection(); @@ -587,7 +587,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, const double scale, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionScaled(); @@ -620,7 +620,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, DENS_MAN * reference, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionReferenced(); diff --git a/lib/atc/Utility.h b/lib/atc/Utility.h index 2c0ea7270..6693df932 100644 --- a/lib/atc/Utility.h +++ b/lib/atc/Utility.h @@ -226,7 +226,7 @@ namespace ATC_Utility { char *endptr; strtod(s.c_str(), &endptr); - if(endptr != NULL && *endptr == '\0') return true; + if(endptr != nullptr && *endptr == '\0') return true; return false; } diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 7bf6125bc..2eebfcc0c 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(NULL),next(NULL){ + :descriptor(descriptor_),prev(nullptr),next(nullptr){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=NULL; - prev=NULL; + glogp->next=nullptr; + prev=nullptr; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ set_out(out); set_err(err); } diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index c29f72773..0f79fc418 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(NULL,1) { + recmatrix(): parr(nullptr,1) { sizey=sizex=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(NULL,1) { + sqmatrix(): parr(nullptr,1) { size=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(NULL){ + sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not NULL, puts the found value there - virtual int Find(long i, long j, T *retval=NULL)=0; - virtual int Find(long i, long j, T **retval=NULL)=0; + //e if retval is not nullptr, puts the found value there + virtual int Find(long i, long j, T *retval=nullptr)=0; + virtual int Find(long i, long j, T **retval=nullptr)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=NULL){ + int Find(long i, long j, T *retval=nullptr){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index a1a4feb0f..8e5fc7df4 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=NULL, int managed=0){ + void reset(T* ptr=nullptr, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==NULL than p is not managed (as in mngptr) + int *num; //if num==nullptr than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=NULL; + else num=nullptr; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } public: - shptr(T* p=NULL, int managed=1){ + shptr(T* p=nullptr, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=NULL; + num=nullptr; } - p=NULL; + p=nullptr; } } bool valid() const { - return p!=NULL; + return p!=nullptr; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 468abbda9..534cea44a 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=NULL) const { + T maxcoord(int *ind=nullptr) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index 7e82af0f6..6e809dd65 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,7 +13,7 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=NULL; +message_logger *message_logger::glogp=nullptr; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); const char *logfmt(const char *format,...){ diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index e118b76f3..4c6544001 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -255,7 +255,7 @@ public: } //e Create NormDeriv object and calculate the derivatived for the given WP - void set2(const WavePacket& w2_, const cdouble *I0_=NULL){ + void set2(const WavePacket& w2_, const cdouble *I0_=nullptr){ w2=w2_; d2.set(w2); w12=conj(w1)*w2; @@ -558,13 +558,13 @@ public: //e if PBCs are used, the corresponding coordinates of electrons and ions //e in periodic directions must be within the range [0, cell[per_dir]) //e @returns 1 if OK - int set_pbc(const Vector_3P pcell=NULL, int pbc_=0x7); + int set_pbc(const Vector_3P pcell=nullptr, int pbc_=0x7); ///\en Setup electrons: forms internal wave packet representations. /// If PBCs are used the coords must be within a range [0, cell). /// Default electron mass is AWPMD::me. - /// Default (q=NULL )electron charges are -1. - int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=NULL); + /// Default (q=nullptr )electron charges are -1. + int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=nullptr); //e setup ion charges and coordinates //e if PBCs are used the coords must be within a range [0, cell) @@ -593,16 +593,16 @@ public: // 0x2 -- add ion forces to the existing set // 0x4 -- calculate derivatives for electronic time step (NOT IMPLEMENTED) //e if PBCs are used the coords must be within a range [0, cell) - virtual int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); //e same as interaction, but using Hartee factorization (no antisymmetrization) - virtual int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates ion-ion interactions and updates Eii and ion forces if requested. This function /// is called form intaraction() and interaction_hartree if calc_ii is set. - virtual int interaction_ii(int flag,Vector_3P fi=NULL); + virtual int interaction_ii(int flag,Vector_3P fi=nullptr); //e Calculates Norm matrix //e The result is saved in AWPMD::Norm[s] @@ -643,7 +643,7 @@ public: ///\en Prepares force arrays according to \a flag setting for interaction() virtual void clear_forces(int flagi,Vector_3P fi, Vector_3P fe_x, - Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=NULL); + Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=nullptr); ///\en Creates wave packet according to the given physical parameters. diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 2c58bdaf2..55105066d 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -312,7 +312,7 @@ void AWPMD_split::clear_forces(int flag,Vector_3P fi, Vector_3P fe_x, void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ if(flag&0x4) //need to replace the forces - clear_forces(0x4,NULL,fe_x,fe_p,fe_w,fe_pw,fe_c); + clear_forces(0x4,nullptr,fe_x,fe_p,fe_w,fe_pw,fe_c); // recalculating derivatives if(flag&(0x8|0x4)){ //electron forces needed @@ -622,7 +622,7 @@ void AWPMD_split::y_deriv(cdouble v,int s,int c2, int c1){ /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n -/// will not update electronic force arrays, which may be NULL, \n +/// will not update electronic force arrays, which may be nullptr, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.h b/lib/awpmd/systems/interact/TCP/wpmd_split.h index 44fb75757..0ffef2645 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.h +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.h @@ -116,8 +116,8 @@ public: /// \a n is the number of electrons of a given spin component /// Electron velocity v is multiplied by mass to obtain momentum. /// Default mass (-1) means me. - /// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split - int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL); + /// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split + int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr); ///\en Starts adding new electron: continue with \ref add_split functions. @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be NULL, \n + /// will not update electronic force arrays, which may be nullptr, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n diff --git a/lib/colvars/colvar.cpp b/lib/colvars/colvar.cpp index 1002dc35d..61e83f44a 100644 --- a/lib/colvars/colvar.cpp +++ b/lib/colvars/colvar.cpp @@ -22,7 +22,7 @@ colvar::colvar() { - runave_os = NULL; + runave_os = nullptr; prev_timestep = -1L; after_restart = false; @@ -62,7 +62,7 @@ int colvar::init(std::string const &conf) get_keyval(conf, "name", this->name, (std::string("colvar")+cvm::to_str(cv->variables()->size()))); - if ((cvm::colvar_by_name(this->name) != NULL) && + if ((cvm::colvar_by_name(this->name) != nullptr) && (cvm::colvar_by_name(this->name) != this)) { cvm::error("Error: this colvar cannot have the same name, \""+this->name+ "\", as another colvar.\n", @@ -744,7 +744,7 @@ template int colvar::init_components_type(std::string c : ".\n")); cvm::increase_depth(); cvc *cvcp = new def_class_name(def_conf); - if (cvcp != NULL) { + if (cvcp != nullptr) { cvcs.push_back(cvcp); cvcp->check_keywords(def_conf, def_config_key); cvcp->config_key = def_config_key; @@ -994,7 +994,7 @@ int colvar::parse_analysis(std::string const &conf) acf_type = acf_vel; enable(f_cv_fdiff_velocity); colvar *cv2 = cvm::colvar_by_name(acf_colvar_name); - if (cv2 == NULL) { + if (cv2 == nullptr) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -1215,14 +1215,14 @@ colvar::~colvar() for (std::vector::iterator cei = value_evaluators.begin(); cei != value_evaluators.end(); ++cei) { - if (*cei != NULL) delete (*cei); + if (*cei != nullptr) delete (*cei); } value_evaluators.clear(); for (std::vector::iterator gei = gradient_evaluators.begin(); gei != gradient_evaluators.end(); ++gei) { - if (*gei != NULL) delete (*gei); + if (*gei != nullptr) delete (*gei); } gradient_evaluators.clear(); #endif @@ -1972,7 +1972,7 @@ void const *colvar::get_cvc_param_ptr(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return NULL; + return nullptr; } @@ -1983,7 +1983,7 @@ colvarvalue const *colvar::get_cvc_param_grad(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param_grad() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return NULL; + return nullptr; } @@ -2422,7 +2422,7 @@ int colvar::calc_acf() // the pointer to each vector is changed at every step colvar const *cfcv = cvm::colvar_by_name(acf_colvar_name); - if (cfcv == NULL) { + if (cfcv == nullptr) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -2660,7 +2660,7 @@ int colvar::calc_runave() if ((*x_history_p).size() >= runave_length-1) { - if (runave_os == NULL) { + if (runave_os == nullptr) { if (runave_outfile.size() == 0) { runave_outfile = std::string(cvm::output_prefix()+"."+ this->name+".runave.traj"); diff --git a/lib/colvars/colvaratoms.cpp b/lib/colvars/colvaratoms.cpp index 180fc69a8..2796f3d28 100644 --- a/lib/colvars/colvaratoms.cpp +++ b/lib/colvars/colvaratoms.cpp @@ -105,7 +105,7 @@ cvm::atom_group::~atom_group() if (fitting_group) { delete fitting_group; - fitting_group = NULL; + fitting_group = nullptr; } cvm::main()->unregister_named_atom_group(this); @@ -217,7 +217,7 @@ int cvm::atom_group::init() b_center = false; b_rotate = false; b_user_defined_fit = false; - fitting_group = NULL; + fitting_group = nullptr; noforce = false; @@ -368,7 +368,7 @@ int cvm::atom_group::parse(std::string const &group_conf) // Optional group name will let other groups reuse atom definition if (get_keyval(group_conf, "name", name)) { - if ((cvm::atom_group_by_name(this->name) != NULL) && + if ((cvm::atom_group_by_name(this->name) != nullptr) && (cvm::atom_group_by_name(this->name) != this)) { cvm::error("Error: this atom group cannot have the same name, \""+this->name+ "\", as another atom group.\n", @@ -395,7 +395,7 @@ int cvm::atom_group::parse(std::string const &group_conf) std::string atoms_of = ""; if (get_keyval(group_conf, "atomsOfGroup", atoms_of)) { atom_group * ag = atom_group_by_name(atoms_of); - if (ag == NULL) { + if (ag == nullptr) { cvm::error("Error: cannot find atom group with name " + atoms_of + ".\n"); return COLVARS_ERROR; } diff --git a/lib/colvars/colvarbias.cpp b/lib/colvars/colvarbias.cpp index 09bcca01b..cdbc13699 100644 --- a/lib/colvars/colvarbias.cpp +++ b/lib/colvars/colvarbias.cpp @@ -47,7 +47,7 @@ int colvarbias::init(std::string const &conf) { colvarbias *bias_with_name = cvm::bias_by_name(this->name); - if (bias_with_name != NULL) { + if (bias_with_name != nullptr) { if ((bias_with_name->rank != this->rank) || (bias_with_name->bias_type != this->bias_type)) { cvm::error("Error: this bias cannot have the same name, \""+this->name+ @@ -295,8 +295,8 @@ int colvarbias::update() colvar_values[i] = colvars[i]->value(); } - error_code |= calc_energy(NULL); - error_code |= calc_forces(NULL); + error_code |= calc_energy(nullptr); + error_code |= calc_forces(nullptr); return error_code; } @@ -547,8 +547,8 @@ colvarbias_ti::colvarbias_ti(char const *key) : colvarbias(key) { provide(f_cvb_calc_ti_samples); - ti_avg_forces = NULL; - ti_count = NULL; + ti_avg_forces = nullptr; + ti_count = nullptr; } @@ -560,13 +560,13 @@ colvarbias_ti::~colvarbias_ti() int colvarbias_ti::clear_state_data() { - if (ti_avg_forces != NULL) { + if (ti_avg_forces != nullptr) { delete ti_avg_forces; - ti_avg_forces = NULL; + ti_avg_forces = nullptr; } - if (ti_count != NULL) { + if (ti_count != nullptr) { delete ti_count; - ti_count = NULL; + ti_count = nullptr; } return COLVARS_OK; } @@ -622,7 +622,7 @@ int colvarbias_ti::init(std::string const &conf) int colvarbias_ti::init_grids() { if (is_enabled(f_cvb_calc_ti_samples)) { - if (ti_avg_forces == NULL) { + if (ti_avg_forces == nullptr) { ti_bin.resize(num_variables()); ti_system_forces.resize(num_variables()); for (size_t icv = 0; icv < num_variables(); icv++) { @@ -643,7 +643,7 @@ int colvarbias_ti::init_grids() int colvarbias_ti::update() { - return update_system_forces(NULL); + return update_system_forces(nullptr); } @@ -679,7 +679,7 @@ int colvarbias_ti::update_system_forces(std::vector const ti_system_forces[i] = variables(i)->total_force(); } else { ti_system_forces[i] = variables(i)->total_force() - - ((subtract_forces != NULL) ? + ((subtract_forces != nullptr) ? (*subtract_forces)[i] : previous_colvar_forces[i]); } } @@ -759,7 +759,7 @@ int colvarbias_ti::write_output_files() std::string const ti_output_prefix = cvm::output_prefix()+"."+this->name; - std::ostream *os = NULL; + std::ostream *os = nullptr; if (is_enabled(f_cvb_write_ti_samples)) { std::string const ti_count_file_name(ti_output_prefix+".ti.count"); diff --git a/lib/colvars/colvarbias.h b/lib/colvars/colvarbias.h index 5179c4285..20c346f81 100644 --- a/lib/colvars/colvarbias.h +++ b/lib/colvars/colvarbias.h @@ -58,12 +58,12 @@ public: virtual int update(); /// Compute the energy of the bias - /// Uses the vector of colvar values provided if not NULL, and the values + /// Uses the vector of colvar values provided if not nullptr, and the values /// currently cached in the bias instance otherwise virtual int calc_energy(std::vector const *values); /// Compute the forces due to the bias - /// Uses the vector of colvar values provided if not NULL, and the values + /// Uses the vector of colvar values provided if not nullptr, and the values /// currently cached in the bias instance otherwise virtual int calc_forces(std::vector const *values); diff --git a/lib/colvars/colvarbias_abf.cpp b/lib/colvars/colvarbias_abf.cpp index 5382a828f..9926579a8 100644 --- a/lib/colvars/colvarbias_abf.cpp +++ b/lib/colvars/colvarbias_abf.cpp @@ -18,16 +18,16 @@ colvarbias_abf::colvarbias_abf(char const *key) b_UI_estimator(false), b_CZAR_estimator(false), pabf_freq(0), - system_force(NULL), - gradients(NULL), - samples(NULL), - pmf(NULL), - z_gradients(NULL), - z_samples(NULL), - czar_gradients(NULL), - czar_pmf(NULL), - last_gradients(NULL), - last_samples(NULL) + system_force(nullptr), + gradients(nullptr), + samples(nullptr), + pmf(nullptr), + z_gradients(nullptr), + z_samples(nullptr), + czar_gradients(nullptr), + czar_pmf(nullptr), + last_gradients(nullptr), + last_samples(nullptr) { } @@ -261,37 +261,37 @@ colvarbias_abf::~colvarbias_abf() { if (samples) { delete samples; - samples = NULL; + samples = nullptr; } if (gradients) { delete gradients; - gradients = NULL; + gradients = nullptr; } if (pmf) { delete pmf; - pmf = NULL; + pmf = nullptr; } if (z_samples) { delete z_samples; - z_samples = NULL; + z_samples = nullptr; } if (z_gradients) { delete z_gradients; - z_gradients = NULL; + z_gradients = nullptr; } if (czar_gradients) { delete czar_gradients; - czar_gradients = NULL; + czar_gradients = nullptr; } if (czar_pmf) { delete czar_pmf; - czar_pmf = NULL; + czar_pmf = nullptr; } // shared ABF @@ -299,17 +299,17 @@ colvarbias_abf::~colvarbias_abf() // but now we can call shared externally if (last_samples) { delete last_samples; - last_samples = NULL; + last_samples = nullptr; } if (last_gradients) { delete last_gradients; - last_gradients = NULL; + last_gradients = nullptr; } if (system_force) { delete [] system_force; - system_force = NULL; + system_force = nullptr; } } @@ -488,7 +488,7 @@ int colvarbias_abf::update() } /// Add the bias energy for 1D ABF - bias_energy = calc_energy(NULL); + bias_energy = calc_energy(nullptr); return COLVARS_OK; } diff --git a/lib/colvars/colvarbias_histogram.cpp b/lib/colvars/colvarbias_histogram.cpp index 92985b0f6..44862ba25 100644 --- a/lib/colvars/colvarbias_histogram.cpp +++ b/lib/colvars/colvarbias_histogram.cpp @@ -15,7 +15,7 @@ colvarbias_histogram::colvarbias_histogram(char const *key) : colvarbias(key), - grid(NULL), out_name("") + grid(nullptr), out_name("") { provide(f_cvb_bypass_ext_lagrangian); // Allow histograms of actual cv for extended-Lagrangian } @@ -105,7 +105,7 @@ colvarbias_histogram::~colvarbias_histogram() { if (grid) { delete grid; - grid = NULL; + grid = nullptr; } } diff --git a/lib/colvars/colvarbias_meta.cpp b/lib/colvars/colvarbias_meta.cpp index 05f293d87..03c1886a8 100644 --- a/lib/colvars/colvarbias_meta.cpp +++ b/lib/colvars/colvarbias_meta.cpp @@ -36,7 +36,7 @@ colvarbias_meta::colvarbias_meta(char const *key) : colvarbias(key), colvarbias_ti(key) { new_hills_begin = hills.end(); - hills_traj_os = NULL; + hills_traj_os = nullptr; hill_width = 0.0; @@ -45,8 +45,8 @@ colvarbias_meta::colvarbias_meta(char const *key) use_grids = true; grids_freq = 0; rebin_grids = false; - hills_energy = NULL; - hills_energy_gradients = NULL; + hills_energy = nullptr; + hills_energy_gradients = nullptr; dump_fes = true; keep_hills = false; @@ -153,7 +153,7 @@ int colvarbias_meta::init(std::string const &conf) get_keyval(conf, "keepHills", keep_hills, keep_hills); get_keyval(conf, "keepFreeEnergyFiles", dump_fes_save, dump_fes_save); - if (hills_energy == NULL) { + if (hills_energy == nullptr) { hills_energy = new colvar_grid_scalar(colvars); hills_energy_gradients = new colvar_grid_gradient(colvars); } @@ -262,7 +262,7 @@ int colvarbias_meta::init_well_tempered_params(std::string const &conf) int colvarbias_meta::init_ebmeta_params(std::string const &conf) { // for ebmeta - target_dist = NULL; + target_dist = nullptr; get_keyval(conf, "ebMeta", ebmeta, false); if(ebmeta){ if (use_grids && expand_grids) { @@ -328,12 +328,12 @@ colvarbias_meta::~colvarbias_meta() if (hills_traj_os) { proxy->close_output_stream(hills_traj_file_name()); - hills_traj_os = NULL; + hills_traj_os = nullptr; } if (target_dist) { delete target_dist; - target_dist = NULL; + target_dist = nullptr; } } @@ -342,12 +342,12 @@ int colvarbias_meta::clear_state_data() { if (hills_energy) { delete hills_energy; - hills_energy = NULL; + hills_energy = nullptr; } if (hills_energy_gradients) { delete hills_energy_gradients; - hills_energy_gradients = NULL; + hills_energy_gradients = nullptr; } hills.clear(); @@ -451,8 +451,8 @@ int colvarbias_meta::update() error_code |= replica_share(); } - error_code |= calc_energy(NULL); - error_code |= calc_forces(NULL); + error_code |= calc_energy(nullptr); + error_code |= calc_forces(nullptr); return error_code; } @@ -593,7 +593,7 @@ int colvarbias_meta::update_bias() std::vector curr_bin = hills_energy->get_colvars_index(); hills_energy_sum_here = hills_energy->value(curr_bin); } else { - calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, NULL); + calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, nullptr); } hills_scale *= cvm::exp(-1.0*hills_energy_sum_here/(bias_temperature*cvm::boltzmann())); } @@ -887,14 +887,14 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, std::vector colvar_forces_scalar(num_variables()); std::vector he_ix = he->new_index(); - std::vector hg_ix = (hg != NULL) ? hg->new_index() : std::vector (0); + std::vector hg_ix = (hg != nullptr) ? hg->new_index() : std::vector (0); cvm::real hills_energy_here = 0.0; std::vector hills_forces_here(num_variables(), 0.0); size_t count = 0; size_t const print_frequency = ((hills.size() >= 1000000) ? 1 : (1000000/(hills.size()+1))); - if (hg != NULL) { + if (hg != nullptr) { // loop over the points of the grid for ( ; @@ -1310,8 +1310,8 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) hills_energy_gradients = new colvar_grid_gradient(colvars); } - colvar_grid_scalar *hills_energy_backup = NULL; - colvar_grid_gradient *hills_energy_gradients_backup = NULL; + colvar_grid_scalar *hills_energy_backup = nullptr; + colvar_grid_gradient *hills_energy_gradients_backup = nullptr; if (has_data) { if (cvm::debug()) @@ -1327,7 +1327,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_pos = is.tellg(); std::string key; if (!(is >> key)) { - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1343,7 +1343,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == NULL) + if (hills_energy_backup == nullptr) cvm::fatal_error("Error: couldn't read the free energy grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1365,7 +1365,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_gradients_pos = is.tellg(); if (!(is >> key)) { - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1381,7 +1381,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_gradients_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == NULL) + if (hills_energy_backup == nullptr) cvm::fatal_error("Error: couldn't read the free energy gradients grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1406,7 +1406,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+"\n"); - if (hills_energy_backup != NULL) { + if (hills_energy_backup != nullptr) { // now that we have successfully updated the grids, delete the // backup copies if (cvm::debug()) @@ -1594,7 +1594,7 @@ int colvarbias_meta::setup_output() // TODO: one may want to specify the path manually for intricated filesystems? char *pwd = new char[3001]; - if (GETCWD(pwd, 3000) == NULL) + if (GETCWD(pwd, 3000) == nullptr) cvm::fatal_error("Error: cannot get the path of the current working directory.\n"); replica_list_file = (std::string(pwd)+std::string(PATHSEP)+ @@ -1885,7 +1885,7 @@ int colvarbias_meta::reopen_replica_buffer_file() { int error_code = COLVARS_OK; colvarproxy *proxy = cvm::proxy; - if (proxy->get_output_stream(replica_hills_file) != NULL) { + if (proxy->get_output_stream(replica_hills_file) != nullptr) { error_code |= proxy->close_output_stream(replica_hills_file); } error_code |= proxy->remove_file(replica_hills_file); diff --git a/lib/colvars/colvarcomp.cpp b/lib/colvars/colvarcomp.cpp index 05d1195d5..d45d85111 100644 --- a/lib/colvars/colvarcomp.cpp +++ b/lib/colvars/colvarcomp.cpp @@ -135,7 +135,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf, char const *group_key, bool optional) { - cvm::atom_group *group = NULL; + cvm::atom_group *group = nullptr; std::string group_conf; if (key_lookup(conf, group_key, &group_conf)) { @@ -298,7 +298,7 @@ colvar::cvc::~cvc() free_children_deps(); remove_all_children(); for (size_t i = 0; i < atom_groups.size(); i++) { - if (atom_groups[i] != NULL) delete atom_groups[i]; + if (atom_groups[i] != nullptr) delete atom_groups[i]; } } @@ -344,7 +344,7 @@ colvarvalue const *colvar::cvc::get_param_grad(std::string const ¶m_name) { colvarvalue const *ptr = reinterpret_cast(get_param_grad_ptr(param_name)); - return ptr != NULL ? ptr : NULL; + return ptr != nullptr ? ptr : nullptr; } @@ -553,7 +553,7 @@ void colvar::cvc::debug_gradients() } } - if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != NULL)) { + if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != nullptr)) { cvm::atom_group *ref_group = group->fitting_group; group->read_positions(); group->calc_required_properties(); diff --git a/lib/colvars/colvarcomp_coordnums.cpp b/lib/colvars/colvarcomp_coordnums.cpp index f0fbabfc4..f36d05552 100644 --- a/lib/colvars/colvarcomp_coordnums.cpp +++ b/lib/colvars/colvarcomp_coordnums.cpp @@ -91,7 +91,7 @@ cvm::real colvar::coordnum::switching_function(cvm::real const &r0, colvar::coordnum::coordnum(std::string const &conf) - : cvc(conf), b_anisotropic(false), pairlist(NULL) + : cvc(conf), b_anisotropic(false), pairlist(nullptr) { function_type = "coordnum"; @@ -102,7 +102,7 @@ colvar::coordnum::coordnum(std::string const &conf) group1 = parse_group(conf, "group1"); group2 = parse_group(conf, "group2"); - if (group1 == NULL || group2 == NULL) { + if (group1 == nullptr || group2 == nullptr) { cvm::error("Error: failed to initialize atom groups.\n", INPUT_ERROR); return; @@ -183,7 +183,7 @@ colvar::coordnum::coordnum(std::string const &conf) colvar::coordnum::~coordnum() { - if (pairlist != NULL) { + if (pairlist != nullptr) { delete [] pairlist; } } @@ -218,11 +218,11 @@ template void colvar::coordnum::main_loop(bool **pairlist_elem) template int colvar::coordnum::compute_coordnum() { - bool const use_pairlist = (pairlist != NULL); - bool const rebuild_pairlist = (pairlist != NULL) && + bool const use_pairlist = (pairlist != nullptr); + bool const rebuild_pairlist = (pairlist != nullptr) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : NULL; + bool *pairlist_elem = use_pairlist ? pairlist : nullptr; if (b_anisotropic) { @@ -239,7 +239,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags | ef_anisotropic; - main_loop(NULL); + main_loop(nullptr); } } else { @@ -257,7 +257,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags; - main_loop(NULL); + main_loop(nullptr); } } @@ -367,7 +367,7 @@ void colvar::h_bond::calc_value() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - NULL, 0.0); + nullptr, 0.0); } @@ -378,7 +378,7 @@ void colvar::h_bond::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - NULL, 0.0); + nullptr, 0.0); } @@ -393,7 +393,7 @@ simple_scalar_dist_functions(h_bond) colvar::selfcoordnum::selfcoordnum(std::string const &conf) - : cvc(conf), pairlist(NULL) + : cvc(conf), pairlist(nullptr) { function_type = "selfcoordnum"; x.type(colvarvalue::type_scalar); @@ -438,7 +438,7 @@ colvar::selfcoordnum::selfcoordnum(std::string const &conf) colvar::selfcoordnum::~selfcoordnum() { - if (pairlist != NULL) { + if (pairlist != nullptr) { delete [] pairlist; } } @@ -448,11 +448,11 @@ template int colvar::selfcoordnum::compute_selfcoordnum() { cvm::rvector const r0_vec(0.0); // TODO enable the flag? - bool const use_pairlist = (pairlist != NULL); - bool const rebuild_pairlist = (pairlist != NULL) && + bool const use_pairlist = (pairlist != nullptr); + bool const rebuild_pairlist = (pairlist != nullptr) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : NULL; + bool *pairlist_elem = use_pairlist ? pairlist : nullptr; size_t i = 0, j = 0; size_t const n = group1->size(); @@ -601,13 +601,13 @@ void colvar::groupcoordnum::calc_value() x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } else { int const flags = coordnum::ef_null; x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } } @@ -624,13 +624,13 @@ void colvar::groupcoordnum::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } else { int const flags = coordnum::ef_gradients; coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - NULL, 0.0); + nullptr, 0.0); } group1->set_weighted_gradient(group1_com_atom.grad); diff --git a/lib/colvars/colvarcomp_distances.cpp b/lib/colvars/colvarcomp_distances.cpp index c3c1ee55d..88a5088aa 100644 --- a/lib/colvars/colvarcomp_distances.cpp +++ b/lib/colvars/colvarcomp_distances.cpp @@ -964,7 +964,7 @@ colvar::rmsd::rmsd(std::string const &conf) } bool b_Jacobian_derivative = true; - if (atoms->fitting_group != NULL && b_Jacobian_derivative) { + if (atoms->fitting_group != nullptr && b_Jacobian_derivative) { cvm::log("The option \"fittingGroup\" (alternative group for fitting) was enabled: " "Jacobian derivatives of the RMSD will not be calculated.\n"); b_Jacobian_derivative = false; diff --git a/lib/colvars/colvardeps.cpp b/lib/colvars/colvardeps.cpp index f83458b51..f647211f6 100644 --- a/lib/colvars/colvardeps.cpp +++ b/lib/colvars/colvardeps.cpp @@ -33,7 +33,7 @@ colvardeps::~colvardeps() { // Do not delete features if it's a static object // may change in the future though // for (i=0; i &colvars, {} colvar_grid_scalar::colvar_grid_scalar() - : colvar_grid(), samples(NULL) + : colvar_grid(), samples(nullptr) {} colvar_grid_scalar::colvar_grid_scalar(colvar_grid_scalar const &g) - : colvar_grid(g), samples(NULL) + : colvar_grid(g), samples(nullptr) { } colvar_grid_scalar::colvar_grid_scalar(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, 1), samples(NULL) + : colvar_grid(nx_i, 0.0, 1), samples(nullptr) { } colvar_grid_scalar::colvar_grid_scalar(std::vector &colvars, bool margin) - : colvar_grid(colvars, 0.0, 1, margin), samples(NULL) + : colvar_grid(colvars, 0.0, 1, margin), samples(nullptr) { } @@ -122,15 +122,15 @@ cvm::real colvar_grid_scalar::entropy() const colvar_grid_gradient::colvar_grid_gradient() - : colvar_grid(), samples(NULL) + : colvar_grid(), samples(nullptr) {} colvar_grid_gradient::colvar_grid_gradient(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, nx_i.size()), samples(NULL) + : colvar_grid(nx_i, 0.0, nx_i.size()), samples(nullptr) {} colvar_grid_gradient::colvar_grid_gradient(std::vector &colvars) - : colvar_grid(colvars, 0.0, colvars.size()), samples(NULL) + : colvar_grid(colvars, 0.0, colvars.size()), samples(nullptr) {} void colvar_grid_gradient::write_1D_integral(std::ostream &os) diff --git a/lib/colvars/colvarmodule.cpp b/lib/colvars/colvarmodule.cpp index 1d5f75bbc..48a38a607 100644 --- a/lib/colvars/colvarmodule.cpp +++ b/lib/colvars/colvarmodule.cpp @@ -30,11 +30,11 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) depth_s = 0; log_level_ = 10; - cv_traj_os = NULL; + cv_traj_os = nullptr; xyz_reader_use_count = 0; - if (proxy == NULL) { + if (proxy == nullptr) { proxy = proxy_in; // Pointer to the proxy object parse = new colvarparse(); // Parsing object for global options version_int = proxy->get_version_from_string(COLVARS_VERSION); @@ -573,7 +573,7 @@ colvarbias * colvarmodule::bias_by_name(std::string const &name) return (*bi); } } - return NULL; + return nullptr; } @@ -587,7 +587,7 @@ colvar *colvarmodule::colvar_by_name(std::string const &name) return (*cvi); } } - return NULL; + return nullptr; } @@ -601,7 +601,7 @@ cvm::atom_group *colvarmodule::atom_group_by_name(std::string const &name) return (*agi); } } - return NULL; + return nullptr; } @@ -631,7 +631,7 @@ int colvarmodule::change_configuration(std::string const &bias_name, cvm::increase_depth(); colvarbias *b; b = bias_by_name(bias_name); - if (b == NULL) { + if (b == nullptr) { cvm::error("Error: bias not found: " + bias_name); return COLVARS_ERROR; } @@ -647,7 +647,7 @@ std::string colvarmodule::read_colvar(std::string const &name) colvar *c; std::stringstream ss; c = colvar_by_name(name); - if (c == NULL) { + if (c == nullptr) { cvm::error("Error: colvar not found: " + name); return std::string(); } @@ -663,7 +663,7 @@ cvm::real colvarmodule::energy_difference(std::string const &bias_name, colvarbias *b; cvm::real energy_diff = 0.; b = bias_by_name(bias_name); - if (b == NULL) { + if (b == nullptr) { cvm::error("Error: bias not found: " + bias_name); return 0.; } @@ -678,7 +678,7 @@ int colvarmodule::bias_current_bin(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->current_bin(); } else { cvm::error("Error: bias not found.\n"); @@ -695,7 +695,7 @@ int colvarmodule::bias_bin_num(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->bin_num(); } else { cvm::error("Error: bias not found.\n"); @@ -712,7 +712,7 @@ int colvarmodule::bias_bin_count(std::string const &bias_name, size_t bin_index) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { ret = b->bin_count(bin_index); } else { cvm::error("Error: bias not found.\n"); @@ -729,7 +729,7 @@ int colvarmodule::bias_share(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != NULL) { + if (b != nullptr) { b->replica_share(); ret = COLVARS_OK; } else { @@ -1037,7 +1037,7 @@ int colvarmodule::write_restart_file(std::string const &out_name) int colvarmodule::write_traj_files() { - if (cv_traj_os == NULL) { + if (cv_traj_os == nullptr) { if (open_traj_file(cv_traj_name) != COLVARS_OK) { return cvm::get_error(); } else { @@ -1057,7 +1057,7 @@ int colvarmodule::write_traj_files() write_traj(*cv_traj_os); } - if (restart_out_freq && (cv_traj_os != NULL)) { + if (restart_out_freq && (cv_traj_os != nullptr)) { // flush the trajectory file if we are at the restart frequency if ( (cvm::step_relative() > 0) && ((cvm::step_absolute() % restart_out_freq) == 0) ) { @@ -1151,8 +1151,8 @@ colvarmodule::~colvarmodule() atom_group::delete_features(); delete parse; - parse = NULL; - proxy = NULL; + parse = nullptr; + proxy = nullptr; } } @@ -1184,7 +1184,7 @@ int colvarmodule::reset() proxy->reset(); - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { // Do not close traj file here, as we might not be done with it yet. proxy->flush_output_stream(cv_traj_os); } @@ -1395,7 +1395,7 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) if (static_cast(is.tellg()) == pos) { // This block has not been read by any object: discard it and move on // to the next one - is >> colvarparse::read_block(word, NULL); + is >> colvarparse::read_block(word, nullptr); } if (!is) break; @@ -1456,7 +1456,7 @@ int colvarmodule::write_output_files() } cvm::decrease_depth(); - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { // do not close, there may be another run command proxy->flush_output_stream(cv_traj_os); } @@ -1575,7 +1575,7 @@ std::ostream & colvarmodule::write_restart(std::ostream &os) int colvarmodule::open_traj_file(std::string const &file_name) { - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { return COLVARS_OK; } @@ -1591,7 +1591,7 @@ int colvarmodule::open_traj_file(std::string const &file_name) cv_traj_os = (cvm::proxy)->output_stream(file_name); } - if (cv_traj_os == NULL) { + if (cv_traj_os == nullptr) { cvm::error("Error: cannot write to file \""+file_name+"\".\n", FILE_ERROR); } @@ -1602,9 +1602,9 @@ int colvarmodule::open_traj_file(std::string const &file_name) int colvarmodule::close_traj_file() { - if (cv_traj_os != NULL) { + if (cv_traj_os != nullptr) { proxy->close_output_stream(cv_traj_name); - cv_traj_os = NULL; + cv_traj_os = nullptr; } return cvm::get_error(); } @@ -1672,7 +1672,7 @@ void cvm::log(std::string const &message, int min_log_level) { if (cvm::log_level() < min_log_level) return; // allow logging when the module is not fully initialized - size_t const d = (cvm::main() != NULL) ? depth() : 0; + size_t const d = (cvm::main() != nullptr) ? depth() : 0; if (d > 0) { proxy->log((std::string(2*d, ' '))+message); } else { @@ -1780,7 +1780,7 @@ int cvm::read_index_file(char const *filename) } if (index_of_group < 0) { index_group_names.push_back(group_name); - index_groups.push_back(NULL); + index_groups.push_back(nullptr); index_of_group = index_groups.size()-1; } } else { @@ -1799,7 +1799,7 @@ int cvm::read_index_file(char const *filename) pos = is.tellg(); } - if (old_index_group != NULL) { + if (old_index_group != nullptr) { bool equal = false; if (new_index_group->size() == old_index_group->size()) { if (std::equal(new_index_group->begin(), new_index_group->end(), @@ -1810,13 +1810,13 @@ int cvm::read_index_file(char const *filename) if (! equal) { new_index_group->clear(); delete new_index_group; - new_index_group = NULL; + new_index_group = nullptr; return cvm::error("Error: the index group \""+group_name+ "\" was redefined.\n", INPUT_ERROR); } else { old_index_group->clear(); delete old_index_group; - old_index_group = NULL; + old_index_group = nullptr; } } @@ -1850,7 +1850,7 @@ int colvarmodule::reset_index_groups() size_t i = 0; for ( ; i < index_groups.size(); i++) { delete index_groups[i]; - index_groups[i] = NULL; + index_groups[i] = nullptr; } index_group_names.clear(); index_groups.clear(); @@ -2179,7 +2179,7 @@ std::string cvm::wrap_string(std::string const &s, size_t nchars) // shared pointer to the proxy object -colvarproxy *colvarmodule::proxy = NULL; +colvarproxy *colvarmodule::proxy = nullptr; // static runtime data cvm::real colvarmodule::debug_gradients_step_size = 1.0e-07; diff --git a/lib/colvars/colvarmodule.h b/lib/colvars/colvarmodule.h index 9346e8e1d..e06f05aca 100644 --- a/lib/colvars/colvarmodule.h +++ b/lib/colvars/colvarmodule.h @@ -459,13 +459,13 @@ public: /// Backup a file before writing it static int backup_file(char const *filename); - /// Look up a bias by name; returns NULL if not found + /// Look up a bias by name; returns nullptr if not found static colvarbias * bias_by_name(std::string const &name); - /// Look up a colvar by name; returns NULL if not found + /// Look up a colvar by name; returns nullptr if not found static colvar * colvar_by_name(std::string const &name); - /// Look up a named atom group by name; returns NULL if not found + /// Look up a named atom group by name; returns nullptr if not found static atom_group * atom_group_by_name(std::string const &name); /// Load new configuration for the given bias - diff --git a/lib/colvars/colvarparams.cpp b/lib/colvars/colvarparams.cpp index e957a1841..ea45c0110 100644 --- a/lib/colvars/colvarparams.cpp +++ b/lib/colvars/colvarparams.cpp @@ -76,7 +76,7 @@ void const *colvarparams::get_param_ptr(std::string const ¶m_name) return param_map[param_name]; } cvm::error("Error: parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return NULL; + return nullptr; } @@ -87,7 +87,7 @@ void const *colvarparams::get_param_grad_ptr(std::string const ¶m_name) } cvm::error("Error: gradient of parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return NULL; + return nullptr; } @@ -95,7 +95,7 @@ cvm::real colvarparams::get_param(std::string const ¶m_name) { cvm::real const *ptr = reinterpret_cast(get_param_ptr(param_name)); - return ptr != NULL ? *ptr : 0.0; + return ptr != nullptr ? *ptr : 0.0; } diff --git a/lib/colvars/colvarparse.cpp b/lib/colvars/colvarparse.cpp index a09d6be9e..e61ebf355 100644 --- a/lib/colvars/colvarparse.cpp +++ b/lib/colvars/colvarparse.cpp @@ -674,12 +674,12 @@ bool colvarparse::key_lookup(std::string const &conf, std::string const conf_lower(to_lower_cppstr(conf)); // by default, there is no value, unless we found one - if (data != NULL) { + if (data != nullptr) { data->clear(); } // start from the first occurrence of key - size_t pos = conf_lower.find(key, (save_pos != NULL) ? *save_pos : 0); + size_t pos = conf_lower.find(key, (save_pos != nullptr) ? *save_pos : 0); // iterate over all instances of the substring until it finds it as isolated keyword while (true) { @@ -727,7 +727,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != NULL) { + if (save_pos != nullptr) { // save the pointer for a future call (when iterating over multiple // valid instances of the same keyword) *save_pos = pos + key.size(); @@ -820,7 +820,7 @@ bool colvarparse::key_lookup(std::string const &conf, data_end) + 1; } - if (data != NULL) { + if (data != nullptr) { data->append(line, data_begin, (data_end-data_begin)); if (cvm::debug()) { @@ -834,7 +834,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != NULL) *save_pos = line_end; + if (save_pos != nullptr) *save_pos = line_end; return true; } diff --git a/lib/colvars/colvarparse.h b/lib/colvars/colvarparse.h index b7d42fdff..fc1362b2b 100644 --- a/lib/colvars/colvarparse.h +++ b/lib/colvars/colvarparse.h @@ -275,12 +275,12 @@ public: /// The keyword that identifies the block std::string const key; - /// Where to keep the data (may be NULL) + /// Where to keep the data (may be nullptr) std::string * const data; public: - read_block(std::string const &key_in, std::string *data_in = NULL); + read_block(std::string const &key_in, std::string *data_in = nullptr); ~read_block(); @@ -300,8 +300,8 @@ public: /// within "conf", useful when doing multiple calls bool key_lookup(std::string const &conf, char const *key, - std::string *data = NULL, - size_t *save_pos = NULL); + std::string *data = nullptr, + size_t *save_pos = nullptr); /// \brief Reads a configuration line, adds it to config_string, and returns /// the stream \param is Input stream \param line String that will hold the diff --git a/lib/colvars/colvarproxy.cpp b/lib/colvars/colvarproxy.cpp index 63ae07a57..7eb0b22cb 100644 --- a/lib/colvars/colvarproxy.cpp +++ b/lib/colvars/colvarproxy.cpp @@ -296,7 +296,7 @@ void colvarproxy_atom_groups::clear_atom_group(int index) colvarproxy_smp::colvarproxy_smp() { b_smp_active = true; // May be disabled by user option - omp_lock_state = NULL; + omp_lock_state = nullptr; #if defined(_OPENMP) if (smp_thread_id() == 0) { omp_lock_state = reinterpret_cast(new omp_lock_t); @@ -459,7 +459,7 @@ int colvarproxy_smp::smp_unlock() colvarproxy_script::colvarproxy_script() { - script = NULL; + script = nullptr; } @@ -507,7 +507,7 @@ int colvarproxy_script::run_colvar_gradient_callback(std::string const & /* name colvarproxy_tcl::colvarproxy_tcl() { - tcl_interp_ = NULL; + tcl_interp_ = nullptr; } @@ -528,7 +528,7 @@ char const *colvarproxy_tcl::tcl_obj_to_str(unsigned char *obj) #if defined(COLVARS_TCL) return Tcl_GetString(reinterpret_cast(obj)); #else - return NULL; + return nullptr; #endif } @@ -666,7 +666,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, } std::ostream *os = get_output_stream(output_name); - if (os != NULL) return os; + if (os != nullptr) return os; if (!(mode & (std::ios_base::app | std::ios_base::ate))) { backup_file(output_name); @@ -675,7 +675,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, if (!osf->is_open()) { cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", FILE_ERROR); - return NULL; + return nullptr; } output_stream_names.push_back(output_name); output_files.push_back(osf); @@ -692,7 +692,7 @@ std::ostream *colvarproxy_io::get_output_stream(std::string const &output_name) return *osi; } } - return NULL; + return nullptr; } @@ -794,7 +794,7 @@ int colvarproxy_io::rename_file(char const *filename, char const *newfilename) colvarproxy::colvarproxy() { - colvars = NULL; + colvars = nullptr; b_simulation_running = true; b_delete_requested = false; } diff --git a/lib/colvars/colvarproxy.h b/lib/colvars/colvarproxy.h index ba91afb40..a46589a52 100644 --- a/lib/colvars/colvarproxy.h +++ b/lib/colvars/colvarproxy.h @@ -607,7 +607,7 @@ public: std::ios_base::openmode mode = std::ios_base::out); - /// Returns a reference to output_name if it exists, NULL otherwise + /// Returns a reference to output_name if it exists, nullptr otherwise virtual std::ostream *get_output_stream(std::string const &output_name); /// \brief Flushes the given output channel diff --git a/lib/colvars/colvarscript.cpp b/lib/colvars/colvarscript.cpp index 10b276c89..a8b5d6ab2 100644 --- a/lib/colvars/colvarscript.cpp +++ b/lib/colvars/colvarscript.cpp @@ -97,7 +97,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvar *cv = cvm::colvar_by_name(name); - if (cv == NULL) { + if (cv == nullptr) { result = "Colvar not found: " + name; return COLVARSCRIPT_ERROR; } @@ -111,7 +111,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvarbias *b = cvm::bias_by_name(name); - if (b == NULL) { + if (b == nullptr) { result = "Bias not found: " + name; return COLVARSCRIPT_ERROR; } @@ -186,7 +186,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) /// Parse config from string if (cmd == "config") { - return exec_command(cv_config, NULL, objc, objv); + return exec_command(cv_config, nullptr, objc, objv); } /// Load an input state file @@ -247,7 +247,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } else if (objc == 3) { // Failure of this function does not trigger an error, but // returns nonzero, to let scripts detect available frames - int error = proxy->set_frame(strtol(obj_to_str(objv[2]), NULL, 10)); + int error = proxy->set_frame(strtol(obj_to_str(objv[2]), nullptr, 10)); result = cvm::to_str(error == COLVARS_OK ? 0 : -1); return COLVARS_OK; } else { @@ -258,7 +258,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) if (cmd == "addenergy") { if (objc == 3) { - colvars->total_bias_energy += strtod(obj_to_str(objv[2]), NULL); + colvars->total_bias_energy += strtod(obj_to_str(objv[2]), nullptr); return COLVARS_OK; } else { result = "Wrong arguments to command \"addenergy\"\n" + help_string(); @@ -267,7 +267,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } if (cmd == "help") { - return exec_command(cv_help, NULL, objc, objv); + return exec_command(cv_help, nullptr, objc, objv); } result = "Syntax error\n" + help_string(); @@ -320,7 +320,7 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) // colvar destructor is tasked with the cleanup delete cv; // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { + if (colvars->cv_traj_os != nullptr) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -513,7 +513,7 @@ int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[] // the bias destructor takes care of the cleanup at cvm level delete b; // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { + if (colvars->cv_traj_os != nullptr) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -564,7 +564,7 @@ int colvarscript::proc_features(colvardeps *obj, if ((subcmd == "get") || (subcmd == "set")) { std::vector const &features = obj->features(); std::string const req_feature(obj_to_str(objv[3])); - colvardeps::feature *f = NULL; + colvardeps::feature *f = nullptr; int fid = 0; for (fid = 0; fid < int(features.size()); fid++) { if (features[fid]->description == @@ -574,7 +574,7 @@ int colvarscript::proc_features(colvardeps *obj, } } - if (f == NULL) { + if (f == nullptr) { result = "Error: feature \""+req_feature+"\" does not exist.\n"; return COLVARSCRIPT_ERROR; diff --git a/lib/colvars/colvarscript.h b/lib/colvars/colvarscript.h index 69d52cbb5..04679b37a 100644 --- a/lib/colvars/colvarscript.h +++ b/lib/colvars/colvarscript.h @@ -278,7 +278,7 @@ extern "C" { 1, 1, { "E (float) - Amount of energy to add" }, cvm::main()->total_bias_energy += - strtod(script->obj_to_str(objv[2]), NULL); + strtod(script->obj_to_str(objv[2]), nullptr); return COLVARS_OK; ) diff --git a/lib/colvars/colvartypes.h b/lib/colvars/colvartypes.h index e5f12154e..55401576b 100644 --- a/lib/colvars/colvartypes.h +++ b/lib/colvars/colvartypes.h @@ -59,7 +59,7 @@ public: if (data.size() > 0) { return &(data[0]); } else { - return NULL; + return nullptr; } } @@ -520,7 +520,7 @@ public: if (rows.size() > 0) { return &(pointers[0]); } else { - return NULL; + return nullptr; } } diff --git a/lib/colvars/lepton/include/lepton/Operation.h b/lib/colvars/lepton/include/lepton/Operation.h index 1ddde0b8c..68474137f 100644 --- a/lib/colvars/lepton/include/lepton/Operation.h +++ b/lib/colvars/lepton/include/lepton/Operation.h @@ -186,7 +186,7 @@ public: } bool operator!=(const Operation& op) const { const Constant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -217,7 +217,7 @@ public: ExpressionTreeNode differentiate(const std::vector& children, const std::vector& childDerivs, const std::string& variable) const; bool operator!=(const Operation& op) const { const Variable* o = dynamic_cast(&op); - return (o == NULL || o->name != name); + return (o == nullptr || o->name != name); } private: std::string name; @@ -264,7 +264,7 @@ public: } bool operator!=(const Operation& op) const { const Custom* o = dynamic_cast(&op); - return (o == NULL || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); + return (o == nullptr || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); } private: std::string name; @@ -955,7 +955,7 @@ public: } bool operator!=(const Operation& op) const { const AddConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -988,7 +988,7 @@ public: } bool operator!=(const Operation& op) const { const MultiplyConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } private: double value; @@ -1042,7 +1042,7 @@ public: } bool operator!=(const Operation& op) const { const PowerConstant* o = dynamic_cast(&op); - return (o == NULL || o->value != value); + return (o == nullptr || o->value != value); } bool isInfixOperator() const { return true; diff --git a/lib/colvars/lepton/src/CompiledExpression.cpp b/lib/colvars/lepton/src/CompiledExpression.cpp index 1ad348b47..6abcad2de 100644 --- a/lib/colvars/lepton/src/CompiledExpression.cpp +++ b/lib/colvars/lepton/src/CompiledExpression.cpp @@ -40,10 +40,10 @@ using namespace std; using namespace asmjit; #endif -CompiledExpression::CompiledExpression() : jitCode(NULL) { +CompiledExpression::CompiledExpression() : jitCode(nullptr) { } -CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(NULL) { +CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(nullptr) { ParsedExpression expr = expression.optimize(); // Just in case it wasn't already optimized. vector > temps; compileExpression(expr.getRootNode(), temps); @@ -59,11 +59,11 @@ CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jit CompiledExpression::~CompiledExpression() { for (int i = 0; i < (int) operation.size(); i++) - if (operation[i] != NULL) + if (operation[i] != nullptr) delete operation[i]; } -CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(NULL) { +CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(nullptr) { *this = expression; } diff --git a/lib/colvars/lepton/src/ExpressionTreeNode.cpp b/lib/colvars/lepton/src/ExpressionTreeNode.cpp index 851987826..09c5352d2 100644 --- a/lib/colvars/lepton/src/ExpressionTreeNode.cpp +++ b/lib/colvars/lepton/src/ExpressionTreeNode.cpp @@ -59,14 +59,14 @@ ExpressionTreeNode::ExpressionTreeNode(Operation* operation) : operation(operati throw Exception("wrong number of arguments to function: "+operation->getName()); } -ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == NULL ? NULL : node.operation->clone()), children(node.getChildren()) { +ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == nullptr ? nullptr : node.operation->clone()), children(node.getChildren()) { } -ExpressionTreeNode::ExpressionTreeNode() : operation(NULL) { +ExpressionTreeNode::ExpressionTreeNode() : operation(nullptr) { } ExpressionTreeNode::~ExpressionTreeNode() { - if (operation != NULL) + if (operation != nullptr) delete operation; } @@ -91,7 +91,7 @@ bool ExpressionTreeNode::operator==(const ExpressionTreeNode& node) const { } ExpressionTreeNode& ExpressionTreeNode::operator=(const ExpressionTreeNode& node) { - if (operation != NULL) + if (operation != nullptr) delete operation; operation = node.getOperation().clone(); children = node.getChildren(); diff --git a/lib/colvars/lepton/src/ParsedExpression.cpp b/lib/colvars/lepton/src/ParsedExpression.cpp index fd3b091d3..c25975634 100644 --- a/lib/colvars/lepton/src/ParsedExpression.cpp +++ b/lib/colvars/lepton/src/ParsedExpression.cpp @@ -46,7 +46,7 @@ ParsedExpression::ParsedExpression(const ExpressionTreeNode& rootNode) : rootNod } const ExpressionTreeNode& ParsedExpression::getRootNode() const { - if (&rootNode.getOperation() == NULL) + if (&rootNode.getOperation() == nullptr) throw Exception("Illegal call to an initialized ParsedExpression"); return rootNode; } diff --git a/lib/gpu/cudpp_mini/cudpp.cpp b/lib/gpu/cudpp_mini/cudpp.cpp index e2cd4621a..950632074 100644 --- a/lib/gpu/cudpp_mini/cudpp.cpp +++ b/lib/gpu/cudpp_mini/cudpp.cpp @@ -95,7 +95,7 @@ CUDPPResult cudppScan(CUDPPHandle planHandle, size_t numElements) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, 1, plan); return CUDPP_SUCCESS; @@ -159,7 +159,7 @@ CUDPPResult cudppSegmentedScan(CUDPPHandle planHandle, { CUDPPSegmentedScanPlan *plan = (CUDPPSegmentedScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSegmentedScanDispatch(d_out, d_idata, d_iflags, numElements, plan); return CUDPP_SUCCESS; @@ -200,7 +200,7 @@ CUDPPResult cudppMultiScan(CUDPPHandle planHandle, size_t numRows) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, numRows, plan); return CUDPP_SUCCESS; @@ -255,7 +255,7 @@ CUDPPResult cudppCompact(CUDPPHandle planHandle, size_t numElements) { CUDPPCompactPlan *plan = (CUDPPCompactPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppCompactDispatch(d_out, d_numValidElements, d_in, d_isValid, numElements, plan); @@ -300,7 +300,7 @@ CUDPPResult cudppSort(CUDPPHandle planHandle, size_t numElements) { CUDPPRadixSortPlan *plan = (CUDPPRadixSortPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppRadixSortDispatch(d_keys, d_values, numElements, keyBits, plan); return CUDPP_SUCCESS; @@ -331,7 +331,7 @@ CUDPPResult cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandl CUDPPSparseMatrixVectorMultiplyPlan *plan = (CUDPPSparseMatrixVectorMultiplyPlan*)CUDPPPlanManager::GetPlan(sparseMatrixHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSparseMatrixVectorMultiplyDispatch(d_y, d_x, plan); return CUDPP_SUCCESS; @@ -366,7 +366,7 @@ CUDPP_DLL CUDPPResult cudppRand(CUDPPHandle planHandle,void * d_out, size_t numElements) { CUDPPRandPlan * plan = (CUDPPRandPlan *) CUDPPPlanManager::GetPlan(planHandle); - if(plan != NULL) + if(plan != nullptr) { //dispatch the rand algorithm here cudppRandDispatch(d_out, numElements, plan); diff --git a/lib/gpu/cudpp_mini/cudpp_plan.cpp b/lib/gpu/cudpp_mini/cudpp_plan.cpp index e92a857dd..8ea99a23f 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan.cpp @@ -18,7 +18,7 @@ #include -CUDPPPlanManager* CUDPPPlanManager::m_instance = NULL; +CUDPPPlanManager* CUDPPPlanManager::m_instance = nullptr; CUDPPResult validateOptions(CUDPPConfiguration config, size_t /*numElements*/, size_t numRows, size_t /*rowPitch*/) { diff --git a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp index dd9d6eb9d..33c8621d2 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp @@ -26,17 +26,17 @@ extern "C" void compNumCTAs(KernelPointer kernel, size_t bytesDynamicSharedMem, //! @internal Instantiate the plan manager singleton object void CUDPPPlanManager::Instantiate() { - if (NULL == m_instance) + if (nullptr == m_instance) m_instance = new CUDPPPlanManager; } //! @internal Destroy the plan manager singleton object void CUDPPPlanManager::Destroy() { - if (NULL != m_instance) + if (nullptr != m_instance) { delete m_instance; - m_instance = NULL; + m_instance = nullptr; } } @@ -51,7 +51,7 @@ CUDPPPlanManager::~CUDPPPlanManager() { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; } m_instance->plans.clear(); @@ -85,7 +85,7 @@ CUDPPHandle CUDPPPlanManager::AddPlan(CUDPPPlan* plan) */ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { return false; } @@ -97,7 +97,7 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; m_instance->plans.erase(it); if (0 == m_instance->plans.size()) @@ -115,14 +115,14 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) /** @brief Get a plan from the plan manager by handle * -* @returns A pointer to the plan if found, or NULL otherwise +* @returns A pointer to the plan if found, or nullptr otherwise * @param handle The handle to the requested plan */ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { - return NULL; + return nullptr; } std::map::iterator it; @@ -133,13 +133,13 @@ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) } else { - return NULL; + return nullptr; } } size_t CUDPPPlanManager::numCTAs(KernelPointer kernel) { - if (m_instance == NULL) + if (m_instance == nullptr) { return 0; } diff --git a/lib/gpu/cudpp_mini/cutil.h b/lib/gpu/cudpp_mini/cutil.h index 7d1fcc17e..54f29f498 100644 --- a/lib/gpu/cudpp_mini/cutil.h +++ b/lib/gpu/cudpp_mini/cutil.h @@ -136,7 +136,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -152,7 +152,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -168,7 +168,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -183,7 +183,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -199,7 +199,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -215,7 +215,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -307,7 +307,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -350,7 +350,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -366,7 +366,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -381,7 +381,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index 93f38d28b..d2fb1919b 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -261,7 +261,7 @@ class UCL_Device { /// Select the platform that has accelerators (for compatibility with OpenCL) inline int set_platform_accelerator(int pid=-1) { return UCL_SUCCESS; } - inline int load_module(const void* program, hipModule_t& module, std::string *log=NULL){ + inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){ auto it = _loaded_modules.emplace(program, hipModule_t()); if(!it.second){ module = it.first->second; @@ -281,7 +281,7 @@ class UCL_Device { hipError_t err=hipModuleLoadDataEx(&module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != hipSuccess) { diff --git a/lib/gpu/geryon/hip_kernel.h b/lib/gpu/geryon/hip_kernel.h index 654eb4477..c5014b52e 100644 --- a/lib/gpu/geryon/hip_kernel.h +++ b/lib/gpu/geryon/hip_kernel.h @@ -30,7 +30,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _device_ptr = &device; _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _device_ptr = &device; _cq=device.cq(); init(device); load_string(program,flags,log); @@ -46,7 +46,7 @@ class UCL_Program { inline void clear() { } /// Load a program from a file and compile with flags - inline int load(const char *filename, const char *flags="", std::string *log=NULL) { + inline int load(const char *filename, const char *flags="", std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -64,7 +64,7 @@ class UCL_Program { } /// Load a program from a string and compile with flags - inline int load_string(const void *program, const char *flags="", std::string *log=NULL) { + inline int load_string(const void *program, const char *flags="", std::string *log=nullptr) { return _device_ptr->load_module(program, _module, log); } @@ -263,7 +263,7 @@ class UCL_Kernel { }; const auto res = hipModuleLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq, NULL, config); + _block_size[2],0,_cq, nullptr, config); CU_SAFE_CALL(res); //#endif } diff --git a/lib/gpu/geryon/hip_memory.h b/lib/gpu/geryon/hip_memory.h index 13f60ad93..a983ba322 100644 --- a/lib/gpu/geryon/hip_memory.h +++ b/lib/gpu/geryon/hip_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/hip_texture.h b/lib/gpu/geryon/hip_texture.h index e7aa4e146..ae16bee90 100644 --- a/lib/gpu/geryon/hip_texture.h +++ b/lib/gpu/geryon/hip_texture.h @@ -99,7 +99,7 @@ class UCL_Texture { else CU_SAFE_CALL(hipTexRefSetFormat(_tex,HIP_AD_FORMAT_SIGNED_INT32,numel*2)); } - CU_SAFE_CALL(hipTexRefSetAddress(NULL, _tex, vec.cbegin(), vec.numel()*vec.element_size())); + CU_SAFE_CALL(hipTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); #else void* data_ptr = (void*)vec.cbegin(); CU_SAFE_CALL(hipMemcpyHtoD(hipDeviceptr_t(_device_ptr_to_global_var), &data_ptr, sizeof(void*))); diff --git a/lib/gpu/geryon/nvd_kernel.h b/lib/gpu/geryon/nvd_kernel.h index 9293db2fe..d74b0e2dc 100644 --- a/lib/gpu/geryon/nvd_kernel.h +++ b/lib/gpu/geryon/nvd_kernel.h @@ -41,7 +41,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _cq=device.cq(); init(device); load_string(program,flags,log); @@ -58,7 +58,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -77,7 +77,7 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { if (std::string(flags)=="BINARY") return load_binary((const char *)program); const unsigned int num_opts=2; @@ -95,7 +95,7 @@ class UCL_Program { CUresult err=cuModuleLoadDataEx(&_module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != CUDA_SUCCESS) { @@ -361,7 +361,7 @@ class UCL_Kernel { #if CUDA_VERSION >= 4000 CU_SAFE_CALL(cuLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq,_kernel_args,NULL)); + _block_size[2],0,_cq,_kernel_args,nullptr)); #else CU_SAFE_CALL(cuParamSetSize(_kernel,_param_size)); CU_SAFE_CALL(cuLaunchGridAsync(_kernel,_num_blocks[0],_num_blocks[1],_cq)); diff --git a/lib/gpu/geryon/nvd_memory.h b/lib/gpu/geryon/nvd_memory.h index 0484e33de..bcfc055ac 100644 --- a/lib/gpu/geryon/nvd_memory.h +++ b/lib/gpu/geryon/nvd_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/nvd_texture.h b/lib/gpu/geryon/nvd_texture.h index 965595a44..c766af826 100644 --- a/lib/gpu/geryon/nvd_texture.h +++ b/lib/gpu/geryon/nvd_texture.h @@ -80,7 +80,7 @@ class UCL_Texture { #ifdef UCL_DEBUG assert(numel!=0 && numel<5); #endif - CU_SAFE_CALL(cuTexRefSetAddress(NULL, _tex, vec.cbegin(), + CU_SAFE_CALL(cuTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); if (vec.element_size()==sizeof(float)) CU_SAFE_CALL(cuTexRefSetFormat(_tex, CU_AD_FORMAT_FLOAT, numel)); diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index 10e84a436..de4def0bc 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -360,7 +360,7 @@ int UCL_Device::set_platform(int pid) { // --- Get Number of Devices cl_uint n; - errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,NULL,&n); + errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,nullptr,&n); _num_devices=n; if (errorv!=CL_SUCCESS || _num_devices==0) { _num_devices=0; @@ -385,7 +385,7 @@ int UCL_Device::create_context() { props[0]=CL_CONTEXT_PLATFORM; props[1]=_platform; props[2]=0; - _context=clCreateContext(0,1,&_cl_device,NULL,NULL,&errorv); + _context=clCreateContext(0,1,&_cl_device,nullptr,nullptr,&errorv); if (errorv!=CL_SUCCESS) { #ifndef UCL_NO_EXIT std::cerr << "UCL Error: Could not access accelerator number " << _device @@ -404,36 +404,36 @@ void UCL_Device::add_properties(cl_device_id device_list) { char buffer[1024]; cl_bool ans_bool; - CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,NULL)); + CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,nullptr)); op.name=buffer; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_GLOBAL_MEM_SIZE, - sizeof(op.global_mem),&op.global_mem,NULL)); + sizeof(op.global_mem),&op.global_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_LOCAL_MEM_SIZE, - sizeof(op.shared_mem),&op.shared_mem,NULL)); + sizeof(op.shared_mem),&op.shared_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, - sizeof(op.const_mem),&op.const_mem,NULL)); + sizeof(op.const_mem),&op.const_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_TYPE, - sizeof(op.device_type),&op.device_type,NULL)); + sizeof(op.device_type),&op.device_type,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(op.compute_units),&op.compute_units, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CLOCK_FREQUENCY, - sizeof(op.clock),&op.clock,NULL)); + sizeof(op.clock),&op.clock,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(op.work_group_size),&op.work_group_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_ITEM_SIZES, 3*sizeof(op.work_item_size[0]),op.work_item_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MEM_BASE_ADDR_ALIGN, - sizeof(cl_uint),&op.alignment,NULL)); + sizeof(cl_uint),&op.alignment,nullptr)); op.alignment/=8; // Determine if double precision is supported cl_uint double_width; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, - sizeof(double_width),&double_width,NULL)); + sizeof(double_width),&double_width,nullptr)); if (double_width==0) op.double_precision=false; else @@ -441,13 +441,13 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PROFILING_TIMER_RESOLUTION, - sizeof(size_t),&op.timer_resolution,NULL)); + sizeof(size_t),&op.timer_resolution,nullptr)); op.ecc_support=false; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_ERROR_CORRECTION_SUPPORT, - sizeof(ans_bool),&ans_bool,NULL)); + sizeof(ans_bool),&ans_bool,nullptr)); if (ans_bool==CL_TRUE) op.ecc_support=true; @@ -459,7 +459,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { #ifdef CL_VERSION_1_2 size_t return_bytes; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_OPENCL_C_VERSION,1024, - buffer,NULL)); + buffer,nullptr)); op.c_version=buffer; cl_device_partition_property pinfo[4]; @@ -479,7 +479,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, - sizeof(cl_uint),&op.max_sub_devices,NULL)); + sizeof(cl_uint),&op.max_sub_devices,nullptr)); #endif _properties.push_back(op); @@ -489,15 +489,15 @@ std::string UCL_Device::platform_name() { char info[1024]; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VENDOR,1024,info, - NULL)); + nullptr)); std::string ans=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_NAME,1024,info, - NULL)); + nullptr)); ans+=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VERSION,1024,info, - NULL)); + nullptr)); ans+=std::string(info); return ans; diff --git a/lib/gpu/geryon/ocl_kernel.h b/lib/gpu/geryon/ocl_kernel.h index b65049b9e..77593f451 100644 --- a/lib/gpu/geryon/ocl_kernel.h +++ b/lib/gpu/geryon/ocl_kernel.h @@ -42,7 +42,7 @@ class UCL_Program { inline UCL_Program() : _init_done(false) {} inline UCL_Program(UCL_Device &device) : _init_done(false) { init(device); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) : + const char *flags="", std::string *log=nullptr) : _init_done(false) { init(device); load_string(program,flags,log); @@ -74,7 +74,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -93,29 +93,29 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { cl_int error_flag; const char *prog=(const char *)program; - _program=clCreateProgramWithSource(_context,1,&prog,NULL,&error_flag); + _program=clCreateProgramWithSource(_context,1,&prog,nullptr,&error_flag); CL_CHECK_ERR(error_flag); - error_flag = clBuildProgram(_program,1,&_device,flags,NULL,NULL); + error_flag = clBuildProgram(_program,1,&_device,flags,nullptr,nullptr); if (error_flag!=-11) CL_CHECK_ERR(error_flag); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); - if (build_status != CL_SUCCESS || log!=NULL) { + if (build_status != CL_SUCCESS || log!=nullptr) { size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); - if (log!=NULL) + if (log!=nullptr) *log=std::string(build_log); if (build_status != CL_SUCCESS) { @@ -363,7 +363,7 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) _kernel_info_name=function; cl_uint nargs; CL_SAFE_CALL(clGetKernelInfo(_kernel,CL_KERNEL_NUM_ARGS,sizeof(cl_uint), - &nargs,NULL)); + &nargs,nullptr)); _kernel_info_nargs=nargs; #ifdef NOT_TEST_CL_VERSION_1_2 char tname[256]; @@ -380,8 +380,8 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) } void UCL_Kernel::run() { - CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,NULL, - _num_blocks,_block_size,0,NULL,NULL)); + CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,nullptr, + _num_blocks,_block_size,0,nullptr,nullptr)); } } // namespace diff --git a/lib/gpu/geryon/ocl_memory.h b/lib/gpu/geryon/ocl_memory.h index 9692f4dd7..740020ab1 100644 --- a/lib/gpu/geryon/ocl_memory.h +++ b/lib/gpu/geryon/ocl_memory.h @@ -58,7 +58,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; cl_map_flags map_perm; @@ -103,12 +103,12 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, map_perm=CL_MAP_READ | CL_MAP_WRITE; } - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=cm.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); @@ -120,10 +120,10 @@ inline int _host_view(mat_type &mat, copy_type &cm, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags orig_flags; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_FLAGS,sizeof(orig_flags), - &orig_flags,NULL)); + &orig_flags,nullptr)); orig_flags=orig_flags & ~CL_MEM_ALLOC_HOST_PTR; mat.cbegin()=clCreateBuffer(context, CL_MEM_USE_HOST_PTR | orig_flags, n, @@ -159,13 +159,13 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, } cl_int error_flag; - mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(dev.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=dev.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); return UCL_SUCCESS; @@ -194,10 +194,10 @@ inline int _host_resize(mat_type &mat, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_FLAGS,sizeof(buffer_perm), - &buffer_perm,NULL)); + &buffer_perm,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); @@ -209,12 +209,12 @@ inline int _host_resize(mat_type &mat, const size_t n) { else map_perm=CL_MAP_READ | CL_MAP_WRITE; - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(mat.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); return UCL_SUCCESS; } @@ -229,7 +229,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags flag; if (kind==UCL_READ_WRITE) flag=CL_MEM_READ_WRITE; @@ -247,7 +247,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); @@ -276,7 +276,7 @@ inline int _device_alloc(mat_type &mat, UCL_Device &dev, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(dev.context(),flag,n,NULL, + mat.cbegin()=clCreateBuffer(dev.context(),flag,n,nullptr, &error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; @@ -321,7 +321,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -341,7 +341,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -359,7 +359,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -379,7 +379,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -395,21 +395,21 @@ inline void _host_zero(void *ptr, const size_t n) { inline void _ocl_build(cl_program &program, cl_device_id &device, const char* options = "") { - clBuildProgram(program,1,&device,options,NULL,NULL); + clBuildProgram(program,1,&device,options,nullptr,nullptr); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); if (build_status == CL_SUCCESS) return; size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(program, device,CL_PROGRAM_BUILD_LOG, 0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); std::cerr << std::endl << "----------------------------------------------------------\n" @@ -426,7 +426,7 @@ inline void _ocl_kernel_from_source(cl_context &context, cl_device_id &device, cl_int error_flag; cl_program program=clCreateProgramWithSource(context,lines,source, - NULL,&error_flag); + nullptr,&error_flag); CL_CHECK_ERR(error_flag); _ocl_build(program,device,options); kernel=clCreateKernel(program,function,&error_flag); @@ -444,15 +444,15 @@ inline void _device_zero(mat_type &mat, const size_t n, command_queue &cq) { #ifdef UCL_CL_ZERO cl_int zeroint=0; CL_SAFE_CALL(clEnqueueFillBuffer(cq,mat.begin(),&zeroint,sizeof(cl_int), - mat.byteoff(),n,0,NULL,NULL)); + mat.byteoff(),n,0,nullptr,nullptr)); #else cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_device_id device; CL_SAFE_CALL(clGetContextInfo(context,CL_CONTEXT_DEVICES, - sizeof(cl_device_id),&device,NULL)); + sizeof(cl_device_id),&device,nullptr)); const char * szero[3]={ "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -585,7 +585,7 @@ template <> struct _ucl_memcpy<1,0> { std::cerr << "UCL_COPY 1NS\n"; #endif CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset,n, - dst.begin(),0,NULL,NULL)); + dst.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -607,13 +607,13 @@ template <> struct _ucl_memcpy<1,0> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset, spitch*rows, - (char *)dst.begin()+dst_offset,0,NULL, - NULL)); + (char *)dst.begin()+dst_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy<0,1> { std::cerr << "UCL_COPY 3NS\n"; #endif CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset,n, - src.begin(),0,NULL,NULL)); + src.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -659,13 +659,13 @@ template <> struct _ucl_memcpy<0,1> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset, spitch*rows, - (char *)src.begin()+src_offset,0,NULL, - NULL)); + (char *)src.begin()+src_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy { const size_t dst_offset, const size_t src_offset) { if (src.cbegin()!=dst.cbegin() || src_offset!=dst_offset) { CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,n,0,NULL,NULL)); + dst_offset,n,0,nullptr,nullptr)); #ifdef UCL_DBG_MEM_TRACE std::cerr << "UCL_COPY 6NS\n"; #endif @@ -704,13 +704,13 @@ template struct _ucl_memcpy { if (spitch==dpitch && dst.cols()==src.cols() && src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,spitch*rows,0,NULL,NULL)); + dst_offset,spitch*rows,0,nullptr,nullptr)); else for (size_t i=0; i AnswerT::Answer() : _allocated(false),_eflag(false),_vflag(false), - _inum(0),_ilist(NULL),_newton(false) { + _inum(0),_ilist(nullptr),_newton(false) { } template @@ -119,7 +119,7 @@ void AnswerT::clear() { engv.clear(); time_answer.clear(); _inum=0; - _ilist=NULL; + _ilist=nullptr; _eflag=false; _vflag=false; } @@ -180,7 +180,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=0; i<_inum; i++) evdwl+=engv[i]; if (_ef_atom) { - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) eatom[i]+=engv[i]; } else { @@ -196,7 +196,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=vstart; i void AnswerT::get_answers(double **f, double **tor) { int fl=0; - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) { f[i][0]+=force[fl]; f[i][1]+=force[fl+1]; diff --git a/lib/gpu/lal_base_atomic.cpp b/lib/gpu/lal_base_atomic.cpp index eb0eab87b..42925aaee 100644 --- a/lib/gpu/lal_base_atomic.cpp +++ b/lib/gpu/lal_base_atomic.cpp @@ -25,8 +25,8 @@ BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -135,7 +135,7 @@ int * BaseAtomicT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -231,7 +231,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -244,7 +244,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_charge.cpp b/lib/gpu/lal_base_charge.cpp index 52e8ae2d8..d5a6e0622 100644 --- a/lib/gpu/lal_base_charge.cpp +++ b/lib/gpu/lal_base_charge.cpp @@ -25,8 +25,8 @@ BaseChargeT::BaseCharge() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -137,7 +137,7 @@ int * BaseChargeT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -240,7 +240,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -253,7 +253,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_dipole.cpp b/lib/gpu/lal_base_dipole.cpp index ed71029e6..57773a3b8 100644 --- a/lib/gpu/lal_base_dipole.cpp +++ b/lib/gpu/lal_base_dipole.cpp @@ -25,8 +25,8 @@ BaseDipoleT::BaseDipole() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -139,7 +139,7 @@ int * BaseDipoleT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); atom->cast_quat_data(host_mu[0]); hd_balancer.start_timer(); diff --git a/lib/gpu/lal_base_dpd.cpp b/lib/gpu/lal_base_dpd.cpp index c0d7ad47b..e4fd80fcc 100644 --- a/lib/gpu/lal_base_dpd.cpp +++ b/lib/gpu/lal_base_dpd.cpp @@ -25,8 +25,8 @@ BaseDPDT::BaseDPD() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -138,7 +138,7 @@ int * BaseDPDT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_v_data(host_v,tag); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_ellipsoid.cpp b/lib/gpu/lal_base_ellipsoid.cpp index abc8807a8..524705ed4 100644 --- a/lib/gpu/lal_base_ellipsoid.cpp +++ b/lib/gpu/lal_base_ellipsoid.cpp @@ -33,10 +33,10 @@ BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - nbor_program=NULL; - ellipsoid_program=NULL; - lj_program=NULL; - ucl_device=NULL; + nbor_program=nullptr; + ellipsoid_program=nullptr; + lj_program=nullptr; + ucl_device=nullptr; } template @@ -356,7 +356,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } int ago=hd_balancer.ago_first(f_ago); @@ -369,7 +369,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, reset_nbors(nall, inum, inum_full, ilist, numj, host_type, firstneigh, success); if (!success) - return NULL; + return nullptr; } int *list; if (_multiple_forms) @@ -406,7 +406,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -420,7 +420,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_quat_data(host_quat[0]); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_three.cpp b/lib/gpu/lal_base_three.cpp index 0b4dbdc89..cfc138aea 100644 --- a/lib/gpu/lal_base_three.cpp +++ b/lib/gpu/lal_base_three.cpp @@ -27,8 +27,8 @@ BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) { #ifdef THREE_CONCURRENT ans2=new Answer(); #endif - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -176,7 +176,7 @@ int * BaseThreeT::reset_nbors(const int nall, const int inum, const int nlist, resize_atom(inum,nall,success); resize_local(nall,mn,success); if (!success) - return NULL; + return nullptr; _nall = nall; @@ -310,7 +310,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -326,7 +326,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, _max_nbors = build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_three.h b/lib/gpu/lal_base_three.h index 38af78b78..36129e616 100644 --- a/lib/gpu/lal_base_three.h +++ b/lib/gpu/lal_base_three.h @@ -59,7 +59,7 @@ class BaseThree { const double gpu_split, FILE *screen, const void *pair_program, const char *k_two, const char *k_three_center, const char *k_three_end, - const char *k_short_nbor=NULL); + const char *k_short_nbor=nullptr); /// Estimate the overhead for GPU context changes and CPU driver void estimate_gpu_overhead(); diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index aaf74ed28..6c6a20630 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -72,7 +72,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, // "0:generic" will select platform 0 and tune for generic device // "1:fermi" will select platform 1 and tune for Nvidia Fermi gpu if (ocl_vendor) { - char *sep = NULL; + char *sep = nullptr; if ((sep = strstr(ocl_vendor,":"))) { *sep = '\0'; _platform_id = atoi(ocl_vendor); @@ -182,7 +182,7 @@ template int DeviceT::set_ocl_params(char *ocl_vendor) { #ifdef USE_OPENCL std::string s_vendor=OCL_DEFAULT_VENDOR; - if (ocl_vendor!=NULL) + if (ocl_vendor!=nullptr) s_vendor=ocl_vendor; if (s_vendor=="none") s_vendor="generic"; @@ -215,14 +215,14 @@ int DeviceT::set_ocl_params(char *ocl_vendor) { int token_count=0; std::string params[13]; char *pch = strtok(ocl_vendor,","); - pch = strtok(NULL,","); - if (pch == NULL) return -11; - while (pch != NULL) { + pch = strtok(nullptr,","); + if (pch == nullptr) return -11; + while (pch != nullptr) { if (token_count==13) return -11; params[token_count]=pch; token_count++; - pch = strtok(NULL,","); + pch = strtok(nullptr,","); } _ocl_vendor_string+=" -DMEM_THREADS="+params[0]+ " -DTHREADS_PER_ATOM="+params[1]+ @@ -430,9 +430,9 @@ template void DeviceT::estimate_gpu_overhead(const int kernel_calls, double &gpu_overhead, double &gpu_driver_overhead) { - UCL_H_Vec *host_data_in=NULL, *host_data_out=NULL; - UCL_D_Vec *dev_data_in=NULL, *dev_data_out=NULL, *kernel_data=NULL; - UCL_Timer *timers_in=NULL, *timers_out=NULL, *timers_kernel=NULL; + UCL_H_Vec *host_data_in=nullptr, *host_data_out=nullptr; + UCL_D_Vec *dev_data_in=nullptr, *dev_data_out=nullptr, *kernel_data=nullptr; + UCL_Timer *timers_in=nullptr, *timers_out=nullptr, *timers_kernel=nullptr; UCL_Timer over_timer(*gpu); if (_data_in_estimate>0) { diff --git a/lib/gpu/lal_eam.cpp b/lib/gpu/lal_eam.cpp index 8c81353f3..03479cd16 100644 --- a/lib/gpu/lal_eam.cpp +++ b/lib/gpu/lal_eam.cpp @@ -380,7 +380,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -394,7 +394,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; } else { this->atom->cast_x_data(host_x,host_type); this->atom->add_x_data(host_x,host_type); @@ -429,7 +429,7 @@ void EAMT::compute2(int *ilist, const bool eflag, const bool vflag, time_fp2.stop(); loop2(eflag,vflag); - if (ilist == NULL) + if (ilist == nullptr) this->ans->copy_answers(eflag,vflag,eatom,vatom); else this->ans->copy_answers(eflag,vflag,eatom,vatom, ilist); diff --git a/lib/gpu/lal_lj_tip4p_long.cpp b/lib/gpu/lal_lj_tip4p_long.cpp index bb848ad5c..1f3b32248 100644 --- a/lib/gpu/lal_lj_tip4p_long.cpp +++ b/lib/gpu/lal_lj_tip4p_long.cpp @@ -340,7 +340,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } this->hd_balancer.balance(cpu_time); @@ -353,7 +353,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->atom->cast_q_data(host_q); this->hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 3e128bcf5..6c4890ef4 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -158,7 +158,7 @@ void Neighbor::alloc(bool &success) { } _c_bytes+=nbor_host.device.row_bytes()+dev_numj_host.row_bytes(); } else { - // Some OpenCL implementations return errors for NULL pointers as args + // Some OpenCL implementations return errors for nullptr pointers as args nbor_host.device.view(dev_nbor); dev_numj_host.view(dev_nbor); } diff --git a/lib/gpu/lal_pppm.cpp b/lib/gpu/lal_pppm.cpp index 84d6c16e1..6b5bf88ea 100644 --- a/lib/gpu/lal_pppm.cpp +++ b/lib/gpu/lal_pppm.cpp @@ -35,7 +35,7 @@ PPPMT::PPPM() : _allocated(false), _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); - pppm_program=NULL; + pppm_program=nullptr; } template diff --git a/lib/gpu/lal_pppm_ext.cpp b/lib/gpu/lal_pppm_ext.cpp index a75536eb1..b82688139 100644 --- a/lib/gpu/lal_pppm_ext.cpp +++ b/lib/gpu/lal_pppm_ext.cpp @@ -56,7 +56,7 @@ grdtyp * pppm_gpu_init(memtyp &pppm, const int nlocal, const int nall, } success=0; - grdtyp * host_brick=NULL; + grdtyp * host_brick=nullptr; if (world_me==0) host_brick=pppm.init(nlocal,nall,screen,order,nxlo_out,nylo_out,nzlo_out, nxhi_out,nyhi_out,nzhi_out,rho_coeff,vd_brick, @@ -129,7 +129,7 @@ double pppm_gpu_bytes_f() { void pppm_gpu_forces_f(double **f) { double etmp; PPPMF.atom->data_unavail(); - PPPMF.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMF.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } double * pppm_gpu_init_d(const int nlocal, const int nall, FILE *screen, @@ -173,6 +173,6 @@ double pppm_gpu_bytes_d() { void pppm_gpu_forces_d(double **f) { double etmp; PPPMD.atom->data_unavail(); - PPPMD.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMD.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } diff --git a/lib/gpu/lal_yukawa_colloid.cpp b/lib/gpu/lal_yukawa_colloid.cpp index e71e962ff..46d4d6432 100644 --- a/lib/gpu/lal_yukawa_colloid.cpp +++ b/lib/gpu/lal_yukawa_colloid.cpp @@ -213,7 +213,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -227,7 +227,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->cast_rad_data(rad); this->hd_balancer.start_timer(); } else { diff --git a/lib/kokkos/cmake/compile_tests/pthread.cpp b/lib/kokkos/cmake/compile_tests/pthread.cpp index 92310da02..7fa98611b 100644 --- a/lib/kokkos/cmake/compile_tests/pthread.cpp +++ b/lib/kokkos/cmake/compile_tests/pthread.cpp @@ -4,11 +4,11 @@ void* kokkos_test(void* args) { return args; } int main(void) { pthread_t thread; - /* Use NULL to avoid C++11. Some compilers + /* Use nullptr to avoid C++11. Some compilers do not have C++11 by default. Forcing C++11 in the compile tests can be done, but is unnecessary */ - pthread_create(&thread, NULL, kokkos_test, NULL); - pthread_join(thread, NULL); + pthread_create(&thread, nullptr, kokkos_test, nullptr); + pthread_join(thread, nullptr); return 0; } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index a97fb2f7c..d4db2c538 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -640,7 +640,7 @@ void SharedAllocationRecord:: /*--------------------------------------------------------------------------*/ void* hip_resize_scratch_space(size_t bytes, bool force_shrink) { - static void* ptr = NULL; + static void* ptr = nullptr; static size_t current_size = 0; if (current_size == 0) { current_size = bytes; diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index fad36c02f..613793fc6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -139,7 +139,7 @@ void *HBWSpace::allocate(const char *arg_label, const size_t arg_alloc_size, } msg << " ]( " << arg_alloc_size << " ) FAILED"; if (ptr == nullptr) { - msg << " nullptr"; + msg << " NULL"; } else { msg << " NOT ALIGNED " << ptr; } diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index a9a277881..2b11adbf6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -215,7 +215,7 @@ SharedAllocationRecord::SharedAllocationRecord( } else { Kokkos::Impl::throw_runtime_exception( - "Kokkos::Impl::SharedAllocationRecord given nullptr allocation"); + "Kokkos::Impl::SharedAllocationRecord given NULL allocation"); } } diff --git a/lib/kokkos/core/unit_test/TestCTestDevice.cpp b/lib/kokkos/core/unit_test/TestCTestDevice.cpp index b2ee79b85..c54c75f94 100644 --- a/lib/kokkos/core/unit_test/TestCTestDevice.cpp +++ b/lib/kokkos/core/unit_test/TestCTestDevice.cpp @@ -13,7 +13,7 @@ int setenv(const char *name, const char *value, int overwrite) { int errcode = 0; if (!overwrite) { size_t envsize = 0; - errcode = getenv_s(&envsize, NULL, 0, name); + errcode = getenv_s(&envsize, nullptr, 0, name); if (errcode || envsize) return errcode; } return _putenv_s(name, value); diff --git a/lib/message/cslib/src/STUBS_ZMQ/zmq.h b/lib/message/cslib/src/STUBS_ZMQ/zmq.h index a335ee5e0..98cb937ed 100644 --- a/lib/message/cslib/src/STUBS_ZMQ/zmq.h +++ b/lib/message/cslib/src/STUBS_ZMQ/zmq.h @@ -24,10 +24,10 @@ namespace CSLIB_NS { #define ZMQ_REQ 0 #define ZMQ_REP 0 -static void *zmq_ctx_new() {return NULL;} -static void *zmq_connect(void *, char *) {return NULL;} +static void *zmq_ctx_new() {return nullptr;} +static void *zmq_connect(void *, char *) {return nullptr;} static int zmq_bind(void *, char *) {return 0;} -static void *zmq_socket(void *,int) {return NULL;} +static void *zmq_socket(void *,int) {return nullptr;} static void zmq_close(void *) {} static void zmq_ctx_destroy(void *) {} static void zmq_send(void *, void *, int, int) {} diff --git a/lib/message/cslib/src/cslib.cpp b/lib/message/cslib/src/cslib.cpp index 7c75a3992..20292329a 100644 --- a/lib/message/cslib/src/cslib.cpp +++ b/lib/message/cslib/src/cslib.cpp @@ -57,7 +57,7 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) else if (csflag == 1) server = 1; else error_all("constructor(): Invalid client/server arg"); - if (pcomm == NULL) { + if (pcomm == nullptr) { me = 0; nprocs = 1; @@ -82,19 +82,19 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) } maxfield = 0; - fieldID = fieldtype = fieldlen = fieldoffset = NULL; + fieldID = fieldtype = fieldlen = fieldoffset = nullptr; maxheader = 0; - header = NULL; + header = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; - recvcounts = displs = NULL; + recvcounts = displs = nullptr; maxglobal = 0; - allids = NULL; + allids = nullptr; maxfieldbytes = 0; - fielddata = NULL; + fielddata = nullptr; - pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing NULL + pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing nullptr nsend = nrecv = 0; } @@ -218,7 +218,7 @@ void CSlib::pack_parallel(int id, int ftype, // nlocal datums, each of nper length, from all procs // final data in buf = datums for all natoms, ordered by ids - if (recvcounts == NULL) { + if (recvcounts == nullptr) { recvcounts = (int *) smalloc(nprocs*sizeof(int)); displs = (int *) smalloc(nprocs*sizeof(int)); } @@ -706,9 +706,9 @@ void CSlib::deallocate_fields() void *CSlib::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"malloc(): Failed to allocate %d bytes",nbytes); error_one(str); @@ -722,11 +722,11 @@ void *CSlib::srealloc(void *ptr, int nbytes) { if (nbytes == 0) { sfree(ptr); - return NULL; + return nullptr; } ptr = realloc(ptr,nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"realloc(): Failed to reallocate %d bytes",nbytes); error_one(str); @@ -738,7 +738,7 @@ void *CSlib::srealloc(void *ptr, int nbytes) void CSlib::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/cslib_wrap.cpp b/lib/message/cslib/src/cslib_wrap.cpp index 64b4d53b2..cb132c238 100644 --- a/lib/message/cslib/src/cslib_wrap.cpp +++ b/lib/message/cslib/src/cslib_wrap.cpp @@ -44,7 +44,7 @@ void cslib_open_fortran(int csflag, const char *mode, const char *str, const void *pcomm, void **csptr) { MPI_Comm ccomm; - void *pccomm = NULL; + void *pccomm = nullptr; if (pcomm) { MPI_Fint *fcomm = (MPI_Fint *) pcomm; diff --git a/lib/message/cslib/src/msg.cpp b/lib/message/cslib/src/msg.cpp index ff654ecbc..dcd78fb73 100644 --- a/lib/message/cslib/src/msg.cpp +++ b/lib/message/cslib/src/msg.cpp @@ -80,9 +80,9 @@ void Msg::allocate(int nheader, int &maxheader, int *&header, void *Msg::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = (void *) malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"Failed to allocate %d bytes",nbytes); } @@ -93,7 +93,7 @@ void *Msg::smalloc(int nbytes) void Msg::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/msg_mpi_two.cpp b/lib/message/cslib/src/msg_mpi_two.cpp index 2a4fa65ff..d365e2084 100644 --- a/lib/message/cslib/src/msg_mpi_two.cpp +++ b/lib/message/cslib/src/msg_mpi_two.cpp @@ -52,7 +52,7 @@ void MsgMPITwo::init(char *filename) { if (client) { if (me == 0) { - FILE *fp = NULL; + FILE *fp = nullptr; while (!fp) { fp = fopen(filename,"r"); if (!fp) sleep(1); diff --git a/lib/message/cslib/src/msg_zmq.cpp b/lib/message/cslib/src/msg_zmq.cpp index 8bee3aebd..07920c6b5 100644 --- a/lib/message/cslib/src/msg_zmq.cpp +++ b/lib/message/cslib/src/msg_zmq.cpp @@ -99,12 +99,12 @@ void MsgZMQ::send(int nheader, int *header, int nbuf, char *buf) if (me == 0) { zmq_send(socket,lengths,2*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) { zmq_send(socket,header,nheader*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) zmq_send(socket,buf,nbuf,0); @@ -125,7 +125,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) { if (me == 0) { zmq_recv(socket,lengths,2*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); @@ -135,7 +135,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) if (me == 0) { zmq_recv(socket,header,nheader*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); diff --git a/lib/molfile/molfile_plugin.h b/lib/molfile/molfile_plugin.h index 057c40336..2b7c57b84 100644 --- a/lib/molfile/molfile_plugin.h +++ b/lib/molfile/molfile_plugin.h @@ -193,7 +193,7 @@ typedef struct molfile_timestep_metadata { typedef struct { float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */ float *velocities; /**< space for velocities of all atoms; same layout */ - /**< NULL unless has_velocities is set */ + /**< nullptr unless has_velocities is set */ /*@{*/ /** @@ -517,7 +517,7 @@ typedef struct { * form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */ float *orbital_energies; /**< list of orbital energies for wavefunction */ float *occupancies; /**< orbital occupancies */ - int *orbital_ids; /**< orbital ID numbers; If NULL then VMD will + int *orbital_ids; /**< orbital ID numbers; If nullptr then VMD will * assume 1,2,3,...num_orbs. */ } molfile_qm_wavefunction_t; @@ -588,7 +588,7 @@ color r, g, b /** - * Main file reader API. Any function in this struct may be NULL + * Main file reader API. Any function in this struct may be nullptr * if not implemented by the plugin; the application checks this to determine * what functionality is present in the plugin. */ @@ -599,7 +599,7 @@ typedef struct { vmdplugin_HEAD /** - * Filename extension for this file type. May be NULL if no filename + * Filename extension for this file type. May be nullptr if no filename * extension exists and/or is known. For file types that match several * common extensions, list them in a comma separated list such as: * "pdb,ent,foo,bar,baz,ban" @@ -611,7 +611,7 @@ typedef struct { const char *filename_extension; /** - * Try to open the file for reading. Return an opaque handle, or NULL on + * Try to open the file for reading. Return an opaque handle, or nullptr on * failure. Set the number of atoms; if the number of atoms cannot be * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. * Filetype should be the name under which this plugin was registered; @@ -638,20 +638,20 @@ typedef struct { * the caller. * If the plugin provides bond information, but the file loaded doesn't * actually contain any bond info, the nbonds parameter should be - * set to 0 and from/to should be set to NULL to indicate that no bond + * set to 0 and from/to should be set to nullptr to indicate that no bond * information was actually present, and automatic bond search should be * performed. * * If the plugin provides bond order information, the bondorder array * will contain the bond order for each from/to pair. If not, the bondorder - * pointer should be set to NULL, in which case the caller will provide a + * pointer should be set to nullptr, in which case the caller will provide a * default bond order value of 1.0. * * If the plugin provides bond type information, the bondtype array * will contain the bond type index for each from/to pair. These numbers * are consecutive integers starting from 0. * the bondtypenames list, contains the corresponding names, if available, - * as a NULL string terminated list. nbondtypes is provided for convenience + * as a nullptr string terminated list. nbondtypes is provided for convenience * and consistency checking. * * These arrays must be freed by the plugin in the close_file_read function. @@ -666,7 +666,7 @@ typedef struct { * new QM-capable version named read_timestep(), when finished. * * Read the next timestep from the file. Return MOLFILE_SUCCESS, or - * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then + * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is nullptr, then * the frame should be skipped. Otherwise, the application must prepare * molfile_timestep_t by allocating space in coords for the corresponding * number of coordinates. @@ -684,7 +684,7 @@ typedef struct { /** * Open a coordinate file for writing using the given header information. - * Return an opaque handle, or NULL on failure. The application must + * Return an opaque handle, or nullptr on failure. The application must * specify the number of atoms to be written. * filetype should be the name under which this plugin was registered. */ @@ -757,7 +757,7 @@ typedef struct { * from/to and to/from versions of each. * This function must be called before write_structure(). * - * Like the read_bonds() routine, the bondorder pointer is set to NULL + * Like the read_bonds() routine, the bondorder pointer is set to nullptr * if the caller doesn't have such information, in which case the * plugin should assume a bond order of 1.0 if the file format requires * bond order information. @@ -767,7 +767,7 @@ typedef struct { * index (consecutive integers starting from 0) and bondtypenames * contain the corresponding strings, in case the naming/numbering * scheme is different from the index numbers. - * if the pointers are set to NULL, then this information is not available. + * if the pointers are set to nullptr, then this information is not available. * bondtypenames can only be used of bondtypes is also given. * Return MOLFILE_SUCCESS if no errors occur. */ @@ -842,13 +842,13 @@ typedef struct { /** * Read the next timestep from the file. Return MOLFILE_SUCCESS, or * MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t - * arguments are NULL, then the coordinate or qm data should be skipped. + * arguments are nullptr, then the coordinate or qm data should be skipped. * Otherwise, the application must prepare molfile_timestep_t and * molfile_qm_timestep_t by allocating space for the corresponding * number of coordinates, orbital wavefunction coefficients, etc. * Since it is common for users to want to load only the final timestep * data from a QM run, the application may provide any combination of - * valid, or NULL pointers for the molfile_timestep_t and + * valid, or nullptr pointers for the molfile_timestep_t and * molfile_qm_timestep_t parameters, depending on what information the * user is interested in. * The natoms and qm metadata parameters exist because some file formats @@ -886,9 +886,9 @@ typedef struct { * caller the ability to prioritize, buffer, and redirect console messages * to an appropriate output channel, window, etc. This enables the use of * graphical consoles like TkCon without losing console output from plugins. - * If the function pointer is NULL, no console output service is provided + * If the function pointer is nullptr, no console output service is provided * by the calling application, and the output should default to stdout - * stream. If the function pointer is non-NULL, all output will be + * stream. If the function pointer is non-nullptr, all output will be * subsequently dealt with by the calling application. * * XXX this should really be put into a separate block of diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index 4fc8785dd..c1c45a86a 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != NULL) + if(currentNode != nullptr) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != NULL); //repeat this until all chains have been added + while(currentNode != nullptr); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null + if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null { - return NULL; + return nullptr; } int * tmp; - POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = NULL; //temporary variable to hold data - while(tempNode != NULL) //when we have followed all links, stop + POEMSChain * tempChain = nullptr; //temporary variable to hold data + while(tempNode != nullptr) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == NULL) + if(aNode == nullptr) { - return NULL; + return nullptr; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == NULL) //and if we find nothing... + if(returnVal == nullptr) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == NULL) //if we could not find any chains + if(returnVal == nullptr) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be NULL if no new chains are + return returnVal; //return what we find (will be nullptr if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists + while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != NULL || tmp2->value != NULL) //go through the list + while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 446fa2013..04f0f4b79 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); +TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value NULL +// The pointers have default value nullptr TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == NULL) + if (p == nullptr) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=NULL) + if(t !=nullptr) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == NULL && t->Right() == NULL) + if (t->Left() == nullptr && t->Right() == nullptr) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == NULL) + if (t == nullptr) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=NULL - if (t != NULL) + //print tree with root t, as long as t!=nullptr + if (t != nullptr) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index ee07a3325..14f5fd400 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = NULL); + void Insert(const int& item, const int& data, void * AuxData = nullptr); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = NULL; + DeleteAuxData = nullptr; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return NULL +// address and a pointer to its parent; otherwise, return nullptr TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is NULL - parent = NULL; + // the parent of the root is nullptr + parent = nullptr; // terminate on empty subtree - while(t != NULL) + while(t != nullptr) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; NULL if not found + // return pointer to node; nullptr if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != NULL) + if (current != nullptr) { item = current->data; return current->GetAuxData(); } else // item not found in the tree. return False - return NULL; + return nullptr; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,NULL,NULL); + newNode = GetTreeNode(item,nullptr,nullptr); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == NULL) + if (tree == nullptr) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) + if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) return; - // If D has NULL pointer, the + // If D has nullptr pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == NULL) + if (DNodePtr->right == nullptr) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == NULL) + else if (DNodePtr->left == nullptr) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-NULL + // Both pointers of DNodePtr are non-nullptr else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != NULL) + while (RNodePtr->right != nullptr) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == NULL) + if (PNodePtr == nullptr) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=NULL && current->data == item) + if (current !=nullptr && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == NULL) - return NULL; + if (t == nullptr) + return nullptr; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns NULL. + // present it makes a copy of left child or returns nullptr. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=NULL) + if (t->Left() !=nullptr) newlptr = CopyTree(t->Left()); else - newlptr = NULL; + newlptr = nullptr; - if (t->Right() !=NULL) + if (t->Right() !=nullptr) newrptr = CopyTree(t->Right()); else - newrptr = NULL; + newrptr = nullptr; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != NULL) { + if (t != nullptr) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != NULL) { - if (DeleteAuxData != NULL) { + if (aux != nullptr) { + if (DeleteAuxData != nullptr) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to NULL +// set the root pointer back to nullptr void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = NULL; // root now NULL + t = nullptr; // root now nullptr } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 051e13d6e..52905fc40 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value NULL assigns a empty subtree +// The pointer value nullptr assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/poemstreenode.h b/lib/poems/poemstreenode.h index a1835ba02..e5673344a 100644 --- a/lib/poems/poemstreenode.h +++ b/lib/poems/poemstreenode.h @@ -18,7 +18,7 @@ #ifndef TREENODE_H #define TREENODE_H -//#define NULL 0 +//#define nullptr 0 //Tree depends on TreeNode diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 67f5b607e..7b1e718b9 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return NULL; + default: return nullptr; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 369213f7d..23554f411 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = NULL; + mappings = nullptr; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 2b3257b0d..21819d4c0 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = NULL; + system = nullptr; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != NULL) { + while(NodeValue != nullptr) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return NULL; + return nullptr; } } diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 889563f61..2242fba02 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -38,7 +38,7 @@ enum{ROTATE,ALL}; ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL), tbias(NULL), avec(NULL) + id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/asphere command"); @@ -49,7 +49,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 89350dd00..3878f7e4d 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -461,20 +461,20 @@ void PairGayBerne::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -506,12 +506,12 @@ void PairGayBerne::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&gamma,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&gamma,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&gamma,1,MPI_DOUBLE,0,world); MPI_Bcast(&upsilon,1,MPI_DOUBLE,0,world); diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index 6397e77f5..ba565c592 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -31,8 +31,8 @@ using namespace LAMMPS_NS; PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 81fb4d4b6..c234ce27b 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -439,20 +439,20 @@ void PairRESquared::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -480,8 +480,8 @@ void PairRESquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index cf89cf9d3..79253140c 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -32,8 +32,8 @@ using namespace LAMMPS_NS; PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index e63d50f81..2619f0cf1 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -30,7 +30,7 @@ enum{SPHERE,LINE,TRI}; // also in DumpImage /* ---------------------------------------------------------------------- */ BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) : - Body(lmp, narg, arg), imflag(NULL), imdata(NULL) + Body(lmp, narg, arg), imflag(nullptr), imdata(nullptr) { if (narg != 3) error->all(FLERR,"Invalid body nparticle command"); @@ -194,7 +194,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyNparticle::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index c43484dca..f2e798c93 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -321,7 +321,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index 18fd65c1d..b647c7e54 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -122,7 +122,7 @@ int BodyRoundedPolyhedron::nfaces(AtomVecBody::Bonus *bonus) double *BodyRoundedPolyhedron::faces(AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; - if (nvertices == 1 || nvertices == 2) return NULL; + if (nvertices == 1 || nvertices == 2) return nullptr; return bonus->dvalue+3*nsub(bonus)+2*nedges(bonus); } @@ -373,7 +373,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index cf570d71a..940250d16 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -31,7 +31,7 @@ enum{ID,TYPE,INDEX}; /* ---------------------------------------------------------------------- */ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), which(NULL), index(NULL), avec(NULL), bptr(NULL) + Compute(lmp, narg, arg), which(nullptr), index(nullptr), avec(nullptr), bptr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute body/local command"); @@ -66,8 +66,8 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index 18c301678..6903f7a25 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -36,7 +36,7 @@ enum{ROTATE,ALL}; /* ---------------------------------------------------------------------- */ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_bias(NULL), tbias(NULL), avec(NULL) + Compute(lmp, narg, arg), id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/body command"); @@ -47,7 +47,7 @@ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index ccfd37bbb..99ae8ed09 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -133,15 +133,15 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 161f8d6d6..2507b94d2 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -132,19 +132,19 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index ece23d952..92ae392cd 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; PairBodyNparticle::PairBodyNparticle(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index fa5a8e57d..b7fa88b74 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -53,16 +53,16 @@ enum {INVALID=0,NONE=1,VERTEXI=2,VERTEXJ=3,EDGE=4}; PairBodyRoundedPolygon::PairBodyRoundedPolygon(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -458,7 +458,7 @@ void PairBodyRoundedPolygon::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index d376ac759..1d7461199 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -58,20 +58,20 @@ enum {EF_INVALID=0,EF_NONE,EF_PARALLEL,EF_SAME_SIDE_OF_FACE, PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -81,8 +81,8 @@ PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) mu = 0.0; A_ua = 1.0; - k_n = NULL; - k_na = NULL; + k_n = nullptr; + k_na = nullptr; } /* ---------------------------------------------------------------------- */ @@ -440,7 +440,7 @@ void PairBodyRoundedPolyhedron::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = facnum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; @@ -884,7 +884,7 @@ void PairBodyRoundedPolyhedron::sphere_against_face(int ibody, int jbody, project_pt_plane(x[jbody], xi1, xi2, xi3, h, d, inside); - inside_polygon(ibody, ni, x[ibody], h, NULL, inside, tmp); + inside_polygon(ibody, ni, x[ibody], h, nullptr, inside, tmp); if (inside == 0) continue; delx = h[0] - x[jbody][0]; @@ -1880,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be NULL) for face-edge intersection + q2 = another point (can be nullptr) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise @@ -1929,7 +1929,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, anglesum1 += acos(costheta); } - if (q2 != NULL) { + if (q2 != nullptr) { MathExtra::sub3(xi1,q2,u); MathExtra::sub3(xi2,q2,v); magu = MathExtra::len3(u); @@ -1945,7 +1945,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, if (fabs(anglesum1 - MY_2PI) < EPSILON) inside1 = 1; else inside1 = 0; - if (q2 != NULL) { + if (q2 != nullptr) { if (fabs(anglesum2 - MY_2PI) < EPSILON) inside2 = 1; else inside2 = 0; } diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index eea43480e..28d081c5c 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -373,19 +373,19 @@ void AngleClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index a97b06a3c..8a8471722 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -184,10 +184,10 @@ void BondClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -228,5 +228,5 @@ void *BondClass2::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index 5be522f2c..5a0300359 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -834,45 +834,45 @@ void DihedralClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - - utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 0b07a7d60..801c21c3b 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -598,15 +598,15 @@ void ImproperClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - - utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + + utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index bb1dfe0ab..fdfaf158e 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -509,7 +509,7 @@ void PairLJClass2::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -612,13 +612,13 @@ void PairLJClass2::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -647,10 +647,10 @@ void PairLJClass2::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -707,5 +707,5 @@ void *PairLJClass2::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 8375043ed..df0019c25 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -364,14 +364,14 @@ void PairLJClass2CoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairLJClass2CoulCut::write_restart_settings(FILE *fp) void PairLJClass2CoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -478,6 +478,6 @@ void *PairLJClass2CoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 3b9ef8dea..68a5bd217 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -47,8 +47,8 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - cut_respa = NULL; + ftable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -691,11 +691,11 @@ void PairLJClass2CoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -807,13 +807,13 @@ void PairLJClass2CoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -844,13 +844,13 @@ void PairLJClass2CoulLong::write_restart_settings(FILE *fp) void PairLJClass2CoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -956,5 +956,5 @@ void *PairLJClass2CoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index 786be66c7..9ec25eecc 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -51,7 +51,7 @@ enum{EDGE,CONSTANT,VARIABLE}; PairBrownian::PairBrownian(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -497,7 +497,7 @@ void PairBrownian::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); @@ -603,12 +603,12 @@ void PairBrownian::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -643,17 +643,17 @@ void PairBrownian::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_target, sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed, sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_target, sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed, sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index 9c2593ffb..c71c0aa3e 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -358,7 +358,7 @@ void PairBrownianPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index f95645c61..3ac4d8f2b 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -395,15 +395,15 @@ void PairColloid::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (comm->me == 0) { - utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a12[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -433,9 +433,9 @@ void PairColloid::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 867bb9197..4e0bf3344 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -566,7 +566,7 @@ void PairLubricate::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate"); @@ -683,12 +683,12 @@ void PairLubricate::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -721,15 +721,15 @@ void PairLubricate::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index 2df1ecaaa..b3420154f 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -58,10 +58,10 @@ PairLubricateU::PairLubricateU(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nmax = 0; - fl = Tl = xl = NULL; + fl = Tl = xl = nullptr; cgmax = 0; - bcg = xcg = rcg = rcg1 = pcg = RU = NULL; + bcg = xcg = rcg = rcg1 = pcg = RU = nullptr; // set comm size needed by this Pair @@ -1794,7 +1794,7 @@ void PairLubricateU::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -1909,12 +1909,12 @@ void PairLubricateU::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -1946,14 +1946,14 @@ void PairLubricateU::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 8483bb0f5..501977187 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1158,7 +1158,7 @@ void PairLubricateUPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL){ + else if (strstr(modify->fix[i]->style,"wall") != nullptr){ if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index 351757e09..244b37457 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -468,7 +468,7 @@ void PairLubricatePoly::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -478,7 +478,7 @@ void PairLubricatePoly::init_style() if (wallfix->xflag) flagwall = 2; // Moving walls exist } - if (strstr(modify->fix[i]->style,"wall") != NULL){ + if (strstr(modify->fix[i]->style,"wall") != nullptr){ flagwall = 1; // Walls exist if (((FixWall *) modify->fix[i])->xflag ) { flagwall = 2; // Moving walls exist diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 484175762..9cc1439e6 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -38,8 +38,8 @@ DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtomGZ::~DumpAtomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -102,8 +102,8 @@ void DumpAtomGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -155,7 +155,7 @@ void DumpAtomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index 18f0fa56d..b6a94e587 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -41,8 +41,8 @@ DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFGGZ::~DumpCFGGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -106,8 +106,8 @@ void DumpCFGGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -163,7 +163,7 @@ void DumpCFGGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index fb2b121f7..af37ff0a1 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -39,8 +39,8 @@ DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustomGZ::~DumpCustomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -104,8 +104,8 @@ void DumpCustomGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -155,7 +155,7 @@ void DumpCustomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index 49a3c3bef..fc7b53472 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -39,8 +39,8 @@ DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocalGZ::~DumpLocalGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -104,8 +104,8 @@ void DumpLocalGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -170,7 +170,7 @@ void DumpLocalGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index cc07b1ce6..24b4a7a07 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; compression_level = Z_BEST_COMPRESSION; @@ -38,8 +38,8 @@ DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZGZ::~DumpXYZGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -103,8 +103,8 @@ void DumpXYZGZ::openfile() gzFp = gzopen(filecurrent, mode.c_str()); - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -134,7 +134,7 @@ void DumpXYZGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index 1b7eb1e43..06754003f 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), vint(NULL), id_fix(NULL), fix(NULL) + Compute(lmp, narg, arg), vint(nullptr), id_fix(nullptr), fix(nullptr) { if (narg != 5) error->all(FLERR,"Illegal compute temp/cs command"); @@ -94,7 +94,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : vector = new double[size_vector]; maxatom = 0; - vint = NULL; + vint = nullptr; // set comm size needed by this Compute diff --git a/src/CORESHELL/pair_born_coul_long_cs.cpp b/src/CORESHELL/pair_born_coul_long_cs.cpp index d50138145..58f58db1b 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.cpp +++ b/src/CORESHELL/pair_born_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairBornCoulLongCS::PairBornCoulLongCS(LAMMPS *lmp) : PairBornCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; writedata = 1; } diff --git a/src/CORESHELL/pair_buck_coul_long_cs.cpp b/src/CORESHELL/pair_buck_coul_long_cs.cpp index dd43f7f4b..f8a00a348 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.cpp +++ b/src/CORESHELL/pair_buck_coul_long_cs.cpp @@ -43,7 +43,7 @@ PairBuckCoulLongCS::PairBuckCoulLongCS(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 1; writedata = 1; single_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_coul_long_cs.cpp b/src/CORESHELL/pair_coul_long_cs.cpp index ee03780a0..6a2117149 100644 --- a/src/CORESHELL/pair_coul_long_cs.cpp +++ b/src/CORESHELL/pair_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairCoulLongCS::PairCoulLongCS(LAMMPS *lmp) : PairCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp index 75e3f5ed1..81336e681 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp @@ -40,7 +40,7 @@ PairLJClass2CoulLongCS::PairLJClass2CoulLongCS(LAMMPS *lmp) : PairLJClass2CoulLo respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp index 9d60dfdbf..89523032a 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp @@ -44,7 +44,7 @@ PairLJCutCoulLongCS::PairLJCutCoulLongCS(LAMMPS *lmp) : PairLJCutCoulLong(lmp) respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index 25fed599d..d7f320180 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -438,14 +438,14 @@ void PairLJCutDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -474,10 +474,10 @@ void PairLJCutDipoleCut::write_restart_settings(FILE *fp) void PairLJCutDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index 67d2e0aa3..e6fe0e8dc 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -446,7 +446,7 @@ void PairLJCutDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -490,13 +490,13 @@ void PairLJCutDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,10 +524,10 @@ void PairLJCutDipoleLong::write_restart_settings(FILE *fp) void PairLJCutDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -552,5 +552,5 @@ void *PairLJCutDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index 86e143626..33ee57b83 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -58,7 +58,7 @@ PairLJLongDipoleLong::PairLJLongDipoleLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongDipoleLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/dipole/long command"); @@ -168,10 +168,10 @@ void *PairLJLongDipoleLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_vdwl", NULL}; + "cut_coul", "cut_vdwl", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, &cut_coul, - &cut_lj_global, NULL}; + &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -220,8 +220,8 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg) void PairLJLongDipoleLong::init_style() { - const char *style3[] = {"ewald/disp", NULL}; - const char *style6[] = {"ewald/disp", NULL}; + const char *style3[] = {"ewald/disp", nullptr}; + const char *style6[] = {"ewald/disp", nullptr}; int i; if (strcmp(update->unit_style,"electron") == 0) @@ -242,14 +242,14 @@ void PairLJLongDipoleLong::init_style() // ensure use of KSpace long-range solver, set g_ewald if (ewald_order&(1<<3)) { // r^-1 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style3[i]&&strcmp(force->kspace_style, style3[i]); ++i); if (!style3[i]) error->all(FLERR,"Pair style requires use of kspace_style ewald/disp"); } if (ewald_order&(1<<6)) { // r^-6 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i); if (!style6[i]) @@ -343,13 +343,13 @@ void PairLJLongDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -378,11 +378,11 @@ void PairLJLongDipoleLong::write_restart_settings(FILE *fp) void PairLJLongDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 15bc42c37..c33b49615 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -118,7 +118,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : int newtonflag = 0; int threads_per_atom = -1; double binsize = 0.0; - char *opencl_flags = NULL; + char *opencl_flags = nullptr; int block_pair = -1; int iarg = 4; @@ -232,7 +232,7 @@ void FixGPU::init() // make sure fdotr virial is not accumulated multiple times - if (force->pair_match("^hybrid",0) != NULL) { + if (force->pair_match("^hybrid",0) != nullptr) { PairHybrid *hybrid = (PairHybrid *) force->pair; for (int i = 0; i < hybrid->nstyles; i++) if (!utils::strmatch(hybrid->keywords[i],"/gpu$")) diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index c27c670f2..dbcb3bcf3 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -189,7 +189,7 @@ void PairBornCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index a2524909e..3a6808d43 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -184,7 +184,7 @@ void PairBornCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 41823fc27..aa25fb4cb 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -180,7 +180,7 @@ void PairBuckCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index 39737ab18..0ced57d28 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -158,7 +158,7 @@ void PairColloidGPU::init_style() } double cell_size = sqrt(maxcut) + neighbor->skin; - int **_form = NULL; + int **_form = nullptr; int n=atom->ntypes; memory->create(_form,n+1,n+1,"colloid/gpu:_form"); for (int i = 1; i <= n; i++) { diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index da59873dd..3eb678fc7 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -154,7 +154,7 @@ void PairCoulLongCSGPU::compute(int eflag, int vflag) void PairCoulLongCSGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/cs/gpu requires atom attribute q"); @@ -175,7 +175,7 @@ void PairCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index 185d3a7f9..7eb502955 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -149,7 +149,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag) void PairCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q"); @@ -170,7 +170,7 @@ void PairCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 493953777..9dd5c85c4 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -143,7 +143,7 @@ void PairEAMAlloyGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_alloy_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_alloy_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_alloy_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 14d9a95c3..3cd78ea51 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index eb028bc77..10f6b4ebe 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -143,7 +143,7 @@ void PairEAMFSGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_fs_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_fs_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_fs_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index 70edf2164..53825f2e8 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 3965f27c6..d8058f11a 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -145,7 +145,7 @@ void PairEAMGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index e4742a3be..09566f7de 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -33,7 +33,7 @@ class PairEAMGPU : public PairEAM { void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index 451799027..58414f4e3 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -74,7 +74,7 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp), { quat_nmax = 0; reinitflag = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index 215998bc8..e4d20e23a 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -135,7 +135,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag) void PairLJ96CutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index 09ed17820..921018853 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag) void PairLJCharmmCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCharmmCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index f6d671d95..264ada0fd 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -177,7 +177,7 @@ void PairLJClass2CoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 2a9d431a4..135a2a7dd 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag) void PairLJCutCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCutCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index f5987c0dd..f8f4af5de 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -143,7 +143,7 @@ void PairLJCutCoulMSMGPU::compute(int eflag, int vflag) void PairLJCutCoulMSMGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/coul/msm/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index 7de9ae2aa..896a0b9d4 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -185,13 +185,13 @@ void PairLJCutDipoleLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 5656c2e18..3fc727a4f 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -139,7 +139,7 @@ void PairLJCutGPU::compute(int eflag, int vflag) void PairLJCutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 2bd7420e7..8e08075bc 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -168,15 +168,15 @@ void PairLJCutTIP4PLongGPU::compute(int eflag, int vflag) void PairLJCutTIP4PLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (atom->tag_enable == 0) error->all(FLERR,"Pair style lj/cut/tip4p/long/gpu requires atom IDs"); if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/gpu requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); if (atom->map_style == 2) @@ -202,7 +202,7 @@ void PairLJCutTIP4PLongGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index f13eea51e..86ff980c7 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -154,7 +154,7 @@ void PairLJExpandCoulLongGPU::compute(int eflag, int vflag) void PairLJExpandCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJExpandCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index 4054f0852..d04a490ca 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -186,13 +186,13 @@ void PairLJSDKCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style is incompatible with KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index 60e6e935e..70e875291 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -136,7 +136,7 @@ void PairMIECutGPU::compute(int eflag, int vflag) void PairMIECutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with mie/cut/gpu pair style"); diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index ca70e3c33..4ce9730e0 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -76,7 +76,7 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), if (!avec) error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid"); quat_nmax = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index d544534c9..54312e411 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -76,7 +76,7 @@ PairSWGPU::PairSWGPU(LAMMPS *lmp) : PairSW(lmp), gpu_mode(GPU_FORCE) suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -162,9 +162,9 @@ void PairSWGPU::init_style() double *epsilon, *sigma, *lambda, *gamma; double *biga, *bigb, *powerp, *powerq; double *_cut, *_cutsq, *costheta; - epsilon = sigma = lambda = gamma = NULL; - biga = bigb = powerp = powerq = NULL; - _cut = _cutsq = costheta = NULL; + epsilon = sigma = lambda = gamma = nullptr; + biga = bigb = powerp = powerq = nullptr; + _cut = _cutsq = costheta = nullptr; memory->create(epsilon,nparams,"pair:epsilon"); memory->create(sigma,nparams,"pair:sigma"); diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index 4ac674aa9..20d21615a 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -165,8 +165,8 @@ void PairTableGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // pack tables and send them to device - double ***table_coeffs = NULL; - double **table_data = NULL; + double ***table_coeffs = nullptr; + double **table_data = nullptr; memory->create(table_coeffs, ntypes+1, ntypes+1, 6, "table:coeffs"); Table *tb; diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index 885dd73d9..b76bf99d5 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -80,7 +80,7 @@ PairTersoffGPU::PairTersoffGPU(LAMMPS *lmp) : PairTersoff(lmp), gpu_mode(GPU_FOR suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -168,11 +168,11 @@ void PairTersoffGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 35edd9ea2..57e13bb29 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -73,7 +73,7 @@ PairTersoffMODGPU::PairTersoffMODGPU(LAMMPS *lmp) : PairTersoffMOD(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -160,11 +160,11 @@ void PairTersoffMODGPU::init_style() double *biga, *bigb, *bigr, *bigd; double *c1, *c2, *c3, *c4, *c5, *h; double *beta, *powern, *ca1, *powern_del, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - powern_del = ca1 = NULL; - c1 = c2 = c3 = c4 = c5 = h = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + powern_del = ca1 = nullptr; + c1 = c2 = c3 = c4 = c5 = h = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index 73251ee72..5facd8625 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -81,7 +81,7 @@ PairTersoffZBLGPU::PairTersoffZBLGPU(LAMMPS *lmp) : PairTersoffZBL(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairTersoffZBLGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *Z_i, *Z_j, *ZBLcut, *ZBLexpscale, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index fe6adfef1..f462e579c 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -141,7 +141,7 @@ void PairUFMGPU::compute(int eflag, int vflag) void PairUFMGPU::init_style() { -// cut_respa = NULL; +// cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with ufm/gpu pair style"); diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index 868b8de0c..99a763bfb 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -77,7 +77,7 @@ PairVashishtaGPU::PairVashishtaGPU(LAMMPS *lmp) : PairVashishta(lmp), gpu_mode(G suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairVashishtaGPU::init_style() double *bigw, *c0, *costheta, *bigb; double *big2b, *bigc; - cutsq = r0 = gamma = eta = NULL; - lam1inv = lam4inv = zizj = mbigd = NULL; - dvrc = big6w = heta = bigh = NULL; - bigw = c0 = costheta = bigb = NULL; - big2b = bigc = NULL; + cutsq = r0 = gamma = eta = nullptr; + lam1inv = lam4inv = zizj = mbigd = nullptr; + dvrc = big6w = heta = bigh = nullptr; + bigw = c0 = costheta = bigb = nullptr; + big2b = bigc = nullptr; memory->create(cutsq,nparams,"pair:cutsq"); memory->create(r0,nparams,"pair:r0"); diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index cb5e08a46..9b753edd6 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -91,7 +91,7 @@ void PPPM_GPU_API(forces)(double **f); PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp) { - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; kspace_split = false; im_real_space = false; @@ -117,11 +117,11 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to NULL + // if do this, make sure to set them to nullptr destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; PPPM::init(); @@ -707,7 +707,7 @@ FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi, void PPPMGPU::destroy_3d_offset(FFT_SCALAR ***array, int n1_offset, int n2_offset) { - if (array == NULL) return; + if (array == nullptr) return; memory->sfree(&array[n1_offset][n2_offset]); memory->sfree(array + n1_offset); } @@ -797,7 +797,7 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) // extend size of per-atom arrays if necessary // part2grid needs to be allocated - if (atom->nmax > nmax || part2grid == NULL) { + if (atom->nmax > nmax || part2grid == nullptr) { memory->destroy(part2grid); nmax = atom->nmax; memory->create(part2grid,nmax,3,"pppm:part2grid"); diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index d449bb561..0bf900729 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -48,10 +48,10 @@ enum{CONSTANT,EQUAL}; // same as FixGravity /* ---------------------------------------------------------------------- */ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), radius_poly(NULL), frac_poly(NULL), - idrigid(NULL), idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), - imageflags(NULL), fixrigid(NULL), fixshake(NULL), recvcounts(NULL), - displs(NULL), random(NULL), random2(NULL) + Fix(lmp, narg, arg), radius_poly(nullptr), frac_poly(nullptr), + idrigid(nullptr), idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), + imageflags(nullptr), fixrigid(nullptr), fixshake(nullptr), recvcounts(nullptr), + displs(nullptr), random(nullptr), random2(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix pour command"); @@ -344,7 +344,7 @@ void FixPour::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix pour rigid fix does not exist"); @@ -359,7 +359,7 @@ void FixPour::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix pour shake fix does not exist"); @@ -456,7 +456,7 @@ void FixPour::pre_exchange() // perform allgatherv to acquire list of nearby particles on all procs - double *ptr = NULL; + double *ptr = nullptr; if (ncount) ptr = xmine[0]; MPI_Allgatherv(ptr,4*ncount,MPI_DOUBLE, xnear[0],recvcounts,displs,MPI_DOUBLE,world); @@ -889,16 +889,16 @@ void FixPour::options(int narg, char **arg) iregion = -1; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; ignoreflag = ignoreline = ignoretri = 0; dstyle = ONE; radius_max = radius_one = 0.5; - radius_poly = frac_poly = NULL; + radius_poly = frac_poly = nullptr; density_lo = density_hi = 1.0; volfrac = 0.25; maxattempt = 50; @@ -1091,5 +1091,5 @@ void *FixPour::extract(const char *str, int &itype) itype = 0; return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 9ec76b88f..25d271be9 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -63,8 +63,8 @@ enum {ROLL_NONE, ROLL_SDS}; /* ---------------------------------------------------------------------- */ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), history_one(NULL), - fix_rigid(NULL), mass_rigid(NULL) + Fix(lmp, narg, arg), idregion(nullptr), history_one(nullptr), + fix_rigid(nullptr), mass_rigid(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/gran command"); @@ -303,7 +303,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // wallstyle args - idregion = NULL; + idregion = nullptr; if (strcmp(arg[iarg],"xplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); @@ -407,16 +407,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - history_one = NULL; + history_one = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be NULL for wallstyle = REGION + // history_one will be nullptr for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -471,7 +471,7 @@ void FixWallGran::init() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to nullptr, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history @@ -681,7 +681,7 @@ void FixWallGran::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 3aa518209..1b3be22e7 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 543df02fc..f91bac2c9 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -39,9 +39,9 @@ enum {NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR}; /* ---------------------------------------------------------------------- */ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : - FixWallGran(lmp, narg, arg), region(NULL), region_style(NULL), - ncontact(NULL), - walls(NULL), history_many(NULL), c2r(NULL) + FixWallGran(lmp, narg, arg), region(nullptr), region_style(nullptr), + ncontact(nullptr), + walls(nullptr), history_many(nullptr), c2r(nullptr) { restart_global = 1; motion_resetflag = 0; @@ -61,11 +61,11 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : // do not register with Atom class, since parent class did that memory->destroy(history_one); - history_one = NULL; + history_one = nullptr; - ncontact = NULL; - walls = NULL; - history_many = NULL; + ncontact = nullptr; + walls = nullptr; + history_many = nullptr; grow_arrays(atom->nmax); // initialize shear history as if particle is not touching region @@ -262,7 +262,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 68a7803f4..b296f8465 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -52,7 +52,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // set comm size needed by this Pair if used with fix rigid @@ -65,7 +65,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_HH_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -426,7 +426,7 @@ void PairGranHookeHistory::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -450,7 +450,7 @@ void PairGranHookeHistory::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -554,7 +554,7 @@ void PairGranHookeHistory::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -580,12 +580,12 @@ void PairGranHookeHistory::write_restart_settings(FILE *fp) void PairGranHookeHistory::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kn,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kt,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamman,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gammat,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&xmu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kn,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kt,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamman,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gammat,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&xmu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kn,1,MPI_DOUBLE,0,world); MPI_Bcast(&kt,1,MPI_DOUBLE,0,world); diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index 309af54ee..dd9a84314 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index ee0eb2ad7..5edc656a6 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -73,14 +73,14 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; - onerad_dynamic = NULL; - onerad_frozen = NULL; - maxrad_dynamic = NULL; - maxrad_frozen = NULL; + onerad_dynamic = nullptr; + onerad_frozen = nullptr; + maxrad_dynamic = nullptr; + maxrad_frozen = nullptr; - history_transfer_factors = NULL; + history_transfer_factors = nullptr; dt = update->dt; @@ -97,7 +97,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -1101,7 +1101,7 @@ void PairGranular::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (use_history && fix_history == NULL) { + if (use_history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -1125,7 +1125,7 @@ void PairGranular::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -1330,20 +1330,20 @@ void PairGranular::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,NULL,error); - utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,nullptr,error); + utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&normal_model[i][j],1,MPI_INT,0,world); MPI_Bcast(&damping_model[i][j],1,MPI_INT,0,world); diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index e9ba629b4..ce417812d 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.cpp b/src/KIM/fix_store_kim.cpp index 776d8aab9..5428b7509 100644 --- a/src/KIM/fix_store_kim.cpp +++ b/src/KIM/fix_store_kim.cpp @@ -67,8 +67,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixStoreKIM::FixStoreKIM(LAMMPS *lmp, int narg, char **arg) - : Fix(lmp, narg, arg), simulator_model(NULL), model_name(NULL), - model_units(NULL), user_units(NULL) + : Fix(lmp, narg, arg), simulator_model(nullptr), model_name(nullptr), + model_units(nullptr), user_units(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix STORE/KIM command"); } @@ -82,25 +82,25 @@ FixStoreKIM::~FixStoreKIM() if (simulator_model) { KIM_SimulatorModel *sm = (KIM_SimulatorModel *)simulator_model; KIM_SimulatorModel_Destroy(&sm); - simulator_model = NULL; + simulator_model = nullptr; } if (model_name) { char *mn = (char *)model_name; delete[] mn; - model_name = NULL; + model_name = nullptr; } if (model_units) { char *mu = (char *)model_units; delete[] mu; - model_units = NULL; + model_units = nullptr; } if (user_units) { char *uu = (char *)user_units; delete[] uu; - user_units = NULL; + user_units = nullptr; } } @@ -151,5 +151,5 @@ void *FixStoreKIM::getptr(const char *name) else if (strcmp(name,"model_name") == 0) return model_name; else if (strcmp(name,"model_units") == 0) return model_units; else if (strcmp(name,"user_units") == 0) return user_units; - else return NULL; + else return nullptr; } diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 6baf48099..4e4890ea6 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or NULL - void *user_units; // string of unit conversion target or NULL + void *model_units; // string of unit conversion origin or nullptr + void *user_units; // string of unit conversion target or nullptr }; } diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 684108be7..bbeffe2d8 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -96,7 +96,7 @@ void KimInit::command(int narg, char **arg) } else unit_conversion_mode = false; char *model_units; - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; if (universe->me == 0) std::remove("kim.log"); @@ -366,8 +366,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM if (numberOfParameters) { KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; mesg += std::to_string(numberOfParameters) + " mutable parameters. \n"; @@ -486,7 +486,7 @@ void KimInit::write_log_cite(char *model_name) int availableAsString; char const * fileString; err = KIM_Collections_GetItemMetadataFile( - coll,i,&fileName,NULL,NULL,&availableAsString,&fileString); + coll,i,&fileName,nullptr,nullptr,&availableAsString,&fileString); if (err) continue; if (0 == strncmp("kimcite",fileName,7)) { diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 5f45dd34d..755121607 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -103,12 +103,12 @@ void KimInteractions::do_setup(int narg, char **arg) fixed_types = false; } - char *model_name = NULL; - KIM_SimulatorModel *simulatorModel(NULL); + char *model_name = nullptr; + KIM_SimulatorModel *simulatorModel(nullptr); // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as NULL. + // validate model name if not given as nullptr. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { @@ -256,7 +256,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con FILE *fp; fp = fopen(filename.c_str(),"r"); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR,"Parameter file not found"); } @@ -266,7 +266,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 6f4ac5cc2..121f167ab 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -185,7 +185,7 @@ void KimParam::command(int narg, char **arg) input->write_echo(fmt::format("#=== BEGIN kim-param {} ===================" "==================\n",kim_param_get_set)); - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; std::string atom_type_list; @@ -251,9 +251,9 @@ void KimParam::command(int narg, char **arg) // Get the parameters if (kim_param_get_set == "get") { // Parameter name - char *paramname = NULL; + char *paramname = nullptr; // Variable name - char *varname = NULL; + char *varname = nullptr; // Loop over all the arguments for (int i = 1; i < narg;) { @@ -267,8 +267,8 @@ void KimParam::command(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kim_error = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -344,7 +344,7 @@ void KimParam::command(int narg, char **arg) } int const nvars = nubound - nlbound + 1; - char **varsname = NULL; + char **varsname = nullptr; if (i < narg) { // Get the variable/variable_base name diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index 95a127485..4a381fb8d 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -112,7 +112,7 @@ void kimProperty::command(int narg, char **arg) PyGILState_STATE gstate = PyGILState_Ensure(); // kim_property module - PyObject *kim_property = NULL; + PyObject *kim_property = nullptr; // import kim_property { @@ -438,7 +438,7 @@ void kimProperty::command(int narg, char **arg) "evaluation failed!"); } } else - pValue = NULL; + pValue = nullptr; // Destroy the variable input->variable->set("kim_property_str delete"); diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 7ed70972c..30b5e6cbb 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -78,9 +78,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(NULL), - lmps_map_species_to_unique(NULL), - lmps_unique_elements(NULL), + kim_modelname(nullptr), + lmps_map_species_to_unique(nullptr), + lmps_unique_elements(nullptr), lmps_num_unique_elements(0), lmps_units(METAL), lengthUnit(KIM_LENGTH_UNIT_unused), @@ -88,8 +88,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : chargeUnit(KIM_CHARGE_UNIT_unused), temperatureUnit(KIM_TEMPERATURE_UNIT_unused), timeUnit(KIM_TIME_UNIT_unused), - pkim(NULL), - pargs(NULL), + pkim(nullptr), + pargs(nullptr), kim_model_support_for_energy(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_forces(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_particleEnergy(KIM_SUPPORT_STATUS_notSupported), @@ -97,15 +97,15 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_neighbor_lists(0), - kim_cutoff_values(NULL), - modelWillNotRequestNeighborsOfNoncontributingParticles(NULL), - neighborLists(NULL), - kim_particle_codes(NULL), + kim_cutoff_values(nullptr), + modelWillNotRequestNeighborsOfNoncontributingParticles(nullptr), + neighborLists(nullptr), + kim_particle_codes(nullptr), lmps_maxalloc(0), - kim_particleSpecies(NULL), - kim_particleContributing(NULL), - lmps_stripped_neigh_list(NULL), - lmps_stripped_neigh_ptr(NULL) + kim_particleSpecies(nullptr), + kim_particleContributing(nullptr), + lmps_stripped_neigh_list(nullptr), + lmps_stripped_neigh_ptr(nullptr) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -137,7 +137,7 @@ PairKIM::~PairKIM() if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } @@ -393,7 +393,7 @@ void PairKIM::coeff(int narg, char **arg) // setup mapping between LAMMPS unique elements and KIM species codes if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } kim_particle_codes = new int[lmps_num_unique_elements]; @@ -430,7 +430,7 @@ void PairKIM::coeff(int narg, char **arg) int kimerror; // Parameter name - char *paramname = NULL; + char *paramname = nullptr; for (int i = 2 + atom->ntypes; i < narg;) { // Parameter name @@ -443,8 +443,8 @@ void PairKIM::coeff(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kimerror = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -903,7 +903,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs,KIM_COMPUTE_ARGUMENT_NAME_partialEnergy, - static_cast(NULL)); + static_cast(nullptr)); } } @@ -924,7 +924,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleEnergy, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( @@ -937,7 +937,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, - static_cast(NULL)); + static_cast(nullptr)); } else { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, &(atom->f[0][0])); @@ -960,7 +960,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index e826a7c39..ed0cfccd4 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -87,7 +87,7 @@ AtomKokkos::~AtomKokkos() memoryKK->destroy_kokkos(k_duChem,duChem); memoryKK->destroy_kokkos(k_dvector,dvector); - dvector = NULL; + dvector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to NULL + free memory for vector and name and set ptrs to nullptr ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ @@ -290,14 +290,14 @@ void AtomKokkos::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { //memoryKK->destroy_kokkos(dvector); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 662f09fe5..3090a62d1 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -48,7 +48,7 @@ AtomVecAngleKokkos::AtomVecAngleKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) k_count = DAT::tdual_int_1d("atom::k_count",1); atomKK = (AtomKokkos *) atom; commKK = (CommKokkos *) comm; - buffer = NULL; + buffer = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/atom_vec_kokkos.cpp b/src/KOKKOS/atom_vec_kokkos.cpp index 9e39f5373..f2dca9beb 100644 --- a/src/KOKKOS/atom_vec_kokkos.cpp +++ b/src/KOKKOS/atom_vec_kokkos.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; AtomVecKokkos::AtomVecKokkos(LAMMPS *lmp) : AtomVec(lmp) { kokkosable = 1; - buffer = NULL; + buffer = nullptr; buffer_size = 0; no_comm_vel_flag = 0; diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 51ba6bbdb..9e1bfcbc5 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -45,7 +45,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) { if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]); memory->sfree(sendlist); - sendlist = NULL; + sendlist = nullptr; k_sendlist = DAT::tdual_int_2d(); k_total_send = DAT::tdual_int_scalar("comm::k_total_send"); @@ -54,9 +54,9 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) // initialize comm buffers & exchange memory memory->destroy(buf_send); - buf_send = NULL; + buf_send = nullptr; memory->destroy(buf_recv); - buf_recv = NULL; + buf_recv = nullptr; k_exchange_lists = DAT::tdual_int_2d("comm:k_exchange_lists",2,100); k_exchange_sendlist = Kokkos::subview(k_exchange_lists,0,Kokkos::ALL); @@ -65,7 +65,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) k_sendflag = DAT::tdual_int_1d("comm:k_sendflag",100); memory->destroy(maxsendlist); - maxsendlist = NULL; + maxsendlist = nullptr; memory->create(maxsendlist,maxswap,"comm:maxsendlist"); for (int i = 0; i < maxswap; i++) { maxsendlist[i] = BUFMIN; @@ -82,11 +82,11 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) CommKokkos::~CommKokkos() { memoryKK->destroy_kokkos(k_sendlist,sendlist); - sendlist = NULL; + sendlist = nullptr; memoryKK->destroy_kokkos(k_buf_send,buf_send); - buf_send = NULL; + buf_send = nullptr; memoryKK->destroy_kokkos(k_buf_recv,buf_recv); - buf_recv = NULL; + buf_recv = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/fft3d_kokkos.cpp b/src/KOKKOS/fft3d_kokkos.cpp index ff95998e4..d7f556cf8 100644 --- a/src/KOKKOS/fft3d_kokkos.cpp +++ b/src/KOKKOS/fft3d_kokkos.cpp @@ -69,7 +69,7 @@ FFT3dKokkos::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective,nthreads,usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ @@ -403,7 +403,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan = new struct fft_plan_3d_kokkos; remapKK = new RemapKokkos(lmp); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -422,7 +422,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; @@ -436,7 +436,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -461,7 +461,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -502,7 +502,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -521,7 +521,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remapKK->remap_3d_create_plan_kokkos(comm, @@ -530,7 +530,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -648,39 +648,39 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #elif defined(FFT_CUFFT) @@ -704,16 +704,16 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl kissfftKK = new KissFFTKokkos(); - plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,NULL,NULL); - plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,NULL,NULL); + plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,NULL,NULL); - plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,NULL,NULL); + plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -725,8 +725,8 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,NULL,NULL); - plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,NULL,NULL); + plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index dadf9e4c8..8761b54d4 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -735,7 +735,7 @@ void FixLangevinKokkos::reset_dt() template double FixLangevinKokkos::compute_scalar() { - if (!tallyflag || flangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr) return 0.0; v = atomKK->k_v.template view(); mask = atomKK->k_mask.template view(); @@ -893,19 +893,19 @@ void FixLangevinKokkos::copy_arrays(int i, int j, int /*delflag*/) template void FixLangevinKokkos::cleanup_copy() { - random = NULL; - tstr = NULL; - gfactor1 = NULL; - gfactor2 = NULL; - ratio = NULL; - id_temp = NULL; - flangevin = NULL; - tforce = NULL; + random = nullptr; + tstr = nullptr; + gfactor1 = nullptr; + gfactor2 = nullptr; + ratio = nullptr; + id_temp = nullptr; + flangevin = nullptr; + tforce = nullptr; gjfflag = 0; - franprev = NULL; - lv = NULL; - id = style = NULL; - vatom = NULL; + franprev = nullptr; + lv = nullptr; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_minimize_kokkos.cpp b/src/KOKKOS/fix_minimize_kokkos.cpp index 13b9cb02a..f123a663d 100644 --- a/src/KOKKOS/fix_minimize_kokkos.cpp +++ b/src/KOKKOS/fix_minimize_kokkos.cpp @@ -34,7 +34,7 @@ FixMinimizeKokkos::FixMinimizeKokkos(LAMMPS *lmp, int narg, char **arg) : FixMinimizeKokkos::~FixMinimizeKokkos() { memoryKK->destroy_kokkos(k_vectors,vectors); - vectors = NULL; + vectors = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index d1f3f6632..56a37c8d1 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -35,9 +35,9 @@ FixNeighHistoryKokkos::FixNeighHistoryKokkos(LAMMPS *lmp, int narg, memory->destroy(npartner); memory->sfree(partner); memory->sfree(valuepartner); - npartner = NULL; - partner = NULL; - valuepartner = NULL; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; maxpartner = 8; grow_arrays(atom->nmax); diff --git a/src/KOKKOS/fix_nve_kokkos.cpp b/src/KOKKOS/fix_nve_kokkos.cpp index beabc5572..fe6aeaccf 100644 --- a/src/KOKKOS/fix_nve_kokkos.cpp +++ b/src/KOKKOS/fix_nve_kokkos.cpp @@ -163,8 +163,8 @@ void FixNVEKokkos::final_integrate_rmass_item(int i) const template void FixNVEKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.cpp b/src/KOKKOS/fix_nve_sphere_kokkos.cpp index 64298748d..f292f30d3 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.cpp +++ b/src/KOKKOS/fix_nve_sphere_kokkos.cpp @@ -39,8 +39,8 @@ FixNVESphereKokkos::FixNVESphereKokkos(LAMMPS *lmp, int narg, char * template void FixNVESphereKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index a71b52e0f..0f4ab850a 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1423,7 +1423,7 @@ void FixQEqReaxKokkos::unpack_reverse_comm(int n, int *list, double template void FixQEqReaxKokkos::cleanup_copy() { - id = style = NULL; + id = style = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp index f98ab0314..faa5a9831 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp @@ -51,7 +51,7 @@ FixReaxCBondsKokkos::~FixReaxCBondsKokkos() void FixReaxCBondsKokkos::init() { Pair *pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c/kk"); FixReaxCBonds::init(); diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxc_species_kokkos.cpp index f3bce2f9c..4674389ed 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_species_kokkos.cpp @@ -58,7 +58,7 @@ FixReaxCSpeciesKokkos::~FixReaxCSpeciesKokkos() void FixReaxCSpeciesKokkos::init() { Pair* pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/species/kk without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/species/kk without " "pair_style reax/c/kk"); FixReaxCSpecies::init(); diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index 18bc4225a..1ba227d53 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -62,7 +62,7 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; template FixRxKokkos::FixRxKokkos(LAMMPS *lmp, int narg, char **arg) : FixRX(lmp, narg, arg), - pairDPDEKK(NULL), + pairDPDEKK(nullptr), update_kinetics_data(true) { kokkosable = 1; @@ -117,14 +117,14 @@ void FixRxKokkos::init() //FixRX::init(); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); pairDPDEKK = dynamic_cast(pairDPDE); - if (pairDPDEKK == NULL) + if (pairDPDEKK == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy/kk with fix rx/kk"); bool eos_flag = false; @@ -964,7 +964,7 @@ int FixRxKokkos::rhs_sparse(double /*t*/, const double *y, double *d //const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) @@ -1111,7 +1111,7 @@ KOKKOS_INLINE_FUNCTION int FixRxKokkos::k_rhs_sparse(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const { #define kFor (userData.kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData.rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 26c6ae4ae..0033e6964 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -121,7 +121,7 @@ class FixRxKokkos : public FixRX { value_type *m_data; KOKKOS_INLINE_FUNCTION - StridedArrayType() : m_data(NULL) {} + StridedArrayType() : m_data(nullptr) {} KOKKOS_INLINE_FUNCTION StridedArrayType(value_type *ptr) : m_data(ptr) {} diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index a11e8b4bd..00d717c91 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -57,7 +57,7 @@ FixSetForceKokkos::~FixSetForceKokkos() if (copymode) return; memoryKK->destroy_kokkos(k_sforce,sforce); - sforce = NULL; + sforce = nullptr; } /* ---------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ void FixSetForceKokkos::post_force(int /*vflag*/) // update region if necessary - region = NULL; + region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 9be4321ff..1779ebc85 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -63,7 +63,7 @@ using namespace random_external_state; template FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **arg) : - FixShardlow(lmp, narg, arg), k_pairDPDE(NULL), ghostmax(0), nlocal(0) , nghost(0) + FixShardlow(lmp, narg, arg), k_pairDPDE(nullptr), ghostmax(0), nlocal(0) , nghost(0) { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -74,8 +74,8 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); -// k_pairDPD = NULL; - k_pairDPDE = NULL; +// k_pairDPD = nullptr; + k_pairDPDE = nullptr; // k_pairDPD = (PairDPDfdtKokkos *) force->pair_match("dpd/fdt",1); k_pairDPDE = dynamic_cast *>(force->pair_match("dpd/fdt/energy",0)); @@ -88,7 +88,7 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a // } - if(/* k_pairDPD == NULL &&*/ k_pairDPDE == NULL) + if(/* k_pairDPD == nullptr &&*/ k_pairDPDE == nullptr) error->all(FLERR,"Must use pair_style "/*"dpd/fdt/kk or "*/"dpd/fdt/energy/kk with fix shardlow/kk"); #ifdef DEBUG_SSA_PAIR_CT diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 909e3c854..0a175343c 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -91,21 +91,21 @@ GridCommKokkos::~GridCommKokkos() // regular comm data struct for (int i = 0; i < nswap; i++) { - swap[i].packlist = NULL; - swap[i].unpacklist = NULL; + swap[i].packlist = nullptr; + swap[i].unpacklist = nullptr; } // tiled comm data structs for (int i = 0; i < nsend; i++) - send[i].packlist = NULL; + send[i].packlist = nullptr; for (int i = 0; i < nrecv; i++) - recv[i].unpacklist = NULL; + recv[i].unpacklist = nullptr; for (int i = 0; i < ncopy; i++) { - copy[i].packlist = NULL; - copy[i].unpacklist = NULL; + copy[i].packlist = nullptr; + copy[i].unpacklist = nullptr; } } @@ -459,7 +459,7 @@ void GridCommKokkos::setup_tiled(int &nbuf1, int &nbuf2) memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); noverlap = maxoverlap = 0; - overlap = NULL; + overlap = nullptr; ghost_box_drop(ghostbox,pbc); diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 79fd0685b..16d906ba3 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -226,7 +226,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int len; char mpi_version[MPI_MAX_LIBRARY_VERSION_STRING]; MPI_Get_library_version(mpi_version, &len); - if (strstr(&mpi_version[0], "Spectrum") != NULL) { + if (strstr(&mpi_version[0], "Spectrum") != nullptr) { cuda_aware_flag = 0; char* str; if (str = getenv("OMPI_MCA_pml_pami_enable_cuda")) diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 83e8b9ec7..df85f72c6 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -78,7 +78,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); array = data.h_view.data(); @@ -88,9 +88,9 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -100,7 +100,7 @@ void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) template TYPE destroy_kokkos(TYPE &data) { - /*if(data.data()!=NULL) + /*if(data.data()!=nullptr) free(data.data());*/ data = TYPE(); return data; @@ -186,7 +186,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); n += n2; @@ -211,7 +211,7 @@ template bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &h_data(i,0); n += n2; @@ -228,14 +228,14 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, int n2, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,n2,name); + if (array == nullptr) return create_kokkos(data,array,n1,n2,name); data.resize(n1,n2); bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; array = (typename TYPE::value_type**) srealloc(array,nbytes,name); for (int i = 0; i < n1; i++) if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -252,7 +252,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -263,7 +263,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); @@ -272,7 +272,7 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -286,10 +286,10 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type** &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); sfree(array); - array = NULL; + array = nullptr; } }; diff --git a/src/KOKKOS/min_kokkos.cpp b/src/KOKKOS/min_kokkos.cpp index 032538fe6..759b00976 100644 --- a/src/KOKKOS/min_kokkos.cpp +++ b/src/KOKKOS/min_kokkos.cpp @@ -49,7 +49,7 @@ using namespace LAMMPS_NS; MinKokkos::MinKokkos(LAMMPS *lmp) : Min(lmp) { atomKK = (AtomKokkos *) atom; - fix_minimize_kk = NULL; + fix_minimize_kk = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index b21a7cb1e..cadfccfa6 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -41,10 +41,10 @@ NeighborKokkos::NeighborKokkos(LAMMPS *lmp) : Neighbor(lmp), neighbond_host(lmp),neighbond_device(lmp) { device_flag = 0; - bondlist = NULL; - anglelist = NULL; - dihedrallist = NULL; - improperlist = NULL; + bondlist = nullptr; + anglelist = nullptr; + dihedrallist = nullptr; + improperlist = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ NeighborKokkos::~NeighborKokkos() { if (!copymode) { memoryKK->destroy_kokkos(k_cutneighsq,cutneighsq); - cutneighsq = NULL; + cutneighsq = nullptr; memoryKK->destroy_kokkos(k_ex_type,ex_type); memoryKK->destroy_kokkos(k_ex1_type,ex1_type); diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index afa8bd649..8f874b9fe 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -48,9 +48,9 @@ PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCo execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -69,11 +69,11 @@ PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } } diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index a77ef291f..6a13254e8 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -55,8 +55,8 @@ PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuck execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -75,11 +75,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } } @@ -88,11 +88,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() template void PairBuckCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index 71f63a9f9..efddb43a9 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -46,7 +46,7 @@ PairBuckKokkos::PairBuckKokkos(LAMMPS *lmp) : PairBuck(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -59,9 +59,9 @@ PairBuckKokkos::~PairBuckKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index 8fae09e1e..a77f738a5 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -37,7 +37,7 @@ PairCoulCutKokkos::PairCoulCutKokkos(LAMMPS *lmp) : PairCoulCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,9 +55,9 @@ template void PairCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index e3326f305..b469a2b8c 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -46,7 +46,7 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } @@ -66,9 +66,9 @@ template void PairCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 780d57d92..aeba50c0a 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairCoulLongKokkos::PairCoulLongKokkos(LAMMPS *lmp):PairCoulLong(lmp execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_coulsq = 0.0; } @@ -71,9 +71,9 @@ PairCoulLongKokkos::~PairCoulLongKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -82,10 +82,10 @@ PairCoulLongKokkos::~PairCoulLongKokkos() template void PairCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 280e47b77..4e0c44acb 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMAlloyKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index aee94471c..2c4e4fdf9 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -61,7 +61,7 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMAlloyKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index a4828c00a..2714da9ca 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMFSKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index 5f1a912f5..104ecf1a0 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -61,7 +61,7 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMFSKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 5992b7ed6..99719bbe5 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -59,7 +59,7 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } KOKKOS_INLINE_FUNCTION void operator()(TagPairEAMPackForwardComm, const int&) const; diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index 035bf87ce..811589972 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -1715,16 +1715,16 @@ void PairExp6rxKokkos::read_file(char *file) char **words = new char*[params_per_line+1]; memoryKK->destroy_kokkos(k_params,params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -1741,7 +1741,7 @@ void PairExp6rxKokkos::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1763,7 +1763,7 @@ void PairExp6rxKokkos::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1783,7 +1783,7 @@ void PairExp6rxKokkos::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp index a442a987f..a1c376cdf 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp @@ -48,8 +48,8 @@ PairGranHookeHistoryKokkos::~PairGranHookeHistoryKokkos() if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } @@ -64,7 +64,7 @@ void PairGranHookeHistoryKokkos::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",3); char **fixarg = new char*[4]; diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index b5b0a9d02..23b8401fe 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -87,7 +87,7 @@ void PairHybridKokkos::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 396a5f2d4..1eaf20ead 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -94,7 +94,7 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations NULL which are destructed by the PairStyle + // Call cleanup_copy which sets allocations nullptr which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index 2ce056938..adfe095dc 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -54,7 +54,7 @@ PairLJCharmmCoulCharmmImplicitKokkos::PairLJCharmmCoulCharmmImplicit execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -74,9 +74,9 @@ PairLJCharmmCoulCharmmImplicitKokkos::~PairLJCharmmCoulCharmmImplici memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -88,11 +88,11 @@ template void PairLJCharmmCoulCharmmImplicitKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index e59da8d29..a20a6242c 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulCharmmKokkos::PairLJCharmmCoulCharmmKokkos(LAMMPS *l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulCharmmKokkos::~PairLJCharmmCoulCharmmKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulCharmmKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index a06e569eb..2f4a03e9b 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulLongKokkos::PairLJCharmmCoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulLongKokkos::~PairLJCharmmCoulLongKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index b45ff6d31..799f1a278 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -43,9 +43,9 @@ PairLJClass2CoulCutKokkos::PairLJClass2CoulCutKokkos(LAMMPS *lmp):Pa execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -67,11 +67,11 @@ template void PairLJClass2CoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index fc97c3491..7fafd865c 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -51,8 +51,8 @@ PairLJClass2CoulLongKokkos::PairLJClass2CoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -74,11 +74,11 @@ template void PairLJClass2CoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index a0d2fba58..6a66a8861 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -46,7 +46,7 @@ PairLJClass2Kokkos::PairLJClass2Kokkos(LAMMPS *lmp) : PairLJClass2(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJClass2Kokkos::~PairLJClass2Kokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJClass2Kokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index d269de45e..3749690b7 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -42,9 +42,9 @@ PairLJCutCoulCutKokkos::PairLJCutCoulCutKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -66,11 +66,11 @@ template void PairLJCutCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 05e0d15db..bd4530cf3 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -46,9 +46,9 @@ PairLJCutCoulDebyeKokkos::PairLJCutCoulDebyeKokkos(LAMMPS *lmp):Pair execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -70,11 +70,11 @@ template void PairLJCutCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index bdd167a29..47fa5cf11 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -56,9 +56,9 @@ PairLJCutCoulDSFKokkos::PairLJCutCoulDSFKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } @@ -80,11 +80,11 @@ template void PairLJCutCoulDSFKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index b6ea969d8..6f31a816d 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -53,8 +53,8 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -66,8 +66,8 @@ PairLJCutCoulLongKokkos::~PairLJCutCoulLongKokkos() { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; if (allocated){ memoryKK->destroy_kokkos(k_cutsq, cutsq); memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); @@ -80,11 +80,11 @@ template void PairLJCutCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index 8294d62f6..674c54fa4 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -41,7 +41,7 @@ PairLJCutKokkos::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,9 +54,9 @@ PairLJCutKokkos::~PairLJCutKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -66,9 +66,9 @@ template void PairLJCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index f17703e2d..5d47e5dab 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -46,7 +46,7 @@ PairLJExpandKokkos::PairLJExpandKokkos(LAMMPS *lmp) : PairLJExpand(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJExpandKokkos::~PairLJExpandKokkos() if (!copymode) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJExpandKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index 60d18519b..04d018257 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -46,7 +46,7 @@ PairLJGromacsCoulGromacsKokkos::PairLJGromacsCoulGromacsKokkos(LAMMP execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -66,9 +66,9 @@ PairLJGromacsCoulGromacsKokkos::~PairLJGromacsCoulGromacsKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -80,11 +80,11 @@ template void PairLJGromacsCoulGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index d27b9e1ec..dacf4d977 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -46,9 +46,9 @@ PairLJGromacsKokkos::PairLJGromacsKokkos(LAMMPS *lmp):PairLJGromacs( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } @@ -63,11 +63,11 @@ PairLJGromacsKokkos::~PairLJGromacsKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_inner_sq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } } @@ -77,11 +77,11 @@ template void PairLJGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 8b228f2c0..ddf4b4efd 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -46,7 +46,7 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJSDKKokkos::~PairLJSDKKokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJSDKKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index ba6e9ba97..b6cf4ed8d 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -48,7 +48,7 @@ PairMorseKokkos::PairMorseKokkos(LAMMPS *lmp) : PairMorse(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,9 +61,9 @@ PairMorseKokkos::~PairMorseKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -73,9 +73,9 @@ template void PairMorseKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index c4e1ae38c..f620d194a 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -83,7 +83,7 @@ PairMultiLucyRXKokkos::~PairMultiLucyRXKokkos() delete h_table; delete d_table; - tabindex = NULL; + tabindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -980,7 +980,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 3a7359df9..d76cb98ec 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -79,9 +79,9 @@ PairReaxCKokkos::~PairReaxCKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_tmpid,tmpid); - tmpid = NULL; + tmpid = nullptr; memoryKK->destroy_kokkos(k_tmpbo,tmpbo); - tmpbo = NULL; + tmpbo = nullptr; // deallocate views of views in serial to prevent race condition in profiling tools @@ -137,7 +137,7 @@ void PairReaxCKokkos::init_style() { PairReaxC::init_style(); if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version - fix_reax = NULL; + fix_reax = nullptr; // irequest = neigh request made by parent class diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 7a567e846..a8a79f968 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -61,8 +61,8 @@ PairSWKokkos::~PairSWKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index b5b59dc45..996dae5c1 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -462,7 +462,7 @@ void PairTableKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -522,10 +522,10 @@ template void PairTableKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 09e38e638..b2b8a7d60 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -995,7 +995,7 @@ void PairTableRXKokkos::settings(int narg, char **arg) for (int m = 0; m < ntables; m++) free_table(&tables[m]); memory->sfree(tables); ntables = 0; - tables = NULL; + tables = nullptr; if (allocated) { memory->destroy(setflag); @@ -1289,10 +1289,10 @@ template void PairTableRXKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_vashishta_kokkos.cpp b/src/KOKKOS/pair_vashishta_kokkos.cpp index b5dd43f12..106422a23 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.cpp +++ b/src/KOKKOS/pair_vashishta_kokkos.cpp @@ -61,8 +61,8 @@ PairVashishtaKokkos::~PairVashishtaKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 71236c807..03deb1ecf 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -45,7 +45,7 @@ PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,9 +58,9 @@ PairYukawaKokkos::~PairYukawaKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -70,9 +70,9 @@ template void PairYukawaKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index 8b583a75f..796dd5211 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -60,9 +60,9 @@ PairZBLKokkos::~PairZBLKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -416,9 +416,9 @@ template void PairZBLKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 4a795833f..f4e3955f3 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -77,25 +77,25 @@ PPPMKokkos::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = NULL; - //d_density_fft = NULL; - //d_u_brick = NULL; - //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = NULL; - //greensfn = NULL; - //d_work1 = d_work2 = NULL; - //vg = NULL; - //d_fkx = d_fky = d_fkz = NULL; + //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = nullptr; + //d_density_fft = nullptr; + //d_u_brick = nullptr; + //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = nullptr; + //greensfn = nullptr; + //d_work1 = d_work2 = nullptr; + //vg = nullptr; + //d_fkx = d_fky = d_fkz = nullptr; - //gf_b = NULL; - //rho1d = rho_coeff = drho1d = drho_coeff = NULL; + //gf_b = nullptr; + //rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - gc = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; nmax = 0; - //part2grid = NULL; + //part2grid = nullptr; peratom_allocate_flag = 0; @@ -160,8 +160,8 @@ PPPMKokkos::~PPPMKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- @@ -212,7 +212,7 @@ void PPPMKokkos::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -247,7 +247,7 @@ void PPPMKokkos::init() // or overlap is allowed, then done // else reduce order and try again - GridCommKokkos *gctmp = NULL; + GridCommKokkos *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -851,22 +851,22 @@ template void PPPMKokkos::deallocate() { memoryKK->destroy_kokkos(d_density_fft,density_fft); - density_fft = NULL; + density_fft = nullptr; memoryKK->destroy_kokkos(d_greensfn,greensfn); - greensfn = NULL; + greensfn = nullptr; memoryKK->destroy_kokkos(d_work1,work1); - work1 = NULL; + work1 = nullptr; memoryKK->destroy_kokkos(d_work2,work2); - work2 = NULL; + work2 = nullptr; delete fft1; - fft1 = NULL; + fft1 = nullptr; delete fft2; - fft2 = NULL; + fft2 = nullptr; delete remap; - remap = NULL; + remap = nullptr; delete gc; - gc = NULL; + gc = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.cpp b/src/KOKKOS/rand_pool_wrap_kokkos.cpp index 2d8865feb..51ea45e83 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.cpp +++ b/src/KOKKOS/rand_pool_wrap_kokkos.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; RandPoolWrap::RandPoolWrap(int, LAMMPS *lmp) : Pointers(lmp) { - random_thr = NULL; + random_thr = nullptr; nthreads = lmp->kokkos->nthreads; } @@ -42,7 +42,7 @@ void RandPoolWrap::destroy() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index 9124d8e9e..8ae90011a 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -26,7 +26,7 @@ struct RandWrap { KOKKOS_INLINE_FUNCTION RandWrap() { - rng = NULL; + rng = nullptr; } KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/remap_kokkos.cpp b/src/KOKKOS/remap_kokkos.cpp index af87ba364..1c72c9edc 100644 --- a/src/KOKKOS/remap_kokkos.cpp +++ b/src/KOKKOS/remap_kokkos.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; template RemapKokkos::RemapKokkos(LAMMPS *lmp) : Pointers(lmp) { - plan = NULL; + plan = nullptr; } template @@ -44,7 +44,7 @@ RemapKokkos::RemapKokkos(LAMMPS *lmp, MPI_Comm comm, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective, usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ @@ -235,7 +235,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // allocate memory for plan data struct plan = new struct remap_plan_3d_kokkos; - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; plan->usecuda_aware = usecuda_aware; @@ -268,10 +268,10 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -297,8 +297,8 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -379,9 +379,9 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -465,7 +465,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (size) { plan->d_sendbuf = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:sendbuf",size); - if (!plan->d_sendbuf.data()) return NULL; + if (!plan->d_sendbuf.data()) return nullptr; } // if requested, allocate internal scratch space for recvs, @@ -475,7 +475,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (nrecv > 0) { plan->d_scratch = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:scratch",nqty*out.isize*out.jsize*out.ksize); - if (!plan->d_scratch.data()) return NULL; + if (!plan->d_scratch.data()) return nullptr; } } @@ -495,7 +495,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat template void RemapKokkos::remap_3d_destroy_plan_kokkos(struct remap_plan_3d_kokkos *plan) { - if (plan == NULL) return; + if (plan == nullptr) return; // free MPI communicator diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 6133df398..51e19f763 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -39,11 +39,11 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), - kxvecs(NULL), kyvecs(NULL), kzvecs(NULL), ug(NULL), eg(NULL), vg(NULL), - ek(NULL), sfacrl(NULL), sfacim(NULL), sfacrl_all(NULL), sfacim_all(NULL), - cs(NULL), sn(NULL), sfacrl_A(NULL), sfacim_A(NULL), sfacrl_A_all(NULL), - sfacim_A_all(NULL), sfacrl_B(NULL), sfacim_B(NULL), sfacrl_B_all(NULL), - sfacim_B_all(NULL) + kxvecs(nullptr), kyvecs(nullptr), kzvecs(nullptr), ug(nullptr), eg(nullptr), vg(nullptr), + ek(nullptr), sfacrl(nullptr), sfacim(nullptr), sfacrl_all(nullptr), sfacim_all(nullptr), + cs(nullptr), sn(nullptr), sfacrl_A(nullptr), sfacim_A(nullptr), sfacrl_A_all(nullptr), + sfacim_A_all(nullptr), sfacrl_B(nullptr), sfacim_B(nullptr), sfacrl_B_all(nullptr), + sfacim_B_all(nullptr) { group_allocate_flag = 0; kmax_created = 0; @@ -53,14 +53,14 @@ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), accuracy_relative = 0.0; kmax = 0; - kxvecs = kyvecs = kzvecs = NULL; - ug = NULL; - eg = vg = NULL; - sfacrl = sfacim = sfacrl_all = sfacim_all = NULL; + kxvecs = kyvecs = kzvecs = nullptr; + ug = nullptr; + eg = vg = nullptr; + sfacrl = sfacim = sfacrl_all = sfacim_all = nullptr; nmax = 0; - ek = NULL; - cs = sn = NULL; + ek = nullptr; + cs = sn = nullptr; kcount = 0; } @@ -121,7 +121,7 @@ void Ewald::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole.cpp b/src/KSPACE/ewald_dipole.cpp index 33d21b416..ae2596ffe 100644 --- a/src/KSPACE/ewald_dipole.cpp +++ b/src/KSPACE/ewald_dipole.cpp @@ -40,12 +40,12 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDipole::EwaldDipole(LAMMPS *lmp) : Ewald(lmp), - tk(NULL), vc(NULL) + tk(nullptr), vc(nullptr) { ewaldflag = dipoleflag = 1; group_group_enable = 0; - tk = NULL; - vc = NULL; + tk = nullptr; + vc = nullptr; } /* ---------------------------------------------------------------------- @@ -112,7 +112,7 @@ void EwaldDipole::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index 94cacd3a7..67f49f87c 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -102,7 +102,7 @@ void EwaldDipoleSpin::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 546ac472c..4de393c8f 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -43,21 +43,21 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp), - kenergy(NULL), kvirial(NULL), energy_self_peratom(NULL), virial_self_peratom(NULL), - ekr_local(NULL), hvec(NULL), kvec(NULL), B(NULL), cek_local(NULL), cek_global(NULL) + kenergy(nullptr), kvirial(nullptr), energy_self_peratom(nullptr), virial_self_peratom(nullptr), + ekr_local(nullptr), hvec(nullptr), kvec(nullptr), B(nullptr), cek_local(nullptr), cek_global(nullptr) { ewaldflag = dispersionflag = dipoleflag = 1; memset(function, 0, EWALD_NFUNCS*sizeof(int)); - kenergy = kvirial = NULL; - cek_local = cek_global = NULL; - ekr_local = NULL; - hvec = NULL; - kvec = NULL; - B = NULL; + kenergy = kvirial = nullptr; + cek_local = cek_global = nullptr; + ekr_local = nullptr; + hvec = nullptr; + kvec = nullptr; + B = nullptr; first_output = 0; - energy_self_peratom = NULL; - virial_self_peratom = NULL; + energy_self_peratom = nullptr; + virial_self_peratom = nullptr; nmax = 0; q2 = 0; b2 = 0; @@ -109,8 +109,8 @@ void EwaldDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; if (!(ptr||cutoff)) error->all(FLERR,"KSpace style is incompatible with Pair style"); int ewald_order = ptr ? *((int *) ptr) : 1<<1; @@ -423,12 +423,12 @@ void EwaldDisp::deallocate_peratom() // free memory { if (energy_self_peratom) { memory->destroy(energy_self_peratom); - energy_self_peratom = NULL; + energy_self_peratom = nullptr; } if (virial_self_peratom) { memory->destroy(virial_self_peratom); - virial_self_peratom = NULL; + virial_self_peratom = nullptr; } } @@ -436,12 +436,12 @@ void EwaldDisp::deallocate_peratom() // free memory void EwaldDisp::deallocate() // free memory { - delete [] hvec; hvec = NULL; - delete [] kvec; kvec = NULL; - delete [] kenergy; kenergy = NULL; - delete [] kvirial; kvirial = NULL; - delete [] cek_local; cek_local = NULL; - delete [] cek_global; cek_global = NULL; + delete [] hvec; hvec = nullptr; + delete [] kvec; kvec = nullptr; + delete [] kenergy; kenergy = nullptr; + delete [] kvirial; kvirial = nullptr; + delete [] cek_local; cek_local = nullptr; + delete [] cek_global; cek_global = nullptr; } /* ---------------------------------------------------------------------- */ @@ -726,7 +726,7 @@ void EwaldDisp::compute_ek() { cvector *ekr = ekr_local; int lbytes = (2*nbox+1)*sizeof(cvector); - hvector *h = NULL; + hvector *h = nullptr; kvector *k, *nk = kvec+nkvec; cvector *z = new cvector[2*nbox+1]; cvector z1, *zx, *zy, *zz, *zn = z+2*nbox; @@ -734,7 +734,7 @@ void EwaldDisp::compute_ek() vector mui; double *x = atom->x[0], *xn = x+3*atom->nlocal, *q = atom->q, qi = 0.0; double bi = 0.0, ci[7]; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; int i, kx, ky, n = nkvec*nsums, *type = atom->type, tri = domain->triclinic; int func[EWALD_NFUNCS]; @@ -806,8 +806,8 @@ void EwaldDisp::compute_force() vector sum[EWALD_MAX_NSUMS], mui = COMPLEX_NULL; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { 8.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(12.0*volume), @@ -1002,7 +1002,7 @@ void EwaldDisp::compute_energy_peratom() complex *cek_coul; double *q = atom->q; double *eatomj = eatom; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke = kenergy; double c[EWALD_NFUNCS] = { @@ -1159,8 +1159,8 @@ void EwaldDisp::compute_virial_dipole() double sum_total[6]; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *mu = atom->mu ? atom->mu[0] : NULL; - double *vatomj = NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; + double *vatomj = nullptr; if (vflag_atom && vatom) vatomj = vatom[0]; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { @@ -1255,8 +1255,8 @@ void EwaldDisp::compute_virial_peratom() complex *cek_coul; double *kv; double *q = atom->q; - double *vatomj = vatom ? vatom[0] : NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *vatomj = vatom ? vatom[0] : nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double c[EWALD_NFUNCS] = { 4.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(24.0*volume), diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp index 477f8c759..d5ca88c0d 100644 --- a/src/KSPACE/fft3d.cpp +++ b/src/KSPACE/fft3d.cpp @@ -279,7 +279,7 @@ struct fft_plan_3d *fft_3d_create_plan( // allocate memory for plan data struct plan = (struct fft_plan_3d *) malloc(sizeof(struct fft_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -299,7 +299,7 @@ struct fft_plan_3d *fft_3d_create_plan( first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; first_ihi = nfast - 1; @@ -311,7 +311,7 @@ struct fft_plan_3d *fft_3d_create_plan( remap_3d_create_plan(comm,in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION,0); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -336,7 +336,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -377,7 +377,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi, third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION,usecollective); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -398,7 +398,7 @@ struct fft_plan_3d *fft_3d_create_plan( MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remap_3d_create_plan(comm, @@ -406,7 +406,7 @@ struct fft_plan_3d *fft_3d_create_plan( third_jlo,third_jhi, out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION,0); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -467,15 +467,15 @@ struct fft_plan_3d *fft_3d_create_plan( if (copy_size) { plan->copy = (FFT_DATA *) malloc(copy_size*sizeof(FFT_DATA)); - if (plan->copy == NULL) return NULL; + if (plan->copy == nullptr) return nullptr; } - else plan->copy = NULL; + else plan->copy = nullptr; if (scratch_size) { plan->scratch = (FFT_DATA *) malloc(scratch_size*sizeof(FFT_DATA)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } - else plan->scratch = NULL; + else plan->scratch = nullptr; // system specific pre-computation of 1d FFT coeffs // and scaling normalization @@ -527,47 +527,47 @@ struct fft_plan_3d *fft_3d_create_plan( plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #else /* FFT_KISS */ - plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,NULL,NULL); - plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,NULL,NULL); + plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,NULL,NULL); - plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,NULL,NULL); + plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -579,8 +579,8 @@ struct fft_plan_3d *fft_3d_create_plan( plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,NULL,NULL); - plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,NULL,NULL); + plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp index d0e3a2b50..28af7aabb 100644 --- a/src/KSPACE/fft3d_wrap.cpp +++ b/src/KSPACE/fft3d_wrap.cpp @@ -30,7 +30,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/KSPACE/gridcomm.cpp b/src/KSPACE/gridcomm.cpp index 0f899d31c..1c013716c 100644 --- a/src/KSPACE/gridcomm.cpp +++ b/src/KSPACE/gridcomm.cpp @@ -211,13 +211,13 @@ void GridComm::initialize(MPI_Comm gcomm, // internal data initializations nswap = maxswap = 0; - swap = NULL; + swap = nullptr; nsend = nrecv = ncopy = 0; - send = NULL; - recv = NULL; - copy = NULL; - requests = NULL; + send = nullptr; + recv = nullptr; + copy = nullptr; + requests = nullptr; } /* ---------------------------------------------------------------------- */ @@ -575,7 +575,7 @@ void GridComm::setup_tiled(int &nbuf1, int &nbuf2) memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); noverlap = maxoverlap = 0; - overlap = NULL; + overlap = nullptr; ghost_box_drop(ghostbox,pbc); diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h index c95b648dc..119dc17f6 100644 --- a/src/KSPACE/kissfft.h +++ b/src/KSPACE/kissfft.h @@ -420,14 +420,14 @@ static void kf_factor(int n, int *facbuf) */ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem) { - kiss_fft_cfg st=NULL; + kiss_fft_cfg st=nullptr; size_t memneeded = sizeof(struct kiss_fft_state) + sizeof(FFT_DATA)*(nfft-1); /* twiddle factors */ - if (lenmem==NULL) { + if (lenmem==nullptr) { st=(kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); } else { - if (mem != NULL && *lenmem >= memneeded) + if (mem != nullptr && *lenmem >= memneeded) st = (kiss_fft_cfg)mem; *lenmem = memneeded; } diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index d0f4d3868..4c5b615a1 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -45,19 +45,19 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; MSM::MSM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), delxinv(NULL), delyinv(NULL), delzinv(NULL), nx_msm(NULL), - ny_msm(NULL), nz_msm(NULL), nxlo_in(NULL), nylo_in(NULL), nzlo_in(NULL), - nxhi_in(NULL), nyhi_in(NULL), nzhi_in(NULL), nxlo_out(NULL), nylo_out(NULL), - nzlo_out(NULL), nxhi_out(NULL), nyhi_out(NULL), nzhi_out(NULL), ngrid(NULL), - active_flag(NULL), alpha(NULL), betax(NULL), betay(NULL), betaz(NULL), - peratom_allocate_flag(0),levels(0),world_levels(NULL),qgrid(NULL),egrid(NULL), - v0grid(NULL), v1grid(NULL),v2grid(NULL),v3grid(NULL),v4grid(NULL),v5grid(NULL), - g_direct(NULL),v0_direct(NULL),v1_direct(NULL),v2_direct(NULL),v3_direct(NULL), - v4_direct(NULL),v5_direct(NULL),g_direct_top(NULL),v0_direct_top(NULL), - v1_direct_top(NULL),v2_direct_top(NULL),v3_direct_top(NULL),v4_direct_top(NULL), - v5_direct_top(NULL),phi1d(NULL),dphi1d(NULL),procneigh_levels(NULL),gcall(NULL), - gc(NULL),gcall_buf1(NULL),gcall_buf2(NULL),gc_buf1(NULL),gc_buf2(NULL), - ngc_buf1(NULL),ngc_buf2(NULL),part2grid(NULL),boxlo(NULL) + factors(nullptr), delxinv(nullptr), delyinv(nullptr), delzinv(nullptr), nx_msm(nullptr), + ny_msm(nullptr), nz_msm(nullptr), nxlo_in(nullptr), nylo_in(nullptr), nzlo_in(nullptr), + nxhi_in(nullptr), nyhi_in(nullptr), nzhi_in(nullptr), nxlo_out(nullptr), nylo_out(nullptr), + nzlo_out(nullptr), nxhi_out(nullptr), nyhi_out(nullptr), nzhi_out(nullptr), ngrid(nullptr), + active_flag(nullptr), alpha(nullptr), betax(nullptr), betay(nullptr), betaz(nullptr), + peratom_allocate_flag(0),levels(0),world_levels(nullptr),qgrid(nullptr),egrid(nullptr), + v0grid(nullptr), v1grid(nullptr),v2grid(nullptr),v3grid(nullptr),v4grid(nullptr),v5grid(nullptr), + g_direct(nullptr),v0_direct(nullptr),v1_direct(nullptr),v2_direct(nullptr),v3_direct(nullptr), + v4_direct(nullptr),v5_direct(nullptr),g_direct_top(nullptr),v0_direct_top(nullptr), + v1_direct_top(nullptr),v2_direct_top(nullptr),v3_direct_top(nullptr),v4_direct_top(nullptr), + v5_direct_top(nullptr),phi1d(nullptr),dphi1d(nullptr),procneigh_levels(nullptr),gcall(nullptr), + gc(nullptr),gcall_buf1(nullptr),gcall_buf2(nullptr),gc_buf1(nullptr),gc_buf2(nullptr), + ngc_buf1(nullptr),ngc_buf2(nullptr),part2grid(nullptr),boxlo(nullptr) { msmflag = 1; @@ -67,32 +67,32 @@ MSM::MSM(LAMMPS *lmp) MPI_Comm_rank(world,&me); - phi1d = dphi1d = NULL; + phi1d = dphi1d = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; - g_direct = NULL; - g_direct_top = NULL; + g_direct = nullptr; + g_direct_top = nullptr; - v0_direct = v1_direct = v2_direct = NULL; - v3_direct = v4_direct = v5_direct = NULL; + v0_direct = v1_direct = v2_direct = nullptr; + v3_direct = v4_direct = v5_direct = nullptr; - v0_direct_top = v1_direct_top = v2_direct_top = NULL; - v3_direct_top = v4_direct_top = v5_direct_top = NULL; + v0_direct_top = v1_direct_top = v2_direct_top = nullptr; + v3_direct_top = v4_direct_top = v5_direct_top = nullptr; - ngrid = NULL; + ngrid = nullptr; - alpha = betax = betay = betaz = NULL; - nx_msm = ny_msm = nz_msm = NULL; - nxlo_in = nylo_in = nzlo_in = NULL; - nxhi_in = nyhi_in = nzhi_in = NULL; - nxlo_out = nylo_out = nzlo_out = NULL; - nxhi_out = nyhi_out = nzhi_out = NULL; - delxinv = delyinv = delzinv = NULL; - qgrid = NULL; - egrid = NULL; - v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = NULL; + alpha = betax = betay = betaz = nullptr; + nx_msm = ny_msm = nz_msm = nullptr; + nxlo_in = nylo_in = nzlo_in = nullptr; + nxhi_in = nyhi_in = nzhi_in = nullptr; + nxlo_out = nylo_out = nzlo_out = nullptr; + nxhi_out = nyhi_out = nzhi_out = nullptr; + delxinv = delyinv = delzinv = nullptr; + qgrid = nullptr; + egrid = nullptr; + v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = nullptr; peratom_allocate_flag = 0; scalar_pressure_flag = 1; @@ -176,7 +176,7 @@ void MSM::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -825,18 +825,18 @@ void MSM::allocate_levels() v5grid = new double***[levels]; for (int n=0; nkspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -383,7 +383,7 @@ void PairBornCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -423,16 +423,16 @@ void PairBornCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -466,13 +466,13 @@ void PairBornCoulLong::write_restart_settings(FILE *fp) void PairBornCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -577,5 +577,5 @@ void *PairBornCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_born_coul_msm.cpp b/src/KSPACE/pair_born_coul_msm.cpp index 7300cd92e..707f7f795 100644 --- a/src/KSPACE/pair_born_coul_msm.cpp +++ b/src/KSPACE/pair_born_coul_msm.cpp @@ -34,7 +34,7 @@ PairBornCoulMSM::PairBornCoulMSM(LAMMPS *lmp) : PairBornCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -251,5 +251,5 @@ void *PairBornCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 8d15a6480..2733bc31c 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -364,7 +364,7 @@ void PairBuckCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -372,7 +372,7 @@ void PairBuckCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -410,14 +410,14 @@ void PairBuckCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -449,13 +449,13 @@ void PairBuckCoulLong::write_restart_settings(FILE *fp) void PairBuckCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -558,5 +558,5 @@ void *PairBuckCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_msm.cpp b/src/KSPACE/pair_buck_coul_msm.cpp index 1355a2f13..87c852b5a 100644 --- a/src/KSPACE/pair_buck_coul_msm.cpp +++ b/src/KSPACE/pair_buck_coul_msm.cpp @@ -31,7 +31,7 @@ PairBuckCoulMSM::PairBuckCoulMSM(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,5 +246,5 @@ void *PairBuckCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index a845ddd1d..744232dd8 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -50,9 +50,9 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; - cut_respa = NULL; + ftable = nullptr; + fdisptable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -61,7 +61,7 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairBuckLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style buck/long/coul/long command"); @@ -177,10 +177,10 @@ void PairBuckLongCoulLong::allocate() void *PairBuckLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { - "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", NULL}; + "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { buck_c, &ewald_order, &cut_coul, &mix_flag, &cut_coul, &cut_buck_global, - NULL}; + nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -240,7 +240,7 @@ void PairBuckLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -250,7 +250,7 @@ void PairBuckLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -359,14 +359,14 @@ void PairBuckLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck_a_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck_rho_read[i][j],1,MPI_DOUBLE,0,world); @@ -399,14 +399,14 @@ void PairBuckLongCoulLong::write_restart_settings(FILE *fp) void PairBuckLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_buck_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 2520da265..68b9a8cbe 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -44,9 +44,9 @@ using namespace LAMMPS_NS; PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -242,13 +242,13 @@ void PairCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -291,10 +291,10 @@ void PairCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&scale[i][j],1,MPI_DOUBLE,0,world); } } @@ -320,11 +320,11 @@ void PairCoulLong::write_restart_settings(FILE *fp) void PairCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -393,5 +393,5 @@ void *PairCoulLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_coul_msm.cpp b/src/KSPACE/pair_coul_msm.cpp index 5d42e1f04..bf689d403 100644 --- a/src/KSPACE/pair_coul_msm.cpp +++ b/src/KSPACE/pair_coul_msm.cpp @@ -217,5 +217,5 @@ void *PairCoulMSM::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 261e93fbc..b4455ff9b 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -47,11 +47,11 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -738,11 +738,11 @@ void PairLJCharmmCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -824,14 +824,14 @@ void PairLJCharmmCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -863,13 +863,13 @@ void PairLJCharmmCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -994,5 +994,5 @@ void *PairLJCharmmCoulLong::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.cpp b/src/KSPACE/pair_lj_charmm_coul_msm.cpp index a93a1275f..fe3ce441a 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_msm.cpp @@ -35,7 +35,7 @@ PairLJCharmmCoulMSM::PairLJCharmmCoulMSM(LAMMPS *lmp) : ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -537,5 +537,5 @@ void *PairLJCharmmCoulMSM::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 9df9862c1..abc8888e5 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -51,11 +51,11 @@ PairLJCharmmfswCoulLong::PairLJCharmmfswCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; // short-range/long-range flag accessed by DihedralCharmmfsw @@ -786,11 +786,11 @@ void PairLJCharmmfswCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -872,14 +872,14 @@ void PairLJCharmmfswCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -911,13 +911,13 @@ void PairLJCharmmfswCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -1055,5 +1055,5 @@ void *PairLJCharmmfswCoulLong::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 7fd8a7255..7ae60acc8 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -51,9 +51,9 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -676,11 +676,11 @@ void PairLJCutCoulLong::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -792,13 +792,13 @@ void PairLJCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -829,13 +829,13 @@ void PairLJCutCoulLong::write_restart_settings(FILE *fp) void PairLJCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -943,5 +943,5 @@ void *PairLJCutCoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_msm.cpp b/src/KSPACE/pair_lj_cut_coul_msm.cpp index 4ebbcb9a3..00aa88152 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.cpp +++ b/src/KSPACE/pair_lj_cut_coul_msm.cpp @@ -34,7 +34,7 @@ PairLJCutCoulMSM::PairLJCutCoulMSM(LAMMPS *lmp) : PairLJCutCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -478,5 +478,5 @@ void *PairLJCutCoulMSM::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index a62c1bd55..0d7778c93 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -55,8 +55,8 @@ PairLJCutTIP4PLong::PairLJCutTIP4PLong(LAMMPS *lmp) : writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -464,9 +464,9 @@ void PairLJCutTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLong::init_style(); @@ -529,19 +529,19 @@ void PairLJCutTIP4PLong::write_restart_settings(FILE *fp) void PairLJCutTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -594,7 +594,7 @@ void *PairLJCutTIP4PLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index b6727c2c9..960a47e68 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -53,10 +53,10 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -65,7 +65,7 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/coul/long command"); @@ -176,10 +176,10 @@ void *PairLJLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_LJ", NULL}; + "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, - &cut_coul, &cut_lj_global, NULL}; + &cut_coul, &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -235,7 +235,7 @@ void PairLJLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -245,7 +245,7 @@ void PairLJLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -360,13 +360,13 @@ void PairLJLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -398,14 +398,14 @@ void PairLJLongCoulLong::write_restart_settings(FILE *fp) void PairLJLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index 8f17bda00..790e31816 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -52,8 +52,8 @@ PairLJLongTIP4PLong::PairLJLongTIP4PLong(LAMMPS *lmp) : respa_enable = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to find_M() finding bonded H atoms which are not near O atom @@ -1479,9 +1479,9 @@ void PairLJLongTIP4PLong::init_style() error->all(FLERR,"Pair style lj/long/tip4p/long requires newton pair on"); if (!atom->q_flag) error->all(FLERR,"Pair style lj/long/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJLongCoulLong::init_style(); @@ -1544,20 +1544,20 @@ void PairLJLongTIP4PLong::write_restart_settings(FILE *fp) void PairLJLongTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -1611,14 +1611,14 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "cut_coul", - "ewald_mix", "cut_LJ", NULL}; + "ewald_mix", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &cut_coul, - &mix_flag, &cut_lj_global, NULL}; + &mix_flag, &cut_lj_global, nullptr}; int i; i=0; - while (ids[i] != NULL) { + while (ids[i] != nullptr) { if (i <=2) dim = 2; else dim = 0; @@ -1627,7 +1627,7 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) ++i; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index 54973c69c..80785d355 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -51,8 +51,8 @@ PairTIP4PLong::PairTIP4PLong(LAMMPS *lmp) : PairCoulLong(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -421,9 +421,9 @@ void PairTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLong::init_style(); @@ -468,11 +468,11 @@ void PairTIP4PLong::read_restart_settings(FILE *fp) PairCoulLong::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -514,7 +514,7 @@ void *PairTIP4PLong::extract(const char *str, int &dim) if (strcmp(str,"typeA") == 0) return (void *) &typeA; if (strcmp(str,"typeB") == 0) return (void *) &typeB; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 41ffec4f3..89d308eaa 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -63,16 +63,16 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), density_brick(NULL), vdx_brick(NULL), vdy_brick(NULL), vdz_brick(NULL), - u_brick(NULL), v0_brick(NULL), v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), - v4_brick(NULL), v5_brick(NULL), greensfn(NULL), vg(NULL), fkx(NULL), fky(NULL), - fkz(NULL), density_fft(NULL), work1(NULL), work2(NULL), gf_b(NULL), rho1d(NULL), - rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), - sf_precoeff1(NULL), sf_precoeff2(NULL), sf_precoeff3(NULL), - sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), - acons(NULL), fft1(NULL), fft2(NULL), remap(NULL), gc(NULL), - gc_buf1(NULL), gc_buf2(NULL), density_A_brick(NULL), density_B_brick(NULL), density_A_fft(NULL), - density_B_fft(NULL), part2grid(NULL), boxlo(NULL) + factors(nullptr), density_brick(nullptr), vdx_brick(nullptr), vdy_brick(nullptr), vdz_brick(nullptr), + u_brick(nullptr), v0_brick(nullptr), v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), + v4_brick(nullptr), v5_brick(nullptr), greensfn(nullptr), vg(nullptr), fkx(nullptr), fky(nullptr), + fkz(nullptr), density_fft(nullptr), work1(nullptr), work2(nullptr), gf_b(nullptr), rho1d(nullptr), + rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), + acons(nullptr), fft1(nullptr), fft2(nullptr), remap(nullptr), gc(nullptr), + gc_buf1(nullptr), gc_buf2(nullptr), density_A_brick(nullptr), density_B_brick(nullptr), density_A_fft(nullptr), + density_B_fft(nullptr), part2grid(nullptr), boxlo(nullptr) { peratom_allocate_flag = 0; group_allocate_flag = 0; @@ -95,31 +95,31 @@ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), nyhi_in = nylo_in = nyhi_out = nylo_out = 0; nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; - u_brick = NULL; - v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = NULL; - greensfn = NULL; - work1 = work2 = NULL; - vg = NULL; - fkx = fky = fkz = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; + u_brick = nullptr; + v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = nullptr; + greensfn = nullptr; + work1 = work2 = nullptr; + vg = nullptr; + fkx = fky = fkz = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = - sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; - density_A_brick = density_B_brick = NULL; - density_A_fft = density_B_fft = NULL; + density_A_brick = density_B_brick = nullptr; + density_A_fft = density_B_fft = nullptr; - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - gc = NULL; - gc_buf1 = gc_buf2 = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; + gc_buf1 = gc_buf2 = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; // define acons coefficients for estimation of kspace errors // see JCP 109, pg 7698 for derivation of coefficients @@ -229,7 +229,7 @@ void PPPM::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -254,8 +254,8 @@ void PPPM::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL || - force->angle->setflag == NULL || force->bond->setflag == NULL) + if (force->angle == nullptr || force->bond == nullptr || + force->angle->setflag == nullptr || force->bond->setflag == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -292,7 +292,7 @@ void PPPM::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -867,7 +867,7 @@ void PPPM::deallocate() } memory->destroy(gf_b); - if (stagger_flag) gf_b = NULL; + if (stagger_flag) gf_b = nullptr; memory->destroy2d_offset(rho1d,-order_allocated/2); memory->destroy2d_offset(drho1d,-order_allocated/2); memory->destroy2d_offset(rho_coeff,(1-order_allocated)/2); diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index b319014c7..62f816a94 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -47,7 +47,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMCG::PPPMCG(LAMMPS *lmp) : PPPM(lmp), - is_charged(NULL) + is_charged(nullptr) { num_charged = -1; group_group_enable = 1; diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 1b7d32532..feb17e522 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -58,25 +58,25 @@ enum{FORWARD_MU,FORWARD_MU_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMDipole::PPPMDipole(LAMMPS *lmp) : PPPM(lmp), - densityx_brick_dipole(NULL), densityy_brick_dipole(NULL), - densityz_brick_dipole(NULL), - vdxx_brick_dipole(NULL), vdyy_brick_dipole(NULL), vdzz_brick_dipole(NULL), - vdxy_brick_dipole(NULL), vdxz_brick_dipole(NULL), vdyz_brick_dipole(NULL), - ux_brick_dipole(NULL), uy_brick_dipole(NULL), uz_brick_dipole(NULL), - v0x_brick_dipole(NULL), v1x_brick_dipole(NULL), - v2x_brick_dipole(NULL), v3x_brick_dipole(NULL), v4x_brick_dipole(NULL), - v5x_brick_dipole(NULL), v0y_brick_dipole(NULL), v1y_brick_dipole(NULL), - v2y_brick_dipole(NULL), v3y_brick_dipole(NULL), v4y_brick_dipole(NULL), - v5y_brick_dipole(NULL), v0z_brick_dipole(NULL), v1z_brick_dipole(NULL), - v2z_brick_dipole(NULL), v3z_brick_dipole(NULL), v4z_brick_dipole(NULL), - v5z_brick_dipole(NULL), work3(NULL), work4(NULL), - densityx_fft_dipole(NULL), densityy_fft_dipole(NULL), - densityz_fft_dipole(NULL) + densityx_brick_dipole(nullptr), densityy_brick_dipole(nullptr), + densityz_brick_dipole(nullptr), + vdxx_brick_dipole(nullptr), vdyy_brick_dipole(nullptr), vdzz_brick_dipole(nullptr), + vdxy_brick_dipole(nullptr), vdxz_brick_dipole(nullptr), vdyz_brick_dipole(nullptr), + ux_brick_dipole(nullptr), uy_brick_dipole(nullptr), uz_brick_dipole(nullptr), + v0x_brick_dipole(nullptr), v1x_brick_dipole(nullptr), + v2x_brick_dipole(nullptr), v3x_brick_dipole(nullptr), v4x_brick_dipole(nullptr), + v5x_brick_dipole(nullptr), v0y_brick_dipole(nullptr), v1y_brick_dipole(nullptr), + v2y_brick_dipole(nullptr), v3y_brick_dipole(nullptr), v4y_brick_dipole(nullptr), + v5y_brick_dipole(nullptr), v0z_brick_dipole(nullptr), v1z_brick_dipole(nullptr), + v2z_brick_dipole(nullptr), v3z_brick_dipole(nullptr), v4z_brick_dipole(nullptr), + v5z_brick_dipole(nullptr), work3(nullptr), work4(nullptr), + densityx_fft_dipole(nullptr), densityy_fft_dipole(nullptr), + densityz_fft_dipole(nullptr) { dipoleflag = 1; group_group_enable = 0; - gc_dipole = NULL; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -153,7 +153,7 @@ void PPPMDipole::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -187,7 +187,7 @@ void PPPMDipole::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index 595c25733..a3f7aa29c 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -75,10 +75,10 @@ PPPMDipoleSpin::~PPPMDipoleSpin() deallocate(); if (peratom_allocate_flag) deallocate_peratom(); - fft1 = NULL; - fft2 = NULL; - remap = NULL; - gc_dipole = NULL; + fft1 = nullptr; + fft2 = nullptr; + remap = nullptr; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -139,7 +139,7 @@ void PPPMDipoleSpin::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); // check the correct extract here - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -172,7 +172,7 @@ void PPPMDipoleSpin::init() // or overlap is allowed, then done // else reduce order and try again - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index a484751a8..a88a0892b 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -63,47 +63,47 @@ enum{FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM, /* ---------------------------------------------------------------------- */ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), csumi(NULL), cii(NULL), B(NULL), density_brick(NULL), vdx_brick(NULL), - vdy_brick(NULL), vdz_brick(NULL), density_fft(NULL), u_brick(NULL), v0_brick(NULL), - v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), v4_brick(NULL), v5_brick(NULL), - density_brick_g(NULL), vdx_brick_g(NULL), vdy_brick_g(NULL), vdz_brick_g(NULL), - density_fft_g(NULL), u_brick_g(NULL), v0_brick_g(NULL), v1_brick_g(NULL), v2_brick_g(NULL), - v3_brick_g(NULL), v4_brick_g(NULL), v5_brick_g(NULL), density_brick_a0(NULL), - vdx_brick_a0(NULL), vdy_brick_a0(NULL), vdz_brick_a0(NULL), density_fft_a0(NULL), - u_brick_a0(NULL), v0_brick_a0(NULL), v1_brick_a0(NULL), v2_brick_a0(NULL), - v3_brick_a0(NULL), v4_brick_a0(NULL), v5_brick_a0(NULL), density_brick_a1(NULL), - vdx_brick_a1(NULL), vdy_brick_a1(NULL), vdz_brick_a1(NULL), density_fft_a1(NULL), - u_brick_a1(NULL), v0_brick_a1(NULL), v1_brick_a1(NULL), v2_brick_a1(NULL), - v3_brick_a1(NULL), v4_brick_a1(NULL), v5_brick_a1(NULL), density_brick_a2(NULL), - vdx_brick_a2(NULL), vdy_brick_a2(NULL), vdz_brick_a2(NULL), density_fft_a2(NULL), - u_brick_a2(NULL), v0_brick_a2(NULL), v1_brick_a2(NULL), v2_brick_a2(NULL), - v3_brick_a2(NULL), v4_brick_a2(NULL), v5_brick_a2(NULL), density_brick_a3(NULL), - vdx_brick_a3(NULL), vdy_brick_a3(NULL), vdz_brick_a3(NULL), density_fft_a3(NULL), - u_brick_a3(NULL), v0_brick_a3(NULL), v1_brick_a3(NULL), v2_brick_a3(NULL), - v3_brick_a3(NULL), v4_brick_a3(NULL), v5_brick_a3(NULL), density_brick_a4(NULL), - vdx_brick_a4(NULL), vdy_brick_a4(NULL), vdz_brick_a4(NULL), density_fft_a4(NULL), - u_brick_a4(NULL), v0_brick_a4(NULL), v1_brick_a4(NULL), v2_brick_a4(NULL), - v3_brick_a4(NULL), v4_brick_a4(NULL), v5_brick_a4(NULL), density_brick_a5(NULL), - vdx_brick_a5(NULL), vdy_brick_a5(NULL), vdz_brick_a5(NULL), density_fft_a5(NULL), - u_brick_a5(NULL), v0_brick_a5(NULL), v1_brick_a5(NULL), v2_brick_a5(NULL), - v3_brick_a5(NULL), v4_brick_a5(NULL), v5_brick_a5(NULL), density_brick_a6(NULL), - vdx_brick_a6(NULL), vdy_brick_a6(NULL), vdz_brick_a6(NULL), density_fft_a6(NULL), - u_brick_a6(NULL), v0_brick_a6(NULL), v1_brick_a6(NULL), v2_brick_a6(NULL), - v3_brick_a6(NULL), v4_brick_a6(NULL), v5_brick_a6(NULL), density_brick_none(NULL), - vdx_brick_none(NULL), vdy_brick_none(NULL), vdz_brick_none(NULL), - density_fft_none(NULL), u_brick_none(NULL), v0_brick_none(NULL), v1_brick_none(NULL), - v2_brick_none(NULL), v3_brick_none(NULL), v4_brick_none(NULL), v5_brick_none(NULL), - greensfn(NULL), vg(NULL), vg2(NULL), greensfn_6(NULL), vg_6(NULL), vg2_6(NULL), - fkx(NULL), fky(NULL), fkz(NULL), fkx2(NULL), fky2(NULL), fkz2(NULL), fkx_6(NULL), - fky_6(NULL), fkz_6(NULL), fkx2_6(NULL), fky2_6(NULL), fkz2_6(NULL), gf_b(NULL), - gf_b_6(NULL), sf_precoeff1(NULL), sf_precoeff2(NULL), sf_precoeff3(NULL), - sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), sf_precoeff1_6(NULL), - sf_precoeff2_6(NULL), sf_precoeff3_6(NULL), sf_precoeff4_6(NULL), sf_precoeff5_6(NULL), - sf_precoeff6_6(NULL), rho1d(NULL), rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), - rho1d_6(NULL), rho_coeff_6(NULL), drho1d_6(NULL), drho_coeff_6(NULL), work1(NULL), - work2(NULL), work1_6(NULL), work2_6(NULL), fft1(NULL), fft2(NULL), fft1_6(NULL), - fft2_6(NULL), remap(NULL), remap_6(NULL), gc(NULL), gc6(NULL), - part2grid(NULL), part2grid_6(NULL), boxlo(NULL) + factors(nullptr), csumi(nullptr), cii(nullptr), B(nullptr), density_brick(nullptr), vdx_brick(nullptr), + vdy_brick(nullptr), vdz_brick(nullptr), density_fft(nullptr), u_brick(nullptr), v0_brick(nullptr), + v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), v4_brick(nullptr), v5_brick(nullptr), + density_brick_g(nullptr), vdx_brick_g(nullptr), vdy_brick_g(nullptr), vdz_brick_g(nullptr), + density_fft_g(nullptr), u_brick_g(nullptr), v0_brick_g(nullptr), v1_brick_g(nullptr), v2_brick_g(nullptr), + v3_brick_g(nullptr), v4_brick_g(nullptr), v5_brick_g(nullptr), density_brick_a0(nullptr), + vdx_brick_a0(nullptr), vdy_brick_a0(nullptr), vdz_brick_a0(nullptr), density_fft_a0(nullptr), + u_brick_a0(nullptr), v0_brick_a0(nullptr), v1_brick_a0(nullptr), v2_brick_a0(nullptr), + v3_brick_a0(nullptr), v4_brick_a0(nullptr), v5_brick_a0(nullptr), density_brick_a1(nullptr), + vdx_brick_a1(nullptr), vdy_brick_a1(nullptr), vdz_brick_a1(nullptr), density_fft_a1(nullptr), + u_brick_a1(nullptr), v0_brick_a1(nullptr), v1_brick_a1(nullptr), v2_brick_a1(nullptr), + v3_brick_a1(nullptr), v4_brick_a1(nullptr), v5_brick_a1(nullptr), density_brick_a2(nullptr), + vdx_brick_a2(nullptr), vdy_brick_a2(nullptr), vdz_brick_a2(nullptr), density_fft_a2(nullptr), + u_brick_a2(nullptr), v0_brick_a2(nullptr), v1_brick_a2(nullptr), v2_brick_a2(nullptr), + v3_brick_a2(nullptr), v4_brick_a2(nullptr), v5_brick_a2(nullptr), density_brick_a3(nullptr), + vdx_brick_a3(nullptr), vdy_brick_a3(nullptr), vdz_brick_a3(nullptr), density_fft_a3(nullptr), + u_brick_a3(nullptr), v0_brick_a3(nullptr), v1_brick_a3(nullptr), v2_brick_a3(nullptr), + v3_brick_a3(nullptr), v4_brick_a3(nullptr), v5_brick_a3(nullptr), density_brick_a4(nullptr), + vdx_brick_a4(nullptr), vdy_brick_a4(nullptr), vdz_brick_a4(nullptr), density_fft_a4(nullptr), + u_brick_a4(nullptr), v0_brick_a4(nullptr), v1_brick_a4(nullptr), v2_brick_a4(nullptr), + v3_brick_a4(nullptr), v4_brick_a4(nullptr), v5_brick_a4(nullptr), density_brick_a5(nullptr), + vdx_brick_a5(nullptr), vdy_brick_a5(nullptr), vdz_brick_a5(nullptr), density_fft_a5(nullptr), + u_brick_a5(nullptr), v0_brick_a5(nullptr), v1_brick_a5(nullptr), v2_brick_a5(nullptr), + v3_brick_a5(nullptr), v4_brick_a5(nullptr), v5_brick_a5(nullptr), density_brick_a6(nullptr), + vdx_brick_a6(nullptr), vdy_brick_a6(nullptr), vdz_brick_a6(nullptr), density_fft_a6(nullptr), + u_brick_a6(nullptr), v0_brick_a6(nullptr), v1_brick_a6(nullptr), v2_brick_a6(nullptr), + v3_brick_a6(nullptr), v4_brick_a6(nullptr), v5_brick_a6(nullptr), density_brick_none(nullptr), + vdx_brick_none(nullptr), vdy_brick_none(nullptr), vdz_brick_none(nullptr), + density_fft_none(nullptr), u_brick_none(nullptr), v0_brick_none(nullptr), v1_brick_none(nullptr), + v2_brick_none(nullptr), v3_brick_none(nullptr), v4_brick_none(nullptr), v5_brick_none(nullptr), + greensfn(nullptr), vg(nullptr), vg2(nullptr), greensfn_6(nullptr), vg_6(nullptr), vg2_6(nullptr), + fkx(nullptr), fky(nullptr), fkz(nullptr), fkx2(nullptr), fky2(nullptr), fkz2(nullptr), fkx_6(nullptr), + fky_6(nullptr), fkz_6(nullptr), fkx2_6(nullptr), fky2_6(nullptr), fkz2_6(nullptr), gf_b(nullptr), + gf_b_6(nullptr), sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), sf_precoeff1_6(nullptr), + sf_precoeff2_6(nullptr), sf_precoeff3_6(nullptr), sf_precoeff4_6(nullptr), sf_precoeff5_6(nullptr), + sf_precoeff6_6(nullptr), rho1d(nullptr), rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + rho1d_6(nullptr), rho_coeff_6(nullptr), drho1d_6(nullptr), drho_coeff_6(nullptr), work1(nullptr), + work2(nullptr), work1_6(nullptr), work2_6(nullptr), fft1(nullptr), fft2(nullptr), fft1_6(nullptr), + fft2_6(nullptr), remap(nullptr), remap_6(nullptr), gc(nullptr), gc6(nullptr), + part2grid(nullptr), part2grid_6(nullptr), boxlo(nullptr) { triclinic_support = 0; pppmflag = dispersionflag = 1; @@ -125,98 +125,98 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), nzhi_in_6 = nzlo_in_6 = nzhi_out_6 = nzlo_out_6 = 0; csumflag = 0; - B = NULL; - cii = NULL; - csumi = NULL; + B = nullptr; + cii = nullptr; + csumi = nullptr; peratom_allocate_flag = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; u_brick = v0_brick = v1_brick = v2_brick = v3_brick = - v4_brick = v5_brick = NULL; + v4_brick = v5_brick = nullptr; - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = v3_brick_g = - v4_brick_g = v5_brick_g = NULL; + v4_brick_g = v5_brick_g = nullptr; - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = v3_brick_a0 = - v4_brick_a0 = v5_brick_a0 = NULL; + v4_brick_a0 = v5_brick_a0 = nullptr; - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = v3_brick_a1 = - v4_brick_a1 = v5_brick_a1 = NULL; + v4_brick_a1 = v5_brick_a1 = nullptr; - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = - v4_brick_a2 = v5_brick_a2 = NULL; + v4_brick_a2 = v5_brick_a2 = nullptr; - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = - v4_brick_a3 = v5_brick_a3 = NULL; + v4_brick_a3 = v5_brick_a3 = nullptr; - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = v3_brick_a4 = - v4_brick_a4 = v5_brick_a4 = NULL; + v4_brick_a4 = v5_brick_a4 = nullptr; - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = v3_brick_a5 = - v4_brick_a5 = v5_brick_a5 = NULL; + v4_brick_a5 = v5_brick_a5 = nullptr; - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = v3_brick_a6 = - v4_brick_a6 = v5_brick_a6 = NULL; + v4_brick_a6 = v5_brick_a6 = nullptr; - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = v3_brick_none = - v4_brick_none = v5_brick_none = NULL; - - greensfn = NULL; - greensfn_6 = NULL; - work1 = work2 = NULL; - work1_6 = work2_6 = NULL; - vg = NULL; - vg2 = NULL; - vg_6 = NULL; - vg2_6 = NULL; - fkx = fky = fkz = NULL; - fkx2 = fky2 = fkz2 = NULL; - fkx_6 = fky_6 = fkz_6 = NULL; - fkx2_6 = fky2_6 = fkz2_6 = NULL; + v4_brick_none = v5_brick_none = nullptr; + + greensfn = nullptr; + greensfn_6 = nullptr; + work1 = work2 = nullptr; + work1_6 = work2_6 = nullptr; + vg = nullptr; + vg2 = nullptr; + vg_6 = nullptr; + vg2_6 = nullptr; + fkx = fky = fkz = nullptr; + fkx2 = fky2 = fkz2 = nullptr; + fkx_6 = fky_6 = fkz_6 = nullptr; + fkx2_6 = fky2_6 = fkz2_6 = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = sf_precoeff4 = - sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff5 = sf_precoeff6 = nullptr; sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = sf_precoeff4_6 = - sf_precoeff5_6 = sf_precoeff6_6 = NULL; - - gf_b = NULL; - gf_b_6 = NULL; - rho1d = rho_coeff = NULL; - drho1d = drho_coeff = NULL; - rho1d_6 = rho_coeff_6 = NULL; - drho1d_6 = drho_coeff_6 = NULL; - fft1 = fft2 = NULL; - fft1_6 = fft2_6 = NULL; - remap = NULL; - remap_6 = NULL; - gc = gc6 = NULL; - gc_buf1 = gc_buf2 = NULL; - gc6_buf1 = gc6_buf2 = NULL; + sf_precoeff5_6 = sf_precoeff6_6 = nullptr; + + gf_b = nullptr; + gf_b_6 = nullptr; + rho1d = rho_coeff = nullptr; + drho1d = drho_coeff = nullptr; + rho1d_6 = rho_coeff_6 = nullptr; + drho1d_6 = drho_coeff_6 = nullptr; + fft1 = fft2 = nullptr; + fft1_6 = fft2_6 = nullptr; + remap = nullptr; + remap_6 = nullptr; + gc = gc6 = nullptr; + gc_buf1 = gc_buf2 = nullptr; + gc6_buf1 = gc6_buf2 = nullptr; ngc_buf1 = ngc_buf2 = ngc6_buf1 = ngc6_buf2 = 0; ngrid = ngrid_6 = npergrid = npergrid6 = 0; nmax = 0; - part2grid = NULL; - part2grid_6 = NULL; + part2grid = nullptr; + part2grid_6 = nullptr; memset(function,0,EWALD_FUNCS*sizeof(int)); } @@ -237,16 +237,16 @@ PPPMDisp::~PPPMDisp() { delete [] factors; delete [] B; - B = NULL; + B = nullptr; delete [] cii; - cii = NULL; + cii = nullptr; delete [] csumi; - csumi = NULL; + csumi = nullptr; deallocate(); deallocate_peratom(); memory->destroy(part2grid); memory->destroy(part2grid_6); - part2grid = part2grid_6 = NULL; + part2grid = part2grid_6 = nullptr; } /* ---------------------------------------------------------------------- @@ -295,9 +295,9 @@ void PPPMDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; - double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; + double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : nullptr; if (!(ptr||p_cutoff||p_cutoff_lj)) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -377,7 +377,7 @@ void PPPMDisp::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL) + if (force->angle == nullptr || force->bond == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -411,7 +411,7 @@ void PPPMDisp::init() int iteration = 0; if (function[0]) { - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; while (order >= minorder) { if (iteration && me == 0) @@ -492,7 +492,7 @@ void PPPMDisp::init() iteration = 0; if (function[1] + function[2] + function[3]) { - GridComm *gctmp = NULL; + GridComm *gctmp = nullptr; while (order_6 >= minorder) { if (iteration && me == 0) @@ -1281,14 +1281,14 @@ void PPPMDisp::init_coeffs() // local pair coeffs int n = atom->ntypes; int converged; delete [] B; - B = NULL; + B = nullptr; if (function[3] + function[2]) { // no mixing rule or arithmetic if (function[2] && me == 0) utils::logmesg(lmp," Optimizing splitting of Dispersion coefficients\n"); // allocate data for eigenvalue decomposition - double **A=NULL; - double **Q=NULL; + double **A=nullptr; + double **Q=nullptr; if ( n > 1 ) { // get dispersion coefficients double **b = (double **) force->pair->extract("B",tmp); @@ -2299,80 +2299,80 @@ void PPPMDisp::deallocate() memory->destroy3d_offset(vdy_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy3d_offset(vdz_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy(density_fft); - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; memory->destroy3d_offset(density_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_g); - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; memory->destroy3d_offset(density_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a0); - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; memory->destroy3d_offset(density_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a1); - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; memory->destroy3d_offset(density_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a2); - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; memory->destroy3d_offset(density_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a3); - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; memory->destroy3d_offset(density_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a4); - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; memory->destroy3d_offset(density_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a5); - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; memory->destroy3d_offset(density_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a6); - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; memory->destroy4d_offset(density_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdx_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdy_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdz_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_none); - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; memory->destroy(sf_precoeff1); memory->destroy(sf_precoeff2); @@ -2381,7 +2381,7 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff5); memory->destroy(sf_precoeff6); sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = - sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; memory->destroy(sf_precoeff1_6); memory->destroy(sf_precoeff2_6); @@ -2390,7 +2390,7 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff5_6); memory->destroy(sf_precoeff6_6); sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = - sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = NULL; + sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = nullptr; memory->destroy(greensfn); memory->destroy(greensfn_6); @@ -2402,45 +2402,45 @@ void PPPMDisp::deallocate() memory->destroy(vg2); memory->destroy(vg_6); memory->destroy(vg2_6); - greensfn = greensfn_6 = NULL; - work1 = work2 = work1_6 = work2_6 = NULL; - vg = vg2 = vg_6 = vg2_6 = NULL; + greensfn = greensfn_6 = nullptr; + work1 = work2 = work1_6 = work2_6 = nullptr; + vg = vg2 = vg_6 = vg2_6 = nullptr; memory->destroy1d_offset(fkx,nxlo_fft); memory->destroy1d_offset(fky,nylo_fft); memory->destroy1d_offset(fkz,nzlo_fft); - fkx = fky = fkz = NULL; + fkx = fky = fkz = nullptr; memory->destroy1d_offset(fkx2,nxlo_fft); memory->destroy1d_offset(fky2,nylo_fft); memory->destroy1d_offset(fkz2,nzlo_fft); - fkx2 = fky2 = fkz2 = NULL; + fkx2 = fky2 = fkz2 = nullptr; memory->destroy1d_offset(fkx_6,nxlo_fft_6); memory->destroy1d_offset(fky_6,nylo_fft_6); memory->destroy1d_offset(fkz_6,nzlo_fft_6); - fkx_6 = fky_6 = fkz_6 = NULL; + fkx_6 = fky_6 = fkz_6 = nullptr; memory->destroy1d_offset(fkx2_6,nxlo_fft_6); memory->destroy1d_offset(fky2_6,nylo_fft_6); memory->destroy1d_offset(fkz2_6,nzlo_fft_6); - fkx2_6 = fky2_6 = fkz2_6 = NULL; + fkx2_6 = fky2_6 = fkz2_6 = nullptr; memory->destroy(gf_b); memory->destroy2d_offset(rho1d,-order/2); memory->destroy2d_offset(rho_coeff,(1-order)/2); memory->destroy2d_offset(drho1d,-order/2); memory->destroy2d_offset(drho_coeff, (1-order)/2); - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; memory->destroy(gf_b_6); memory->destroy2d_offset(rho1d_6,-order_6/2); memory->destroy2d_offset(rho_coeff_6,(1-order_6)/2); memory->destroy2d_offset(drho1d_6,-order_6/2); memory->destroy2d_offset(drho_coeff_6,(1-order_6)/2); - gf_b_6 = NULL; - rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = NULL; + gf_b_6 = nullptr; + rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = nullptr; memory->destroy(gc_buf1); memory->destroy(gc_buf2); @@ -2474,7 +2474,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick, nzlo_out, nylo_out, nxlo_out); memory->destroy3d_offset(v5_brick, nzlo_out, nylo_out, nxlo_out); u_brick = v0_brick = v1_brick = v2_brick = - v3_brick = v4_brick = v5_brick = NULL; + v3_brick = v4_brick = v5_brick = nullptr; memory->destroy3d_offset(u_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2484,7 +2484,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = - v3_brick_g = v4_brick_g = v5_brick_g = NULL; + v3_brick_g = v4_brick_g = v5_brick_g = nullptr; memory->destroy3d_offset(u_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2494,7 +2494,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = - v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = NULL; + v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = nullptr; memory->destroy3d_offset(u_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2504,7 +2504,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = - v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = NULL; + v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = nullptr; memory->destroy3d_offset(u_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2513,7 +2513,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = NULL; + u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = nullptr; memory->destroy3d_offset(u_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2522,7 +2522,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = NULL; + u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = nullptr; memory->destroy3d_offset(u_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2532,7 +2532,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = - v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = NULL; + v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = nullptr; memory->destroy3d_offset(u_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2542,7 +2542,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = - v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = NULL; + v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = nullptr; memory->destroy3d_offset(u_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2552,7 +2552,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v4_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = - v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = NULL; + v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = nullptr; memory->destroy4d_offset(u_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v0_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2562,7 +2562,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy4d_offset(v4_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v5_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = - v3_brick_none = v4_brick_none = v5_brick_none = NULL; + v3_brick_none = v4_brick_none = v5_brick_none = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp index f71529ae8..afdc97e37 100644 --- a/src/KSPACE/pppm_stagger.cpp +++ b/src/KSPACE/pppm_stagger.cpp @@ -50,7 +50,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; PPPMStagger::PPPMStagger(LAMMPS *lmp) : PPPM(lmp), - gf_b2(NULL) + gf_b2(nullptr) { stagger_flag = 1; group_group_enable = 0; diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index d4cfdea2b..41ba1a678 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -252,7 +252,7 @@ struct remap_plan_3d *remap_3d_create_plan( // allocate memory for plan data struct plan = (struct remap_plan_3d *) malloc(sizeof(struct remap_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; // store parameters in local data structs @@ -284,10 +284,10 @@ struct remap_plan_3d *remap_3d_create_plan( // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -313,8 +313,8 @@ struct remap_plan_3d *remap_3d_create_plan( plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -395,9 +395,9 @@ struct remap_plan_3d *remap_3d_create_plan( plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -456,7 +456,7 @@ struct remap_plan_3d *remap_3d_create_plan( // create sub-comm rank list if (plan->usecollective) { - plan->commringlist = NULL; + plan->commringlist = nullptr; // merge recv and send rank lists // ask Steve Plimpton about method to more accurately determine @@ -578,7 +578,7 @@ struct remap_plan_3d *remap_3d_create_plan( // find biggest send message (not including self) and malloc space for it - plan->sendbuf = NULL; + plan->sendbuf = nullptr; size = 0; for (nsend = 0; nsend < plan->nsend; nsend++) @@ -586,20 +586,20 @@ struct remap_plan_3d *remap_3d_create_plan( if (size) { plan->sendbuf = (FFT_SCALAR *) malloc(size*sizeof(FFT_SCALAR)); - if (plan->sendbuf == NULL) return NULL; + if (plan->sendbuf == nullptr) return nullptr; } // if requested, allocate internal scratch space for recvs, // only need it if I will receive any data (including self) - plan->scratch = NULL; + plan->scratch = nullptr; if (memory == 1) { if (nrecv > 0) { plan->scratch = (FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize * sizeof(FFT_SCALAR)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } } @@ -643,7 +643,7 @@ void remap_3d_destroy_plan(struct remap_plan_3d *plan) MPI_Comm_free(&plan->comm); if (plan->usecollective) { - if (plan->commringlist != NULL) + if (plan->commringlist != nullptr) free(plan->commringlist); } diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp index 4aaaa1329..de8533947 100644 --- a/src/KSPACE/remap_wrap.cpp +++ b/src/KSPACE/remap_wrap.cpp @@ -31,7 +31,7 @@ Remap::Remap(LAMMPS *lmp, MPI_Comm comm, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 7d4e89272..0581f1e35 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,10 +74,10 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // NULL means LATTE will compute Coulombic potential + // nullptr means LATTE will compute Coulombic potential coulomb = 0; - id_pe = NULL; + id_pe = nullptr; if (strcmp(arg[3],"NULL") != 0) { coulomb = 1; @@ -97,8 +97,8 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : // initializations nmax = 0; - qpotential = NULL; - flatte = NULL; + qpotential = nullptr; + flatte = nullptr; latte_energy = 0.0; } @@ -136,7 +136,7 @@ void FixLatte::init() error->all(FLERR,"Fix latte requires 3d problem"); if (coulomb) { - if (atom->q_flag == 0 || force->pair == NULL || force->kspace == NULL) + if (atom->q_flag == 0 || force->pair == nullptr || force->kspace == nullptr) error->all(FLERR,"Fix latte cannot compute Coulomb potential"); int ipe = modify->find_compute(id_pe); @@ -154,7 +154,7 @@ void FixLatte::init() // create qpotential & flatte if needed // for now, assume nlocal will never change - if (coulomb && qpotential == NULL) { + if (coulomb && qpotential == nullptr) { memory->create(qpotential,atom->nlocal,"latte:qpotential"); memory->create(flatte,atom->nlocal,3,"latte:flatte"); } diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 54169d08d..bddec9e2e 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -39,7 +39,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), comb(NULL), comb3(NULL), qf(NULL), q1(NULL), q2(NULL) + fp(nullptr), comb(nullptr), comb3(nullptr), qf(nullptr), q1(nullptr), q2(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command"); @@ -65,7 +65,7 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,std::string("Cannot open fix qeq/comb file ") + arg[iarg+1]); } @@ -85,8 +85,8 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) qf[i] = 0.0; - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; comm_forward = 1; } @@ -121,7 +121,7 @@ void FixQEQComb::init() comb = (PairComb *) force->pair_match("^comb",0); comb3 = (PairComb3 *) force->pair_match("^comb3",0); - if (comb == NULL && comb3 == NULL) + if (comb == nullptr && comb3 == nullptr) error->all(FLERR,"Must use pair_style comb or comb3 with fix qeq/comb"); if (utils::strmatch(update->integrate_style,"^respa")) { diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index ff30ac7b1..4eeab8938 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -41,25 +41,25 @@ PairADP::PairADP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nmax = 0; - rho = NULL; - fp = NULL; - mu = NULL; - lambda = NULL; - map = NULL; - - setfl = NULL; - - frho = NULL; - rhor = NULL; - z2r = NULL; - u2r = NULL; - w2r = NULL; - - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; - u2r_spline = NULL; - w2r_spline = NULL; + rho = nullptr; + fp = nullptr; + mu = nullptr; + lambda = nullptr; + map = nullptr; + + setfl = nullptr; + + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + u2r = nullptr; + w2r = nullptr; + + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; + u2r_spline = nullptr; + w2r_spline = nullptr; // set comm size needed by this Pair @@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 7ab2eaa27..8643f5481 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -61,13 +61,13 @@ PairAIREBO::PairAIREBO(LAMMPS *lmp) pvector = new double[nextra]; maxlocal = 0; - REBO_numneigh = NULL; - REBO_firstneigh = NULL; - ipage = NULL; + REBO_numneigh = nullptr; + REBO_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - nC = nH = NULL; - map = NULL; + nC = nH = nullptr; + map = nullptr; manybody_flag = 1; sigwid = 0.84; @@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to C and H - // map[i] = which element (0,1) the Ith atom type is, -1 if NULL + // map[i] = which element (0,1) the Ith atom type is, -1 if nullptr for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -245,7 +245,7 @@ void PairAIREBO::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index ab02533ce..d605ddc2d 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -40,7 +40,7 @@ class PairAIREBO : public Pair { enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code protected: - int *map; // 0 (C), 1 (H), or -1 (NULL) for each type + int *map; // 0 (C), 1 (H), or -1 (nullptr) for each type int variant; int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index 2a69e70b8..a6bf0ac40 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -311,10 +311,10 @@ void PairATM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) for (k = j; k <= atom->ntypes; k++) { - if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&nu[i][j][k],1,MPI_DOUBLE,0,world); } } @@ -339,8 +339,8 @@ void PairATM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_triple,1,MPI_DOUBLE,0,world); diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index e7c2f6467..4c7d30e45 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -64,114 +64,114 @@ PairBOP::PairBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; allocated = 0; - BOP_index = NULL; - BOP_index3 = NULL; - BOP_total = NULL; - BOP_total3 = NULL; - map = NULL; - pi_a = NULL; - pro_delta = NULL; - pi_delta = NULL; - pi_p = NULL; - pi_c = NULL; - r1 = NULL; - sigma_r0 = NULL; - pi_r0 = NULL; - phi_r0 = NULL; - sigma_rc = NULL; - pi_rc = NULL; - phi_rc = NULL; - sigma_beta0 = NULL; - pi_beta0 = NULL; - phi0 = NULL; - sigma_n = NULL; - pi_n = NULL; - phi_m = NULL; - sigma_nc = NULL; - pi_nc = NULL; - phi_nc = NULL; - pro = NULL; - sigma_delta = NULL; - sigma_c = NULL; - sigma_a = NULL; - sigma_f = NULL; - sigma_k = NULL; - small3 = NULL; - rcut = NULL; - rcut3 = NULL; - rcutsq = NULL; - rcutsq3 = NULL; - dr = NULL; - rdr = NULL; - dr3 = NULL; - rdr3 = NULL; - disij = NULL; - rij = NULL; - neigh_index = NULL; - neigh_index3 = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - cosAng = NULL; - betaS = NULL; - dBetaS = NULL; - betaP = NULL; - dBetaP = NULL; - repul = NULL; - dRepul = NULL; - itypeSigBk = NULL; - itypePiBk = NULL; - pBetaS = NULL; - pBetaS1 = NULL; - pBetaS2 = NULL; - pBetaS3 = NULL; - pBetaS4 = NULL; - pBetaS5 = NULL; - pBetaS6 = NULL; - pLong = NULL; - pLong1 = NULL; - pLong2 = NULL; - pLong3 = NULL; - pLong4 = NULL; - pLong5 = NULL; - pLong6 = NULL; - pBetaP = NULL; - pBetaP1 = NULL; - pBetaP2 = NULL; - pBetaP3 = NULL; - pBetaP4 = NULL; - pBetaP5 = NULL; - pBetaP6 = NULL; - pRepul = NULL; - pRepul1 = NULL; - pRepul2 = NULL; - pRepul3 = NULL; - pRepul4 = NULL; - pRepul5 = NULL; - pRepul6 = NULL; - FsigBO = NULL; - FsigBO1 = NULL; - FsigBO2 = NULL; - FsigBO3 = NULL; - FsigBO4 = NULL; - FsigBO5 = NULL; - FsigBO6 = NULL; - rcmin = NULL; - rcmax = NULL; - rcmaxp = NULL; - setflag = NULL; - cutsq = NULL; - cutghost = NULL; - - gfunc = NULL; - gfunc1 = NULL; - gfunc2 = NULL; - gfunc3 = NULL; - gfunc4 = NULL; - gfunc5 = NULL; - gfunc6 = NULL; - gpara = NULL; - bt_sg=NULL; - bt_pi=NULL; + BOP_index = nullptr; + BOP_index3 = nullptr; + BOP_total = nullptr; + BOP_total3 = nullptr; + map = nullptr; + pi_a = nullptr; + pro_delta = nullptr; + pi_delta = nullptr; + pi_p = nullptr; + pi_c = nullptr; + r1 = nullptr; + sigma_r0 = nullptr; + pi_r0 = nullptr; + phi_r0 = nullptr; + sigma_rc = nullptr; + pi_rc = nullptr; + phi_rc = nullptr; + sigma_beta0 = nullptr; + pi_beta0 = nullptr; + phi0 = nullptr; + sigma_n = nullptr; + pi_n = nullptr; + phi_m = nullptr; + sigma_nc = nullptr; + pi_nc = nullptr; + phi_nc = nullptr; + pro = nullptr; + sigma_delta = nullptr; + sigma_c = nullptr; + sigma_a = nullptr; + sigma_f = nullptr; + sigma_k = nullptr; + small3 = nullptr; + rcut = nullptr; + rcut3 = nullptr; + rcutsq = nullptr; + rcutsq3 = nullptr; + dr = nullptr; + rdr = nullptr; + dr3 = nullptr; + rdr3 = nullptr; + disij = nullptr; + rij = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + cosAng = nullptr; + betaS = nullptr; + dBetaS = nullptr; + betaP = nullptr; + dBetaP = nullptr; + repul = nullptr; + dRepul = nullptr; + itypeSigBk = nullptr; + itypePiBk = nullptr; + pBetaS = nullptr; + pBetaS1 = nullptr; + pBetaS2 = nullptr; + pBetaS3 = nullptr; + pBetaS4 = nullptr; + pBetaS5 = nullptr; + pBetaS6 = nullptr; + pLong = nullptr; + pLong1 = nullptr; + pLong2 = nullptr; + pLong3 = nullptr; + pLong4 = nullptr; + pLong5 = nullptr; + pLong6 = nullptr; + pBetaP = nullptr; + pBetaP1 = nullptr; + pBetaP2 = nullptr; + pBetaP3 = nullptr; + pBetaP4 = nullptr; + pBetaP5 = nullptr; + pBetaP6 = nullptr; + pRepul = nullptr; + pRepul1 = nullptr; + pRepul2 = nullptr; + pRepul3 = nullptr; + pRepul4 = nullptr; + pRepul5 = nullptr; + pRepul6 = nullptr; + FsigBO = nullptr; + FsigBO1 = nullptr; + FsigBO2 = nullptr; + FsigBO3 = nullptr; + FsigBO4 = nullptr; + FsigBO5 = nullptr; + FsigBO6 = nullptr; + rcmin = nullptr; + rcmax = nullptr; + rcmaxp = nullptr; + setflag = nullptr; + cutsq = nullptr; + cutghost = nullptr; + + gfunc = nullptr; + gfunc1 = nullptr; + gfunc2 = nullptr; + gfunc3 = nullptr; + gfunc4 = nullptr; + gfunc5 = nullptr; + gfunc6 = nullptr; + gpara = nullptr; + bt_sg=nullptr; + bt_pi=nullptr; } /* ---------------------------------------------------------------------- @@ -5627,12 +5627,12 @@ void PairBOP::memory_theta_destroy() memory->destroy(neigh_flag3); memory->destroy(neigh_index); memory->destroy(neigh_index3); - itypeSigBk = NULL; - itypePiBk = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - neigh_index = NULL; - neigh_index3 = NULL; + itypeSigBk = nullptr; + itypePiBk = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; if(otfly==0) { memory->destroy(cosAng); memory->destroy(dcAng); @@ -5680,7 +5680,7 @@ void PairBOP::grow_pi(int n1, int n2) } } memory->destroy(bt_pi); - bt_pi=NULL; + bt_pi=nullptr; bt_pi = (B_PI *) memory->smalloc(n2*sizeof(B_PI),"BOP:bt_pi"); for(i=0;idestroy(bt_sg); - bt_sg=NULL; + bt_sg=nullptr; bt_sg = (B_SG *) memory->smalloc(n2*sizeof(B_SG),"BOP:bt_sg"); for(i=0;iall(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -465,7 +465,7 @@ void PairComb::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -542,7 +542,7 @@ void PairComb::init_style() //for (i = 0; i < modify->nfix; i++) // if (strcmp(modify->fix[i]->style,"qeq") == 0) break; //if (i < modify->nfix) fixqeq = (FixQEQ *) modify->fix[i]; - //else fixqeq = NULL; + //else fixqeq = nullptr; // need a full neighbor list @@ -554,7 +554,7 @@ void PairComb::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 265d30c6f..fd4f1b382 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -54,38 +54,38 @@ PairComb3::PairComb3(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nmax = 0; - NCo = NULL; - bbij = NULL; - map = NULL; - esm = NULL; + NCo = nullptr; + bbij = nullptr; + map = nullptr; + esm = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; - - intype = NULL; - afb = NULL; - dafb = NULL; - fafb = NULL; - dfafb = NULL; - ddfafb = NULL; - phin = NULL; - dphin = NULL; - erpaw = NULL; - vvdw = NULL; - vdvdw = NULL; - dpl = NULL; - xcctmp = NULL; - xchtmp = NULL; - xcotmp = NULL; - - sht_num = NULL; - sht_first = NULL; - - ipage = NULL; + params = nullptr; + elem2param = nullptr; + + intype = nullptr; + afb = nullptr; + dafb = nullptr; + fafb = nullptr; + dfafb = nullptr; + ddfafb = nullptr; + phin = nullptr; + dphin = nullptr; + erpaw = nullptr; + vvdw = nullptr; + vdvdw = nullptr; + dpl = nullptr; + xcctmp = nullptr; + xchtmp = nullptr; + xcotmp = nullptr; + + sht_num = nullptr; + sht_first = nullptr; + + ipage = nullptr; pgsize = oneatom = 0; cflag = 0; @@ -192,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -201,7 +201,7 @@ void PairComb3::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -277,7 +277,7 @@ void PairComb3::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 999384ea2..ac96c040b 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -46,26 +46,26 @@ PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nmax = 0; - rho = NULL; - fp = NULL; - numforce = NULL; - map = NULL; - type2frho = NULL; + rho = nullptr; + fp = nullptr; + numforce = nullptr; + map = nullptr; + type2frho = nullptr; nfuncfl = 0; - funcfl = NULL; + funcfl = nullptr; - setfl = NULL; - fs = NULL; + setfl = nullptr; + fs = nullptr; - frho = NULL; - rhor = NULL; - z2r = NULL; - scale = NULL; + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + scale = nullptr; - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; // set comm size needed by this Pair @@ -90,8 +90,8 @@ PairEAM::~PairEAM() memory->destroy(cutsq); delete [] map; delete [] type2frho; - map = NULL; - type2frho = NULL; + map = nullptr; + type2frho = nullptr; memory->destroy(type2rhor); memory->destroy(type2z2r); memory->destroy(scale); @@ -105,7 +105,7 @@ PairEAM::~PairEAM() memory->destroy(funcfl[i].zr); } memory->sfree(funcfl); - funcfl = NULL; + funcfl = nullptr; } if (setfl) { @@ -116,7 +116,7 @@ PairEAM::~PairEAM() memory->destroy(setfl->rhor); memory->destroy(setfl->z2r); delete setfl; - setfl = NULL; + setfl = nullptr; } if (fs) { @@ -127,7 +127,7 @@ PairEAM::~PairEAM() memory->destroy(fs->rhor); memory->destroy(fs->z2r); delete fs; - fs = NULL; + fs = nullptr; } memory->destroy(frho); @@ -937,5 +937,5 @@ void *PairEAM::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index d30f46aa3..055a2baf1 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -70,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index dc36c7327..01ec02dd2 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -44,9 +44,9 @@ PairEAMCD::PairEAMCD(LAMMPS *lmp, int _cdeamVersion) restartinfo = 0; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - rhoB = NULL; - D_values = NULL; - hcoeff = NULL; + rhoB = nullptr; + D_values = nullptr; + hcoeff = nullptr; // Set communication buffer sizes needed by this pair style. @@ -505,14 +505,14 @@ void PairEAMCD::read_h_coeff(char *filename) char nextline[MAXLINE]; int convert_flag = unit_convert_flag; fptr = utils::open_potential(filename, lmp, &convert_flag); - if (fptr == NULL) + if (fptr == nullptr) error->one(FLERR,fmt::format("Cannot open EAMCD potential file {}", filename)); // h coefficients are stored at the end of the file. // Skip to last line of file. - while(fgets(nextline, MAXLINE, fptr) != NULL) { + while(fgets(nextline, MAXLINE, fptr) != nullptr) { strcpy(line, nextline); } diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index ee84fb09c..8f306d101 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -49,7 +49,7 @@ public: /// Reports the memory usage of this pair style to LAMMPS. double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. void read_h_coeff(char* filename); diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index dd45d12da..90c24bb25 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -70,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index cb5a95faa..69e2832b3 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -41,25 +41,25 @@ PairEIM::PairEIM(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - setfl = NULL; + setfl = nullptr; nmax = 0; - rho = NULL; - fp = NULL; - map = NULL; + rho = nullptr; + fp = nullptr; + map = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; - negativity = NULL; - q0 = NULL; - cutforcesq = NULL; - Fij = NULL; - Gij = NULL; - phiij = NULL; + negativity = nullptr; + q0 = nullptr; + cutforcesq = nullptr; + Fij = nullptr; + Gij = nullptr; + phiij = nullptr; - Fij_spline = NULL; - Gij_spline = NULL; - phiij_spline = NULL; + Fij_spline = nullptr; + Gij_spline = nullptr; + phiij_spline = nullptr; // set comm size needed by this Pair @@ -388,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg) read_file(arg[2+nelements]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3 + nelements; i < narg; i++) { m = i - (3+nelements) + 1; @@ -1062,7 +1062,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp, FILE *fp = utils::open_potential(filename, lmp, &unit_convert); conversion_factor = utils::get_conversion_factor(utils::ENERGY,unit_convert); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR, fmt::format("cannot open eim potential file {}", filename)); } diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index 051c30f87..dd9b55b7b 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -51,11 +51,11 @@ PairGW::PairGW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -292,7 +292,7 @@ void PairGW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -370,7 +370,7 @@ double PairGW::init_one(int i, int j) void PairGW::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 diff --git a/src/MANYBODY/pair_gw_zbl.cpp b/src/MANYBODY/pair_gw_zbl.cpp index ee3bebda1..69c677d0c 100644 --- a/src/MANYBODY/pair_gw_zbl.cpp +++ b/src/MANYBODY/pair_gw_zbl.cpp @@ -61,7 +61,7 @@ PairGWZBL::PairGWZBL(LAMMPS *lmp) : PairGW(lmp) void PairGWZBL::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index d2e478b37..c84361d7a 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -48,13 +48,13 @@ PairLCBOP::PairLCBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - N = NULL; - M = NULL; + N = nullptr; + M = nullptr; } /* ---------------------------------------------------------------------- @@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg) if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // read args that map atom types to C and NULL - // map[i] = which element (0 for C) the Ith atom type is, -1 if NULL + // read args that map atom types to C and nullptr + // map[i] = which element (0 for C) the Ith atom type is, -1 if nullptr for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -193,7 +193,7 @@ void PairLCBOP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -970,7 +970,7 @@ void PairLCBOP::read_file(char *filename) if (me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open LCBOP potential file %s",filename); error->one(FLERR,str); diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index c7a7fab46..9ca2e3d55 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -39,7 +39,7 @@ class PairLCBOP : public Pair { protected: int **pages; // neighbor list pages - int *map; // 0 (C) or -1 (NULL) for each type + int *map; // 0 (C) or -1 (nullptr) for each type int me; diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index 0a197a157..a361955fa 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -50,11 +50,11 @@ PairNb3bHarmonic::PairNb3bHarmonic(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -207,7 +207,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index 0f7fd7a1c..cdf9a7f23 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -479,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -909,7 +909,7 @@ void PairPolymorphic::write_tables(int npts) { char tag[6] = ""; if (comm->me != 0) sprintf(tag,"%d",comm->me); - FILE* fp = NULL; + FILE* fp = nullptr; double xmin,xmax,x,uf,vf,wf,pf,gf,ff,ufp,vfp,wfp,pfp,gfp,ffp; char line[MAXLINE]; for (int i = 0; i < nelements; i++) { diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 2deb45ac7..9db9adf42 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -46,14 +46,14 @@ PairSW::PairSW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -262,7 +262,7 @@ void PairSW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -271,7 +271,7 @@ void PairSW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index c08c722e5..21a8f7de6 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -50,14 +50,14 @@ PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -306,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -315,7 +315,7 @@ void PairTersoff::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index 63765234b..fea414f5f 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -48,15 +48,15 @@ PairVashishta::PairVashishta(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; r0max = 0.0; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -278,7 +278,7 @@ void PairVashishta::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index 5e0c2c16f..8939efc78 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; PairVashishtaTable::PairVashishtaTable(LAMMPS *lmp) : PairVashishta(lmp) { - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; } /* ---------------------------------------------------------------------- @@ -252,8 +252,8 @@ void PairVashishtaTable::create_tables() { memory->destroy(forceTable); memory->destroy(potentialTable); - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; tabinnersq = tabinner*tabinner; diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index f786179aa..217646b92 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -50,10 +50,10 @@ using namespace FixConst; FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), type_list(NULL), mu(NULL), qtype(NULL), - sqrt_mass_ratio(NULL), local_swap_iatom_list(NULL), - local_swap_jatom_list(NULL), local_swap_atom_list(NULL), - random_equal(NULL), random_unequal(NULL), c_pe(NULL) + idregion(nullptr), type_list(nullptr), mu(nullptr), qtype(nullptr), + sqrt_mass_ratio(nullptr), local_swap_iatom_list(nullptr), + local_swap_jatom_list(nullptr), local_swap_atom_list(nullptr), + random_equal(nullptr), random_unequal(nullptr), c_pe(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix atom/swap command"); @@ -105,9 +105,9 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : nswap_successes = 0.0; atom_swap_nmax = 0; - local_swap_atom_list = NULL; - local_swap_iatom_list = NULL; - local_swap_jatom_list = NULL; + local_swap_atom_list = nullptr; + local_swap_iatom_list = nullptr; + local_swap_jatom_list = nullptr; // set comm size needed by this Fix diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 8a7cd20b0..a024bc20d 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -33,8 +33,8 @@ using namespace FixConst; FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - partner(NULL), finalpartner(NULL), distsq(NULL), probability(NULL), - broken(NULL), copy(NULL), random(NULL) + partner(nullptr), finalpartner(nullptr), distsq(nullptr), probability(nullptr), + broken(nullptr), copy(nullptr), random(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix bond/break command"); diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index a2c2eee2c..e485d370d 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -40,8 +40,8 @@ using namespace MathConst; FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - bondcount(NULL), partner(NULL), finalpartner(NULL), distsq(NULL), - probability(NULL), created(NULL), copy(NULL), random(NULL), list(NULL) + bondcount(nullptr), partner(nullptr), finalpartner(nullptr), distsq(nullptr), + probability(nullptr), created(nullptr), copy(nullptr), random(nullptr), list(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix bond/create command"); @@ -163,7 +163,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // register with Atom class // bondcount values will be initialized in setup() - bondcount = NULL; + bondcount = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); countflag = 0; @@ -177,11 +177,11 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; maxcreate = 0; - created = NULL; + created = nullptr; // copy = special list for one atom // size = ms^2 + ms is sufficient @@ -237,7 +237,7 @@ void FixBondCreate::init() // check cutoff for iatomtype,jatomtype - if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype]) + if (force->pair == nullptr || cutsq > force->pair->cutsq[iatomtype][jatomtype]) error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff"); // warn if more than one fix bond/create or also a fix bond/break diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 270a49777..9b1f14516 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -52,8 +52,8 @@ static const char cite_fix_bond_swap[] = FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tflag(0), alist(NULL), id_temp(NULL), type(NULL), x(NULL), list(NULL), - temperature(NULL), random(NULL) + tflag(0), alist(nullptr), id_temp(nullptr), type(nullptr), x(nullptr), list(nullptr), + temperature(nullptr), random(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_swap); @@ -96,7 +96,7 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : // initialize atom list nmax = 0; - alist = NULL; + alist = nullptr; naccept = foursome = 0; } @@ -130,7 +130,7 @@ void FixBondSwap::init() { // require an atom style with molecule IDs - if (atom->molecule == NULL) + if (atom->molecule == nullptr) error->all(FLERR, "Must use atom style with molecule IDs with fix bond/swap"); @@ -143,13 +143,13 @@ void FixBondSwap::init() // no dihedral or improper potentials allowed // special bonds must be 0 1 1 - if (force->pair == NULL || force->bond == NULL) + if (force->pair == nullptr || force->bond == nullptr) error->all(FLERR,"Fix bond/swap requires pair and bond styles"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support fix bond/swap"); - if (force->angle == NULL && atom->nangles > 0 && comm->me == 0) + if (force->angle == nullptr && atom->nangles > 0 && comm->me == 0) error->warning(FLERR,"Fix bond/swap will ignore defined angles"); if (force->dihedral || force->improper) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index fc306696e..670a1ff58 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -66,10 +66,10 @@ enum{MOVEATOM,MOVEMOL}; // movemode FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), ngroups(0), groupstrings(NULL), ngrouptypes(0), grouptypestrings(NULL), - grouptypebits(NULL), grouptypes(NULL), local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL), random_unequal(NULL), - fixrigid(NULL), fixshake(NULL), idrigid(NULL), idshake(NULL) + idregion(nullptr), full_flag(0), ngroups(0), groupstrings(nullptr), ngrouptypes(0), grouptypestrings(nullptr), + grouptypebits(nullptr), grouptypes(nullptr), local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr), random_unequal(nullptr), + fixrigid(nullptr), fixshake(nullptr), idrigid(nullptr), idshake(nullptr) { if (narg < 11) error->all(FLERR,"Illegal fix gcmc command"); @@ -167,7 +167,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix gcmc molecule must have atom types"); if (ngcmc_type != 0) error->all(FLERR,"Atom type must be zero in fix gcmc mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) + if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix gcmc molecule has charges, but atom style does not"); if (atom->molecular == 2 && onemols != atom->avec->onemols) @@ -176,7 +176,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix gcmc atom has charge, but atom style does not"); if (rigidflag && exchmode == EXCHATOM) @@ -219,7 +219,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : ninsertion_successes = 0.0; gcmc_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -258,12 +258,12 @@ void FixGCMC::options(int narg, char **arg) full_flag = false; ngroups = 0; int ngroupsmax = 0; - groupstrings = NULL; + groupstrings = nullptr; ngrouptypes = 0; int ngrouptypesmax = 0; - grouptypestrings = NULL; - grouptypes = NULL; - grouptypebits = NULL; + grouptypestrings = nullptr; + grouptypes = nullptr; + grouptypebits = nullptr; energy_intra = 0.0; tfac_insert = 1.0; overlap_cutoffsq = 0.0; @@ -481,7 +481,7 @@ void FixGCMC::init() if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("^hybrid",0)) || (force->pair_match("^eam",0)) || @@ -542,7 +542,7 @@ void FixGCMC::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix gcmc rigid fix does not exist"); @@ -557,7 +557,7 @@ void FixGCMC::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix gcmc shake fix does not exist"); diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index b855c0b79..20b72dc26 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -37,7 +37,7 @@ using namespace FixConst; FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xd(NULL), rotflag(0), random_num(NULL) + xd(nullptr), rotflag(0), random_num(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tfmc command"); @@ -83,7 +83,7 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : comflag = 0; if (rotflag) { - xd = NULL; + xd = nullptr; nmax = -1; } @@ -97,7 +97,7 @@ FixTFMC::~FixTFMC() delete random_num; if (rotflag) { memory->destroy(xd); - xd = NULL; + xd = nullptr; nmax = -1; } } diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 94b248174..919cf6d3c 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -58,9 +58,9 @@ enum{EXCHATOM,EXCHMOL}; // exchmode FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), - local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL) + idregion(nullptr), full_flag(0), + local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix Widom command"); @@ -151,7 +151,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix Widom molecule must have atom types"); if (nwidom_type != 0) error->all(FLERR,"Atom type must be zero in fix Widom mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) + if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix Widom molecule has charges, but atom style does not"); if (atom->molecular == 2 && onemols != atom->avec->onemols) @@ -160,7 +160,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix Widom atom has charge, but atom style does not"); // setup of array of coordinates for molecule insertion @@ -177,7 +177,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : // zero out counters widom_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -283,7 +283,7 @@ void FixWidom::init() // decide whether to switch to the full_energy option if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("hybrid",0)) || (force->pair_match("eam",0)) || diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 588d57f32..f4bac9b8c 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -38,8 +38,8 @@ PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp) total_number_of_collisions = 0; max_particles = max_particle_list = 0; - next_particle = NULL; - random = NULL; + next_particle = nullptr; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -342,12 +342,12 @@ void PairDSMC::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -375,11 +375,11 @@ void PairDSMC::write_restart_settings(FILE *fp) void PairDSMC::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 1cbce3a7f..aee8b2a06 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -62,7 +62,7 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : box[0][2] = box[1][2] = box[2][0] = box[2][1] = box[2][2] = 0.0; maxatom = 0; - xpbc = NULL; + xpbc = nullptr; // unit conversion factors for REAL // otherwise not needed diff --git a/src/MESSAGE/message.cpp b/src/MESSAGE/message.cpp index b83be0339..b43a2686a 100644 --- a/src/MESSAGE/message.cpp +++ b/src/MESSAGE/message.cpp @@ -116,6 +116,6 @@ void Message::quit() // clean-up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; lmp->clientserver = 0; } diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp index af7850a0e..44e4a628a 100644 --- a/src/MESSAGE/server_mc.cpp +++ b/src/MESSAGE/server_mc.cpp @@ -77,7 +77,7 @@ void ServerMC::loop() cs->send(msgID,2); cs->pack_double(1,dval); - double *coords = NULL; + double *coords = nullptr; if (atom->nlocal) coords = &atom->x[0][0]; cs->pack_parallel(2,4,atom->nlocal,atom->tag,3,coords); @@ -143,5 +143,5 @@ void ServerMC::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp index 418162e5d..d2bbb088b 100644 --- a/src/MESSAGE/server_md.cpp +++ b/src/MESSAGE/server_md.cpp @@ -64,7 +64,7 @@ ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) pconvert = 1.0 / 0.986923; // atmospheres -> bars } - fcopy = NULL; + fcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -107,15 +107,15 @@ void ServerMD::loop() if (msgID == SETUP) { int dim = 0; - int *periodicity = NULL; + int *periodicity = nullptr; int natoms = -1; int ntypes = -1; - double *origin = NULL; - double *box = NULL; - int *types = NULL; - double *coords = NULL; - char *unit_style = NULL; - double *charge = NULL; + double *origin = nullptr; + double *box = nullptr; + int *types = nullptr; + double *coords = nullptr; + char *unit_style = nullptr; + double *charge = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == DIM) { @@ -185,7 +185,7 @@ void ServerMD::loop() int nlocal = 0; for (int i = 0; i < natoms; i++) { - if (!domain->ownatom(i+1,&coords[3*i],NULL,0)) continue; + if (!domain->ownatom(i+1,&coords[3*i],nullptr,0)) continue; atom->avec->create_atom(types[i],&coords[3*i]); atom->tag[nlocal] = i+1; if (charge) atom->q[nlocal] = charge[i]; @@ -226,9 +226,9 @@ void ServerMD::loop() } else if (msgID == STEP) { - double *coords = NULL; - double *origin = NULL; - double *box = NULL; + double *coords = nullptr; + double *origin = nullptr; + double *box = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == COORDS) { @@ -314,7 +314,7 @@ void ServerMD::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } /* ---------------------------------------------------------------------- @@ -349,7 +349,7 @@ void ServerMD::send_fev(int msgID) cs->send(msgID,3); - double *forces = NULL; + double *forces = nullptr; if (atom->nlocal) { if (units != REAL) forces = &atom->f[0][0]; else { diff --git a/src/MISC/compute_ti.cpp b/src/MISC/compute_ti.cpp index d8be8679c..f984aeac2 100644 --- a/src/MISC/compute_ti.cpp +++ b/src/MISC/compute_ti.cpp @@ -36,8 +36,8 @@ enum{PAIR,TAIL,KSPACE}; /* ---------------------------------------------------------------------- */ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), nterms(0), which(NULL), ivar1(NULL), ivar2(NULL), - ilo(NULL), ihi(NULL), var1(NULL), var2(NULL), pptr(NULL), pstyle(NULL) + Compute(lmp, narg, arg), nterms(0), which(nullptr), ivar1(nullptr), ivar2(nullptr), + ilo(nullptr), ihi(nullptr), var1(nullptr), var2(nullptr), pptr(nullptr), pstyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute ti command"); @@ -64,7 +64,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : pptr = new Pair*[nterms]; pstyle = new char*[nterms]; - for (int m = 0; m < nterms; m++) pstyle[m] = NULL; + for (int m = 0; m < nterms; m++) pstyle[m] = nullptr; // parse keywords @@ -136,16 +136,16 @@ void ComputeTI::init() if (which[m] == PAIR) { pptr[m] = force->pair_match(pstyle[m],1); - if (pptr[m] == NULL) + if (pptr[m] == nullptr) error->all(FLERR,"Compute ti pair style does not exist"); } else if (which[m] == TAIL) { - if (force->pair == NULL || force->pair->tail_flag == 0) + if (force->pair == nullptr || force->pair->tail_flag == 0) error->all(FLERR,"Compute ti tail when pair style does not " "compute tail corrections"); } else if (which[m] == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Compute ti kspace style does not exist"); } } diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 9f2bbfe42..5c3ca7264 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -53,7 +53,7 @@ int xdr3dfcoord(XDR *, float *, int *, float *); /* ---------------------------------------------------------------------- */ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xtc command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), size_one = 3; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; precision = 1000.0; @@ -137,9 +137,9 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to NULL so parent dump class will not use it + // set fp to nullptr so parent dump class will not use it - fp = NULL; + fp = nullptr; if (me == 0) if (xdropen(&xd,filename,"w") == 0) error->one(FLERR,"Cannot open dump file"); } @@ -364,8 +364,8 @@ void DumpXTC::write_frame() static FILE *xdrfiles[MAXID]; static XDR *xdridptr[MAXID]; static char xdrmodes[MAXID]; -static int *ip = NULL; -static int *buf = NULL; +static int *ip = nullptr; +static int *buf = nullptr; /*___________________________________________________________________________ | @@ -414,12 +414,12 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) if (init_done == 0) { for (xdrid = 1; xdrid < MAXID; xdrid++) { - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; } init_done = 1; } xdrid = 1; - while (xdrid < MAXID && xdridptr[xdrid] != NULL) { + while (xdrid < MAXID && xdridptr[xdrid] != nullptr) { xdrid++; } if (xdrid == MAXID) { @@ -433,8 +433,8 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) lmode = XDR_DECODE; } xdrfiles[xdrid] = fopen(filename, type); - if (xdrfiles[xdrid] == NULL) { - xdrs = NULL; + if (xdrfiles[xdrid] == nullptr) { + xdrs = nullptr; return 0; } xdrmodes[xdrid] = *type; @@ -444,7 +444,7 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) * (C users are expected to pass the address of an already allocated * XDR staructure) */ - if (xdrs == NULL) { + if (xdrs == nullptr) { xdridptr[xdrid] = (XDR *) malloc(sizeof(XDR)); xdrstdio_create(xdridptr[xdrid], xdrfiles[xdrid], lmode); } else { @@ -468,7 +468,7 @@ int xdrclose(XDR *xdrs) { int xdrid; - if (xdrs == NULL) { + if (xdrs == nullptr) { fprintf(stderr, "xdrclose: passed a NULL pointer\n"); exit(1); } @@ -477,7 +477,7 @@ int xdrclose(XDR *xdrs) xdr_destroy(xdrs); fclose(xdrfiles[xdrid]); - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; return 1; } } @@ -495,8 +495,8 @@ void xdrfreebuf() { if (ip) free(ip); if (buf) free(buf); - ip = NULL; - buf = NULL; + ip = nullptr; + buf = nullptr; } @@ -815,28 +815,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *) realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } @@ -1059,28 +1059,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) (xdrproc_t)xdr_float)); } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *)realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *)realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index 7ee6fce1b..35b5e0e40 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -44,9 +44,9 @@ enum{DIST_UNIFORM,DIST_GAUSSIAN}; /* ---------------------------------------------------------------------- */ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), idrigid(NULL), - idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), imageflags(NULL), - fixrigid(NULL), fixshake(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), idrigid(nullptr), + idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), imageflags(nullptr), + fixrigid(nullptr), fixshake(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix deposit command"); @@ -233,7 +233,7 @@ void FixDeposit::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix deposit rigid fix does not exist"); @@ -248,7 +248,7 @@ void FixDeposit::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix deposit shake fix does not exist"); @@ -658,13 +658,13 @@ void FixDeposit::options(int narg, char **arg) // defaults iregion = -1; - idregion = NULL; + idregion = nullptr; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; globalflag = localflag = 0; lo = hi = deltasq = 0.0; @@ -904,5 +904,5 @@ void *FixDeposit::extract(const char *str, int &itype) return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index bd2f9acfb..d3836f52a 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -40,8 +40,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), - estr(NULL), idregion(NULL), efield(NULL) + Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), + estr(nullptr), idregion(nullptr), efield(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix efield command"); @@ -57,7 +57,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : virial_flag = 1; qe2f = force->qe2f; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -89,8 +89,8 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; - estr = NULL; + idregion = nullptr; + estr = nullptr; int iarg = 6; while (iarg < narg) { @@ -272,7 +272,7 @@ void FixEfield::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index 6396d139a..0d3b40010 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -33,7 +33,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), list(NULL), mark(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), list(nullptr), mark(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix evaporate command"); @@ -84,8 +84,8 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : ndeleted = 0; nmax = 0; - list = NULL; - mark = NULL; + list = nullptr; + mark = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 75642b632..6f56eb4d5 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -41,7 +41,7 @@ using namespace FixConst; FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - step_respa(NULL), prony_c(NULL), prony_tau(NULL), s_gld(NULL), random(NULL) + step_respa(nullptr), prony_c(nullptr), prony_tau(nullptr), s_gld(nullptr), random(nullptr) { int narg_min = 8; // Check to make sure we have the minimal number of inputs @@ -89,7 +89,7 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : // allocate memory for Prony series timescale coefficients memory->create(prony_tau, prony_terms, "gld:prony_tau"); // allocate memory for Prony series extended variables - s_gld = NULL; + s_gld = nullptr; grow_arrays(atom->nmax); // add callbacks to enable restarts atom->add_callback(0); diff --git a/src/MISC/fix_oneway.cpp b/src/MISC/fix_oneway.cpp index 1ca24a590..3508c2fd7 100644 --- a/src/MISC/fix_oneway.cpp +++ b/src/MISC/fix_oneway.cpp @@ -35,7 +35,7 @@ FixOneWay::FixOneWay(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { direction = NONE; regionidx = 0; - regionstr = NULL; + regionstr = nullptr; if (narg < 6) error->all(FLERR,"Illegal fix oneway command"); diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index cc22a509b..7d9463f77 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -56,7 +56,7 @@ static const char cite_fix_orient_bcc[] = FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_bcc); @@ -114,7 +114,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); @@ -124,7 +124,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f391eab91..0677b8d57 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -53,8 +53,8 @@ static const char cite_fix_orient_fcc[] = FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), - sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), + sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_fcc); @@ -112,7 +112,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); @@ -122,7 +122,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); diff --git a/src/MISC/fix_thermal_conductivity.cpp b/src/MISC/fix_thermal_conductivity.cpp index 115045db8..ac86162e3 100644 --- a/src/MISC/fix_thermal_conductivity.cpp +++ b/src/MISC/fix_thermal_conductivity.cpp @@ -35,7 +35,7 @@ using namespace FixConst; FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - index_lo(NULL), index_hi(NULL), ke_lo(NULL), ke_hi(NULL) + index_lo(nullptr), index_hi(nullptr), ke_lo(nullptr), ke_hi(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix thermal/conductivity command"); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 2d38f3c6c..31585cea9 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -42,11 +42,11 @@ using namespace FixConst; FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (narg < 15) error->all(FLERR,"Illegal fix ttm command"); @@ -74,7 +74,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : if (narg != 16) error->all(FLERR,"Illegal fix ttm command"); if (comm->me == 0) { fp = fopen(arg[15],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open output file {}: {}", arg[15], utils::getsyserror())); } @@ -128,7 +128,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "TTM:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -341,7 +341,7 @@ void FixTTM::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); diff --git a/src/MISC/fix_viscosity.cpp b/src/MISC/fix_viscosity.cpp index 5dcd2d291..90e6fcda6 100644 --- a/src/MISC/fix_viscosity.cpp +++ b/src/MISC/fix_viscosity.cpp @@ -37,7 +37,7 @@ using namespace FixConst; FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pos_index(NULL), neg_index(NULL), pos_delta(NULL), neg_delta(NULL) + pos_index(nullptr), neg_index(nullptr), pos_delta(nullptr), neg_delta(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix viscosity command"); diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index 4fc1fb062..4090677a0 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -319,15 +319,15 @@ void PairNMCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -357,10 +357,10 @@ void PairNMCut::write_restart_settings(FILE *fp) void PairNMCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -422,5 +422,5 @@ void *PairNMCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 4a1868041..1f0ae9632 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -370,16 +370,16 @@ void PairNMCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -411,11 +411,11 @@ void PairNMCutCoulCut::write_restart_settings(FILE *fp) void PairNMCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -493,5 +493,5 @@ void *PairNMCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index 576637c59..a981204af 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -46,7 +46,7 @@ using namespace MathConst; PairNMCutCoulLong::PairNMCutCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -308,13 +308,13 @@ void PairNMCutCoulLong::init_style() cut_coulsq = cut_coul * cut_coul; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -414,15 +414,15 @@ void PairNMCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -455,13 +455,13 @@ void PairNMCutCoulLong::write_restart_settings(FILE *fp) void PairNMCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -576,5 +576,5 @@ void *PairNMCutCoulLong::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/xdr_compat.cpp b/src/MISC/xdr_compat.cpp index 9806b0bbd..7483b4aa1 100644 --- a/src/MISC/xdr_compat.cpp +++ b/src/MISC/xdr_compat.cpp @@ -352,7 +352,7 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt) /* * XDR null terminated ASCII strings * xdr_string deals with "C strings" - arrays of bytes that are - * terminated by a NULL character. The parameter cpp references a + * terminated by a nullptr character. The parameter cpp references a * pointer to storage; If the pointer is null, then the necessary * storage is allocated. The last parameter is the max allowed length * of the string as specified by a protocol. @@ -370,13 +370,13 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) switch (xdrs->x_op) { case XDR_FREE: - if (sp == NULL) + if (sp == nullptr) { return TRUE; /* already free */ } /* fall through... */ case XDR_ENCODE: - if (sp == NULL) + if (sp == nullptr) return FALSE; size = strlen (sp); break; @@ -404,9 +404,9 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) { return TRUE; } - if (sp == NULL) + if (sp == nullptr) *cpp = sp = (char *) malloc (nodesize); - if (sp == NULL) + if (sp == nullptr) { (void) fputs ("xdr_string: out of memory\n", stderr); return FALSE; @@ -419,7 +419,7 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) case XDR_FREE: free (sp); - *cpp = NULL; + *cpp = nullptr; return TRUE; } return FALSE; @@ -660,7 +660,7 @@ xdrstdio_inline (XDR * /*xdrs*/, int /*len*/) * most of the gains to be had here and require storage * management on this buffer, so we don't do this. */ - return NULL; + return nullptr; } static bool_t diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 956cb0196..fe406772c 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeMLIAP::ComputeMLIAP(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), mliaparray(NULL), - mliaparrayall(NULL), map(NULL) + Compute(lmp, narg, arg), mliaparray(nullptr), + mliaparrayall(nullptr), map(nullptr) { array_flag = 1; extarray = 0; @@ -127,7 +127,7 @@ ComputeMLIAP::~ComputeMLIAP() void ComputeMLIAP::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute mliap requires a pair style be defined"); if (descriptor->cutmax > force->pair->cutforce) diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index a7e50012c..cb29dffd4 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -25,10 +25,10 @@ MLIAPData::MLIAPData(LAMMPS *lmp, int gradgradflag_in, int *map_in, class MLIAPModel* model_in, class MLIAPDescriptor* descriptor_in, class PairMLIAP* pairmliap_in) : - Pointers(lmp), gradforce(NULL), betas(NULL), descriptors(NULL), gamma(NULL), - gamma_row_index(NULL), gamma_col_index(NULL), egradient(NULL), - numneighs(NULL), iatoms(NULL), ielems(NULL), jatoms(NULL), jelems(NULL), - rij(NULL), graddesc(NULL), model(NULL), descriptor(NULL), list(NULL) + Pointers(lmp), gradforce(nullptr), betas(nullptr), descriptors(nullptr), gamma(nullptr), + gamma_row_index(nullptr), gamma_col_index(nullptr), egradient(nullptr), + numneighs(nullptr), iatoms(nullptr), ielems(nullptr), jatoms(nullptr), jelems(nullptr), + rij(nullptr), graddesc(nullptr), model(nullptr), descriptor(nullptr), list(nullptr) { gradgradflag = gradgradflag_in; map = map_in; diff --git a/src/MLIAP/mliap_data.h b/src/MLIAP/mliap_data.h index 0307d93ae..ffac9ccd4 100644 --- a/src/MLIAP/mliap_data.h +++ b/src/MLIAP/mliap_data.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPData : protected Pointers { public: - MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = NULL); + MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = nullptr); ~MLIAPData(); void init(); diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 5f0ee33c8..21ba68e9a 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -35,10 +35,10 @@ MLIAPDescriptorSNAP::MLIAPDescriptorSNAP(LAMMPS *lmp, char *paramfilename): MLIAPDescriptor(lmp) { nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - snaptr = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + snaptr = nullptr; read_paramfile(paramfilename); snaptr = new SNA(lmp, rfac0, twojmax, @@ -374,7 +374,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) FILE *fpparam; if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); - if (fpparam == NULL) + if (fpparam == nullptr) error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}", paramfilename, utils::getsyserror())); } @@ -386,7 +386,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -406,7 +406,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { utils::logmesg(lmp, fmt::format("SNAP keyword {} {} \n", keywd, keyval)); @@ -427,19 +427,19 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) int n = strlen(elemtmp) + 1; elements[ielem] = new char[n]; strcpy(elements[ielem],elemtmp); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } elementsflag = 1; } else if (strcmp(keywd,"radelems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { radelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } radelemflag = 1; } else if (strcmp(keywd,"welems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { wjelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } wjelemflag = 1; } diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index b731e1c9f..7ac1013c4 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; MLIAPModel::MLIAPModel(LAMMPS* lmp, char* coefffilename) : Pointers(lmp) { - coeffelem = NULL; + coeffelem = nullptr; if (coefffilename) read_coeffs(coefffilename); else { nparams = 0; @@ -81,7 +81,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) FILE *fpcoeff; if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); - if (fpcoeff == NULL) + if (fpcoeff == nullptr) error->one(FLERR,fmt::format("Cannot open MLIAPModel coeff file {}: {}", coefffilename,utils::getsyserror())); } @@ -94,7 +94,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -119,7 +119,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); nparams = atoi(words[1]); @@ -134,7 +134,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) for (int icoeff = 0; icoeff < nparams; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; diff --git a/src/MLIAP/mliap_model_quadratic.h b/src/MLIAP/mliap_model_quadratic.h index 188d78661..b41df18a0 100644 --- a/src/MLIAP/mliap_model_quadratic.h +++ b/src/MLIAP/mliap_model_quadratic.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModel { public: - MLIAPModelQuadratic(LAMMPS*, char* = NULL); + MLIAPModelQuadratic(LAMMPS*, char* = nullptr); ~MLIAPModelQuadratic(); virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData*); diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp index 6cd550384..61051084b 100644 --- a/src/MOLECULE/angle_charmm.cpp +++ b/src/MOLECULE/angle_charmm.cpp @@ -246,10 +246,10 @@ void AngleCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp index 0288a61d8..b4190d902 100644 --- a/src/MOLECULE/angle_cosine.cpp +++ b/src/MOLECULE/angle_cosine.cpp @@ -194,7 +194,7 @@ void AngleCosine::read_restart(FILE *fp) { allocate(); - if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp index 1a05edc20..1cf0cb887 100644 --- a/src/MOLECULE/angle_cosine_periodic.cpp +++ b/src/MOLECULE/angle_cosine_periodic.cpp @@ -247,9 +247,9 @@ void AngleCosinePeriodic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp index 5fb40b54c..dc1a20fd8 100644 --- a/src/MOLECULE/angle_cosine_squared.cpp +++ b/src/MOLECULE/angle_cosine_squared.cpp @@ -37,8 +37,8 @@ using namespace MathConst; AngleCosineSquared::AngleCosineSquared(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -216,8 +216,8 @@ void AngleCosineSquared::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp index eb5e48ec9..19142f94c 100644 --- a/src/MOLECULE/angle_harmonic.cpp +++ b/src/MOLECULE/angle_harmonic.cpp @@ -33,8 +33,8 @@ using namespace MathConst; AngleHarmonic::AngleHarmonic(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -216,8 +216,8 @@ void AngleHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 100b75cb0..6e47bf787 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -47,7 +47,7 @@ AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -205,7 +205,7 @@ void AngleTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -311,8 +311,8 @@ void AngleTable::write_restart_settings(FILE *fp) void AngleTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -351,10 +351,10 @@ double AngleTable::single(int type, int i1, int i2, int i3) void AngleTable::null_table(Table *tb) { - tb->afile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->ang = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->afile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->ang = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 3dc8c9088..5e3e2df07 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -55,7 +55,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = 0; - bond_negative = angle_negative = NULL; + bond_negative = angle_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 2fa445c8e..22f47e569 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -50,7 +50,7 @@ AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = 0; - bond_negative = NULL; + bond_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 866cf796c..a69007cea 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -75,7 +75,7 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index e90bec510..da75316a7 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -75,7 +75,7 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index b2271d45f..f79c56b63 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -215,10 +215,10 @@ void BondFENE::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -279,5 +279,5 @@ void *BondFENE::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index 676d5f687..8166e63e2 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -225,11 +225,11 @@ void BondFENEExpand::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index 89b3830cb..85653a60f 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -167,8 +167,8 @@ void BondGromos::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -204,5 +204,5 @@ void *BondGromos::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index 28100512a..6e523b492 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -168,8 +168,8 @@ void BondHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -208,7 +208,7 @@ void *BondHarmonic::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index 49074e1cd..f7e4e6c91 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -173,9 +173,9 @@ void BondMorse::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&d0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -213,5 +213,5 @@ void *BondMorse::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index 63b640730..7c74d8f41 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -168,9 +168,9 @@ void BondNonlinear::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&epsilon[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -211,5 +211,5 @@ void *BondNonlinear::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"epsilon")==0) return (void*) epsilon; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index c8d182e4f..4fd22f377 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -229,7 +229,7 @@ void BondQuartic::coeff(int narg, char **arg) void BondQuartic::init_style() { - if (force->pair == NULL || force->pair->single_enable == 0) + if (force->pair == nullptr || force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support bond_style quartic"); if (force->angle || force->dihedral || force->improper) error->all(FLERR, @@ -276,11 +276,11 @@ void BondQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&b1[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 5cc91ceae..a7fbbb84d 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -43,7 +43,7 @@ BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -157,7 +157,7 @@ void BondTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -254,8 +254,8 @@ void BondTable::write_restart_settings(FILE *fp) void BondTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -278,10 +278,10 @@ double BondTable::single(int type, double rsq, int /*i*/, int /*j*/, void BondTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index 11422e082..cc615213a 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -389,7 +389,7 @@ void DihedralCharmm::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmm is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -424,11 +424,11 @@ void DihedralCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 408be8ef9..a12421211 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -407,7 +407,7 @@ void DihedralCharmmfsw::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -428,8 +428,8 @@ void DihedralCharmmfsw::init_style() double *p_cutlj = (double *) force->pair->extract("cut_lj",itmp); double *p_cutcoul = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutcoul == NULL || p_cutljinner == NULL || - p_cutlj == NULL || p_dihedflag == NULL) + if (p_cutcoul == nullptr || p_cutljinner == nullptr || + p_cutlj == nullptr || p_dihedflag == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); dihedflag = *p_dihedflag; @@ -467,11 +467,11 @@ void DihedralCharmmfsw::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index 55e2f2500..87ade01be 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -328,9 +328,9 @@ void DihedralHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index 40e026c2f..8c4ba07fb 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -323,9 +323,9 @@ void DihedralHelix::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&aphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&bphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index 963304da8..57c017bd9 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -319,11 +319,11 @@ void DihedralMultiHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&a1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index fe05dc7c3..39b979ff2 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -331,10 +331,10 @@ void DihedralOPLS::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 2de6dd418..0de406120 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -62,11 +62,11 @@ using namespace MathConst; FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - crosstermlist(NULL), num_crossterm(NULL), crossterm_type(NULL), - crossterm_atom1(NULL), crossterm_atom2(NULL), crossterm_atom3(NULL), - crossterm_atom4(NULL), crossterm_atom5(NULL), - g_axis(NULL), cmapgrid(NULL), d1cmapgrid(NULL), d2cmapgrid(NULL), - d12cmapgrid(NULL) + crosstermlist(nullptr), num_crossterm(nullptr), crossterm_type(nullptr), + crossterm_atom1(nullptr), crossterm_atom2(nullptr), crossterm_atom3(nullptr), + crossterm_atom4(nullptr), crossterm_atom5(nullptr), + g_axis(nullptr), cmapgrid(nullptr), d1cmapgrid(nullptr), d2cmapgrid(nullptr), + d12cmapgrid(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix cmap command"); @@ -101,13 +101,13 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - num_crossterm = NULL; - crossterm_type = NULL; - crossterm_atom1 = NULL; - crossterm_atom2 = NULL; - crossterm_atom3 = NULL; - crossterm_atom4 = NULL; - crossterm_atom5 = NULL; + num_crossterm = nullptr; + crossterm_type = nullptr; + crossterm_atom1 = nullptr; + crossterm_atom2 = nullptr; + crossterm_atom3 = nullptr; + crossterm_atom4 = nullptr; + crossterm_atom5 = nullptr; nmax_previous = 0; grow_arrays(atom->nmax); @@ -118,7 +118,7 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : ncmap = 0; maxcrossterm = 0; - crosstermlist = NULL; + crosstermlist = nullptr; } /* --------------------------------------------------------------------- */ @@ -631,10 +631,10 @@ void FixCMAP::read_grid_map(char *cmapfile) char *chunk,*line; int i1, i2, i3, i4, i5, i6, j1, j2, j3, j4, j5, j6, counter; - FILE *fp = NULL; + FILE *fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(cmapfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix cmap file {}: {}", cmapfile, utils::getsyserror())); @@ -654,7 +654,7 @@ void FixCMAP::read_grid_map(char *cmapfile) while (!done) { // only read on rank 0 and broadcast to all other ranks if (comm->me == 0) - done = (fgets(linebuf,MAXLINE,fp) == NULL); + done = (fgets(linebuf,MAXLINE,fp) == nullptr); MPI_Bcast(&done,1,MPI_INT,0,world); if (done) continue; @@ -681,13 +681,13 @@ void FixCMAP::read_grid_map(char *cmapfile) // 6. Glycine before proline map chunk = strtok(line, " \r\n"); - while (chunk != NULL) { + while (chunk != nullptr) { // alanine map if (counter < CMAPDIM*CMAPDIM) { cmapgrid[0][i1][j1] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j1++; if (j1 == CMAPDIM) { j1 = 0; @@ -701,7 +701,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= CMAPDIM*CMAPDIM && counter < 2*CMAPDIM*CMAPDIM) { cmapgrid[1][i2][j2]= atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j2++; if (j2 == CMAPDIM) { j2 = 0; @@ -715,7 +715,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 2*CMAPDIM*CMAPDIM && counter < 3*CMAPDIM*CMAPDIM) { cmapgrid[2][i3][j3] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j3++; if (j3 == CMAPDIM) { j3 = 0; @@ -729,7 +729,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 3*CMAPDIM*CMAPDIM && counter < 4*CMAPDIM*CMAPDIM) { cmapgrid[3][i4][j4] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j4++; if (j4 == CMAPDIM) { j4 = 0; @@ -743,7 +743,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 4*CMAPDIM*CMAPDIM && counter < 5*CMAPDIM*CMAPDIM) { cmapgrid[4][i5][j5] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j5++; if (j5 == CMAPDIM) { j5 = 0; @@ -757,7 +757,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 5*CMAPDIM*CMAPDIM && counter < 6*CMAPDIM*CMAPDIM) { cmapgrid[5][i6][j6] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j6++; if (j6 == CMAPDIM) { j6 = 0; diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 90cf3eee3..75eeb4a45 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -334,9 +334,9 @@ void ImproperCvff::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->nimpropertypes,MPI_INT,0,world); diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index 6327ea8b0..159574a12 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -275,8 +275,8 @@ void ImproperHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 7b2c4e0b0..7a7c07ab0 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -316,9 +316,9 @@ void ImproperUmbrella::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 6d9c85142..307fe3772 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -50,7 +50,7 @@ PairHbondDreidingLJ::PairHbondDreidingLJ(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nparams = maxparam = 0; - params = NULL; + params = nullptr; nextra = 2; pvector = new double[2]; diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index dea6bd625..9b3805a8b 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -375,14 +375,14 @@ void PairLJCharmmCoulCharmm::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -436,12 +436,12 @@ void PairLJCharmmCoulCharmm::write_restart_settings(FILE *fp) void PairLJCharmmCoulCharmm::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -523,5 +523,5 @@ void *PairLJCharmmCoulCharmm::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"implicit") == 0) return (void *) &implicit; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index 31083312a..c311c76f5 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -433,14 +433,14 @@ void PairLJCharmmfswCoulCharmmfsh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -470,11 +470,11 @@ void PairLJCharmmfswCoulCharmmfsh::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulCharmmfsh::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -560,5 +560,5 @@ void *PairLJCharmmfswCoulCharmmfsh::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index b5ed25578..d8ab817e7 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -43,8 +43,8 @@ PairLJCutTIP4PCut::PairLJCutTIP4PCut(LAMMPS *lmp) : Pair(lmp) writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -494,9 +494,9 @@ void PairLJCutTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -618,13 +618,13 @@ void PairLJCutTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -660,17 +660,17 @@ void PairLJCutTIP4PCut::write_restart_settings(FILE *fp) void PairLJCutTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -740,7 +740,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- memory usage of hneigh diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 8d8f5ec78..7757e9649 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -39,8 +39,8 @@ PairTIP4PCut::PairTIP4PCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -423,9 +423,9 @@ void PairTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -475,7 +475,7 @@ void PairTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -502,13 +502,13 @@ void PairTIP4PCut::write_restart_settings(FILE *fp) void PairTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 62d940af3..812cec21a 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -186,7 +186,7 @@ void DumpAtomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 6d5fc3da8..f598f2599 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -207,7 +207,7 @@ void DumpCFGMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index b623df82d..065b04801 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -202,7 +202,7 @@ void DumpCustomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -247,8 +247,8 @@ void DumpCustomMPIIO::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index 139245e4b..959a45410 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -198,7 +198,7 @@ void DumpXYZMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -239,7 +239,7 @@ void DumpXYZMPIIO::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; diff --git a/src/MSCG/fix_mscg.cpp b/src/MSCG/fix_mscg.cpp index 29d6d550e..650c25cd4 100644 --- a/src/MSCG/fix_mscg.cpp +++ b/src/MSCG/fix_mscg.cpp @@ -65,7 +65,7 @@ FixMSCG::FixMSCG(LAMMPS *lmp, int narg, char **arg) : nframes = n_frames = block_size = 0; range_flag = 0; name_flag = 0; - f = NULL; + f = nullptr; type_names = new char*[natoms]; for (int i = 0; i < natoms; i++) type_names[i] = new char[24]; diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 8bea52f1c..9e4c88690 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), damage(NULL) + Compute(lmp, narg, arg), damage(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute damage/atom command"); diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 65a25cda0..bf8d345f2 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -43,7 +43,7 @@ ComputeDilatationAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dilatation = NULL; + dilatation = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index d90e21150..5d0d55498 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -44,7 +44,7 @@ ComputePlasticityAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - plasticity = NULL; + plasticity = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 295038119..d741aca85 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -56,15 +56,15 @@ FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : // set maxpartner = 1 as placeholder maxpartner = 1; - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; - vinter = NULL; - wvolume = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; + vinter = nullptr; + wvolume = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -228,13 +228,13 @@ void FixPeriNeigh::setup(int /*vflag*/) memory->destroy(r0); memory->destroy(npartner); - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; grow_arrays(atom->nmax); // create partner list and r0 values from neighbor list @@ -301,9 +301,9 @@ void FixPeriNeigh::setup(int /*vflag*/) double **x0 = atom->x0; double half_lc = 0.5*(domain->lattice->xlattice); double vfrac_scale; - PairPeriLPS *pairlps = NULL; - PairPeriVES *pairves = NULL; - PairPeriEPS *paireps = NULL; + PairPeriLPS *pairlps = nullptr; + PairPeriVES *pairves = nullptr; + PairPeriEPS *paireps = nullptr; if (isLPS) pairlps = static_cast(anypair); else if (isVES) diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index 0e5760ac8..c6f3c1ada 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -47,14 +47,14 @@ PairPeriEPS::PairPeriEPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = -1; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_yieldstress = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_yieldstress = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -219,7 +219,7 @@ void PairPeriEPS::compute(int eflag, int vflag) // ******** temp array to store Plastic extension *********** /// // create on heap to reduce stack use and to allow for faster zeroing - double **deviatorPlasticExtTemp = NULL; + double **deviatorPlasticExtTemp = nullptr; if (nlocal*maxpartner > 0) { memory->create(deviatorPlasticExtTemp,nlocal,maxpartner,"pair:plastext"); memset(&(deviatorPlasticExtTemp[0][0]),0,sizeof(double)*nlocal*maxpartner); @@ -505,7 +505,7 @@ void PairPeriEPS::init_style() if (atom->map_style == 0) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -559,16 +559,16 @@ void PairPeriEPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index b60f28d9f..65f43ad66 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -45,13 +45,13 @@ PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -481,15 +481,15 @@ void PairPeriLPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 5d6973a91..f29671a42 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -44,12 +44,12 @@ PairPeriPMB::PairPeriPMB(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; + s0_new = nullptr; - kspring = NULL; - s00 = NULL; - alpha = NULL; - cut = NULL; + kspring = nullptr; + s00 = nullptr; + alpha = nullptr; + cut = nullptr; } /* ---------------------------------------------------------------------- */ @@ -410,14 +410,14 @@ void PairPeriPMB::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&kspring[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index 93c980702..ff131eae5 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -45,15 +45,15 @@ PairPeriVES::PairPeriVES(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_lambdai = NULL; - m_taubi = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_lambdai = nullptr; + m_taubi = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -484,7 +484,7 @@ void PairPeriVES::init_style() if (atom->map_style == 0) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -539,17 +539,17 @@ void PairPeriVES::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 12dc59c28..6dadb2866 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -62,12 +62,12 @@ static const char cite_fix_poems[] = ------------------------------------------------------------------------- */ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), natom2body(NULL), - atom2body(NULL), displace(NULL), nrigid(NULL), masstotal(NULL), - xcm(NULL), vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), sum(NULL), all(NULL), jointbody(NULL), - xjoint(NULL), freelist(NULL), poems(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), natom2body(nullptr), + atom2body(nullptr), displace(nullptr), nrigid(nullptr), masstotal(nullptr), + xcm(nullptr), vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), sum(nullptr), all(nullptr), jointbody(nullptr), + xjoint(nullptr), freelist(nullptr), poems(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_poems); @@ -84,9 +84,9 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with atom class - natom2body = NULL; - atom2body = NULL; - displace = NULL; + natom2body = nullptr; + atom2body = nullptr; + displace = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -944,7 +944,7 @@ void FixPOEMS::readfile(char *file) if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix poems file %s",file); error->one(FLERR,str); @@ -952,7 +952,7 @@ void FixPOEMS::readfile(char *file) } nbody = 0; - char *line = NULL; + char *line = nullptr; int maxline = 0; char *ptr; int nlocal = atom->nlocal; @@ -965,10 +965,10 @@ void FixPOEMS::readfile(char *file) MPI_Bcast(line,nlen,MPI_CHAR,0,world); ptr = strtok(line," ,\t\n\0"); - if (ptr == NULL || ptr[0] == '#') continue; - ptr = strtok(NULL," ,\t\n\0"); + if (ptr == nullptr || ptr[0] == '#') continue; + ptr = strtok(nullptr," ,\t\n\0"); - while ((ptr = strtok(NULL," ,\t\n\0"))) { + while ((ptr = strtok(nullptr," ,\t\n\0"))) { id = atoi(ptr); i = atom->map(id); if (i < 0 || i >= nlocal) continue; @@ -995,7 +995,7 @@ int FixPOEMS::readline(FILE *fp, char **pline, int *pmaxline) maxline += DELTA; memory->grow(line,maxline,"fix_poems:line"); } - if (fgets(&line[n],maxline-n,fp) == NULL) { + if (fgets(&line[n],maxline-n,fp) == nullptr) { n = 0; break; } @@ -1030,7 +1030,7 @@ void FixPOEMS::jointbuild() mjoint += natom2body[i]-1; } - tagint **mylist = NULL; + tagint **mylist = nullptr; if (mjoint) memory->create(mylist,mjoint,3,"poems:mylist"); mjoint = 0; @@ -1047,7 +1047,7 @@ void FixPOEMS::jointbuild() // jlist = mylist concatenated across all procs via MPI_Allgatherv MPI_Allreduce(&mjoint,&njoint,1,MPI_INT,MPI_SUM,world); - tagint **jlist = NULL; + tagint **jlist = nullptr; if (njoint) memory->create(jlist,njoint,3,"poems:jlist"); int nprocs; @@ -1069,7 +1069,7 @@ void FixPOEMS::jointbuild() MPI_Allgatherv(mylist[0],3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); else - MPI_Allgatherv(NULL,3*mjoint,MPI_LMP_TAGINT,jlist[0], + MPI_Allgatherv(nullptr,3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); } @@ -1107,9 +1107,9 @@ void FixPOEMS::jointbuild() // each proc sets myjoint if it owns joint atom // MPI_Allreduce gives all procs the xjoint coords - jointbody = NULL; - xjoint = NULL; - double **myjoint = NULL; + jointbody = nullptr; + xjoint = nullptr; + double **myjoint = nullptr; if (njoint) { memory->create(jointbody,njoint,2,"poems:jointbody"); memory->create(xjoint,njoint,3,"poems:xjoint"); @@ -1146,7 +1146,7 @@ void FixPOEMS::jointbuild() for (i = 0; i < nbody; i++) if (mark[i]) nfree++; if (nfree) freelist = new int[nfree]; - else freelist = NULL; + else freelist = nullptr; nfree = 0; for (i = 0; i < nbody; i++) if (mark[i]) freelist[nfree++] = i + 1; diff --git a/src/PYTHON/fix_python_move.cpp b/src/PYTHON/fix_python_move.cpp index 53bde5e80..6aec1d785 100644 --- a/src/PYTHON/fix_python_move.cpp +++ b/src/PYTHON/fix_python_move.cpp @@ -37,7 +37,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : python->init(); - py_move = NULL; + py_move = nullptr; PyGILState_STATE gstate = PyGILState_Ensure(); @@ -50,7 +50,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : char * full_cls_name = arg[3]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Fix python/integrate requires fully qualified class name"); } @@ -138,7 +138,7 @@ void FixPythonMove::init() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'init' method'"); } - PyObject * result = PyEval_CallObject(py_init, NULL); + PyObject * result = PyEval_CallObject(py_init, nullptr); PyGILState_Release(gstate); } @@ -174,7 +174,7 @@ void FixPythonMove::final_integrate() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'final_integrate' method'"); } - PyObject * result = PyEval_CallObject(py_final_integrate, NULL); + PyObject * result = PyEval_CallObject(py_final_integrate, nullptr); PyGILState_Release(gstate); } @@ -229,6 +229,6 @@ void FixPythonMove::reset_dt() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'reset_dt' method'"); } - PyObject * result = PyEval_CallObject(py_reset_dt, NULL); + PyObject * result = PyEval_CallObject(py_reset_dt, nullptr); PyGILState_Release(gstate); } diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 074de2f39..e24daf311 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -43,8 +43,8 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { cut_global = 0.0; centroidstressflag = 1; - py_potential = NULL; - skip_types = NULL; + py_potential = nullptr; + skip_types = nullptr; python->init(); @@ -54,7 +54,7 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { // if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well const char * potentials_path = getenv("LAMMPS_POTENTIALS"); - if (potentials_path != NULL) { + if (potentials_path != nullptr) { PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path)); } } @@ -259,7 +259,7 @@ void PairPython::coeff(int narg, char **arg) char * full_cls_name = arg[2]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Python pair style requires fully qualified class name"); } @@ -297,7 +297,7 @@ void PairPython::coeff(int narg, char **arg) delete [] module_name; delete [] cls_name; - PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, NULL); + PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, nullptr); if (!py_pair_instance) { PyErr_Print(); PyErr_Clear(); diff --git a/src/PYTHON/python_compat.h b/src/PYTHON/python_compat.h index effac81ce..97946349b 100644 --- a/src/PYTHON/python_compat.h +++ b/src/PYTHON/python_compat.h @@ -21,14 +21,14 @@ #define PY_INT_FROM_LONG(X) PyInt_FromLong(X) #define PY_INT_AS_LONG(X) PyInt_AsLong(X) #define PY_STRING_FROM_STRING(X) PyString_FromString(X) -#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, NULL) +#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, nullptr) #define PY_STRING_AS_STRING(X) PyString_AsString(X) #elif PY_MAJOR_VERSION == 3 #define PY_INT_FROM_LONG(X) PyLong_FromLong(X) #define PY_INT_AS_LONG(X) PyLong_AsLong(X) #define PY_STRING_FROM_STRING(X) PyUnicode_FromString(X) -#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, NULL, NULL) +#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, nullptr, nullptr) #define PY_STRING_AS_STRING(X) PyUnicode_AsUTF8(X) #endif diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index cb35cba85..5a94d33e9 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -38,15 +38,15 @@ enum{NONE,INT,DOUBLE,STRING,PTR}; PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) { ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; // pfuncs stores interface info for each Python function nfunc = 0; - pfuncs = NULL; + pfuncs = nullptr; // one-time initialization of Python interpreter // pyMain stores pointer to main module @@ -104,7 +104,7 @@ void PythonImpl::command(int narg, char **arg) int ifunc = find(arg[0]); if (ifunc < 0) error->all(FLERR,"Python invoke of undefined function"); - char *str = NULL; + char *str = nullptr; if (noutput) { str = input->variable->pythonstyle(pfuncs[ifunc].ovarname, pfuncs[ifunc].name); @@ -122,7 +122,7 @@ void PythonImpl::command(int narg, char **arg) int err; FILE *fp = fopen(arg[2],"r"); - if (fp == NULL) + if (fp == nullptr) err = execute_string(arg[2]); else err = execute_file(arg[2]); @@ -136,12 +136,12 @@ void PythonImpl::command(int narg, char **arg) // parse optional args, invoke is not allowed in this mode ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; - char *pyfile = NULL; - char *herestr = NULL; + char *pyfile = nullptr; + char *herestr = nullptr; int existflag = 0; int iarg = 1; @@ -206,7 +206,7 @@ void PythonImpl::command(int narg, char **arg) if (pyfile) { FILE *fp = fopen(pyfile,"r"); - if (fp == NULL) { + if (fp == nullptr) { PyGILState_Release(gstate); error->all(FLERR,"Could not open Python file"); } @@ -422,7 +422,7 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].svalue = new char*[ninput]; for (int i = 0; i < ninput; i++) { - pfuncs[ifunc].svalue[i] = NULL; + pfuncs[ifunc].svalue[i] = nullptr; char type = format[i]; if (type == 'i') { pfuncs[ifunc].itype[i] = INT; @@ -470,8 +470,8 @@ int PythonImpl::create_entry(char *name) // process output as value or variable - pfuncs[ifunc].ovarname = NULL; - pfuncs[ifunc].longstr = NULL; + pfuncs[ifunc].ovarname = nullptr; + pfuncs[ifunc].longstr = nullptr; if (!noutput) return ifunc; char type = format[ninput]; @@ -512,7 +512,7 @@ int PythonImpl::execute_string(char *cmd) int PythonImpl::execute_file(char *fname) { FILE *fp = fopen(fname,"r"); - if (fp == NULL) return -1; + if (fp == nullptr) return -1; PyGILState_STATE gstate = PyGILState_Ensure(); int err = PyRun_SimpleFile(fp,fname); diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 5cadce617..9f8b6c344 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -37,11 +37,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), list(NULL), chi(NULL), eta(NULL), - gamma(NULL), zeta(NULL), zcore(NULL), chizj(NULL), shld(NULL), - s(NULL), t(NULL), s_hist(NULL), t_hist(NULL), Hdia_inv(NULL), b_s(NULL), - b_t(NULL), p(NULL), q(NULL), r(NULL), d(NULL), - qf(NULL), q1(NULL), q2(NULL), qv(NULL) + Fix(lmp, narg, arg), list(nullptr), chi(nullptr), eta(nullptr), + gamma(nullptr), zeta(nullptr), zcore(nullptr), chizj(nullptr), shld(nullptr), + s(nullptr), t(nullptr), s_hist(nullptr), t_hist(nullptr), Hdia_inv(nullptr), b_s(nullptr), + b_t(nullptr), p(nullptr), q(nullptr), r(nullptr), d(nullptr), + qf(nullptr), q1(nullptr), q2(nullptr), qv(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix qeq command"); @@ -58,48 +58,48 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : swa = 0.0; swb = cutoff; - shld = NULL; + shld = nullptr; nlocal = n_cap = 0; nall = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 5; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // others cutoff_sq = cutoff*cutoff; - chizj = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; + chizj = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; streitz_flag = 0; reax_flag = 0; - qv = NULL; + qv = nullptr; comm_forward = comm_reverse = 1; // perform initial allocation of atom-based arrays // register with Atom class - s_hist = t_hist = NULL; + s_hist = t_hist = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -708,7 +708,7 @@ void FixQEq::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix qeq parameter file %s",file); error->one(FLERR,str); @@ -726,7 +726,7 @@ void FixQEq::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -751,7 +751,7 @@ void FixQEq::read_file(char *file) for (n=0, words[n] = strtok(line," \t\n\r\f"); n < 6; - words[++n] = strtok(NULL," \t\n\r\f")); + words[++n] = strtok(nullptr," \t\n\r\f")); utils::bounds(FLERR,words[0],1,ntypes,nlo,nhi,error); for (n=nlo; n <=nhi; ++n) { diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 6dcc5e9cd..10cdc5d3c 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -66,8 +66,8 @@ FixQEqFire::FixQEqFire(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix qeq/fire command"); } - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index 37951adb1..306f3f61e 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -78,12 +78,12 @@ void FixQEqShielded::init() void FixQEqShielded::extract_reax() { Pair *pair = force->pair_match("^reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair reax/c"); } diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 327a9c5b3..7c7dc159b 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -88,15 +88,15 @@ void FixQEqSlater::init() void FixQEqSlater::extract_streitz() { Pair *pair = force->pair_match("coul/streitz",1); - if (pair == NULL) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); + if (pair == nullptr) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); zeta = (double *) pair->extract("zeta",tmp); zcore = (double *) pair->extract("zcore",tmp); - if (chi == NULL || eta == NULL || gamma == NULL - || zeta == NULL || zcore == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr + || zeta == nullptr || zcore == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair coul/streitz"); diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index 531f488e6..8efaab7c7 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_event(NULL), fix_event(NULL) + Compute(lmp, narg, arg), id_event(nullptr), fix_event(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute event/displace command"); @@ -47,7 +47,7 @@ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : // fix event ID will be set later by accelerated dynamics method - id_event = NULL; + id_event = nullptr; } /* ---------------------------------------------------------------------- */ @@ -65,7 +65,7 @@ void ComputeEventDisplace::init() // if set by PRD, then find fix which stores original atom coords // check if it is correct style - if (id_event != NULL) { + if (id_event != nullptr) { int ifix = modify->find_fix(id_event); if (ifix < 0) error->all(FLERR, "Could not find compute event/displace fix ID"); @@ -88,7 +88,7 @@ double ComputeEventDisplace::compute_scalar() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; double event = 0.0; double **xevent = fix_event->array_atom; @@ -150,7 +150,7 @@ int ComputeEventDisplace::all_events() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; int event = 0; double **xevent = fix_event->array_atom; @@ -204,8 +204,8 @@ int ComputeEventDisplace::all_events() void ComputeEventDisplace::reset_extra_compute_fix(const char *id_new) { delete [] id_event; - id_event = NULL; - if (id_new == NULL) return; + id_event = nullptr; + if (id_new == nullptr) return; int n = strlen(id_new) + 1; id_event = new char[n]; diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 41f91332c..7e6a82bdd 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -27,8 +27,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xevent(NULL), xold(NULL), vold(NULL), - imageold(NULL), xorig(NULL), vorig(NULL), imageorig(NULL) + Fix(lmp, narg, arg), xevent(nullptr), xold(nullptr), vold(nullptr), + imageold(nullptr), xorig(nullptr), vorig(nullptr), imageorig(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix event command"); diff --git a/src/REPLICA/fix_hyper.cpp b/src/REPLICA/fix_hyper.cpp index 472d0bbb4..733578caa 100644 --- a/src/REPLICA/fix_hyper.cpp +++ b/src/REPLICA/fix_hyper.cpp @@ -35,6 +35,6 @@ void *FixHyper::extract(const char *str, int &dim) if (strcmp(str,"hyperflag") == 0) { return &hyperflag; } - return NULL; + return nullptr; } diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index f104d14c2..abc16618c 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -41,7 +41,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), xold(NULL), tagold(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), xold(nullptr), tagold(nullptr) { if (atom->map_style == 0) error->all(FLERR,"Fix hyper/global command requires atom map"); @@ -70,12 +70,12 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : maxbond = 0; nblocal = 0; - blist = NULL; + blist = nullptr; maxold = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; me = comm->me; firstflag = 1; diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index da444bc45..2eb18a0c8 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -47,10 +47,10 @@ enum{IGNORE,WARN,ERROR}; /* ---------------------------------------------------------------------- */ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), biascoeff(NULL), numbond(NULL), - maxhalf(NULL), eligible(NULL), maxhalfstrain(NULL), old2now(NULL), - tagold(NULL), xold(NULL), maxstrain(NULL), maxstrain_domain(NULL), - biasflag(NULL), bias(NULL), cpage(NULL), clist(NULL), numcoeff(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), biascoeff(nullptr), numbond(nullptr), + maxhalf(nullptr), eligible(nullptr), maxhalfstrain(nullptr), old2now(nullptr), + tagold(nullptr), xold(nullptr), maxstrain(nullptr), maxstrain_domain(nullptr), + biasflag(nullptr), bias(nullptr), cpage(nullptr), clist(nullptr), numcoeff(nullptr) { // error checks @@ -132,28 +132,28 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : // per-atom data structs maxbond = nblocal = 0; - blist = NULL; - biascoeff = NULL; + blist = nullptr; + biascoeff = nullptr; allbonds = 0; maxatom = 0; - maxstrain = NULL; - maxstrain_domain = NULL; - biasflag = NULL; + maxstrain = nullptr; + maxstrain_domain = nullptr; + biasflag = nullptr; maxlocal = nlocal_old = 0; - numbond = NULL; - maxhalf = NULL; - eligible = NULL; - maxhalfstrain = NULL; + numbond = nullptr; + maxhalf = nullptr; + eligible = nullptr; + maxhalfstrain = nullptr; maxall = nall_old = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; nbias = maxbias = 0; - bias = NULL; + bias = nullptr; // data structs for persisting bias coeffs when bond list is reformed // maxbondperatom = max # of bonds any atom is part of @@ -162,8 +162,8 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : maxcoeff = 0; maxbondperatom = FCCBONDS; - numcoeff = NULL; - clist = NULL; + numcoeff = nullptr; + clist = nullptr; cpage = new MyPage; cpage->init(maxbondperatom,1024*maxbondperatom,1); @@ -983,7 +983,7 @@ void FixHyperLocal::build_bond_list(int natom) while (1) { if (firstflag) break; for (i = 0; i < nall; i++) numcoeff[i] = 0; - for (i = 0; i < nall; i++) clist[i] = NULL; + for (i = 0; i < nall; i++) clist[i] = nullptr; cpage->reset(); for (m = 0; m < nblocal; m++) { diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index b8fd0f644..a739ec754 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -45,12 +45,12 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), xnext(NULL), - fnext(NULL), springF(NULL), tangent(NULL), xsend(NULL), xrecv(NULL), - fsend(NULL), frecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), - tagsendall(NULL), tagrecvall(NULL), counts(NULL), - displacements(NULL) + id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), xnext(nullptr), + fnext(nullptr), springF(nullptr), tangent(nullptr), xsend(nullptr), xrecv(nullptr), + fsend(nullptr), frecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), + tagsendall(nullptr), tagrecvall(nullptr), counts(nullptr), + displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb command"); @@ -237,7 +237,7 @@ void FixNEB::init() if (atom->nmax > maxlocal) reallocate(); - if ((cmode == MULTI_PROC) && (counts == NULL)) { + if ((cmode == MULTI_PROC) && (counts == nullptr)) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -785,9 +785,9 @@ void FixNEB::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 6c4cba4ab..b015839f6 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -38,7 +38,7 @@ enum{NOHYPER,GLOBAL,LOCAL}; /* ---------------------------------------------------------------------- */ -Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(NULL) {} +Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(nullptr) {} /* ---------------------------------------------------------------------- perform hyperdynamics simulation @@ -91,7 +91,7 @@ void Hyper::command(int narg, char **arg) fix_hyper = (FixHyper *) modify->fix[ifix]; int dim; int *hyperflag = (int *) fix_hyper->extract("hyperflag",dim); - if (hyperflag == NULL || *hyperflag == 0) + if (hyperflag == nullptr || *hyperflag == 0) error->all(FLERR,"Hyper fix is not a valid hyperdynamics fix"); if (*hyperflag == 1) hyperstyle = GLOBAL; if (*hyperflag == 2) hyperstyle = LOCAL; @@ -353,7 +353,7 @@ void Hyper::command(int narg, char **arg) delete finish; modify->delete_fix("hyper_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -449,7 +449,7 @@ void Hyper::options(int narg, char **arg) maxeval = 50; dumpflag = 0; ndump = 0; - dumplist = NULL; + dumplist = nullptr; rebond = 0; int iarg = 0; diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 2d1dd6eea..31ce61f4c 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -391,7 +391,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -407,7 +407,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -460,7 +460,7 @@ void NEB::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust atom coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -561,7 +561,7 @@ void NEB::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index cdb1eb9b0..641714115 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -117,9 +117,9 @@ void PRD::command(int narg, char **arg) natoms = atom->natoms; - tagall = NULL; - xall = NULL; - imageall = NULL; + tagall = nullptr; + xall = nullptr; + imageall = nullptr; if (cmode != SINGLE_PROC_DIRECT) { memory->create(tagall,natoms,"prd:tagall"); @@ -127,8 +127,8 @@ void PRD::command(int narg, char **arg) memory->create(imageall,natoms,"prd:imageall"); } - counts = NULL; - displacements = NULL; + counts = nullptr; + displacements = nullptr; if (cmode == MULTI_PROC) { memory->create(counts,nprocs,"prd:counts"); @@ -465,7 +465,7 @@ void PRD::command(int narg, char **arg) modify->delete_compute("prd_temp"); modify->delete_fix("prd_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -908,16 +908,16 @@ void PRD::options(int narg, char **arg) delete [] loop_setting; delete [] dist_setting; - if (strcmp(arg[iarg+1],"all") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = NULL; + if (strcmp(arg[iarg+1],"all") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = nullptr; else error->all(FLERR,"Illegal prd command"); int n = strlen(arg[iarg+1]) + 1; loop_setting = new char[n]; strcpy(loop_setting,arg[iarg+1]); - if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = NULL; - else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = NULL; + if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = nullptr; + else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = nullptr; else error->all(FLERR,"Illegal prd command"); n = strlen(arg[iarg+2]) + 1; dist_setting = new char[n]; diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index db74b63c3..3deda0c50 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -50,7 +50,7 @@ TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {} TAD::~TAD() { memory->sfree(fix_event_list); - if (neb_logfilename != NULL) delete [] neb_logfilename; + if (neb_logfilename != nullptr) delete [] neb_logfilename; delete [] min_style; delete [] min_style_neb; } @@ -62,7 +62,7 @@ TAD::~TAD() void TAD::command(int narg, char **arg) { - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; nmin_event_list = 10; @@ -226,8 +226,8 @@ void TAD::command(int narg, char **arg) ulogfile_lammps = universe->ulogfile; uscreen_lammps = universe->uscreen; - ulogfile_neb = NULL; - uscreen_neb = NULL; + ulogfile_neb = nullptr; + uscreen_neb = nullptr; if (me_universe == 0 && neb_logfilename) ulogfile_neb = fopen(neb_logfilename,"w"); @@ -421,7 +421,7 @@ void TAD::command(int narg, char **arg) modify->delete_fix("tad_revert"); delete_event_list(); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -586,7 +586,7 @@ void TAD::options(int narg, char **arg) min_style_neb = new char[n]; strcpy(min_style_neb,"quickmin"); dt_neb = update->dt; - neb_logfilename = NULL; + neb_logfilename = nullptr; int iarg = 0; while (iarg < narg) { @@ -630,7 +630,7 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb_log") == 0) { delete [] neb_logfilename; if (iarg+2 > narg) error->all(FLERR,"Illegal tad command"); - if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL; + if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = nullptr; else { int n = strlen(arg[iarg+1]) + 1; neb_logfilename = new char[n]; @@ -885,7 +885,7 @@ void TAD::delete_event_list() { modify->delete_fix(str); } memory->sfree(fix_event_list); - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index 0cce389bf..0d15be2aa 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -147,7 +147,7 @@ void Temper::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index a5ed1a671..f6a8f5994 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -42,7 +42,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : - Verlet(lmp, narg, arg), qsize(NULL), qdisp(NULL), xsize(NULL), xdisp(NULL), f_kspace(NULL) + Verlet(lmp, narg, arg), qsize(nullptr), qdisp(nullptr), xsize(nullptr), xdisp(nullptr), f_kspace(nullptr) { // error checks on partitions @@ -194,7 +194,7 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : // allocate dummy version for Kspace partition maxatom = 0; - f_kspace = NULL; + f_kspace = nullptr; if (!master) memory->create(f_kspace,1,1,"verlet/split:f_kspace"); } @@ -289,7 +289,7 @@ void VerletSplit::run(int n) Fix *fix_omp; int ifix = modify->find_fix("package_omp"); - if (ifix < 0) fix_omp = NULL; + if (ifix < 0) fix_omp = nullptr; else fix_omp = modify->fix[ifix]; // flags for timestepping iterations diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index e15c0deb8..43e636963 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeERotateRigid::ComputeERotateRigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute erotate/rigid command"); diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 031919b7a..6ce4440d0 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeKERigid::ComputeKERigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute ke/rigid command"); diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 57f69a64e..c100db82e 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -33,7 +33,7 @@ enum{ID,MOL,MASS,X,Y,Z,XU,YU,ZU,VX,VY,VZ,FX,FY,FZ,IX,IY,IZ, ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rstyle(NULL), idrigid(NULL), fixrigid(NULL), vlocal(NULL), alocal(NULL) + rstyle(nullptr), idrigid(nullptr), fixrigid(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute rigid/local command"); @@ -89,8 +89,8 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; ncount = nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -115,8 +115,8 @@ void ComputeRigidLocal::init() fixrigid = (FixRigidSmall *) modify->fix[ifix]; int flag = 0; - if (strstr(fixrigid->style,"rigid/") == NULL) flag = 1; - if (strstr(fixrigid->style,"/small") == NULL) flag = 1; + if (strstr(fixrigid->style,"rigid/") == nullptr) flag = 1; + if (strstr(fixrigid->style,"/small") == nullptr) flag = 1; if (flag) error->all(FLERR,"Compute rigid/local does not use fix rigid/small fix"); diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 03b79cc75..6b283b2f8 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -45,8 +45,8 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), x(NULL), f(NULL), v(NULL), - mass(NULL), rmass(NULL), type(NULL), scalingmask(NULL) + idregion(nullptr), x(nullptr), f(nullptr), v(nullptr), + mass(nullptr), rmass(nullptr), type(nullptr), scalingmask(nullptr) { MPI_Comm_rank(world, &me); @@ -127,7 +127,7 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), error->all(FLERR, "You can only use the keyword 'com' together with the keyword 'constrain' "); scale = 1.0; - scalingmask = NULL; + scalingmask = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -177,7 +177,7 @@ void FixEHEX::init() if (group->count(igroup) == 0) error->all(FLERR,"Fix ehex group has no atoms"); - fshake = NULL; + fshake = nullptr; if (constraints) { // check if constraining algorithm is used (FixRattle inherits from FixShake) @@ -335,7 +335,7 @@ void FixEHEX::update_scalingmask() { // prematch region - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -354,7 +354,7 @@ void FixEHEX::update_scalingmask() { m = fshake->list[i]; // check if the centre of mass of the cluster is inside the region - // if region == NULL, just check the group information of all sites + // if region == nullptr, just check the group information of all sites if (fshake->shake_flag[m] == 1) nsites = 3; else if (fshake->shake_flag[m] == 2) nsites = 2; diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 436b2191f..07787bcbf 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -59,7 +59,7 @@ FixRattle::FixRattle(LAMMPS *lmp, int narg, char **arg) : // allocate memory for unconstrained velocity update - vp = NULL; + vp = nullptr; grow_arrays(atom->nmax); // default communication mode diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index f74cce823..c40c3b13d 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -46,16 +46,16 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), nrigid(NULL), mol2body(NULL), body2mol(NULL), - body(NULL), displace(NULL), masstotal(NULL), xcm(NULL), - vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), quat(NULL), imagebody(NULL), fflag(NULL), - tflag(NULL), langextra(NULL), sum(NULL), all(NULL), - remapflag(NULL), xcmimage(NULL), eflags(NULL), orient(NULL), - dorient(NULL), id_dilate(NULL), id_gravity(NULL), random(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), nrigid(nullptr), mol2body(nullptr), body2mol(nullptr), + body(nullptr), displace(nullptr), masstotal(nullptr), xcm(nullptr), + vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), quat(nullptr), imagebody(nullptr), fflag(nullptr), + tflag(nullptr), langextra(nullptr), sum(nullptr), all(nullptr), + remapflag(nullptr), xcmimage(nullptr), eflags(nullptr), orient(nullptr), + dorient(nullptr), id_dilate(nullptr), id_gravity(nullptr), random(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr) { int i,ibody; @@ -76,12 +76,12 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = 0; - body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -91,8 +91,8 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix rigid command"); int iarg; - mol2body = NULL; - body2mol = NULL; + mol2body = nullptr; + body2mol = nullptr; // single rigid body // nbody = 1 @@ -322,9 +322,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : t_order = 3; p_chain = 10; - inpfile = NULL; - id_gravity = NULL; - id_dilate = NULL; + inpfile = nullptr; + id_gravity = nullptr; + id_dilate = nullptr; pcouple = NONE; pstyle = ANISO; @@ -567,7 +567,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed if (langflag) random = new RanMars(lmp,seed + me); - else random = NULL; + else random = nullptr; // initialize vector output quantities in case accessed before run @@ -1930,7 +1930,7 @@ void FixRigid::setup_bodies_static() // overwrite Cartesian inertia tensor with file values - if (inpfile) readfile(1,NULL,all,NULL,NULL,NULL,inbody); + if (inpfile) readfile(1,nullptr,all,nullptr,nullptr,nullptr,inbody); // diagonalize inertia tensor for each body via Jacobi rotations // inertia = 3 eigenvalues = principal moments of inertia @@ -2281,12 +2281,12 @@ void FixRigid::readfile(int which, double *vec, if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of fix rigid file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -2327,7 +2327,7 @@ void FixRigid::readfile(int which, double *vec, values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = atoi(values[0]); if (rstyle == MOLECULE) { @@ -2390,7 +2390,7 @@ void FixRigid::write_restart_file(const char *file) auto outfile = std::string(file) + ".rigid"; FILE *fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -2711,7 +2711,7 @@ void *FixRigid::extract(const char *str, int &dim) return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 1df7f3453..0aa5f9976 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -42,12 +42,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : - FixRigid(lmp, narg, arg), conjqm(NULL), w(NULL), - wdti1(NULL), wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), - eta_t(NULL), eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), - f_eta_t(NULL), f_eta_r(NULL), q_b(NULL), eta_b(NULL), - eta_dot_b(NULL), f_eta_b(NULL), rfix(NULL), id_temp(NULL), - id_press(NULL), temperature(NULL), pressure(NULL) + FixRigid(lmp, narg, arg), conjqm(nullptr), w(nullptr), + wdti1(nullptr), wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), + eta_t(nullptr), eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), + f_eta_t(nullptr), f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), + eta_dot_b(nullptr), f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), + id_press(nullptr), temperature(nullptr), pressure(nullptr) { // error checks: could be moved up to FixRigid @@ -145,7 +145,7 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -153,8 +153,8 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -304,7 +304,7 @@ void FixRigidNH::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index d1204e2bb..b599868ec 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -44,12 +44,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : - FixRigidSmall(lmp, narg, arg), w(NULL), wdti1(NULL), - wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), eta_t(NULL), - eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), f_eta_t(NULL), - f_eta_r(NULL), q_b(NULL), eta_b(NULL), eta_dot_b(NULL), - f_eta_b(NULL), rfix(NULL), id_temp(NULL), id_press(NULL), - temperature(NULL), pressure(NULL) + FixRigidSmall(lmp, narg, arg), w(nullptr), wdti1(nullptr), + wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), eta_t(nullptr), + eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), f_eta_t(nullptr), + f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), eta_dot_b(nullptr), + f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), + temperature(nullptr), pressure(nullptr) { // error checks @@ -159,7 +159,7 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -167,8 +167,8 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -301,7 +301,7 @@ void FixRigidNHSmall::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 85cadc826..e7f67ab2b 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -54,12 +54,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), body(NULL), bodyown(NULL), bodytag(NULL), atom2body(NULL), - xcmimage(NULL), displace(NULL), eflags(NULL), orient(NULL), dorient(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL), counts(NULL), - itensor(NULL), mass_body(NULL), langextra(NULL), random(NULL), - id_dilate(NULL), id_gravity(NULL), onemols(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), body(nullptr), bodyown(nullptr), bodytag(nullptr), atom2body(nullptr), + xcmimage(nullptr), displace(nullptr), eflags(nullptr), orient(nullptr), dorient(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr), counts(nullptr), + itensor(nullptr), mass_body(nullptr), langextra(nullptr), random(nullptr), + id_dilate(nullptr), id_gravity(nullptr), onemols(nullptr) { int i; @@ -82,21 +82,21 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = customflag = 0; - bodyown = NULL; - bodytag = NULL; - atom2body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + bodyown = nullptr; + bodytag = nullptr; + atom2body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); // parse args for rigid body specification int *mask = atom->mask; - tagint *bodyID = NULL; + tagint *bodyID = nullptr; int nlocal = atom->nlocal; if (narg < 4) error->all(FLERR,"Illegal fix rigid/small command"); @@ -178,14 +178,14 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : int seed; langflag = 0; - inpfile = NULL; - onemols = NULL; + inpfile = nullptr; + onemols = nullptr; reinitflag = 1; tstat_flag = 0; pstat_flag = 0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; t_chain = 10; t_iter = 1; t_order = 3; @@ -477,13 +477,13 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed maxlang = 0; - langextra = NULL; - random = NULL; + langextra = nullptr; + random = nullptr; if (langflag) random = new RanMars(lmp,seed + comm->me); // mass vector for granular pair styles - mass_body = NULL; + mass_body = nullptr; nmax_mass = 0; // wait to setup bodies until comm stencils are defined @@ -1965,7 +1965,7 @@ void FixRigidSmall::setup_bodies_static() if (inpfile) { memory->create(inbody,nlocal_body,"rigid/small:inbody"); for (ibody = 0; ibody < nlocal_body; ibody++) inbody[ibody] = 0; - readfile(0,NULL,inbody); + readfile(0,nullptr,inbody); } // remap the xcm of each body back into simulation box @@ -2445,12 +2445,12 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid/small file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid/small file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; @@ -2490,7 +2490,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = ATOTAGINT(values[0]); if (id <= 0 || id > maxmol) @@ -2559,7 +2559,7 @@ void FixRigidSmall::write_restart_file(const char *file) if (me == 0) { auto outfile = std::string(file) + ".rigid"; fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -3432,7 +3432,7 @@ void *FixRigidSmall::extract(const char *str, int &dim) return mass_body; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index ee88f5734..c4b0c68f3 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -47,16 +47,16 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), bond_flag(NULL), angle_flag(NULL), - type_flag(NULL), mass_list(NULL), bond_distance(NULL), angle_distance(NULL), - loop_respa(NULL), step_respa(NULL), x(NULL), v(NULL), f(NULL), ftmp(NULL), - vtmp(NULL), mass(NULL), rmass(NULL), type(NULL), shake_flag(NULL), - shake_atom(NULL), shake_type(NULL), xshake(NULL), nshake(NULL), - list(NULL), b_count(NULL), b_count_all(NULL), b_ave(NULL), b_max(NULL), - b_min(NULL), b_ave_all(NULL), b_max_all(NULL), b_min_all(NULL), - a_count(NULL), a_count_all(NULL), a_ave(NULL), a_max(NULL), a_min(NULL), - a_ave_all(NULL), a_max_all(NULL), a_min_all(NULL), atommols(NULL), - onemols(NULL) + Fix(lmp, narg, arg), bond_flag(nullptr), angle_flag(nullptr), + type_flag(nullptr), mass_list(nullptr), bond_distance(nullptr), angle_distance(nullptr), + loop_respa(nullptr), step_respa(nullptr), x(nullptr), v(nullptr), f(nullptr), ftmp(nullptr), + vtmp(nullptr), mass(nullptr), rmass(nullptr), type(nullptr), shake_flag(nullptr), + shake_atom(nullptr), shake_type(nullptr), xshake(nullptr), nshake(nullptr), + list(nullptr), b_count(nullptr), b_count_all(nullptr), b_ave(nullptr), b_max(nullptr), + b_min(nullptr), b_ave_all(nullptr), b_max_all(nullptr), b_min_all(nullptr), + a_count(nullptr), a_count_all(nullptr), a_ave(nullptr), a_max(nullptr), a_min(nullptr), + a_ave_all(nullptr), a_max_all(nullptr), a_min_all(nullptr), atommols(nullptr), + onemols(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -76,13 +76,13 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; - xshake = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; + xshake = nullptr; - ftmp = NULL; - vtmp = NULL; + ftmp = nullptr; + vtmp = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -161,7 +161,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // parse optional args - onemols = NULL; + onemols = nullptr; int iarg = next; while (iarg < narg) { @@ -233,7 +233,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // initialize list of SHAKE clusters to constrain maxlist = 0; - list = NULL; + list = nullptr; } /* ---------------------------------------------------------------------- */ @@ -367,7 +367,7 @@ void FixShake::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for SHAKE"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -378,7 +378,7 @@ void FixShake::init() for (i = 1; i <= atom->nangletypes; i++) { if (angle_flag[i] == 0) continue; - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle potential must be defined for SHAKE"); // scan all atoms for a SHAKE angle cluster @@ -2976,7 +2976,7 @@ void *FixShake::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"onemol") == 0) return onemols; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 509e45202..306196210 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -35,8 +35,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomx(NULL), randomt(NULL), basistype(NULL), - spatialid(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomx(nullptr), randomt(nullptr), basistype(nullptr), + spatialid(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; @@ -48,7 +48,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : scaleflag = 1; spatflag=0; - spatialid = NULL; + spatialid = nullptr; xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0; tempflag = 0; @@ -58,8 +58,8 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : rany = 0.0; ranz = 0.0; - randomx = NULL; - randomt = NULL; + randomx = nullptr; + randomt = nullptr; if (domain->lattice->nbasis == 0) error->all(FLERR,"Fix append/atoms requires a lattice be defined"); diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 393013322..1b2e73726 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -41,9 +41,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), old_velocity(NULL), rfix(NULL), - id_temp(NULL), id_press(NULL), id_pe(NULL), temperature(NULL), - pressure(NULL), pe(NULL) + Fix(lmp, narg, arg), old_velocity(nullptr), rfix(nullptr), + id_temp(nullptr), id_press(nullptr), id_pe(nullptr), temperature(nullptr), + pressure(nullptr), pe(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix msst command"); @@ -206,10 +206,10 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : omega[0] = omega[1] = omega[2] = 0.0; nrigid = 0; - rfix = NULL; + rfix = nullptr; maxold = -1; - old_velocity = NULL; + old_velocity = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,7 +246,7 @@ int FixMSST::setmask() void FixMSST::init() { - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); // set compute ptrs @@ -287,7 +287,7 @@ void FixMSST::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^rigid") || @@ -306,7 +306,7 @@ void FixMSST::init() for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^external$")) fix_external = (FixExternal *) modify->fix[i]; - if (fix_external == NULL) + if (fix_external == nullptr) error->all(FLERR,"Fix msst dftb cannot be used w/out fix external"); } } diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 1179bb6b3..20fa909af 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -30,7 +30,7 @@ enum{ISO,ANISO,TRICLINIC}; // same as fix_nh.cpp /* ---------------------------------------------------------------------- */ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), pe(NULL), id_pe(NULL) + FixNH(lmp, narg, arg), pe(nullptr), id_pe(nullptr) { // Prevent masses from being updated every timestep diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index a796c1a4b..b37537022 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -31,15 +31,15 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomt(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomt(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; if (narg < 4) error->all(FLERR,"Illegal fix wall/piston command"); - randomt = NULL; - gfactor1 = gfactor2 = NULL; + randomt = nullptr; + gfactor1 = gfactor2 = nullptr; tempflag = 0; scaleflag = 1; roughflag = 0; diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 37b82b86f..66d6abfb7 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), sna(nullptr), + radelem(nullptr), wjelem(nullptr) { double rmin0, rfac0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -145,7 +145,7 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - sna = NULL; + sna = nullptr; } /* ---------------------------------------------------------------------- */ @@ -163,7 +163,7 @@ ComputeSNAAtom::~ComputeSNAAtom() void ComputeSNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute sna/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index bb546708b..e08679a37 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snad(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -147,7 +147,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snad = NULL; + snad = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeSNADAtom::~ComputeSNADAtom() void ComputeSNADAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snad/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index ca989a75b..5537d2c93 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -32,9 +32,9 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snap(NULL), - snapall(NULL), snap_peratom(NULL), radelem(NULL), wjelem(NULL), - snaptr(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snap(nullptr), + snapall(nullptr), snap_peratom(nullptr), radelem(nullptr), wjelem(nullptr), + snaptr(nullptr) { array_flag = 1; @@ -42,8 +42,8 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -180,7 +180,7 @@ ComputeSnap::~ComputeSnap() void ComputeSnap::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snap requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index dd562cac5..cace5e532 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -29,13 +29,13 @@ using namespace LAMMPS_NS; ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snav(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -140,7 +140,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snav = NULL; + snav = nullptr; } @@ -160,7 +160,7 @@ ComputeSNAVAtom::~ComputeSNAVAtom() void ComputeSNAVAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snav/atom requires a pair style be defined"); // TODO: Not sure what to do with this error check since cutoff radius is not // a single number diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index cb1a71aa4..e3b8fdfa9 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -42,15 +42,15 @@ PairSNAP::PairSNAP(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - coeffelem = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + coeffelem = nullptr; beta_max = 0; - beta = NULL; - bispectrum = NULL; - snaptr = NULL; + beta = nullptr; + bispectrum = nullptr; + snaptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -516,7 +516,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpcoeff; if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); - if (fpcoeff == NULL) { + if (fpcoeff == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP coefficient file %s",coefffilename); error->one(FLERR,str); @@ -531,7 +531,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -556,7 +556,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); ncoeffall = atoi(words[1]); @@ -574,7 +574,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -592,9 +592,9 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); iword = 2; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); char* elemtmp = words[0]; int n = strlen(elemtmp) + 1; @@ -615,7 +615,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) for (int icoeff = 0; icoeff < ncoeffall; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -663,7 +663,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpparam; if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); - if (fpparam == NULL) { + if (fpparam == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP parameter file %s",paramfilename); error->one(FLERR,str); @@ -674,7 +674,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -697,7 +697,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { if (screen) fprintf(screen,"SNAP keyword %s %s \n",keywd,keyval); diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index e003ec7ca..ae250c6f7 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -134,16 +134,16 @@ SNA::SNA(LAMMPS* lmp, double rfac0_in, int twojmax_in, compute_ncoeff(); - rij = NULL; - inside = NULL; - wj = NULL; - rcutij = NULL; - element = NULL; + rij = nullptr; + inside = nullptr; + wj = nullptr; + rcutij = nullptr; + element = nullptr; nmax = 0; - idxz = NULL; - idxb = NULL; - ulist_r_ij = NULL; - ulist_i_ij = NULL; + idxz = nullptr; + idxb = nullptr; + ulist_r_ij = nullptr; + ulist_i_ij = nullptr; build_indexlist(); create_twojmax_arrays(); @@ -1332,7 +1332,7 @@ void SNA::create_twojmax_arrays() if (bzero_flag) memory->create(bzero, twojmax+1,"sna:bzero"); else - bzero = NULL; + bzero = nullptr; } diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 281100740..32f9e7351 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -41,7 +41,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeSpin::ComputeSpin(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), pair(NULL), spin_pairs(NULL) + Compute(lmp, narg, arg), pair(nullptr), spin_pairs(nullptr) { if ((narg != 3) && (narg != 4)) error->all(FLERR,"Illegal compute compute/spin command"); diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 82bf83ac1..2b3aa363f 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_temp(NULL), random(NULL) + Fix(lmp, narg, arg), id_temp(nullptr), random(nullptr) { if (narg != 6) error->all(FLERR,"Illegal langevin/spin command"); diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 0b2e86e46..b2982e7bc 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -46,13 +46,13 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; /* ---------------------------------------------------------------------- */ FixNEBSpin::FixNEBSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), - xnext(NULL), fnext(NULL), spprev(NULL), spnext(NULL), fmnext(NULL), springF(NULL), - tangent(NULL), xsend(NULL), xrecv(NULL), fsend(NULL), frecv(NULL), spsend(NULL), - sprecv(NULL), fmsend(NULL), fmrecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), spsendall(NULL), - sprecvall(NULL), fmsendall(NULL), fmrecvall(NULL), tagsendall(NULL), tagrecvall(NULL), - counts(NULL), displacements(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), + xnext(nullptr), fnext(nullptr), spprev(nullptr), spnext(nullptr), fmnext(nullptr), springF(nullptr), + tangent(nullptr), xsend(nullptr), xrecv(nullptr), fsend(nullptr), frecv(nullptr), spsend(nullptr), + sprecv(nullptr), fmsend(nullptr), fmrecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), spsendall(nullptr), + sprecvall(nullptr), fmsendall(nullptr), fmrecvall(nullptr), tagsendall(nullptr), tagrecvall(nullptr), + counts(nullptr), displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb_spin command"); @@ -229,7 +229,7 @@ void FixNEBSpin::init() if (atom->nmax > maxlocal) reallocate(); - if (MULTI_PROC && counts == NULL) { + if (MULTI_PROC && counts == nullptr) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -861,9 +861,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } if (spsend) { @@ -872,9 +872,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fmsend[0],3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, spsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 462a359d9..d74e82e50 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -60,9 +60,9 @@ enum{NONE}; FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), spin_pairs(NULL), - rsec(NULL), stack_head(NULL), stack_foot(NULL), - backward_stacks(NULL), forward_stacks(NULL) + pair(nullptr), spin_pairs(nullptr), + rsec(nullptr), stack_head(nullptr), stack_foot(nullptr), + backward_stacks(nullptr), forward_stacks(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_nve_spin); diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index cbb367e43..f4dfddd3c 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -44,7 +44,7 @@ enum{CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ -FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(NULL) +FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(nullptr) { if (narg < 7) error->all(FLERR,"Illegal precession/spin command"); @@ -59,7 +59,7 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm respa_level_support = 1; ilevel_respa = 0; - magstr = NULL; + magstr = nullptr; magfieldstyle = CONSTANT; H_field = 0.0; diff --git a/src/SPIN/fix_setforce_spin.cpp b/src/SPIN/fix_setforce_spin.cpp index ec738b752..1f38ee43e 100644 --- a/src/SPIN/fix_setforce_spin.cpp +++ b/src/SPIN/fix_setforce_spin.cpp @@ -52,7 +52,7 @@ void FixSetForceSpin::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -124,7 +124,7 @@ void FixSetForceSpin::single_setforce_spin(int i, double fmi[3]) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -195,7 +195,7 @@ void FixSetForceSpin::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index 4b8b74541..817c14939 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -60,7 +60,7 @@ static const char cite_minstyle_spin_cg[] = /* ---------------------------------------------------------------------- */ MinSpinCG::MinSpinCG(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_cg); nlocal_max = 0; diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index 40029b7e7..edabcf6bb 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -60,7 +60,7 @@ static const char cite_minstyle_spin_lbfgs[] = /* ---------------------------------------------------------------------- */ MinSpinLBFGS::MinSpinLBFGS(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), rho(NULL), ds(NULL), dy(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), rho(nullptr), ds(nullptr), dy(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_lbfgs); nlocal_max = 0; diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index a89ca403c..322249e02 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -384,7 +384,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -398,7 +398,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -452,7 +452,7 @@ void NEBSpin::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust spin coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -705,7 +705,7 @@ void NEBSpin::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index b0965d127..53dd6530b 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -42,7 +42,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(NULL) +PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(nullptr) { hbar = force->hplanck/MY_2PI; single_enable = 0; diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 8bbb27ed0..9db2bd417 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -27,7 +27,7 @@ friend class FixNVESpin; virtual void coeff(int, char **) {} virtual void init_style(); virtual double init_one(int, int) {return 0.0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void compute(int, int) {} virtual void compute_single_pair(int, double *) {} diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index b27c9736b..7444be347 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -154,7 +154,7 @@ void *PairSpinDipoleCut::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -448,11 +448,11 @@ void PairSpinDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -477,8 +477,8 @@ void PairSpinDipoleCut::write_restart_settings(FILE *fp) void PairSpinDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dipole_long.cpp b/src/SPIN/pair_spin_dipole_long.cpp index d4b1b8e43..28a70a047 100644 --- a/src/SPIN/pair_spin_dipole_long.cpp +++ b/src/SPIN/pair_spin_dipole_long.cpp @@ -133,7 +133,7 @@ void PairSpinDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -174,7 +174,7 @@ void *PairSpinDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -527,11 +527,11 @@ void PairSpinDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -556,8 +556,8 @@ void PairSpinDipoleLong::write_restart_settings(FILE *fp) void PairSpinDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index e27f9fad7..e2ddd708d 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -156,7 +156,7 @@ void *PairSpinDmi::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_dmi_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -477,18 +477,18 @@ void PairSpinDmi::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&DM[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_dmx[i][j],1,MPI_DOUBLE,0,world); @@ -522,9 +522,9 @@ void PairSpinDmi::write_restart_settings(FILE *fp) void PairSpinDmi::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_dmi_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 27da47dd0..ba9bddb7c 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -141,7 +141,7 @@ void *PairSpinExchange::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_exchange_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -467,15 +467,15 @@ void PairSpinExchange::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&J1_mag[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&J1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -506,9 +506,9 @@ void PairSpinExchange::write_restart_settings(FILE *fp) void PairSpinExchange::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_exchange_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 2242cf985..849590bad 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -149,7 +149,7 @@ void *PairSpinMagelec::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_magelec_global; - return NULL; + return nullptr; } @@ -465,15 +465,15 @@ void PairSpinMagelec::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&ME[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_mex[i][j],1,MPI_DOUBLE,0,world); @@ -503,9 +503,9 @@ void PairSpinMagelec::write_restart_settings(FILE *fp) void PairSpinMagelec::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_magelec_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 33ea904c0..1e50ee48a 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -156,7 +156,7 @@ void *PairSpinNeel::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_neel_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -681,19 +681,19 @@ void PairSpinNeel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&g1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&g1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -727,9 +727,9 @@ void PairSpinNeel::write_restart_settings(FILE *fp) void PairSpinNeel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_neel_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 688522c1b..50a27b5fa 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -77,12 +77,12 @@ static const char cite_fix_srd[] = /* ---------------------------------------------------------------------- */ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - wallfix(NULL), wallwhich(NULL), xwall(NULL), xwallhold(NULL), - vwall(NULL), fwall(NULL), avec_ellipsoid(NULL), avec_line(NULL), - avec_tri(NULL), random(NULL), randomshift(NULL), flocal(NULL), - tlocal(NULL), biglist(NULL), binhead(NULL), binnext(NULL), sbuf1(NULL), - sbuf2(NULL), rbuf1(NULL), rbuf2(NULL), nbinbig(NULL), binbig(NULL), - binsrd(NULL), stencil(NULL) + wallfix(nullptr), wallwhich(nullptr), xwall(nullptr), xwallhold(nullptr), + vwall(nullptr), fwall(nullptr), avec_ellipsoid(nullptr), avec_line(nullptr), + avec_tri(nullptr), random(nullptr), randomshift(nullptr), flocal(nullptr), + tlocal(nullptr), biglist(nullptr), binhead(nullptr), binnext(nullptr), sbuf1(nullptr), + sbuf2(nullptr), rbuf1(nullptr), rbuf2(nullptr), nbinbig(nullptr), binbig(nullptr), + binsrd(nullptr), stencil(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_srd); @@ -232,7 +232,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) randomshift = new RanPark(lmp,shiftseed); - else randomshift = NULL; + else randomshift = nullptr; // initialize data structs and flags @@ -240,31 +240,31 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), else biggroupbit = 0; nmax = 0; - binhead = NULL; + binhead = nullptr; maxbin1 = 0; - binnext = NULL; + binnext = nullptr; maxbuf = 0; - sbuf1 = sbuf2 = rbuf1 = rbuf2 = NULL; + sbuf1 = sbuf2 = rbuf1 = rbuf2 = nullptr; shifts[0].maxvbin = shifts[1].maxvbin = 0; - shifts[0].vbin = shifts[1].vbin = NULL; + shifts[0].vbin = shifts[1].vbin = nullptr; shifts[0].maxbinsq = shifts[1].maxbinsq = 0; for (int ishift = 0; ishift < 2; ishift++) for (int iswap = 0; iswap < 6; iswap++) shifts[ishift].bcomm[iswap].sendlist = - shifts[ishift].bcomm[iswap].recvlist = NULL; + shifts[ishift].bcomm[iswap].recvlist = nullptr; maxbin2 = 0; - nbinbig = NULL; - binbig = NULL; - binsrd = NULL; + nbinbig = nullptr; + binbig = nullptr; + binsrd = nullptr; nstencil = maxstencil = 0; - stencil = NULL; + stencil = nullptr; maxbig = 0; - biglist = NULL; + biglist = nullptr; stats_flag = 1; for (int i = 0; i < size_vector; i++) stats_all[i] = 0.0; @@ -1367,7 +1367,7 @@ void FixSRD::collisions_single() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1, xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1387,7 +1387,7 @@ void FixSRD::collisions_single() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) @@ -1557,7 +1557,7 @@ void FixSRD::collisions_multi() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1,xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1576,7 +1576,7 @@ void FixSRD::collisions_multi() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index 8ffd76444..aa8a4140a 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -34,7 +34,7 @@ enum{NONE,EDGE,CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), nwall(0), fwall(NULL), fwall_all(NULL) + Fix(lmp, narg, arg), nwall(0), fwall(nullptr), fwall_all(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/srd command"); diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 063dc542b..5df63682b 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -50,7 +50,7 @@ extern "C" { #define MPI_GROUP_EMPTY -1 #define MPI_ANY_SOURCE -1 -#define MPI_STATUS_IGNORE NULL +#define MPI_STATUS_IGNORE nullptr #define MPI_Comm int #define MPI_Request int @@ -60,7 +60,7 @@ extern "C" { #define MPI_Group int #define MPI_Offset long -#define MPI_IN_PLACE NULL +#define MPI_IN_PLACE nullptr #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 diff --git a/src/USER-ADIOS/dump_atom_adios.cpp b/src/USER-ADIOS/dump_atom_adios.cpp index 3012223ac..121bb193e 100644 --- a/src/USER-ADIOS/dump_atom_adios.cpp +++ b/src/USER-ADIOS/dump_atom_adios.cpp @@ -190,7 +190,7 @@ void DumpAtomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); diff --git a/src/USER-ADIOS/dump_custom_adios.cpp b/src/USER-ADIOS/dump_custom_adios.cpp index f7015ef69..921c725bc 100644 --- a/src/USER-ADIOS/dump_custom_adios.cpp +++ b/src/USER-ADIOS/dump_custom_adios.cpp @@ -274,7 +274,7 @@ void DumpCustomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); diff --git a/src/USER-ADIOS/reader_adios.cpp b/src/USER-ADIOS/reader_adios.cpp index d1e731343..89a9ae698 100644 --- a/src/USER-ADIOS/reader_adios.cpp +++ b/src/USER-ADIOS/reader_adios.cpp @@ -73,7 +73,7 @@ public: ReaderADIOS::ReaderADIOS(LAMMPS *lmp) : Reader(lmp) { - fieldindex = NULL; + fieldindex = nullptr; nAtoms = 0; nAtomsTotal = 0; atomOffset = 0; @@ -230,7 +230,7 @@ void ReaderADIOS::skip() { internal->fh.EndStep(); } match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index dd0267646..e5e42115f 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -48,7 +48,7 @@ using std::string; /* ------------------------------------------------------------------------- */ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - lammps_(lmp), atc_(NULL) + lammps_(lmp), atc_(nullptr) { // ID GROUP atc PHYSICSTYPE [PARAMETERFILE] if (narg < 4 || narg > 5) lmp->error->all(FLERR,"Illegal fix atc command"); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 5e23b7fc6..870a15407 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -49,8 +49,8 @@ PairAWPMDCut::PairAWPMDCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_var = NULL; - min_varforce = NULL; + min_var = nullptr; + min_varforce = nullptr; nextra = 4; pvector = new double[nextra]; @@ -82,7 +82,7 @@ PairAWPMDCut::~PairAWPMDCut() struct cmp_x{ double **xx; double tol; - cmp_x(double **xx_=NULL, double tol_=1e-12):xx(xx_),tol(tol_){} + cmp_x(double **xx_=nullptr, double tol_=1e-12):xx(xx_),tol(tol_){} bool operator()(const pair &left, const pair &right) const { if(left.first==right.first){ double d=xx[left.second][0]-xx[right.second][0]; @@ -241,7 +241,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) error->all(FLERR,logfmt("Invalid spin value (%d) for particle %d !",spin[i],i)); } // ion force vector - Vector_3 *fi=NULL; + Vector_3 *fi=nullptr; if(wpmd->ni) fi= new Vector_3[wpmd->ni]; @@ -269,7 +269,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) atom->ervel[i]=pv/(m*ermscale); } } - wpmd->set_pbc(NULL); // not required for LAMMPS + wpmd->set_pbc(nullptr); // not required for LAMMPS wpmd->interaction(0x1|0x4|0x10,fi); // get forces from the AWPMD solver object @@ -602,10 +602,10 @@ void PairAWPMDCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -629,9 +629,9 @@ void PairAWPMDCut::write_restart_settings(FILE *fp) void PairAWPMDCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index a4b8de84b..46aabf790 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -39,7 +39,7 @@ using namespace LAMMPS_NS; ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure/bocs command"); if (igroup) error->all(FLERR,"Compute pressure/bocs must use group all"); @@ -52,12 +52,12 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : timeflag = 1; p_match_flag = 0; - phi_coeff = NULL; + phi_coeff = nullptr; // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -104,15 +104,15 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure/bocs requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; - splines = NULL; + splines = nullptr; spline_length = 0; } @@ -149,7 +149,7 @@ void ComputePressureBocs::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairflag && force->pair) nvirial++; if (bondflag && atom->molecular && force->bond) nvirial++; @@ -179,7 +179,7 @@ void ComputePressureBocs::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* Extra functions added for BOCS */ diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 6f7962c83..0dad793fd 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -75,10 +75,10 @@ const int MAX_MESSAGE_LENGTH = 255; FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_bocs_package); @@ -98,7 +98,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -113,12 +113,12 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; - p_match_coeffs = NULL; + p_match_coeffs = nullptr; - splines = NULL; + splines = nullptr; spline_length = 0; // turn on tilt factor scaling, whenever applicable @@ -385,10 +385,10 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -481,7 +481,7 @@ FixBocs::~FixBocs() if (p_match_coeffs) free(p_match_coeffs); // Free splines memory structure - if (splines != NULL) { + if (splines != nullptr) { memory->destroy(splines); spline_length = 0; } @@ -629,7 +629,7 @@ void FixBocs::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -918,7 +918,7 @@ void FixBocs::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1924,7 +1924,7 @@ void *FixBocs::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index c9540bf0c..f135c6b7e 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -359,9 +359,9 @@ void BondOxdnaFene::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&Delta[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index 662d55c59..6ddf03518 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -815,47 +815,47 @@ void PairOxdna2Coaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,nullptr,error); } @@ -919,9 +919,9 @@ void PairOxdna2Coaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1023,5 +1023,5 @@ void *PairOxdna2Coaxstk::extract(const char *str, int &dim) if (strcmp(str,"AA_cxst1") == 0) return (void *) AA_cxst1; if (strcmp(str,"BB_cxst1") == 0) return (void *) BB_cxst1; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna2_dh.cpp b/src/USER-CGDNA/pair_oxdna2_dh.cpp index f23ca4fbf..1c4bd3bf0 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxdna2_dh.cpp @@ -437,16 +437,16 @@ void PairOxdna2Dh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -479,9 +479,9 @@ void PairOxdna2Dh::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -531,5 +531,5 @@ void *PairOxdna2Dh::extract(const char *str, int &dim) if (strcmp(str,"cut_dh_ast") == 0) return (void *) cut_dh_ast; if (strcmp(str,"cut_dh_c") == 0) return (void *) cut_dh_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp index f1d425a0b..3a1ee3d12 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp @@ -974,53 +974,53 @@ void PairOxdnaCoaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1090,9 +1090,9 @@ void PairOxdnaCoaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1205,5 +1205,5 @@ void *PairOxdnaCoaxstk::extract(const char *str, int &dim) if (strcmp(str,"b_cxst4p") == 0) return (void *) b_cxst4p; if (strcmp(str,"cosphi_cxst4p_c") == 0) return (void *) cosphi_cxst4p_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_excv.cpp b/src/USER-CGDNA/pair_oxdna_excv.cpp index ad96186b6..64881cae2 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna_excv.cpp @@ -696,26 +696,26 @@ void PairOxdnaExcv::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -758,9 +758,9 @@ void PairOxdnaExcv::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -824,5 +824,5 @@ void *PairOxdnaExcv::extract(const char *str, int &dim) if (strcmp(str,"b_bb") == 0) return (void *) b_bb; if (strcmp(str,"cut_bb_c") == 0) return (void *) cut_bb_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_hbond.cpp b/src/USER-CGDNA/pair_oxdna_hbond.cpp index 7987210d7..009b96717 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.cpp +++ b/src/USER-CGDNA/pair_oxdna_hbond.cpp @@ -986,58 +986,58 @@ void PairOxdnaHbond::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1112,9 +1112,9 @@ void PairOxdnaHbond::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1232,5 +1232,5 @@ void *PairOxdnaHbond::extract(const char *str, int &dim) if (strcmp(str,"b_hb8") == 0) return (void *) b_hb8; if (strcmp(str,"dtheta_hb8_c") == 0) return (void *) dtheta_hb8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_stk.cpp b/src/USER-CGDNA/pair_oxdna_stk.cpp index bf52d6118..87b22f446 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.cpp +++ b/src/USER-CGDNA/pair_oxdna_stk.cpp @@ -1094,49 +1094,49 @@ void PairOxdnaStk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1202,9 +1202,9 @@ void PairOxdnaStk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1308,5 +1308,5 @@ void *PairOxdnaStk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_xstk.cpp b/src/USER-CGDNA/pair_oxdna_xstk.cpp index 175149968..29c78c103 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_xstk.cpp @@ -933,56 +933,56 @@ void PairOxdnaXstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1055,9 +1055,9 @@ void PairOxdnaXstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1173,5 +1173,5 @@ void *PairOxdnaXstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_stk.cpp b/src/USER-CGDNA/pair_oxrna2_stk.cpp index fd0294613..fff552908 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_stk.cpp @@ -1191,55 +1191,55 @@ void PairOxrna2Stk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1311,9 +1311,9 @@ void PairOxrna2Stk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1427,5 +1427,5 @@ void *PairOxrna2Stk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.cpp b/src/USER-CGDNA/pair_oxrna2_xstk.cpp index 673ef1c9a..9fe4bebab 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_xstk.cpp @@ -855,50 +855,50 @@ void PairOxrna2Xstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -965,9 +965,9 @@ void PairOxrna2Xstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1073,5 +1073,5 @@ void *PairOxrna2Xstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGSDK/angle_sdk.cpp b/src/USER-CGSDK/angle_sdk.cpp index 6f97d2104..bdcb03c3c 100644 --- a/src/USER-CGSDK/angle_sdk.cpp +++ b/src/USER-CGSDK/angle_sdk.cpp @@ -290,7 +290,7 @@ void AngleSDK::init_style() if (repflag) { int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle style SDK requires use of a compatible with Pair style"); lj1 = (double **) force->pair->extract("lj1",itmp); @@ -333,9 +333,9 @@ void AngleSDK::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index 8185e2487..6c3e15089 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -374,14 +374,14 @@ void PairLJSDK::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -411,10 +411,10 @@ void PairLJSDK::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -484,7 +484,7 @@ void *PairLJSDK::extract(const char *str, int &dim) if (strcmp(str,"lj4") == 0) return (void *) lj4; if (strcmp(str,"rminsq") == 0) return (void *) rminsq; if (strcmp(str,"emin") == 0) return (void *) emin; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 42f1ff3ce..2e21bdd10 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -51,7 +51,7 @@ PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -361,13 +361,13 @@ void PairLJSDKCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables (no rRESPA support yet) - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -466,14 +466,14 @@ void PairLJSDKCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -505,13 +505,13 @@ void PairLJSDKCoulLong::write_restart_settings(FILE *fp) void PairLJSDKCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -643,7 +643,7 @@ void *PairLJSDKCoulLong::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp index 8aa16b4ad..9818b7c51 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp @@ -37,7 +37,7 @@ PairLJSDKCoulMSM::PairLJSDKCoulMSM(LAMMPS *lmp) : PairLJSDKCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; respa_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,6 +308,6 @@ void *PairLJSDKCoulMSM::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"cut_msm") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp index dabb0bf92..f265271bb 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.cpp +++ b/src/USER-COLVARS/colvarproxy_lammps.cpp @@ -179,9 +179,9 @@ int colvarproxy_lammps::read_state_file(char const *state_filename) colvarproxy_lammps::~colvarproxy_lammps() { delete _random; - if (colvars != NULL) { + if (colvars != nullptr) { delete colvars; - colvars = NULL; + colvars = nullptr; } } diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index fcbfb5845..eaa0d272c 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -194,7 +194,7 @@ int inthash_lookup(void *ptr, int key) { /* find the entry in the hash table */ h=inthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -246,7 +246,7 @@ void inthash_destroy(inthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -254,7 +254,7 @@ void inthash_destroy(inthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(inthash_t)); } @@ -276,7 +276,7 @@ int FixColvars::instances=0; optional keyword value pairs: input (for restarting/continuing, defaults to - NULL, but set to at end) + nullptr, but set to at end) output (defaults to 'out') seed (seed for RNG, defaults to '1966') tstat (label of thermostatting fix) @@ -305,9 +305,9 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : rng_seed = 1966; unwrap_flag = 1; - inp_name = NULL; - out_name = NULL; - tmp_name = NULL; + inp_name = nullptr; + out_name = nullptr; + tmp_name = nullptr; /* parse optional arguments */ int argsdone = 4; @@ -346,10 +346,10 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : nlevels_respa = 0; init_flag = 0; num_coords = 0; - comm_buf = NULL; - force_buf = NULL; - proxy = NULL; - idmap = NULL; + comm_buf = nullptr; + force_buf = nullptr; + proxy = nullptr; + idmap = nullptr; /* storage required to communicate a single coordinate or force. */ size_one = sizeof(struct commdata); @@ -445,7 +445,7 @@ void FixColvars::one_time_init() if (inp_name) { if (strcmp(inp_name,"NULL") == 0) { memory->sfree(inp_name); - inp_name = NULL; + inp_name = nullptr; } } @@ -961,7 +961,7 @@ void FixColvars::write_restart(FILE *fp) proxy->serialize_status(rest_text); // TODO call write_output_files() const char *cvm_state = rest_text.c_str(); - int len = strlen(cvm_state) + 1; // need to include terminating NULL byte. + int len = strlen(cvm_state) + 1; // need to include terminating nullptr byte. fwrite(&len,sizeof(int),1,fp); fwrite(cvm_state,1,len,fp); } diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 07a8ac2d5..37b853ba9 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -143,7 +143,7 @@ void Group2Ndx::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for writing"); if (screen) diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index bab1592b1..e09084ebf 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -36,13 +36,13 @@ static char *find_section(FILE *fp, const char *name) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - if ((t != NULL) && *t == '[') { - t = strtok(NULL," \t\n\r\f"); - if (t != NULL) { + if ((t != nullptr) && *t == '[') { + t = strtok(nullptr," \t\n\r\f"); + if (t != nullptr) { n = t; - t = strtok(NULL," \t\n\r\f"); - if ((t != NULL) && *t == ']') { - if ((name == NULL) || strcmp(name,n) == 0) { + t = strtok(nullptr," \t\n\r\f"); + if ((t != nullptr) && *t == ']') { + if ((name == nullptr) || strcmp(name,n) == 0) { int l = strlen(n); r = new char[l+1]; strncpy(r,n,l+1); @@ -52,7 +52,7 @@ static char *find_section(FILE *fp, const char *name) } } } - return NULL; + return nullptr; } static tagint *read_section(FILE *fp, bigint &num) @@ -68,7 +68,7 @@ static tagint *read_section(FILE *fp, bigint &num) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - while (t != NULL) { + while (t != nullptr) { // start of a new section. we are done here. if (*t == '[') return tagbuf; @@ -77,7 +77,7 @@ static tagint *read_section(FILE *fp, bigint &num) nmax += DELTA; tagbuf = (tagint *)realloc(tagbuf,sizeof(tagint)*nmax); } - t = strtok(NULL," \t\n\r\f"); + t = strtok(nullptr," \t\n\r\f"); } } return tagbuf; @@ -90,7 +90,7 @@ void Ndx2Group::command(int narg, char **arg) int len; bigint num; FILE *fp; - char *name = NULL; + char *name = nullptr; tagint *tags; if (narg < 1) error->all(FLERR,"Illegal ndx2group command"); @@ -100,7 +100,7 @@ void Ndx2Group::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for reading"); if (screen) @@ -117,15 +117,15 @@ void Ndx2Group::command(int narg, char **arg) // find the next section. // if we had processed a section, before we need to step back - if (name != NULL) { + if (name != nullptr) { rewind(fp); char *tmp = find_section(fp,name); delete[] tmp; delete[] name; - name = NULL; + name = nullptr; } - name = find_section(fp,NULL); - if (name != NULL) { + name = find_section(fp,nullptr); + if (name != nullptr) { len=strlen(name)+1; // skip over group "all", which is called "System" in gromacs @@ -171,10 +171,10 @@ void Ndx2Group::command(int narg, char **arg) len = 0; // find named section, search from beginning of file - if (name != NULL) delete[] name; + if (name != nullptr) delete[] name; rewind(fp); name = find_section(fp,arg[idx]); - if (name != NULL) len=strlen(name)+1; + if (name != nullptr) len=strlen(name)+1; if (screen) fprintf(screen," %s group '%s'\n", diff --git a/src/USER-DIFFRACTION/compute_saed.cpp b/src/USER-DIFFRACTION/compute_saed.cpp index d16fbf287..f35ea6679 100644 --- a/src/USER-DIFFRACTION/compute_saed.cpp +++ b/src/USER-DIFFRACTION/compute_saed.cpp @@ -49,7 +49,7 @@ static const char cite_compute_saed_c[] = /* ---------------------------------------------------------------------- */ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_saed_c); diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp index b48de49c8..633467fe3 100644 --- a/src/USER-DIFFRACTION/compute_xrd.cpp +++ b/src/USER-DIFFRACTION/compute_xrd.cpp @@ -50,7 +50,7 @@ static const char cite_compute_xrd_c[] = /* ---------------------------------------------------------------------- */ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_xrd_c); diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 39382264c..00cfcbf91 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -40,8 +40,8 @@ enum{FIRST,MULTI}; /* ---------------------------------------------------------------------- */ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ids(NULL), fp(NULL), vector(NULL), - vector_total(NULL), vector_list(NULL), compute_saed(NULL), filename(NULL) + Fix(lmp, narg, arg), ids(nullptr), fp(nullptr), vector(nullptr), + vector_total(nullptr), vector_list(nullptr), compute_saed(nullptr), filename(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix saed/vtk command"); @@ -66,7 +66,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : options(narg,arg); which = 0; - ids = NULL; + ids = nullptr; nvalues = 0; @@ -136,8 +136,8 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; if (ave == WINDOW) memory->create(vector_list,nwindow,nvalues,"saed/vtk:vector_list"); @@ -145,7 +145,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : memory->create(vector,nrows,"saed/vtk:vector"); memory->create(vector_total,nrows,"saed/vtk:vector_total"); - extlist = NULL; + extlist = nullptr; vector_flag = 1; size_vector = nrows; @@ -425,7 +425,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); @@ -531,7 +531,7 @@ void FixSAEDVTK::options(int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; overwrite = 0; @@ -552,7 +552,7 @@ void FixSAEDVTK::options(int narg, char **arg) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); diff --git a/src/USER-DPD/compute_dpd_atom.cpp b/src/USER-DPD/compute_dpd_atom.cpp index 0fd732f66..95141e2de 100644 --- a/src/USER-DPD/compute_dpd_atom.cpp +++ b/src/USER-DPD/compute_dpd_atom.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDpdAtom::ComputeDpdAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), dpdAtom(NULL) + Compute(lmp, narg, arg), dpdAtom(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dpd/atom command"); diff --git a/src/USER-DPD/fix_dpd_energy.cpp b/src/USER-DPD/fix_dpd_energy.cpp index 6ee88ea88..674bf0e13 100644 --- a/src/USER-DPD/fix_dpd_energy.cpp +++ b/src/USER-DPD/fix_dpd_energy.cpp @@ -28,12 +28,12 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) : { if (narg != 3 ) error->all(FLERR,"Illegal fix dpd/energy command"); - pairDPDE = NULL; + pairDPDE = nullptr; pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy"); if (!(atom->dpd_flag)) error->all(FLERR,"Must use atom_style dpd/fdt/energy with fix dpd/energy"); diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index 57cfe03dc..00cbda167 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -31,7 +31,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix eos/table command"); nevery = 1; @@ -43,7 +43,7 @@ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : if (tablength < 2) error->all(FLERR,"Illegal number of eos/table entries"); ntables = 0; - tables = NULL; + tables = nullptr; int me; MPI_Comm_rank(world,&me); tables = (Table *) @@ -167,10 +167,10 @@ void FixEOStable::end_of_step() void FixEOStable::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -198,7 +198,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -207,7 +207,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -305,13 +305,13 @@ void FixEOStable::param_extract(Table *tb, Table *tb2, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); tb2->ninput = atoi(word); } else { error->one(FLERR,"Invalid keyword in fix eos/table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"fix eos/table parameters did not set N"); diff --git a/src/USER-DPD/fix_eos_table_rx.cpp b/src/USER-DPD/fix_eos_table_rx.cpp index c220d84a5..d01b2015d 100644 --- a/src/USER-DPD/fix_eos_table_rx.cpp +++ b/src/USER-DPD/fix_eos_table_rx.cpp @@ -42,8 +42,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL), - tables2(NULL), dHf(NULL), eosSpecies(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr), + tables2(nullptr), dHf(nullptr), eosSpecies(nullptr) { if (narg != 8 && narg != 10) error->all(FLERR,"Illegal fix eos/table/rx command"); nevery = 1; @@ -64,9 +64,9 @@ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : if (tablength < 2) error->all(FLERR,"Illegal number of eos/table/rx entries"); ntables = 0; - tables = NULL; - tables2 = NULL; - eosSpecies = NULL; + tables = nullptr; + tables2 = nullptr; + eosSpecies = nullptr; int me; MPI_Comm_rank(world,&me); @@ -306,10 +306,10 @@ void FixEOStableRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open eos table/rx potential file %s",file); error->one(FLERR,str); @@ -324,7 +324,7 @@ void FixEOStableRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -346,7 +346,7 @@ void FixEOStableRX::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -366,7 +366,7 @@ void FixEOStableRX::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -388,10 +388,10 @@ void FixEOStableRX::read_file(char *file) void FixEOStableRX::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -419,7 +419,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -428,7 +428,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -482,7 +482,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) } nwords = 0; word = strtok(line," \t\n\r\f"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); rtmp = atof(word); for (int icolumn=0;icolumnrfile[i] = rtmp; @@ -574,11 +574,11 @@ void FixEOStableRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); if(rx_flag){ while (word) { @@ -592,7 +592,7 @@ void FixEOStableRX::param_extract(Table *tb, char *line) printf("name=%s not found in species list\n",word); error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } for (int icolumn = 0; icolumn < ncolumn; icolumn++) diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp index d974d1247..07d39d0de 100644 --- a/src/USER-DPD/fix_rx.cpp +++ b/src/USER-DPD/fix_rx.cpp @@ -67,23 +67,23 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; /* ---------------------------------------------------------------------- */ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mol2param(NULL), nreactions(0), - params(NULL), Arr(NULL), nArr(NULL), Ea(NULL), tempExp(NULL), - stoich(NULL), stoichReactants(NULL), stoichProducts(NULL), kR(NULL), - pairDPDE(NULL), dpdThetaLocal(NULL), sumWeights(NULL), sparseKinetics_nu(NULL), - sparseKinetics_nuk(NULL), sparseKinetics_inu(NULL), sparseKinetics_isIntegralReaction(NULL), - kineticsFile(NULL), id_fix_species(NULL), - id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL) + Fix(lmp, narg, arg), mol2param(nullptr), nreactions(0), + params(nullptr), Arr(nullptr), nArr(nullptr), Ea(nullptr), tempExp(nullptr), + stoich(nullptr), stoichReactants(nullptr), stoichProducts(nullptr), kR(nullptr), + pairDPDE(nullptr), dpdThetaLocal(nullptr), sumWeights(nullptr), sparseKinetics_nu(nullptr), + sparseKinetics_nuk(nullptr), sparseKinetics_inu(nullptr), sparseKinetics_isIntegralReaction(nullptr), + kineticsFile(nullptr), id_fix_species(nullptr), + id_fix_species_old(nullptr), fix_species(nullptr), fix_species_old(nullptr) { if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command"); nevery = 1; nreactions = maxparam = 0; - params = NULL; - mol2param = NULL; - pairDPDE = NULL; - id_fix_species = NULL; - id_fix_species_old = NULL; + params = nullptr; + mol2param = nullptr; + pairDPDE = nullptr; + id_fix_species = nullptr; + id_fix_species_old = nullptr; const int Verbosity = 1; @@ -166,7 +166,7 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : diagnosticFrequency = 0; for (int i = 0; i < numDiagnosticCounters; ++i){ diagnosticCounter[i] = 0; - diagnosticCounterPerODE[i] = NULL; + diagnosticCounterPerODE[i] = nullptr; } if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg==8){ @@ -189,8 +189,8 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : minSteps = atoi( arg[iarg++] ); maxIters = atoi( arg[iarg++] ); - relTol = strtod( arg[iarg++], NULL); - absTol = strtod( arg[iarg++], NULL); + relTol = strtod( arg[iarg++], nullptr); + absTol = strtod( arg[iarg++], nullptr); if (iarg < narg) diagnosticFrequency = atoi( arg[iarg++] ); @@ -207,10 +207,10 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : } // Initialize/Create the sparse matrix database. - sparseKinetics_nu = NULL; - sparseKinetics_nuk = NULL; - sparseKinetics_inu = NULL; - sparseKinetics_isIntegralReaction = NULL; + sparseKinetics_nu = nullptr; + sparseKinetics_nuk = nullptr; + sparseKinetics_inu = nullptr; + sparseKinetics_isIntegralReaction = nullptr; sparseKinetics_maxReactants = 0; sparseKinetics_maxProducts = 0; sparseKinetics_maxSpecies = 0; @@ -259,15 +259,15 @@ void FixRX::post_constructor() char **tmpspecies = new char*[maxspecies]; int tmpmaxstrlen = 0; for(int jj=0; jj < maxspecies; jj++) - tmpspecies[jj] = NULL; + tmpspecies[jj] = nullptr; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(kineticsFile,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",kineticsFile); error->one(FLERR,str); @@ -284,7 +284,7 @@ void FixRX::post_constructor() while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -304,8 +304,8 @@ void FixRX::post_constructor() nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ - word = strtok(NULL, " \t\n\r\f"); + while (word != nullptr){ + word = strtok(nullptr, " \t\n\r\f"); match=false; for(int jj=0;jjnspecies_dpd = nUniqueSpecies; @@ -332,8 +332,8 @@ void FixRX::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_species = NULL; - id_fix_species_old = NULL; + id_fix_species = nullptr; + id_fix_species_old = nullptr; n = strlen(id) + strlen("_SPECIES") + 1; id_fix_species = new char[n]; @@ -637,10 +637,10 @@ int FixRX::setmask() void FixRX::init() { pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); bool eos_flag = false; @@ -853,10 +853,10 @@ void FixRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",file); error->one(FLERR,str); @@ -872,7 +872,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -926,7 +926,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -946,9 +946,9 @@ void FixRX::read_file(char *file) nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ + while (word != nullptr){ tmpStoich = atof(word); - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); for (ispecies = 0; ispecies < nspecies; ispecies++){ if (strcmp(word,&atom->dname[ispecies][0]) == 0){ stoich[nreactions][ispecies] += sign*tmpStoich; @@ -965,22 +965,22 @@ void FixRX::read_file(char *file) } error->all(FLERR,"Illegal fix rx command"); } - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); if(strcmp(word,"=") == 0) sign = 1.0; if(strcmp(word,"+") != 0 && strcmp(word,"=") != 0){ - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Arr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); nArr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Ea[nreactions] = atof(word); sign = -1.0; break; } - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); } nreactions++; } @@ -1434,7 +1434,7 @@ void FixRX::odeDiagnostics(void) my_max[i] = 0; my_min[i] = DBL_MAX; - if (diagnosticCounterPerODE[i] != NULL){ + if (diagnosticCounterPerODE[i] != nullptr){ for (int j = 0; j < nlocal; ++j) if (mask[j] & groupbit){ double diff = double(diagnosticCounterPerODE[i][j]) - avg_per_atom[i]; @@ -1637,8 +1637,8 @@ void FixRX::rkf45(int id, double *rwork, void *v_param, int ode_counter[]) ode_counter[1] += nit; ode_counter[2] += nfe; - //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != NULL) - if (diagnosticCounterPerODE[StepSum] != NULL){ + //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != nullptr) + if (diagnosticCounterPerODE[StepSum] != nullptr){ diagnosticCounterPerODE[StepSum][id] = nst; diagnosticCounterPerODE[FuncSum][id] = nfe; } @@ -1708,7 +1708,7 @@ int FixRX::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_param const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) diff --git a/src/USER-DPD/fix_shardlow.cpp b/src/USER-DPD/fix_shardlow.cpp index c4480a037..6db13d394 100644 --- a/src/USER-DPD/fix_shardlow.cpp +++ b/src/USER-DPD/fix_shardlow.cpp @@ -84,18 +84,18 @@ static const char cite_fix_shardlow[] = /* ---------------------------------------------------------------------- */ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pairDPD(NULL), pairDPDE(NULL), v_t0(NULL) - ,rand_state(NULL) + Fix(lmp, narg, arg), pairDPD(nullptr), pairDPDE(nullptr), v_t0(nullptr) + ,rand_state(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_shardlow); if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); - pairDPD = NULL; - pairDPDE = NULL; + pairDPD = nullptr; + pairDPDE = nullptr; pairDPD = (PairDPDfdt *) force->pair_match("dpd/fdt",1); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); maxRNG = 0; @@ -107,7 +107,7 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; } - if(pairDPD == NULL && pairDPDE == NULL) + if(pairDPD == nullptr && pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt or dpd/fdt/energy with fix shardlow"); } @@ -533,7 +533,7 @@ void FixShardlow::initial_integrate(int /*vflag*/) const int nlocal = atom->nlocal; const int nghost = atom->nghost; - const bool useDPDE = (pairDPDE != NULL); + const bool useDPDE = (pairDPDE != nullptr); // NOTE: this logic is specific to orthogonal boxes, not triclinic @@ -640,7 +640,7 @@ fprintf(stdout, "\n%6d %6d,%6d %6d: " #endif memory->sfree(v_t0); - v_t0 = NULL; + v_t0 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.cpp b/src/USER-DPD/npair_half_bin_newton_ssa.cpp index 4fb5714d1..e3f6f4e20 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.cpp +++ b/src/USER-DPD/npair_half_bin_newton_ssa.cpp @@ -37,9 +37,9 @@ NPairHalfBinNewtonSSA::NPairHalfBinNewtonSSA(LAMMPS *lmp) : NPair(lmp) ssa_maxPhaseCt = 0; ssa_maxPhaseLen = 0; ssa_phaseCt = 0; - ssa_phaseLen = NULL; - ssa_itemLoc = NULL; - ssa_itemLen = NULL; + ssa_phaseLen = nullptr; + ssa_itemLoc = nullptr; + ssa_itemLen = nullptr; ssa_gphaseCt = 7; memory->create(ssa_gphaseLen,ssa_gphaseCt,"NPairHalfBinNewtonSSA:ssa_gphaseLen"); memory->create(ssa_gitemLoc,ssa_gphaseCt,1,"NPairHalfBinNewtonSSA:ssa_gitemLoc"); diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index 1d3d952e9..822444f8c 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -39,7 +39,7 @@ using namespace LAMMPS_NS; PairDPDfdt::PairDPDfdt(LAMMPS *lmp) : Pair(lmp) { - random = NULL; + random = nullptr; splitFDT_flag = false; a0_is_zero = false; } @@ -375,13 +375,13 @@ void PairDPDfdt::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -410,10 +410,10 @@ void PairDPDfdt::write_restart_settings(FILE *fp) void PairDPDfdt::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index b843e4601..094e5732c 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -39,9 +39,9 @@ using namespace LAMMPS_NS; PairDPDfdtEnergy::PairDPDfdtEnergy(LAMMPS *lmp) : Pair(lmp) { - random = NULL; - duCond = NULL; - duMech = NULL; + random = nullptr; + duCond = nullptr; + duMech = nullptr; splitFDT_flag = false; a0_is_zero = false; @@ -476,14 +476,14 @@ void PairDPDfdtEnergy::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -513,9 +513,9 @@ void PairDPDfdtEnergy::write_restart_settings(FILE *fp) void PairDPDfdtEnergy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 666a1b0ea..9d7fcc1ab 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -59,10 +59,10 @@ struct PairExp6ParamDataType // Default constructor -- nullify everything. PairExp6ParamDataType(void) - : n(0), epsilon1(NULL), alpha1(NULL), rm1(NULL), mixWtSite1(NULL), - epsilon2(NULL), alpha2(NULL), rm2(NULL), mixWtSite2(NULL), - epsilonOld1(NULL), alphaOld1(NULL), rmOld1(NULL), mixWtSite1old(NULL), - epsilonOld2(NULL), alphaOld2(NULL), rmOld2(NULL), mixWtSite2old(NULL) + : n(0), epsilon1(nullptr), alpha1(nullptr), rm1(nullptr), mixWtSite1(nullptr), + epsilon2(nullptr), alpha2(nullptr), rm2(nullptr), mixWtSite2(nullptr), + epsilonOld1(nullptr), alphaOld1(nullptr), rmOld1(nullptr), mixWtSite1old(nullptr), + epsilonOld2(nullptr), alphaOld2(nullptr), rmOld2(nullptr), mixWtSite2old(nullptr) {} }; @@ -74,8 +74,8 @@ PairExp6rx::PairExp6rx(LAMMPS *lmp) : Pair(lmp) nspecies = 0; nparams = maxparam = 0; - params = NULL; - mol2param = NULL; + params = nullptr; + mol2param = nullptr; fractionalWeighting = true; } @@ -85,7 +85,7 @@ PairExp6rx::~PairExp6rx() { if (copymode) return; - if (params != NULL) { + if (params != nullptr) { for (int i=0; i < nparams; ++i) { delete[] params[i].name; delete[] params[i].potential; @@ -659,7 +659,7 @@ void PairExp6rx::coeff(int narg, char **arg) } delete[] site1; delete[] site2; - site1 = site2 = NULL; + site1 = site2 = nullptr; setup(); @@ -717,16 +717,16 @@ void PairExp6rx::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -743,7 +743,7 @@ void PairExp6rx::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -765,7 +765,7 @@ void PairExp6rx::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -785,7 +785,7 @@ void PairExp6rx::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -839,10 +839,10 @@ void PairExp6rx::read_file2(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open polynomial file %s",file); error->one(FLERR,str); @@ -857,7 +857,7 @@ void PairExp6rx::read_file2(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -879,7 +879,7 @@ void PairExp6rx::read_file2(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -899,7 +899,7 @@ void PairExp6rx::read_file2(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; if (strcmp(words[0],"alpha") == 0){ for (int ii=1; iime; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -1004,10 +1004,10 @@ void PairExp6rx::write_restart_settings(FILE *fp) void PairExp6rx::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index ceb5c78ea..2e556d82e 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -57,14 +57,14 @@ static const char cite_pair_multi_lucy[] = /* ---------------------------------------------------------------------- */ PairMultiLucy::PairMultiLucy(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL) + ntables(0), tables(nullptr), tabindex(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -256,7 +256,7 @@ void PairMultiLucy::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -349,7 +349,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -358,7 +358,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -481,26 +481,26 @@ void PairMultiLucy::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -582,15 +582,15 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -707,8 +707,8 @@ void PairMultiLucy::write_restart_settings(FILE *fp) void PairMultiLucy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index d769d9478..e56743ea1 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -68,14 +68,14 @@ static const char cite_pair_multi_lucy_rx[] = /* ---------------------------------------------------------------------- */ PairMultiLucyRX::PairMultiLucyRX(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL), site1(NULL), site2(NULL) + ntables(0), tables(nullptr), tabindex(nullptr), site1(nullptr), site2(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy_rx); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy/rx command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -134,10 +134,10 @@ void PairMultiLucyRX::compute(int eflag, int vflag) int jtable; double *rho = atom->rho; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = nlocal + nghost; @@ -355,7 +355,7 @@ void PairMultiLucyRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -494,7 +494,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -503,7 +503,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -626,26 +626,26 @@ void PairMultiLucyRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -727,15 +727,15 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -852,8 +852,8 @@ void PairMultiLucyRX::write_restart_settings(FILE *fp) void PairMultiLucyRX::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index f791107f1..05467346c 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -46,8 +46,8 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTableRX::PairTableRX(LAMMPS *lmp) : PairTable(lmp) { fractionalWeighting = true; - site1 = NULL; - site2 = NULL; + site1 = nullptr; + site2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -93,10 +93,10 @@ void PairTableRX::compute(int eflag, int vflag) double *uCG = atom->uCG; double *uCGnew = atom->uCGnew; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = atom->nlocal + atom->nghost; @@ -290,7 +290,7 @@ void PairTableRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-DRUDE/compute_temp_drude.cpp b/src/USER-DRUDE/compute_temp_drude.cpp index b806b4434..1c60805db 100644 --- a/src/USER-DRUDE/compute_temp_drude.cpp +++ b/src/USER-DRUDE/compute_temp_drude.cpp @@ -43,9 +43,9 @@ ComputeTempDrude::ComputeTempDrude(LAMMPS *lmp, int narg, char **arg) : tempflag = 0; // because does not compute a single temperature (scalar and vector) vector = new double[size_vector]; - fix_drude = NULL; - id_temp = NULL; - temperature = NULL; + fix_drude = nullptr; + id_temp = nullptr; + temperature = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_drude.cpp b/src/USER-DRUDE/fix_drude.cpp index 313ac249d..ea9373142 100644 --- a/src/USER-DRUDE/fix_drude.cpp +++ b/src/USER-DRUDE/fix_drude.cpp @@ -53,7 +53,7 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal fix drude command"); } - drudeid = NULL; + drudeid = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); @@ -147,7 +147,7 @@ void FixDrude::build_drudeid(){ // Loop on procs to fill my atoms' sets of bond partners comm->ring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 4, ring_build_partner, NULL, (void *)this, 1); + 4, ring_build_partner, nullptr, (void *)this, 1); // Build the list of my Drudes' tags // The only bond partners of a Drude particle is its core, @@ -163,7 +163,7 @@ void FixDrude::build_drudeid(){ // so that each core finds its Drude. comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 3, ring_search_drudeid, NULL, (void *)this, 1); + 3, ring_search_drudeid, nullptr, (void *)this, 1); delete [] partner_set; } @@ -338,11 +338,11 @@ void FixDrude::rebuild_special(){ // Remove Drude particles from the special lists of each proc comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 9, ring_remove_drude, NULL, (void *)this, 1); + 9, ring_remove_drude, nullptr, (void *)this, 1); // Add back Drude particles in the lists just after their core comm->ring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 10, ring_add_drude, NULL, (void *)this, 1); + 10, ring_add_drude, nullptr, (void *)this, 1); // Check size of special list nspecmax_loc = 0; @@ -373,7 +373,7 @@ void FixDrude::rebuild_special(){ // Copy core's list into their drude list comm->ring(core_special_vec.size(), sizeof(tagint), (char *) core_special_vec.data(), - 11, ring_copy_drude, NULL, (void *)this, 1); + 11, ring_copy_drude, nullptr, (void *)this, 1); } /* ---------------------------------------------------------------------- diff --git a/src/USER-DRUDE/fix_drude_transform.cpp b/src/USER-DRUDE/fix_drude_transform.cpp index bdccaaebc..fc8936732 100644 --- a/src/USER-DRUDE/fix_drude_transform.cpp +++ b/src/USER-DRUDE/fix_drude_transform.cpp @@ -29,11 +29,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ template FixDrudeTransform::FixDrudeTransform(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mcoeff(NULL) + Fix(lmp, narg, arg), mcoeff(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix drude/transform command"); comm_forward = 9; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index da7451082..3fd017444 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -48,7 +48,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; // core temperature - tstr_core = NULL; + tstr_core = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr_core = new char[n]; @@ -63,7 +63,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : int seed_core = utils::inumeric(FLERR,arg[5],false,lmp); // drude temperature - tstr_drude = NULL; + tstr_drude = nullptr; if (strstr(arg[7],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; tstr_drude = new char[n]; @@ -102,9 +102,9 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : tflag = 0; // no external compute/temp is specified yet (for bias) energy = 0.; - fix_drude = NULL; - temperature = NULL; - id_temp = NULL; + fix_drude = nullptr; + temperature = nullptr; + id_temp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -379,7 +379,7 @@ void *FixLangevinDrude::extract(const char *str, int &dim) } else if (strcmp(str,"t_target_drude") == 0) { return &t_target_drude; } else error->all(FLERR, "Illegal extract string in fix langevin/drude"); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 461f97288..c6662c423 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -56,9 +56,9 @@ PairLJCutTholeLong::PairLJCutTholeLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; single_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -371,11 +371,11 @@ void PairLJCutTholeLong::init_style() // set rRESPA cutoffs - cut_respa = NULL; + cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -496,16 +496,16 @@ void PairLJCutTholeLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -541,15 +541,15 @@ void PairLJCutTholeLong::write_restart_settings(FILE *fp) void PairLJCutTholeLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -602,5 +602,5 @@ void *PairLJCutTholeLong::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index 281317c07..e9c4f396d 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairThole::PairThole(LAMMPS *lmp) : Pair(lmp) { - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -312,13 +312,13 @@ void PairThole::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); } MPI_Bcast(&polar[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairThole::write_restart_settings(FILE *fp) void PairThole::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&thole_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -400,5 +400,5 @@ void *PairThole::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp index 001e1d4c4..e25f239ad 100644 --- a/src/USER-EFF/compute_ke_atom_eff.cpp +++ b/src/USER-EFF/compute_ke_atom_eff.cpp @@ -40,7 +40,7 @@ ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - ke = NULL; + ke = nullptr; // error check diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index 90e25ca3c..979b47f50 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -52,7 +52,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index c95cf0de2..f7c1bd5b6 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -55,7 +55,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 3966bc7b9..a0aabb68a 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -45,7 +45,7 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevinEff::FixLangevinEff(LAMMPS *lmp, int narg, char **arg) : FixLangevin(lmp, narg, arg) { - erforcelangevin = NULL; + erforcelangevin = nullptr; } /* ---------------------------------------------------------------------- */ @@ -399,7 +399,7 @@ void FixLangevinEff::end_of_step() double FixLangevinEff::compute_scalar() { - if (!tallyflag || flangevin == NULL || erforcelangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr || erforcelangevin == nullptr) return 0.0; // capture the very first energy transfer to thermal reservoir diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index f4e7af658..817b2eb6e 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -42,8 +42,8 @@ PairEffCut::PairEffCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_eradius = NULL; - min_erforce = NULL; + min_eradius = nullptr; + min_erforce = nullptr; nextra = 4; pvector = new double[nextra]; } @@ -979,10 +979,10 @@ void PairEffCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -1006,9 +1006,9 @@ void PairEffCut::write_restart_settings(FILE *fp) void PairEffCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index ff1e303a3..6ecf0795d 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -158,14 +158,14 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : // allocate space for charge, force, energy, virial arrays - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; allocate_storage(); - fixgpu = NULL; + fixgpu = nullptr; } /* ---------------------------------------------------------------------- */ @@ -210,17 +210,17 @@ void ComputeFEP::init() if (!input->variable->equalstyle(pert->ivar)) error->all(FLERR,"Variable for compute fep is of invalid style"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"compute fep pair requires pair interactions"); if (pert->which == PAIR) { pairflag = 1; Pair *pair = force->pair_match(pert->pstyle,1); - if (pair == NULL) error->all(FLERR,"compute fep pair style " + if (pair == nullptr) error->all(FLERR,"compute fep pair style " "does not exist"); void *ptr = pair->extract(pert->pparam,pert->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"compute fep pair style param not supported"); pert->array = (double **) ptr; @@ -497,10 +497,10 @@ void ComputeFEP::deallocate_storage() memory->destroy(keatom_orig); memory->destroy(kvatom_orig); - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; } diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 2f97b5a0e..ca9088836 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -172,7 +172,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : if (adapt[m].which == PAIR) memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig"); - id_fix_diam = id_fix_chg = NULL; + id_fix_diam = id_fix_chg = nullptr; } /* ---------------------------------------------------------------------- */ @@ -220,8 +220,8 @@ void FixAdaptFEP::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; char **newarg = new char*[6]; newarg[1] = group->names[igroup]; @@ -307,7 +307,7 @@ void FixAdaptFEP::init() if (ad->which == PAIR) { anypair = 1; - Pair *pair = NULL; + Pair *pair = nullptr; if (lmp->suffix_enable) { char psuffix[128]; @@ -316,11 +316,11 @@ void FixAdaptFEP::init() strcat(psuffix,lmp->suffix); pair = force->pair_match(psuffix,1); } - if (pair == NULL) pair = force->pair_match(ad->pstyle,1); - if (pair == NULL) + if (pair == nullptr) pair = force->pair_match(ad->pstyle,1); + if (pair == nullptr) error->all(FLERR, "Fix adapt/fep pair style does not exist"); void *ptr = pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt/fep pair style param not supported"); ad->pdim = 2; @@ -340,7 +340,7 @@ void FixAdaptFEP::init() } } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt/fep kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index b0a099a56..a68c13699 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -275,12 +275,12 @@ void PairCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -309,12 +309,12 @@ void PairCoulCutSoft::write_restart_settings(FILE *fp) void PairCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -373,5 +373,5 @@ void *PairCoulCutSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_coul_long_soft.cpp b/src/USER-FEP/pair_coul_long_soft.cpp index 80173f3f0..2749fe8c7 100644 --- a/src/USER-FEP/pair_coul_long_soft.cpp +++ b/src/USER-FEP/pair_coul_long_soft.cpp @@ -236,7 +236,7 @@ void PairCoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -295,11 +295,11 @@ void PairCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); } } @@ -326,12 +326,12 @@ void PairCoulLongSoft::write_restart_settings(FILE *fp) void PairCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -388,5 +388,5 @@ void *PairCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"scale") == 0) return (void *) scale; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index e13b98329..e6783b022 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -728,11 +728,11 @@ void PairLJCharmmCoulLongSoft::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -819,15 +819,15 @@ void PairLJCharmmCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -862,15 +862,15 @@ void PairLJCharmmCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCharmmCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -990,5 +990,5 @@ void *PairLJCharmmCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp index bfd5a630f..f8719b890 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp @@ -382,15 +382,15 @@ void PairLJClass2CoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -425,15 +425,15 @@ void PairLJClass2CoulCutSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -515,5 +515,5 @@ void *PairLJClass2CoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp index e027a3018..9741dd24c 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp @@ -285,7 +285,7 @@ void PairLJClass2CoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -397,14 +397,14 @@ void PairLJClass2CoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -438,15 +438,15 @@ void PairLJClass2CoulLongSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -537,5 +537,5 @@ void *PairLJClass2CoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_soft.cpp b/src/USER-FEP/pair_lj_class2_soft.cpp index 0cd1fc9e8..81319d715 100644 --- a/src/USER-FEP/pair_lj_class2_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_soft.cpp @@ -321,14 +321,14 @@ void PairLJClass2Soft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -360,12 +360,12 @@ void PairLJClass2Soft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -432,5 +432,5 @@ void *PairLJClass2Soft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index a18256f98..53f39523e 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -378,15 +378,15 @@ void PairLJCutCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -421,15 +421,15 @@ void PairLJCutCoulCutSoft::write_restart_settings(FILE *fp) void PairLJCutCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -512,5 +512,5 @@ void *PairLJCutCoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index 4b3fae77b..61db28fe1 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -656,11 +656,11 @@ void PairLJCutCoulLongSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -775,14 +775,14 @@ void PairLJCutCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -816,15 +816,15 @@ void PairLJCutCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCutCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -923,5 +923,5 @@ void *PairLJCutCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 786715d6c..589e03642 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -532,7 +532,7 @@ void PairLJCutSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -636,14 +636,14 @@ void PairLJCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -676,13 +676,13 @@ void PairLJCutSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -748,5 +748,5 @@ void *PairLJCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 18f8db502..748c616d6 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -53,8 +53,8 @@ PairLJCutTIP4PLongSoft::PairLJCutTIP4PLongSoft(LAMMPS *lmp) : respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -450,9 +450,9 @@ void PairLJCutTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/soft requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLongSoft::init_style(); @@ -517,17 +517,17 @@ void PairLJCutTIP4PLongSoft::read_restart_settings(FILE *fp) PairLJCutCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); - - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); + + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -579,7 +579,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 85a30a541..5154907ec 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -313,15 +313,15 @@ void PairMorseSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -353,10 +353,10 @@ void PairMorseSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&shift_range,1,MPI_DOUBLE,0,world); @@ -450,5 +450,5 @@ void *PairMorseSoft::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index 9578befd3..18e266715 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -52,8 +52,8 @@ PairTIP4PLongSoft::PairTIP4PLongSoft(LAMMPS *lmp) : PairCoulLongSoft(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -407,9 +407,9 @@ void PairTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLongSoft::init_style(); @@ -454,11 +454,11 @@ void PairTIP4PLongSoft::read_restart_settings(FILE *fp) PairCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); MPI_Bcast(&typeH,1,MPI_INT,0,world); @@ -501,7 +501,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-H5MD/dump_h5md.cpp b/src/USER-H5MD/dump_h5md.cpp index e9daf7186..11a490626 100644 --- a/src/USER-H5MD/dump_h5md.cpp +++ b/src/USER-H5MD/dump_h5md.cpp @@ -68,11 +68,11 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) size_one = 6; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; datafile_from_dump = -1; - author_name=NULL; + author_name=nullptr; every_dump = utils::inumeric(FLERR,arg[3],false,lmp); every_position = every_image = -1; @@ -175,7 +175,7 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) if (iarg+1>=narg) { error->all(FLERR, "Invalid number of arguments in dump h5md"); } - if (author_name==NULL) { + if (author_name==nullptr) { author_name = new char[strlen(arg[iarg])+1]; strcpy(author_name, arg[iarg+1]); } else { @@ -271,10 +271,10 @@ void DumpH5MD::openfile() if (me == 0) { if (datafile_from_dump<0) { - if (author_name==NULL) { - datafile = h5md_create_file(filename, "N/A", NULL, "lammps", LAMMPS_VERSION); + if (author_name==nullptr) { + datafile = h5md_create_file(filename, "N/A", nullptr, "lammps", LAMMPS_VERSION); } else { - datafile = h5md_create_file(filename, author_name, NULL, "lammps", LAMMPS_VERSION); + datafile = h5md_create_file(filename, author_name, nullptr, "lammps", LAMMPS_VERSION); } group_name_length = strlen(group->names[igroup])+1; group_name = new char[group_name_length]; @@ -288,19 +288,19 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } else { @@ -318,26 +318,26 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } } - if (author_name!=NULL) delete [] author_name; + if (author_name!=nullptr) delete [] author_name; for (int i=0; i<3; i++) { delete [] boundary[i]; } @@ -536,7 +536,7 @@ void DumpH5MD::write_fixed_frame() edges[2] = boxzhi - boxzlo; if (every_position==0) { particles_data.position = h5md_create_fixed_data_simple(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, dump_position); - h5md_create_box(&particles_data, dims[1], boundary, false, edges, NULL); + h5md_create_box(&particles_data, dims[1], boundary, false, edges, nullptr); if (every_image==0) particles_data.image = h5md_create_fixed_data_simple(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, dump_image); } diff --git a/src/USER-INTEL/angle_charmm_intel.h b/src/USER-INTEL/angle_charmm_intel.h index 155ecfaff..798e3d152 100644 --- a/src/USER-INTEL/angle_charmm_intel.h +++ b/src/USER-INTEL/angle_charmm_intel.h @@ -61,7 +61,7 @@ class AngleCharmmIntel : public AngleCharmm { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/angle_harmonic_intel.h b/src/USER-INTEL/angle_harmonic_intel.h index c00292f7c..7df4a9887 100644 --- a/src/USER-INTEL/angle_harmonic_intel.h +++ b/src/USER-INTEL/angle_harmonic_intel.h @@ -61,7 +61,7 @@ class AngleHarmonicIntel : public AngleHarmonic { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/bond_fene_intel.h b/src/USER-INTEL/bond_fene_intel.h index 58fcdb866..92ec4097c 100644 --- a/src/USER-INTEL/bond_fene_intel.h +++ b/src/USER-INTEL/bond_fene_intel.h @@ -61,7 +61,7 @@ class BondFENEIntel : public BondFENE { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/bond_harmonic_intel.h b/src/USER-INTEL/bond_harmonic_intel.h index 3c1d050a3..449df3b7a 100644 --- a/src/USER-INTEL/bond_harmonic_intel.h +++ b/src/USER-INTEL/bond_harmonic_intel.h @@ -61,7 +61,7 @@ class BondHarmonicIntel : public BondHarmonic { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_charmm_intel.h b/src/USER-INTEL/dihedral_charmm_intel.h index d80b32c8a..bb830b729 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.h +++ b/src/USER-INTEL/dihedral_charmm_intel.h @@ -66,7 +66,7 @@ class DihedralCharmmIntel : public DihedralCharmm { flt_t *weight; ForceConst() : _npairtypes(0), _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, 0, NULL); } + ~ForceConst() { set_ntypes(0, 0, nullptr); } void set_ntypes(const int npairtypes, const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_fourier_intel.h b/src/USER-INTEL/dihedral_fourier_intel.h index 26007f411..f91d89f6b 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.h +++ b/src/USER-INTEL/dihedral_fourier_intel.h @@ -63,7 +63,7 @@ class DihedralFourierIntel : public DihedralFourier { fc_packed1 **bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, NULL, NULL); } + ~ForceConst() { set_ntypes(0, nullptr, nullptr, nullptr); } void set_ntypes(const int nbondtypes, int *setflag, int *nterms, Memory *memory); diff --git a/src/USER-INTEL/dihedral_harmonic_intel.h b/src/USER-INTEL/dihedral_harmonic_intel.h index 0a9cfaa04..cdbae365f 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.h +++ b/src/USER-INTEL/dihedral_harmonic_intel.h @@ -63,7 +63,7 @@ class DihedralHarmonicIntel : public DihedralHarmonic { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_opls_intel.h b/src/USER-INTEL/dihedral_opls_intel.h index 1080bfa6c..77fd8c4b9 100644 --- a/src/USER-INTEL/dihedral_opls_intel.h +++ b/src/USER-INTEL/dihedral_opls_intel.h @@ -62,7 +62,7 @@ class DihedralOPLSIntel : public DihedralOPLS { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index eacbc7ddc..21cc106e3 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -303,7 +303,7 @@ void FixIntel::init() #endif const int nstyles = _pair_intel_count; - if (force->pair_match("^hybrid", 0) != NULL) { + if (force->pair_match("^hybrid", 0) != nullptr) { _pair_hybrid_flag = 1; if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute) error->all(FLERR, @@ -513,9 +513,9 @@ void FixIntel::bond_init_check() "USER-INTEL package requires same setting for newton bond and non-bond."); int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -530,9 +530,9 @@ void FixIntel::bond_init_check() void FixIntel::kspace_init_check() { int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -855,7 +855,7 @@ void FixIntel::add_oresults(const ft * _noalias const f_in, } } - if (ev_global != NULL) { + if (ev_global != nullptr) { force->pair->eng_vdwl += ev_global[0]; force->pair->eng_coul += ev_global[1]; force->pair->virial[0] += ev_global[2]; @@ -1168,7 +1168,7 @@ int FixIntel::set_host_affinity(const int nomp) sprintf(cmd, "lscpu -p | grep -v '#' |" "sort -t, -k 3,3n -k 2,2n | awk -F, '{print $1}'"); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; ncores = 0; while(fgets(readbuf, 512, p)) { proc_list[ncores] = atoi(readbuf); @@ -1190,7 +1190,7 @@ int FixIntel::set_host_affinity(const int nomp) int nthreads = nomp; if (nthreads == 0) { estring = getenv("OMP_NUM_THREADS"); - if (estring != NULL) { + if (estring != nullptr) { nthreads = atoi(estring); if (nthreads < 2) nthreads = 1; } else @@ -1222,7 +1222,7 @@ int FixIntel::set_host_affinity(const int nomp) if (coi_cores) { sprintf(cmd, "ps -Lp %d -o lwp | awk ' (NR > 2) {print}'", pid); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); @@ -1258,7 +1258,7 @@ int FixIntel::set_host_affinity(const int nomp) free(buf1); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); diff --git a/src/USER-INTEL/fix_intel.h b/src/USER-INTEL/fix_intel.h index 4c50164d3..df3aecbc8 100644 --- a/src/USER-INTEL/fix_intel.h +++ b/src/USER-INTEL/fix_intel.h @@ -167,8 +167,8 @@ class FixIntel : public Fix { inline void zero_timers() {} inline void start_watch(const int /*which*/) {} inline double stop_watch(const int /*which*/) { return 0.0; } - double * off_watch_pair() { return NULL; } - double * off_watch_neighbor() { return NULL; } + double * off_watch_pair() { return nullptr; } + double * off_watch_neighbor() { return nullptr; } inline void balance_stamp() {} inline void acc_timers() {} inline int separate_buffers() { return 0; } diff --git a/src/USER-INTEL/improper_cvff_intel.h b/src/USER-INTEL/improper_cvff_intel.h index 812b49d50..94aa29c55 100644 --- a/src/USER-INTEL/improper_cvff_intel.h +++ b/src/USER-INTEL/improper_cvff_intel.h @@ -62,7 +62,7 @@ class ImproperCvffIntel : public ImproperCvff { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/improper_harmonic_intel.h b/src/USER-INTEL/improper_harmonic_intel.h index 6d7c82996..ce1da11a3 100644 --- a/src/USER-INTEL/improper_harmonic_intel.h +++ b/src/USER-INTEL/improper_harmonic_intel.h @@ -62,7 +62,7 @@ class ImproperHarmonicIntel : public ImproperHarmonic { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/intel_buffers.cpp b/src/USER-INTEL/intel_buffers.cpp index dc5b0fad5..168074eb3 100644 --- a/src/USER-INTEL/intel_buffers.cpp +++ b/src/USER-INTEL/intel_buffers.cpp @@ -123,9 +123,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, _buf_local_size = static_cast(nlocal) * 1.1 + 1; const int f_stride = get_stride(_buf_local_size); lmp->memory->create(_x, _buf_size,"intel_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_q, _buf_size, "intel_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_quat, _buf_size, "intel_quat"); #ifdef _LMP_INTEL_OFFLOAD if (lmp->force->newton_pair) @@ -139,9 +139,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, #ifdef _LMP_INTEL_OFFLOAD if (_separate_buffers) { lmp->memory->create(_host_x, _buf_size,"intel_host_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_host_q, _buf_size, "intel_host_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_host_quat, _buf_size, "intel_host_quat"); } @@ -154,24 +154,24 @@ void IntelBuffers::_grow(const int nall, const int nlocal, const flt_t * const q = get_q(); const vec3_acc_t * f_start = get_off_f(); acc_t * ev_global = get_ev_global(); - if (lmp->atom->q != NULL) { - if (x != NULL && q != NULL && f_start != NULL && ev_global != NULL) { + if (lmp->atom->q != nullptr) { + if (x != nullptr && q != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x,q:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } else { - if (x != NULL && f_start != NULL && ev_global != NULL) { + if (x != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } - if (lmp->atom->ellipsoid != NULL) { + if (lmp->atom->ellipsoid != nullptr) { const quat_t * const quat = get_quat(); - if (quat != NULL) { + if (quat != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(quat:length(_buf_size) alloc_if(1) free_if(0)) } @@ -252,7 +252,7 @@ void IntelBuffers::free_list_local() int * cnumneigh = _neigh_list_ptrs[0].cnumneigh; _neigh_list_ptrs[0].cnumneigh = 0; #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cnumneigh:alloc_if(0) free_if(1)) } @@ -261,11 +261,11 @@ void IntelBuffers::free_list_local() } #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { const int * ilist = _off_map_ilist; const int * numneigh = _off_map_numneigh; const int ** firstneigh = (const int **)_off_map_firstneigh; - _off_map_ilist = NULL; + _off_map_ilist = nullptr; #pragma offload_transfer target(mic:_cop) \ nocopy(ilist,firstneigh,numneigh:alloc_if(0) free_if(1)) } @@ -402,7 +402,7 @@ void IntelBuffers::_grow_nbor_list(NeighList * /*list*/, if (offload_end > 0) { int * list_alloc =_list_alloc; - if (list_alloc != NULL) { + if (list_alloc != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(list_alloc:length(list_alloc_size) alloc_if(1) free_if(0)) _off_list_alloc = true; @@ -497,8 +497,8 @@ void IntelBuffers::grow_ccache(const int off_flag, int *ccachei = _ccachei; int *ccachej = _ccachej; - if (ccachex != NULL && ccachey !=NULL && ccachez != NULL && - ccachew != NULL && ccachei != NULL && ccachej !=NULL) { + if (ccachex != nullptr && ccachey !=nullptr && ccachez != nullptr && + ccachew != nullptr && ccachei != nullptr && ccachej !=nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachex,ccachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ccachez,ccachew:length(vsize) alloc_if(1) free_if(0)) \ @@ -506,7 +506,7 @@ void IntelBuffers::grow_ccache(const int off_flag, in(ccachej:length(vsize) alloc_if(1) free_if(0)) } #ifdef LMP_USE_AVXCD - if (ccachef != NULL) { + if (ccachef != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachef:length(_ccache_stride3 * nt) alloc_if(1) free_if(0)) } @@ -595,8 +595,8 @@ void IntelBuffers::grow_ncache(const int off_flag, int *ncachej = _ncachej; int *ncachejtype = _ncachejtype; - if (ncachex != NULL && ncachey !=NULL && ncachez != NULL && - ncachej != NULL && ncachejtype != NULL) { + if (ncachex != nullptr && ncachey !=nullptr && ncachez != nullptr && + ncachej != nullptr && ncachejtype != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ncachex,ncachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ncachez,ncachej:length(vsize) alloc_if(1) free_if(0)) \ @@ -674,13 +674,13 @@ void IntelBuffers::set_ntypes(const int ntypes, #ifdef _LMP_INTEL_OFFLOAD flt_t * cutneighsqo = _cutneighsq[0]; const int ntypes2 = ntypes * ntypes; - if (_off_threads > 0 && cutneighsqo != NULL) { + if (_off_threads > 0 && cutneighsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighsqo:length(ntypes2) alloc_if(1) free_if(0)) } if (use_ghost_cut) { flt_t * cutneighghostsqo = _cutneighghostsq[0]; - if (_off_threads > 0 && cutneighghostsqo != NULL) { + if (_off_threads > 0 && cutneighghostsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighghostsqo:length(ntypes2) alloc_if(1) free_if(0)) } diff --git a/src/USER-INTEL/intel_buffers.h b/src/USER-INTEL/intel_buffers.h index f3c07da7c..86fc921c9 100644 --- a/src/USER-INTEL/intel_buffers.h +++ b/src/USER-INTEL/intel_buffers.h @@ -211,7 +211,7 @@ class IntelBuffers { _x[i].z = lmp->atom->x[i][2]; _x[i].w = lmp->atom->type[i]; } - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) #if defined(LMP_SIMD_COMPILER) #pragma vector aligned #pragma ivdep @@ -296,7 +296,7 @@ class IntelBuffers { _host_x[nall].y = INTEL_BIGP; _host_x[nall].z = INTEL_BIGP; _host_x[nall].w = 1; - if (lmp->atom->q != NULL) { + if (lmp->atom->q != nullptr) { memcpy(_host_q + host_min_local, _q + host_min_local, used_local * sizeof(flt_t)); memcpy(_host_q + host_min_local + used_local, _q + host_min_ghost, diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 2515e47c5..3e547b58a 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -528,7 +528,7 @@ inline double MIC_Wtime() { double time; struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec; return time; } diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 4a046bc84..9dfc3b899 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -35,8 +35,8 @@ NBinIntel::NBinIntel(LAMMPS *lmp) : NBinStandard(lmp) { "The 'package intel' command is required for /intel styles"); _fix = static_cast(modify->fix[ifix]); _precision_mode = _fix->precision(); - _atombin = NULL; - _binpacked = NULL; + _atombin = nullptr; + _binpacked = nullptr; #ifdef _LMP_INTEL_OFFLOAD _cop = _fix->coprocessor_number(); _offload_alloc = 0; diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index bd4a95f77..737c2d133 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -119,8 +119,8 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; if (molecular) { diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index 9aae0d27b..392e7bd8c 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -125,8 +125,8 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; if (molecular) { diff --git a/src/USER-INTEL/pair_airebo_intel.cpp b/src/USER-INTEL/pair_airebo_intel.cpp index 6b576220f..d5192f200 100644 --- a/src/USER-INTEL/pair_airebo_intel.cpp +++ b/src/USER-INTEL/pair_airebo_intel.cpp @@ -159,10 +159,10 @@ void aut_frebo(KernelArgsAIREBOT * ka, int torsion_flag); PairAIREBOIntel::PairAIREBOIntel(LAMMPS *lmp) : PairAIREBO(lmp) { suffix_flag |= Suffix::INTEL; - REBO_cnumneigh = NULL; - REBO_num_skin = NULL; - REBO_list_data = NULL; - fix = NULL; + REBO_cnumneigh = nullptr; + REBO_num_skin = nullptr; + REBO_list_data = nullptr; + fix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -697,7 +697,7 @@ inline flt_t gSpline(KernelArgsAIREBOT * ka, int itype, flt_t cos, flt_t NCmin = ka->params.NCmin; flt_t NCmax = ka->params.NCmax; int index = 0; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; int offs = 0; if (itype == 0) { @@ -921,7 +921,7 @@ inline flt_t frebo_pij(KernelArgsAIREBOT * ka, int i, int j, if (pass == 0) { sum_pij += wik * g * ex_lam; sum_dpij_dN += wik * dgdN * ex_lam; - flt_t cutN = Sp(Nki, Nmin, Nmax, NULL); + flt_t cutN = Sp(Nki, Nmin, Nmax, nullptr); *sum_N += (1 - ktype) * wik * cutN; } else { flt_t tmp = -0.5 * pij * pij * pij; @@ -1583,9 +1583,9 @@ void ref_rebo_neigh(KernelArgsAIREBOT * ka) { flt_t rcmin = ka->params.rcmin[itype][jtype]; flt_t rcmax = ka->params.rcmax[itype][jtype]; if (jtype == CARBON) - ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); else - ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); } } ka->neigh_rebo.num[i] = n; @@ -2408,7 +2408,7 @@ static fvec aut_mask_gSpline_pd_2(KernelArgsAIREBOT * ka, bvec /*active_mask*/, int itype, fvec cosjik, fvec Nij, fvec *dgdc, fvec *dgdN) { int i; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; ivec offs = ivec::setzero(); fvec NCmin = fvec::set1(ka->params.NCmin); diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp index a67db0ad3..41af529ca 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp @@ -502,8 +502,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -531,8 +531,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.h b/src/USER-INTEL/pair_buck_coul_cut_intel.h index 720432390..4bc19ac15 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.h +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.h @@ -72,7 +72,7 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut { c_cut_t **c_cut; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.cpp b/src/USER-INTEL/pair_buck_coul_long_intel.cpp index d0cb1837c..11ee79e5f 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_long_intel.cpp @@ -617,10 +617,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -662,10 +662,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.h b/src/USER-INTEL/pair_buck_coul_long_intel.h index ec37c699c..95492cd4e 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.h +++ b/src/USER-INTEL/pair_buck_coul_long_intel.h @@ -73,7 +73,7 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_intel.cpp b/src/USER-INTEL/pair_buck_intel.cpp index bb5b44d26..b4f57d2fa 100644 --- a/src/USER-INTEL/pair_buck_intel.cpp +++ b/src/USER-INTEL/pair_buck_intel.cpp @@ -449,8 +449,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: alloc_if(0) free_if(1)) \ @@ -473,8 +473,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_intel.h b/src/USER-INTEL/pair_buck_intel.h index ab5e13526..0e473c7c3 100644 --- a/src/USER-INTEL/pair_buck_intel.h +++ b/src/USER-INTEL/pair_buck_intel.h @@ -69,7 +69,7 @@ private: c_energy_t **c_energy; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_dpd_intel.cpp b/src/USER-INTEL/pair_dpd_intel.cpp index 690496d54..40b6c891d 100644 --- a/src/USER-INTEL/pair_dpd_intel.cpp +++ b/src/USER-INTEL/pair_dpd_intel.cpp @@ -37,7 +37,7 @@ PairDPDIntel::PairDPDIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - random_thread = NULL; + random_thread = nullptr; _nrandom_thread = 0; } diff --git a/src/USER-INTEL/pair_dpd_intel.h b/src/USER-INTEL/pair_dpd_intel.h index bce90a36b..409e123f2 100644 --- a/src/USER-INTEL/pair_dpd_intel.h +++ b/src/USER-INTEL/pair_dpd_intel.h @@ -83,7 +83,7 @@ class PairDPDIntel : public PairDPD { int *rngi; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nthreads, const int max_nbors, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index 084714daf..b93c9bc8c 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index 8786c0d78..2165f10af 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -69,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_intel.h b/src/USER-INTEL/pair_eam_intel.h index a9590f6b3..b9ad11597 100644 --- a/src/USER-INTEL/pair_eam_intel.h +++ b/src/USER-INTEL/pair_eam_intel.h @@ -76,7 +76,7 @@ class PairEAMIntel : public PairEAM { fc_packed2 *z2r_spline_t; ForceConst() : _ntypes(0), _nr(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nr, const int nrho, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_gayberne_intel.cpp b/src/USER-INTEL/pair_gayberne_intel.cpp index 30e61f67b..423631ae8 100644 --- a/src/USER-INTEL/pair_gayberne_intel.cpp +++ b/src/USER-INTEL/pair_gayberne_intel.cpp @@ -958,7 +958,7 @@ void PairGayBerneIntel::pack_force_const(ForceConst &fc, FC_PACKED2_T *olj34 = fc.lj34[0]; FC_PACKED3_T *oic = fc.ic; int tp1sq = tp1 * tp1; - if (oijc != NULL && oic != NULL) { + if (oijc != nullptr && oic != nullptr) { #pragma offload_transfer target(mic:_cop) \ in(special_lj: length(4) alloc_if(0) free_if(0)) \ in(oijc,olj34: length(tp1sq) alloc_if(0) free_if(0)) \ @@ -990,9 +990,9 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int * ojtype_form = jtype_form[0]; int * ojlist_form = jlist_form[0]; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - orsq_form != NULL && odelx_form != NULL && odely_form != NULL && - odelz_form != NULL && ojtype_form != NULL && ojlist_form != NULL && + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + orsq_form != nullptr && odelx_form != nullptr && odely_form != nullptr && + odelz_form != nullptr && ojtype_form != nullptr && ojlist_form != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(ospecial_lj, oijc, olj34, oic: alloc_if(0) free_if(1)) \ @@ -1048,10 +1048,10 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int off_onel = one_length * nthreads; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - oic != NULL && orsq_form != NULL && odelx_form != NULL && - odely_form != NULL && odelz_form != NULL && ojtype_form !=NULL && - ojlist_form !=NULL && cop >= 0) { + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + oic != nullptr && orsq_form != nullptr && odelx_form != nullptr && + odely_form != nullptr && odelz_form != nullptr && ojtype_form !=nullptr && + ojlist_form !=nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(oijc,olj34: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_gayberne_intel.h b/src/USER-INTEL/pair_gayberne_intel.h index 07dfba14d..ecdd93d35 100644 --- a/src/USER-INTEL/pair_gayberne_intel.h +++ b/src/USER-INTEL/pair_gayberne_intel.h @@ -74,7 +74,7 @@ class PairGayBerneIntel : public PairGayBerne { int **jtype_form, **jlist_form; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int one_length, const int nthreads, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp index c8e4a3d0e..71f2e2455 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -555,8 +555,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ospecial_coul = special_coul; flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(ocutsq, olj: alloc_if(0) free_if(1)) @@ -577,8 +577,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h index a48a84b5c..006dbaade 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -69,7 +69,7 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm { typename IntelBuffers::vec4_t **lj; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp index 5a4069e19..8f106d860 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -38,7 +38,7 @@ PairLJCharmmCoulLongIntel::PairLJCharmmCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -652,9 +652,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable != NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable != nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -693,9 +693,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable !=NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable !=nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h index 31b2182cb..f5b46eaf7 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h @@ -72,7 +72,7 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong { typename IntelBuffers::vec2_t **lj; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp index 34ab97fd3..ead3d5b5b 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongIntel::PairLJCutCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -611,10 +611,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -652,10 +652,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h index 288a6a7bc..617231363 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h @@ -73,7 +73,7 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_intel.cpp b/src/USER-INTEL/pair_lj_cut_intel.cpp index b484cb68d..281eef52d 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_intel.cpp @@ -36,7 +36,7 @@ PairLJCutIntel::PairLJCutIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-INTEL/pair_lj_cut_intel.h b/src/USER-INTEL/pair_lj_cut_intel.h index b577a0465..b88d21321 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.h +++ b/src/USER-INTEL/pair_lj_cut_intel.h @@ -67,7 +67,7 @@ class PairLJCutIntel : public PairLJCut { fc_packed2 **lj34; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp index 533252d01..ccde2d3a5 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp @@ -36,7 +36,7 @@ PairLJLongCoulLongIntel::PairLJLongCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } diff --git a/src/USER-INTEL/pair_sw_intel.cpp b/src/USER-INTEL/pair_sw_intel.cpp index 4ec2af40b..d2a481a76 100644 --- a/src/USER-INTEL/pair_sw_intel.cpp +++ b/src/USER-INTEL/pair_sw_intel.cpp @@ -1277,8 +1277,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; #ifdef _LMP_INTEL_OFFLOAD - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && _cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(op2, op2f, op2f2, op2e, op3: alloc_if(0) free_if(1)) } @@ -1306,8 +1306,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; int tp1sq = ntypes * ntypes; int tp1cu = tp1sq * ntypes; - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(op2,op2f,op2f2,op2e: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(op3: length(tp1cu) alloc_if(1) free_if(0)) diff --git a/src/USER-INTEL/pair_sw_intel.h b/src/USER-INTEL/pair_sw_intel.h index 5f7a511c9..f345b3d4f 100644 --- a/src/USER-INTEL/pair_sw_intel.h +++ b/src/USER-INTEL/pair_sw_intel.h @@ -88,7 +88,7 @@ class PairSWIntel : public PairSW { fc_packed3 ***p3; ForceConst() : p2(0), p2f(0), p2f2(0), p2e(0), p3(0), _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_tersoff_intel.cpp b/src/USER-INTEL/pair_tersoff_intel.cpp index 75f5f85f2..db24692b6 100644 --- a/src/USER-INTEL/pair_tersoff_intel.cpp +++ b/src/USER-INTEL/pair_tersoff_intel.cpp @@ -576,8 +576,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, c_cutoff_t * oc_cutoff_outer = c_cutoff_outer[0]; c_inner_t * oc_inner = c_inner[0][0]; c_outer_t * oc_outer = c_outer[0]; - if (c_first_loop != NULL && c_second_loop != NULL && - c_inner_loop != NULL && _cop >= 0) { + if (c_first_loop != nullptr && c_second_loop != nullptr && + c_inner_loop != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop, oc_second_loop, oc_inner_loop: alloc_if(0) free_if(1)) \ @@ -615,8 +615,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, int tp1sq = ntypes * ntypes; int tp1cb = ntypes * ntypes * ntypes; int tp1cb_pad = ntypes * ntypes * ntypes_pad; - if (oc_first_loop != NULL && oc_second_loop != NULL && - oc_inner_loop != NULL && cop >= 0) { + if (oc_first_loop != nullptr && oc_second_loop != nullptr && + oc_inner_loop != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(oc_second_loop: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h index 6da478c10..195efa74d 100644 --- a/src/USER-INTEL/pair_tersoff_intel.h +++ b/src/USER-INTEL/pair_tersoff_intel.h @@ -65,7 +65,7 @@ class PairTersoffIntel : public PairTersoff { c_outer_t * * c_outer; c_inner_t * * * c_inner; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pppm_disp_intel.cpp b/src/USER-INTEL/pppm_disp_intel.cpp index 1149c9b2c..8e958bf23 100644 --- a/src/USER-INTEL/pppm_disp_intel.cpp +++ b/src/USER-INTEL/pppm_disp_intel.cpp @@ -68,18 +68,18 @@ PPPMDispIntel::PPPMDispIntel(LAMMPS *lmp) : PPPMDisp(lmp) order = 7; order_6 = 7; //sets default stencil sizes to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; - particle_ekx0 = particle_eky0 = particle_ekz0 = NULL; - particle_ekx1 = particle_eky1 = particle_ekz1 = NULL; - particle_ekx2 = particle_eky2 = particle_ekz2 = NULL; - particle_ekx3 = particle_eky3 = particle_ekz3 = NULL; - particle_ekx4 = particle_eky4 = particle_ekz4 = NULL; - particle_ekx5 = particle_eky5 = particle_ekz5 = NULL; - particle_ekx6 = particle_eky6 = particle_ekz6 = NULL; - - rho_lookup = drho_lookup = NULL; - rho6_lookup = drho6_lookup = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; + particle_ekx0 = particle_eky0 = particle_ekz0 = nullptr; + particle_ekx1 = particle_eky1 = particle_ekz1 = nullptr; + particle_ekx2 = particle_eky2 = particle_ekz2 = nullptr; + particle_ekx3 = particle_eky3 = particle_ekz3 = nullptr; + particle_ekx4 = particle_eky4 = particle_ekz4 = nullptr; + particle_ekx5 = particle_eky5 = particle_ekz5 = nullptr; + particle_ekx6 = particle_eky6 = particle_ekz6 = nullptr; + + rho_lookup = drho_lookup = nullptr; + rho6_lookup = drho6_lookup = nullptr; rho_points = 0; _use_table = _use_packing = _use_lrt = 0; diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index d596df449..1a09522a2 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -65,10 +65,10 @@ PPPMIntel::PPPMIntel(LAMMPS *lmp) : PPPM(lmp) order = 7; //sets default stencil size to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; - rho_lookup = drho_lookup = NULL; + rho_lookup = drho_lookup = nullptr; rho_points = 0; _use_table = _use_lrt = 0; diff --git a/src/USER-INTEL/verlet_lrt_intel.cpp b/src/USER-INTEL/verlet_lrt_intel.cpp index 4efed0d33..869330ead 100644 --- a/src/USER-INTEL/verlet_lrt_intel.cpp +++ b/src/USER-INTEL/verlet_lrt_intel.cpp @@ -45,7 +45,7 @@ using namespace LAMMPS_NS; VerletLRTIntel::VerletLRTIntel(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) { #if defined(_LMP_INTEL_LRT_PTHREAD) - pthread_mutex_init(&_kmutex,NULL); + pthread_mutex_init(&_kmutex,nullptr); #endif } @@ -119,7 +119,7 @@ void VerletLRTIntel::setup(int flag) _kspace_ready = 0; _kspace_done = 0; - pthread_cond_init(&_kcond, NULL); + pthread_cond_init(&_kcond, nullptr); pthread_attr_init(&_kspace_attr); pthread_attr_setdetachstate(&_kspace_attr, PTHREAD_CREATE_JOINABLE); #endif @@ -377,7 +377,7 @@ void VerletLRTIntel::run(int n) _kspace_done = 0; pthread_cond_signal(&_kcond); pthread_mutex_unlock(&_kmutex); - pthread_join(_kspace_thread, NULL); + pthread_join(_kspace_thread, nullptr); pthread_attr_destroy(&_kspace_attr); } #endif @@ -428,8 +428,8 @@ void * VerletLRTIntel::k_launch_loop(void *context) pthread_mutex_unlock(&(c->_kmutex)); } - pthread_exit(NULL); - return NULL; + pthread_exit(nullptr); + return nullptr; } #endif diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 204a9c073..652b142b9 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -116,8 +116,8 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setArea = 0; numvel = 15; - Gamma = NULL; - NodeArea = NULL; + Gamma = nullptr; + NodeArea = nullptr; int iarg = 7; while (iarg < narg){ @@ -129,7 +129,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : double areafactor = atof(arg[iarg+2]); if(itype <= 0 || itype > atom->ntypes || areafactor < 0.0) error->all(FLERR,"Illegal fix lb/fluid command: setArea"); - if(NodeArea == NULL){ + if(NodeArea == nullptr){ NodeArea = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) NodeArea[i] = -1.0; } @@ -142,7 +142,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setGamma = 1; double Gammaone; Gammaone = atof(arg[iarg+1]); - if(Gamma == NULL) + if(Gamma == nullptr) Gamma = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) Gamma[i] = Gammaone; iarg += 2; @@ -240,7 +240,7 @@ a z wall velocity without implementing fixed BCs in z"); // perform initial allocation of atom-based array register // with Atom class //-------------------------------------------------------------------------- - hydroF = NULL; + hydroF = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -248,24 +248,24 @@ a z wall velocity without implementing fixed BCs in z"); for(int j=0; j<3; j++) hydroF[i][j] = 0.0; - Ng_lb = NULL; - w_lb = NULL; - mg_lb = NULL; - e = NULL; - feq = NULL; - feqold = NULL; - feqn = NULL; - feqoldn = NULL; - f_lb = NULL; - fnew = NULL; - density_lb = NULL; - u_lb = NULL; - altogether = NULL; - buf = NULL; - Ff = NULL; - Fftempx = NULL; - Fftempy = NULL; - Fftempz = NULL; + Ng_lb = nullptr; + w_lb = nullptr; + mg_lb = nullptr; + e = nullptr; + feq = nullptr; + feqold = nullptr; + feqn = nullptr; + feqoldn = nullptr; + f_lb = nullptr; + fnew = nullptr; + density_lb = nullptr; + u_lb = nullptr; + altogether = nullptr; + buf = nullptr; + Ff = nullptr; + Fftempx = nullptr; + Fftempy = nullptr; + Fftempz = nullptr; //-------------------------------------------------------------------------- // Set the lattice Boltzmann dt. diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 2c7e8dbf4..3c31dc93f 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -45,9 +45,9 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - force_old = NULL; - up = NULL; - up_old = NULL; + force_old = nullptr; + up = nullptr; + up_old = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index f714e3171..741a23c29 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -54,8 +54,8 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - body = NULL; - up = NULL; + body = nullptr; + up = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-LB/fix_lb_viscous.cpp b/src/USER-LB/fix_lb_viscous.cpp index 59fddebd6..602ec29f0 100644 --- a/src/USER-LB/fix_lb_viscous.cpp +++ b/src/USER-LB/fix_lb_viscous.cpp @@ -88,7 +88,7 @@ void FixLbViscous::init() void FixLbViscous::setup(int vflag) { - if (strstr(update->integrate_style,"verlet") != NULL) + if (strstr(update->integrate_style,"verlet") != nullptr) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 732ba0909..3193b23d6 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -76,7 +76,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : } ptr_m->params = new double[nvars]; - if (ptr_m->params == NULL) { + if (ptr_m->params == nullptr) { error->all(FLERR,"Parameter pointer was NULL!"); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index b3122a68d..abe903125 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -129,7 +129,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, is_var[i] = 0; } tstrs[i] = new char[len]; - if (tstrs[i] == NULL ) error->all(FLERR,"Error allocating space for args."); + if (tstrs[i] == nullptr ) error->all(FLERR,"Error allocating space for args."); strcpy( tstrs[i], arg[i+6] + offset ); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h index 42da240ab..7ed1f75fa 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h @@ -125,7 +125,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -136,7 +136,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h index f42902f72..69e4eb13e 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h @@ -112,7 +112,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -123,7 +123,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/manifold.h b/src/USER-MANIFOLD/manifold.h index b0727c346..9adf7055c 100644 --- a/src/USER-MANIFOLD/manifold.h +++ b/src/USER-MANIFOLD/manifold.h @@ -46,7 +46,7 @@ namespace user_manifold { // Abstract base class. class manifold : protected Pointers { public: - manifold(class LAMMPS* lmp) : Pointers(lmp), params(NULL){ } + manifold(class LAMMPS* lmp) : Pointers(lmp), params(nullptr){ } virtual ~manifold(){ delete[] params; } virtual double g( const double * ) = 0; virtual void n( const double *, double * ) = 0; diff --git a/src/USER-MANIFOLD/manifold_factory.cpp b/src/USER-MANIFOLD/manifold_factory.cpp index 7df3e52ed..fe9b7615b 100644 --- a/src/USER-MANIFOLD/manifold_factory.cpp +++ b/src/USER-MANIFOLD/manifold_factory.cpp @@ -54,7 +54,7 @@ manifold* LAMMPS_NS::user_manifold::create_manifold(const char *mname, LAMMPS *lmp, int narg, char **arg ) { - manifold *man = NULL; + manifold *man = nullptr; make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); diff --git a/src/USER-MANIFOLD/manifold_factory.h b/src/USER-MANIFOLD/manifold_factory.h index 85ee4011b..1eac8bf64 100644 --- a/src/USER-MANIFOLD/manifold_factory.h +++ b/src/USER-MANIFOLD/manifold_factory.h @@ -94,7 +94,7 @@ class manifold; LAMMPS *lmp, int narg, char **arg ) { if( strcmp( m_type::type(), name ) == 0 ){ - if( *man_ptr == NULL ){ + if( *man_ptr == nullptr ){ *man_ptr = new m_type(lmp, narg, arg); } } diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index ef2699929..7b0d7d4d3 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -136,7 +136,7 @@ public: // Manifold itself: manifold_gaussian_bump::manifold_gaussian_bump(class LAMMPS* lmp, int /*narg*/, char **/*arg*/) - : manifold(lmp), lut_z(NULL), lut_zp(NULL) {} + : manifold(lmp), lut_z(nullptr), lut_zp(nullptr) {} manifold_gaussian_bump::~manifold_gaussian_bump() diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index ee86a50bf..a1d2c7a62 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -123,14 +123,14 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla for( std::size_t i = 0; i < parts.size(); ++i ){ thyla_part *p = parts[i]; if (is_in_domain(p,x)) { - if (idx != NULL) *idx = i; + if (idx != nullptr) *idx = i; return p; } } char msg[2048]; sprintf(msg,"Could not find thyla_part for x = (%f,%f,%f)", x[0],x[1],x[2]); error->one(FLERR,msg); - return NULL; + return nullptr; } diff --git a/src/USER-MANIFOLD/manifold_thylakoid.h b/src/USER-MANIFOLD/manifold_thylakoid.h index 35ad4dfd9..d3ffa6776 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.h +++ b/src/USER-MANIFOLD/manifold_thylakoid.h @@ -29,7 +29,7 @@ namespace user_manifold { private: void init_domains(); - thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = NULL ); + thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = nullptr ); int is_in_domain( thyla_part *p, const double *x ); void check_overlap(); std::vector parts; diff --git a/src/USER-MEAMC/meam_impl.cpp b/src/USER-MEAMC/meam_impl.cpp index a546aa0c7..147be9246 100644 --- a/src/USER-MEAMC/meam_impl.cpp +++ b/src/USER-MEAMC/meam_impl.cpp @@ -28,15 +28,15 @@ using namespace LAMMPS_NS; MEAM::MEAM(Memory* mem) : memory(mem) { - phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = NULL; + phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = nullptr; nmax = 0; - rho = rho0 = rho1 = rho2 = rho3 = frhop = NULL; - gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = NULL; - arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = NULL; + rho = rho0 = rho1 = rho2 = rho3 = frhop = nullptr; + gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = nullptr; + arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = nullptr; maxneigh = 0; - scrfcn = dscrfcn = fcpair = NULL; + scrfcn = dscrfcn = fcpair = nullptr; neltypes = 0; for (int i = 0; i < maxelt; i++) { diff --git a/src/USER-MEAMC/meam_setup_done.cpp b/src/USER-MEAMC/meam_setup_done.cpp index ddbb40310..f8703f10e 100644 --- a/src/USER-MEAMC/meam_setup_done.cpp +++ b/src/USER-MEAMC/meam_setup_done.cpp @@ -186,21 +186,21 @@ MEAM::compute_pair_meam(void) double C, s111, s112, s221, S11, S22; // check for previously allocated arrays and free them - if (this->phir != NULL) + if (this->phir != nullptr) memory->destroy(this->phir); - if (this->phirar != NULL) + if (this->phirar != nullptr) memory->destroy(this->phirar); - if (this->phirar1 != NULL) + if (this->phirar1 != nullptr) memory->destroy(this->phirar1); - if (this->phirar2 != NULL) + if (this->phirar2 != nullptr) memory->destroy(this->phirar2); - if (this->phirar3 != NULL) + if (this->phirar3 != nullptr) memory->destroy(this->phirar3); - if (this->phirar4 != NULL) + if (this->phirar4 != nullptr) memory->destroy(this->phirar4); - if (this->phirar5 != NULL) + if (this->phirar5 != nullptr) memory->destroy(this->phirar5); - if (this->phirar6 != NULL) + if (this->phirar6 != nullptr) memory->destroy(this->phirar6); // allocate memory for array that defines the potential diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 6f674c9f4..133bb611c 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -56,10 +56,10 @@ PairMEAMC::PairMEAMC(LAMMPS *lmp) : Pair(lmp) allocated = 0; nelements = 0; - elements = NULL; - mass = NULL; + elements = nullptr; + mass = nullptr; meam_inst = new MEAM(memory); - scale = NULL; + scale = nullptr; // set comm size needed by this Pair @@ -161,7 +161,7 @@ void PairMEAMC::compute(int eflag, int vflag) double **vptr; if (vflag_atom) vptr = vatom; - else vptr = NULL; + else vptr = nullptr; for (ii = 0; ii < inum_half; ii++) { i = ilist_half[ii]; @@ -365,7 +365,7 @@ void PairMEAMC::read_files(const std::string &globalfile, FILE *fp; if (comm->me == 0) { fp = utils::open_potential(globalfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", globalfile)); } @@ -408,7 +408,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (1) { char *ptr; ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -424,7 +424,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (nwords < params_per_line) { int n = strlen(line); ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -440,7 +440,7 @@ void PairMEAMC::read_files(const std::string &globalfile, nwords = 0; words[nwords++] = strtok(line,"' \t\n\r\f"); - while ((words[nwords++] = strtok(NULL,"' \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr,"' \t\n\r\f"))) continue; // skip if element name isn't in element list @@ -556,7 +556,7 @@ void PairMEAMC::read_files(const std::string &globalfile, delete [] rozero; delete [] found; - // done if user param file is NULL + // done if user param file is nullptr if (userfile == "NULL") return; @@ -564,7 +564,7 @@ void PairMEAMC::read_files(const std::string &globalfile, if (comm->me == 0) { fp = utils::open_potential(userfile,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", userfile)); } @@ -584,7 +584,7 @@ void PairMEAMC::read_files(const std::string &globalfile, char *ptr; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); nline = -1; } else nline = strlen(line) + 1; @@ -603,7 +603,7 @@ void PairMEAMC::read_files(const std::string &globalfile, int nparams = 0; params[nparams++] = strtok(line,"=(), '\t\n\r\f"); while (nparams < maxparams && - (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f"))) + (params[nparams++] = strtok(nullptr,"=(), '\t\n\r\f"))) continue; nparams--; @@ -837,5 +837,5 @@ void *PairMEAMC::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.cpp b/src/USER-MESODPD/compute_edpd_temp_atom.cpp index 9eb6e9752..02aa3e731 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.cpp +++ b/src/USER-MESODPD/compute_edpd_temp_atom.cpp @@ -34,7 +34,7 @@ ComputeEDPDTempAtom::ComputeEDPDTempAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - temp_vector = NULL; + temp_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index 7e9d5eb29..d87d645b6 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -38,7 +38,7 @@ ComputeTDPDCCAtom::ComputeTDPDCCAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - cc_vector = NULL; + cc_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index 9c2e74b88..36ad434f4 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -65,8 +65,8 @@ PairEDPD::PairEDPD(LAMMPS *lmp) : Pair(lmp) { if (lmp->citeme) lmp->citeme->add(cite_pair_edpd); writedata = 1; - random = NULL; - randomT = NULL; + random = nullptr; + randomT = nullptr; } /* ---------------------------------------------------------------------- */ @@ -453,24 +453,24 @@ void PairEDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,nullptr,error); if(power_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,nullptr,error); if(kappa_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -508,9 +508,9 @@ void PairEDPD::write_restart_settings(FILE *fp) void PairEDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-MESODPD/pair_mdpd.cpp b/src/USER-MESODPD/pair_mdpd.cpp index 88b6724a0..62a2ca8d1 100644 --- a/src/USER-MESODPD/pair_mdpd.cpp +++ b/src/USER-MESODPD/pair_mdpd.cpp @@ -54,7 +54,7 @@ PairMDPD::PairMDPD(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_pair_mdpd); writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -348,15 +348,15 @@ void PairMDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&A_att[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&B_rep[i][j],1,MPI_DOUBLE,0,world); @@ -386,10 +386,10 @@ void PairMDPD::write_restart_settings(FILE *fp) void PairMDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESODPD/pair_tdpd.cpp b/src/USER-MESODPD/pair_tdpd.cpp index 65a518c07..b1ffb5ce8 100644 --- a/src/USER-MESODPD/pair_tdpd.cpp +++ b/src/USER-MESODPD/pair_tdpd.cpp @@ -57,7 +57,7 @@ PairTDPD::PairTDPD(LAMMPS *lmp) : Pair(lmp) cc_species = atom->cc_species; writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -395,19 +395,19 @@ void PairTDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,nullptr,error); for(int k=0; kme == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESONT/compute_mesont.cpp b/src/USER-MESONT/compute_mesont.cpp index 96792c898..0321be7c5 100644 --- a/src/USER-MESONT/compute_mesont.cpp +++ b/src/USER-MESONT/compute_mesont.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMesoNT::ComputeMesoNT(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), energy(NULL) { + Compute(lmp, narg, arg), energy(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute mesont command"); std::string ctype = arg[3]; if (ctype == "estretch") compute_type = ES; @@ -62,7 +62,7 @@ double ComputeMesoNT::compute_scalar() { error->all(FLERR,"Energy was not tallied on needed timestep"); int i; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es_tot",i)); else if (compute_type == EB) @@ -104,7 +104,7 @@ void ComputeMesoNT::compute_peratom() { int i; // clear local energy array for (int i = 0; i < ntotal; i++) energy[i] = 0.0; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es",i)); else if (compute_type == EB) diff --git a/src/USER-MESONT/pair_mesocnt.cpp b/src/USER-MESONT/pair_mesocnt.cpp index 96d53bd41..a7b4bf057 100644 --- a/src/USER-MESONT/pair_mesocnt.cpp +++ b/src/USER-MESONT/pair_mesocnt.cpp @@ -244,7 +244,7 @@ void PairMesoCNT::compute(int eflag, int vflag) // infinite CNT case if (endflag == 0) { - geometry(r1,r2,p1,p2,NULL,p,m,param,basis); + geometry(r1,r2,p1,p2,nullptr,p,m,param,basis); if (param[0] > cutoff) continue; finf(param,evdwl,flocal); @@ -760,7 +760,7 @@ void PairMesoCNT::read_file() // open file fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open mesocnt file: {}",file)); utils::sfgets(FLERR,line,MAXLINE,fp,file,error); @@ -846,7 +846,7 @@ void PairMesoCNT::read_data(FILE *fp, double *data, double x,xtemp,dxtemp; for (int i = 0; i < ninput; i++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (i > 0) xtemp = x; @@ -899,7 +899,7 @@ void PairMesoCNT::read_data(FILE *fp, double **data, for (int i = 0; i < ninput; i++) { if (i > 0) xtemp = x; for (int j = 0; j < ninput; j++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (j > 0) ytemp = y; diff --git a/src/USER-MESONT/pair_mesont_tpm.cpp b/src/USER-MESONT/pair_mesont_tpm.cpp index 6d8c8126a..4e5f31c66 100644 --- a/src/USER-MESONT/pair_mesont_tpm.cpp +++ b/src/USER-MESONT/pair_mesont_tpm.cpp @@ -166,7 +166,7 @@ void vector_union(std::vector& v1, std::vector& v2, } MESONTList::MESONTList(const Atom* atom, const NeighList* nblist, double /* rc2 */){ - if (atom == NULL || nblist == NULL) return; + if (atom == nullptr || nblist == nullptr) return; //number of local atoms at the node int nlocal = atom->nlocal; //total number of atoms in the node and ghost shell @@ -305,12 +305,12 @@ PairMESONTTPM::PairMESONTTPM(LAMMPS *lmp) : Pair(lmp) { writedata=1; BendingMode = 0; // Harmonic bending model TPMType = 0; // Inter-tube segment-segment interaction - tab_path = NULL; + tab_path = nullptr; tab_path_length = 0; - eatom_s = NULL; - eatom_b = NULL; - eatom_t = NULL; + eatom_s = nullptr; + eatom_b = nullptr; + eatom_t = nullptr; instance_count++; if(instance_count > 1) error->all(FLERR, "only a single instance of mesont/tpm pair style can be created"); @@ -330,7 +330,7 @@ PairMESONTTPM::~PairMESONTTPM() memory->destroy(eatom_t); } instance_count--; - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); } /* ---------------------------------------------------------------------- */ @@ -597,7 +597,7 @@ void PairMESONTTPM::settings(int narg, char **arg){ } std::string TPMAFile = (narg > 1) ? arg[1] : "MESONT-TABTP.xrs"; tab_path_length = TPMAFile.length(); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); //c_str returns '\0' terminated string memory->create(tab_path,tab_path_length+1,"pair:path"); std::memcpy(tab_path, TPMAFile.c_str(), tab_path_length+1); @@ -738,7 +738,7 @@ void PairMESONTTPM::read_restart_settings(FILE *fp){ MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&tab_path_length,1,MPI_INT,0,world); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); memory->create(tab_path,tab_path_length+1,"pair:path"); if (me == 0) fread(tab_path,tab_path_length+1,1,fp); MPI_Bcast(tab_path,tab_path_length+1,MPI_CHAR,0,world); @@ -793,5 +793,5 @@ void* PairMESONTTPM::extract(const char *str, int &){ else if (strcmp(str,"mesonttpm_Es") == 0) return eatom_s; else if (strcmp(str,"mesonttpm_Eb") == 0) return eatom_b; else if (strcmp(str,"mesonttpm_Et") == 0) return eatom_t; - else return NULL; + else return nullptr; }; diff --git a/src/USER-MGPT/mgpt_readpot.cpp b/src/USER-MGPT/mgpt_readpot.cpp index 144c661b0..c5f7c75d7 100644 --- a/src/USER-MGPT/mgpt_readpot.cpp +++ b/src/USER-MGPT/mgpt_readpot.cpp @@ -66,7 +66,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub FILE *in = fopen(potin_file,"r"); char line[1024]; - if(in == NULL) { + if(in == nullptr) { fprintf(stderr,"@%s:%d: Error reading potin file. Can not open file \'%s\'.\n", __FILE__,__LINE__,potin_file); exit(1); @@ -75,7 +75,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub vsize = 10; volarr = (double *) malloc(sizeof(double) * vsize); n = 0; - while(fgets(line,sizeof(line),in) != NULL) { + while(fgets(line,sizeof(line),in) != nullptr) { double zval,ivol,rws,mass; double r0x,r1x,drx; int nrx,i; @@ -408,7 +408,7 @@ void potdata::readpot(const char *parmin_file,const char *potin_file,const doubl vpairtab[i*nr+j] = vpairtab[i*nr+j]*fscr + v2a - v2b; if(0) if(fabs(vol-ivol) < 0.01) { - static FILE *xfile = NULL; + static FILE *xfile = nullptr; if(j == 0) { xfile = fopen("mgpt5-pot.dat","w"); fprintf(xfile,"%%%% vol = %15.5e ivol = %15.5e i = %d ii = %d\n", diff --git a/src/USER-MGPT/mgpt_readpot.h b/src/USER-MGPT/mgpt_readpot.h index 8f46592e8..c2a6feabe 100644 --- a/src/USER-MGPT/mgpt_readpot.h +++ b/src/USER-MGPT/mgpt_readpot.h @@ -172,7 +172,7 @@ struct potdata2 { strcpy(s,nametemplate); p = strchr(s,'{'); - if(p != NULL) { + if(p != nullptr) { if(sscanf(p+1,"%d:%d:%d",i0,stride,i1) != 3) { fprintf(stderr,"Error in template (\'%s\'), can not parse range.\n",nametemplate); exit(1); @@ -217,12 +217,12 @@ struct potdata2 { const char *parmin_suffix = strchr(parmin_template,'}')+1; const char * potin_suffix = strchr( potin_template,'}')+1; - if(parmin_suffix-1 == NULL) { + if(parmin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. parmin_template=\'%s\'\n", parmin_template); exit(1); } - if(potin_suffix-1 == NULL) { + if(potin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. potin_template=\'%s\'\n", potin_template); exit(1); diff --git a/src/USER-MGPT/pair_mgpt.cpp b/src/USER-MGPT/pair_mgpt.cpp index 070e3cb61..dd4829535 100644 --- a/src/USER-MGPT/pair_mgpt.cpp +++ b/src/USER-MGPT/pair_mgpt.cpp @@ -54,7 +54,7 @@ static double gettime(int x = 0) { if(1) { /* struct timeval tv; - gettimeofday(&tv,NULL); + gettimeofday(&tv,nullptr); return tv.tv_sec + 1e-6 * tv.tv_usec; */ /* @@ -1859,7 +1859,7 @@ void PairMGPT::coeff(int narg, char **arg) if(strspn(arg[iarg+1],"1234") == strlen(arg[iarg+1])) { nbody_flag = 0; for(int i = 0; i<4; i++) - if(strchr(arg[iarg+1],'1'+i) != NULL) { + if(strchr(arg[iarg+1],'1'+i) != nullptr) { nbody_flag = nbody_flag + (1<me == 0) printf("Explicitly adding %d-tuple forces.\n",i+1); } @@ -1906,7 +1906,7 @@ void PairMGPT::coeff(int narg, char **arg) if(comm->me == 0) { FILE *parmin_fp = utils::open_potential(arg[2],lmp,nullptr); FILE *potin_fp = utils::open_potential(arg[3],lmp,nullptr); - if (parmin_fp == NULL || potin_fp == NULL) { + if (parmin_fp == nullptr || potin_fp == nullptr) { char str[128]; sprintf(str,"Cannot open MGPT potential files %s %s",arg[2],arg[3]); error->one(FLERR,str); diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp index a986cb832..f6427171a 100644 --- a/src/USER-MISC/angle_cosine_shift.cpp +++ b/src/USER-MISC/angle_cosine_shift.cpp @@ -37,7 +37,7 @@ using namespace MathConst; AngleCosineShift::AngleCosineShift(LAMMPS *lmp) : Angle(lmp) { - kcost = NULL; + kcost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -225,10 +225,10 @@ void AngleCosineShift::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&kcost[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp index 52bfe751f..9e98c319f 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.cpp +++ b/src/USER-MISC/angle_cosine_shift_exp.cpp @@ -37,13 +37,13 @@ using namespace MathConst; AngleCosineShiftExp::AngleCosineShiftExp(LAMMPS *lmp) : Angle(lmp) { - doExpansion = NULL; - umin = NULL; - a = NULL; - opt1 = NULL; - theta0 = NULL; - sint = NULL; - cost = NULL; + doExpansion = nullptr; + umin = nullptr; + a = nullptr; + opt1 = nullptr; + theta0 = nullptr; + sint = nullptr; + cost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -257,11 +257,11 @@ void AngleCosineShiftExp::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp index 336638f25..6715bd118 100644 --- a/src/USER-MISC/angle_dipole.cpp +++ b/src/USER-MISC/angle_dipole.cpp @@ -35,8 +35,8 @@ using namespace MathConst; AngleDipole::AngleDipole(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - gamma0 = NULL; + k = nullptr; + gamma0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -206,8 +206,8 @@ void AngleDipole::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&gamma0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier.cpp b/src/USER-MISC/angle_fourier.cpp index 907ee973b..fc14736a0 100644 --- a/src/USER-MISC/angle_fourier.cpp +++ b/src/USER-MISC/angle_fourier.cpp @@ -38,10 +38,10 @@ using namespace MathConst; AngleFourier::AngleFourier(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C0 = NULL; - C1 = NULL; - C2 = NULL; + k = nullptr; + C0 = nullptr; + C1 = nullptr; + C2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -232,10 +232,10 @@ void AngleFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier_simple.cpp b/src/USER-MISC/angle_fourier_simple.cpp index 8894f7b4c..abd02535c 100644 --- a/src/USER-MISC/angle_fourier_simple.cpp +++ b/src/USER-MISC/angle_fourier_simple.cpp @@ -38,9 +38,9 @@ using namespace MathConst; AngleFourierSimple::AngleFourierSimple(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C = NULL; - N = NULL; + k = nullptr; + C = nullptr; + N = nullptr; } /* ---------------------------------------------------------------------- */ @@ -238,9 +238,9 @@ void AngleFourierSimple::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp index 93f45f956..50a73af7b 100644 --- a/src/USER-MISC/angle_quartic.cpp +++ b/src/USER-MISC/angle_quartic.cpp @@ -233,10 +233,10 @@ void AngleQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&k3[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp index 5889400b9..28badce91 100644 --- a/src/USER-MISC/bond_harmonic_shift.cpp +++ b/src/USER-MISC/bond_harmonic_shift.cpp @@ -177,9 +177,9 @@ void BondHarmonicShift::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp index 86e6263f9..b875fb71b 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.cpp +++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp @@ -179,9 +179,9 @@ void BondHarmonicShiftCut::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 87671655b..4f79fea51 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -44,7 +44,7 @@ BondSpecial::~BondSpecial() void BondSpecial::init_style() { - if (force->pair == NULL) error->all(FLERR,"No pair style defined"); + if (force->pair == nullptr) error->all(FLERR,"No pair style defined"); else if ((force->pair->single_enable == 0) || force->pair->manybody_flag) error->all(FLERR,"Pair style does not support bond style special"); @@ -59,7 +59,7 @@ void BondSpecial::init_style() force->special_coul[3] != 1.0)) error->all(FLERR,"Invalid 1-4 setting for bond style special."); - if (force->kspace != NULL) + if (force->kspace != nullptr) error->all(FLERR,"Bond style special is not compatible with long range " "Coulombic interactions"); } diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp index bcf41591e..df0636d7b 100644 --- a/src/USER-MISC/compute_ackland_atom.cpp +++ b/src/USER-MISC/compute_ackland_atom.cpp @@ -48,13 +48,13 @@ ComputeAcklandAtom::ComputeAcklandAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - structure = NULL; + structure = nullptr; maxneigh = 0; legacy = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; int iarg = 3; while (narg > iarg) { diff --git a/src/USER-MISC/compute_basal_atom.cpp b/src/USER-MISC/compute_basal_atom.cpp index 3b9b38343..fa59a0257 100644 --- a/src/USER-MISC/compute_basal_atom.cpp +++ b/src/USER-MISC/compute_basal_atom.cpp @@ -44,12 +44,12 @@ ComputeBasalAtom::ComputeBasalAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 3; nmax = 0; - BPV = NULL; + BPV = nullptr; maxneigh = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 52656ec9d..5efab292b 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -49,7 +49,7 @@ enum{NCOMMON}; ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), cnpv(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), cnpv(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cnp/atom command"); @@ -92,7 +92,7 @@ ComputeCNPAtom::~ComputeCNPAtom() void ComputeCNPAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cnp/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/USER-MISC/compute_entropy_atom.cpp b/src/USER-MISC/compute_entropy_atom.cpp index d539d51e9..2a308c427 100644 --- a/src/USER-MISC/compute_entropy_atom.cpp +++ b/src/USER-MISC/compute_entropy_atom.cpp @@ -40,7 +40,7 @@ using namespace MathConst; ComputeEntropyAtom:: ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pair_entropy(NULL), pair_entropy_avg(NULL) + pair_entropy(nullptr), pair_entropy_avg(nullptr) { if (narg < 5 || narg > 10) error->all(FLERR,"Illegal compute entropy/atom command; wrong number" @@ -118,7 +118,7 @@ ComputeEntropyAtom::~ComputeEntropyAtom() void ComputeEntropyAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute entropy/atom requires a pair style be" " defined"); diff --git a/src/USER-MISC/compute_gyration_shape.cpp b/src/USER-MISC/compute_gyration_shape.cpp index aef5ef91a..6aef8c80e 100644 --- a/src/USER-MISC/compute_gyration_shape.cpp +++ b/src/USER-MISC/compute_gyration_shape.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShape::ComputeGyrationShape(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration(NULL) + Compute(lmp, narg, arg), id_gyration(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape command"); diff --git a/src/USER-MISC/compute_gyration_shape_chunk.cpp b/src/USER-MISC/compute_gyration_shape_chunk.cpp index 116d85102..2c9bf9d3e 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.cpp +++ b/src/USER-MISC/compute_gyration_shape_chunk.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShapeChunk::ComputeGyrationShapeChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration_chunk(NULL), shape_parameters(NULL) + Compute(lmp, narg, arg), id_gyration_chunk(nullptr), shape_parameters(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape/chunk command"); diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index f2ccf2694..f7a9f9fcf 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -73,7 +73,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_temp(NULL), deltaR(NULL) + Compute(lmp, narg, arg), id_temp(nullptr), deltaR(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute hma command"); if (igroup) error->all(FLERR,"Compute hma must use group all"); @@ -199,7 +199,7 @@ ComputeHMA::~ComputeHMA() void ComputeHMA::init() { if (computeCv>-1) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute hma cv"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute hma cv"); @@ -222,7 +222,7 @@ void ComputeHMA::setup() int ifix = modify->find_fix(id_temp); if (ifix < 0) error->all(FLERR,"Could not find compute hma temperature ID"); double * temperat = (double *) modify->fix[ifix]->extract("t_target",dummy); - if (temperat==NULL) error->all(FLERR,"Could not find compute hma temperature ID"); + if (temperat==nullptr) error->all(FLERR,"Could not find compute hma temperature ID"); finaltemp = * temperat; // set fix which stores original atom coords diff --git a/src/USER-MISC/compute_pressure_cylinder.cpp b/src/USER-MISC/compute_pressure_cylinder.cpp index 6cf375dd1..e050275f7 100644 --- a/src/USER-MISC/compute_pressure_cylinder.cpp +++ b/src/USER-MISC/compute_pressure_cylinder.cpp @@ -48,10 +48,10 @@ static const char cite_compute_pressure_cylinder[] = ComputePressureCyl::ComputePressureCyl(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - Pr_temp(NULL), Pr_all(NULL), Pz_temp(NULL), Pz_all(NULL), Pphi_temp(NULL), - Pphi_all(NULL), R(NULL), Rinv(NULL), R2(NULL), PrAinv(NULL), PzAinv(NULL), - R2kin(NULL), density_temp(NULL), invVbin(NULL), density_all(NULL), - tangent(NULL), ephi_x(NULL), ephi_y(NULL), binz(NULL) + Pr_temp(nullptr), Pr_all(nullptr), Pz_temp(nullptr), Pz_all(nullptr), Pphi_temp(nullptr), + Pphi_all(nullptr), R(nullptr), Rinv(nullptr), R2(nullptr), PrAinv(nullptr), PzAinv(nullptr), + R2kin(nullptr), density_temp(nullptr), invVbin(nullptr), density_all(nullptr), + tangent(nullptr), ephi_x(nullptr), ephi_y(nullptr), binz(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_pressure_cylinder); if (narg != 7) error->all(FLERR,"Illegal compute pressure/cylinder command"); @@ -143,7 +143,7 @@ ComputePressureCyl::~ComputePressureCyl() void ComputePressureCyl::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pressure/cylinder"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pressure/cylinder"); diff --git a/src/USER-MISC/compute_pressure_grem.cpp b/src/USER-MISC/compute_pressure_grem.cpp index ba949727b..6a5c36a06 100644 --- a/src/USER-MISC/compute_pressure_grem.cpp +++ b/src/USER-MISC/compute_pressure_grem.cpp @@ -55,7 +55,7 @@ void ComputePressureGrem::init() int dim; scale_grem = (double *)modify->fix[ifix]->extract("scale_grem",dim); - if (scale_grem == NULL || dim != 0) + if (scale_grem == nullptr || dim != 0) error->all(FLERR,"Cannot extract gREM scale factor from fix grem"); } diff --git a/src/USER-MISC/compute_stress_mop.cpp b/src/USER-MISC/compute_stress_mop.cpp index c733c929b..2abe812f1 100644 --- a/src/USER-MISC/compute_stress_mop.cpp +++ b/src/USER-MISC/compute_stress_mop.cpp @@ -117,7 +117,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // Initialize some variables - values_local = values_global = vector = NULL; + values_local = values_global = vector = nullptr; // this fix produces a global vector @@ -173,7 +173,7 @@ void ComputeStressMop::init() // This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop"); @@ -185,15 +185,15 @@ void ComputeStressMop::init() //Compute stress/mop only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_stress_mop_profile.cpp b/src/USER-MISC/compute_stress_mop_profile.cpp index 323aee851..6beb3ffd8 100644 --- a/src/USER-MISC/compute_stress_mop_profile.cpp +++ b/src/USER-MISC/compute_stress_mop_profile.cpp @@ -112,8 +112,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a // initialize some variables nbins = 0; - coord = coordp = NULL; - values_local = values_global = array = NULL; + coord = coordp = nullptr; + values_local = values_global = array = nullptr; // bin setup @@ -173,7 +173,7 @@ void ComputeStressMopProfile::init() //This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop/profile"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop/profile"); @@ -185,15 +185,15 @@ void ComputeStressMopProfile::init() //Compute stress/mop/profile only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp index c333357a9..5aafe1903 100644 --- a/src/USER-MISC/compute_temp_rotate.cpp +++ b/src/USER-MISC/compute_temp_rotate.cpp @@ -42,7 +42,7 @@ ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-MISC/compute_viscosity_cos.cpp b/src/USER-MISC/compute_viscosity_cos.cpp index dae93a8d8..4a798eb15 100644 --- a/src/USER-MISC/compute_viscosity_cos.cpp +++ b/src/USER-MISC/compute_viscosity_cos.cpp @@ -45,7 +45,7 @@ ComputeViscosityCos::ComputeViscosityCos(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[7]; } diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp index 7c131682f..d5cd27189 100644 --- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp +++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp @@ -322,11 +322,11 @@ void DihedralCosineShiftExp::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp index 066447f92..cb620ae7d 100644 --- a/src/USER-MISC/dihedral_fourier.cpp +++ b/src/USER-MISC/dihedral_fourier.cpp @@ -365,7 +365,7 @@ void DihedralFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -380,9 +380,9 @@ void DihedralFourier::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,NULL,error); - utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index bde8d8407..bf1b2fa75 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -320,7 +320,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -330,7 +330,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) if (comm->me == 0) { for(int i = 1; i <= atom->ndihedraltypes; i++) - utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,nullptr,error); } for (int i = 1; i <= atom->ndihedraltypes; i++ ) diff --git a/src/USER-MISC/dihedral_quadratic.cpp b/src/USER-MISC/dihedral_quadratic.cpp index deafc8391..68be19833 100644 --- a/src/USER-MISC/dihedral_quadratic.cpp +++ b/src/USER-MISC/dihedral_quadratic.cpp @@ -326,8 +326,8 @@ void DihedralQuadratic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&phi0[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_spherical.cpp b/src/USER-MISC/dihedral_spherical.cpp index 15bb458c4..d20048299 100644 --- a/src/USER-MISC/dihedral_spherical.cpp +++ b/src/USER-MISC/dihedral_spherical.cpp @@ -654,16 +654,16 @@ void DihedralSpherical::allocate() theta2_shift = new double * [n+1]; theta2_offset = new double * [n+1]; for (int i = 1; i <= n; i++) { - Ccoeff[i] = NULL; - phi_mult[i] = NULL; - phi_shift[i] = NULL; - phi_offset[i] = NULL; - theta1_mult[i] = NULL; - theta1_shift[i] = NULL; - theta1_offset[i] = NULL; - theta2_mult[i] = NULL; - theta2_shift[i] = NULL; - theta2_offset[i] = NULL; + Ccoeff[i] = nullptr; + phi_mult[i] = nullptr; + phi_shift[i] = nullptr; + phi_offset[i] = nullptr; + theta1_mult[i] = nullptr; + theta1_shift[i] = nullptr; + theta1_offset[i] = nullptr; + theta2_mult[i] = nullptr; + theta2_shift[i] = nullptr; + theta2_offset[i] = nullptr; } memory->create(setflag,n+1,"dihedral:setflag"); @@ -755,7 +755,7 @@ void DihedralSpherical::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -775,16 +775,16 @@ void DihedralSpherical::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 91a8642b1..d09684df9 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -788,7 +788,7 @@ void DihedralTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } @@ -1014,8 +1014,8 @@ void DihedralTable::write_restart_settings(FILE *fp) void DihedralTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1027,10 +1027,10 @@ void DihedralTable::read_restart_settings(FILE *fp) void DihedralTable::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index f8a2f0259..3933e3934 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -412,8 +412,8 @@ DihedralTableCut::DihedralTableCut(LAMMPS *lmp) : Dihedral(lmp) { if (lmp->citeme) lmp->citeme->add(cite_dihedral_tablecut); ntables = 0; - tables = NULL; - checkU_fname = checkF_fname = NULL; + tables = nullptr; + checkU_fname = checkF_fname = nullptr; } /* ---------------------------------------------------------------------- */ @@ -779,7 +779,7 @@ void DihedralTableCut::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -1029,8 +1029,8 @@ void DihedralTableCut::write_restart_settings(FILE *fp) void DihedralTableCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1041,10 +1041,10 @@ void DihedralTableCut::read_restart_settings(FILE *fp) void DihedralTableCut::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1079,7 +1079,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { string err_msg = string("Cannot open file ") + string(file); error->one(FLERR,err_msg); } @@ -1087,7 +1087,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) { + if (fgets(line,MAXLINE,fp) == nullptr) { string err_msg=string("Did not find keyword \"") +string(keyword)+string("\" in dihedral table file."); error->one(FLERR, err_msg); @@ -1121,7 +1121,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // Skip blank lines and delete text following a '#' character char *pe = strchr(line, '#'); - if (pe != NULL) *pe = '\0'; //terminate string at '#' character + if (pe != nullptr) *pe = '\0'; //terminate string at '#' character char *pc = line; while ((*pc != '\0') && isspace(*pc)) pc++; @@ -1344,7 +1344,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"NOF") == 0) { @@ -1357,20 +1357,20 @@ void DihedralTableCut::param_extract(Table *tb, char *line) tb->use_degrees = false; } else if (strcmp(word,"CHECKU") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkU_fname); memory->create(checkU_fname,strlen(word)+1,"dihedral_table:checkU"); strcpy(checkU_fname, word); } else if (strcmp(word,"CHECKF") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkF_fname); memory->create(checkF_fname,strlen(word)+1,"dihedral_table:checkF"); strcpy(checkF_fname, word); } // COMMENTING OUT: equilibrium angles are not supported //else if (strcmp(word,"EQ") == 0) { - // word = strtok(NULL," \t\n\r\f"); + // word = strtok(nullptr," \t\n\r\f"); // tb->theta0 = atof(word); //} else { @@ -1378,7 +1378,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) err_msg += string(" (") + string(word) + string(")"); error->one(FLERR, err_msg); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index ed796280e..f1b64817b 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -51,7 +51,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index d92789f03..57eb9705b 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -118,13 +118,13 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): type = AUTO; startstep = 0; - fp = NULL; + fp = nullptr; overwrite = 0; numcorrelators=20; p = 16; m = 2; - char *title1 = NULL; - char *title2 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"type") == 0) { @@ -163,7 +163,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Illegal fix ave/correlate/long command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ave/correlate/long file %s",arg[iarg+1]); error->one(FLERR,str); diff --git a/src/USER-MISC/fix_electron_stopping.cpp b/src/USER-MISC/fix_electron_stopping.cpp index 952ffe758..52ab44b0c 100644 --- a/src/USER-MISC/fix_electron_stopping.cpp +++ b/src/USER-MISC/fix_electron_stopping.cpp @@ -242,7 +242,7 @@ void FixElectronStopping::read_table(const char *file) char line[MAXLINE]; FILE *fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str, 128, "Cannot open stopping range table %s", file); error->one(FLERR, str); @@ -252,21 +252,21 @@ void FixElectronStopping::read_table(const char *file) int l = 0; while (true) { - if (fgets(line, MAXLINE, fp) == NULL) break; // end of file + if (fgets(line, MAXLINE, fp) == nullptr) break; // end of file if (line[0] == '#') continue; // comment char *pch = strtok(line, " \t\n\r"); - if (pch == NULL) continue; // blank line + if (pch == nullptr) continue; // blank line if (l >= maxlines) grow_table(); int i = 0; - for ( ; i < ncol && pch != NULL; i++) { + for ( ; i < ncol && pch != nullptr; i++) { elstop_ranges[i][l] = utils::numeric(FLERR, pch,false,lmp); - pch = strtok(NULL, " \t\n\r"); + pch = strtok(nullptr, " \t\n\r"); } - if (i != ncol || pch != NULL) // too short or too long + if (i != ncol || pch != nullptr) // too short or too long error->one(FLERR, "fix electron/stopping: Invalid table line"); if (l >= 1 && elstop_ranges[0][l] <= elstop_ranges[0][l-1]) diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index fb111c1f2..c0f79869b 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -106,11 +106,11 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"ffl:sqrt_m"); // allocates space for temporaries - ffl_tmp1=ffl_tmp2=NULL; + ffl_tmp1=ffl_tmp2=nullptr; grow_arrays(atom->nmax); @@ -426,7 +426,7 @@ void *FixFFL::extract(const char *str, int &dim) { if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 86650cd50..6ed2632b4 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -149,22 +149,22 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : angle_distance = new double[atom->nangletypes+1]; //grow_arrays - array_atom = NULL; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + array_atom = nullptr; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); //calls grow_arrays - x_store = NULL; + x_store = nullptr; //STUFF - g = NULL; - help2 = NULL; + g = nullptr; + help2 = nullptr; - dn1dx = dn2dx = dn3dx = NULL; - n1 = n2 = n3 = del1 = del2 = del3 = NULL; + dn1dx = dn2dx = dn3dx = nullptr; + n1 = n2 = n3 = del1 = del2 = del3 = nullptr; memory->grow(help2,15,15,"FilterCorotate:help2"); memory->grow(n1,3,"FilterCorotate:n1"); @@ -188,11 +188,11 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : // initialize list of clusters to constrain maxlist = 0; - list = NULL; - clist_derv = NULL; - clist_q0 = NULL; //list for derivative and ref. config - clist_nselect1 = clist_nselect2 = NULL; - clist_select1 = clist_select2 = NULL; + list = nullptr; + clist_derv = nullptr; + clist_q0 = nullptr; //list for derivative and ref. config + clist_nselect1 = clist_nselect2 = nullptr; + clist_select1 = clist_select2 = nullptr; } @@ -284,7 +284,7 @@ void FixFilterCorotate::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for fix filter/corotate"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -1225,7 +1225,7 @@ void FixFilterCorotate::find_clusters() // cycle buffer around ring of procs back to self - comm->ring(size,sizeof(tagint),buf,3,ring_shake,NULL,(void *)this); + comm->ring(size,sizeof(tagint),buf,3,ring_shake,nullptr,(void *)this); memory->destroy(buf); diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index f4776c3d6..04be66521 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -218,11 +218,11 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : int seed = utils::inumeric(FLERR,arg[6],false,lmp); // LOADING A matrix - FILE *fgle = NULL; + FILE *fgle = nullptr; char *fname = arg[7]; if (comm->me == 0) { fgle = utils::open_potential(fname,lmp,nullptr); - if (fgle == NULL) { + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open A-matrix file %s",fname); error->one(FLERR,str); @@ -238,7 +238,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -258,9 +258,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { A[ndone] = atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } fnoneq=0; gle_every=1; gle_step=0; @@ -292,7 +292,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : } else { if (comm->me == 0) { fgle = utils::open_potential(fname,lmp,nullptr); - if (fgle == NULL) { + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open C-matrix file %s",fname); error->one(FLERR,str); @@ -310,7 +310,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -330,9 +330,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { C[ndone] = cfac*atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } } @@ -349,13 +349,13 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"gle:sqrt_m"); // allocates space for additional degrees of freedom - gle_s=NULL; + gle_s=nullptr; // allocates space for temporaries - gle_tmp1=gle_tmp2=NULL; + gle_tmp1=gle_tmp2=nullptr; grow_arrays(atom->nmax); init_gles(); @@ -720,7 +720,7 @@ void *FixGLE::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index b17c601f0..0a283522e 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -132,7 +132,7 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : pressflag = 0; int *p_flag = (int *)nh->extract("p_flag",ifix); - if ((p_flag == NULL) || (ifix != 1) || (p_flag[0] == 0) + if ((p_flag == nullptr) || (ifix != 1) || (p_flag[0] == 0) || (p_flag[1] == 0) || (p_flag[2] == 0)) { pressflag = 0; } else if ((p_flag[0] == 1) && (p_flag[1] == 1) @@ -203,7 +203,7 @@ void FixGrem::init() double *t_start = (double *)nh->extract("t_start",ifix); double *t_stop = (double *)nh->extract("t_stop",ifix); - if ((t_start != NULL) && (t_stop != NULL) && (ifix == 0)) { + if ((t_start != nullptr) && (t_stop != nullptr) && (ifix == 0)) { tbath = *t_start; if (*t_start != *t_stop) error->all(FLERR,"Thermostat temperature ramp not allowed"); @@ -215,7 +215,7 @@ void FixGrem::init() int *p_flag = (int *)nh->extract("p_flag",ifix); double *p_start = (double *) nh->extract("p_start",ifix); double *p_stop = (double *) nh->extract("p_stop",ifix); - if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL) + if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr) && (ifix == 1)) { ifix = 0; pressref = p_start[0]; @@ -291,5 +291,5 @@ void *FixGrem::extract(const char *str, int &dim) if (strcmp(str,"scale_grem") == 0) { return &scale_grem; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 7c3fac9c3..d772998b1 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -207,7 +207,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -229,7 +229,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -280,7 +280,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -288,7 +288,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -492,25 +492,25 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); /* initialize various imd state variables. */ - clientsock = NULL; - localsock = NULL; + clientsock = nullptr; + localsock = nullptr; nlevels_respa = 0; imd_inactive = 0; imd_terminate = 0; imd_forces = 0; - force_buf = NULL; + force_buf = nullptr; maxbuf = 0; - msgdata = NULL; + msgdata = nullptr; msglen = 0; - comm_buf = NULL; - idmap = NULL; - rev_idmap = NULL; + comm_buf = nullptr; + idmap = nullptr; + rev_idmap = nullptr; if (me == 0) { /* set up incoming socket on MPI rank 0. */ imdsock_init(); localsock = imdsock_create(); - clientsock = NULL; + clientsock = nullptr; if (imdsock_bind(localsock,imd_port)) { perror("bind to socket failed"); imdsock_destroy(localsock); @@ -536,9 +536,9 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : /* set up mutex and condition variable for i/o thread */ /* hold mutex before creating i/o thread to keep it waiting. */ - pthread_mutex_init(&read_mutex, NULL); - pthread_mutex_init(&write_mutex, NULL); - pthread_cond_init(&write_cond, NULL); + pthread_mutex_init(&read_mutex, nullptr); + pthread_mutex_init(&write_mutex, nullptr); + pthread_cond_init(&write_cond, nullptr); pthread_mutex_lock(&write_mutex); buf_has_data=0; @@ -564,7 +564,7 @@ FixIMD::~FixIMD() buf_has_data=-1; pthread_cond_signal(&write_cond); pthread_mutex_unlock(&write_mutex); - pthread_join(iothread, NULL); + pthread_join(iothread, nullptr); /* cleanup */ pthread_attr_destroy(&iot_attr); @@ -584,8 +584,8 @@ FixIMD::~FixIMD() imdsock_destroy(clientsock); imdsock_shutdown(localsock); imdsock_destroy(localsock); - clientsock=NULL; - localsock=NULL; + clientsock=nullptr; + localsock=nullptr; return; } @@ -627,7 +627,7 @@ int FixIMD::reconnect() } } connect_msg = 0; - clientsock = NULL; + clientsock = nullptr; if (nowait_flag) { int retval = imdsock_selread(localsock,0); if (retval > 0) { @@ -774,7 +774,7 @@ void *fix_imd_ioworker(void *t) { FixIMD *imd=(FixIMD *)t; imd->ioworker(); - return NULL; + return nullptr; } /* the real i/o worker thread */ @@ -787,7 +787,7 @@ void FixIMD::ioworker() fprintf(screen,"Asynchronous I/O thread is exiting.\n"); buf_has_data=0; pthread_mutex_unlock(&write_mutex); - pthread_exit(NULL); + pthread_exit(nullptr); } else if (buf_has_data > 0) { /* send coordinate data, if client is able to accept */ if (clientsock && imdsock_selwrite(clientsock,0)) { @@ -855,9 +855,9 @@ void FixIMD::post_force(int /*vflag*/) imd_paused = 0; imd_forces = 0; memory->destroy(force_buf); - force_buf = NULL; + force_buf = nullptr; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; if (screen) fprintf(screen, "IMD client detached. LAMMPS run continues.\n"); @@ -875,7 +875,7 @@ void FixIMD::post_force(int /*vflag*/) imd_terminate = 1; imd_paused = 0; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; break; case IMD_PAUSE: @@ -958,7 +958,7 @@ void FixIMD::post_force(int /*vflag*/) /* check if we need to readjust the forces comm buffer on the receiving nodes. */ if (me != 0) { if (old_imd_forces < imd_forces) { /* grow holding space for forces, if needed. */ - if (force_buf != NULL) + if (force_buf != nullptr) memory->sfree(force_buf); force_buf = memory->smalloc(imd_forces*size_one, "imd:force_buf"); } @@ -1200,14 +1200,14 @@ void * imdsock_create(void) { imdsocket * s; s = (imdsocket *) malloc(sizeof(imdsocket)); - if (s != NULL) + if (s != nullptr) memset(s, 0, sizeof(imdsocket)); - else return NULL; + else return nullptr; if ((s->sd = socket(PF_INET, SOCK_STREAM, 0)) == -1) { printf("Failed to open socket."); free(s); - return NULL; + return nullptr; } return (void *) s; @@ -1229,7 +1229,7 @@ int imdsock_listen(void * v) { void *imdsock_accept(void * v) { int rc; - imdsocket *new_s = NULL, *s = (imdsocket *) v; + imdsocket *new_s = nullptr, *s = (imdsocket *) v; #if defined(ARCH_AIX5) || defined(ARCH_AIX5_64) || defined(ARCH_AIX6_64) unsigned int len; #define _SOCKLEN_TYPE unsigned int @@ -1248,7 +1248,7 @@ void *imdsock_accept(void * v) { rc = accept(s->sd, (struct sockaddr *) &s->addr, ( _SOCKLEN_TYPE * ) &len); if (rc >= 0) { new_s = (imdsocket *) malloc(sizeof(imdsocket)); - if (new_s != NULL) { + if (new_s != nullptr) { *new_s = *s; new_s->sd = rc; } @@ -1277,7 +1277,7 @@ int imdsock_read(void * v, void *buf, int len) { void imdsock_shutdown(void *v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1289,7 +1289,7 @@ void imdsock_shutdown(void *v) { void imdsock_destroy(void * v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1306,14 +1306,14 @@ int imdsock_selread(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&rfd); FD_SET(s->sd, &rfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd+1, &rfd, NULL, NULL, &tv); + rc = select(s->sd+1, &rfd, nullptr, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; @@ -1325,14 +1325,14 @@ int imdsock_selwrite(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&wfd); FD_SET(s->sd, &wfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd + 1, NULL, &wfd, NULL, &tv); + rc = select(s->sd + 1, nullptr, &wfd, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; } diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index b8045a9ff..2ddc965bb 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -167,7 +167,7 @@ static void readbuffer(int sockfd, char *data, int len, Error* error) /* ---------------------------------------------------------------------- */ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), irregular(NULL) + Fix(lmp, narg, arg), irregular(nullptr) { /* format for fix: * fix num group_id ipi host port [unix] diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 9361d9ebd..a613ceb9b 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -53,10 +53,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL), id_store(NULL),init_store(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr), id_store(nullptr),init_store(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix npt/cauchy command"); @@ -583,10 +583,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -794,7 +794,7 @@ void FixNPTCauchy::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -821,7 +821,7 @@ void FixNPTCauchy::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1812,7 +1812,7 @@ void *FixNPTCauchy::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 5f1582d58..2d8d16e40 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -61,7 +61,7 @@ struct FixOrientECO::Nbr { FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - dir_filename(NULL), order(NULL), nbr(NULL), list(NULL) + dir_filename(nullptr), order(nullptr), nbr(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_eco); @@ -96,7 +96,7 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : int count; FILE *infile = utils::open_potential(dir_filename,lmp,nullptr); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open fix orient/eco file {}: {}", dir_filename, utils::getsyserror())); for (int i = 0; i < 6; ++i) { diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp index 1ac0ffb18..4b107c648 100644 --- a/src/USER-MISC/fix_pafi.cpp +++ b/src/USER-MISC/fix_pafi.cpp @@ -58,8 +58,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixPAFI::FixPAFI(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), computename(NULL), random(NULL), - h(NULL), step_respa(NULL) + Fix(lmp, narg, arg), computename(nullptr), random(nullptr), + h(nullptr), step_respa(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_pafi_package); diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 5be9bf162..998dcdadf 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -87,27 +87,27 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) /* Initiation */ max_nsend = 0; - tag_send = NULL; - buf_send = NULL; + tag_send = nullptr; + buf_send = nullptr; max_nlocal = 0; - buf_recv = NULL; - buf_beads = NULL; + buf_recv = nullptr; + buf_beads = nullptr; size_plan = 0; - plan_send = plan_recv = NULL; + plan_send = plan_recv = nullptr; - M_x2xp = M_xp2x = M_f2fp = M_fp2f = NULL; - lam = NULL; - mode_index = NULL; + M_x2xp = M_xp2x = M_f2fp = M_fp2f = nullptr; + lam = nullptr; + mode_index = nullptr; - mass = NULL; + mass = nullptr; - array_atom = NULL; - nhc_eta = NULL; - nhc_eta_dot = NULL; - nhc_eta_dotdot = NULL; - nhc_eta_mass = NULL; + array_atom = nullptr; + nhc_eta = nullptr; + nhc_eta_dot = nullptr; + nhc_eta_dotdot = nullptr; + nhc_eta_mass = nullptr; size_peratom_cols = 12 * nhc_nchain + 3; @@ -601,7 +601,7 @@ void FixPIMD::comm_init() } buf_beads = new double* [np]; - for(int i=0; iall(FLERR, "Illegal fix propel/self command"); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 97bf1fb07..ad96ec712 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -55,7 +55,7 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // initial allocation of atom-based array // register with Atom class - array = NULL; + array = nullptr; grow_arrays(atom->nmax); // extends pack_exchange() @@ -100,7 +100,7 @@ int FixSRP::setmask() void FixSRP::init() { - if (force->pair_match("hybrid",1) == NULL && force->pair_match("hybrid/overlay",1) == NULL) + if (force->pair_match("hybrid",1) == nullptr && force->pair_match("hybrid/overlay",1) == nullptr) error->all(FLERR,"Cannot use pair srp without pair_style hybrid"); int has_rigid = 0; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index bc10b5284..f2638f8a9 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -74,7 +74,7 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : // Perform initial allocation of atom-based array // Register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index c12019528..728a50999 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -67,11 +67,11 @@ static const char cite_fix_ttm_mod[] = FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_ttm_mod); @@ -103,7 +103,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : if (narg != 11) error->all(FLERR,"Illegal fix ttm/mod command"); if (comm->me == 0) { fp = fopen(arg[10],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ttm/mod file %s",arg[10]); error->one(FLERR,str); @@ -151,7 +151,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : "ttm/mod:net_energy_transfer"); memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "ttm/mod:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -560,7 +560,7 @@ void FixTTMMod::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 9a8454b01..6c3a58bc3 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -38,7 +38,7 @@ enum{NONE,DIFFUSIVE,MAXWELL,CCL}; FixWallReflectStochastic:: FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : - FixWallReflect(lmp, narg, arg), random(NULL) + FixWallReflect(lmp, narg, arg), random(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/reflect/stochastic command"); diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp index 571493121..9f6e7f114 100644 --- a/src/USER-MISC/improper_cossq.cpp +++ b/src/USER-MISC/improper_cossq.cpp @@ -302,8 +302,8 @@ void ImproperCossq::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_distance.cpp b/src/USER-MISC/improper_distance.cpp index 476cf8ab4..cbdb5130e 100644 --- a/src/USER-MISC/improper_distance.cpp +++ b/src/USER-MISC/improper_distance.cpp @@ -248,8 +248,8 @@ void ImproperDistance::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp index 85f7809a0..8f54c8b7a 100644 --- a/src/USER-MISC/improper_fourier.cpp +++ b/src/USER-MISC/improper_fourier.cpp @@ -326,11 +326,11 @@ void ImproperFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp index c85e4850c..b2a71b10a 100644 --- a/src/USER-MISC/improper_ring.cpp +++ b/src/USER-MISC/improper_ring.cpp @@ -326,8 +326,8 @@ void ImproperRing::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index 41f9bc953..afd600594 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -85,11 +85,11 @@ PairAGNI::PairAGNI(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nelements = 0; - elements = NULL; - elem2param = NULL; + elements = nullptr; + elem2param = nullptr; nparams = 0; - params = NULL; - map = NULL; + params = nullptr; + map = nullptr; cutmax = 0.0; } @@ -114,7 +114,7 @@ PairAGNI::~PairAGNI() delete [] params[i].yU; } memory->destroy(params); - params = NULL; + params = nullptr; } if (allocated) { @@ -266,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -275,7 +275,7 @@ void PairAGNI::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -348,7 +348,7 @@ double PairAGNI::init_one(int i, int j) void PairAGNI::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = 0; // open file on proc 0 only @@ -357,7 +357,7 @@ void PairAGNI::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open AGNI potential file %s",file); error->one(FLERR,str); @@ -373,7 +373,7 @@ void PairAGNI::read_file(char *file) n = 0; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -396,7 +396,7 @@ void PairAGNI::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; --nwords; if ((nwords == 2) && (strcmp(words[0],"generation") == 0)) { diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 9ef96f118..8c1114c4d 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -304,15 +304,15 @@ void PairBuckMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -343,11 +343,11 @@ void PairBuckMDF::write_restart_settings(FILE *fp) void PairBuckMDF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); @@ -396,5 +396,5 @@ void *PairBuckMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index 1203cea5f..84383c102 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -271,14 +271,14 @@ void PairCosineSquared::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { if (me == 0) - utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,nullptr,error); MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,nullptr,error); } MPI_Bcast(&epsilon[i][j], 1, MPI_DOUBLE, 0, world); MPI_Bcast(&sigma[i][j], 1, MPI_DOUBLE, 0, world); @@ -306,7 +306,7 @@ void PairCosineSquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,NULL,error); + utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,nullptr,error); } MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world); } diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index 5a3e12f1a..35995717b 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -281,13 +281,13 @@ void PairCoulDiel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&rme[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairCoulDiel::write_restart_settings(FILE *fp) void PairCoulDiel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_shield.cpp b/src/USER-MISC/pair_coul_shield.cpp index 44ab555b0..54e3dbddb 100644 --- a/src/USER-MISC/pair_coul_shield.cpp +++ b/src/USER-MISC/pair_coul_shield.cpp @@ -297,12 +297,12 @@ void PairCoulShield::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -328,9 +328,9 @@ void PairCoulShield::write_restart_settings(FILE *fp) void PairCoulShield::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index 0c94254f4..0f5ee9bd1 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -44,7 +44,7 @@ using namespace LAMMPS_NS; PairCoulSlaterLong::PairCoulSlaterLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - //ftable = NULL; + //ftable = nullptr; qdist = 0.0; } @@ -250,13 +250,13 @@ void PairCoulSlaterLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - // if (ncoultablebits) init_tables(cut_coul,NULL); + // if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -415,5 +415,5 @@ void *PairCoulSlaterLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 7b56caa20..449cf8669 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -49,11 +49,11 @@ PairDRIP::PairDRIP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; manybody_flag = 1; - params = NULL; - nearest3neigh = NULL; - elements = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + nearest3neigh = nullptr; + elements = nullptr; + elem2param = nullptr; + map = nullptr; nelements = 0; cutmax = 0.0; } @@ -68,10 +68,10 @@ PairDRIP::~PairDRIP() delete [] map; } - if (elements != NULL) { + if (elements != nullptr) { for (int i = 0; i < nelements; i++) delete [] elements[i]; delete [] elements; - elements = NULL; + elements = nullptr; } memory->destroy(params); memory->destroy(elem2param); @@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -148,7 +148,7 @@ void PairDRIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -224,7 +224,7 @@ void PairDRIP::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open DRIP potential file %s",filename); error->one(FLERR,str); @@ -241,7 +241,7 @@ void PairDRIP::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -263,7 +263,7 @@ void PairDRIP::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -283,7 +283,7 @@ void PairDRIP::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index a7ed0fcaa..96aeea66f 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -50,12 +50,12 @@ PairE3B::PairE3B(LAMMPS *lmp) : Pair(lmp),pairPerAtom(10) pvector = new double[nextra]; allocatedE3B = false; - pairO = NULL; - pairH = NULL; - exps = NULL; - del3 = NULL; - fpair3 = NULL; - sumExp = NULL; + pairO = nullptr; + pairH = nullptr; + exps = nullptr; + del3 = nullptr; + fpair3 = nullptr; + sumExp = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 6ccaded35..31dda8bb0 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -52,12 +52,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairEDIP::PairEDIP(LAMMPS *lmp) : - Pair(lmp), preInvR_ij(NULL), preExp3B_ij(NULL), preExp3BDerived_ij(NULL), - preExp2B_ij(NULL), preExp2BDerived_ij(NULL), prePow2B_ij(NULL), - preForceCoord(NULL), cutoffFunction(NULL), cutoffFunctionDerived(NULL), - pow2B(NULL), exp2B(NULL), exp3B(NULL), qFunctionGrid(NULL), - expMinusBetaZeta_iZeta_iGrid(NULL), tauFunctionGrid(NULL), - tauFunctionDerivedGrid(NULL) + Pair(lmp), preInvR_ij(nullptr), preExp3B_ij(nullptr), preExp3BDerived_ij(nullptr), + preExp2B_ij(nullptr), preExp2BDerived_ij(nullptr), prePow2B_ij(nullptr), + preForceCoord(nullptr), cutoffFunction(nullptr), cutoffFunctionDerived(nullptr), + pow2B(nullptr), exp2B(nullptr), exp3B(nullptr), qFunctionGrid(nullptr), + expMinusBetaZeta_iZeta_iGrid(nullptr), tauFunctionGrid(nullptr), + tauFunctionDerivedGrid(nullptr) { single_enable = 0; restartinfo = 0; @@ -65,10 +65,10 @@ PairEDIP::PairEDIP(LAMMPS *lmp) : manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -788,7 +788,7 @@ void PairEDIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -876,7 +876,7 @@ void PairEDIP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -884,7 +884,7 @@ void PairEDIP::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -902,7 +902,7 @@ void PairEDIP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -924,7 +924,7 @@ void PairEDIP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -944,7 +944,7 @@ void PairEDIP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 4a81a41a2..1a5d4925d 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -70,10 +70,10 @@ PairEDIPMulti::PairEDIPMulti(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -548,7 +548,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -633,7 +633,7 @@ void PairEDIPMulti::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -641,7 +641,7 @@ void PairEDIPMulti::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -659,7 +659,7 @@ void PairEDIPMulti::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -681,7 +681,7 @@ void PairEDIPMulti::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -701,7 +701,7 @@ void PairEDIPMulti::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index 0db7f8739..6d9f74de8 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -52,20 +52,20 @@ PairExTeP::PairExTeP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - map = NULL; + map = nullptr; - Nt = NULL; - Nd = NULL; + Nt = nullptr; + Nd = nullptr; } /* ---------------------------------------------------------------------- @@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -476,7 +476,7 @@ void PairExTeP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -544,7 +544,7 @@ void PairExTeP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -582,7 +582,7 @@ void PairExTeP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -590,7 +590,7 @@ void PairExTeP::read_file(char *file) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ExTeP potential file %s",file); error->one(FLERR,str); @@ -607,7 +607,7 @@ void PairExTeP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -629,7 +629,7 @@ void PairExTeP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -649,7 +649,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line @@ -737,7 +737,7 @@ void PairExTeP::read_file(char *file) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); //fputs(line,stdout); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -758,7 +758,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); while ((nwords < params_per_line) - && (words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + && (words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // skip line if it is a leftover from the previous section, // which can be identified by having 3 elements (instead of 2) diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index c9601c416..d7d7f6864 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -301,14 +301,14 @@ void PairGaussCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&hgauss[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rmh[i][j],1,MPI_DOUBLE,0,world); @@ -337,9 +337,9 @@ void PairGaussCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index 671dcb309..f0c197ca3 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -54,23 +54,23 @@ PairILPGrapheneHBN::PairILPGrapheneHBN(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutILPsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutILPsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - ILP_numneigh = NULL; - ILP_firstneigh = NULL; - ipage = NULL; + ILP_numneigh = nullptr; + ILP_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -176,7 +176,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -249,7 +249,7 @@ void PairILPGrapheneHBN::read_file(char *filename) int params_per_line = 13; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -257,7 +257,7 @@ void PairILPGrapheneHBN::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ILP potential file %s",filename); error->one(FLERR,str); @@ -274,7 +274,7 @@ void PairILPGrapheneHBN::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -296,7 +296,7 @@ void PairILPGrapheneHBN::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -316,7 +316,7 @@ void PairILPGrapheneHBN::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -414,7 +414,7 @@ void PairILPGrapheneHBN::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 9f986fa10..c30899083 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -54,23 +54,23 @@ PairKolmogorovCrespiFull::PairKolmogorovCrespiFull(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutKCsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutKCsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - KC_numneigh = NULL; - KC_firstneigh = NULL; - ipage = NULL; + KC_numneigh = nullptr; + KC_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -177,7 +177,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -250,7 +250,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -258,7 +258,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -275,7 +275,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -297,7 +297,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -317,7 +317,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -415,7 +415,7 @@ void PairKolmogorovCrespiFull::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 7ce6f8652..80f57fb5d 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -48,11 +48,11 @@ PairKolmogorovCrespiZ::PairKolmogorovCrespiZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -232,7 +232,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -241,7 +241,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -308,7 +308,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) int params_per_line = 11; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -316,7 +316,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -333,7 +333,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -355,7 +355,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -375,7 +375,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index b8f9e5c38..cb65dc85f 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -49,11 +49,11 @@ PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -228,7 +228,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -237,7 +237,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -304,7 +304,7 @@ void PairLebedevaZ::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -312,7 +312,7 @@ void PairLebedevaZ::read_file(char *filename) FILE *fp; if (comm->me == 0) { fp = utils::open_potential(filename,lmp,nullptr); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; sprintf(str,"Cannot open Lebedeva potential file %s",filename); error->one(FLERR,str); @@ -329,7 +329,7 @@ void PairLebedevaZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -351,7 +351,7 @@ void PairLebedevaZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -371,7 +371,7 @@ void PairLebedevaZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 31d32db50..23c12ea9d 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -304,14 +304,14 @@ void PairLennardMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&aparm[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&bparm[i][j],1,MPI_DOUBLE,0,world); @@ -340,9 +340,9 @@ void PairLennardMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -413,5 +413,5 @@ void *PairLennardMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) aparm; if (strcmp(str,"b") == 0) return (void *) bparm; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index a93e0a81a..f46c061e4 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; static const char * const stylename[] = { - "none", "harmonic", "morse", "lj126", NULL + "none", "harmonic", "morse", "lj126", nullptr }; // fast power function for integer exponent > 0 @@ -54,8 +54,8 @@ PairList::PairList(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; respa_enable = 0; cut_global = 0.0; - style = NULL; - params = NULL; + style = nullptr; + params = nullptr; check_flag = 1; } @@ -211,7 +211,7 @@ void PairList::settings(int narg, char **arg) FILE *fp = utils::open_potential(arg[0],lmp,nullptr); char line[1024]; - if (fp == NULL) + if (fp == nullptr) error->all(FLERR,"Cannot open pair list file"); // count lines in file for upper limit of storage needed @@ -238,13 +238,13 @@ void PairList::settings(int narg, char **arg) // get atom ids of pair id1 = ATOTAGINT(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); id2 = ATOTAGINT(ptr); // get potential type - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); @@ -257,13 +257,13 @@ void PairList::settings(int narg, char **arg) if (strcmp(ptr,stylename[HARM]) == 0) { style[npairs] = HARM; - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); par.parm.harm.k = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); par.parm.harm.r0 = utils::numeric(FLERR,ptr,false,lmp); @@ -273,17 +273,17 @@ void PairList::settings(int narg, char **arg) } else if (strcmp(ptr,stylename[MORSE]) == 0) { style[npairs] = MORSE; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.d0 = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.alpha = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); par.parm.morse.r0 = utils::numeric(FLERR,ptr,false,lmp); @@ -294,12 +294,12 @@ void PairList::settings(int narg, char **arg) // 12-6 lj potential style[npairs] = LJ126; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); par.parm.lj126.epsilon = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); par.parm.lj126.sigma = utils::numeric(FLERR,ptr,false,lmp); @@ -311,8 +311,8 @@ void PairList::settings(int narg, char **arg) } // optional cutoff parameter. if not specified use global value - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr != NULL) && (*ptr != '#')) { + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr != nullptr) && (*ptr != '#')) { double cut = utils::numeric(FLERR,ptr,false,lmp); par.cutsq = cut*cut; } else { diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 92e869e58..8951af77c 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -51,9 +51,9 @@ PairLJExpandCoulLong::PairLJExpandCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -710,11 +710,11 @@ void PairLJExpandCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -838,14 +838,14 @@ void PairLJExpandCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -877,13 +877,13 @@ void PairLJExpandCoulLong::write_restart_settings(FILE *fp) void PairLJExpandCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -997,5 +997,5 @@ void *PairLJExpandCoulLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index baa0e233f..07f58aced 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -311,14 +311,14 @@ void PairLJMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -345,7 +345,7 @@ void PairLJMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } @@ -414,5 +414,5 @@ void *PairLJMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index ab845e69d..42a2d4bb7 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -487,15 +487,15 @@ void PairLJSFDipoleSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,9 +524,9 @@ void PairLJSFDipoleSF::write_restart_settings(FILE *fp) void PairLJSFDipoleSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -638,5 +638,5 @@ void *PairLJSFDipoleSF::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index 404f6e2db..61346a7fd 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -62,28 +62,28 @@ PairLocalDensity::PairLocalDensity(LAMMPS *lmp) : Pair(lmp) // stuff read from tabulated file nLD = 0; nrho = 0; - rho_min = NULL; - rho_max = NULL; - a = NULL; - b = NULL; - c0 = NULL; - c2 = NULL; - c4 = NULL; - c6 = NULL; - uppercut = NULL; - lowercut = NULL; - uppercutsq = NULL; - lowercutsq = NULL; - frho = NULL; - rho = NULL; + rho_min = nullptr; + rho_max = nullptr; + a = nullptr; + b = nullptr; + c0 = nullptr; + c2 = nullptr; + c4 = nullptr; + c6 = nullptr; + uppercut = nullptr; + lowercut = nullptr; + uppercutsq = nullptr; + lowercutsq = nullptr; + frho = nullptr; + rho = nullptr; // splined arrays - frho_spline = NULL; + frho_spline = nullptr; // per-atom arrays nmax = 0; - fp = NULL; - localrho = NULL; + fp = nullptr; + localrho = nullptr; // set comm size needed by this pair comm_forward = 1; @@ -667,7 +667,7 @@ void PairLocalDensity::parse_file(char *filename) { if (me == 0) { fptr = fopen(filename, "r"); - if (fptr == NULL) { + if (fptr == nullptr) { char str[128]; sprintf(str,"Cannot open Local Density potential file %s",filename); error->one(FLERR,str); @@ -724,23 +724,23 @@ void PairLocalDensity::parse_file(char *filename) { for (k = 0; k < nLD; k++) { // parse upper and lower cut values - if (fgets(line,MAXLINE,fptr)==NULL) break; + if (fgets(line,MAXLINE,fptr)==nullptr) break; sscanf(line, "%lf %lf", &lowercut[k], &uppercut[k]); // parse and broadcast central atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); char *tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { a[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse neighbor atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { b[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse min, max and delta rho values diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index 4d9b3866b..455a21ada 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -56,24 +56,24 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp) one_coeff = 1; nelements = 0; - elements = NULL; - map = NULL; + elements = nullptr; + map = nullptr; - Uprime_values = NULL; + Uprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; - phis = NULL; - Us = NULL; - rhos = NULL; - fs = NULL; - gs = NULL; + phis = nullptr; + Us = nullptr; + rhos = nullptr; + fs = nullptr; + gs = nullptr; - zero_atom_energies = NULL; + zero_atom_energies = nullptr; } /* ---------------------------------------------------------------------- */ @@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -459,7 +459,7 @@ void PairMEAMSpline::read_file(const char* filename) if(comm->me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if(fp == NULL) { + if(fp == nullptr) { char str[1024]; snprintf(str,128,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -480,8 +480,8 @@ void PairMEAMSpline::read_file(const char* filename) if (strcmp(ptr, "meam/spline") == 0) { isNewFormat = true; // parse the rest of the line! - ptr = strtok(NULL," \t\n\r\f"); - if (ptr == NULL) + ptr = strtok(nullptr," \t\n\r\f"); + if (ptr == nullptr) error->one(FLERR,"Need to include number of atomic species on" " meam/spline line in multi-element potential file"); nelements = atoi(ptr); @@ -493,8 +493,8 @@ void PairMEAMSpline::read_file(const char* filename) delete [] elements; elements = new char*[nelements]; for (int i=0; ione(FLERR, "Not enough atomic species in meam/spline" " line of multi-element potential file"); elements[i] = new char[strlen(ptr)+1]; @@ -674,27 +674,27 @@ void PairMEAMSpline::SplineFunction::parse(FILE* fp, Error* error, // If new format, read the spline format. Should always be "spline3eq" for now. if (isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line in old format if (!isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h index 2e6e7e00f..31be826d0 100644 --- a/src/USER-MISC/pair_meam_spline.h +++ b/src/USER-MISC/pair_meam_spline.h @@ -74,7 +74,7 @@ protected: class SplineFunction { public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -205,7 +205,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 0a8aae233..0013fa557 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -49,13 +49,13 @@ PairMEAMSWSpline::PairMEAMSWSpline(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; - Uprime_values = NULL; - //ESWprime_values = NULL; + Uprime_values = nullptr; + //ESWprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; @@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -402,7 +402,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -461,7 +461,7 @@ void PairMEAMSWSpline::read_file(const char* filename) { if(comm->me == 0) { FILE *fp = utils::open_potential(filename,lmp,nullptr); - if(fp == NULL) { + if(fp == nullptr) { char str[1024]; snprintf(str,1024,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -601,23 +601,23 @@ void PairMEAMSWSpline::SplineFunction::parse(FILE* fp, Error* error) char line[MAXLINE]; // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_sw_spline.h b/src/USER-MISC/pair_meam_sw_spline.h index b4480050d..1fd59b34a 100644 --- a/src/USER-MISC/pair_meam_sw_spline.h +++ b/src/USER-MISC/pair_meam_sw_spline.h @@ -62,7 +62,7 @@ protected: public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -188,7 +188,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index d534284b5..997e33453 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -308,16 +308,16 @@ void PairMomb::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -349,11 +349,11 @@ void PairMomb::write_restart_settings(FILE *fp) void PairMomb::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&sscale,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 9f895800d..73e0bb3c6 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -269,14 +269,14 @@ void PairMorseSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -303,8 +303,8 @@ void PairMorseSmoothLinear::write_restart_settings(FILE *fp) void PairMorseSmoothLinear::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairMorseSmoothLinear::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 150895108..d26a0b28d 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -76,7 +76,7 @@ PairSRP::PairSRP(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_srp); nextra = 1; - segment = NULL; + segment = nullptr; // generate unique fix-id for this pair style instance @@ -704,12 +704,12 @@ void PairSRP::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -737,12 +737,12 @@ void PairSRP::write_restart_settings(FILE *fp) void PairSRP::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bptype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&btype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&min,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&exclude,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bptype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&btype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&min,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&exclude,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); } diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index 1f5cfddff..6e0cacaff 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -764,7 +764,7 @@ void PairTersoffTable::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index 8d7a4ee2c..c3c6d89fb 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -167,7 +167,7 @@ void TemperGrem::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index 69f4559ca..288be333f 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -148,7 +148,7 @@ void TemperNPT::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MOFFF/angle_class2_p6.cpp b/src/USER-MOFFF/angle_class2_p6.cpp index 7ef134405..490974657 100644 --- a/src/USER-MOFFF/angle_class2_p6.cpp +++ b/src/USER-MOFFF/angle_class2_p6.cpp @@ -386,21 +386,21 @@ void AngleClass2P6::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/angle_cosine_buck6d.cpp b/src/USER-MOFFF/angle_cosine_buck6d.cpp index 1bede5875..7d08467be 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.cpp +++ b/src/USER-MOFFF/angle_cosine_buck6d.cpp @@ -281,7 +281,7 @@ void AngleCosineBuck6d::init_style() { // set local ptrs to buck6d 13 arrays setup by Pair int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle cosine/buck6d is incompatible with Pair style"); cut_ljsq = (double **) force->pair->extract("cut_ljsq",itmp); buck6d1 = (double **) force->pair->extract("buck6d1",itmp); @@ -332,9 +332,9 @@ void AngleCosineBuck6d::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/improper_inversion_harmonic.cpp b/src/USER-MOFFF/improper_inversion_harmonic.cpp index bbe6e48a3..96faebc85 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.cpp +++ b/src/USER-MOFFF/improper_inversion_harmonic.cpp @@ -313,8 +313,8 @@ void ImproperInversionHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp index 0de5423d3..1e6a0417e 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp @@ -415,16 +415,16 @@ void PairBuck6dCoulGaussDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -457,12 +457,12 @@ void PairBuck6dCoulGaussDSF::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -584,5 +584,5 @@ void *PairBuck6dCoulGaussDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp index c6ba832ff..3286abe77 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp @@ -331,7 +331,7 @@ void PairBuck6dCoulGaussLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -447,16 +447,16 @@ void PairBuck6dCoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -490,13 +490,13 @@ void PairBuck6dCoulGaussLong::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&coul_smooth,1,MPI_DOUBLE,0,world); @@ -639,5 +639,5 @@ void *PairBuck6dCoulGaussLong::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index e0e92f933..a06d83a78 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -72,10 +72,10 @@ DumpMolfile::DumpMolfile(LAMMPS *lmp, int narg, char **arg) ntotal = 0; me = comm->me; - coords = vels = masses = charges = radiuses = NULL; - types = molids = NULL; + coords = vels = masses = charges = radiuses = nullptr; + types = molids = nullptr; ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; // allocate global array for atom coords @@ -132,7 +132,7 @@ DumpMolfile::~DumpMolfile() delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -146,7 +146,7 @@ void DumpMolfile::init_style() if (me == 0) { /* initialize typenames array to numeric types by default */ - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { /* a 32-bit int can be maximally 10 digits plus sign */ @@ -408,7 +408,7 @@ void DumpMolfile::write_data(int n, double *mybuf) need_structure = 0; } double simtime = update->ntimestep * update->dt; - mf->timestep(coords,NULL,cell,&simtime); + mf->timestep(coords,nullptr,cell,&simtime); } } } @@ -433,7 +433,7 @@ int DumpMolfile::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; diff --git a/src/USER-MOLFILE/molfile_interface.cpp b/src/USER-MOLFILE/molfile_interface.cpp index 90a5781ff..485be5172 100644 --- a/src/USER-MOLFILE/molfile_interface.cpp +++ b/src/USER-MOLFILE/molfile_interface.cpp @@ -175,7 +175,7 @@ extern "C" { int i, ind; char atom[3]; - if (label != NULL) { + if (label != nullptr) { /* zap string */ atom[0] = atom[1] = atom[2] = '\0'; @@ -217,8 +217,8 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) - return NULL; + if (dirname == nullptr) + return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -237,7 +237,7 @@ extern "C" { delete[] d->searchname; delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -248,13 +248,13 @@ extern "C" { if (FindNextFile(d->h, &(d->fd))) { return d->fd.cFileName; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->h != NULL) { + if (d->h != nullptr) { FindClose(d->h); } delete[] d->searchname; @@ -293,7 +293,7 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) return NULL; + if (dirname == nullptr) return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -303,10 +303,10 @@ extern "C" { d->dlen = len; d->d = opendir(d->name); - if (d->d == NULL) { + if (d->d == nullptr) { delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -316,17 +316,17 @@ extern "C" { { struct dirent *p; - if ((p = readdir(d->d)) != NULL) { + if ((p = readdir(d->d)) != nullptr) { return p->d_name; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->d != NULL) { + if (d->d != nullptr) { closedir(d->d); } delete[] d->name; @@ -374,7 +374,7 @@ MolfileInterface::~MolfileInterface() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } delete[] _name; delete[] _type; @@ -392,7 +392,7 @@ int MolfileInterface::find_plugin(const char *pluginpath) #else #define MY_PATHSEP ':' #endif - if (pluginpath == NULL) return E_DIR; + if (pluginpath == nullptr) return E_DIR; plugindir = path = strdup(pluginpath); while (plugindir) { @@ -413,11 +413,11 @@ int MolfileInterface::find_plugin(const char *pluginpath) int len; filename = my_readdir(dir); - if (filename == NULL) break; + if (filename == nullptr) break; // only look at .so files ext = strrchr(filename, '.'); - if (ext == NULL) continue; + if (ext == nullptr) continue; if (strcasecmp(ext,".so") != 0) continue; // construct full pathname of potential DSO @@ -450,14 +450,14 @@ int MolfileInterface::load_plugin(const char *filename) // access shared object dso = my_dlopen(filename); - if (dso == NULL) + if (dso == nullptr) return E_FILE; // check for required plugin symbols void *ifunc = my_dlsym(dso,"vmdplugin_init"); void *rfunc = my_dlsym(dso,"vmdplugin_register"); void *ffunc = my_dlsym(dso,"vmdplugin_fini"); - if (ifunc == NULL || rfunc == NULL || ffunc == NULL) { + if (ifunc == nullptr || rfunc == nullptr || ffunc == nullptr) { my_dlclose(dso); return E_SYMBOL; } @@ -472,7 +472,7 @@ int MolfileInterface::load_plugin(const char *filename) // the callback will be called for each plugin in the DSO and // check the file type. plugin->name will change if successful. plugin_reginfo_t reginfo; - reginfo.p = NULL; + reginfo.p = nullptr; reginfo.name=_type; ((regfunc)rfunc)(®info, plugin_register_cb); @@ -481,7 +481,7 @@ int MolfileInterface::load_plugin(const char *filename) // if the callback found a matching plugin and copied the struct, // its name element will point to a different location now. - if (plugin == NULL) { + if (plugin == nullptr) { retval = E_TYPE; // check if the ABI matches the one used to compile this code @@ -490,16 +490,16 @@ int MolfileInterface::load_plugin(const char *filename) // check if (basic) reading is supported } else if ((_mode & M_READ) && - ( (plugin->open_file_read == NULL) || - (plugin->read_next_timestep == NULL) || - (plugin->close_file_read == NULL) )) { + ( (plugin->open_file_read == nullptr) || + (plugin->read_next_timestep == nullptr) || + (plugin->close_file_read == nullptr) )) { retval = E_MODE; // check if (basic) writing is supported } else if ( (_mode & M_WRITE) && - ( (plugin->open_file_write == NULL) || - (plugin->write_timestep == NULL) || - (plugin->close_file_write == NULL) )) { + ( (plugin->open_file_write == nullptr) || + (plugin->write_timestep == nullptr) || + (plugin->close_file_write == nullptr) )) { retval = E_MODE; // make some additional check, if we @@ -579,7 +579,7 @@ void MolfileInterface::forget_plugin() close(); if (_plugin) - _plugin = NULL; + _plugin = nullptr; if (_dso) { void *ffunc = my_dlsym(_dso,"vmdplugin_fini"); @@ -587,7 +587,7 @@ void MolfileInterface::forget_plugin() ((finifunc)ffunc)(); my_dlclose(_dso); } - _dso = NULL; + _dso = nullptr; delete[] _name; _name = new char[5]; @@ -608,7 +608,7 @@ int MolfileInterface::open(const char *name, int *natoms) else if (_mode & M_READ) _ptr = p->open_file_read(name,_type,natoms); - if (_ptr == NULL) + if (_ptr == nullptr) return E_FILE; _natoms = *natoms; @@ -681,9 +681,9 @@ int MolfileInterface::close() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } - _ptr = NULL; + _ptr = nullptr; _natoms = 0; return E_NONE; @@ -704,7 +704,7 @@ int MolfileInterface::timestep(float *coords, float *vels, if (_mode & M_WRITE) { t->coords = coords; t->velocities = vels; - if (cell != NULL) { + if (cell != nullptr) { t->A = cell[0]; t->B = cell[1]; t->C = cell[2]; @@ -729,8 +729,8 @@ int MolfileInterface::timestep(float *coords, float *vels, } else { // no coordinate storage => skip step - if (coords == NULL) { - rv = p->read_next_timestep(_ptr, _natoms, NULL); + if (coords == nullptr) { + rv = p->read_next_timestep(_ptr, _natoms, nullptr); } else { t->coords = coords; t->velocities = vels; @@ -742,7 +742,7 @@ int MolfileInterface::timestep(float *coords, float *vels, t->gamma = 90.0f; t->physical_time = 0.0; rv = p->read_next_timestep(_ptr, _natoms, t); - if (cell != NULL) { + if (cell != nullptr) { cell[0] = t->A; cell[1] = t->B; cell[2] = t->C; @@ -823,7 +823,7 @@ static int read_int_property(molfile_atom_t &a, const int propid) static const char *read_string_property(molfile_atom_t &a, const int propid) { - const char *prop = NULL; + const char *prop = nullptr; int iprop = 0; PROPUPDATE(MolfileInterface::P_NAME,name,prop); PROPUPDATE(MolfileInterface::P_TYPE,type,prop); @@ -910,7 +910,7 @@ static int write_atom_property(molfile_atom_t &a, // set/get atom floating point property int MolfileInterface::property(int propid, int idx, float *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -927,7 +927,7 @@ int MolfileInterface::property(int propid, int idx, float *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, float *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -947,7 +947,7 @@ int MolfileInterface::property(int propid, int *types, float *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, float *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -968,7 +968,7 @@ int MolfileInterface::property(int propid, float *prop) // set/get atom floating point property int MolfileInterface::property(int propid, int idx, double *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -985,7 +985,7 @@ int MolfileInterface::property(int propid, int idx, double *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, double *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1005,7 +1005,7 @@ int MolfileInterface::property(int propid, int *types, double *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, double *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1040,7 +1040,7 @@ int MolfileInterface::property(int propid, double *prop) // set/get atom integer property int MolfileInterface::property(int propid, int idx, int *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1065,7 +1065,7 @@ int MolfileInterface::property(int propid, int idx, int *prop) // set/get per type integer property int MolfileInterface::property(int propid, int *types, int *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1094,7 +1094,7 @@ int MolfileInterface::property(int propid, int *types, int *prop) // set/get per atom integer property int MolfileInterface::property(int propid, int *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1125,7 +1125,7 @@ int MolfileInterface::property(int propid, int *prop) // set/get atom string property int MolfileInterface::property(int propid, int idx, char *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1143,7 +1143,7 @@ int MolfileInterface::property(int propid, int idx, char *prop) // set/get per type string property int MolfileInterface::property(int propid, int *types, char **prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1164,7 +1164,7 @@ int MolfileInterface::property(int propid, int *types, char **prop) // set/get per atom string property int MolfileInterface::property(int propid, char **prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); diff --git a/src/USER-MOLFILE/reader_molfile.cpp b/src/USER-MOLFILE/reader_molfile.cpp index d26a4d4ba..c99131811 100644 --- a/src/USER-MOLFILE/reader_molfile.cpp +++ b/src/USER-MOLFILE/reader_molfile.cpp @@ -42,11 +42,11 @@ static bool is_smalldiff(const float &val1, const float &val2) ReaderMolfile::ReaderMolfile(LAMMPS *lmp) : Reader(lmp) { - mf = NULL; - coords = NULL; - vels = NULL; - types = NULL; - fieldindex = NULL; + mf = nullptr; + coords = nullptr; + vels = nullptr; + types = nullptr; + fieldindex = nullptr; nstep = 0; needvels = 0; me = comm->me; @@ -156,7 +156,7 @@ int ReaderMolfile::read_time(bigint &ntimestep) int rv; // try to read in the time step (coordinates, velocities and cell only) - rv = mf->timestep(coords, vels, cell, NULL); + rv = mf->timestep(coords, vels, cell, nullptr); if (rv != 0) return 1; // we fake time step numbers. @@ -187,7 +187,7 @@ void ReaderMolfile::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index f936de6d0..c48688df4 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -193,13 +193,13 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 19b063292..4288bf6ba 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -190,13 +190,13 @@ DumpNetCDFMPIIO::DumpNetCDFMPIIO(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } @@ -767,7 +767,7 @@ void DumpNetCDFMPIIO::write() // pack my data into buf - pack(NULL); + pack(nullptr); // each process writes its data diff --git a/src/USER-OMP/bond_class2_omp.cpp b/src/USER-OMP/bond_class2_omp.cpp index 9c52bdb28..866538dac 100644 --- a/src/USER-OMP/bond_class2_omp.cpp +++ b/src/USER-OMP/bond_class2_omp.cpp @@ -56,7 +56,7 @@ void BondClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_expand_omp.cpp b/src/USER-OMP/bond_fene_expand_omp.cpp index 38df4f50d..b881ae3b1 100644 --- a/src/USER-OMP/bond_fene_expand_omp.cpp +++ b/src/USER-OMP/bond_fene_expand_omp.cpp @@ -57,7 +57,7 @@ void BondFENEExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_omp.cpp b/src/USER-OMP/bond_fene_omp.cpp index 5dde355a7..54a6cd5b3 100644 --- a/src/USER-OMP/bond_fene_omp.cpp +++ b/src/USER-OMP/bond_fene_omp.cpp @@ -57,7 +57,7 @@ void BondFENEOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_gromos_omp.cpp b/src/USER-OMP/bond_gromos_omp.cpp index 012737f77..2469329a5 100644 --- a/src/USER-OMP/bond_gromos_omp.cpp +++ b/src/USER-OMP/bond_gromos_omp.cpp @@ -53,7 +53,7 @@ void BondGromosOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_omp.cpp b/src/USER-OMP/bond_harmonic_omp.cpp index e8f17d5ea..e9b2d5b10 100644 --- a/src/USER-OMP/bond_harmonic_omp.cpp +++ b/src/USER-OMP/bond_harmonic_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp index 61a60fa99..3d81098d4 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicShiftCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_omp.cpp b/src/USER-OMP/bond_harmonic_shift_omp.cpp index 50b4ed98a..ff85a9f00 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_omp.cpp @@ -55,7 +55,7 @@ void BondHarmonicShiftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_morse_omp.cpp b/src/USER-OMP/bond_morse_omp.cpp index 51586370f..352a7e1e4 100644 --- a/src/USER-OMP/bond_morse_omp.cpp +++ b/src/USER-OMP/bond_morse_omp.cpp @@ -55,7 +55,7 @@ void BondMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_nonlinear_omp.cpp b/src/USER-OMP/bond_nonlinear_omp.cpp index 720d660ea..f7330d1f3 100644 --- a/src/USER-OMP/bond_nonlinear_omp.cpp +++ b/src/USER-OMP/bond_nonlinear_omp.cpp @@ -55,7 +55,7 @@ void BondNonlinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_quartic_omp.cpp b/src/USER-OMP/bond_quartic_omp.cpp index bc1ae96ac..c48c8ae65 100644 --- a/src/USER-OMP/bond_quartic_omp.cpp +++ b/src/USER-OMP/bond_quartic_omp.cpp @@ -61,7 +61,7 @@ void BondQuarticOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_table_omp.cpp b/src/USER-OMP/bond_table_omp.cpp index 3ccc65441..34f678a22 100644 --- a/src/USER-OMP/bond_table_omp.cpp +++ b/src/USER-OMP/bond_table_omp.cpp @@ -55,7 +55,7 @@ void BondTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/ewald_omp.cpp b/src/USER-OMP/ewald_omp.cpp index d5480d2a9..5f27c04e6 100644 --- a/src/USER-OMP/ewald_omp.cpp +++ b/src/USER-OMP/ewald_omp.cpp @@ -120,7 +120,7 @@ void EwaldOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, nlocal, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, 0, NULL, NULL, NULL, thr); + ev_setup_thr(eflag, vflag, 0, nullptr, nullptr, nullptr, thr); for (i = ifrom; i < ito; i++) { ek[i][0] = 0.0; diff --git a/src/USER-OMP/fix_neigh_history_omp.cpp b/src/USER-OMP/fix_neigh_history_omp.cpp index 7acded0ab..02da93ab7 100644 --- a/src/USER-OMP/fix_neigh_history_omp.cpp +++ b/src/USER-OMP/fix_neigh_history_omp.cpp @@ -138,7 +138,7 @@ void FixNeighHistoryOMP::pre_exchange_onesided() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -276,7 +276,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -289,7 +289,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -444,7 +444,7 @@ void FixNeighHistoryOMP::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index f3c86a774..7c3591322 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -61,7 +61,7 @@ static int get_tid() FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - thr(NULL), last_omp_style(NULL), last_pair_hybrid(NULL), + thr(nullptr), last_omp_style(nullptr), last_pair_hybrid(nullptr), _nthr(-1), _neighbor(true), _mixed(false), _reduced(true), _pair_compute_flag(false), _kspace_compute_flag(false) { @@ -203,8 +203,8 @@ void FixOMP::init() thr[i]->_timer_active=-1; } - if ((strstr(update->integrate_style,"respa") != NULL) - && (strstr(update->integrate_style,"respa/omp") == NULL)) + if ((strstr(update->integrate_style,"respa") != nullptr) + && (strstr(update->integrate_style,"respa/omp") == nullptr)) error->all(FLERR,"Need to use respa/omp for r-RESPA with /omp styles"); if (force->pair && force->pair->compute_flag) _pair_compute_flag = true; @@ -213,18 +213,18 @@ void FixOMP::init() else _kspace_compute_flag = false; int check_hybrid, kspace_split; - last_pair_hybrid = NULL; - last_omp_style = NULL; - const char *last_omp_name = NULL; - const char *last_hybrid_name = NULL; - const char *last_force_name = NULL; + last_pair_hybrid = nullptr; + last_omp_style = nullptr; + const char *last_omp_name = nullptr; + const char *last_hybrid_name = nullptr; + const char *last_force_name = nullptr; // support for verlet/split operation. // kspace_split == 0 : regular processing // kspace_split < 0 : master partition, does not do kspace // kspace_split > 0 : slave partition, only does kspace - if (strstr(update->integrate_style,"verlet/split") != NULL) { + if (strstr(update->integrate_style,"verlet/split") != nullptr) { if (universe->iworld == 0) kspace_split = -1; else kspace_split = 1; } else { diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index 5b2ee8842..f88dada70 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -48,13 +48,13 @@ void FixQEQCombOMP::init() if (!atom->q_flag) error->all(FLERR,"Fix qeq/comb/omp requires atom attribute q"); - if (NULL != force->pair_match("comb3",0)) + if (nullptr != force->pair_match("comb3",0)) error->all(FLERR,"No support for comb3 currently available in USER-OMP"); comb = (PairComb *) force->pair_match("comb/omp",1); - if (comb == NULL) + if (comb == nullptr) comb = (PairComb *) force->pair_match("comb",1); - if (comb == NULL) + if (comb == nullptr) error->all(FLERR,"Must use pair_style comb or " "comb/omp with fix qeq/comb/omp"); diff --git a/src/USER-OMP/fix_qeq_reax_omp.cpp b/src/USER-OMP/fix_qeq_reax_omp.cpp index 92c1b73e1..9a4e90084 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.cpp +++ b/src/USER-OMP/fix_qeq_reax_omp.cpp @@ -63,7 +63,7 @@ using namespace FixConst; FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : FixQEqReax(lmp, narg, arg) { - b_temp = NULL; + b_temp = nullptr; // ASPC: Kolafa, J. Comp. Chem., 25(3), 335 (2003) do_aspc = 0; @@ -71,7 +71,7 @@ FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : // Must be consistent with nprev to store history: nprev = aspc_order + 2 aspc_order_max = nprev - 2; aspc_omega = 0.0; - aspc_b = NULL; + aspc_b = nullptr; } FixQEqReaxOMP::~FixQEqReaxOMP() diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index c42aa8e0c..81aa380ce 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -46,7 +46,7 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ MSMCGOMP::MSMCGOMP(LAMMPS *lmp) : MSMOMP(lmp), - is_charged(NULL) + is_charged(nullptr) { triclinic_support = 0; diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index 97d94e551..1197e9ebb 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -71,7 +71,7 @@ void PairADPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_adp(nall, rho, mu, lambda); diff --git a/src/USER-OMP/pair_agni_omp.cpp b/src/USER-OMP/pair_agni_omp.cpp index de6903aab..401f4a668 100644 --- a/src/USER-OMP/pair_agni_omp.cpp +++ b/src/USER-OMP/pair_agni_omp.cpp @@ -56,7 +56,7 @@ void PairAGNIOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) eval<1>(ifrom, ito, thr); else eval<0>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_airebo_omp.cpp b/src/USER-OMP/pair_airebo_omp.cpp index 837734d6e..d2c3ef6a0 100644 --- a/src/USER-OMP/pair_airebo_omp.cpp +++ b/src/USER-OMP/pair_airebo_omp.cpp @@ -67,7 +67,7 @@ void PairAIREBOOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); FREBO_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv0,thr); if (ljflag) FLJ_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv1,thr); diff --git a/src/USER-OMP/pair_beck_omp.cpp b/src/USER-OMP/pair_beck_omp.cpp index 01e33dc5c..617c237dd 100644 --- a/src/USER-OMP/pair_beck_omp.cpp +++ b/src/USER-OMP/pair_beck_omp.cpp @@ -54,7 +54,7 @@ void PairBeckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_long_omp.cpp b/src/USER-OMP/pair_born_coul_long_omp.cpp index b410c998e..be88df3e7 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.cpp +++ b/src/USER-OMP/pair_born_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairBornCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_msm_omp.cpp b/src/USER-OMP/pair_born_coul_msm_omp.cpp index 4adba396e..b161250df 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_born_coul_msm_omp.cpp @@ -59,7 +59,7 @@ void PairBornCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.cpp b/src/USER-OMP/pair_born_coul_wolf_omp.cpp index 9bc6507c6..a426bc93d 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_born_coul_wolf_omp.cpp @@ -54,7 +54,7 @@ void PairBornCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_omp.cpp b/src/USER-OMP/pair_born_omp.cpp index e74f0139c..237685b9d 100644 --- a/src/USER-OMP/pair_born_omp.cpp +++ b/src/USER-OMP/pair_born_omp.cpp @@ -52,7 +52,7 @@ void PairBornOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index b7b82c3da..afd41668a 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -48,7 +48,7 @@ PairBrownianOMP::PairBrownianOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -61,7 +61,7 @@ PairBrownianOMP::~PairBrownianOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -127,7 +127,7 @@ void PairBrownianOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial Brownian style // we use is random number generator instance for thread 0 @@ -143,11 +143,11 @@ void PairBrownianOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index 4d8b45728..6abd276bf 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -48,7 +48,7 @@ PairBrownianPolyOMP::PairBrownianPolyOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -61,7 +61,7 @@ PairBrownianPolyOMP::~PairBrownianPolyOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -128,7 +128,7 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial BrownianPoly style // we use is random number generator instance for thread 0 @@ -144,11 +144,11 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.cpp b/src/USER-OMP/pair_buck_coul_cut_omp.cpp index 1c433f808..20a4953ef 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairBuckCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_long_omp.cpp b/src/USER-OMP/pair_buck_coul_long_omp.cpp index 264073a07..f0e7edf71 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairBuckCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.cpp b/src/USER-OMP/pair_buck_coul_msm_omp.cpp index 631a1ee61..dd112ba99 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_msm_omp.cpp @@ -59,7 +59,7 @@ void PairBuckCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp index 00ab1c248..2b5570097 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp @@ -41,7 +41,7 @@ PairBuckLongCoulLongOMP::PairBuckLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ void PairBuckLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -330,7 +330,7 @@ void PairBuckLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -355,7 +355,7 @@ void PairBuckLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -385,7 +385,7 @@ void PairBuckLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_buck_omp.cpp b/src/USER-OMP/pair_buck_omp.cpp index bddacaf5b..ab037a204 100644 --- a/src/USER-OMP/pair_buck_omp.cpp +++ b/src/USER-OMP/pair_buck_omp.cpp @@ -52,7 +52,7 @@ void PairBuckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_colloid_omp.cpp b/src/USER-OMP/pair_colloid_omp.cpp index 94325232f..450957954 100644 --- a/src/USER-OMP/pair_colloid_omp.cpp +++ b/src/USER-OMP/pair_colloid_omp.cpp @@ -56,7 +56,7 @@ void PairColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp index 9a0155d6d..c07a6948a 100644 --- a/src/USER-OMP/pair_comb_omp.cpp +++ b/src/USER-OMP/pair_comb_omp.cpp @@ -63,7 +63,7 @@ void PairCombOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_omp.cpp b/src/USER-OMP/pair_coul_cut_omp.cpp index 57b821cb8..5f4a792c9 100644 --- a/src/USER-OMP/pair_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_omp.cpp @@ -52,7 +52,7 @@ void PairCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_coul_cut_soft_omp.cpp index f8b3a36e3..36453b1b3 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_soft_omp.cpp @@ -53,7 +53,7 @@ void PairCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_debye_omp.cpp b/src/USER-OMP/pair_coul_debye_omp.cpp index 1bb867699..8a3549b73 100644 --- a/src/USER-OMP/pair_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_coul_debye_omp.cpp @@ -52,7 +52,7 @@ void PairCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_diel_omp.cpp b/src/USER-OMP/pair_coul_diel_omp.cpp index 62f258042..f6bdcf8cf 100644 --- a/src/USER-OMP/pair_coul_diel_omp.cpp +++ b/src/USER-OMP/pair_coul_diel_omp.cpp @@ -53,7 +53,7 @@ void PairCoulDielOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_dsf_omp.cpp b/src/USER-OMP/pair_coul_dsf_omp.cpp index 3a8db4563..f7bb7adac 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_coul_dsf_omp.cpp @@ -61,7 +61,7 @@ void PairCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_omp.cpp b/src/USER-OMP/pair_coul_long_omp.cpp index 92cb51f7a..12b8fdb2f 100644 --- a/src/USER-OMP/pair_coul_long_omp.cpp +++ b/src/USER-OMP/pair_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairCoulLongOMP::PairCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_soft_omp.cpp b/src/USER-OMP/pair_coul_long_soft_omp.cpp index 28ba13d5c..0d4dd729d 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_long_soft_omp.cpp @@ -61,7 +61,7 @@ void PairCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_msm_omp.cpp b/src/USER-OMP/pair_coul_msm_omp.cpp index e907d63eb..4c77b85ae 100644 --- a/src/USER-OMP/pair_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairCoulMSMOMP::PairCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp index 71e8148a5..20d45102b 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_coul_wolf_omp.cpp @@ -54,7 +54,7 @@ void PairCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index 6e3da77cb..615908f06 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -35,7 +35,7 @@ PairDPDOMP::PairDPDOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -48,7 +48,7 @@ PairDPDOMP::~PairDPDOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -73,7 +73,7 @@ void PairDPDOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -89,11 +89,11 @@ void PairDPDOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 823367109..844c79771 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -36,7 +36,7 @@ PairDPDTstatOMP::PairDPDTstatOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -49,7 +49,7 @@ PairDPDTstatOMP::~PairDPDTstatOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -74,7 +74,7 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -89,11 +89,11 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index c7559420b..9a797dafa 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index 66a7581c2..d474e039b 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -69,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_omp.cpp b/src/USER-OMP/pair_eam_omp.cpp index e6ba299a4..cbdf03a41 100644 --- a/src/USER-OMP/pair_eam_omp.cpp +++ b/src/USER-OMP/pair_eam_omp.cpp @@ -67,7 +67,7 @@ void PairEAMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eam(nall, rho); diff --git a/src/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp index 864ff68f7..d0e84be4c 100644 --- a/src/USER-OMP/pair_edip_omp.cpp +++ b/src/USER-OMP/pair_edip_omp.cpp @@ -58,7 +58,7 @@ void PairEDIPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_eim_omp.cpp b/src/USER-OMP/pair_eim_omp.cpp index 74b460a78..7e25a14a0 100644 --- a/src/USER-OMP/pair_eim_omp.cpp +++ b/src/USER-OMP/pair_eim_omp.cpp @@ -65,7 +65,7 @@ void PairEIMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eim(nall, rho, fp); diff --git a/src/USER-OMP/pair_gauss_cut_omp.cpp b/src/USER-OMP/pair_gauss_cut_omp.cpp index a45391573..d2a197291 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.cpp +++ b/src/USER-OMP/pair_gauss_cut_omp.cpp @@ -53,7 +53,7 @@ void PairGaussCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gauss_omp.cpp b/src/USER-OMP/pair_gauss_omp.cpp index 3e5777e4e..919ffbe79 100644 --- a/src/USER-OMP/pair_gauss_omp.cpp +++ b/src/USER-OMP/pair_gauss_omp.cpp @@ -55,7 +55,7 @@ void PairGaussOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp index 991c72a9b..d4ee5b268 100644 --- a/src/USER-OMP/pair_gayberne_omp.cpp +++ b/src/USER-OMP/pair_gayberne_omp.cpp @@ -53,7 +53,7 @@ void PairGayBerneOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 9ad84afb9..2506c4e5b 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -78,7 +78,7 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index 3e519fc0d..ec8710871 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -79,7 +79,7 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_omp.cpp b/src/USER-OMP/pair_gran_hooke_omp.cpp index 8de959a91..1965c1676 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_omp.cpp @@ -74,7 +74,7 @@ void PairGranHookeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (force->newton_pair) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 338eb5245..8b8dea2a1 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -41,7 +41,7 @@ PairHbondDreidingLJOMP::PairHbondDreidingLJOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingLJOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 5094d5c19..9731972a4 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -41,7 +41,7 @@ PairHbondDreidingMorseOMP::PairHbondDreidingMorseOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj96_cut_omp.cpp b/src/USER-OMP/pair_lj96_cut_omp.cpp index 5aeec25d1..ddbb7ae8e 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.cpp +++ b/src/USER-OMP/pair_lj96_cut_omp.cpp @@ -32,7 +32,7 @@ PairLJ96CutOMP::PairLJ96CutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJ96CutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp index 3ff02b610..a7cd7aa76 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp @@ -51,7 +51,7 @@ void PairLJCharmmCoulCharmmImplicitOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp index 77caf63f1..03d33a6a8 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp @@ -53,7 +53,7 @@ void PairLJCharmmCoulCharmmOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp index 56cf0a68d..ed199dbfd 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp @@ -32,7 +32,7 @@ PairLJCharmmCoulLongOMP::PairLJCharmmCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJCharmmCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp index e19632dc7..932460a6b 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp @@ -32,7 +32,7 @@ PairLJCharmmCoulLongSoftOMP::PairLJCharmmCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJCharmmCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp index a39ef0aa8..1d9391206 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairLJCharmmCoulMSMOMP::PairLJCharmmCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairLJCharmmCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp index 63fb4fe52..50baa7eb8 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJClass2CoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp index f618f7f42..85712f22c 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairLJClass2CoulLongOMP::PairLJClass2CoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJClass2CoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_omp.cpp b/src/USER-OMP/pair_lj_class2_omp.cpp index 39cc320e4..ae2243daa 100644 --- a/src/USER-OMP/pair_lj_class2_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_omp.cpp @@ -53,7 +53,7 @@ void PairLJClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cubic_omp.cpp b/src/USER-OMP/pair_lj_cubic_omp.cpp index 27f613249..1ccade4e6 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.cpp +++ b/src/USER-OMP/pair_lj_cubic_omp.cpp @@ -54,7 +54,7 @@ void PairLJCubicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp index 2f46e0bfe..2ab0a4e8c 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp index 03f0852b0..d8080656b 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp index 82031f91a..d15456334 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp index 7ab6f31b3..fe47e947e 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp @@ -63,7 +63,7 @@ void PairLJCutCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp index c7b6de802..1edeb94b1 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongOMP::PairLJCutCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp index 6e804bd8a..a024db5fc 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp @@ -40,7 +40,7 @@ PairLJCutCoulLongSoftOMP::PairLJCutCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ void PairLJCutCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp index 0e6d11327..04afd428a 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp @@ -34,7 +34,7 @@ PairLJCutCoulMSMOMP::PairLJCutCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairLJCutCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp index 0e9a33312..9f0577dac 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp @@ -55,7 +55,7 @@ void PairLJCutCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp index 2cc915a43..b486ba33d 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp @@ -53,7 +53,7 @@ void PairLJCutDipoleCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_omp.cpp index 2aa71026e..4f8c95a97 100644 --- a/src/USER-OMP/pair_lj_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_omp.cpp @@ -30,7 +30,7 @@ PairLJCutOMP::PairLJCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ void PairLJCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_soft_omp.cpp index 406c5f41d..dc2441fed 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_soft_omp.cpp @@ -30,7 +30,7 @@ PairLJCutSoftOMP::PairLJCutSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ void PairLJCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp index b921c8f1c..d79980493 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp @@ -53,7 +53,7 @@ PairLJCutTholeLongOMP::PairLJCutTholeLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -75,7 +75,7 @@ void PairLJCutTholeLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp index 2d1b82882..d11a018a8 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PCutOMP::PairLJCutTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp index a60f9d6a5..b712ef843 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongOMP::PairLJCutTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp index f4a75b9af..d498da3e8 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongSoftOMP::PairLJCutTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_expand_omp.cpp b/src/USER-OMP/pair_lj_expand_omp.cpp index 89077ba6a..ba624ae7d 100644 --- a/src/USER-OMP/pair_lj_expand_omp.cpp +++ b/src/USER-OMP/pair_lj_expand_omp.cpp @@ -53,7 +53,7 @@ void PairLJExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp index 26a6e979b..7e8a38935 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp @@ -53,7 +53,7 @@ void PairLJGromacsCoulGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_omp.cpp index 308209153..d179831e3 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_omp.cpp @@ -53,7 +53,7 @@ void PairLJGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp index cdd62ff96..76768276c 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp @@ -42,7 +42,7 @@ PairLJLongCoulLongOMP::PairLJLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ void PairLJLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -329,7 +329,7 @@ void PairLJLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -354,7 +354,7 @@ void PairLJLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -384,7 +384,7 @@ void PairLJLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp index af24e93a4..4ba412c66 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp @@ -44,9 +44,9 @@ PairLJLongTIP4PLongOMP::PairLJLongTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; - newsite_thr = NULL; - hneigh_thr = NULL; + cut_respa = nullptr; + newsite_thr = nullptr; + hneigh_thr = nullptr; tip4pflag = dispersionflag = 1; no_virial_fdotr_compute = 1; single_enable = 0; @@ -106,7 +106,7 @@ void PairLJLongTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -389,7 +389,7 @@ void PairLJLongTIP4PLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -414,7 +414,7 @@ void PairLJLongTIP4PLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -468,7 +468,7 @@ void PairLJLongTIP4PLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp index 4a53f2c08..f3af43cd5 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp @@ -54,7 +54,7 @@ void PairLJSDKCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp index 4b89375b5..f05f5e120 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp @@ -60,7 +60,7 @@ void PairLJSDKCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_omp.cpp b/src/USER-OMP/pair_lj_sdk_omp.cpp index d5146c679..a88a1ded0 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_omp.cpp @@ -56,7 +56,7 @@ void PairLJSDKOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp index 8828b40b9..130ac6e5e 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp @@ -53,7 +53,7 @@ void PairLJSFDipoleSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp index 2c0c02818..d69cfea0a 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp @@ -53,7 +53,7 @@ void PairLJSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_omp.cpp b/src/USER-OMP/pair_lj_smooth_omp.cpp index 0b4ea4e5f..1adccbf3c 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_omp.cpp @@ -53,7 +53,7 @@ void PairLJSmoothOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lubricate_omp.cpp b/src/USER-OMP/pair_lubricate_omp.cpp index caf5a1112..17496830f 100644 --- a/src/USER-OMP/pair_lubricate_omp.cpp +++ b/src/USER-OMP/pair_lubricate_omp.cpp @@ -116,7 +116,7 @@ void PairLubricateOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (evflag) { diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp index feb110194..227c94300 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.cpp +++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp @@ -113,7 +113,7 @@ void PairLubricatePolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (shearing) { diff --git a/src/USER-OMP/pair_meam_spline_omp.cpp b/src/USER-OMP/pair_meam_spline_omp.cpp index 782371e84..e093e925f 100644 --- a/src/USER-OMP/pair_meam_spline_omp.cpp +++ b/src/USER-OMP/pair_meam_spline_omp.cpp @@ -65,7 +65,7 @@ void PairMEAMSplineOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); thr->init_eam(nall,Uprime_values); diff --git a/src/USER-OMP/pair_morse_omp.cpp b/src/USER-OMP/pair_morse_omp.cpp index 48687781e..aa79a0f05 100644 --- a/src/USER-OMP/pair_morse_omp.cpp +++ b/src/USER-OMP/pair_morse_omp.cpp @@ -53,7 +53,7 @@ void PairMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp index 220fb9481..1896fdcba 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp @@ -55,7 +55,7 @@ void PairMorseSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp index 1cfe576a3..ecdba46e0 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp @@ -53,7 +53,7 @@ void PairNMCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp index d9e123182..09ec46d1c 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp @@ -61,7 +61,7 @@ void PairNMCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_omp.cpp index a232da1a9..faa3acefb 100644 --- a/src/USER-OMP/pair_nm_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_omp.cpp @@ -53,7 +53,7 @@ void PairNMCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_lps_omp.cpp b/src/USER-OMP/pair_peri_lps_omp.cpp index 9bf707ad9..b2be37391 100644 --- a/src/USER-OMP/pair_peri_lps_omp.cpp +++ b/src/USER-OMP/pair_peri_lps_omp.cpp @@ -71,7 +71,7 @@ void PairPeriLPSOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_pmb_omp.cpp b/src/USER-OMP/pair_peri_pmb_omp.cpp index 28df45b67..b58cadc20 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.cpp +++ b/src/USER-OMP/pair_peri_pmb_omp.cpp @@ -67,7 +67,7 @@ void PairPeriPMBOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index dfc1f428e..54417f953 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -92,7 +92,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) system->pair_ptr = this; system->omp_active = 1; - num_nbrs_offset = NULL; + num_nbrs_offset = nullptr; #ifdef OMP_TIMING for (int i=0;iget_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_soft_omp.cpp b/src/USER-OMP/pair_soft_omp.cpp index f733b5106..382a995e2 100644 --- a/src/USER-OMP/pair_soft_omp.cpp +++ b/src/USER-OMP/pair_soft_omp.cpp @@ -57,7 +57,7 @@ void PairSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_sw_omp.cpp b/src/USER-OMP/pair_sw_omp.cpp index c2eb4cb15..dac252705 100644 --- a/src/USER-OMP/pair_sw_omp.cpp +++ b/src/USER-OMP/pair_sw_omp.cpp @@ -51,7 +51,7 @@ void PairSWOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp index f5fbabcca..79128bea8 100644 --- a/src/USER-OMP/pair_table_omp.cpp +++ b/src/USER-OMP/pair_table_omp.cpp @@ -51,7 +51,7 @@ void PairTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp index 83baa56e4..6d2cbf71a 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp @@ -50,7 +50,7 @@ void PairTersoffMODCOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_omp.cpp b/src/USER-OMP/pair_tersoff_mod_omp.cpp index ab2f07322..45669dc60 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_omp.cpp @@ -52,7 +52,7 @@ void PairTersoffMODOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp index a36774997..efafa7949 100644 --- a/src/USER-OMP/pair_tersoff_omp.cpp +++ b/src/USER-OMP/pair_tersoff_omp.cpp @@ -53,7 +53,7 @@ void PairTersoffOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp index 8321ad9d9..277b79b9e 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.cpp +++ b/src/USER-OMP/pair_tersoff_table_omp.cpp @@ -43,8 +43,8 @@ PairTersoffTableOMP::PairTersoffTableOMP(LAMMPS *lmp) : suffix_flag |= Suffix::OMP; respa_enable = 0; - thrGtetaFunction = thrGtetaFunctionDerived = NULL; - thrCutoffFunction = thrCutoffFunctionDerived = NULL; + thrGtetaFunction = thrGtetaFunctionDerived = nullptr; + thrCutoffFunction = thrCutoffFunctionDerived = nullptr; } /* ---------------------------------------------------------------------- */ @@ -76,7 +76,7 @@ void PairTersoffTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (vflag_atom) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_tip4p_cut_omp.cpp b/src/USER-OMP/pair_tip4p_cut_omp.cpp index 5b983d3db..a7e087e20 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PCutOMP::PairTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -101,7 +101,7 @@ void PairTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tip4p_long_omp.cpp b/src/USER-OMP/pair_tip4p_long_omp.cpp index 86bebdbef..75f6850ac 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongOMP::PairTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (!ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp index 26e042095..e408cb7cc 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongSoftOMP::PairTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_ufm_omp.cpp b/src/USER-OMP/pair_ufm_omp.cpp index e1c2ff457..202cce567 100644 --- a/src/USER-OMP/pair_ufm_omp.cpp +++ b/src/USER-OMP/pair_ufm_omp.cpp @@ -55,7 +55,7 @@ void PairUFMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_omp.cpp b/src/USER-OMP/pair_vashishta_omp.cpp index 0637fe3df..c1dd45d8b 100644 --- a/src/USER-OMP/pair_vashishta_omp.cpp +++ b/src/USER-OMP/pair_vashishta_omp.cpp @@ -53,7 +53,7 @@ void PairVashishtaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_table_omp.cpp b/src/USER-OMP/pair_vashishta_table_omp.cpp index 9650a57e7..caf4bb493 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.cpp +++ b/src/USER-OMP/pair_vashishta_table_omp.cpp @@ -51,7 +51,7 @@ void PairVashishtaTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.cpp b/src/USER-OMP/pair_yukawa_colloid_omp.cpp index 227ec0744..4b595365f 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.cpp +++ b/src/USER-OMP/pair_yukawa_colloid_omp.cpp @@ -53,7 +53,7 @@ void PairYukawaColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_omp.cpp b/src/USER-OMP/pair_yukawa_omp.cpp index 347575e28..78f2a1213 100644 --- a/src/USER-OMP/pair_yukawa_omp.cpp +++ b/src/USER-OMP/pair_yukawa_omp.cpp @@ -53,7 +53,7 @@ void PairYukawaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_zbl_omp.cpp b/src/USER-OMP/pair_zbl_omp.cpp index 9679a00b2..2faf6d1bb 100644 --- a/src/USER-OMP/pair_zbl_omp.cpp +++ b/src/USER-OMP/pair_zbl_omp.cpp @@ -54,7 +54,7 @@ void PairZBLOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index 80e9b90ec..bcef3a3c8 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -88,7 +88,7 @@ void BondsOMP( reax_system *system, control_params * /* control */, pair_reax_ptr->ev_setup_thr_proxy(system->pair_ptr->eflag_either, system->pair_ptr->vflag_either, system->N, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index ad6ea35eb..ad474a1cc 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -165,7 +165,7 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); pair_reax_ptr->ev_setup_thr_proxy(0, 1, natoms, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 612c36053..0ce2c3718 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -82,33 +82,33 @@ void ThrData::init_force(int nall, double **f, double **torque, memset(virial_imprp,0,6*sizeof(double)); memset(virial_kspce,0,6*sizeof(double)); - eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=NULL; - vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=NULL; + eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=nullptr; + vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=nullptr; if (nall >= 0 && f) { _f = f + _tid*nall; memset(&(_f[0][0]),0,nall*3*sizeof(double)); - } else _f = NULL; + } else _f = nullptr; if (nall >= 0 && torque) { _torque = torque + _tid*nall; memset(&(_torque[0][0]),0,nall*3*sizeof(double)); - } else _torque = NULL; + } else _torque = nullptr; if (nall >= 0 && erforce) { _erforce = erforce + _tid*nall; memset(&(_erforce[0]),0,nall*sizeof(double)); - } else _erforce = NULL; + } else _erforce = nullptr; if (nall >= 0 && de) { _de = de + _tid*nall; memset(&(_de[0]),0,nall*sizeof(double)); - } else _de = NULL; + } else _de = nullptr; if (nall >= 0 && drho) { _drho = drho + _tid*nall; memset(&(_drho[0]),0,nall*sizeof(double)); - } else _drho = NULL; + } else _drho = nullptr; } /* ---------------------------------------------------------------------- @@ -191,8 +191,8 @@ void ThrData::init_pppm(int order, Memory *memory) drho1d = static_cast(_drho1d); if (rho1d) memory->destroy2d_offset(rho1d,-order/2); if (drho1d) memory->destroy2d_offset(drho1d,-order/2); - _rho1d = NULL; - _drho1d = NULL; + _rho1d = nullptr; + _drho1d = nullptr; } } diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h index 4b8735710..c942083ef 100644 --- a/src/USER-OMP/thr_data.h +++ b/src/USER-OMP/thr_data.h @@ -31,7 +31,7 @@ class ThrData { public: ThrData(int tid, class Timer *t); - ~ThrData() { delete _timer; _timer = NULL; }; + ~ThrData() { delete _timer; _timer = nullptr; }; void check_tid(int); // thread id consistency check int get_tid() const { return _tid; }; // our thread id. @@ -140,7 +140,7 @@ class ThrData { // disabled default methods private: - ThrData() : _tid(-1), _timer(NULL) {}; + ThrData() : _tid(-1), _timer(nullptr) {}; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index 6e096defa..01e54d3bd 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ThrOMP::ThrOMP(LAMMPS *ptr, int style) - : lmp(ptr), fix(NULL), thr_style(style), thr_error(0) + : lmp(ptr), fix(nullptr), thr_style(style), thr_error(0) { // register fix omp with this class int ifix = lmp->modify->find_fix("package_omp"); @@ -88,7 +88,7 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom, if (nall > 0) memset(&(thr->cvatom_pair[0][0]),0,nall*9*sizeof(double)); } else { - thr->cvatom_pair = NULL; + thr->cvatom_pair = nullptr; } } @@ -199,7 +199,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, if (lmp->force->pair->vflag_fdotr) { // this is a non-hybrid pair style. compute per thread fdotr - if (fix->last_pair_hybrid == NULL) { + if (fix->last_pair_hybrid == nullptr) { if (lmp->neighbor->includegroup == 0) thr->virial_fdotr_compute(x, nlocal, nghost, -1); else diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 238aa7c96..5451ffba5 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -32,7 +32,7 @@ enum{REGULAR,ESKM}; /* ---------------------------------------------------------------------- */ -DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -43,7 +43,7 @@ DynamicalMatrix::~DynamicalMatrix() { if (fp && me == 0) fclose(fp); memory->destroy(groupmap); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -223,7 +223,7 @@ void DynamicalMatrix::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 382eabe82..c80073f3c 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because NULL buffer will result in error for MPI + // allocate variables; MAX(1,... is used because nullptr buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); @@ -184,7 +184,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // output some information on the system to log file if (me == 0){ flog = fopen(logfile, "w"); - if (flog == NULL) { + if (flog == nullptr) { char str[MAXLINE]; sprintf(str,"Can not open output file %s",logfile); error->one(FLERR,str); @@ -563,34 +563,34 @@ void FixPhonon::readmap() // read from map file for others char line[MAXLINE]; FILE *fp = fopen(mapfile, "r"); - if (fp == NULL){ + if (fp == nullptr){ sprintf(line,"Cannot open input map file %s", mapfile); error->all(FLERR,line); } - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading header of mapping file!"); nx = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); - ny = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - nz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - nucell = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + ny = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nucell = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); ntotal = nx*ny*nz; if (ntotal*nucell != ngroup) error->all(FLERR,"FFT mesh and number of atoms in group mismatch!"); // second line of mapfile is comment - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading comment of mapping file!"); int ix, iy, iz, iu; // the remaining lines carry the mapping info for (int i = 0; i < ngroup; ++i){ - if (fgets(line,MAXLINE,fp) == NULL) {info = 1; break;} + if (fgets(line,MAXLINE,fp) == nullptr) {info = 1; break;} ix = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); - iy = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - iz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - iu = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); - itag = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + iy = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iu = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + itag = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); // check if index is in correct range if (ix < 0 || ix >= nx || iy < 0 || iy >= ny || diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index e7997d639..e72ac0fdf 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -32,7 +32,7 @@ enum{REGULAR,BALLISTICO}; /* ---------------------------------------------------------------------- */ -ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -42,7 +42,7 @@ ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) ThirdOrder::~ThirdOrder() { if (fp && me == 0) fclose(fp); - fp = NULL; + fp = nullptr; memory->destroy(groupmap); } @@ -220,7 +220,7 @@ void ThirdOrder::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index b7a29c7bc..3d2acacc1 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -53,8 +53,8 @@ using namespace FixConst; FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - p(NULL), nlocal(0), gatindex(NULL), masses(NULL), charges(NULL), - id_pe(NULL), id_press(NULL) + p(nullptr), nlocal(0), gatindex(nullptr), masses(nullptr), charges(nullptr), + id_pe(nullptr), id_press(nullptr) { if (!atom->tag_enable) @@ -68,7 +68,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : "Group will be ignored."); #if defined(__PLUMED_DEFAULT_KERNEL) - if (getenv("PLUMED_KERNEL") == NULL) + if (getenv("PLUMED_KERNEL") == nullptr) putenv(plumed_default_kernel); #endif @@ -101,7 +101,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : // it is defined inside plumed. p->cmd("GREX setMPIIntercomm",&inter_comm); } - p->cmd("GREX init",NULL); + p->cmd("GREX init",nullptr); } // The general communicator is independent of the existence of partitions, diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index 309dd75c1..508c3d0ff 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -61,7 +61,7 @@ static const char cite_user_ptm_package[] = /* ---------------------------------------------------------------------- */ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) - : Compute(lmp, narg, arg), list(NULL), output(NULL) { + : Compute(lmp, narg, arg), list(nullptr), output(nullptr) { if (narg < 5 || narg > 6) error->all(FLERR, "Illegal compute ptm/atom command"); @@ -144,7 +144,7 @@ ComputePTMAtom::~ComputePTMAtom() { memory->destroy(output); } /* ---------------------------------------------------------------------- */ void ComputePTMAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR, "Compute ptm/atom requires a pair style be defined"); int count = 0; @@ -201,7 +201,7 @@ static int get_neighbours(void* vdata, size_t central_index, size_t atom_index, double **x = data->x; double *pos = x[atom_index]; - int *jlist = NULL; + int *jlist = nullptr; int jnum = 0; if (atom_index < data->nlocal) { jlist = data->firstneigh[atom_index]; @@ -307,7 +307,7 @@ void ComputePTMAtom::compute_peratom() { ptm_index(local_handle, i, get_neighbours, (void*)&nbrlist, input_flags, standard_orientations, &type, &alloy_type, &scale, &rmsd, q, - NULL, NULL, NULL, NULL, &interatomic_distance, NULL, NULL); + nullptr, nullptr, nullptr, nullptr, &interatomic_distance, nullptr, nullptr); if (rmsd > rmsd_threshold) { type = PTM_MATCH_NONE; diff --git a/src/USER-PTM/ptm_index.cpp b/src/USER-PTM/ptm_index.cpp index cedd35126..7c912ed5b 100644 --- a/src/USER-PTM/ptm_index.cpp +++ b/src/USER-PTM/ptm_index.cpp @@ -95,11 +95,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], double *P, double *p_interatomic_distance, double *p_lattice_constant, size_t *output_indices) { const ptm::refdata_t *ref = res->ref_struct; - if (ref == NULL) + if (ref == nullptr) return; *p_type = ref->type; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = ptm::find_alloy_type(ref, res->mapping, numbers); int8_t temp[PTM_MAX_POINTS]; @@ -123,7 +123,7 @@ static void output_data(ptm::result_t *res, double (*points)[3], memcpy(res->mapping, temp, (ref->num_nbrs + 1) * sizeof(int8_t)); - if (F != NULL && F_res != NULL) { + if (F != nullptr && F_res != nullptr) { double scaled_points[PTM_MAX_INPUT_POINTS][3]; ptm::subtract_barycentre(ref->num_nbrs + 1, points, scaled_points); @@ -160,11 +160,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], if (ref->type == PTM_MATCH_GRAPHENE) // hack for pseudo-2d structures F[8] = 1; - if (P != NULL && U != NULL) + if (P != nullptr && U != nullptr) ptm::polar_decomposition_3x3(F, false, U, P); } - if (output_indices != NULL) + if (output_indices != nullptr) for (int i = 0; i < ref->num_nbrs + 1; i++) output_indices[i] = ordering[res->mapping[i]]; @@ -173,10 +173,10 @@ static void output_data(ptm::result_t *res, double (*points)[3], double lattice_constant = calculate_lattice_constant(ref->type, interatomic_distance); - if (p_interatomic_distance != NULL) + if (p_interatomic_distance != nullptr) *p_interatomic_distance = interatomic_distance; - if (p_lattice_constant != NULL) + if (p_lattice_constant != nullptr) *p_lattice_constant = lattice_constant; *p_rmsd = res->rmsd; @@ -200,7 +200,7 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, int ret = 0; ptm::result_t res; - res.ref_struct = NULL; + res.ref_struct = nullptr; res.rmsd = INFINITY; size_t ordering[PTM_MAX_INPUT_POINTS]; @@ -269,13 +269,13 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, } *p_type = PTM_MATCH_NONE; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = PTM_ALLOY_NONE; - if (output_indices != NULL) + if (output_indices != nullptr) memset(output_indices, -1, PTM_MAX_INPUT_POINTS * sizeof(size_t)); - if (res.ref_struct == NULL) + if (res.ref_struct == nullptr) return PTM_NO_ERROR; if (res.ref_struct->type == PTM_MATCH_DCUB || diff --git a/src/USER-PTM/ptm_initialize_data.h b/src/USER-PTM/ptm_initialize_data.h index 87111b128..dd1cddd9f 100644 --- a/src/USER-PTM/ptm_initialize_data.h +++ b/src/USER-PTM/ptm_initialize_data.h @@ -50,17 +50,17 @@ const refdata_t structure_sc = { PTM_MATCH_SC, //. NUM_SC_GRAPHS, //.num_graphs graphs_sc, //.graphs ptm_template_sc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_sc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_sc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_fcc = { PTM_MATCH_FCC, //.type @@ -70,17 +70,17 @@ const refdata_t structure_fcc = { PTM_MATCH_FCC, / NUM_FCC_GRAPHS, //.num_graphs graphs_fcc, //.graphs ptm_template_fcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_fcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_fcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_hcp = { PTM_MATCH_HCP, //.type @@ -91,12 +91,12 @@ const refdata_t structure_hcp = { PTM_MATCH_HCP, / graphs_hcp, //.graphs ptm_template_hcp, //.points ptm_template_hcp_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_hcp, //.penrose penrose_hcp_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_HEX_MAPPINGS, //.num_mappings mapping_hcp, //.mapping mapping_hcp_conventional, //.mapping_conventional @@ -110,17 +110,17 @@ const refdata_t structure_ico = { PTM_MATCH_ICO, / NUM_ICO_GRAPHS, //.num_graphs graphs_ico, //.graphs ptm_template_ico, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_ico, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_ICO_MAPPINGS, //.num_mappings mapping_ico, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_bcc = { PTM_MATCH_BCC, //.type @@ -130,17 +130,17 @@ const refdata_t structure_bcc = { PTM_MATCH_BCC, / NUM_BCC_GRAPHS, //.num_graphs graphs_bcc, //.graphs ptm_template_bcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_bcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_bcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_dcub = { PTM_MATCH_DCUB, //.type @@ -151,12 +151,12 @@ const refdata_t structure_dcub = { PTM_MATCH_DCUB, graphs_dcub, //.graphs ptm_template_dcub, //.points ptm_template_dcub_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_dcub, //.penrose penrose_dcub_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_DCUB_MAPPINGS, //.num_mappings mapping_dcub, //.mapping mapping_dcub_conventional, //.mapping_conventional @@ -188,15 +188,15 @@ const refdata_t structure_graphene = { PTM_MATCH_GRAPHENE, -1, //.num_facets -1, //.max_degree -1, //.num_graphs - NULL, //.graphs + nullptr, //.graphs ptm_template_graphene, //.points ptm_template_graphene_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_graphene, //.penrose penrose_graphene_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 -1, //.num_mappings mapping_graphene, //.mapping mapping_graphene_conventional, //.mapping_conventional diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index 9f0703000..f6d0f9300 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -169,7 +169,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -191,7 +191,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -242,7 +242,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -250,7 +250,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -353,11 +353,11 @@ FixQMMM::FixQMMM(LAMMPS *lmp, int narg, char **arg) : mm_comm = MPI_Comm_f2c(qmmmcfg.mm_comm); /* initialize storage */ - qm_idmap = mm_idmap = NULL; - qm_remap = mm_remap = NULL; - qm_coord = mm_coord = qm_force = mm_force = NULL; - qm_charge =NULL; - mm_type = NULL; + qm_idmap = mm_idmap = nullptr; + qm_remap = mm_remap = nullptr; + qm_coord = mm_coord = qm_force = mm_force = nullptr; + qm_charge =nullptr; + mm_type = nullptr; do_init = 1; diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 034738023..2b05ce543 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -246,19 +246,19 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : peflag = 1; // allocate qbmsst - temperature = NULL; - pressure = NULL; - pe = NULL; - old_velocity = NULL; - rfix = NULL; - gfactor = NULL; - random = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; + old_velocity = nullptr; + rfix = nullptr; + gfactor = nullptr; + random = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; // initialize Marsagxlia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -331,7 +331,7 @@ void FixQBMSST::init() boltz = force->boltz; nktv2p = force->nktv2p; mvv2e = force->mvv2e; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix qbmsst without per-type mass defined"); // set compute ptrs diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 3f29229be..ff36326ed 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -94,16 +94,16 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : maxexchange = 6*N_f+3; // allocate qtb - gfactor1 = NULL; - gfactor3 = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; - id_temp = NULL; - temperature = NULL; + gfactor1 = nullptr; + gfactor3 = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; + id_temp = nullptr; + temperature = nullptr; // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -158,7 +158,7 @@ void FixQTB::init() { // copy parameters from other classes double dtv = update->dt; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); //initiate the counter \mu diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 5511efe68..d2093941a 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -45,10 +45,10 @@ PairQUIP::PairQUIP(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; manybody_flag = 1; - map = NULL; - quip_potential = NULL; - quip_file = NULL; - quip_string = NULL; + map = nullptr; + quip_potential = nullptr; + quip_file = nullptr; + quip_string = nullptr; } PairQUIP::~PairQUIP() diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 5d57b7405..41a2244d4 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -92,10 +92,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_react); - fix1 = NULL; - fix2 = NULL; - fix3 = NULL; - reset_mol_ids = NULL; + fix1 = nullptr; + fix2 = nullptr; + fix3 = nullptr; + reset_mol_ids = nullptr; if (narg < 8) error->all(FLERR,"Illegal fix bond/react command: " "too few arguments"); @@ -116,12 +116,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : narrhenius = 0; status = PROCEED; - nxspecial = NULL; - onemol_nxspecial = NULL; - twomol_nxspecial = NULL; - xspecial = NULL; - onemol_xspecial = NULL; - twomol_xspecial = NULL; + nxspecial = nullptr; + onemol_nxspecial = nullptr; + twomol_nxspecial = nullptr; + xspecial = nullptr; + onemol_xspecial = nullptr; + twomol_xspecial = nullptr; // these group names are reserved for use exclusively by bond/react master_group = (char *) "bond_react_MASTER_group"; @@ -472,16 +472,16 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; - probability = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; + probability = nullptr; maxcreate = 0; - created = NULL; - ncreate = NULL; + created = nullptr; + ncreate = nullptr; allncreate = 0; local_num_mega = 0; ghostly_num_mega = 0; - restore = NULL; + restore = nullptr; // zero out stats global_megasize = 0; @@ -489,17 +489,17 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : glove_counter = 0; guess_branch = new int[MAXGUESS](); pioneer_count = new int[max_natoms]; - local_mega_glove = NULL; - ghostly_mega_glove = NULL; - global_mega_glove = NULL; + local_mega_glove = nullptr; + ghostly_mega_glove = nullptr; + global_mega_glove = nullptr; // these are merely loop indices that became important pion = neigh = trace = 0; - id_fix1 = NULL; - id_fix2 = NULL; - id_fix3 = NULL; - statted_id = NULL; + id_fix1 = nullptr; + id_fix2 = nullptr; + id_fix3 = nullptr; + statted_id = nullptr; custom_exclude_flag = 0; // used to store restart info @@ -708,7 +708,7 @@ void FixBondReact::post_constructor() int unused; char * idprop; idprop = (char *) fix->extract("property",unused); - if (idprop == NULL) + if (idprop == nullptr) error->all(FLERR,"Exclude group must be a per-atom property group"); len = strlen(idprop) + 1; @@ -750,7 +750,7 @@ void FixBondReact::init() // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { - if (force->pair == NULL || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) + if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); } @@ -3132,7 +3132,7 @@ void FixBondReact::read(int myrxn) // skip 1st line of file eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); + if (eof == nullptr) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); // read header lines // skip blank lines or lines that start with "#" @@ -3403,7 +3403,7 @@ void FixBondReact::readID(char *strarg, int iconstr, int mode, int myID) void FixBondReact::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Bond/react: Cannot open map file %s",file); error->one(FLERR,str); @@ -3414,7 +3414,7 @@ void FixBondReact::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -3431,11 +3431,11 @@ void FixBondReact::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return @@ -3477,7 +3477,7 @@ int FixBondReact::parse(char *line, char **words, int max) int nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((ptr = strtok(NULL," \t\n\r\f"))) { + while ((ptr = strtok(nullptr," \t\n\r\f"))) { if (nwords < max) words[nwords] = ptr; nwords++; } diff --git a/src/USER-REAXC/compute_spec_atom.cpp b/src/USER-REAXC/compute_spec_atom.cpp index bc5b26b69..1c4856d72 100644 --- a/src/USER-REAXC/compute_spec_atom.cpp +++ b/src/USER-REAXC/compute_spec_atom.cpp @@ -117,8 +117,8 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index fea8b39f5..08bf75b76 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -60,7 +60,7 @@ static const char cite_fix_qeq_reax[] = /* ---------------------------------------------------------------------- */ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pertype_option(NULL) + Fix(lmp, narg, arg), pertype_option(nullptr) { if (narg<8 || narg>11) error->all(FLERR,"Illegal fix qeq/reax command"); @@ -90,33 +90,33 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix qeq/reax command"); iarg++; } - shld = NULL; + shld = nullptr; nn = n_cap = 0; NN = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 4; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; - b_prc = NULL; - b_prm = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; + b_prc = nullptr; + b_prm = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // dual CG support // Update comm sizes for this fix @@ -126,10 +126,10 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxc = NULL; + reaxc = nullptr; reaxc = (PairReaxC *) force->pair_match("^reax/c",0); - s_hist = t_hist = NULL; + s_hist = t_hist = nullptr; atom->add_callback(0); } @@ -194,13 +194,13 @@ void FixQEqReax::pertype_parameters(char *arg) if (strcmp(arg,"reax/c") == 0) { reaxflag = 1; Pair *pair = force->pair_match("reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/reax"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/reax"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/reax could not extract params from pair reax/c"); return; @@ -218,7 +218,7 @@ void FixQEqReax::pertype_parameters(char *arg) memory->create(gamma,ntypes+1,"qeq/reax:gamma"); if (comm->me == 0) { - if ((pf = fopen(arg,"r")) == NULL) + if ((pf = fopen(arg,"r")) == nullptr) error->one(FLERR,"Fix qeq/reax parameter file could not be found"); for (i = 1; i <= ntypes && !feof(pf); i++) { @@ -389,7 +389,7 @@ void FixQEqReax::init_shielding() int ntypes; ntypes = atom->ntypes; - if (shld == NULL) + if (shld == nullptr) memory->create(shld,ntypes+1,ntypes+1,"qeq:shielding"); for (i = 1; i <= ntypes; ++i) diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c98adf5b4..14f4762ce 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -41,8 +41,8 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : // register with atom class oldnmax = 0; - num_bonds = NULL; - num_hbonds = NULL; + num_bonds = nullptr; + num_hbonds = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index c0ffd4c17..a16446e76 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -65,7 +65,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[4],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/bonds file %s",arg[4]); error->one(FLERR,str); @@ -75,9 +75,9 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : if (atom->tag_consecutive() == 0) error->all(FLERR,"Atom IDs must be consecutive for fix reax/c bonds"); - abo = NULL; - neighid = NULL; - numneigh = NULL; + abo = nullptr; + neighid = nullptr; + numneigh = nullptr; allocate(); } @@ -114,7 +114,7 @@ void FixReaxCBonds::setup(int /*vflag*/) void FixReaxCBonds::init() { reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); } @@ -235,7 +235,7 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) } j += (5+numbonds); - if (atom->molecule == NULL ) buf[j] = 0.0; + if (atom->molecule == nullptr ) buf[j] = 0.0; else buf[j] = atom->molecule[i]; j ++; diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp index ec03ab180..952748570 100644 --- a/src/USER-REAXC/fix_reaxc_species.cpp +++ b/src/USER-REAXC/fix_reaxc_species.cpp @@ -97,7 +97,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : error->warning(FLERR,"Resetting reneighboring criteria for fix reax/c/species"); } - tmparg = NULL; + tmparg = nullptr; memory->create(tmparg,4,4,"reax/c/species:tmparg"); strcpy(tmparg[0],arg[3]); strcpy(tmparg[1],arg[4]); @@ -119,28 +119,28 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[6],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/species file %s",arg[6]); error->one(FLERR,str); } } - x0 = NULL; - clusterID = NULL; + x0 = nullptr; + clusterID = nullptr; int ntmp = 1; memory->create(x0,ntmp,"reax/c/species:x0"); memory->create(clusterID,ntmp,"reax/c/species:clusterID"); vector_atom = clusterID; - BOCut = NULL; - Name = NULL; - MolName = NULL; - MolType = NULL; - NMol = NULL; - nd = NULL; - molmap = NULL; + BOCut = nullptr; + Name = nullptr; + MolName = nullptr; + MolType = nullptr; + NMol = nullptr; + nd = nullptr; + molmap = nullptr; nmax = 0; setupflag = 0; @@ -156,8 +156,8 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : BOCut[i][j] = bg_cut; // optional args - eletype = NULL; - ele = filepos = NULL; + eletype = nullptr; + ele = filepos = nullptr; eleflag = posflag = padflag = 0; singlepos_opened = multipos_opened = 0; @@ -213,7 +213,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } else { if (me == 0) { pos = fopen(filepos, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); } singlepos_opened = 1; multipos = 0; @@ -278,7 +278,7 @@ int FixReaxCSpecies::setmask() void FixReaxCSpecies::setup(int /*vflag*/) { ntotal = static_cast (atom->natoms); - if (Name == NULL) + if (Name == nullptr) memory->create(Name,ntypes,"reax/c/species:Name"); post_integrate(); @@ -292,7 +292,7 @@ void FixReaxCSpecies::init() error->all(FLERR,"Cannot use fix reax/c/species unless atoms have IDs"); reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/species without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/species without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); reaxc->fixspecies_flag = 1; @@ -579,7 +579,7 @@ void FixReaxCSpecies::FindMolecule () void FixReaxCSpecies::SortMolecule(int &Nmole) { memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; int n, idlo, idhi; int *mask =atom->mask; @@ -641,7 +641,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) } memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; } @@ -656,11 +656,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) int *Nameall, *NMolall; memory->destroy(MolName); - MolName = NULL; + MolName = nullptr; memory->create(MolName,Nmole*(ntypes+1),"reax/c/species:MolName"); memory->destroy(NMol); - NMol = NULL; + NMol = nullptr; memory->create(NMol,Nmole,"reax/c/species:NMol"); for (m = 0; m < Nmole; m ++) NMol[m] = 1; @@ -705,11 +705,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(Nameall); memory->destroy(nd); - nd = NULL; + nd = nullptr; memory->create(nd,Nspec,"reax/c/species:nd"); memory->destroy(MolType); - MolType = NULL; + MolType = nullptr; memory->create(MolType,Nspec*(ntypes+2),"reax/c/species:MolType"); } @@ -793,8 +793,8 @@ void FixReaxCSpecies::OpenPos() if (me == 0) { pos = fopen(filecurrent, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); - } else pos = NULL; + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); + } else pos = nullptr; multipos_opened = 1; free(filecurrent); @@ -831,7 +831,7 @@ void FixReaxCSpecies::WritePos(int Nmole, int Nspec) fprintf(pos,"ID\tAtom_Count\tType\tAve_q\t\tCoM_x\t\tCoM_y\t\tCoM_z\n"); } - Nameall = NULL; + Nameall = nullptr; memory->create(Nameall,ntypes,"reax/c/species:Nameall"); for (m = 1; m <= Nmole; m ++) { diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index c38257ae3..6a2ba7d75 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -117,16 +117,16 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) system->bndry_cuts.ghost_hbond = 0; system->bndry_cuts.ghost_bond = 0; system->bndry_cuts.ghost_cutoff = 0; - system->my_atoms = NULL; + system->my_atoms = nullptr; system->pair_ptr = this; system->error_ptr = error; control->error_ptr = error; system->omp_active = 0; - fix_reax = NULL; - tmpid = NULL; - tmpbo = NULL; + fix_reax = nullptr; + tmpid = nullptr; + tmpbo = nullptr; nextra = 14; pvector = new double[nextra]; @@ -318,7 +318,7 @@ void PairReaxC::coeff( int nargs, char **args ) char *file = args[2]; FILE *fp; fp = utils::open_potential(file,lmp,nullptr); - if (fp != NULL) + if (fp != nullptr) Read_Force_Field(fp, &(system->reax_param), control); else { char str[128]; @@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args ) } // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr int itmp = 0; int nreax_types = system->reax_param.num_atom_types; @@ -424,7 +424,7 @@ void PairReaxC::init_style( ) if (lists[i].allocated != 1) lists[i].allocated = 0; - if (fix_reax == NULL) { + if (fix_reax == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) fix_id; fixarg[1] = (char *) "all"; @@ -819,7 +819,7 @@ void *PairReaxC::extract(const char *str, int &dim) else gamma[i] = 0.0; return (void *) gamma; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index f0b0e8229..0390769b5 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -57,10 +57,10 @@ int PreAllocate_Space( reax_system *system, control_params * /*control*/, // Nullify some arrays only used in omp styles // Should be safe to do here since called in pair->setup(); #ifdef LMP_USER_OMP - workspace->CdDeltaReduction = NULL; - workspace->forceReduction = NULL; - workspace->valence_angle_atom_myoffset = NULL; - workspace->my_ext_pressReduction = NULL; + workspace->CdDeltaReduction = nullptr; + workspace->forceReduction = nullptr; + workspace->valence_angle_atom_myoffset = nullptr; + workspace->my_ext_pressReduction = nullptr; #else LMP_UNUSED_PARAM(workspace); #endif diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp index 12aa989fa..1c8c24c31 100644 --- a/src/USER-REAXC/reaxc_control.cpp +++ b/src/USER-REAXC/reaxc_control.cpp @@ -41,7 +41,7 @@ char Read_Control_File( char *control_file, control_params* control, double val; /* open control file */ - if ( (fp = fopen( control_file, "r" ) ) == NULL ) { + if ( (fp = fopen( control_file, "r" ) ) == nullptr ) { control->error_ptr->all(FLERR, "The control file cannot be opened"); } diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index f68a2a2ab..866e3c989 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -50,7 +50,7 @@ int Init_Output_Files( reax_system *system, control_params *control, /* init potentials file */ sprintf( temp, "%s.pot", control->sim_name ); - if ((out_control->pot = fopen( temp, "w" )) != NULL) { + if ((out_control->pot = fopen( temp, "w" )) != nullptr) { fflush( out_control->pot ); } else { strcpy( msg, "init_out_controls: .pot file could not be opened\n" ); @@ -65,7 +65,7 @@ int Init_Output_Files( reax_system *system, control_params *control, control->ensemble == iNPT || control->ensemble == sNPT ) { sprintf( temp, "%s.prs", control->sim_name ); - if ((out_control->prs = fopen( temp, "w" )) != NULL) { + if ((out_control->prs = fopen( temp, "w" )) != nullptr) { fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n", "step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]", "Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" ); @@ -91,12 +91,12 @@ int Close_Output_Files( reax_system *system, control_params * /* control */, if (system->my_rank == MASTER_NODE) { if (out_control->pot) { fclose( out_control->pot ); - out_control->pot = NULL; + out_control->pot = nullptr; } if (out_control->prs) { fclose(out_control->prs); - out_control->prs = NULL; + out_control->prs = nullptr; } } diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp index 0880d9631..ea59b84ff 100644 --- a/src/USER-REAXC/reaxc_list.cpp +++ b/src/USER-REAXC/reaxc_list.cpp @@ -106,37 +106,37 @@ void Delete_List( reax_list *l ) sfree(l->error_ptr, l->index, "list:index" ); sfree(l->error_ptr, l->end_index, "list:end_index" ); - l->index = NULL; - l->end_index = NULL; + l->index = nullptr; + l->end_index = nullptr; switch(l->type) { case TYP_VOID: sfree(l->error_ptr, l->select.v, "list:v" ); - l->select.v = NULL; + l->select.v = nullptr; break; case TYP_HBOND: sfree(l->error_ptr, l->select.hbond_list, "list:hbonds" ); - l->select.hbond_list = NULL; + l->select.hbond_list = nullptr; break; case TYP_FAR_NEIGHBOR: sfree(l->error_ptr, l->select.far_nbr_list, "list:far_nbrs" ); - l->select.far_nbr_list = NULL; + l->select.far_nbr_list = nullptr; break; case TYP_BOND: sfree(l->error_ptr, l->select.bond_list, "list:bonds" ); - l->select.bond_list = NULL; + l->select.bond_list = nullptr; break; case TYP_DBO: sfree(l->error_ptr, l->select.dbo_list, "list:dbos" ); - l->select.dbo_list = NULL; + l->select.dbo_list = nullptr; break; case TYP_DDELTA: sfree(l->error_ptr, l->select.dDelta_list, "list:dDeltas" ); - l->select.dDelta_list = NULL; + l->select.dDelta_list = nullptr; break; case TYP_THREE_BODY: sfree(l->error_ptr, l->select.three_body_list, "list:three_bodies" ); - l->select.three_body_list = NULL; + l->select.three_body_list = nullptr; break; default: diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index 07a45b946..b78b00568 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -48,7 +48,7 @@ double Get_Time( ) t /= 1000.0; return t; #else - gettimeofday(&tim, NULL ); + gettimeofday(&tim, nullptr ); return( tim.tv_sec + (tim.tv_usec / 1000000.0) ); #endif } @@ -62,7 +62,7 @@ int Tokenize( char* s, char*** tok ) strncpy( test, s, MAX_LINE-1); - for( word = strtok(test, sep); word; word = strtok(NULL, sep) ) { + for( word = strtok(test, sep); word; word = strtok(nullptr, sep) ) { strncpy( (*tok)[count], word, MAX_LINE ); count++; } @@ -84,11 +84,11 @@ void *smalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, const char *name ) if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = malloc( n ); - if (ptr == NULL) { + if (ptr == nullptr) { snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n, name); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); @@ -109,7 +109,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL.\n", n, name ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } if (size <= 0) { @@ -117,11 +117,11 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL", name, size ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = calloc( n, size ); - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n*size, name); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -135,7 +135,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c /* safe free */ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) { - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Trying to free the already NULL pointer %s", name ); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -144,6 +144,6 @@ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) } free( ptr ); - ptr = NULL; + ptr = nullptr; } diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 717bf741e..698715de2 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -41,7 +41,7 @@ int Reallocate_Output_Buffer( LAMMPS_NS::Error *error_ptr, output_controls *out_ out_control->buffer_len = (int)(req_space*REAX_SAFE_ZONE); out_control->buffer = (char*) malloc(out_control->buffer_len*sizeof(char)); - if (out_control->buffer == NULL) { + if (out_control->buffer == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Insufficient memory for required buffer size %d", (int) (req_space*REAX_SAFE_ZONE)); error_ptr->one(FLERR,errmsg); @@ -341,7 +341,7 @@ int Init_Traj( reax_system *system, control_params *control, /* allocate line & buffer space */ out_control->line = (char*) calloc( MAX_TRJ_LINE_LEN + 1, sizeof(char) ); out_control->buffer_len = 0; - out_control->buffer = NULL; + out_control->buffer = nullptr; /* write trajectory header and atom info, if applicable */ if (out_control->traj_method == REG_TRAJ) { diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index c49f99a5a..4dd796a34 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -42,10 +42,10 @@ Scafacos::Scafacos(LAMMPS *lmp) : KSpace(lmp) initialized = 0; maxatom = 0; - xpbc = NULL; - epot = NULL; - efield = NULL; - fcs = NULL; + xpbc = nullptr; + epot = nullptr; + efield = nullptr; + fcs = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index c39d142a6..45843268f 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -43,9 +43,9 @@ enum{EQUAL,ATOM}; FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), - vxvarstr(NULL), vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), displace(NULL), velocity(NULL) { + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), + vxvarstr(nullptr), vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), displace(nullptr), velocity(nullptr) { if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all(FLERR, "fix meso/move command requires atom_style with both energy and density"); @@ -126,37 +126,37 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (narg < 10) error->all(FLERR,"Illegal fix meso/move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -237,7 +237,7 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : atom->add_callback(0); atom->add_callback(1); - displace = velocity = NULL; + displace = velocity = nullptr; // xoriginal = initial unwrapped positions of atoms @@ -353,9 +353,9 @@ void FixMesoMove::init () { memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; } void FixMesoMove::setup_pre_force (int /*vflag*/) { @@ -731,7 +731,7 @@ void FixMesoMove::initial_integrate (int /*vflag*/) { } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMesoMove::final_integrate () { diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp index bf2fc73b0..b3a084ab1 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp @@ -307,7 +307,7 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) { void PairSDPDTaitwaterIsothermal::init_style() { - if ((!atom->rho_flag) || (atom->drho == NULL)) + if ((!atom->rho_flag) || (atom->drho == nullptr)) error->all(FLERR,"Pair style dpd/taitwater/isothermal requires atom " "attributes rho and drho"); diff --git a/src/USER-SMD/compute_smd_contact_radius.cpp b/src/USER-SMD/compute_smd_contact_radius.cpp index 46cbc602f..ccab79f85 100644 --- a/src/USER-SMD/compute_smd_contact_radius.cpp +++ b/src/USER-SMD/compute_smd_contact_radius.cpp @@ -46,7 +46,7 @@ ComputeSMDContactRadius::ComputeSMDContactRadius(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - contact_radius_vector = NULL; + contact_radius_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_damage.cpp b/src/USER-SMD/compute_smd_damage.cpp index 96a936cd8..9e58903c9 100644 --- a/src/USER-SMD/compute_smd_damage.cpp +++ b/src/USER-SMD/compute_smd_damage.cpp @@ -46,7 +46,7 @@ ComputeSMDDamage::ComputeSMDDamage(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - damage_vector = NULL; + damage_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_hourglass_error.cpp b/src/USER-SMD/compute_smd_hourglass_error.cpp index 3b6b90000..411802503 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.cpp +++ b/src/USER-SMD/compute_smd_hourglass_error.cpp @@ -49,7 +49,7 @@ ComputeSMDHourglassError::ComputeSMDHourglassError(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - hourglass_error_vector = NULL; + hourglass_error_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ void ComputeSMDHourglassError::compute_peratom() { int itmp = 0; double *hourglass_error = (double *) force->pair->extract("smd/tlsph/hourglass_error_ptr", itmp); - if (hourglass_error == NULL) { + if (hourglass_error == nullptr) { error->all(FLERR, "compute smd/hourglass_error failed to access hourglass_error array"); } diff --git a/src/USER-SMD/compute_smd_internal_energy.cpp b/src/USER-SMD/compute_smd_internal_energy.cpp index 90ddb7483..c7b11e22c 100644 --- a/src/USER-SMD/compute_smd_internal_energy.cpp +++ b/src/USER-SMD/compute_smd_internal_energy.cpp @@ -46,7 +46,7 @@ ComputeSMDInternalEnergy::ComputeSMDInternalEnergy(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - internal_energy_vector = NULL; + internal_energy_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain.cpp b/src/USER-SMD/compute_smd_plastic_strain.cpp index c1c001a5d..842d84889 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrain::ComputeSMDPlasticStrain(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - plastic_strain_vector = NULL; + plastic_strain_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp index 272a2c59e..907e503f5 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrainRate::ComputeSMDPlasticStrainRate(LAMMPS *lmp, int narg, size_peratom_cols = 0; nmax = 0; - plastic_strain_rate_vector = NULL; + plastic_strain_rate_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_rho.cpp b/src/USER-SMD/compute_smd_rho.cpp index d9c0a99b0..89db0b0ac 100644 --- a/src/USER-SMD/compute_smd_rho.cpp +++ b/src/USER-SMD/compute_smd_rho.cpp @@ -46,7 +46,7 @@ ComputeSMDRho::ComputeSMDRho(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp index 81792355e..b283a41c4 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp @@ -49,7 +49,7 @@ ComputeSMDTLSPHDefgrad::ComputeSMDTLSPHDefgrad(LAMMPS *lmp, int narg, char **arg size_peratom_cols = 10; nmax = 0; - defgradVector = NULL; + defgradVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_dt.cpp b/src/USER-SMD/compute_smd_tlsph_dt.cpp index 7752436b8..a02ff838d 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.cpp +++ b/src/USER-SMD/compute_smd_tlsph_dt.cpp @@ -49,7 +49,7 @@ ComputeSMDTlsphDt::ComputeSMDTlsphDt(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMDTlsphDt::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/tlsph/particle_dt_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/tlsph_dt failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp index 347b13841..f5f14fa50 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDTLSPHNumNeighs::ComputeSMDTLSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsRefConfigOutput = NULL; + numNeighsRefConfigOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDTLSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighsRefConfig = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (numNeighsRefConfig == NULL) { + if (numNeighsRefConfig == nullptr) { error->all(FLERR, "compute smd/tlsph_num_neighs failed to access numNeighsRefConfig array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_shape.cpp b/src/USER-SMD/compute_smd_tlsph_shape.cpp index a3727871d..a978fd2e9 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.cpp +++ b/src/USER-SMD/compute_smd_tlsph_shape.cpp @@ -51,7 +51,7 @@ ComputeSmdTlsphShape::ComputeSmdTlsphShape(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 7; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -89,12 +89,12 @@ void ComputeSmdTlsphShape::compute_peratom() { int itmp = 0; Matrix3d *R = (Matrix3d *) force->pair->extract("smd/tlsph/rotation_ptr", itmp); - if (R == NULL) { + if (R == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access rotation array"); } Matrix3d *F = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (F == NULL) { + if (F == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access deformation gradient array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain.cpp b/src/USER-SMD/compute_smd_tlsph_strain.cpp index db51ca412..5e86f4fd3 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain.cpp @@ -52,7 +52,7 @@ ComputeSMDTLSPHstrain::ComputeSMDTLSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -92,7 +92,7 @@ void ComputeSMDTLSPHstrain::compute_peratom() { // copy data to output array int itmp = 0; Matrix3d *Fincr = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (Fincr == NULL) { + if (Fincr == nullptr) { error->all(FLERR, "compute smd/tlsph_strain failed to access Fincr array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp index 577dc0e40..3d9f46769 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp @@ -52,7 +52,7 @@ ComputeSMDTLSPHStrainRate::ComputeSMDTLSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -89,7 +89,7 @@ void ComputeSMDTLSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *D = (Matrix3d *) force->pair->extract("smd/tlsph/strain_rate_ptr", itmp); - if (D == NULL) { + if (D == nullptr) { error->all(FLERR, "compute smd/tlsph_strain_rate could not access strain rate. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_tlsph_stress.cpp b/src/USER-SMD/compute_smd_tlsph_stress.cpp index 9c78b192c..f668a7f82 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.cpp +++ b/src/USER-SMD/compute_smd_tlsph_stress.cpp @@ -60,7 +60,7 @@ ComputeSMDTLSPHStress::ComputeSMDTLSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDTLSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/tlsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/tlsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_triangle_vertices.cpp b/src/USER-SMD/compute_smd_triangle_vertices.cpp index 06706a85a..46555559d 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.cpp +++ b/src/USER-SMD/compute_smd_triangle_vertices.cpp @@ -46,7 +46,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch size_peratom_cols = 9; nmax = 0; - outputVector = NULL; + outputVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_effm.cpp b/src/USER-SMD/compute_smd_ulsph_effm.cpp index fc8637bbf..4285d1c98 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.cpp +++ b/src/USER-SMD/compute_smd_ulsph_effm.cpp @@ -49,7 +49,7 @@ ComputeSMD_Ulsph_Effm::ComputeSMD_Ulsph_Effm(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMD_Ulsph_Effm::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/ulsph/effective_modulus_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/ulsph_effm failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp index 4ef339db9..57460c292 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDULSPHNumNeighs::ComputeSMDULSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsOutput = NULL; + numNeighsOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDULSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighs = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (numNeighs == NULL) { + if (numNeighs == nullptr) { error->all(FLERR, "compute smd/ulsph_num_neighs failed to access numNeighs array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_strain.cpp b/src/USER-SMD/compute_smd_ulsph_strain.cpp index cf1535759..a4211a6b6 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDULSPHstrain::ComputeSMDULSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp index f5ff4fef9..9118e6dde 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp @@ -49,7 +49,7 @@ ComputeSMDULSPHStrainRate::ComputeSMDULSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ void ComputeSMDULSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->all(FLERR, "compute smd/ulsph_strain_rate could not access any velocity gradients. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_ulsph_stress.cpp b/src/USER-SMD/compute_smd_ulsph_stress.cpp index ea477375c..c7078a574 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.cpp +++ b/src/USER-SMD/compute_smd_ulsph_stress.cpp @@ -59,7 +59,7 @@ ComputeSMDULSPHStress::ComputeSMDULSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDULSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/ulsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/ulsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_vol.cpp b/src/USER-SMD/compute_smd_vol.cpp index 5999dfaa5..46aa7ea3c 100644 --- a/src/USER-SMD/compute_smd_vol.cpp +++ b/src/USER-SMD/compute_smd_vol.cpp @@ -48,7 +48,7 @@ ComputeSMDVol::ComputeSMDVol(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - volVector = NULL; + volVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/fix_smd_adjust_dt.cpp b/src/USER-SMD/fix_smd_adjust_dt.cpp index b5dab3d3a..ccb64b8f2 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.cpp +++ b/src/USER-SMD/fix_smd_adjust_dt.cpp @@ -108,28 +108,28 @@ void FixSMDTlsphDtReset::end_of_step() { double *dt_HERTZ = (double *) force->pair->extract("smd/hertz/stable_time_increment_ptr", itmp); double *dt_PERI_IPMB = (double *) force->pair->extract("smd/peri_ipmb/stable_time_increment_ptr", itmp); - if ((dtCFL_TLSPH == NULL) && (dtCFL_ULSPH == NULL) && (dt_TRI == NULL) && (dt_HERTZ == NULL) - && (dt_PERI_IPMB == NULL)) { + if ((dtCFL_TLSPH == nullptr) && (dtCFL_ULSPH == nullptr) && (dt_TRI == nullptr) && (dt_HERTZ == nullptr) + && (dt_PERI_IPMB == nullptr)) { error->all(FLERR, "fix smd/adjust_dt failed to access a valid dtCFL"); } - if (dtCFL_TLSPH != NULL) { + if (dtCFL_TLSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_TLSPH); } - if (dtCFL_ULSPH != NULL) { + if (dtCFL_ULSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_ULSPH); } - if (dt_TRI != NULL) { + if (dt_TRI != nullptr) { dtmin = MIN(dtmin, *dt_TRI); } - if (dt_HERTZ != NULL) { + if (dt_HERTZ != nullptr) { dtmin = MIN(dtmin, *dt_HERTZ); } - if (dt_PERI_IPMB != NULL) { + if (dt_PERI_IPMB != nullptr) { dtmin = MIN(dtmin, *dt_PERI_IPMB); } diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index 7d5e89f89..743cd09f0 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -139,7 +139,7 @@ void FixSMDIntegrateTlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVelDifference = (Vector3d *) force->pair->extract("smd/tlsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVelDifference == NULL) { + if (smoothVelDifference == nullptr) { error->one(FLERR, "fix smd/integrate_tlsph failed to access smoothVel array. Check if a pair style exist which calculates this quantity."); } diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 215759331..c261537df 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -171,7 +171,7 @@ void FixSMDIntegrateUlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVel = (Vector3d *) force->pair->extract("smd/ulsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVel == NULL) { + if (smoothVel == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to access smoothVel array"); } } @@ -259,12 +259,12 @@ void FixSMDIntegrateUlsph::final_integrate() { int itmp; int *nn = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss num_neighs array"); } Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss velocityGradient array"); } diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index d3e71f0e5..330199927 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -57,7 +57,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3], "v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -93,7 +93,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -241,7 +241,7 @@ void FixSMDSetVel::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 3e63de08f..f0b405f94 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -59,12 +59,12 @@ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); maxpartner = 1; - npartner = NULL; - partner = NULL; - wfd_list = NULL; - wf_list = NULL; - energy_per_bond = NULL; - degradation_ij = NULL; + npartner = nullptr; + partner = nullptr; + wfd_list = nullptr; + wf_list = nullptr; + energy_per_bond = nullptr; + degradation_ij = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); @@ -130,13 +130,13 @@ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { } int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); - if (updateFlag_ptr == NULL) { + if (updateFlag_ptr == nullptr) { error->one(FLERR, "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); } int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); } @@ -468,7 +468,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*nth*/) { -// ipage = NULL if being called from granular pair style init() +// ipage = nullptr if being called from granular pair style init() // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 10f248c39..26190a5a9 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -69,7 +69,7 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : FixSMDWallSurface::~FixSMDWallSurface() { free(filename); - filename = NULL; + filename = nullptr; // unregister this fix so atom class doesn't invoke it any more //atom->delete_callback(id, 0); @@ -198,12 +198,12 @@ int FixSMDWallSurface::count_words(const char *line) { if ((ptr = strchr(copy, '#'))) *ptr = '\0'; - if (strtok(copy, " \t\n\r\f") == NULL) { + if (strtok(copy, " \t\n\r\f") == nullptr) { memory->destroy(copy); return 0; } n = 1; - while (strtok(NULL, " \t\n\r\f")) + while (strtok(nullptr, " \t\n\r\f")) n++; memory->destroy(copy); @@ -229,7 +229,7 @@ void FixSMDWallSurface::read_triangles(int pass) { Vector3d normal, center; FILE *fp = fopen(filename, "r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128, "Cannot open file %s", filename); error->one(FLERR, str); @@ -261,7 +261,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read STL solid name retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading number of triangle pairs"); } @@ -272,11 +272,11 @@ void FixSMDWallSurface::read_triangles(int pass) { // values = new char*[nwords]; // values[0] = strtok(line, " \t\n\r\f"); -// if (values[0] == NULL) +// if (values[0] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // for (m = 1; m < nwords; m++) { -// values[m] = strtok(NULL, " \t\n\r\f"); -// if (values[m] == NULL) +// values[m] = strtok(nullptr, " \t\n\r\f"); +// if (values[m] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // } // delete[] values; @@ -301,11 +301,11 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); } @@ -318,7 +318,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read outer loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading outer loop"); } @@ -331,7 +331,7 @@ void FixSMDWallSurface::read_triangles(int pass) { for (int k = 0; k < 3; k++) { retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading vertex line"); } @@ -342,11 +342,11 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect vertex line"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect vertex line"); } @@ -362,7 +362,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading endloop"); } @@ -373,7 +373,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end facet line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading endfacet"); } diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index 8d3c06d5e..c966f5ba7 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -51,9 +51,9 @@ using namespace LAMMPS_NS; PairHertz::PairHertz(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -374,6 +374,6 @@ void *PairHertz::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index 25301685a..3c8711955 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -63,28 +63,28 @@ using namespace SMD_Math; PairTlsph::PairTlsph(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; - failureModel = NULL; - strengthModel = eos = NULL; + failureModel = nullptr; + strengthModel = eos = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - Fdot = Fincr = K = PK1 = NULL; - R = FincrInv = W = D = NULL; - detF = NULL; - smoothVelDifference = NULL; - numNeighsRefConfig = NULL; - CauchyStress = NULL; - hourglass_error = NULL; - Lookup = NULL; - particle_dt = NULL; + Fdot = Fincr = K = PK1 = nullptr; + R = FincrInv = W = D = nullptr; + detF = nullptr; + smoothVelDifference = nullptr; + numNeighsRefConfig = nullptr; + CauchyStress = nullptr; + hourglass_error = nullptr; + Lookup = nullptr; + particle_dt = nullptr; updateFlag = 0; first = true; dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight - fix_tlsph_reference_configuration = NULL; + fix_tlsph_reference_configuration = nullptr; cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. } @@ -1748,7 +1748,7 @@ void PairTlsph::init_style() { if (igroup == -1) error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); - if (fix_tlsph_reference_configuration == NULL) { + if (fix_tlsph_reference_configuration == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; fixarg[1] = (char *) "tlsph"; @@ -1824,7 +1824,7 @@ void *PairTlsph::extract(const char *str, int &/*i*/) { return (void *) R; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index 8ccba562e..6e702ef82 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -54,9 +54,9 @@ using namespace Eigen; PairTriSurf::PairTriSurf(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -833,6 +833,6 @@ void *PairTriSurf::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index 3a6cdf5d2..bbb8cf372 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -56,22 +56,22 @@ PairULSPH::PairULSPH(LAMMPS *lmp) : Pair(lmp) { // per-type arrays - Q1 = NULL; - eos = viscosity = strength = NULL; - c0_type = NULL; - c0 = NULL; - Lookup = NULL; - artificial_stress = NULL; - artificial_pressure = NULL; + Q1 = nullptr; + eos = viscosity = strength = nullptr; + c0_type = nullptr; + c0 = nullptr; + Lookup = nullptr; + artificial_stress = nullptr; + artificial_pressure = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - stressTensor = L = K = NULL; - shepardWeight = NULL; - smoothVel = NULL; - numNeighs = NULL; - F = NULL; - rho = NULL; - effm = NULL; + stressTensor = L = K = nullptr; + shepardWeight = nullptr; + smoothVel = nullptr; + numNeighs = nullptr; + F = nullptr; + rho = nullptr; + effm = nullptr; velocity_gradient_required = false; // turn off computation of velocity gradient by default density_summation = velocity_gradient = false; @@ -1575,7 +1575,7 @@ void *PairULSPH::extract(const char *str, int &/*i*/) { return (void *) K; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 875d254ac..a40f676ff 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -101,50 +101,50 @@ PairSMTBQ::PairSMTBQ(LAMMPS *lmp) : Pair(lmp) kmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - intparams = NULL; - - intype = NULL; - coultype = NULL; - fafb = NULL; - dfafb = NULL; - potqn = NULL; - dpotqn = NULL; + params = nullptr; + intparams = nullptr; + + intype = nullptr; + coultype = nullptr; + fafb = nullptr; + dfafb = nullptr; + potqn = nullptr; + dpotqn = nullptr; Vself = 0.0; - tabsmb = NULL; - tabsmr = NULL; - dtabsmb = NULL; - dtabsmr = NULL; - - sbcov = NULL; - coord = NULL; - sbmet = NULL; - ecov = NULL; - - potmad = NULL; - potself = NULL; - potcov = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; - tab_comm = NULL; - - nvsm = NULL; - vsm = NULL; - flag_QEq = NULL; - nQEqaall = NULL; - nQEqcall = NULL; - nQEqall = NULL; + tabsmb = nullptr; + tabsmr = nullptr; + dtabsmb = nullptr; + dtabsmr = nullptr; + + sbcov = nullptr; + coord = nullptr; + sbmet = nullptr; + ecov = nullptr; + + potmad = nullptr; + potself = nullptr; + potcov = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; + tab_comm = nullptr; + + nvsm = nullptr; + vsm = nullptr; + flag_QEq = nullptr; + nQEqaall = nullptr; + nQEqcall = nullptr; + nQEqall = nullptr; nteam = 0; cluster = 0; Nevery = 0.0; Neverypot = 0.0; - fct = NULL; + fct = nullptr; maxpage = 0; @@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -286,7 +286,7 @@ void PairSMTBQ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -392,9 +392,9 @@ void PairSMTBQ::read_file(char *file) char **words; memory->sfree(params); - params = NULL; + params = nullptr; memory->sfree(intparams); - intparams = NULL; + intparams = nullptr; nparams = 0; maxparam = 0; maxintparam = 0; @@ -411,7 +411,7 @@ void PairSMTBQ::read_file(char *file) // open file on all processors FILE *fp; fp = utils::open_potential(file,lmp,nullptr); - if ( fp == NULL ) { + if ( fp == nullptr ) { char str[128]; snprintf(str,128,"Cannot open SMTBQ potential file %s",file); error->one(FLERR,str); @@ -3562,12 +3562,12 @@ int PairSMTBQ::Tokenize( char* s, char*** tok ) const char *sep = "' "; char *mot; int count=0; - mot = NULL; + mot = nullptr; strncpy( test, s, MAXLINE-1 ); - for( mot = strtok(test, sep); mot; mot = strtok(NULL, sep) ) { + for( mot = strtok(test, sep); mot; mot = strtok(nullptr, sep) ) { strncpy( (*tok)[count], mot, MAXLINE ); count++; } diff --git a/src/USER-SPH/compute_sph_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp index 8869dae5f..d8142fd79 100644 --- a/src/USER-SPH/compute_sph_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHEAtom::ComputeSPHEAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - evector = NULL; + evector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp index 1d6d03811..edc788a1a 100644 --- a/src/USER-SPH/compute_sph_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -35,7 +35,7 @@ ComputeSPHRhoAtom::ComputeSPHRhoAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp index 063af7002..253e63748 100644 --- a/src/USER-SPH/compute_sph_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHTAtom::ComputeSPHTAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - tvector = NULL; + tvector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-TALLY/compute_force_tally.cpp b/src/USER-TALLY/compute_force_tally.cpp index d010b004d..a5ad46e77 100644 --- a/src/USER-TALLY/compute_force_tally.cpp +++ b/src/USER-TALLY/compute_force_tally.cpp @@ -49,7 +49,7 @@ ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - fatom = NULL; + fatom = nullptr; vector = new double[size_peratom_cols]; } @@ -66,7 +66,7 @@ ComputeForceTally::~ComputeForceTally() void ComputeForceTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute force/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_heat_flux_tally.cpp b/src/USER-TALLY/compute_heat_flux_tally.cpp index 1a2dd3628..f57899c59 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.cpp +++ b/src/USER-TALLY/compute_heat_flux_tally.cpp @@ -48,8 +48,8 @@ ComputeHeatFluxTally::ComputeHeatFluxTally(LAMMPS *lmp, int narg, char **arg) : did_setup = 0; invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; - eatom = NULL; + stress = nullptr; + eatom = nullptr; vector = new double[size_vector]; heatj = new double[size_vector]; } @@ -69,7 +69,7 @@ ComputeHeatFluxTally::~ComputeHeatFluxTally() void ComputeHeatFluxTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute heat/flux/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_mol_tally.cpp b/src/USER-TALLY/compute_pe_mol_tally.cpp index 835d1e80b..77bf7973d 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.cpp +++ b/src/USER-TALLY/compute_pe_mol_tally.cpp @@ -59,7 +59,7 @@ ComputePEMolTally::~ComputePEMolTally() void ComputePEMolTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/mol/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_tally.cpp b/src/USER-TALLY/compute_pe_tally.cpp index ef7c13fed..e330b56a8 100644 --- a/src/USER-TALLY/compute_pe_tally.cpp +++ b/src/USER-TALLY/compute_pe_tally.cpp @@ -48,7 +48,7 @@ ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - eatom = NULL; + eatom = nullptr; vector = new double[size_peratom_cols]; } @@ -65,7 +65,7 @@ ComputePETally::~ComputePETally() void ComputePETally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/tally without a pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_stress_tally.cpp b/src/USER-TALLY/compute_stress_tally.cpp index 2a0cbc8e4..58d42cd93 100644 --- a/src/USER-TALLY/compute_stress_tally.cpp +++ b/src/USER-TALLY/compute_stress_tally.cpp @@ -49,7 +49,7 @@ ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; + stress = nullptr; vector = new double[size_peratom_cols]; virial = new double[size_peratom_cols]; } @@ -68,7 +68,7 @@ ComputeStressTally::~ComputeStressTally() void ComputeStressTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute stress/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-UEF/fix_nh_uef.cpp b/src/USER-UEF/fix_nh_uef.cpp index f910caac5..e83350295 100644 --- a/src/USER-UEF/fix_nh_uef.cpp +++ b/src/USER-UEF/fix_nh_uef.cpp @@ -57,7 +57,7 @@ static const char cite_user_uef_package[] = * temp/pressure fixes ---------------------------------------------------------------------- */ FixNHUef::FixNHUef(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), uefbox(NULL) + FixNH(lmp, narg, arg), uefbox(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_uef_package); diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 59dba0d90..cb468fc3d 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -128,11 +128,11 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : if (filewriter) reset_vtk_data_containers(); - label = NULL; + label = nullptr; { // parallel vtp/vtu requires proc number to be preceded by underscore '_' - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { multiname_ex = new char[strlen(filename) + 16]; @@ -160,12 +160,12 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : nclusterprocs = nprocs; } - filecurrent = NULL; - domainfilecurrent = NULL; - parallelfilecurrent = NULL; - header_choice = NULL; - write_choice = NULL; - boxcorners = NULL; + filecurrent = nullptr; + domainfilecurrent = nullptr; + parallelfilecurrent = nullptr; + header_choice = nullptr; + write_choice = nullptr; + boxcorners = nullptr; } /* ---------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ void DumpVTK::init_style() { // default for element names = C - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[2]; @@ -880,7 +880,7 @@ void DumpVTK::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // filewriter = 1 = this proc writes to file @@ -939,13 +939,13 @@ void DumpVTK::write_data(int n, double *mybuf) void DumpVTK::setFileCurrent() { delete [] filecurrent; - filecurrent = NULL; + filecurrent = nullptr; char *filestar = filename; if (multiproc) { if (multiproc > 1) { // if dump_modify fileper or nfile was used delete [] multiname_ex; - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { int id; @@ -983,7 +983,7 @@ void DumpVTK::setFileCurrent() { // filename of domain box data file delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multiproc) { // remove '%' character char *ptr = strchr(filename,'%'); @@ -997,7 +997,7 @@ void DumpVTK::setFileCurrent() { *ptr = '\0'; sprintf(filestar,"%s_boundingBox.%s",domainfilecurrent,ptr+1); delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multifile == 0) { domainfilecurrent = new char[strlen(filestar) + 1]; @@ -1018,7 +1018,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } else { domainfilecurrent = new char[strlen(filecurrent) + 16]; char *ptr = strrchr(filecurrent,'.'); @@ -1030,7 +1030,7 @@ void DumpVTK::setFileCurrent() { // filename of parallel file if (multiproc && me == 0) { delete [] parallelfilecurrent; - parallelfilecurrent = NULL; + parallelfilecurrent = nullptr; // remove '%' character and add 'p' to file extension // -> string length stays the same @@ -1066,7 +1066,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } } @@ -1995,7 +1995,7 @@ int DumpVTK::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -2075,7 +2075,7 @@ int DumpVTK::modify_param(int narg, char **arg) if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; @@ -2094,9 +2094,9 @@ int DumpVTK::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; } nthresh = 0; return 2; diff --git a/src/USER-YAFF/angle_cross.cpp b/src/USER-YAFF/angle_cross.cpp index c45af1d19..69dac7f58 100644 --- a/src/USER-YAFF/angle_cross.cpp +++ b/src/USER-YAFF/angle_cross.cpp @@ -279,12 +279,12 @@ void AngleCross::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&kss[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/angle_mm3.cpp b/src/USER-YAFF/angle_mm3.cpp index 34de77267..d165a2d17 100644 --- a/src/USER-YAFF/angle_mm3.cpp +++ b/src/USER-YAFF/angle_mm3.cpp @@ -226,8 +226,8 @@ void AngleMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/bond_mm3.cpp b/src/USER-YAFF/bond_mm3.cpp index f5d5fed94..2c310c631 100644 --- a/src/USER-YAFF/bond_mm3.cpp +++ b/src/USER-YAFF/bond_mm3.cpp @@ -179,8 +179,8 @@ void BondMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_distharm.cpp b/src/USER-YAFF/improper_distharm.cpp index 37039b27e..757695c3c 100644 --- a/src/USER-YAFF/improper_distharm.cpp +++ b/src/USER-YAFF/improper_distharm.cpp @@ -257,8 +257,8 @@ void ImproperDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_sqdistharm.cpp b/src/USER-YAFF/improper_sqdistharm.cpp index ddc4d78c9..79245d341 100644 --- a/src/USER-YAFF/improper_sqdistharm.cpp +++ b/src/USER-YAFF/improper_sqdistharm.cpp @@ -257,8 +257,8 @@ void ImproperSQDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index 98fd31779..5508ffbfd 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -51,7 +51,7 @@ PairLJSwitch3CoulGaussLong::PairLJSwitch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -358,11 +358,11 @@ void PairLJSwitch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairLJSwitch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairLJSwitch3CoulGaussLong::write_restart_settings(FILE *fp) void PairLJSwitch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairLJSwitch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index e1ee0e0b9..d63f42cf3 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -51,7 +51,7 @@ PairMM3Switch3CoulGaussLong::PairMM3Switch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -360,11 +360,11 @@ void PairMM3Switch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairMM3Switch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairMM3Switch3CoulGaussLong::write_restart_settings(FILE *fp) void PairMM3Switch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairMM3Switch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index be77b8457..aa8488e86 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -41,10 +41,10 @@ using namespace voro; /* ---------------------------------------------------------------------- */ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), con_mono(NULL), con_poly(NULL), - radstr(NULL), voro(NULL), edge(NULL), sendvector(NULL), - rfield(NULL), tags(NULL), occvec(NULL), sendocc(NULL), - lroot(NULL), lnext(NULL), faces(NULL) + Compute(lmp, narg, arg), con_mono(nullptr), con_poly(nullptr), + radstr(nullptr), voro(nullptr), edge(nullptr), sendvector(nullptr), + rfield(nullptr), tags(nullptr), occvec(nullptr), sendocc(nullptr), + lroot(nullptr), lnext(nullptr), faces(nullptr) { int sgroup; @@ -56,16 +56,16 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : surface = VOROSURF_NONE; maxedge = 0; fthresh = ethresh = 0.0; - radstr = NULL; + radstr = nullptr; onlyGroup = false; occupation = false; - con_mono = NULL; - con_poly = NULL; - tags = NULL; + con_mono = nullptr; + con_poly = nullptr; + tags = nullptr; oldmaxtag = 0; - occvec = sendocc = lroot = lnext = NULL; - faces = NULL; + occvec = sendocc = lroot = lnext = nullptr; + faces = nullptr; int iarg = 3; while ( iargall(FLERR,"Compute voronoi/atom occupation requires an atom map, see atom_modify"); nmax = rmax = 0; - edge = rfield = sendvector = NULL; - voro = NULL; + edge = rfield = sendvector = nullptr; + voro = nullptr; if ( maxedge > 0 ) { vector_flag = 1; @@ -207,7 +207,7 @@ void ComputeVoronoi::compute_peratom() if (occupation) { // build cells only once int i, nall = atom->nlocal + atom->nghost; - if (con_mono==NULL && con_poly==NULL) { + if (con_mono==nullptr && con_poly==nullptr) { // generate the voronoi cell network for the initial structure buildCells(); @@ -218,7 +218,7 @@ void ComputeVoronoi::compute_peratom() // linked list structure for cell occupation count on the atoms oldnall= nall; memory->create(lroot,nall,"voronoi/atom:lroot"); // point to first atom index in cell (or -1 for empty cell) - lnext = NULL; + lnext = nullptr; lmax = 0; // build the occupation buffer. diff --git a/src/angle.cpp b/src/angle.cpp index 2796ae01b..4eedd7c69 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -36,10 +36,10 @@ Angle::Angle(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 56590d675..70779aa7b 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -174,7 +174,7 @@ void AngleHybrid::allocate() maxangle = new int[nstyles]; anglelist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxangle[m] = 0; - for (int m = 0; m < nstyles; m++) anglelist[m] = NULL; + for (int m = 0; m < nstyles; m++) anglelist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -358,7 +358,7 @@ void AngleHybrid::write_restart(FILE *fp) void AngleHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Angle*[nstyles]; keywords = new char*[nstyles]; @@ -367,10 +367,10 @@ void AngleHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_angle(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index e087b774e..9d8255e84 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -128,7 +128,7 @@ void AngleZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/atom.cpp b/src/atom.cpp index 49ff26276..a58e1e318 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -83,113 +83,113 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; nbonds = nangles = ndihedrals = nimpropers = 0; - firstgroupname = NULL; + firstgroupname = nullptr; sortfreq = 1000; nextsort = 0; userbinsize = 0.0; maxbin = maxnext = 0; - binhead = NULL; - next = permute = NULL; + binhead = nullptr; + next = permute = nullptr; // data structure with info on per-atom vectors/arrays nperatom = maxperatom = 0; - peratom = NULL; + peratom = nullptr; // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variables - tag = NULL; - type = mask = NULL; - image = NULL; - x = v = f = NULL; + tag = nullptr; + type = mask = nullptr; + image = nullptr; + x = v = f = nullptr; // charged and dipolar particles - q = NULL; - mu = NULL; + q = nullptr; + mu = nullptr; // finite-size particles - omega = angmom = torque = NULL; - radius = rmass = NULL; - ellipsoid = line = tri = body = NULL; + omega = angmom = torque = nullptr; + radius = rmass = nullptr; + ellipsoid = line = tri = body = nullptr; // molecular systems - molecule = NULL; - molindex = molatom = NULL; + molecule = nullptr; + molindex = molatom = nullptr; bond_per_atom = extra_bond_per_atom = 0; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; angle_per_atom = extra_angle_per_atom = 0; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; dihedral_per_atom = extra_dihedral_per_atom = 0; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; improper_per_atom = extra_improper_per_atom = 0; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; maxspecial = 1; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; // PERI package - vfrac = s0 = NULL; - x0 = NULL; + vfrac = s0 = nullptr; + x0 = nullptr; // SPIN package - sp = fm = fm_long = NULL; + sp = fm = fm_long = nullptr; // USER-EFF and USER-AWPMD packages - spin = NULL; - eradius = ervel = erforce = NULL; - ervelforce = NULL; - cs = csforce = vforce = NULL; - etag = NULL; + spin = nullptr; + eradius = ervel = erforce = nullptr; + ervelforce = nullptr; + cs = csforce = vforce = nullptr; + etag = nullptr; // USER-DPD package - uCond = uMech = uChem = uCG = uCGnew = NULL; - duChem = dpdTheta = NULL; + uCond = uMech = uChem = uCG = uCGnew = nullptr; + duChem = dpdTheta = nullptr; // USER-MESO package - cc = cc_flux = NULL; - edpd_temp = edpd_flux = edpd_cv = NULL; + cc = cc_flux = nullptr; + edpd_temp = edpd_flux = edpd_cv = nullptr; // USER-MESONT package - length = NULL; - buckling = NULL; - bond_nt = NULL; + length = nullptr; + buckling = nullptr; + bond_nt = nullptr; // USER-SMD package - contact_radius = NULL; - smd_data_9 = NULL; - smd_stress = NULL; - eff_plastic_strain = NULL; - eff_plastic_strain_rate = NULL; - damage = NULL; + contact_radius = nullptr; + smd_data_9 = nullptr; + smd_stress = nullptr; + eff_plastic_strain = nullptr; + eff_plastic_strain_rate = nullptr; + damage = nullptr; // USER-SPH package - rho = drho = esph = desph = cv = NULL; - vest = NULL; + rho = drho = esph = desph = cv = nullptr; + vest = nullptr; // end of customization section // -------------------------------------------------------------------- @@ -197,14 +197,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // user-defined molecules nmolecule = 0; - molecules = NULL; + molecules = nullptr; // custom atom arrays nivector = ndvector = 0; - ivector = NULL; - dvector = NULL; - iname = dname = NULL; + ivector = nullptr; + dvector = nullptr; + iname = dname = nullptr; // initialize atom style and array existence flags @@ -216,16 +216,16 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // ntype-length arrays - mass = NULL; - mass_setflag = NULL; + mass = nullptr; + mass_setflag = nullptr; // callback lists & extra restart info nextra_grow = nextra_restart = nextra_border = 0; - extra_grow = extra_restart = extra_border = NULL; + extra_grow = extra_restart = extra_border = nullptr; nextra_grow_max = nextra_restart_max = nextra_border_max = 0; nextra_store = 0; - extra = NULL; + extra = nullptr; // default atom ID and mapping values @@ -235,15 +235,15 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) map_maxarray = map_nhash = map_nbucket = -1; max_same = 0; - sametag = NULL; - map_array = NULL; - map_bucket = NULL; - map_hash = NULL; + sametag = nullptr; + map_array = nullptr; + map_bucket = nullptr; + map_hash = nullptr; unique_tags = nullptr; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; avec_map = new AtomVecCreatorMap(); @@ -288,7 +288,7 @@ Atom::~Atom() delete [] iname[i]; memory->destroy(ivector[i]); } - if (dvector != NULL) { + if (dvector != nullptr) { for (int i = 0; i < ndvector; i++) { delete [] dname[i]; memory->destroy(dvector[i]); @@ -352,7 +352,7 @@ void Atom::peratom_create() delete [] peratom[i].name; memory->sfree(peratom); - peratom = NULL; + peratom = nullptr; nperatom = maxperatom = 0; // -------------------------------------------------------------------- @@ -533,7 +533,7 @@ void Atom::add_peratom(const char *name, void *address, peratom[nperatom].datatype = datatype; peratom[nperatom].cols = cols; peratom[nperatom].threadflag = threadflag; - peratom[nperatom].address_length = NULL; + peratom[nperatom].address_length = nullptr; nperatom++; } @@ -629,8 +629,8 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu { delete [] atom_style; if (avec) delete avec; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; // unset atom style and array existence flags // may have been set by old avec @@ -702,7 +702,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag) } error->all(FLERR,utils::check_packages_for_style("atom",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -723,7 +723,7 @@ void Atom::init() if (nextra_store) { memory->destroy(extra); - extra = NULL; + extra = nullptr; nextra_store = 0; } @@ -756,7 +756,7 @@ void Atom::setup() /* ---------------------------------------------------------------------- return ptr to AtomVec class if matches style or to matching hybrid sub-class - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ AtomVec *Atom::style_match(const char *style) @@ -768,7 +768,7 @@ AtomVec *Atom::style_match(const char *style) if (strcmp(avec_hybrid->keywords[i],style) == 0) return avec_hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -807,7 +807,7 @@ void Atom::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command"); if (strcmp(arg[iarg+1],"all") == 0) { delete [] firstgroupname; - firstgroupname = NULL; + firstgroupname = nullptr; } else { int n = strlen(arg[iarg+1]) + 1; firstgroupname = new char[n]; @@ -983,33 +983,33 @@ void Atom::deallocate_topology() { memory->destroy(atom->bond_type); memory->destroy(atom->bond_atom); - atom->bond_type = NULL; - atom->bond_atom = NULL; + atom->bond_type = nullptr; + atom->bond_atom = nullptr; memory->destroy(atom->angle_type); memory->destroy(atom->angle_atom1); memory->destroy(atom->angle_atom2); memory->destroy(atom->angle_atom3); - atom->angle_type = NULL; - atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL; + atom->angle_type = nullptr; + atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = nullptr; memory->destroy(atom->dihedral_type); memory->destroy(atom->dihedral_atom1); memory->destroy(atom->dihedral_atom2); memory->destroy(atom->dihedral_atom3); memory->destroy(atom->dihedral_atom4); - atom->dihedral_type = NULL; + atom->dihedral_type = nullptr; atom->dihedral_atom1 = atom->dihedral_atom2 = - atom->dihedral_atom3 = atom->dihedral_atom4 = NULL; + atom->dihedral_atom3 = atom->dihedral_atom4 = nullptr; memory->destroy(atom->improper_type); memory->destroy(atom->improper_atom1); memory->destroy(atom->improper_atom2); memory->destroy(atom->improper_atom3); memory->destroy(atom->improper_atom4); - atom->improper_type = NULL; + atom->improper_type = nullptr; atom->improper_atom1 = atom->improper_atom2 = - atom->improper_atom3 = atom->improper_atom4 = NULL; + atom->improper_atom3 = atom->improper_atom4 = nullptr; } /* ---------------------------------------------------------------------- @@ -1108,11 +1108,11 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL," \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr," \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); } @@ -1195,7 +1195,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1210,7 +1210,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) /* ---------------------------------------------------------------------- process N bonds read into buf from data files - if count is non-NULL, just count bonds per atom + if count is non-nullptr, just count bonds per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1265,7 +1265,7 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N angles read into buf from data files - if count is non-NULL, just count angles per atom + if count is non-nullptr, just count angles per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1337,7 +1337,7 @@ void Atom::data_angles(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N dihedrals read into buf from data files - if count is non-NULL, just count diihedrals per atom + if count is non-nullptr, just count diihedrals per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1428,7 +1428,7 @@ void Atom::data_dihedrals(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N impropers read into buf from data files - if count is non-NULL, just count impropers per atom + if count is non-nullptr, just count impropers per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1547,7 +1547,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1577,8 +1577,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) int maxint = 0; int maxdouble = 0; - int *ivalues = NULL; - double *dvalues = NULL; + int *ivalues = nullptr; + double *dvalues = nullptr; if (!unique_tags) unique_tags = new std::set; @@ -1588,7 +1588,7 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) for (int i = 0; i < n; i++) { if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset; - else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset; + else tagdata = ATOTAGINT(strtok(nullptr," \t\n\r\f")) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) error->one(FLERR,"Invalid atom ID in Bodies section of data file"); @@ -1598,8 +1598,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) else error->one(FLERR,"Duplicate atom ID in Bodies section of data file"); - ninteger = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); - ndouble = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + ninteger = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); + ndouble = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); if ((m = map(tagdata)) >= 0) { if (ninteger > maxint) { @@ -1614,16 +1614,16 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) } for (j = 0; j < ninteger; j++) - ivalues[j] = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + ivalues[j] = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); for (j = 0; j < ndouble; j++) - dvalues[j] = utils::numeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + dvalues[j] = utils::numeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues); } else { nvalues = ninteger + ndouble; // number of values to skip for (j = 0; j < nvalues; j++) - strtok(NULL," \t\n\r\f"); + strtok(nullptr," \t\n\r\f"); } } @@ -1680,7 +1680,7 @@ void Atom::allocate_type_arrays() void Atom::set_mass(const char *file, int line, const char *str, int type_offset) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int itype; double mass_one; @@ -1704,7 +1704,7 @@ void Atom::set_mass(const char *file, int line, const char *str, int type_offset void Atom::set_mass(const char *file, int line, int itype, double value) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); if (itype < 1 || itype > ntypes) error->all(file,line,"Invalid type for mass set"); @@ -1721,7 +1721,7 @@ void Atom::set_mass(const char *file, int line, int itype, double value) void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int lo,hi; utils::bounds(file,line,arg[0],1,ntypes,lo,hi,error); @@ -1754,7 +1754,7 @@ void Atom::set_mass(double *values) void Atom::check_mass(const char *file, int line) { - if (mass == NULL) return; + if (mass == nullptr) return; if (rmass_flag) return; for (int itype = 1; itype <= ntypes; itype++) if (mass_setflag[itype] == 0) @@ -1864,7 +1864,7 @@ void Atom::add_molecule(int narg, char **arg) int Atom::find_molecule(char *id) { - if(id == NULL) return -1; + if(id == nullptr) return -1; int imol; for (imol = 0; imol < nmolecule; imol++) if (strcmp(id,molecules[imol]->id) == 0) return imol; @@ -2201,14 +2201,14 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find NULL ptr: + // if find nullptr ptr: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find NULL ptr: + // if don't find nullptr ptr: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix] == NULL) break; + if (modify->fix[ifix] == nullptr) break; // add callback to lists and sort, reallocating if necessary // sorting is required in cases where fixes were replaced as it ensures atom @@ -2249,7 +2249,7 @@ void Atom::add_callback(int flag) void Atom::delete_callback(const char *id, int flag) { - if (id == NULL) return; + if (id == nullptr) return; int ifix = modify->find_fix(id); @@ -2310,7 +2310,7 @@ void Atom::update_callback(int ifix) int Atom::find_custom(const char *name, int &flag) { - if(name == NULL) return -1; + if(name == nullptr) return -1; for (int i = 0; i < nivector; i++) if (iname[i] && strcmp(iname[i],name) == 0) { @@ -2374,7 +2374,7 @@ int Atom::add_custom(const char *name, int flag) \verbatim embed:rst This will remove a property that was requested e.g. by the :doc:`fix property/atom ` command. It frees the -allocated memory and sets the pointer to ``NULL`` to the entry in +allocated memory and sets the pointer to ``nullptr`` to the entry in the list can be reused. The lists of those pointers will never be compacted or never shrink, so that index to name mappings remain valid. \endverbatim @@ -2386,14 +2386,14 @@ void Atom::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { memory->destroy(dvector[index]); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } @@ -2483,7 +2483,7 @@ length of the data area, and a short description. * - rmass - double - 1 - - per-atom mass of the particles. ``NULL`` if per-type masses are + - per-atom mass of the particles. ``nullptr`` if per-type masses are used. See the :cpp:func:`rmass_flag` setting. * - ellipsoid - int @@ -2506,7 +2506,7 @@ length of the data area, and a short description. * * \param name string with the keyword of the desired property. Typically the name of the pointer variable returned - * \return pointer to the requested data cast to ``void *`` or NULL */ + * \return pointer to the requested data cast to ``void *`` or nullptr */ void *Atom::extract(char *name) { @@ -2577,7 +2577,7 @@ void *Atom::extract(char *name) // end of customization section // -------------------------------------------------------------------- - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/atom.h b/src/atom.h index 21b9c06f8..841d224d2 100644 --- a/src/atom.h +++ b/src/atom.h @@ -55,7 +55,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, NULL if unset + char *firstgroupname; // group-ID to store first, nullptr if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable diff --git a/src/atom_map.cpp b/src/atom_map.cpp index 02b97a113..45808d086 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -323,18 +323,18 @@ int Atom::map_style_set() void Atom::map_delete() { memory->destroy(sametag); - sametag = NULL; + sametag = nullptr; max_same = 0; if (map_style == 1) { memory->destroy(map_array); - map_array = NULL; + map_array = nullptr; } else { if (map_nhash) { delete [] map_bucket; delete [] map_hash; - map_bucket = NULL; - map_hash = NULL; + map_bucket = nullptr; + map_hash = nullptr; } map_nhash = map_nbucket = 0; } diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 4a00e5852..8dcec3a78 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -2060,7 +2060,7 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf) } /* ---------------------------------------------------------------------- - pack bond info for data file into buf if non-NULL + pack bond info for data file into buf if non-nullptr return count of bonds from this proc do not count/pack bonds with bondtype = 0 if bondtype is negative, flip back to positive @@ -2118,7 +2118,7 @@ void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index) } /* ---------------------------------------------------------------------- - pack angle info for data file into buf if non-NULL + pack angle info for data file into buf if non-nullptr return count of angles from this proc do not count/pack angles with angletype = 0 if angletype is negative, flip back to positive diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index e9044519c..9f5ec26cc 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -49,9 +49,9 @@ AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) atom->radius_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; - bptr = NULL; + bptr = nullptr; if (sizeof(double) == sizeof(int)) intdoubleratio = 1; else if (sizeof(double) == 2*sizeof(int)) intdoubleratio = 2; @@ -104,7 +104,7 @@ void AtomVecBody::process_args(int narg, char **arg) if (narg < 1) error->all(FLERR,"Invalid atom_style body command"); - if (0) bptr = NULL; + if (0) bptr = nullptr; #define BODY_CLASS #define BodyStyle(key,Class) \ @@ -582,7 +582,7 @@ void AtomVecBody::pack_data_pre(int ilocal) /* ---------------------------------------------------------------------- pack bonus body info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecBody::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index c22111f48..e673ac295 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -46,7 +46,7 @@ AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp) atom->rmass_flag = atom->angmom_flag = atom->torque_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -484,7 +484,7 @@ void AtomVecEllipsoid::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus ellipsoid info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecEllipsoid::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7a8c73570..e343bcbdb 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -30,13 +30,13 @@ enum{ELLIPSOID,LINE,TRIANGLE,BODY}; // also in WriteData AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp) : AtomVec(lmp) { nstyles = 0; - styles = NULL; - keywords = NULL; - fieldstrings = NULL; + styles = nullptr; + keywords = nullptr; + fieldstrings = nullptr; bonus_flag = 0; nstyles_bonus = 0; - styles_bonus = NULL; + styles_bonus = nullptr; // these strings will be concatenated from sub-style strings // fields_data_atom & fields_data_vel start with fields common to all styles @@ -187,7 +187,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) // save concat_grow to check for duplicates of special-case fields char *concat_grow;; - char *null = NULL; + char *null = nullptr; fields_grow = merge_fields(0,fields_grow,1,concat_grow); fields_copy = merge_fields(1,fields_copy,0,null); diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 88dcb8c2f..8776c33e5 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -47,7 +47,7 @@ AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -457,7 +457,7 @@ void AtomVecLine::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus line info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e391a7321..abcd628e5 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -49,7 +49,7 @@ AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -688,7 +688,7 @@ void AtomVecTri::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus tri info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/balance.cpp b/src/balance.cpp index af8d90481..494d43cf8 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -52,17 +52,17 @@ Balance::Balance(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - user_xsplit = user_ysplit = user_zsplit = NULL; + user_xsplit = user_ysplit = user_zsplit = nullptr; shift_allocate = 0; - proccost = allproccost = NULL; + proccost = allproccost = nullptr; - rcb = NULL; + rcb = nullptr; nimbalance = 0; - imbalances = NULL; - fixstore = NULL; + imbalances = nullptr; + fixstore = nullptr; - fp = NULL; + fp = nullptr; firststep = 1; } @@ -97,7 +97,7 @@ Balance::~Balance() // check nfix in case all fixes have already been deleted if (fixstore && modify->nfix) modify->delete_fix(fixstore->id); - fixstore = NULL; + fixstore = nullptr; if (fp) fclose(fp); } @@ -246,7 +246,7 @@ void Balance::command(int narg, char **arg) // process remaining optional args options(iarg,narg,arg); - if (wtflag) weight_storage(NULL); + if (wtflag) weight_storage(nullptr); // insure particles are in current box & update box via shrink-wrap // init entire system since comm->setup is done @@ -425,7 +425,7 @@ void Balance::options(int iarg, int narg, char **arg) oldrcb = 0; outflag = 0; int outarg = 0; - fp = NULL; + fp = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"weight") == 0) { @@ -473,7 +473,7 @@ void Balance::options(int iarg, int narg, char **arg) if (outflag && comm->me == 0) { fp = fopen(arg[outarg],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open (fix) balance output file {}: {}", arg[outarg], utils::getsyserror())); } @@ -639,12 +639,12 @@ int *Balance::bisection(int sortflag) if (wtflag) { weight = fixstore->vstore; rcb->compute_old(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute_old(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute_old(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } else { if (wtflag) { weight = fixstore->vstore; rcb->compute(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } if (triclinic) domain->lamda2x(nlocal); @@ -1273,7 +1273,7 @@ void Balance::dumpout(bigint tstep) void Balance::debug_shift_output(int idim, int m, int np, double *split) { int i; - const char *dim = NULL; + const char *dim = nullptr; double *boxlo = domain->boxlo; double *prd = domain->prd; diff --git a/src/body.cpp b/src/body.cpp index c0e58d3f4..9bc0bfc04 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -23,8 +23,8 @@ Body::Body(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) int n = strlen(arg[0]) + 1; style = new char[n]; strcpy(style,arg[0]); - icp = NULL; - dcp = NULL; + icp = nullptr; + dcp = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/bond.cpp b/src/bond.cpp index 1f953bbd1..1ff701713 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -44,9 +44,9 @@ Bond::Bond(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -276,7 +276,7 @@ void Bond::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -284,7 +284,7 @@ void Bond::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by bond_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open bond_write file {}: {}", arg[4], utils::getsyserror())); } diff --git a/src/bond.h b/src/bond.h index 8d7585b38..5406aa3f0 100644 --- a/src/bond.h +++ b/src/bond.h @@ -52,7 +52,7 @@ class Bond : protected Pointers { virtual void write_data(FILE *) {} virtual double single(int, double, int, int, double &) = 0; virtual double memory_usage(); - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void reinit(); void write_file(int, char**); diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index b42683c30..46eeab580 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -166,7 +166,7 @@ void BondHybrid::allocate() maxbond = new int[nstyles]; bondlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxbond[m] = 0; - for (int m = 0; m < nstyles; m++) bondlist[m] = NULL; + for (int m = 0; m < nstyles; m++) bondlist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -351,7 +351,7 @@ void BondHybrid::write_restart(FILE *fp) void BondHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Bond*[nstyles]; keywords = new char*[nstyles]; @@ -360,10 +360,10 @@ void BondHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_bond(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index 71146ec4d..06e554916 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -126,7 +126,7 @@ void BondZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -157,5 +157,5 @@ void *BondZero::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/citeme.cpp b/src/citeme.cpp index c8745891c..b638eaf47 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -28,7 +28,7 @@ static const char cite_nagline[] = "\nPlease see the log.cite file " CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; cs = new citeset(); } diff --git a/src/comm.cpp b/src/comm.cpp index 7b351e12f..becb52df9 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -57,15 +57,15 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) mode = 0; bordergroup = 0; cutghostuser = 0.0; - cutusermulti = NULL; + cutusermulti = nullptr; ghost_velocity = 0; user_procgrid[0] = user_procgrid[1] = user_procgrid[2] = 0; coregrid[0] = coregrid[1] = coregrid[2] = 1; gridflag = ONELEVEL; mapflag = CART; - customfile = NULL; - outfile = NULL; + customfile = nullptr; + outfile = nullptr; recv_from_partition = send_to_partition = -1; otherflag = 0; @@ -73,8 +73,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) maxexchange_fix_dynamic = 0; bufextra = BUFEXTRA; - grid2proc = NULL; - xsplit = ysplit = zsplit = NULL; + grid2proc = nullptr; + xsplit = ysplit = zsplit = nullptr; rcbnew = 0; // use of OpenMP threads @@ -88,7 +88,7 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) #ifdef _OPENMP if (lmp->kokkos) { nthreads = lmp->kokkos->nthreads * lmp->kokkos->numa; - } else if (getenv("OMP_NUM_THREADS") == NULL) { + } else if (getenv("OMP_NUM_THREADS") == nullptr) { nthreads = 1; if (me == 0) error->message(FLERR,"OMP_NUM_THREADS environment is not set. " @@ -276,7 +276,7 @@ void Comm::modify_params(int narg, char **arg) // need to reset cutghostuser when switching comm mode if (mode == Comm::MULTI) cutghostuser = 0.0; memory->destroy(cutusermulti); - cutusermulti = NULL; + cutusermulti = nullptr; mode = Comm::SINGLE; } else if (strcmp(arg[iarg+1],"multi") == 0) { // need to reset cutghostuser when switching comm mode @@ -289,7 +289,7 @@ void Comm::modify_params(int narg, char **arg) bordergroup = group->find(arg[iarg+1]); if (bordergroup < 0) error->all(FLERR,"Invalid group in comm_modify command"); - if (bordergroup && (atom->firstgroupname == NULL || + if (bordergroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR,"Comm_modify group != atom_modify first group"); iarg += 2; @@ -313,7 +313,7 @@ void Comm::modify_params(int narg, char **arg) const int ntypes = atom->ntypes; if (iarg+3 > narg) error->all(FLERR,"Illegal comm_modify command"); - if (cutusermulti == NULL) { + if (cutusermulti == nullptr) { memory->create(cutusermulti,ntypes+1,"comm:cutusermulti"); for (i=0; i < ntypes+1; ++i) cutusermulti[i] = -1.0; @@ -770,7 +770,7 @@ int Comm::binary(double value, int n, double *vec) callback() is invoked to allow caller to process/update each proc's inbuf if self=1 (default), then callback() is invoked on final iteration using original inbuf, which may have been updated - for non-NULL outbuf, final updated inbuf is copied to it + for non-nullptr outbuf, final updated inbuf is copied to it ok to specify outbuf = inbuf the ptr argument is a pointer to the instance of calling class ------------------------------------------------------------------------- */ @@ -792,7 +792,7 @@ void Comm::ring(int n, int nper, void *inbuf, int messtag, // sanity check - if ((nbytes > 0) && inbuf == NULL) + if ((nbytes > 0) && inbuf == nullptr) error->one(FLERR,"Cannot put data on ring from NULL pointer"); char *buf,*bufcopy; @@ -888,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -925,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -967,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1032,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1074,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1135,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not nullptr outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/comm.h b/src/comm.h index 1743436e2..7ba79843d 100644 --- a/src/comm.h +++ b/src/comm.h @@ -118,7 +118,7 @@ class Comm : protected Pointers { int read_lines_from_file_universe(FILE *, int, int, char *); // extract data useful to other classes - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} protected: int bordergroup; // only communicate this group in borders @@ -242,7 +242,7 @@ E: Processor count in z must be 1 for 2d simulation Self-explanatory. -E: Cannot put data on ring from NULL pointer +E: Cannot put data on ring from nullptr pointer W: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 37a4f0ae3..bce069fb3 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -41,17 +41,17 @@ using namespace LAMMPS_NS; CommBrick::CommBrick(LAMMPS *lmp) : Comm(lmp), - sendnum(NULL), recvnum(NULL), sendproc(NULL), recvproc(NULL), - size_forward_recv(NULL), - size_reverse_send(NULL), size_reverse_recv(NULL), - slablo(NULL), slabhi(NULL), multilo(NULL), multihi(NULL), - cutghostmulti(NULL), pbc_flag(NULL), pbc(NULL), firstrecv(NULL), - sendlist(NULL), localsendlist(NULL), maxsendlist(NULL), - buf_send(NULL), buf_recv(NULL) + sendnum(nullptr), recvnum(nullptr), sendproc(nullptr), recvproc(nullptr), + size_forward_recv(nullptr), + size_reverse_send(nullptr), size_reverse_recv(nullptr), + slablo(nullptr), slabhi(nullptr), multilo(nullptr), multihi(nullptr), + cutghostmulti(nullptr), pbc_flag(nullptr), pbc(nullptr), firstrecv(nullptr), + sendlist(nullptr), localsendlist(nullptr), maxsendlist(nullptr), + buf_send(nullptr), buf_recv(nullptr) { style = 0; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; + pbc_flag = nullptr; init_buffers(); } @@ -98,10 +98,10 @@ CommBrick::CommBrick(LAMMPS * /*lmp*/, Comm *oldcomm) : Comm(*oldcomm) void CommBrick::init_buffers() { - multilo = multihi = NULL; - cutghostmulti = NULL; + multilo = multihi = nullptr; + cutghostmulti = nullptr; - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); @@ -130,7 +130,7 @@ void CommBrick::init() // memory for multi-style communication - if (mode == Comm::MULTI && multilo == NULL) { + if (mode == Comm::MULTI && multilo == nullptr) { allocate_multi(maxswap); memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti"); } @@ -1463,7 +1463,7 @@ void CommBrick::free_multi() { memory->destroy(multilo); memory->destroy(multihi); - multilo = multihi = NULL; + multilo = multihi = nullptr; } /* ---------------------------------------------------------------------- @@ -1492,7 +1492,7 @@ void *CommBrick::extract(const char *str, int &dim) return (void *) localsendlist; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 48c9680d2..cb236fd72 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -47,12 +47,12 @@ CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp) { style = 1; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; - buf_send = NULL; - buf_recv = NULL; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; + pbc_flag = nullptr; + buf_send = nullptr; + buf_recv = nullptr; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; init_buffers(); } @@ -89,16 +89,16 @@ CommTiled::~CommTiled() void CommTiled::init_buffers() { - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); maxoverlap = 0; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; - sendbox_multi = NULL; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; + sendbox_multi = nullptr; maxswap = 6; allocate_swap(maxswap); @@ -2085,22 +2085,22 @@ void CommTiled::allocate_swap(int n) sendlist = new int**[n]; for (int i = 0; i < n; i++) { - sendproc[i] = recvproc[i] = NULL; - sendnum[i] = recvnum[i] = NULL; - size_forward_recv[i] = firstrecv[i] = NULL; - size_reverse_send[i] = size_reverse_recv[i] = NULL; - forward_recv_offset[i] = reverse_recv_offset[i] = NULL; - - pbc_flag[i] = NULL; - pbc[i] = NULL; - sendbox[i] = NULL; - sendbox_multi[i] = NULL; - maxsendlist[i] = NULL; - sendlist[i] = NULL; + sendproc[i] = recvproc[i] = nullptr; + sendnum[i] = recvnum[i] = nullptr; + size_forward_recv[i] = firstrecv[i] = nullptr; + size_reverse_send[i] = size_reverse_recv[i] = nullptr; + forward_recv_offset[i] = reverse_recv_offset[i] = nullptr; + + pbc_flag[i] = nullptr; + pbc[i] = nullptr; + sendbox[i] = nullptr; + sendbox_multi[i] = nullptr; + maxsendlist[i] = nullptr; + sendlist[i] = nullptr; } maxrequest = 0; - requests = NULL; + requests = nullptr; for (int i = 0; i < n; i++) { nprocmax[i] = DELTA_PROCS; diff --git a/src/compute.cpp b/src/compute.cpp index 4cde9ff56..bd07b0c6d 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -37,10 +37,10 @@ int Compute::instance_total = 0; Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp), - id(NULL), style(NULL), - vector(NULL), array(NULL), vector_atom(NULL), - array_atom(NULL), vector_local(NULL), array_local(NULL), extlist(NULL), - tlist(NULL), vbiasall(NULL) + id(nullptr), style(nullptr), + vector(nullptr), array(nullptr), vector_atom(nullptr), + array_atom(nullptr), vector_local(nullptr), array_local(nullptr), extlist(nullptr), + tlist(nullptr), vbiasall(nullptr) { instance_me = instance_total++; diff --git a/src/compute_adf.cpp b/src/compute_adf.cpp index 5d55f1fbb..e0213872d 100644 --- a/src/compute_adf.cpp +++ b/src/compute_adf.cpp @@ -43,18 +43,18 @@ enum{DEGREE, RADIAN, COSINE}; ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), klo(NULL), khi(NULL), - hist(NULL), histall(NULL), - rcutinnerj(NULL), rcutinnerk(NULL), - rcutouterj(NULL), rcutouterk(NULL), - list(NULL), - iatomcount(NULL), iatomcountall(NULL), iatomflag(NULL), - maxjatom(NULL), maxkatom(NULL), - numjatom(NULL), numkatom(NULL), - neighjatom(NULL),neighkatom(NULL), - jatomflag(NULL), katomflag(NULL), - maxjkatom(NULL), numjkatom(NULL), - neighjkatom(NULL), bothjkatom(NULL), delrjkatom(NULL) + ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), klo(nullptr), khi(nullptr), + hist(nullptr), histall(nullptr), + rcutinnerj(nullptr), rcutinnerk(nullptr), + rcutouterj(nullptr), rcutouterk(nullptr), + list(nullptr), + iatomcount(nullptr), iatomcountall(nullptr), iatomflag(nullptr), + maxjatom(nullptr), maxkatom(nullptr), + numjatom(nullptr), numkatom(nullptr), + neighjatom(nullptr),neighkatom(nullptr), + jatomflag(nullptr), katomflag(nullptr), + maxjkatom(nullptr), numjkatom(nullptr), + neighjkatom(nullptr), bothjkatom(nullptr), delrjkatom(nullptr) { int nargsperadf = 7; diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index 6b6f376b4..97f8c6ff9 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -40,7 +40,7 @@ using namespace LAMMPS_NS; ComputeAggregateAtom::ComputeAggregateAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - aggregateID(NULL) + aggregateID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute aggregate/atom command"); @@ -71,10 +71,10 @@ void ComputeAggregateAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute aggregate/atom unless atoms have IDs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Compute aggregate/atom requires a bond style to be defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index e3e44efbb..83daeedb9 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeAngle::ComputeAngle(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute angle command"); diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index b100824ea..8f9f728cf 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -38,7 +38,7 @@ enum{THETA,ENG,VARIABLE}; ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), tstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), tstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute angle/local command"); @@ -77,7 +77,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - tstr = NULL; + tstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -123,8 +123,8 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ ComputeAngleLocal::~ComputeAngleLocal() void ComputeAngleLocal::init() { - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"No angle style is defined for compute angle/local"); if (nvar) { diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 6c9f1d65a..eb22dcee5 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), angmom(nullptr), angmomall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute angmom/chunk command"); diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 503582bc6..f7c420685 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeBond::ComputeBond(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute bond command"); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 010e8db62..c201a9886 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -39,7 +39,7 @@ enum{DIST,VELVIB,OMEGA,ENGTRANS,ENGVIB,ENGROT,ENGPOT,FORCE,FX,FY,FZ,VARIABLE}; ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), dstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), dstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute bond/local command"); @@ -84,7 +84,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - dstr = NULL; + dstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -142,8 +142,8 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeBondLocal::~ComputeBondLocal() void ComputeBondLocal::init() { - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"No bond style is defined for compute bond/local"); if (nvar) { diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index f88dea9eb..af32a8e9a 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), centro(NULL) + distsq(nullptr), nearest(nullptr), centro(nullptr) { if (narg < 4 || narg > 6) error->all(FLERR,"Illegal compute centro/atom command"); @@ -88,7 +88,7 @@ ComputeCentroAtom::~ComputeCentroAtom() void ComputeCentroAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute centro/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 7c979c66d..499d90345 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute centroid/stress/atom command"); @@ -49,7 +49,7 @@ ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -237,7 +237,7 @@ void ComputeCentroidStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index d0044410d..7fe9394b4 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -54,10 +54,10 @@ enum{LIMITMAX,LIMITEXACT}; ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL), - cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL), - varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL), - exclude(NULL), hash(NULL) + chunk_volume_vec(nullptr), coord(nullptr), ichunk(nullptr), chunkID(nullptr), + cfvid(nullptr), idregion(nullptr), region(nullptr), cchunk(nullptr), fchunk(nullptr), + varatom(nullptr), id_fix(nullptr), fixstore(nullptr), lockfix(nullptr), chunk(nullptr), + exclude(nullptr), hash(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command"); @@ -73,7 +73,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : binflag = 0; ncoord = 0; - cfvid = NULL; + cfvid = nullptr; if (strcmp(arg[3],"bin/1d") == 0) { binflag = 1; @@ -177,7 +177,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // optional args regionflag = 0; - idregion = NULL; + idregion = nullptr; nchunksetflag = 0; nchunkflag = EVERY; limit = 0; @@ -448,16 +448,16 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // initialize chunk vector and per-chunk info nmax = 0; - chunk = NULL; + chunk = nullptr; nmaxint = -1; - ichunk = NULL; - exclude = NULL; + ichunk = nullptr; + exclude = nullptr; nchunk = 0; chunk_volume_scalar = 1.0; - chunk_volume_vec = NULL; - coord = NULL; - chunkID = NULL; + chunk_volume_vec = nullptr; + coord = nullptr; + chunkID = nullptr; // computeflag = 1 if this compute might invoke another compute // during assign_chunk_ids() @@ -470,17 +470,17 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : invoked_setup = -1; invoked_ichunk = -1; - id_fix = NULL; - fixstore = NULL; + id_fix = nullptr; + fixstore = nullptr; if (compress) hash = new std::map(); - else hash = NULL; + else hash = nullptr; maxvar = 0; - varatom = NULL; + varatom = nullptr; lockcount = 0; - lockfix = NULL; + lockfix = nullptr; if (which == MOLECULE) molcheck = 1; else molcheck = 0; @@ -593,7 +593,7 @@ void ComputeChunkAtom::init() if ((idsflag != ONCE && !lockcount) && fixstore) { modify->delete_fix(id_fix); - fixstore = NULL; + fixstore = nullptr; } } @@ -665,7 +665,7 @@ double ComputeChunkAtom::compute_scalar() void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) { - if (lockfix == NULL) { + if (lockfix == nullptr) { lockfix = fixptr; lockstart = startstep; lockstop = stopstep; @@ -689,7 +689,7 @@ void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) void ComputeChunkAtom::unlock(Fix *fixptr) { if (fixptr != lockfix) return; - lockfix = NULL; + lockfix = nullptr; } /* ---------------------------------------------------------------------- @@ -1049,7 +1049,7 @@ void ComputeChunkAtom::compress_chunk_ids() // create my list of populated IDs - int *list = NULL; + int *list = nullptr; memory->create(list,n,"chunk/atom:list"); n = 0; @@ -1094,7 +1094,7 @@ void ComputeChunkAtom::compress_chunk_ids() memory->destroy(listall); } else { - comm->ring(n,sizeof(int),list,1,idring,NULL,(void *)this,0); + comm->ring(n,sizeof(int),list,1,idring,nullptr,(void *)this,0); } memory->destroy(list); diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 98a3ea9a2..14c86383b 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // NULL if no lock currently in place + // nullptr if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 953ae3a8c..b3b57d75d 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -37,7 +37,7 @@ enum{COMPUTE,FIX}; ComputeChunkSpreadAtom:: ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), ids(NULL), which(NULL), argindex(NULL), value2index(NULL) + idchunk(nullptr), ids(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute chunk/spread/atom command"); @@ -68,7 +68,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0) { @@ -161,8 +161,8 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom vector or array nmax = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index 8086ef3f4..fa31e738b 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -37,7 +37,7 @@ enum{CLUSTER,MASK,COORDS}; ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - clusterID(NULL) + clusterID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command"); @@ -64,7 +64,7 @@ void ComputeClusterAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute cluster/atom unless atoms have IDs"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index e9b6f1699..9a7a9b5d1 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -44,7 +44,7 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND}; ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), pattern(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), pattern(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command"); @@ -71,7 +71,7 @@ ComputeCNAAtom::~ComputeCNAAtom() void ComputeCNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cna/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR,"Compute cna/atom cutoff is longer than pairwise cutoff"); diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 8398311a0..39ea6cfa8 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -31,7 +31,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) + idchunk(nullptr), masstotal(nullptr), massproc(nullptr), com(nullptr), comall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index 7a288afb4..11f0c1489 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - contact(NULL) + contact(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command"); @@ -57,7 +57,7 @@ ComputeContactAtom::~ComputeContactAtom() void ComputeContactAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute contact/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index cb919d3a8..05d299fa2 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -38,8 +38,8 @@ using namespace LAMMPS_NS; ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - typelo(NULL), typehi(NULL), cvec(NULL), carray(NULL), - group2(NULL), id_orientorder(NULL), normv(NULL) + typelo(nullptr), typehi(nullptr), cvec(nullptr), carray(nullptr), + group2(nullptr), id_orientorder(nullptr), normv(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute coord/atom command"); @@ -147,7 +147,7 @@ void ComputeCoordAtom::init() "option in compute orientorder/atom"); } - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute coord/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index 8853887f1..64d9c8b37 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeDihedral::ComputeDihedral(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dihedral command"); diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index ac2c884c3..d1ff05194 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -38,7 +38,7 @@ enum{PHI,VARIABLE}; ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), pstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), pstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command"); @@ -74,7 +74,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - pstr = NULL; + pstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -122,8 +122,8 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -145,7 +145,7 @@ ComputeDihedralLocal::~ComputeDihedralLocal() void ComputeDihedralLocal::init() { - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"No dihedral style is defined for compute dihedral/local"); if (nvar) { diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 361ee36c1..f387786b8 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -34,9 +34,9 @@ enum { MASSCENTER, GEOMCENTER }; ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), chrgproc(NULL), - chrgtotal(NULL), com(NULL), - comall(NULL), dipole(NULL), dipoleall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), chrgproc(nullptr), + chrgtotal(nullptr), com(nullptr), + comall(nullptr), dipole(nullptr), dipoleall(nullptr) { if ((narg != 4) && (narg != 5)) error->all(FLERR,"Illegal compute dipole/chunk command"); diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 4b194cfab..bd939f140 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - displace(NULL), id_fix(NULL) + displace(nullptr), id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute displace/atom command"); @@ -44,7 +44,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // optional args refreshflag = 0; - rvar = NULL; + rvar = nullptr; int iarg = 3; while (iarg < narg) { @@ -102,7 +102,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom displacement array nmax = nvmax = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index 78664a912..d3f0d723c 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeErotateSphereAtom:: ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - erot(NULL) + erot(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere//atom command"); diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index db003c93e..85497bce0 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - fragmentID(NULL) + fragmentID(nullptr) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Compute fragment/atom used when bonds are not allowed"); @@ -61,9 +61,9 @@ ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - stack = NULL; - clist = NULL; - markflag = NULL; + stack = nullptr; + clist = nullptr; + markflag = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index b3e4f88bf..03d9ba4ec 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -39,8 +39,8 @@ enum{VECTOR,ARRAY}; ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idref(NULL), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - indices(NULL), varatom(NULL), vecglobal(NULL) + idref(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + indices(nullptr), varatom(nullptr), vecglobal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute global/atom command"); @@ -96,7 +96,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || strncmp(arg[iarg],"v_",2) == 0) { @@ -234,8 +234,8 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = nvalues; nmax = maxvector = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index ca0483fce..90956c6b1 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -45,7 +45,7 @@ enum{OFF,INTER,INTRA}; ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute group/group command"); @@ -122,15 +122,15 @@ void ComputeGroupGroup::init() // if non-hybrid, then error if single_enable = 0 // if hybrid, let hybrid determine if sub-style sets single_enable = 0 - if (pairflag && force->pair == NULL) + if (pairflag && force->pair == nullptr) error->all(FLERR,"No pair style defined for compute group/group"); - if (force->pair_match("^hybrid",0) == NULL + if (force->pair_match("^hybrid",0) == nullptr && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute group/group"); // error if Kspace style does not compute group/group interactions - if (kspaceflag && force->kspace == NULL) + if (kspaceflag && force->kspace == nullptr) error->all(FLERR,"No Kspace style defined for compute group/group"); if (kspaceflag && force->kspace->group_group_enable == 0) error->all(FLERR,"Kspace style does not support compute group/group"); @@ -138,10 +138,10 @@ void ComputeGroupGroup::init() if (pairflag) { pair = force->pair; cutsq = force->pair->cutsq; - } else pair = NULL; + } else pair = nullptr; if (kspaceflag) kspace = force->kspace; - else kspace = NULL; + else kspace = nullptr; // compute Kspace correction terms diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index ad0520bc0..f7e7c8ced 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -29,8 +29,8 @@ using namespace LAMMPS_NS; ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - rg(NULL), rgall(NULL), rgt(NULL), rgtall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + rg(nullptr), rgall(nullptr), rgt(nullptr), rgtall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute gyration/chunk command"); diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index 15a17949e..bcb10c833 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_ke(NULL), id_pe(NULL), id_stress(NULL) + id_ke(nullptr), id_pe(nullptr), id_stress(nullptr) { if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command"); diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index 00f81dc84..736a7e64c 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -45,7 +45,7 @@ using namespace MathConst; ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), qnarray(NULL) + distsq(nullptr), nearest(nullptr), qnarray(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute hexorder/atom command"); @@ -104,7 +104,7 @@ ComputeHexOrderAtom::~ComputeHexOrderAtom() void ComputeHexOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute hexorder/atom requires a pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; else if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 3721dbfd4..aa65bde66 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute improper command"); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index e363749b6..4d230cd1e 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -35,7 +35,7 @@ using namespace MathConst; ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL) + vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute improper/local command"); @@ -57,8 +57,8 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ ComputeImproperLocal::~ComputeImproperLocal() void ComputeImproperLocal::init() { - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"No improper style is defined for compute improper/local"); // do initial memory allocation so that memory_usage() is correct @@ -135,7 +135,7 @@ int ComputeImproperLocal::compute_impropers(int flag) if (cflag >= 0) cbuf = vlocal; } else { if (cflag >= 0 && alocal) cbuf = &alocal[0][cflag]; - else cbuf = NULL; + else cbuf = nullptr; } } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index 65de1d7bb..ba7c4f36f 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -28,8 +28,8 @@ using namespace LAMMPS_NS; ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - inertia(NULL), inertiaall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + inertia(nullptr), inertiaall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command"); diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index 102d6364f..65b3140d7 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ke(NULL) + ke(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command"); diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index d23c389ab..41ffa95fe 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute msd command"); diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index b0e2520f9..2c3c2811d 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), id_fix(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), msd(NULL) + idchunk(nullptr), id_fix(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), msd(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command"); diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 4151b2cdb..40f13f748 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -31,8 +31,8 @@ using namespace LAMMPS_NS; ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL), - inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL) + idchunk(nullptr),massproc(nullptr),masstotal(nullptr),com(nullptr),comall(nullptr), + inertia(nullptr),inertiaall(nullptr),angmom(nullptr),angmomall(nullptr),omega(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command"); diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 7323b6ef0..e76081e0b 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -49,8 +49,8 @@ using namespace MathConst; ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - qlist(NULL), distsq(NULL), nearest(NULL), rlist(NULL), - qnarray(NULL), qnm_r(NULL), qnm_i(NULL), cglist(NULL) + qlist(nullptr), distsq(nullptr), nearest(nullptr), rlist(nullptr), + qnarray(nullptr), qnm_r(nullptr), qnm_i(nullptr), cglist(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute orientorder/atom command"); @@ -186,7 +186,7 @@ ComputeOrientOrderAtom::~ComputeOrientOrderAtom() void ComputeOrientOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute orientorder/atom requires a " "pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index 7ace5615a..15b5bec19 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -28,7 +28,7 @@ enum{EPAIR,EVDWL,ECOUL}; ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pair(NULL), one(NULL) + pstyle(nullptr), pair(nullptr), one(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair command"); @@ -82,7 +82,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : extvector = 1; one = new double[npair]; vector = new double[npair]; - } else one = vector = NULL; + } else one = vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index e41221f70..a8fa247e4 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -37,7 +37,7 @@ enum{TYPE,RADIUS}; ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pindex(NULL), vlocal(NULL), alocal(NULL) + pstyle(nullptr), pindex(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair/local command"); @@ -97,8 +97,8 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -115,7 +115,7 @@ ComputePairLocal::~ComputePairLocal() void ComputePairLocal::init() { - if (singleflag && force->pair == NULL) + if (singleflag && force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pair/local"); if (singleflag && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pair/local"); diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 6bdd72950..374a3151c 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - energy(NULL) + energy(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command"); diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index 90e4f9b39..ae1bb4747 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure command"); if (igroup) error->all(FLERR,"Compute pressure must use group all"); @@ -51,7 +51,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -130,13 +130,13 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ void ComputePressure::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairhybridflag && force->pair) nvirial++; if (pairflag && force->pair) nvirial++; @@ -221,7 +221,7 @@ void ComputePressure::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 9c637edc1..e23458d20 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - index(NULL), pack_choice(NULL) + index(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/atom command"); @@ -441,7 +441,7 @@ void ComputePropertyAtom::compute_peratom() (this->*pack_choice[0])(0); } else { if (nmax) buf = &array_atom[0][0]; - else buf = NULL; + else buf = nullptr; for (int n = 0; n < nvalues; n++) (this->*pack_choice[n])(n); } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index c27cfc409..ad21e8029 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), count_one(NULL), count_all(NULL) + idchunk(nullptr), count_one(nullptr), count_all(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute property/chunk command"); diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 651e1190b..8478535e9 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -35,7 +35,7 @@ enum{TYPE,RADIUS}; ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL), indices(NULL), pack_choice(NULL) + vlocal(nullptr), alocal(nullptr), indices(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/local command"); @@ -254,8 +254,8 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute property/local requires atom attribute radius"); nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -273,7 +273,7 @@ ComputePropertyLocal::~ComputePropertyLocal() void ComputePropertyLocal::init() { if (kindflag == NEIGH || kindflag == PAIR) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute property/local"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute property/local"); diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index a28223b3a..f4d553d2d 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -41,9 +41,9 @@ using namespace MathConst; ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rdfpair(NULL), nrdfpair(NULL), ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), - hist(NULL), histall(NULL), typecount(NULL), icount(NULL), jcount(NULL), - duplicates(NULL) + rdfpair(nullptr), nrdfpair(nullptr), ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), + hist(nullptr), histall(nullptr), typecount(nullptr), icount(nullptr), jcount(nullptr), + duplicates(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute rdf command"); diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index b024b4365..66af301e4 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -44,14 +44,14 @@ enum{PERATOM,LOCAL}; ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), flavor(NULL), - value2index(NULL), ids(NULL), onevec(NULL), replace(NULL), indices(NULL), - owner(NULL), idregion(NULL), varatom(NULL) + nvalues(0), which(nullptr), argindex(nullptr), flavor(nullptr), + value2index(nullptr), ids(nullptr), onevec(nullptr), replace(nullptr), indices(nullptr), + owner(nullptr), idregion(nullptr), varatom(nullptr) { int iarg = 0; if (strcmp(style,"reduce") == 0) { if (narg < 5) error->all(FLERR,"Illegal compute reduce command"); - idregion = NULL; + idregion = nullptr; iarg = 3; } else if (strcmp(style,"reduce/region") == 0) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/region command"); @@ -93,13 +93,13 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"x") == 0) { which[nvalues] = X; @@ -190,7 +190,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : if (replace[i] >= 0) flag = 1; if (!flag) { delete [] replace; - replace = NULL; + replace = nullptr; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -285,8 +285,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; if (mode == SUM || mode == SUMSQ) extscalar = 1; else extscalar = 0; - vector = onevec = NULL; - indices = owner = NULL; + vector = onevec = nullptr; + indices = owner = nullptr; } else { vector_flag = 1; size_vector = nvalues; @@ -299,7 +299,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : } maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 6e8aa4841..fbcf82619 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -40,8 +40,8 @@ enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), argindex(NULL), value2index(NULL), idchunk(NULL), ids(NULL), - vlocal(NULL), vglobal(NULL), alocal(NULL), aglobal(NULL), varatom(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), idchunk(nullptr), ids(nullptr), + vlocal(nullptr), vglobal(nullptr), alocal(nullptr), aglobal(nullptr), varatom(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/chunk command"); @@ -78,13 +78,13 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || @@ -193,11 +193,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : else if (mode == MAXX) initvalue = -BIG; maxchunk = 0; - vlocal = vglobal = NULL; - alocal = aglobal = NULL; + vlocal = vglobal = nullptr; + alocal = aglobal = nullptr; maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index ca4b735d6..036a9bb28 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -34,7 +34,7 @@ enum{COMPUTE,FIX,VARIABLE}; ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute slice command"); diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 9c65ee86c..279d2af07 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command"); @@ -49,7 +49,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -213,7 +213,7 @@ void ComputeStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 54f052900..f3110cfec 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -31,8 +31,8 @@ enum{TEMP,KECOM,INTERNAL}; ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), idchunk(NULL), id_bias(NULL), sum(NULL), sumall(NULL), count(NULL), - countall(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + which(nullptr), idchunk(nullptr), id_bias(nullptr), sum(nullptr), sumall(nullptr), count(nullptr), + countall(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command"); @@ -71,7 +71,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : comflag = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index b50962a2c..75b784c85 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -47,7 +47,7 @@ ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index 85e51d2a5..5ce62dfeb 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -47,7 +47,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx"); maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index eacca87e1..0344880e1 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -30,7 +30,7 @@ enum{TENSOR,BIN}; ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bin(NULL), vbin(NULL), binave(NULL), tbin(NULL), tbinall(NULL) + bin(nullptr), vbin(nullptr), binave(nullptr), tbin(nullptr), tbinall(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command"); diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index 3874c1f28..17509b85a 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -98,7 +98,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : } maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index 74955da42..8a8d671df 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute temp/region command"); @@ -48,7 +48,7 @@ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp index 6ef3038d6..42dc790a3 100644 --- a/src/compute_temp_sphere.cpp +++ b/src/compute_temp_sphere.cpp @@ -32,7 +32,7 @@ enum{ROTATE,ALL}; ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL) + id_bias(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command"); diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index c0b648418..df2559145 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), torque(NULL), torqueall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), torque(nullptr), torqueall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute torque/chunk command"); diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index 635c3e416..a34c4bac8 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute vacf command"); diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index 6651110e7..7edab91d5 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -29,7 +29,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute vcm/chunk command"); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 7e84e9cce..d7f862de9 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -130,7 +130,7 @@ void CreateAtoms::command(int narg, char **arg) mode = ATOM; int molseed; varflag = 0; - vstr = xstr = ystr = zstr = NULL; + vstr = xstr = ystr = zstr = nullptr; quatone[0] = quatone[1] = quatone[2] = 0.0; subsetflag = NONE; int subsetseed; @@ -245,7 +245,7 @@ void CreateAtoms::command(int narg, char **arg) // error check and further setup for mode = MOLECULE - ranmol = NULL; + ranmol = nullptr; if (mode == MOLECULE) { if (onemol->xflag == 0) error->all(FLERR,"Create_atoms molecule must have coordinates"); @@ -267,7 +267,7 @@ void CreateAtoms::command(int narg, char **arg) ranmol = new RanMars(lmp,molseed+me); } - ranlatt = NULL; + ranlatt = nullptr; if (subsetflag != NONE) ranlatt = new RanMars(lmp,subsetseed+me); // error check and further setup for variable test diff --git a/src/create_atoms.h b/src/create_atoms.h index 87d15d00b..5508752f0 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -62,7 +62,7 @@ class CreateAtoms : protected Pointers { void add_random(); void add_lattice(); void loop_lattice(int); - void add_molecule(double *, double * = NULL); + void add_molecule(double *, double * = nullptr); int vartest(double *); // evaluate a variable with new atom position }; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 9e3eb6580..7bface4d0 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -197,14 +197,14 @@ void CreateBonds::many() // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Create_bonds requires a pair style be defined"); if (rmax > neighbor->cutneighmax) error->all(FLERR,"Create_bonds max distance > neighbor cutoff"); if (rmax > neighbor->cutneighmin && comm->me == 0) error->warning(FLERR,"Create_bonds max distance > minimum neighbor cutoff"); - // require special_bonds 1-2 weights = 0.0 and KSpace = NULL + // require special_bonds 1-2 weights = 0.0 and KSpace = nullptr // so that already bonded atom pairs do not appear in neighbor list // otherwise with newton_bond = 1, // would be hard to check if I-J bond already existed diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 8baee645c..9f73a64f7 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -299,7 +299,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Delete_atoms requires a pair style be defined"); if (cut > neighbor->cutneighmax) error->all(FLERR,"Delete_atoms cutoff > max neighbor cutoff"); @@ -476,7 +476,7 @@ void DeleteAtoms::delete_bond() for (int i = 0; i < nlocal; i++) if (dlist[i]) list[n++] = tag[i]; - comm->ring(n,sizeof(tagint),list,1,bondring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,bondring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -514,7 +514,7 @@ void DeleteAtoms::delete_molecule() std::map::iterator pos; for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index b8ec5f788..4b68a461f 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -75,7 +75,7 @@ void DeleteBonds::command(int narg, char **arg) // use utils::bounds(FLERR,) to allow setting of range of types // range can be 0 to ntypes inclusive - int *tlist = NULL; + int *tlist = nullptr; int iarg = 2; if (style != MULTI && style != STATS) { diff --git a/src/dihedral.cpp b/src/dihedral.cpp index ac2d432cf..f75b89139 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -36,10 +36,10 @@ Dihedral::Dihedral(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index 61e0fdc72..83feb2f84 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -161,7 +161,7 @@ void DihedralHybrid::allocate() maxdihedral = new int[nstyles]; dihedrallist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxdihedral[m] = 0; - for (int m = 0; m < nstyles; m++) dihedrallist[m] = NULL; + for (int m = 0; m < nstyles; m++) dihedrallist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -329,7 +329,7 @@ void DihedralHybrid::write_restart(FILE *fp) void DihedralHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Dihedral*[nstyles]; keywords = new char*[nstyles]; @@ -338,10 +338,10 @@ void DihedralHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_dihedral(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 018288d47..4f8495699 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -44,7 +44,7 @@ enum{MOVE,RAMP,RANDOM,ROTATE}; DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp) { - mvec = NULL; + mvec = nullptr; } /* ---------------------------------------------------------------------- */ @@ -313,7 +313,7 @@ void DisplaceAtoms::command(int narg, char **arg) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -384,7 +384,7 @@ void DisplaceAtoms::move(int idim, char *arg, double scale) for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += delta; } else if (input->variable->atomstyle(ivar)) { - if (mvec == NULL) memory->create(mvec,nlocal,"displace_atoms:mvec"); + if (mvec == nullptr) memory->create(mvec,nlocal,"displace_atoms:mvec"); input->variable->compute_atom(ivar,igroup,mvec,1,0); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += scale*mvec[i]; diff --git a/src/domain.cpp b/src/domain.cpp index 984c735a2..086f0228b 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -89,7 +89,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) boxlo_lamda[0] = boxlo_lamda[1] = boxlo_lamda[2] = 0.0; boxhi_lamda[0] = boxhi_lamda[1] = boxhi_lamda[2] = 1.0; - lattice = NULL; + lattice = nullptr; char **args = new char*[2]; args[0] = (char *) "none"; args[1] = (char *) "1.0"; @@ -97,7 +97,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) delete [] args; nregion = maxregion = 0; - regions = NULL; + regions = nullptr; copymode = 0; @@ -1640,7 +1640,7 @@ void Domain::image_flip(int m, int n, int p) return 1 if this proc owns atom with coords x, else return 0 x is returned remapped into periodic box if image flag is passed, flag is updated via remap(x,image) - if image = NULL is passed, no update with remap(x) + if image = nullptr is passed, no update with remap(x) if shrinkexceed, atom can be outside shrinkwrap boundaries called from create_atoms() in library.cpp ------------------------------------------------------------------------- */ @@ -1727,7 +1727,7 @@ int Domain::ownatom(int /*id*/, double *x, imageint *image, int shrinkexceed) void Domain::set_lattice(int narg, char **arg) { if (lattice) delete lattice; - lattice = NULL; + lattice = nullptr; lattice = new Lattice(lmp,narg,arg); } diff --git a/src/dump.cpp b/src/dump.cpp index febc3d082..3f1e997d1 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -66,17 +66,17 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) first_flag = 0; flush_flag = 1; - format = NULL; - format_default = NULL; + format = nullptr; + format_default = nullptr; - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_column_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_column_user = nullptr; refreshflag = 0; - refresh = NULL; + refresh = nullptr; clearstep = 0; sort_flag = 0; @@ -93,20 +93,20 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) maxfiles = -1; numfiles = 0; fileidx = 0; - nameslist = NULL; + nameslist = nullptr; maxbuf = maxids = maxsort = maxproc = 0; - buf = bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + buf = bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; maxsbuf = 0; - sbuf = NULL; + sbuf = nullptr; maxpbc = 0; - xpbc = vpbc = NULL; - imagepbc = NULL; + xpbc = vpbc = nullptr; + imagepbc = nullptr; // parse filename for special syntax // if contains '%', write one file per proc and replace % with proc-ID @@ -117,7 +117,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) // else if ends in .zst = Zstd compressed text file // else ASCII text file - fp = NULL; + fp = nullptr; singlefile_opened = 0; compressed = 0; binary = 0; @@ -128,7 +128,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) filewriter = 0; if (me == 0) filewriter = 1; fileproc = 0; - multiname = NULL; + multiname = nullptr; char *ptr; if ((ptr = strchr(filename,'%'))) { @@ -202,15 +202,15 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to NULL since it closes file in its destructor + // XTC style sets fp to nullptr since it closes file in its destructor - if (multifile == 0 && fp != NULL) { + if (multifile == 0 && fp != nullptr) { if (compressed) { if (filewriter) pclose(fp); } else { if (filewriter) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -229,10 +229,10 @@ void Dump::init() delete irregular; maxids = maxsort = maxproc = 0; - bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; } if (sort_flag) { @@ -243,7 +243,7 @@ void Dump::init() error->all(FLERR,"Cannot dump sort on atom IDs with no atom IDs defined"); if (sortcol && sortcol > size_one) error->all(FLERR,"Dump sort column is invalid"); - if (nprocs > 1 && irregular == NULL) + if (nprocs > 1 && irregular == nullptr) irregular = new Irregular(lmp); bigint size = group->count(igroup); @@ -438,7 +438,7 @@ void Dump::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // if buffering, convert doubles into strings @@ -528,11 +528,11 @@ void Dump::write() if (multifile) { if (compressed) { - if (filewriter && fp != NULL) pclose(fp); + if (filewriter && fp != nullptr) pclose(fp); } else { - if (filewriter && fp != NULL) fclose(fp); + if (filewriter && fp != nullptr) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -609,8 +609,8 @@ void Dump::openfile() fp = fopen(filecurrent,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); - } else fp = NULL; + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else fp = nullptr; // delete string with timestep replaced @@ -1013,10 +1013,10 @@ void Dump::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; // pass format none to child classes which may use it // not an error if they don't modify_param(narg-iarg,&arg[iarg]); @@ -1055,7 +1055,7 @@ void Dump::modify_params(int narg, char **arg) nameslist = new char*[maxfiles]; numfiles = 0; for (int idx=0; idx < maxfiles; ++idx) - nameslist[idx] = NULL; + nameslist[idx] = nullptr; fileidx = 0; } iarg += 2; diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index a68e95059..f8d02904f 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -34,7 +34,7 @@ DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) image_flag = 0; buffer_allow = 1; buffer_flag = 1; - format_default = NULL; + format_default = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index da9740d9c..ffff1e85c 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), auxname(NULL) + DumpCustom(lmp, narg, arg), auxname(nullptr) { multifile_override = 0; @@ -63,7 +63,7 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : // convert 'X_ID[m]' (X=c,f,v) to 'X_ID_m' if (nfield > 5) auxname = new char*[nfield]; - else auxname = NULL; + else auxname = nullptr; int i = 0; for (int iarg = 5; iarg < nfield; iarg++, i++) { diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 167d88789..1439e68ce 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -53,13 +53,13 @@ enum{LT,LE,GT,GE,EQ,NEQ,XOR}; DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - idregion(NULL), thresh_array(NULL), thresh_op(NULL), thresh_value(NULL), - thresh_last(NULL), thresh_fix(NULL), thresh_fixID(NULL), thresh_first(NULL), - earg(NULL), vtype(NULL), vformat(NULL), columns(NULL), choose(NULL), - dchoose(NULL), clist(NULL), field2index(NULL), argindex(NULL), id_compute(NULL), - compute(NULL), id_fix(NULL), fix(NULL), id_variable(NULL), variable(NULL), - vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL), - pack_choice(NULL) + idregion(nullptr), thresh_array(nullptr), thresh_op(nullptr), thresh_value(nullptr), + thresh_last(nullptr), thresh_fix(nullptr), thresh_fixID(nullptr), thresh_first(nullptr), + earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), choose(nullptr), + dchoose(nullptr), clist(nullptr), field2index(nullptr), argindex(nullptr), id_compute(nullptr), + compute(nullptr), id_fix(nullptr), fix(nullptr), id_variable(nullptr), variable(nullptr), + vbuf(nullptr), id_custom(nullptr), flag_custom(nullptr), typenames(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); @@ -87,37 +87,37 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : buffer_allow = 1; buffer_flag = 1; iregion = -1; - idregion = NULL; + idregion = nullptr; nthresh = 0; - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; nthreshlast = 0; - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; // computes, fixes, variables which the dump accesses ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; nvariable = 0; - id_variable = NULL; - variable = NULL; - vbuf = NULL; + id_variable = nullptr; + variable = nullptr; + vbuf = nullptr; ncustom = 0; - id_custom = NULL; - flag_custom = NULL; + id_custom = nullptr; + flag_custom = nullptr; // process attributes // ioptional = start of additional optional args in expanded args @@ -142,9 +142,9 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // atom selection arrays maxlocal = 0; - choose = NULL; - dchoose = NULL; - clist = NULL; + choose = nullptr; + dchoose = nullptr; + clist = nullptr; // default element name for all types = C @@ -167,11 +167,11 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : else if (vtype[i] == Dump::DOUBLE) strcat(format_default,"%g "); else if (vtype[i] == Dump::STRING) strcat(format_default,"%s "); else if (vtype[i] == Dump::BIGINT) strcat(format_default,BIGINT_FORMAT " "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -279,8 +279,8 @@ void DumpCustom::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { @@ -1648,7 +1648,7 @@ int DumpCustom::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -1711,7 +1711,7 @@ int DumpCustom::modify_param(int narg, char **arg) // just clear format_column_user allocated by this dump child class for (int i = 0; i < size_one; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } return 2; } @@ -1729,7 +1729,7 @@ int DumpCustom::modify_param(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Dump_modify int format does not contain d character"); char str[8]; @@ -1791,17 +1791,17 @@ int DumpCustom::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; for (int i = 0; i < nthreshlast; i++) { modify->delete_fix(thresh_fixID[i]); delete [] thresh_fixID[i]; } - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; } nthresh = nthreshlast = 0; return 2; diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 254b371e2..8c848d261 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -51,7 +51,7 @@ static inline void fwrite_int32(FILE* fd, uint32_t i) /* ---------------------------------------------------------------------- */ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump dcd command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), sortcol = 0; unwrap_flag = 0; - format_default = NULL; + format_default = nullptr; // allocate global array for atom coords @@ -115,7 +115,7 @@ void DumpDCD::openfile() { if (me == 0) { fp = fopen(filename,"wb"); - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); } } @@ -342,7 +342,7 @@ void DumpDCD::write_dcd_header(const char *remarks) strncpy(title_string,remarks,80); title_string[79] = '\0'; fwrite(title_string,80,1,fp); - cur_time=time(NULL); + cur_time=time(nullptr); tmbuf=localtime(&cur_time); memset(title_string,' ',81); strftime(title_string,80,"REMARKS Created %d %B,%Y at %H:%M",tmbuf); diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 96a338950..bbaa9038b 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -50,12 +50,12 @@ enum{NO,YES}; /* ---------------------------------------------------------------------- */ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), thetastr(NULL), phistr(NULL), cxstr(NULL), - cystr(NULL), czstr(NULL), upxstr(NULL), upystr(NULL), upzstr(NULL), - zoomstr(NULL), perspstr(NULL), diamtype(NULL), diamelement(NULL), - bdiamtype(NULL), colortype(NULL), colorelement(NULL), bcolortype(NULL), - avec_line(NULL), avec_tri(NULL), avec_body(NULL), fixptr(NULL), image(NULL), - chooseghost(NULL), bufcopy(NULL) + DumpCustom(lmp, narg, arg), thetastr(nullptr), phistr(nullptr), cxstr(nullptr), + cystr(nullptr), czstr(nullptr), upxstr(nullptr), upystr(nullptr), upzstr(nullptr), + zoomstr(nullptr), perspstr(nullptr), diamtype(nullptr), diamelement(nullptr), + bdiamtype(nullptr), colortype(nullptr), colorelement(nullptr), bcolortype(nullptr), + avec_line(nullptr), avec_tri(nullptr), avec_body(nullptr), fixptr(nullptr), image(nullptr), + chooseghost(nullptr), bufcopy(nullptr) { if (binary || multiproc) error->all(FLERR,"Invalid dump image filename"); @@ -124,16 +124,16 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : bdiam = NUMERIC; bdiamvalue = 0.5; } - char *fixID = NULL; + char *fixID = nullptr; - thetastr = phistr = NULL; + thetastr = phistr = nullptr; cflag = STATIC; cx = cy = cz = 0.5; - cxstr = cystr = czstr = NULL; + cxstr = cystr = czstr = nullptr; - upxstr = upystr = upzstr = NULL; - zoomstr = NULL; - perspstr = NULL; + upxstr = upystr = upzstr = nullptr; + zoomstr = nullptr; + perspstr = nullptr; boxflag = YES; boxdiam = 0.02; axesflag = NO; @@ -441,8 +441,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else if (i % 6 == 0) bcolortype[i] = image->color2rgb("cyan"); } } else { - bdiamtype = NULL; - bcolortype = NULL; + bdiamtype = nullptr; + bcolortype = nullptr; } // viewflag = DYNAMIC if any view parameter is dynamic @@ -458,8 +458,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : // local data maxbufcopy = 0; - chooseghost = NULL; - bufcopy = NULL; + chooseghost = nullptr; + bufcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -566,7 +566,7 @@ void DumpImage::init_style() if (atomflag && acolor == ELEMENT) { for (int i = 1; i <= ntypes; i++) { colorelement[i] = image->element2color(typenames[i]); - if (colorelement[i] == NULL) + if (colorelement[i] == nullptr) error->all(FLERR,"Invalid dump image element name"); } } @@ -606,7 +606,7 @@ void DumpImage::write() // pack buf with color & diameter - pack(NULL); + pack(nullptr); // set minmax color range if using dynamic atom color map @@ -641,7 +641,7 @@ void DumpImage::write() else image->write_PPM(fp); if (multifile) { fclose(fp); - fp = NULL; + fp = nullptr; } } } @@ -1261,7 +1261,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1269,7 +1269,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { colortype[i] = image->color2rgb(ptrs[m%ncount]); - if (colortype[i] == NULL) + if (colortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1324,7 +1324,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1332,7 +1332,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { bcolortype[i] = image->color2rgb(ptrs[m%ncount]); - if (bcolortype[i] == NULL) + if (bcolortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1356,7 +1356,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"backcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); double *color = image->color2rgb(arg[1]); - if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command"); + if (color == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); image->background[0] = static_cast (color[0]*255.0); image->background[1] = static_cast (color[1]*255.0); image->background[2] = static_cast (color[2]*255.0); @@ -1366,7 +1366,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"boxcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); image->boxcolor = image->color2rgb(arg[1]); - if (image->boxcolor == NULL) + if (image->boxcolor == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); return 2; } diff --git a/src/dump_local.cpp b/src/dump_local.cpp index a71166ec5..988ff269d 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -35,9 +35,9 @@ enum{INT,DOUBLE}; DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - label(NULL), vtype(NULL), vformat(NULL), columns(NULL), field2index(NULL), - argindex(NULL), id_compute(NULL), compute(NULL), id_fix(NULL), fix(NULL), - pack_choice(NULL) + label(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), field2index(nullptr), + argindex(nullptr), id_compute(nullptr), compute(nullptr), id_fix(nullptr), fix(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump local arguments specified"); @@ -73,12 +73,12 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : argindex = new int[nfield]; ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; // process attributes @@ -95,11 +95,11 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < size_one; i++) { if (vtype[i] == INT) strcat(format_default,"%d "); else if (vtype[i] == DOUBLE) strcat(format_default,"%g "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -180,8 +180,8 @@ void DumpLocal::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index 5f6d0b80d..951768978 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -35,7 +35,7 @@ DumpMovie::DumpMovie(LAMMPS *lmp, int narg, char **arg) : filetype = PPM; bitrate = 2000; framerate = 24; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -44,7 +44,7 @@ void DumpMovie::openfile() { char moviecmd[1024]; - if ((comm->me == 0) && (fp == NULL)) { + if ((comm->me == 0) && (fp == nullptr)) { #ifdef LAMMPS_FFMPEG sprintf(moviecmd,"ffmpeg -v error -y -r %.2f -f image2pipe -c:v ppm -i - " @@ -59,7 +59,7 @@ void DumpMovie::openfile() fp = popen(moviecmd,"w"); #endif - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Failed to open FFmpeg pipeline to " "file {}",filename)); } diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index 10ba10f99..d4352b074 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - typenames(NULL) + typenames(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xyz command"); if (binary || multiproc) error->all(FLERR,"Invalid dump xyz filename"); @@ -46,7 +46,7 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), strcpy(format_default,str); ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,13 +54,13 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), DumpXYZ::~DumpXYZ() { delete[] format_default; - format_default = NULL; + format_default = nullptr; if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -83,7 +83,7 @@ void DumpXYZ::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; @@ -114,7 +114,7 @@ int DumpXYZ::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; diff --git a/src/error.cpp b/src/error.cpp index 0ea218887..d89ea5b68 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -69,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -95,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -143,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -169,7 +169,7 @@ void Error::all(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - write to world screen only if non-NULL on this proc + write to world screen only if non-nullptr on this proc always write to universe screen forces abort of entire world (and universe) if any proc in world calls ------------------------------------------------------------------------- */ @@ -192,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be nullptr when catching command line errors if (update) update->whichflag = 0; @@ -207,7 +207,7 @@ void Error::one(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - only write to screen if non-NULL on this proc since could be file + only write to screen if non-nullptr on this proc since could be file ------------------------------------------------------------------------- */ void Error::warning(const std::string &file, int line, const std::string &str, int logflag) diff --git a/src/fix.cpp b/src/fix.cpp index 03313739a..8d6d3f882 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -33,8 +33,8 @@ int Fix::instance_total = 0; Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), extlist(NULL), vector_atom(NULL), array_atom(NULL), - vector_local(NULL), array_local(NULL), eatom(NULL), vatom(NULL) + id(nullptr), style(nullptr), extlist(nullptr), vector_atom(nullptr), array_atom(nullptr), + vector_local(nullptr), array_local(nullptr), eatom(nullptr), vatom(nullptr) { instance_me = instance_total++; diff --git a/src/fix.h b/src/fix.h index ab8dddf1d..07a222063 100644 --- a/src/fix.h +++ b/src/fix.h @@ -215,7 +215,7 @@ class Fix : protected Pointers { virtual int image(int *&, double **&) {return 0;} virtual int modify_param(int, char **) {return 0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual double memory_usage() {return 0.0;} diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index dba4fde07..52f423698 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -43,7 +43,7 @@ enum{DIAMETER,CHARGE}; /* ---------------------------------------------------------------------- */ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) +nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix adapt command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); @@ -96,7 +96,7 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].pstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].pparam = new char[n]; - adapt[nadapt].pair = NULL; + adapt[nadapt].pair = nullptr; strcpy(adapt[nadapt].pparam,arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); @@ -118,7 +118,7 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].bstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].bparam = new char[n]; - adapt[nadapt].bond = NULL; + adapt[nadapt].bond = nullptr; strcpy(adapt[nadapt].bparam,arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->nbondtypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); @@ -263,8 +263,8 @@ void FixAdapt::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; if (diamflag && atom->radius_flag) { std::string fixcmd = id + std::string("_FIX_STORE_DIAM"); @@ -340,7 +340,7 @@ void FixAdapt::init() if (ad->which == PAIR) { anypair = 1; - ad->pair = NULL; + ad->pair = nullptr; // if ad->pstyle has trailing sub-style annotation ":N", // strip it for pstyle arg to pair_match() and set nsub = N @@ -366,12 +366,12 @@ void FixAdapt::init() ad->pair = force->pair_match(psuffix,1,nsub); delete[] psuffix; } - if (ad->pair == NULL) ad->pair = force->pair_match(pstyle,1,nsub); - if (ad->pair == NULL) + if (ad->pair == nullptr) ad->pair = force->pair_match(pstyle,1,nsub); + if (ad->pair == nullptr) error->all(FLERR,"Fix adapt pair style does not exist"); void *ptr = ad->pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt pair style param not supported"); // for pair styles only parameters that are 2-d arrays in atom types or @@ -396,7 +396,7 @@ void FixAdapt::init() delete [] pstyle; } else if (ad->which == BOND){ - ad->bond = NULL; + ad->bond = nullptr; anybond = 1; int n = strlen(ad->bstyle) + 1; @@ -412,13 +412,13 @@ void FixAdapt::init() ad->bond = force->bond_match(bsuffix); delete [] bsuffix; } - if (ad->bond == NULL) ad->bond = force->bond_match(bstyle); - if (ad->bond == NULL ) + if (ad->bond == nullptr) ad->bond = force->bond_match(bstyle); + if (ad->bond == nullptr ) error->all(FLERR,"Fix adapt bond style does not exist"); void *ptr = ad->bond->extract(ad->bparam,ad->bdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt bond style param not supported"); // for bond styles, use a vector @@ -431,7 +431,7 @@ void FixAdapt::init() delete [] bstyle; } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 0983728ea..a8b7a46e4 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -36,7 +36,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), estr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix addforce command"); @@ -52,7 +52,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : ilevel_respa = 0; virial_flag = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -253,7 +253,7 @@ void FixAddForce::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index da009c55d..e4a04c6f9 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -35,8 +35,8 @@ enum{X,V,F,COMPUTE,FIX,VARIABLE}; FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), array(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command"); @@ -64,7 +64,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nvalues]; for (int i = 0; i < nvalues; i++) { - ids[i] = NULL; + ids[i] = nullptr; if (strcmp(arg[i],"x") == 0) { which[i] = X; @@ -376,7 +376,7 @@ void FixAveAtom::end_of_step() } else if (which[m] == VARIABLE) { if (array) input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1); - else input->variable->compute_atom(n,igroup,NULL,nvalues,1); + else input->variable->compute_atom(n,igroup,nullptr,nvalues,1); } } @@ -394,7 +394,7 @@ void FixAveAtom::end_of_step() nvalid = ntimestep+peratom_freq - (nrepeat-1)*nevery; modify->addstep_compute(nvalid); - if (array == NULL) return; + if (array == nullptr) return; // average the final result for the Nfreq timestep @@ -424,7 +424,7 @@ void FixAveAtom::grow_arrays(int nmax) memory->grow(array,nmax,nvalues,"fix_ave/atom:array"); array_atom = array; if (array) vector_atom = array[0]; - else vector_atom = NULL; + else vector_atom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 18fb33527..c178cf63c 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -46,12 +46,12 @@ enum{ONE,RUNNING,WINDOW}; FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), nvalues(0), nrepeat(0), - which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - fp(NULL), idchunk(NULL), varatom(NULL), - count_one(NULL), count_many(NULL), count_sum(NULL), - values_one(NULL), values_many(NULL), values_sum(NULL), - count_total(NULL), count_list(NULL), - values_total(NULL), values_list(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + fp(nullptr), idchunk(nullptr), varatom(nullptr), + count_one(nullptr), count_many(nullptr), count_sum(nullptr), + values_one(nullptr), values_many(nullptr), values_sum(nullptr), + count_total(nullptr), count_list(nullptr), + values_total(nullptr), values_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command"); @@ -88,7 +88,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : int iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"vx") == 0) { which[nvalues] = V; @@ -164,15 +164,15 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : ave = ONE; nwindow = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"norm") == 0) { @@ -225,7 +225,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/chunk file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -409,12 +409,12 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : normcount = 0; maxvar = 0; - varatom = NULL; + varatom = nullptr; - count_one = count_many = count_sum = count_total = NULL; - count_list = NULL; - values_one = values_many = values_sum = values_total = NULL; - values_list = NULL; + count_one = count_many = count_sum = count_total = nullptr; + count_list = nullptr; + values_one = values_many = values_sum = values_total = nullptr; + values_list = nullptr; maxchunk = 0; nchunk = 1; @@ -466,24 +466,24 @@ FixAveChunk::~FixAveChunk() } delete [] idchunk; - which = NULL; - argindex = NULL; - ids = NULL; - value2index = NULL; - fp = NULL; - varatom = NULL; - count_one = NULL; - count_many = NULL; - count_sum = NULL; - count_total = NULL; - count_list = NULL; - values_one = NULL; - values_many = NULL; - values_sum = NULL; - values_total = NULL; - values_list = NULL; - idchunk = NULL; - cchunk = NULL; + which = nullptr; + argindex = nullptr; + ids = nullptr; + value2index = nullptr; + fp = nullptr; + varatom = nullptr; + count_one = nullptr; + count_many = nullptr; + count_sum = nullptr; + count_total = nullptr; + count_list = nullptr; + values_one = nullptr; + values_many = nullptr; + values_sum = nullptr; + values_total = nullptr; + values_list = nullptr; + idchunk = nullptr; + cchunk = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1110,7 +1110,7 @@ void FixAveChunk::allocate() double FixAveChunk::compute_array(int i, int j) { - if (values_total == NULL) return 0.0; + if (values_total == nullptr) return 0.0; if (i >= nchunk) return 0.0; if (j < colextra) { if (cchunk->compress) { diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 031dfc26b..5576c7fb6 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -45,8 +45,8 @@ enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): Fix (lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL), - count(NULL), values(NULL), corr(NULL), save_count(NULL), save_corr(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), fp(nullptr), + count(nullptr), values(nullptr), corr(nullptr), save_count(nullptr), save_corr(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/correlate command"); @@ -112,11 +112,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): ave = ONE; startstep = 0; prefactor = 1.0; - fp = NULL; + fp = nullptr; overwrite = 0; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"type") == 0) { @@ -147,7 +147,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/correlate file {}:"" {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 3a9346498..4d1cd5b2d 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -45,10 +45,10 @@ enum{IGNORE,END,EXTRA}; FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), fp(NULL), stats_list(NULL), - bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL), - coord(NULL), vector(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), fp(nullptr), stats_list(nullptr), + bin(nullptr), bin_total(nullptr), bin_all(nullptr), bin_list(nullptr), + coord(nullptr), vector(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command"); @@ -120,41 +120,41 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[i],"x") == 0) { which[i] = X; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"y") == 0) { which[i] = X; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"z") == 0) { which[i] = X; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vx") == 0) { which[i] = V; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vy") == 0) { which[i] = V; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vz") == 0) { which[i] = V; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fx") == 0) { which[i] = F; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fy") == 0) { which[i] = F; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fz") == 0) { which[i] = F; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if ((strncmp(arg[i],"c_",2) == 0) || (strncmp(arg[i],"f_",2) == 0) || @@ -467,9 +467,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : bin_all = new double[nbins]; coord = new double[nbins]; - stats_list = NULL; - bin_list = NULL; - vector = NULL; + stats_list = nullptr; + bin_list = nullptr; + vector = nullptr; maxatom = 0; if (ave == WINDOW) { @@ -944,16 +944,16 @@ void FixAveHisto::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; kind = DEFAULT; ave = ONE; startstep = 0; mode = SCALAR; beyond = IGNORE; overwrite = 0; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -962,7 +962,7 @@ void FixAveHisto::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/histo file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 5e93df031..586c36af8 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -126,7 +126,7 @@ void FixAveHistoWeight::end_of_step() // calculate weight factors which are 2nd value (i = 1) double weight = 0.0; - double *weights = NULL; + double *weights = nullptr; int stride = 0; i = 1; @@ -270,11 +270,11 @@ void FixAveHistoWeight::end_of_step() // atom attributes - if (which[i] == X && weights != NULL) + if (which[i] == X && weights != nullptr) bin_atoms_weights(&atom->x[0][j],3,weights,stride); - else if (which[i] == V && weights != NULL) + else if (which[i] == V && weights != nullptr) bin_atoms_weights(&atom->v[0][j],3,weights,stride); - else if (which[i] == F && weights != NULL) + else if (which[i] == F && weights != nullptr) bin_atoms_weights(&atom->f[0][j],3,weights,stride); // invoke compute if not previously invoked diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 9c493b984..b40a7eb00 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -43,11 +43,11 @@ enum{SCALAR,VECTOR}; FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - offcol(NULL), varlen(NULL), ids(NULL), - fp(NULL), offlist(NULL), format(NULL), format_user(NULL), - vector(NULL), vector_total(NULL), vector_list(NULL), - column(NULL), array(NULL), array_total(NULL), array_list(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + offcol(nullptr), varlen(nullptr), ids(nullptr), + fp(nullptr), offlist(nullptr), format(nullptr), format_user(nullptr), + vector(nullptr), vector_total(nullptr), vector_list(nullptr), + column(nullptr), array(nullptr), array_total(nullptr), array_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/time command"); @@ -243,7 +243,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // nrows = # of rows in output array // if all columns are variable length, just set nrows = 1 for now - column = NULL; + column = nullptr; if (mode == VECTOR) { if (all_variable_length == 0) nrows = column_length(0); else nrows = 1; @@ -304,10 +304,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; - array = array_total = NULL; - array_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; + array = array_total = nullptr; + array_list = nullptr; if (mode == SCALAR) { vector = new double[nvalues]; @@ -321,7 +321,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // VECTOR mode produces either a vector or array // intensive/extensive flags set by compute,fix,variable that produces value - extlist = NULL; + extlist = nullptr; if (mode == SCALAR) { if (nvalues == 1) { @@ -1022,18 +1022,18 @@ void FixAveTime::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; mode = SCALAR; noff = 0; - offlist = NULL; + offlist = nullptr; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -1042,7 +1042,7 @@ void FixAveTime::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/time file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 00ec0d67b..324f6eaa6 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL}; FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix aveforce command"); @@ -46,7 +46,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -82,7 +82,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -197,7 +197,7 @@ void FixAveForce::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -265,7 +265,7 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index 7cee83537..735b6b3bd 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -35,7 +35,7 @@ enum{SHIFT,BISECTION}; /* ---------------------------------------------------------------------- */ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), balance(NULL), irregular(NULL) + Fix(lmp, narg, arg), balance(nullptr), irregular(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix balance command"); diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 5fd9ef190..8d8b4af10 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -43,7 +43,7 @@ enum{ISO,ANISO,TRICLINIC}; FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix box/relax command"); @@ -395,7 +395,7 @@ void FixBoxRelax::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index 92fd42f3d..edeaf60f4 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -34,7 +34,7 @@ enum{COMPUTE,FIX,VARIABLE}; FixController::FixController(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pvID(NULL), cvID(NULL) + pvID(nullptr), cvID(nullptr) { if (narg != 11) error->all(FLERR,"Illegal fix controller command"); diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index b4c36ca43..4d3b1c647 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -42,7 +42,7 @@ enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE}; /* ---------------------------------------------------------------------- */ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -rfix(NULL), irregular(NULL), set(NULL) +rfix(nullptr), irregular(nullptr), set(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix deform command"); @@ -353,7 +353,7 @@ rfix(NULL), irregular(NULL), set(NULL) flip = 0; if (force_reneighbor) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; TWOPI = 2.0*MY_PI; } @@ -618,7 +618,7 @@ void FixDeform::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index be2a74d81..02d76b8c2 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -28,7 +28,7 @@ using namespace FixConst; FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - flist(NULL) + flist(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command"); diff --git a/src/fix_external.cpp b/src/fix_external.cpp index 1db7e1529..c44261b33 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -29,7 +29,7 @@ enum{PF_CALLBACK,PF_ARRAY}; FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fexternal(NULL), caller_vector(NULL) + fexternal(nullptr), caller_vector(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix external command"); @@ -53,7 +53,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : if (napply <= 0) error->all(FLERR,"Illegal fix external command"); } else error->all(FLERR,"Illegal fix external command"); - callback = NULL; + callback = nullptr; // perform initial allocation of atom-based array // register with Atom class @@ -66,7 +66,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : // optional vector of values provided by caller // vector_flag and size_vector are setup via set_vector_length() - caller_vector = NULL; + caller_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ int FixExternal::setmask() void FixExternal::init() { - if (mode == PF_CALLBACK && callback == NULL) + if (mode == PF_CALLBACK && callback == nullptr) error->all(FLERR,"Fix external callback function not set"); } diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 6dff93738..abef474b4 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -37,8 +37,8 @@ enum{CONSTANT,EQUAL}; // same as FixPour FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL), - xstr(NULL), ystr(NULL), zstr(NULL) + mstr(nullptr), vstr(nullptr), pstr(nullptr), tstr(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix gravity command"); @@ -49,7 +49,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - mstr = vstr = pstr = tstr = xstr = ystr = zstr = NULL; + mstr = vstr = pstr = tstr = xstr = ystr = zstr = nullptr; mstyle = vstyle = pstyle = tstyle = xstyle = ystyle = zstyle = CONSTANT; if (strstr(arg[3],"v_") == arg[3]) { @@ -394,5 +394,5 @@ void *FixGravity::extract(const char *name, int &dim) dim = 1; return (void *) gvec; } - return NULL; + return nullptr; } diff --git a/src/fix_group.cpp b/src/fix_group.cpp index bb51fafa1..108a97157 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -34,7 +34,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), idvar(NULL), idprop(NULL) +idregion(nullptr), idvar(nullptr), idprop(nullptr) { // dgroupbit = bitmask of dynamic group // group ID is last part of fix ID @@ -210,9 +210,9 @@ void FixGroup::set_group() // operate differently due to invocation this early in timestep // e.g. perform ghost comm update due to atoms having just moved - double *var = NULL; - int *ivector = NULL; - double *dvector = NULL; + double *var = nullptr; + int *ivector = nullptr; + double *dvector = nullptr; if (varflag) { update->post_integrate = 1; @@ -265,5 +265,5 @@ void *FixGroup::extract(const char *str, int &/*unused*/) if (strcmp(str,"property") == 0 && propflag) return (void *) idprop; if (strcmp(str,"variable") == 0 && varflag) return (void *) idvar; if (strcmp(str,"region") == 0 && regionflag) return (void *) idregion; - return NULL; + return nullptr; } diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index f8222e3ec..42f5c46a8 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -37,7 +37,7 @@ enum{NOMSG,YESMSG}; /* ---------------------------------------------------------------------- */ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idvar(NULL), dlimit_path(NULL) + Fix(lmp, narg, arg), idvar(nullptr), dlimit_path(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix halt command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); @@ -45,7 +45,7 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : // comparison args - idvar = NULL; + idvar = nullptr; int iarg = 4; if (strcmp(arg[iarg],"tlimit") == 0) { diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index e2eb39932..3c9134194 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -39,7 +39,7 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) +idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix heat command"); @@ -50,7 +50,7 @@ idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix heat command"); - hstr = NULL; + hstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; @@ -192,7 +192,7 @@ void FixHeat::end_of_step() // vsub = velocity subtracted from each atom to preserve momentum // overall KE cannot go negative - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index ae58f2791..e96ad7ab8 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -40,7 +40,7 @@ enum{INSIDE,OUTSIDE}; FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL), pstr(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr), pstr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix indent command"); @@ -407,7 +407,7 @@ void FixIndent::options(int narg, char **arg) if (narg < 0) error->all(FLERR,"Illegal fix indent command"); istyle = NONE; - xstr = ystr = zstr = rstr = pstr = NULL; + xstr = ystr = zstr = rstr = pstr = nullptr; xvalue = yvalue = zvalue = rvalue = pvalue = 0.0; scaleflag = 1; side = OUTSIDE; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 9d0b5f28f..5cfb860b5 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -53,8 +53,8 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gjfflag(0), gfactor1(NULL), gfactor2(NULL), ratio(NULL), tstr(NULL), - flangevin(NULL), tforce(NULL), franprev(NULL), lv(NULL), id_temp(NULL), random(NULL) + gjfflag(0), gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), tstr(nullptr), + flangevin(nullptr), tforce(nullptr), franprev(nullptr), lv(nullptr), id_temp(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix langevin command"); @@ -154,10 +154,10 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix langevin command"); } - // set temperature = NULL, user can override via fix_modify if wants bias + // set temperature = nullptr, user can override via fix_modify if wants bias - id_temp = NULL; - temperature = NULL; + id_temp = nullptr; + temperature = nullptr; energy = 0.0; @@ -165,11 +165,11 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : // compute_scalar checks for this and returns 0.0 // if flangevin_allocated is not set - flangevin = NULL; + flangevin = nullptr; flangevin_allocated = 0; - franprev = NULL; - lv = NULL; - tforce = NULL; + franprev = nullptr; + lv = nullptr; + tforce = nullptr; maxatom1 = maxatom2 = 0; // setup atom-based array for franprev @@ -1104,7 +1104,7 @@ void *FixLangevin::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 93b13fac4..a3814f185 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -23,7 +23,7 @@ using namespace FixConst; FixMinimize::FixMinimize(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvector(0), peratom(NULL), vectors(NULL) + nvector(0), peratom(nullptr), vectors(nullptr) { // register callback to this fix from Atom class // don't perform initial allocation here, must wait until add_vector() diff --git a/src/fix_move.cpp b/src/fix_move.cpp index d6f61af09..aaa2422fa 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -46,10 +46,10 @@ enum{EQUAL,ATOM}; FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), vxvarstr(NULL), - vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), toriginal(NULL), qoriginal(NULL), - displace(NULL), velocity(NULL) + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), vxvarstr(nullptr), + vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), toriginal(nullptr), qoriginal(nullptr), + displace(nullptr), velocity(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix move command"); @@ -127,37 +127,37 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (narg < 10) error->all(FLERR,"Illegal fix move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -259,7 +259,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : atom->add_callback(0); atom->add_callback(1); - displace = velocity = NULL; + displace = velocity = nullptr; // AtomVec pointers to retrieve per-atom storage of extra quantities @@ -297,7 +297,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (quat_flag) { double *quat; for (int i = 0; i < nlocal; i++) { - quat = NULL; + quat = nullptr; if (mask[i] & groupbit) { if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; @@ -439,9 +439,9 @@ void FixMove::init() memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; if (strstr(update->integrate_style,"respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; @@ -664,7 +664,7 @@ void FixMove::initial_integrate(int /*vflag*/) // angmom for ellipsoids, tris, and bodies if (angmom_flag) { - quat = inertia = NULL; + quat = inertia = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) { quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; shape = avec_ellipsoid->bonus[ellipsoid[i]].shape; @@ -701,7 +701,7 @@ void FixMove::initial_integrate(int /*vflag*/) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -873,7 +873,7 @@ void FixMove::initial_integrate(int /*vflag*/) } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMove::final_integrate() @@ -1121,7 +1121,7 @@ void FixMove::set_arrays(int i) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 43415a6ef..766d4de14 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -34,8 +34,8 @@ enum{DEFAULT,NPARTNER,PERPARTNER}; // also set in fix neigh/history/omp FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), npartner(NULL), partner(NULL), valuepartner(NULL), - ipage_atom(NULL), dpage_atom(NULL), ipage_neigh(NULL), dpage_neigh(NULL) + pair(nullptr), npartner(nullptr), partner(nullptr), valuepartner(nullptr), + ipage_atom(nullptr), dpage_atom(nullptr), ipage_neigh(nullptr), dpage_neigh(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command"); @@ -70,16 +70,16 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : // other per-atom vectors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; maxatom = 0; // per-atom and per-neighbor data structs - ipage_atom = NULL; - dpage_atom = NULL; - ipage_neigh = NULL; - dpage_neigh = NULL; + ipage_atom = nullptr; + dpage_atom = nullptr; + ipage_neigh = nullptr; + dpage_neigh = nullptr; // initialize npartner to 0 so neighbor list creation is OK the 1st time @@ -120,13 +120,13 @@ FixNeighHistory::~FixNeighHistory() // to better detect use-after-delete errors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; - pair = NULL; - npartner = NULL; - partner = NULL; - valuepartner = NULL; + pair = nullptr; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,7 +172,7 @@ void FixNeighHistory::init() void FixNeighHistory::allocate_pages() { int create = 0; - if (ipage_atom == NULL) create = 1; + if (ipage_atom == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -279,7 +279,7 @@ void FixNeighHistory::pre_exchange_onesided() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -383,7 +383,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -392,7 +392,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -506,7 +506,7 @@ void FixNeighHistory::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -864,9 +864,9 @@ int FixNeighHistory::pack_restart(int i, double *buf) void FixNeighHistory::unpack_restart(int nlocal, int nth) { - // ipage_atom = NULL if being called from granular pair style init() + // ipage_atom = nullptr if being called from granular pair style init() - if (ipage_atom == NULL) allocate_pages(); + if (ipage_atom == nullptr) allocate_pages(); // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 0e3dc8931..aa353b19a 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -51,10 +51,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command"); @@ -72,7 +72,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -88,8 +88,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; // turn on tilt factor scaling, whenever applicable @@ -579,10 +579,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -740,7 +740,7 @@ void FixNH::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -767,7 +767,7 @@ void FixNH::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1768,7 +1768,7 @@ void *FixNH::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 145d60e8d..cd186eb9a 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -40,8 +40,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), numdiff_forces(NULL), - temp_x(NULL), temp_f(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), + temp_x(nullptr), temp_f(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix numdiff command"); diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index a90bf86c5..a156c0d58 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -37,7 +37,7 @@ enum{ISO,ANISO}; FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command"); @@ -239,7 +239,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : pflag = 1; nrigid = 0; - rfix = NULL; + rfix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,7 +308,7 @@ void FixPressBerendsen::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_print.cpp b/src/fix_print.cpp index 78fceea18..c8a7c8e61 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -29,7 +29,7 @@ using namespace FixConst; FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), string(NULL), copy(NULL), work(NULL), var_print(NULL) + fp(nullptr), string(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix print command"); if (strstr(arg[3],"v_") == arg[3]) { @@ -54,9 +54,9 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : // parse optional args - fp = NULL; + fp = nullptr; screenflag = 1; - char *title = NULL; + char *title = nullptr; int iarg = 5; while (iarg < narg) { @@ -65,7 +65,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : if (me == 0) { if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix print file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 07108721c..35ac20e37 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -30,7 +30,7 @@ enum{MOLECULE,CHARGE,RMASS,INTEGER,DOUBLE}; FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalue(0), style(NULL), index(NULL), astyle(NULL) + nvalue(0), style(nullptr), index(nullptr), astyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix property/atom command"); @@ -152,21 +152,21 @@ FixPropertyAtom::~FixPropertyAtom() if (border) atom->delete_callback(id,2); // deallocate per-atom vectors in Atom class - // set ptrs to NULL, so they no longer exist for Atom class + // set ptrs to nullptr, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { atom->molecule_flag = 0; memory->destroy(atom->molecule); - atom->molecule = NULL; + atom->molecule = nullptr; } else if (style[m] == CHARGE) { atom->q_flag = 0; memory->destroy(atom->q); - atom->q = NULL; + atom->q = nullptr; } else if (style[m] == RMASS) { atom->rmass_flag = 0; memory->destroy(atom->rmass); - atom->rmass = NULL; + atom->rmass = nullptr; } else if (style[m] == INTEGER) { atom->remove_custom(0,index[m]); } else if (style[m] == DOUBLE) { @@ -237,13 +237,13 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,fmt::format("Too few lines in {} section of data file",keyword)); int format_ok = 1; for (j = 1; j < nwords; j++) { - values[j] = strtok(NULL," \t\n\r\f"); - if (values[j] == NULL) format_ok = 0; + values[j] = strtok(nullptr," \t\n\r\f"); + if (values[j] == nullptr) format_ok = 0; } if (!format_ok) error->all(FLERR,fmt::format("Incorrect {} format in data file",keyword)); diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 2e10b15ff..cee1ed4cc 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -23,7 +23,7 @@ using namespace FixConst; FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - count(NULL), extra(NULL) + count(nullptr), extra(nullptr) { nextra = utils::inumeric(FLERR,arg[3],false,lmp); int nfix = utils::inumeric(FLERR,arg[4],false,lmp); diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index b116f8cca..abed4b477 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -25,7 +25,7 @@ using namespace FixConst; FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - store_torque(0), f_level(NULL), t_level(NULL) + store_torque(0), f_level(nullptr), t_level(nullptr) { // nlevels = # of rRESPA levels @@ -41,8 +41,8 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - f_level = NULL; - t_level = NULL; + f_level = nullptr; + t_level = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); } diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 4f675bf7b..31e32a478 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -45,9 +45,9 @@ enum{BOND,LBOUND,ANGLE,DIHEDRAL}; FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rstyle(NULL), mult(NULL), ids(NULL), kstart(NULL), kstop(NULL), - deqstart(NULL), deqstop(NULL), target(NULL), cos_target(NULL), - sin_target(NULL) + rstyle(nullptr), mult(nullptr), ids(nullptr), kstart(nullptr), kstop(nullptr), + deqstart(nullptr), deqstop(nullptr), target(nullptr), cos_target(nullptr), + sin_target(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix restrain command"); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 229890c5d..3acd44964 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -35,7 +35,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix setforce command"); @@ -46,7 +46,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : extvector = 1; respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -82,7 +82,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -228,7 +228,7 @@ void FixSetForce::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -305,7 +305,7 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) foriginal[1] += foriginal_saved[1]; foriginal[2] += foriginal_saved[2]; } else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 2d695add2..ac08cbb49 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -37,7 +37,7 @@ enum{TETHER,COUPLE}; FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 9) error->all(FLERR,"Illegal fix spring command"); diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index d8de88bd6..b7ffea3d6 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -35,7 +35,7 @@ using namespace FixConst; FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idchunk(NULL), idcom(NULL), com0(NULL), fcom(NULL) + idchunk(nullptr), idcom(nullptr), com0(nullptr), fcom(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix spring/chunk command"); @@ -155,7 +155,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // will be unlocked in destructor // necessary b/c this fix stores original COM - if (com0 == NULL) cchunk->lock(this,update->ntimestep,-1); + if (com0 == nullptr) cchunk->lock(this,update->ntimestep,-1); // calculate current centers of mass for each chunk // extract pointers from idchunk and idcom @@ -170,7 +170,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // check if first time cchunk was queried via ccom // if so, allocate com0,fcom and store initial COM - if (com0 == NULL) { + if (com0 == nullptr) { memory->create(com0,nchunk,3,"spring/chunk:com0"); memory->create(fcom,nchunk,3,"spring/chunk:fcom"); diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 5715e7eb8..280539505 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -67,7 +67,7 @@ void FixSpringRG::init() { masstotal = group->mass(igroup); - // if rg0 was specified as NULL, compute current Rg + // if rg0 was specified as nullptr, compute current Rg // only occurs on 1st run if (rg0_flag) { diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 8e7b3eb92..12e933cd0 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -33,7 +33,7 @@ using namespace FixConst; FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xoriginal(NULL) + xoriginal(nullptr) { if ((narg < 4) || (narg > 5)) error->all(FLERR,"Illegal fix spring/self command"); @@ -70,7 +70,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3eb207525..d8d6dbf90 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -28,7 +28,7 @@ enum{UNKNOWN,GLOBAL,PERATOM}; /* ---------------------------------------------------------------------- */ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -vstore(NULL), astore(NULL), rbuf(NULL) +vstore(nullptr), astore(nullptr), rbuf(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix store command"); @@ -69,8 +69,8 @@ vstore(NULL), astore(NULL), rbuf(NULL) if (nvalues == 1) vecflag = 1; } - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; // allocate vector or array and restart buffer rbuf // for PERATOM, register with Atom class @@ -84,7 +84,7 @@ vstore(NULL), astore(NULL), rbuf(NULL) grow_arrays(atom->nmax); atom->add_callback(0); if (restart_peratom) atom->add_callback(1); - rbuf = NULL; + rbuf = nullptr; } // zero the storage @@ -145,8 +145,8 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_caller == 1) vecflag = 1; @@ -199,8 +199,8 @@ void FixStore::restart(char *buf) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_restart == 1) vecflag = 1; diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 5c25f0e16..ae01848d7 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -26,7 +26,7 @@ using namespace FixConst; FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - foriginal(NULL) + foriginal(nullptr) { if (narg < 3) error->all(FLERR,"Illegal fix store/coord command"); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index fd4563b7a..4ce65195b 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -38,9 +38,9 @@ enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME}; FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), values(NULL), - vbuf(NULL), pack_choice(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), values(nullptr), + vbuf(nullptr), pack_choice(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix store/state command"); @@ -64,7 +64,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : int iarg = 4; while (iarg < narg) { which[nvalues] = KEYWORD; - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"id") == 0) { pack_choice[nvalues++] = &FixStoreState::pack_id; @@ -348,7 +348,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - values = NULL; + values = nullptr; grow_arrays(atom->nmax); atom->add_callback(0); atom->add_callback(1); @@ -479,7 +479,7 @@ void FixStoreState::end_of_step() // fill vector or array with per-atom values if (values) vbuf = &values[0][0]; - else vbuf = NULL; + else vbuf = nullptr; for (int m = 0; m < nvalues; m++) { if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); @@ -572,7 +572,7 @@ void FixStoreState::grow_arrays(int nmax) memory->grow(values,nmax,nvalues,"store/state:values"); if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; - else vector_atom = NULL; + else vector_atom = nullptr; } else array_atom = values; } diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index ec2965d07..610cc7310 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -37,7 +37,7 @@ enum{CONSTANT,EQUAL}; FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg != 6) error->all(FLERR,"Illegal fix temp/berendsen command"); @@ -50,7 +50,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : global_freq = nevery; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -280,5 +280,5 @@ void *FixTempBerendsen::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index cf7e9e9fe..c8016f320 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -43,7 +43,7 @@ enum{CONSTANT,EQUAL}; FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - vhold(NULL), tstr(NULL), id_temp(NULL), random(NULL) + vhold(nullptr), tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csld command"); @@ -56,7 +56,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -90,7 +90,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - vhold = NULL; + vhold = nullptr; nmax = -1; energy = 0.0; } @@ -108,7 +108,7 @@ FixTempCSLD::~FixTempCSLD() delete random; memory->destroy(vhold); - vhold = NULL; + vhold = nullptr; nmax = -1; } @@ -350,5 +350,5 @@ void *FixTempCSLD::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index c62090510..649f0d987 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -120,7 +120,7 @@ double FixTempCSVR::resamplekin(double ekin_old, double ekin_new){ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), random(NULL) + tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csvr command"); @@ -133,7 +133,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; @@ -383,5 +383,5 @@ void *FixTempCSVR::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index b5cb9c9a1..bd3ae9ecd 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -37,7 +37,7 @@ enum{CONSTANT,EQUAL}; FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command"); @@ -50,7 +50,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; dynamic_group_allow = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; tstr = new char[n]; @@ -278,5 +278,5 @@ void *FixTempRescale::extract(const char *str, int &dim) dim = 0; return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 12e36d890..17520d191 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -41,7 +41,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nfileevery(0), fp(NULL), xf(NULL), xold(NULL) +nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tmd command"); @@ -74,7 +74,7 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) if (narg != 7) error->all(FLERR,"Illegal fix tmd command"); if (me == 0) { fp = fopen(arg[6],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix tmd file {}: {}", arg[6], utils::getsyserror())); fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back", @@ -396,7 +396,7 @@ void FixTMD::readfile(char *file) int firstline = 1; int ncount = 0; - char *eof = NULL; + char *eof = nullptr; xprd = yprd = zprd = -1.0; do { @@ -404,7 +404,7 @@ void FixTMD::readfile(char *file) m = 0; for (nlines = 0; nlines < CHUNK; nlines++) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) break; + if (eof == nullptr) break; m += strlen(&buffer[m]); } if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); @@ -486,7 +486,7 @@ void FixTMD::readfile(char *file) } bufptr = next + 1; } - } while (eof != NULL); + } while (eof != nullptr); // clean up @@ -540,7 +540,7 @@ void FixTMD::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 6bcdfe948..141f00e65 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -38,7 +38,7 @@ enum{SCALAR,VECTOR}; FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), vector(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), vector(nullptr), array(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix vector command"); @@ -154,8 +154,8 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : // ncount = current size of vector or array - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; ncount = ncountmax = 0; if (nvalues == 1) size_vector = 0; else size_array_rows = 0; diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index 08649280d..d07d547c2 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -27,7 +27,7 @@ using namespace FixConst; FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gamma(NULL) + gamma(nullptr) { dynamic_group_allow = 1; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index cb822f109..2394922e2 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -51,7 +51,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : fldflag = 0; int pbcflag = 0; - for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = NULL; + for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = nullptr; int iarg = 3; while (iarg < narg) { diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index fc3735cfb..6ec3a27a5 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -34,7 +34,7 @@ enum{LJ93,LJ126,LJ1043,COLLOID,HARMONIC,MORSE}; FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/region command"); diff --git a/src/force.cpp b/src/force.cpp index 701113d7e..68cf5b247 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -54,12 +54,12 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) qqr2e_lammps_real = 332.06371; // these constants are toggled qqr2e_charmm_real = 332.0716; // by new CHARMM pair styles - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; char *str = (char *) "none"; int n = strlen(str) + 1; @@ -76,7 +76,7 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) kspace_style = new char[n]; strcpy(kspace_style,str); - pair_restart = NULL; + pair_restart = nullptr; create_factories(); } @@ -159,12 +159,12 @@ Force::~Force() if (improper) delete improper; if (kspace) delete kspace; - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; delete pair_map; delete bond_map; @@ -233,9 +233,9 @@ void Force::create_pair(const std::string &style, int trysuffix) delete [] pair_style; if (pair) delete pair; if (pair_restart) delete [] pair_restart; - pair_style = NULL; - pair = NULL; - pair_restart = NULL; + pair_style = nullptr; + pair = nullptr; + pair_restart = nullptr; int sflag; pair = new_pair(style,trysuffix,sflag); @@ -270,7 +270,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (pair_map->find(style) != pair_map->end()) { PairCreator &pair_creator = (*pair_map)[style]; return pair_creator(lmp); @@ -278,7 +278,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("pair",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -296,7 +296,7 @@ Pair *Force::pair_creator(LAMMPS *lmp) if exact, then style name must be exact match to word if not exact, style name must contain word if nsub > 0, match Nth hybrid sub-style - return NULL if no match or if nsub=0 and multiple sub-styles match + return nullptr if no match or if nsub=0 and multiple sub-styles match ------------------------------------------------------------------------- */ Pair *Force::pair_match(const std::string &word, int exact, int nsub) @@ -318,13 +318,13 @@ Pair *Force::pair_match(const std::string &word, int exact, int nsub) if (count == 1) return hybrid->styles[iwhich]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- return style name of Pair class that matches Pair ptr called by Neighbor::print_neigh_info() - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ char *Force::pair_match_ptr(Pair *ptr) @@ -337,7 +337,7 @@ char *Force::pair_match_ptr(Pair *ptr) if (ptr == hybrid->styles[i]) return hybrid->keywords[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -381,7 +381,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (bond_map->find(style) != bond_map->end()) { BondCreator &bond_creator = (*bond_map)[style]; return bond_creator(lmp); @@ -389,7 +389,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("bond",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -414,7 +414,7 @@ Bond *Force::bond_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -458,7 +458,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (angle_map->find(style) != angle_map->end()) { AngleCreator &angle_creator = (*angle_map)[style]; return angle_creator(lmp); @@ -466,7 +466,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("angle",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -491,7 +491,7 @@ Angle *Force::angle_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -535,7 +535,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (dihedral_map->find(style) != dihedral_map->end()) { DihedralCreator &dihedral_creator = (*dihedral_map)[style]; return dihedral_creator(lmp); @@ -543,7 +543,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("dihedral",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -568,7 +568,7 @@ Dihedral *Force::dihedral_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -612,7 +612,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (improper_map->find(style) != improper_map->end()) { ImproperCreator &improper_creator = (*improper_map)[style]; return improper_creator(lmp); @@ -620,7 +620,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("improper",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -645,7 +645,7 @@ Improper *Force::improper_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -689,7 +689,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (kspace_map->find(style) != kspace_map->end()) { KSpaceCreator &kspace_creator = (*kspace_map)[style]; return kspace_creator(lmp); @@ -697,7 +697,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("kspace",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -714,14 +714,14 @@ KSpace *Force::kspace_creator(LAMMPS *lmp) return ptr to Kspace class if matches word if exact, then style name must be exact match to word if not exact, style name must contain word - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ KSpace *Force::kspace_match(const std::string &word, int exact) { if (exact && (word == kspace_style)) return kspace; else if (!exact && utils::strmatch(kspace_style,word)) return kspace; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/group.cpp b/src/group.cpp index a2e20a6ab..6b9121f50 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -58,7 +58,7 @@ Group::Group(LAMMPS *lmp) : Pointers(lmp) inversemask = new int[MAX_GROUP]; dynamic = new int[MAX_GROUP]; - for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL; + for (int i = 0; i < MAX_GROUP; i++) names[i] = nullptr; for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i; for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0; for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0; @@ -126,7 +126,7 @@ void Group::assign(int narg, char **arg) modify->delete_fix(std::string("GROUP_") + names[igroup]); delete [] names[igroup]; - names[igroup] = NULL; + names[igroup] = nullptr; dynamic[igroup] = 0; ngroup--; @@ -235,8 +235,8 @@ void Group::assign(int narg, char **arg) bound2 = utils::tnumeric(FLERR,arg[4],false,lmp); } else if (narg != 4) error->all(FLERR,"Illegal group command"); - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -296,8 +296,8 @@ void Group::assign(int narg, char **arg) // args = list of values } else { - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -310,9 +310,9 @@ void Group::assign(int narg, char **arg) if (strchr(arg[iarg],':')) { ptr = strtok(arg[iarg],":"); start = utils::tnumeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL,":"); + ptr = strtok(nullptr,":"); stop = utils::tnumeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL,":"); + ptr = strtok(nullptr,":"); if (ptr) delta = utils::tnumeric(FLERR,ptr,false,lmp); } else { start = stop = utils::tnumeric(FLERR,arg[iarg],false,lmp); @@ -617,7 +617,7 @@ int Group::find_or_create(const char *name) int Group::find_unused() { for (int igroup = 0; igroup < MAX_GROUP; igroup++) - if (names[igroup] == NULL) return igroup; + if (names[igroup] == nullptr) return igroup; return -1; } @@ -654,7 +654,7 @@ void Group::add_molecules(int /*igroup*/, int bit) for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; molbit = bit; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -724,7 +724,7 @@ void Group::read_restart(FILE *fp) for (i = 0; i < MAX_GROUP; i++) delete [] names[i]; - if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&ngroup,1,MPI_INT,0,world); // use count to not change restart format with deleted groups @@ -733,17 +733,17 @@ void Group::read_restart(FILE *fp) int count = 0; for (i = 0; i < MAX_GROUP; i++) { if (count == ngroup) { - names[i] = NULL; + names[i] = nullptr; continue; } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n) { names[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(names[i],n,MPI_CHAR,0,world); count++; - } else names[i] = NULL; + } else names[i] = nullptr; } } diff --git a/src/image.cpp b/src/image.cpp index 755be587d..6912bdee8 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -74,8 +74,8 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) // colors ncolors = 0; - username = NULL; - userrgb = NULL; + username = nullptr; + userrgb = nullptr; boxcolor = color2rgb("yellow"); background[0] = background[1] = background[2] = 0; @@ -112,7 +112,7 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) backLightColor[1] = 0.9; backLightColor[2] = 0.9; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1029,13 +1029,13 @@ void Image::write_PNG(FILE *fp) png_structp png_ptr; png_infop info_ptr; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (!png_ptr) return; info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, NULL); + png_destroy_write_struct(&png_ptr, nullptr); return; } @@ -1166,7 +1166,7 @@ int Image::addcolor(char *name, double r, double g, double b) if index < 0, return ptr to -index-1 color from userrgb if index = 0, search the 2 lists of color names for the string color search user-defined color names first, then the list of NCOLORS names - return a pointer to the 3 floating point RGB values or NULL if didn't find + return a pointer to the 3 floating point RGB values or nullptr if didn't find ------------------------------------------------------------------------- */ double *Image::color2rgb(const char *color, int index) @@ -1458,11 +1458,11 @@ double *Image::color2rgb(const char *color, int index) }; if (index > 0) { - if (index > NCOLORS) return NULL; + if (index > NCOLORS) return nullptr; return rgb[index-1]; } if (index < 0) { - if (-index > ncolors) return NULL; + if (-index > ncolors) return nullptr; return userrgb[-index-1]; } @@ -1472,7 +1472,7 @@ double *Image::color2rgb(const char *color, int index) for (int i = 0; i < NCOLORS; i++) if (strcmp(color,name[i]) == 0) return rgb[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1620,7 +1620,7 @@ double *Image::element2color(char *element) for (int i = 0; i < NELEMENTS; i++) if (strcmp(element,name[i]) == 0) return rgb[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1791,13 +1791,13 @@ int ColorMap::reset(int narg, char **arg) if (n+1 > narg) return 1; mentry[i].color = image->color2rgb(arg[n]); } else if (expandflag == 1) { - mentry[i].color = image->color2rgb(NULL,i+1); + mentry[i].color = image->color2rgb(nullptr,i+1); } else if (expandflag == 2) { - mentry[i].color = image->color2rgb(NULL,-(i+1)); + mentry[i].color = image->color2rgb(nullptr,-(i+1)); } n += 1; } - if (mentry[i].color == NULL) return 1; + if (mentry[i].color == nullptr) return 1; } if (mstyle == CONTINUOUS) { @@ -1915,5 +1915,5 @@ double *ColorMap::value2color(double value) return mentry[ibin%nentry].color; } - return NULL; + return nullptr; } diff --git a/src/improper.cpp b/src/improper.cpp index ad79a1a97..c657530a4 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -33,10 +33,10 @@ Improper::Improper(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 096e0c361..474d8c0c5 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -160,7 +160,7 @@ void ImproperHybrid::allocate() maximproper = new int[nstyles]; improperlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maximproper[m] = 0; - for (int m = 0; m < nstyles; m++) improperlist[m] = NULL; + for (int m = 0; m < nstyles; m++) improperlist[m] = nullptr; } /* ---------------------------------------------------------------------- */ @@ -325,7 +325,7 @@ void ImproperHybrid::write_restart(FILE *fp) void ImproperHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Improper*[nstyles]; keywords = new char*[nstyles]; @@ -334,10 +334,10 @@ void ImproperHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_improper(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/info.cpp b/src/info.cpp index 87161e9ca..3c0003db0 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -259,10 +259,10 @@ void Info::command(int narg, char **arg) } } - if (out == NULL) return; + if (out == nullptr) return; fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n",out); - time_t now = time(NULL); + time_t now = time(nullptr); fmt::print(out,"Printed on {}\n",ctime(&now)); if (flags & CONFIG) { @@ -792,7 +792,7 @@ void Info::command_styles(FILE *out) bool Info::is_active(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; const char *style = "none"; if (strcmp(category,"package") == 0) { @@ -813,7 +813,7 @@ bool Info::is_active(const char *category, const char *name) else error->all(FLERR,"Unknown name for info newton category"); } else if (strcmp(category,"pair") == 0) { - if (force->pair == NULL) return false; + if (force->pair == nullptr) return false; if (strcmp(name,"single") == 0) return (force->pair->single_enable != 0); else if (strcmp(name,"respa") == 0) return (force->pair->respa_enable != 0); else if (strcmp(name,"manybody") == 0) return (force->pair->manybody_flag != 0); @@ -867,7 +867,7 @@ bool Info::is_active(const char *category, const char *name) bool Info::is_available(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (has_style(category, name)) { return true; @@ -897,7 +897,7 @@ bool Info::is_available(const char *category, const char *name) bool Info::is_defined(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (strcmp(category,"compute") == 0) { int ncompute = modify->ncompute; @@ -1137,7 +1137,7 @@ bool Info::has_exceptions() { } bool Info::has_package(const char * package_name) { - for(int i = 0; LAMMPS::installed_packages[i] != NULL; ++i) { + for(int i = 0; LAMMPS::installed_packages[i] != nullptr; ++i) { if(strcmp(package_name, LAMMPS::installed_packages[i]) == 0) { return true; } diff --git a/src/input.cpp b/src/input.cpp index 6456f6c22..5efbdfba3 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -96,15 +96,15 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) MPI_Comm_rank(world,&me); maxline = maxcopy = maxwork = 0; - line = copy = work = NULL; + line = copy = work = nullptr; narg = maxarg = 0; - arg = NULL; + arg = nullptr; echo_screen = 0; echo_log = 1; label_active = 0; - labelstr = NULL; + labelstr = nullptr; jump_skip = 0; if (me == 0) { @@ -112,7 +112,7 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) maxfile = 16; infiles = new FILE *[maxfile]; infiles[0] = infile; - } else infiles = NULL; + } else infiles = nullptr; variable = new Variable(lmp); @@ -196,7 +196,7 @@ void Input::file() // end of file reached, so break // n == 0 if nothing read, else n = line with str terminator - if (fgets(&line[m],maxline-m,infile) == NULL) { + if (fgets(&line[m],maxline-m,infile) == nullptr) { if (m) n = strlen(line) + 1; else n = 0; break; @@ -252,7 +252,7 @@ void Input::file() // if no command, skip to next line in input script parse(); - if (command == NULL) continue; + if (command == nullptr) continue; // if scanning for label, skip command unless it's a label command @@ -292,7 +292,7 @@ void Input::file(const char *filename) error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(filename,"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", filename, utils::getsyserror())); @@ -317,7 +317,7 @@ void Input::file(const char *filename) This function takes the text in *single*, makes a copy, parses that, executes the command and returns the name of the command (without the arguments). If there was no command in *single* it will return -``NULL``. +``nullptr``. \endverbatim * @@ -338,14 +338,14 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return NULL + // if no command, just return nullptr parse(); - if (command == NULL) return NULL; + if (command == nullptr) return nullptr; // if scanning for label, skip command unless it's a label command - if (label_active && strcmp(command,"label") != 0) return NULL; + if (label_active && strcmp(command,"label") != 0) return nullptr; // execute the command and return its name @@ -423,7 +423,7 @@ void Input::parse() char *next; command = nextword(copy,&next); - if (command == NULL) return; + if (command == nullptr) return; // point arg[] at each subsequent arg in copy string // nextword() inserts string terminators into copy string to delimit args @@ -450,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or NULL if no word in string + return ptr to start of word or nullptr if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ @@ -461,16 +461,16 @@ char *Input::nextword(char *str, char **next) // start = first non-whitespace char start = &str[strspn(str," \t\n\v\f\r")]; - if (*start == '\0') return NULL; + if (*start == '\0') return nullptr; // if start is single/double/triple quote: // start = first char beyond quote // stop = first char of matching quote // next = first char beyond matching quote - // next must be NULL or whitespace + // next must be nullptr or whitespace // if start is not single/double/triple quote: // stop = first whitespace char after start - // next = char after stop, or stop itself if stop is NULL + // next = char after stop, or stop itself if stop is nullptr if (strstr(start,"\"\"\"") == start) { stop = strstr(&start[3],"\"\"\""); @@ -492,7 +492,7 @@ char *Input::nextword(char *str, char **next) else *next = stop+1; } - // set stop to NULL to terminate word + // set stop to nullptr to terminate word *stop = '\0'; return start; @@ -510,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) // use str2 as scratch space to expand str, then copy back to str // reallocate str and str2 as necessary // do not replace $ inside single/double/triple quotes - // var = pts at variable name, ended by NULL - // if $ is followed by '{', trailing '}' becomes NULL - // else $x becomes x followed by NULL + // var = pts at variable name, ended by nullptr + // if $ is followed by '{', trailing '}' becomes nullptr + // else $x becomes x followed by nullptr // beyond = points to text following variable int i,n,paren_count; @@ -593,7 +593,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) value = variable->retrieve(var); } - if (value == NULL) + if (value == nullptr) error->one(FLERR,fmt::format("Substitution for illegal " "variable {}",var)); @@ -950,7 +950,7 @@ void Input::include() error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -984,7 +984,7 @@ void Input::jump() else { if (infile && infile != stdin) fclose(infile); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -1023,12 +1023,12 @@ void Input::log() if (me == 0) { if (logfile) fclose(logfile); - if (strcmp(arg[0],"none") == 0) logfile = NULL; + if (strcmp(arg[0],"none") == 0) logfile = nullptr; else { if (appendflag) logfile = fopen(arg[0],"a"); else logfile = fopen(arg[0],"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", arg[0], utils::getsyserror())); @@ -1063,8 +1063,8 @@ void Input::partition() strcpy(copy,line); char *ptr = strtok(copy," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ptr += strlen(ptr) + 1; ptr += strspn(ptr," \t\n\r\f"); @@ -1094,7 +1094,7 @@ void Input::print() // parse optional args - FILE *fp = NULL; + FILE *fp = nullptr; int screenflag = 1; int universeflag = 0; @@ -1103,10 +1103,10 @@ void Input::print() if (strcmp(arg[iarg],"file") == 0 || strcmp(arg[iarg],"append") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal print command"); if (me == 0) { - if (fp != NULL) fclose(fp); + if (fp != nullptr) fclose(fp); if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open print file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -1237,9 +1237,9 @@ void Input::shell() char *ptr = strdup(arg[i]); rv = 0; #ifdef _WIN32 - if (ptr != NULL) rv = _putenv(ptr); + if (ptr != nullptr) rv = _putenv(ptr); #else - if (ptr != NULL) rv = putenv(ptr); + if (ptr != nullptr) rv = putenv(ptr); #endif rv = (rv < 0) ? errno : 0; MPI_Reduce(&rv,&err,1,MPI_INT,MPI_MAX,0,world); @@ -1291,7 +1291,7 @@ void Input::angle_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Angle_coeff command before simulation box is defined"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle_coeff command before angle_style is defined"); if (atom->avec->angles_allow == 0) error->all(FLERR,"Angle_coeff command when no angles allowed"); @@ -1332,7 +1332,7 @@ void Input::bond_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Bond_coeff command before simulation box is defined"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_coeff command before bond_style is defined"); if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_coeff command when no bonds allowed"); @@ -1356,7 +1356,7 @@ void Input::bond_write() { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_write command when no bonds allowed"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_write command before bond_style is defined"); else force->bond->write_file(narg,arg); } @@ -1435,7 +1435,7 @@ void Input::dihedral_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Dihedral_coeff command before simulation box is defined"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined"); if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed"); @@ -1512,7 +1512,7 @@ void Input::improper_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Improper_coeff command before simulation box is defined"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Improper_coeff command before improper_style is defined"); if (atom->avec->impropers_allow == 0) error->all(FLERR,"Improper_coeff command when no impropers allowed"); @@ -1534,7 +1534,7 @@ void Input::improper_style() void Input::kspace_modify() { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"KSpace style has not yet been set"); force->kspace->modify_params(narg,arg); } @@ -1650,7 +1650,7 @@ void Input::package() modify->add_fix(fixcmd); } else if (strcmp(arg[0],"kokkos") == 0) { - if (lmp->kokkos == NULL || lmp->kokkos->kokkos_exists == 0) + if (lmp->kokkos == nullptr || lmp->kokkos->kokkos_exists == 0) error->all(FLERR, "Package kokkos command without KOKKOS package enabled"); lmp->kokkos->accelerator(narg-1,&arg[1]); @@ -1682,7 +1682,7 @@ void Input::pair_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Pair_coeff command before simulation box is defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_coeff command before pair_style is defined"); force->pair->coeff(narg,arg); } @@ -1691,7 +1691,7 @@ void Input::pair_coeff() void Input::pair_modify() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_modify command before pair_style is defined"); force->pair->modify_params(narg,arg); } @@ -1729,7 +1729,7 @@ void Input::pair_style() void Input::pair_write() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_write command before pair_style is defined"); force->pair->write_file(narg,arg); } diff --git a/src/integrate.cpp b/src/integrate.cpp index 1f50ff76c..720e8ba27 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -25,8 +25,8 @@ using namespace LAMMPS_NS; Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char **/*arg*/) : Pointers(lmp) { - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; external_force_clear = 0; } @@ -74,8 +74,8 @@ void Integrate::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/irregular.cpp b/src/irregular.cpp index fbb572fd8..c5ce94e40 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -52,15 +52,15 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // migrate work vectors maxlocal = 0; - mproclist = NULL; - msizes = NULL; + mproclist = nullptr; + msizes = nullptr; // send buffers maxdbuf = 0; - dbuf = NULL; + dbuf = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; // universal work vectors @@ -70,7 +70,7 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // initialize buffers for migrate atoms, not used for datum comm // these can persist for multiple irregular operations - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; bufextra = BUFEXTRA; grow_send(maxsend,2); diff --git a/src/irregular.h b/src/irregular.h index 01fe40c46..d601f1586 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -30,7 +30,7 @@ class Irregular : protected Pointers { Irregular(class LAMMPS *); ~Irregular(); void migrate_atoms(int sortflag = 0, int preassign = 0, - int *procassign = NULL); + int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); int create_data_grouped(int, int *, int sortflag = 0); diff --git a/src/kspace.cpp b/src/kspace.cpp index e51cc54c9..117ae5465 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -86,8 +86,8 @@ KSpace::KSpace(LAMMPS *lmp) : Pointers(lmp) splittol = 1.0e-6; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -188,7 +188,7 @@ void KSpace::compute_dummy(int eflag, int vflag) void KSpace::pair_check() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"KSpace solver requires a pair style"); if (ewaldflag && !force->pair->ewaldflag) @@ -610,5 +610,5 @@ void KSpace::modify_params(int narg, char **arg) void *KSpace::extract(const char *str) { if (strcmp(str,"scale") == 0) return (void *) &scale; - return NULL; + return nullptr; } diff --git a/src/lammps.cpp b/src/lammps.cpp index f6952354b..1d655f6fc 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -105,22 +105,22 @@ using namespace LAMMPS_NS; * \param communicator MPI communicator used by this LAMMPS instance */ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : - memory(NULL), error(NULL), universe(NULL), input(NULL), atom(NULL), - update(NULL), neighbor(NULL), comm(NULL), domain(NULL), force(NULL), - modify(NULL), group(NULL), output(NULL), timer(NULL), kokkos(NULL), - atomKK(NULL), memoryKK(NULL), python(NULL), citeme(NULL) + memory(nullptr), error(nullptr), universe(nullptr), input(nullptr), atom(nullptr), + update(nullptr), neighbor(nullptr), comm(nullptr), domain(nullptr), force(nullptr), + modify(nullptr), group(nullptr), output(nullptr), timer(nullptr), kokkos(nullptr), + atomKK(nullptr), memoryKK(nullptr), python(nullptr), citeme(nullptr) { memory = new Memory(this); error = new Error(this); universe = new Universe(this,communicator); clientserver = 0; - cslib = NULL; + cslib = nullptr; cscomm = 0; - screen = NULL; - logfile = NULL; - infile = NULL; + screen = nullptr; + logfile = nullptr; + infile = nullptr; initclock = MPI_Wtime(); @@ -170,19 +170,19 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : int citeflag = 1; int helpflag = 0; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 0; if (arg) exename = arg[0]; - else exename = NULL; - packargs = NULL; + else exename = nullptr; + packargs = nullptr; num_package = 0; - char *restartfile = NULL; + char *restartfile = nullptr; int wfirst,wlast; int kkfirst,kklast; int npack = 0; - int *pfirst = NULL; - int *plast = NULL; + int *pfirst = nullptr; + int *plast = nullptr; iarg = 1; while (iarg < narg) { @@ -348,7 +348,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : error->universe_all(FLERR,"Invalid command-line argument"); delete [] suffix; delete [] suffix2; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 1; // hybrid option to set fall-back for suffix2 if (strcmp(arg[iarg+1],"hybrid") == 0) { @@ -380,7 +380,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // if no partition command-line switch, universe is one world with all procs - if (universe->existflag == 0) universe->add_world(NULL); + if (universe->existflag == 0) universe->add_world(nullptr); // sum of procs in all worlds must equal total # of procs @@ -409,10 +409,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (screenflag == 0) universe->uscreen = stdout; else if (strcmp(arg[screenflag],"none") == 0) - universe->uscreen = NULL; + universe->uscreen = nullptr; else { universe->uscreen = fopen(arg[screenflag],"w"); - if (universe->uscreen == NULL) + if (universe->uscreen == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe screen " "file {}: {}",arg[screenflag], utils::getsyserror())); @@ -420,15 +420,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { if (helpflag == 0) { universe->ulogfile = fopen("log.lammps","w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_warn(FLERR,"Cannot open log.lammps for writing: " + utils::getsyserror()); } } else if (strcmp(arg[logflag],"none") == 0) - universe->ulogfile = NULL; + universe->ulogfile = nullptr; else { universe->ulogfile = fopen(arg[logflag],"w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe log " "file {}: {}",arg[logflag], utils::getsyserror())); @@ -437,8 +437,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me > 0) { if (screenflag == 0) universe->uscreen = stdout; - else universe->uscreen = NULL; - universe->ulogfile = NULL; + else universe->uscreen = nullptr; + universe->ulogfile = nullptr; } // make universe and single world the same, since no partition switch @@ -454,7 +454,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me == 0) { if (inflag == 0) infile = stdin; else infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } @@ -472,31 +472,31 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : MPI_Comm_split(universe->uworld,universe->iworld,0,&world); MPI_Comm_rank(world,&me); - screen = logfile = infile = NULL; + screen = logfile = infile = nullptr; if (me == 0) { std::string str; if (partscreenflag == 0) { if (screenflag == 0) { str = fmt::format("screen.{}",universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } else if (strcmp(arg[screenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[screenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", arg[screenflag],utils::getsyserror())); } } else if (strcmp(arg[partscreenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[partscreenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } @@ -505,30 +505,30 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { str = fmt::format("log.lammps.{}",universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } else if (strcmp(arg[logflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[logflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } } else if (strcmp(arg[partlogflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[partlogflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } @@ -590,7 +590,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // instantiation creates dummy Kokkos class if KOKKOS is not installed // add args between kkfirst and kklast to Kokkos instantiation - kokkos = NULL; + kokkos = nullptr; if (kokkosflag == 1) { kokkos = new KokkosLMP(this,kklast-kkfirst,&arg[kkfirst]); if (!kokkos->kokkos_exists) @@ -600,7 +600,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // allocate CiteMe class if enabled if (citeflag) citeme = new CiteMe(this); - else citeme = NULL; + else citeme = nullptr; // allocate input class now that MPI is fully setup @@ -616,7 +616,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : packargs[i] = new char*[n+1]; for (int j=0; j < n; ++j) packargs[i][j] = strdup(arg[pfirst[i]+j]); - packargs[i][n] = NULL; + packargs[i][n] = nullptr; } memory->destroy(pfirst); memory->destroy(plast); @@ -668,14 +668,14 @@ LAMMPS::~LAMMPS() if (num_package) { for (int i = 0; i < num_package; i++) { - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) free(*ptr); delete[] packargs[i]; } delete[] packargs; } num_package = 0; - packargs = NULL; + packargs = nullptr; double totalclock = MPI_Wtime() - initclock; if ((me == 0) && (screen || logfile)) { @@ -690,14 +690,14 @@ LAMMPS::~LAMMPS() if (universe->nworlds == 1) { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } else { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); if (universe->ulogfile) fclose(universe->ulogfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } if (infile && infile != stdin) fclose(infile); @@ -733,7 +733,7 @@ LAMMPS::~LAMMPS() void LAMMPS::create() { - force = NULL; // Domain->Lattice checks if Force exists + force = nullptr; // Domain->Lattice checks if Force exists // Comm class must be created before Atom class // so that nthreads is defined when create_avec invokes grow() @@ -755,9 +755,9 @@ void LAMMPS::create() else atom = new Atom(this); if (kokkos) - atom->create_avec("atomic/kk",0,NULL,1); + atom->create_avec("atomic/kk",0,nullptr,1); else - atom->create_avec("atomic",0,NULL,1); + atom->create_avec("atomic",0,nullptr,1); group = new Group(this); force = new Force(this); // must be after group, to create temperature @@ -799,7 +799,7 @@ void LAMMPS::post_create() if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); if (strcmp(suffix,"kk") == 0 && - (kokkos == NULL || kokkos->kokkos_exists == 0)) + (kokkos == nullptr || kokkos->kokkos_exists == 0)) error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) error->all(FLERR,"Using suffix omp without USER-OMP package installed"); @@ -821,7 +821,7 @@ void LAMMPS::post_create() char str[256]; for (int i = 0; i < num_package; i++) { strcpy(str,"package"); - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) { + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) { if (strlen(str) + strlen(*ptr) + 2 > 256) error->all(FLERR,"Too many -pk arguments in command line"); strcat(str," "); @@ -861,41 +861,41 @@ void LAMMPS::init() void LAMMPS::destroy() { delete update; - update = NULL; + update = nullptr; delete neighbor; - neighbor = NULL; + neighbor = nullptr; delete force; - force = NULL; + force = nullptr; delete group; - group = NULL; + group = nullptr; delete output; - output = NULL; + output = nullptr; delete modify; // modify must come after output, force, update // since they delete fixes - modify = NULL; + modify = nullptr; delete comm; // comm must come after modify // since fix destructors may access comm - comm = NULL; + comm = nullptr; delete domain; // domain must come after modify // since fix destructors access domain - domain = NULL; + domain = nullptr; delete atom; // atom must come after modify, neighbor // since fixes delete callbacks in atom - atom = NULL; + atom = nullptr; delete timer; - timer = NULL; + timer = nullptr; delete python; - python = NULL; + python = nullptr; } /* ---------------------------------------------------------------------- @@ -1011,7 +1011,7 @@ void _noopt LAMMPS::init_pkg_lists() */ bool LAMMPS::is_installed_pkg(const char *pkg) { - for (int i=0; installed_packages[i] != NULL; ++i) + for (int i=0; installed_packages[i] != nullptr; ++i) if (strcmp(installed_packages[i],pkg) == 0) return true; return false; @@ -1053,7 +1053,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) check_for_match(pair,style,name); check_for_match(reader,style,name); check_for_match(region,style,name); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1063,7 +1063,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) void _noopt LAMMPS::help() { FILE *fp = screen; - const char *pager = NULL; + const char *pager = nullptr; // if output is "stdout", use a pipe to a pager for paged output. // this will avoid the most important help text to rush past the @@ -1072,7 +1072,7 @@ void _noopt LAMMPS::help() if (fp == stdout) { pager = getenv("PAGER"); - if (pager == NULL) pager = "more"; + if (pager == nullptr) pager = "more"; #if defined(_WIN32) fp = _popen(pager,"w"); #else @@ -1080,9 +1080,9 @@ void _noopt LAMMPS::help() #endif // reset to original state, if pipe command failed - if (fp == NULL) { + if (fp == nullptr) { fp = stdout; - pager = NULL; + pager = nullptr; } } @@ -1236,7 +1236,7 @@ void _noopt LAMMPS::help() // close pipe to pager, if active - if (pager != NULL) pclose(fp); + if (pager != nullptr) pclose(fp); } /* ---------------------------------------------------------------------- @@ -1309,7 +1309,7 @@ void LAMMPS::print_config(FILE *fp) sizeof(tagint)*8, sizeof(bigint)*8); fputs("\nInstalled packages:\n\n",fp); - for (int i = 0; NULL != (pkg = installed_packages[i]); ++i) { + for (int i = 0; nullptr != (pkg = installed_packages[i]); ++i) { ncword = strlen(pkg); if (ncline + ncword > 78) { ncline = 0; diff --git a/src/lattice.cpp b/src/lattice.cpp index 68f3e7abe..625e243d6 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { nbasis = 0; - basis = NULL; + basis = nullptr; // parse style arg @@ -164,7 +164,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) else if (strcmp(arg[iarg+1],"y") == 0) dim = 1; else if (strcmp(arg[iarg+1],"z") == 0) dim = 2; else error->all(FLERR,"Illegal lattice command"); - int *orient = NULL; + int *orient = nullptr; if (dim == 0) orient = orientx; else if (dim == 1) orient = orienty; else if (dim == 2) orient = orientz; diff --git a/src/library.cpp b/src/library.cpp index 0e0c4070e..2e3545783 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -105,7 +105,7 @@ LAMMPS executable, and an MPI communicator for LAMMPS to run under. Since the list of arguments is **exactly** as when called from the command line, the first argument would be the name of the executable and thus is otherwise ignored. However ``argc`` may be set to 0 and then -``argv`` may be ``NULL``. If MPI is not yet initialized, ``MPI_Init()`` +``argv`` may be ``nullptr``. If MPI is not yet initialized, ``MPI_Init()`` will be called during creation of the LAMMPS class instance. If for some reason the creation or initialization of the LAMMPS instance @@ -117,7 +117,7 @@ fails a null pointer is returned. instance as return value. For backward compatibility it is still possible to provide the address of a pointer variable as final argument *ptr*\ . This use is deprecated and may be removed in - the future. The *ptr* argument may be ``NULL`` and is then ignored. + the future. The *ptr* argument may be ``nullptr`` and is then ignored. .. note:: @@ -133,12 +133,12 @@ fails a null pointer is returned. * \param argv list of command line argument strings * \param comm MPI communicator for this LAMMPS instance * \param ptr pointer to a void pointer variable which serves - * as a handle; may be ``NULL`` + * as a handle; may be ``nullptr`` * \return pointer to new LAMMPS instance cast to ``void *`` */ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) { - LAMMPS *lmp = NULL; + LAMMPS *lmp = nullptr; lammps_mpi_init(); #ifdef LAMMPS_EXCEPTIONS @@ -149,7 +149,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) } catch(LAMMPSException & e) { fmt::print(stderr, "LAMMPS Exception: {}", e.message); - *ptr = (void *) NULL; + *ptr = nullptr; } #else lmp = new LAMMPS(argc, argv, comm); @@ -183,14 +183,14 @@ fails a null pointer is returned. instance as return value. For backward compatibility it is still possible to provide the address of a pointer variable as final argument *ptr*\ . This use is deprecated and may be removed in - the future. The *ptr* argument may be ``NULL`` and is then ignored. + the future. The *ptr* argument may be ``nullptr`` and is then ignored. \endverbatim * * \param argc number of command line arguments * \param argv list of command line argument strings * \param ptr pointer to a void pointer variable - * which serves as a handle; may be ``NULL`` + * which serves as a handle; may be ``nullptr`` * \return pointer to new LAMMPS instance cast to ``void *`` */ void *lammps_open_no_mpi(int argc, char **argv, void **ptr) @@ -275,7 +275,7 @@ void lammps_mpi_init() if (!flag) { // provide a dummy argc and argv for MPI_Init(). int argc = 1; - char *args[] = { (char *)"liblammps" , NULL }; + char *args[] = { (char *)"liblammps" , nullptr }; char **argv = args; MPI_Init(&argc,&argv); } @@ -375,19 +375,19 @@ string, however, will be treated as part of the command and will **not** start a second command. The function :cpp:func:`lammps_commands_string` processes a string with multiple command lines. -The function returns the name of the command on success or ``NULL`` when +The function returns the name of the command on success or ``nullptr`` when passing a string without a command. \endverbatim * * \param handle pointer to a previously created LAMMPS instance * \param cmd string with a single LAMMPS command - * \return string with parsed command name or ``NULL`` */ + * \return string with parsed command name or ``nullptr`` */ char *lammps_command(void *handle, const char *cmd) { LAMMPS *lmp = (LAMMPS *) handle; - char *result = NULL; + char *result = nullptr; BEGIN_CAPTURE { @@ -639,7 +639,7 @@ double lammps_get_thermo(void *handle, char *keyword) This function (re-)initializes the simulation box and boundary information and then assign the designated data to the locations in the pointers passed as arguments. Any argument (except the first) may be -a NULL pointer and then will not be assigned. +a nullptr pointer and then will not be assigned. \endverbatim * @@ -1071,7 +1071,7 @@ to be either an ``int`` or an ``int64_t``. This is selected at * \param handle pointer to a previously created LAMMPS instance * \param name string with the name of the extracted property * \return pointer (cast to ``void *``) to the location of the - requested property. NULL if name is not known. */ + requested property. nullptr if name is not known. */ void *lammps_extract_global(void *handle, char *name) { @@ -1134,7 +1134,7 @@ void *lammps_extract_global(void *handle, char *name) if (strcmp(name,"femtosecond") == 0) return (void *) &lmp->force->femtosecond; if (strcmp(name,"qelectron") == 0) return (void *) &lmp->force->qelectron; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1163,7 +1163,7 @@ of the :cpp:func:`Atom::extract() ` function. * \param handle pointer to a previously created LAMMPS instance * \param name string with the name of the extracted property * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_atom(void *handle, char *name) { @@ -1213,13 +1213,13 @@ X(1),Y(1),Z(1),X(2),Y(2),Z(2),...,X(N),Y(N),Z(N). * * \param handle pointer to a previously created LAMMPS instance * \param n number of atoms, N, to be added to the system - * \param id pointer to N atom IDs; ``NULL`` will generate IDs + * \param id pointer to N atom IDs; ``nullptr`` will generate IDs * \param type pointer to N atom types (required) * \param x pointer to 3N doubles with x-,y-,z- positions of the new atoms (required) * \param v pointer to 3N doubles with x-,y-,z- velocities - of the new atoms (set to 0.0 if ``NULL``) - * \param image pointer to N imageint sets of image flags, or ``NULL`` + of the new atoms (set to 0.0 if ``nullptr``) + * \param image pointer to N imageint sets of image flags, or ``nullptr`` * \param bexpand if 1, atoms outside of shrink-wrap boundaries will still be created and not dropped and the box extended * \return number of atoms created on success; @@ -1267,7 +1267,7 @@ int lammps_create_atoms(void *handle, int n, tagint *id, int *type, xdata[0] = x[3*i]; xdata[1] = x[3*i+1]; xdata[2] = x[3*i+2]; - imageint * img = image ? image + i : NULL; + imageint * img = image ? image + i : nullptr; tagint tag = id ? id[i] : 0; // create atom only on MPI rank that would own it @@ -1288,7 +1288,7 @@ int lammps_create_atoms(void *handle, int n, tagint *id, int *type, // if no tags are given explicitly, create new and unique tags - if (id == NULL) atom->tag_extend(); + if (id == nullptr) atom->tag_extend(); // reset box info, if extended when adding atoms. @@ -1332,7 +1332,7 @@ dimensions of the respective data. Since computes may provide multiple kinds of data, it is required to set style and type flags representing what specific data is desired. This also determines to what kind of pointer the returned pointer needs to be cast to access the data -correctly. The function returns ``NULL`` if the compute ID is not found +correctly. The function returns ``nullptr`` if the compute ID is not found or the requested data is not available or current. The following table lists the available options. @@ -1420,7 +1420,7 @@ be used after other LAMMPS commands have been issued. * \param type constant indicating type of data (scalar, vector, or array) or size of rows or columns * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_compute(void *handle, char *id, int style, int type) { @@ -1429,18 +1429,18 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) BEGIN_CAPTURE { int icompute = lmp->modify->find_compute(id); - if (icompute < 0) return NULL; + if (icompute < 0) return nullptr; Compute *compute = lmp->modify->compute[icompute]; if (style == LMP_STYLE_GLOBAL) { if (type == LMP_TYPE_SCALAR) { - if (!compute->scalar_flag) return NULL; + if (!compute->scalar_flag) return nullptr; if (compute->invoked_scalar != lmp->update->ntimestep) compute->compute_scalar(); return (void *) &compute->scalar; } if ((type == LMP_TYPE_VECTOR) || (type == LMP_SIZE_VECTOR)) { - if (!compute->vector_flag) return NULL; + if (!compute->vector_flag) return nullptr; if (compute->invoked_vector != lmp->update->ntimestep) compute->compute_vector(); if (type == LMP_TYPE_VECTOR) @@ -1449,7 +1449,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) return (void *) &compute->size_vector; } if ((type == LMP_TYPE_ARRAY) || (type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { - if (!compute->array_flag) return NULL; + if (!compute->array_flag) return nullptr; if (compute->invoked_array != lmp->update->ntimestep) compute->compute_array(); if (type == LMP_TYPE_ARRAY) @@ -1462,7 +1462,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } if (style == LMP_STYLE_ATOM) { - if (!compute->peratom_flag) return NULL; + if (!compute->peratom_flag) return nullptr; if (compute->invoked_peratom != lmp->update->ntimestep) compute->compute_peratom(); if (type == LMP_TYPE_VECTOR) return (void *) compute->vector_atom; @@ -1471,7 +1471,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } if (style == LMP_STYLE_LOCAL) { - if (!compute->local_flag) return NULL; + if (!compute->local_flag) return nullptr; if (compute->invoked_local != lmp->update->ntimestep) compute->compute_local(); if (type == LMP_TYPE_SCALAR) return (void *) &compute->size_local_rows; /* for backward compatibility */ @@ -1483,7 +1483,7 @@ void *lammps_extract_compute(void *handle, char *id, int style, int type) } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1500,7 +1500,7 @@ Since individual fixes may provide multiple kinds of data, it is required to set style and type flags representing what specific data is desired. This also determines to what kind of pointer the returned pointer needs to be cast to access the data correctly. The function -returns ``NULL`` if the fix ID is not found or the requested data is not +returns ``nullptr`` if the fix ID is not found or the requested data is not available. .. note:: @@ -1604,7 +1604,7 @@ been issued. * \param nrow row index (only used for global vectors and arrays) * \param ncol column index (only used for global arrays) * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_fix(void *handle, char *id, int style, int type, int nrow, int ncol) @@ -1614,34 +1614,34 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, BEGIN_CAPTURE { int ifix = lmp->modify->find_fix(id); - if (ifix < 0) return NULL; + if (ifix < 0) return nullptr; Fix *fix = lmp->modify->fix[ifix]; if (style == LMP_STYLE_GLOBAL) { if (type == LMP_TYPE_SCALAR) { - if (!fix->scalar_flag) return NULL; + if (!fix->scalar_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_scalar(); return (void *) dptr; } if (type == LMP_TYPE_VECTOR) { - if (!fix->vector_flag) return NULL; + if (!fix->vector_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_vector(nrow); return (void *) dptr; } if (type == LMP_TYPE_ARRAY) { - if (!fix->array_flag) return NULL; + if (!fix->array_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_array(nrow,ncol); return (void *) dptr; } if (type == LMP_SIZE_VECTOR) { - if (!fix->vector_flag) return NULL; + if (!fix->vector_flag) return nullptr; return (void *) &fix->size_vector; } if ((type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { - if (!fix->array_flag) return NULL; + if (!fix->array_flag) return nullptr; if (type == LMP_SIZE_ROWS) return (void *) &fix->size_array_rows; else @@ -1650,14 +1650,14 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, } if (style == LMP_STYLE_ATOM) { - if (!fix->peratom_flag) return NULL; + if (!fix->peratom_flag) return nullptr; if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_atom; if (type == LMP_TYPE_ARRAY) return (void *) fix->array_atom; if (type == LMP_SIZE_COLS) return (void *) &fix->size_peratom_cols; } if (style == LMP_STYLE_LOCAL) { - if (!fix->local_flag) return NULL; + if (!fix->local_flag) return nullptr; if (type == LMP_TYPE_SCALAR) return (void *) &fix->size_local_rows; if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_local; if (type == LMP_TYPE_ARRAY) return (void *) fix->array_local; @@ -1667,7 +1667,7 @@ void *lammps_extract_fix(void *handle, char *id, int style, int type, } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1681,9 +1681,9 @@ identified by its name. The variable must be either an *equal*\ -style compatible or an *atom*\ -style variable. Variables of style *internal* are compatible with *equal*\ -style variables and so are *python*\ -style variables, if they return a numeric value. The function returns -``NULL`` when a variable of the provided *name* is not found or of an +``nullptr`` when a variable of the provided *name* is not found or of an incompatible style. The *group* argument is only used for *atom*\ --style variables and ignored otherwise. If set to ``NULL`` when +-style variables and ignored otherwise. If set to ``nullptr`` when extracting data from and *atom*\ -style variable, the group is assumed to be "all". @@ -1697,7 +1697,7 @@ to be "all". .. code-block:: c - double *dptr = (double *) lammps_extract_variable(handle,name,NULL); + double *dptr = (double *) lammps_extract_variable(handle,name,nullptr); double value = *dptr; lammps_free((void *)dptr); @@ -1720,9 +1720,9 @@ values will not be updated, in case the variable is re-evaluated. * * \param handle pointer to a previously created LAMMPS instance * \param name name of the variable - * \param group group-ID for atom style variable or ``NULL`` + * \param group group-ID for atom style variable or ``nullptr`` * \return pointer (cast to ``void *``) to the location of the - * requested data or ``NULL`` if not found. */ + * requested data or ``nullptr`` if not found. */ void *lammps_extract_variable(void *handle, char *name, char *group) { @@ -1731,7 +1731,7 @@ void *lammps_extract_variable(void *handle, char *name, char *group) BEGIN_CAPTURE { int ivar = lmp->input->variable->find(name); - if (ivar < 0) return NULL; + if (ivar < 0) return nullptr; if (lmp->input->variable->equalstyle(ivar)) { double *dptr = (double *) malloc(sizeof(double)); @@ -1740,9 +1740,9 @@ void *lammps_extract_variable(void *handle, char *name, char *group) } if (lmp->input->variable->atomstyle(ivar)) { - if (group == NULL) group = (char *)"all"; + if (group == nullptr) group = (char *)"all"; int igroup = lmp->group->find(group); - if (igroup < 0) return NULL; + if (igroup < 0) return nullptr; int nlocal = lmp->atom->nlocal; double *vector = (double *) malloc(nlocal*sizeof(double)); lmp->input->variable->compute_atom(ivar,igroup,vector,1,0); @@ -1751,7 +1751,7 @@ void *lammps_extract_variable(void *handle, char *name, char *group) } END_CAPTURE - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -1845,7 +1845,7 @@ void lammps_gather_atoms(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -1855,8 +1855,8 @@ void lammps_gather_atoms(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -1894,8 +1894,8 @@ void lammps_gather_atoms(void *handle, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -1985,7 +1985,7 @@ void lammps_gather_atoms_concat(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -1999,8 +1999,8 @@ void lammps_gather_atoms_concat(void *handle, char *name, lmp->memory->create(displs,nprocs,"lib/gather:displs"); if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2050,8 +2050,8 @@ void lammps_gather_atoms_concat(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2145,7 +2145,7 @@ void lammps_gather_atoms_subset(void *handle, char *name, } void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms_subset: " "unknown property name"); return; @@ -2156,8 +2156,8 @@ void lammps_gather_atoms_subset(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2203,8 +2203,8 @@ void lammps_gather_atoms_subset(void *handle, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2296,7 +2296,7 @@ void lammps_scatter_atoms(void *handle, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms: unknown property name"); return; @@ -2307,8 +2307,8 @@ void lammps_scatter_atoms(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -2340,8 +2340,8 @@ void lammps_scatter_atoms(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -2424,7 +2424,7 @@ void lammps_scatter_atoms_subset(void *handle, char *name, } void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms_subset: unknown property name"); return; @@ -2435,8 +2435,8 @@ void lammps_scatter_atoms_subset(void *handle, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -2474,8 +2474,8 @@ void lammps_scatter_atoms_subset(void *handle, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -2565,7 +2565,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2596,7 +2596,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2624,7 +2624,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -2645,7 +2645,7 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather: unknown property name"); return; } @@ -2654,8 +2654,8 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) // use atom ID to insert each atom's values into copy // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type==0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); @@ -2695,8 +2695,8 @@ void lammps_gather(void *ptr, char *name, int type, int count, void *data) } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -2786,7 +2786,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2818,7 +2818,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2846,7 +2846,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -2869,7 +2869,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_concat: unknown property name"); return; } @@ -2883,8 +2883,8 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data lmp->memory->create(displs,nprocs,"lib/gather:displs"); if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -2934,8 +2934,8 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -3031,7 +3031,7 @@ void lammps_gather_subset(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3063,7 +3063,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3091,7 +3091,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3114,7 +3114,7 @@ void lammps_gather_subset(void *ptr, char *name, } - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_subset: " "unknown property name"); return; @@ -3125,8 +3125,8 @@ void lammps_gather_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -3172,8 +3172,8 @@ void lammps_gather_subset(void *ptr, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -3273,7 +3273,7 @@ void lammps_scatter(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3298,7 +3298,7 @@ void lammps_scatter(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3326,7 +3326,7 @@ void lammps_scatter(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3346,7 +3346,7 @@ void lammps_scatter(void *ptr, char *name, } - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR,"lammps_scatter: unknown property name"); return; } @@ -3356,8 +3356,8 @@ void lammps_scatter(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -3389,8 +3389,8 @@ void lammps_scatter(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -3475,7 +3475,7 @@ void lammps_scatter_subset(void *ptr, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==NULL && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && strstr(name,"f_") == name) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3500,7 +3500,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && strstr(name,"c_") == name) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3528,7 +3528,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if (vptr==NULL && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3551,7 +3551,7 @@ void lammps_scatter_subset(void *ptr, char *name, } - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR,"lammps_scatter_atoms_subset: " "unknown property name"); return; @@ -3562,8 +3562,8 @@ void lammps_scatter_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -3601,8 +3601,8 @@ void lammps_scatter_subset(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -3741,7 +3741,7 @@ included in the LAMMPS library in use. */ int lammps_config_package_count() { int i = 0; - while(LAMMPS::installed_packages[i] != NULL) { + while(LAMMPS::installed_packages[i] != nullptr) { ++i; } return i; @@ -3987,7 +3987,7 @@ int lammps_find_pair_neighlist(void* handle, char * style, int exact, int nsub, LAMMPS * lmp = (LAMMPS *) handle; Pair* pair = lmp->force->pair_match(style, exact, nsub); - if (pair != NULL) { + if (pair != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4013,7 +4013,7 @@ int lammps_find_pair_neighlist(void* handle, char * style, int exact, int nsub, */ int lammps_find_fix_neighlist(void* handle, char * id, int request) { LAMMPS * lmp = (LAMMPS *) handle; - Fix* fix = NULL; + Fix* fix = nullptr; const int nfix = lmp->modify->nfix; // find fix with name @@ -4024,7 +4024,7 @@ int lammps_find_fix_neighlist(void* handle, char * id, int request) { } } - if (fix != NULL) { + if (fix != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4050,7 +4050,7 @@ int lammps_find_fix_neighlist(void* handle, char * id, int request) { */ int lammps_find_compute_neighlist(void* handle, char * id, int request) { LAMMPS * lmp = (LAMMPS *) handle; - Compute* compute = NULL; + Compute* compute = nullptr; const int ncompute = lmp->modify->ncompute; // find compute with name @@ -4061,7 +4061,7 @@ int lammps_find_compute_neighlist(void* handle, char * id, int request) { } } - if (compute == NULL) { + if (compute == nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -4108,14 +4108,14 @@ int lammps_neighlist_num_elements(void * handle, int idx) { invalid idx or element value * \param[out] numneigh number of neighbors of atom iatom or 0 * \param[out] neighbors pointer to array of neighbor atom local indices or - * NULL + * nullptr */ void lammps_neighlist_element_neighbors(void * handle, int idx, int element, int * iatom, int * numneigh, int ** neighbors) { LAMMPS * lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; *iatom = -1; *numneigh = 0; - *neighbors = NULL; + *neighbors = nullptr; if(idx < 0 || idx >= neighbor->nlist) { return; diff --git a/src/lmppython.cpp b/src/lmppython.cpp index 67bbca15b..080a22cb6 100644 --- a/src/lmppython.cpp +++ b/src/lmppython.cpp @@ -26,7 +26,7 @@ Python::Python(LAMMPS *lmp) : Pointers(lmp) { // implementation of Python interface is only loaded on demand // and only if PYTHON package has been installed and compiled into binary - impl = NULL; + impl = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/memory.cpp b/src/memory.cpp index bbbc233bb..f0d8976ad 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -45,7 +45,7 @@ Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {} void *Memory::smalloc(bigint nbytes, const char *name) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; #if defined(LAMMPS_MEMALIGN) void *ptr; @@ -54,13 +54,13 @@ void *Memory::smalloc(bigint nbytes, const char *name) ptr = scalable_aligned_malloc(nbytes, LAMMPS_MEMALIGN); #else int retval = posix_memalign(&ptr, LAMMPS_MEMALIGN, nbytes); - if (retval) ptr = NULL; + if (retval) ptr = nullptr; #endif #else void *ptr = malloc(nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to allocate {} bytes for array {}", nbytes,name)); return ptr; @@ -74,7 +74,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) { if (nbytes == 0) { destroy(ptr); - return NULL; + return nullptr; } #if defined(LMP_USE_TBB_ALLOCATOR) @@ -99,7 +99,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) #else ptr = realloc(ptr,nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to reallocate {} bytes for array {}", nbytes,name)); return ptr; @@ -111,7 +111,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) void Memory::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; #if defined(LMP_USE_TBB_ALLOCATOR) scalable_aligned_free(ptr); #else diff --git a/src/memory.h b/src/memory.h index 42c9bf6ab..1fc82c990 100644 --- a/src/memory.h +++ b/src/memory.h @@ -50,7 +50,7 @@ class Memory : protected Pointers { template TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1d array @@ -59,7 +59,7 @@ class Memory : protected Pointers { template TYPE *grow(TYPE *&array, int n, const char *name) { - if (array == NULL) return create(array,n,name); + if (array == nullptr) return create(array,n,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n; array = (TYPE *) srealloc(array,nbytes,name); @@ -68,7 +68,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array @@ -77,7 +77,7 @@ class Memory : protected Pointers { template void destroy(TYPE *&array) { sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -96,7 +96,7 @@ class Memory : protected Pointers { template TYPE **create1d_offset(TYPE **& /*array*/, int /*nlo*/, int /*nhi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array with index offset @@ -106,7 +106,7 @@ class Memory : protected Pointers { void destroy1d_offset(TYPE *&array, int offset) { if (array) sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -131,7 +131,7 @@ class Memory : protected Pointers { template TYPE ***create(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 2d array @@ -141,7 +141,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **&array, int n1, int n2, const char *name) { - if (array == NULL) return create(array,n1,n2,name); + if (array == nullptr) return create(array,n1,n2,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; TYPE *data = (TYPE *) srealloc(array[0],nbytes,name); @@ -158,7 +158,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array @@ -167,10 +167,10 @@ class Memory : protected Pointers { template void destroy(TYPE **&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ class Memory : protected Pointers { template TYPE ***create_ragged(TYPE ***& /*array*/, int /*n1*/, int * /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- create a 2d array with 2nd index from n2lo to n2hi inclusive @@ -217,7 +217,7 @@ class Memory : protected Pointers { template TYPE ***create2d_offset(TYPE ***& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - const char *name) {fail(name); return NULL;} + const char *name) {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array with 2nd index offset @@ -226,10 +226,10 @@ class Memory : protected Pointers { template void destroy2d_offset(TYPE **&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -262,7 +262,7 @@ class Memory : protected Pointers { template TYPE ****create(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 3d array @@ -272,7 +272,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) { - if (array == NULL) return create(array,n1,n2,n3,name); + if (array == nullptr) return create(array,n1,n2,n3,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name); @@ -297,7 +297,7 @@ class Memory : protected Pointers { template TYPE ****grow(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 3d array @@ -306,11 +306,11 @@ class Memory : protected Pointers { template void destroy(TYPE ***&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -331,7 +331,7 @@ class Memory : protected Pointers { template TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with 1st index offset @@ -340,11 +340,11 @@ class Memory : protected Pointers { template void destroy3d_offset(TYPE ***&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[offset][0][0]); sfree(&array[offset][0]); sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -376,7 +376,7 @@ class Memory : protected Pointers { TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with all 3 indices offset @@ -386,11 +386,11 @@ class Memory : protected Pointers { void destroy3d_offset(TYPE ***&array, int n1_offset, int n2_offset, int n3_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[n1_offset][n2_offset][n3_offset]); sfree(&array[n1_offset][n2_offset]); sfree(&array[n1_offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -433,7 +433,7 @@ class Memory : protected Pointers { template TYPE *****create(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 4d array @@ -444,7 +444,7 @@ class Memory : protected Pointers { TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - if (array == NULL) return create(array, n1, n2, n3, n4, name); + if (array == nullptr) return create(array, n1, n2, n3, n4, name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; TYPE *data = (TYPE *)srealloc(array[0][0][0], nbytes, name); @@ -479,7 +479,7 @@ class Memory : protected Pointers { TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) { - fail(name); return NULL; + fail(name); return nullptr; } /* ---------------------------------------------------------------------- @@ -489,12 +489,12 @@ class Memory : protected Pointers { template void destroy(TYPE ****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -527,7 +527,7 @@ class Memory : protected Pointers { TYPE ****create4d_offset(TYPE *****& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 4d array with indices 2,3, and 4 offset @@ -537,12 +537,12 @@ class Memory : protected Pointers { void destroy4d_offset(TYPE ****&array, int n2_offset, int n3_offset, int n4_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][n2_offset][n3_offset][n4_offset]); sfree(&array[0][n2_offset][n3_offset]); sfree(&array[0][n2_offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -594,7 +594,7 @@ class Memory : protected Pointers { template TYPE ******create(TYPE ******& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, int /*n5*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 5d array @@ -603,13 +603,13 @@ class Memory : protected Pointers { template void destroy(TYPE *****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0][0]); sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/min.cpp b/src/min.cpp index 6bcb4b4e2..ea07820e5 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -71,17 +71,17 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp) delaystep_start_flag = 1; max_vdotf_negatif = 2000; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nextra_global = 0; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; external_force_clear = 0; @@ -128,7 +128,7 @@ void Min::init() nextra_global = 0; delete [] fextra; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; memory->sfree(xextra_atom); @@ -137,10 +137,10 @@ void Min::init() memory->destroy(extra_nlen); memory->destroy(extra_max); memory->sfree(requestor); - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; // virial_style: // 1 if computed explicitly by pair->compute via sum over pair interactions @@ -760,8 +760,8 @@ void Min::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp index 909f0b068..54b1ee636 100644 --- a/src/min_hftn.cpp +++ b/src/min_hftn.cpp @@ -81,11 +81,11 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) searchflag = 1; for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; - _fpPrint = NULL; + _fpPrint = nullptr; return; } @@ -97,10 +97,10 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) MinHFTN::~MinHFTN (void) { for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; return; @@ -118,14 +118,14 @@ void MinHFTN::init() error->all(FLERR,"Incorrect min_modify option"); for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; } for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; } return; @@ -1618,7 +1618,7 @@ void MinHFTN::open_hftn_print_file_(void) char szTmp[50]; sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank); _fpPrint = fopen (szTmp, "w"); - if (_fpPrint == NULL) { + if (_fpPrint == nullptr) { printf ("*** MinHFTN cannot open file '%s'\n", szTmp); printf ("*** continuing...\n"); return; @@ -1655,7 +1655,7 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, const char sFormatR[] = "r %4d %5d %14.8f %11.5e %3s %9.3e %8.2e %10.3e %10.3e\n"; - if (_fpPrint == NULL) + if (_fpPrint == nullptr) return; char sStepType[4]; @@ -1701,6 +1701,6 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, void MinHFTN::close_hftn_print_file_(void) { - if (_fpPrint != NULL) fclose (_fpPrint); + if (_fpPrint != nullptr) fclose (_fpPrint); return; } diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp index 7226f6161..4ae887312 100644 --- a/src/min_linesearch.cpp +++ b/src/min_linesearch.cpp @@ -54,8 +54,8 @@ using namespace LAMMPS_NS; MinLineSearch::MinLineSearch(LAMMPS *lmp) : Min(lmp) { searchflag = 1; - gextra = hextra = NULL; - x0extra_atom = gextra_atom = hextra_atom = NULL; + gextra = hextra = nullptr; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -81,12 +81,12 @@ void MinLineSearch::init() delete [] gextra; delete [] hextra; - gextra = hextra = NULL; + gextra = hextra = nullptr; delete [] x0extra_atom; delete [] gextra_atom; delete [] hextra_atom; - x0extra_atom = gextra_atom = hextra_atom = NULL; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index c88d52b62..a908cfc7a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -54,34 +54,34 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) n_min_post_force = n_min_energy = 0; n_timeflag = -1; - fix = NULL; - fmask = NULL; - list_initial_integrate = list_post_integrate = NULL; - list_pre_exchange = list_pre_neighbor = list_post_neighbor = NULL; - list_pre_force = list_pre_reverse = list_post_force = NULL; - list_final_integrate = list_end_of_step = NULL; - list_thermo_energy = list_thermo_energy_atom = NULL; - list_initial_integrate_respa = list_post_integrate_respa = NULL; - list_pre_force_respa = list_post_force_respa = NULL; - list_final_integrate_respa = NULL; - list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = NULL; - list_min_pre_force = list_min_pre_reverse = list_min_post_force = NULL; - list_min_energy = NULL; - - end_of_step_every = NULL; - - list_timeflag = NULL; + fix = nullptr; + fmask = nullptr; + list_initial_integrate = list_post_integrate = nullptr; + list_pre_exchange = list_pre_neighbor = list_post_neighbor = nullptr; + list_pre_force = list_pre_reverse = list_post_force = nullptr; + list_final_integrate = list_end_of_step = nullptr; + list_thermo_energy = list_thermo_energy_atom = nullptr; + list_initial_integrate_respa = list_post_integrate_respa = nullptr; + list_pre_force_respa = list_post_force_respa = nullptr; + list_final_integrate_respa = nullptr; + list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = nullptr; + list_min_pre_force = list_min_pre_reverse = list_min_post_force = nullptr; + list_min_energy = nullptr; + + end_of_step_every = nullptr; + + list_timeflag = nullptr; nfix_restart_global = 0; - id_restart_global = style_restart_global = NULL; - state_restart_global = NULL; - used_restart_global = NULL; + id_restart_global = style_restart_global = nullptr; + state_restart_global = nullptr; + used_restart_global = nullptr; nfix_restart_peratom = 0; - id_restart_peratom = style_restart_peratom = NULL; - index_restart_peratom = used_restart_peratom = NULL; + id_restart_peratom = style_restart_peratom = nullptr; + index_restart_peratom = used_restart_peratom = nullptr; ncompute = maxcompute = 0; - compute = NULL; + compute = nullptr; create_factories(); } @@ -795,17 +795,17 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // but can't think of better way // too late if instantiate fix, then check flag set in fix constructor, // since some fixes access domain settings in their constructor - // NULL must be last entry in this list + // nullptr must be last entry in this list const char *exceptions[] = {"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx", - "deprecated", "STORE/KIM", NULL}; + "deprecated", "STORE/KIM", nullptr}; if (domain->box_exist == 0) { int m; - for (m = 0; exceptions[m] != NULL; m++) + for (m = 0; exceptions[m] != nullptr; m++) if (strcmp(arg[2],exceptions[m]) == 0) break; - if (exceptions[m] == NULL) + if (exceptions[m] == nullptr) error->all(FLERR,"Fix command before simulation box is defined"); } @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to NULL in case new fix scans list of fixes, + // set ptr to nullptr in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix @@ -852,7 +852,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) if (fix[ifix]->igroup != igroup && comm->me == 0) error->warning(FLERR,"Replacing a fix, but new group != old group"); delete fix[ifix]; - fix[ifix] = NULL; + fix[ifix] = nullptr; } else { newflag = 1; @@ -866,7 +866,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // create the Fix // try first with suffix appended - fix[ifix] = NULL; + fix[ifix] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -879,7 +879,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) strcpy(fix[ifix]->style,estyle.c_str()); } } - if (fix[ifix] == NULL && lmp->suffix2) { + if (fix[ifix] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (fix_map->find(estyle) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[estyle]; @@ -891,12 +891,12 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) } } - if (fix[ifix] == NULL && fix_map->find(arg[2]) != fix_map->end()) { + if (fix[ifix] == nullptr && fix_map->find(arg[2]) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[arg[2]]; fix[ifix] = fix_creator(lmp,narg,arg); } - if (fix[ifix] == NULL) + if (fix[ifix] == nullptr) error->all(FLERR,utils::check_packages_for_style("fix",arg[2],lmp)); // check if Fix is in restart_global list @@ -1105,7 +1105,7 @@ int Modify::check_rigid_group_overlap(int groupbit) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0)) ++n; @@ -1137,7 +1137,7 @@ int Modify::check_rigid_region_overlap(int groupbit, Region *reg) for (int ifix = 0; ifix < nfix; ifix++) { if (strncmp("rigid",fix[ifix]->style,5) == 0) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0) @@ -1167,7 +1167,7 @@ int Modify::check_rigid_list_overlap(int *select) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((body[i] >= 0) && select[i]) ++n; @@ -1206,7 +1206,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) // create the Compute // try first with suffix appended - compute[ncompute] = NULL; + compute[ncompute] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -1219,7 +1219,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) strcpy(compute[ncompute]->style,estyle.c_str()); } } - if (compute[ncompute] == NULL && lmp->suffix2) { + if (compute[ncompute] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (compute_map->find(estyle) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[estyle]; @@ -1231,13 +1231,13 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) } } - if (compute[ncompute] == NULL && + if (compute[ncompute] == nullptr && compute_map->find(arg[2]) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[arg[2]]; compute[ncompute] = compute_creator(lmp,narg,arg); } - if (compute[ncompute] == NULL) + if (compute[ncompute] == nullptr) error->all(FLERR,utils::check_packages_for_style("compute",arg[2],lmp)); ncompute++; @@ -1428,7 +1428,7 @@ int Modify::read_restart(FILE *fp) // nfix_restart_global = # of restart entries with global state info int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world); // allocate space for each entry @@ -1445,22 +1445,22 @@ int Modify::read_restart(FILE *fp) int n; for (int i = 0; i < nfix_restart_global; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); state_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world); used_restart_global[i] = 0; @@ -1470,7 +1470,7 @@ int Modify::read_restart(FILE *fp) int maxsize = 0; - if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world); // allocate space for each entry @@ -1487,19 +1487,19 @@ int Modify::read_restart(FILE *fp) // set index = which set of extra data this fix represents for (int i = 0; i < nfix_restart_peratom; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); maxsize += n; diff --git a/src/molecule.cpp b/src/molecule.cpp index 0d81f49a5..6957dbdc0 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -39,16 +39,16 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : - Pointers(lmp), id(NULL), x(NULL), type(NULL), molecule(NULL), q(NULL), radius(NULL), - rmass(NULL), num_bond(NULL), bond_type(NULL), bond_atom(NULL), - num_angle(NULL), angle_type(NULL), angle_atom1(NULL), angle_atom2(NULL), - angle_atom3(NULL), num_dihedral(NULL), dihedral_type(NULL), dihedral_atom1(NULL), - dihedral_atom2(NULL), dihedral_atom3(NULL), dihedral_atom4(NULL), num_improper(NULL), - improper_type(NULL), improper_atom1(NULL), improper_atom2(NULL), - improper_atom3(NULL), improper_atom4(NULL), nspecial(NULL), special(NULL), - shake_flag(NULL), shake_atom(NULL), shake_type(NULL), avec_body(NULL), ibodyparams(NULL), - dbodyparams(NULL), fragmentmask(NULL), - dx(NULL), dxcom(NULL), dxbody(NULL), quat_external(NULL), fp(NULL), count(NULL) + Pointers(lmp), id(nullptr), x(nullptr), type(nullptr), molecule(nullptr), q(nullptr), radius(nullptr), + rmass(nullptr), num_bond(nullptr), bond_type(nullptr), bond_atom(nullptr), + num_angle(nullptr), angle_type(nullptr), angle_atom1(nullptr), angle_atom2(nullptr), + angle_atom3(nullptr), num_dihedral(nullptr), dihedral_type(nullptr), dihedral_atom1(nullptr), + dihedral_atom2(nullptr), dihedral_atom3(nullptr), dihedral_atom4(nullptr), num_improper(nullptr), + improper_type(nullptr), improper_atom1(nullptr), improper_atom2(nullptr), + improper_atom3(nullptr), improper_atom4(nullptr), nspecial(nullptr), special(nullptr), + shake_flag(nullptr), shake_atom(nullptr), shake_type(nullptr), avec_body(nullptr), ibodyparams(nullptr), + dbodyparams(nullptr), fragmentmask(nullptr), + dx(nullptr), dxcom(nullptr), dxbody(nullptr), quat_external(nullptr), fp(nullptr), count(nullptr) { me = comm->me; @@ -406,7 +406,7 @@ void Molecule::read(int flag) if (me == 0) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of molecule file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of molecule file"); } // read header lines @@ -511,7 +511,7 @@ void Molecule::read(int flag) // count = vector for tallying bonds,angles,etc per atom if (flag == 0) memory->create(count,natoms,"molecule:count"); - else count = NULL; + else count = nullptr; // grab keyword and skip next line @@ -1703,41 +1703,41 @@ void Molecule::initialize() centerflag = massflag = comflag = inertiaflag = 0; tag_require = 0; - x = NULL; - type = NULL; - q = NULL; - radius = NULL; - rmass = NULL; + x = nullptr; + type = nullptr; + q = nullptr; + radius = nullptr; + rmass = nullptr; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; - ibodyparams = NULL; - dbodyparams = NULL; + ibodyparams = nullptr; + dbodyparams = nullptr; - dx = NULL; - dxcom = NULL; - dxbody = NULL; + dx = nullptr; + dxcom = nullptr; + dxbody = nullptr; } /* ---------------------------------------------------------------------- @@ -1901,7 +1901,7 @@ void Molecule::deallocate() void Molecule::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open molecule file {}: {}", file, utils::getsyserror())); } @@ -1914,7 +1914,7 @@ void Molecule::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1937,11 +1937,11 @@ void Molecule::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return diff --git a/src/my_page.cpp b/src/my_page.cpp index 95dd56fec..2416c7e76 100644 --- a/src/my_page.cpp +++ b/src/my_page.cpp @@ -113,7 +113,7 @@ template T *MyPage::get(int n) { if (n > maxchunk) { errorflag = 1; - return NULL; + return nullptr; } ndatum += n; nchunk++; @@ -129,7 +129,7 @@ T *MyPage::get(int n) { ipage++; if (ipage == npage) { allocate(); - if (errorflag) return NULL; + if (errorflag) return nullptr; } page = pages[ipage]; index = n; diff --git a/src/my_page.h b/src/my_page.h index 4beb397ae..0e4375ed7 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -53,7 +53,7 @@ class MyPage { ipage++; if (ipage == npage) { allocate(); - if (errorflag) return NULL; + if (errorflag) return nullptr; } page = pages[ipage]; index = 0; diff --git a/src/nbin.cpp b/src/nbin.cpp index 1092311f6..d3211cd62 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -27,9 +27,9 @@ NBin::NBin(LAMMPS *lmp) : Pointers(lmp) { last_bin = -1; mbins = maxbin = maxatom = 0; - binhead = NULL; - bins = NULL; - atom2bin = NULL; + binhead = nullptr; + bins = nullptr; + atom2bin = nullptr; neighbor->last_setup_bins = -1; diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index c01f8ca59..fae1a2941 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -33,9 +33,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) maxatom = 0; inum = gnum = 0; - ilist = NULL; - numneigh = NULL; - firstneigh = NULL; + ilist = nullptr; + numneigh = nullptr; + firstneigh = nullptr; // defaults, but may be reset by post_constructor() @@ -51,31 +51,31 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // ptrs - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; - listcopy = NULL; - listskip = NULL; - listfull = NULL; + listcopy = nullptr; + listskip = nullptr; + listfull = nullptr; - fix_bond = NULL; + fix_bond = nullptr; - ipage = NULL; + ipage = nullptr; // extra rRESPA lists inum_inner = gnum_inner = 0; - ilist_inner = NULL; - numneigh_inner = NULL; - firstneigh_inner = NULL; + ilist_inner = nullptr; + numneigh_inner = nullptr; + firstneigh_inner = nullptr; inum_middle = gnum_middle = 0; - ilist_middle = NULL; - numneigh_middle = NULL; - firstneigh_middle = NULL; + ilist_middle = nullptr; + numneigh_middle = nullptr; + firstneigh_middle = nullptr; - ipage_inner = NULL; - ipage_middle = NULL; + ipage_inner = nullptr; + ipage_middle = nullptr; // Kokkos package @@ -85,9 +85,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // USER-DPD package - np = NULL; + np = nullptr; - requestor = NULL; + requestor = nullptr; requestor_type = NeighList::NONE; } diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 006ff5e87..f4c7e7e0b 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -71,12 +71,12 @@ NeighRequest::NeighRequest(LAMMPS *lmp) : Pointers(lmp) // skip info, default is no skipping skip = 0; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; // only set when command = 1; - command_style = NULL; + command_style = nullptr; // info set by Neighbor class when morphing original requests @@ -217,8 +217,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) cut = other->cut; cutoff = other->cutoff; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; if (!skipflag) return; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 66ab92496..26e7d6b74 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -76,7 +76,7 @@ static const char cite_neigh_multi[] = /* ---------------------------------------------------------------------- */ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp), -pairclass(NULL), pairnames(NULL), pairmasks(NULL) +pairclass(nullptr), pairnames(nullptr), pairmasks(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -95,62 +95,62 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) ago = -1; cutneighmax = 0.0; - cutneighsq = NULL; - cutneighghostsq = NULL; - cuttype = NULL; - cuttypesq = NULL; - fixchecklist = NULL; + cutneighsq = nullptr; + cutneighghostsq = nullptr; + cuttype = nullptr; + cuttypesq = nullptr; + fixchecklist = nullptr; // pairwise neighbor lists and associated data structs nlist = 0; - lists = NULL; + lists = nullptr; nbin = 0; - neigh_bin = NULL; + neigh_bin = nullptr; nstencil = 0; - neigh_stencil = NULL; + neigh_stencil = nullptr; - neigh_pair = NULL; + neigh_pair = nullptr; nstencil_perpetual = 0; - slist = NULL; + slist = nullptr; npair_perpetual = 0; - plist = NULL; + plist = nullptr; nrequest = maxrequest = 0; - requests = NULL; + requests = nullptr; old_nrequest = 0; - old_requests = NULL; + old_requests = nullptr; old_style = style; old_triclinic = 0; old_pgsize = pgsize; old_oneatom = oneatom; - binclass = NULL; - binnames = NULL; - binmasks = NULL; - stencilclass = NULL; - stencilnames = NULL; - stencilmasks = NULL; + binclass = nullptr; + binnames = nullptr; + binmasks = nullptr; + stencilclass = nullptr; + stencilnames = nullptr; + stencilmasks = nullptr; // topology lists bondwhich = anglewhich = dihedralwhich = improperwhich = NONE; - neigh_bond = NULL; - neigh_angle = NULL; - neigh_dihedral = NULL; - neigh_improper = NULL; + neigh_bond = nullptr; + neigh_angle = nullptr; + neigh_dihedral = nullptr; + neigh_improper = nullptr; // coords at last neighboring maxhold = 0; - xhold = NULL; + xhold = nullptr; lastcall = -1; last_setup_bins = -1; @@ -159,14 +159,14 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) includegroup = 0; nex_type = maxex_type = 0; - ex1_type = ex2_type = NULL; - ex_type = NULL; + ex1_type = ex2_type = nullptr; + ex_type = nullptr; nex_group = maxex_group = 0; - ex1_group = ex2_group = ex1_bit = ex2_bit = NULL; + ex1_group = ex2_group = ex1_bit = ex2_bit = nullptr; nex_mol = maxex_mol = 0; - ex_mol_group = ex_mol_bit = ex_mol_intra = NULL; + ex_mol_group = ex_mol_bit = ex_mol_intra = nullptr; // Kokkos setting @@ -270,7 +270,7 @@ void Neighbor::init() // set neighbor cutoffs (force cutoff + skin) // trigger determines when atoms migrate and neighbor lists are rebuilt // needs to be non-zero for migration distance check - // even if pair = NULL and no neighbor lists are used + // even if pair = nullptr and no neighbor lists are used // cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0 // cutneighghost = pair cutghost if it requests it, else same as cutneigh @@ -281,7 +281,7 @@ void Neighbor::init() boxcheck = 1; n = atom->ntypes; - if (cutneighsq == NULL) { + if (cutneighsq == nullptr) { if (lmp->kokkos) init_cutneighsq_kokkos(n); else memory->create(cutneighsq,n+1,n+1,"neigh:cutneighsq"); memory->create(cutneighghostsq,n+1,n+1,"neigh:cutneighghostsq"); @@ -338,7 +338,7 @@ void Neighbor::init() if (output->restart_flag) restart_check = 1; delete [] fixchecklist; - fixchecklist = NULL; + fixchecklist = nullptr; fixchecklist = new int[modify->nfix]; fix_check = 0; @@ -378,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-NULL pointer if there is only one substyle of the kind. + // will only return a non-nullptr pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; @@ -410,7 +410,7 @@ void Neighbor::init() if (dist_check == 0) { memory->destroy(xhold); maxhold = 0; - xhold = NULL; + xhold = nullptr; } // first time allocation @@ -515,7 +515,7 @@ void Neighbor::init() for (int i = 0; i < nrequest; i++) { delete requests[i]; - requests[i] = NULL; + requests[i] = nullptr; } nrequest = 0; @@ -809,7 +809,7 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_stencil[nstencil]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_stencil[nstencil]->nb == NULL) + if (neigh_stencil[nstencil]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor stencil"); } @@ -823,7 +823,7 @@ int Neighbor::init_pair() requests[i]->index_pair = -1; flag = lists[i]->pair_method; if (flag == 0) { - neigh_pair[i] = NULL; + neigh_pair[i] = nullptr; continue; } @@ -834,12 +834,12 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_pair[i]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_pair[i]->nb == NULL) + if (neigh_pair[i]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor pair"); } if (lists[i]->stencil_method > 0) { neigh_pair[i]->ns = neigh_stencil[requests[i]->index_stencil]; - if (neigh_pair[i]->ns == NULL) + if (neigh_pair[i]->ns == nullptr) error->all(FLERR,"Could not assign stencil method to neighbor pair"); } @@ -905,11 +905,11 @@ int Neighbor::init_pair() done = 1; for (i = 0; i < npair_perpetual; i++) { for (k = 0; k < 3; k++) { - ptr = NULL; + ptr = nullptr; if (k == 0) ptr = lists[plist[i]]->listcopy; if (k == 1) ptr = lists[plist[i]]->listskip; if (k == 2) ptr = lists[plist[i]]->listfull; - if (ptr == NULL) continue; + if (ptr == nullptr) continue; for (m = 0; m < nrequest; m++) if (ptr == lists[m]) break; for (j = 0; j < npair_perpetual; j++) @@ -1575,17 +1575,17 @@ void Neighbor::requests_new2old() /* ---------------------------------------------------------------------- find and return request made by classptr - if not found or classpt = NULL, return NULL + if not found or classpt = nullptr, return nullptr ------------------------------------------------------------------------- */ NeighRequest *Neighbor::find_request(void *classptr) { - if (classptr == NULL) return NULL; + if (classptr == nullptr) return nullptr; for (int i = 0; i < nrequest; i++) if (requests[i]->requestor == classptr) return requests[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -2138,7 +2138,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) { // check if list structure is initialized - if (mylist == NULL) + if (mylist == nullptr) error->all(FLERR,"Trying to build an occasional neighbor list " "before initialization completed"); @@ -2283,7 +2283,7 @@ void Neighbor::modify_params(int narg, char **arg) includegroup = group->find(arg[iarg+1]); if (includegroup < 0) error->all(FLERR,"Invalid group ID in neigh_modify command"); - if (includegroup && (atom->firstgroupname == NULL || + if (includegroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR, "Neigh_modify include group != atom_modify first group"); diff --git a/src/npair.cpp b/src/npair.cpp index b63135fad..698ff2806 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -27,10 +27,10 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ NPair::NPair(LAMMPS *lmp) - : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL) + : Pointers(lmp), nb(nullptr), ns(nullptr), bins(nullptr), stencil(nullptr) { last_build = -1; - mycutneighsq = NULL; + mycutneighsq = nullptr; molecular = atom->molecular; copymode = 0; execution_space = Host; diff --git a/src/nstencil.cpp b/src/nstencil.cpp index 431906e89..aae6c9b1d 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -59,11 +59,11 @@ NStencil::NStencil(LAMMPS *lmp) : Pointers(lmp) xyzflag = 0; maxstencil = maxstencil_multi = 0; - stencil = NULL; - stencilxyz = NULL; - nstencil_multi = NULL; - stencil_multi = NULL; - distsq_multi = NULL; + stencil = nullptr; + stencilxyz = nullptr; + nstencil_multi = nullptr; + stencil_multi = nullptr; + distsq_multi = nullptr; dimension = domain->dimension; } @@ -179,8 +179,8 @@ void NStencil::create_setup() distsq_multi = new double*[n+1]; for (i = 1; i <= n; i++) { nstencil_multi[i] = 0; - stencil_multi[i] = NULL; - distsq_multi[i] = NULL; + stencil_multi[i] = nullptr; + distsq_multi[i] = nullptr; } } if (smax > maxstencil_multi) { diff --git a/src/ntopo.cpp b/src/ntopo.cpp index d4ddcc7fc..02a86e33c 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -33,7 +33,7 @@ NTopo::NTopo(LAMMPS *lmp) : Pointers(lmp) nbondlist = nanglelist = ndihedrallist = nimproperlist = 0; maxbond = maxangle = maxdihedral = maximproper = 0; - bondlist = anglelist = dihedrallist = improperlist = NULL; + bondlist = anglelist = dihedrallist = improperlist = nullptr; cluster_check = neighbor->cluster_check; } diff --git a/src/output.cpp b/src/output.cpp index 6c90198de..13261396d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -56,23 +56,23 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp) delete [] newarg; thermo_every = 0; - var_thermo = NULL; + var_thermo = nullptr; ndump = 0; max_dump = 0; - every_dump = NULL; - next_dump = NULL; - last_dump = NULL; - var_dump = NULL; - ivar_dump = NULL; - dump = NULL; + every_dump = nullptr; + next_dump = nullptr; + last_dump = nullptr; + var_dump = nullptr; + ivar_dump = nullptr; + dump = nullptr; restart_flag = restart_flag_single = restart_flag_double = 0; restart_every_single = restart_every_double = 0; last_restart = -1; - restart1 = restart2a = restart2b = NULL; - var_restart_single = var_restart_double = NULL; - restart = NULL; + restart1 = restart2a = restart2b = nullptr; + var_restart_single = var_restart_double = nullptr; + restart = nullptr; dump_map = new DumpCreatorMap(); @@ -560,7 +560,7 @@ void Output::add_dump(int narg, char **arg) every_dump[ndump] = 0; last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ivar_dump[ndump] = -1; // create the Dump @@ -573,7 +573,7 @@ void Output::add_dump(int narg, char **arg) every_dump[ndump] = utils::inumeric(FLERR,arg[3],false,lmp); if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command"); last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ndump++; } @@ -641,7 +641,7 @@ void Output::delete_dump(char *id) int Output::find_dump(const char *id) { - if (id == NULL) return -1; + if (id == nullptr) return -1; int idump; for (idump = 0; idump < ndump; idump++) if (strcmp(id,dump[idump]->id) == 0) break; @@ -661,7 +661,7 @@ void Output::set_thermo(int narg, char **arg) // variable spaced thermo outputs to constant spaced ones. delete [] var_thermo; - var_thermo = NULL; + var_thermo = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; @@ -692,10 +692,10 @@ void Output::create_thermo(int narg, char **arg) error->warning(FLERR,"New thermo_style command, " "previous thermo_modify settings will be lost"); - // set thermo = NULL in case new Thermo throws an error + // set thermo = nullptr in case new Thermo throws an error delete thermo; - thermo = NULL; + thermo = nullptr; thermo = new Thermo(lmp,narg,arg); } @@ -721,14 +721,14 @@ void Output::create_restart(int narg, char **arg) last_restart = -1; delete restart; - restart = NULL; + restart = nullptr; delete [] restart1; delete [] restart2a; delete [] restart2b; - restart1 = restart2a = restart2b = NULL; + restart1 = restart2a = restart2b = nullptr; delete [] var_restart_single; delete [] var_restart_double; - var_restart_single = var_restart_double = NULL; + var_restart_single = var_restart_double = nullptr; return; } @@ -754,7 +754,7 @@ void Output::create_restart(int narg, char **arg) delete [] restart1; restart1 = new char[n]; strcpy(restart1,arg[1]); - if (strchr(restart1,'*') == NULL) strcat(restart1,".*"); + if (strchr(restart1,'*') == nullptr) strcat(restart1,".*"); } if (nfile == 2) { diff --git a/src/output.h b/src/output.h index 06be7b244..6a64e67c9 100644 --- a/src/output.h +++ b/src/output.h @@ -29,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, NULL if every + char *var_thermo; // variable name for thermo freq, nullptr if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations diff --git a/src/pair.cpp b/src/pair.cpp index d869bbe8d..60a5c0d8b 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -67,12 +67,12 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) unit_convert_flag = utils::NOCONVERT; nextra = 0; - pvector = NULL; + pvector = nullptr; single_extra = 0; - svector = NULL; + svector = nullptr; - setflag = NULL; - cutsq = NULL; + setflag = nullptr; + cutsq = nullptr; ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = dipoleflag = spinflag = 0; reinitflag = 1; @@ -91,19 +91,19 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) ndisptablebits = 12; tabinner = sqrt(2.0); tabinner_disp = sqrt(2.0); - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; allocated = 0; suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; num_tally_compute = 0; - list_tally_compute = NULL; + list_tally_compute = nullptr; nondefault_history_transfer = 0; beyond_contact = 0; @@ -123,7 +123,7 @@ Pair::~Pair() { num_tally_compute = 0; memory->sfree((void *) list_tally_compute); - list_tally_compute = NULL; + list_tally_compute = nullptr; if (copymode) return; @@ -331,7 +331,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) double r,grij,expm2,derfc,egamma,fgamma,rsw; double qqrd2e = force->qqrd2e; - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); double g_ewald = force->kspace->g_ewald; @@ -359,8 +359,8 @@ void Pair::init_tables(double cut_coul, double *cut_respa) memory->create(dctable,ntable,"pair:dctable"); memory->create(detable,ntable,"pair:detable"); - if (cut_respa == NULL) { - vtable = ptable = dvtable = dptable = NULL; + if (cut_respa == nullptr) { + vtable = ptable = dvtable = dptable = nullptr; } else { memory->create(vtable,ntable,"pair:vtable"); memory->create(ptable,ntable,"pair:ptable"); @@ -391,7 +391,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { rtable[i] = rsq_lookup.f; ctable[i] = qqrd2e/r; if (msmflag) { @@ -488,7 +488,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { c_tmp = qqrd2e/r; if (msmflag) { f_tmp = qqrd2e/r * fgamma; @@ -1664,7 +1664,7 @@ void Pair::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -1672,7 +1672,7 @@ void Pair::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by pair_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open pair_write file {}: {}", table_file, utils::getsyserror())); fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n", diff --git a/src/pair.h b/src/pair.h index 00f433233..ace233539 100644 --- a/src/pair.h +++ b/src/pair.h @@ -197,7 +197,7 @@ class Pair : protected Pointers { // specific child-class methods for certain Pair styles - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void swap_eam(double *, double **) {} virtual void reset_dt() {} virtual void min_xf_pointers(int, double **, double **) {} diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index 87aa0bab5..777c7e4c4 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -281,16 +281,16 @@ void PairBeck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world); @@ -320,8 +320,8 @@ void PairBeck::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_born.cpp b/src/pair_born.cpp index 5b0d3a656..fee494fd9 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -330,16 +330,16 @@ void PairBorn::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -370,10 +370,10 @@ void PairBorn::write_restart_settings(FILE *fp) void PairBorn::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -433,5 +433,5 @@ void *PairBorn::extract(const char *str, int &dim) if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; if (strcmp(str,"d") == 0) return (void *) d; - return NULL; + return nullptr; } diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index e4617b5c4..abe3d1e07 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -361,16 +361,16 @@ void PairBornCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -402,11 +402,11 @@ void PairBornCoulDSF::write_restart_settings(FILE *fp) void PairBornCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index 30fe8fcde..a873ec6c6 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -360,16 +360,16 @@ void PairBornCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairBornCoulWolf::write_restart_settings(FILE *fp) void PairBornCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 1abdbcc68..6de115a0e 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -309,14 +309,14 @@ void PairBuck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -345,10 +345,10 @@ void PairBuck::write_restart_settings(FILE *fp) void PairBuck::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -405,5 +405,5 @@ void *PairBuck::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 9fac17aed..9cc90ebc8 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -364,15 +364,15 @@ void PairBuckCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -403,11 +403,11 @@ void PairBuckCoulCut::write_restart_settings(FILE *fp) void PairBuckCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index 67c471a5e..5aa281190 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -247,10 +247,10 @@ void PairCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -274,9 +274,9 @@ void PairCoulCut::write_restart_settings(FILE *fp) void PairCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -307,5 +307,5 @@ void *PairCoulCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"cut_coul") == 0) return (void *) &cut; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index 209371824..31838fbee 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -146,10 +146,10 @@ void PairCoulDebye::write_restart_settings(FILE *fp) void PairCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_dsf.cpp b/src/pair_coul_dsf.cpp index ee124c7f5..94106405b 100644 --- a/src/pair_coul_dsf.cpp +++ b/src/pair_coul_dsf.cpp @@ -254,7 +254,7 @@ void PairCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -278,10 +278,10 @@ void PairCoulDSF::write_restart_settings(FILE *fp) void PairCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -327,5 +327,5 @@ void *PairCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index e538275b3..6ff958483 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -51,11 +51,11 @@ PairCoulStreitz::PairCoulStreitz(LAMMPS *lmp) : Pair(lmp) nmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if nullptr // nelements = # of unique elements // elements = list of element names @@ -152,7 +152,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -215,7 +215,7 @@ void PairCoulStreitz::init_style() // insure use of KSpace long-range solver when ewald specified, set g_ewald if (ewaldflag) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -799,5 +799,5 @@ void *PairCoulStreitz::extract(const char *str, int &dim) if (kspacetype == 1) return (void *) &g_wolf; if (kspacetype == 2) return (void *) &g_ewald; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp index e3079dcaf..994e74fc9 100644 --- a/src/pair_coul_wolf.cpp +++ b/src/pair_coul_wolf.cpp @@ -250,7 +250,7 @@ void PairCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -274,10 +274,10 @@ void PairCoulWolf::write_restart_settings(FILE *fp) void PairCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index d0d9b98fc..d92f4b7cc 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) { writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -314,13 +314,13 @@ void PairDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairDPD::write_restart_settings(FILE *fp) void PairDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index dd0e14495..4b9c186da 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -232,12 +232,12 @@ void PairDPDTstat::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -265,11 +265,11 @@ void PairDPDTstat::write_restart_settings(FILE *fp) void PairDPDTstat::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&t_start,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&t_start,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&t_start,1,MPI_DOUBLE,0,world); MPI_Bcast(&t_stop,1,MPI_DOUBLE,0,world); diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index 673229676..39c8caa73 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -280,13 +280,13 @@ void PairGauss::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world); @@ -313,9 +313,9 @@ void PairGauss::write_restart_settings(FILE *fp) void PairGauss::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairGauss::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) a; - return NULL; + return nullptr; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 0b1882f12..7f7f795b8 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -35,8 +35,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp), - styles(NULL), keywords(NULL), multiple(NULL), nmap(NULL), - map(NULL), special_lj(NULL), special_coul(NULL), compute_tally(NULL) + styles(nullptr), keywords(nullptr), multiple(nullptr), nmap(nullptr), + map(nullptr), special_lj(nullptr), special_coul(nullptr), compute_tally(nullptr) { nstyles = 0; @@ -116,7 +116,7 @@ void PairHybrid::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; @@ -324,7 +324,7 @@ void PairHybrid::settings(int narg, char **arg) styles[nstyles] = force->new_pair(arg[iarg],1,dummy); force->store_style(keywords[nstyles],arg[iarg],0); - special_lj[nstyles] = special_coul[nstyles] = NULL; + special_lj[nstyles] = special_coul[nstyles] = nullptr; compute_tally[nstyles] = 1; // determine list of arguments for pair style settings @@ -706,10 +706,10 @@ void PairHybrid::write_restart(FILE *fp) fwrite(keywords[m],sizeof(char),n,fp); styles[m]->write_restart_settings(fp); // write out per style special settings, if present - n = (special_lj[m] == NULL) ? 0 : 1; + n = (special_lj[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_lj[m],sizeof(double),4,fp); - n = (special_coul[m] == NULL) ? 0 : 1; + n = (special_coul[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_coul[m],sizeof(double),4,fp); } @@ -722,7 +722,7 @@ void PairHybrid::write_restart(FILE *fp) void PairHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); // allocate list of sub-styles @@ -745,32 +745,32 @@ void PairHybrid::read_restart(FILE *fp) // each sub-style is created via new_pair() // each reads its settings, but no coeff info - if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,nullptr,error); MPI_Bcast(compute_tally,nstyles,MPI_INT,0,world); int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_pair(keywords[m],1,dummy); styles[m]->read_restart_settings(fp); // read back per style special settings, if present - special_lj[m] = special_coul[m] = NULL; - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + special_lj[m] = special_coul[m] = nullptr; + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_lj[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_lj[m],4,MPI_DOUBLE,0,world); } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_coul[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_coul[m],4,MPI_DOUBLE,0,world); } } @@ -813,8 +813,8 @@ double PairHybrid::single(int i, int j, int itype, int jtype, if (styles[map[itype][jtype][m]]->single_enable == 0) error->one(FLERR,"Pair hybrid sub-style does not support single call"); - if ((special_lj[map[itype][jtype][m]] != NULL) || - (special_coul[map[itype][jtype][m]] != NULL)) + if ((special_lj[map[itype][jtype][m]] != nullptr) || + (special_coul[map[itype][jtype][m]] != nullptr)) error->one(FLERR,"Pair hybrid single calls do not support" " per sub-style special bond values"); @@ -1006,13 +1006,13 @@ void PairHybrid::restore_special(double *saved) /* ---------------------------------------------------------------------- extract a ptr to a particular quantity stored by pair pass request thru to sub-styles - return first non-NULL result except for cut_coul request - for cut_coul, insure all non-NULL results are equal since required by Kspace + return first non-nullptr result except for cut_coul request + for cut_coul, insure all non-nullptr results are equal since required by Kspace ------------------------------------------------------------------------- */ void *PairHybrid::extract(const char *str, int &dim) { - void *cutptr = NULL; + void *cutptr = nullptr; void *ptr; double cutvalue = 0.0; int couldim = -1; @@ -1037,7 +1037,7 @@ void *PairHybrid::extract(const char *str, int &dim) } if (strcmp(str,"cut_coul") == 0) return cutptr; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index 34c4cfe41..8d352e9f2 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -140,7 +140,7 @@ void PairHybridOverlay::copy_svector(int itype, int jtype) if (m == map[itype][jtype][k]) { this_style = styles[m]; } else { - this_style = NULL; + this_style = nullptr; } } for (int l = 0; l < styles[m]->single_extra; ++l) { diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index a4ba3b858..444538b25 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -41,7 +41,7 @@ PairLJ96Cut::PairLJ96Cut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -508,7 +508,7 @@ void PairLJ96Cut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -607,13 +607,13 @@ void PairLJ96Cut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -642,10 +642,10 @@ void PairLJ96Cut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index b6c91cafe..f5f8038be 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -279,14 +279,14 @@ void PairLJCubic::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -313,7 +313,7 @@ void PairLJCubic::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index bd42801f3..f9b5a2552 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -502,7 +502,7 @@ void PairLJCut::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -601,13 +601,13 @@ void PairLJCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -636,10 +636,10 @@ void PairLJCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -693,5 +693,5 @@ void *PairLJCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 669d48c86..38f4316d2 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -354,14 +354,14 @@ void PairLJCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -391,11 +391,11 @@ void PairLJCutCoulCut::write_restart_settings(FILE *fp) void PairLJCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -466,5 +466,5 @@ void *PairLJCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp index 3ddb898c8..ed09e9806 100644 --- a/src/pair_lj_cut_coul_debye.cpp +++ b/src/pair_lj_cut_coul_debye.cpp @@ -171,11 +171,11 @@ void PairLJCutCoulDebye::write_restart_settings(FILE *fp) void PairLJCutCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index 952a14003..f2c48b222 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -377,13 +377,13 @@ void PairLJCutCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJCutCoulDSF::write_restart_settings(FILE *fp) void PairLJCutCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -477,5 +477,5 @@ void *PairLJCutCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_wolf.cpp b/src/pair_lj_cut_coul_wolf.cpp index 749cc9e6a..e6b00b9a5 100644 --- a/src/pair_lj_cut_coul_wolf.cpp +++ b/src/pair_lj_cut_coul_wolf.cpp @@ -370,13 +370,13 @@ void PairLJCutCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -407,12 +407,12 @@ void PairLJCutCoulWolf::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index 3f711e2a1..c68c2298e 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -325,14 +325,14 @@ void PairLJExpand::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -361,10 +361,10 @@ void PairLJExpand::write_restart_settings(FILE *fp) void PairLJExpand::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -423,5 +423,5 @@ void *PairLJExpand::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index 0818c60f3..05f30bcdd 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -339,14 +339,14 @@ void PairLJGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -376,10 +376,10 @@ void PairLJGromacs::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index 005bc4406..481e65723 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -379,12 +379,12 @@ void PairLJGromacsCoulGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJGromacsCoulGromacs::write_restart_settings(FILE *fp) void PairLJGromacsCoulGromacs::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index a53d703b8..7afc66735 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -353,14 +353,14 @@ void PairLJSmooth::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -390,10 +390,10 @@ void PairLJSmooth::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 3697208d4..78a538f13 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -286,13 +286,13 @@ void PairLJSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -319,8 +319,8 @@ void PairLJSmoothLinear::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 7447e143f..5030ffc2a 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -40,7 +40,7 @@ using namespace MathConst; PairMIECut::PairMIECut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -517,7 +517,7 @@ void PairMIECut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -628,15 +628,15 @@ void PairMIECut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -667,10 +667,10 @@ void PairMIECut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -706,5 +706,5 @@ void *PairMIECut::extract(const char *str, int &dim) if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamR") == 0) return (void *) gamR; if (strcmp(str,"gamA") == 0) return (void *) gamA; - return NULL; + return nullptr; } diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index efcc1aa81..b55fc7a85 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -266,14 +266,14 @@ void PairMorse::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -301,9 +301,9 @@ void PairMorse::write_restart_settings(FILE *fp) void PairMorse::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -357,5 +357,5 @@ void *PairMorse::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index f3dd139b6..b6a315198 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -245,12 +245,12 @@ void PairSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -275,8 +275,8 @@ void PairSoft::write_restart_settings(FILE *fp) void PairSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -326,5 +326,5 @@ void *PairSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) prefactor; - return NULL; + return nullptr; } diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 1711465ff..c0fad544d 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -43,7 +43,7 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTable::PairTable(LAMMPS *lmp) : Pair(lmp) { ntables = 0; - tables = NULL; + tables = nullptr; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); } @@ -246,7 +246,7 @@ void PairTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -821,15 +821,15 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to nullptr, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -951,13 +951,13 @@ void PairTable::write_restart_settings(FILE *fp) void PairTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -1029,7 +1029,7 @@ double PairTable::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq, void *PairTable::extract(const char *str, int &dim) { - if (strcmp(str,"cut_coul") != 0) return NULL; + if (strcmp(str,"cut_coul") != 0) return nullptr; if (ntables == 0) error->all(FLERR,"All pair coeffs are not set"); // only check for cutoff consistency if claiming to be KSpace compatible @@ -1042,5 +1042,5 @@ void *PairTable::extract(const char *str, int &dim) "Pair table cutoffs must all be equal to use with KSpace"); dim = 0; return &tables[0].cut; - } else return NULL; + } else return nullptr; } diff --git a/src/pair_ufm.cpp b/src/pair_ufm.cpp index 50cc87cf9..e1e378155 100644 --- a/src/pair_ufm.cpp +++ b/src/pair_ufm.cpp @@ -278,14 +278,14 @@ void PairUFM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairUFM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -365,5 +365,5 @@ void *PairUFM::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 642949234..6118e5f36 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -253,12 +253,12 @@ void PairYukawa::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -285,10 +285,10 @@ void PairYukawa::write_restart_settings(FILE *fp) void PairYukawa::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index 68c63c980..7b028de65 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -285,10 +285,10 @@ void PairZBL::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][i],1,MPI_INT,0,world); if (setflag[i][i]) { - if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&z[i],1,MPI_DOUBLE,0,world); } } @@ -319,11 +319,11 @@ void PairZBL::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index 976bb1ba3..a45fef67a 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -178,11 +178,11 @@ void PairZero::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -207,8 +207,8 @@ void PairZero::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&coeffflag,1,MPI_INT,0,world); diff --git a/src/procmap.cpp b/src/procmap.cpp index f80af9330..b85b0abd0 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -49,7 +49,7 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid, // factors = list of all possible 3 factors of processor count - int npossible = factor(nprocs,NULL); + int npossible = factor(nprocs,nullptr); memory->create(factors,npossible,3,"procmap:factors"); npossible = factor(nprocs,factors); @@ -93,7 +93,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // nfactors = list of all possible 3 factors of node count // constrain by 2d - int nnpossible = factor(nprocs/ncores,NULL); + int nnpossible = factor(nprocs/ncores,nullptr); memory->create(nfactors,nnpossible,3,"procmap:nfactors"); nnpossible = factor(nprocs/ncores,nfactors); @@ -102,7 +102,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // cfactors = list of all possible 3 factors of core count // constrain by 2d - int ncpossible = factor(ncores,NULL); + int ncpossible = factor(ncores,nullptr); memory->create(cfactors,ncpossible,3,"procmap:cfactors"); ncpossible = factor(ncores,cfactors); @@ -205,7 +205,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, // initial factorization within NUMA node int **numafactors; - int numapossible = factor(procs_per_numa,NULL); + int numapossible = factor(procs_per_numa,nullptr); memory->create(numafactors,numapossible,3,"procmap:numafactors"); numapossible = factor(procs_per_numa,numafactors); @@ -230,7 +230,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, int node_count = nprocs / procs_per_numa; int **nodefactors; - int nodepossible = factor(node_count,NULL); + int nodepossible = factor(node_count,nullptr); memory->create(nodefactors,nodepossible,3,"procmap:nodefactors"); nodepossible = factor(node_count,nodefactors); @@ -281,11 +281,11 @@ void ProcMap::custom_grid(char *cfile, int nprocs, MPI_Comm_rank(world,&me); char line[MAXLINE]; - FILE *fp = NULL; + FILE *fp = nullptr; if (me == 0) { fp = fopen(cfile,"r"); - if (fp == NULL) error->one(FLERR,"Cannot open custom file"); + if (fp == nullptr) error->one(FLERR,"Cannot open custom file"); // skip header = blank and comment lines @@ -662,7 +662,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) FILE *fp; if (me == 0) { fp = fopen(file,"w"); - if (fp == NULL) error->one(FLERR,"Cannot open processors output file"); + if (fp == nullptr) error->one(FLERR,"Cannot open processors output file"); fprintf(fp,"LAMMPS mapping of processors to 3d grid\n"); fprintf(fp,"partition = %d\n",universe->iworld+1); fprintf(fp,"Px Py Pz = %d %d %d\n",procgrid[0],procgrid[1],procgrid[2]); @@ -722,7 +722,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) /* ---------------------------------------------------------------------- generate all possible 3-integer factorizations of N - store them in factors if non-NULL + store them in factors if non-nullptr return # of factorizations ------------------------------------------------------------------------- */ diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 29314525a..3f5bd7a62 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -27,7 +27,7 @@ enum{ADD,SUBTRACT}; /* ---------------------------------------------------------------------- */ RanMars::RanMars(LAMMPS *lmp, int seed) : Pointers(lmp), - u(NULL) + u(nullptr) { int ij,kl,i,j,k,l,ii,jj,m; double s,t; diff --git a/src/rcb.cpp b/src/rcb.cpp index 03c99560b..36e1a5474 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -39,19 +39,19 @@ RCB::RCB(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); ndot = maxdot = 0; - dots = NULL; + dots = nullptr; nlist = maxlist = 0; - dotlist = dotmark = dotmark_select = NULL; + dotlist = dotmark = dotmark_select = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; maxrecv = maxsend = 0; - recvproc = recvindex = sendproc = sendindex = NULL; + recvproc = recvindex = sendproc = sendindex = nullptr; - tree = NULL; - irregular = NULL; + tree = nullptr; + irregular = nullptr; // create MPI data and function types for box and median AllReduce ops @@ -95,7 +95,7 @@ RCB::~RCB() NEW version: each RCB cut is tested in all dimensions dimeension that produces 2 boxes with largest min size is selected this is to prevent very narrow boxes from being produced - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -573,10 +573,10 @@ void RCB::compute(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner @@ -632,7 +632,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt, /* ---------------------------------------------------------------------- perform RCB balancing of N particles at coords X in bounding box LO/HI OLD version: each RCB cut is made in longest dimension of sub-box - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -1065,10 +1065,10 @@ void RCB::compute_old(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner diff --git a/src/read_data.cpp b/src/read_data.cpp index 2a6801b3a..231871c47 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -62,7 +62,7 @@ enum{NONE,APPEND,VALUE,MERGE}; const char *suffixes[] = {"/cuda","/gpu","/opt","/omp","/kk", "/coul/cut","/coul/long","/coul/msm", "/coul/dsf","/coul/debye","/coul/charmm", - NULL}; + nullptr}; /* ---------------------------------------------------------------------- */ @@ -74,8 +74,8 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp) style = new char[MAXLINE]; buffer = new char[CHUNK*MAXLINE]; narg = maxarg = 0; - arg = NULL; - fp = NULL; + arg = nullptr; + fp = nullptr; // customize for new sections // pointers to atom styles that store bonus info @@ -132,9 +132,9 @@ void ReadData::command(int narg, char **arg) groupbit = 0; nfix = 0; - fix_index = NULL; - fix_header = NULL; - fix_section = NULL; + fix_index = nullptr; + fix_header = nullptr; + fix_section = nullptr; int iarg = 1; while (iarg < narg) { @@ -277,7 +277,7 @@ void ReadData::command(int narg, char **arg) fix_index[nfix] = modify->find_fix(arg[iarg+1]); if (fix_index[nfix] < 0) error->all(FLERR,"Fix ID for read_data does not exist"); - if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = NULL; + if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = nullptr; else { int n = strlen(arg[iarg+2]) + 1; fix_header[nfix] = new char[n]; @@ -334,12 +334,12 @@ void ReadData::command(int narg, char **arg) // set up pointer to hold original styles while we replace them with "zero" - Pair *saved_pair = NULL; - Bond *saved_bond = NULL; - Angle *saved_angle = NULL; - Dihedral *saved_dihedral = NULL; - Improper *saved_improper = NULL; - KSpace *saved_kspace = NULL; + Pair *saved_pair = nullptr; + Bond *saved_bond = nullptr; + Angle *saved_angle = nullptr; + Dihedral *saved_dihedral = nullptr; + Improper *saved_improper = nullptr; + KSpace *saved_kspace = nullptr; if (coeffflag == 0) { char *coeffs[2]; @@ -347,33 +347,33 @@ void ReadData::command(int narg, char **arg) coeffs[1] = (char *) "nocoeff"; saved_pair = force->pair; - force->pair = NULL; + force->pair = nullptr; force->create_pair("zero",0); if (force->pair) force->pair->settings(2,coeffs); coeffs[0] = coeffs[1]; saved_bond = force->bond; - force->bond = NULL; + force->bond = nullptr; force->create_bond("zero",0); if (force->bond) force->bond->settings(1,coeffs); saved_angle = force->angle; - force->angle = NULL; + force->angle = nullptr; force->create_angle("zero",0); if (force->angle) force->angle->settings(1,coeffs); saved_dihedral = force->dihedral; - force->dihedral = NULL; + force->dihedral = nullptr; force->create_dihedral("zero",0); if (force->dihedral) force->dihedral->settings(1,coeffs); saved_improper = force->improper; - force->improper = NULL; + force->improper = nullptr; force->create_improper("zero",0); if (force->improper) force->improper->settings(1,coeffs); saved_kspace = force->kspace; - force->kspace = NULL; + force->kspace = nullptr; } // ----------------------------------------------------------------- @@ -414,7 +414,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (firstpass) utils::logmesg(lmp,"Reading data file ...\n"); open(arg[0]); - } else fp = NULL; + } else fp = nullptr; // read header info @@ -578,7 +578,7 @@ void ReadData::command(int narg, char **arg) if (firstpass) mass(); else skip_lines(ntypes); } else if (strcmp(keyword,"Pair Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before Pair Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -587,7 +587,7 @@ void ReadData::command(int narg, char **arg) paircoeffs(); } else skip_lines(ntypes); } else if (strcmp(keyword,"PairIJ Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before PairIJ Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -598,7 +598,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Bond Coeffs") == 0) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Invalid data file section: Bond Coeffs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must define bond_style before Bond Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->bond_style)) @@ -609,7 +609,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Angle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: Angle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before Angle Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->angle_style)) @@ -620,7 +620,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Dihedral Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: Dihedral Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->dihedral_style)) @@ -631,7 +631,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Improper Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: Improper Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Must define improper_style before Improper Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->improper_style)) @@ -643,14 +643,14 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondBond Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondBond Coeffs"); if (firstpass) anglecoeffs(1); else skip_lines(nangletypes); } else if (strcmp(keyword,"BondAngle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondAngle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondAngle Coeffs"); if (firstpass) anglecoeffs(2); else skip_lines(nangletypes); @@ -659,7 +659,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: MiddleBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "MiddleBondTorsion Coeffs"); @@ -668,7 +668,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before EndBondTorsion Coeffs"); if (firstpass) dihedralcoeffs(2); @@ -676,7 +676,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before AngleTorsion Coeffs"); if (firstpass) dihedralcoeffs(3); @@ -685,7 +685,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: AngleAngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "AngleAngleTorsion Coeffs"); @@ -694,7 +694,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: BondBond13 Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before BondBond13 Coeffs"); if (firstpass) dihedralcoeffs(5); @@ -703,7 +703,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: AngleAngle Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR, "Must define improper_style before AngleAngle Coeffs"); if (firstpass) impropercoeffs(1); @@ -725,7 +725,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } // done if this was 2nd pass @@ -929,7 +929,7 @@ void ReadData::header(int firstpass) if (me == 0) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } while (1) { @@ -937,7 +937,7 @@ void ReadData::header(int firstpass) // read a line and bcast length if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1289,7 +1289,7 @@ void ReadData::bonds(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1363,7 +1363,7 @@ void ReadData::angles(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1437,7 +1437,7 @@ void ReadData::dihedrals(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1511,7 +1511,7 @@ void ReadData::impropers(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1641,7 +1641,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) while (nchunk < nmax && nline <= CHUNK-MAXBODY) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); rv = sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble); if (rv != 3) error->one(FLERR,"Incorrect format in Bodies section of data file"); @@ -1655,7 +1655,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ninteger) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1669,7 +1669,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ndouble) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1743,7 +1743,7 @@ void ReadData::paircoeffs() for (int i = 0; i < ntypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,1,2,toffset); + parse_coeffs(buf,nullptr,1,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1770,7 +1770,7 @@ void ReadData::pairIJcoeffs() for (j = i; j < ntypes; j++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,2,toffset); + parse_coeffs(buf,nullptr,0,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1795,7 +1795,7 @@ void ReadData::bondcoeffs() for (int i = 0; i < nbondtypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,1,boffset); + parse_coeffs(buf,nullptr,0,1,boffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in BondCoeffs section"); force->bond->coeff(narg,arg); @@ -1820,7 +1820,7 @@ void ReadData::anglecoeffs(int which) for (int i = 0; i < nangletypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,aoffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,aoffset); else if (which == 1) parse_coeffs(buf,"bb",0,1,aoffset); else if (which == 2) parse_coeffs(buf,"ba",0,1,aoffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in AngleCoeffs section"); @@ -1846,7 +1846,7 @@ void ReadData::dihedralcoeffs(int which) for (int i = 0; i < ndihedraltypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,doffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,doffset); else if (which == 1) parse_coeffs(buf,"mbt",0,1,doffset); else if (which == 2) parse_coeffs(buf,"ebt",0,1,doffset); else if (which == 3) parse_coeffs(buf,"at",0,1,doffset); @@ -1876,7 +1876,7 @@ void ReadData::impropercoeffs(int which) for (int i = 0; i < nimpropertypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,ioffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,ioffset); else if (which == 1) parse_coeffs(buf,"aa",0,1,ioffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in ImproperCoeffs section"); force->improper->coeff(narg,arg); @@ -1945,7 +1945,7 @@ void ReadData::open(char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -1970,15 +1970,15 @@ void ReadData::parse_keyword(int first) if (me == 0) { if (!first) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } while (eof == 0 && done == 0) { int blank = strspn(line," \t\n\r"); if ((blank == (int)strlen(line)) || (line[blank] == '#')) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } else done = 1; } - if (fgets(buffer,MAXLINE,fp) == NULL) { + if (fgets(buffer,MAXLINE,fp) == nullptr) { eof = 1; buffer[0] = '\0'; } @@ -2031,16 +2031,16 @@ void ReadData::skip_lines(bigint n) { if (me) return; if (n <= 0) return; - char *eof = NULL; + char *eof = nullptr; for (bigint i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } /* ---------------------------------------------------------------------- parse a line of coeffs into words, storing them in narg,arg trim anything from '#' onward word strings remain in line, are not copied - if addstr != NULL, add addstr as extra arg for class2 angle/dihedral/improper + if addstr != nullptr, add addstr as extra arg for class2 angle/dihedral/improper if 2nd word starts with letter, then is hybrid style, add addstr after it else add addstr before 2nd word if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2" @@ -2065,7 +2065,7 @@ void ReadData::parse_coeffs(char *line, const char *addstr, arg[narg++] = word; if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr; if (dupflag && narg == 1) arg[narg++] = word; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } // to avoid segfaults on empty lines @@ -2094,12 +2094,12 @@ int ReadData::style_match(const char *one, const char *two) { int i,delta,len,len1,len2; - if ((one == NULL) || (two == NULL)) return 1; + if ((one == nullptr) || (two == nullptr)) return 1; len1 = strlen(one); len2 = strlen(two); - for (i = 0; suffixes[i] != NULL; i++) { + for (i = 0; suffixes[i] != nullptr; i++) { len = strlen(suffixes[i]); if ((delta = len1 - len) > 0) if (strcmp(one+delta,suffixes[i]) == 0) len1 = delta; diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 10218fe61..2fd14b547 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -55,22 +55,22 @@ ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp) triclinic = domain->triclinic; nfile = 0; - files = NULL; + files = nullptr; nnew = maxnew = 0; nfield = 0; - fieldtype = NULL; - fieldlabel = NULL; - fields = NULL; - buf = NULL; + fieldtype = nullptr; + fieldlabel = nullptr; + fields = nullptr; + buf = nullptr; int n = strlen("native") + 1; readerstyle = new char[n]; strcpy(readerstyle,"native"); nreader = 0; - readers = NULL; - nsnapatoms = NULL; + readers = nullptr; + nsnapatoms = nullptr; clustercomm = MPI_COMM_NULL; filereader = 0; parallel = 0; @@ -111,9 +111,9 @@ void ReadDump::command(int narg, char **arg) int nremain = narg - 2; if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = fields_and_keywords(0,NULL); + else nremain = fields_and_keywords(0,nullptr); if (nremain) setup_reader(nremain,&arg[narg-nremain]); - else setup_reader(0,NULL); + else setup_reader(0,nullptr); // find the snapshot and read/bcast/process header info @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid nullptr ptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid NULL ptr + newmaxnew = MAX(newmaxnew,1); // avoid nullptr ptr memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); @@ -1207,7 +1207,7 @@ int ReadDump::fields_and_keywords(int narg, char **arg) purgeflag = 0; trimflag = 0; addflag = NOADD; - for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; + for (int i = 0; i < nfield; i++) fieldlabel[i] = nullptr; scaleflag = 0; wrapflag = 1; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index dcab9f834..81a686223 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -108,7 +108,7 @@ void ReadRestart::command(int narg, char **arg) hfile.replace(hfile.find("%"),1,"base"); } fp = fopen(hfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", hfile, utils::getsyserror())); } @@ -166,7 +166,7 @@ void ReadRestart::command(int narg, char **arg) if (multiproc && me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // read per-proc info @@ -174,7 +174,7 @@ void ReadRestart::command(int narg, char **arg) AtomVec *avec = atom->avec; int maxbuf = 0; - double *buf = NULL; + double *buf = nullptr; int m,flag; // MPI-IO input from single file @@ -255,7 +255,7 @@ void ReadRestart::command(int narg, char **arg) if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -270,34 +270,34 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",iproc)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); int procsperfile; - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); for (int i = 0; i < procsperfile; i++) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); m = 0; while (m < n) m += avec->unpack_restart(&buf[m]); } fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -334,7 +334,7 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",icluster)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); } @@ -342,10 +342,10 @@ void ReadRestart::command(int narg, char **arg) int flag,procsperfile; if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&procsperfile,1,MPI_INT,0,clustercomm); @@ -354,17 +354,17 @@ void ReadRestart::command(int narg, char **arg) for (int i = 0; i < procsperfile; i++) { if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); if (i % nclusterprocs) { iproc = me + (i % nclusterprocs); @@ -391,9 +391,9 @@ void ReadRestart::command(int narg, char **arg) } } - if (filereader && fp != NULL) { + if (filereader && fp != nullptr) { fclose(fp); - fp = NULL; + fp = nullptr; } MPI_Comm_free(&clustercomm); } @@ -570,11 +570,11 @@ void ReadRestart::file_search(char *inpfile, char *outfile) struct dirent *ep; DIR *dp = opendir(dirname); - if (dp == NULL) + if (dp == nullptr) error->one(FLERR,"Cannot open dir to search for restart file"); while ((ep = readdir(dp))) { if (strstr(ep->d_name,begin) != ep->d_name) continue; - if ((ptr = strstr(&ep->d_name[nbegin],end)) == NULL) continue; + if ((ptr = strstr(&ep->d_name[nbegin],end)) == nullptr) continue; if (strlen(end) == 0) ptr = ep->d_name + strlen(ep->d_name); *ptr = '\0'; if ((int)strlen(&ep->d_name[nbegin]) < n) { @@ -1034,7 +1034,7 @@ void ReadRestart::file_layout() memory->create(nproc_chunk_number,nprocs, "write_restart:nproc_chunk_number"); - utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,NULL,error); + utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,nullptr,error); if ((nprocs != nprocs_file) && !(atom->nextra_store)) { // nprocs differ, but atom sizes are fixed length, yeah! @@ -1232,7 +1232,7 @@ double ReadRestart::read_double() } /* ---------------------------------------------------------------------- - read a char string (including NULL) and bcast it + read a char string (including nullptr) and bcast it str is allocated here, ptr is returned, caller must deallocate ------------------------------------------------------------------------- */ @@ -1241,7 +1241,7 @@ char *ReadRestart::read_string() int n = read_int(); if (n < 0) error->all(FLERR,"Illegal size string or corrupt restart"); char *value = new char[n]; - if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,nullptr,error); MPI_Bcast(value,n,MPI_CHAR,0,world); return value; } @@ -1253,7 +1253,7 @@ char *ReadRestart::read_string() void ReadRestart::read_int_vec(int n, int *vec) { if (n < 0) error->all(FLERR,"Illegal size integer vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_INT,0,world); } @@ -1264,6 +1264,6 @@ void ReadRestart::read_int_vec(int n, int *vec) void ReadRestart::read_double_vec(int n, double *vec) { if (n < 0) error->all(FLERR,"Illegal size double vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_DOUBLE,0,world); } diff --git a/src/reader.cpp b/src/reader.cpp index 8230fa3ed..218fd75df 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; Reader::Reader(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -35,7 +35,7 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) void Reader::open_file(const char *file) { - if (fp != NULL) close_file(); + if (fp != nullptr) close_file(); compressed = 0; const char *suffix = file + strlen(file) - 3; @@ -55,7 +55,7 @@ void Reader::open_file(const char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -67,10 +67,10 @@ void Reader::open_file(const char *file) void Reader::close_file() { - if (fp == NULL) return; + if (fp == nullptr) return; if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/reader_native.cpp b/src/reader_native.cpp index e0f0d7792..11241047a 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -34,7 +34,7 @@ enum{UNSET,NOSCALE_NOWRAP,NOSCALE_WRAP,SCALE_NOWRAP,SCALE_WRAP}; ReaderNative::ReaderNative(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - fieldindex = NULL; + fieldindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ ReaderNative::~ReaderNative() int ReaderNative::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // skip over unit and time information, if present. @@ -110,7 +110,7 @@ void ReaderNative::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flags = scaleflag+wrapflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 @@ -315,7 +315,7 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); // tokenize the line std::vector words = Tokenizer(line).as_vector(); @@ -351,8 +351,8 @@ int ReaderNative::find_label(const std::string & label, const std::mapone(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp index 8a2f7a398..82fe756c2 100644 --- a/src/reader_xyz.cpp +++ b/src/reader_xyz.cpp @@ -31,7 +31,7 @@ enum{ID,TYPE,X,Y,Z}; ReaderXYZ::ReaderXYZ(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - fieldindex = NULL; + fieldindex = nullptr; nstep = 0; } @@ -52,7 +52,7 @@ ReaderXYZ::~ReaderXYZ() int ReaderXYZ::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // first line has to have the number of atoms // truncate the string to the first whitespace, @@ -109,7 +109,7 @@ void ReaderXYZ::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ @@ -174,7 +174,7 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); ++nid; rv = sscanf(line,"%*s%lg%lg%lg", &myx, &myy, &myz); @@ -216,8 +216,8 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) void ReaderXYZ::read_lines(int n) { - char *eof = NULL; + char *eof = nullptr; if (n <= 0) return; for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/region.cpp b/src/region.cpp index 15b6fee27..c7c262788 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), contact(NULL), list(NULL), - xstr(NULL), ystr(NULL), zstr(NULL), tstr(NULL) + id(nullptr), style(nullptr), contact(nullptr), list(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr), tstr(nullptr) { int n = strlen(arg[0]) + 1; id = new char[n]; @@ -42,13 +42,13 @@ Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : strcpy(style,arg[1]); varshape = 0; - xstr = ystr = zstr = tstr = NULL; + xstr = ystr = zstr = tstr = nullptr; dx = dy = dz = 0.0; size_restart = 5; reset_vel(); copymode = 0; - list = NULL; + list = nullptr; nregion = 1; } diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index f7676a3d7..2d40052e0 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -30,7 +30,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), c1str(NULL), c2str(NULL), rstr(NULL) + Region(lmp, narg, arg), c1str(nullptr), c2str(nullptr), rstr(nullptr) { options(narg-8,&arg[8]); diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index a61e2556b..35c6c502a 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -23,7 +23,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), idsub(NULL) + Region(lmp, narg, arg), idsub(nullptr) { nregion = 0; diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 4256af421..5282095c8 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -28,7 +28,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL) + Region(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr) { options(narg-6,&arg[6]); diff --git a/src/region_union.cpp b/src/region_union.cpp index 677f1022f..3ee0765f0 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), - idsub(NULL) + idsub(nullptr) { nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); diff --git a/src/replicate.cpp b/src/replicate.cpp index 374d7113b..471af6934 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -154,7 +154,7 @@ void Replicate::command(int narg, char **arg) // also set atomKK for Kokkos version of Atom class Atom *old = atom; - atomKK = NULL; + atomKK = nullptr; if (lmp->kokkos) atom = atomKK = new AtomKokkos(lmp); else atom = new Atom(lmp); diff --git a/src/rerun.cpp b/src/rerun.cpp index 51c0f6fdb..00cd1d408 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -120,9 +120,9 @@ void Rerun::command(int narg, char **arg) rd->store_files(nfile,arg); if (nremain) nremain = rd->fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = rd->fields_and_keywords(0,NULL); + else nremain = rd->fields_and_keywords(0,nullptr); if (nremain) rd->setup_reader(nremain,&arg[narg-nremain]); - else rd->setup_reader(0,NULL); + else rd->setup_reader(0,nullptr); // perform the pseudo run // invoke lmp->init() only once diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index ad2caad65..10337fd18 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -33,8 +33,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) { - cfa = NULL; - cca = NULL; + cfa = nullptr; + cca = nullptr; // default settings diff --git a/src/respa.cpp b/src/respa.cpp index c970c63a1..ecc6cc58f 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -46,8 +46,8 @@ using namespace LAMMPS_NS; Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg), - step(NULL), loop(NULL), hybrid_level(NULL), hybrid_compute(NULL), - newton(NULL), fix_respa(NULL) + step(nullptr), loop(nullptr), hybrid_level(nullptr), hybrid_compute(nullptr), + newton(nullptr), fix_respa(nullptr) { nhybrid_styles = 0; if (narg < 1) error->all(FLERR,"Illegal run_style respa command"); diff --git a/src/run.cpp b/src/run.cpp index 166955d6a..f5b571844 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -91,7 +91,7 @@ void Run::command(int narg, char **arg) // all remaining args are commands // first,last = arg index of first/last commands - // set ncommands = 0 if single command and it is NULL + // set ncommands = 0 if single command and it is nullptr } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); @@ -140,7 +140,7 @@ void Run::command(int narg, char **arg) // if nevery, make copies of arg strings that are commands // required because re-parsing commands via input->one() will wipe out args - char **commands = NULL; + char **commands = nullptr; if (nevery && ncommands > 0) { commands = new char*[ncommands]; ncommands = 0; diff --git a/src/set.cpp b/src/set.cpp index 3b2cd44ad..f66de96e9 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -74,7 +74,7 @@ void Set::command(int narg, char **arg) int n = strlen(arg[1]) + 1; id = new char[n]; strcpy(id,arg[1]); - select = NULL; + select = nullptr; selection(atom->nlocal); // loop over keyword/value pairs @@ -689,7 +689,7 @@ void Set::set(int keyword) { // evaluate atom-style variable(s) if necessary - vec1 = vec2 = vec3 = vec4 = NULL; + vec1 = vec2 = vec3 = vec4 = nullptr; if (varflag) { int nlocal = atom->nlocal; @@ -907,7 +907,7 @@ void Set::set(int keyword) // enforce quat rotation vector in z dir for 2d systems else if (keyword == QUAT) { - double *quat = NULL; + double *quat = nullptr; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) diff --git a/src/special.cpp b/src/special.cpp index eb74f534f..9661fa5ad 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -34,7 +34,7 @@ Special::Special(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - onetwo = onethree = onefour = NULL; + onetwo = onethree = onefour = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/thermo.cpp b/src/thermo.cpp index 787b0cdda..485974cc8 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -147,9 +147,9 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // ptrs, flags, IDs for compute objects thermo may use or create - temperature = NULL; - pressure = NULL; - pe = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; index_temp = index_press_scalar = index_press_vector = index_pe = -1; @@ -179,10 +179,10 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]); sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]); - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; } /* ---------------------------------------------------------------------- */ @@ -563,13 +563,13 @@ void Thermo::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; for (int i = 0; i < nfield_initial+1; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } iarg += 2; continue; @@ -593,7 +593,7 @@ void Thermo::modify_params(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Thermo_modify int format does not contain d character"); char str[8]; @@ -632,14 +632,14 @@ void Thermo::allocate() int n = nfield_initial + 1; keyword = new char*[n]; - for (int i = 0; i < n; i++) keyword[i] = NULL; + for (int i = 0; i < n; i++) keyword[i] = nullptr; vfunc = new FnPtr[n]; vtype = new int[n]; format = new char*[n]; for (int i = 0; i < n; i++) format[i] = new char[32]; format_column_user = new char*[n]; - for (int i = 0; i < n; i++) format_column_user[i] = NULL; + for (int i = 0; i < n; i++) format_column_user[i] = nullptr; field2index = new int[n]; argindex1 = new int[n]; @@ -893,7 +893,7 @@ void Thermo::parse_fields(char *str) // argindex1,argindex2 = int inside each bracket pair, 0 if no bracket char *ptr = strchr(id,'['); - if (ptr == NULL) argindex1[nfield] = argindex2[nfield] = 0; + if (ptr == nullptr) argindex1[nfield] = argindex2[nfield] = 0; else { *ptr = '\0'; argindex1[nfield] = diff --git a/src/universe.cpp b/src/universe.cpp index cd079a45c..ecdd5aa04 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -40,12 +40,12 @@ Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : Pointers(lmp) MPI_Comm_size(uworld,&nprocs); uscreen = stdout; - ulogfile = NULL; + ulogfile = nullptr; existflag = 0; nworlds = 0; - procs_per_world = NULL; - root_proc = NULL; + procs_per_world = nullptr; + root_proc = nullptr; memory->create(uni2orig,nprocs,"universe:uni2orig"); for (int i = 0; i < nprocs; i++) uni2orig[i] = i; @@ -95,7 +95,7 @@ void Universe::reorder(char *style, char *arg) if (me == 0) { FILE *fp = fopen(arg,"r"); - if (fp == NULL) + if (fp == nullptr) error->universe_one(FLERR,fmt::format("Cannot open -reorder " "file {}: {}",arg, utils::getsyserror())); @@ -156,7 +156,7 @@ void Universe::reorder(char *style, char *arg) /* ---------------------------------------------------------------------- add 1 or more worlds to universe - str == NULL -> add 1 world with all procs in universe + str == nullptr -> add 1 world with all procs in universe str = NxM -> add N worlds, each with M procs str = P -> add 1 world with P procs ------------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ void Universe::add_world(char *str) n = 1; nper = 0; - if (str != NULL) { + if (str != nullptr) { // check for valid partition argument @@ -184,7 +184,7 @@ void Universe::add_world(char *str) else valid = false; if (valid) { - if ((ptr = strchr(str,'x')) != NULL) { + if ((ptr = strchr(str,'x')) != nullptr) { // 'x' may not be the first or last character diff --git a/src/update.cpp b/src/update.cpp index 399584473..00e396c6a 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -48,13 +48,13 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) eflag_global = vflag_global = -1; - unit_style = NULL; + unit_style = nullptr; set_units("lj"); - integrate_style = NULL; - integrate = NULL; - minimize_style = NULL; - minimize = NULL; + integrate_style = nullptr; + integrate = nullptr; + minimize_style = nullptr; + minimize = nullptr; integrate_map = new IntegrateCreatorMap(); diff --git a/src/utils.cpp b/src/utils.cpp index f63deac0d..e985f9e6e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -152,7 +152,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, Error *error) { char *rv = fgets(s,size,fp); - if (rv == NULL) { // something went wrong + if (rv == nullptr) { // something went wrong char buf[MAXPATHLENBUF]; std::string errmsg; @@ -171,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is NULL + if (s) *s = '\0'; // truncate string to empty in case error is nullptr } return; } @@ -377,19 +377,19 @@ void utils::bounds(const char *file, int line, const std::string &str, nlo = nhi = -1; if (found == std::string::npos) { // contains no '*' - nlo = nhi = strtol(str.c_str(),NULL,10); + nlo = nhi = strtol(str.c_str(),nullptr,10); } else if (str.size() == 1) { // is only '*' nlo = nmin; nhi = nmax; } else if (found == 0) { // is '*j' nlo = nmin; - nhi = strtol(str.substr(1).c_str(),NULL,10); + nhi = strtol(str.substr(1).c_str(),nullptr,10); } else if (str.size() == found+1) { // is 'i*' - nlo = strtol(str.c_str(),NULL,10); + nlo = strtol(str.c_str(),nullptr,10); nhi = nmax; } else { // is 'i*j' - nlo = strtol(str.c_str(),NULL,10); - nhi = strtol(str.substr(found+1).c_str(),NULL,10); + nlo = strtol(str.c_str(),nullptr,10); + nhi = strtol(str.substr(found+1).c_str(),nullptr,10); } if (error) { @@ -422,7 +422,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int n,iarg,index,nlo,nhi,nmax,expandflag,icompute,ifix; char *ptr1,*ptr2,*str; - ptr1 = NULL; + ptr1 = nullptr; for (iarg = 0; iarg < narg; iarg++) { ptr1 = strchr(arg[iarg],'*'); if (ptr1) break; @@ -1000,10 +1000,10 @@ double utils::timespec2seconds(const std::string ×pec) int utils::date2num(const std::string &date) { std::size_t found = date.find_first_not_of("0123456789 "); - int num = strtol(date.substr(0,found).c_str(),NULL,10); + int num = strtol(date.substr(0,found).c_str(),nullptr,10); auto month = date.substr(found); found = month.find_first_of("0123456789 "); - num += strtol(month.substr(found).c_str(),NULL,10)*10000; + num += strtol(month.substr(found).c_str(),nullptr,10)*10000; if (num < 1000000) num += 20000000; if (strmatch(month,"^Jan")) num += 100; diff --git a/src/utils.h b/src/utils.h index 06aef4654..cf8952b8a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -60,7 +60,7 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfgets(const char *srcname, int srcline, char *s, int size, @@ -75,7 +75,7 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfread(const char *srcname, int srcline, void *s, size_t size, @@ -354,7 +354,7 @@ namespace LAMMPS_NS { * If the potential file has a ``UNITS`` tag in the first line, the * tag's value is compared to the current unit style setting. * The behavior of the function then depends on the value of the - * *auto_convert* parameter. If it is ``NULL``, then the unit values + * *auto_convert* parameter. If it is ``nullptr``, then the unit values * must match or else the open will fail with an error. Otherwise * the bitmask that *auto_convert* points to is used check for * compatibility with possible automatic conversions by the calling @@ -363,8 +363,8 @@ namespace LAMMPS_NS { * * \param name file- or pathname of the potential file * \param lmp pointer to top-level LAMMPS class instance - * \param auto_convert pointer to unit conversion bitmask or NULL - * \return FILE pointer of the opened potential file or NULL*/ + * \param auto_convert pointer to unit conversion bitmask or nullptr + * \return FILE pointer of the opened potential file or nullptr*/ FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); diff --git a/src/variable.cpp b/src/variable.cpp index 8d4416dfa..5ceed4dd3 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -86,20 +86,20 @@ Variable::Variable(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); nvar = maxvar = 0; - names = NULL; - style = NULL; - num = NULL; - which = NULL; - pad = NULL; - reader = NULL; - data = NULL; - dvalue = NULL; - vecs = NULL; + names = nullptr; + style = nullptr; + num = nullptr; + which = nullptr; + pad = nullptr; + reader = nullptr; + data = nullptr; + dvalue = nullptr; + vecs = nullptr; - eval_in_progress = NULL; + eval_in_progress = nullptr; - randomequal = NULL; - randomatom = NULL; + randomequal = nullptr; + randomatom = nullptr; // customize by assigning a precedence level @@ -207,7 +207,7 @@ void Variable::set(int narg, char **arg) num[nvar] = nlast; which[nvar] = nfirst-1; data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; // WORLD // num = listed args, which = partition this proc is in, data = copied args @@ -251,7 +251,7 @@ void Variable::set(int narg, char **arg) style[nvar] = ULOOP; num[nvar] = utils::inumeric(FLERR,arg[2],false,lmp); data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; if (narg == 4) { char digits[12]; sprintf(digits,"%d",num[nvar]); @@ -265,12 +265,12 @@ void Variable::set(int narg, char **arg) if (universe->me == 0) { FILE *fp = fopen("tmp.lammps.variable","w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open temporary file for world counter: " + utils::getsyserror()); fprintf(fp,"%d\n",universe->nworlds); fclose(fp); - fp = NULL; + fp = nullptr; } for (int jvar = 0; jvar < nvar; jvar++) @@ -355,7 +355,7 @@ void Variable::set(int narg, char **arg) // ATOMFILE for numbers // which = 1st value - // data = NULL + // data = nullptr } else if (strcmp(arg[1],"atomfile") == 0) { if (narg != 3) error->all(FLERR,"Illegal variable command"); @@ -366,7 +366,7 @@ void Variable::set(int narg, char **arg) which[nvar] = 0; pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; reader[nvar] = new VarReader(lmp,arg[0],arg[2],ATOMFILE); int flag = reader[nvar]->read_peratom(); if (flag) error->all(FLERR,"Atomfile variable could not read values"); @@ -706,7 +706,7 @@ int Variable::next(int narg, char **arg) char buf[64]; for (int loopmax = 0; loopmax < 100; ++loopmax) { fp = fopen("tmp.lammps.variable.lock","r"); - if (fp == NULL) goto uloop_again; + if (fp == nullptr) goto uloop_again; buf[0] = buf[1] = '\0'; fread(buf,1,64,fp); @@ -731,7 +731,7 @@ int Variable::next(int narg, char **arg) fprintf(fp,"%d\n",nextindex+1); //printf("WRITE %d %d\n",universe->me,nextindex+1); fclose(fp); - fp = NULL; + fp = nullptr; rename("tmp.lammps.variable.lock","tmp.lammps.variable"); if (universe->uscreen) fprintf(universe->uscreen, @@ -840,15 +840,15 @@ int Variable::vectorstyle(int ivar) check if variable with name is PYTHON and matches funcname called by Python class before it invokes a Python function return data storage so Python function can return a value for this variable - return NULL if not a match + return nullptr if not a match ------------------------------------------------------------------------- */ char *Variable::pythonstyle(char *name, char *funcname) { int ivar = find(name); - if (ivar < 0) return NULL; - if (style[ivar] != PYTHON) return NULL; - if (strcmp(data[ivar][0],funcname) != 0) return NULL; + if (ivar < 0) return nullptr; + if (style[ivar] != PYTHON) return nullptr; + if (strcmp(data[ivar][0],funcname) != 0) return nullptr; return data[ivar][1]; } @@ -873,23 +873,23 @@ int Variable::internalstyle(int ivar) if GETENV, query environment and put result in str if PYTHON, evaluate Python function, it will put result in str if INTERNAL, convert dvalue and put result in str - if ATOM or ATOMFILE or VECTOR, return NULL - return NULL if no variable with name, or which value is bad, + if ATOM or ATOMFILE or VECTOR, return nullptr + return nullptr if no variable with name, or which value is bad, caller must respond ------------------------------------------------------------------------- */ char *Variable::retrieve(const char *name) { int ivar = find(name); - if (ivar < 0) return NULL; - if (which[ivar] >= num[ivar]) return NULL; + if (ivar < 0) return nullptr; + if (which[ivar] >= num[ivar]) return nullptr; if (eval_in_progress[ivar]) print_var_error(FLERR,"Variable has a circular dependency",ivar); eval_in_progress[ivar] = 1; - char *str = NULL; + char *str = nullptr; if (style[ivar] == INDEX || style[ivar] == WORLD || style[ivar] == UNIVERSE || style[ivar] == STRING || style[ivar] == SCALARFILE) { @@ -908,19 +908,19 @@ char *Variable::retrieve(const char *name) strcpy(data[ivar][0],result); str = data[ivar][0]; } else if (style[ivar] == EQUAL) { - double answer = evaluate(data[ivar][0],NULL,ivar); + double answer = evaluate(data[ivar][0],nullptr,ivar); sprintf(data[ivar][1],"%.15g",answer); str = data[ivar][1]; } else if (style[ivar] == FORMAT) { int jvar = find(data[ivar][0]); - if (jvar == -1) return NULL; - if (!equalstyle(jvar)) return NULL; + if (jvar == -1) return nullptr; + if (!equalstyle(jvar)) return nullptr; double answer = compute_equal(jvar); sprintf(data[ivar][2],data[ivar][1],answer); str = data[ivar][2]; } else if (style[ivar] == GETENV) { const char *result = getenv(data[ivar][0]); - if (result == NULL) result = (const char *) ""; + if (result == nullptr) result = (const char *) ""; int n = strlen(result) + 1; if (n > VALUELENGTH) { delete [] data[ivar][1]; @@ -943,7 +943,7 @@ char *Variable::retrieve(const char *name) sprintf(data[ivar][0],"%.15g",dvalue[ivar]); str = data[ivar][0]; } else if (style[ivar] == ATOM || style[ivar] == ATOMFILE || - style[ivar] == VECTOR) return NULL; + style[ivar] == VECTOR) return nullptr; eval_in_progress[ivar] = 0; @@ -965,7 +965,7 @@ double Variable::compute_equal(int ivar) eval_in_progress[ivar] = 1; double value = 0.0; - if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL,ivar); + if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],nullptr,ivar); else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == PYTHON) { int ifunc = python->find(data[ivar][0]); @@ -987,7 +987,7 @@ double Variable::compute_equal(int ivar) double Variable::compute_equal(char *str) { - return evaluate(str,NULL,-1); + return evaluate(str,nullptr,-1); } /* ---------------------------------------------------------------------- @@ -1000,7 +1000,7 @@ double Variable::compute_equal(char *str) void Variable::compute_atom(int ivar, int igroup, double *result, int stride, int sumflag) { - Tree *tree = NULL; + Tree *tree = nullptr; double *vstore; if (eval_in_progress[ivar]) @@ -1014,7 +1014,7 @@ void Variable::compute_atom(int ivar, int igroup, collapse_tree(tree); } else vstore = reader[ivar]->fixstore->vstore; - if (result == NULL) { + if (result == nullptr) { if (style[ivar] == ATOM) free_tree(tree); eval_in_progress[ivar] = 0; return; @@ -1073,7 +1073,7 @@ void Variable::compute_atom(int ivar, int igroup, int Variable::compute_vector(int ivar, double **result) { - Tree *tree = NULL; + Tree *tree = nullptr; if (vecs[ivar].currentstep == update->ntimestep) { *result = vecs[ivar].values; return vecs[ivar].n; @@ -1166,7 +1166,7 @@ void Variable::grow() reader = (VarReader **) memory->srealloc(reader,maxvar*sizeof(VarReader *),"var:reader"); - for (int i = old; i < maxvar; i++) reader[i] = NULL; + for (int i = old; i < maxvar; i++) reader[i] = nullptr; data = (char ***) memory->srealloc(data,maxvar*sizeof(char **),"var:data"); memory->grow(dvalue,maxvar,"var:dvalue"); @@ -1175,7 +1175,7 @@ void Variable::grow() for (int i = old; i < maxvar; i++) { vecs[i].nmax = 0; vecs[i].currentstep = -1; - vecs[i].values = NULL; + vecs[i].values = nullptr; } memory->grow(eval_in_progress,maxvar,"var:eval_in_progress"); @@ -1214,9 +1214,9 @@ void Variable::copy(int narg, char **from, char **to) compute = c_ID, c_ID[i], c_ID[i][j] fix = f_ID, f_ID[i], f_ID[i][j] variable = v_name, v_name[i] - equal-style variables passes in tree = NULL: + equal-style variables passes in tree = nullptr: evaluate the formula, return result as a double - atom-style and vector-style variables pass in tree = non-NULL: + atom-style and vector-style variables pass in tree = non-nullptr: parse the formula but do not evaluate it create a parse tree and return it ------------------------------------------------------------------------- */ @@ -1261,10 +1261,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) // evaluate contents and push on stack if (tree) { - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(contents,&newtree,ivar); treestack[ntreestack++] = newtree; - } else argstack[nargstack++] = evaluate(contents,NULL,ivar); + } else argstack[nargstack++] = evaluate(contents,nullptr,ivar); delete [] contents; @@ -1297,7 +1297,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(number); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->extra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(number); @@ -1389,7 +1389,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1418,7 +1418,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1450,7 +1450,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1459,7 +1459,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->vector_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1483,7 +1483,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_vector; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1491,7 +1491,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->array_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1515,7 +1515,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_array_rows; newtree->nstride = compute->size_array_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1533,7 +1533,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= INVOKED_PERATOM; } - peratom2global(1,NULL,compute->vector_atom,1,index1, + peratom2global(1,nullptr,compute->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // c_ID[i][j] = scalar from per-atom array @@ -1554,11 +1554,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } if (compute->array_atom) - peratom2global(1,NULL,&compute->array_atom[0][index2-1], + peratom2global(1,nullptr,&compute->array_atom[0][index2-1], compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1567,7 +1567,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->peratom_flag && compute->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1587,7 +1587,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = compute->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1596,7 +1596,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->peratom_flag && compute->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1619,10 +1619,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->array_atom) newtree->array = &compute->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = compute->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1686,7 +1686,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1708,7 +1708,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1733,7 +1733,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1745,7 +1745,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed at " "compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1767,7 +1767,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1778,7 +1778,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1800,7 +1800,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1814,7 +1814,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - peratom2global(1,NULL,fix->vector_atom,1,index1, + peratom2global(1,nullptr,fix->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // f_ID[i][j] = scalar from per-atom array @@ -1831,11 +1831,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) "at a compatible time",ivar); if (fix->array_atom) - peratom2global(1,NULL,&fix->array_atom[0][index2-1], + peratom2global(1,nullptr,&fix->array_atom[0][index2-1], fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1844,7 +1844,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && fix->peratom_flag && fix->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (update->whichflag > 0 && @@ -1857,7 +1857,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = fix->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1866,7 +1866,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && fix->peratom_flag && fix->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (index1 > fix->size_peratom_cols) @@ -1882,10 +1882,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (fix->array_atom) newtree->array = &fix->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = fix->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1929,7 +1929,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1941,14 +1941,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) style[ivar] != ATOMFILE && style[ivar] != VECTOR) { char *var = retrieve(word+2); - if (var == NULL) + if (var == nullptr) print_var_error(FLERR,"Invalid variable evaluation in " "variable formula",ivar); if (tree) { Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(var); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(var); @@ -1958,14 +1958,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOM) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atom-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) print_var_error(FLERR,"Atom-style variable in " "vector-style variable formula",ivar); - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(data[ivar][0],&newtree,ivar); treestack[ntreestack++] = newtree; @@ -1973,7 +1973,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1985,7 +1985,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = reader[ivar]->fixstore->vstore; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1994,7 +1994,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == VECTOR) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Vector-style variable in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -2010,7 +2010,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -2023,7 +2023,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) double *result; memory->create(result,atom->nlocal,"variable:result"); compute_atom(ivar,0,result,1,0); - peratom2global(1,NULL,result,1,index, + peratom2global(1,nullptr,result,1,index, tree,treestack,ntreestack,argstack,nargstack); memory->destroy(result); @@ -2031,7 +2031,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket && style[ivar] == ATOMFILE) { - peratom2global(1,NULL,reader[ivar]->fixstore->vstore,1,index, + peratom2global(1,nullptr,reader[ivar]->fixstore->vstore,1,index, tree,treestack,ntreestack,argstack,nargstack); // v_name[N] = scalar from vector-style variable @@ -2050,7 +2050,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = vec[m-1]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = vec[m-1]; @@ -2098,7 +2098,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) tagint id = int_between_brackets(ptr,1); i = ptr-str+1; - peratom2global(0,word,NULL,0,id, + peratom2global(0,word,nullptr,0,id, tree,treestack,ntreestack,argstack,nargstack); // ---------------- @@ -2122,7 +2122,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2144,7 +2144,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2224,7 +2224,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->type = opprevious; if ((opprevious == UNARY) || (opprevious == NOT)) { newtree->first = treestack[--ntreestack]; - newtree->second = NULL; + newtree->second = nullptr; newtree->nextra = 0; } else { newtree->second = treestack[--ntreestack]; @@ -2627,7 +2627,7 @@ double Variable::collapse_tree(Tree *tree) if (tree->type == RANDOM) { collapse_tree(tree->first); collapse_tree(tree->second); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -2641,7 +2641,7 @@ double Variable::collapse_tree(Tree *tree) double sigma = collapse_tree(tree->second); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3021,7 +3021,7 @@ double Variable::eval_tree(Tree *tree, int i) if (tree->type == RANDOM) { double lower = eval_tree(tree->first,i); double upper = eval_tree(tree->second,i); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3034,7 +3034,7 @@ double Variable::eval_tree(Tree *tree, int i) double sigma = eval_tree(tree->second,i); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3344,7 +3344,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) error->all(FLERR,"Invalid variable name in variable formula"); char *var = retrieve(id); - if (var == NULL) + if (var == nullptr) error->all(FLERR,"Invalid variable evaluation in variable formula"); index = static_cast (atof(var)); @@ -3399,15 +3399,15 @@ int Variable::math_function(char *word, char *contents, Tree **tree, char *args[MAXFUNCARG]; int narg = parse_args(contents,args); - Tree *newtree = NULL; + Tree *newtree = nullptr; double value1,value2; double values[MAXFUNCARG-2]; if (tree) { newtree = new Tree(); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; - Tree *argtree = NULL; + Tree *argtree = nullptr; evaluate(args[0],&argtree,ivar); newtree->first = argtree; if (narg > 1) { @@ -3425,12 +3425,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, treestack[ntreestack++] = newtree; } else { - value1 = evaluate(args[0],NULL,ivar); + value1 = evaluate(args[0],nullptr,ivar); if (narg > 1) { - value2 = evaluate(args[1],NULL,ivar); + value2 = evaluate(args[1],nullptr,ivar); if (narg > 2) { for (int i = 2; i < narg; i++) - values[i-2] = evaluate(args[i],NULL,ivar); + values[i-2] = evaluate(args[i],nullptr,ivar); } } } @@ -3530,7 +3530,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = RANDOM; else { - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -3545,7 +3545,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, else { if (value2 < 0.0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -4029,7 +4029,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4107,8 +4107,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (narg != 1) print_var_error(FLERR,"Invalid special function in variable formula",ivar); - Compute *compute = NULL; - Fix *fix = NULL; + Compute *compute = nullptr; + Fix *fix = nullptr; int ivar = -1; int index,nvec,nstride; char *ptr1,*ptr2; @@ -4239,7 +4239,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, double *vec; if (index) { if (compute->array) vec = &compute->array[0][index-1]; - else vec = NULL; + else vec = nullptr; } else vec = compute->vector; int j = 0; @@ -4320,7 +4320,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4328,7 +4328,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // mask special functions } else if (strcmp(word,"gmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Gmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4341,12 +4341,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = GMASK; newtree->ivalue1 = group->bitmask[igroup]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"rmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Rmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4358,12 +4358,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = RMASK; newtree->ivalue1 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"grmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Grmask function in equal-style " "variable formula",ivar); if (narg != 2) @@ -4379,7 +4379,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->type = GRMASK; newtree->ivalue1 = group->bitmask[igroup]; newtree->ivalue2 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4409,7 +4409,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4419,7 +4419,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // set selfalloc = 1 so result will be deleted by free_tree() after eval } else if (style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile variable in " "equal-style variable formula",ivar); @@ -4435,7 +4435,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->array = result; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4456,7 +4456,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4475,7 +4475,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4494,7 +4494,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4579,7 +4579,7 @@ void Variable::peratom2global(int flag, char *word, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4622,14 +4622,14 @@ int Variable::is_atom_vector(char *word) void Variable::atom_vector(char *word, Tree **tree, Tree **treestack, int &ntreestack) { - if (tree == NULL) + if (tree == nullptr) error->all(FLERR,"Atom vector in equal-style variable formula"); Tree *newtree = new Tree(); newtree->type = ATOMARRAY; newtree->nstride = 3; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4756,7 +4756,7 @@ int Variable::parse_args(char *str, char **args) /* ---------------------------------------------------------------------- find next comma in str skip commas inside one or more nested parenthesis - only return ptr to comma at level 0, else NULL if not found + only return ptr to comma at level 0, else nullptr if not found ------------------------------------------------------------------------- */ char *Variable::find_next_comma(char *str) @@ -4767,7 +4767,7 @@ char *Variable::find_next_comma(char *str) else if (')' == *p) level--; else if (',' == *p && !level) return p; } - return NULL; + return nullptr; } @@ -5069,11 +5069,11 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : { me = comm->me; style = flag; - fp = NULL; + fp = nullptr; if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file variable file {}: {}", file, utils::getsyserror())); } @@ -5082,9 +5082,9 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : // allocate a new fix STORE, so they persist // id = variable-ID + VARIABLE_STORE, fix group = all - fixstore = NULL; - id_fix = NULL; - buffer = NULL; + fixstore = nullptr; + id_fix = nullptr; + buffer = nullptr; if (style == ATOMFILE) { if (atom->map_style == 0) @@ -5109,7 +5109,7 @@ VarReader::~VarReader() { if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // check modify in case all fixes have already been deleted @@ -5137,12 +5137,12 @@ int VarReader::read_scalar(char *str) if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } @@ -5180,12 +5180,12 @@ int VarReader::read_peratom() char str[MAXLINE]; if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } diff --git a/src/variable.h b/src/variable.h index efffacc7b..58548bc27 100644 --- a/src/variable.h +++ b/src/variable.h @@ -93,9 +93,9 @@ class Variable : protected Pointers { Tree **extra; // ptrs further down tree for nextra args Tree() : - array(NULL), iarray(NULL), barray(NULL), + array(nullptr), iarray(nullptr), barray(nullptr), selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), - first(NULL), second(NULL), extra(NULL) {} + first(nullptr), second(nullptr), extra(nullptr) {} }; int compute_python(int); diff --git a/src/velocity.cpp b/src/velocity.cpp index eafa98cb7..db396fb7e 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -82,7 +82,7 @@ void Velocity::command(int narg, char **arg) // set defaults - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -147,7 +147,7 @@ void Velocity::init_external(const char *extgroup) if (igroup == -1) error->all(FLERR,"Could not find velocity group ID"); groupbit = group->bitmask[igroup]; - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -179,18 +179,18 @@ void Velocity::create(double t_desired, int seed) } } - // if temperature = NULL or bias_flag set, + // if temperature = nullptr or bias_flag set, // create a new ComputeTemp with the velocity group int tcreate_flag = 0; - Compute *temperature_nobias = NULL; + Compute *temperature_nobias = nullptr; - if (temperature == NULL || bias_flag) { + if (temperature == nullptr || bias_flag) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; arg[2] = (char *) "temp"; - if (temperature == NULL) { + if (temperature == nullptr) { temperature = new ComputeTemp(lmp,3,arg); tcreate_flag = 1; } else temperature_nobias = new ComputeTemp(lmp,3,arg); @@ -245,7 +245,7 @@ void Velocity::create(double t_desired, int seed) int m; double vx,vy,vz,factor; - RanPark *random = NULL; + RanPark *random = nullptr; if (loop_flag == ALL) { @@ -368,7 +368,7 @@ void Velocity::create(double t_desired, int seed) // no-bias compute calculates temp only for new thermal velocities double t; - if ((bias_flag == 0) || (temperature_nobias == NULL)) + if ((bias_flag == 0) || (temperature_nobias == nullptr)) t = temperature->compute_scalar(); else t = temperature_nobias->compute_scalar(); rescale(t,t_desired); @@ -417,7 +417,7 @@ void Velocity::set(int /*narg*/, char **arg) // parse 3 args xstyle = ystyle = zstyle = CONSTANT; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; @@ -501,7 +501,7 @@ void Velocity::set(int /*narg*/, char **arg) // allocate vfield array if necessary - double **vfield = NULL; + double **vfield = nullptr; if (varflag == ATOM) memory->create(vfield,atom->nlocal,3,"velocity:vfield"); // set velocities via constants @@ -531,17 +531,17 @@ void Velocity::set(int /*narg*/, char **arg) if (xstyle == EQUAL) vx = input->variable->compute_equal(xvar); else if (xstyle == ATOM) { if (vfield) input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0); - else input->variable->compute_atom(xvar,igroup,NULL,3,0); + else input->variable->compute_atom(xvar,igroup,nullptr,3,0); } if (ystyle == EQUAL) vy = input->variable->compute_equal(yvar); else if (ystyle == ATOM) { if (vfield) input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0); - else input->variable->compute_atom(yvar,igroup,NULL,3,0); + else input->variable->compute_atom(yvar,igroup,nullptr,3,0); } if (zstyle == EQUAL) vz = input->variable->compute_equal(zvar); else if (zstyle == ATOM) { if (vfield) input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0); - else input->variable->compute_atom(zvar,igroup,NULL,3,0); + else input->variable->compute_atom(zvar,igroup,nullptr,3,0); } for (int i = 0; i < nlocal; i++) @@ -580,10 +580,10 @@ void Velocity::scale(int /*narg*/, char **arg) { double t_desired = utils::numeric(FLERR,arg[0],false,lmp); - // if temperature = NULL, create a new ComputeTemp with the velocity group + // if temperature = nullptr, create a new ComputeTemp with the velocity group int tflag = 0; - if (temperature == NULL) { + if (temperature == nullptr) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; @@ -901,7 +901,7 @@ void Velocity::options(int narg, char **arg) // error check - if (bias_flag && temperature == NULL) + if (bias_flag && temperature == nullptr) error->all(FLERR,"Cannot use velocity bias command without temp keyword"); if (bias_flag && temperature->tempbias == 0) error->all(FLERR,"Velocity temperature ID does calculate a velocity bias"); diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 121a2ed1f..3e247f19c 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -56,7 +56,7 @@ void WriteCoeff::command(int narg, char **arg) char str[256], coeff[256]; FILE *one = fopen(file,"wb+"); - if (one == NULL) + if (one == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file, utils::getsyserror())); @@ -90,7 +90,7 @@ void WriteCoeff::command(int narg, char **arg) rewind(one); FILE *two = fopen(file+4,"w"); - if (two == NULL) + if (two == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file+4, utils::getsyserror())); @@ -99,15 +99,15 @@ void WriteCoeff::command(int narg, char **arg) while(1) { int coeff_mode = REGULAR_MODE; - if (fgets(str,256,one) == NULL) break; + if (fgets(str,256,one) == nullptr) break; // some coeffs need special treatment - if (strstr(str,"class2") != NULL) { - if (strstr(str,"angle_style") != NULL) + if (strstr(str,"class2") != nullptr) { + if (strstr(str,"angle_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"dihedral_style") != NULL) + else if (strstr(str,"dihedral_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"improper_style") != NULL) + else if (strstr(str,"improper_style") != nullptr) coeff_mode = CLASS2_MODE; } diff --git a/src/write_data.cpp b/src/write_data.cpp index 53d277b72..6f22547b8 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -153,21 +153,21 @@ void WriteData::write(const std::string &file) // may be different than atom->nbonds,nangles, etc. if broken/turned-off if (atom->molecular == 1 && (atom->nbonds || atom->nbondtypes)) { - nbonds_local = atom->avec->pack_bond(NULL); + nbonds_local = atom->avec->pack_bond(nullptr); MPI_Allreduce(&nbonds_local,&nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->nangles || atom->nangletypes)) { - nangles_local = atom->avec->pack_angle(NULL); + nangles_local = atom->avec->pack_angle(nullptr); MPI_Allreduce(&nangles_local,&nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->ndihedrals || atom->ndihedraltypes)) { - ndihedrals_local = atom->avec->pack_dihedral(NULL); + ndihedrals_local = atom->avec->pack_dihedral(nullptr); MPI_Allreduce(&ndihedrals_local,&ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); } if (atom->molecular == 1 && (atom->nimpropers || atom->nimpropertypes)) { - nimpropers_local = atom->avec->pack_improper(NULL); + nimpropers_local = atom->avec->pack_improper(nullptr); MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); } @@ -175,7 +175,7 @@ void WriteData::write(const std::string &file) if (me == 0) { fp = fopen(file.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open data file {}: {}", file, utils::getsyserror())); } @@ -665,7 +665,7 @@ void WriteData::bonus(int flag) // communication buffer for all my Bonus info // maxvalues = largest buffer needed by any proc - int nvalues = atom->avec->pack_data_bonus(NULL,flag); + int nvalues = atom->avec->pack_data_bonus(nullptr,flag); int maxvalues; MPI_Allreduce(&nvalues,&maxvalues,1,MPI_INT,MPI_MAX,world); diff --git a/src/write_dump.cpp b/src/write_dump.cpp index 56839a2f5..fd359ec2b 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -45,7 +45,7 @@ void WriteDump::command(int narg, char **arg) // create the Dump instance // create dump command line with extra required args - Dump *dump = NULL; + Dump *dump = nullptr; char **dumpargs = new char*[modindex+2]; dumpargs[0] = (char *) "WRITE_DUMP"; // dump id diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 256d7a377..01ad917e8 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -49,7 +49,7 @@ WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); multiproc = 0; noinit = 0; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -231,7 +231,7 @@ void WriteRestart::write(std::string file) if (multiproc) base.replace(base.find("%"),1,"base"); fp = fopen(base.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", base, utils::getsyserror())); } @@ -286,7 +286,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } std::string multiname = file; @@ -294,7 +294,7 @@ void WriteRestart::write(std::string file) if (filewriter) { fp = fopen(multiname.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", multiname, utils::getsyserror())); write_int(PROCSPERFILE,nclusterprocs); @@ -363,7 +363,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } mpiio->openForWrite(file.c_str()); mpiio->write(headerOffset,send_size,buf); @@ -393,7 +393,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } else { MPI_Recv(&tmp,0,MPI_INT,fileproc,0,world,MPI_STATUS_IGNORE); @@ -661,7 +661,7 @@ void WriteRestart::write_double(int flag, double value) } /* ---------------------------------------------------------------------- - write a flag and a char string (including NULL) into restart file + write a flag and a char string (including nullptr) into restart file ------------------------------------------------------------------------- */ void WriteRestart::write_string(int flag, const char *value) -- GitLab From f524fa758dc25aecc216f2c3c776ee805fe93e35 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 08:53:44 -0600 Subject: [PATCH 28/52] T2345: Replace instances of NULL with nullptr Per guidance from Axel, revert lib/kokkos and lib/colvars to remove nullptr changes. --- lib/colvars/colvar.cpp | 20 +++---- lib/colvars/colvaratoms.cpp | 8 +-- lib/colvars/colvarbias.cpp | 26 ++++---- lib/colvars/colvarbias.h | 4 +- lib/colvars/colvarbias_abf.cpp | 42 ++++++------- lib/colvars/colvarbias_histogram.cpp | 4 +- lib/colvars/colvarbias_meta.cpp | 46 +++++++------- lib/colvars/colvarcomp.cpp | 8 +-- lib/colvars/colvarcomp_coordnums.cpp | 38 ++++++------ lib/colvars/colvarcomp_distances.cpp | 2 +- lib/colvars/colvardeps.cpp | 2 +- lib/colvars/colvargrid.cpp | 14 ++--- lib/colvars/colvarmodule.cpp | 60 +++++++++---------- lib/colvars/colvarmodule.h | 6 +- lib/colvars/colvarparams.cpp | 6 +- lib/colvars/colvarparse.cpp | 10 ++-- lib/colvars/colvarparse.h | 8 +-- lib/colvars/colvarproxy.cpp | 16 ++--- lib/colvars/colvarproxy.h | 2 +- lib/colvars/colvarscript.cpp | 20 +++---- lib/colvars/colvarscript.h | 2 +- lib/colvars/colvartypes.h | 4 +- lib/colvars/lepton/include/lepton/Operation.h | 12 ++-- lib/colvars/lepton/src/CompiledExpression.cpp | 8 +-- lib/colvars/lepton/src/ExpressionTreeNode.cpp | 8 +-- lib/colvars/lepton/src/ParsedExpression.cpp | 2 +- lib/kokkos/cmake/compile_tests/pthread.cpp | 6 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp | 2 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 2 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 2 +- lib/kokkos/core/unit_test/TestCTestDevice.cpp | 2 +- 31 files changed, 196 insertions(+), 196 deletions(-) diff --git a/lib/colvars/colvar.cpp b/lib/colvars/colvar.cpp index 61e83f44a..1002dc35d 100644 --- a/lib/colvars/colvar.cpp +++ b/lib/colvars/colvar.cpp @@ -22,7 +22,7 @@ colvar::colvar() { - runave_os = nullptr; + runave_os = NULL; prev_timestep = -1L; after_restart = false; @@ -62,7 +62,7 @@ int colvar::init(std::string const &conf) get_keyval(conf, "name", this->name, (std::string("colvar")+cvm::to_str(cv->variables()->size()))); - if ((cvm::colvar_by_name(this->name) != nullptr) && + if ((cvm::colvar_by_name(this->name) != NULL) && (cvm::colvar_by_name(this->name) != this)) { cvm::error("Error: this colvar cannot have the same name, \""+this->name+ "\", as another colvar.\n", @@ -744,7 +744,7 @@ template int colvar::init_components_type(std::string c : ".\n")); cvm::increase_depth(); cvc *cvcp = new def_class_name(def_conf); - if (cvcp != nullptr) { + if (cvcp != NULL) { cvcs.push_back(cvcp); cvcp->check_keywords(def_conf, def_config_key); cvcp->config_key = def_config_key; @@ -994,7 +994,7 @@ int colvar::parse_analysis(std::string const &conf) acf_type = acf_vel; enable(f_cv_fdiff_velocity); colvar *cv2 = cvm::colvar_by_name(acf_colvar_name); - if (cv2 == nullptr) { + if (cv2 == NULL) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -1215,14 +1215,14 @@ colvar::~colvar() for (std::vector::iterator cei = value_evaluators.begin(); cei != value_evaluators.end(); ++cei) { - if (*cei != nullptr) delete (*cei); + if (*cei != NULL) delete (*cei); } value_evaluators.clear(); for (std::vector::iterator gei = gradient_evaluators.begin(); gei != gradient_evaluators.end(); ++gei) { - if (*gei != nullptr) delete (*gei); + if (*gei != NULL) delete (*gei); } gradient_evaluators.clear(); #endif @@ -1972,7 +1972,7 @@ void const *colvar::get_cvc_param_ptr(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return nullptr; + return NULL; } @@ -1983,7 +1983,7 @@ colvarvalue const *colvar::get_cvc_param_grad(std::string const ¶m_name) } cvm::error("Error: calling colvar::get_cvc_param_grad() for a variable " "with more than one component.\n", COLVARS_NOT_IMPLEMENTED); - return nullptr; + return NULL; } @@ -2422,7 +2422,7 @@ int colvar::calc_acf() // the pointer to each vector is changed at every step colvar const *cfcv = cvm::colvar_by_name(acf_colvar_name); - if (cfcv == nullptr) { + if (cfcv == NULL) { return cvm::error("Error: collective variable \""+acf_colvar_name+ "\" is not defined at this time.\n", INPUT_ERROR); } @@ -2660,7 +2660,7 @@ int colvar::calc_runave() if ((*x_history_p).size() >= runave_length-1) { - if (runave_os == nullptr) { + if (runave_os == NULL) { if (runave_outfile.size() == 0) { runave_outfile = std::string(cvm::output_prefix()+"."+ this->name+".runave.traj"); diff --git a/lib/colvars/colvaratoms.cpp b/lib/colvars/colvaratoms.cpp index 2796f3d28..180fc69a8 100644 --- a/lib/colvars/colvaratoms.cpp +++ b/lib/colvars/colvaratoms.cpp @@ -105,7 +105,7 @@ cvm::atom_group::~atom_group() if (fitting_group) { delete fitting_group; - fitting_group = nullptr; + fitting_group = NULL; } cvm::main()->unregister_named_atom_group(this); @@ -217,7 +217,7 @@ int cvm::atom_group::init() b_center = false; b_rotate = false; b_user_defined_fit = false; - fitting_group = nullptr; + fitting_group = NULL; noforce = false; @@ -368,7 +368,7 @@ int cvm::atom_group::parse(std::string const &group_conf) // Optional group name will let other groups reuse atom definition if (get_keyval(group_conf, "name", name)) { - if ((cvm::atom_group_by_name(this->name) != nullptr) && + if ((cvm::atom_group_by_name(this->name) != NULL) && (cvm::atom_group_by_name(this->name) != this)) { cvm::error("Error: this atom group cannot have the same name, \""+this->name+ "\", as another atom group.\n", @@ -395,7 +395,7 @@ int cvm::atom_group::parse(std::string const &group_conf) std::string atoms_of = ""; if (get_keyval(group_conf, "atomsOfGroup", atoms_of)) { atom_group * ag = atom_group_by_name(atoms_of); - if (ag == nullptr) { + if (ag == NULL) { cvm::error("Error: cannot find atom group with name " + atoms_of + ".\n"); return COLVARS_ERROR; } diff --git a/lib/colvars/colvarbias.cpp b/lib/colvars/colvarbias.cpp index cdbc13699..09bcca01b 100644 --- a/lib/colvars/colvarbias.cpp +++ b/lib/colvars/colvarbias.cpp @@ -47,7 +47,7 @@ int colvarbias::init(std::string const &conf) { colvarbias *bias_with_name = cvm::bias_by_name(this->name); - if (bias_with_name != nullptr) { + if (bias_with_name != NULL) { if ((bias_with_name->rank != this->rank) || (bias_with_name->bias_type != this->bias_type)) { cvm::error("Error: this bias cannot have the same name, \""+this->name+ @@ -295,8 +295,8 @@ int colvarbias::update() colvar_values[i] = colvars[i]->value(); } - error_code |= calc_energy(nullptr); - error_code |= calc_forces(nullptr); + error_code |= calc_energy(NULL); + error_code |= calc_forces(NULL); return error_code; } @@ -547,8 +547,8 @@ colvarbias_ti::colvarbias_ti(char const *key) : colvarbias(key) { provide(f_cvb_calc_ti_samples); - ti_avg_forces = nullptr; - ti_count = nullptr; + ti_avg_forces = NULL; + ti_count = NULL; } @@ -560,13 +560,13 @@ colvarbias_ti::~colvarbias_ti() int colvarbias_ti::clear_state_data() { - if (ti_avg_forces != nullptr) { + if (ti_avg_forces != NULL) { delete ti_avg_forces; - ti_avg_forces = nullptr; + ti_avg_forces = NULL; } - if (ti_count != nullptr) { + if (ti_count != NULL) { delete ti_count; - ti_count = nullptr; + ti_count = NULL; } return COLVARS_OK; } @@ -622,7 +622,7 @@ int colvarbias_ti::init(std::string const &conf) int colvarbias_ti::init_grids() { if (is_enabled(f_cvb_calc_ti_samples)) { - if (ti_avg_forces == nullptr) { + if (ti_avg_forces == NULL) { ti_bin.resize(num_variables()); ti_system_forces.resize(num_variables()); for (size_t icv = 0; icv < num_variables(); icv++) { @@ -643,7 +643,7 @@ int colvarbias_ti::init_grids() int colvarbias_ti::update() { - return update_system_forces(nullptr); + return update_system_forces(NULL); } @@ -679,7 +679,7 @@ int colvarbias_ti::update_system_forces(std::vector const ti_system_forces[i] = variables(i)->total_force(); } else { ti_system_forces[i] = variables(i)->total_force() - - ((subtract_forces != nullptr) ? + ((subtract_forces != NULL) ? (*subtract_forces)[i] : previous_colvar_forces[i]); } } @@ -759,7 +759,7 @@ int colvarbias_ti::write_output_files() std::string const ti_output_prefix = cvm::output_prefix()+"."+this->name; - std::ostream *os = nullptr; + std::ostream *os = NULL; if (is_enabled(f_cvb_write_ti_samples)) { std::string const ti_count_file_name(ti_output_prefix+".ti.count"); diff --git a/lib/colvars/colvarbias.h b/lib/colvars/colvarbias.h index 20c346f81..5179c4285 100644 --- a/lib/colvars/colvarbias.h +++ b/lib/colvars/colvarbias.h @@ -58,12 +58,12 @@ public: virtual int update(); /// Compute the energy of the bias - /// Uses the vector of colvar values provided if not nullptr, and the values + /// Uses the vector of colvar values provided if not NULL, and the values /// currently cached in the bias instance otherwise virtual int calc_energy(std::vector const *values); /// Compute the forces due to the bias - /// Uses the vector of colvar values provided if not nullptr, and the values + /// Uses the vector of colvar values provided if not NULL, and the values /// currently cached in the bias instance otherwise virtual int calc_forces(std::vector const *values); diff --git a/lib/colvars/colvarbias_abf.cpp b/lib/colvars/colvarbias_abf.cpp index 9926579a8..5382a828f 100644 --- a/lib/colvars/colvarbias_abf.cpp +++ b/lib/colvars/colvarbias_abf.cpp @@ -18,16 +18,16 @@ colvarbias_abf::colvarbias_abf(char const *key) b_UI_estimator(false), b_CZAR_estimator(false), pabf_freq(0), - system_force(nullptr), - gradients(nullptr), - samples(nullptr), - pmf(nullptr), - z_gradients(nullptr), - z_samples(nullptr), - czar_gradients(nullptr), - czar_pmf(nullptr), - last_gradients(nullptr), - last_samples(nullptr) + system_force(NULL), + gradients(NULL), + samples(NULL), + pmf(NULL), + z_gradients(NULL), + z_samples(NULL), + czar_gradients(NULL), + czar_pmf(NULL), + last_gradients(NULL), + last_samples(NULL) { } @@ -261,37 +261,37 @@ colvarbias_abf::~colvarbias_abf() { if (samples) { delete samples; - samples = nullptr; + samples = NULL; } if (gradients) { delete gradients; - gradients = nullptr; + gradients = NULL; } if (pmf) { delete pmf; - pmf = nullptr; + pmf = NULL; } if (z_samples) { delete z_samples; - z_samples = nullptr; + z_samples = NULL; } if (z_gradients) { delete z_gradients; - z_gradients = nullptr; + z_gradients = NULL; } if (czar_gradients) { delete czar_gradients; - czar_gradients = nullptr; + czar_gradients = NULL; } if (czar_pmf) { delete czar_pmf; - czar_pmf = nullptr; + czar_pmf = NULL; } // shared ABF @@ -299,17 +299,17 @@ colvarbias_abf::~colvarbias_abf() // but now we can call shared externally if (last_samples) { delete last_samples; - last_samples = nullptr; + last_samples = NULL; } if (last_gradients) { delete last_gradients; - last_gradients = nullptr; + last_gradients = NULL; } if (system_force) { delete [] system_force; - system_force = nullptr; + system_force = NULL; } } @@ -488,7 +488,7 @@ int colvarbias_abf::update() } /// Add the bias energy for 1D ABF - bias_energy = calc_energy(nullptr); + bias_energy = calc_energy(NULL); return COLVARS_OK; } diff --git a/lib/colvars/colvarbias_histogram.cpp b/lib/colvars/colvarbias_histogram.cpp index 44862ba25..92985b0f6 100644 --- a/lib/colvars/colvarbias_histogram.cpp +++ b/lib/colvars/colvarbias_histogram.cpp @@ -15,7 +15,7 @@ colvarbias_histogram::colvarbias_histogram(char const *key) : colvarbias(key), - grid(nullptr), out_name("") + grid(NULL), out_name("") { provide(f_cvb_bypass_ext_lagrangian); // Allow histograms of actual cv for extended-Lagrangian } @@ -105,7 +105,7 @@ colvarbias_histogram::~colvarbias_histogram() { if (grid) { delete grid; - grid = nullptr; + grid = NULL; } } diff --git a/lib/colvars/colvarbias_meta.cpp b/lib/colvars/colvarbias_meta.cpp index 03c1886a8..05f293d87 100644 --- a/lib/colvars/colvarbias_meta.cpp +++ b/lib/colvars/colvarbias_meta.cpp @@ -36,7 +36,7 @@ colvarbias_meta::colvarbias_meta(char const *key) : colvarbias(key), colvarbias_ti(key) { new_hills_begin = hills.end(); - hills_traj_os = nullptr; + hills_traj_os = NULL; hill_width = 0.0; @@ -45,8 +45,8 @@ colvarbias_meta::colvarbias_meta(char const *key) use_grids = true; grids_freq = 0; rebin_grids = false; - hills_energy = nullptr; - hills_energy_gradients = nullptr; + hills_energy = NULL; + hills_energy_gradients = NULL; dump_fes = true; keep_hills = false; @@ -153,7 +153,7 @@ int colvarbias_meta::init(std::string const &conf) get_keyval(conf, "keepHills", keep_hills, keep_hills); get_keyval(conf, "keepFreeEnergyFiles", dump_fes_save, dump_fes_save); - if (hills_energy == nullptr) { + if (hills_energy == NULL) { hills_energy = new colvar_grid_scalar(colvars); hills_energy_gradients = new colvar_grid_gradient(colvars); } @@ -262,7 +262,7 @@ int colvarbias_meta::init_well_tempered_params(std::string const &conf) int colvarbias_meta::init_ebmeta_params(std::string const &conf) { // for ebmeta - target_dist = nullptr; + target_dist = NULL; get_keyval(conf, "ebMeta", ebmeta, false); if(ebmeta){ if (use_grids && expand_grids) { @@ -328,12 +328,12 @@ colvarbias_meta::~colvarbias_meta() if (hills_traj_os) { proxy->close_output_stream(hills_traj_file_name()); - hills_traj_os = nullptr; + hills_traj_os = NULL; } if (target_dist) { delete target_dist; - target_dist = nullptr; + target_dist = NULL; } } @@ -342,12 +342,12 @@ int colvarbias_meta::clear_state_data() { if (hills_energy) { delete hills_energy; - hills_energy = nullptr; + hills_energy = NULL; } if (hills_energy_gradients) { delete hills_energy_gradients; - hills_energy_gradients = nullptr; + hills_energy_gradients = NULL; } hills.clear(); @@ -451,8 +451,8 @@ int colvarbias_meta::update() error_code |= replica_share(); } - error_code |= calc_energy(nullptr); - error_code |= calc_forces(nullptr); + error_code |= calc_energy(NULL); + error_code |= calc_forces(NULL); return error_code; } @@ -593,7 +593,7 @@ int colvarbias_meta::update_bias() std::vector curr_bin = hills_energy->get_colvars_index(); hills_energy_sum_here = hills_energy->value(curr_bin); } else { - calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, nullptr); + calc_hills(new_hills_begin, hills.end(), hills_energy_sum_here, NULL); } hills_scale *= cvm::exp(-1.0*hills_energy_sum_here/(bias_temperature*cvm::boltzmann())); } @@ -887,14 +887,14 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, std::vector colvar_forces_scalar(num_variables()); std::vector he_ix = he->new_index(); - std::vector hg_ix = (hg != nullptr) ? hg->new_index() : std::vector (0); + std::vector hg_ix = (hg != NULL) ? hg->new_index() : std::vector (0); cvm::real hills_energy_here = 0.0; std::vector hills_forces_here(num_variables(), 0.0); size_t count = 0; size_t const print_frequency = ((hills.size() >= 1000000) ? 1 : (1000000/(hills.size()+1))); - if (hg != nullptr) { + if (hg != NULL) { // loop over the points of the grid for ( ; @@ -1310,8 +1310,8 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) hills_energy_gradients = new colvar_grid_gradient(colvars); } - colvar_grid_scalar *hills_energy_backup = nullptr; - colvar_grid_gradient *hills_energy_gradients_backup = nullptr; + colvar_grid_scalar *hills_energy_backup = NULL; + colvar_grid_gradient *hills_energy_gradients_backup = NULL; if (has_data) { if (cvm::debug()) @@ -1327,7 +1327,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_pos = is.tellg(); std::string key; if (!(is >> key)) { - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1343,7 +1343,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == nullptr) + if (hills_energy_backup == NULL) cvm::fatal_error("Error: couldn't read the free energy grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1365,7 +1365,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) size_t const hills_energy_gradients_pos = is.tellg(); if (!(is >> key)) { - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { delete hills_energy; delete hills_energy_gradients; hills_energy = hills_energy_backup; @@ -1381,7 +1381,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) is.seekg(hills_energy_gradients_pos, std::ios::beg); grids_from_restart_file = false; if (!rebin_grids) { - if (hills_energy_backup == nullptr) + if (hills_energy_backup == NULL) cvm::fatal_error("Error: couldn't read the free energy gradients grid for metadynamics bias \""+ this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+ @@ -1406,7 +1406,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) this->name+"\""+ ((comm != single_replica) ? ", replica \""+replica_id+"\"" : "")+"\n"); - if (hills_energy_backup != nullptr) { + if (hills_energy_backup != NULL) { // now that we have successfully updated the grids, delete the // backup copies if (cvm::debug()) @@ -1594,7 +1594,7 @@ int colvarbias_meta::setup_output() // TODO: one may want to specify the path manually for intricated filesystems? char *pwd = new char[3001]; - if (GETCWD(pwd, 3000) == nullptr) + if (GETCWD(pwd, 3000) == NULL) cvm::fatal_error("Error: cannot get the path of the current working directory.\n"); replica_list_file = (std::string(pwd)+std::string(PATHSEP)+ @@ -1885,7 +1885,7 @@ int colvarbias_meta::reopen_replica_buffer_file() { int error_code = COLVARS_OK; colvarproxy *proxy = cvm::proxy; - if (proxy->get_output_stream(replica_hills_file) != nullptr) { + if (proxy->get_output_stream(replica_hills_file) != NULL) { error_code |= proxy->close_output_stream(replica_hills_file); } error_code |= proxy->remove_file(replica_hills_file); diff --git a/lib/colvars/colvarcomp.cpp b/lib/colvars/colvarcomp.cpp index d45d85111..05d1195d5 100644 --- a/lib/colvars/colvarcomp.cpp +++ b/lib/colvars/colvarcomp.cpp @@ -135,7 +135,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf, char const *group_key, bool optional) { - cvm::atom_group *group = nullptr; + cvm::atom_group *group = NULL; std::string group_conf; if (key_lookup(conf, group_key, &group_conf)) { @@ -298,7 +298,7 @@ colvar::cvc::~cvc() free_children_deps(); remove_all_children(); for (size_t i = 0; i < atom_groups.size(); i++) { - if (atom_groups[i] != nullptr) delete atom_groups[i]; + if (atom_groups[i] != NULL) delete atom_groups[i]; } } @@ -344,7 +344,7 @@ colvarvalue const *colvar::cvc::get_param_grad(std::string const ¶m_name) { colvarvalue const *ptr = reinterpret_cast(get_param_grad_ptr(param_name)); - return ptr != nullptr ? ptr : nullptr; + return ptr != NULL ? ptr : NULL; } @@ -553,7 +553,7 @@ void colvar::cvc::debug_gradients() } } - if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != nullptr)) { + if ((group->is_enabled(f_ag_fit_gradients)) && (group->fitting_group != NULL)) { cvm::atom_group *ref_group = group->fitting_group; group->read_positions(); group->calc_required_properties(); diff --git a/lib/colvars/colvarcomp_coordnums.cpp b/lib/colvars/colvarcomp_coordnums.cpp index f36d05552..f0fbabfc4 100644 --- a/lib/colvars/colvarcomp_coordnums.cpp +++ b/lib/colvars/colvarcomp_coordnums.cpp @@ -91,7 +91,7 @@ cvm::real colvar::coordnum::switching_function(cvm::real const &r0, colvar::coordnum::coordnum(std::string const &conf) - : cvc(conf), b_anisotropic(false), pairlist(nullptr) + : cvc(conf), b_anisotropic(false), pairlist(NULL) { function_type = "coordnum"; @@ -102,7 +102,7 @@ colvar::coordnum::coordnum(std::string const &conf) group1 = parse_group(conf, "group1"); group2 = parse_group(conf, "group2"); - if (group1 == nullptr || group2 == nullptr) { + if (group1 == NULL || group2 == NULL) { cvm::error("Error: failed to initialize atom groups.\n", INPUT_ERROR); return; @@ -183,7 +183,7 @@ colvar::coordnum::coordnum(std::string const &conf) colvar::coordnum::~coordnum() { - if (pairlist != nullptr) { + if (pairlist != NULL) { delete [] pairlist; } } @@ -218,11 +218,11 @@ template void colvar::coordnum::main_loop(bool **pairlist_elem) template int colvar::coordnum::compute_coordnum() { - bool const use_pairlist = (pairlist != nullptr); - bool const rebuild_pairlist = (pairlist != nullptr) && + bool const use_pairlist = (pairlist != NULL); + bool const rebuild_pairlist = (pairlist != NULL) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : nullptr; + bool *pairlist_elem = use_pairlist ? pairlist : NULL; if (b_anisotropic) { @@ -239,7 +239,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags | ef_anisotropic; - main_loop(nullptr); + main_loop(NULL); } } else { @@ -257,7 +257,7 @@ template int colvar::coordnum::compute_coordnum() } else { int const flags = compute_flags; - main_loop(nullptr); + main_loop(NULL); } } @@ -367,7 +367,7 @@ void colvar::h_bond::calc_value() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - nullptr, 0.0); + NULL, 0.0); } @@ -378,7 +378,7 @@ void colvar::h_bond::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, (*atom_groups[0])[0], (*atom_groups[0])[1], - nullptr, 0.0); + NULL, 0.0); } @@ -393,7 +393,7 @@ simple_scalar_dist_functions(h_bond) colvar::selfcoordnum::selfcoordnum(std::string const &conf) - : cvc(conf), pairlist(nullptr) + : cvc(conf), pairlist(NULL) { function_type = "selfcoordnum"; x.type(colvarvalue::type_scalar); @@ -438,7 +438,7 @@ colvar::selfcoordnum::selfcoordnum(std::string const &conf) colvar::selfcoordnum::~selfcoordnum() { - if (pairlist != nullptr) { + if (pairlist != NULL) { delete [] pairlist; } } @@ -448,11 +448,11 @@ template int colvar::selfcoordnum::compute_selfcoordnum() { cvm::rvector const r0_vec(0.0); // TODO enable the flag? - bool const use_pairlist = (pairlist != nullptr); - bool const rebuild_pairlist = (pairlist != nullptr) && + bool const use_pairlist = (pairlist != NULL); + bool const rebuild_pairlist = (pairlist != NULL) && (cvm::step_relative() % pairlist_freq == 0); - bool *pairlist_elem = use_pairlist ? pairlist : nullptr; + bool *pairlist_elem = use_pairlist ? pairlist : NULL; size_t i = 0, j = 0; size_t const n = group1->size(); @@ -601,13 +601,13 @@ void colvar::groupcoordnum::calc_value() x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } else { int const flags = coordnum::ef_null; x.real_value = coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } } @@ -624,13 +624,13 @@ void colvar::groupcoordnum::calc_gradients() coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } else { int const flags = coordnum::ef_gradients; coordnum::switching_function(r0, r0_vec, en, ed, group1_com_atom, group2_com_atom, - nullptr, 0.0); + NULL, 0.0); } group1->set_weighted_gradient(group1_com_atom.grad); diff --git a/lib/colvars/colvarcomp_distances.cpp b/lib/colvars/colvarcomp_distances.cpp index 88a5088aa..c3c1ee55d 100644 --- a/lib/colvars/colvarcomp_distances.cpp +++ b/lib/colvars/colvarcomp_distances.cpp @@ -964,7 +964,7 @@ colvar::rmsd::rmsd(std::string const &conf) } bool b_Jacobian_derivative = true; - if (atoms->fitting_group != nullptr && b_Jacobian_derivative) { + if (atoms->fitting_group != NULL && b_Jacobian_derivative) { cvm::log("The option \"fittingGroup\" (alternative group for fitting) was enabled: " "Jacobian derivatives of the RMSD will not be calculated.\n"); b_Jacobian_derivative = false; diff --git a/lib/colvars/colvardeps.cpp b/lib/colvars/colvardeps.cpp index f647211f6..f83458b51 100644 --- a/lib/colvars/colvardeps.cpp +++ b/lib/colvars/colvardeps.cpp @@ -33,7 +33,7 @@ colvardeps::~colvardeps() { // Do not delete features if it's a static object // may change in the future though // for (i=0; i &colvars, {} colvar_grid_scalar::colvar_grid_scalar() - : colvar_grid(), samples(nullptr) + : colvar_grid(), samples(NULL) {} colvar_grid_scalar::colvar_grid_scalar(colvar_grid_scalar const &g) - : colvar_grid(g), samples(nullptr) + : colvar_grid(g), samples(NULL) { } colvar_grid_scalar::colvar_grid_scalar(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, 1), samples(nullptr) + : colvar_grid(nx_i, 0.0, 1), samples(NULL) { } colvar_grid_scalar::colvar_grid_scalar(std::vector &colvars, bool margin) - : colvar_grid(colvars, 0.0, 1, margin), samples(nullptr) + : colvar_grid(colvars, 0.0, 1, margin), samples(NULL) { } @@ -122,15 +122,15 @@ cvm::real colvar_grid_scalar::entropy() const colvar_grid_gradient::colvar_grid_gradient() - : colvar_grid(), samples(nullptr) + : colvar_grid(), samples(NULL) {} colvar_grid_gradient::colvar_grid_gradient(std::vector const &nx_i) - : colvar_grid(nx_i, 0.0, nx_i.size()), samples(nullptr) + : colvar_grid(nx_i, 0.0, nx_i.size()), samples(NULL) {} colvar_grid_gradient::colvar_grid_gradient(std::vector &colvars) - : colvar_grid(colvars, 0.0, colvars.size()), samples(nullptr) + : colvar_grid(colvars, 0.0, colvars.size()), samples(NULL) {} void colvar_grid_gradient::write_1D_integral(std::ostream &os) diff --git a/lib/colvars/colvarmodule.cpp b/lib/colvars/colvarmodule.cpp index 48a38a607..1d5f75bbc 100644 --- a/lib/colvars/colvarmodule.cpp +++ b/lib/colvars/colvarmodule.cpp @@ -30,11 +30,11 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) depth_s = 0; log_level_ = 10; - cv_traj_os = nullptr; + cv_traj_os = NULL; xyz_reader_use_count = 0; - if (proxy == nullptr) { + if (proxy == NULL) { proxy = proxy_in; // Pointer to the proxy object parse = new colvarparse(); // Parsing object for global options version_int = proxy->get_version_from_string(COLVARS_VERSION); @@ -573,7 +573,7 @@ colvarbias * colvarmodule::bias_by_name(std::string const &name) return (*bi); } } - return nullptr; + return NULL; } @@ -587,7 +587,7 @@ colvar *colvarmodule::colvar_by_name(std::string const &name) return (*cvi); } } - return nullptr; + return NULL; } @@ -601,7 +601,7 @@ cvm::atom_group *colvarmodule::atom_group_by_name(std::string const &name) return (*agi); } } - return nullptr; + return NULL; } @@ -631,7 +631,7 @@ int colvarmodule::change_configuration(std::string const &bias_name, cvm::increase_depth(); colvarbias *b; b = bias_by_name(bias_name); - if (b == nullptr) { + if (b == NULL) { cvm::error("Error: bias not found: " + bias_name); return COLVARS_ERROR; } @@ -647,7 +647,7 @@ std::string colvarmodule::read_colvar(std::string const &name) colvar *c; std::stringstream ss; c = colvar_by_name(name); - if (c == nullptr) { + if (c == NULL) { cvm::error("Error: colvar not found: " + name); return std::string(); } @@ -663,7 +663,7 @@ cvm::real colvarmodule::energy_difference(std::string const &bias_name, colvarbias *b; cvm::real energy_diff = 0.; b = bias_by_name(bias_name); - if (b == nullptr) { + if (b == NULL) { cvm::error("Error: bias not found: " + bias_name); return 0.; } @@ -678,7 +678,7 @@ int colvarmodule::bias_current_bin(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->current_bin(); } else { cvm::error("Error: bias not found.\n"); @@ -695,7 +695,7 @@ int colvarmodule::bias_bin_num(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->bin_num(); } else { cvm::error("Error: bias not found.\n"); @@ -712,7 +712,7 @@ int colvarmodule::bias_bin_count(std::string const &bias_name, size_t bin_index) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { ret = b->bin_count(bin_index); } else { cvm::error("Error: bias not found.\n"); @@ -729,7 +729,7 @@ int colvarmodule::bias_share(std::string const &bias_name) int ret; colvarbias *b = bias_by_name(bias_name); - if (b != nullptr) { + if (b != NULL) { b->replica_share(); ret = COLVARS_OK; } else { @@ -1037,7 +1037,7 @@ int colvarmodule::write_restart_file(std::string const &out_name) int colvarmodule::write_traj_files() { - if (cv_traj_os == nullptr) { + if (cv_traj_os == NULL) { if (open_traj_file(cv_traj_name) != COLVARS_OK) { return cvm::get_error(); } else { @@ -1057,7 +1057,7 @@ int colvarmodule::write_traj_files() write_traj(*cv_traj_os); } - if (restart_out_freq && (cv_traj_os != nullptr)) { + if (restart_out_freq && (cv_traj_os != NULL)) { // flush the trajectory file if we are at the restart frequency if ( (cvm::step_relative() > 0) && ((cvm::step_absolute() % restart_out_freq) == 0) ) { @@ -1151,8 +1151,8 @@ colvarmodule::~colvarmodule() atom_group::delete_features(); delete parse; - parse = nullptr; - proxy = nullptr; + parse = NULL; + proxy = NULL; } } @@ -1184,7 +1184,7 @@ int colvarmodule::reset() proxy->reset(); - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { // Do not close traj file here, as we might not be done with it yet. proxy->flush_output_stream(cv_traj_os); } @@ -1395,7 +1395,7 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) if (static_cast(is.tellg()) == pos) { // This block has not been read by any object: discard it and move on // to the next one - is >> colvarparse::read_block(word, nullptr); + is >> colvarparse::read_block(word, NULL); } if (!is) break; @@ -1456,7 +1456,7 @@ int colvarmodule::write_output_files() } cvm::decrease_depth(); - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { // do not close, there may be another run command proxy->flush_output_stream(cv_traj_os); } @@ -1575,7 +1575,7 @@ std::ostream & colvarmodule::write_restart(std::ostream &os) int colvarmodule::open_traj_file(std::string const &file_name) { - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { return COLVARS_OK; } @@ -1591,7 +1591,7 @@ int colvarmodule::open_traj_file(std::string const &file_name) cv_traj_os = (cvm::proxy)->output_stream(file_name); } - if (cv_traj_os == nullptr) { + if (cv_traj_os == NULL) { cvm::error("Error: cannot write to file \""+file_name+"\".\n", FILE_ERROR); } @@ -1602,9 +1602,9 @@ int colvarmodule::open_traj_file(std::string const &file_name) int colvarmodule::close_traj_file() { - if (cv_traj_os != nullptr) { + if (cv_traj_os != NULL) { proxy->close_output_stream(cv_traj_name); - cv_traj_os = nullptr; + cv_traj_os = NULL; } return cvm::get_error(); } @@ -1672,7 +1672,7 @@ void cvm::log(std::string const &message, int min_log_level) { if (cvm::log_level() < min_log_level) return; // allow logging when the module is not fully initialized - size_t const d = (cvm::main() != nullptr) ? depth() : 0; + size_t const d = (cvm::main() != NULL) ? depth() : 0; if (d > 0) { proxy->log((std::string(2*d, ' '))+message); } else { @@ -1780,7 +1780,7 @@ int cvm::read_index_file(char const *filename) } if (index_of_group < 0) { index_group_names.push_back(group_name); - index_groups.push_back(nullptr); + index_groups.push_back(NULL); index_of_group = index_groups.size()-1; } } else { @@ -1799,7 +1799,7 @@ int cvm::read_index_file(char const *filename) pos = is.tellg(); } - if (old_index_group != nullptr) { + if (old_index_group != NULL) { bool equal = false; if (new_index_group->size() == old_index_group->size()) { if (std::equal(new_index_group->begin(), new_index_group->end(), @@ -1810,13 +1810,13 @@ int cvm::read_index_file(char const *filename) if (! equal) { new_index_group->clear(); delete new_index_group; - new_index_group = nullptr; + new_index_group = NULL; return cvm::error("Error: the index group \""+group_name+ "\" was redefined.\n", INPUT_ERROR); } else { old_index_group->clear(); delete old_index_group; - old_index_group = nullptr; + old_index_group = NULL; } } @@ -1850,7 +1850,7 @@ int colvarmodule::reset_index_groups() size_t i = 0; for ( ; i < index_groups.size(); i++) { delete index_groups[i]; - index_groups[i] = nullptr; + index_groups[i] = NULL; } index_group_names.clear(); index_groups.clear(); @@ -2179,7 +2179,7 @@ std::string cvm::wrap_string(std::string const &s, size_t nchars) // shared pointer to the proxy object -colvarproxy *colvarmodule::proxy = nullptr; +colvarproxy *colvarmodule::proxy = NULL; // static runtime data cvm::real colvarmodule::debug_gradients_step_size = 1.0e-07; diff --git a/lib/colvars/colvarmodule.h b/lib/colvars/colvarmodule.h index e06f05aca..9346e8e1d 100644 --- a/lib/colvars/colvarmodule.h +++ b/lib/colvars/colvarmodule.h @@ -459,13 +459,13 @@ public: /// Backup a file before writing it static int backup_file(char const *filename); - /// Look up a bias by name; returns nullptr if not found + /// Look up a bias by name; returns NULL if not found static colvarbias * bias_by_name(std::string const &name); - /// Look up a colvar by name; returns nullptr if not found + /// Look up a colvar by name; returns NULL if not found static colvar * colvar_by_name(std::string const &name); - /// Look up a named atom group by name; returns nullptr if not found + /// Look up a named atom group by name; returns NULL if not found static atom_group * atom_group_by_name(std::string const &name); /// Load new configuration for the given bias - diff --git a/lib/colvars/colvarparams.cpp b/lib/colvars/colvarparams.cpp index ea45c0110..e957a1841 100644 --- a/lib/colvars/colvarparams.cpp +++ b/lib/colvars/colvarparams.cpp @@ -76,7 +76,7 @@ void const *colvarparams::get_param_ptr(std::string const ¶m_name) return param_map[param_name]; } cvm::error("Error: parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return nullptr; + return NULL; } @@ -87,7 +87,7 @@ void const *colvarparams::get_param_grad_ptr(std::string const ¶m_name) } cvm::error("Error: gradient of parameter \""+param_name+"\" not found.\n", INPUT_ERROR); - return nullptr; + return NULL; } @@ -95,7 +95,7 @@ cvm::real colvarparams::get_param(std::string const ¶m_name) { cvm::real const *ptr = reinterpret_cast(get_param_ptr(param_name)); - return ptr != nullptr ? *ptr : 0.0; + return ptr != NULL ? *ptr : 0.0; } diff --git a/lib/colvars/colvarparse.cpp b/lib/colvars/colvarparse.cpp index e61ebf355..a09d6be9e 100644 --- a/lib/colvars/colvarparse.cpp +++ b/lib/colvars/colvarparse.cpp @@ -674,12 +674,12 @@ bool colvarparse::key_lookup(std::string const &conf, std::string const conf_lower(to_lower_cppstr(conf)); // by default, there is no value, unless we found one - if (data != nullptr) { + if (data != NULL) { data->clear(); } // start from the first occurrence of key - size_t pos = conf_lower.find(key, (save_pos != nullptr) ? *save_pos : 0); + size_t pos = conf_lower.find(key, (save_pos != NULL) ? *save_pos : 0); // iterate over all instances of the substring until it finds it as isolated keyword while (true) { @@ -727,7 +727,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != nullptr) { + if (save_pos != NULL) { // save the pointer for a future call (when iterating over multiple // valid instances of the same keyword) *save_pos = pos + key.size(); @@ -820,7 +820,7 @@ bool colvarparse::key_lookup(std::string const &conf, data_end) + 1; } - if (data != nullptr) { + if (data != NULL) { data->append(line, data_begin, (data_end-data_begin)); if (cvm::debug()) { @@ -834,7 +834,7 @@ bool colvarparse::key_lookup(std::string const &conf, } } - if (save_pos != nullptr) *save_pos = line_end; + if (save_pos != NULL) *save_pos = line_end; return true; } diff --git a/lib/colvars/colvarparse.h b/lib/colvars/colvarparse.h index fc1362b2b..b7d42fdff 100644 --- a/lib/colvars/colvarparse.h +++ b/lib/colvars/colvarparse.h @@ -275,12 +275,12 @@ public: /// The keyword that identifies the block std::string const key; - /// Where to keep the data (may be nullptr) + /// Where to keep the data (may be NULL) std::string * const data; public: - read_block(std::string const &key_in, std::string *data_in = nullptr); + read_block(std::string const &key_in, std::string *data_in = NULL); ~read_block(); @@ -300,8 +300,8 @@ public: /// within "conf", useful when doing multiple calls bool key_lookup(std::string const &conf, char const *key, - std::string *data = nullptr, - size_t *save_pos = nullptr); + std::string *data = NULL, + size_t *save_pos = NULL); /// \brief Reads a configuration line, adds it to config_string, and returns /// the stream \param is Input stream \param line String that will hold the diff --git a/lib/colvars/colvarproxy.cpp b/lib/colvars/colvarproxy.cpp index 7eb0b22cb..63ae07a57 100644 --- a/lib/colvars/colvarproxy.cpp +++ b/lib/colvars/colvarproxy.cpp @@ -296,7 +296,7 @@ void colvarproxy_atom_groups::clear_atom_group(int index) colvarproxy_smp::colvarproxy_smp() { b_smp_active = true; // May be disabled by user option - omp_lock_state = nullptr; + omp_lock_state = NULL; #if defined(_OPENMP) if (smp_thread_id() == 0) { omp_lock_state = reinterpret_cast(new omp_lock_t); @@ -459,7 +459,7 @@ int colvarproxy_smp::smp_unlock() colvarproxy_script::colvarproxy_script() { - script = nullptr; + script = NULL; } @@ -507,7 +507,7 @@ int colvarproxy_script::run_colvar_gradient_callback(std::string const & /* name colvarproxy_tcl::colvarproxy_tcl() { - tcl_interp_ = nullptr; + tcl_interp_ = NULL; } @@ -528,7 +528,7 @@ char const *colvarproxy_tcl::tcl_obj_to_str(unsigned char *obj) #if defined(COLVARS_TCL) return Tcl_GetString(reinterpret_cast(obj)); #else - return nullptr; + return NULL; #endif } @@ -666,7 +666,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, } std::ostream *os = get_output_stream(output_name); - if (os != nullptr) return os; + if (os != NULL) return os; if (!(mode & (std::ios_base::app | std::ios_base::ate))) { backup_file(output_name); @@ -675,7 +675,7 @@ std::ostream * colvarproxy_io::output_stream(std::string const &output_name, if (!osf->is_open()) { cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", FILE_ERROR); - return nullptr; + return NULL; } output_stream_names.push_back(output_name); output_files.push_back(osf); @@ -692,7 +692,7 @@ std::ostream *colvarproxy_io::get_output_stream(std::string const &output_name) return *osi; } } - return nullptr; + return NULL; } @@ -794,7 +794,7 @@ int colvarproxy_io::rename_file(char const *filename, char const *newfilename) colvarproxy::colvarproxy() { - colvars = nullptr; + colvars = NULL; b_simulation_running = true; b_delete_requested = false; } diff --git a/lib/colvars/colvarproxy.h b/lib/colvars/colvarproxy.h index a46589a52..ba91afb40 100644 --- a/lib/colvars/colvarproxy.h +++ b/lib/colvars/colvarproxy.h @@ -607,7 +607,7 @@ public: std::ios_base::openmode mode = std::ios_base::out); - /// Returns a reference to output_name if it exists, nullptr otherwise + /// Returns a reference to output_name if it exists, NULL otherwise virtual std::ostream *get_output_stream(std::string const &output_name); /// \brief Flushes the given output channel diff --git a/lib/colvars/colvarscript.cpp b/lib/colvars/colvarscript.cpp index a8b5d6ab2..10b276c89 100644 --- a/lib/colvars/colvarscript.cpp +++ b/lib/colvars/colvarscript.cpp @@ -97,7 +97,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvar *cv = cvm::colvar_by_name(name); - if (cv == nullptr) { + if (cv == NULL) { result = "Colvar not found: " + name; return COLVARSCRIPT_ERROR; } @@ -111,7 +111,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } std::string const name(obj_to_str(objv[2])); colvarbias *b = cvm::bias_by_name(name); - if (b == nullptr) { + if (b == NULL) { result = "Bias not found: " + name; return COLVARSCRIPT_ERROR; } @@ -186,7 +186,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) /// Parse config from string if (cmd == "config") { - return exec_command(cv_config, nullptr, objc, objv); + return exec_command(cv_config, NULL, objc, objv); } /// Load an input state file @@ -247,7 +247,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } else if (objc == 3) { // Failure of this function does not trigger an error, but // returns nonzero, to let scripts detect available frames - int error = proxy->set_frame(strtol(obj_to_str(objv[2]), nullptr, 10)); + int error = proxy->set_frame(strtol(obj_to_str(objv[2]), NULL, 10)); result = cvm::to_str(error == COLVARS_OK ? 0 : -1); return COLVARS_OK; } else { @@ -258,7 +258,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) if (cmd == "addenergy") { if (objc == 3) { - colvars->total_bias_energy += strtod(obj_to_str(objv[2]), nullptr); + colvars->total_bias_energy += strtod(obj_to_str(objv[2]), NULL); return COLVARS_OK; } else { result = "Wrong arguments to command \"addenergy\"\n" + help_string(); @@ -267,7 +267,7 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } if (cmd == "help") { - return exec_command(cv_help, nullptr, objc, objv); + return exec_command(cv_help, NULL, objc, objv); } result = "Syntax error\n" + help_string(); @@ -320,7 +320,7 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) // colvar destructor is tasked with the cleanup delete cv; // TODO this could be done by the destructors - if (colvars->cv_traj_os != nullptr) { + if (colvars->cv_traj_os != NULL) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -513,7 +513,7 @@ int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[] // the bias destructor takes care of the cleanup at cvm level delete b; // TODO this could be done by the destructors - if (colvars->cv_traj_os != nullptr) { + if (colvars->cv_traj_os != NULL) { colvars->write_traj_label(*(colvars->cv_traj_os)); } return COLVARS_OK; @@ -564,7 +564,7 @@ int colvarscript::proc_features(colvardeps *obj, if ((subcmd == "get") || (subcmd == "set")) { std::vector const &features = obj->features(); std::string const req_feature(obj_to_str(objv[3])); - colvardeps::feature *f = nullptr; + colvardeps::feature *f = NULL; int fid = 0; for (fid = 0; fid < int(features.size()); fid++) { if (features[fid]->description == @@ -574,7 +574,7 @@ int colvarscript::proc_features(colvardeps *obj, } } - if (f == nullptr) { + if (f == NULL) { result = "Error: feature \""+req_feature+"\" does not exist.\n"; return COLVARSCRIPT_ERROR; diff --git a/lib/colvars/colvarscript.h b/lib/colvars/colvarscript.h index 04679b37a..69d52cbb5 100644 --- a/lib/colvars/colvarscript.h +++ b/lib/colvars/colvarscript.h @@ -278,7 +278,7 @@ extern "C" { 1, 1, { "E (float) - Amount of energy to add" }, cvm::main()->total_bias_energy += - strtod(script->obj_to_str(objv[2]), nullptr); + strtod(script->obj_to_str(objv[2]), NULL); return COLVARS_OK; ) diff --git a/lib/colvars/colvartypes.h b/lib/colvars/colvartypes.h index 55401576b..e5f12154e 100644 --- a/lib/colvars/colvartypes.h +++ b/lib/colvars/colvartypes.h @@ -59,7 +59,7 @@ public: if (data.size() > 0) { return &(data[0]); } else { - return nullptr; + return NULL; } } @@ -520,7 +520,7 @@ public: if (rows.size() > 0) { return &(pointers[0]); } else { - return nullptr; + return NULL; } } diff --git a/lib/colvars/lepton/include/lepton/Operation.h b/lib/colvars/lepton/include/lepton/Operation.h index 68474137f..1ddde0b8c 100644 --- a/lib/colvars/lepton/include/lepton/Operation.h +++ b/lib/colvars/lepton/include/lepton/Operation.h @@ -186,7 +186,7 @@ public: } bool operator!=(const Operation& op) const { const Constant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -217,7 +217,7 @@ public: ExpressionTreeNode differentiate(const std::vector& children, const std::vector& childDerivs, const std::string& variable) const; bool operator!=(const Operation& op) const { const Variable* o = dynamic_cast(&op); - return (o == nullptr || o->name != name); + return (o == NULL || o->name != name); } private: std::string name; @@ -264,7 +264,7 @@ public: } bool operator!=(const Operation& op) const { const Custom* o = dynamic_cast(&op); - return (o == nullptr || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); + return (o == NULL || o->name != name || o->isDerivative != isDerivative || o->derivOrder != derivOrder); } private: std::string name; @@ -955,7 +955,7 @@ public: } bool operator!=(const Operation& op) const { const AddConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -988,7 +988,7 @@ public: } bool operator!=(const Operation& op) const { const MultiplyConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } private: double value; @@ -1042,7 +1042,7 @@ public: } bool operator!=(const Operation& op) const { const PowerConstant* o = dynamic_cast(&op); - return (o == nullptr || o->value != value); + return (o == NULL || o->value != value); } bool isInfixOperator() const { return true; diff --git a/lib/colvars/lepton/src/CompiledExpression.cpp b/lib/colvars/lepton/src/CompiledExpression.cpp index 6abcad2de..1ad348b47 100644 --- a/lib/colvars/lepton/src/CompiledExpression.cpp +++ b/lib/colvars/lepton/src/CompiledExpression.cpp @@ -40,10 +40,10 @@ using namespace std; using namespace asmjit; #endif -CompiledExpression::CompiledExpression() : jitCode(nullptr) { +CompiledExpression::CompiledExpression() : jitCode(NULL) { } -CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(nullptr) { +CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jitCode(NULL) { ParsedExpression expr = expression.optimize(); // Just in case it wasn't already optimized. vector > temps; compileExpression(expr.getRootNode(), temps); @@ -59,11 +59,11 @@ CompiledExpression::CompiledExpression(const ParsedExpression& expression) : jit CompiledExpression::~CompiledExpression() { for (int i = 0; i < (int) operation.size(); i++) - if (operation[i] != nullptr) + if (operation[i] != NULL) delete operation[i]; } -CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(nullptr) { +CompiledExpression::CompiledExpression(const CompiledExpression& expression) : jitCode(NULL) { *this = expression; } diff --git a/lib/colvars/lepton/src/ExpressionTreeNode.cpp b/lib/colvars/lepton/src/ExpressionTreeNode.cpp index 09c5352d2..851987826 100644 --- a/lib/colvars/lepton/src/ExpressionTreeNode.cpp +++ b/lib/colvars/lepton/src/ExpressionTreeNode.cpp @@ -59,14 +59,14 @@ ExpressionTreeNode::ExpressionTreeNode(Operation* operation) : operation(operati throw Exception("wrong number of arguments to function: "+operation->getName()); } -ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == nullptr ? nullptr : node.operation->clone()), children(node.getChildren()) { +ExpressionTreeNode::ExpressionTreeNode(const ExpressionTreeNode& node) : operation(node.operation == NULL ? NULL : node.operation->clone()), children(node.getChildren()) { } -ExpressionTreeNode::ExpressionTreeNode() : operation(nullptr) { +ExpressionTreeNode::ExpressionTreeNode() : operation(NULL) { } ExpressionTreeNode::~ExpressionTreeNode() { - if (operation != nullptr) + if (operation != NULL) delete operation; } @@ -91,7 +91,7 @@ bool ExpressionTreeNode::operator==(const ExpressionTreeNode& node) const { } ExpressionTreeNode& ExpressionTreeNode::operator=(const ExpressionTreeNode& node) { - if (operation != nullptr) + if (operation != NULL) delete operation; operation = node.getOperation().clone(); children = node.getChildren(); diff --git a/lib/colvars/lepton/src/ParsedExpression.cpp b/lib/colvars/lepton/src/ParsedExpression.cpp index c25975634..fd3b091d3 100644 --- a/lib/colvars/lepton/src/ParsedExpression.cpp +++ b/lib/colvars/lepton/src/ParsedExpression.cpp @@ -46,7 +46,7 @@ ParsedExpression::ParsedExpression(const ExpressionTreeNode& rootNode) : rootNod } const ExpressionTreeNode& ParsedExpression::getRootNode() const { - if (&rootNode.getOperation() == nullptr) + if (&rootNode.getOperation() == NULL) throw Exception("Illegal call to an initialized ParsedExpression"); return rootNode; } diff --git a/lib/kokkos/cmake/compile_tests/pthread.cpp b/lib/kokkos/cmake/compile_tests/pthread.cpp index 7fa98611b..92310da02 100644 --- a/lib/kokkos/cmake/compile_tests/pthread.cpp +++ b/lib/kokkos/cmake/compile_tests/pthread.cpp @@ -4,11 +4,11 @@ void* kokkos_test(void* args) { return args; } int main(void) { pthread_t thread; - /* Use nullptr to avoid C++11. Some compilers + /* Use NULL to avoid C++11. Some compilers do not have C++11 by default. Forcing C++11 in the compile tests can be done, but is unnecessary */ - pthread_create(&thread, nullptr, kokkos_test, nullptr); - pthread_join(thread, nullptr); + pthread_create(&thread, NULL, kokkos_test, NULL); + pthread_join(thread, NULL); return 0; } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index d4db2c538..a97fb2f7c 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -640,7 +640,7 @@ void SharedAllocationRecord:: /*--------------------------------------------------------------------------*/ void* hip_resize_scratch_space(size_t bytes, bool force_shrink) { - static void* ptr = nullptr; + static void* ptr = NULL; static size_t current_size = 0; if (current_size == 0) { current_size = bytes; diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index 613793fc6..fad36c02f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -139,7 +139,7 @@ void *HBWSpace::allocate(const char *arg_label, const size_t arg_alloc_size, } msg << " ]( " << arg_alloc_size << " ) FAILED"; if (ptr == nullptr) { - msg << " NULL"; + msg << " nullptr"; } else { msg << " NOT ALIGNED " << ptr; } diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index 2b11adbf6..a9a277881 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -215,7 +215,7 @@ SharedAllocationRecord::SharedAllocationRecord( } else { Kokkos::Impl::throw_runtime_exception( - "Kokkos::Impl::SharedAllocationRecord given NULL allocation"); + "Kokkos::Impl::SharedAllocationRecord given nullptr allocation"); } } diff --git a/lib/kokkos/core/unit_test/TestCTestDevice.cpp b/lib/kokkos/core/unit_test/TestCTestDevice.cpp index c54c75f94..b2ee79b85 100644 --- a/lib/kokkos/core/unit_test/TestCTestDevice.cpp +++ b/lib/kokkos/core/unit_test/TestCTestDevice.cpp @@ -13,7 +13,7 @@ int setenv(const char *name, const char *value, int overwrite) { int errcode = 0; if (!overwrite) { size_t envsize = 0; - errcode = getenv_s(&envsize, nullptr, 0, name); + errcode = getenv_s(&envsize, NULL, 0, name); if (errcode || envsize) return errcode; } return _putenv_s(name, value); -- GitLab From ed57554e186af6b3f0392fdbc2e617ee735b59be Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 09:54:15 -0600 Subject: [PATCH 29/52] T2345: Replace instances of NULL with nullptr revert lib/poems to remove nullptr changes. Walking back changes to lib as needed. --- lib/poems/SystemProcessor.h | 30 +++++++++--------- lib/poems/poemsnodelib.h | 20 ++++++------ lib/poems/poemstree.h | 62 ++++++++++++++++++------------------- lib/poems/poemstreenode.cpp | 2 +- lib/poems/poemstreenode.h | 2 +- lib/poems/solver.cpp | 2 +- lib/poems/system.cpp | 10 +++--- lib/poems/workspace.cpp | 6 ++-- 8 files changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index c1c45a86a..4fc8785dd 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != nullptr) + if(currentNode != NULL) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != nullptr); //repeat this until all chains have been added + while(currentNode != NULL); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null + if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null { - return nullptr; + return NULL; } int * tmp; - POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = nullptr; //temporary variable to hold data - while(tempNode != nullptr) //when we have followed all links, stop + POEMSChain * tempChain = NULL; //temporary variable to hold data + while(tempNode != NULL) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == nullptr) + if(aNode == NULL) { - return nullptr; + return NULL; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == nullptr) //and if we find nothing... + if(returnVal == NULL) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == nullptr) //if we could not find any chains + if(returnVal == NULL) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be nullptr if no new chains are + return returnVal; //return what we find (will be NULL if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists + while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list + while(tmp->value != NULL || tmp2->value != NULL) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 04f0f4b79..446fa2013 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); +TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != nullptr) + if (t != NULL) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != nullptr) + if (t != NULL) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value nullptr +// The pointers have default value NULL TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == nullptr) + if (p == NULL) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=nullptr) + if(t !=NULL) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == nullptr && t->Right() == nullptr) + if (t->Left() == NULL && t->Right() == NULL) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == nullptr) + if (t == NULL) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=nullptr - if (t != nullptr) + //print tree with root t, as long as t!=NULL + if (t != NULL) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index 14f5fd400..ee07a3325 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = nullptr); + void Insert(const int& item, const int& data, void * AuxData = NULL); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = nullptr; + DeleteAuxData = NULL; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return nullptr +// address and a pointer to its parent; otherwise, return NULL TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is nullptr - parent = nullptr; + // the parent of the root is NULL + parent = NULL; // terminate on empty subtree - while(t != nullptr) + while(t != NULL) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; nullptr if not found + // return pointer to node; NULL if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != nullptr) + if (current != NULL) { item = current->data; return current->GetAuxData(); } else // item not found in the tree. return False - return nullptr; + return NULL; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,nullptr,nullptr); + newNode = GetTreeNode(item,NULL,NULL); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == nullptr) + if (tree == NULL) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) + if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) return; - // If D has nullptr pointer, the + // If D has NULL pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == nullptr) + if (DNodePtr->right == NULL) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == nullptr) + else if (DNodePtr->left == NULL) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-nullptr + // Both pointers of DNodePtr are non-NULL else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != nullptr) + while (RNodePtr->right != NULL) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == nullptr) + if (PNodePtr == NULL) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=nullptr && current->data == item) + if (current !=NULL && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == nullptr) - return nullptr; + if (t == NULL) + return NULL; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns nullptr. + // present it makes a copy of left child or returns NULL. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=nullptr) + if (t->Left() !=NULL) newlptr = CopyTree(t->Left()); else - newlptr = nullptr; + newlptr = NULL; - if (t->Right() !=nullptr) + if (t->Right() !=NULL) newrptr = CopyTree(t->Right()); else - newrptr = nullptr; + newrptr = NULL; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != nullptr) { + if (t != NULL) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != nullptr) { - if (DeleteAuxData != nullptr) { + if (aux != NULL) { + if (DeleteAuxData != NULL) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to nullptr +// set the root pointer back to NULL void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = nullptr; // root now nullptr + t = NULL; // root now NULL } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 52905fc40..051e13d6e 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value nullptr assigns a empty subtree +// The pointer value NULL assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/poemstreenode.h b/lib/poems/poemstreenode.h index e5673344a..a1835ba02 100644 --- a/lib/poems/poemstreenode.h +++ b/lib/poems/poemstreenode.h @@ -18,7 +18,7 @@ #ifndef TREENODE_H #define TREENODE_H -//#define nullptr 0 +//#define NULL 0 //Tree depends on TreeNode diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 7b1e718b9..67f5b607e 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return nullptr; + default: return NULL; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 23554f411..369213f7d 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = nullptr; + mappings = NULL; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = nullptr; + Body* body = NULL; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = nullptr; + Point* point_ch = NULL; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = nullptr; + Body* body = NULL; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = nullptr; + Point* point_ch = NULL; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 21819d4c0..2b3257b0d 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = nullptr; + system = NULL; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != nullptr) { + while(NodeValue != NULL) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return nullptr; + return NULL; } } -- GitLab From 96b01f2383a9d5571b7319f81c35eedda07f7c0e Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 10:24:51 -0600 Subject: [PATCH 30/52] T2345: Walking back nullptr changes to lib/awpmd --- lib/awpmd/ivutils/include/logexc.h | 8 +++--- lib/awpmd/ivutils/include/pairhash.h | 28 +++++++++---------- lib/awpmd/ivutils/include/refobj.h | 20 ++++++------- lib/awpmd/ivutils/include/vector_3.h | 14 +++++----- lib/awpmd/ivutils/src/logexc.cpp | 2 +- lib/awpmd/systems/interact/TCP/wpmd.h | 20 ++++++------- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 4 +-- lib/awpmd/systems/interact/TCP/wpmd_split.h | 16 +++++------ 8 files changed, 56 insertions(+), 56 deletions(-) diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 2eebfcc0c..7bf6125bc 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(nullptr),next(nullptr){ + :descriptor(descriptor_),prev(NULL),next(NULL){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=nullptr; - prev=nullptr; + glogp->next=NULL; + prev=NULL; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ set_out(out); set_err(err); } diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index 0f79fc418..c29f72773 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(nullptr),incr(0){} + iterator():ptr(NULL),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(nullptr,1) { + recmatrix(): parr(NULL,1) { sizey=sizex=0; - arr=nullptr; + arr=NULL; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(nullptr,0); + parr.reset(NULL,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(nullptr),incr(0){} + iterator():ptr(NULL),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(nullptr,1) { + sqmatrix(): parr(NULL,1) { size=0; - arr=nullptr; + arr=NULL; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ + sqmatrix(const sqmatrix &other):size(0),arr(NULL){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(nullptr,0); + parr.reset(NULL,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not nullptr, puts the found value there - virtual int Find(long i, long j, T *retval=nullptr)=0; - virtual int Find(long i, long j, T **retval=nullptr)=0; + //e if retval is not NULL, puts the found value there + virtual int Find(long i, long j, T *retval=NULL)=0; + virtual int Find(long i, long j, T **retval=NULL)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=nullptr){ + int Find(long i, long j, T *retval=NULL){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index 8e5fc7df4..a1a4feb0f 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=nullptr, int managed=0){ + void reset(T* ptr=NULL, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==nullptr than p is not managed (as in mngptr) + int *num; //if num==NULL than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=nullptr; + else num=NULL; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=nullptr; + else num=NULL; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=nullptr; + else num=NULL; } public: - shptr(T* p=nullptr, int managed=1){ + shptr(T* p=NULL, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=nullptr; + num=NULL; } - p=nullptr; + p=NULL; } } bool valid() const { - return p!=nullptr; + return p!=NULL; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 534cea44a..468abbda9 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=nullptr) const { + T maxcoord(int *ind=NULL) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index 6e809dd65..7e82af0f6 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,7 +13,7 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=nullptr; +message_logger *message_logger::glogp=NULL; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); const char *logfmt(const char *format,...){ diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index 4c6544001..e118b76f3 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -255,7 +255,7 @@ public: } //e Create NormDeriv object and calculate the derivatived for the given WP - void set2(const WavePacket& w2_, const cdouble *I0_=nullptr){ + void set2(const WavePacket& w2_, const cdouble *I0_=NULL){ w2=w2_; d2.set(w2); w12=conj(w1)*w2; @@ -558,13 +558,13 @@ public: //e if PBCs are used, the corresponding coordinates of electrons and ions //e in periodic directions must be within the range [0, cell[per_dir]) //e @returns 1 if OK - int set_pbc(const Vector_3P pcell=nullptr, int pbc_=0x7); + int set_pbc(const Vector_3P pcell=NULL, int pbc_=0x7); ///\en Setup electrons: forms internal wave packet representations. /// If PBCs are used the coords must be within a range [0, cell). /// Default electron mass is AWPMD::me. - /// Default (q=nullptr )electron charges are -1. - int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=nullptr); + /// Default (q=NULL )electron charges are -1. + int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=NULL); //e setup ion charges and coordinates //e if PBCs are used the coords must be within a range [0, cell) @@ -593,16 +593,16 @@ public: // 0x2 -- add ion forces to the existing set // 0x4 -- calculate derivatives for electronic time step (NOT IMPLEMENTED) //e if PBCs are used the coords must be within a range [0, cell) - virtual int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + virtual int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); //e same as interaction, but using Hartee factorization (no antisymmetrization) - virtual int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + virtual int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Calculates ion-ion interactions and updates Eii and ion forces if requested. This function /// is called form intaraction() and interaction_hartree if calc_ii is set. - virtual int interaction_ii(int flag,Vector_3P fi=nullptr); + virtual int interaction_ii(int flag,Vector_3P fi=NULL); //e Calculates Norm matrix //e The result is saved in AWPMD::Norm[s] @@ -643,7 +643,7 @@ public: ///\en Prepares force arrays according to \a flag setting for interaction() virtual void clear_forces(int flagi,Vector_3P fi, Vector_3P fe_x, - Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=nullptr); + Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=NULL); ///\en Creates wave packet according to the given physical parameters. diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 55105066d..2c58bdaf2 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -312,7 +312,7 @@ void AWPMD_split::clear_forces(int flag,Vector_3P fi, Vector_3P fe_x, void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ if(flag&0x4) //need to replace the forces - clear_forces(0x4,nullptr,fe_x,fe_p,fe_w,fe_pw,fe_c); + clear_forces(0x4,NULL,fe_x,fe_p,fe_w,fe_pw,fe_c); // recalculating derivatives if(flag&(0x8|0x4)){ //electron forces needed @@ -622,7 +622,7 @@ void AWPMD_split::y_deriv(cdouble v,int s,int c2, int c1){ /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n -/// will not update electronic force arrays, which may be nullptr, \n +/// will not update electronic force arrays, which may be NULL, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.h b/lib/awpmd/systems/interact/TCP/wpmd_split.h index 0ffef2645..44fb75757 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.h +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.h @@ -116,8 +116,8 @@ public: /// \a n is the number of electrons of a given spin component /// Electron velocity v is multiplied by mass to obtain momentum. /// Default mass (-1) means me. - /// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split - int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr); + /// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split + int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL); ///\en Starts adding new electron: continue with \ref add_split functions. @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be nullptr, \n + /// will not update electronic force arrays, which may be NULL, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, - Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); + int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, + Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n -- GitLab From 96f0e7e0d07dfa0045b5cf253c617c7d35770efe Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Fri, 11 Sep 2020 10:48:48 -0600 Subject: [PATCH 31/52] T2345: Walking back nullptr changes in #defines in STUBS/mpi.h --- src/STUBS/mpi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 5df63682b..063dc542b 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -50,7 +50,7 @@ extern "C" { #define MPI_GROUP_EMPTY -1 #define MPI_ANY_SOURCE -1 -#define MPI_STATUS_IGNORE nullptr +#define MPI_STATUS_IGNORE NULL #define MPI_Comm int #define MPI_Request int @@ -60,7 +60,7 @@ extern "C" { #define MPI_Group int #define MPI_Offset long -#define MPI_IN_PLACE nullptr +#define MPI_IN_PLACE NULL #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 -- GitLab From a57a5c76a5be1b35a8634b5e58d8fbe0a701332a Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Sat, 12 Sep 2020 09:02:31 -0600 Subject: [PATCH 32/52] T2345: After examining comments changed by batch conversion of NULL to nullptr, I've corrected a small number where it seemed clear that the previous NULL should have been either "NULL" (where the code is looking for a string with that value), or null char / null byte (where the comment is talking about the char/byte that terminates a c-style string). Also changed 6 places where the batch change had changed 'NULL ptr' to 'nullptr ptr'. Now they simply say 'nullptr'. --- src/GPU/pair_eam_alloy_gpu.cpp | 2 +- src/GPU/pair_eam_fs_gpu.cpp | 2 +- src/KOKKOS/pair_eam_alloy_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_fs_kokkos.cpp | 2 +- src/MANYBODY/pair_adp.cpp | 2 +- src/MANYBODY/pair_airebo.cpp | 2 +- src/MANYBODY/pair_airebo.h | 2 +- src/MANYBODY/pair_comb.cpp | 2 +- src/MANYBODY/pair_comb3.cpp | 2 +- src/MANYBODY/pair_eam_alloy.cpp | 2 +- src/MANYBODY/pair_eam_fs.cpp | 2 +- src/MANYBODY/pair_eim.cpp | 2 +- src/MANYBODY/pair_gw.cpp | 2 +- src/MANYBODY/pair_lcbop.cpp | 4 ++-- src/MANYBODY/pair_lcbop.h | 2 +- src/MANYBODY/pair_nb3b_harmonic.cpp | 2 +- src/MANYBODY/pair_polymorphic.cpp | 2 +- src/MANYBODY/pair_sw.cpp | 2 +- src/MANYBODY/pair_tersoff.cpp | 2 +- src/MANYBODY/pair_vashishta.cpp | 2 +- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-INTEL/pair_eam_alloy_intel.cpp | 2 +- src/USER-INTEL/pair_eam_fs_intel.cpp | 2 +- src/USER-MEAMC/pair_meamc.cpp | 2 +- src/USER-MISC/pair_agni.cpp | 2 +- src/USER-MISC/pair_drip.cpp | 2 +- src/USER-MISC/pair_edip.cpp | 2 +- src/USER-MISC/pair_edip_multi.cpp | 2 +- src/USER-MISC/pair_extep.cpp | 2 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 2 +- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 2 +- src/USER-MISC/pair_kolmogorov_crespi_z.cpp | 2 +- src/USER-MISC/pair_lebedeva_z.cpp | 2 +- src/USER-MISC/pair_meam_spline.cpp | 2 +- src/USER-MISC/pair_meam_sw_spline.cpp | 2 +- src/USER-MISC/pair_tersoff_table.cpp | 2 +- src/USER-OMP/pair_eam_alloy_omp.cpp | 2 +- src/USER-OMP/pair_eam_fs_omp.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 2 +- src/USER-SMTBQ/pair_smtbq.cpp | 2 +- src/atom.cpp | 4 ++-- src/fix_spring_rg.cpp | 2 +- src/input.cpp | 12 ++++++------ src/pair_coul_streitz.cpp | 2 +- src/read_dump.cpp | 8 ++++---- src/run.cpp | 2 +- 46 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 9dd5c85c4..998ca9293 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index 10f6b4ebe..5559bb470 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 4e0c44acb..52882c8be 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMAlloyKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index 2714da9ca..d697cfbe9 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -938,7 +938,7 @@ void PairEAMFSKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index 4eeab8938..3b98c91cb 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 8643f5481..eb92e0c58 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to C and H - // map[i] = which element (0,1) the Ith atom type is, -1 if nullptr + // map[i] = which element (0,1) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index d605ddc2d..7539cc5e7 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -40,7 +40,7 @@ class PairAIREBO : public Pair { enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code protected: - int *map; // 0 (C), 1 (H), or -1 (nullptr) for each type + int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type int variant; int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 0e2ac8dac..95b49b98f 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -456,7 +456,7 @@ void PairComb::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index fd4f1b382..01a1538f7 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -192,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index 055a2baf1..f17d500a4 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -70,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index 90c24bb25..1c055e1bc 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -70,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index 69e2832b3..8f229060c 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -388,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg) read_file(arg[2+nelements]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3 + nelements; i < narg; i++) { m = i - (3+nelements) + 1; diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index dd9b55b7b..6a97975d4 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index c84361d7a..760ffc8cd 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg) if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // read args that map atom types to C and nullptr - // map[i] = which element (0 for C) the Ith atom type is, -1 if nullptr + // read args that map atom types to C and "NULL" + // map[i] = which element (0 for C) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index 9ca2e3d55..dacbe7415 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -39,7 +39,7 @@ class PairLCBOP : public Pair { protected: int **pages; // neighbor list pages - int *map; // 0 (C) or -1 (nullptr) for each type + int *map; // 0 (C) or -1 ("NULL") for each type int me; diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index a361955fa..859652dd1 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index cdf9a7f23..99eb2fec5 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -479,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 9db9adf42..b74eda0f8 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -262,7 +262,7 @@ void PairSW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index 21a8f7de6..b8379d15c 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -306,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index fea414f5f..10ac2c418 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index eaa0d272c..57162df24 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -961,7 +961,7 @@ void FixColvars::write_restart(FILE *fp) proxy->serialize_status(rest_text); // TODO call write_output_files() const char *cvm_state = rest_text.c_str(); - int len = strlen(cvm_state) + 1; // need to include terminating nullptr byte. + int len = strlen(cvm_state) + 1; // need to include terminating null byte. fwrite(&len,sizeof(int),1,fp); fwrite(cvm_state,1,len,fp); } diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index b93c9bc8c..b78baf896 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index 2165f10af..84cfcb8a1 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -69,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 133bb611c..4c4a3dcf6 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -556,7 +556,7 @@ void PairMEAMC::read_files(const std::string &globalfile, delete [] rozero; delete [] found; - // done if user param file is nullptr + // done if user param file is "NULL" if (userfile == "NULL") return; diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index afd600594..0361942af 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -266,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 449cf8669..b5b39a65a 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 31dda8bb0..62d09e0c4 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 1a5d4925d..07245b172 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index 6d9f74de8..d8fa565ae 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index f0c197ca3..63ba47448 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index c30899083..0804f42b8 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 80f57fb5d..617a48c0f 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -232,7 +232,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index cb65dc85f..3168a35ab 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -228,7 +228,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index 455a21ada..3be2a3858 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 0013fa557..a8977a09d 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index 6e0cacaff..bc6be2d39 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index 9a797dafa..2f29aced6 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -69,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index d474e039b..a7fd0cac5 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -69,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 6a2ba7d75..fd97a2635 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args ) } // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" int itmp = 0; int nreax_types = system->reax_param.num_atom_types; diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index a40f676ff..d84f30230 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/atom.cpp b/src/atom.cpp index a58e1e318..539bf6fc0 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find nullptr ptr: + // if find nullptr: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find nullptr ptr: + // if don't find nullptr: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 280539505..6cd8637a5 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -67,7 +67,7 @@ void FixSpringRG::init() { masstotal = group->mass(igroup); - // if rg0 was specified as nullptr, compute current Rg + // Compute current Rg // only occurs on 1st run if (rg0_flag) { diff --git a/src/input.cpp b/src/input.cpp index 5efbdfba3..5e40d2ded 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -467,10 +467,10 @@ char *Input::nextword(char *str, char **next) // start = first char beyond quote // stop = first char of matching quote // next = first char beyond matching quote - // next must be nullptr or whitespace + // next must be null char or whitespace // if start is not single/double/triple quote: // stop = first whitespace char after start - // next = char after stop, or stop itself if stop is nullptr + // next = char after stop, or stop itself if stop is null char if (strstr(start,"\"\"\"") == start) { stop = strstr(&start[3],"\"\"\""); @@ -492,7 +492,7 @@ char *Input::nextword(char *str, char **next) else *next = stop+1; } - // set stop to nullptr to terminate word + // set stop to null char to terminate word *stop = '\0'; return start; @@ -510,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) // use str2 as scratch space to expand str, then copy back to str // reallocate str and str2 as necessary // do not replace $ inside single/double/triple quotes - // var = pts at variable name, ended by nullptr - // if $ is followed by '{', trailing '}' becomes nullptr - // else $x becomes x followed by nullptr + // var = pts at variable name, ended by null char + // if $ is followed by '{', trailing '}' becomes null char + // else $x becomes x followed by null char // beyond = points to text following variable int i,n,paren_count; diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 6ff958483..101aaf36a 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if nullptr + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 2fd14b547..dcbb95fcc 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr ptr + maxnew = MAX(nnew,1); // avoid nullptr memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid nullptr ptr + newmaxnew = MAX(newmaxnew,1); // avoid nullptr memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); diff --git a/src/run.cpp b/src/run.cpp index f5b571844..2e55fba43 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -91,7 +91,7 @@ void Run::command(int narg, char **arg) // all remaining args are commands // first,last = arg index of first/last commands - // set ncommands = 0 if single command and it is nullptr + // set ncommands = 0 if single command and it is "NULL" } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); -- GitLab From ec1fe4e445b777138a1778a9a2a2e5861c2c5120 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 14:04:23 -0400 Subject: [PATCH 33/52] update molfile plugin headers with latest versions from VMD --- lib/molfile/molfile_plugin.h | 127 +++++++++++++++++++++++++++++------ lib/molfile/vmdplugin.h | 4 +- 2 files changed, 109 insertions(+), 22 deletions(-) diff --git a/lib/molfile/molfile_plugin.h b/lib/molfile/molfile_plugin.h index 2b7c57b84..491cd375b 100644 --- a/lib/molfile/molfile_plugin.h +++ b/lib/molfile/molfile_plugin.h @@ -11,7 +11,7 @@ * * $RCSfile: molfile_plugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.108 $ $Date: 2016/02/26 03:17:01 $ + * $Revision: 1.112 $ $Date: 2019/10/17 06:12:24 $ * ***************************************************************************/ @@ -111,7 +111,7 @@ typedef struct { char resname[8]; /**< required residue name string */ int resid; /**< required integer residue ID */ char segid[8]; /**< required segment name string, or "" */ -#if 0 && vmdplugin_ABIVERSION > 17 +#if 0 && vmdplugin_ABIVERSION > 10000 /* The new PDB file formats allows for much larger structures, */ /* which can therefore require longer chain ID strings. The */ /* new PDBx/mmCIF file formats do not have length limits on */ @@ -187,13 +187,58 @@ typedef struct molfile_timestep_metadata { int has_velocities; /**< if timesteps have velocities */ } molfile_timestep_metadata_t; + /* - * Per-timestep atom coordinates and periodic cell information + * + * Per-timestep atom coordinates, velocities, forces, energies, + * and periodic cell information + * + */ + +#if 0 +/** + * Periodically stored energies of various kinds + */ +typedef struct { + int energyflags; // XXX indicate use and semantics of data fields + + double total_energy; // XXX these copied from DESRES_READ_TIMESTEP2 case + double potential_energy; + double kinetic_energy; + double extended_energy; + double force_energy; + double total_pressure; + + // Alchemical free energy methods need to store individual energy samples. + // We don't really want pre-averaged quantities, they lead to problems later. + double lambda; // data gen sim parm: + aux scheduling + soft core parm + double temperature; // temp set by thermostat + // either we use deltaU, or we store U and Uprime... + double deltaU; // Ulambda - Ulambdaprime + double Ulambda; // U for lambda + double Ulambdaprime; // U for lambdaprime + + // IDWS methods + // XXX both values of lambdaprime and required de-interleaving information + + // Replica exchange methods + // XXX rectangle sample params? + + // REST2 method + // XXX + +} molfile_energies_t; +#endif + + +/** + * Per-timestep atom coordinates, velocities, time, energies + * and periodic cell info */ typedef struct { float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */ float *velocities; /**< space for velocities of all atoms; same layout */ - /**< nullptr unless has_velocities is set */ + /**< NULL unless has_velocities is set */ /*@{*/ /** @@ -517,7 +562,7 @@ typedef struct { * form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */ float *orbital_energies; /**< list of orbital energies for wavefunction */ float *occupancies; /**< orbital occupancies */ - int *orbital_ids; /**< orbital ID numbers; If nullptr then VMD will + int *orbital_ids; /**< orbital ID numbers; If NULL then VMD will * assume 1,2,3,...num_orbs. */ } molfile_qm_wavefunction_t; @@ -588,7 +633,7 @@ color r, g, b /** - * Main file reader API. Any function in this struct may be nullptr + * Main file reader API. Any function in this struct may be NULL * if not implemented by the plugin; the application checks this to determine * what functionality is present in the plugin. */ @@ -599,7 +644,7 @@ typedef struct { vmdplugin_HEAD /** - * Filename extension for this file type. May be nullptr if no filename + * Filename extension for this file type. May be NULL if no filename * extension exists and/or is known. For file types that match several * common extensions, list them in a comma separated list such as: * "pdb,ent,foo,bar,baz,ban" @@ -611,7 +656,7 @@ typedef struct { const char *filename_extension; /** - * Try to open the file for reading. Return an opaque handle, or nullptr on + * Try to open the file for reading. Return an opaque handle, or NULL on * failure. Set the number of atoms; if the number of atoms cannot be * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. * Filetype should be the name under which this plugin was registered; @@ -638,20 +683,20 @@ typedef struct { * the caller. * If the plugin provides bond information, but the file loaded doesn't * actually contain any bond info, the nbonds parameter should be - * set to 0 and from/to should be set to nullptr to indicate that no bond + * set to 0 and from/to should be set to NULL to indicate that no bond * information was actually present, and automatic bond search should be * performed. * * If the plugin provides bond order information, the bondorder array * will contain the bond order for each from/to pair. If not, the bondorder - * pointer should be set to nullptr, in which case the caller will provide a + * pointer should be set to NULL, in which case the caller will provide a * default bond order value of 1.0. * * If the plugin provides bond type information, the bondtype array * will contain the bond type index for each from/to pair. These numbers * are consecutive integers starting from 0. * the bondtypenames list, contains the corresponding names, if available, - * as a nullptr string terminated list. nbondtypes is provided for convenience + * as a NULL string terminated list. nbondtypes is provided for convenience * and consistency checking. * * These arrays must be freed by the plugin in the close_file_read function. @@ -662,11 +707,11 @@ typedef struct { int **bondtype, int *nbondtypes, char ***bondtypename); /** - * XXX this function will be augmented and possibly superseded by a + * XXX this function will be augmented and possibly superceded by a * new QM-capable version named read_timestep(), when finished. * * Read the next timestep from the file. Return MOLFILE_SUCCESS, or - * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is nullptr, then + * MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then * the frame should be skipped. Otherwise, the application must prepare * molfile_timestep_t by allocating space in coords for the corresponding * number of coordinates. @@ -684,7 +729,7 @@ typedef struct { /** * Open a coordinate file for writing using the given header information. - * Return an opaque handle, or nullptr on failure. The application must + * Return an opaque handle, or NULL on failure. The application must * specify the number of atoms to be written. * filetype should be the name under which this plugin was registered. */ @@ -757,7 +802,7 @@ typedef struct { * from/to and to/from versions of each. * This function must be called before write_structure(). * - * Like the read_bonds() routine, the bondorder pointer is set to nullptr + * Like the read_bonds() routine, the bondorder pointer is set to NULL * if the caller doesn't have such information, in which case the * plugin should assume a bond order of 1.0 if the file format requires * bond order information. @@ -767,7 +812,7 @@ typedef struct { * index (consecutive integers starting from 0) and bondtypenames * contain the corresponding strings, in case the naming/numbering * scheme is different from the index numbers. - * if the pointers are set to nullptr, then this information is not available. + * if the pointers are set to NULL, then this information is not available. * bondtypenames can only be used of bondtypes is also given. * Return MOLFILE_SUCCESS if no errors occur. */ @@ -839,16 +884,39 @@ typedef struct { int (* read_qm_rundata)(void *, molfile_qm_t *qmdata); + /** + * Query the molfile plugin to determine whether or not memory + * allocations used for atomic coordinates and PBC unit cell information + * need to be aligned to a particular virtual memory or filesystem + * page size boundary to facilitate kernel-bypass unbuffered I/O, + * e.g., as used by jsplugin. This API should be called prior to the + * first call to read a timestep. The required page alignment size + * (in bytes) is returned to the caller. If this API has not been + * called, then the molfile plugin should revert to standard + * kernel-buffered I/O and suffer the associated performance loss. + * The caller can be assured that the plugin will not request any + * page alignment size that is greater than the value of + * MOLFILE_DIRECTIO_MAX_BLOCK_SIZE, both as a runtime sanity check, + * and to ensure that a caller that is unable to perform the max + * aligned allocation doesn't call the API in the first place. + * If a page-aligned allocation is not required for the file being read, + * the plugin will return an alignment size of 1. + */ +#if vmdplugin_ABIVERSION > 17 + int (* read_timestep_pagealign_size)(void *, int *pagealignsize); +#endif + + /** * Read the next timestep from the file. Return MOLFILE_SUCCESS, or * MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t - * arguments are nullptr, then the coordinate or qm data should be skipped. + * arguments are NULL, then the coordinate or qm data should be skipped. * Otherwise, the application must prepare molfile_timestep_t and * molfile_qm_timestep_t by allocating space for the corresponding * number of coordinates, orbital wavefunction coefficients, etc. * Since it is common for users to want to load only the final timestep * data from a QM run, the application may provide any combination of - * valid, or nullptr pointers for the molfile_timestep_t and + * valid, or NULL pointers for the molfile_timestep_t and * molfile_qm_timestep_t parameters, depending on what information the * user is interested in. * The natoms and qm metadata parameters exist because some file formats @@ -862,6 +930,25 @@ typedef struct { int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *); int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *); + +#if defined(EXPERIMENTAL_DIRECTIO_APIS) + /** + * Calculate file offsets and I/O lengths for performing + * kernel-bypass direct I/O or using GPU-Direct Storage APIs, + * thereby enabling peak I/O rates to be achieved for analysis + * worksloads like clustering of trajectories. + */ + int (* calc_fileoffsets_timestep)(void *, + molfile_ssize_t frameindex, + int firstatom, + int lastatom, + int *firstatom, + int *pageoffset, + molfile_ssize_t *startoffset, + molfile_ssize_t *readlen); +#endif + + #if defined(DESRES_READ_TIMESTEP2) /** * Read a specified timestep! @@ -886,9 +973,9 @@ typedef struct { * caller the ability to prioritize, buffer, and redirect console messages * to an appropriate output channel, window, etc. This enables the use of * graphical consoles like TkCon without losing console output from plugins. - * If the function pointer is nullptr, no console output service is provided + * If the function pointer is NULL, no console output service is provided * by the calling application, and the output should default to stdout - * stream. If the function pointer is non-nullptr, all output will be + * stream. If the function pointer is non-NULL, all output will be * subsequently dealt with by the calling application. * * XXX this should really be put into a separate block of diff --git a/lib/molfile/vmdplugin.h b/lib/molfile/vmdplugin.h index 842d1e431..7afc358e9 100644 --- a/lib/molfile/vmdplugin.h +++ b/lib/molfile/vmdplugin.h @@ -11,7 +11,7 @@ * * $RCSfile: vmdplugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.33 $ $Date: 2015/10/29 05:10:54 $ + * $Revision: 1.34 $ $Date: 2018/05/02 03:12:56 $ * ***************************************************************************/ @@ -144,7 +144,7 @@ typedef struct { /** * Use this macro to initialize the abiversion member of each plugin */ -#define vmdplugin_ABIVERSION 17 +#define vmdplugin_ABIVERSION 18 /*@{*/ /** Use this macro to indicate a plugin's thread-safety at registration time */ -- GitLab From 58a17532bf11c2eacc5464b40dc83566aebd3ad5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 12 Sep 2020 14:26:34 -0400 Subject: [PATCH 34/52] fix up some comments --- src/BODY/body_rounded_polygon.cpp | 2 +- src/BODY/body_rounded_polyhedron.cpp | 2 +- src/BODY/fix_wall_body_polygon.cpp | 2 +- src/BODY/fix_wall_body_polyhedron.cpp | 2 +- src/BODY/pair_body_rounded_polyhedron.cpp | 2 +- src/GPU/pppm_gpu.cpp | 2 +- src/GRANULAR/fix_wall_gran.cpp | 4 ++-- src/GRANULAR/fix_wall_gran.h | 2 +- src/GRANULAR/pair_gran_hooke_history.h | 2 +- src/GRANULAR/pair_granular.h | 2 +- src/KIM/fix_store_kim.h | 4 ++-- src/KIM/kim_interactions.cpp | 2 +- src/KOKKOS/atom_kokkos.cpp | 2 +- src/KOKKOS/pair_kokkos.h | 2 +- src/LATTE/fix_latte.cpp | 2 +- src/MISC/dump_xtc.cpp | 2 +- src/USER-DPD/pair_multi_lucy.cpp | 2 +- src/USER-DPD/pair_multi_lucy_rx.cpp | 2 +- src/USER-PHONON/fix_phonon.cpp | 2 +- src/atom.cpp | 4 ++-- src/atom.h | 2 +- src/comm.cpp | 12 ++++++------ src/compute_chunk_atom.h | 2 +- src/dump.cpp | 2 +- src/error.cpp | 8 ++++---- src/fix_property_atom.cpp | 2 +- src/input.cpp | 4 ++-- src/modify.cpp | 2 +- src/neighbor.cpp | 2 +- src/output.h | 2 +- src/pair_table.cpp | 2 +- src/read_dump.cpp | 8 ++++---- src/utils.cpp | 2 +- src/utils.h | 4 ++-- 34 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index f2e798c93..c7d006c67 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -321,7 +321,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index b647c7e54..423a3b344 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -373,7 +373,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 99ae8ed09..2e69f70af 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 2507b94d2..472fe5fb2 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index 1d7461199..a3cffef9c 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -1880,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be nullptr) for face-edge intersection + q2 = another point (can be a null pointer) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 9b753edd6..a2e3e3ab9 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -117,7 +117,7 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to nullptr + // if do this, make sure to set them to a null pointer destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 25d271be9..9482aae3e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -416,7 +416,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be nullptr for wallstyle = REGION + // history_one will be a null pointer for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 1b3be22e7..a81a4c787 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index dd9a84314..c27ce8a9a 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index ce417812d..7ef4f2af9 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 4e4890ea6..577505687 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or nullptr - void *user_units; // string of unit conversion target or nullptr + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; } diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 755121607..c5ae2ec38 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -108,7 +108,7 @@ void KimInteractions::do_setup(int narg, char **arg) // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as nullptr. + // validate model name if not given as null pointer. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index ed0cfccd4..e9093ee0a 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to nullptr + free memory for vector and name and set ptrs to a null pointer ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 1eaf20ead..cb55dd314 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -94,7 +94,7 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations nullptr which are destructed by the PairStyle + // Call cleanup_copy which sets allocations to null which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 0581f1e35..055e62c41 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,7 +74,7 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // nullptr means LATTE will compute Coulombic potential + // null pointer means LATTE will compute Coulombic potential coulomb = 0; id_pe = nullptr; diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 5c3ca7264..35cca3287 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -137,7 +137,7 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to nullptr so parent dump class will not use it + // set fp to a null pointer so parent dump class will not use it fp = nullptr; if (me == 0) diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 2e556d82e..a266e94cc 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -582,7 +582,7 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index e56743ea1..d8356d20c 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -727,7 +727,7 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index c80073f3c..d8900d234 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because nullptr buffer will result in error for MPI + // allocate variables; MAX(1,... is used because a null buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); diff --git a/src/atom.cpp b/src/atom.cpp index 539bf6fc0..e140d2e47 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find nullptr: + // if find null pointer: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find nullptr: + // if don't find null pointer: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) diff --git a/src/atom.h b/src/atom.h index 841d224d2..4ea4157fa 100644 --- a/src/atom.h +++ b/src/atom.h @@ -55,7 +55,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, nullptr if unset + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable diff --git a/src/comm.cpp b/src/comm.cpp index becb52df9..32a415229 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -888,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -925,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -967,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1032,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1074,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1135,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 14c86383b..392179043 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // nullptr if no lock currently in place + // null pointer if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/dump.cpp b/src/dump.cpp index 3f1e997d1..2259f9ef3 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -202,7 +202,7 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to nullptr since it closes file in its destructor + // XTC style sets fp to a null pointer since it closes file in its destructor if (multifile == 0 && fp != nullptr) { if (compressed) { diff --git a/src/error.cpp b/src/error.cpp index d89ea5b68..fff3072bb 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -69,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -95,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -143,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -192,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 35ac20e37..e6ed9ea02 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -152,7 +152,7 @@ FixPropertyAtom::~FixPropertyAtom() if (border) atom->delete_callback(id,2); // deallocate per-atom vectors in Atom class - // set ptrs to nullptr, so they no longer exist for Atom class + // set ptrs to a null pointer, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { diff --git a/src/input.cpp b/src/input.cpp index 5e40d2ded..4539dfabf 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -338,7 +338,7 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return nullptr + // if no command, just return a null pointer parse(); if (command == nullptr) return nullptr; @@ -450,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or nullptr if no word in string + return ptr to start of word or null pointer if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index a908cfc7a..0f0a86cdd 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to nullptr in case new fix scans list of fixes, + // set ptr to a null pointer in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 26e7d6b74..db67f7154 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -378,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-nullptr pointer if there is only one substyle of the kind. + // will only return a non-null pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; diff --git a/src/output.h b/src/output.h index 6a64e67c9..1af03df22 100644 --- a/src/output.h +++ b/src/output.h @@ -29,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, nullptr if every + char *var_thermo; // variable name for thermo freq, null pointer if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations diff --git a/src/pair_table.cpp b/src/pair_table.cpp index c0fad544d..a92d2e491 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -821,7 +821,7 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index dcbb95fcc..426d0f5a9 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid nullptr + newmaxnew = MAX(newmaxnew,1); // avoid null pointer memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); diff --git a/src/utils.cpp b/src/utils.cpp index e985f9e6e..b0928fd18 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -171,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is nullptr + if (s) *s = '\0'; // truncate string to empty in case error is null pointer } return; } diff --git a/src/utils.h b/src/utils.h index cf8952b8a..c9e958365 100644 --- a/src/utils.h +++ b/src/utils.h @@ -60,7 +60,7 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfgets(const char *srcname, int srcline, char *s, int size, @@ -75,7 +75,7 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfread(const char *srcname, int srcline, void *s, size_t size, -- GitLab From 430d1516603644cc74ea48246302ae02058db148 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Mon, 14 Sep 2020 08:53:59 -0600 Subject: [PATCH 35/52] Revert commit 05d41cd50de992fe806e4f4a3d8b42b6e39579a4 which walked-back the NULL->nullptr changes for lib/poems. Then, hand-applied a minor cleanup to comments, ala Axel's changes to the rest of the codebase. --- lib/poems/SystemProcessor.h | 30 ++++++++--------- lib/poems/poemsnodelib.h | 20 ++++++------ lib/poems/poemstree.h | 64 ++++++++++++++++++------------------- lib/poems/poemstreenode.cpp | 2 +- lib/poems/solver.cpp | 2 +- lib/poems/system.cpp | 10 +++--- lib/poems/workspace.cpp | 6 ++-- 7 files changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index 4fc8785dd..f009794f6 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != NULL) + if(currentNode != nullptr) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != NULL); //repeat this until all chains have been added + while(currentNode != nullptr); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null + if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null { - return NULL; + return nullptr; } int * tmp; - POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = NULL; //temporary variable to hold data - while(tempNode != NULL) //when we have followed all links, stop + POEMSChain * tempChain = nullptr; //temporary variable to hold data + while(tempNode != nullptr) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == NULL) + if(aNode == nullptr) { - return NULL; + return nullptr; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == NULL) //and if we find nothing... + if(returnVal == nullptr) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == NULL) //if we could not find any chains + if(returnVal == nullptr) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be NULL if no new chains are + return returnVal; //return what we find (will be a null pointer if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists + while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != NULL || tmp2->value != NULL) //go through the list + while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 446fa2013..04f0f4b79 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); +TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value NULL +// The pointers have default value nullptr TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == NULL) + if (p == nullptr) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=NULL) + if(t !=nullptr) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == NULL && t->Right() == NULL) + if (t->Left() == nullptr && t->Right() == nullptr) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == NULL) + if (t == nullptr) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=NULL - if (t != NULL) + //print tree with root t, as long as t!=nullptr + if (t != nullptr) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index ee07a3325..cb9499cfd 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = NULL); + void Insert(const int& item, const int& data, void * AuxData = nullptr); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = NULL; + DeleteAuxData = nullptr; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return NULL +// address and a pointer to its parent; otherwise, return a null pointer TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is NULL - parent = NULL; + // the parent of the root is a null pointer + parent = nullptr; // terminate on empty subtree - while(t != NULL) + while(t != nullptr) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; NULL if not found + // return pointer to node; a null pointer if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != NULL) + if (current != nullptr) { item = current->data; return current->GetAuxData(); } else - // item not found in the tree. return False - return NULL; + // item not found in the tree. return a null pointer + return nullptr; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,NULL,NULL); + newNode = GetTreeNode(item,nullptr,nullptr); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == NULL) + if (tree == nullptr) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) + if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) return; - // If D has NULL pointer, the + // If D has null pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == NULL) + if (DNodePtr->right == nullptr) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == NULL) + else if (DNodePtr->left == nullptr) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-NULL + // Both pointers of DNodePtr are non-null pointers else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != NULL) + while (RNodePtr->right != nullptr) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == NULL) + if (PNodePtr == nullptr) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=NULL && current->data == item) + if (current !=nullptr && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == NULL) - return NULL; + if (t == nullptr) + return nullptr; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns NULL. + // present it makes a copy of left child or returns a null pointer. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=NULL) + if (t->Left() !=nullptr) newlptr = CopyTree(t->Left()); else - newlptr = NULL; + newlptr = nullptr; - if (t->Right() !=NULL) + if (t->Right() !=nullptr) newrptr = CopyTree(t->Right()); else - newrptr = NULL; + newrptr = nullptr; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != NULL) { + if (t != nullptr) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != NULL) { - if (DeleteAuxData != NULL) { + if (aux != nullptr) { + if (DeleteAuxData != nullptr) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to NULL +// set the root pointer back to a null pointer void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = NULL; // root now NULL + t = nullptr; // root now a null pointer } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 051e13d6e..0b475c0a8 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value NULL assigns a empty subtree +// A null pointer value assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 67f5b607e..7b1e718b9 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return NULL; + default: return nullptr; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 369213f7d..23554f411 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = NULL; + mappings = nullptr; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 2b3257b0d..21819d4c0 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = NULL; + system = nullptr; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != NULL) { + while(NodeValue != nullptr) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return NULL; + return nullptr; } } -- GitLab From 6315b277c8798fbce824004b115c70819de459c9 Mon Sep 17 00:00:00 2001 From: Anne Gunn Date: Mon, 14 Sep 2020 10:12:48 -0600 Subject: [PATCH 36/52] Revert commit 14dfd3876ac4a53855804baa7f27abfb6a1a9d46 which walked-back the NULL->nullptr changes for lib/awpmd. Then, hand-applied a minor cleanup to comments, ala Axel's changes to the rest of the codebase. --- lib/awpmd/ivutils/include/logexc.h | 8 +++--- lib/awpmd/ivutils/include/pairhash.h | 28 +++++++++---------- lib/awpmd/ivutils/include/refobj.h | 20 ++++++------- lib/awpmd/ivutils/include/vector_3.h | 14 +++++----- lib/awpmd/ivutils/src/logexc.cpp | 2 +- lib/awpmd/systems/interact/TCP/wpmd.h | 20 ++++++------- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 4 +-- lib/awpmd/systems/interact/TCP/wpmd_split.h | 16 +++++------ 8 files changed, 56 insertions(+), 56 deletions(-) diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 7bf6125bc..2eebfcc0c 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(NULL),next(NULL){ + :descriptor(descriptor_),prev(nullptr),next(nullptr){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=NULL; - prev=NULL; + glogp->next=nullptr; + prev=nullptr; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ set_out(out); set_err(err); } diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index c29f72773..401b7b91e 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(NULL,1) { + recmatrix(): parr(nullptr,1) { sizey=sizex=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(NULL,1) { + sqmatrix(): parr(nullptr,1) { size=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(NULL){ + sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not NULL, puts the found value there - virtual int Find(long i, long j, T *retval=NULL)=0; - virtual int Find(long i, long j, T **retval=NULL)=0; + //e if retval is not a null pointer, puts the found value there + virtual int Find(long i, long j, T *retval=nullptr)=0; + virtual int Find(long i, long j, T **retval=nullptr)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=NULL){ + int Find(long i, long j, T *retval=nullptr){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index a1a4feb0f..8e5fc7df4 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=NULL, int managed=0){ + void reset(T* ptr=nullptr, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==NULL than p is not managed (as in mngptr) + int *num; //if num==nullptr than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=NULL; + else num=nullptr; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } public: - shptr(T* p=NULL, int managed=1){ + shptr(T* p=nullptr, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=NULL; + num=nullptr; } - p=NULL; + p=nullptr; } } bool valid() const { - return p!=NULL; + return p!=nullptr; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 468abbda9..5711d3bf3 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=NULL) const { + T maxcoord(int *ind=nullptr) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index 7e82af0f6..6e809dd65 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,7 +13,7 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=NULL; +message_logger *message_logger::glogp=nullptr; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); const char *logfmt(const char *format,...){ diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index e118b76f3..4c6544001 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -255,7 +255,7 @@ public: } //e Create NormDeriv object and calculate the derivatived for the given WP - void set2(const WavePacket& w2_, const cdouble *I0_=NULL){ + void set2(const WavePacket& w2_, const cdouble *I0_=nullptr){ w2=w2_; d2.set(w2); w12=conj(w1)*w2; @@ -558,13 +558,13 @@ public: //e if PBCs are used, the corresponding coordinates of electrons and ions //e in periodic directions must be within the range [0, cell[per_dir]) //e @returns 1 if OK - int set_pbc(const Vector_3P pcell=NULL, int pbc_=0x7); + int set_pbc(const Vector_3P pcell=nullptr, int pbc_=0x7); ///\en Setup electrons: forms internal wave packet representations. /// If PBCs are used the coords must be within a range [0, cell). /// Default electron mass is AWPMD::me. - /// Default (q=NULL )electron charges are -1. - int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=NULL); + /// Default (q=nullptr )electron charges are -1. + int set_electrons(int spin, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass=-1, double *q=nullptr); //e setup ion charges and coordinates //e if PBCs are used the coords must be within a range [0, cell) @@ -593,16 +593,16 @@ public: // 0x2 -- add ion forces to the existing set // 0x4 -- calculate derivatives for electronic time step (NOT IMPLEMENTED) //e if PBCs are used the coords must be within a range [0, cell) - virtual int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); //e same as interaction, but using Hartee factorization (no antisymmetrization) - virtual int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + virtual int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates ion-ion interactions and updates Eii and ion forces if requested. This function /// is called form intaraction() and interaction_hartree if calc_ii is set. - virtual int interaction_ii(int flag,Vector_3P fi=NULL); + virtual int interaction_ii(int flag,Vector_3P fi=nullptr); //e Calculates Norm matrix //e The result is saved in AWPMD::Norm[s] @@ -643,7 +643,7 @@ public: ///\en Prepares force arrays according to \a flag setting for interaction() virtual void clear_forces(int flagi,Vector_3P fi, Vector_3P fe_x, - Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=NULL); + Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c=nullptr); ///\en Creates wave packet according to the given physical parameters. diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 2c58bdaf2..f85b1ebf5 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -312,7 +312,7 @@ void AWPMD_split::clear_forces(int flag,Vector_3P fi, Vector_3P fe_x, void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ if(flag&0x4) //need to replace the forces - clear_forces(0x4,NULL,fe_x,fe_p,fe_w,fe_pw,fe_c); + clear_forces(0x4,nullptr,fe_x,fe_p,fe_w,fe_pw,fe_c); // recalculating derivatives if(flag&(0x8|0x4)){ //electron forces needed @@ -622,7 +622,7 @@ void AWPMD_split::y_deriv(cdouble v,int s,int c2, int c1){ /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n -/// will not update electronic force arrays, which may be NULL, \n +/// will not update electronic force arrays, which may be null pointers, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.h b/lib/awpmd/systems/interact/TCP/wpmd_split.h index 44fb75757..10a8bda55 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.h +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.h @@ -116,8 +116,8 @@ public: /// \a n is the number of electrons of a given spin component /// Electron velocity v is multiplied by mass to obtain momentum. /// Default mass (-1) means me. - /// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split - int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL); + /// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split + int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr); ///\en Starts adding new electron: continue with \ref add_split functions. @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be NULL, \n + /// will not update electronic force arrays, which may be null pointers, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n -- GitLab From f70717710e40a85d35775f05ba1ac5f7d7711971 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 17:07:09 -0400 Subject: [PATCH 37/52] fix for zstd support. add styles to list at top and document .zst extension requirement --- doc/src/dump.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/dump.rst b/doc/src/dump.rst index 3f6a8812c..c94d9a800 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -36,8 +36,7 @@ Syntax * ID = user-assigned name for the dump * group-ID = ID of the group of atoms to be dumped -* style = *atom* or *atom/gz* or *atom/mpiio* or *cfg* or *cfg/gz* or - *cfg/mpiio* or *custom* or *custom/gz* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/mpiio* +* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* * N = dump every this many timesteps * file = name of file to write dump info to * args = list of arguments for a particular style @@ -138,7 +137,7 @@ Examples dump 2 subgroup atom 50 dump.run.mpiio.bin dump 4a all custom 100 dump.myforce.* id type x y vx fx dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke - dump 4b flow custom 100 dump.%.myforce id type c_myF[\*] v_ke + dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke dump 2 inner cfg 10 dump.snap.*.cfg mass type xs ys zs vx vy vz dump snap all cfg 100 dump.config.*.cfg mass type xs ys zs id type c_Stress[2] dump 1 all xtc 1000 file.xtc @@ -204,8 +203,9 @@ of the required filename suffix. Similarly, the *atom/zstd*\ , *cfg/zstd*\ , *custom/zstd*\ , *local/zstd*, and *xyz/zstd* styles are identical to the gz styles, but use the Zstd -compression library instead. See the :doc:`dump_modify ` doc -page for details on how to control the compression level in both variants. +compression library instead and require the ".zst" suffix. See the +:doc:`dump_modify ` doc page for details on how to control +the compression level in both variants. As explained below, the *atom/mpiio*\ , *cfg/mpiio*\ , *custom/mpiio*\ , and *xyz/mpiio* styles are identical in command syntax and in the format -- GitLab From 5634dd4394b507df889d6c56b05178a4829bc67f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 17:15:53 -0400 Subject: [PATCH 38/52] correct formatting of examples --- doc/src/compute_reduce.rst | 2 +- doc/src/compute_stress_mop.rst | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/src/compute_reduce.rst b/doc/src/compute_reduce.rst index c7815305c..660ef8704 100644 --- a/doc/src/compute_reduce.rst +++ b/doc/src/compute_reduce.rst @@ -53,7 +53,7 @@ Examples compute 1 all reduce sum c_force compute 1 all reduce/region subbox sum c_force compute 2 all reduce min c_press[2] f_ave v_myKE - compute 2 all reduce min c_press[\*] f_ave v_myKE + compute 2 all reduce min c_press[*] f_ave v_myKE compute 3 fluid reduce max c_index[1] c_index[2] c_dist replace 1 3 replace 2 3 Description diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index f164a33c2..d68bafa48 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -28,14 +28,16 @@ Syntax origin = *lower* or *center* or *upper* or coordinate value (distance units) is the position of the first plane delta = value (distance units) is the distance between planes +.. code-block:: LAMMPS + compute 1 all stress/mop x lower total compute 1 liquid stress/mop z 0.0 kin conf - fix 1 all ave/time 10 1000 10000 c_1[\*] file mop.time + fix 1 all ave/time 10 1000 10000 c_1[*] file mop.time fix 1 all ave/time 10 1000 10000 c_1[2] file mop.time compute 1 all stress/mop/profile x lower 0.1 total compute 1 liquid stress/mop/profile z 0.0 0.25 kin conf - fix 1 all ave/time 500 20 10000 c_1[\*] ave running overwrite file mopp.time mode vector + fix 1 all ave/time 500 20 10000 c_1[*] ave running overwrite file mopp.time mode vector Description """"""""""" -- GitLab From df9f0e244b15019181182e1c9e7c702071751a41 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 17:18:14 -0400 Subject: [PATCH 39/52] add false positive --- doc/utils/sphinx-config/false_positives.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index b13d7a3ff..5046316ec 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -3455,6 +3455,7 @@ zmin zmq zN zs +zst zsu zu zx -- GitLab From 0183e999c9b91c5a13f2d86b663346a006b81e3b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 21:38:52 -0400 Subject: [PATCH 40/52] consistently return "memory_usage" as double. --- src/KOKKOS/atom_vec_angle_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_angle_kokkos.h | 2 +- src/KOKKOS/atom_vec_atomic_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_atomic_kokkos.h | 2 +- src/KOKKOS/atom_vec_bond_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_bond_kokkos.h | 2 +- src/KOKKOS/atom_vec_charge_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_charge_kokkos.h | 2 +- src/KOKKOS/atom_vec_dpd_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_dpd_kokkos.h | 2 +- src/KOKKOS/atom_vec_full_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_full_kokkos.h | 2 +- src/KOKKOS/atom_vec_hybrid_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_hybrid_kokkos.h | 2 +- src/KOKKOS/atom_vec_molecular_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_molecular_kokkos.h | 2 +- src/KOKKOS/atom_vec_sphere_kokkos.cpp | 4 ++-- src/KOKKOS/atom_vec_sphere_kokkos.h | 2 +- src/MISC/dump_xtc.cpp | 4 ++-- src/MISC/dump_xtc.h | 2 +- src/REPLICA/verlet_split.cpp | 4 ++-- src/REPLICA/verlet_split.h | 2 +- src/USER-DPD/nbin_ssa.cpp | 4 ++-- src/USER-DPD/nbin_ssa.h | 2 +- src/USER-INTEL/nbin_intel.cpp | 2 +- src/USER-INTEL/nbin_intel.h | 2 +- src/USER-MOLFILE/dump_molfile.cpp | 4 ++-- src/USER-MOLFILE/dump_molfile.h | 2 +- src/USER-VTK/dump_vtk.cpp | 4 ++-- src/USER-VTK/dump_vtk.h | 2 +- src/atom.cpp | 4 ++-- src/atom.h | 2 +- src/atom_vec.cpp | 4 ++-- src/atom_vec.h | 4 ++-- src/atom_vec_body.cpp | 4 ++-- src/atom_vec_body.h | 2 +- src/atom_vec_ellipsoid.cpp | 4 ++-- src/atom_vec_ellipsoid.h | 2 +- src/atom_vec_hybrid.cpp | 4 ++-- src/atom_vec_hybrid.h | 2 +- src/atom_vec_line.cpp | 4 ++-- src/atom_vec_line.h | 2 +- src/atom_vec_tri.cpp | 4 ++-- src/atom_vec_tri.h | 2 +- src/comm.h | 2 +- src/comm_brick.cpp | 4 ++-- src/comm_brick.h | 2 +- src/comm_tiled.cpp | 4 ++-- src/comm_tiled.h | 2 +- src/dump.cpp | 4 ++-- src/dump.h | 2 +- src/dump_custom.cpp | 4 ++-- src/dump_custom.h | 2 +- src/dump_dcd.cpp | 4 ++-- src/dump_dcd.h | 2 +- src/fix_numdiff.cpp | 2 +- src/force.cpp | 4 ++-- src/force.h | 2 +- src/info.cpp | 2 +- src/integrate.h | 2 +- src/irregular.cpp | 4 ++-- src/irregular.h | 2 +- src/memory.h | 28 ++++++++++++------------ src/min.h | 2 +- src/modify.cpp | 4 ++-- src/modify.h | 2 +- src/nbin.cpp | 4 ++-- src/nbin.h | 2 +- src/neigh_list.cpp | 4 ++-- src/neigh_list.h | 2 +- src/neighbor.cpp | 4 ++-- src/neighbor.h | 2 +- src/nstencil.cpp | 4 ++-- src/nstencil.h | 2 +- src/ntopo.cpp | 4 ++-- src/ntopo.h | 2 +- src/output.cpp | 2 +- src/rcb.cpp | 4 ++-- src/rcb.h | 2 +- src/update.cpp | 4 ++-- src/update.h | 2 +- 81 files changed, 131 insertions(+), 131 deletions(-) diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 662f09fe5..ccb23064e 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1724,9 +1724,9 @@ int AtomVecAngleKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecAngleKokkos::memory_usage() +double AtomVecAngleKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index 4fc71725b..29b5ce8fc 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -56,7 +56,7 @@ class AtomVecAngleKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 995985b29..e4a5f62c2 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -879,9 +879,9 @@ void AtomVecAtomicKokkos::write_data(FILE *fp, int n, double **buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecAtomicKokkos::memory_usage() +double AtomVecAtomicKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index 212132ef6..2c682d498 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -46,7 +46,7 @@ class AtomVecAtomicKokkos : public AtomVecKokkos { void data_atom(double *, tagint, char **); void pack_data(double **); void write_data(FILE *, int, double **); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index db56d58df..b5a69f6fc 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1148,9 +1148,9 @@ int AtomVecBondKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecBondKokkos::memory_usage() +double AtomVecBondKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index f38ade8f6..7f4d04c03 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -50,7 +50,7 @@ class AtomVecBondKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 9846d2f4f..ce0751cb4 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -1048,9 +1048,9 @@ int AtomVecChargeKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecChargeKokkos::memory_usage() +double AtomVecChargeKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index 39d641b84..4d61b2a69 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -51,7 +51,7 @@ class AtomVecChargeKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index b11260585..70bd9e582 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1830,9 +1830,9 @@ int AtomVecDPDKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecDPDKokkos::memory_usage() +double AtomVecDPDKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index e969a28cb..71b0c8559 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -59,7 +59,7 @@ class AtomVecDPDKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 89275c706..e6f36d999 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1588,9 +1588,9 @@ int AtomVecFullKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecFullKokkos::memory_usage() +double AtomVecFullKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index a2d4fa9cf..4a5a61e91 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -50,7 +50,7 @@ class AtomVecFullKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index 7c7f3c982..baa777790 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -1198,9 +1198,9 @@ int AtomVecHybridKokkos::known_style(char *str) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecHybridKokkos::memory_usage() +double AtomVecHybridKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage(); return bytes; } diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 02f9044d7..3354735bf 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -65,7 +65,7 @@ class AtomVecHybridKokkos : public AtomVecKokkos { void write_vel(FILE *, int, double **); int property_atom(char *); void pack_property_atom(int, double *, int, int); - bigint memory_usage(); + double memory_usage(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 7e3cdbf5e..ab2902443 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1987,9 +1987,9 @@ int AtomVecMolecularKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecMolecularKokkos::memory_usage() +double AtomVecMolecularKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index cede4f42a..a356c6821 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -56,7 +56,7 @@ class AtomVecMolecularKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 6b62014e4..dfae7fa54 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -2765,9 +2765,9 @@ int AtomVecSphereKokkos::write_vel_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecSphereKokkos::memory_usage() +double AtomVecSphereKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 3f6d34e8b..676df431d 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -69,7 +69,7 @@ class AtomVecSphereKokkos : public AtomVecKokkos { int pack_vel_hybrid(int, double *); void write_vel(FILE *, int, double **); int write_vel_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 9f2bbfe42..ba90f8331 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -310,9 +310,9 @@ int DumpXTC::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpXTC::memory_usage() +double DumpXTC::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); return bytes; } diff --git a/src/MISC/dump_xtc.h b/src/MISC/dump_xtc.h index 3fcc89f4b..e242e7eef 100644 --- a/src/MISC/dump_xtc.h +++ b/src/MISC/dump_xtc.h @@ -45,7 +45,7 @@ class DumpXTC : public Dump { void write_header(bigint); void pack(tagint *); void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); void write_frame(); }; diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index a5ed1a671..389bd109e 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -580,8 +580,8 @@ void VerletSplit::k2r_comm() memory usage of Kspace force array on master procs ------------------------------------------------------------------------- */ -bigint VerletSplit::memory_usage() +double VerletSplit::memory_usage() { - bigint bytes = maxatom*3 * sizeof(double); + double bytes = maxatom*3 * sizeof(double); return bytes; } diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index b3ee87e58..f31ebdfa1 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -32,7 +32,7 @@ class VerletSplit : public Verlet { void setup(int); void setup_minimal(int); void run(int); - bigint memory_usage(); + double memory_usage(); private: int master; // 1 if an Rspace proc, 0 if Kspace diff --git a/src/USER-DPD/nbin_ssa.cpp b/src/USER-DPD/nbin_ssa.cpp index e3fa71aed..21d630e78 100644 --- a/src/USER-DPD/nbin_ssa.cpp +++ b/src/USER-DPD/nbin_ssa.cpp @@ -120,9 +120,9 @@ void NBinSSA::bin_atoms_setup(int nall) /* ---------------------------------------------------------------------- */ -bigint NBinSSA::memory_usage() +double NBinSSA::memory_usage() { - bigint bytes = NBinStandard::memory_usage(); // Count the parent's usage too + double bytes = NBinStandard::memory_usage(); // Count the parent's usage too return bytes; } diff --git a/src/USER-DPD/nbin_ssa.h b/src/USER-DPD/nbin_ssa.h index c738391d6..eb4b2db24 100644 --- a/src/USER-DPD/nbin_ssa.h +++ b/src/USER-DPD/nbin_ssa.h @@ -47,7 +47,7 @@ class NBinSSA : public NBinStandard { void bin_atoms_setup(int); void bin_atoms(); - bigint memory_usage(); + double memory_usage(); inline int coord2bin(const double & x,const double & y,const double & z, int &ixo, int &iyo, int &izo) const diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 4a046bc84..3a2af740d 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -241,7 +241,7 @@ void NBinIntel::bin_atoms(IntelBuffers * buffers) { /* ---------------------------------------------------------------------- */ -bigint NBinIntel::memory_usage() +double NBinIntel::memory_usage() { return NBinStandard::memory_usage() + maxatom*2*sizeof(int); } diff --git a/src/USER-INTEL/nbin_intel.h b/src/USER-INTEL/nbin_intel.h index d96f31885..a7a28010b 100644 --- a/src/USER-INTEL/nbin_intel.h +++ b/src/USER-INTEL/nbin_intel.h @@ -40,7 +40,7 @@ class NBinIntel : public NBinStandard { FixIntel *_fix; int *_atombin, *_binpacked; int _precision_mode; - bigint memory_usage(); + double memory_usage(); template void bin_atoms(IntelBuffers *); diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index e0e92f933..f83477833 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -452,9 +452,9 @@ int DumpMolfile::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpMolfile::memory_usage() +double DumpMolfile::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); bytes += sizeof(MFI); return bytes; diff --git a/src/USER-MOLFILE/dump_molfile.h b/src/USER-MOLFILE/dump_molfile.h index c99d1cc5e..f07416cff 100644 --- a/src/USER-MOLFILE/dump_molfile.h +++ b/src/USER-MOLFILE/dump_molfile.h @@ -51,7 +51,7 @@ class DumpMolfile : public Dump { virtual void write_header(bigint) {}; virtual void pack(tagint *); virtual void write_data(int, double *); - virtual bigint memory_usage(); + virtual double memory_usage(); virtual void openfile(); }; diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 59dba0d90..794947f1b 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -2309,9 +2309,9 @@ int DumpVTK::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf, choose, variable arrays ------------------------------------------------------------------------- */ -bigint DumpVTK::memory_usage() +double DumpVTK::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(choose,maxlocal); bytes += memory->usage(dchoose,maxlocal); bytes += memory->usage(clist,maxlocal); diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index b9db1f88c..28fcca78d 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -77,7 +77,7 @@ class DumpVTK : public DumpCustom { int count(); void pack(tagint *); virtual void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); int parse_fields(int, char **); void identify_vectors(); diff --git a/src/atom.cpp b/src/atom.cpp index 49ff26276..a0b981d12 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2586,9 +2586,9 @@ void *Atom::extract(char *name) add in global to local mapping storage ------------------------------------------------------------------------- */ -bigint Atom::memory_usage() +double Atom::memory_usage() { - bigint bytes = avec->memory_usage(); + double bytes = avec->memory_usage(); bytes += max_same*sizeof(int); if (map_style == 1) diff --git a/src/atom.h b/src/atom.h index 21b9c06f8..0fa1b3085 100644 --- a/src/atom.h +++ b/src/atom.h @@ -341,7 +341,7 @@ class Atom : protected Pointers { // NOTE: placeholder method until KOKKOS/AtomVec is refactored int memcheck(const char *) {return 1;} - bigint memory_usage(); + double memory_usage(); // functions for global to local ID mapping // map lookup function inlined for efficiency diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 4a00e5852..6e46406d1 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -2306,12 +2306,12 @@ void AtomVec::write_improper(FILE *fp, int n, tagint **buf, int index) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVec::memory_usage() +double AtomVec::memory_usage() { int datatype,cols,maxcols; void *pdata; - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(tag,nmax); bytes += memory->usage(type,nmax); diff --git a/src/atom_vec.h b/src/atom_vec.h index 07dec6350..5064a1cee 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -151,8 +151,8 @@ class AtomVec : protected Pointers { virtual int property_atom(char *) {return -1;} virtual void pack_property_atom(int, double *, int, int) {} - virtual bigint memory_usage(); - virtual bigint memory_usage_bonus() {return 0;} + virtual double memory_usage(); + virtual double memory_usage_bonus() {return 0;} // old hybrid functions, needed by Kokkos package diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index e9044519c..78bde4a2e 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -551,9 +551,9 @@ void AtomVecBody::data_body(int m, int ninteger, int ndouble, return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecBody::memory_usage_bonus() +double AtomVecBody::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); bytes += icp->size() + dcp->size(); diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 809d90c25..4a4c0d0e6 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -56,7 +56,7 @@ class AtomVecBody : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_body(int, int, int, int *, double *); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index c22111f48..59f6cb9b0 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -414,9 +414,9 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecEllipsoid::memory_usage_bonus() +double AtomVecEllipsoid::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index 041a20aff..57646522e 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -49,7 +49,7 @@ class AtomVecEllipsoid : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7a8c73570..bc0f80486 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -379,9 +379,9 @@ int AtomVecHybrid::unpack_restart_bonus(int ilocal, double *buf) /* ---------------------------------------------------------------------- */ -bigint AtomVecHybrid::memory_usage_bonus() +double AtomVecHybrid::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; for (int k = 0; k < nstyles_bonus; k++) bytes += styles_bonus[k]->memory_usage_bonus(); return bytes; diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 00be1b041..2d8d5dec2 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -48,7 +48,7 @@ class AtomVecHybrid : public AtomVec { int size_restart_bonus(); int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void pack_restart_pre(int); void pack_restart_post(int); diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 88dcb8c2f..c5beaaee8 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -380,9 +380,9 @@ void AtomVecLine::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecLine::memory_usage_bonus() +double AtomVecLine::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index 55a4b8bc0..449d8a1c0 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -49,7 +49,7 @@ class AtomVecLine : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e391a7321..0394a6c35 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -601,9 +601,9 @@ void AtomVecTri::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecTri::memory_usage_bonus() +double AtomVecTri::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index 9becf315f..06898f20f 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -51,7 +51,7 @@ class AtomVecTri : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/comm.h b/src/comm.h index 1743436e2..6672891a4 100644 --- a/src/comm.h +++ b/src/comm.h @@ -104,7 +104,7 @@ class Comm : protected Pointers { // memory usage - virtual bigint memory_usage() = 0; + virtual double memory_usage() = 0; // non-virtual functions common to all Comm styles diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 37a4f0ae3..769ff8ad9 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -1499,9 +1499,9 @@ void *CommBrick::extract(const char *str, int &dim) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint CommBrick::memory_usage() +double CommBrick::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += nprocs * sizeof(int); // grid2proc for (int i = 0; i < nswap; i++) bytes += memory->usage(sendlist[i],maxsendlist[i]); diff --git a/src/comm_brick.h b/src/comm_brick.h index 05268da63..6165f54de 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -47,7 +47,7 @@ class CommBrick : public Comm { void forward_comm_array(int, double **); // forward comm of array int exchange_variable(int, double *, double *&); // exchange on neigh stencil void *extract(const char *,int &); - virtual bigint memory_usage(); + virtual double memory_usage(); protected: int nswap; // # of swaps to perform = sum of maxneed diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 48c9680d2..a78727663 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -2249,8 +2249,8 @@ void CommTiled::deallocate_swap(int n) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint CommTiled::memory_usage() +double CommTiled::memory_usage() { - bigint bytes = 0; + double bytes = 0; return bytes; } diff --git a/src/comm_tiled.h b/src/comm_tiled.h index aa8867b2c..fa2c76e6e 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -50,7 +50,7 @@ class CommTiled : public Comm { void coord2proc_setup(); int coord2proc(double *, int &, int &, int &); - bigint memory_usage(); + double memory_usage(); private: int nswap; // # of swaps to perform = 2*dim diff --git a/src/dump.cpp b/src/dump.cpp index febc3d082..b4584ffd6 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1172,9 +1172,9 @@ void Dump::pbc_allocate() return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Dump::memory_usage() +double Dump::memory_usage() { - bigint bytes = memory->usage(buf,size_one*maxbuf); + double bytes = memory->usage(buf,size_one*maxbuf); bytes += memory->usage(sbuf,maxsbuf); if (sort_flag) { if (sortcol == 0) bytes += memory->usage(ids,maxids); diff --git a/src/dump.h b/src/dump.h index 17e9434fa..fb6627a2b 100644 --- a/src/dump.h +++ b/src/dump.h @@ -47,7 +47,7 @@ class Dump : protected Pointers { virtual void unpack_reverse_comm(int, int *, double *) {} void modify_params(int, char **); - virtual bigint memory_usage(); + virtual double memory_usage(); protected: int me,nprocs; // proc info diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 167d88789..66d9d5217 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -2091,9 +2091,9 @@ int DumpCustom::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf, choose, variable arrays ------------------------------------------------------------------------- */ -bigint DumpCustom::memory_usage() +double DumpCustom::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(choose,maxlocal); bytes += memory->usage(dchoose,maxlocal); bytes += memory->usage(clist,maxlocal); diff --git a/src/dump_custom.h b/src/dump_custom.h index 0f63eac8d..654a87fc6 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -102,7 +102,7 @@ class DumpCustom : public Dump { void pack(tagint *); virtual int convert_string(int, double *); virtual void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); int parse_fields(int, char **); int add_compute(char *); diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 254b371e2..bb73d8975 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -263,9 +263,9 @@ int DumpDCD::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpDCD::memory_usage() +double DumpDCD::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); return bytes; } diff --git a/src/dump_dcd.h b/src/dump_dcd.h index 15f6faf4b..3f59490b1 100644 --- a/src/dump_dcd.h +++ b/src/dump_dcd.h @@ -42,7 +42,7 @@ class DumpDCD : public Dump { void pack(tagint *); void write_data(int, double *); int modify_param(int, char **); - bigint memory_usage(); + double memory_usage(); void write_frame(); void write_dcd_header(const char *); diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 145d60e8d..085b9215d 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -338,7 +338,7 @@ void FixNumDiff::reallocate() double FixNumDiff::memory_usage() { - bigint bytes = 0.0; + double bytes = 0.0; bytes += 3 * maxatom*3 * sizeof(double); return bytes; } diff --git a/src/force.cpp b/src/force.cpp index 701113d7e..11c21df75 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -836,9 +836,9 @@ void Force::set_special(int narg, char **arg) memory usage of force classes ------------------------------------------------------------------------- */ -bigint Force::memory_usage() +double Force::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (pair) bytes += static_cast (pair->memory_usage()); if (bond) bytes += static_cast (bond->memory_usage()); if (angle) bytes += static_cast (angle->memory_usage()); diff --git a/src/force.h b/src/force.h index 1302e20f1..a2cc37f0b 100644 --- a/src/force.h +++ b/src/force.h @@ -135,7 +135,7 @@ class Force : protected Pointers { void store_style(char *&, const std::string &, int); void set_special(int, char **); - bigint memory_usage(); + double memory_usage(); private: void create_factories(); diff --git a/src/info.cpp b/src/info.cpp index 87161e9ca..108f902b3 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -318,7 +318,7 @@ void Info::command(int narg, char **arg) fputs("\nMemory allocation information (MPI rank 0):\n\n",out); - bigint bytes = 0; + double bytes = 0; bytes += atom->memory_usage(); bytes += neighbor->memory_usage(); bytes += comm->memory_usage(); diff --git a/src/integrate.h b/src/integrate.h index f07faacbf..c9aa92e09 100644 --- a/src/integrate.h +++ b/src/integrate.h @@ -28,7 +28,7 @@ class Integrate : protected Pointers { virtual void run(int) = 0; virtual void cleanup() {} virtual void reset_dt() {} - virtual bigint memory_usage() {return 0;} + virtual double memory_usage() {return 0;} protected: int eflag,vflag; // flags for energy/virial computation diff --git a/src/irregular.cpp b/src/irregular.cpp index fbb572fd8..47ee864ab 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -1051,9 +1051,9 @@ void Irregular::grow_recv(int n) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Irregular::memory_usage() +double Irregular::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += maxsend*sizeof(double); // buf_send bytes += maxrecv*sizeof(double); // buf_recv bytes += maxdbuf*sizeof(double); // dbuf diff --git a/src/irregular.h b/src/irregular.h index 01fe40c46..9af6e5255 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -36,7 +36,7 @@ class Irregular : protected Pointers { int create_data_grouped(int, int *, int sortflag = 0); void exchange_data(char *, int, char *); void destroy_data(); - bigint memory_usage(); + double memory_usage(); private: int me,nprocs; diff --git a/src/memory.h b/src/memory.h index 42c9bf6ab..ef55dc2c8 100644 --- a/src/memory.h +++ b/src/memory.h @@ -617,40 +617,40 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - bigint usage(TYPE *array, int n) + double usage(TYPE *array, int n) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n; + double bytes = ((double) sizeof(TYPE)) * n; return bytes; } template - bigint usage(TYPE **array, int n1, int n2) + double usage(TYPE **array, int n1, int n2) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2; - bytes += ((bigint) sizeof(TYPE *)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2; + bytes += ((double) sizeof(TYPE *)) * n1; return bytes; } template - bigint usage(TYPE ***array, int n1, int n2, int n3) + double usage(TYPE ***array, int n1, int n2, int n3) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - bytes += ((bigint) sizeof(TYPE *)) * n1*n2; - bytes += ((bigint) sizeof(TYPE **)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2*n3; + bytes += ((double) sizeof(TYPE *)) * n1*n2; + bytes += ((double) sizeof(TYPE **)) * n1; return bytes; } template - bigint usage(TYPE ****array, int n1, int n2, int n3, int n4) + double usage(TYPE ****array, int n1, int n2, int n3, int n4) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - bytes += ((bigint) sizeof(TYPE *)) * n1*n2*n3; - bytes += ((bigint) sizeof(TYPE **)) * n1*n2; - bytes += ((bigint) sizeof(TYPE ***)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2*n3*n4; + bytes += ((double) sizeof(TYPE *)) * n1*n2*n3; + bytes += ((double) sizeof(TYPE **)) * n1*n2; + bytes += ((double) sizeof(TYPE ***)) * n1; return bytes; } }; diff --git a/src/min.h b/src/min.h index 1db196a55..438a775d1 100644 --- a/src/min.h +++ b/src/min.h @@ -36,7 +36,7 @@ class Min : protected Pointers { virtual void run(int); void cleanup(); int request(class Pair *, int, double); - virtual bigint memory_usage() {return 0;} + virtual double memory_usage() {return 0;} void modify_params(int, char **); virtual int modify_param(int, char **) {return 0;} virtual double fnorm_sqr(); diff --git a/src/modify.cpp b/src/modify.cpp index c88d52b62..9d0511ca6 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1676,9 +1676,9 @@ void Modify::list_init_compute() return # of bytes of allocated memory from all fixes ------------------------------------------------------------------------- */ -bigint Modify::memory_usage() +double Modify::memory_usage() { - bigint bytes = 0; + double bytes = 0; for (int i = 0; i < nfix; i++) bytes += static_cast (fix[i]->memory_usage()); for (int i = 0; i < ncompute; i++) diff --git a/src/modify.h b/src/modify.h index 4c3db0a1b..ee14baf63 100644 --- a/src/modify.h +++ b/src/modify.h @@ -125,7 +125,7 @@ class Modify : protected Pointers { int read_restart(FILE *); void restart_deallocate(int); - bigint memory_usage(); + double memory_usage(); protected: diff --git a/src/nbin.cpp b/src/nbin.cpp index 1092311f6..66c5bd415 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -153,9 +153,9 @@ int NBin::coord2bin(double *x) /* ---------------------------------------------------------------------- */ -bigint NBin::memory_usage() +double NBin::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += maxbin*sizeof(int); bytes += 2*maxatom*sizeof(int); return bytes; diff --git a/src/nbin.h b/src/nbin.h index 54b8da171..4bfe57951 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -42,7 +42,7 @@ class NBin : protected Pointers { void post_constructor(class NeighRequest *); virtual void copy_neighbor_info(); virtual void bin_atoms_setup(int); - bigint memory_usage(); + double memory_usage(); virtual void setup_bins(int) = 0; virtual void bin_atoms() = 0; diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index c01f8ca59..8798ec8f9 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -294,9 +294,9 @@ void NeighList::print_attributes() if stencilflag = 0, maxstencil * maxstencil_multi will also be 0 ------------------------------------------------------------------------- */ -bigint NeighList::memory_usage() +double NeighList::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(ilist,maxatom); bytes += memory->usage(numneigh,maxatom); bytes += maxatom * sizeof(int *); diff --git a/src/neigh_list.h b/src/neigh_list.h index c26b00813..d69b844dc 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -107,7 +107,7 @@ class NeighList : protected Pointers { void grow(int,int); // grow all data structs void print_attributes(); // debug routine int get_maxlocal() {return maxatom;} - bigint memory_usage(); + double memory_usage(); }; } diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 66ab92496..4fc54aafc 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2390,9 +2390,9 @@ int Neighbor::exclude_setting() return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Neighbor::memory_usage() +double Neighbor::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(xhold,maxhold,3); for (int i = 0; i < nlist; i++) diff --git a/src/neighbor.h b/src/neighbor.h index 8fe423c60..9ee2af9c7 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -123,7 +123,7 @@ class Neighbor : protected Pointers { int exclude_setting(); // return exclude value to accelerator pkg class NeighRequest *find_request(void *); // find a neighbor request - bigint memory_usage(); + double memory_usage(); bigint last_setup_bins; // step of last neighbor::setup_bins() call diff --git a/src/nstencil.cpp b/src/nstencil.cpp index 431906e89..9eb1818b8 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -222,9 +222,9 @@ double NStencil::bin_distance(int i, int j, int k) /* ---------------------------------------------------------------------- */ -bigint NStencil::memory_usage() +double NStencil::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (neighstyle == Neighbor::BIN) { bytes += memory->usage(stencil,maxstencil); bytes += memory->usage(stencilxyz,maxstencil,3); diff --git a/src/nstencil.h b/src/nstencil.h index a4c6a4af6..75e678b48 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -39,7 +39,7 @@ class NStencil : protected Pointers { void post_constructor(class NeighRequest *); void copy_neighbor_info(); virtual void create_setup(); - bigint memory_usage(); + double memory_usage(); virtual void create() = 0; diff --git a/src/ntopo.cpp b/src/ntopo.cpp index d4ddcc7fc..a53d88505 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -206,9 +206,9 @@ void NTopo::dihedral_check(int nlist, int **list) /* ---------------------------------------------------------------------- */ -bigint NTopo::memory_usage() +double NTopo::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += 3*maxbond * sizeof(int); bytes += 4*maxangle * sizeof(int); bytes += 5*maxdihedral * sizeof(int); diff --git a/src/ntopo.h b/src/ntopo.h index b115b3296..3e4204cea 100644 --- a/src/ntopo.h +++ b/src/ntopo.h @@ -28,7 +28,7 @@ class NTopo : protected Pointers { virtual void build() = 0; - bigint memory_usage(); + double memory_usage(); protected: int me,nprocs; diff --git a/src/output.cpp b/src/output.cpp index 6c90198de..aafbcd971 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -817,7 +817,7 @@ void Output::create_restart(int narg, char **arg) void Output::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += atom->memory_usage(); bytes += neighbor->memory_usage(); bytes += comm->memory_usage(); diff --git a/src/rcb.cpp b/src/rcb.cpp index 03c99560b..9cb4248ab 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -1261,9 +1261,9 @@ void RCB::invert(int sortflag) memory use of Irregular ------------------------------------------------------------------------- */ -bigint RCB::memory_usage() +double RCB::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (irregular) bytes += irregular->memory_usage(); return bytes; } diff --git a/src/rcb.h b/src/rcb.h index 555c4142b..a3dc37bb9 100644 --- a/src/rcb.h +++ b/src/rcb.h @@ -43,7 +43,7 @@ class RCB : protected Pointers { void compute(int, int, double **, double *, double *, double *); void compute_old(int, int, double **, double *, double *, double *); void invert(int sortflag = 0); - bigint memory_usage(); + double memory_usage(); // DEBUG methods //void check(); diff --git a/src/update.cpp b/src/update.cpp index 399584473..3524dcca1 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -522,9 +522,9 @@ void Update::update_time() memory usage of update and integrate/minimize ------------------------------------------------------------------------- */ -bigint Update::memory_usage() +double Update::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (whichflag == 1) bytes += integrate->memory_usage(); else if (whichflag == 2) bytes += minimize->memory_usage(); return bytes; diff --git a/src/update.h b/src/update.h index 558719f4c..38db85e5e 100644 --- a/src/update.h +++ b/src/update.h @@ -67,7 +67,7 @@ class Update : protected Pointers { void reset_timestep(int, char **); void reset_timestep(bigint); void update_time(); - bigint memory_usage(); + double memory_usage(); private: void new_integrate(char *, int, char **, int, int &); -- GitLab From 4b64be77e0adb06211f288457afd82d22184429c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 01:48:38 -0400 Subject: [PATCH 41/52] consolidate memory allocation information into a single function (in Info) --- doc/src/pg_lib_properties.rst | 5 +++ src/info.cpp | 71 ++++++++++++++++++++++------------- src/info.h | 1 + src/output.cpp | 32 ++++++---------- 4 files changed, 62 insertions(+), 47 deletions(-) diff --git a/doc/src/pg_lib_properties.rst b/doc/src/pg_lib_properties.rst index cdc7617d9..25f99fe85 100644 --- a/doc/src/pg_lib_properties.rst +++ b/doc/src/pg_lib_properties.rst @@ -21,6 +21,11 @@ event as atoms are migrating between sub-domains. ----------------------- +.. doxygenfunction:: lammps_memory_usage + :project: progguide + +----------------------- + .. doxygenfunction:: lammps_get_mpi_comm :project: progguide diff --git a/src/info.cpp b/src/info.cpp index 108f902b3..ccf6eb414 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -315,41 +315,23 @@ void Info::command(int narg, char **arg) } if (flags & MEMORY) { + double meminfo[3]; - fputs("\nMemory allocation information (MPI rank 0):\n\n",out); + get_memory_info(meminfo); - double bytes = 0; - bytes += atom->memory_usage(); - bytes += neighbor->memory_usage(); - bytes += comm->memory_usage(); - bytes += update->memory_usage(); - bytes += force->memory_usage(); - bytes += modify->memory_usage(); - for (int i = 0; i < output->ndump; i++) - bytes += output->dump[i]->memory_usage(); - double mbytes = bytes/1024.0/1024.0; - fmt::print(out,"Total dynamically allocated memory: {:.4} Mbyte\n",mbytes); + fputs("\nMemory allocation information (MPI rank 0):\n\n",out); + fmt::print(out,"Total dynamically allocated memory: {:.4} Mbyte\n", + meminfo[0]); #if defined(_WIN32) - HANDLE phandle = GetCurrentProcess(); - PROCESS_MEMORY_COUNTERS_EX pmc; - GetProcessMemoryInfo(phandle,(PROCESS_MEMORY_COUNTERS *)&pmc,sizeof(pmc)); - fmt::print(out,"Non-shared memory use: {:.4} Mbyte\n", - (double)pmc.PrivateUsage/1048576.0); - fmt::print(out,"Maximum working set size: {:.4} Mbyte\n", - (double)pmc.PeakWorkingSetSize/1048576.0); + fmt::print(out,"Non-shared memory use: {:.4} Mbyte\n",meminfo[1]); + fmt::print(out,"Maximum working set size: {:.4} Mbyte\n",meminfo[2]); #else #if defined(__linux__) - struct mallinfo mi; - mi = mallinfo(); fmt::print(out,"Current reserved memory pool size: {:.4} Mbyte\n", - (double)mi.uordblks/1048576.0+(double)mi.hblkhd/1048576.0); + meminfo[1]); #endif - struct rusage ru; - if (getrusage(RUSAGE_SELF, &ru) == 0) { - fmt::print(out,"Maximum resident set size: {:.4} Mbyte\n", - (double)ru.ru_maxrss/1024.0); - } + fmt::print(out,"Maximum resident set size: {:.4} Mbyte\n",meminfo[2]); #endif } @@ -1300,6 +1282,41 @@ std::string Info::get_cxx_info() /* ---------------------------------------------------------------------- */ +void Info::get_memory_info(double *meminfo) +{ + double bytes = 0; + bytes += atom->memory_usage(); + bytes += neighbor->memory_usage(); + bytes += comm->memory_usage(); + bytes += update->memory_usage(); + bytes += force->memory_usage(); + bytes += modify->memory_usage(); + for (int i = 0; i < output->ndump; i++) + bytes += output->dump[i]->memory_usage(); + meminfo[0] = bytes/1024.0/1024.0; + meminfo[1] = 0; + meminfo[2] = 0; + +#if defined(_WIN32) + HANDLE phandle = GetCurrentProcess(); + PROCESS_MEMORY_COUNTERS_EX pmc; + GetProcessMemoryInfo(phandle,(PROCESS_MEMORY_COUNTERS *)&pmc,sizeof(pmc)); + meminfo[1] = (double)pmc.PrivateUsage/1048576.0; + meminfo[2] = (double)pmc.PeakWorkingSetSize/1048576.0; +#else +#if defined(__linux__) + struct mallinfo mi; + mi = mallinfo(); + meminfo[1] = (double)mi.uordblks/1048576.0+(double)mi.hblkhd/1048576.0; +#endif + struct rusage ru; + if (getrusage(RUSAGE_SELF, &ru) == 0) + meminfo[2] = (double)ru.ru_maxrss/1024.0; +#endif +} + +/* ---------------------------------------------------------------------- */ + char **Info::get_variable_names(int &num) { num = input->variable->nvar; return input->variable->names; diff --git a/src/info.h b/src/info.h index 65690ab28..ae61600b6 100644 --- a/src/info.h +++ b/src/info.h @@ -52,6 +52,7 @@ class Info : protected Pointers { static std::string get_mpi_info(int &, int &); static std::string get_cxx_info(); + void get_memory_info(double *); char **get_variable_names(int &num); private: diff --git a/src/output.cpp b/src/output.cpp index aafbcd971..d4fd5ae75 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -21,6 +21,7 @@ #include "error.h" #include "force.h" #include "group.h" +#include "info.h" #include "input.h" #include "memory.h" #include "modify.h" @@ -817,28 +818,19 @@ void Output::create_restart(int narg, char **arg) void Output::memory_usage() { - double bytes = 0; - bytes += atom->memory_usage(); - bytes += neighbor->memory_usage(); - bytes += comm->memory_usage(); - bytes += update->memory_usage(); - bytes += force->memory_usage(); - bytes += modify->memory_usage(); - for (int i = 0; i < ndump; i++) bytes += dump[i]->memory_usage(); - - double mbytes = bytes/1024.0/1024.0; - double mbavg,mbmin,mbmax; + double meminfo[3]; + Info info(lmp); + + info.get_memory_info(meminfo); + double mbytes = meminfo[0]; + double mbmin,mbavg,mbmax; MPI_Reduce(&mbytes,&mbavg,1,MPI_DOUBLE,MPI_SUM,0,world); MPI_Reduce(&mbytes,&mbmin,1,MPI_DOUBLE,MPI_MIN,0,world); MPI_Reduce(&mbytes,&mbmax,1,MPI_DOUBLE,MPI_MAX,0,world); + mbavg /= comm->nprocs; - if (comm->me == 0) { - mbavg /= comm->nprocs; - if (screen) - fprintf(screen,"Per MPI rank memory allocation (min/avg/max) = " - "%.4g | %.4g | %.4g Mbytes\n",mbmin,mbavg,mbmax); - if (logfile) - fprintf(logfile,"Per MPI rank memory allocation (min/avg/max) = " - "%.4g | %.4g | %.4g Mbytes\n",mbmin,mbavg,mbmax); - } + if (comm->me == 0) + utils::logmesg(lmp,fmt::format("Per MPI rank memory allocation (min/avg/" + "max) = {:.4} | {:.4} | {:.4} Mbytes\n", + mbmin,mbavg,mbmax)); } -- GitLab From bb76215ef0468aa866fde3835ebf6bcc6424f210 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 01:48:59 -0400 Subject: [PATCH 42/52] add library interface to retrieve memory usage info --- src/library.cpp | 32 ++++++++++++++++++++++++++++++++ src/library.h | 3 ++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/library.cpp b/src/library.cpp index 0e0c4070e..e1e505e46 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -532,6 +532,38 @@ int lammps_version(void *handle) return atoi(lmp->universe->num_ver); } +/* ---------------------------------------------------------------------- */ + +/** Get memory usage information + * +\verbatim embed:rst + +This function will retrieve memory usage information for the current +LAMMPS instance or process. The *meminfo* buffer will be filled with +3 different numbers (if supported by the operating system). The first +is the tally (in MBytes) of all large memory allocations made by LAMMPS. +This is a lower boundary of how much memory is requested and does not +account for memory allocated on the stack or allocations via ``new``. +The second number is the current memory allocation of the process as +returned by the memory allocator in the C-library. The third number +is the maximum amount of RAM (not swap) used by the process so far. +If any of the two latter parameters is not supported by the operating +system, the number value is 0. + +.. versionadded:: 15Sep2020 + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param meminfo buffer with space for at least 3 double to store + * data in. */ + +void lammps_memory_usage(void *handle, double *meminfo) +{ + LAMMPS *lmp = (LAMMPS *) handle; + Info info(lmp); + info.get_memory_info(meminfo); +} /* ---------------------------------------------------------------------- */ diff --git a/src/library.h b/src/library.h index f5a02502e..9b9d89ca3 100644 --- a/src/library.h +++ b/src/library.h @@ -98,7 +98,8 @@ void lammps_commands_string(void *handle, const char *str); * ----------------------------------------------------------------------- */ int lammps_version(void *handle); -int lammps_get_mpi_comm(void* handle); +void lammps_memory_usage(void *handle, double *meminfo); +int lammps_get_mpi_comm(void *handle); double lammps_get_natoms(void *handle); double lammps_get_thermo(void *handle, char *keyword); -- GitLab From c6b6369d2ddac532cd0ee1cdce48dbc158cdf383 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 09:46:57 -0400 Subject: [PATCH 43/52] fix bug in input script templates that would have the timestep setting overwritten by a units command --- unittest/force-styles/tests/angle-charmm.yaml | 66 ++++----- unittest/force-styles/tests/angle-class2.yaml | 66 ++++----- .../force-styles/tests/angle-class2_p6.yaml | 98 ++++++------- unittest/force-styles/tests/angle-cosine.yaml | 66 ++++----- .../tests/angle-cosine_delta.yaml | 66 ++++----- .../tests/angle-cosine_periodic.yaml | 66 ++++----- .../tests/angle-cosine_shift.yaml | 66 ++++----- .../tests/angle-cosine_shift_exp.yaml | 66 ++++----- .../tests/angle-cosine_squared.yaml | 66 ++++----- unittest/force-styles/tests/angle-cross.yaml | 100 ++++++------- .../force-styles/tests/angle-fourier.yaml | 42 +++--- .../tests/angle-fourier_simple.yaml | 68 ++++----- .../force-styles/tests/angle-harmonic.yaml | 66 ++++----- unittest/force-styles/tests/angle-hybrid.yaml | 66 ++++----- unittest/force-styles/tests/angle-mm3.yaml | 98 ++++++------- .../force-styles/tests/angle-quartic.yaml | 66 ++++----- .../tests/angle-table_linear.yaml | 66 ++++----- .../tests/angle-table_spline.yaml | 66 ++++----- unittest/force-styles/tests/angle-zero.yaml | 4 +- .../force-styles/tests/atomic-pair-adp.yaml | 72 ++++----- .../force-styles/tests/atomic-pair-atm.yaml | 72 ++++----- .../force-styles/tests/atomic-pair-beck.yaml | 72 ++++----- .../force-styles/tests/atomic-pair-born.yaml | 72 ++++----- .../tests/atomic-pair-colloid.yaml | 60 ++++---- .../tests/atomic-pair-colloid_multi.yaml | 60 ++++---- .../tests/atomic-pair-colloid_multi_tri.yaml | 60 ++++---- .../tests/atomic-pair-colloid_tiled.yaml | 60 ++++---- .../tests/atomic-pair-colloid_tiled_tri.yaml | 60 ++++---- .../force-styles/tests/atomic-pair-eam.yaml | 72 ++++----- .../tests/atomic-pair-eam_alloy.yaml | 72 ++++----- .../tests/atomic-pair-eam_alloy_real.yaml | 72 ++++----- .../tests/atomic-pair-eam_cd.yaml | 72 ++++----- .../tests/atomic-pair-eam_cd_old.yaml | 72 ++++----- .../tests/atomic-pair-eam_cd_real.yaml | 72 ++++----- .../tests/atomic-pair-eam_fs.yaml | 72 ++++----- .../tests/atomic-pair-eam_fs_real.yaml | 72 ++++----- .../tests/atomic-pair-eam_real.yaml | 74 +++++----- .../force-styles/tests/atomic-pair-edip.yaml | 4 +- .../force-styles/tests/atomic-pair-eim.yaml | 72 ++++----- .../force-styles/tests/atomic-pair-gauss.yaml | 134 ++++++++--------- .../tests/atomic-pair-hybrid-eam.yaml | 72 ++++----- .../tests/atomic-pair-hybrid-eam_fs.yaml | 72 ++++----- .../tests/atomic-pair-kim_lj.yaml | 72 ++++----- .../tests/atomic-pair-meam_c.yaml | 72 ++++----- .../tests/atomic-pair-meam_spline.yaml | 72 ++++----- .../tests/atomic-pair-meam_sw_spline.yaml | 4 +- .../force-styles/tests/atomic-pair-momb.yaml | 72 ++++----- .../tests/atomic-pair-polymorphic_eam.yaml | 72 ++++----- .../tests/atomic-pair-reax_c.yaml | 4 +- .../tests/atomic-pair-reax_c_lgvdw.yaml | 4 +- .../tests/atomic-pair-reax_c_noqeq.yaml | 4 +- .../tests/atomic-pair-table_bitmap.yaml | 72 ++++----- .../tests/atomic-pair-table_linear.yaml | 72 ++++----- .../tests/atomic-pair-table_lookup.yaml | 72 ++++----- .../tests/atomic-pair-table_spline.yaml | 72 ++++----- .../tests/atomic-pair-yukawa_colloid.yaml | 62 ++++---- unittest/force-styles/tests/bond-class2.yaml | 66 ++++----- unittest/force-styles/tests/bond-fene.yaml | 68 ++++----- .../force-styles/tests/bond-fene_expand.yaml | 70 ++++----- unittest/force-styles/tests/bond-gromos.yaml | 66 ++++----- .../force-styles/tests/bond-harmonic.yaml | 66 ++++----- .../tests/bond-harmonic_shift.yaml | 66 ++++----- .../tests/bond-harmonic_shift_cut.yaml | 4 +- unittest/force-styles/tests/bond-hybrid.yaml | 66 ++++----- unittest/force-styles/tests/bond-mm3.yaml | 66 ++++----- unittest/force-styles/tests/bond-morse.yaml | 66 ++++----- .../force-styles/tests/bond-nonlinear.yaml | 66 ++++----- .../force-styles/tests/bond-table_linear.yaml | 66 ++++----- .../force-styles/tests/bond-table_spline.yaml | 66 ++++----- unittest/force-styles/tests/bond-zero.yaml | 4 +- .../tests/fix-timestep-addforce_const.yaml | 4 +- .../tests/fix-timestep-addforce_variable.yaml | 4 +- .../tests/fix-timestep-aveforce_const.yaml | 4 +- .../tests/fix-timestep-aveforce_variable.yaml | 4 +- .../force-styles/tests/fix-timestep-drag.yaml | 4 +- .../tests/fix-timestep-efield_const.yaml | 4 +- .../tests/fix-timestep-efield_region.yaml | 4 +- .../tests/fix-timestep-efield_variable.yaml | 4 +- .../force-styles/tests/fix-timestep-heat.yaml | 4 +- .../tests/fix-timestep-heat_region.yaml | 4 +- .../tests/fix-timestep-lineforce.yaml | 4 +- .../tests/fix-timestep-momentum.yaml | 4 +- .../tests/fix-timestep-momentum_chunk.yaml | 4 +- .../force-styles/tests/fix-timestep-nph.yaml | 4 +- .../tests/fix-timestep-npt_aniso.yaml | 4 +- .../tests/fix-timestep-npt_iso.yaml | 4 +- .../tests/fix-timestep-npt_tri.yaml | 4 +- .../force-styles/tests/fix-timestep-nve.yaml | 4 +- .../tests/fix-timestep-nve_limit.yaml | 4 +- .../tests/fix-timestep-nve_noforce.yaml | 4 +- .../force-styles/tests/fix-timestep-nvt.yaml | 4 +- .../tests/fix-timestep-oneway.yaml | 4 +- .../tests/fix-timestep-planeforce.yaml | 4 +- .../fix-timestep-press_berendsen_iso.yaml | 4 +- .../tests/fix-timestep-rattle_angle.yaml | 4 +- .../tests/fix-timestep-rattle_bond.yaml | 4 +- .../tests/fix-timestep-restrain.yaml | 4 +- .../tests/fix-timestep-rigid_group.yaml | 4 +- .../tests/fix-timestep-rigid_molecule.yaml | 4 +- .../fix-timestep-rigid_molecule_tri.yaml | 4 +- .../tests/fix-timestep-rigid_nph.yaml | 4 +- .../tests/fix-timestep-rigid_nph_small.yaml | 4 +- .../tests/fix-timestep-rigid_npt.yaml | 4 +- .../tests/fix-timestep-rigid_npt_small.yaml | 4 +- .../tests/fix-timestep-rigid_nve_group.yaml | 4 +- .../fix-timestep-rigid_nve_molecule.yaml | 4 +- .../tests/fix-timestep-rigid_nve_single.yaml | 4 +- .../tests/fix-timestep-rigid_nve_small.yaml | 4 +- .../tests/fix-timestep-rigid_nvt.yaml | 4 +- .../tests/fix-timestep-rigid_nvt_small.yaml | 4 +- .../tests/fix-timestep-rigid_single.yaml | 4 +- .../tests/fix-timestep-rigid_small.yaml | 4 +- .../tests/fix-timestep-setforce_const.yaml | 4 +- .../tests/fix-timestep-setforce_region.yaml | 4 +- .../tests/fix-timestep-setforce_variable.yaml | 4 +- .../tests/fix-timestep-shake_angle.yaml | 4 +- .../tests/fix-timestep-shake_bond.yaml | 4 +- .../tests/fix-timestep-smd_couple.yaml | 4 +- .../tests/fix-timestep-smd_tether.yaml | 4 +- .../tests/fix-timestep-spring_chunk.yaml | 4 +- .../tests/fix-timestep-spring_couple.yaml | 4 +- .../tests/fix-timestep-spring_rg.yaml | 4 +- .../tests/fix-timestep-spring_self.yaml | 4 +- .../tests/fix-timestep-spring_tether.yaml | 4 +- .../tests/fix-timestep-temp_berendsen.yaml | 4 +- .../tests/fix-timestep-temp_csld.yaml | 4 +- .../tests/fix-timestep-temp_csvr.yaml | 4 +- .../tests/fix-timestep-temp_rescale.yaml | 4 +- .../fix-timestep-wall_harmonic_const.yaml | 4 +- .../tests/fix-timestep-wall_lj1043_const.yaml | 4 +- .../tests/fix-timestep-wall_lj126_const.yaml | 4 +- .../tests/fix-timestep-wall_lj93_const.yaml | 4 +- .../tests/fix-timestep-wall_morse_const.yaml | 4 +- unittest/force-styles/tests/in.airebo | 2 +- unittest/force-styles/tests/in.colloid | 2 +- unittest/force-styles/tests/in.fourmol | 2 +- unittest/force-styles/tests/in.manybody | 2 +- .../force-styles/tests/in.manybody-charge | 2 +- unittest/force-styles/tests/in.metal | 2 +- unittest/force-styles/tests/kspace-ewald.yaml | 62 ++++---- .../force-styles/tests/kspace-ewald_disp.yaml | 62 ++++---- .../tests/kspace-ewald_nozforce.yaml | 62 ++++---- .../force-styles/tests/kspace-ewald_slab.yaml | 62 ++++---- .../force-styles/tests/kspace-ewald_tri.yaml | 120 +++++++-------- unittest/force-styles/tests/kspace-msm.yaml | 62 ++++---- .../force-styles/tests/kspace-msm_cg.yaml | 44 +++--- unittest/force-styles/tests/kspace-pppm.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_ad.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_cg.yaml | 44 +++--- .../force-styles/tests/kspace-pppm_cg_ad.yaml | 44 +++--- .../tests/kspace-pppm_cg_tiled.yaml | 44 +++--- .../force-styles/tests/kspace-pppm_disp.yaml | 62 ++++---- .../tests/kspace-pppm_disp_ad.yaml | 62 ++++---- .../tests/kspace-pppm_disp_ad_only.yaml | 62 ++++---- .../tests/kspace-pppm_disp_only.yaml | 4 +- .../tests/kspace-pppm_disp_tip4p.yaml | 62 ++++---- .../tests/kspace-pppm_nozforce.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_slab.yaml | 62 ++++---- .../tests/kspace-pppm_stagger.yaml | 62 ++++---- .../tests/kspace-pppm_stagger_tiled.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_tiled.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_tip4p.yaml | 62 ++++---- .../tests/kspace-pppm_tip4p_ad.yaml | 62 ++++---- .../tests/kspace-pppm_tip4p_nozforce.yaml | 62 ++++---- .../tests/kspace-pppm_tip4p_slab.yaml | 62 ++++---- .../force-styles/tests/kspace-pppm_tri.yaml | 62 ++++---- .../tests/manybody-pair-airebo.yaml | 104 ++++++------- .../tests/manybody-pair-airebo_00.yaml | 104 ++++++------- .../tests/manybody-pair-airebo_m.yaml | 104 ++++++------- .../tests/manybody-pair-airebo_m00.yaml | 104 ++++++------- .../force-styles/tests/manybody-pair-bop.yaml | 138 +++++++++--------- .../tests/manybody-pair-bop_save.yaml | 138 +++++++++--------- .../tests/manybody-pair-comb.yaml | 136 ++++++++--------- .../tests/manybody-pair-comb3.yaml | 102 ++++++------- .../tests/manybody-pair-edip_multi.yaml | 136 ++++++++--------- .../tests/manybody-pair-extep.yaml | 100 ++++++------- .../force-styles/tests/manybody-pair-gw.yaml | 136 ++++++++--------- .../tests/manybody-pair-gw_zbl.yaml | 136 ++++++++--------- .../tests/manybody-pair-lcbop.yaml | 136 ++++++++--------- .../tests/manybody-pair-meam_c.yaml | 136 ++++++++--------- .../tests/manybody-pair-mliap_snap.yaml | 136 ++++++++--------- .../tests/manybody-pair-mliap_snap_chem.yaml | 136 ++++++++--------- .../tests/manybody-pair-nb3b_harmonic.yaml | 104 ++++++------- .../tests/manybody-pair-polymorphic_sw.yaml | 136 ++++++++--------- .../manybody-pair-polymorphic_tersoff.yaml | 138 +++++++++--------- .../tests/manybody-pair-rebo.yaml | 104 ++++++------- .../tests/manybody-pair-snap.yaml | 136 ++++++++--------- .../tests/manybody-pair-snap_chem.yaml | 136 ++++++++--------- .../tests/manybody-pair-sw-multi.yaml | 136 ++++++++--------- .../force-styles/tests/manybody-pair-sw.yaml | 136 ++++++++--------- .../tests/manybody-pair-tersoff.yaml | 136 ++++++++--------- .../tests/manybody-pair-tersoff_mod.yaml | 136 ++++++++--------- .../tests/manybody-pair-tersoff_mod_c.yaml | 136 ++++++++--------- .../tests/manybody-pair-tersoff_table.yaml | 136 ++++++++--------- .../tests/manybody-pair-tersoff_zbl.yaml | 136 ++++++++--------- .../tests/manybody-pair-vashishta.yaml | 136 ++++++++--------- .../tests/manybody-pair-vashishta_table.yaml | 136 ++++++++--------- .../force-styles/tests/mol-pair-beck.yaml | 64 ++++---- .../force-styles/tests/mol-pair-born.yaml | 98 ++++++------- .../tests/mol-pair-born_coul_dsf.yaml | 100 ++++++------- .../tests/mol-pair-born_coul_dsf_cs.yaml | 68 ++++----- .../tests/mol-pair-born_coul_long.yaml | 100 ++++++------- .../tests/mol-pair-born_coul_long_cs.yaml | 68 ++++----- .../tests/mol-pair-born_coul_msm.yaml | 100 ++++++------- .../tests/mol-pair-born_coul_msm_table.yaml | 68 ++++----- .../tests/mol-pair-born_coul_table_cs.yaml | 68 ++++----- .../tests/mol-pair-born_coul_wolf.yaml | 130 ++++++++--------- .../tests/mol-pair-born_coul_wolf_cs.yaml | 68 ++++----- .../force-styles/tests/mol-pair-buck.yaml | 66 ++++----- .../tests/mol-pair-buck_coul_cut.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_long.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_long_cs.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_msm.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_msm_table.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_table.yaml | 68 ++++----- .../tests/mol-pair-buck_coul_table_cs.yaml | 68 ++++----- .../tests/mol-pair-buck_long_coul_long.yaml | 70 ++++----- .../tests/mol-pair-buck_long_coul_off.yaml | 66 ++++----- .../mol-pair-buck_long_cut_coul_long.yaml | 68 ++++----- .../force-styles/tests/mol-pair-buck_mdf.yaml | 66 ++++----- .../tests/mol-pair-buck_table_coul_long.yaml | 68 ++++----- .../tests/mol-pair-buck_table_coul_off.yaml | 66 ++++----- .../tests/mol-pair-buck_table_coul_table.yaml | 70 ++++----- .../tests/mol-pair-cosine_squared.yaml | 66 ++++----- .../force-styles/tests/mol-pair-coul_cut.yaml | 66 ++++----- .../tests/mol-pair-coul_cut_soft.yaml | 68 ++++----- .../tests/mol-pair-coul_debye.yaml | 66 ++++----- .../tests/mol-pair-coul_diel.yaml | 66 ++++----- .../force-styles/tests/mol-pair-coul_dsf.yaml | 66 ++++----- .../tests/mol-pair-coul_long.yaml | 66 ++++----- .../tests/mol-pair-coul_long_cs.yaml | 66 ++++----- .../tests/mol-pair-coul_long_soft.yaml | 68 ++++----- .../force-styles/tests/mol-pair-coul_msm.yaml | 66 ++++----- .../tests/mol-pair-coul_msm_table.yaml | 66 ++++----- .../tests/mol-pair-coul_shield.yaml | 68 ++++----- .../tests/mol-pair-coul_slater_cut.yaml | 66 ++++----- .../tests/mol-pair-coul_slater_long.yaml | 66 ++++----- .../tests/mol-pair-coul_streitz_long.yaml | 69 ++++----- .../tests/mol-pair-coul_streitz_wolf.yaml | 69 ++++----- .../tests/mol-pair-coul_table.yaml | 66 ++++----- .../tests/mol-pair-coul_table_cs.yaml | 66 ++++----- .../tests/mol-pair-coul_wolf.yaml | 66 ++++----- .../tests/mol-pair-coul_wolf_cs.yaml | 66 ++++----- unittest/force-styles/tests/mol-pair-dpd.yaml | 126 ++++++++-------- .../tests/mol-pair-dpd_tstat.yaml | 124 ++++++++-------- unittest/force-styles/tests/mol-pair-e3b.yaml | 68 ++++----- .../force-styles/tests/mol-pair-gauss.yaml | 66 ++++----- .../tests/mol-pair-gauss_cut.yaml | 66 ++++----- .../tests/mol-pair-hybrid-overlay.yaml | 68 ++++----- .../force-styles/tests/mol-pair-hybrid.yaml | 66 ++++----- .../tests/mol-pair-lennard_mdf.yaml | 66 ++++----- .../force-styles/tests/mol-pair-lj96_cut.yaml | 66 ++++----- .../tests/mol-pair-lj_charmm_coul_charmm.yaml | 68 ++++----- ...l-pair-lj_charmm_coul_charmm_implicit.yaml | 68 ++++----- .../tests/mol-pair-lj_charmm_coul_long.yaml | 68 ++++----- .../mol-pair-lj_charmm_coul_long_soft.yaml | 68 ++++----- .../tests/mol-pair-lj_charmm_coul_msm.yaml | 68 ++++----- .../mol-pair-lj_charmm_coul_msm_table.yaml | 68 ++++----- .../tests/mol-pair-lj_charmm_coul_table.yaml | 68 ++++----- .../mol-pair-lj_charmmfsw_coul_charmmfsw.yaml | 68 ++++----- .../mol-pair-lj_charmmfsw_coul_long.yaml | 68 ++++----- .../mol-pair-lj_charmmfsw_coul_table.yaml | 68 ++++----- .../tests/mol-pair-lj_class2.yaml | 66 ++++----- .../tests/mol-pair-lj_class2_coul_cut.yaml | 68 ++++----- .../mol-pair-lj_class2_coul_cut_soft.yaml | 68 ++++----- .../tests/mol-pair-lj_class2_coul_long.yaml | 68 ++++----- .../mol-pair-lj_class2_coul_long_cs.yaml | 68 ++++----- .../mol-pair-lj_class2_coul_long_soft.yaml | 68 ++++----- .../tests/mol-pair-lj_class2_coul_table.yaml | 68 ++++----- .../mol-pair-lj_class2_coul_table_cs.yaml | 68 ++++----- .../tests/mol-pair-lj_class2_soft.yaml | 66 ++++----- .../force-styles/tests/mol-pair-lj_cubic.yaml | 66 ++++----- .../force-styles/tests/mol-pair-lj_cut.yaml | 66 ++++----- .../tests/mol-pair-lj_cut_coul_cut.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_cut_soft.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_debye.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_dsf.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_long.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_long_cs.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_long_soft.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_msm.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_msm_table.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_table.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_table_cs.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_coul_wolf.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_soft.yaml | 66 ++++----- .../tests/mol-pair-lj_cut_tip4p_cut.yaml | 68 ++++----- .../tests/mol-pair-lj_cut_tip4p_long.yaml | 68 ++++----- .../mol-pair-lj_cut_tip4p_long_soft.yaml | 82 +++++------ .../tests/mol-pair-lj_cut_tip4p_table.yaml | 68 ++++----- .../tests/mol-pair-lj_expand.yaml | 66 ++++----- .../tests/mol-pair-lj_expand_coul_long.yaml | 68 ++++----- .../tests/mol-pair-lj_expand_coul_table.yaml | 68 ++++----- .../tests/mol-pair-lj_gromacs.yaml | 66 ++++----- .../mol-pair-lj_gromacs_coul_gromacs.yaml | 68 ++++----- .../tests/mol-pair-lj_long_coul_long.yaml | 68 ++++----- .../tests/mol-pair-lj_long_coul_off.yaml | 66 ++++----- .../tests/mol-pair-lj_long_cut_coul_long.yaml | 68 ++++----- .../mol-pair-lj_long_cut_tip4p_long.yaml | 68 ++++----- .../tests/mol-pair-lj_long_tip4p_long.yaml | 68 ++++----- .../force-styles/tests/mol-pair-lj_mdf.yaml | 66 ++++----- .../force-styles/tests/mol-pair-lj_sdk.yaml | 66 ++++----- .../tests/mol-pair-lj_sdk_coul_long.yaml | 68 ++++----- .../tests/mol-pair-lj_sdk_coul_msm.yaml | 68 ++++----- .../tests/mol-pair-lj_sdk_coul_msm_table.yaml | 68 ++++----- .../tests/mol-pair-lj_sdk_coul_table.yaml | 68 ++++----- .../tests/mol-pair-lj_smooth.yaml | 66 ++++----- .../tests/mol-pair-lj_smooth_linear.yaml | 66 ++++----- .../tests/mol-pair-lj_table_coul_long.yaml | 68 ++++----- .../tests/mol-pair-lj_table_coul_off.yaml | 68 ++++----- .../tests/mol-pair-lj_table_coul_table.yaml | 68 ++++----- .../tests/mol-pair-lj_table_tip4p_long.yaml | 68 ++++----- .../tests/mol-pair-lj_table_tip4p_table.yaml | 68 ++++----- .../force-styles/tests/mol-pair-mie_cut.yaml | 66 ++++----- .../force-styles/tests/mol-pair-morse.yaml | 93 ++++++------ .../tests/mol-pair-morse_smooth_linear.yaml | 66 ++++----- .../tests/mol-pair-morse_soft.yaml | 68 ++++----- .../force-styles/tests/mol-pair-nm_cut.yaml | 66 ++++----- .../tests/mol-pair-nm_cut_coul_cut.yaml | 68 ++++----- .../tests/mol-pair-nm_cut_coul_long.yaml | 68 ++++----- .../tests/mol-pair-nm_cut_coul_table.yaml | 68 ++++----- .../tests/mol-pair-python_hybrid.yaml | 68 ++++----- .../tests/mol-pair-python_lj.yaml | 66 ++++----- .../force-styles/tests/mol-pair-soft.yaml | 82 +++++------ .../force-styles/tests/mol-pair-table.yaml | 66 ++++----- .../tests/mol-pair-tip4p_cut.yaml | 66 ++++----- .../tests/mol-pair-tip4p_long.yaml | 66 ++++----- .../tests/mol-pair-tip4p_long_soft.yaml | 78 +++++----- .../tests/mol-pair-tip4p_table.yaml | 66 ++++----- unittest/force-styles/tests/mol-pair-ufm.yaml | 66 ++++----- .../force-styles/tests/mol-pair-yukawa.yaml | 66 ++++----- unittest/force-styles/tests/mol-pair-zbl.yaml | 66 ++++----- .../force-styles/tests/mol-pair-zero.yaml | 4 +- 333 files changed, 9836 insertions(+), 9839 deletions(-) diff --git a/unittest/force-styles/tests/angle-charmm.yaml b/unittest/force-styles/tests/angle-charmm.yaml index c56e3ae6f..f330ebc95 100644 --- a/unittest/force-styles/tests/angle-charmm.yaml +++ b/unittest/force-styles/tests/angle-charmm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -1.2828590583680111e-01 1.0531267905268624e+00 -3.5872993954368049e-01 28 -2.1397316777571888e+01 -6.8536308873550515e+00 -1.0104593869135021e+01 29 2.1525602683408689e+01 5.8005040968281891e+00 1.0463323808678702e+01 -run_energy: 69.5038576349246 +run_energy: 85.0418773515778 run_stress: ! |2- - 1.5649327850389238e+02 -1.3576175184752444e+01 1.0301817481047499e+02 1.1751125350905258e+02 8.1820504826714767e+01 8.0309752683500211e+00 + 1.8012121267556859e+02 -4.6946144659715401e+00 1.1788231937577407e+02 1.3413231562226755e+02 9.2660175182735685e+01 2.3291837947470942e+01 run_forces: ! |2 - 1 3.2673907043103924e+01 7.0945689163394468e+00 -1.8445622162375827e+01 - 2 3.9740242751610664e+00 2.9513087966460372e+00 -5.0029928500601795e+00 - 3 7.2187270355452906e+00 -5.9092128037891003e+00 1.4203606972280422e+01 - 4 -1.6927467901050289e+01 -7.3859651827093025e+00 -1.4353585997401646e+01 - 5 -1.8409024900834989e+01 -3.4535581103141681e+01 1.3272518754203558e+01 - 6 2.0589410812493110e+01 8.0236562189313609e+00 -1.2960642418999164e+01 - 7 -2.3631931177375314e+01 1.8664083313377326e+01 -2.1460676242173019e+01 - 8 4.4078064602776070e+00 -1.9506406597487576e+01 7.6157986021827725e+01 - 9 -1.2872279366933459e+01 1.3367415437083203e+01 -6.7987510304161081e-01 - 10 1.7068495816883917e+01 1.3277171419237666e+01 -3.6716828531348568e+01 - 11 -2.0022241908167199e+01 -4.3872495528933699e+00 8.3275988802544596e+00 - 12 -7.7453219525172825e+00 -1.8894522494274831e+01 9.0662328749664240e+00 - 13 2.2164198238442463e+01 -1.6052737131589645e+01 7.1273217580409165e+00 - 14 -5.1588905300387884e+00 -1.8946152907089644e+00 -2.9531709636198215e+01 - 15 -2.5742212978495180e+00 2.1122073440175640e+01 2.4271434448540585e+01 - 16 -3.5711419901429564e-01 2.2624935653043305e+01 -8.4643921759749290e+00 - 17 -3.9807644812623544e-01 1.4410769617604862e+00 -4.8103745925409314e+00 - 18 -1.1328653272278899e-01 -8.7030074096365340e-01 3.4079850166128001e+00 - 19 -1.4296841483844430e+01 -1.2025900714259519e+01 -5.1480379176678346e+00 - 20 1.4410128016567219e+01 1.2896201455223173e+01 1.7400529010550347e+00 - 21 -1.4384266302963056e-01 -1.6712728564325374e-01 5.3093449084065192e-01 - 22 -1.9343247281638671e+01 -8.6574192096222582e+00 -8.4047349351069993e+00 - 23 1.9487089944668302e+01 8.8245464952655119e+00 7.8738004442663474e+00 - 24 6.6099237575914671e-01 -2.5342427128367895e+00 1.4932164263150582e+00 - 25 -1.7526054501171469e+01 -8.8950231017495049e+00 -1.0437094403998735e+01 - 26 1.6865062125412322e+01 1.1429265814586294e+01 8.9438779776836768e+00 - 27 2.7630957147703228e-01 -2.0949168656441595e+00 6.7238481135276018e-01 - 28 -1.9195019940436467e+01 -4.6371717881364969e+00 -9.5643824275161027e+00 - 29 1.8918710368959434e+01 6.7320886537806564e+00 8.8919976161633425e+00 + 1 3.8118215247385578e+01 9.3158891150979617e+00 -2.2235196779381894e+01 + 2 4.7446383048075313e+00 5.6766508464956900e+00 -3.6982594464011989e+00 + 3 3.1149110433173788e+00 -2.9235876910292546e-01 2.0771850131756278e+01 + 4 -1.9213776668483394e+01 -1.0713679638456888e+01 -1.9827377096781120e+01 + 5 -1.8462986210023516e+01 -4.0912757647333258e+01 1.6016557702839879e+01 + 6 2.1320408843036898e+01 5.6489845377932966e+00 -1.6840267466256492e+01 + 7 -2.5337148538378756e+01 1.9575167714362749e+01 -2.4211425008511085e+01 + 8 1.0402500234579088e+01 -2.3124673095658373e+01 9.0001704276300842e+01 + 9 -1.5935169154860102e+01 1.6504102172504812e+01 -4.0325180892868806e-01 + 10 1.5361132526764665e+01 1.6972436102402419e+01 -5.0009834334305353e+01 + 11 -2.1009023103269463e+01 -6.7853788579354752e+00 9.3150254065112641e+00 + 12 -4.1242681396404217e+00 -1.8884325060764713e+01 7.5941409807812175e+00 + 13 2.6716685384920325e+01 -1.8479210646320460e+01 7.6519504974846377e+00 + 14 -8.9813963745393934e+00 -5.6081411585049104e+00 -3.4974606169627144e+01 + 15 -3.9068665424157736e+00 2.5127983108798688e+01 3.1708967596018880e+01 + 16 -2.8902838051274999e+00 2.5379491745385284e+01 -7.2873773066545091e+00 + 17 8.2426951926853897e-02 5.9981953123609699e-01 -3.5726011748455146e+00 + 18 6.2973687099251663e-02 6.3250354487009020e-01 -2.5567134127911926e+00 + 19 -1.8456670000846625e+01 -1.6104493093882169e+01 -3.3376194263865493e+00 + 20 1.8393696313747373e+01 1.5471989549012079e+01 5.8943328391777419e+00 + 21 1.4361256154637871e+00 1.7851691643692806e+00 -5.3662421470650266e+00 + 22 -2.4004457378745911e+01 -1.1572072140686995e+01 -7.2248711252066702e+00 + 23 2.2568331763282124e+01 9.7869029763177142e+00 1.2591113272271697e+01 + 24 -5.1634756740144283e-01 2.0044573777520096e+00 -1.1921659540752660e+00 + 25 -1.9528421728171214e+01 -1.2408015443757698e+01 -1.0307901340145479e+01 + 26 2.0044769295572657e+01 1.0403558066005688e+01 1.1500067294220745e+01 + 27 -1.1702126880387453e-01 9.5304786947607312e-01 -3.2276094262571320e-01 + 28 -2.1371463893292912e+01 -6.8023506048817319e+00 -1.0118342451922880e+01 + 29 2.1488485162096786e+01 5.8493027354056588e+00 1.0441103394548593e+01 ... diff --git a/unittest/force-styles/tests/angle-class2.yaml b/unittest/force-styles/tests/angle-class2.yaml index db25af816..a82e2f66b 100644 --- a/unittest/force-styles/tests/angle-class2.yaml +++ b/unittest/force-styles/tests/angle-class2.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -57,37 +57,37 @@ init_forces: ! |2 27 -1.3120258950869723e-01 2.3248353742613195e+00 -7.0687277526256109e-01 28 -7.9798149428972343e-01 -1.3623378004463826e+00 -7.5274691791676882e-02 29 9.2918408379842066e-01 -9.6249757381493684e-01 7.8214746705423799e-01 -run_energy: 34.7710094271953 +run_energy: 45.4459195202412 run_stress: ! |2- - 8.2599011234487151e+01 -7.3165139178918366e+01 1.3818327814911246e+01 6.3916212989349248e+01 -3.2786151147810777e+01 -1.4139354495141657e+01 + 1.0224296939567702e+02 -8.5149951148281033e+01 1.1077450496851872e+01 9.2245165502849829e+01 -3.1084418227269154e+01 5.2366663320491313e-01 run_forces: ! |2 - 1 3.7927137109518426e+01 1.1345776743648571e+01 -1.1972422647418604e+01 - 2 -2.2530141117266576e+00 -1.6730807513104189e+01 -1.3830069636798278e+01 - 3 -1.2807806269040759e+01 2.6810763173904366e+01 3.2102458810037781e+01 - 4 -1.1543379425440360e+01 -1.2065849590554350e+01 1.2118821024647799e+01 - 5 -3.4453012748727886e+01 -3.1526964872763209e+01 -1.7061761972273043e+01 - 6 5.3123872542884158e+01 -9.8153013707847077e+00 -3.3412834234377840e+01 - 7 -1.5837635364590703e+01 1.5464812605191852e+01 2.9906954026383756e+00 - 8 -1.2643102528312030e+01 -1.6828317157412190e+01 6.6126868188102918e+01 - 9 -1.2422473327569506e+01 1.5140643860855519e+01 3.1927481107090356e+00 - 10 -4.5692218152548030e+00 1.9877718754870362e+01 -5.0445651839786777e+01 - 11 -2.0547249589519271e+01 -4.0809878372375428e+00 6.3993979128429981e+00 - 12 1.6677222553183326e+00 -7.8902083302551942e+00 -4.6574156789871370e+00 - 13 1.3788011824015860e+00 3.6786720583203052e+00 8.0456037446080408e-01 - 14 1.4612683317625487e+01 8.9627450118438645e-01 -5.0334728663917501e+00 - 15 8.6954758759595663e+00 -2.6866239131863328e+00 7.8777888670824670e+00 - 16 1.0980375091174608e+01 6.6690299994953675e+00 5.5514979818966026e+00 - 17 -1.3091721947001891e+00 1.7413688878269715e+00 -7.5120779638533652e-01 - 18 -2.9253358773418248e-01 -1.0692065587751192e+00 3.5574890115063189e+00 - 19 1.2218057627151511e+00 1.4528878204712177e+00 -1.4511972616407449e+00 - 20 -9.2927217498096859e-01 -3.8368126169609845e-01 -2.1062917498655742e+00 - 21 7.2982701997905797e-01 7.4575563779175358e-01 -2.1049026413553120e+00 - 22 -1.1629868443291469e+00 -7.2090297774647027e-01 6.5350153907281450e-01 - 23 4.3315982435008887e-01 -2.4852660045283331e-02 1.4514011022824975e+00 - 24 2.1047126806247407e-01 -1.2182537484601070e+00 6.3301123686955307e-01 - 25 3.4461103224844192e-01 8.3416580594917367e-01 -4.7213084508628128e-02 - 26 -5.5508230031091599e-01 3.8408794251093342e-01 -5.8579815236092492e-01 - 27 -4.0872631365042086e-02 3.4985032854784381e-01 -1.0933719967980113e-01 - 28 -9.5501418104510585e-02 -2.0817696072436775e-01 -1.8145761036114749e-03 - 29 1.3637404946955267e-01 -1.4167336782347603e-01 1.1115177578341261e-01 + 1 4.6696948163060675e+01 9.5469544165543052e+00 -2.1330948302985508e+01 + 2 -1.7341210851964273e+00 -1.4128897827282087e+01 -1.1408863992275160e+01 + 3 -1.0105551089272240e+01 4.2277702428791336e+01 3.9657670069675063e+01 + 4 -1.6122111935066883e+01 -2.0098532812588481e+01 1.2653235408843411e+01 + 5 -4.2111565648427224e+01 -4.1283493356078523e+01 -1.7589964848850386e+01 + 6 5.6633343610296642e+01 -1.3630420678353568e+01 -3.9740642386699271e+01 + 7 -1.8067962126721181e+01 1.7005582120491120e+01 1.5568169485445109e+00 + 8 -1.0459403976386902e+01 -1.5611162457913967e+01 8.4226500676174069e+01 + 9 -1.4631300686651667e+01 1.7116506905325277e+01 3.5366459989463483e+00 + 10 -9.1067423535925318e+00 2.5083637022662394e+01 -6.6120603070314331e+01 + 11 -2.0531188000382802e+01 -7.0572039110412836e+00 7.4976926119744087e+00 + 12 -4.5804053460484440e-01 -6.7408368318088137e+00 -7.3612432437675679e+00 + 13 3.0256565331949181e+00 7.9773964875310250e+00 -1.1599249084139895e+00 + 14 1.6325797226942768e+01 -6.0364594808671850e+00 -6.0596304628457736e+00 + 15 1.2032950547216590e+01 -4.6547008559207024e+00 1.4984306358892226e+01 + 16 9.4390365741788855e+00 9.1831264349550388e+00 6.8856125869099509e+00 + 17 -8.2574521858778427e-01 1.0508023955441044e+00 -2.2665944380799952e-01 + 18 4.1662989783566795e-01 1.4355996853101134e+00 -4.6916036738076876e+00 + 19 -1.7454972366844239e+00 -2.0016596312326365e+00 1.8125096846165301e+00 + 20 1.3288673388487560e+00 5.6605994592252307e-01 2.8790939891911576e+00 + 21 3.7257661846966093e+00 4.0481711597815977e+00 -1.0827752619904448e+01 + 22 -6.1593135050903065e+00 -3.9305106214838132e+00 3.2463364124342222e+00 + 23 2.4335473203936973e+00 -1.1766053829778456e-01 7.5814162074702249e+00 + 24 -7.6007405188534261e-01 4.2086623877720974e+00 -2.2508903613389659e+00 + 25 -1.2107922910240914e+00 -2.8924997143595577e+00 1.9797185345341334e-01 + 26 1.9708663429094340e+00 -1.3161626734125400e+00 2.0529185078855527e+00 + 27 -1.2690270648686752e-01 2.1785298399231308e+00 -6.5914069723159696e-01 + 28 -7.4337188418354749e-01 -1.2769741286441925e+00 -7.1075298614674390e-02 + 29 8.7027459067041502e-01 -9.0155571127893830e-01 7.3021599584627139e-01 ... diff --git a/unittest/force-styles/tests/angle-class2_p6.yaml b/unittest/force-styles/tests/angle-class2_p6.yaml index 8cc8903b1..f8b398257 100644 --- a/unittest/force-styles/tests/angle-class2_p6.yaml +++ b/unittest/force-styles/tests/angle-class2_p6.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 01:47:32 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -26,68 +26,68 @@ extract: ! "" natoms: 29 init_energy: 45.6314933281677 init_stress: ! |2- - 1.0380655176146684e+02 -8.5598294304262993e+01 1.0547225768036336e+01 9.3533997442530406e+01 -3.0452940351933222e+01 1.6213985364060386e+00 + 1.0380655176146676e+02 -8.5598294304263064e+01 1.0547225768036466e+01 9.3533997442530364e+01 -3.0452940351933286e+01 1.6213985364060581e+00 init_forces: ! |2 - 1 4.7202230480286410e+01 9.2446782757168116e+00 -2.1892853730747078e+01 - 2 -1.7062799943363016e+00 -1.3815333539761287e+01 -1.1109218053986506e+01 - 3 -1.0819442137600223e+01 4.2755643579721415e+01 4.0131978148937151e+01 + 1 4.7202230480286389e+01 9.2446782757168187e+00 -2.1892853730746999e+01 + 2 -1.7062799943363052e+00 -1.3815333539761312e+01 -1.1109218053986531e+01 + 3 -1.0819442137600213e+01 4.2755643579721394e+01 4.0131978148937094e+01 4 -1.6107331786015202e+01 -2.0450833016170897e+01 1.2394698445624217e+01 - 5 -4.1996775288710353e+01 -4.1451276926607711e+01 -1.7536151963373868e+01 + 5 -4.1996775288710346e+01 -4.1451276926607676e+01 -1.7536151963373857e+01 6 5.6640330905804802e+01 -1.3581373316126099e+01 -3.9714075413905050e+01 7 -1.8054191673295325e+01 1.6982840171711775e+01 1.5587849314106879e+00 8 -1.0524752828621686e+01 -1.5572494690475857e+01 8.4307006012653105e+01 9 -1.4606116746275049e+01 1.7088845087132931e+01 3.5265010989798085e+00 - 10 -9.2183983294618042e+00 2.5308833813269260e+01 -6.6220570658369539e+01 - 11 -2.0536178089795960e+01 -7.0922505905966320e+00 7.5061958159305702e+00 - 12 -2.8507497680541416e-01 -6.5761946491161325e+00 -7.8131884119322699e+00 - 13 3.1055913097859396e+00 8.1431291943766322e+00 -1.2597770427903274e+00 - 14 1.6321556949530393e+01 -6.4737931388147860e+00 -6.0969371866598241e+00 + 10 -9.2183983294618113e+00 2.5308833813269253e+01 -6.6220570658369525e+01 + 11 -2.0536178089795950e+01 -7.0922505905966178e+00 7.5061958159305595e+00 + 12 -2.8507497680544613e-01 -6.5761946491161254e+00 -7.8131884119322397e+00 + 13 3.1055913097859387e+00 8.1431291943766304e+00 -1.2597770427903630e+00 + 14 1.6321556949530429e+01 -6.4737931388148002e+00 -6.0969371866598330e+00 15 1.2014697273266693e+01 -4.7819939276460772e+00 1.5497663357748195e+01 16 9.3845137052789855e+00 9.2380146356987876e+00 6.9332800900251534e+00 17 -8.1437877303591466e-01 1.0335590376878656e+00 -2.1333543954444023e-01 - 18 4.7908727278799290e-01 1.6800089017686126e+00 -5.5268872325673559e+00 - 19 -2.0533806022955741e+00 -2.3525963295672678e+00 2.1320669593942387e+00 - 20 1.5742933295075812e+00 6.7258742779865532e-01 3.3948202731731172e+00 - 21 3.9487365123921143e+00 4.3175299645965666e+00 -1.1481914586060437e+01 - 22 -6.5477065825321858e+00 -4.1918674696341007e+00 3.4304242277121499e+00 - 23 2.5989700701400715e+00 -1.2566249496246629e-01 8.0514903583482873e+00 + 18 4.7908727278798890e-01 1.6800089017685975e+00 -5.5268872325673071e+00 + 19 -2.0533806022955563e+00 -2.3525963295672470e+00 2.1320669593942201e+00 + 20 1.5742933295075674e+00 6.7258742779864933e-01 3.3948202731730870e+00 + 21 3.9487365123920992e+00 4.3175299645965515e+00 -1.1481914586060395e+01 + 22 -6.5477065825321601e+00 -4.1918674696340856e+00 3.4304242277121375e+00 + 23 2.5989700701400609e+00 -1.2566249496246562e-01 8.0514903583482571e+00 24 -8.4094044796366130e-01 4.6838059399926504e+00 -2.5056978760993669e+00 25 -1.3589398825660985e+00 -3.2194809423072277e+00 2.1726605118393005e-01 26 2.1998803305297598e+00 -1.4643249976854225e+00 2.2884318249154370e+00 27 -1.3120258888530634e-01 2.3248353691437700e+00 -7.0687277351935407e-01 28 -7.9798149292664289e-01 -1.3623377973865247e+00 -7.5274691862757134e-02 29 9.2918408181194923e-01 -9.6249757175724537e-01 7.8214746538211122e-01 -run_energy: 34.7710021802843 +run_energy: 45.4458285940593 run_stress: ! |2- - 8.2597971291479197e+01 -7.3165155099119787e+01 1.3819523382589331e+01 6.3916255789759887e+01 -3.2786246459555542e+01 -1.4139108343887937e+01 + 1.0224054425179162e+02 -8.5151354715203126e+01 1.1081280882090672e+01 9.2245389115064398e+01 -3.1084294543117402e+01 5.2530572051471558e-01 run_forces: ! |2 - 1 3.7927352066617843e+01 1.1345578955697578e+01 -1.1972223392594877e+01 - 2 -2.2530151861588221e+00 -1.6730752730321111e+01 -1.3830028934174075e+01 - 3 -1.2808202999545058e+01 2.6810537449420028e+01 3.2101813074628957e+01 - 4 -1.1543428890097667e+01 -1.2065890478079011e+01 1.2118876491850669e+01 - 5 -3.4452953998071493e+01 -3.1526645749475254e+01 -1.7061508583515799e+01 - 6 5.3124061789690046e+01 -9.8153932766364225e+00 -3.3413445953998050e+01 - 7 -1.5837451909202500e+01 1.5464636644079322e+01 2.9907535647605528e+00 - 8 -1.2642499501331814e+01 -1.6827520447502955e+01 6.6128157110851689e+01 - 9 -1.2422527130616468e+01 1.5140727744495180e+01 3.1927309477457397e+00 - 10 -4.5699146984782653e+00 1.9876544474852427e+01 -5.0445553641851191e+01 - 11 -2.0546856915215699e+01 -4.0805919057130202e+00 6.3990200309451364e+00 - 12 1.6674386786922035e+00 -7.8898622136347321e+00 -4.6576734932525898e+00 - 13 1.3787930022897750e+00 3.6786663373190747e+00 8.0453816384512500e-01 - 14 1.4612585031889664e+01 8.9625154966459952e-01 -5.0334305413899969e+00 - 15 8.6954127506719381e+00 -2.6866238831447746e+00 7.8777491997152982e+00 - 16 1.0980388209061257e+01 6.6689588413014143e+00 5.5514416401958968e+00 - 17 -1.3091803001949562e+00 1.7413786876776518e+00 -7.5121568376248682e-01 - 18 -2.9253358583708966e-01 -1.0692065548636447e+00 3.5574890018854184e+00 - 19 1.2218057581339843e+00 1.4528878155123350e+00 -1.4511972583726351e+00 - 20 -9.2927217229689463e-01 -3.8368126064869040e-01 -2.1062917435127830e+00 - 21 7.2982725828986472e-01 7.4575588184549157e-01 -2.1049033311678720e+00 - 22 -1.1629872272200477e+00 -7.2090321482023068e-01 6.5350175240989561e-01 - 23 4.3315996893018294e-01 -2.4852667025260865e-02 1.4514015787579764e+00 - 24 2.1047126507496655e-01 -1.2182537322525984e+00 6.3301122830056489e-01 - 25 3.4461102790155146e-01 8.3416579486254627e-01 -4.7213083696926589e-02 - 26 -5.5508229297651801e-01 3.8408793739005220e-01 -5.8579814460363833e-01 - 27 -4.0872631407944005e-02 3.4985032920658937e-01 -1.0933719986668670e-01 - 28 -9.5501418324631770e-02 -2.0817696111033340e-01 -1.8145761309987267e-03 - 29 1.3637404973257578e-01 -1.4167336809625597e-01 1.1115177599768543e-01 + 1 4.6697063144899758e+01 9.5464292184313084e+00 -2.1329615486413495e+01 + 2 -1.7341213469343071e+00 -1.4128899311205867e+01 -1.1408865229626386e+01 + 3 -1.0106423829890657e+01 4.2276216760085092e+01 3.9655618981253937e+01 + 4 -1.6122153804166530e+01 -2.0098535935851185e+01 1.2653292967815302e+01 + 5 -4.2111045474433908e+01 -4.1281732299841927e+01 -1.7589329659171515e+01 + 6 5.6633872451307042e+01 -1.3631017853516695e+01 -3.9742648484553712e+01 + 7 -1.8067710814224181e+01 1.7005356519278848e+01 1.5568722867815019e+00 + 8 -1.0458368774535296e+01 -1.5609267760781632e+01 8.4230369919214809e+01 + 9 -1.4631291097137083e+01 1.7116505329041448e+01 3.5366441447941890e+00 + 10 -9.1083165882262076e+00 2.5081593622661249e+01 -6.6121298210985884e+01 + 11 -2.0530357257878578e+01 -7.0564447871249403e+00 7.4970247183653580e+00 + 12 -4.5873997835014801e-01 -6.7403152848189372e+00 -7.3618095936615644e+00 + 13 3.0256572433426814e+00 7.9773984059331964e+00 -1.1599242567025270e+00 + 14 1.6325706512702343e+01 -6.0365250687180749e+00 -6.0596004500231722e+00 + 15 1.2032945183866531e+01 -4.6546995895395877e+00 1.4984301967909428e+01 + 16 9.4390297519529085e+00 9.1831355042234861e+00 6.8856259318712949e+00 + 17 -8.2574532229437936e-01 1.0508025317442151e+00 -2.2665954686757872e-01 + 18 4.1662989358421232e-01 1.4355996421935044e+00 -4.6916034993533247e+00 + 19 -1.7454971864999060e+00 -2.0016595685522596e+00 1.8125096096904596e+00 + 20 1.3288672929156937e+00 5.6605992635875502e-01 2.8790938896628648e+00 + 21 3.7257651397379274e+00 4.0481698601097618e+00 -1.0827748711362894e+01 + 22 -6.1593116505043302e+00 -3.9305093611054267e+00 3.2463350269770475e+00 + 23 2.4335465107664027e+00 -1.1766049900433539e-01 7.5814136843858462e+00 + 24 -7.6007402633523591e-01 4.2086622887143186e+00 -2.2508903023980524e+00 + 25 -1.2107922707762828e+00 -2.8924996458903025e+00 1.9797184221876996e-01 + 26 1.9708662971115187e+00 -1.3161626428240165e+00 2.0529184601792827e+00 + 27 -1.2690270602781828e-01 2.1785298361926788e+00 -6.5914069596767511e-01 + 28 -7.4337188319492098e-01 -1.2769741264135199e+00 -7.1075298663885261e-02 + 29 8.7027458922273926e-01 -9.0155570977915866e-01 7.3021599463156039e-01 ... diff --git a/unittest/force-styles/tests/angle-cosine.yaml b/unittest/force-styles/tests/angle-cosine.yaml index 859ec02d5..69d3c7439 100644 --- a/unittest/force-styles/tests/angle-cosine.yaml +++ b/unittest/force-styles/tests/angle-cosine.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -1.3169752428031160e+01 1.0811335053602835e+02 -3.6826995619636030e+01 28 -2.8796447607995553e+01 -6.4642561032416026e+01 1.5016412228095177e+00 29 4.1966200036026713e+01 -4.3470789503612323e+01 3.5325354396826512e+01 -run_energy: 1244.44896829426 +run_energy: 1345.58352455998 run_stress: ! |2- - 7.4057360277435123e+01 -3.8153851541957792e+01 -3.5903508735477303e+01 1.8861542221783722e+02 1.1365123094061245e+02 4.5042317928787789e+01 + 9.6442128885179770e+01 -4.8453952330886217e+01 -4.7988176554293645e+01 2.1952791027456863e+02 1.5268865805166467e+02 4.9751785588281081e+01 run_forces: ! |2 - 1 2.4907774801316801e+01 -4.9097105331692447e+01 -1.2364427687199722e+02 - 2 2.9329284252306067e+00 5.9136887674803816e+01 5.9578880658069693e+01 - 3 -4.9358598590135983e+01 8.7357911188901411e+01 1.1815063455841008e+02 - 4 2.2801309262832241e+01 -3.3808192611166085e+01 -3.4426038400436340e+01 - 5 2.2901749282882996e+01 -4.4340179357063121e+01 -1.4034252770383354e+01 - 6 -2.1232712811654800e+01 -2.9663128182233024e+01 -1.1376964804336971e+01 - 7 -4.1498538426341085e+00 3.2515740219648457e+00 -8.3236439878832336e-01 - 8 -3.7098598501705879e+00 -1.0707670694548424e+01 2.7700184054685629e+01 - 9 -6.3662264579740047e+00 -5.8853748767646152e-01 1.5854728391634012e+00 - 10 7.0855889837651603e+01 1.3914454520313420e+01 -6.8649756458502495e+01 - 11 -6.6251217006404328e+00 -1.0347936786198247e+01 8.6106170239832309e+00 - 12 4.3689890692177016e+01 5.2862453136287321e+01 -7.3061355546777207e+01 - 13 -1.1000058138069159e+01 -2.3218918724450297e+01 2.4543715090723467e+01 - 14 -2.0286133917273787e+01 -2.2246959447705486e+01 8.4897844734619774e+00 - 15 -1.3775932261186291e+01 -1.4001847470995166e+01 2.8511113742212046e+01 - 16 -9.2929554847321441e+01 8.0121150626237551e+01 2.0816143303199841e+01 - 17 4.1344510114969339e+01 -5.8623955074779587e+01 2.8038463507312553e+01 - 18 3.5067522996202953e+00 2.7473790903689110e+01 -1.0786704322724714e+02 - 19 -2.5932029699667350e+01 -3.4796220764598054e+01 4.8447905016712532e+01 - 20 2.2425277400047054e+01 7.3224298609089438e+00 5.9419138210534612e+01 - 21 2.8907713907963231e+01 3.3285055664535903e+01 -1.0618104878004326e+02 - 22 -4.3942601855226357e+01 -2.9895567644474593e+01 4.0574906186582929e+01 - 23 1.5034887947263126e+01 -3.3894880200613144e+00 6.5606142593460334e+01 - 24 -2.5318186450837381e+01 9.7042233743697111e+01 -5.7098900235942409e+01 - 25 -1.3448719084456691e+01 -6.3904644057436585e+01 1.3824604979730214e+01 - 26 3.8766905535294072e+01 -3.3137589686260526e+01 4.3274295256212191e+01 - 27 -1.4527530941806340e+01 1.0822309703158444e+02 -3.4610780561171154e+01 - 28 -2.2021162614136024e+01 -6.3104302716506822e+01 3.1892598613773089e+00 - 29 3.6548693555942364e+01 -4.5118794315077615e+01 3.1421520699793842e+01 + 1 3.3310959657199788e+01 -5.8040296100287833e+01 -1.2945524266694179e+02 + 2 8.5870393959942355e+00 7.0408819029851827e+01 5.6967154758251091e+01 + 3 -6.9963805394039028e+01 1.1311751605237619e+02 1.4714334367816153e+02 + 4 2.5205511921403478e+01 -4.5763127545222865e+01 -5.3247479111835744e+01 + 5 2.9147753296847696e+01 -6.0006135675323264e+01 -1.2436844405719620e+01 + 6 -2.3612945069563093e+01 -3.0741773482400543e+01 -1.5833911790837433e+01 + 7 -3.4783970928297592e+00 3.4714797927419418e+00 -8.3388188085464598e-01 + 8 -7.6955423003026269e+00 -1.3330490711322678e+01 3.2198883597865581e+01 + 9 -5.6451797418385787e+00 1.3703447743044705e-01 1.2438564049293710e+00 + 10 8.1970312589029746e+01 1.8901344197998323e+01 -7.6804502158236602e+01 + 11 -9.9623834807537648e+00 -1.2063985935478257e+01 9.8149600848577947e+00 + 12 6.6390803648804933e+01 7.7416547844323759e+01 -1.0251227764683274e+02 + 13 -1.3551585037918830e+01 -3.6065386748220142e+01 3.6853405974077049e+01 + 14 -3.2837209388190558e+01 -3.0720562496461838e+01 1.0329597543938771e+01 + 15 -2.2873927088048177e+01 -1.6124397012641587e+01 4.3081420391749923e+01 + 16 -9.7092580240378680e+01 7.6805766058096722e+01 2.2551044477930834e+01 + 17 4.2101174324583191e+01 -5.7402351745460194e+01 3.0940472749496621e+01 + 18 2.7185549318300275e+00 2.7293151201690996e+01 -1.1031990986607916e+02 + 19 -3.1730292124836687e+01 -3.9630685029561079e+01 4.7371969938244661e+01 + 20 2.9011737193006660e+01 1.2337533827870082e+01 6.2947939927834497e+01 + 21 2.8232003255838382e+01 3.5093033729887964e+01 -1.0548961579957985e+02 + 22 -5.0045186259925117e+01 -3.4011670666288083e+01 3.7391132528990354e+01 + 23 2.1813183004086735e+01 -1.0813630635998841e+00 6.8098483270589497e+01 + 24 -2.4828750178936197e+01 9.6388338828877693e+01 -5.7326948398008653e+01 + 25 -1.9689710371376442e+01 -6.6594809397223244e+01 1.0930011630931592e+01 + 26 4.4518460550312639e+01 -2.9793529431654441e+01 4.6396936767077065e+01 + 27 -1.3292774366402444e+01 1.0824826079287187e+02 -3.6660087749220551e+01 + 28 -2.8665216034376339e+01 -6.4707180983415128e+01 1.4345369157760857e+00 + 29 4.1957990400778783e+01 -4.3541079809456747e+01 3.5225550833444466e+01 ... diff --git a/unittest/force-styles/tests/angle-cosine_delta.yaml b/unittest/force-styles/tests/angle-cosine_delta.yaml index b263f6a1e..131e91789 100644 --- a/unittest/force-styles/tests/angle-cosine_delta.yaml +++ b/unittest/force-styles/tests/angle-cosine_delta.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -6.3244441950917540e-01 5.1918732409438526e+00 -1.7685243510997071e+00 28 -1.3828773692511795e+00 -3.1042973063575339e+00 7.2112563744889890e-02 29 2.0153217887603549e+00 -2.0875759345863187e+00 1.6964117873548172e+00 -run_energy: 18.2003409008082 +run_energy: 20.5727973982101 run_stress: ! |2- - 3.3872130383583688e+01 -2.0203108056263353e+01 -1.3669022327320338e+01 2.7054391573877599e+01 -6.9089878415320687e+00 -6.0535185778451464e+00 + 4.0414601145881797e+01 -2.2259720000355941e+01 -1.8154881145525859e+01 3.4356097430708736e+01 -5.1760682620031746e+00 -3.0219001073831366e+00 run_forces: ! |2 - 1 1.3245232650922153e+01 3.6218277280062385e+00 -1.4529750862045901e+01 - 2 -2.5762761865352912e-01 -2.2483967947154540e+00 -1.8914626952462292e+00 - 3 1.2007953430748586e+00 2.1045408993510662e+01 2.3898295156139103e+01 - 4 -4.1015565110259633e+00 -7.4515930419094056e+00 3.0655976210098754e+00 - 5 -1.4588100141845420e+01 -1.9866510174530987e+01 -9.7244199677919596e+00 - 6 9.7606062512221108e+00 -2.1348704392604301e-01 -2.7476458544163060e+00 - 7 -4.2170497854398583e+00 3.9322852142373952e+00 -9.6285233383016777e-01 - 8 -3.5867461049279790e+00 -1.2783941196904046e+01 8.9920414636036909e+00 - 9 -5.1483394330670231e+00 4.9329753685231488e+00 -3.8260817368226015e-02 - 10 8.1976669125303250e+00 1.7001951885483685e+01 -1.2606926799949800e+01 - 11 -7.9443537768101660e+00 -3.3203186581551503e+00 4.1307936358349551e+00 - 12 -1.9853011300072776e+00 -4.0901436821658184e+00 -3.5280196001751740e+00 - 13 3.9644789677884618e-01 1.0201817948195213e+00 1.1014712196497394e+00 - 14 4.8390794740814744e+00 -1.8034199364431815e+00 -1.9594281272623011e+00 - 15 3.6061171450987146e+00 -1.8355059643785232e+00 5.1771161065009146e+00 - 16 -1.1433158990070389e+00 4.4426298066121817e+00 3.4562347063782628e-01 - 17 1.7264447270757763e+00 -2.3839442980642289e+00 1.2778283847099594e+00 - 18 1.0218018090007064e-01 7.8114061786890598e-01 -3.0568042156631439e+00 - 19 -8.5541764115951757e-01 -1.0906509728122966e+00 1.3428911990860488e+00 - 20 7.5323746025944693e-01 3.0951035494339063e-01 1.7139130165770950e+00 - 21 1.4464845721184005e+00 1.6808149006754534e+00 -5.3420486211475620e+00 - 22 -2.4674896510034650e+00 -1.6244488324559274e+00 1.9343735093145220e+00 - 23 1.0210050788850644e+00 -5.6366068219525944e-02 3.4076751118330399e+00 - 24 -8.4693551504412135e-01 3.2461804178277180e+00 -1.9128010708765943e+00 - 25 -6.1009105569295485e-01 -2.2332280205361030e+00 3.7334996274817822e-01 - 26 1.4570265707370762e+00 -1.0129523972916150e+00 1.5394511081284161e+00 - 27 -5.4153121699149231e-01 4.1113464239260065e+00 -1.3188046982828696e+00 - 28 -1.0440996822592261e+00 -2.4557418355727911e+00 2.4503330804486828e-02 - 29 1.5856308992507184e+00 -1.6556045883532153e+00 1.2943013674783828e+00 + 1 1.5854493147994463e+01 2.5625041903632990e+00 -1.8403707584219074e+01 + 2 -1.0778147157154860e-01 -8.7954374413254754e-01 -7.1033263283978343e-01 + 3 -3.5903740231366399e-01 2.6747382244473819e+01 2.7776094765308599e+01 + 4 -4.3667455132583095e+00 -9.9043336720964916e+00 2.2554137013680173e+00 + 5 -1.5435306686274910e+01 -2.3368620551346389e+01 -1.0071205010683155e+01 + 6 9.7004722937708081e+00 2.8185574443378769e-02 -2.6469111215932317e+00 + 7 -4.2051376166149819e+00 3.8059875922956321e+00 -9.2948254913796591e-01 + 8 -4.0811558306056366e+00 -1.3725195219352727e+01 9.4305267102762294e+00 + 9 -5.3018040121457650e+00 5.1712375236873847e+00 -5.5170438746634645e-02 + 10 8.5884631851414461e+00 1.8977169595422655e+01 -1.3503733846157104e+01 + 11 -8.2489793835708181e+00 -3.8307795657532537e+00 4.3670355271621792e+00 + 12 -2.2854196014067192e+00 -2.5730964210485894e+00 -5.5327026624884059e+00 + 13 6.8857552776933595e-01 1.7099649678302427e+00 8.4476951940004152e-01 + 14 5.0388676050555610e+00 -4.1380632752237574e+00 -2.2619786920581975e+00 + 15 4.2713089863647529e+00 -2.6164691252678391e+00 7.6327855841331669e+00 + 16 -1.6264161996020330e+00 4.5902884407035538e+00 4.2906258286847176e-01 + 17 1.8756029712680160e+00 -2.5566185549983746e+00 1.3795361474068404e+00 + 18 1.5949074618033343e-01 1.6020315457790026e+00 -6.4757984092122172e+00 + 19 -1.8652368265982293e+00 -2.3286173150011660e+00 2.7801057275919874e+00 + 20 1.7057460804178959e+00 7.2658576922216334e-01 3.6956926816202298e+00 + 21 2.3015994659382839e+00 2.8609989652412136e+00 -8.6002184142673883e+00 + 22 -4.0843967543541453e+00 -2.7748751066344628e+00 3.0465239349836288e+00 + 23 1.7827972884158614e+00 -8.6123858606750758e-02 5.5536944792837595e+00 + 24 -1.4105671680157137e+00 5.4757757163247867e+00 -3.2567653472769451e+00 + 25 -1.1213719131694582e+00 -3.7848791001392357e+00 6.1939772997236853e-01 + 26 2.5319390811851719e+00 -1.6908966161855510e+00 2.6373676173045766e+00 + 27 -6.3028932344593258e-01 5.1333019072248991e+00 -1.7384473964198532e+00 + 28 -1.3620336377103737e+00 -3.0692701554272013e+00 6.6735136389115601e-02 + 29 1.9923229611563062e+00 -2.0640317517976978e+00 1.6717122600307377e+00 ... diff --git a/unittest/force-styles/tests/angle-cosine_periodic.yaml b/unittest/force-styles/tests/angle-cosine_periodic.yaml index 10a9f9a39..814c837dc 100644 --- a/unittest/force-styles/tests/angle-cosine_periodic.yaml +++ b/unittest/force-styles/tests/angle-cosine_periodic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -8.7971258084923178e+00 7.2217511410368814e+01 -2.4599681382405976e+01 28 -1.9235439225569891e+01 -4.3179911322776611e+01 1.0030656861974458e+00 29 2.8032565034062209e+01 -2.9037600087592210e+01 2.3596615696208531e+01 -run_energy: 898.669772734792 +run_energy: 945.667120914027 run_stress: ! |2- - 3.3936204372603932e+01 -7.2755211808629142e+01 3.8819007436025174e+01 1.6151069358014291e+02 1.1122271842942311e+02 8.3043098226366141e+01 + 4.9007195370705645e+00 -6.4584848054201885e+01 5.9684128517131313e+01 1.4440631784196160e+02 1.0147779649040916e+02 5.0605123164347972e+01 run_forces: ! |2 - 1 7.8647097021183168e+00 -3.7093547118448015e+01 -3.4099814234220084e+01 - 2 2.9456677438664602e+00 3.4123500664937140e+01 3.1556016392203617e+01 - 3 -3.4392888865784570e+01 5.5344910610001463e+00 1.1711544615196097e+01 - 4 9.0015692545421935e+00 -1.3036349971874692e+01 -1.6198469551346488e+01 - 5 2.3856867402750257e+01 1.8173962539554573e+01 9.1115096388044901e+00 - 6 1.7297755719348569e+01 -5.1992350503881916e+01 -5.2590571126041354e+01 - 7 -1.2894995796626503e+01 1.1425994876327133e+01 -2.6289958101947062e+00 - 8 -3.0496678140531301e+00 4.8222767658323789e+01 1.0907333773569675e+02 - 9 1.0958040134070743e+01 -1.6579111670775131e+01 9.0204718126258499e-01 - 10 3.4102167065415358e+01 -2.5372584075860367e+01 -8.6937528514518704e+01 - 11 1.3180034953126475e+01 -2.0130739707376577e+00 -2.0931711282513064e+00 - 12 1.1921313929780105e+01 4.2874350368202158e+01 -4.0831713335532804e+01 - 13 -4.2875645042560926e+00 -1.0577885927408795e+01 1.3657542840704117e+01 - 14 -2.1333630780408757e+01 -1.4261977352199963e+01 8.1679784493533401e+00 - 15 -6.0420139779404423e+00 -4.1261509168202810e+00 9.4625675442032566e+00 - 16 -7.1328582006203121e+01 4.5444139936099887e+01 2.6124499942127727e+01 - 17 2.2201217840254124e+01 -3.0746175596437993e+01 1.5613219360553449e+01 - 18 3.2014329391340617e+00 2.4883747176264578e+01 -9.7595184207201612e+01 - 19 -2.4705881819407605e+01 -3.2561321639477612e+01 4.3525022787748128e+01 - 20 2.1504448880273543e+01 7.6775744632130341e+00 5.4070161419453484e+01 - 21 2.3973304149122125e+01 2.7715634331495849e+01 -8.8261932917781166e+01 - 22 -3.8201692739909106e+01 -2.5640471620503025e+01 3.3028167998478402e+01 - 23 1.4228388590786981e+01 -2.0751627109928243e+00 5.5233764919302772e+01 - 24 -2.2826773805811595e+01 8.7495257154504770e+01 -5.1508923828146763e+01 - 25 -1.3511636321489878e+01 -5.8443758368563152e+01 1.1695835075137913e+01 - 26 3.6338410127301472e+01 -2.9051498785941611e+01 3.9813088753008849e+01 - 27 -1.2897024354695333e+01 9.6663530848064681e+01 -3.0950112952782661e+01 - 28 -2.1142754917126503e+01 -5.6779623821268707e+01 2.1680211853374161e+00 - 29 3.4039779271821835e+01 -3.9883907026795981e+01 2.8782091767445245e+01 + 1 8.0595707378962782e+00 -3.9275884216073550e+01 -3.8921834622274609e+01 + 2 4.6450877231394490e+00 3.7989319504376653e+01 3.0709930231636147e+01 + 3 -4.4174062041610540e+01 -1.3116774304574319e+00 1.9852389406583850e+01 + 4 1.1432955350908090e+01 -7.3978491536336328e+00 -1.8963452260213845e+01 + 5 2.7565769765719310e+01 1.5533965769082254e+01 1.0064393083030197e+01 + 6 2.2437947870916961e+01 -5.4321180615060769e+01 -6.0748488446866872e+01 + 7 -1.5585343433722571e+01 1.3904433399215314e+01 -3.4020204287915634e+00 + 8 -2.7173598979194153e+00 4.7428178462168347e+01 1.2654691883960646e+02 + 9 9.4915406599908749e+00 -1.3885257714808199e+01 1.2160209239091246e+00 + 10 3.7036130179485966e+01 -2.6384482125884212e+01 -1.0013051660330657e+02 + 11 1.1913327728618880e+01 -1.7105485662994653e+00 -1.8898750666441195e+00 + 12 1.3449580650332301e+01 3.9344535800585398e+01 -3.9552691785632291e+01 + 13 -4.6002052262583266e+00 -1.2370495939576998e+01 1.4765847794019894e+01 + 14 -2.1313398317698834e+01 -9.6666833306404527e+00 7.4826992840481967e+00 + 15 -8.0459573339780484e+00 -2.8098768831377434e+00 7.2021609989661499e+00 + 16 -7.0394187900784956e+01 4.3284348202675552e+01 3.0478355256814506e+01 + 17 2.0798603484964556e+01 -2.8350845162531051e+01 1.5290163395115368e+01 + 18 1.7456021018344252e+00 1.7528557172698406e+01 -7.0852460721917453e+01 + 19 -2.0389936120749365e+01 -2.5462340563923114e+01 3.0421727677614534e+01 + 20 1.8644334018914940e+01 7.9337833912247095e+00 4.0430733044302912e+01 + 21 1.6517268317097550e+01 2.0531536618559141e+01 -6.1717967915716365e+01 + 22 -2.9293957935776255e+01 -1.9905577364456363e+01 2.1870035659045151e+01 + 23 1.2776689618678706e+01 -6.2595925410277875e-01 3.9847932256671214e+01 + 24 -1.6067082221526842e+01 6.2373469754139357e+01 -3.7096821397423525e+01 + 25 -1.2753486814048248e+01 -4.3101082367336026e+01 7.0662489242667057e+00 + 26 2.8820569035575090e+01 -1.9272387386803331e+01 3.0030572473156820e+01 + 27 -8.9233162938210242e+00 7.2669056612963558e+01 -2.4610439704365813e+01 + 28 -1.9256705992379011e+01 -4.3442840232212284e+01 9.5666525994413210e-01 + 29 2.8180022286200035e+01 -2.9226216380751275e+01 2.3653774444421682e+01 ... diff --git a/unittest/force-styles/tests/angle-cosine_shift.yaml b/unittest/force-styles/tests/angle-cosine_shift.yaml index e4e9ed561..3ea5e257e 100644 --- a/unittest/force-styles/tests/angle-cosine_shift.yaml +++ b/unittest/force-styles/tests/angle-cosine_shift.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -7.1800548840952522e-02 5.8942625899320822e-01 -2.0077814766093691e-01 28 -1.5699617393892926e-01 -3.5242662198670610e-01 8.1868406068466293e-03 29 2.2879672277988178e-01 -2.3699963700650206e-01 1.9259130705409028e-01 -run_energy: -2040.63077069513 +run_energy: -2039.70992482657 run_stress: ! |2- - 1.8310686397471056e+01 -1.9766050020348946e+01 1.4553636228778937e+00 1.8463931080825674e+01 -8.0238284000948319e+00 -3.0502781345431478e+00 + 2.1884369028041654e+01 -2.1572961501206787e+01 -3.1140752683487311e-01 2.2503542416936284e+01 -7.1010323713779107e+00 -4.7667733522911088e-01 run_forces: ! |2 - 1 1.0258967430248324e+01 2.9178373598499170e+00 -5.9717332761140582e+00 - 2 -3.7527403847168550e-01 -3.2039124097741083e+00 -2.6845142467401262e+00 - 3 1.2680671815880107e-01 1.1093877996487050e+01 1.1210949003218900e+01 - 4 -3.9015657807277431e+00 -4.8782217835571409e+00 3.6450806171598318e+00 - 5 -1.0933013895673353e+01 -1.0927588245593249e+01 -5.7382951966076332e+00 - 6 1.1545055139471865e+01 -2.3550717618404846e+00 -7.8577403422255436e+00 - 7 -3.9988397507260363e+00 3.5992515511250383e+00 -8.8394451579282052e-01 - 8 -1.5650407731295903e+00 -6.2301049441497263e+00 1.9480507036606689e+01 - 9 -3.8122890401988188e+00 3.9711822913218926e+00 -9.2300694007209860e-02 - 10 2.7237959288219704e+00 9.4351193254981247e+00 -1.5401072655475792e+01 - 11 -5.0281257663191061e+00 -1.3812326635240693e+00 2.1321393186162365e+00 - 12 -2.7245837281429690e+00 -3.3039899765537704e+00 -1.3085753923982779e+00 - 13 4.7256060382094789e-01 1.2549822606095533e+00 2.9633597502407327e-01 - 14 3.6626291552730308e+00 -9.7868575982728090e-01 -1.4628034210996188e+00 - 15 2.8605689471453637e+00 -1.0561324924605233e+00 3.1001474922357222e+00 - 16 4.0333190739736274e-01 2.4345817168477715e+00 1.3246631770460870e+00 - 17 2.8501694305163572e-01 -3.9189246445899734e-01 2.1115712055354072e-01 - 18 -2.2086707184166554e-02 -1.6866718907008105e-01 6.5994208997786830e-01 - 19 1.8591329871863366e-01 2.3653514582477400e-01 -2.8961181842013473e-01 - 20 -1.6382659153446710e-01 -6.7867956754692954e-02 -3.7033027155773357e-01 - 21 3.1937267791803831e-01 3.7127964631712718e-01 -1.1798074306115356e+00 - 22 -5.4816718570416034e-01 -3.6026307031720456e-01 4.2587666227557575e-01 - 23 2.2879450778612204e-01 -1.1016575999922604e-02 7.5393076833595984e-01 - 24 5.1107232226090191e-02 -1.9588609671194465e-01 1.1543215939027748e-01 - 25 3.7274030298908162e-02 1.3503495529000262e-01 -2.2273303479189550e-02 - 26 -8.8381262524998352e-02 6.0851141421942034e-02 -9.3158855911087926e-02 - 27 -1.7819443831854881e-02 1.3539505270425822e-01 -4.3435391388922689e-02 - 28 -3.4693371546939022e-02 -8.0959404754839370e-02 6.6185337951065945e-04 - 29 5.2512815378793903e-02 -5.4435647949418853e-02 4.2773538009412027e-02 + 1 1.1729965327753137e+01 2.0309465039937580e+00 -7.8168433859928701e+00 + 2 -2.8690907669612709e-01 -2.3408248041288271e+00 -1.8904024405804718e+00 + 3 -1.2101426442110605e+00 1.3046396788632865e+01 1.2686743519179629e+01 + 4 -4.0157133068859814e+00 -6.0413285160058381e+00 3.2759732209847456e+00 + 5 -1.1151252245101732e+01 -1.1823031459598438e+01 -5.7477685275722523e+00 + 6 1.1679071554466891e+01 -2.3821371898106709e+00 -8.0647944259245286e+00 + 7 -4.0436333893393481e+00 3.6085568466645626e+00 -8.8345495489791315e-01 + 8 -1.5720501682987593e+00 -6.2490866494297839e+00 2.0322570400660446e+01 + 9 -3.8773847073482228e+00 4.0321707581531978e+00 -1.0092426030683344e-01 + 10 2.4950309915282380e+00 1.0243563370421830e+01 -1.6323226863812724e+01 + 11 -5.0617993614350532e+00 -1.5865646155492252e+00 2.2134628805825742e+00 + 12 -2.7804616399817279e+00 -2.7173413351634137e+00 -2.3083882598042527e+00 + 13 7.0406551139329654e-01 1.7891407686069014e+00 5.4902670417189547e-04 + 14 3.8087054855508367e+00 -2.2550805601207946e+00 -1.6425772767430766e+00 + 15 3.1066662537207543e+00 -1.5209649073879441e+00 4.4863450259424873e+00 + 16 1.1276701136726819e-01 2.6604669761898063e+00 1.5256867664836677e+00 + 17 3.6307440351759024e-01 -4.9488197546798240e-01 2.6704955509720335e-01 + 18 3.5594731651478362e-02 3.5754617568109615e-01 -1.4452916048513413e+00 + 19 -4.1631944226432277e-01 -5.1973422661521229e-01 6.2046682525295860e-01 + 20 3.8072471061284441e-01 1.6218805093411612e-01 8.2482477959838274e-01 + 21 8.0768041329109708e-01 1.0039868270307482e+00 -3.0180050986490530e+00 + 22 -1.4333942307717482e+00 -9.7380588406119384e-01 1.0690540006512608e+00 + 23 6.2571381748065114e-01 -3.0180942969554370e-02 1.9489510979977922e+00 + 24 -2.9230035828102291e-01 1.1346982111179227e+00 -6.7487214093654868e-01 + 25 -2.3240045404791115e-01 -7.8432477795012601e-01 1.2833716322204347e-01 + 26 5.2470081232893406e-01 -3.5037343316779668e-01 5.4653497771450521e-01 + 27 -6.7185578265576251e-02 5.4718630412637759e-01 -1.8531032411402357e-01 + 28 -1.4519928493983825e-01 -3.2717363264043392e-01 7.1075012480917785e-03 + 29 2.1238486320541450e-01 -2.2001267148594361e-01 1.7820282286593178e-01 ... diff --git a/unittest/force-styles/tests/angle-cosine_shift_exp.yaml b/unittest/force-styles/tests/angle-cosine_shift_exp.yaml index 29bfef6fc..cf19a26b1 100644 --- a/unittest/force-styles/tests/angle-cosine_shift_exp.yaml +++ b/unittest/force-styles/tests/angle-cosine_shift_exp.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -1.6606843149042227e-01 1.3632917281328529e+00 -4.6438241208243458e-01 28 -3.6311851060900069e-01 -8.1513215809039241e-01 1.8935451056965480e-02 29 5.2918694209942296e-01 -5.4815957004246063e-01 4.4544696102546910e-01 -run_energy: -2039.29043001045 +run_energy: -2037.80459205009 run_stress: ! |2- - 2.3409626405776471e+01 -3.7232961535901836e+01 1.3823335130125358e+01 1.8449759086855384e+01 -7.3488270840678744e+00 -3.1148137591843422e-01 + 3.0879668883081692e+01 -4.0694932235648714e+01 9.8152633525670350e+00 2.4448196341774814e+01 -4.5553409231643682e+00 5.0039677219877552e+00 run_forces: ! |2 - 1 8.0428589704256108e+00 2.2708090982524816e+00 -4.7987857743863840e+00 - 2 -2.8603425623693968e-01 -2.4602004037743570e+00 -2.0620770260203209e+00 - 3 1.7264280207254812e-01 8.8002523612074697e+00 8.8952318893093274e+00 - 4 -3.1428320828032486e+00 -3.7236716004313912e+00 2.9955191594227242e+00 - 5 -8.4752028636791952e+00 -8.8166731897394168e+00 -4.5091079802875376e+00 - 6 1.6388366654752929e+01 -1.0978015918176180e+01 -1.6030724473567979e+01 - 7 -7.3333474089097619e+00 6.6154771575212230e+00 -1.5952702530603819e+00 - 8 -9.9495879633910107e+00 -6.5290136128246870e+00 3.6981006076061064e+01 - 9 -2.0514890000671424e+00 2.1522863253947992e+00 -4.1951085355430406e-02 - 10 -3.1672632320790863e+00 2.1956737246074329e+01 -2.2328088175633034e+01 - 11 -2.7428428824428139e+00 -6.6009787447421009e-01 1.0980321832849507e+00 - 12 5.2988043176816912e+00 -1.0568197888840341e+01 -1.6803391266640739e+00 - 13 4.3886792509740574e-01 1.1790091832467446e+00 3.5944901449824207e-02 - 14 2.4022290750639765e+00 -1.4256031492874959e+00 -1.0211981635931946e+00 - 15 2.5147668010632724e+00 -7.8541395353916721e-01 2.3784950715486572e+00 - 16 1.6612865071624283e+00 3.2868872409643104e+00 1.5137982245427686e+00 - 17 2.2877663628933234e-01 -3.1457102157412076e-01 1.6951455294901424e-01 - 18 -5.8573639011598344e-02 -4.4740423239723659e-01 1.7506070590277174e+00 - 19 4.9234026352605298e-01 6.2673211901571413e-01 -7.6845022559179077e-01 - 20 -4.3376662451445464e-01 -1.7932788661847754e-01 -9.8215683343592652e-01 - 21 5.6527731605870568e-01 6.5695715580814407e-01 -2.0878504727534364e+00 - 22 -9.6651487888787813e-01 -6.3588254799908128e-01 7.5512929355341774e-01 - 23 4.0123756282917239e-01 -2.1074607809062784e-02 1.3327211792000186e+00 - 24 1.7303510902300490e-01 -6.6321622461872431e-01 3.9081488381876378e-01 - 25 1.2580741418179542e-01 4.5695676956326187e-01 -7.5629713760882747e-02 - 26 -2.9884252320480031e-01 2.0625945505546239e-01 -3.1518517005788105e-01 - 27 -2.6492937596073685e-02 2.0127647383353192e-01 -6.4569466567704320e-02 - 28 -5.1515819720395997e-02 -1.2033663622868830e-01 1.0114575892329128e-03 - 29 7.8008757316469682e-02 -8.0939837604843634e-02 6.3558008978471400e-02 + 1 9.1065075023561857e+00 1.5880628525160212e+00 -6.1444158539252323e+00 + 2 -2.2120601316092470e-01 -1.8048900683424336e+00 -1.4575950333500403e+00 + 3 -8.8020860349230789e-01 1.0023819952999157e+01 1.0011075395081349e+01 + 4 -3.1949611249073353e+00 -4.4972636091879261e+00 2.7275485123228713e+00 + 5 -8.5561905637825024e+00 -9.3671157358673174e+00 -4.4987188315490245e+00 + 6 1.6924127918491227e+01 -1.1813112009133306e+01 -1.7269252631945022e+01 + 7 -7.7275309283106361e+00 6.8959935962791992e+00 -1.6879908061887305e+00 + 8 -1.0578617666906394e+01 -6.3070557164096739e+00 4.0167541859066304e+01 + 9 -2.0155081280748717e+00 2.0960609888075732e+00 -5.2372420878423531e-02 + 10 -3.7000669365902366e+00 2.3315895858044918e+01 -2.4794153457788465e+01 + 11 -2.6623377493898830e+00 -8.5722430546957917e-01 1.1780147069373170e+00 + 12 6.1869509528991031e+00 -1.0825619969584887e+01 -2.4188152548332642e+00 + 13 5.9278315713920104e-01 1.5098342475189601e+00 -7.2486607905087097e-02 + 14 2.3664615149623343e+00 -2.2180614621429084e+00 -1.0836697520688441e+00 + 15 2.6575970360093253e+00 -1.0854869034405092e+00 3.2366936975855358e+00 + 16 1.4222686476408712e+00 3.7277172864267203e+00 1.9527005103885702e+00 + 17 2.7993098511683995e-01 -3.8155500301401291e-01 2.0589596905018723e-01 + 18 8.2211837840863833e-02 8.2580271510648040e-01 -3.3380989192158892e+00 + 19 -9.6151893114112141e-01 -1.2003734500426124e+00 1.4330597800197054e+00 + 20 8.7930709330025758e-01 3.7457073493613208e-01 1.9050391391961838e+00 + 21 1.8633723509367264e+00 2.3162622990347179e+00 -6.9627301889775088e+00 + 22 -3.3067809167451636e+00 -2.2465627424418719e+00 2.4664395596036517e+00 + 23 1.4434085658084372e+00 -6.9699556592845990e-02 4.4962906293738572e+00 + 24 -6.7514953779542553e-01 2.6209051999893100e+00 -1.5588069291055300e+00 + 25 -5.3677043338745900e-01 -1.8116049285715730e+00 2.9644385708131005e-01 + 26 1.2119199711828845e+00 -8.0930027141773730e-01 1.2623630720242198e+00 + 27 -1.5521816821745804e-01 1.2641579324003485e+00 -4.2812026796333580e-01 + 28 -3.3544730250214505e-01 -7.5586394036097537e-01 1.6422714313808900e-02 + 29 4.9066547071960309e-01 -5.0829399203937309e-01 4.1169755364952693e-01 ... diff --git a/unittest/force-styles/tests/angle-cosine_squared.yaml b/unittest/force-styles/tests/angle-cosine_squared.yaml index 7a60bb65d..c9ab2e544 100644 --- a/unittest/force-styles/tests/angle-cosine_squared.yaml +++ b/unittest/force-styles/tests/angle-cosine_squared.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -2.5470038587839250e-01 2.0908906413094188e+00 -7.1222675189387996e-01 28 -5.5691755465898818e-01 -1.2501742404876248e+00 2.9041441818330599e-02 29 8.1161794053738068e-01 -8.4071640082179400e-01 6.8318531007554939e-01 -run_energy: 26.1675352329513 +run_energy: 35.7964731709877 run_stress: ! |2- - 6.2576019069139306e+01 -6.0860801678726162e+01 -1.7152173904131602e+00 5.0010514835868449e+01 -2.5620832842513124e+01 -1.4221451793506560e+01 + 8.1386079163985897e+01 -6.7672385446129056e+01 -1.3713693717856859e+01 7.5931272732679375e+01 -2.6246397151461188e+01 -5.8523230432862601e+00 run_forces: ! |2 - 1 3.0433701385846341e+01 1.1307355514996834e+01 -1.7921352396807546e+01 - 2 -1.4629435066474996e+00 -1.1780884627980214e+01 -9.8145855796458612e+00 - 3 -1.5182007813606839e+00 3.2285255139145235e+01 3.9064404411028590e+01 - 4 -1.0348744110198286e+01 -1.3094301866734417e+01 1.0128169901801693e+01 - 5 -3.2375489345607832e+01 -3.4370610680893911e+01 -2.0168357918693932e+01 - 6 3.4393337686199708e+01 -3.8003235361688583e+00 -1.8093233227629561e+01 - 7 -1.2106262519144842e+01 1.1078045184351328e+01 -2.6100423851877861e+00 - 8 -8.3560236482204910e+00 -2.5182156552649889e+01 4.8130027344858803e+01 - 9 -1.1471272138640636e+01 1.1840316345901936e+01 -4.9712898842505426e-01 - 10 1.2396338462040639e+01 3.4332880451417964e+01 -4.1601518933016564e+01 - 11 -1.8145647028143578e+01 -4.2265898912400477e+00 7.6862976472209601e+00 - 12 -5.2076108717465459e+00 -1.3047421301665519e+01 -4.1603314493525314e+00 - 13 8.7158531706520215e-01 2.3170016775399565e+00 1.5314194584713752e+00 - 14 1.2082035262688338e+01 -9.4165918550001049e-01 -4.5537527658096337e+00 - 15 7.2870758492678789e+00 -3.1937612071599899e+00 8.8378414744931124e+00 - 16 2.8635260343706244e+00 7.3964256110471656e+00 3.5494695660817350e+00 - 17 6.6459395223166917e-01 -9.1957107440755292e-01 4.9267384061220348e-01 - 18 -9.8995279817258641e-02 -7.5631006574017379e-01 2.9593774651803217e+00 - 19 8.3101921479118990e-01 1.0583749329236165e+00 -1.2993731762218426e+00 - 20 -7.3202393497393126e-01 -3.0206486718344266e-01 -1.6600042889584792e+00 - 21 6.1109204941448436e-01 7.0999737764087489e-01 -2.2566864027357312e+00 - 22 -1.0410043275800609e+00 -6.8558865111744138e-01 8.1771769653891901e-01 - 23 4.2991227816557653e-01 -2.4408726523433510e-02 1.4389687061968122e+00 - 24 3.3893778636536553e-01 -1.2990937371098246e+00 7.6550793422416807e-01 - 25 2.4572908656485981e-01 8.9465900936050491e-01 -1.4853157901068351e-01 - 26 -5.8466687293022535e-01 4.0443472774931966e-01 -6.1697635521348460e-01 - 27 -2.0166798479784136e-02 1.5319986542267661e-01 -4.9145781401381948e-02 - 28 -3.9170468228166465e-02 -9.1581870730467918e-02 7.8873212599255699e-04 - 29 5.9337266707950601e-02 -6.1617994692208702e-02 4.8357049275389391e-02 + 1 3.9504298737934299e+01 9.0362064390205923e+00 -3.1339457751434480e+01 + 2 -1.0002265079899280e+00 -8.1563440981107718e+00 -6.5866597501694137e+00 + 3 -2.9707237672744302e-01 5.2915623881067980e+01 5.1462135248962241e+01 + 4 -1.3474759165646581e+01 -2.1796354081389847e+01 1.0404041775592727e+01 + 5 -3.9969510582025805e+01 -4.7883964205194445e+01 -2.2295653940762463e+01 + 6 3.5513144692452883e+01 -5.2230478544001331e+00 -1.9967331414759983e+01 + 7 -1.3141080293140208e+01 1.1737017796016362e+01 -2.8719233967504918e+00 + 8 -7.5072163530686016e+00 -2.7612742492512091e+01 5.5531252764148959e+01 + 9 -1.3496615614426194e+01 1.3939678288256896e+01 -3.3102772174179584e-01 + 10 1.2306280437647038e+01 4.0751132927235759e+01 -5.0707025556664895e+01 + 11 -1.9057013299568268e+01 -6.9239381290868431e+00 8.9185294031013740e+00 + 12 -9.2656690702987667e+00 -1.0263709057962135e+01 -7.8624630945648750e+00 + 13 2.4489502984114528e+00 6.2284887545653573e+00 -8.8034212951717095e-02 + 14 1.4050613823675080e+01 -8.2707042101779802e+00 -6.0540825820707997e+00 + 15 1.1284464526661036e+01 -5.5287408576449808e+00 1.6299463854690750e+01 + 16 7.8869229788968109e-01 8.8407924519403771e+00 4.5226970079595503e+00 + 17 1.3127184482203083e+00 -1.7893955516240998e+00 9.6553936741530322e-01 + 18 1.2694956105094679e-01 1.2751722153999723e+00 -5.1545565105565174e+00 + 19 -1.4846968851065028e+00 -1.8535321439652668e+00 2.2128825320928631e+00 + 20 1.3577473240555560e+00 5.7835992856529450e-01 2.9416739784636539e+00 + 21 2.9244787860493995e+00 3.6352659652262287e+00 -1.0927678024393749e+01 + 22 -5.1895978704720935e+00 -3.5257644330904849e+00 3.8710622844172722e+00 + 23 2.2651190844226941e+00 -1.0950153213574376e-01 7.0566157399764782e+00 + 24 -1.0411087961103460e+00 4.0415481427544702e+00 -2.4037464775633905e+00 + 25 -8.2768762397509377e-01 -2.7935515297939277e+00 4.5714842187279736e-01 + 26 1.8687964200854397e+00 -1.2479966129605424e+00 1.9465980556905931e+00 + 27 -2.3770330946966578e-01 1.9359478428067436e+00 -6.5562900876955288e-01 + 28 -5.1370135722491139e-01 -1.1575378709264035e+00 2.5153324043681036e-02 + 29 7.5140466669457717e-01 -7.7840997188034011e-01 6.3047568472587190e-01 ... diff --git a/unittest/force-styles/tests/angle-cross.yaml b/unittest/force-styles/tests/angle-cross.yaml index 57802cd94..ccaf5f3be 100644 --- a/unittest/force-styles/tests/angle-cross.yaml +++ b/unittest/force-styles/tests/angle-cross.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 02:05:46 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -19,68 +19,68 @@ extract: ! "" natoms: 29 init_energy: -138.932277153618 init_stress: ! |- - -4.2805178950841434e+02 -6.8931627675603272e+02 -1.3391464673179194e+03 1.7315796064284473e+02 -4.7373177498509804e+01 -1.2493656046964837e+02 + -4.2805178950841440e+02 -6.8931627675603272e+02 -1.3391464673179194e+03 1.7315796064284467e+02 -4.7373177498509762e+01 -1.2493656046964831e+02 init_forces: ! |2 - 1 4.1261771156832864e+01 -3.9901180365329722e+01 -5.8374199387912931e+01 - 2 -3.6935073144563262e+01 -4.1436803276575638e+01 3.1801084962114309e+01 - 3 -3.2573818619875419e+02 -6.6500679467513812e+00 1.4291055848554771e+02 + 1 4.1261771156832864e+01 -3.9901180365329751e+01 -5.8374199387912959e+01 + 2 -3.6935073144563269e+01 -4.1436803276575645e+01 3.1801084962114324e+01 + 3 -3.2573818619875419e+02 -6.6500679467513315e+00 1.4291055848554771e+02 4 2.6997608680775113e+02 -7.2399407558115584e+01 1.5603217496050598e+02 - 5 9.0142725537811359e+01 8.3784243775028855e+01 -3.1041619931467909e+02 + 5 9.0142725537811359e+01 8.3784243775028870e+01 -3.1041619931467909e+02 6 7.0518354707600892e+01 -3.5688408606101547e+01 -1.9863264840396582e+01 7 -3.1099772047202357e+01 4.2191781474751821e+01 8.0541672920710511e+01 8 -3.3291691525631649e+01 1.1421233563604184e+02 4.5145975856099867e+01 9 -2.0097568628798609e+01 -2.8949808125067534e+01 -9.9834623873123718e+01 - 10 -1.8926705389391168e+02 -2.9499473880339724e+02 -1.9126304362253541e+02 - 11 1.0871064004892659e+02 1.9947452100760881e+02 3.3898316466944209e+02 - 12 1.6577321129406224e+02 2.3860689874372537e+02 -1.1277910127691004e+02 - 13 -1.3827402271990965e+02 2.9192785722581753e+01 1.5604081681362711e+01 - 14 3.2683184972651915e+01 -2.7370682688527136e+01 1.4257278340569977e+02 + 10 -1.8926705389391168e+02 -2.9499473880339724e+02 -1.9126304362253546e+02 + 11 1.0871064004892659e+02 1.9947452100760881e+02 3.3898316466944215e+02 + 12 1.6577321129406224e+02 2.3860689874372534e+02 -1.1277910127691004e+02 + 13 -1.3827402271990968e+02 2.9192785722581760e+01 1.5604081681362711e+01 + 14 3.2683184972651922e+01 -2.7370682688527136e+01 1.4257278340569979e+02 15 -1.3704545056389415e+01 -2.1010776334000127e+02 -5.4827359766131927e+01 16 -1.6260788071214986e+01 5.4319222370483033e+01 3.0878888817764548e+01 17 2.5602726760738861e+01 -4.2829280203544968e+00 -1.3711259367755784e+02 - 18 4.4382898505726800e+01 3.8575853540595062e+01 8.4942962936193993e+00 - 19 -4.0669070046367011e+01 -3.0398559842419200e+01 -2.9790776450486824e+01 - 20 -3.7138284593597923e+00 -8.1772936981758662e+00 2.1296480156867425e+01 - 21 4.8125944561078576e+01 2.1993457392981661e+01 2.1164315021860890e+01 - 22 -4.3995064087630098e+01 -1.6036579945545959e+01 -4.0751411025849421e+01 - 23 -4.1308804734484790e+00 -5.9568774474356996e+00 1.9587096003988531e+01 + 18 4.4382898505726807e+01 3.8575853540595070e+01 8.4942962936193780e+00 + 19 -4.0669070046367004e+01 -3.0398559842419193e+01 -2.9790776450486810e+01 + 20 -3.7138284593598030e+00 -8.1772936981758768e+00 2.1296480156867432e+01 + 21 4.8125944561078583e+01 2.1993457392981664e+01 2.1164315021860872e+01 + 22 -4.3995064087630091e+01 -1.6036579945545956e+01 -4.0751411025849407e+01 + 23 -4.1308804734484923e+00 -5.9568774474357085e+00 1.9587096003988535e+01 24 4.4750995566613383e+01 2.8951721466978508e+01 2.3322963994109926e+01 25 -4.8220422931020614e+01 -9.2520584071419378e+00 -3.3809259662730113e+01 26 3.4694273644072284e+00 -1.9699663059836571e+01 1.0486295668620187e+01 27 4.7585743845211717e+01 1.8785871750636648e+01 2.1506067119647888e+01 28 -4.9785651292999155e+01 1.9503981519706528e+00 -2.8387090726034970e+01 29 2.1999074477874405e+00 -2.0736269902607301e+01 6.8810236063870809e+00 -run_energy: -889.986798682076 -run_stress: ! |2- - 6.2032360151200282e+02 5.2404271480687089e+02 -7.9766346305103582e+02 1.8788017500161166e+02 -3.3065243080514335e+02 -1.9541086664451404e+02 +run_energy: -143.17285626124 +run_stress: ! |- + -4.2136943025425171e+02 -6.8143523471945389e+02 -1.3373080481523612e+03 1.7225234470532837e+02 -5.0415065989752279e+01 -1.2628092326319543e+02 run_forces: ! |2 - 1 1.2410095526751289e+02 7.7107736904240781e+01 -4.4093648318567098e+01 - 2 -4.4510271992921041e+01 -4.5619512048781388e+01 4.1046404593008859e+01 - 3 -7.1737120871520744e+02 1.1731035280496367e+02 3.1906281222623056e+02 - 4 2.9648870407307368e+02 -7.6538903731607789e+01 1.6140330965017336e+02 - 5 1.0026655172616390e+02 8.7788729411632005e+01 -3.4300001131890929e+02 - 6 3.4849367490473037e+02 -2.8205577430636208e+02 -2.5719791408224165e+02 - 7 -4.5693333755656603e+01 5.8517091234287307e+01 9.5255349706311947e+01 - 8 -1.5567919750483691e+02 3.5623689847871810e+02 2.5733162917382754e+02 - 9 -2.0241139553713793e+01 -4.5633636920096777e+01 -1.4136212461520404e+02 - 10 -5.0563564520435619e+02 -8.9458027939934959e+02 -5.1224441958153523e+02 - 11 9.9129502224764863e+01 2.4918320141218032e+02 5.3289039476810501e+02 - 12 5.4675965939691775e+02 7.2245181913254692e+02 -2.6073823924297500e+02 - 13 -1.6843077637066705e+02 2.0930840623941872e+01 1.3253648491547258e+01 - 14 3.6029135878922879e+01 -4.0482344788499539e+01 1.5508129105553371e+02 - 15 1.6546004038532232e+00 -2.7170978973512308e+02 -8.7945682620661728e+01 - 16 7.6285319212612194e+01 -2.2584716543975293e+01 2.1686618269540631e+02 - 17 2.8353470008807250e+01 -1.0321712528715462e+01 -1.4560898258005068e+02 - 18 5.0761083509487648e+01 4.5876997617787652e+01 4.1461514924504499e+00 - 19 -3.6248289725249840e+01 -2.7244416085659807e+01 -2.7471372147322061e+01 - 20 -1.4512793784237811e+01 -1.8632581532127848e+01 2.3325220654871611e+01 - 21 6.2092747177666155e+01 2.9035902409181922e+01 1.9655639900605195e+01 - 22 -4.4008555668269942e+01 -1.5835759606379121e+01 -4.1366741507205347e+01 - 23 -1.8084191509396216e+01 -1.3200142802802802e+01 2.1711101606600153e+01 - 24 5.2569537785929668e+01 4.0844673040252673e+01 2.5893306272073922e+01 - 25 -5.0354690954148325e+01 -1.0776153112111967e+01 -3.5642125276776859e+01 - 26 -2.2148468317813421e+00 -3.0068519928140702e+01 9.7488190047029395e+00 - 27 5.7654772845660396e+01 2.5751879999227995e+01 2.5827764093646238e+01 - 28 -5.1108879214123533e+01 3.5861424927109447e+00 -2.9419298155615849e+01 - 29 -6.5458936315368632e+00 -2.9338022491938940e+01 3.5915340619696101e+00 + 1 4.1923692106109975e+01 -3.9012621586607779e+01 -5.8344448698273837e+01 + 2 -3.7118533283239934e+01 -4.1610138580200328e+01 3.1878934012758794e+01 + 3 -3.2875608950810692e+02 -5.4575617693828899e+00 1.4423369516485488e+02 + 4 2.7006021790986608e+02 -7.2137893980818205e+01 1.5631086706713808e+02 + 5 9.0253422442019456e+01 8.3814641969903647e+01 -3.1060172880897829e+02 + 6 7.2812758717994200e+01 -3.8016446245662216e+01 -2.1645111449568191e+01 + 7 -3.1138799998448683e+01 4.2304748565035339e+01 8.0556472805651850e+01 + 8 -3.4052122008972383e+01 1.1561924521860692e+02 4.6504388187843233e+01 + 9 -2.0205307286762000e+01 -2.8933593317815955e+01 -1.0018846802005910e+02 + 10 -1.9195506001270834e+02 -2.9911198259816035e+02 -1.9309836172393551e+02 + 11 1.0897916905632175e+02 2.0014159923061675e+02 3.4037391562666085e+02 + 12 1.6857737718075367e+02 2.4231570592139727e+02 -1.1370297079679960e+02 + 13 -1.3875679683761231e+02 2.8854437622249360e+01 1.5551950102510107e+01 + 14 3.2678848269914070e+01 -2.7415338829175326e+01 1.4267344380443686e+02 + 15 -1.3311355451662230e+01 -2.1063122987826182e+02 -5.5389356311230543e+01 + 16 -1.5636586240749754e+01 5.3656270664040377e+01 3.2200339997560448e+01 + 17 2.5645164945283511e+01 -4.3798424057647338e+00 -1.3731356096056993e+02 + 18 4.4124140299118373e+01 3.8495708627761331e+01 8.0019354874683550e+00 + 19 -4.0145442933587447e+01 -3.0090733684041400e+01 -2.9218498199893862e+01 + 20 -3.9786973655309277e+00 -8.4049749437199317e+00 2.1216562712425507e+01 + 21 4.8448042879119711e+01 2.2185416657195066e+01 2.0791950145986359e+01 + 22 -4.4085362856941870e+01 -1.6113371744624057e+01 -4.0537326060438865e+01 + 23 -4.3626800221778375e+00 -6.0720449125710081e+00 1.9745375914452506e+01 + 24 4.4661630839973142e+01 2.9377912487833438e+01 2.3179715138822758e+01 + 25 -4.8365087913286132e+01 -9.6360373508333730e+00 -3.3845620939166274e+01 + 26 3.7034570733129906e+00 -1.9741875137000065e+01 1.0665905800343515e+01 + 27 4.7635971551647629e+01 1.8962512302444232e+01 2.1527299291799473e+01 + 28 -4.9874277842980497e+01 1.8668899166938218e+00 -2.8402828114746590e+01 + 29 2.2383062913328651e+00 -2.0829402219138053e+01 6.8755288229471168e+00 ... diff --git a/unittest/force-styles/tests/angle-fourier.yaml b/unittest/force-styles/tests/angle-fourier.yaml index c0c443746..d36d2cefd 100644 --- a/unittest/force-styles/tests/angle-fourier.yaml +++ b/unittest/force-styles/tests/angle-fourier.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,27 +50,27 @@ init_forces: ! |2 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -run_energy: 380.087499627958 +run_energy: 400.532578826681 run_stress: ! |- - -3.4329754923059610e+01 -6.4014673607513686e+01 9.8344428530573325e+01 6.2684140379910403e+01 -3.0630276889906185e+01 6.5730500220415768e+00 + -3.5033990243752221e+01 -6.9683360450913014e+01 1.0471735069466519e+02 7.3091958599418575e+01 -2.0600460353197874e+01 1.1646840154687229e+01 run_forces: ! |2 - 1 1.5808747698138973e+01 1.1593347596566467e+01 -3.5794276211694154e+00 - 2 -1.5295286273310085e+00 -1.1820038435074464e+01 -9.7834202327686057e+00 - 3 -3.3392355257392285e+00 5.3343916091101626e+01 3.2066135490332293e+01 - 4 -1.6013545913188398e+00 -1.9333805096376604e+01 -3.6875735118370301e+00 - 5 -1.1869472215316211e+01 -3.5888657881157584e+01 -1.5511693059733933e+01 - 6 4.1363920096223097e+01 -3.3059061257092374e+01 -5.2949251752954524e+01 - 7 -1.4844386315052169e+01 1.1787224620580623e+01 -2.7085282890678144e+00 - 8 -1.5200023707837861e+01 -2.5549565490159111e+01 1.5433230069837680e+02 - 9 -5.8715046902676917e+00 1.3653149410851501e+01 -2.2086011734742508e+00 - 10 4.3099345865514884e+01 2.7983453986538134e+01 -1.0905370437364058e+02 - 11 -1.2719173488672336e+01 2.8525726546999195e+00 1.7454371385807157e+00 - 12 1.0885269050699016e+01 2.3393229089740107e+01 -3.8035969177075962e+01 - 13 -4.9170932680202899e+00 -1.2363964694955254e+01 7.6567537459821509e+00 - 14 -1.6312526333489896e+00 -8.7165105851989786e+00 2.4961670766355182e-01 - 15 -8.7763054361446589e+00 -7.1347529213252718e+00 1.6091032804538383e+01 - 16 -2.4956571734439091e+01 3.7961155406178921e+00 2.8289617926446926e+01 - 17 -3.9013804770875860e+00 5.4633473706433753e+00 -2.9127253201987044e+00 + 1 2.1008520935041918e+01 1.0115968449180599e+01 -8.3808587755521273e+00 + 2 -1.2977584068184411e+00 -1.0577686408674259e+01 -8.5413317121507539e+00 + 3 -7.4735449728122809e+00 6.5836156659481588e+01 4.0441250912127416e+01 + 4 -1.7105308718790155e+00 -2.4670973647842828e+01 -7.2571745461957597e+00 + 5 -1.1914719883198824e+01 -4.2724134873398413e+01 -1.5230089428132226e+01 + 6 4.2157081738055481e+01 -4.4112859663876229e+01 -6.2367428864285031e+01 + 7 -1.9311201934106222e+01 1.6491451177166113e+01 -4.0665565241362884e+00 + 8 -6.8181075471689532e+00 -1.2418364181057008e+01 1.7315505642390346e+02 + 9 -9.4426103426511325e+00 1.3853089229901364e+01 -1.2264257535632375e+00 + 10 4.0193842314432615e+01 1.8889845511105765e+01 -1.2925877654442914e+02 + 11 -1.1909858699758537e+01 1.7199104954201125e+00 1.8860453621301545e+00 + 12 1.6510442493960081e+01 3.2146617862476468e+01 -4.1475819729222046e+01 + 13 -5.1663011540687291e+00 -1.3502999322396409e+01 8.1940392163122464e+00 + 14 -4.1465711350167300e+00 -1.5177454427589430e+01 4.3313414510123122e-01 + 15 -9.7152556617045480e+00 -8.2317287883053698e+00 2.2180170033897841e+01 + 16 -2.8340486703799215e+01 8.7874070442667360e+00 3.3444119487605178e+01 + 17 -2.6229401685074554e+00 3.5757548841412032e+00 -1.9293537034109345e+00 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 diff --git a/unittest/force-styles/tests/angle-fourier_simple.yaml b/unittest/force-styles/tests/angle-fourier_simple.yaml index 52d0cc673..abd9218c7 100644 --- a/unittest/force-styles/tests/angle-fourier_simple.yaml +++ b/unittest/force-styles/tests/angle-fourier_simple.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 1.3169752428031160e+01 -1.0811335053602835e+02 3.6826995619636030e+01 28 2.8796447607995553e+01 6.4642561032416026e+01 -1.5016412228095177e+00 29 -4.1966200036026713e+01 4.3470789503612323e+01 -3.5325354396826512e+01 -run_energy: 2264.52119449875 -run_stress: ! |2- - 6.3465747478652929e+01 4.5575565685939273e+02 -5.1922140433804566e+02 -5.0093487079778293e+02 -5.7026046397097844e+02 2.9178827815477780e+02 +run_energy: 2473.12574569709 +run_stress: ! |- + -4.9754396810415287e+00 2.2858091244313221e+02 -2.2360547276209070e+02 -3.3609442061303969e+02 -2.8303432598637687e+02 3.9880332185018744e+01 run_forces: ! |2 - 1 -1.6698926695768151e+01 4.5711693052603088e+01 9.6251256261722901e+01 - 2 -9.8928655704830479e+00 -5.8601444758224687e+01 -4.2727594230889892e+01 - 3 2.0054398888001650e+01 -1.6434932735116803e+01 -1.5323295301328767e+02 - 4 -1.2100098158393333e+01 9.7391765072594723e+00 2.2619708738388418e+01 - 5 -1.8258726159388036e+01 2.5865257320590153e+01 3.0667577123388234e+00 - 6 -4.3423432172962424e+02 5.6311907807588784e+02 6.3024845753385500e+02 - 7 3.9363332585567201e+02 -3.4972930654174473e+02 1.5881681757024674e+02 - 8 7.6726935425838292e+01 -2.0227510089580079e+02 -9.6509096803490706e+02 - 9 -5.4835735651978865e+00 6.2083739370896254e+00 -7.3341578466841417e-01 - 10 -6.8139363080782516e+01 1.7562229879133465e+01 3.4018026693549120e+02 - 11 -1.0668428489623540e+01 -7.2121673107166799e+00 6.8168864165206813e+00 - 12 -2.8421811860280471e+01 -1.7764509747815794e+01 4.9394588697851503e+01 - 13 2.4114212717272068e+00 8.4290572461023316e+00 -1.4591754542306489e+01 - 14 2.0545024971971891e+01 1.7329209701933543e+01 -5.7555689654765274e+00 - 15 3.0038579400106791e+00 5.3021217104708391e+00 -1.4758579566258796e+01 - 16 1.1918407275705373e+02 -9.0904491340025544e+01 -8.5064683623338340e+01 - 17 -3.1660921800734172e+01 4.3655755898374728e+01 -2.5439222105282020e+01 - 18 -3.6592504729843824e+00 -2.7267345087455325e+01 1.0632644718119943e+02 - 19 3.4830159165832384e+01 4.2341647624973504e+01 -4.5437970543995831e+01 - 20 -3.1170908692848002e+01 -1.5074302537518179e+01 -6.0888476637203595e+01 - 21 -2.7706029791467422e+01 -3.2475509891611665e+01 1.0287740945126555e+02 - 22 5.3850377475933037e+01 3.4216381345914968e+01 -3.4629285296623365e+01 - 23 -2.6144347684465615e+01 -1.7408714543033010e+00 -6.8248124154642184e+01 - 24 2.4832657887803705e+01 -9.5172063279851187e+01 5.6152805766154692e+01 - 25 2.3601261694681085e+01 6.8888870386744443e+01 -7.7497899517082542e+00 - 26 -4.8433919582484791e+01 2.6283192893106747e+01 -4.8403015814446441e+01 - 27 1.3674003146699775e+01 -1.0587503079229145e+02 3.4028492557727340e+01 - 28 3.3278447704348693e+01 6.5031147897006932e+01 2.3912434337628161e+00 - 29 -4.6952450851048468e+01 4.0843882895284516e+01 -3.6419735991490157e+01 + 1 -1.7574762490646698e+01 4.8878213007480610e+01 9.6804664011982865e+01 + 2 -7.2208693917505755e+00 -5.8665833609405979e+01 -4.7309648462800169e+01 + 3 3.9423848754405100e+01 -3.2317658838254971e+01 -9.3164627940296270e+01 + 4 -1.3435804304255573e+01 1.3608234725857265e+01 2.4253603633849970e+01 + 5 -2.0407456967952236e+01 2.0935934389483734e+01 2.2999023525675959e+00 + 6 -2.4134677013006936e+02 3.2474689443258484e+02 3.0098143020258937e+02 + 7 1.7078652173773315e+02 -1.5365555610707105e+02 3.7851772471268809e+01 + 8 8.3528525066631602e+01 -1.7198510548971609e+02 -4.5551149384527645e+02 + 9 -1.8849507250300945e+01 2.7504289827597496e+01 -2.4283245924554322e+00 + 10 1.8109169846462336e+00 -1.3511888413314921e+01 1.6906999558499726e+02 + 11 -2.3693819337333967e+01 3.3380667673094493e+00 3.7999509490104479e+00 + 12 -2.9043833002947260e+01 -2.2408240978959462e+01 4.9207942625106782e+01 + 13 2.9203193989333691e+00 8.2534241732944764e+00 -1.7317673541377474e+01 + 14 2.6436101690532862e+01 2.0024673656736013e+01 -8.6388617419150542e+00 + 15 -1.6939666978149148e+00 3.9604783845860894e+00 -1.1190207429645028e+01 + 16 8.1930226799935113e+01 -6.4463302869033939e+01 -2.3996742426309098e+01 + 17 -3.3569670859745912e+01 4.5757376940826411e+01 -2.4711681851298145e+01 + 18 -2.7144385787914693e+00 -2.7281247334926082e+01 1.1028371136584573e+02 + 19 3.1816499839894821e+01 3.9700731989600570e+01 -4.7333303106647207e+01 + 20 -2.9102061261103351e+01 -1.2419484654674488e+01 -6.2950408259198518e+01 + 21 -2.8216728258636810e+01 -3.5075585209672020e+01 1.0543874657441462e+02 + 22 5.0138251351925732e+01 3.4049239555506063e+01 -3.7323558840698865e+01 + 23 -2.1921523093288922e+01 1.0263456541659561e+00 -6.8115187733715757e+01 + 24 2.4822425089419458e+01 -9.6355417613975845e+01 5.7309186590442614e+01 + 25 1.9788003451265634e+01 6.6634116000272627e+01 -1.0869035296985309e+01 + 26 -4.4610428540685092e+01 2.9721301613703218e+01 -4.6440151293457305e+01 + 27 1.3285975858071151e+01 -1.0821988220296628e+02 3.6649089215541103e+01 + 28 2.8776621869740911e+01 6.4723637853509459e+01 -1.3768826343816105e+00 + 29 -4.2062597727812062e+01 4.3496244349456816e+01 -3.5272206581159494e+01 ... diff --git a/unittest/force-styles/tests/angle-harmonic.yaml b/unittest/force-styles/tests/angle-harmonic.yaml index abfa43f4a..a419c131f 100644 --- a/unittest/force-styles/tests/angle-harmonic.yaml +++ b/unittest/force-styles/tests/angle-harmonic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -2.8720725187343144e-01 2.3577465459556626e+00 -8.0312673032167137e-01 28 -6.2799575211499037e-01 -1.4097313073755557e+00 3.2747938980615732e-02 29 9.1520300398842180e-01 -9.4801523858010661e-01 7.7037879134105569e-01 -run_energy: 29.2286477697792 +run_energy: 41.2832373902946 run_stress: ! |2- - 6.7161703985479804e+01 -7.4680138065367487e+01 7.5184340798876628e+00 5.7521437901240859e+01 -2.7304190748521741e+01 -1.4932945649428730e+01 + 8.8236221596506653e+01 -8.6492260623309548e+01 -1.7439609731970818e+00 9.0601855980531212e+01 -2.8735005690485036e+01 -2.6097632235197925e+00 run_forces: ! |2 - 1 3.6220193547187421e+01 1.1585587142479543e+01 -1.7238241972840832e+01 - 2 -1.7637583558698005e+00 -1.3758538851839576e+01 -1.1469071109412811e+01 - 3 -7.1131175159873123e+00 3.1523130842685575e+01 3.9133327910920059e+01 - 4 -1.1598618479874565e+01 -1.4069946914275834e+01 1.1631964860700649e+01 - 5 -3.5092143924598361e+01 -3.4761325046913356e+01 -2.1062123798094685e+01 - 6 4.3880849952881221e+01 -6.1732167988806808e+00 -2.6034788339533922e+01 - 7 -1.4366916728367741e+01 1.3135040103127027e+01 -3.0387136809768127e+00 - 8 -8.5333281419768383e+00 -2.4737111100998256e+01 6.5176870591189868e+01 - 9 -1.2996571868203590e+01 1.3674206710496604e+01 -6.7871105914534047e-01 - 10 1.1736432849972278e+01 3.5147252452549246e+01 -4.9691358934493337e+01 - 11 -1.9930599656448706e+01 -3.2836744898198571e+00 7.6150969595859577e+00 - 12 -5.8293065548538978e+00 -1.3423749355667645e+01 -5.2738511429383701e+00 - 13 7.7658418286980746e-01 2.0512357329017221e+00 1.8932242747136039e+00 - 14 1.2984672111772401e+01 -7.2763363322049823e-01 -4.8588140465034959e+00 - 15 7.4743142834562555e+00 -3.4640965582760748e+00 9.4855052919847029e+00 - 16 3.6043562512330887e+00 8.0382102532623243e+00 4.0048096667552189e+00 - 17 5.4695804680833793e-01 -7.5537048761027403e-01 4.0487452808954988e-01 - 18 -1.1709942604030477e-01 -8.9468235295761567e-01 3.5008479949198765e+00 - 19 9.8256914435044085e-01 1.2515894863018922e+00 -1.5372413162209382e+00 - 20 -8.6546971831013608e-01 -3.5690713334427648e-01 -1.9636066786989381e+00 - 21 6.0524643645662579e-01 7.0314728523699110e-01 -2.2349906198624576e+00 - 22 -1.0299517357238845e+00 -6.7850914711871291e-01 8.1029011311054200e-01 - 23 4.2470529926725875e-01 -2.4638138118278141e-02 1.4247005067519156e+00 - 24 4.1516966455944304e-01 -1.5912776575035221e+00 9.3767616296745859e-01 - 25 3.0070697634261156e-01 1.0957067953103508e+00 -1.8209981159009775e-01 - 26 -7.1587664090205461e-01 4.9557086219317126e-01 -7.5557635137736079e-01 - 27 -1.4554421797154906e-02 1.1056084388051551e-01 -3.5467198058544314e-02 - 28 -2.8257906393508312e-02 -6.6089589395261994e-02 5.7412954785297787e-04 - 29 4.2812328190663218e-02 -4.4471254485253520e-02 3.4893068510691336e-02 + 1 4.7316793853445823e+01 8.2815577813110419e+00 -3.2021703111755414e+01 + 2 -1.1508196824491370e+00 -9.3814982172707779e+00 -7.5761211707510405e+00 + 3 -5.1083163691832354e+00 5.2667553294971555e+01 5.1784852458007521e+01 + 4 -1.6078177452606020e+01 -2.4156048365236188e+01 1.3140924677013139e+01 + 5 -4.4915734474022308e+01 -4.8095168640411785e+01 -2.3331149037574153e+01 + 6 4.7077916942842364e+01 -9.5906213020089943e+00 -3.2570331503075479e+01 + 7 -1.6228599672412471e+01 1.4485102617342370e+01 -3.5441153194985300e+00 + 8 -6.5097893981550552e+00 -2.5117582302614508e+01 8.2131369512415986e+01 + 9 -1.5527440970965937e+01 1.6147270375910470e+01 -4.0812004993325646e-01 + 10 1.0070812216240931e+01 4.1571532807578770e+01 -6.5968810328796309e+01 + 11 -2.0431584971707451e+01 -6.4817395192247664e+00 8.9879981618991636e+00 + 12 -1.0884695976714742e+01 -1.1067390190389069e+01 -9.1551242768939716e+00 + 13 2.8052913970098916e+00 7.1296301666595223e+00 1.3173039168658640e-02 + 14 1.5254877537873556e+01 -8.9700095533297102e+00 -6.5719846903613259e+00 + 15 1.2392009100171009e+01 -6.0827695435257185e+00 1.7929674392339564e+01 + 16 4.7158712437382944e-01 1.0631038523396501e+01 6.0960085687560248e+00 + 17 1.4458707962589461e+00 -1.9708579331587084e+00 1.0634586790394374e+00 + 18 1.4201882413835776e-01 1.4265339757773212e+00 -5.7663956896747468e+00 + 19 -1.6609130686729214e+00 -2.0735307593210943e+00 2.4755525101126916e+00 + 20 1.5188942445345637e+00 6.4699678354377321e-01 3.2908431795620547e+00 + 21 3.2242729509516277e+00 4.0079233768385976e+00 -1.2047892238650938e+01 + 22 -5.7215184687399532e+00 -3.8871624402883245e+00 4.2679223469272056e+00 + 23 2.4972455177883255e+00 -1.2076093655027353e-01 7.7799698917237325e+00 + 24 -1.1661978296905358e+00 4.5271404898674401e+00 -2.6925565853369919e+00 + 25 -9.2712094527151212e-01 -3.1291890525016810e+00 5.1208215565053306e-01 + 26 2.0933187749620479e+00 -1.3979514373657593e+00 2.1804744296864591e+00 + 27 -2.6804542538019893e-01 2.1830651328697592e+00 -7.3931790038943679e-01 + 28 -5.7927072943126978e-01 -1.3052929090347605e+00 2.8365455885795143e-02 + 29 8.4731615481146871e-01 -8.7777222383499887e-01 7.1095244450364159e-01 ... diff --git a/unittest/force-styles/tests/angle-hybrid.yaml b/unittest/force-styles/tests/angle-hybrid.yaml index 30d0c2fcf..f68d23e79 100644 --- a/unittest/force-styles/tests/angle-hybrid.yaml +++ b/unittest/force-styles/tests/angle-hybrid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 -2.8720725187343144e-01 2.3577465459556626e+00 -8.0312673032167137e-01 28 -6.2799575211499037e-01 -1.4097313073755557e+00 3.2747938980615732e-02 29 9.1520300398842180e-01 -9.4801523858010661e-01 7.7037879134105569e-01 -run_energy: -678.497727741936 +run_energy: -669.682915883011 run_stress: ! |2- - 8.2140048770505047e+01 -6.7140087335752213e+01 -1.4999961434752873e+01 4.2405310501261120e+01 -3.2761641882477846e+01 -1.5227450692944958e+01 + 1.0910827460635431e+02 -7.6717747945181756e+01 -3.2390526661172551e+01 6.9397333601070585e+01 -3.2919024520896613e+01 -9.3879103935841197e+00 run_forces: ! |2 - 1 3.6196009547824410e+01 1.1487083370831206e+01 -1.7344933379630366e+01 - 2 -1.7615598459241220e+00 -1.3626889019099266e+01 -1.1372753028008844e+01 - 3 -9.1117561375465321e+00 3.4778556240356963e+01 3.6079449053774489e+01 - 4 -1.1938356622920127e+01 -1.3536571330679612e+01 1.2313793395926419e+01 - 5 -3.3250059393122804e+01 -3.7250456744001504e+01 -2.1515052704694316e+01 - 6 2.6632193553538304e+01 1.0886442763901238e+01 -5.4988176854674879e+00 - 7 -3.9769255664464103e+00 3.6279578054976165e+00 -8.8523980649771361e-01 - 8 -1.4478102089609642e+01 -2.1136011291890696e+01 2.8008021072612827e+01 - 9 -3.7330506232075189e+00 3.8961732678258452e+00 -9.4673356033210698e-02 - 10 -2.4554596442123917e+00 3.7755869619854806e+01 -2.3056093893912518e+01 - 11 -5.2006351048006554e+00 -1.1149399238878011e+00 2.0181071509415172e+00 - 12 1.3328408204317139e+00 -1.5840824317314473e+01 -4.4826207159795466e+00 - 13 1.6866763385590779e+00 4.6546602357244318e+00 -6.0071491695716817e-01 - 14 6.6825233317930284e+00 -6.5086865978360695e+00 -2.9031475821958308e+00 - 15 9.0252416662284212e+00 -2.6639855071364096e+00 7.6079501074977962e+00 - 16 3.1183900445676671e+00 6.2909643334076675e+00 8.1445871688812077e-01 - 17 1.2320297248475742e+00 -1.6993429055539448e+00 9.1226757173582018e-01 - 18 -1.1709942604030477e-01 -8.9468235295761567e-01 3.5008479949198765e+00 - 19 9.8256914435044085e-01 1.2515894863018922e+00 -1.5372413162209382e+00 - 20 -8.6546971831013608e-01 -3.5690713334427648e-01 -1.9636066786989381e+00 - 21 6.0524643645662579e-01 7.0314728523699110e-01 -2.2349906198624576e+00 - 22 -1.0299517357238845e+00 -6.7850914711871291e-01 8.1029011311054200e-01 - 23 4.2470529926725875e-01 -2.4638138118278141e-02 1.4247005067519156e+00 - 24 4.1516966455944304e-01 -1.5912776575035221e+00 9.3767616296745859e-01 - 25 3.0070697634261156e-01 1.0957067953103508e+00 -1.8209981159009775e-01 - 26 -7.1587664090205461e-01 4.9557086219317126e-01 -7.5557635137736079e-01 - 27 -1.4554421797154906e-02 1.1056084388051551e-01 -3.5467198058544314e-02 - 28 -2.8257906393508312e-02 -6.6089589395261994e-02 5.7412954785297787e-04 - 29 4.2812328190663218e-02 -4.4471254485253520e-02 3.4893068510691336e-02 + 1 4.7317043425228775e+01 8.2803400468351640e+00 -3.2022741474282327e+01 + 2 -1.1507396121610043e+00 -9.3800428273681664e+00 -7.5750298470193211e+00 + 3 -7.0722723744612948e+00 5.3120552129380108e+01 4.5464393600034171e+01 + 4 -1.7156487213177229e+01 -2.2199431380438227e+01 1.5423862413015085e+01 + 5 -4.3774148945103477e+01 -4.9580631677813287e+01 -2.3555256603215724e+01 + 6 2.8582136701975742e+01 1.2250206029073558e+01 -5.2918320968928203e+00 + 7 -4.0433921589706658e+00 3.6088512198553104e+00 -8.8346207971269153e-01 + 8 -1.6100382908522299e+01 -2.2479778216429441e+01 3.0308685247449411e+01 + 9 -3.8765997707298476e+00 4.0314231532636722e+00 -1.0094598622123530e-01 + 10 -3.0127554499097524e+00 4.1839118845102284e+01 -2.5278694388259829e+01 + 11 -5.0636093903406154e+00 -1.5836940795577710e+00 2.2122864002357181e+00 + 12 -6.0437037739721182e+00 -1.1714116472236709e+01 -1.0834285417835348e+01 + 13 3.3948471920723367e+00 8.6692910641428309e+00 -8.5533159046844065e-01 + 14 8.3711862952624507e+00 -1.4706373371942306e+01 -4.3599928418467879e+00 + 15 1.5472767163774250e+01 -5.0378189247377430e+00 1.5256421410739964e+01 + 16 2.7028526717416108e+00 6.8630083227935339e+00 1.0230239724999741e+00 + 17 1.4532581472931438e+00 -1.9809038599228157e+00 1.0688992817802037e+00 + 18 1.4201882413835776e-01 1.4265339757773212e+00 -5.7663956896747468e+00 + 19 -1.6609130686729214e+00 -2.0735307593210943e+00 2.4755525101126916e+00 + 20 1.5188942445345637e+00 6.4699678354377321e-01 3.2908431795620547e+00 + 21 3.2242729509516277e+00 4.0079233768385976e+00 -1.2047892238650938e+01 + 22 -5.7215184687399532e+00 -3.8871624402883245e+00 4.2679223469272056e+00 + 23 2.4972455177883255e+00 -1.2076093655027353e-01 7.7799698917237325e+00 + 24 -1.1661978296905358e+00 4.5271404898674401e+00 -2.6925565853369919e+00 + 25 -9.2712094527151212e-01 -3.1291890525016810e+00 5.1208215565053306e-01 + 26 2.0933187749620479e+00 -1.3979514373657593e+00 2.1804744296864591e+00 + 27 -2.6804542538019893e-01 2.1830651328697592e+00 -7.3931790038943679e-01 + 28 -5.7927072943126978e-01 -1.3052929090347605e+00 2.8365455885795143e-02 + 29 8.4731615481146871e-01 -8.7777222383499887e-01 7.1095244450364159e-01 ... diff --git a/unittest/force-styles/tests/angle-mm3.yaml b/unittest/force-styles/tests/angle-mm3.yaml index a4c4d9731..d4bf2b8cb 100644 --- a/unittest/force-styles/tests/angle-mm3.yaml +++ b/unittest/force-styles/tests/angle-mm3.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 02:07:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -19,68 +19,68 @@ extract: ! "" natoms: 29 init_energy: 44.7246154856262 init_stress: ! |2- - 9.6483539484715649e+01 -7.3120175237333171e+01 -2.3363364247382489e+01 9.6221737253953165e+01 -3.1311135458252558e+01 -1.7557146927751806e+01 + 9.6483539484715550e+01 -7.3120175237333257e+01 -2.3363364247382318e+01 9.6221737253953094e+01 -3.1311135458252629e+01 -1.7557146927751774e+01 init_forces: ! |2 - 1 4.4689184239622811e+01 1.4410850488342223e+01 -4.9896003676738601e+01 - 2 -1.0347123094666624e+00 -8.3778135595728997e+00 -6.7367868738801651e+00 - 3 4.6051547598378484e+00 7.6238656099244039e+01 8.0924821901641337e+01 + 1 4.4689184239622783e+01 1.4410850488342238e+01 -4.9896003676738502e+01 + 2 -1.0347123094666664e+00 -8.3778135595729282e+00 -6.7367868738801882e+00 + 3 4.6051547598378555e+00 7.6238656099243968e+01 8.0924821901641266e+01 4 -1.3879556638976471e+01 -2.5509672482964671e+01 9.4826500118368635e+00 - 5 -4.8662433133193005e+01 -7.2269667876505977e+01 -3.1280325044276090e+01 + 5 -4.8662433133192977e+01 -7.2269667876505906e+01 -3.1280325044276069e+01 6 4.2630030017502165e+01 -1.4584975822585262e+01 -2.8437404960316339e+01 7 -1.8500794405118786e+01 1.6518275777933866e+01 -4.0339107370898475e+00 8 -1.4191729253133266e+01 -3.4864230574246292e+01 7.5918883739362883e+01 9 -1.5796555588594202e+01 1.6195942437882501e+01 -3.7228001790677689e-01 - 10 1.8322429576874946e+01 5.9405823367322235e+01 -6.9720265077692162e+01 - 11 -2.5541108989280865e+01 -1.1403183226794766e+01 1.3233874660940693e+01 - 12 -6.6849905958062745e+00 -1.4573899088230753e+01 -7.9431956449961731e+00 - 13 2.6386638124624522e+00 6.6821772047683305e+00 -2.5200611835550557e-01 - 14 1.7062014144274453e+01 -9.5655590628320333e+00 -7.3297792370284753e+00 + 10 1.8322429576874924e+01 5.9405823367322235e+01 -6.9720265077692119e+01 + 11 -2.5541108989280843e+01 -1.1403183226794742e+01 1.3233874660940675e+01 + 12 -6.6849905958063056e+00 -1.4573899088230753e+01 -7.9431956449961483e+00 + 13 2.6386638124624513e+00 6.6821772047683288e+00 -2.5200611835554199e-01 + 14 1.7062014144274485e+01 -9.5655590628320475e+00 -7.3297792370284887e+00 15 1.2590362179775433e+01 -6.6233814314601647e+00 1.9505432098849852e+01 16 2.5818882071551919e-01 1.0357871783493341e+01 5.8369792597804713e+00 17 1.4958533625039077e+00 -2.0372140337937137e+00 1.0993157158679869e+00 - 18 1.6336476139296607e-01 1.7071567478868546e+00 -6.9281945549275328e+00 - 19 -2.0002819887482959e+00 -2.4919453319891600e+00 2.9670497500280750e+00 - 20 1.8369172273553298e+00 7.8478858410230534e-01 3.9611448048994573e+00 - 21 3.6622530369381416e+00 4.5845356902040812e+00 -1.3701042411933230e+01 - 22 -6.5214087195934987e+00 -4.4462929914148557e+00 4.8435089311126376e+00 - 23 2.8591556826553570e+00 -1.3824269878922513e-01 8.8575334808205923e+00 + 18 1.6336476139296474e-01 1.7071567478868408e+00 -6.9281945549274777e+00 + 19 -2.0002819887482799e+00 -2.4919453319891400e+00 2.9670497500280515e+00 + 20 1.8369172273553152e+00 7.8478858410229935e-01 3.9611448048994262e+00 + 21 3.6622530369381256e+00 4.5845356902040626e+00 -1.3701042411933173e+01 + 22 -6.5214087195934711e+00 -4.4462929914148379e+00 4.8435089311126180e+00 + 23 2.8591556826553455e+00 -1.3824269878922490e-01 8.8575334808205550e+00 24 -1.3449587561612431e+00 5.2279343877424056e+00 -3.1125116049354911e+00 25 -1.0788495447525834e+00 -3.6145543163951412e+00 5.9113806641683375e-01 26 2.4238083009138265e+00 -1.6133800713472644e+00 2.5213735385186573e+00 27 -2.9077025434585668e-01 2.3869960050754981e+00 -8.1309006692665386e-01 28 -6.3578646910720737e-01 -1.4272199888098533e+00 3.3154199570463894e-02 29 9.2655672345306406e-01 -9.5977601626564502e-01 7.7993586735619003e-01 -run_energy: 28.5216147491206 +run_energy: 44.3963062209567 run_stress: ! |2- - 6.8461353854478219e+01 -7.0950008061963530e+01 2.4886542074852920e+00 5.5870749189169125e+01 -2.7667972182039183e+01 -1.6996023033360832e+01 + 9.4780140946000415e+01 -7.2437928047641378e+01 -2.2342212898359016e+01 9.4615808363649876e+01 -3.1856450072762396e+01 -1.8642069063830736e+01 run_forces: ! |2 - 1 3.0380072332525348e+01 1.3814126903880505e+01 -2.0438184527799478e+01 - 2 -1.5896758508862501e+00 -1.3186713957024102e+01 -1.0957750561693299e+01 - 3 1.0173706748711790e+00 3.4749452305760151e+01 4.6613519883555128e+01 - 4 -1.0383808658739017e+01 -1.3092365246467571e+01 1.0237776620551353e+01 - 5 -3.4745343543018002e+01 -3.8258698544781538e+01 -2.3605370769960434e+01 - 6 4.0787323590543807e+01 -1.0201577912271816e+01 -2.3948461973825886e+01 - 7 -1.6198436571694629e+01 1.4913874197821972e+01 -3.4306120590974016e+00 - 8 -1.3465852437235963e+01 -3.0185469919264790e+01 6.0837800511112157e+01 - 9 -1.2716454112122053e+01 1.3041502725150096e+01 -5.8377443421772757e-01 - 10 1.7027475118237291e+01 4.5315690176362438e+01 -5.1379767191696686e+01 - 11 -2.2855844833833256e+01 -5.5494228294778045e+00 1.0138888484515970e+01 - 12 -4.4269952322579140e+00 -1.7470425947183756e+01 -4.6317953693609208e+00 - 13 7.6465435292114470e-01 2.0155421267026603e+00 1.9370658422010325e+00 - 14 1.4672307445518555e+01 1.0427182317397055e-01 -5.4211481924917226e+00 - 15 7.7515783031017698e+00 -3.5744171309510042e+00 9.8109367651667689e+00 - 16 3.4121913655913687e+00 8.3565191811471671e+00 4.3979250745677350e+00 - 17 5.6943805647662382e-01 -7.9188795257658329e-01 4.2295189847340964e-01 - 18 -1.1595207714960087e-01 -8.8592994767285993e-01 3.4666075636248141e+00 - 19 9.7283502868341010e-01 1.2392405135742253e+00 -1.5222371111054831e+00 - 20 -8.5688295153380922e-01 -3.5331056590136534e-01 -1.9443704525193310e+00 - 21 5.6171987735395690e-01 6.5254583338821914e-01 -2.0741987744859971e+00 - 22 -9.5527937700173116e-01 -6.2942572231870320e-01 7.5223417657219804e-01 - 23 3.9355949964777426e-01 -2.3120111069515975e-02 1.3219645979137991e+00 - 24 4.1742703452645963e-01 -1.5999295770543851e+00 9.4277327946116163e-01 - 25 3.0228085645331310e-01 1.1016277327143633e+00 -1.8312389454553685e-01 - 26 -7.1970789097977272e-01 4.9830184434002178e-01 -7.5964938491562473e-01 - 27 -1.3855386687371539e-02 1.0525039239171710e-01 -3.3763622025640205e-02 - 28 -2.6899771291758752e-02 -6.2914938974737530e-02 5.4695029730642344e-04 - 29 4.0755157979130291e-02 -4.2335453416979571e-02 3.3216671728333778e-02 + 1 4.4113926303928523e+01 1.4735518086541525e+01 -4.9141715974909346e+01 + 2 -1.0675648446398882e+00 -8.7083109832158581e+00 -7.0322569937281294e+00 + 3 5.2317239162825988e+00 7.5221631110658564e+01 8.0173133383269388e+01 + 4 -1.3887921415601015e+01 -2.5001639271033945e+01 9.7318436563202937e+00 + 5 -4.8671779613078051e+01 -7.1754959100400711e+01 -3.1236340783667664e+01 + 6 4.2690569355593759e+01 -1.4646513866760488e+01 -2.8494498531131782e+01 + 7 -1.8538189975839735e+01 1.6563782535087753e+01 -4.0517773757888831e+00 + 8 -1.4052595014401200e+01 -3.4766110126709762e+01 7.5862147043604523e+01 + 9 -1.5821983538308260e+01 1.6220871157648649e+01 -3.5951160651071579e-01 + 10 1.8369767302920256e+01 5.8963497155097841e+01 -6.9557748972567737e+01 + 11 -2.5510712057854295e+01 -1.1336886088949173e+01 1.3204630009070282e+01 + 12 -6.8118307800175675e+00 -1.4935416852785352e+01 -7.4652801808920284e+00 + 13 2.5661796976841336e+00 6.5290525900184910e+00 -1.3891512480189849e-01 + 14 1.7057824029716013e+01 -8.9565844537150223e+00 -7.2659820051184028e+00 + 15 1.2523993303170752e+01 -6.4249996877582092e+00 1.8894605564375958e+01 + 16 3.3392926114233301e-01 1.0307325461265727e+01 5.7929913531049007e+00 + 17 1.4746640693016377e+00 -2.0102576649900650e+00 1.0846765393712383e+00 + 18 1.4626511084156957e-01 1.4691850370582769e+00 -5.9388009816760370e+00 + 19 -1.7105664597497281e+00 -2.1355214168723151e+00 2.5495684710511335e+00 + 20 1.5643013489081585e+00 6.6633637981403815e-01 3.3892325106249030e+00 + 21 3.4390818119558602e+00 4.2749401402035128e+00 -1.2850548799300885e+01 + 22 -6.1026388346388476e+00 -4.1461061685683793e+00 4.5522857029473531e+00 + 23 2.6635570226829874e+00 -1.2883397163513322e-01 8.2982630963535318e+00 + 24 -1.1974807198960937e+00 4.6485799115650313e+00 -2.7647836829203936e+00 + 25 -9.5198695411281364e-01 -3.2131265393949211e+00 5.2582069334900261e-01 + 26 2.1494676740089074e+00 -1.4354533721701102e+00 2.2389629895713909e+00 + 27 -2.7110772848200537e-01 2.2080056370936436e+00 -7.4776426732997858e-01 + 28 -5.8588831502942817e-01 -1.3202051856691475e+00 2.8689668867307644e-02 + 29 8.5699604351143355e-01 -8.8780045142449637e-01 7.1907459846267097e-01 ... diff --git a/unittest/force-styles/tests/angle-quartic.yaml b/unittest/force-styles/tests/angle-quartic.yaml index 42f286a11..1ffa16373 100644 --- a/unittest/force-styles/tests/angle-quartic.yaml +++ b/unittest/force-styles/tests/angle-quartic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -2.8661525615948458e-01 2.3528867249007490e+00 -8.0147131396639093e-01 28 -6.2670131824814423e-01 -1.4068255489507977e+00 3.2680438458290273e-02 29 9.1331657440762881e-01 -9.4606117594995109e-01 7.6879087550810066e-01 -run_energy: 29.1502240990426 +run_energy: 40.8070328565151 run_stress: ! |2- - 6.7042207793770658e+01 -7.3107350065369147e+01 6.0651422715984635e+00 5.7540451643703122e+01 -2.5791549664995877e+01 -1.5308659267071452e+01 + 8.7762099497944007e+01 -8.3994526348801116e+01 -3.7675731491429025e+00 9.0047666438661253e+01 -2.6521811185253604e+01 -2.8086171333623424e+00 run_forces: ! |2 - 1 3.6505789840992350e+01 1.1382172519452340e+01 -1.6875444601860664e+01 - 2 -1.7716323417624196e+00 -1.3768088852791305e+01 -1.1479285999653328e+01 - 3 -7.5168987159123155e+00 3.1094483404615445e+01 3.8504999248894983e+01 - 4 -1.1662621900315891e+01 -1.4143057614013497e+01 1.1699960518779212e+01 - 5 -3.5082415370053397e+01 -3.4273036378440537e+01 -2.0798846041201188e+01 - 6 4.4144378475751395e+01 -5.9596786168782065e+00 -2.5355426543615081e+01 - 7 -1.4716836057781308e+01 1.3465396691744385e+01 -3.1116020272731171e+00 - 8 -7.8265825645814804e+00 -2.3835380160539565e+01 6.2777165990707303e+01 - 9 -1.2958821825205867e+01 1.3585230611436817e+01 -6.6441623486441470e-01 - 10 1.2011527626439079e+01 3.3455416635530291e+01 -4.9114814894541034e+01 - 11 -2.0302324661356725e+01 -3.8324358769074571e+00 8.0903961686405310e+00 - 12 -6.4231252649457105e+00 -1.2762378393911021e+01 -4.6797365453575672e+00 - 13 8.1367027229927757e-01 2.1471772074435997e+00 1.9791984184110607e+00 - 14 1.3080567738382573e+01 -4.5027878071955296e-01 -4.8692982659115724e+00 - 15 7.4303134887284399e+00 -3.4674445784365719e+00 9.4896710017867782e+00 - 16 3.7309073685486296e+00 8.1130889110521132e+00 4.0047679021986848e+00 - 17 5.4410389077337018e-01 -7.5118672863729063e-01 4.0271190485941960e-01 - 18 -1.1728343467585933e-01 -8.9608593127973857e-01 3.5063388996752507e+00 - 19 9.8413110740128806e-01 1.2535706485393892e+00 -1.5396471964240221e+00 - 20 -8.6684767272542873e-01 -3.5748471725965059e-01 -1.9666917032512286e+00 - 21 6.1228887112492458e-01 7.1133508406083412e-01 -2.2610073612225863e+00 - 22 -1.0420455963088935e+00 -6.8645646043483677e-01 8.1967897514834509e-01 - 23 4.2975672518396890e-01 -2.4878623625997381e-02 1.4413283860742414e+00 - 24 4.1477192992804562e-01 -1.5897532403332193e+00 9.3677806890565296e-01 - 25 3.0042900402130596e-01 1.0946631641767579e+00 -1.8191974356268292e-01 - 26 -7.1520093394935158e-01 4.9509007615646139e-01 -7.5485832534297004e-01 - 27 -1.4670545669870434e-02 1.1144302048037638e-01 -3.5750197695858035e-02 - 28 -2.8483529459502294e-02 -6.6616967348837736e-02 5.7864060974736550e-04 - 29 4.3154075129372728e-02 -4.4826053131538646e-02 3.5171557086110666e-02 + 1 4.7475164277645312e+01 7.8777709131723412e+00 -3.0915658364290962e+01 + 2 -1.1559109334446465e+00 -9.4226195618654938e+00 -7.6093447951764386e+00 + 3 -5.7576614222332116e+00 5.1216995191819414e+01 4.9794862083462384e+01 + 4 -1.6226175053866950e+01 -2.4066925411614598e+01 1.3383864764060526e+01 + 5 -4.4670869097542578e+01 -4.6570043115854503e+01 -2.2821540309954109e+01 + 6 4.7589352268086508e+01 -8.9553632330618171e+00 -3.0865638031458829e+01 + 7 -1.6704198591654183e+01 1.4913238577202083e+01 -3.6486717563951263e+00 + 8 -5.5192207861136726e+00 -2.4488649768845629e+01 7.7752724928288529e+01 + 9 -1.5576671305984533e+01 1.6166418360644251e+01 -4.0165266020600487e-01 + 10 1.0976487328913040e+01 3.9226027528064300e+01 -6.4436093333093154e+01 + 11 -2.1155365323574784e+01 -7.1741040914785765e+00 9.5888667488338548e+00 + 12 -1.2144969864066418e+01 -9.8348077280172710e+00 -8.0286920101544474e+00 + 13 2.8259447105312909e+00 7.1819945041161040e+00 1.5357042677671906e-02 + 14 1.5502820798661531e+01 -8.6671621751474639e+00 -6.6441312756609170e+00 + 15 1.2448840465066979e+01 -6.0384708821632387e+00 1.7810593260808542e+01 + 16 6.4836281700235476e-01 1.0604097603902881e+01 5.9630209376263075e+00 + 17 1.4440697125739574e+00 -1.9683967108727725e+00 1.0621327706321573e+00 + 18 1.4131359781982522e-01 1.4194504484030088e+00 -5.7377624571160748e+00 + 19 -1.6526665582318956e+00 -2.0632352681245125e+00 2.4632598767822902e+00 + 20 1.5113529604120703e+00 6.4378481972150381e-01 3.2745025803337846e+00 + 21 3.1886533019107692e+00 3.9636465932568559e+00 -1.1914795526028055e+01 + 22 -5.6583202691063921e+00 -3.8442239924121901e+00 4.2207694501445765e+00 + 23 2.4696669671956228e+00 -1.1942260084466549e-01 7.6940260758834782e+00 + 24 -1.1610018423228623e+00 4.5069697943593638e+00 -2.6805598974979934e+00 + 25 -9.2299076223980769e-01 -3.1152472957609127e+00 5.0980023946540243e-01 + 26 2.0839926045626700e+00 -1.3917224985984509e+00 2.1707596580325910e+00 + 27 -2.6753655331204973e-01 2.1789206945095407e+00 -7.3791434228017316e-01 + 28 -5.7817106470135293e-01 -1.3028148911241797e+00 2.8311580775492118e-02 + 29 8.4570761801340266e-01 -8.7610580338536093e-01 7.0960276150468105e-01 ... diff --git a/unittest/force-styles/tests/angle-table_linear.yaml b/unittest/force-styles/tests/angle-table_linear.yaml index 90001248d..2c5410f64 100644 --- a/unittest/force-styles/tests/angle-table_linear.yaml +++ b/unittest/force-styles/tests/angle-table_linear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -2.8720725187343266e-01 2.3577465459556737e+00 -8.0312673032167514e-01 28 -6.2799575211499314e-01 -1.4097313073755624e+00 3.2747938980615898e-02 29 9.1520300398842580e-01 -9.4801523858011116e-01 7.7037879134105924e-01 -run_energy: 29.2317863480852 +run_energy: 41.2864477972198 run_stress: ! |2- - 6.7161703985479718e+01 -7.4680138065367359e+01 7.5184340798876548e+00 5.7521437901240908e+01 -2.7304190748521801e+01 -1.4932945649428691e+01 + 8.8236221596506653e+01 -8.6492260623309619e+01 -1.7439609731970602e+00 9.0601855980531255e+01 -2.8735005690484979e+01 -2.6097632235196491e+00 run_forces: ! |2 - 1 3.6220193547187456e+01 1.1585587142479525e+01 -1.7238241972840854e+01 - 2 -1.7637583558697996e+00 -1.3758538851839569e+01 -1.1469071109412802e+01 - 3 -7.1131175159873807e+00 3.1523130842685656e+01 3.9133327910920087e+01 - 4 -1.1598618479874556e+01 -1.4069946914275876e+01 1.1631964860700624e+01 - 5 -3.5092143924598346e+01 -3.4761325046913385e+01 -2.1062123798094682e+01 - 6 4.3880849952881213e+01 -6.1732167988806488e+00 -2.6034788339533911e+01 - 7 -1.4366916728367732e+01 1.3135040103127022e+01 -3.0387136809768114e+00 - 8 -8.5333281419768152e+00 -2.4737111100998341e+01 6.5176870591189896e+01 - 9 -1.2996571868203626e+01 1.3674206710496637e+01 -6.7871105914534136e-01 - 10 1.1736432849972303e+01 3.5147252452549331e+01 -4.9691358934493358e+01 - 11 -1.9930599656448692e+01 -3.2836744898198695e+00 7.6150969595859648e+00 - 12 -5.8293065548538641e+00 -1.3423749355667574e+01 -5.2738511429384252e+00 - 13 7.7658418286979858e-01 2.0512357329016981e+00 1.8932242747136030e+00 - 14 1.2984672111772394e+01 -7.2763363322055064e-01 -4.8588140465034968e+00 - 15 7.4743142834562475e+00 -3.4640965582760912e+00 9.4855052919847456e+00 - 16 3.6043562512330527e+00 8.0382102532623314e+00 4.0048096667552047e+00 - 17 5.4695804680835325e-01 -7.5537048761029524e-01 4.0487452808956131e-01 - 18 -1.1709942604030243e-01 -8.9468235295759790e-01 3.5008479949198064e+00 - 19 9.8256914435042142e-01 1.2515894863018673e+00 -1.5372413162209075e+00 - 20 -8.6546971831011899e-01 -3.5690713334426938e-01 -1.9636066786988988e+00 - 21 6.0524643645662701e-01 7.0314728523699266e-01 -2.2349906198624625e+00 - 22 -1.0299517357238868e+00 -6.7850914711871446e-01 8.1029011311054377e-01 - 23 4.2470529926725969e-01 -2.4638138118278197e-02 1.4247005067519189e+00 - 24 4.1516966455942839e-01 -1.5912776575034653e+00 9.3767616296742518e-01 - 25 3.0070697634260080e-01 1.0957067953103117e+00 -1.8209981159009125e-01 - 26 -7.1587664090202918e-01 4.9557086219315349e-01 -7.5557635137733392e-01 - 27 -1.4554421797121797e-02 1.1056084388026395e-01 -3.5467198058463670e-02 - 28 -2.8257906393443971e-02 -6.6089589395111600e-02 5.7412954785172193e-04 - 29 4.2812328190565768e-02 -4.4471254485152351e-02 3.4893068510611948e-02 + 1 4.7316793853445787e+01 8.2815577813110224e+00 -3.2021703111755357e+01 + 2 -1.1508196824491352e+00 -9.3814982172707655e+00 -7.5761211707510290e+00 + 3 -5.1083163691832629e+00 5.2667553294971491e+01 5.1784852458007471e+01 + 4 -1.6078177452605996e+01 -2.4156048365236188e+01 1.3140924677013103e+01 + 5 -4.4915734474022237e+01 -4.8095168640411714e+01 -2.3331149037574118e+01 + 6 4.7077916942842322e+01 -9.5906213020089819e+00 -3.2570331503075465e+01 + 7 -1.6228599672412457e+01 1.4485102617342356e+01 -3.5441153194985260e+00 + 8 -6.5097893981550570e+00 -2.5117582302614579e+01 8.2131369512415915e+01 + 9 -1.5527440970965969e+01 1.6147270375910505e+01 -4.0812004993325735e-01 + 10 1.0070812216240979e+01 4.1571532807578812e+01 -6.5968810328796266e+01 + 11 -2.0431584971707455e+01 -6.4817395192247522e+00 8.9879981618991565e+00 + 12 -1.0884695976714699e+01 -1.1067390190389048e+01 -9.1551242768940480e+00 + 13 2.8052913970098849e+00 7.1296301666595081e+00 1.3173039168681733e-02 + 14 1.5254877537873535e+01 -8.9700095533297279e+00 -6.5719846903613170e+00 + 15 1.2392009100170998e+01 -6.0827695435257256e+00 1.7929674392339585e+01 + 16 4.7158712437379569e-01 1.0631038523396514e+01 6.0960085687560088e+00 + 17 1.4458707962589645e+00 -1.9708579331587333e+00 1.0634586790394511e+00 + 18 1.4201882413835887e-01 1.4265339757773323e+00 -5.7663956896747930e+00 + 19 -1.6609130686729350e+00 -2.0735307593211108e+00 2.4755525101127116e+00 + 20 1.5188942445345761e+00 6.4699678354377854e-01 3.2908431795620818e+00 + 21 3.2242729509516455e+00 4.0079233768386207e+00 -1.2047892238651006e+01 + 22 -5.7215184687399852e+00 -3.8871624402883467e+00 4.2679223469272296e+00 + 23 2.4972455177883397e+00 -1.2076093655027398e-01 7.7799698917237752e+00 + 24 -1.1661978296905469e+00 4.5271404898674845e+00 -2.6925565853370190e+00 + 25 -9.2712094527152134e-01 -3.1291890525017116e+00 5.1208215565053816e-01 + 26 2.0933187749620683e+00 -1.3979514373657729e+00 2.1804744296864809e+00 + 27 -2.6804542538020493e-01 2.1830651328698085e+00 -7.3931790038945344e-01 + 28 -5.7927072943128266e-01 -1.3052929090347898e+00 2.8365455885795865e-02 + 29 8.4731615481148759e-01 -8.7777222383501852e-01 7.1095244450365758e-01 ... diff --git a/unittest/force-styles/tests/angle-table_spline.yaml b/unittest/force-styles/tests/angle-table_spline.yaml index 4594294e2..42d8f5890 100644 --- a/unittest/force-styles/tests/angle-table_spline.yaml +++ b/unittest/force-styles/tests/angle-table_spline.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 27 -2.8720725187343266e-01 2.3577465459556737e+00 -8.0312673032167514e-01 28 -6.2799575211499314e-01 -1.4097313073755624e+00 3.2747938980615898e-02 29 9.1520300398842580e-01 -9.4801523858011116e-01 7.7037879134105924e-01 -run_energy: 29.2286477697792 +run_energy: 41.2832373902946 run_stress: ! |2- - 6.7161703985479718e+01 -7.4680138065367373e+01 7.5184340798876477e+00 5.7521437901240908e+01 -2.7304190748521808e+01 -1.4932945649428691e+01 + 8.8236221596506653e+01 -8.6492260623309605e+01 -1.7439609731970425e+00 9.0601855980531241e+01 -2.8735005690484972e+01 -2.6097632235196544e+00 run_forces: ! |2 - 1 3.6220193547187456e+01 1.1585587142479525e+01 -1.7238241972840854e+01 - 2 -1.7637583558697996e+00 -1.3758538851839569e+01 -1.1469071109412802e+01 - 3 -7.1131175159873807e+00 3.1523130842685656e+01 3.9133327910920080e+01 - 4 -1.1598618479874556e+01 -1.4069946914275876e+01 1.1631964860700624e+01 - 5 -3.5092143924598346e+01 -3.4761325046913385e+01 -2.1062123798094682e+01 - 6 4.3880849952881213e+01 -6.1732167988806470e+00 -2.6034788339533911e+01 - 7 -1.4366916728367732e+01 1.3135040103127022e+01 -3.0387136809768114e+00 - 8 -8.5333281419768152e+00 -2.4737111100998341e+01 6.5176870591189896e+01 - 9 -1.2996571868203626e+01 1.3674206710496637e+01 -6.7871105914534136e-01 - 10 1.1736432849972303e+01 3.5147252452549331e+01 -4.9691358934493351e+01 - 11 -1.9930599656448692e+01 -3.2836744898198695e+00 7.6150969595859648e+00 - 12 -5.8293065548538676e+00 -1.3423749355667578e+01 -5.2738511429384261e+00 - 13 7.7658418286979880e-01 2.0512357329016990e+00 1.8932242747136030e+00 - 14 1.2984672111772397e+01 -7.2763363322054886e-01 -4.8588140465034968e+00 - 15 7.4743142834562475e+00 -3.4640965582760912e+00 9.4855052919847456e+00 - 16 3.6043562512330527e+00 8.0382102532623314e+00 4.0048096667552056e+00 - 17 5.4695804680835325e-01 -7.5537048761029524e-01 4.0487452808956131e-01 - 18 -1.1709942604030243e-01 -8.9468235295759790e-01 3.5008479949198064e+00 - 19 9.8256914435042142e-01 1.2515894863018673e+00 -1.5372413162209075e+00 - 20 -8.6546971831011899e-01 -3.5690713334426938e-01 -1.9636066786988988e+00 - 21 6.0524643645662701e-01 7.0314728523699266e-01 -2.2349906198624625e+00 - 22 -1.0299517357238868e+00 -6.7850914711871446e-01 8.1029011311054377e-01 - 23 4.2470529926725969e-01 -2.4638138118278197e-02 1.4247005067519189e+00 - 24 4.1516966455942839e-01 -1.5912776575034653e+00 9.3767616296742518e-01 - 25 3.0070697634260080e-01 1.0957067953103117e+00 -1.8209981159009125e-01 - 26 -7.1587664090202918e-01 4.9557086219315349e-01 -7.5557635137733392e-01 - 27 -1.4554421797121797e-02 1.1056084388026395e-01 -3.5467198058463670e-02 - 28 -2.8257906393443971e-02 -6.6089589395111600e-02 5.7412954785172193e-04 - 29 4.2812328190565768e-02 -4.4471254485152351e-02 3.4893068510611948e-02 + 1 4.7316793853445795e+01 8.2815577813110224e+00 -3.2021703111755372e+01 + 2 -1.1508196824491352e+00 -9.3814982172707655e+00 -7.5761211707510290e+00 + 3 -5.1083163691832700e+00 5.2667553294971505e+01 5.1784852458007485e+01 + 4 -1.6078177452605996e+01 -2.4156048365236188e+01 1.3140924677013103e+01 + 5 -4.4915734474022237e+01 -4.8095168640411721e+01 -2.3331149037574118e+01 + 6 4.7077916942842322e+01 -9.5906213020089819e+00 -3.2570331503075479e+01 + 7 -1.6228599672412457e+01 1.4485102617342356e+01 -3.5441153194985260e+00 + 8 -6.5097893981550499e+00 -2.5117582302614572e+01 8.2131369512415944e+01 + 9 -1.5527440970965969e+01 1.6147270375910502e+01 -4.0812004993325823e-01 + 10 1.0070812216240975e+01 4.1571532807578812e+01 -6.5968810328796266e+01 + 11 -2.0431584971707455e+01 -6.4817395192247522e+00 8.9879981618991565e+00 + 12 -1.0884695976714699e+01 -1.1067390190389055e+01 -9.1551242768940497e+00 + 13 2.8052913970098858e+00 7.1296301666595081e+00 1.3173039168680845e-02 + 14 1.5254877537873536e+01 -8.9700095533297279e+00 -6.5719846903613188e+00 + 15 1.2392009100170998e+01 -6.0827695435257247e+00 1.7929674392339585e+01 + 16 4.7158712437379569e-01 1.0631038523396514e+01 6.0960085687560088e+00 + 17 1.4458707962589645e+00 -1.9708579331587333e+00 1.0634586790394511e+00 + 18 1.4201882413835887e-01 1.4265339757773328e+00 -5.7663956896747930e+00 + 19 -1.6609130686729350e+00 -2.0735307593211112e+00 2.4755525101127116e+00 + 20 1.5188942445345761e+00 6.4699678354377854e-01 3.2908431795620818e+00 + 21 3.2242729509516455e+00 4.0079233768386207e+00 -1.2047892238651006e+01 + 22 -5.7215184687399852e+00 -3.8871624402883467e+00 4.2679223469272296e+00 + 23 2.4972455177883397e+00 -1.2076093655027398e-01 7.7799698917237752e+00 + 24 -1.1661978296905469e+00 4.5271404898674845e+00 -2.6925565853370190e+00 + 25 -9.2712094527152134e-01 -3.1291890525017116e+00 5.1208215565053816e-01 + 26 2.0933187749620683e+00 -1.3979514373657729e+00 2.1804744296864809e+00 + 27 -2.6804542538020482e-01 2.1830651328698081e+00 -7.3931790038945333e-01 + 28 -5.7927072943128266e-01 -1.3052929090347896e+00 2.8365455885795837e-02 + 29 8.4731615481148748e-01 -8.7777222383501852e-01 7.1095244450365747e-01 ... diff --git a/unittest/force-styles/tests/angle-zero.yaml b/unittest/force-styles/tests/angle-zero.yaml index 0deee051b..71f4451d7 100644 --- a/unittest/force-styles/tests/angle-zero.yaml +++ b/unittest/force-styles/tests/angle-zero.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/atomic-pair-adp.yaml b/unittest/force-styles/tests/atomic-pair-adp.yaml index 12170e69b..c8eb06a3b 100644 --- a/unittest/force-styles/tests/atomic-pair-adp.yaml +++ b/unittest/force-styles/tests/atomic-pair-adp.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-13 prerequisites: ! | pair adp @@ -49,41 +49,41 @@ init_forces: ! |2 30 -1.0514674962209756e+00 4.6022227597482734e-01 -1.6698279858900587e+00 31 -1.4488194920959718e+00 -3.1789190528067137e+00 2.9594105842256515e+00 32 -2.0773789987296838e+00 -2.1888455436203138e+00 -1.3852152623916831e+00 -run_vdwl: -97.2840335101252 +run_vdwl: -96.3734477054396 run_coul: 0 run_stress: ! |2- - 1.0925403884890126e+02 1.0018439642388212e+02 8.3068253121729811e+01 4.5993272946160433e+00 -1.7799394161194859e+00 2.9390998409508358e+00 + 1.0951004479511994e+02 9.8811690876958494e+01 8.2888847962836564e+01 4.4647274907395618e+00 -1.6370120128669803e+00 3.1799350694512256e+00 run_forces: ! |2 - 1 2.4064978281383116e+00 2.8310326936438877e+00 -3.5810016705697367e-01 - 2 -1.1261310132338069e+00 -1.5312320923043055e+00 9.6952704543098811e-01 - 3 -2.4650555117225181e-01 1.8315233906328920e+00 -5.7634113367450002e-01 - 4 1.2242282478350608e-01 -4.3211338579366498e-01 -1.8416879128899488e+00 - 5 -7.0953596594993995e-01 4.3872501528819772e+00 1.2198764107921147e+00 - 6 1.4355778194846196e+00 3.1230427942640886e+00 1.0460063095047266e-01 - 7 -1.3416390203108872e+00 2.8948917966566108e+00 5.2646849990322797e-01 - 8 -1.4007930720394097e+00 -1.5230294132832771e+00 3.4579502678166296e-01 - 9 -1.2622837538049017e+00 -2.2231298677487961e+00 -2.0045399334221412e+00 - 10 -4.3913922697311669e-01 -9.0840973588166463e-01 -2.8218327626483251e+00 - 11 -1.3147642860228517e+00 -4.8236401147771337e+00 2.6871309117513680e+00 - 12 -1.0957379311264326e+00 -2.9278906379066498e+00 4.6929334188560934e-01 - 13 6.7249226506672344e-01 1.1483409210433106e-01 -9.6784482414126272e-01 - 14 1.4106438235859298e+00 3.6819359106125810e-01 1.1836433781724227e+00 - 15 -1.0871174078364445e+00 8.4370127310773335e-01 -1.4801691474240857e+00 - 16 3.8907862703737037e+00 -3.3139955888245916e+00 1.5672229237406345e+00 - 17 2.1444955824270222e+00 4.8533155990282646e+00 1.0545502443590111e+00 - 18 -4.0554294388745866e+00 -1.3079577852355624e+00 -1.5174362521234366e+00 - 19 -3.0072194753444514e+00 -2.4667032104263260e+00 3.5614927986445716e-01 - 20 3.5586969111907174e-01 1.4473797586761281e-01 -8.3789376744459909e-01 - 21 2.6413106532436315e+00 2.9469445429824588e+00 8.5617991697448781e-01 - 22 2.2100391009224801e-01 -2.6566634187479758e+00 -8.0101369565518421e-01 - 23 1.1776903128486964e+00 1.3203050720866989e+00 -2.6493524059502667e+00 - 24 3.1945792941270805e+00 2.0791083868152311e+00 2.4754363069038008e+00 - 25 2.4537864834143148e+00 5.5354561408985292e-01 -1.4374704915688303e+00 - 26 -1.2204586684158216e+00 -2.3600757011587330e+00 3.1427413394695853e+00 - 27 -5.5338014379062539e-01 -1.9087190309620143e+00 -1.5736095755530599e+00 - 28 7.8017213821606735e-01 1.4703377685237793e+00 1.9909979967943472e+00 - 29 4.4948816191724444e-01 3.3942012039423943e+00 3.4685365598763132e-03 - 30 -1.0472698350323018e+00 4.0806056721724765e-01 -1.6032550490562876e+00 - 31 -1.4002064035600614e+00 -3.0959067091238390e+00 2.8187227270565738e+00 - 32 -2.0492058653502760e+00 -2.0855598227317866e+00 -1.3012573987817382e+00 + 1 2.6335998588684562e+00 3.0718713056748426e+00 -4.3533883052139938e-01 + 2 -1.2130965248435011e+00 -1.6332850675279018e+00 9.8731476914861804e-01 + 3 -2.5840774553985979e-01 1.8994020639949443e+00 -5.7661952344793110e-01 + 4 1.2528355266020463e-01 -4.8243055870799778e-01 -1.9255512172616964e+00 + 5 -8.1576844641669455e-01 4.5793888293654188e+00 1.2610014118343751e+00 + 6 1.4628471254610576e+00 3.3500676329737855e+00 1.2375854450218134e-01 + 7 -1.4486431442568142e+00 2.9655818125329838e+00 6.4300795550990542e-01 + 8 -1.3787022640845215e+00 -1.5717466998275595e+00 3.3106855030667537e-01 + 9 -1.3669610559153875e+00 -2.2775005623760229e+00 -2.0338631409771621e+00 + 10 -4.9548531986472533e-01 -7.7008996071212898e-01 -2.9350474821717696e+00 + 11 -1.4224562527345270e+00 -5.0338094687683173e+00 2.8593904715509284e+00 + 12 -1.2087011193233312e+00 -3.0829096279281289e+00 5.1182767728505318e-01 + 13 7.8471366815190979e-01 1.0282659894606264e-01 -1.0352582452260137e+00 + 14 1.4064366196299338e+00 2.4429883832495394e-01 1.2101230450834048e+00 + 15 -1.1668201827660081e+00 9.4018440130184955e-01 -1.5622141068461959e+00 + 16 4.2171613644943520e+00 -3.4643382186863851e+00 1.6317861784965257e+00 + 17 2.1376838918048078e+00 4.9432137466293753e+00 1.1907219416870334e+00 + 18 -4.2326444593771129e+00 -1.3509032521738131e+00 -1.5594273015627202e+00 + 19 -3.1524589317374754e+00 -2.5623951878717328e+00 3.6277951534825598e-01 + 20 3.8434418251627672e-01 1.0697323687332358e-01 -8.0614086504594651e-01 + 21 2.7349309312679035e+00 3.0875426783244739e+00 9.1007767941983708e-01 + 22 1.7287287960198522e-01 -2.8047726299186184e+00 -8.2832831335879464e-01 + 23 1.2363533716088724e+00 1.2872828596445158e+00 -2.8090656111273011e+00 + 24 3.3561480309646243e+00 2.1114384815764389e+00 2.5304710382098818e+00 + 25 2.6074280504378859e+00 5.4071369711839212e-01 -1.5075274158460379e+00 + 26 -1.2861527438203963e+00 -2.4549198518427682e+00 3.2518821797827000e+00 + 27 -5.9662657311150602e-01 -1.9114718761912197e+00 -1.6095442760753069e+00 + 28 8.5847169431506698e-01 1.5141674913883303e+00 1.9840696080927263e+00 + 29 5.0666993590991882e-01 3.5646528382237204e+00 -6.9720557975667230e-02 + 30 -1.0517587489230662e+00 4.5990454362168903e-01 -1.6684632913670490e+00 + 31 -1.4508696109956738e+00 -3.1803634351741605e+00 2.9585845883357167e+00 + 32 -2.0793920339826530e+00 -2.1885746588083443e+00 -1.3857549757828296e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-atm.yaml b/unittest/force-styles/tests/atomic-pair-atm.yaml index 3297ae8ba..0dbd3b2e9 100644 --- a/unittest/force-styles/tests/atomic-pair-atm.yaml +++ b/unittest/force-styles/tests/atomic-pair-atm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-12 prerequisites: ! | pair atm @@ -51,41 +51,41 @@ init_forces: ! |2 30 -5.4737231063771909e-02 -7.4768574267284921e-04 -7.9319198647640782e-02 31 -1.6935816002065361e-02 -1.0547543496314456e-01 5.0982604012348082e-02 32 -1.2390716429105794e-01 -7.2578142947119742e-02 -4.1957221348949782e-02 -run_vdwl: 4.29678520905175 +run_vdwl: 4.2978376627225 run_coul: 0 run_stress: ! |2- - 1.2902501676629520e+01 1.2783007042632454e+01 1.2985558162203775e+01 3.1902451318206584e-02 4.9692682027741341e-03 -4.5841675964141118e-03 + 1.2906967061285989e+01 1.2784294465524448e+01 1.2989277437691916e+01 3.2259383532254583e-02 4.8758996531777293e-03 -4.1128361419111841e-03 run_forces: ! |2 - 1 3.3734691997181203e-02 6.5926666157357816e-02 -2.0212661794738487e-02 - 2 -4.0243038944484999e-02 -2.0489733787140557e-02 4.3944476008022572e-02 - 3 -5.2124466923619217e-02 1.9244290660437285e-01 -4.0102595899321400e-02 - 4 4.3912830867371563e-02 -5.0564625615345709e-03 -3.2091995790436166e-02 - 5 -1.8276949365810320e-02 8.6512717045277576e-02 2.8791766737910139e-02 - 6 2.6660132934969657e-02 3.4027933791671121e-02 -6.0675731973441971e-03 - 7 -3.1808400382727343e-02 6.6249693662560338e-02 5.5345909483010495e-03 - 8 -2.0612413489651919e-02 -3.7877790722024657e-02 -8.5691734712158591e-03 - 9 1.2263382774671270e-03 -5.9895799055484623e-02 4.0588659240649401e-03 - 10 -3.7440753216426176e-02 -4.6456691559416383e-02 -1.0636399332268090e-01 - 11 -3.2661856092849051e-02 -7.5500387920977463e-02 1.1885632033435473e-02 - 12 -2.3166162640220526e-02 -6.6740696046220585e-02 -9.2808128163209339e-03 - 13 1.7535325333773860e-03 -1.4604621599631754e-02 -2.7610891988407594e-02 - 14 2.8149735580433134e-02 -6.3563214206855748e-02 7.4492378499084966e-02 - 15 2.4305838534998442e-03 7.1135700954773600e-03 -3.0207324091680986e-02 - 16 1.1449426216077799e-01 -6.3461697505436884e-02 2.0756074304336219e-02 - 17 1.1714556130218040e-02 1.0446430266193403e-01 3.6365861543390894e-02 - 18 -9.2367659037495664e-02 3.6774544203677408e-02 -6.6049192627083544e-02 - 19 -9.7706710589851697e-02 -2.9443191787610248e-02 4.2123682373641815e-02 - 20 5.8042341223428712e-03 -1.2104389541143005e-03 1.4565283993158821e-02 - 21 9.7577971934171351e-02 3.6678603760412057e-02 -2.4126944368435588e-02 - 22 8.4457546203480730e-03 -5.9921078808321059e-02 2.0335050625926256e-02 - 23 4.7688299465539027e-02 1.1877198168582574e-01 -3.2379193036300082e-02 - 24 7.7970150423267132e-02 5.7667199610007810e-02 5.7146883072702444e-02 - 25 7.0271860854181273e-02 -4.2706597092193072e-02 -3.4975460737548668e-02 - 26 -1.5841314381102450e-02 -1.1690659586025803e-01 1.0077570722559201e-01 - 27 1.5231359666175337e-02 2.9284322474196281e-02 1.0711563735310445e-02 - 28 8.8436437677884325e-02 3.5038915629166797e-03 4.1361615934702271e-02 - 29 -1.6414684901000294e-02 4.4551861225322273e-02 -4.6093104191993100e-03 - 30 -5.5028163808135369e-02 -1.3942838232525647e-03 -7.8635287340677290e-02 - 31 -1.7126389022898446e-02 -1.0598042766439184e-01 5.0743125098716896e-02 - 32 -1.2468377030293323e-01 -7.2760485586144660e-02 -4.2310147156906106e-02 + 1 3.5401721309115237e-02 6.6151336873749966e-02 -1.9719724377827347e-02 + 2 -4.0186763809660464e-02 -2.0854993702571011e-02 4.3564156334967394e-02 + 3 -5.2820010582647819e-02 1.9402027303196295e-01 -3.9782002457720449e-02 + 4 4.3294629615879932e-02 -5.3566645090954174e-03 -3.2263283314663521e-02 + 5 -1.8378897090245969e-02 8.7246556653410343e-02 2.8053245131795038e-02 + 6 2.6232367484997965e-02 3.5060350748682835e-02 -5.2206558017400973e-03 + 7 -3.1527323048459593e-02 6.5984312542039444e-02 6.7389658719831658e-03 + 8 -1.9855910842240573e-02 -3.7622802584800094e-02 -8.4482312154984043e-03 + 9 5.4856672365414410e-04 -5.9571065857357122e-02 4.4768992945615847e-03 + 10 -3.8675871678911206e-02 -4.6879733954323363e-02 -1.0782500098987788e-01 + 11 -3.2817216375070735e-02 -7.5514260839380135e-02 1.1968644424281518e-02 + 12 -2.4475979845238492e-02 -6.7196817501989303e-02 -9.0388543456681111e-03 + 13 2.6155879085454393e-03 -1.4537088966496406e-02 -2.7380086488130857e-02 + 14 2.8022126159726869e-02 -6.5267741664761889e-02 7.5447861721112994e-02 + 15 1.9864184880557258e-03 7.2165814788740035e-03 -3.0735996532295987e-02 + 16 1.1665348252753197e-01 -6.4232317162071603e-02 2.1257641389521350e-02 + 17 1.0970114277397797e-02 1.0455135710732520e-01 3.5692908103572597e-02 + 18 -9.2033642815095240e-02 3.6070951951039168e-02 -6.5805442692928498e-02 + 19 -9.7758656960776430e-02 -2.8758989687168304e-02 4.2814225276081364e-02 + 20 6.6052526704885707e-03 -1.1412669164007950e-03 1.4620703883852976e-02 + 21 9.8556356324640437e-02 3.7647350349833450e-02 -2.4134796120472056e-02 + 22 7.9143649713514612e-03 -6.0296720982841029e-02 1.9530903648322953e-02 + 23 4.6716657905498074e-02 1.1858326999885892e-01 -3.3798456551843312e-02 + 24 7.7516105367544330e-02 5.7413902243213376e-02 5.6960262870515956e-02 + 25 6.9931796492555598e-02 -4.2434731189407528e-02 -3.5026903538419231e-02 + 26 -1.6191450675578506e-02 -1.1756583460234057e-01 1.0093058326973189e-01 + 27 1.4993409909210692e-02 2.8999867813830314e-02 1.1307382558895171e-02 + 28 8.8224082745384930e-02 2.9470751338946514e-03 4.1471260624656496e-02 + 29 -1.5741505346307305e-02 4.4269590456497976e-02 -5.3499638747653271e-03 + 30 -5.4772143709541747e-02 -8.1097185829389999e-04 -7.9266803882798428e-02 + 31 -1.6955755719736010e-02 -1.0553514857043328e-01 5.0965681063917891e-02 + 32 -1.2399191238206866e-01 -7.2585625833481202e-02 -4.2005123283120671e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-beck.yaml b/unittest/force-styles/tests/atomic-pair-beck.yaml index 6977253a2..e2398914a 100644 --- a/unittest/force-styles/tests/atomic-pair-beck.yaml +++ b/unittest/force-styles/tests/atomic-pair-beck.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-13 prerequisites: ! | pair beck @@ -49,41 +49,41 @@ init_forces: ! |2 30 -4.2587399053040723e-02 -3.0047441564997463e-02 -8.4420708024142574e-02 31 -2.0646215864156710e-02 -1.1590109109011101e-01 7.4785523155347783e-02 32 -1.9351936790460383e-01 -6.3281924064284692e-02 -2.2278650486481616e-02 -run_vdwl: 1.66727313959022 +run_vdwl: 1.66842323237505 run_coul: 0 run_stress: ! |2- - 6.1925536052639654e+00 6.0572952427592908e+00 5.8826299176822126e+00 2.0544339243117685e-01 -2.2313076013814197e-02 -9.0766973890911720e-02 + 6.1945945010955059e+00 6.0608213175977346e+00 5.8870610876826692e+00 2.0713170028170666e-01 -2.1315978613950362e-02 -8.9579347008543392e-02 run_forces: ! |2 - 1 1.0239633039926725e-02 6.5143827450340364e-02 1.3356826483242093e-02 - 2 -2.2314719471620656e-02 -7.7524048072324103e-02 4.8999120956964244e-02 - 3 -3.9043356167461310e-02 1.8727112838178461e-01 -5.0358319798713573e-02 - 4 2.1555032357536419e-02 -9.6560594717705842e-03 -5.2219716189557459e-02 - 5 5.5684800051774425e-02 1.4098076904655099e-01 3.6430385066003400e-02 - 6 4.2103920880822591e-02 2.9054969006626474e-02 -8.0777612688504273e-03 - 7 -6.4964007845713198e-02 9.0824767968312611e-02 -1.1492723622049571e-02 - 8 -6.9887913442026883e-02 -6.1361833172215080e-02 4.5061146458178193e-02 - 9 1.5493100590754061e-02 -5.6306897489850329e-02 -2.9234346430697500e-02 - 10 -3.0007119247408176e-02 -1.4355108862388466e-01 -1.1246502108073943e-01 - 11 -4.0156583919137311e-02 -5.1238608597329385e-02 4.2111943233834694e-02 - 12 3.2215137822304681e-02 -8.8013573252647803e-02 -4.0049313931954829e-03 - 13 -1.9322692597672969e-02 2.3710729929784284e-02 -4.6453771737164938e-02 - 14 5.7508119494667061e-02 -1.5717550633209541e-02 6.8891636737719267e-02 - 15 -3.1551853669997326e-02 3.2002272431756511e-02 -2.7508264035627245e-02 - 16 1.0688913507194681e-01 -9.0842064004416773e-02 3.6419114836833077e-02 - 17 4.4576981542844771e-02 1.3022472735575572e-01 -7.5802578101500360e-04 - 18 -1.4789240022198286e-01 -3.4554799550127843e-02 -7.1472575936121843e-02 - 19 -1.5516657001979403e-01 -8.1733453439229858e-02 3.6527707276003518e-02 - 20 2.3565107656625076e-02 2.0131835166166397e-02 -3.4090223526710393e-02 - 21 1.6266310464239428e-01 4.8905845528845679e-02 4.9357147579654733e-03 - 22 3.9108118507976131e-03 -8.1159765340878515e-02 -1.0833146931204877e-02 - 23 4.9862133468538940e-02 1.2418637390189499e-01 -7.7818397268800285e-02 - 24 1.2773306915414476e-01 9.4426377034667608e-02 8.4499929493330947e-02 - 25 7.0365782722834294e-02 4.4772437383421562e-03 -4.6793954837637514e-02 - 26 -5.0367468327228382e-02 -1.4927976328251297e-01 1.2849283650241430e-01 - 27 4.6468158313960936e-02 -4.1893768988097574e-03 -1.3381219210924535e-03 - 28 1.1447648870047913e-02 5.8175458417239131e-02 7.3359281810092353e-02 - 29 4.7807507958107280e-02 1.0732101464030744e-01 -1.9887006822288077e-03 - 30 -4.2515399306546596e-02 -2.9914522212438972e-02 -8.4055981768013960e-02 - 31 -2.1955842603439347e-02 -1.1661294560481096e-01 7.4709136906302168e-02 - 32 -1.9494325864999937e-01 -6.5180990351917406e-02 -2.2830796309462689e-02 + 1 1.3136442819446297e-02 6.5498227396166772e-02 1.4145079083803582e-02 + 2 -2.2034256341501031e-02 -7.7576337504999759e-02 4.8909120526581029e-02 + 3 -3.8436899824314447e-02 1.8975362753060651e-01 -4.8726243312969583e-02 + 4 2.0978949923146778e-02 -9.8857596948180391e-03 -5.2578611127355887e-02 + 5 5.5986284762286023e-02 1.4251627170733119e-01 3.5581774735974521e-02 + 6 4.1609279496864444e-02 2.9580611045096697e-02 -7.0798904205760750e-03 + 7 -6.4247787133974374e-02 8.9462542313753363e-02 -1.0352978485464128e-02 + 8 -6.8720764193947903e-02 -6.0890053624964295e-02 4.4724105740396945e-02 + 9 1.4478842067913332e-02 -5.5303569204355849e-02 -2.8303411291253081e-02 + 10 -3.2442332658613321e-02 -1.4462919699482241e-01 -1.1490578105368766e-01 + 11 -4.0380055369720995e-02 -5.0488836940910345e-02 4.2886305247645820e-02 + 12 3.1042227864624215e-02 -8.8123764507346422e-02 -3.9836068884396428e-03 + 13 -1.8662269139604476e-02 2.4488419239999688e-02 -4.7017343437126720e-02 + 14 5.6758199931667197e-02 -1.8416861914698303e-02 7.0021194400955999e-02 + 15 -3.1890572551505292e-02 3.1680930947275934e-02 -2.8098680581825183e-02 + 16 1.0974868678912759e-01 -9.1700220406539495e-02 3.7353142364615385e-02 + 17 4.3949528608521672e-02 1.3055969016019356e-01 -1.5187494682300476e-03 + 18 -1.4779001114950291e-01 -3.5544673929873906e-02 -7.0803580120720383e-02 + 19 -1.5575778115409988e-01 -8.1593082966047878e-02 3.7401415485950447e-02 + 20 2.4191778828097237e-02 1.9797464419968807e-02 -3.4094272334447562e-02 + 21 1.6277653141489679e-01 5.0613511902067546e-02 4.3814155017482693e-03 + 22 3.0806866323392548e-03 -8.1893077433857112e-02 -1.1674668194295391e-02 + 23 4.7291190912019797e-02 1.2321965162274764e-01 -8.0293981714821758e-02 + 24 1.2796380708349342e-01 9.4709252988459863e-02 8.3837086418314360e-02 + 25 6.9978376175952553e-02 4.2426017561827088e-03 -4.6754324535236834e-02 + 26 -5.1719666902434014e-02 -1.5090737132817128e-01 1.2863915933326120e-01 + 27 4.6200161027657921e-02 -4.6572247814397581e-03 -3.2134778218044849e-04 + 28 1.1176499425351219e-02 5.7636543505236171e-02 7.3674923849034277e-02 + 29 4.8792715040429396e-02 1.0735909128078319e-01 -3.0905737063130702e-03 + 30 -4.2586902664599219e-02 -3.0035740191794790e-02 -8.4399528449889391e-02 + 31 -2.0779726081630163e-02 -1.1598584252757124e-01 7.4785159127376918e-02 + 32 -1.9369116363838693e-01 -6.3486823863658212e-02 -2.2342308910825545e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-born.yaml b/unittest/force-styles/tests/atomic-pair-born.yaml index 89c43d44e..4769fc729 100644 --- a/unittest/force-styles/tests/atomic-pair-born.yaml +++ b/unittest/force-styles/tests/atomic-pair-born.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Jul 30 03:30:06 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-13 prerequisites: ! | pair born @@ -49,41 +49,41 @@ init_forces: ! |2 30 -1.2005631838887281e+01 -6.4092999695138637e+00 -1.9850411539058847e+01 31 -5.5566952298732328e+00 -2.8420402803389738e+01 1.7818115115845121e+01 32 -4.3603353069761802e+01 -1.4618745302080386e+01 -5.8614805227083417e+00 -run_vdwl: 808.581991307929 +run_vdwl: 836.525645079158 run_coul: 0 run_stress: ! |2- - 2.1352577876164714e+03 2.1048336346087822e+03 2.0866093207888316e+03 1.6710708502154183e+01 -7.2805172515122214e+00 -5.1007546794256298e+00 + 2.1900813819406562e+03 2.1526856543612221e+03 2.1377858496227304e+03 3.1265932019331444e+01 -5.2753088928534844e+00 -1.2351730282986319e+01 run_forces: ! |2 - 1 4.3996728759831116e+00 1.3617808952853350e+01 3.9365269387608910e+00 - 2 -5.8870109187129227e+00 -1.6653786974892565e+01 1.0458442718468866e+01 - 3 -2.5384607642764081e+00 2.7976453386304165e+01 -7.9538384346985778e+00 - 4 2.6011652570379979e+00 3.4444982822291809e-01 -1.4078044299688214e+01 - 5 6.2739400167978490e+00 2.3321353952206238e+01 9.8524679762955127e+00 - 6 9.7615972917437634e+00 9.8314066166309821e+00 9.1579317972042351e-01 - 7 -8.4994423410616129e+00 1.7133945132359301e+01 -2.1335415687539081e+00 - 8 -1.4401879593786829e+01 -1.0717410919398073e+01 6.2772265942246497e+00 - 9 2.4581092844990748e+00 -1.5139809581001368e+01 -6.0486224458444502e+00 - 10 5.7295535185278368e-01 -2.2473696014663325e+01 -1.8469640259236243e+01 - 11 -8.3438231201666824e+00 -1.1773385047512056e+01 8.0911869578298905e+00 - 12 5.6018202198927955e+00 -1.3190833667603776e+01 3.2425752936252150e-01 - 13 -5.1665403937031575e+00 3.8641569820964516e+00 -8.0278457568777704e+00 - 14 1.1059028830337486e+01 -3.5867141219142817e-01 8.3359673389637585e+00 - 15 -7.0225257033738311e+00 3.4315031664638429e+00 -5.9505539807290697e+00 - 16 1.5086691796848593e+01 -1.7105542466895855e+01 6.8923022058483863e+00 - 17 7.7552246185118392e+00 2.3712928096926632e+01 -1.1565629751691666e+00 - 18 -2.2415417000611026e+01 -5.6849910964810348e+00 -1.0167777125296530e+01 - 19 -2.2914820778853272e+01 -9.2271207471412673e+00 6.1677237945523231e+00 - 20 6.5866441066676380e+00 6.2266458578595580e+00 -6.7918108679194686e+00 - 21 2.5378769975471076e+01 6.5502175694342872e+00 2.7113928300966954e+00 - 22 1.4722121850540351e+00 -1.6174770388907241e+01 -3.6146790093186110e+00 - 23 3.9177677709068743e+00 1.6640247776368867e+01 -1.5217886244976798e+01 - 24 1.6292888686152281e+01 1.6539457853286358e+01 1.3246494291709737e+01 - 25 1.2399183978889422e+01 2.2450939828300065e+00 -8.4542270100046313e+00 - 26 -5.5487323330521612e+00 -2.0228255850187249e+01 1.8528693239502584e+01 - 27 7.5279483917695700e+00 -3.0072122179470506e+00 6.9304022265424459e-01 - 28 -3.8508457491974468e-01 9.5889969664907753e+00 1.3098728886480401e+01 - 29 5.7371217847825058e+00 1.5830079463104170e+01 -9.7700534543667272e-01 - 30 -7.4069396659644475e+00 -5.7323481111133043e+00 -1.2021778057070120e+01 - 31 -3.9192345419264893e+00 -2.1509286285601934e+01 1.3203747851309895e+01 - 32 -3.0432830692790130e+01 -7.8776248019003354e+00 -1.6701791747605144e+00 + 1 6.1120175911319183e+00 1.6586713534991279e+01 2.3427471869018115e+00 + 2 -7.1439990034527057e+00 -1.9616138162527818e+01 1.3366345408780326e+01 + 3 -8.3740792864283371e+00 4.5687695450585252e+01 -1.1329024829724993e+01 + 4 6.5789906764567414e+00 -2.2428556454683433e+00 -1.4776284669722061e+01 + 5 8.7839850608305117e+00 3.1971267353669749e+01 1.0524231849791974e+01 + 6 1.0486825989898263e+01 9.4001289475307974e+00 -1.1575535043424319e+00 + 7 -1.4096800953831305e+01 2.1164975129644958e+01 -1.6614770040535538e+00 + 8 -1.6220633774875726e+01 -1.5735949365233726e+01 8.2398223640180497e+00 + 9 2.3098923219830225e+00 -1.5428849927742394e+01 -6.1389346271232608e+00 + 10 -5.4906970063424865e+00 -2.9882733840828749e+01 -2.8204614010656918e+01 + 11 -1.0767305870663957e+01 -1.4080960909838801e+01 1.0284449631079900e+01 + 12 5.0243479900549461e+00 -2.0425009875474444e+01 -3.8396559672122210e-01 + 13 -3.8645991200819987e+00 5.8084482454221043e+00 -1.1731205472792510e+01 + 14 1.2955990333388423e+01 -5.6679952716384214e+00 1.6211273423578991e+01 + 15 -7.5489305769447794e+00 7.5587533366304553e+00 -7.4693700053380105e+00 + 16 2.7030144402533857e+01 -2.2088082849829568e+01 8.9608911928336603e+00 + 17 9.6709219095905983e+00 3.1674400710139903e+01 1.7317262301062790e+00 + 18 -3.3064330598597465e+01 -5.7398087567170855e+00 -1.6704698294614381e+01 + 19 -3.4229151436449555e+01 -1.6290459456739452e+01 9.4640103300869338e+00 + 20 6.3444009547043976e+00 4.8548452372467823e+00 -7.0967526548233550e+00 + 21 3.7064108669504463e+01 1.0758788027720094e+01 4.2755449594794126e-01 + 22 4.3976646647373352e-01 -2.1774689122251147e+01 -1.5388504905174949e+00 + 23 9.0095255114761343e+00 2.7540303709309974e+01 -1.8805498015616191e+01 + 24 2.7505559672112742e+01 2.1121378340214431e+01 1.9000798880974383e+01 + 25 1.8164869529852325e+01 8.0286303069777165e-01 -1.1486181103319115e+01 + 26 -9.5982329526180870e+00 -3.3736457370921237e+01 2.9057109434205746e+01 + 27 1.0219681844559718e+01 1.1476386614683189e+00 8.7304533304023835e-01 + 28 5.6616279971128094e+00 1.2080546451715168e+01 1.6841588048699421e+01 + 29 8.0427689832695837e+00 2.3893230899614760e+01 -1.0232661755760464e+00 + 30 -1.1957061813322168e+01 -6.4025628148862097e+00 -1.9756908805016277e+01 + 31 -5.5613030897974003e+00 -2.8362852520634963e+01 1.7766507154200429e+01 + 32 -4.3488300421528173e+01 -1.4576571175869466e+01 -5.8275157042882082e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-colloid.yaml b/unittest/force-styles/tests/atomic-pair-colloid.yaml index a9e12b3f3..9ac371067 100644 --- a/unittest/force-styles/tests/atomic-pair-colloid.yaml +++ b/unittest/force-styles/tests/atomic-pair-colloid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-14 prerequisites: ! | pair colloid @@ -53,36 +53,36 @@ init_forces: ! |2 25 -1.1259499193288544e-01 1.6395143300644177e-02 -9.0439962448757879e-04 26 1.0304882476745540e-01 7.8050496446500431e-03 1.9255643852370385e-02 27 -4.3346315050731818e-02 -2.2993111981455712e-02 -1.1392238078737215e-02 -run_vdwl: 0.0367182211916192 +run_vdwl: 0.546631276624111 run_coul: 0 run_stress: ! |2- - 3.2545234036053254e+00 1.2817594721674045e+01 2.9383804763809485e+00 -6.5738604535059864e+00 2.3065705273606478e+00 1.5121755374667603e+00 + 5.6665057159424279e+00 1.4285058934754080e+01 5.9048859060593220e+00 -8.4818814420023418e+00 5.2881315002023017e+00 -1.1970976964673827e+00 run_forces: ! |2 - 1 4.1447236896055568e-02 8.4984633363665834e-03 -7.1565468520811443e-02 - 2 -2.4451051586476304e-04 -5.7391827303752204e-05 1.6907428582411947e-05 - 3 -1.6184661894786571e-02 -1.2047019655367870e-02 -1.2189740041384602e-02 - 4 4.7049123492354846e-04 -3.0305522972900800e-02 -4.3609470856651497e-02 - 5 7.9841068285770012e-04 6.5880880038333371e-05 1.3840659114887740e-04 - 6 5.4775302106929926e+00 -3.3435741912382899e+00 5.8021270645808745e+00 - 7 -3.4577504657755014e-03 -9.3349532033408413e-04 -1.5696706937008277e-03 - 8 1.3392885595460452e-01 -2.9467417351771795e-02 -9.0902656642780702e-03 - 9 -1.7123469245219562e-02 1.5862013571050645e-02 -1.3049795876411903e-02 - 10 1.8544095678649998e-04 3.9928059116526140e-04 1.2197284521083842e-04 - 11 1.5450042897697011e-02 -1.0557539868014379e-01 -1.1539698970598398e-01 - 12 -1.6489596487183065e+00 4.4215309402003911e+00 1.2758457405639687e+00 - 13 -1.3347630087741680e-01 3.6628535027741112e-02 -5.6719354360201757e-02 - 14 -4.1553429683017021e-02 -1.1540368471833904e-02 1.5467778628554116e-01 - 15 1.7577484997124488e+00 -4.3805631271698307e+00 -1.2463135748050815e+00 - 16 1.0396685127639720e-03 7.5317296594891241e-04 4.1929174719427522e-05 - 17 1.1778403499163440e-03 -7.1238534940179336e-05 3.8035065505820104e-03 - 18 -3.3315903593767987e-02 -2.1130575404712599e-02 1.4962162894607431e-02 + 1 4.0537507872915053e-02 1.0013640201526583e-02 -7.4355259432510867e-02 + 2 -2.4485071669905174e-04 -5.6491959787860711e-05 1.5762341909211182e-05 + 3 -1.6525210356374609e-02 -1.0700896145717292e-02 -1.2466738605043475e-02 + 4 5.0895222294109008e-04 -3.7419904027191128e-02 -5.2521332284172585e-02 + 5 8.5578946640614008e-04 8.0514060368271155e-05 1.6089100898761868e-04 + 6 1.0911859985057569e+01 -7.9829483219779931e+00 1.1645117315742233e+01 + 7 -4.1062783933935344e-03 -1.1807936887044740e-03 -1.9906886909716232e-03 + 8 1.5636388167915602e-01 -2.6781130173509270e-02 -6.1357481353796735e-03 + 9 -1.5567285888326367e-02 1.4722366247268760e-02 -1.1953767152526074e-02 + 10 1.8805531793129058e-04 3.7820400166769451e-04 1.4614304834967826e-04 + 11 -1.4864493912733895e-03 -1.0424975640019393e-01 -1.0816074777358398e-01 + 12 -1.4904584977612405e+00 4.2295428937341466e+00 1.1884379359045367e+00 + 13 -1.1886876552110640e-01 2.9541662205201557e-02 -4.8308607756837901e-02 + 14 -4.1308859452544304e-02 -1.3119548152383659e-02 1.5120405320455541e-01 + 15 1.5979084315924961e+00 -4.1789376696435214e+00 -1.1491971372792293e+00 + 16 9.0310163053403483e-04 6.6079222833706974e-04 3.6708366832548456e-05 + 17 1.8715075729367309e-03 2.1147818438203045e-04 4.1547470949003821e-03 + 18 -3.0456290625962976e-02 -1.9427008524387373e-02 1.3856334852879893e-02 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 20 -6.6557683033616174e-03 -9.8089615075005066e-04 -4.5869764220629459e-04 - 21 6.4422979624128504e-03 1.1468754348007283e-03 6.8525347184504311e-04 - 22 -7.5216145678175033e-04 1.1318396788931372e-04 -9.2834078115899713e-04 - 23 -5.5282158633416767e+00 3.3673691649465551e+00 -5.7944723588252627e+00 - 24 5.8210356160171874e-02 7.7028326238927733e-02 1.0457588922155152e-01 - 25 -1.4075156519665147e-01 1.8202248246942915e-02 -2.0674716237672891e-03 - 26 1.1435050190904306e-01 8.6100147519947955e-03 2.0290916519561587e-02 - 27 -3.8088820630046961e-02 -1.9961457381631506e-02 -9.8563367312923152e-03 + 20 -6.8134551323710407e-03 -9.2563232531751437e-04 -2.5011200860506922e-04 + 21 6.5798593112743053e-03 1.0885497409975236e-03 5.0300594748037915e-04 + 22 -7.0187004021510127e-04 1.0724877221923711e-04 -8.7584649012749057e-04 + 23 -1.0963098689741106e+01 8.0069723546503830e+00 -1.1637002224325435e+01 + 24 4.2791276882802251e-02 7.5413656281613797e-02 9.2510054641217462e-02 + 25 -1.6396876440827662e-01 1.5180752630598059e-02 -5.8364823335845528e-03 + 26 1.2677571346204658e-01 9.1980780160170368e-03 2.1458873742780715e-02 + 27 -3.3538794640120287e-02 -1.7365037936021697e-02 -8.5471336286569340e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-colloid_multi.yaml b/unittest/force-styles/tests/atomic-pair-colloid_multi.yaml index fa62126a7..7923d672e 100644 --- a/unittest/force-styles/tests/atomic-pair-colloid_multi.yaml +++ b/unittest/force-styles/tests/atomic-pair-colloid_multi.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-14 prerequisites: ! | pair colloid @@ -53,36 +53,36 @@ init_forces: ! |2 25 -1.1259499193288544e-01 1.6395143300644177e-02 -9.0439962448757879e-04 26 1.0304882476745540e-01 7.8050496446500431e-03 1.9255643852370385e-02 27 -4.3346315050731818e-02 -2.2993111981455712e-02 -1.1392238078737215e-02 -run_vdwl: 0.0367182211916192 +run_vdwl: 0.546631276624111 run_coul: 0 run_stress: ! |2- - 3.2545234036053201e+00 1.2817594721674030e+01 2.9383804763809369e+00 -6.5738604535059864e+00 2.3065705273606469e+00 1.5121755374667567e+00 + 5.6665057159424261e+00 1.4285058934754046e+01 5.9048859060592864e+00 -8.4818814420023330e+00 5.2881315002022999e+00 -1.1970976964673721e+00 run_forces: ! |2 - 1 4.1447236896055561e-02 8.4984633363665869e-03 -7.1565468520811457e-02 - 2 -2.4451051586476304e-04 -5.7391827303752204e-05 1.6907428582411947e-05 - 3 -1.6184661894786571e-02 -1.2047019655367870e-02 -1.2189740041384602e-02 - 4 4.7049123492354846e-04 -3.0305522972900800e-02 -4.3609470856651497e-02 - 5 7.9841068285770055e-04 6.5880880038332991e-05 1.3840659114887751e-04 - 6 5.4775302106929935e+00 -3.3435741912382895e+00 5.8021270645808736e+00 - 7 -3.4577504657755018e-03 -9.3349532033408424e-04 -1.5696706937008275e-03 - 8 1.3392885595460452e-01 -2.9467417351771795e-02 -9.0902656642780702e-03 - 9 -1.7123469245219562e-02 1.5862013571050645e-02 -1.3049795876411903e-02 - 10 1.8544095678649998e-04 3.9928059116526140e-04 1.2197284521083842e-04 - 11 1.5450042897697011e-02 -1.0557539868014379e-01 -1.1539698970598398e-01 - 12 -1.6489596487183067e+00 4.4215309402003902e+00 1.2758457405639687e+00 - 13 -1.3347630087741644e-01 3.6628535027741022e-02 -5.6719354360201611e-02 - 14 -4.1553429683017021e-02 -1.1540368471833904e-02 1.5467778628554116e-01 - 15 1.7577484997124486e+00 -4.3805631271698307e+00 -1.2463135748050815e+00 - 16 1.0396685127639720e-03 7.5317296594891241e-04 4.1929174719427522e-05 - 17 1.1778403499163440e-03 -7.1238534940179363e-05 3.8035065505820104e-03 - 18 -3.3315903593767938e-02 -2.1130575404712564e-02 1.4962162894607408e-02 + 1 4.0537507872915053e-02 1.0013640201526581e-02 -7.4355259432510867e-02 + 2 -2.4485071669905174e-04 -5.6491959787860711e-05 1.5762341909211182e-05 + 3 -1.6525210356374609e-02 -1.0700896145717292e-02 -1.2466738605043475e-02 + 4 5.0895222294109008e-04 -3.7419904027191128e-02 -5.2521332284172585e-02 + 5 8.5578946640613943e-04 8.0514060368271588e-05 1.6089100898761854e-04 + 6 1.0911859985057569e+01 -7.9829483219779931e+00 1.1645117315742235e+01 + 7 -4.1062783933935344e-03 -1.1807936887044740e-03 -1.9906886909716228e-03 + 8 1.5636388167915602e-01 -2.6781130173509270e-02 -6.1357481353796735e-03 + 9 -1.5567285888326367e-02 1.4722366247268760e-02 -1.1953767152526074e-02 + 10 1.8805531793129058e-04 3.7820400166769451e-04 1.4614304834967826e-04 + 11 -1.4864493912733895e-03 -1.0424975640019393e-01 -1.0816074777358398e-01 + 12 -1.4904584977612405e+00 4.2295428937341466e+00 1.1884379359045367e+00 + 13 -1.1886876552110689e-01 2.9541662205201678e-02 -4.8308607756838103e-02 + 14 -4.1308859452544304e-02 -1.3119548152383659e-02 1.5120405320455541e-01 + 15 1.5979084315924958e+00 -4.1789376696435205e+00 -1.1491971372792293e+00 + 16 9.0310163053403483e-04 6.6079222833706974e-04 3.6708366832548456e-05 + 17 1.8715075729367327e-03 2.1147818438203180e-04 4.1547470949003804e-03 + 18 -3.0456290625962980e-02 -1.9427008524387373e-02 1.3856334852879893e-02 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 20 -6.6557683033616174e-03 -9.8089615075005066e-04 -4.5869764220629459e-04 - 21 6.4422979624128504e-03 1.1468754348007283e-03 6.8525347184504311e-04 - 22 -7.5216145678175033e-04 1.1318396788931372e-04 -9.2834078115899713e-04 - 23 -5.5282158633416767e+00 3.3673691649465547e+00 -5.7944723588252627e+00 - 24 5.8210356160171492e-02 7.7028326238927844e-02 1.0457588922155134e-01 - 25 -1.4075156519665147e-01 1.8202248246942915e-02 -2.0674716237672891e-03 - 26 1.1435050190904306e-01 8.6100147519947955e-03 2.0290916519561587e-02 - 27 -3.8088820630046961e-02 -1.9961457381631506e-02 -9.8563367312923152e-03 + 20 -6.8134551323710407e-03 -9.2563232531751437e-04 -2.5011200860506922e-04 + 21 6.5798593112743053e-03 1.0885497409975236e-03 5.0300594748037915e-04 + 22 -7.0187004021510127e-04 1.0724877221923711e-04 -8.7584649012749057e-04 + 23 -1.0963098689741106e+01 8.0069723546503813e+00 -1.1637002224325434e+01 + 24 4.2791276882802765e-02 7.5413656281613686e-02 9.2510054641217671e-02 + 25 -1.6396876440827662e-01 1.5180752630598059e-02 -5.8364823335845528e-03 + 26 1.2677571346204658e-01 9.1980780160170368e-03 2.1458873742780715e-02 + 27 -3.3538794640120287e-02 -1.7365037936021697e-02 -8.5471336286569340e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-colloid_multi_tri.yaml b/unittest/force-styles/tests/atomic-pair-colloid_multi_tri.yaml index bc455ac6e..38d51f356 100644 --- a/unittest/force-styles/tests/atomic-pair-colloid_multi_tri.yaml +++ b/unittest/force-styles/tests/atomic-pair-colloid_multi_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-13 prerequisites: ! | pair colloid @@ -54,36 +54,36 @@ init_forces: ! |2 25 -1.1259499193288525e-01 1.6395143300644142e-02 -9.0439962448757977e-04 26 1.0304882476745569e-01 7.8050496446502114e-03 1.9255643852370365e-02 27 -4.3346315050731436e-02 -2.2993111981455479e-02 -1.1392238078737104e-02 -run_vdwl: 0.0367182211916219 +run_vdwl: 0.546631276624125 run_coul: 0 run_stress: ! |2- - 3.2545234036053388e+00 1.2817594721674228e+01 2.9383804763809755e+00 -6.5738604535060468e+00 2.3065705273606301e+00 1.5121755374668360e+00 + 5.6665057159425141e+00 1.4285058934754488e+01 5.9048859060595005e+00 -8.4818814420024662e+00 5.2881315002023204e+00 -1.1970976964672442e+00 run_forces: ! |2 - 1 4.1447236896055638e-02 8.4984633363665851e-03 -7.1565468520811498e-02 - 2 -2.4451051586476380e-04 -5.7391827303752326e-05 1.6907428582411937e-05 - 3 -1.6184661894786685e-02 -1.2047019655368075e-02 -1.2189740041384702e-02 - 4 4.7049123492350683e-04 -3.0305522972901157e-02 -4.3609470856651830e-02 - 5 7.9841068285770012e-04 6.5880880038332612e-05 1.3840659114887713e-04 - 6 5.4775302106929926e+00 -3.3435741912382899e+00 5.8021270645808745e+00 - 7 -3.4577504657755053e-03 -9.3349532033408424e-04 -1.5696706937008277e-03 - 8 1.3392885595460410e-01 -2.9467417351771743e-02 -9.0902656642780511e-03 - 9 -1.7123469245219562e-02 1.5862013571050645e-02 -1.3049795876411906e-02 - 10 1.8544095678649792e-04 3.9928059116526535e-04 1.2197284521083560e-04 - 11 1.5450042897696470e-02 -1.0557539868014387e-01 -1.1539698970598380e-01 - 12 -1.6489596487183285e+00 4.4215309402004559e+00 1.2758457405639874e+00 - 13 -1.3347630087741638e-01 3.6628535027741001e-02 -5.6719354360201764e-02 - 14 -4.1553429683017180e-02 -1.1540368471833928e-02 1.5467778628554141e-01 - 15 1.7577484997124713e+00 -4.3805631271698946e+00 -1.2463135748050993e+00 - 16 1.0396685127639722e-03 7.5317296594891231e-04 4.1929174719427319e-05 - 17 1.1778403499163354e-03 -7.1238534940187549e-05 3.8035065505820221e-03 - 18 -3.3315903593768015e-02 -2.1130575404712623e-02 1.4962162894607469e-02 + 1 4.0537507872915039e-02 1.0013640201526628e-02 -7.4355259432510909e-02 + 2 -2.4485071669905233e-04 -5.6491959787860793e-05 1.5762341909211158e-05 + 3 -1.6525210356374626e-02 -1.0700896145717401e-02 -1.2466738605043531e-02 + 4 5.0895222294107621e-04 -3.7419904027191864e-02 -5.2521332284173328e-02 + 5 8.5578946640613932e-04 8.0514060368270612e-05 1.6089100898761840e-04 + 6 1.0911859985057617e+01 -7.9829483219779238e+00 1.1645117315742368e+01 + 7 -4.1062783933935310e-03 -1.1807936887044700e-03 -1.9906886909716232e-03 + 8 1.5636388167915585e-01 -2.6781130173509173e-02 -6.1357481353797629e-03 + 9 -1.5567285888326300e-02 1.4722366247268678e-02 -1.1953767152526006e-02 + 10 1.8805531793129020e-04 3.7820400166769380e-04 1.4614304834967978e-04 + 11 -1.4864493912745413e-03 -1.0424975640019400e-01 -1.0816074777358338e-01 + 12 -1.4904584977612991e+00 4.2295428937343154e+00 1.1884379359045845e+00 + 13 -1.1886876552110487e-01 2.9541662205201210e-02 -4.8308607756837312e-02 + 14 -4.1308859452544325e-02 -1.3119548152383642e-02 1.5120405320455521e-01 + 15 1.5979084315925551e+00 -4.1789376696436884e+00 -1.1491971372792762e+00 + 16 9.0310163053403689e-04 6.6079222833707125e-04 3.6708366832548463e-05 + 17 1.8715075729367286e-03 2.1147818438202660e-04 4.1547470949003795e-03 + 18 -3.0456290625963053e-02 -1.9427008524387408e-02 1.3856334852879930e-02 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 20 -6.6557683033616182e-03 -9.8089615075005370e-04 -4.5869764220629415e-04 - 21 6.4422979624128504e-03 1.1468754348007311e-03 6.8525347184504181e-04 - 22 -7.5216145678175326e-04 1.1318396788931422e-04 -9.2834078115900081e-04 - 23 -5.5282158633416776e+00 3.3673691649465551e+00 -5.7944723588252627e+00 - 24 5.8210356160171721e-02 7.7028326238927830e-02 1.0457588922155144e-01 - 25 -1.4075156519665108e-01 1.8202248246942852e-02 -2.0674716237672969e-03 - 26 1.1435050190904378e-01 8.6100147519948857e-03 2.0290916519561344e-02 - 27 -3.8088820630047288e-02 -1.9961457381631711e-02 -9.8563367312924106e-03 + 20 -6.8134551323710381e-03 -9.2563232531751730e-04 -2.5011200860506922e-04 + 21 6.5798593112743045e-03 1.0885497409975256e-03 5.0300594748037633e-04 + 22 -7.0187004021510387e-04 1.0724877221923791e-04 -8.7584649012749393e-04 + 23 -1.0963098689741154e+01 8.0069723546503138e+00 -1.1637002224325569e+01 + 24 4.2791276882800683e-02 7.5413656281613561e-02 9.2510054641216644e-02 + 25 -1.6396876440827649e-01 1.5180752630597804e-02 -5.8364823335845511e-03 + 26 1.2677571346204791e-01 9.1980780160173560e-03 2.1458873742780590e-02 + 27 -3.3538794640120474e-02 -1.7365037936021819e-02 -8.5471336286569739e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-colloid_tiled.yaml b/unittest/force-styles/tests/atomic-pair-colloid_tiled.yaml index 78341ac45..516395e3c 100644 --- a/unittest/force-styles/tests/atomic-pair-colloid_tiled.yaml +++ b/unittest/force-styles/tests/atomic-pair-colloid_tiled.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-14 prerequisites: ! | pair colloid @@ -53,36 +53,36 @@ init_forces: ! |2 25 -1.1259499193288544e-01 1.6395143300644177e-02 -9.0439962448757879e-04 26 1.0304882476745540e-01 7.8050496446500431e-03 1.9255643852370385e-02 27 -4.3346315050731818e-02 -2.2993111981455712e-02 -1.1392238078737215e-02 -run_vdwl: 0.0367182211916192 +run_vdwl: 0.546631276624111 run_coul: 0 run_stress: ! |2- - 3.2545234036053201e+00 1.2817594721674030e+01 2.9383804763809369e+00 -6.5738604535059864e+00 2.3065705273606469e+00 1.5121755374667567e+00 + 5.6665057159424261e+00 1.4285058934754046e+01 5.9048859060592864e+00 -8.4818814420023330e+00 5.2881315002022999e+00 -1.1970976964673721e+00 run_forces: ! |2 - 1 4.1447236896055561e-02 8.4984633363665869e-03 -7.1565468520811457e-02 - 2 -2.4451051586476304e-04 -5.7391827303752204e-05 1.6907428582411947e-05 - 3 -1.6184661894786571e-02 -1.2047019655367870e-02 -1.2189740041384602e-02 - 4 4.7049123492354846e-04 -3.0305522972900800e-02 -4.3609470856651497e-02 - 5 7.9841068285770055e-04 6.5880880038332991e-05 1.3840659114887751e-04 - 6 5.4775302106929935e+00 -3.3435741912382895e+00 5.8021270645808736e+00 - 7 -3.4577504657755018e-03 -9.3349532033408424e-04 -1.5696706937008275e-03 - 8 1.3392885595460452e-01 -2.9467417351771795e-02 -9.0902656642780702e-03 - 9 -1.7123469245219562e-02 1.5862013571050645e-02 -1.3049795876411903e-02 - 10 1.8544095678649998e-04 3.9928059116526140e-04 1.2197284521083842e-04 - 11 1.5450042897697011e-02 -1.0557539868014379e-01 -1.1539698970598398e-01 - 12 -1.6489596487183067e+00 4.4215309402003902e+00 1.2758457405639687e+00 - 13 -1.3347630087741644e-01 3.6628535027741022e-02 -5.6719354360201611e-02 - 14 -4.1553429683017021e-02 -1.1540368471833904e-02 1.5467778628554116e-01 - 15 1.7577484997124486e+00 -4.3805631271698307e+00 -1.2463135748050815e+00 - 16 1.0396685127639720e-03 7.5317296594891241e-04 4.1929174719427522e-05 - 17 1.1778403499163440e-03 -7.1238534940179363e-05 3.8035065505820104e-03 - 18 -3.3315903593767938e-02 -2.1130575404712564e-02 1.4962162894607408e-02 + 1 4.0537507872915053e-02 1.0013640201526581e-02 -7.4355259432510867e-02 + 2 -2.4485071669905174e-04 -5.6491959787860711e-05 1.5762341909211182e-05 + 3 -1.6525210356374609e-02 -1.0700896145717292e-02 -1.2466738605043475e-02 + 4 5.0895222294109008e-04 -3.7419904027191128e-02 -5.2521332284172585e-02 + 5 8.5578946640613943e-04 8.0514060368271588e-05 1.6089100898761854e-04 + 6 1.0911859985057569e+01 -7.9829483219779931e+00 1.1645117315742235e+01 + 7 -4.1062783933935344e-03 -1.1807936887044740e-03 -1.9906886909716228e-03 + 8 1.5636388167915602e-01 -2.6781130173509270e-02 -6.1357481353796735e-03 + 9 -1.5567285888326367e-02 1.4722366247268760e-02 -1.1953767152526074e-02 + 10 1.8805531793129058e-04 3.7820400166769451e-04 1.4614304834967826e-04 + 11 -1.4864493912733895e-03 -1.0424975640019393e-01 -1.0816074777358398e-01 + 12 -1.4904584977612405e+00 4.2295428937341466e+00 1.1884379359045367e+00 + 13 -1.1886876552110689e-01 2.9541662205201678e-02 -4.8308607756838103e-02 + 14 -4.1308859452544304e-02 -1.3119548152383659e-02 1.5120405320455541e-01 + 15 1.5979084315924958e+00 -4.1789376696435205e+00 -1.1491971372792293e+00 + 16 9.0310163053403483e-04 6.6079222833706974e-04 3.6708366832548456e-05 + 17 1.8715075729367327e-03 2.1147818438203180e-04 4.1547470949003804e-03 + 18 -3.0456290625962980e-02 -1.9427008524387373e-02 1.3856334852879893e-02 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 20 -6.6557683033616174e-03 -9.8089615075005066e-04 -4.5869764220629459e-04 - 21 6.4422979624128504e-03 1.1468754348007283e-03 6.8525347184504311e-04 - 22 -7.5216145678175033e-04 1.1318396788931372e-04 -9.2834078115899713e-04 - 23 -5.5282158633416767e+00 3.3673691649465547e+00 -5.7944723588252627e+00 - 24 5.8210356160171492e-02 7.7028326238927844e-02 1.0457588922155134e-01 - 25 -1.4075156519665147e-01 1.8202248246942915e-02 -2.0674716237672891e-03 - 26 1.1435050190904306e-01 8.6100147519947955e-03 2.0290916519561587e-02 - 27 -3.8088820630046961e-02 -1.9961457381631506e-02 -9.8563367312923152e-03 + 20 -6.8134551323710407e-03 -9.2563232531751437e-04 -2.5011200860506922e-04 + 21 6.5798593112743053e-03 1.0885497409975236e-03 5.0300594748037915e-04 + 22 -7.0187004021510127e-04 1.0724877221923711e-04 -8.7584649012749057e-04 + 23 -1.0963098689741106e+01 8.0069723546503813e+00 -1.1637002224325434e+01 + 24 4.2791276882802765e-02 7.5413656281613686e-02 9.2510054641217671e-02 + 25 -1.6396876440827662e-01 1.5180752630598059e-02 -5.8364823335845528e-03 + 26 1.2677571346204658e-01 9.1980780160170368e-03 2.1458873742780715e-02 + 27 -3.3538794640120287e-02 -1.7365037936021697e-02 -8.5471336286569340e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-colloid_tiled_tri.yaml b/unittest/force-styles/tests/atomic-pair-colloid_tiled_tri.yaml index 4af6734f0..b52ad6fe3 100644 --- a/unittest/force-styles/tests/atomic-pair-colloid_tiled_tri.yaml +++ b/unittest/force-styles/tests/atomic-pair-colloid_tiled_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 5e-13 prerequisites: ! | pair colloid @@ -54,36 +54,36 @@ init_forces: ! |2 25 -1.1259499193288525e-01 1.6395143300644142e-02 -9.0439962448757977e-04 26 1.0304882476745569e-01 7.8050496446502114e-03 1.9255643852370365e-02 27 -4.3346315050731436e-02 -2.2993111981455479e-02 -1.1392238078737104e-02 -run_vdwl: 0.0367182211916219 +run_vdwl: 0.546631276624125 run_coul: 0 run_stress: ! |2- - 3.2545234036053388e+00 1.2817594721674228e+01 2.9383804763809755e+00 -6.5738604535060468e+00 2.3065705273606301e+00 1.5121755374668360e+00 + 5.6665057159425141e+00 1.4285058934754488e+01 5.9048859060595005e+00 -8.4818814420024662e+00 5.2881315002023204e+00 -1.1970976964672442e+00 run_forces: ! |2 - 1 4.1447236896055638e-02 8.4984633363665851e-03 -7.1565468520811498e-02 - 2 -2.4451051586476380e-04 -5.7391827303752326e-05 1.6907428582411937e-05 - 3 -1.6184661894786685e-02 -1.2047019655368075e-02 -1.2189740041384702e-02 - 4 4.7049123492350683e-04 -3.0305522972901157e-02 -4.3609470856651830e-02 - 5 7.9841068285770012e-04 6.5880880038332612e-05 1.3840659114887713e-04 - 6 5.4775302106929926e+00 -3.3435741912382899e+00 5.8021270645808745e+00 - 7 -3.4577504657755053e-03 -9.3349532033408424e-04 -1.5696706937008277e-03 - 8 1.3392885595460410e-01 -2.9467417351771743e-02 -9.0902656642780511e-03 - 9 -1.7123469245219562e-02 1.5862013571050645e-02 -1.3049795876411906e-02 - 10 1.8544095678649792e-04 3.9928059116526535e-04 1.2197284521083560e-04 - 11 1.5450042897696470e-02 -1.0557539868014387e-01 -1.1539698970598380e-01 - 12 -1.6489596487183285e+00 4.4215309402004559e+00 1.2758457405639874e+00 - 13 -1.3347630087741638e-01 3.6628535027741001e-02 -5.6719354360201764e-02 - 14 -4.1553429683017180e-02 -1.1540368471833928e-02 1.5467778628554141e-01 - 15 1.7577484997124713e+00 -4.3805631271698946e+00 -1.2463135748050993e+00 - 16 1.0396685127639722e-03 7.5317296594891231e-04 4.1929174719427319e-05 - 17 1.1778403499163354e-03 -7.1238534940187549e-05 3.8035065505820221e-03 - 18 -3.3315903593768015e-02 -2.1130575404712623e-02 1.4962162894607469e-02 + 1 4.0537507872915039e-02 1.0013640201526628e-02 -7.4355259432510909e-02 + 2 -2.4485071669905233e-04 -5.6491959787860793e-05 1.5762341909211158e-05 + 3 -1.6525210356374626e-02 -1.0700896145717401e-02 -1.2466738605043531e-02 + 4 5.0895222294107621e-04 -3.7419904027191864e-02 -5.2521332284173328e-02 + 5 8.5578946640613932e-04 8.0514060368270612e-05 1.6089100898761840e-04 + 6 1.0911859985057617e+01 -7.9829483219779238e+00 1.1645117315742368e+01 + 7 -4.1062783933935310e-03 -1.1807936887044700e-03 -1.9906886909716232e-03 + 8 1.5636388167915585e-01 -2.6781130173509173e-02 -6.1357481353797629e-03 + 9 -1.5567285888326300e-02 1.4722366247268678e-02 -1.1953767152526006e-02 + 10 1.8805531793129020e-04 3.7820400166769380e-04 1.4614304834967978e-04 + 11 -1.4864493912745413e-03 -1.0424975640019400e-01 -1.0816074777358338e-01 + 12 -1.4904584977612991e+00 4.2295428937343154e+00 1.1884379359045845e+00 + 13 -1.1886876552110487e-01 2.9541662205201210e-02 -4.8308607756837312e-02 + 14 -4.1308859452544325e-02 -1.3119548152383642e-02 1.5120405320455521e-01 + 15 1.5979084315925551e+00 -4.1789376696436884e+00 -1.1491971372792762e+00 + 16 9.0310163053403689e-04 6.6079222833707125e-04 3.6708366832548463e-05 + 17 1.8715075729367286e-03 2.1147818438202660e-04 4.1547470949003795e-03 + 18 -3.0456290625963053e-02 -1.9427008524387408e-02 1.3856334852879930e-02 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 20 -6.6557683033616182e-03 -9.8089615075005370e-04 -4.5869764220629415e-04 - 21 6.4422979624128504e-03 1.1468754348007311e-03 6.8525347184504181e-04 - 22 -7.5216145678175326e-04 1.1318396788931422e-04 -9.2834078115900081e-04 - 23 -5.5282158633416776e+00 3.3673691649465551e+00 -5.7944723588252627e+00 - 24 5.8210356160171721e-02 7.7028326238927830e-02 1.0457588922155144e-01 - 25 -1.4075156519665108e-01 1.8202248246942852e-02 -2.0674716237672969e-03 - 26 1.1435050190904378e-01 8.6100147519948857e-03 2.0290916519561344e-02 - 27 -3.8088820630047288e-02 -1.9961457381631711e-02 -9.8563367312924106e-03 + 20 -6.8134551323710381e-03 -9.2563232531751730e-04 -2.5011200860506922e-04 + 21 6.5798593112743045e-03 1.0885497409975256e-03 5.0300594748037633e-04 + 22 -7.0187004021510387e-04 1.0724877221923791e-04 -8.7584649012749393e-04 + 23 -1.0963098689741154e+01 8.0069723546503138e+00 -1.1637002224325569e+01 + 24 4.2791276882800683e-02 7.5413656281613561e-02 9.2510054641216644e-02 + 25 -1.6396876440827649e-01 1.5180752630597804e-02 -5.8364823335845511e-03 + 26 1.2677571346204791e-01 9.1980780160173560e-03 2.1458873742780590e-02 + 27 -3.3538794640120474e-02 -1.7365037936021819e-02 -8.5471336286569739e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam.yaml b/unittest/force-styles/tests/atomic-pair-eam.yaml index 3ddaf0be8..455f93225 100644 --- a/unittest/force-styles/tests/atomic-pair-eam.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 6e-12 prerequisites: ! | pair eam @@ -51,41 +51,41 @@ init_forces: ! |2 30 -3.1599376372206285e+00 1.2411259590817284e+01 -3.3705452712365678e+00 31 -4.7553805255326385e+00 2.0807423151379889e+00 9.7968713347922520e+00 32 4.7774045900241520e+00 -3.5862707137300642e+00 -3.6201646908068756e+00 -run_vdwl: -373.391968845895 +run_vdwl: -368.628082866892 run_coul: 0 run_stress: ! |- - -3.9486584521928921e+02 -4.6496789731503287e+02 -4.1710147439167230e+02 1.8213412417225918e+01 7.6724894655356990e-01 1.2094096020347751e+01 + -3.9249694064943384e+02 -4.6446111054680068e+02 -4.1341521022304943e+02 1.9383267246544207e+01 1.1036774867522274e+00 1.2092041596769240e+01 run_forces: ! |2 - 1 3.6065103849699045e+00 3.3850045614132207e+00 -3.2099404138932623e+00 - 2 1.5272319527262948e+00 5.1159618338837785e+00 1.4386822600145812e+00 - 3 8.8889124738980918e-01 -1.2549265126891047e+01 -7.6286300397668594e-01 - 4 -2.5149887025850397e+00 -5.1630477798480570e+00 -5.7927560583462672e+00 - 5 -2.7577319227244645e+00 7.7337372091604548e+00 -1.6161053768723057e+00 - 6 2.9829137219776214e-01 4.9518159754561530e+00 -6.3319133869644395e-01 - 7 -8.7309179105045454e-01 3.7242971801707845e+00 3.1667500872406640e+00 - 8 7.4988511941697533e-01 -5.2345536588071431e+00 -6.0694489025296816e+00 - 9 -5.6748652076462358e+00 -3.6155005353015071e+00 -3.8960205269341404e+00 - 10 -1.6985487726686137e+00 3.3586465595355084e+00 -3.9313302972887927e+00 - 11 3.0645290480838572e-01 -1.1180223984570464e+01 6.5832137421123793e+00 - 12 -4.4891921700259259e+00 -4.1479969157236125e+00 4.6314455848788976e+00 - 13 4.3217028924633798e+00 -3.6856204342215526e+00 -3.0397864454471007e-01 - 14 -2.5849914165064791e+00 7.5606403552492631e+00 2.3174690493052812e+00 - 15 1.1796272962344825e-01 5.7288100295841273e+00 -9.7607016326974527e+00 - 16 5.7880766878599035e+00 -2.4198072924487954e+00 3.0510124864169175e+00 - 17 2.6948634470284509e+00 4.9491285704784609e+00 2.8470505948517495e+00 - 18 -1.3885896269096671e+00 -1.7319937370044067e+00 -1.4698594584041307e+00 - 19 1.3993184597150856e+00 -1.1797240539240288e+01 4.4955145029417165e-01 - 20 -3.6118153030813107e+00 -4.8252169436387415e+00 5.1301467326004531e+00 - 21 -1.3245618504865346e+00 1.0413638773882186e+01 2.6136063969881778e+00 - 22 -3.6531531607884909e-01 -1.2221686471408978e+01 3.4297492050278428e-01 - 23 2.1591154306812275e+00 -8.2020156536692501e-01 -4.8505116467226950e+00 - 24 5.8317944566992397e+00 -3.8285931693700967e+00 7.1438153964941540e+00 - 25 8.3117675961795374e+00 7.0110643410720712e+00 -3.1321086296778664e+00 - 26 -2.9593072762046271e+00 -7.3717349777414354e-01 5.3317823136164080e+00 - 27 -2.8851089719213050e+00 -8.5425149524249200e+00 -6.6688154620289044e+00 - 28 4.7313345552455530e+00 6.4894520960747961e+00 4.4358188230991802e+00 - 29 -6.6981970679986054e+00 1.1511660045027632e+01 -2.4612864290500908e-01 - 30 -2.9580050013088357e+00 1.2189750141569929e+01 -3.2455167441500277e+00 - 31 -4.5434783129378431e+00 1.9394948274115187e+00 9.6218495408601559e+00 - 32 4.5945894731298269e+00 -3.5624658959292090e+00 -3.5158925996075792e+00 + 1 3.8648745061436549e+00 3.2153530119060876e+00 -3.2776964378827809e+00 + 2 1.5395023772635832e+00 5.3728946493746328e+00 1.5705551331765530e+00 + 3 9.6439342910815462e-01 -1.3140554128998806e+01 -9.0381655603046884e-01 + 4 -2.5080764903528223e+00 -5.2101455423737706e+00 -5.8901759169886310e+00 + 5 -2.8518529990906187e+00 7.6654911378431052e+00 -1.6110386516436834e+00 + 6 2.0654307225844221e-01 5.1877283294983574e+00 -5.9100817552674811e-01 + 7 -9.7192789771442745e-01 3.5326749404690498e+00 3.2261023355359058e+00 + 8 7.5059354130908207e-01 -5.2942992341744253e+00 -6.2390200883690241e+00 + 9 -5.8494569092278610e+00 -3.7473000064784929e+00 -3.9401401772571027e+00 + 10 -1.7979370846789302e+00 3.6981920584497829e+00 -3.8889476404944059e+00 + 11 3.5475565180840984e-01 -1.1327326310762574e+01 6.7138132245101128e+00 + 12 -4.4666682057995537e+00 -4.1277593874530858e+00 4.6909478963337934e+00 + 13 4.4719553517377983e+00 -3.8318369944181176e+00 -2.6779766300763541e-01 + 14 -2.7302858919010604e+00 7.7804651786773276e+00 2.4955341765160828e+00 + 15 1.8476110630581924e-01 5.9064091583222345e+00 -9.9139839508001106e+00 + 16 5.8469269793993535e+00 -2.2621009546197075e+00 2.9856827293028521e+00 + 17 2.7553353171571593e+00 4.9217297032412874e+00 2.9074238621941570e+00 + 18 -1.4802668189179600e+00 -1.7372348119855912e+00 -1.6045171198770904e+00 + 19 1.4800740855771553e+00 -1.2239437648932398e+01 4.9816445821272770e-01 + 20 -3.6607569568202685e+00 -4.8715080450687225e+00 5.2576467666477402e+00 + 21 -1.3492965780402633e+00 1.0609379062991749e+01 2.7008869206124682e+00 + 22 -3.5208582233992636e-01 -1.2268782932135997e+01 3.7986349777635808e-01 + 23 2.1310751326456043e+00 -9.7857014532091580e-01 -5.0655619672118393e+00 + 24 6.0402733942654301e+00 -3.8590587466065021e+00 7.2720380032016676e+00 + 25 8.4434130422863714e+00 7.0614902021934034e+00 -3.1805207683877694e+00 + 26 -3.0882278058556731e+00 -7.7065083250351485e-01 5.3318961108181098e+00 + 27 -2.9654598223018827e+00 -8.6646399517253716e+00 -6.7850422987819936e+00 + 28 4.9355194061872822e+00 6.6281159364074878e+00 4.6428802157733715e+00 + 29 -6.7594523076675728e+00 1.1850266906155818e+01 -3.1882316602533856e-01 + 30 -3.1568872205983745e+00 1.2411929968707108e+01 -3.3715546239305563e+00 + 31 -4.7548821693326886e+00 2.0782081646827288e+00 9.7950447665291271e+00 + 32 4.7735245871865910e+00 -3.5891227353621598e+00 -3.6188348949258478e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_alloy.yaml b/unittest/force-styles/tests/atomic-pair-eam_alloy.yaml index 3391ce07b..a2d39bdd7 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_alloy.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_alloy.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam/alloy @@ -49,41 +49,41 @@ init_forces: ! |2 30 -7.7628811007199061e-01 -1.1864112261858684e+00 -1.7057845890523824e+00 31 -5.5170344013648301e-02 -2.3455335239818620e+00 1.3686542848487442e+00 32 -4.4069686170352860e+00 -9.2275646480965812e-01 -2.8237489589371051e-01 -run_vdwl: -119.01346314091 +run_vdwl: -118.721845820838 run_coul: 0 run_stress: ! |2- - 5.0163665030040001e+01 4.7680228852249961e+01 4.6077773225979605e+01 3.3830790498090906e+00 -1.1731598776842909e+00 -2.6694718068658267e+00 + 5.1008838955726937e+01 4.8584006717520772e+01 4.7099721534677649e+01 3.5410070434379857e+00 -1.0820463688123025e+00 -2.7574764800554417e+00 run_forces: ! |2 - 1 1.6656370951687224e-01 1.2668180632727586e+00 4.6512485297556683e-01 - 2 -4.6355934712710534e-01 -1.8865492277456797e+00 8.8559398025617497e-01 - 3 -9.4063094819583548e-01 3.9885554759284059e+00 -1.0651876560035394e+00 - 4 3.1809989421285695e-01 -1.5735553215512343e-03 -1.0739457289106022e+00 - 5 1.3107085701461587e+00 2.7000436252294420e+00 9.6663082860580274e-01 - 6 9.4560513816795355e-01 4.8856711744784481e-01 -1.4777906111423750e-01 - 7 -1.2462601122119747e+00 1.8233940025762738e+00 -3.9005272587655360e-01 - 8 -1.5724236097150643e+00 -1.0326685877501389e+00 1.2613834765742475e+00 - 9 6.6499600201055986e-01 -1.2048800840156759e+00 -6.0041236575467516e-01 - 10 -4.2918690454462260e-01 -3.2102647210747581e+00 -2.2423530055534227e+00 - 11 -8.9306521974511965e-01 -7.3609588764692946e-01 7.7858707603166932e-01 - 12 8.6395200517054016e-01 -1.5981432915146632e+00 -2.1679477568839745e-01 - 13 -6.4494400058042478e-01 6.2756955493634248e-01 -1.0012212508165597e+00 - 14 1.4121457183669881e+00 -3.8145518370890946e-01 1.4374334735700072e+00 - 15 -8.0012105256118471e-01 3.3826645187577792e-01 -4.4188948688375512e-01 - 16 1.9512996642081428e+00 -1.8484269993310276e+00 7.6647387636667308e-01 - 17 9.6847667918444036e-01 2.8004906783494139e+00 -3.0748007851388115e-01 - 18 -2.8449746205170134e+00 -6.1824996554122424e-01 -1.3472806126411994e+00 - 19 -3.2477430400820975e+00 -1.3687972228229346e+00 8.3236229178971677e-01 - 20 5.9315059333536402e-01 6.0128565847431148e-01 -9.1217508958587568e-01 - 21 3.5879727016607603e+00 5.5038586867508599e-01 9.8753442724867704e-02 - 22 1.5511768770985568e-01 -1.4315503989159941e+00 -3.5655100825750630e-01 - 23 8.5405829958739810e-01 2.5896581671113488e+00 -1.5824438465222816e+00 - 24 2.1822151145920117e+00 1.9809861442953116e+00 1.5846435537420727e+00 - 25 1.1642513964511370e+00 7.8654670449493508e-02 -9.5490964373690435e-01 - 26 -8.8370436766026839e-01 -3.0720569678955640e+00 2.5586883908525340e+00 - 27 1.0905263045646054e+00 -9.2089563796464990e-02 9.5183608542272730e-02 - 28 -2.2483303095995844e-01 1.1477992712823375e+00 1.4903422943362210e+00 - 29 1.0962449966023380e+00 1.8651010391452665e+00 -2.5090548124359832e-02 - 30 -7.5204116181154745e-01 -1.1523526863157827e+00 -1.6322014962960107e+00 - 31 -9.0957260597904349e-02 -2.2978996297940468e+00 1.3386614339051799e+00 - 32 -4.2909397991778597e+00 -9.1452181585807046e-01 -2.6209419999324374e-01 + 1 2.2192658266602311e-01 1.2875270717533405e+00 4.7868793143818650e-01 + 2 -4.6202241252919102e-01 -1.9111539745262807e+00 9.0087149806221845e-01 + 3 -9.9739093402473189e-01 4.2233685362072730e+00 -1.0727636906172522e+00 + 4 3.2501320003273498e-01 -2.3155498364564486e-02 -1.0815511271656340e+00 + 5 1.3537414481437227e+00 2.7984236239921430e+00 9.5292168906981378e-01 + 6 9.4791088684668612e-01 4.8222508883366189e-01 -1.5076112557910848e-01 + 7 -1.2744330329859861e+00 1.8312828604449318e+00 -3.7376160068293307e-01 + 8 -1.5669798546973497e+00 -1.0512178414830131e+00 1.2898756648841769e+00 + 9 6.5261543966956259e-01 -1.1760207067444297e+00 -5.7912358305492573e-01 + 10 -5.3281740358239493e-01 -3.3260478846662753e+00 -2.3676046954618970e+00 + 11 -9.1281874389827766e-01 -7.2223712608354740e-01 7.9972707230674500e-01 + 12 8.4656613151610360e-01 -1.6519677424198445e+00 -2.3251797243559619e-01 + 13 -6.2957763504845210e-01 6.7296465889236812e-01 -1.0458357260181776e+00 + 14 1.4251189605838193e+00 -4.9728101200725983e-01 1.5254743318238351e+00 + 15 -8.1242855179559792e-01 3.5430972054101240e-01 -4.6017894732493059e-01 + 16 2.1015126244981928e+00 -1.9108151804063827e+00 7.9183862922076376e-01 + 17 9.8563480725719543e-01 2.8778103984484851e+00 -3.1035471800725700e-01 + 18 -2.9476328637907891e+00 -6.4505338942118984e-01 -1.3892310952794205e+00 + 19 -3.3804834962128480e+00 -1.4401929962999240e+00 8.8110508676473287e-01 + 20 5.9658819954869635e-01 5.8562697586314616e-01 -9.3301722230442219e-01 + 21 3.6994932537123466e+00 6.1650230331283096e-01 5.8971362009639372e-02 + 22 1.3844685029913997e-01 -1.4732999490314462e+00 -3.5844298830982746e-01 + 23 8.6137551032010662e-01 2.6792173029184680e+00 -1.6497668769607996e+00 + 24 2.2889671664217670e+00 2.0463367980607261e+00 1.6421856852680501e+00 + 25 1.1926018888018013e+00 6.6942192347533458e-02 -9.7581217297774292e-01 + 26 -9.5040327407173952e-01 -3.2454149716402760e+00 2.6649139048917272e+00 + 27 1.1113561171604389e+00 -8.7057638492284095e-02 1.2120466161552276e-01 + 28 -2.0701612494222044e-01 1.1598447258383562e+00 1.5296377847108658e+00 + 29 1.1677638663315946e+00 1.9370791128310514e+00 -3.7309040310851985e-02 + 30 -7.7600866508395150e-01 -1.1857738452823672e+00 -1.7044214878692550e+00 + 31 -5.8060137522569472e-02 -2.3464015355285261e+00 1.3683818828203740e+00 + 32 -4.4085598036238327e+00 -9.2637007788771664e-01 -2.8334311452661692e-01 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_alloy_real.yaml b/unittest/force-styles/tests/atomic-pair-eam_alloy_real.yaml index c14e6f7e7..468495154 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_alloy_real.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_alloy_real.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 7.5e-12 prerequisites: ! | pair eam/alloy @@ -50,41 +50,41 @@ init_forces: ! |2 30 -1.7901630000432078e+01 -2.7359294215609122e+01 -3.9336329099287752e+01 31 -1.2722584214742627e+00 -5.4089290760925913e+01 3.1561919199814835e+01 32 -1.0162711573460497e+02 -2.1279270671809819e+01 -6.5117201231272759e+00 -run_vdwl: 13786.8231164129 +run_vdwl: -2737.72416936454 run_coul: 0 run_stress: ! |2- - 1.5453045758769322e+04 1.4324564159674677e+04 2.0339719265203443e+04 -4.3703985097767946e+02 -2.4828700331963387e+03 2.6371860977250767e+03 + 1.1764787620345819e+03 1.1205547781193936e+03 1.0863293163772205e+03 8.1706260194005594e+01 -2.4940094344791824e+01 -6.3614824113069091e+01 run_forces: ! |2 - 1 -4.1235070358044668e+03 -1.6712537087260520e+02 1.0285277274671405e+02 - 2 -1.7134569288200307e+03 5.6109874495911788e+02 1.5833880163322276e+03 - 3 7.0660491674313198e+02 1.9980947258588313e+02 3.5478310177110654e+02 - 4 -1.5805950092619483e+02 -6.3394860464941223e+02 -8.2522020103607667e+02 - 5 3.9405888405680421e+03 -3.4696561240376536e+03 -1.8565396295835046e+03 - 6 4.1907332132233353e+02 4.0962894944175650e+02 1.0986647025780062e+03 - 7 -9.6645970600745250e+02 -3.5911787935573318e+02 -2.2384719111998045e+01 - 8 1.0265438581270096e+03 2.0808489842263421e+03 2.0164534268300017e+02 - 9 1.1337966507234950e+02 -5.0396233184210274e+02 3.8179698908837901e+02 - 10 1.2342073717320214e+02 9.5758334207235251e+01 6.8799216904596193e+01 - 11 -1.5320242612327121e+02 7.0895437874334348e+01 2.8604566716136297e+00 - 12 8.6000100331177293e+02 -1.3442535831934202e+02 -6.4193775682228181e+02 - 13 -2.4471242994052943e+02 -5.4264102607261248e+02 5.7696771921238803e+02 - 14 -3.9018569969951250e+02 3.0656573620303152e+03 1.5177932576921341e+02 - 15 -4.7634536416265757e+02 -1.2625516023855369e+03 -1.7806430239510260e+03 - 16 -2.8401490184979712e+03 1.5282109260061964e+03 -2.2214870113522188e+03 - 17 -1.2156159328353722e+03 -4.3257815608069222e+02 -2.1345521131784184e+02 - 18 3.0311750850899085e+02 3.4429089555337634e+02 -7.3709708806569211e+02 - 19 1.2045122218993008e+03 -9.7593750646130115e+02 5.4415371253339413e+02 - 20 -1.1696081099778976e+02 -8.3225560965708397e+01 -7.0457470193503610e+01 - 21 2.0598989260725048e+01 2.2356469079280600e+01 -7.9554177550794435e+01 - 22 -2.9312564165085789e+01 -5.9822361803207244e+01 -8.0777528003416975e+01 - 23 1.1532179753142128e+02 7.6103559438211857e+02 -5.6029347839975253e+02 - 24 -1.3770034997569403e+03 -2.7507426940749690e+02 3.3464942960699618e+03 - 25 5.1243904877932528e+02 -2.7117746030266056e+02 3.9984232018061857e+02 - 26 1.0172211816330166e+03 -9.5258495026630271e+02 -3.7013789400208348e+03 - 27 -9.3684148116058168e+02 4.9006556088962077e+02 4.5089073710681362e+02 - 28 2.6547988549156607e+03 5.0325157403920798e+02 5.1846329264498172e+03 - 29 1.3361686744155759e+03 2.5910193783558044e-01 1.0501345350932138e+03 - 30 4.1083282961451374e+02 6.3716214702024570e+02 -3.1059177937091081e+03 - 31 2.2436377537176998e+02 -5.0079917535823370e+02 6.8158392999295666e+02 - 32 -2.4717482535028950e+02 -1.4570181605226253e+02 -2.8412607206596545e+02 + 1 5.1163560414356368e+00 2.9694514911764713e+01 1.1036923724327968e+01 + 2 -1.0656293921893143e+01 -4.4077421001912619e+01 2.0777446216903417e+01 + 3 -2.3018869404295653e+01 9.7437752282413427e+01 -2.4749986099525096e+01 + 4 7.4997116028785911e+00 -5.3822960731896075e-01 -2.4941180239136909e+01 + 5 3.1228045485774874e+01 6.4550168040554269e+01 2.1975271933409303e+01 + 6 2.1862630554034030e+01 1.1116447411034340e+01 -3.4826674275829639e+00 + 7 -2.9399549538119221e+01 4.2239580210433544e+01 -8.6210159090324563e+00 + 8 -3.6140150423510562e+01 -2.4249253807594148e+01 2.9754501676463814e+01 + 9 1.5051101065384739e+01 -2.7118595631460462e+01 -1.3356081305308548e+01 + 10 -1.2301595828966398e+01 -7.6723267028163534e+01 -5.4616751251739139e+01 + 11 -2.1053519025903988e+01 -1.6655560219629507e+01 1.8444105138289942e+01 + 12 1.9524280624568892e+01 -3.8108732767591192e+01 -5.3643070687403203e+00 + 13 -1.4517306552848233e+01 1.5524339212691846e+01 -2.4124614349629418e+01 + 14 3.2869810918988343e+01 -1.1479700629105066e+01 3.5196071942383170e+01 + 15 -1.8736516364405116e+01 8.1752295716530909e+00 -1.0611792110769416e+01 + 16 4.8484704018011023e+01 -4.4075612303436024e+01 1.8262164502672402e+01 + 17 2.2736910766936550e+01 6.6381054543028227e+01 -7.1536985428936317e+00 + 18 -6.7997051750314455e+01 -1.4876614368436783e+01 -3.2047784456421340e+01 + 19 -7.7986251495199525e+01 -3.3230621033526660e+01 2.0326051958056802e+01 + 20 1.3757182474823544e+01 1.3503788606458833e+01 -2.1516965847781236e+01 + 21 8.5340963288906082e+01 1.4224649989147103e+01 1.3533645495561113e+00 + 22 3.1918813078584041e+00 -3.3981741003314589e+01 -8.2633704276541522e+00 + 23 1.9877430254014339e+01 6.1810423273894180e+01 -3.8049012439606280e+01 + 24 5.2812297164903235e+01 4.7203457045661935e+01 3.7884742288132436e+01 + 25 2.7510773686545477e+01 1.5412717577193131e+00 -2.2507949490608922e+01 + 26 -2.1926819334710338e+01 -7.4876348493828488e+01 6.1480258633235259e+01 + 27 2.5634970628871173e+01 -2.0037347996759354e+00 2.7955384049417535e+00 + 28 -4.7682426026975904e+00 2.6752103367898396e+01 3.5282720194883531e+01 + 29 2.6940168781514210e+01 4.4686979293815888e+01 -8.6087548761187205e-01 + 30 -1.7901284649638569e+01 -2.7349739804895563e+01 -3.9321507127612932e+01 + 31 -1.3377293698834705e+00 -5.4122684379020313e+01 3.1562239151932097e+01 + 32 -1.0169803840306297e+02 -2.1373902639259313e+01 -6.5418407335334035e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_cd.yaml b/unittest/force-styles/tests/atomic-pair-eam_cd.yaml index be44e323f..c1d189e1d 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_cd.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_cd.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam/cd @@ -50,41 +50,41 @@ init_forces: ! |2 30 -4.8386802956274799e-01 6.7845093285518510e-01 -7.2822185494105651e-01 31 -8.5629870279800413e-01 -1.3626475979016444e+00 2.4555267483126282e+00 32 -2.6135587355983043e+00 -1.5330500443455732e+00 -6.7557011932914857e-01 -run_vdwl: -77.65496555698 +run_vdwl: -77.4214727154924 run_coul: 0 run_stress: ! |2- - 2.8585743222299783e+01 2.8300763599883620e+01 2.1800410375921810e+01 7.4500400291680950e+00 -1.0636039604288940e+00 8.4740666819864296e-01 + 2.9493005554949598e+01 2.9172864836203829e+01 2.2312049668403862e+01 7.8487811034540371e+00 -9.4002654430986221e-01 8.4333891294706553e-01 run_forces: ! |2 - 1 3.4169448683529990e-01 -3.1004791972686529e-02 -2.4769580345365880e-01 - 2 -8.5490517434075847e-02 -2.1659172685616215e-01 5.0142370520318835e-01 - 3 -9.4063283702315814e-01 1.0775755551349597e+00 -5.9775647301115542e-01 - 4 4.0807816914053147e-01 -9.4566550283660311e-01 -9.5348608946481239e-01 - 5 -7.2493198432645400e-01 5.4807444983935638e-01 4.8889246609771136e-01 - 6 -5.5245666180980457e-01 6.4138882034278044e-01 -4.8007835354561723e-01 - 7 -1.0741108869644040e+00 1.2831430885766124e+00 -5.4667017037232546e-01 - 8 -2.7151053004591208e-01 -1.5287399675025755e+00 -5.4534089864381885e-01 - 9 -4.1823699825935307e-01 -3.0754071802614963e-01 -1.1183696132595670e-01 - 10 -2.5002184738752448e-01 -1.0198477234944650e-01 -6.6684588027858072e-01 - 11 -7.6679766845686814e-01 -6.3322365651311130e-01 4.7728049772552503e-02 - 12 1.5816856488010231e+00 -9.1902882640923744e-01 -5.6535909175480059e-01 - 13 5.0939531182086928e-01 6.8413494991310242e-01 -4.2098815476105311e-01 - 14 5.0573882893138455e-01 -3.8622187936633440e-01 1.3985322998607304e+00 - 15 -7.2508155408548902e-01 1.5144677531296626e+00 -1.0864955300224399e+00 - 16 2.2898405388879040e+00 -1.1378953314614961e+00 -8.4272711131861044e-01 - 17 4.7161383076462332e-01 1.9565174525684229e-01 9.3819195032752134e-01 - 18 -3.6892936686513820e+00 -1.4556828938869788e+00 -1.8103278324839420e+00 - 19 -2.3085159711941969e+00 -2.9612141261464395e+00 3.7188702337674601e-01 - 20 5.3179718158105560e-01 -4.7602396117212981e-01 3.0623145836571120e-01 - 21 1.4790878931837190e+00 1.7136887929621036e+00 1.1269633038157936e+00 - 22 -2.2054525313872317e-01 -1.9984312218234146e+00 7.1900794989121525e-02 - 23 1.2244927661586273e+00 1.8328418245722449e+00 -3.2381249699480508e-01 - 24 4.2941840668820070e+00 1.9468832898802828e+00 2.2380972699887196e+00 - 25 2.4910528464915269e+00 1.4658890698067975e+00 -1.3869148162687062e-01 - 26 -1.4106451720861932e+00 -1.5618537601149505e+00 9.7574227521752288e-01 - 27 2.0890840531702448e-01 3.5786474239715432e-01 6.2130307644364287e-02 - 28 -3.7176754911744125e-01 2.5654240520686689e-01 1.3306741973778954e-01 - 29 1.3407876110200074e+00 3.3111406589372017e+00 -3.3732975630652123e-01 - 30 -4.5762456300468696e-01 6.6407205464735841e-01 -6.9428727830465098e-01 - 31 -8.1236514734795273e-01 -1.3407493053805772e+00 2.3754011704155875e+00 - 32 -2.5983287754819857e+00 -1.4915067587850344e+00 -6.6646013114343972e-01 + 1 3.7480735346154664e-01 -1.8643720194102729e-02 -2.3069598493510354e-01 + 2 -9.3063213508892476e-02 -2.0943525263831045e-01 5.1418332142915046e-01 + 3 -9.4174637538704542e-01 1.1067903956345688e+00 -6.0583856060193098e-01 + 4 4.2518836600597681e-01 -9.7225735217006137e-01 -9.7096803434435552e-01 + 5 -7.4473824294582336e-01 5.6412777829498040e-01 5.0761588777114730e-01 + 6 -5.6207213872800210e-01 6.4697180722698033e-01 -5.0413554727898069e-01 + 7 -1.1020698643418605e+00 1.2952330657009610e+00 -5.4879818176128237e-01 + 8 -2.5146754077012379e-01 -1.5314223283789183e+00 -5.6180884487275307e-01 + 9 -4.2065026415648299e-01 -3.0012653666354494e-01 -9.5398795450643878e-02 + 10 -2.7926186237834588e-01 -1.1038019019167825e-01 -7.1505472329715114e-01 + 11 -7.8414686105650222e-01 -6.3084581051386290e-01 6.2722171718795280e-02 + 12 1.6042803500198315e+00 -9.5194576608419590e-01 -5.8160109224202705e-01 + 13 5.1925885949851280e-01 6.7785482820868648e-01 -4.2199669927323469e-01 + 14 4.9632983592170749e-01 -4.1009971270040230e-01 1.3869678137500503e+00 + 15 -7.6956669350889784e-01 1.5445811342149824e+00 -1.1151791103577440e+00 + 16 2.3747530411383115e+00 -1.1516721831955303e+00 -8.5704463787631124e-01 + 17 4.6563659191327150e-01 1.9859819319218000e-01 9.4706624039981713e-01 + 18 -3.9269243711753541e+00 -1.5587662665761899e+00 -1.9177849326264931e+00 + 19 -2.4644648543759655e+00 -3.1409373246448427e+00 3.7058401077037761e-01 + 20 5.4232644123583562e-01 -4.8103762797043198e-01 3.1771610541229584e-01 + 21 1.5529077159259050e+00 1.8152703450049612e+00 1.1502984261761080e+00 + 22 -2.8226102272893133e-01 -2.0644971613909169e+00 8.6917712249102400e-02 + 23 1.2431189511123264e+00 1.8632749105674307e+00 -3.5386487610514034e-01 + 24 4.6088730019813458e+00 2.0903958045539706e+00 2.3394009342678275e+00 + 25 2.5705812790338722e+00 1.5005389379107170e+00 -1.3066543303878558e-01 + 26 -1.5154308638545686e+00 -1.6741386775347213e+00 1.0389133412368403e+00 + 27 1.9849560670453528e-01 3.7153404234395843e-01 7.7439462825639876e-02 + 28 -3.6543031917768992e-01 2.5751811596051138e-01 1.2617229327865076e-01 + 29 1.4842316157731708e+00 3.4938912113011065e+00 -3.6602806750883499e-01 + 30 -4.8361802726671183e-01 6.8017187848086791e-01 -7.2852708973001534e-01 + 31 -8.5705889766178311e-01 -1.3646134086814514e+00 2.4555907661446867e+00 + 32 -2.6168175967031684e+00 -1.5359331290677014e+00 -6.7619787612970073e-01 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_cd_old.yaml b/unittest/force-styles/tests/atomic-pair-eam_cd_old.yaml index 8ac65dbf7..6dd89be14 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_cd_old.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_cd_old.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam/cd/old @@ -50,41 +50,41 @@ init_forces: ! |2 30 -4.8103274177570204e-01 6.7765823339012321e-01 -7.2776907743413610e-01 31 -8.5335875768564051e-01 -1.3518208677019026e+00 2.4663641279666662e+00 32 -2.6142628689137353e+00 -1.5189868845729886e+00 -6.7390297673000232e-01 -run_vdwl: -77.5908146669562 +run_vdwl: -77.3586232494724 run_coul: 0 run_stress: ! |2- - 2.8485191578893058e+01 2.8198695634641155e+01 2.1600480977108983e+01 7.4831961344053015e+00 -1.0657036014691093e+00 8.1083296213634959e-01 + 2.9392159617306476e+01 2.9067390891336895e+01 2.2108618910688079e+01 7.8809332873995865e+00 -9.4254846573098539e-01 8.0805977962507369e-01 run_forces: ! |2 - 1 3.4051925606376454e-01 -2.6258862226114895e-02 -2.5087755767694686e-01 - 2 -8.8659229971455075e-02 -2.1347769705954714e-01 5.0057777700323369e-01 - 3 -9.0534014592010392e-01 1.0332760987936294e+00 -5.7650969402625052e-01 - 4 4.0729758180114273e-01 -9.4491662268062182e-01 -9.5450134374689677e-01 - 5 -7.2603632278983410e-01 5.5101408460680934e-01 4.8498734148834588e-01 - 6 -5.4727635910881256e-01 6.3807859667675315e-01 -4.7985870047603307e-01 - 7 -1.0726809843117340e+00 1.2799606830754382e+00 -5.4314026901401546e-01 - 8 -2.6687662328951439e-01 -1.5323983128806480e+00 -5.3650003340444363e-01 - 9 -4.1599974909284382e-01 -3.0446259231679634e-01 -1.1153295601432243e-01 - 10 -2.4598170004171149e-01 -9.1061063106574108e-02 -6.4286211566594620e-01 - 11 -7.6894416406912669e-01 -6.3558503412677736e-01 3.8197957557271150e-02 - 12 1.5850988167998827e+00 -9.1572194416915975e-01 -5.6882585734207169e-01 - 13 5.0470405196269419e-01 6.8947168162484451e-01 -4.2691120946149397e-01 - 14 5.0915603335540283e-01 -4.0999165632064422e-01 1.3825486730786496e+00 - 15 -7.2971570976124900e-01 1.5042763436302977e+00 -1.0747802112135652e+00 - 16 2.2585093380006076e+00 -1.1168061549089283e+00 -8.4057202310250323e-01 - 17 4.7006057082843539e-01 1.9337850521959463e-01 9.3772077301591306e-01 - 18 -3.6854522670425158e+00 -1.4559988082140753e+00 -1.8074005610504837e+00 - 19 -2.3079714228833410e+00 -2.9608093698018987e+00 3.7108228042443869e-01 - 20 5.2623598439294483e-01 -4.7516744794791216e-01 3.0914307217963943e-01 - 21 1.4601582272558056e+00 1.7066533856947079e+00 1.1129911037189397e+00 - 22 -2.2250198294686541e-01 -1.9965841181629400e+00 7.1747050733221227e-02 - 23 1.2240069186776739e+00 1.8337840117671826e+00 -3.2452205560407349e-01 - 24 4.2950019630782688e+00 1.9475688188592346e+00 2.2351682655037335e+00 - 25 2.4950084662696983e+00 1.4707797579395552e+00 -1.3594695871930362e-01 - 26 -1.4181737451422176e+00 -1.5291168458460618e+00 9.5602794273735947e-01 - 27 1.7749931668796490e-01 3.8675424964670363e-01 5.9748810010048489e-02 - 28 -3.4089135725955205e-01 2.2341523534112284e-01 1.2257324449666285e-01 - 29 1.3524738452403593e+00 3.2946498298818288e+00 -3.3499173170850133e-01 - 30 -4.5467752591799759e-01 6.6316947806197213e-01 -6.9376708110580343e-01 - 31 -8.0935941564949265e-01 -1.3301958218136074e+00 2.3859777045237114e+00 - 32 -2.5991916652162788e+00 -1.4776784092373672e+00 -6.6499163713851406e-01 + 1 3.7348311164252801e-01 -1.4033433919998620e-02 -2.3386852217572451e-01 + 2 -9.6247240745287857e-02 -2.0626094475237694e-01 5.1330682725402832e-01 + 3 -9.0668915609970957e-01 1.0605950959305914e+00 -5.8412873519573139e-01 + 4 4.2440030668674272e-01 -9.7152149236359708e-01 -9.7203276023952911e-01 + 5 -7.4578452592475319e-01 5.6698832989519810e-01 5.0364229948636619e-01 + 6 -5.5680726913527290e-01 6.4360843999878714e-01 -5.0377105499986208e-01 + 7 -1.1004504399427040e+00 1.2920541310582350e+00 -5.4522047736985335e-01 + 8 -2.4672898361960902e-01 -1.5349217321816389e+00 -5.5289483232744185e-01 + 9 -4.1840591312181830e-01 -2.9704030763913042e-01 -9.5126359430470667e-02 + 10 -2.7519038647454508e-01 -9.8503204588900023e-02 -6.8990373455511533e-01 + 11 -7.8641160332266336e-01 -6.3346572870871598e-01 5.2905243155403965e-02 + 12 1.6077198962653116e+00 -9.4850015739123383e-01 -5.8505034770569087e-01 + 13 5.1452191230083666e-01 6.8307121314152219e-01 -4.2797039997991737e-01 + 14 4.9988366613996021e-01 -4.3379020859390205e-01 1.3707645110610869e+00 + 15 -7.7437585424851463e-01 1.5341621955688391e+00 -1.1032344451330065e+00 + 16 2.3436600694609440e+00 -1.1310169989460754e+00 -8.5454400102328054e-01 + 17 4.6405876806232244e-01 1.9631748376715549e-01 9.4654225167483574e-01 + 18 -3.9227826129022816e+00 -1.5589524492466571e+00 -1.9147996797215652e+00 + 19 -2.4639076382108960e+00 -3.1405055406605653e+00 3.6978113694169001e-01 + 20 5.3680618084786547e-01 -4.8020114527314689e-01 3.2061960959035052e-01 + 21 1.5334781879131403e+00 1.8075942933826259e+00 1.1362896811848890e+00 + 22 -2.8446349643183494e-01 -2.0625982414769140e+00 8.6617423257035864e-02 + 23 1.2425466308608755e+00 1.8640612377600028e+00 -3.5454468256892469e-01 + 24 4.6095191299871425e+00 2.0910370520912451e+00 2.3361701267661661e+00 + 25 2.5746012625531431e+00 1.5054836785640557e+00 -1.2800581093603744e-01 + 26 -1.5223104973930786e+00 -1.6390812220867064e+00 1.0171495764705401e+00 + 27 1.6678015738184618e-01 4.0053606104379830e-01 7.5317898695952762e-02 + 28 -3.3457606148676128e-01 2.2428550821961282e-01 1.1598496491497567e-01 + 29 1.4961049242501856e+00 3.4768707544037496e+00 -3.6381109815491136e-01 + 30 -4.8077950891165194e-01 6.7938904298741087e-01 -7.2807334814722402e-01 + 31 -8.5412100611225217e-01 -1.3537897416138192e+00 2.4664269976020421e+00 + 32 -2.6175320102692088e+00 -1.5218719683694502e+00 -6.7453825839107562e-01 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_cd_real.yaml b/unittest/force-styles/tests/atomic-pair-eam_cd_real.yaml index 65f71e913..bf5269b8c 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_cd_real.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_cd_real.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam/cd @@ -51,41 +51,41 @@ init_forces: ! |2 30 -1.1158262405262278e+01 1.5645450981201224e+01 -1.6793195768740453e+01 31 -1.9746718194509157e+01 -3.1423401701143103e+01 5.6625794900273171e+01 32 -6.0270099286644076e+01 -3.5352975667087023e+01 -1.5579017839726909e+01 -run_vdwl: 50833.2095623296 +run_vdwl: -1785.32443012494 run_coul: 0 run_stress: ! |2- - 1.1422757276809535e+06 6.4698538309370563e+05 4.1051148563743685e+05 9.5363304679863315e+04 -1.8362039585635814e+05 -1.1661012466179531e+05 + 6.8033307307183838e+02 6.7295080184729852e+02 5.1465049023351878e+02 1.8108364252022736e+02 -2.1656087785470721e+01 1.9438707865457804e+01 run_forces: ! |2 - 1 -6.8825417922686768e+02 -6.9446834170851105e+01 -8.7132365430256675e+02 - 2 -7.6357102464059423e+01 1.1233035238477735e+03 -6.8826275473684734e+02 - 3 -3.9919676312365674e+05 -2.9469092131577787e+05 4.7182000013219702e+04 - 4 8.2866585144562814e+03 2.1987889627894288e+03 -7.3269584596262494e+03 - 5 4.6327746018426421e+02 -4.2009134275606988e+02 -2.3788165159758432e+03 - 6 -8.7269440254898623e+00 -4.2871068258170464e+00 -2.8071174977249292e+01 - 7 -4.4527084366606331e+01 1.2083311421562198e+02 1.4090365320304448e+02 - 8 -7.4661838460394392e+03 -1.1211419092422277e+03 -9.9785680647352146e+03 - 9 -4.6751202227701106e+04 -4.5455389599126021e+04 6.9310666457731480e+04 - 10 1.7089467526999974e+03 1.5998419382683530e+03 3.7660701226776137e+03 - 11 -1.2156739748086090e+03 -2.5965260670035136e+03 1.0931787195989884e+03 - 12 -9.1471177123677103e+02 8.8769239275792152e+03 2.4590954021189071e+02 - 13 1.8896681608363186e+00 4.8691607259253598e+00 -1.2350445460363511e+00 - 14 3.2489354130384342e+01 -1.8199012589513384e+00 -1.2103425811994835e+01 - 15 -1.7479956445491289e+03 -1.6324715355756241e+03 -3.8088738011660262e+03 - 16 -6.0049578751180659e+05 6.0547722741760830e+04 2.7117954880042735e+05 - 17 1.0955176820986504e+06 -7.3097457868151064e+05 3.0732902700087085e+05 - 18 9.6833281561496960e+01 2.3040573196963862e+02 -5.8045206738908939e+02 - 19 1.7252084357421229e+03 -1.1971214382248465e+03 9.6479329686047492e+01 - 20 1.3147736477952492e+04 4.5528169367928685e+03 1.4550409304372291e+04 - 21 -6.4190745440347182e+03 -5.4746193210828221e+02 9.9912667127815548e+03 - 22 5.9705595976766385e+05 -7.3498559170154767e+04 -2.8830207944910158e+05 - 23 9.7820842419642599e+02 -3.4289927091667382e+03 1.0679111325906649e+03 - 24 -9.4115440774054550e+03 1.4868082917729362e+04 9.5344712883688589e+03 - 25 -6.2964336519821582e+05 1.0487031227925373e+06 -4.2163928496549878e+05 - 26 -1.2400361710263704e+02 -1.6482646184110337e+02 -1.3181023673232635e+03 - 27 -2.0206241875051242e+03 8.9736344917421536e+02 2.7371544379914650e+02 - 28 1.2720985720833842e+02 1.6004798320652955e+02 1.3546485540637434e+03 - 29 -1.1522875720670545e+04 2.1859177429597163e+04 6.6026924351739308e+03 - 30 -8.8479117293965324e+00 3.9144652621120195e+00 -2.5741472917180985e+00 - 31 1.6062724190796649e+02 -3.5009702848199694e+01 1.5780906691469243e+01 - 32 -1.5462086679694005e+03 -9.9085693678646985e+03 -6.7979735229861662e+03 + 1 8.6426612188042267e+00 -4.2968301463703457e-01 -5.3199186588320311e+00 + 2 -2.1467811497373863e+00 -4.8270038148443453e+00 1.1859520060861293e+01 + 3 -2.1716065799298011e+01 2.5527833997156343e+01 -1.3974546651012330e+01 + 4 9.8093031543274520e+00 -2.2427811949220480e+01 -2.2395409615316531e+01 + 5 -1.7177730277386701e+01 1.3012053735978336e+01 1.1709927434466163e+01 + 6 -1.2964380870217468e+01 1.4921355739606131e+01 -1.1631291728928117e+01 + 7 -2.5426169715050303e+01 2.9877684865108133e+01 -1.2657792057357108e+01 + 8 -5.8004178326958673e+00 -3.5320315935875676e+01 -1.2961129217809127e+01 + 9 -9.7001978919774103e+00 -6.9206100816628631e+00 -2.1989686831596766e+00 + 10 -6.4426870970421612e+00 -2.5455557423026414e+00 -1.6494349718824544e+01 + 11 -1.8085718545391252e+01 -1.4548964940670663e+01 1.4475333756164674e+00 + 12 3.7005784706479012e+01 -2.1964295566058219e+01 -1.3414655175940847e+01 + 13 1.1975427422552627e+01 1.5631029586746266e+01 -9.7306415677117393e+00 + 14 1.1445242526928594e+01 -9.4593889597527170e+00 3.1982303564901798e+01 + 15 -1.7753961544659674e+01 3.5630164934394323e+01 -2.5723510132857481e+01 + 16 5.4775368058105755e+01 -2.6561435081659944e+01 -1.9769702322012346e+01 + 17 1.0738493944332602e+01 4.5817981361271150e+00 2.1843652023568254e+01 + 18 -9.0614436392010290e+01 -3.5967561219443716e+01 -4.4255898030991133e+01 + 19 -5.6869494739254222e+01 -7.2475529736181386e+01 8.5468473313466848e+00 + 20 1.2507311554872821e+01 -1.1094362879068422e+01 7.3288657391176493e+00 + 21 3.5823671538621468e+01 4.1878649277746923e+01 2.6530450330697072e+01 + 22 -6.5198245556583236e+00 -4.7621968107610357e+01 2.0118481319047308e+00 + 23 2.8682406311851242e+01 4.2980463065222622e+01 -8.1614048713182470e+00 + 24 1.0636048284757098e+02 4.8240449975585648e+01 5.3976159533253629e+01 + 25 5.9300509546032004e+01 3.4609951856445953e+01 -3.0144470814625772e+00 + 26 -3.4964514832186644e+01 -3.8627782680337909e+01 2.3971762126672754e+01 + 27 4.5783157240688315e+00 8.5718442911961006e+00 1.7876837406773340e+00 + 28 -8.4260647171512666e+00 5.9387032928012662e+00 2.9085991174327255e+00 + 29 3.4257714254483403e+01 8.0614532317621709e+01 -8.4411535953769139e+00 + 30 -1.1159009676254385e+01 1.5693385865352878e+01 -1.6810437188972131e+01 + 31 -1.9777374262928600e+01 -3.1480195407933159e+01 5.6647953637063331e+01 + 32 -6.0357862910131068e+01 -3.5437435819830199e+01 -1.5597849849696992e+01 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_fs.yaml b/unittest/force-styles/tests/atomic-pair-eam_fs.yaml index 086890284..f978b7d44 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_fs.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_fs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam/fs @@ -49,41 +49,41 @@ init_forces: ! |2 30 -1.0374660230195671e+00 -1.1402475422746554e+00 -1.7211546087860548e+00 31 -1.0712777798403222e-01 -2.4507774686205819e+00 1.0846841028356100e+00 32 -4.7946208495149687e+00 -2.9144866547588686e+00 -1.3852412930860005e+00 -run_vdwl: -109.421760327124 +run_vdwl: -108.277148649431 run_coul: 0 run_stress: ! |2- - 9.7321790151683032e+01 8.9726181847598752e+01 8.5108697468923864e+01 5.4985923819753797e+00 -2.2363627964466568e+00 4.7695776857019978e-01 + 9.9846864346759972e+01 9.1717939805174794e+01 8.7564501381757196e+01 5.9037090269161174e+00 -2.1310430207577928e+00 3.4797921426392381e-01 run_forces: ! |2 - 1 1.2679194886054646e+00 2.6787268858296414e+00 9.7023827299581675e-03 - 2 -5.5815898277144038e-01 -2.3090914306107573e+00 7.7129085256173746e-01 - 3 -9.0701490664425277e-01 3.9988150514788630e+00 -9.0008377838410702e-01 - 4 2.1760036877107486e-01 -3.5592028900505723e-02 -1.3241879269726802e+00 - 5 8.7191382908658766e-01 5.5025947096510439e+00 1.2269578107092691e+00 - 6 1.4320309112831469e+00 2.0271259799586265e+00 -4.5496868330302566e-03 - 7 -2.0055825566447965e+00 3.2691589608305760e+00 1.0134836971121294e-01 - 8 -1.4686427349869116e+00 -1.2816756190774403e+00 1.2930511003067942e+00 - 9 -6.4120552539828712e-01 -2.4385069051766362e+00 -1.6951251844611397e+00 - 10 -6.2209257619918201e-01 -3.4962227672673376e+00 -3.7799754582118790e+00 - 11 -1.5341640045915756e+00 -3.6794922955899305e+00 2.3169074025641407e+00 - 12 1.0716306131848929e-01 -3.1612337564358306e+00 5.4689025366733734e-01 - 13 -3.4865083527509999e-02 6.2163633221569436e-01 -1.2767015747690553e+00 - 14 1.4759289180607154e+00 -1.9983903928235117e-01 1.3165181136760309e+00 - 15 -1.0859468934837868e+00 5.7512146638833528e-01 -1.9208548742570955e-01 - 16 4.2650302076169417e+00 -3.3898349033764879e+00 1.5150959333645790e+00 - 17 1.7075552543987051e+00 4.2197797415562528e+00 6.8658143676544903e-01 - 18 -2.9282428817784707e+00 -8.1722879256446568e-01 -1.2768017170708874e+00 - 19 -3.3028429922142437e+00 -1.4969402957853979e+00 6.6796170315879078e-01 - 20 8.2458362952654385e-01 8.3101411589898766e-01 -1.1162304568819137e+00 - 21 4.1973022930400949e+00 3.2131020492334490e+00 9.9992489898285064e-01 - 22 -2.1782086247662638e-01 -1.8782889044649795e+00 -3.3002646429455057e-01 - 23 1.3378055708885839e+00 2.8417725691838442e+00 -3.3299911840808853e+00 - 24 2.3314022784432149e+00 2.1821654533604953e+00 1.6556156861679943e+00 - 25 1.4357165303696771e+00 4.2664400867737490e-01 -9.4597021021657834e-01 - 26 -1.7463565218649646e+00 -4.0460118685059721e+00 4.3667870871022822e+00 - 27 4.1107143320055650e-01 -1.1331997756369530e+00 -7.2860925822132971e-01 - 28 -4.1072299435514803e-01 9.1485902771452987e-01 1.3319976358714796e+00 - 29 1.1026069599653305e+00 2.0767178601615672e+00 -1.4719919616790900e-01 - 30 -9.3823645826167124e-01 -1.0624295742838414e+00 -1.6161620718496021e+00 - 31 -1.4173053658599111e-01 -2.3849422802844553e+00 1.0354387068087780e+00 - 32 -4.4420042227902661e+00 -2.5687039748959393e+00 -1.1783697183074275e+00 + 1 1.4118121813562743e+00 2.7986160003269456e+00 -9.3260847771264879e-02 + 2 -5.5717737760628028e-01 -2.3640743642322706e+00 7.8881993406836970e-01 + 3 -1.0777447884744453e+00 4.5488322661135800e+00 -1.0128934564625112e+00 + 4 2.3473230761964739e-01 -8.2164840352704160e-02 -1.3320723631276825e+00 + 5 9.9007151763533541e-01 5.9857914499694154e+00 1.2063707380594624e+00 + 6 1.4318147451955585e+00 2.0530489140488286e+00 1.5568098970824121e-02 + 7 -2.3030294879424265e+00 3.4316222649339982e+00 1.3937259903212837e-01 + 8 -1.4663997682134280e+00 -1.3824732158974693e+00 1.3530805383190514e+00 + 9 -6.9724160685188674e-01 -2.4357341484747024e+00 -1.7265124936079355e+00 + 10 -1.0058380156890632e+00 -3.7362570600338296e+00 -4.2121882653061897e+00 + 11 -1.6389165441835272e+00 -3.8672006761881446e+00 2.4953485079765985e+00 + 12 1.3324394765894429e-01 -3.5078419702328660e+00 5.7247106736549036e-01 + 13 5.8583900109228662e-02 7.0297195144726221e-01 -1.4106576262128416e+00 + 14 1.4811154538749478e+00 -4.2307273997134404e-01 1.5193314258369979e+00 + 15 -1.0960041767237623e+00 6.2507705459227547e-01 -1.9790318879884575e-01 + 16 4.9063993377433022e+00 -3.5594426873146578e+00 1.5936706061296859e+00 + 17 1.7202136962702290e+00 4.4805555958776253e+00 8.6776379895854638e-01 + 18 -3.0419270606045186e+00 -8.3965741580737929e-01 -1.3483920894511952e+00 + 19 -3.4717725029664961e+00 -1.5698255768701301e+00 7.3711675437913382e-01 + 20 8.2737286375422359e-01 7.8345209522539283e-01 -1.1127312014225026e+00 + 21 4.6260148102967378e+00 3.6395301181010957e+00 1.0938168857714456e+00 + 22 -2.6365252067707040e-01 -1.9873742030106365e+00 -3.3098269579777773e-01 + 23 1.5597934707930348e+00 3.1541438064872769e+00 -3.6203823962121953e+00 + 24 2.4727270592891419e+00 2.1913204994493483e+00 1.7177018340794246e+00 + 25 1.4960812556525822e+00 4.6175724908732491e-01 -9.8118175765415427e-01 + 26 -2.0772200044772369e+00 -4.6522349333382076e+00 4.8160935768516975e+00 + 27 4.9566614405043885e-01 -1.0495602573442182e+00 -7.1131628831198590e-01 + 28 -3.5217104579348057e-01 8.9427626626089340e-01 1.3716365962495725e+00 + 29 1.1451243738963464e+00 2.2120108290119522e+00 -1.7722503796478367e-01 + 30 -1.0364532175666108e+00 -1.1392089954246218e+00 -1.7196347450675755e+00 + 31 -1.0939966656230753e-01 -2.4511423539380761e+00 1.0840435685265570e+00 + 32 -4.7958192808634355e+00 -2.9157409225019530e+00 -1.3848720774055419e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_fs_real.yaml b/unittest/force-styles/tests/atomic-pair-eam_fs_real.yaml index 35c9842ff..eae925a38 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_fs_real.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_fs_real.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 7.5e-12 prerequisites: ! | pair eam/fs @@ -50,41 +50,41 @@ init_forces: ! |2 30 -2.3924536059675400e+01 -2.6294734320753790e+01 -3.9690770192486177e+01 31 -2.4704253734659591e+00 -5.6516273903225319e+01 2.5013410902965866e+01 32 -1.1056658903666084e+02 -6.7209662311916517e+01 -3.1944424716035719e+01 -run_vdwl: 40769.6664263018 +run_vdwl: -2496.65480914656 run_coul: 0 run_stress: ! |2- - 4.7822449917559134e+04 3.8552602066321786e+04 1.0546475946402676e+05 -4.7097209744559623e+03 -1.9235871974749352e+04 2.4588761490847905e+03 + 2.3031173686359612e+03 2.1155351475115854e+03 2.0198681219493476e+03 1.3623771207922428e+02 -4.9117004849463832e+01 7.9864065254956884e+00 run_forces: ! |2 - 1 -1.9097605102340876e+04 2.7546194107359679e+03 8.3909985474393779e+03 - 2 -3.5418672604851145e+03 1.1917117809026861e+03 2.9638609715427833e+03 - 3 1.4645939207616050e+03 1.8470227268076071e+03 9.0546066503789025e+03 - 4 1.5171875398835630e+02 2.3348543217680691e+00 8.5754083947283647e+01 - 5 1.5255670556575809e+04 -9.9590105126576509e+03 -1.0489498857223583e+04 - 6 2.7818209314372571e+03 -8.6014157651658352e+03 -1.2889694687248734e+03 - 7 -8.8128660207679713e+03 1.1138472916663044e+04 -2.0399367408221206e+04 - 8 3.5529460324478478e+03 5.5566000158231727e+03 -1.8769853546434602e+04 - 9 4.8136177248634124e+02 -1.1761544007856508e+03 -2.7017533689434504e+02 - 10 1.6535310540000421e+02 1.3432168572002630e+02 1.1963005448873372e+02 - 11 -1.5594213178911821e+02 1.2778619884218517e+02 1.4189480288863157e+01 - 12 7.3411513010215776e+02 1.4480425185203373e+02 -4.6079278035525209e+02 - 13 -6.0663163395445554e+02 -4.8726527419798191e+02 7.3735693469165005e+02 - 14 -4.5176376406929248e+03 6.1391055620710958e+03 -4.1085739464471732e+02 - 15 1.1925775244418553e+03 1.1292242217643995e+03 -1.5125109545593780e+03 - 16 -7.2703161457282818e+01 8.3339390002660116e+02 1.9248938430088270e+02 - 17 -1.7348561999524920e+03 -7.2757358517490627e+02 -3.8426231743638226e+02 - 18 4.1035400691422149e+02 6.4564583234883332e+02 -1.4428957831119492e+03 - 19 1.9940148697028285e+03 -1.7448505231999184e+03 1.0608439981184874e+03 - 20 -1.2838394344544719e+02 -8.5097194257359575e+01 -4.9610165903646248e+01 - 21 3.8616135702957799e+01 1.0718282306569954e+01 -1.3278179744237363e+02 - 22 -2.4718543372784740e+01 -6.0165634334582258e+01 -7.0468964014221868e+01 - 23 9.0747440529575016e+01 8.5311078702804366e+02 -6.4721686266288384e+02 - 24 -7.7063686156537779e+03 -9.4345142528368035e+02 1.9053020187898852e+04 - 25 1.1857089833982548e+03 -1.5931029976787677e+03 6.4196001788861088e+02 - 26 1.2336392110886525e+03 -5.8839681071745563e+03 -1.3144430058576259e+04 - 27 -1.5957637891150082e+03 3.9143843166375348e+02 1.1708001522772015e+03 - 28 8.2009942698864488e+03 -4.3380266610719063e+03 3.2623123387196545e+04 - 29 3.1967940813545983e+03 2.8352472875148283e+03 1.8573222150564936e+04 - 30 5.4696070166385871e+03 4.6916524743136716e+02 -2.5807628896134262e+04 - 31 5.3597116724412365e+02 -5.7446986383631292e+02 7.3443567691357464e+02 - 32 -1.4126086707422229e+02 -3.0171449004869864e+01 -1.3497108559673748e+02 + 1 3.2571820842868540e+01 6.4564472909827458e+01 -2.1805579963844424e+00 + 2 -1.2850620596514712e+01 -5.4529147804065360e+01 1.8195427793023548e+01 + 3 -2.4899975102996386e+01 1.0502420071554535e+02 -2.3393921432737876e+01 + 4 5.4197475045289050e+00 -1.9041878273798041e+00 -3.0718286109266266e+01 + 5 2.2858783485996106e+01 1.3814304249999100e+02 2.7815643186768863e+01 + 6 3.3020705341923559e+01 4.7346477722622730e+01 3.5811723521401995e-01 + 7 -5.3186173256699178e+01 7.9184104921676592e+01 3.2120872879859879e+00 + 8 -3.3819329845408610e+01 -3.1906204250613413e+01 3.1219098218781959e+01 + 9 -1.6086714153034208e+01 -5.6176815823080503e+01 -3.9828269524078436e+01 + 10 -2.3273240092055929e+01 -8.6214111375032672e+01 -9.7225360308965037e+01 + 11 -3.7816675788116811e+01 -8.9231662911312540e+01 5.7578476935799621e+01 + 12 3.0856986318812885e+00 -8.0975333083054522e+01 1.3207170299853335e+01 + 13 1.3702508573345376e+00 1.6225687847545554e+01 -3.2556257720122098e+01 + 14 3.4161705243252797e+01 -9.7969884741449818e+00 3.5082043056771475e+01 + 15 -2.5275717394638498e+01 1.4428352491679195e+01 -4.5628717421968359e+00 + 16 1.1327897511754696e+02 -8.2122546962557806e+01 3.6764980531755675e+01 + 17 3.9679974943078840e+01 1.0338584932956742e+02 2.0061477235656774e+01 + 18 -7.0177537808807003e+01 -1.9363155430964056e+01 -3.1116913560967106e+01 + 19 -8.0098564293756880e+01 -3.6218855580268176e+01 1.7009221616051786e+01 + 20 1.9076369898542829e+01 1.8057163700786500e+01 -2.5658161986033857e+01 + 21 1.0678283938612479e+02 8.4022934877580440e+01 2.5248530407182631e+01 + 22 -6.0868751844758631e+00 -4.5850531809441222e+01 -7.6282845791248119e+00 + 23 3.6040978056239744e+01 7.2820968679513342e+01 -8.3539510493759352e+01 + 24 5.7056803223005502e+01 5.0533733448004192e+01 3.9630743790206864e+01 + 25 3.4515575576493816e+01 1.0657358165653907e+01 -2.2635372128143057e+01 + 26 -4.7973060166543547e+01 -1.0742327881604575e+02 1.1117370266838988e+02 + 27 1.1452773088205037e+01 -2.4180697169794875e+01 -1.6407214808730604e+01 + 28 -8.1077036388585810e+00 2.0620415596267065e+01 3.1640150014059049e+01 + 29 2.6413243946213541e+01 5.1042610869194839e+01 -4.0866120602412455e+00 + 30 -2.3924926108542316e+01 -2.6288718680413279e+01 -3.9678812806142645e+01 + 31 -2.5196925544356281e+00 -5.6542809722040715e+01 2.5009669024617558e+01 + 32 -1.1068943915835271e+02 -6.7332328055245668e+01 -3.1990132045225433e+01 ... diff --git a/unittest/force-styles/tests/atomic-pair-eam_real.yaml b/unittest/force-styles/tests/atomic-pair-eam_real.yaml index 225b7c8d3..a9df9364a 100644 --- a/unittest/force-styles/tests/atomic-pair-eam_real.yaml +++ b/unittest/force-styles/tests/atomic-pair-eam_real.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair eam @@ -51,41 +51,41 @@ init_forces: ! |2 30 -7.2869896720070074e+01 2.8621045994576787e+02 -7.7726624384065360e+01 31 -1.0966168562269873e+02 4.7983060114616165e+01 2.2592123146266928e+02 32 1.1016957264107174e+02 -8.2701371521245974e+01 -8.3482985240425492e+01 -run_vdwl: 36279.0101522507 +run_vdwl: -8499.63392113313 run_coul: 0 -run_stress: ! |2- - 6.8617284985816106e+04 5.8840338251294685e+04 4.9173412724151516e+04 -8.7320720548069312e+03 -1.4804674260124837e+04 1.4286081929041897e+04 +run_stress: ! |- + -9.0505794012029874e+03 -1.0710658449701059e+04 -9.5327589626093231e+03 4.4723194233718323e+02 2.5525028652344783e+01 2.7889354001643403e+02 run_forces: ! |2 - 1 -1.8801881199148458e+04 -2.2952295535469352e+03 7.7538322152247383e+03 - 2 -4.1204309984197334e+03 3.9974180085520161e+03 4.3473920721632112e+03 - 3 -5.3203316436748594e+02 -2.0904013776411184e+03 -2.1889617008631431e+03 - 4 4.2748949639633173e+02 -9.0574308491181478e+02 -3.1452289507637914e+02 - 5 9.6209046948317446e+03 -8.2581113904264603e+03 -1.0446350545429854e+04 - 6 8.9357703719184319e+03 -2.1627075238994184e+03 -2.7910760895156991e+03 - 7 -1.6771483557857369e+04 1.6311574435610341e+04 2.9013646076183682e+03 - 8 4.9281165530365621e+02 -1.9418868071714874e+03 -1.6251488823913426e+03 - 9 -5.8575452704640873e+02 6.4867039915368377e+02 -1.1994332775825942e+03 - 10 -7.5002177028345614e+00 1.3371970267937689e+02 1.7086029496424061e+02 - 11 -7.4112330774615361e+02 4.9496307880222332e+02 -2.7399350083368324e+02 - 12 9.4442081296443791e+02 5.5726294596565708e+02 -4.7445042822601414e+02 - 13 -2.9823453070252062e+03 -1.1243383556731740e+03 2.0393260589681911e+03 - 14 1.4690379110332547e+03 6.8718012562597742e+03 7.4104265907921035e+02 - 15 2.9352021540988142e+02 -6.8464019908234192e+01 -1.5697867591334168e+03 - 16 -1.1187452835505010e+03 -5.0942719099583314e+02 6.1184598184253332e+02 - 17 -1.7474509810876184e+03 -6.0457148035538985e+03 -1.6485264046696857e+03 - 18 4.4607104164218839e+02 3.4893057128797358e+02 -1.0683802675857785e+03 - 19 2.6846560299595858e+03 -1.9604404111237598e+03 7.5179155996229490e+00 - 20 3.1467440677839100e+01 -1.9394341540596773e+02 -1.5452870297451892e+02 - 21 -4.8572604737843825e+01 -5.2368368433832586e+01 5.2006926244005250e+01 - 22 -3.1057917866565498e+02 -3.6203364410569316e+02 -1.9818927476283139e+02 - 23 -3.2519516257161484e+02 1.7981634008567814e+03 -1.0689607287024155e+03 - 24 3.7024818762006720e+02 -1.0714406761271687e+03 -4.7575775136767851e+02 - 25 1.5037085122622909e+03 6.9844106766958512e+03 3.2093828527254800e+03 - 26 1.3948771623560078e+04 -1.2357848450183492e+04 -1.9266918517779883e+04 - 27 -2.3736463612226107e+03 1.7097162179598649e+03 9.9541308990792004e+02 - 28 8.2302550220349567e+03 -1.5285255401371560e+03 1.6767520845541123e+04 - 29 1.2644427071474988e+03 3.0966783186225189e+03 1.2562218506756606e+03 - 30 -6.1186918063634471e+02 3.2678985634374203e+02 3.1389427530948551e+03 - 31 3.6223572246865859e+02 -3.9937104153443727e+02 7.4861364047401298e+02 - 32 5.2799586554932908e+01 4.7896785990086244e+01 2.3701962771751898e+01 + 1 8.9181493585528116e+01 7.4117765098455848e+01 -7.5600659996080566e+01 + 2 3.5504007708258285e+01 1.2395985493188439e+02 3.6243818449130380e+01 + 3 2.2253459706761106e+01 -3.0317376449423625e+02 -2.0882708187945472e+01 + 4 -5.7837267461257376e+01 -1.2016560222021364e+02 -1.3585360042999787e+02 + 5 -6.5790980281186037e+01 1.7674880032412040e+02 -3.7139959463496005e+01 + 6 4.7442314036159647e+00 1.1969071216631691e+02 -1.3612255539195237e+01 + 7 -2.2439921981442854e+01 8.1424499125082036e+01 7.4405667127915095e+01 + 8 1.7302172336293147e+01 -1.2210695328947413e+02 -1.4391658640168856e+02 + 9 -1.3493564056733933e+02 -8.6449795959426410e+01 -9.0870671611458121e+01 + 10 -4.1472909083960104e+01 8.5363874611644903e+01 -8.9664340998876526e+01 + 11 8.1970691805861975e+00 -2.6124787268827475e+02 1.5484618662330888e+02 + 12 -1.0299712371160859e+02 -9.5182904370617919e+01 1.0818729012565038e+02 + 13 1.0316223479666986e+02 -8.8402126601426176e+01 -6.1616519032366988e+00 + 14 -6.2992364020111701e+01 1.7947646260581158e+02 5.7590134363666778e+01 + 15 4.2789673620527653e+00 1.3625119475329782e+02 -2.2865741173238334e+02 + 16 1.3484241992375871e+02 -5.2133721761864336e+01 6.8832151659618120e+01 + 17 6.3552670260663930e+01 1.1349251249511239e+02 6.7062763432674402e+01 + 18 -3.4160192448448946e+01 -4.0058193525461121e+01 -3.7035088818831817e+01 + 19 3.4151012336087774e+01 -2.8234873032154206e+02 1.1502139136993751e+01 + 20 -8.4429795069155304e+01 -1.1234690713845150e+02 1.2127204891217914e+02 + 21 -3.1116054664800796e+01 2.4470255852116972e+02 6.2302333283627725e+01 + 22 -8.1125389338242684e+00 -2.8294233716657050e+02 8.7686967195184895e+00 + 23 4.9145179958297966e+01 -2.2599978277214525e+01 -1.1685674410494640e+02 + 24 1.3933797756566020e+02 -8.8998440962988582e+01 1.6773113853318230e+02 + 25 1.9473997782227215e+02 1.6285198139119129e+02 -7.3357308528016176e+01 + 26 -7.1244747524647366e+01 -1.7775723762156744e+01 1.2295332984918392e+02 + 27 -6.8405861813729643e+01 -1.9983927193638254e+02 -1.5649352966281651e+02 + 28 1.1386449403331237e+02 1.5288111033473280e+02 1.0711344911207628e+02 + 29 -1.5589095737875238e+02 2.7334995635119134e+02 -7.3713509299717632e+00 + 30 -7.2844115618518089e+01 2.8628454877870684e+02 -7.7785434951246415e+01 + 31 -1.0970292619122833e+02 4.7953049036282430e+01 2.2592160548062182e+02 + 32 1.1011602877019264e+02 -8.2776556048699192e+01 -8.3473449549160065e+01 ... diff --git a/unittest/force-styles/tests/atomic-pair-edip.yaml b/unittest/force-styles/tests/atomic-pair-edip.yaml index c46742a30..5c17154ab 100644 --- a/unittest/force-styles/tests/atomic-pair-edip.yaml +++ b/unittest/force-styles/tests/atomic-pair-edip.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 16:11:57 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 2e-14 prerequisites: ! | pair edip diff --git a/unittest/force-styles/tests/atomic-pair-eim.yaml b/unittest/force-styles/tests/atomic-pair-eim.yaml index 2518ea0a8..8e9b4ee2c 100644 --- a/unittest/force-styles/tests/atomic-pair-eim.yaml +++ b/unittest/force-styles/tests/atomic-pair-eim.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 1e-11 prerequisites: ! | pair eim @@ -50,41 +50,41 @@ init_forces: ! |2 30 -4.4268691057672088e-01 1.8614184084637593e+00 -3.0635131466682086e+00 31 3.1796191004214864e+00 -2.9038638862283421e+00 1.3534160908852291e+01 32 -1.5023162437974118e+01 -1.0281185077172976e+00 1.4167924044403386e+00 -run_vdwl: 122.202735196696 +run_vdwl: 156.543907523153 run_coul: 0 run_stress: ! |2- - 3.4380556379381511e+02 3.4108042955292865e+02 3.6400846317693936e+02 4.9614126800758174e-01 -9.9439839758416682e+00 -1.1841677419289216e+01 + 3.9785327522503184e+02 3.9895469050745766e+02 4.2324893277634811e+02 1.1324454072042596e+00 -1.0273666048004785e+01 -1.2969144723625490e+01 run_forces: ! |2 - 1 6.0857607918334917e+00 2.1218203466742889e+00 2.6856606282317652e+00 - 2 -4.1577550735915674e+00 -5.7865744963177157e-01 1.1523121453859590e+01 - 3 -7.8053297493962726e+00 1.1887214267198683e+01 -3.2460992289834332e+00 - 4 8.1080116696133544e+00 -1.0789261354289245e+01 -6.7556421479437878e+00 - 5 -5.9977109572586702e+00 5.0829170695584294e+00 4.3252899456557543e+00 - 6 -1.1774871337125217e+00 -1.2770796219367506e+00 7.4518654076934867e+00 - 7 -2.8549810374112694e-01 8.2282626857675218e+00 -6.4305323521837856e+00 - 8 -2.7659955642929752e+00 -1.3971135305951176e+01 -7.8342515967184339e+00 - 9 2.6889982519418596e+00 -4.7827118680275160e-01 -7.7051710490703158e+00 - 10 -3.3257144845831861e+00 -5.8510594418036477e-01 -9.2686733430468120e+00 - 11 -8.3892766023939860e+00 -3.0246878402629132e+00 -2.9027093347714379e+00 - 12 8.4999192896356810e+00 2.4240920506421961e+00 -4.3101637900279632e+00 - 13 9.0226620749142450e-01 1.0044404705860035e+00 -9.4069063946105551e+00 - 14 2.1079055275251330e+00 -5.3042488908894585e+00 1.3182185305943696e+01 - 15 -1.0208202060412843e+00 4.1422863614573080e+00 -9.0440067304128231e+00 - 16 4.0045475207907701e+00 -1.6120893712409301e-01 -4.7527492142657453e+00 - 17 7.9617411834294964e+00 5.6302197041026689e+00 2.0734601036697562e+00 - 18 -1.5811894747868804e+01 -5.7642264133192471e+00 -7.6690034686865598e+00 - 19 -6.9307071966841525e+00 -1.4663516993961514e+01 1.0223899016280067e+00 - 20 1.0207174804826836e+01 -6.3154531879982176e+00 5.0243823168161867e+00 - 21 1.3382393279924647e+00 9.1670844574857036e+00 4.6483601255583356e+00 - 22 1.0600019847250368e+00 -1.5642060404695211e+01 -1.0267971561794753e+00 - 23 5.9734107032207051e-01 1.0202156536638823e+01 -1.1235706443984697e+00 - 24 8.2900528878653095e+00 -2.5851699687669250e+00 7.4423513246948509e+00 - 25 1.7486205632839102e+01 6.2967785926326680e+00 2.4007943747602485e+00 - 26 -4.5801163729457857e+00 -1.3117973025687979e+00 1.8620718510196819e+00 - 27 -1.0168776045802588e+00 5.7619619612797357e-01 4.0239087026639924e+00 - 28 -9.5036762856329151e+00 4.7848406477520644e+00 2.8493906400405771e+00 - 29 -1.3627559888275171e+00 7.3299392964025669e+00 -9.1918490541258902e-01 - 30 7.3706368544374035e-01 3.7909839787461745e+00 -2.0812605330187393e+00 - 31 2.5225616441946235e+00 -1.6842946688758833e+00 1.1333524346595516e+01 - 32 -8.4661754089193586e+00 1.4669428094812473e+00 2.6279654608994747e+00 + 1 7.9770908685557238e+00 3.1263300438461248e+00 3.4298306629489352e+00 + 2 -4.5981402288021949e+00 -1.8240547079225344e-01 1.2821780779427138e+01 + 3 -1.1058455694457628e+01 1.6920750764628039e+01 -4.2883307666893185e+00 + 4 9.3228785785100676e+00 -1.2765736619920528e+01 -7.6378488510350104e+00 + 5 -8.7717517521930546e+00 6.8708334356754959e+00 5.7661388984023052e+00 + 6 -1.9723436585046707e+00 -1.4676891696652483e+00 8.3745768534950926e+00 + 7 -2.1751047816181259e+00 1.0686284055133276e+01 -8.9602611062623279e+00 + 8 -2.8721942770681776e+00 -1.6737458721292807e+01 -8.1480386494636541e+00 + 9 3.4184829314194909e+00 -2.2433510744562818e-01 -9.0079910760629911e+00 + 10 -4.8319622283505490e+00 -1.3639853492797738e+00 -1.3124330569508336e+01 + 11 -1.0950198962021313e+01 -5.0788871686341110e+00 -2.5864664170496283e+00 + 12 1.1233713336459465e+01 1.3977065246458587e+00 -6.2565049222114544e+00 + 13 1.5760002345996491e+00 1.9116697062578412e+00 -1.1867001788972432e+01 + 14 3.3641133388952702e+00 -9.1937759675270669e+00 1.7004771700949902e+01 + 15 -2.5835324436682519e+00 5.3321170248389276e+00 -1.0184854760698338e+01 + 16 9.6997621371687952e+00 -1.5440938818861500e+00 -6.6462697652263643e+00 + 17 1.0437058529383513e+01 8.1236011923281044e+00 3.9816473111608621e+00 + 18 -1.8747496811817019e+01 -6.6495428181472249e+00 -1.0168991828169643e+01 + 19 -8.3413033313900335e+00 -1.7152615979901213e+01 1.1265270137056755e+00 + 20 1.1666811935973637e+01 -6.7788726903708127e+00 5.1630846848771714e+00 + 21 3.7911697402069993e+00 1.2850488581455391e+01 7.5762468691380898e+00 + 22 1.5172187070013729e-01 -1.8346236349383886e+01 -3.4433235413200353e-01 + 23 2.9367551963087539e+00 1.4785185581872371e+01 -3.6116402045049671e+00 + 24 1.1663753077645714e+01 -2.4858818813513412e+00 8.7898945146238265e+00 + 25 2.0488011827749862e+01 7.3088221098894399e+00 3.2550190497327707e+00 + 26 -8.1421255051338672e+00 -4.8467061313644493e+00 7.4804751347983389e+00 + 27 -8.4032933275332400e-01 2.6988984837613192e+00 4.1292255325764335e+00 + 28 -8.6995438299892029e+00 4.9802675385607555e+00 2.1609082232123948e+00 + 29 -9.3495796316717272e-01 9.8347960818160072e+00 -1.1817559166977358e-01 + 30 -4.2719921028107649e-01 1.8858294901816268e+00 -3.0511634200808597e+00 + 31 3.1690334422304449e+00 -2.8911767107427706e+00 1.3510558335525166e+01 + 32 -1.4949717034591869e+01 -1.0041805971853250e+00 1.4315165071629787e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-gauss.yaml b/unittest/force-styles/tests/atomic-pair-gauss.yaml index b6f477b5d..a6db06e01 100644 --- a/unittest/force-styles/tests/atomic-pair-gauss.yaml +++ b/unittest/force-styles/tests/atomic-pair-gauss.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Wed Aug 26 15:18:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:22 202 epsilon: 5e-12 prerequisites: ! | pair gauss @@ -16,75 +16,75 @@ natoms: 32 init_vdwl: -0.563282655796335 init_coul: 0 init_stress: ! |- - -7.1147683670454420e-01 -6.1895022673299749e-01 -7.1191426374517874e-01 -1.3771409096139881e-03 8.9168242763715066e-05 -4.5069108788045121e-03 + -7.1147683670454420e-01 -6.1895022673299749e-01 -7.1191426374517874e-01 -1.3771409096140666e-03 8.9168242763744339e-05 -4.5069108788046326e-03 init_forces: ! |2 - 1 -3.6975091363322197e-03 -8.9166609180134377e-03 3.8707370816502317e-03 - 2 6.7664258073144642e-04 3.0285805489280921e-03 5.8246816035877568e-05 - 3 7.5183749069060923e-04 -5.9597015320580152e-03 2.9037917992728402e-04 - 4 -1.0475839410519602e-03 -1.4148792698487741e-03 -1.2416950669482958e-03 - 5 3.4659191685813421e-03 -1.0592557038465261e-02 1.7167649635640306e-03 - 6 -2.0475405635241796e-03 -8.6989207608955711e-03 1.3418888653935538e-03 - 7 -1.2552853754846285e-03 -8.3218226106267883e-03 -6.0990521648894716e-03 - 8 1.0360368053013332e-03 -8.3883339491666240e-04 -2.6138068672443950e-03 - 9 4.1082937587654349e-03 1.0388903548678087e-02 2.8242797697012609e-03 - 10 3.0365914074665344e-03 -2.2252705767044950e-03 5.4269465575813216e-03 + 1 -3.6975091363322214e-03 -8.9166609180134412e-03 3.8707370816502321e-03 + 2 6.7664258073144663e-04 3.0285805489280917e-03 5.8246816035878157e-05 + 3 7.5183749069060966e-04 -5.9597015320580170e-03 2.9037917992728271e-04 + 4 -1.0475839410519602e-03 -1.4148792698487746e-03 -1.2416950669482958e-03 + 5 3.4659191685813421e-03 -1.0592557038465265e-02 1.7167649635640315e-03 + 6 -2.0475405635241787e-03 -8.6989207608955711e-03 1.3418888653935538e-03 + 7 -1.2552853754846287e-03 -8.3218226106267883e-03 -6.0990521648894716e-03 + 8 1.0360368053013323e-03 -8.3883339491666240e-04 -2.6138068672443941e-03 + 9 4.1082937587654331e-03 1.0388903548678087e-02 2.8242797697012626e-03 + 10 3.0365914074665309e-03 -2.2252705767044959e-03 5.4269465575813268e-03 11 1.3004025353227297e-03 1.5457051866805356e-02 -7.3429974982901578e-03 - 12 5.1312746351524271e-03 5.6154154320436234e-03 -6.1242911513773998e-03 - 13 -4.1183232509029929e-03 9.4869050937663110e-03 1.7031346395223349e-03 - 14 -1.3984473074106509e-03 2.3954677961721006e-03 6.8820150454989418e-05 - 15 5.8013186047801459e-04 1.3665809850244893e-03 -2.9667523828888907e-03 - 16 -5.5149323840025799e-03 3.9231523520377376e-03 -5.7838177614615953e-03 - 17 -1.0517085303787545e-03 -1.0325998256457721e-02 -2.9330828348634970e-03 - 18 6.7213123017888297e-04 -1.3325061791941048e-04 9.7378305919517734e-05 - 19 1.7419961411847631e-03 -3.0438907880170718e-03 -2.9361186595039862e-04 + 12 5.1312746351524271e-03 5.6154154320436226e-03 -6.1242911513774024e-03 + 13 -4.1183232509029938e-03 9.4869050937663145e-03 1.7031346395223351e-03 + 14 -1.3984473074106509e-03 2.3954677961721014e-03 6.8820150454988754e-05 + 15 5.8013186047801448e-04 1.3665809850244889e-03 -2.9667523828888907e-03 + 16 -5.5149323840025834e-03 3.9231523520377384e-03 -5.7838177614615953e-03 + 17 -1.0517085303787547e-03 -1.0325998256457721e-02 -2.9330828348634970e-03 + 18 6.7213123017888297e-04 -1.3325061791941048e-04 9.7378305919517625e-05 + 19 1.7419961411847635e-03 -3.0438907880170705e-03 -2.9361186595039981e-04 20 -1.5166405967847016e-03 -1.6318347020119605e-03 2.0888288971545555e-03 - 21 -3.4554749816301331e-04 -1.2317433244469309e-02 -1.9376462742739437e-03 - 22 1.9679936406251231e-05 -2.8622553443930811e-03 1.0199898126447986e-04 - 23 -3.3388836800437929e-03 -5.6041781071079263e-03 6.6830063101126500e-03 - 24 1.0042783549230922e-03 -1.6856423379370820e-03 1.5876572173932921e-03 - 25 2.0987440879636924e-03 1.8116243065802462e-03 -4.7113266062051416e-04 - 26 2.2100060749557972e-03 3.7067639415198292e-03 -6.6249167381585480e-03 - 27 2.8988173789132590e-03 1.1447286743003436e-02 7.5453222446118743e-03 - 28 1.7361574622116339e-03 1.3810057381998862e-03 8.1905302076125364e-04 - 29 -2.5747642276920109e-03 2.6563759975225766e-03 3.6250176235475764e-05 - 30 -3.9857037525045701e-04 4.3697148126638332e-03 -3.1548156670274658e-04 - 31 -1.4904089957431151e-03 1.3032869676305749e-03 2.4501187901800996e-03 - 32 -2.6727950464621665e-03 6.2350133692663928e-03 6.0374728662057706e-03 -run_vdwl: -0.563233052239839 + 21 -3.4554749816301331e-04 -1.2317433244469309e-02 -1.9376462742739442e-03 + 22 1.9679936406251191e-05 -2.8622553443930811e-03 1.0199898126447986e-04 + 23 -3.3388836800437929e-03 -5.6041781071079272e-03 6.6830063101126500e-03 + 24 1.0042783549230922e-03 -1.6856423379370813e-03 1.5876572173932919e-03 + 25 2.0987440879636924e-03 1.8116243065802462e-03 -4.7113266062051427e-04 + 26 2.2100060749557972e-03 3.7067639415198296e-03 -6.6249167381585497e-03 + 27 2.8988173789132590e-03 1.1447286743003438e-02 7.5453222446118743e-03 + 28 1.7361574622116339e-03 1.3810057381998871e-03 8.1905302076125213e-04 + 29 -2.5747642276920109e-03 2.6563759975225761e-03 3.6250176235476184e-05 + 30 -3.9857037525045750e-04 4.3697148126638340e-03 -3.1548156670274744e-04 + 31 -1.4904089957431146e-03 1.3032869676305745e-03 2.4501187901800996e-03 + 32 -2.6727950464621696e-03 6.2350133692663928e-03 6.0374728662057706e-03 +run_vdwl: -0.563277392601751 run_coul: 0 run_stress: ! |- - -7.1157360661143920e-01 -6.1889049047247346e-01 -7.1192632204343109e-01 -1.3392830636186702e-03 7.5725029369861019e-05 -4.5413100211652135e-03 + -7.1148627853396940e-01 -6.1894423210414351e-01 -7.1191515574790543e-01 -1.3731992304281122e-03 8.7962523442472685e-05 -4.5100872635451894e-03 run_forces: ! |2 - 1 -3.6686124252972409e-03 -8.9350327372598876e-03 3.8810577661021793e-03 - 2 6.7979404886000334e-04 3.0233576690327163e-03 4.7456791294909121e-05 - 3 7.5633049559225857e-04 -5.9439939708244814e-03 2.9942817501032060e-04 - 4 -1.0566057629555279e-03 -1.4272832374600697e-03 -1.2465554120747022e-03 - 5 3.4542187442194961e-03 -1.0591862783855046e-02 1.7040547134995880e-03 - 6 -2.0529624833974776e-03 -8.6908158450241454e-03 1.3521175576812769e-03 - 7 -1.2378100828156998e-03 -8.3153295469970030e-03 -6.0641028446522015e-03 - 8 1.0356610384790247e-03 -8.3942251602866288e-04 -2.6205223928138476e-03 - 9 4.0956197516761146e-03 1.0415492737390893e-02 2.8270546765106733e-03 - 10 3.0232168440311631e-03 -2.2273991989069713e-03 5.4249070307556147e-03 - 11 1.2869492019802285e-03 1.5467748882104244e-02 -7.3455140419333926e-03 - 12 5.1024474988293966e-03 5.6045531136680602e-03 -6.1137045116280847e-03 - 13 -4.1046942912707886e-03 9.4926542944429732e-03 1.7278248815632109e-03 - 14 -1.4068857318857405e-03 2.3698562168476193e-03 7.6075486194014091e-05 - 15 5.8330905021635436e-04 1.3702451769552081e-03 -2.9724575746321578e-03 - 16 -5.4894080631135459e-03 3.9412646806737620e-03 -5.7807073622216203e-03 - 17 -1.0774240198883002e-03 -1.0330343194922521e-02 -2.9590053895634746e-03 - 18 6.7606970063029646e-04 -1.3736892386880862e-04 1.0275184877993657e-04 - 19 1.7410016436244188e-03 -3.0380040199797218e-03 -2.7388946751269005e-04 - 20 -1.5089015590401564e-03 -1.6333211201424390e-03 2.0862691007254492e-03 - 21 -3.2400255636498478e-04 -1.2320097592577971e-02 -1.9320929956516638e-03 - 22 1.6985112307787755e-05 -2.8745852779696280e-03 9.5869218592076162e-05 - 23 -3.3479692839997952e-03 -5.5977162642779129e-03 6.6458983350256295e-03 - 24 9.9831062174002673e-04 -1.6874402964014573e-03 1.5855571063953778e-03 - 25 2.0924859292390380e-03 1.8078584507053310e-03 -4.7094963693244002e-04 - 26 2.2052959022549438e-03 3.7218591686479260e-03 -6.6379106152103752e-03 - 27 2.8965306485482399e-03 1.1432059569111147e-02 7.5653239310787893e-03 - 28 1.7376198455564126e-03 1.3763854610550673e-03 8.1538919655569893e-04 - 29 -2.5676548177329273e-03 2.6497909603554223e-03 1.8339177274955466e-05 - 30 -3.9743098824430285e-04 4.3793350248157127e-03 -3.2444856851193303e-04 - 31 -1.4865980596656129e-03 1.3046725700242229e-03 2.4510790237550098e-03 - 32 -2.6548859521130881e-03 6.2328825506664104e-03 6.0354067965438648e-03 + 1 -3.6946151887502585e-03 -8.9184773862379385e-03 3.8717556851949114e-03 + 2 6.7696030416209210e-04 3.0280551406598982e-03 5.7169012144883129e-05 + 3 7.5228077904151676e-04 -5.9581197493242134e-03 2.9128250222307353e-04 + 4 -1.0484874761186288e-03 -1.4161173075930044e-03 -1.2421785613362514e-03 + 5 3.4647493525140982e-03 -1.0592460345477860e-02 1.7154840312026264e-03 + 6 -2.0480515233024812e-03 -8.6980426248079203e-03 1.3429526417282395e-03 + 7 -1.2535351595215297e-03 -8.3211584244285135e-03 -6.0955385544210440e-03 + 8 1.0359953401636941e-03 -8.3889152951949024e-04 -2.6144769411486335e-03 + 9 4.1070142100750997e-03 1.0391529941599897e-02 2.8245498675518385e-03 + 10 3.0352480463850945e-03 -2.2254808930207040e-03 5.4267290170592133e-03 + 11 1.2990288905117466e-03 1.5458041509200276e-02 -7.3432852252725521e-03 + 12 5.1283777335971717e-03 5.6143315544539473e-03 -6.1232201573757153e-03 + 13 -4.1169449960159537e-03 9.4874404140513346e-03 1.7056010894097935e-03 + 14 -1.3992950307445348e-03 2.3928902460205880e-03 6.9546920079011231e-05 + 15 5.8044921205682991e-04 1.3669457345750632e-03 -2.9673242325533099e-03 + 16 -5.5123812178895417e-03 3.9249717895225291e-03 -5.7834971642953615e-03 + 17 -1.0542848617734947e-03 -1.0326415457917133e-02 -2.9356601579074051e-03 + 18 6.7252619744020384e-04 -1.3366039627639762e-04 9.7916760068144737e-05 + 19 1.7418953605814495e-03 -3.0432961467650086e-03 -2.9163786232830823e-04 + 20 -1.5158667392487380e-03 -1.6319859967430799e-03 2.0885715950876801e-03 + 21 -3.4338445125575191e-04 -1.2317683896328270e-02 -1.9370785218559288e-03 + 22 1.9410998292166067e-05 -2.8634916121819303e-03 1.0138365175570916e-04 + 23 -3.3397816554642410e-03 -5.6035132808260092e-03 6.6792787585094604e-03 + 24 1.0036806245278015e-03 -1.6858215562945572e-03 1.5874467384904131e-03 + 25 2.0981212296029002e-03 1.8112473972760829e-03 -4.7111492666408348e-04 + 26 2.2095387793713110e-03 3.7082733004562252e-03 -6.6261958695378832e-03 + 27 2.8985817934594517e-03 1.1445735288490789e-02 7.5473070941163012e-03 + 28 1.7363057776344274e-03 1.3805433349460053e-03 8.1868488804201934e-04 + 29 -2.5740541153588055e-03 2.6557123013273873e-03 3.4455863603077852e-05 + 30 -3.9845494707871804e-04 4.3706730911735351e-03 -3.1637494366614687e-04 + 31 -1.4900272871341423e-03 1.3034231532838684e-03 2.4502179338835176e-03 + 32 -2.6709999797602173e-03 6.2348024067045947e-03 6.0372490682127312e-03 ... diff --git a/unittest/force-styles/tests/atomic-pair-hybrid-eam.yaml b/unittest/force-styles/tests/atomic-pair-hybrid-eam.yaml index 43e2495cf..6647cc39a 100644 --- a/unittest/force-styles/tests/atomic-pair-hybrid-eam.yaml +++ b/unittest/force-styles/tests/atomic-pair-hybrid-eam.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 5e-12 prerequisites: ! | pair eam/fs @@ -50,41 +50,41 @@ init_forces: ! |2 30 -8.7442364632334701e-01 -8.5922993943854902e+00 -3.1671240722317777e+00 31 3.1880080741982892e+00 -5.0021160844369490e+00 -2.7083467494366831e-01 32 -1.5986786450380142e+01 -5.5759911113046883e+00 -1.5504124024744577e+00 -run_vdwl: -2.66375379444636 +run_vdwl: 0.669352105052575 run_coul: 0 run_stress: ! |2- - 2.5240789931255762e+02 2.5310341558939220e+02 2.3543185866992556e+02 3.5794743941279328e+00 -6.5594623433970316e+00 -1.2031941810791363e+01 + 2.6541041873586806e+02 2.6644256162479292e+02 2.4793398704069506e+02 5.9903981717659827e+00 -6.6045526000630410e+00 -1.4160943794248436e+01 run_forces: ! |2 - 1 -7.3526208784876937e-02 4.6276320068176959e+00 1.3126264406665118e+00 - 2 -1.5191460382260331e+00 -7.2498061177696114e+00 1.1823934281570776e+00 - 3 -3.2833567945495470e+00 1.5927553463956462e+01 -2.9194944379847763e+00 - 4 1.7820481436204219e+00 1.1974444662187944e+00 -2.4893842934590110e-01 - 5 4.7368209750868262e+00 9.9036364584686591e+00 2.1027355832605523e+00 - 6 2.8161555194400765e+00 1.7961276852999983e+00 -5.7078753323633125e-01 - 7 -4.5078427357513151e+00 6.2991186370729713e+00 -8.0377899842111500e-01 - 8 -4.4353940063558506e+00 -9.7188642407974235e-01 6.3230048169341826e+00 - 9 1.3321375236984641e+00 -3.7787257273939892e+00 -2.0434694926966208e+00 - 10 -1.9181848101178929e+00 -1.0676184991243765e+01 -7.1179944803771953e+00 - 11 -2.4308670067274405e+00 -3.3248447289326091e+00 2.8133415240037296e+00 - 12 2.8237193303412664e+00 -5.9086614687477743e+00 -3.1342585243749416e-01 - 13 -1.6609055329084119e+00 1.1502077740387375e+00 -2.9812284538437752e+00 - 14 4.9864847833340420e+00 -3.1069456640509343e+00 2.6407894626498329e+00 - 15 -2.3096659810862570e+00 -7.1889956555863266e-01 2.4005929790782683e+00 - 16 6.3388015605019676e+00 -5.9323183163022204e+00 2.5107086541588584e+00 - 17 3.0224684980801002e+00 8.7577289282650828e+00 -7.8693201428206749e-01 - 18 -4.6063549496955716e+00 -4.8952117895160330e-01 -1.7876069960758847e+00 - 19 -7.6082515836661804e+00 1.7464009236580180e+00 1.7708127739610868e+00 - 20 3.2358845256701860e+00 2.8607356592741970e+00 -4.0297737600168642e+00 - 21 1.1010164765387213e+01 3.2330607311408555e+00 4.0042019178611621e-01 - 22 4.4781828869438857e-02 6.0719403319623344e-01 -5.5908241440452000e-01 - 23 3.5594522651794591e+00 8.5069620665211403e+00 -5.6129085441684339e+00 - 24 1.3556306526283137e+00 4.1895383567136788e+00 8.5123633213127070e-01 - 25 -4.7747651793878743e-01 -1.0333245427318232e+00 -7.2474339551019717e-01 - 26 -3.6774542022592964e+00 -9.7618611587187978e+00 8.5271212642003018e+00 - 27 3.4544370855467634e+00 -1.0186800522859873e+00 -2.8836655978984127e-01 - 28 -4.4586745068280216e+00 1.3021742871288211e-01 2.1159918887153317e+00 - 29 4.0230480986379309e+00 -9.9978144037769612e-02 -2.3050698755072571e-01 - 30 -6.1379468567831041e-01 -7.9222717952796513e+00 -2.6496750288296882e+00 - 31 2.6518561367509244e+00 -4.5192458764555550e+00 -2.0974012823704041e-01 - 32 -1.3592996132199600e+01 -4.4204028668149364e+00 -1.0733218324946607e+00 + 1 -9.3229246728818882e-02 4.9673054384512847e+00 1.2591800125271964e+00 + 2 -1.5712882490726656e+00 -7.5510352806699625e+00 1.1807377474189060e+00 + 3 -4.2391661910450864e+00 1.9290035832965771e+01 -3.5667149434810357e+00 + 4 1.8564945054981579e+00 1.1035150648268628e+00 -2.1866754129397797e-01 + 5 5.9567841366887722e+00 1.1709662054205069e+01 1.7546797355740575e+00 + 6 3.0284906543622450e+00 1.5827618623804345e+00 -8.3522112551985872e-01 + 7 -5.3008735163343577e+00 7.0032666571155078e+00 -9.0197890466783903e-01 + 8 -4.6482788569644118e+00 -1.2524933886127729e+00 6.9095709734040991e+00 + 9 1.3040735871340510e+00 -3.5642048992102100e+00 -2.0667534475373666e+00 + 10 -3.5083410023729744e+00 -1.2930228165539772e+01 -8.5371963051849953e+00 + 11 -2.6067502037817496e+00 -3.3037719522017839e+00 3.0049753967440878e+00 + 12 3.1330294329015982e+00 -6.9798706106839203e+00 -4.4429846383185584e-01 + 13 -1.5536708889499649e+00 1.5253391985090887e+00 -3.3085220343744384e+00 + 14 5.3289889366992167e+00 -4.0717166315562405e+00 3.7249927679152983e+00 + 15 -2.3658082493887069e+00 -6.8746635212013441e-01 2.5334337175407442e+00 + 16 8.0496233542823941e+00 -6.7781688824526087e+00 2.8141446774232248e+00 + 17 3.4569034940410632e+00 9.8153873687314110e+00 -7.0461943097149038e-01 + 18 -4.8258666981288343e+00 -4.4655093498639048e-01 -1.8624361695397951e+00 + 19 -8.3503076626910211e+00 1.7177572838375239e+00 2.1371975036587791e+00 + 20 3.2994877451206053e+00 2.8422235827548015e+00 -4.1214533278838914e+00 + 21 1.2884079592431274e+01 4.5277454441858049e+00 3.0590642298598097e-01 + 22 -2.5266820634339783e-04 5.3949765100032665e-01 -5.7239112239455903e-01 + 23 4.8100036911725974e+00 1.0567464692159545e+01 -6.0273184289658532e+00 + 24 1.5435347290494312e+00 4.2873737178397624e+00 9.4586764343865048e-01 + 25 -5.1959668388628810e-01 -1.0509635356541467e+00 -7.8052654566208612e-01 + 26 -4.8684235685964916e+00 -1.2754410056317294e+01 1.0544415924463886e+01 + 27 3.8503266913828842e+00 -9.8505147145647087e-01 -2.3610017163980102e-01 + 28 -4.5436204320865139e+00 2.3030036679871912e-02 2.3270999675191941e+00 + 29 4.1658618146103032e+00 2.0013729964932260e-02 -2.7898015670172888e-01 + 30 -8.7108483787568580e-01 -8.5865605268375749e+00 -3.1592086269263318e+00 + 31 3.1759987103168621e+00 -4.9958059621308744e+00 -2.7028793394462020e-01 + 32 -1.5977122119581539e+01 -5.5840809651778560e+00 -1.5495278100925964e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-hybrid-eam_fs.yaml b/unittest/force-styles/tests/atomic-pair-hybrid-eam_fs.yaml index 8abcdc5cc..2098f90e1 100644 --- a/unittest/force-styles/tests/atomic-pair-hybrid-eam_fs.yaml +++ b/unittest/force-styles/tests/atomic-pair-hybrid-eam_fs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 5e-12 prerequisites: ! | pair eam/fs @@ -50,41 +50,41 @@ init_forces: ! |2 30 -2.0584055270338175e+00 -5.2207163606526530e+00 -4.6304543222177532e+00 31 1.2014109675977875e+00 -6.5554529419137078e+00 2.1453874832093329e+00 32 -1.5986786450380142e+01 -5.5759911113046883e+00 -1.5504124024744577e+00 -run_vdwl: 11.4858562707976 +run_vdwl: 15.6055369596825 run_coul: 0 run_stress: ! |2- - 3.0206281119895192e+02 2.9839150289953903e+02 2.7908748751032857e+02 5.2322850515137054e+00 -4.4239479114146283e+00 -8.4608706993722507e+00 + 3.1739734448741643e+02 3.1467775824072135e+02 2.9494960877836593e+02 8.0575431550134713e+00 -4.6069278562709943e+00 -1.1484582135772436e+01 run_forces: ! |2 - 1 -1.1849858890514021e-01 4.7242432545697088e+00 1.3265451237218602e+00 - 2 -1.3250768345508559e+00 -5.3511603765145770e+00 2.1410052830224986e+00 - 3 -2.2700257027423225e+00 1.1882640655984687e+01 -2.6893578040536417e+00 - 4 9.2467426254256924e-01 4.7472136350787353e-01 -1.9054352365531899e+00 - 5 4.7363491800017670e+00 9.8438006258188651e+00 1.9732492208585084e+00 - 6 2.7680034258340784e+00 1.8171614620504244e+00 -3.6035747489478603e-01 - 7 -4.4919044715564649e+00 6.3872035608307183e+00 -8.2274250075750177e-01 - 8 -4.2041699436029045e+00 -2.4646139599222829e+00 4.0605229910239533e+00 - 9 1.4629904265694940e+00 -3.8814409140350206e+00 -2.0274374837861129e+00 - 10 -1.8917309349531379e+00 -1.0478812541228589e+01 -6.7381196596711090e+00 - 11 -2.4118490286273033e+00 -3.3214814331743030e+00 2.7677127410903135e+00 - 12 3.0519151897635446e+00 -5.7757394077502502e+00 -3.0038765160829517e-01 - 13 -1.7057375614102981e+00 1.0854340974897752e+00 -2.8355940344663870e+00 - 14 4.0183527421571297e+00 -1.2067382913714841e+00 3.2102889327660686e+00 - 15 -1.9580383412386364e+00 4.8390607508432104e-01 -7.5740122183371242e-02 - 16 6.0677348392979713e+00 -5.7378693262646001e+00 2.4974286052812276e+00 - 17 2.8547982360336568e+00 8.5493890206088938e+00 -8.4565046086350093e-01 - 18 -5.1749897015544475e+00 -4.7312180095976142e-01 -2.2371554847310056e+00 - 19 -7.1675344296007797e+00 -1.0118502862174970e+00 1.7882195840126567e+00 - 20 2.0161347706407526e+00 1.8417839323791756e+00 -2.8671273527748875e+00 - 21 1.0578411106115118e+01 3.3304963159644583e+00 7.3282301526571236e-01 - 22 1.7893814500606164e-01 -2.6448785628600362e+00 -6.3104856433780721e-01 - 23 3.5387062116822832e+00 8.2619934075188315e+00 -5.5800038194270147e+00 - 24 3.1160414704593657e+00 3.8864959234902394e+00 2.4094721723738313e+00 - 25 2.0051152564142143e+00 1.7701772456340975e-01 -1.6642079255120197e+00 - 26 -3.7855143773897071e+00 -9.1165837952426152e+00 7.9299986973321710e+00 - 27 3.3936982993989577e+00 -1.1159969847487432e+00 -1.9289487597647970e-01 - 28 -2.0849071615339776e+00 1.7673677200016646e+00 3.4512964427566213e+00 - 29 2.0695057271768094e+00 2.6685623735706621e+00 5.1113802725358676e-03 - 30 -1.6314063838809783e+00 -4.4318986602461869e+00 -3.6140235345662295e+00 - 31 6.4100992367021226e-01 -5.6703633267329838e+00 2.0418124408970137e+00 - 32 -1.3200995751217025e+01 -4.4996678461647708e+00 -9.4820264451162939e-01 + 1 -9.3675363156649233e-02 4.9683156446820016e+00 1.2592861803639455e+00 + 2 -1.4455054034808144e+00 -5.9189881901789407e+00 2.3627598062298469e+00 + 3 -3.6335550819980176e+00 1.6640731043969986e+01 -3.7672515177668968e+00 + 4 1.2975570285945408e+00 1.8327857642749620e-01 -1.9193696255475197e+00 + 5 5.9568697856339030e+00 1.1708970783386933e+01 1.7532839586937630e+00 + 6 3.0278141744951594e+00 1.5830589911529696e+00 -8.3284968452150776e-01 + 7 -5.3006954485929567e+00 7.0042396399556131e+00 -9.0219807922867623e-01 + 8 -4.6631123965561505e+00 -2.9969007459425017e+00 4.9927024944694711e+00 + 9 1.3054237880899120e+00 -3.5652680276676558e+00 -2.0665850391465463e+00 + 10 -3.5080353283325909e+00 -1.2927486696846113e+01 -8.5320931579561456e+00 + 11 -2.6065651041333546e+00 -3.3037337663667405e+00 3.0044925662679787e+00 + 12 3.1357316657204075e+00 -6.9783223880208380e+00 -4.4416054549053680e-01 + 13 -1.5542135347805459e+00 1.5243799219500502e+00 -3.3069161310970867e+00 + 14 4.7225794772749721e+00 -2.2988597160813469e+00 4.7472269899120256e+00 + 15 -2.0525269660284549e+00 7.8364424619381789e-01 -8.7489818423437515e-03 + 16 8.0459506159333838e+00 -6.7755805206443487e+00 2.8141775520134917e+00 + 17 3.4548999326351066e+00 9.8129382920367796e+00 -7.0513006960941005e-01 + 18 -5.8715051432797747e+00 -3.7461478979774360e-01 -2.6346856034674340e+00 + 19 -8.5760694586752884e+00 -1.2950255789915222e+00 2.3875585959907433e+00 + 20 2.1625900384404382e+00 1.8469924616059621e+00 -3.0753883585114385e+00 + 21 1.2879001607192773e+01 4.5288402256391889e+00 3.0964156393048370e-01 + 22 7.6224940501632199e-02 -2.9118249197213286e+00 -5.4298234463173500e-01 + 23 4.8097036272113423e+00 1.0564357455278760e+01 -6.0267754392739228e+00 + 24 3.7930654791968799e+00 4.2424438666033479e+00 2.8226927060731759e+00 + 25 2.2443138532385505e+00 4.9339178560398766e-02 -1.7959968909032658e+00 + 26 -4.8698072194951072e+00 -1.2744779059473977e+01 1.0535074393757780e+01 + 27 3.8496845459574573e+00 -9.8613335415638581e-01 -2.3503707860353917e-01 + 28 -2.0731303118863256e+00 1.8804322995270999e+00 3.9023872779217266e+00 + 29 2.3241703875241924e+00 3.0997097455004718e+00 -7.3743105303317708e-02 + 30 -2.0532096386649950e+00 -5.2131374744224726e+00 -4.6170415615663405e+00 + 31 1.1883020202007899e+00 -6.5458743547469167e+00 2.1436563939713538e+00 + 32 -1.5972276568780419e+01 -5.5851427894120409e+00 -1.5479872651281312e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-kim_lj.yaml b/unittest/force-styles/tests/atomic-pair-kim_lj.yaml index 4d3c0bc54..87d799474 100644 --- a/unittest/force-styles/tests/atomic-pair-kim_lj.yaml +++ b/unittest/force-styles/tests/atomic-pair-kim_lj.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:03:08 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 5e-13 prerequisites: ! | pair kim @@ -53,41 +53,41 @@ init_forces: ! |2 30 -3.0327485980861826e+02 -2.4995256045088931e+02 -7.3294648144296673e+02 31 -1.4519981131932030e+02 -9.6219346984929757e+02 6.2610179331203506e+02 32 -1.7547266233289331e+03 -6.1208925134474191e+02 -1.7225786789032620e+02 -run_vdwl: 8142.86347823301 +run_vdwl: 9544.77225671978 run_coul: 0 run_stress: ! |2- - 3.6512836406529568e+04 3.5682959231644767e+04 3.4412688212733083e+04 5.6189168789619612e+02 -4.2481744530021876e+02 -2.7757612048066983e+02 + 4.2681476563591095e+04 4.1812793670721279e+04 3.9208204473290876e+04 2.5418452318429695e+03 -1.1545209608755380e+02 -1.1259694382235248e+03 run_forces: ! |2 - 1 3.8311178201527490e+01 3.7585505820468717e+02 1.9757405602027183e+02 - 2 -1.1844938311612088e+02 -4.8043072698138155e+02 2.6367640059751051e+02 - 3 1.6394272961661102e+01 5.1459709359786723e+02 -2.2410940390911816e+02 - 4 -1.2123576871167595e+01 5.7230471179062107e+01 -3.6755163706867410e+02 - 5 1.9019221167642178e+02 5.9188097374321762e+02 2.5937000791455858e+02 - 6 2.7749005927676541e+02 2.7070305503307389e+02 5.4435429295621752e+01 - 7 -2.3248100140275349e+02 4.8692460296490441e+02 -9.0300509228150020e+01 - 8 -4.6217800508481992e+02 -2.4728904225365955e+02 2.4932907579824641e+02 - 9 1.3410284012343629e+02 -4.5292826338971150e+02 -2.2837675291250582e+02 - 10 1.4530863161708237e+02 -6.1548549380597399e+02 -4.4351502319678036e+02 - 11 -1.9905554659594321e+02 -3.4355930770064487e+02 2.6024953200842936e+02 - 12 2.1297433997392667e+02 -3.1511715502482247e+02 -3.7424526203262970e-01 - 13 -1.9858682569721589e+02 6.2921524082363248e+01 -1.8923705324648364e+02 - 14 3.4936578580200324e+02 1.4705518493498701e+02 1.4681698599118570e+02 - 15 -2.0809244623647521e+02 8.8205393968163847e+01 -1.7752026872007139e+02 - 16 2.4667648947202227e+02 -4.3646506456558359e+02 1.9509665141012698e+02 - 17 2.2933295377749576e+02 6.4104261620752254e+02 -1.5109148422048989e+02 - 18 -5.3873169918198187e+02 -2.1414201422664937e+02 -2.2591007177963030e+02 - 19 -5.6749230460543004e+02 -2.3262620380132645e+02 1.4653470321239266e+02 - 20 1.8566973366457043e+02 1.9886588256575220e+02 -2.5638815554492624e+02 - 21 6.4315092325143962e+02 1.1769325522370647e+02 1.5604863509821035e+02 - 22 1.0456347574328095e+02 -3.8942876050459927e+02 -1.8071881199705481e+02 - 23 6.6909907479213516e+01 3.7541449768966930e+02 -4.8604534485921107e+02 - 24 3.2350923515305857e+02 4.3061844958850605e+02 3.4567879113227229e+02 - 25 2.9838327588701031e+02 1.1949893200293532e+02 -2.0664284065675889e+02 - 26 -1.1939442342364089e+02 -4.2106384870953508e+02 4.7864310208661647e+02 - 27 2.3139600604144570e+02 -1.9507445898605204e+02 -5.7759462960585992e+01 - 28 -1.5102708891629663e+02 3.2948188463592419e+02 4.0741095434709365e+02 - 29 1.7422582608172320e+02 4.1663882828588106e+02 8.1276076778305784e-01 - 30 -1.5395003064183584e+02 -1.7108751552799220e+02 -2.7454144789634552e+02 - 31 -1.2523565393832922e+02 -5.7496227934489946e+02 3.8415001989069390e+02 - 32 -7.8115916047207691e+02 -1.3496756908539183e+02 1.4255407887805275e+01 + 1 3.7588562383278673e-01 5.5033624900811310e+02 1.3757480542836151e+02 + 2 -1.4260078405859608e+02 -5.7915683530143963e+02 3.5917194854621164e+02 + 3 -3.6202916814614576e+02 1.6691284792404499e+03 -4.4107621286123560e+02 + 4 1.4022222046056294e+02 -8.2480607484978606e+01 -3.5994248835552867e+02 + 5 6.4625891579526331e+02 1.2892459613739691e+03 1.9788858691726796e+02 + 6 3.3508367385107238e+02 1.8043256370646299e+02 -8.9568169341558175e+01 + 7 -5.8109386253887226e+02 7.7112262754974961e+02 -9.6949872382622303e+01 + 8 -5.5804831822585800e+02 -4.5631660658338217e+02 4.3037971913922007e+02 + 9 1.4088891990829663e+02 -3.9803215182572677e+02 -2.2626114395133104e+02 + 10 -3.8511963506304210e+02 -1.4164277808227780e+03 -9.4744048566906008e+02 + 11 -2.9088454212496379e+02 -3.6921144778600819e+02 3.3277577643490855e+02 + 12 3.3833253908496710e+02 -7.6889525190665017e+02 -4.8111655019585697e+01 + 13 -1.6932258479134043e+02 1.6943027018755748e+02 -3.6697011445085963e+02 + 14 4.6899348486522035e+02 -1.4553381520641443e+02 6.1215251846400008e+02 + 15 -2.4236192961921364e+02 2.4325395222849625e+02 -2.0624783120248259e+02 + 16 8.9413123494669355e+02 -7.4999901046345406e+02 3.1166497197485421e+02 + 17 3.7941297467792060e+02 1.0852886594325935e+03 -7.3393476125030915e+01 + 18 -1.3705625293409923e+03 -4.0919203729189530e+02 -6.1451567343704528e+02 + 19 -1.4558839067656993e+03 -8.3359345533120495e+02 2.9587160203058738e+02 + 20 1.7522692875288274e+02 1.4576446283459254e+02 -2.7885539601278447e+02 + 21 1.4183060839370312e+03 4.9871615972784684e+02 3.1831329285360649e+01 + 22 4.0905347626156860e+01 -5.9301531814597399e+02 -1.1490661869148970e+02 + 23 5.2200779255919781e+02 1.1603423280101097e+03 -6.6705056605806942e+02 + 24 1.2501860737077111e+03 8.9819241281734560e+02 7.3921633155912718e+02 + 25 5.4052464374878912e+02 -6.1252810216968889e+00 -3.8029531542737573e+02 + 26 -5.3254539256578278e+02 -1.4042399624664633e+03 1.1606879497016591e+03 + 27 4.2237133187884189e+02 -1.0399838526722216e+02 -2.3116899385300904e+01 + 28 2.8524183184990079e+01 5.0568186638847976e+02 6.2770990579393822e+02 + 29 5.5191128262772963e+02 9.7352609801905567e+02 -2.3120022741566515e+01 + 30 -3.0327479167188972e+02 -2.4995217488115551e+02 -7.3294627704592688e+02 + 31 -1.4520372559381914e+02 -9.6219550115395964e+02 6.2610222185535997e+02 + 32 -1.7547323467309429e+03 -6.1209646758442068e+02 -1.7225944897200438e+02 ... diff --git a/unittest/force-styles/tests/atomic-pair-meam_c.yaml b/unittest/force-styles/tests/atomic-pair-meam_c.yaml index 7e5e04f25..976bd6a08 100644 --- a/unittest/force-styles/tests/atomic-pair-meam_c.yaml +++ b/unittest/force-styles/tests/atomic-pair-meam_c.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 23:07:41 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 1e-14 prerequisites: ! | pair meam/c @@ -52,41 +52,41 @@ init_forces: ! |2 30 7.7479118765962562e-01 -2.0113378117527199e+00 -1.1752517279578472e+00 31 -3.0187614250981643e-01 -1.9390174634551343e+00 1.0383705899546767e+00 32 -1.2004071740323694e+00 -1.7334188099495886e+00 -2.1413667718607474e+00 -run_vdwl: -46.2140181358044 +run_vdwl: -45.2391567908444 run_coul: 0 run_stress: ! |2- - 1.6157965789097213e+02 1.6428652881157308e+02 1.6336882710875963e+02 2.6492515508164325e+00 1.2241232984533445e+01 5.5190034161221986e+00 + 1.5974816998957081e+02 1.6797053429091017e+02 1.6585129043852777e+02 5.1231901045278549e+00 1.6504160483904446e+01 5.0433930663133388e+00 run_forces: ! |2 - 1 1.4856594142247812e+00 1.3639636325981797e+00 -5.0378084014868607e+00 - 2 1.8182339780431884e+00 -9.3557071728214447e-01 -2.4867456758182305e-02 - 3 5.7250604322168730e-01 3.2882383721502992e+00 -3.7188062637281187e+00 - 4 -6.8842242815074728e-01 -7.0037406395340751e-01 2.5760654039513100e+00 - 5 -1.9571913004063546e+00 -1.3233213413526190e-01 -2.2438965612657222e+00 - 6 -1.8651742326227614e+00 -4.8468578333404022e-01 -2.7911772077644054e-01 - 7 -4.9442152738943967e-01 -1.1681880069672819e+00 -2.5352798491056787e+00 - 8 1.2592765155128149e+00 1.6750866848292199e+00 2.5314611372610711e+00 - 9 -2.2700899303104660e+00 -8.4610037647594505e-01 -8.2197247669596041e-01 - 10 -5.2603756313602101e-01 6.2537262007466055e-01 -1.9938738261140956e+00 - 11 1.1059566338684506e+00 -2.2783517227894436e+00 1.0378519836841325e+00 - 12 1.9951410121761808e+00 -8.4076225829238926e-01 2.5198765202805182e+00 - 13 -1.2827079396195376e+00 -4.5345205763719831e-01 3.4438478269172363e+00 - 14 -4.0464108837820074e+00 -3.1923972207510523e+00 -7.0213605672060275e-01 - 15 4.0025802133057873e+00 -1.1037617051241588e+00 -5.1588391805876399e-01 - 16 1.5914921042116810e+00 9.2030995037334684e-01 -2.6802819182474624e+00 - 17 -1.8579518052232831e+00 1.8118983771861097e+00 5.0819971752277970e+00 - 18 -4.0909796680192629e+00 -2.7591189183791348e-01 -1.0244288001425377e+00 - 19 2.6751234596394475e+00 2.7609078952528736e+00 4.1514114372642821e+00 - 20 2.8481426512553898e+00 2.6986776328520237e+00 4.4898740316194086e-01 - 21 -1.9437192711372819e+00 1.4091280032018816e-01 2.2644003119896792e+00 - 22 1.8254191352777844e+00 3.0719235358584487e+00 4.5017211622441650e-01 - 23 -2.1601694180228566e+00 1.7902617251951618e+00 2.9533619495614762e+00 - 24 2.7895842030434230e+00 3.1722014317841833e+00 -1.7741293715364701e+00 - 25 -3.2638233897322499e+00 -3.4166001227605443e+00 1.3985431577184873e+00 - 26 -9.1990767101326454e-01 -9.5724178802139537e-01 1.7064137001271595e+00 - 27 -6.0383554598036171e-01 -1.4527794131550307e+00 -6.9700493107515060e-01 - 28 2.7707447808728909e+00 -4.4730551568202004e-01 -3.0908506243192981e+00 - 29 1.1100695379735015e+00 9.1855343597532213e-01 -5.7797940973864115e-01 - 30 9.7770736173486794e-01 -2.4773587643325179e+00 -1.2193288328217222e+00 - 31 -5.9510700882663636e-02 -1.7259733398300987e+00 1.0959471485608105e+00 - 32 -7.9728376893331943e-01 -1.3491612120881715e+00 -2.7226908533386083e+00 + 1 1.5522958093651915e+00 1.0615499655473433e+00 -4.8771821807418485e+00 + 2 1.8973724991949517e+00 -9.6465336157461035e-01 2.5916704629391041e-01 + 3 3.8034122964525019e-01 3.5452884732563450e+00 -3.6139523730420851e+00 + 4 -1.1892033063776144e+00 -8.6893150111448980e-01 3.2303123556435636e+00 + 5 -2.0069746736860914e+00 -2.1551866770104500e-01 -2.5800308573392057e+00 + 6 -1.9262772641522954e+00 -6.5112124241466596e-01 -5.0650473098597582e-01 + 7 -4.2887113032606522e-01 -1.0929393617614069e+00 -2.9716499095267266e+00 + 8 1.3272509935252343e+00 1.8075298869656615e+00 2.6876530868505122e+00 + 9 -2.4863439559997147e+00 -5.8229036107332555e-01 -1.0184569767619536e+00 + 10 -4.9328393652926650e-01 6.0906915277191986e-01 -1.9720253397318523e+00 + 11 1.1571995663004178e+00 -2.6004228250959609e+00 1.1844562933907317e+00 + 12 1.9797530074668792e+00 -1.0759971829258270e+00 2.3843637536861060e+00 + 13 -1.2351306317703690e+00 -4.8946891762142453e-01 3.2699721216517554e+00 + 14 -3.4969251749453769e+00 -2.9253406812100771e+00 -8.5880267585552172e-02 + 15 4.7595054404358699e+00 -1.3946859094207447e+00 -7.0577550403088818e-01 + 16 1.6064644243575112e+00 1.0403003076596826e+00 -2.8835993747035298e+00 + 17 -1.4424018061699417e+00 2.1565350201536018e+00 4.7035848736272214e+00 + 18 -4.3776340389547483e+00 -6.0164554901304146e-01 -1.3176481609134063e+00 + 19 3.0032627207090075e+00 3.4652228503210889e+00 4.4659383717609629e+00 + 20 3.0109704796506285e+00 2.9243985271359469e+00 3.1112282185951651e-01 + 21 -3.1124737723479008e+00 -6.0197145013086062e-01 2.9489316729846107e+00 + 22 2.3129005383095507e+00 4.1794011071000359e+00 1.0844810754934946e+00 + 23 -2.1122780126283778e+00 1.4303835656135215e+00 2.3599538159734594e+00 + 24 3.1292175201621695e+00 3.0814827648779497e+00 -2.4360779908374615e+00 + 25 -3.8993420842654669e+00 -3.7728747006486945e+00 1.5544438528411257e+00 + 26 -3.5928828751391539e-01 -9.4221235312628893e-01 1.2058127314018361e+00 + 27 -5.4113410432517139e-01 -1.4473629388249933e+00 -6.7474700873946114e-01 + 28 2.3893959574061734e+00 -4.6586517285280549e-01 -3.3549876902305158e+00 + 29 1.3227714518441580e+00 1.0846612642848170e+00 -3.5694184128593764e-01 + 30 7.7811759130183367e-01 -2.0243118267359028e+00 -1.1786433832619818e+00 + 31 -3.0383843912651598e-01 -1.9398913309613246e+00 1.0394092650479267e+00 + 32 -1.1954186105559983e+00 -1.7283175514804292e+00 -2.1554995487883564e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-meam_spline.yaml b/unittest/force-styles/tests/atomic-pair-meam_spline.yaml index 26b41e324..68ac2d016 100644 --- a/unittest/force-styles/tests/atomic-pair-meam_spline.yaml +++ b/unittest/force-styles/tests/atomic-pair-meam_spline.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 14:45:37 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 1e-14 prerequisites: ! | pair meam/spline @@ -51,41 +51,41 @@ init_forces: ! |2 30 2.0771077210589186e+00 -4.6709171948180614e+00 1.3782704353736193e+00 31 1.4867111163388858e+00 2.4196890137058618e+00 -1.3329156106123738e+00 32 4.0861876180074033e+00 5.5424831866167956e-01 -2.5681732500505770e+00 -run_vdwl: -136.927175193919 +run_vdwl: -135.569915239339 run_coul: 0 run_stress: ! |- - -1.3790554770531864e+02 -1.4796019532345704e+02 -1.2695822186179616e+02 -9.5340055843860583e+00 -2.3259375412442342e+01 3.8153285115911913e+01 + -1.3297571706861984e+02 -1.4278817708715408e+02 -1.2149323096249972e+02 -9.2133160597589718e+00 -2.3180777117992285e+01 3.4338894527841632e+01 run_forces: ! |2 - 1 3.5086034357051035e+00 -1.3832098977035816e+00 -2.9787172241828053e-01 - 2 -8.7858901832133629e-01 1.4730792686369756e+00 1.4153652084673130e+00 - 3 6.8100489528455221e-01 7.2977966248387949e+00 3.5755634726044123e+00 - 4 1.4894246482548736e+00 1.4837422363790622e+00 -4.8420669124828430e-01 - 5 -2.7311699606192517e+00 -3.0295874055286465e+00 1.1967774866963374e+00 - 6 9.0433413753708192e-01 1.5868295885240083e-01 -8.5209508637998099e-01 - 7 -2.2159826213221945e-01 -4.5287706057643834e-01 -5.3889815621402271e-02 - 8 -3.2299490267459032e+00 2.7823585498004735e+00 8.0777049450167071e-01 - 9 -3.0584937569863331e+00 -9.6460940939188666e-01 1.6618649317157125e-01 - 10 5.4463521755389577e-01 -9.3292969426617631e+00 2.2564374299897118e+01 - 11 -1.3821675333932457e+00 4.9814974894668262e+00 -6.8153507629670305e+00 - 12 -5.5693958122685128e-02 1.2715998886193272e+00 -2.1630025905480759e+00 - 13 4.5968795792006079e+00 -5.1344654486065462e+00 3.9250553951483103e-01 - 14 2.1392341081356485e+00 -1.1655861959252005e+00 5.4751786756477794e-01 - 15 1.7341412670432161e+00 1.8141556098674534e+00 7.0431414285193017e-01 - 16 -8.3661133989893806e+00 2.3420276938987352e+00 -7.6016111470017300e+00 - 17 3.6529145482632686e-01 1.6607714094667467e-01 -1.6987229721114327e-01 - 18 7.1136628052133144e-01 -4.3734709654417045e+00 -3.2252028703549707e-02 - 19 -5.9370792180259202e-01 4.1384504925870580e+00 -5.7998200472271533e-01 - 20 2.6139308615581283e+00 1.0405203043498585e+00 -9.3957785224592849e-01 - 21 -1.5592763831709282e+00 3.5863015093644302e-01 -1.0006375436715582e+00 - 22 5.6184017734039782e-01 4.0653913071954220e+00 -2.3860701609019110e+00 - 23 1.4501358996036311e+00 6.0018801823265544e-01 1.2822873275571993e+00 - 24 -1.7390705727825817e+00 -1.3002893598605003e-01 -5.4124617185211998e-01 - 25 -1.1116754512747864e+00 9.3582649044762345e-01 -9.5815952070152677e-01 - 26 1.1835123448107867e+00 -2.9187864345943404e-01 1.5069565888166874e+00 - 27 -6.7062583941809095e-01 -3.2630956893194272e+00 -3.7144673843698044e+00 - 28 -5.5537435362925693e+00 -2.5716494416180469e+00 -4.4918650660397241e-01 - 29 1.4097795894076732e+00 -9.4764440427736352e-01 -2.3971019891811221e+00 - 30 1.9017154117916961e+00 -4.6838293532123672e+00 1.1080544795378526e+00 - 31 1.5146769796445219e+00 2.2924358188600724e+00 -1.4564208222136106e+00 - 32 3.8413683318324394e+00 5.1876974979260093e-01 -2.3746713026179731e+00 + 1 3.4622686676410730e+00 -1.2649224073076546e+00 -3.3121203222176243e-01 + 2 -8.7178434879687383e-01 1.6526186430041809e+00 1.4262951514108271e+00 + 3 6.4908634016554478e-01 7.3393143331459134e+00 3.7438039754644121e+00 + 4 1.4613573821476731e+00 1.3728058714659175e+00 -4.5616699418782725e-01 + 5 -2.7145431009835552e+00 -2.9228339321156382e+00 1.1759197752984312e+00 + 6 8.9024064814298964e-01 1.8839427035472422e-01 -8.3918470932323430e-01 + 7 -9.1430345776695399e-02 -4.0773010786306618e-01 -5.7364781799506881e-02 + 8 -3.2869889480487857e+00 2.6289139722549724e+00 8.1190437244355707e-01 + 9 -3.1449921734381538e+00 -1.1405842338590784e+00 1.7824798508888764e-01 + 10 1.7097698589782406e-01 -7.6310006136719393e+00 1.9578608060298365e+01 + 11 -1.2281006321822896e+00 3.0802313608203686e+00 -5.5281310042687126e+00 + 12 -5.9361397455084830e-01 1.2992105035943169e+00 -1.4717754118787600e+00 + 13 4.4937100412216031e+00 -5.2862814368126072e+00 4.6356778630706585e-01 + 14 2.3905631744402838e+00 -1.3793799080625624e+00 5.7426895046045834e-01 + 15 1.7246396055984641e+00 1.8160429266671745e+00 6.2809474474824634e-01 + 16 -7.5767875308849328e+00 2.5842725784325520e+00 -7.1159584988046563e+00 + 17 3.6479438909911299e-01 1.2870091544904574e-01 -6.2715180822890293e-02 + 18 6.8923032382585570e-01 -4.5629057722893318e+00 1.3948825050359703e-01 + 19 -5.6567826153431777e-01 4.3768827702722737e+00 -6.4549221034261872e-01 + 20 2.6207976008375073e+00 1.1287843258798875e+00 -1.0105367858840515e+00 + 21 -1.6360156626252302e+00 3.3683416357147966e-01 -9.8487700820392243e-01 + 22 5.4962178844885012e-01 4.0041934057724333e+00 -2.4099736413866695e+00 + 23 1.4558916519768299e+00 6.4961037355101725e-01 1.1960691905495928e+00 + 24 -1.7726134927308221e+00 -1.8199204832528593e-01 -5.6636713310295461e-01 + 25 -1.0796556253638707e+00 9.4549769617994861e-01 -7.9550097477574266e-01 + 26 1.1691750269469272e+00 -2.9369663818367092e-01 1.2536063951768774e+00 + 27 -7.0635872146582712e-01 -3.1701807298823463e+00 -3.5897091108865142e+00 + 28 -5.7587592673895474e+00 -2.6868347143683855e+00 -5.5666191622674466e-01 + 29 1.2878195908085917e+00 -9.0624695596530269e-01 -2.2257426165959235e+00 + 30 2.0779535720344127e+00 -4.6704338990675156e+00 1.3779919079770058e+00 + 31 1.4868847556098141e+00 2.4204392559624290e+00 -1.3331491771980268e+00 + 32 4.0823105409284093e+00 5.5227603139573811e-01 -2.5673473578168333e+00 ... diff --git a/unittest/force-styles/tests/atomic-pair-meam_sw_spline.yaml b/unittest/force-styles/tests/atomic-pair-meam_sw_spline.yaml index 255a424c9..44f580f43 100644 --- a/unittest/force-styles/tests/atomic-pair-meam_sw_spline.yaml +++ b/unittest/force-styles/tests/atomic-pair-meam_sw_spline.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 16:07:01 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 1e-14 prerequisites: ! | pair meam/sw/spline diff --git a/unittest/force-styles/tests/atomic-pair-momb.yaml b/unittest/force-styles/tests/atomic-pair-momb.yaml index 5ffcd66ea..00ae66c4e 100644 --- a/unittest/force-styles/tests/atomic-pair-momb.yaml +++ b/unittest/force-styles/tests/atomic-pair-momb.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 23:12:52 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 7.5e-13 prerequisites: ! | pair momb @@ -49,41 +49,41 @@ init_forces: ! |2 30 -1.2442109923751410e-01 -1.0770559238740045e+00 3.1395720300646190e-02 31 9.2984933250948032e-02 -1.8228335119987582e+00 2.3781726323623342e-01 32 -1.2461785964541576e+00 -5.4977549941894166e-01 8.3509737369560444e-01 -run_vdwl: -10465.8413515726 +run_vdwl: -10465.7423386717 run_coul: 0 run_stress: ! |- - -4.5989233668382385e+03 -4.6177593858915625e+03 -4.5916090651558889e+03 -1.2424092403563131e+01 1.7013964296464619e+00 6.0883467998381882e+00 + -4.5988993884891906e+03 -4.6177101080149896e+03 -4.5915627861079975e+03 -1.2437349307689638e+01 1.7003970965698816e+00 6.1002478300203276e+00 run_forces: ! |2 - 1 8.4198470261117553e-01 1.0153495574291247e+00 1.7109382518035801e-01 - 2 -7.5121877876583198e-02 -4.2599241104886904e-01 -8.6759570697158850e-01 - 3 3.5109795430827972e-01 1.0554625279207510e+00 -9.3619509195423056e-02 - 4 2.6603839528621798e-01 3.7705754918199963e-01 -1.3754693375524463e+00 - 5 -3.0787081742576916e-01 8.8121003888242377e-01 1.9777634557418011e-01 - 6 1.0754370880706272e+00 8.0221206313288329e-01 8.2390365792648668e-01 - 7 -1.4651008878030467e+00 1.0251960234129998e+00 1.3423583770802772e-01 - 8 4.2434589944626921e-01 8.3345075328014406e-01 5.1695521054053040e-01 - 9 -7.1259951171871627e-01 1.3056481375742440e-01 9.0292748502409603e-01 - 10 -6.5167477715725042e-01 -7.5857941464851120e-01 -4.8021121605168471e-01 - 11 1.9524022840020550e-01 -5.7633411994189432e-01 -3.7973448238338792e-01 - 12 -1.5231933195347258e-01 -1.2979327896885220e+00 3.1453938186377167e-01 - 13 1.8666934031186244e-01 1.2455281419832276e-01 -2.4918431158046606e-01 - 14 1.7288478568433234e+00 -6.6113176993529432e-01 5.3385579950234741e-01 - 15 -2.1851787444122728e-01 8.6346309678063560e-02 1.7041477649682801e-01 - 16 -5.9283560495212839e-01 -1.7629532546911051e+00 5.7747674641375735e-01 - 17 4.3813648675524464e-01 8.9656404881989582e-01 -1.8729024673962713e-01 - 18 -5.3745774232159960e-01 -8.4673884619545414e-01 -4.9003012388987433e-01 - 19 -6.0675027995629449e-01 1.1850584311977785e-01 -1.0446438035139618e+00 - 20 -4.5955083662432461e-01 1.1271366203863276e+00 8.7684749874699341e-01 - 21 1.8475659619245270e+00 1.0215600467704133e+00 -2.3366290246952381e-01 - 22 2.3634732874719688e-01 -7.5392745105157255e-01 -5.9560685383164857e-01 - 23 -1.8608799981202040e-01 2.0353606582114496e+00 -7.2750273667878607e-01 - 24 -3.2934621066742054e-01 3.5421377395063525e-01 -6.4513335361209467e-01 - 25 2.8068933312682143e-01 -3.8182835613705779e-01 -6.9205971304404967e-01 - 26 -1.1095562207158949e-01 -2.2358392051100626e+00 3.3344451201899439e-01 - 27 -1.2604476976770549e+00 -9.4591645833246396e-01 5.9136075442175340e-01 - 28 7.6604686124433385e-02 9.6346014894391985e-01 9.8202499581798364e-01 - 29 9.9823803412371959e-01 1.1727027000745527e+00 -1.6263664034530079e-01 - 30 -1.1429934926123231e-01 -1.0192015638725889e+00 5.1995009168094408e-02 - 31 6.2732878272861115e-02 -1.7944772843437771e+00 2.2916661162999974e-01 - 32 -1.2290397526330565e+00 -5.6005336615393952e-01 8.1636248982564741e-01 + 1 9.1196760787711062e-01 1.0618029966797256e+00 1.8497223590363041e-01 + 2 -6.9327778325295242e-02 -4.2996763177217556e-01 -8.6490996161293765e-01 + 3 3.9521261682771325e-01 1.1152337176930693e+00 -7.2806932546176206e-02 + 4 2.4440120794567832e-01 3.6518442807328055e-01 -1.4299798956737853e+00 + 5 -3.1494041267997019e-01 9.2737530123628797e-01 2.0595358644956363e-01 + 6 1.1044747975984253e+00 8.1636200155687433e-01 8.5489496270742693e-01 + 7 -1.4902416492575252e+00 1.0118672808203828e+00 1.6760348735875075e-01 + 8 4.6736698947297839e-01 8.6961980158869423e-01 5.1111984107327113e-01 + 9 -7.4199071293315821e-01 1.6905855541320808e-01 9.4993985583297424e-01 + 10 -6.7858779406584446e-01 -7.7160209321143203e-01 -5.1778518243268135e-01 + 11 2.0128666246568017e-01 -5.5126319834522519e-01 -3.7387846966855243e-01 + 12 -1.6147724691444321e-01 -1.3244371432095576e+00 3.1544612621324519e-01 + 13 1.9303413241916090e-01 1.3622349509996434e-01 -2.9018896660149407e-01 + 14 1.7449943696942150e+00 -7.1803432032703907e-01 5.6460293792016802e-01 + 15 -2.2473044632263672e-01 8.0444786280617131e-02 1.4328365798233045e-01 + 16 -5.5303772976991894e-01 -1.8099193154902946e+00 6.1863374529065007e-01 + 17 4.1898022945089641e-01 9.1748334807805598e-01 -2.0396337063386055e-01 + 18 -5.5293023039747524e-01 -8.6390570586034476e-01 -4.6178432247699330e-01 + 19 -6.3041852517104147e-01 1.4711856152516289e-01 -1.0266801526406457e+00 + 20 -4.5478707065709534e-01 1.1343387732348016e+00 8.9286297100336498e-01 + 21 1.8688420122356959e+00 1.0737300663923035e+00 -2.2929845883545408e-01 + 22 2.1280888577611812e-01 -8.0199928380277985e-01 -6.4594715784848722e-01 + 23 -2.1430575260977758e-01 2.0546423436260062e+00 -7.7931322217098842e-01 + 24 -3.2572260960853328e-01 3.6726771636950772e-01 -6.6887472125331104e-01 + 25 2.5830966853659554e-01 -4.1744612624086086e-01 -7.1400616034638764e-01 + 26 -1.4107704730754023e-01 -2.2934106752857870e+00 3.3607980121876668e-01 + 27 -1.3082236318217788e+00 -9.7973756238465093e-01 6.4017687341237917e-01 + 28 7.8633245676446251e-02 9.7396811755446500e-01 9.9141005939797822e-01 + 29 1.0424349797127341e+00 1.1880178773005490e+00 -2.0234801119816881e-01 + 30 -1.2395311415688148e-01 -1.0730493544634545e+00 3.3112507537253255e-02 + 31 9.0045304988793262e-02 -1.8231341288549574e+00 2.3742513074004279e-01 + 32 -1.2470409586792943e+00 -5.5183262927438381e-01 8.3424720589813095e-01 ... diff --git a/unittest/force-styles/tests/atomic-pair-polymorphic_eam.yaml b/unittest/force-styles/tests/atomic-pair-polymorphic_eam.yaml index 4ac11509e..de8091201 100644 --- a/unittest/force-styles/tests/atomic-pair-polymorphic_eam.yaml +++ b/unittest/force-styles/tests/atomic-pair-polymorphic_eam.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:23 202 epsilon: 1e-12 prerequisites: ! | pair polymorphic @@ -52,41 +52,41 @@ init_forces: ! |2 30 -1.1772953098090733e+00 3.5197586410261525e+00 -3.5507225884796605e+00 31 6.9641430977980212e-01 -2.4233846293906267e+00 1.1255702676228792e+01 32 -8.7713084366180301e+00 3.3637284067716072e-01 5.2446663030603202e-01 -run_vdwl: -114.579218859094 +run_vdwl: -112.561397617355 run_coul: 0 run_stress: ! |2- - 1.2682783976501629e+02 1.2273466726841482e+02 1.2679647640259789e+02 1.2775833963287322e+01 -1.1864416554153783e+00 -7.7826768849259231e+00 + 1.3369777615744354e+02 1.3004752994085680e+02 1.3320208526824615e+02 1.3747668586704531e+01 -5.2218775435270448e-01 -8.4749563526951750e+00 run_forces: ! |2 - 1 4.3104820933110216e-01 -2.6368885400461839e-01 6.0881198145076927e-02 - 2 -1.1289422736647199e+00 -8.0921577037559367e-01 1.8152658202464940e+00 - 3 -3.1621474806768193e+00 5.2930284092497768e+00 -1.7015133774218951e+00 - 4 3.3538324650551039e+00 -4.4992140684738446e+00 -3.4606966129033019e+00 - 5 -1.3177311901465094e+00 8.5257263853703158e-01 5.0228895435624199e-01 - 6 -1.3876886373523303e+00 4.5387290626449639e-01 1.8317734815991413e+00 - 7 -1.5987451653319409e+00 2.7413942248593166e+00 -2.1168147897998852e+00 - 8 -2.2254562718397524e+00 -7.0577940840175080e+00 -3.0962690738540943e+00 - 9 7.1590051950955458e-01 -4.2103946884691956e-01 -1.1456141506066282e+00 - 10 -7.0101615323216615e-01 -1.3515941554175164e+00 -3.3293577876623597e+00 - 11 -2.1929239154433446e+00 -5.3928826149999021e-01 -6.0654499237996318e-01 - 12 3.5731246168602149e+00 -2.3462802672495844e-01 -1.8060184232978318e+00 - 13 5.3833905841821170e-02 1.8745491522866751e+00 -2.6359286367580852e+00 - 14 1.4992490201053872e+00 -1.8390091571631242e+00 5.6335813085637065e+00 - 15 -1.4629310401742095e+00 5.0304022223617570e+00 -7.3851813747064234e+00 - 16 3.2520318780195163e+00 -1.5996393571100542e+00 -1.5067493862673176e+00 - 17 2.8445091823292974e+00 2.0789765810758944e+00 1.3134516493575699e+00 - 18 -1.2358313574771616e+01 -3.6529012493973747e+00 -5.5079972779843223e+00 - 19 -5.7274233665183294e+00 -7.3163054105423857e+00 1.5641743686962271e+00 - 20 3.4092304692375435e+00 -2.0427196989538072e+00 1.1275332681388128e+00 - 21 2.4145324622622071e+00 2.5215587904387955e+00 2.8706167158401157e+00 - 22 1.0896911108801459e+00 -1.0787930676808893e+01 -8.1418001542183371e-01 - 23 1.2261863045347119e+00 5.2282462258487570e+00 -1.2811265120115127e+00 - 24 8.5071019627289477e+00 1.8102333582834893e+00 7.9697162151700791e+00 - 25 1.1168485829416628e+01 4.7097483866175471e+00 4.4664623989799684e-01 - 26 -2.0718724043183725e+00 -3.5926178393787467e+00 3.8320270066646733e+00 - 27 1.1087347847647036e+00 7.6622506480526842e-01 5.3675592400142980e-01 - 28 -1.1362727186873163e-01 1.0342403636003235e+00 -6.9515254620422950e-01 - 29 -5.1151379646253270e-01 1.0538375334834587e+01 -2.8672542718355953e-01 - 30 -1.0980785799734369e+00 3.1399692933387495e+00 -3.0791049438024598e+00 - 31 7.4624042429388004e-01 -2.3900962747552450e+00 1.0373889218509238e+01 - 32 -8.3353220233959657e+00 3.2428940106811888e-01 5.7637395907890621e-01 + 1 5.0396259885197514e-01 -2.2262529064903203e-01 8.2292633144598004e-02 + 2 -1.1752759366285856e+00 -7.4133184308735811e-01 1.9484764113292306e+00 + 3 -3.3972495220596737e+00 5.7563277011972032e+00 -1.7822230069833129e+00 + 4 3.5910497819252849e+00 -4.8514176759041856e+00 -3.7068971625102423e+00 + 5 -1.3961136778694081e+00 9.0262473991038972e-01 5.1487266282865507e-01 + 6 -1.4985650101945092e+00 4.6217012942283808e-01 1.7909021779056034e+00 + 7 -1.6534133639793331e+00 2.7335352397612032e+00 -2.1055074693428240e+00 + 8 -2.2507003037921343e+00 -7.4039470389228352e+00 -3.3578370006998357e+00 + 9 6.5550227617588552e-01 -4.1113851667205570e-01 -1.0784562422333035e+00 + 10 -7.5886296269476761e-01 -1.4840718417519412e+00 -3.5637965257517301e+00 + 11 -2.2480872315317617e+00 -5.3309201200976641e-01 -5.8192884688055213e-01 + 12 3.6100527824238444e+00 -2.9376860991841258e-01 -1.8554573174458706e+00 + 13 9.2670458556225799e-02 1.9423514628858551e+00 -2.7195451050286668e+00 + 14 1.6070281856136417e+00 -2.1316378912186362e+00 5.9237471399162374e+00 + 15 -1.6573910458319150e+00 5.5248934252393420e+00 -8.0301993792534088e+00 + 16 3.5668085923229786e+00 -1.7579783014441719e+00 -1.5179125861386751e+00 + 17 2.8953712183402964e+00 2.1393480975687935e+00 1.3445486729725251e+00 + 18 -1.3669143484635145e+01 -4.0225901086221505e+00 -6.2531347002727404e+00 + 19 -6.3222805686621069e+00 -8.1503642806153778e+00 1.6346314894193827e+00 + 20 3.5391377485276072e+00 -2.1298379401591117e+00 1.2496083527576780e+00 + 21 2.5644796558264438e+00 2.6367403125774955e+00 2.9819408468845565e+00 + 22 9.2853188918867413e-01 -1.1755383944098975e+01 -6.4798643334796824e-01 + 23 1.2991417881296388e+00 5.5083575602485970e+00 -1.4504181180347235e+00 + 24 9.8249057865497225e+00 2.0688913867109906e+00 8.7568532449126515e+00 + 25 1.2094080839504690e+01 5.0761908746485274e+00 5.5551465207235773e-01 + 26 -2.1574906400925413e+00 -3.9454098299655374e+00 4.1508275650315465e+00 + 27 1.0941632378663124e+00 8.6610996919432182e-01 5.7452859594600814e-01 + 28 -9.4213644131153060e-02 1.0518784799995187e+00 -7.1975755377961048e-01 + 29 -3.3454865188278154e-01 1.1743455262903380e+01 -3.6211982591997532e-01 + 30 -1.1769394280323107e+00 3.5180656708783040e+00 -3.5456714284917923e+00 + 31 6.9233177584866690e-01 -2.4276408190309331e+00 1.1246670338253619e+01 + 32 -8.7689431436337593e+00 3.3129563092370934e-01 5.2343391874058709e-01 ... diff --git a/unittest/force-styles/tests/atomic-pair-reax_c.yaml b/unittest/force-styles/tests/atomic-pair-reax_c.yaml index 15f7bf02a..4f7a6b528 100644 --- a/unittest/force-styles/tests/atomic-pair-reax_c.yaml +++ b/unittest/force-styles/tests/atomic-pair-reax_c.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:35:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:24 202 epsilon: 7.5e-12 prerequisites: ! | pair reax/c diff --git a/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml b/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml index 7d549efc1..90bfd15f3 100644 --- a/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml +++ b/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:41:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:25 202 epsilon: 1e-10 prerequisites: ! | pair reax/c diff --git a/unittest/force-styles/tests/atomic-pair-reax_c_noqeq.yaml b/unittest/force-styles/tests/atomic-pair-reax_c_noqeq.yaml index 511bc012f..32a75749b 100644 --- a/unittest/force-styles/tests/atomic-pair-reax_c_noqeq.yaml +++ b/unittest/force-styles/tests/atomic-pair-reax_c_noqeq.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:30:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:26 202 epsilon: 5e-13 prerequisites: ! | pair reax/c diff --git a/unittest/force-styles/tests/atomic-pair-table_bitmap.yaml b/unittest/force-styles/tests/atomic-pair-table_bitmap.yaml index 85f3fdb7d..d4401d689 100644 --- a/unittest/force-styles/tests/atomic-pair-table_bitmap.yaml +++ b/unittest/force-styles/tests/atomic-pair-table_bitmap.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-13 prerequisites: ! | pair table @@ -49,41 +49,41 @@ init_forces: ! |2 30 -4.2584465166652936e-02 -3.0054615946788474e-02 -8.4428957096643942e-02 31 -2.0649926244740491e-02 -1.1590442114762316e-01 7.4794527710849712e-02 32 -1.9354598378544019e-01 -6.3287613853627508e-02 -2.2278111493111191e-02 -run_vdwl: 1.66741314145205 +run_vdwl: 1.66856268800034 run_coul: 0 run_stress: ! |2- - 6.1931374572792954e+00 6.0579168006450157e+00 5.8831944925174655e+00 2.0546568651742717e-01 -2.2310825568610582e-02 -9.0786598388712531e-02 + 6.1952311663382620e+00 6.0614392437022566e+00 5.8875647278117054e+00 2.0717006197774884e-01 -2.1333105104445964e-02 -8.9586451595579902e-02 run_forces: ! |2 - 1 1.0245582840443836e-02 6.5151854710940468e-02 1.3361955389177321e-02 - 2 -2.2314027604621318e-02 -7.7535528641419729e-02 4.9002169116395371e-02 - 3 -3.9051836443840873e-02 1.8729640241706769e-01 -5.0368800191922920e-02 - 4 2.1556848319449432e-02 -9.6560257281038397e-03 -5.2226270227499996e-02 - 5 5.5692513794487093e-02 1.4100131039803696e-01 3.6433829498680612e-02 - 6 4.2104114940438239e-02 2.9061099461956740e-02 -8.0757486645345530e-03 - 7 -6.4974396400004103e-02 9.0834827653364231e-02 -1.1497303228903639e-02 - 8 -6.9891945210390563e-02 -6.1365585968288172e-02 4.5058971443054034e-02 - 9 1.5494788785065767e-02 -5.6313873741252601e-02 -2.9239516346795842e-02 - 10 -3.0025791257554668e-02 -1.4356984394446920e-01 -1.1248096343757182e-01 - 11 -4.0162199915935268e-02 -5.1244062549941558e-02 4.2120428458812920e-02 - 12 3.2219067015055440e-02 -8.8023947653775636e-02 -4.0000605662452050e-03 - 13 -1.9322021317182518e-02 2.3705996957186400e-02 -4.6458078927757253e-02 - 14 5.7515188139881337e-02 -1.5720861856457415e-02 6.8903466211661560e-02 - 15 -3.1550376834563972e-02 3.2004964657920229e-02 -2.7509931415147928e-02 - 16 1.0690614440695038e-01 -9.0850865144888507e-02 3.6425761956666795e-02 - 17 4.4576246121271583e-02 1.3023640557355332e-01 -7.6587762084134013e-04 - 18 -1.4790335009012934e-01 -3.4561193108141076e-02 -7.1476252590456105e-02 - 19 -1.5517474793926253e-01 -8.1735148865468926e-02 3.6534263240961207e-02 - 20 2.3564800733902859e-02 2.0130469558539449e-02 -3.4093822740206496e-02 - 21 1.6267868459547039e-01 4.8910520011812009e-02 4.9415963505101621e-03 - 22 3.9143651683370253e-03 -8.1172695145679000e-02 -1.0834230526190378e-02 - 23 4.9870311913370033e-02 1.2420611623040828e-01 -7.7833840076172459e-02 - 24 1.2773385871506515e-01 9.4431969129075782e-02 8.4509868356579518e-02 - 25 7.0376169719190279e-02 4.4792786930559310e-03 -4.6803763947891978e-02 - 26 -5.0364526911511179e-02 -1.4929711058338557e-01 1.2850817811267942e-01 - 27 4.6472580366719141e-02 -4.1923069078539394e-03 -1.3401923595724521e-03 - 28 1.1441857387906706e-02 5.8173904345736008e-02 7.3370361778840071e-02 - 29 4.7811159682183739e-02 1.0733827504367408e-01 -1.9879309433676450e-03 - 30 -4.2511930547412778e-02 -2.9916695214642831e-02 -8.4066745720912481e-02 - 31 -2.1952102296720562e-02 -1.1662029578060293e-01 7.4721379144302519e-02 - 32 -1.9497502987605872e-01 -6.5187354007956666e-02 -2.2832899526331281e-02 + 1 1.3134249472550126e-02 6.5510201473625004e-02 1.4146036345890697e-02 + 2 -2.2039573344135470e-02 -7.7588485000158275e-02 4.8916315387578096e-02 + 3 -3.8439918128248318e-02 1.8977371534710236e-01 -4.8731849712923506e-02 + 4 2.0980362197831393e-02 -9.8846450988062749e-03 -5.2587039844588776e-02 + 5 5.5995177756368829e-02 1.4253279617531009e-01 3.5587395309304624e-02 + 6 4.1613981768887615e-02 2.9579301520216102e-02 -7.0825553148169667e-03 + 7 -6.4258885949726355e-02 8.9476952054014833e-02 -1.0354781651553567e-02 + 8 -6.8729705700664737e-02 -6.0895260442125412e-02 4.4724892722415109e-02 + 9 1.4482225207595997e-02 -5.5309013657411511e-02 -2.8306731345116094e-02 + 10 -3.2448326498501046e-02 -1.4464776854454503e-01 -1.1491399380071821e-01 + 11 -4.0384463132688363e-02 -5.0494511670038184e-02 4.2890457560861246e-02 + 12 3.1049715288197031e-02 -8.8136870143633181e-02 -3.9789632015512768e-03 + 13 -1.8662185074198423e-02 2.4491648446990373e-02 -4.7021210426121889e-02 + 14 5.6766854832423948e-02 -1.8416605122597990e-02 7.0020951549122801e-02 + 15 -3.1889694541598082e-02 3.1684225421592001e-02 -2.8098680283054712e-02 + 16 1.0976172812214702e-01 -9.1711892027847686e-02 3.7350137069033548e-02 + 17 4.3953690408596112e-02 1.3057427889636417e-01 -1.5215047936603689e-03 + 18 -1.4781241427028258e-01 -3.5551685051969963e-02 -7.0808497336688106e-02 + 19 -1.5577155608835769e-01 -8.1603182295195725e-02 3.7399093573260524e-02 + 20 2.4195342043258416e-02 1.9797928495550812e-02 -3.4097656485428188e-02 + 21 1.6279125035813624e-01 5.0622556692516057e-02 4.3861767492901155e-03 + 22 3.0808005120638027e-03 -8.1905029973223478e-02 -1.1677185805045008e-02 + 23 4.7300273656154787e-02 1.2323101758522344e-01 -8.0297816190661592e-02 + 24 1.2797846120677306e-01 9.4721543990869725e-02 8.3850172703102410e-02 + 25 6.9983697210703494e-02 4.2428781832062334e-03 -4.6765270774152684e-02 + 26 -5.1734472982834054e-02 -1.5092905862202721e-01 1.2865570928769271e-01 + 27 4.6210267378730449e-02 -4.6579641317464181e-03 -3.2491754928932678e-04 + 28 1.1178316079450953e-02 5.7642375438101016e-02 7.3686481611428961e-02 + 29 4.8801247801051863e-02 1.0737696991422141e-01 -3.0899403279808558e-03 + 30 -4.2583729082310590e-02 -3.0042506111919103e-02 -8.4407719074041418e-02 + 31 -2.0782623030144873e-02 -1.1599033475742046e-01 7.4794873035509954e-02 + 32 -1.9372009347723101e-01 -6.3493576984237618e-02 -2.2342378987097743e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-table_linear.yaml b/unittest/force-styles/tests/atomic-pair-table_linear.yaml index de8cf8021..14dd697e4 100644 --- a/unittest/force-styles/tests/atomic-pair-table_linear.yaml +++ b/unittest/force-styles/tests/atomic-pair-table_linear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-13 prerequisites: ! | pair table @@ -51,41 +51,41 @@ init_forces: ! |2 30 -4.2587368463202192e-02 -3.0047436022746527e-02 -8.4421201266270535e-02 31 -2.0646231349659299e-02 -1.1590205379082782e-01 7.4785818423894770e-02 32 -1.9352068689594826e-01 -6.3282139756026798e-02 -2.2278655095207611e-02 -run_vdwl: 1.66727802356891 +run_vdwl: 1.66842874884356 run_coul: 0 run_stress: ! |2- - 6.1925738027578641e+00 6.0573149352705613e+00 5.8826519662480035e+00 2.0544288354756310e-01 -2.2314569036134008e-02 -9.0767397150969681e-02 + 6.1946185356811014e+00 6.0608444906913288e+00 5.8870835095750591e+00 2.0713242742857005e-01 -2.1315300788911050e-02 -8.9580203233208117e-02 run_forces: ! |2 - 1 1.0239417972012135e-02 6.5143936411888370e-02 1.3356763777998637e-02 - 2 -2.2314835701632570e-02 -7.7524477122967728e-02 4.8999346575662309e-02 - 3 -3.9043638693828556e-02 1.8727196361074283e-01 -5.0358906369839446e-02 - 4 2.1555046910191538e-02 -9.6562479880345862e-03 -5.2220025740068080e-02 - 5 5.5684458879600447e-02 1.4098102798381096e-01 3.6430504994586173e-02 - 6 4.2104147709418713e-02 2.9055058600247489e-02 -8.0778112152718948e-03 - 7 -6.4963866924303920e-02 9.0824824870264262e-02 -1.1492621439859574e-02 - 8 -6.9888106386663568e-02 -6.1362238801327997e-02 4.5061669154972568e-02 - 9 1.5493057273285156e-02 -5.6307006366398599e-02 -2.9234755420043165e-02 - 10 -3.0006706586658188e-02 -1.4355133290296190e-01 -1.1246538976169368e-01 - 11 -4.0156699765253455e-02 -5.1238883202820718e-02 4.2112202625462891e-02 - 12 3.2215165580774301e-02 -8.8013396380619557e-02 -4.0047290710007333e-03 - 13 -1.9322767417550984e-02 2.3711197649086194e-02 -4.6454058795633212e-02 - 14 5.7508424194302507e-02 -1.5717730349026085e-02 6.8892268883266869e-02 - 15 -3.1552192265302363e-02 3.2002449140037137e-02 -2.7508481800674743e-02 - 16 1.0688955089657577e-01 -9.0842508916126788e-02 3.6418887829925486e-02 - 17 4.4577236329712736e-02 1.3022532646095397e-01 -7.5825494000398793e-04 - 18 -1.4789247023417521e-01 -3.4554869410601124e-02 -7.1472651306375229e-02 - 19 -1.5516659799350990e-01 -8.1733259734237992e-02 3.6528023380248152e-02 - 20 2.3565292501585497e-02 2.0131963706666492e-02 -3.4090460756558867e-02 - 21 1.6266349958385409e-01 4.8905943278807026e-02 4.9357951969207243e-03 - 22 3.9108463662172284e-03 -8.1159914942901146e-02 -1.0833213112554453e-02 - 23 4.9862761614696910e-02 1.2418695431753196e-01 -7.7818580582703634e-02 - 24 1.2773299190190621e-01 9.4426552636226180e-02 8.4500013220674824e-02 - 25 7.0366190135544543e-02 4.4772942266913711e-03 -4.6793931216364631e-02 - 26 -5.0367407305875939e-02 -1.4928033291926532e-01 1.2849353197675831e-01 - 27 4.6468146723438429e-02 -4.1892634838488693e-03 -1.3380548635599163e-03 - 28 1.1447706368862415e-02 5.8175438626723523e-02 7.3359635688296038e-02 - 29 4.7807434863290775e-02 1.0732112842460283e-01 -1.9886348252873588e-03 - 30 -4.2515720470887731e-02 -2.9914625470396135e-02 -8.4056579797267661e-02 - 31 -2.1956047762899965e-02 -1.1661348485300055e-01 7.4709459326432123e-02 - 32 -1.9494431829672756e-01 -6.5181487099745139e-02 -2.2830961616444944e-02 + 1 1.3136405015519746e-02 6.5498536206097205e-02 1.4145214095606940e-02 + 2 -2.2034410423651667e-02 -7.7576693121538851e-02 4.8909358860435813e-02 + 3 -3.8436750474921857e-02 1.8975412237840655e-01 -4.8726187016363658e-02 + 4 2.0979009839150985e-02 -9.8856544954155391e-03 -5.2578884003490263e-02 + 5 5.5986385340335378e-02 1.4251676537479371e-01 3.5581722118314153e-02 + 6 4.1609477912926705e-02 2.9580714336645355e-02 -7.0799595458764155e-03 + 7 -6.4248263419537974e-02 8.9463099871546339e-02 -1.0353167690937956e-02 + 8 -6.8721035685484169e-02 -6.0890353008273349e-02 4.4724377870025867e-02 + 9 1.4478794027632313e-02 -5.5303840190565834e-02 -2.8303449824621626e-02 + 10 -3.2442225470238284e-02 -1.4462958347444255e-01 -1.1490636044802598e-01 + 11 -4.0380098198936315e-02 -5.0489237465722342e-02 4.2886366839783141e-02 + 12 3.1042573934613786e-02 -8.8124417892490550e-02 -3.9836223107036824e-03 + 13 -1.8662346594323406e-02 2.4488860531734036e-02 -4.7017569637503226e-02 + 14 5.6758398737186001e-02 -1.8417013099939757e-02 7.0021208727040221e-02 + 15 -3.1890718750375871e-02 3.1680945160164634e-02 -2.8099007087897577e-02 + 16 1.0974927295956437e-01 -9.1700581694579272e-02 3.7353604266666181e-02 + 17 4.3949599290549167e-02 1.3056022082771249e-01 -1.5186533101522860e-03 + 18 -1.4779065775094938e-01 -3.5545009034603448e-02 -7.0804115436467974e-02 + 19 -1.5575849273033265e-01 -8.1593798424580852e-02 3.7401403037003671e-02 + 20 2.4191762324487637e-02 1.9797661050897725e-02 -3.4094421586452622e-02 + 21 1.6277689383944274e-01 5.0613904402710908e-02 4.3814046214179373e-03 + 22 3.0808529409187316e-03 -8.1893387158318190e-02 -1.1674778822049670e-02 + 23 4.7291115645669610e-02 1.2321981673952434e-01 -8.0293924098566907e-02 + 24 1.2796476903734316e-01 9.4710000727985508e-02 8.3837701472172954e-02 + 25 6.9978511690556522e-02 4.2426845623083206e-03 -4.6754249512428875e-02 + 26 -5.1719879565222809e-02 -1.5090772643136091e-01 1.2863958130289438e-01 + 27 4.6200315012573274e-02 -4.6570545961200031e-03 -3.2130512222193833e-04 + 28 1.1176722714214035e-02 5.7636649192569951e-02 7.3675147792124071e-02 + 29 4.8792848254175826e-02 1.0735947043019201e-01 -3.0906432282771269e-03 + 30 -4.2586878118599319e-02 -3.0035634149439758e-02 -8.4400036833510272e-02 + 31 -2.0779775688602325e-02 -1.1598657888745820e-01 7.4785567642976225e-02 + 32 -1.9369217564568370e-01 -6.3486888668439864e-02 -2.2342323130913760e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-table_lookup.yaml b/unittest/force-styles/tests/atomic-pair-table_lookup.yaml index 59aab6e86..769d94b35 100644 --- a/unittest/force-styles/tests/atomic-pair-table_lookup.yaml +++ b/unittest/force-styles/tests/atomic-pair-table_lookup.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-13 prerequisites: ! | pair table @@ -51,41 +51,41 @@ init_forces: ! |2 30 -4.2678491461167409e-02 -3.0167096740169222e-02 -8.4323491798094938e-02 31 -2.0446963122925290e-02 -1.1577119295225209e-01 7.4834425292344492e-02 32 -1.9338210089853922e-01 -6.2777766271189708e-02 -2.2198626823726184e-02 -run_vdwl: 1.66790120138923 +run_vdwl: 1.66836471086472 run_coul: 0 run_stress: ! |2- - 6.1954399052539300e+00 6.0597796933663810e+00 5.8839846490596770e+00 2.0464958122047128e-01 -2.2990948428733799e-02 -9.0561388880444543e-02 + 6.1942043291654469e+00 6.0612653540830586e+00 5.8861497905111531e+00 2.0800105441755243e-01 -2.1762342247091705e-02 -9.1029111210449057e-02 run_forces: ! |2 - 1 1.0357196419898495e-02 6.5372257333873959e-02 1.3514409758410917e-02 - 2 -2.2518946587964585e-02 -7.7700478129363010e-02 4.8980708027650338e-02 - 3 -3.9187350884245992e-02 1.8746598368586515e-01 -5.0095509280450985e-02 - 4 2.1505122391926864e-02 -9.8121998835355474e-03 -5.2197325168546041e-02 - 5 5.6368397082486393e-02 1.4115837375527868e-01 3.6749677569935905e-02 - 6 4.2042380520510882e-02 2.9049092654418140e-02 -8.0059207630978693e-03 - 7 -6.5262053410956963e-02 9.1189712395790753e-02 -1.1162106417995799e-02 - 8 -6.9823982763573419e-02 -6.1642359327017858e-02 4.5148186601411129e-02 - 9 1.5581717631005403e-02 -5.6464988109373171e-02 -2.9179373549110328e-02 - 10 -2.9936010364121191e-02 -1.4403347574591194e-01 -1.1249323547874966e-01 - 11 -4.0279718641423851e-02 -5.1267663186455890e-02 4.2308426648069226e-02 - 12 3.2548290765190446e-02 -8.8360090934889973e-02 -4.1059424850670304e-03 - 13 -1.9100876563736404e-02 2.3923943182546592e-02 -4.6654992572323889e-02 - 14 5.7003886104469645e-02 -1.5977942426948746e-02 6.9080947733147463e-02 - 15 -3.1419200863690128e-02 3.2134894708585104e-02 -2.7460582419399034e-02 - 16 1.0678077169426231e-01 -9.0718758218836820e-02 3.6086450730476470e-02 - 17 4.4432206292973897e-02 1.3053785119638170e-01 -8.8349832217821166e-04 - 18 -1.4847693210486995e-01 -3.4770804844180284e-02 -7.1598050906370336e-02 - 19 -1.5584406172770648e-01 -8.1902850262455335e-02 3.6401901739187829e-02 - 20 2.3632828687886766e-02 2.0210640568054113e-02 -3.3962375402201296e-02 - 21 1.6251200328353549e-01 4.8509762572667509e-02 4.6262805117567836e-03 - 22 3.9297251786593766e-03 -8.1271664355599668e-02 -1.0814196256901271e-02 - 23 4.9681279655079395e-02 1.2435597457773782e-01 -7.8146336899556537e-02 - 24 1.2830345267622284e-01 9.4849763681645619e-02 8.4755594763442382e-02 - 25 7.0574066259719931e-02 4.7738855789510749e-03 -4.6746928071330643e-02 - 26 -5.0012323977413009e-02 -1.4919205052782003e-01 1.2835423785227032e-01 - 27 4.6693855278230161e-02 -4.3926905018267671e-03 -1.5097765818073844e-03 - 28 1.1103730609808571e-02 5.8020761280684265e-02 7.3177666578219974e-02 - 29 4.8063412527103180e-02 1.0769074559895483e-01 -1.8637969627234715e-03 - 30 -4.2307197338881525e-02 -2.9602719505751475e-02 -8.4192072289735478e-02 - 31 -2.2008710097816863e-02 -1.1651727431063712e-01 7.4819836125210509e-02 - 32 -1.9493695773256986e-01 -6.5615632500831411e-02 -2.2932304811643992e-02 + 1 1.3125858531157650e-02 6.5334657113436528e-02 1.4305447006118053e-02 + 2 -2.2064446236710021e-02 -7.7531973689875092e-02 4.8939931405982184e-02 + 3 -3.8571993383925557e-02 1.8972343199734315e-01 -4.9423862365686633e-02 + 4 2.0909662472951264e-02 -9.7625770712553711e-03 -5.2580840511648574e-02 + 5 5.6476814434241865e-02 1.4263713150474955e-01 3.5297772378880717e-02 + 6 4.1816112255632865e-02 2.9686492127625502e-02 -7.3652865935041976e-03 + 7 -6.4129866268728089e-02 8.9522632485992237e-02 -1.0372258842373494e-02 + 8 -6.8800424492617140e-02 -6.0755850681527328e-02 4.4703243061970876e-02 + 9 1.4533874066772938e-02 -5.5419441490201393e-02 -2.8189822511676507e-02 + 10 -3.2945644101749050e-02 -1.4447439162489434e-01 -1.1471740848884845e-01 + 11 -4.0396464806283609e-02 -5.0812254424785971e-02 4.2663936608481730e-02 + 12 3.1122505066072836e-02 -8.8171665892914836e-02 -4.0449458290990883e-03 + 13 -1.8879372632517231e-02 2.4224147518479469e-02 -4.6718915912130246e-02 + 14 5.6792736939185372e-02 -1.8423252581223553e-02 7.0093308225446516e-02 + 15 -3.1867795371328791e-02 3.1513995522282207e-02 -2.8193401412766612e-02 + 16 1.0969067848948520e-01 -9.1639040565616670e-02 3.7136977622416557e-02 + 17 4.4238792854823322e-02 1.3057053471200269e-01 -1.3054745127138911e-03 + 18 -1.4743283464772453e-01 -3.5395591133668525e-02 -7.0839657916762708e-02 + 19 -1.5535213047507518e-01 -8.1537063829019915e-02 3.7403210171858610e-02 + 20 2.4078471461330780e-02 1.9763078503192914e-02 -3.3872281369159353e-02 + 21 1.6238933804757652e-01 5.0633096416577358e-02 4.8831657768131902e-03 + 22 3.0648947350774567e-03 -8.1858939218718202e-02 -1.1643047214008162e-02 + 23 4.7659402550802352e-02 1.2359142797466878e-01 -8.0372483404069897e-02 + 24 1.2788326733072664e-01 9.4579823744745189e-02 8.4096829892132768e-02 + 25 7.0185493245522951e-02 4.4752222085328456e-03 -4.6901358516484450e-02 + 26 -5.1654800285098695e-02 -1.5109054038783262e-01 1.2888404719067126e-01 + 27 4.6414853397934795e-02 -4.7685797739764283e-03 -4.0107202128412955e-04 + 28 1.0852680565342138e-02 5.7772828842703537e-02 7.3314190424770456e-02 + 29 4.8619098287556367e-02 1.0741954084999950e-01 -2.9315472237437462e-03 + 30 -4.2684615979835673e-02 -3.0228709418647592e-02 -8.4336370707452285e-02 + 31 -2.0891266236869249e-02 -1.1595520073966126e-01 7.4868500319906064e-02 + 32 -1.9418287981373036e-01 -6.3622968998512802e-02 -2.2380524732036357e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-table_spline.yaml b/unittest/force-styles/tests/atomic-pair-table_spline.yaml index b74691266..a4dce1338 100644 --- a/unittest/force-styles/tests/atomic-pair-table_spline.yaml +++ b/unittest/force-styles/tests/atomic-pair-table_spline.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-13 prerequisites: ! | pair table @@ -51,41 +51,41 @@ init_forces: ! |2 30 -4.2587398133307960e-02 -3.0047443784418228e-02 -8.4420705386072381e-02 31 -2.0646215207926085e-02 -1.1590108886476506e-01 7.4785520470549566e-02 32 -1.9351936740994052e-01 -6.3281923890906297e-02 -2.2278650628172247e-02 -run_vdwl: 1.667273130413 +run_vdwl: 1.66842322373739 run_coul: 0 run_stress: ! |2- - 6.1925535687585693e+00 6.0572952105271769e+00 5.8826298841000604e+00 2.0544338949977917e-01 -2.2313078114848450e-02 -9.0766976514897041e-02 + 6.1945944680219887e+00 6.0608212867624980e+00 5.8870610546441418e+00 2.0713169827359051e-01 -2.1315981269016338e-02 -8.9579349983669246e-02 run_forces: ! |2 - 1 1.0239633061502058e-02 6.5143827221595174e-02 1.3356826587515483e-02 - 2 -2.2314719792140746e-02 -7.7524048417887792e-02 4.8999119168703323e-02 - 3 -3.9043356307568236e-02 1.8727112901323323e-01 -5.0358319574288206e-02 - 4 2.1555031522153656e-02 -9.6560578347078038e-03 -5.2219714561247452e-02 - 5 5.5684799810960112e-02 1.4098076857747269e-01 3.6430385068854737e-02 - 6 4.2103921190025241e-02 2.9054969033758940e-02 -8.0777612807259296e-03 - 7 -6.4964007703587665e-02 9.0824767825338215e-02 -1.1492723720965943e-02 - 8 -6.9887912879430303e-02 -6.1361831723537673e-02 4.5061147281770325e-02 - 9 1.5493100733112084e-02 -5.6306897360260899e-02 -2.9234346339233039e-02 - 10 -3.0007119234870205e-02 -1.4355108819988596e-01 -1.1246502096182201e-01 - 11 -4.0156584042997157e-02 -5.1238608709860869e-02 4.2111943089822509e-02 - 12 3.2215137999640264e-02 -8.8013573068877235e-02 -4.0049314316609446e-03 - 13 -1.9322692643690253e-02 2.3710729865779583e-02 -4.6453771618837091e-02 - 14 5.7508119522746703e-02 -1.5717550954823703e-02 6.8891636524075137e-02 - 15 -3.1551853579254628e-02 3.2002270904692251e-02 -2.7508263221790400e-02 - 16 1.0688913506500985e-01 -9.0842063672437995e-02 3.6419114766505958e-02 - 17 4.4576981599750799e-02 1.3022472720372444e-01 -7.5802573483000615e-04 - 18 -1.4789239369554841e-01 -3.4554795916705260e-02 -7.1472573328781749e-02 - 19 -1.5516657008010420e-01 -8.1733453599869749e-02 3.6527707427395764e-02 - 20 2.3565108550513952e-02 2.0131835710028016e-02 -3.4090223278000355e-02 - 21 1.6266310434046480e-01 4.8905845083266029e-02 4.9357148091662226e-03 - 22 3.9108125555495730e-03 -8.1159764595007206e-02 -1.0833146565530810e-02 - 23 4.9862133358188218e-02 1.2418637371342198e-01 -7.7818397024808514e-02 - 24 1.2773306535829987e-01 9.4426378198700950e-02 8.4499926668801975e-02 - 25 7.0365780658878857e-02 4.4772437288752168e-03 -4.6793953502009267e-02 - 26 -5.0367468278612715e-02 -1.4927976307827082e-01 1.2849283634143213e-01 - 27 4.6468158385616867e-02 -4.1893770730035470e-03 -1.3381218640924168e-03 - 28 1.1447647509745237e-02 5.8175457185785213e-02 7.3359279966104529e-02 - 29 4.7807504512594315e-02 1.0732100993527130e-01 -1.9887010850049803e-03 - 30 -4.2515398596597830e-02 -2.9914524234883048e-02 -8.4055979568242525e-02 - 31 -2.1955840630845491e-02 -1.1661294434426502e-01 7.4709133379083956e-02 - 32 -1.9494325826950429e-01 -6.5180990416658327e-02 -2.2830796417360581e-02 + 1 1.3136442618358161e-02 6.5498227315221855e-02 1.4145078995418579e-02 + 2 -2.2034256567348511e-02 -7.7576337733228889e-02 4.8909118840101927e-02 + 3 -3.8436900073276270e-02 1.8975362788816072e-01 -4.8726243374650938e-02 + 4 2.0978949241700288e-02 -9.8857580828319962e-03 -5.2578609546318052e-02 + 5 5.5986284770654149e-02 1.4251627158654043e-01 3.5581774581604449e-02 + 6 4.1609279569923184e-02 2.9580610890402377e-02 -7.0798904439686172e-03 + 7 -6.4247786974295090e-02 8.9462542236576847e-02 -1.0352978532861528e-02 + 8 -6.8720762724902296e-02 -6.0890051691569129e-02 4.4724106993147938e-02 + 9 1.4478842053986708e-02 -5.5303569073753112e-02 -2.8303411247561115e-02 + 10 -3.2442332492131298e-02 -1.4462919679170583e-01 -1.1490578061003126e-01 + 11 -4.0380055415556892e-02 -5.0488836940528713e-02 4.2886305220519144e-02 + 12 3.1042227992224478e-02 -8.8123764355279618e-02 -3.9836069180612353e-03 + 13 -1.8662268997237452e-02 2.4488419187471220e-02 -4.7017343341322765e-02 + 14 5.6758199788558089e-02 -1.8416862458127060e-02 7.0021194071001158e-02 + 15 -3.1890572826806143e-02 3.1680928999145423e-02 -2.8098679630362888e-02 + 16 1.0974868640576729e-01 -9.1700220236871577e-02 3.7353142474932051e-02 + 17 4.3949528805055281e-02 1.3055969003223247e-01 -1.5187491825980459e-03 + 18 -1.4779000533887526e-01 -3.5544671045993903e-02 -7.0803577272391949e-02 + 19 -1.5575778158085732e-01 -8.1593083003148048e-02 3.7401415452051688e-02 + 20 2.4191779948586647e-02 1.9797464684680625e-02 -3.4094272027510815e-02 + 21 1.6277653146417212e-01 5.0613511751031293e-02 4.3814156181018905e-03 + 22 3.0806866050182807e-03 -8.1893077377184098e-02 -1.1674669002377578e-02 + 23 4.7291190714284087e-02 1.2321965137783808e-01 -8.0293981500818887e-02 + 24 1.2796380350177128e-01 9.4709254075356381e-02 8.3837083622034791e-02 + 25 6.9978374487630321e-02 4.2426024253015776e-03 -4.6754323257751022e-02 + 26 -5.1719666836254230e-02 -1.5090737131881993e-01 1.2863915919640112e-01 + 27 4.6200160980032046e-02 -4.6572249711511141e-03 -3.2134775379477620e-04 + 28 1.1176498636291901e-02 5.7636542286366617e-02 7.3674921385797079e-02 + 29 4.8792712387152257e-02 1.0735908674397694e-01 -3.0905743122255180e-03 + 30 -4.2586901743155985e-02 -3.0035742375685015e-02 -8.4399525850689064e-02 + 31 -2.0779725307508403e-02 -1.1598584036368677e-01 7.4785156394731572e-02 + 32 -1.9369116309296114e-01 -6.3486823660737712e-02 -2.2342309040547161e-02 ... diff --git a/unittest/force-styles/tests/atomic-pair-yukawa_colloid.yaml b/unittest/force-styles/tests/atomic-pair-yukawa_colloid.yaml index 47aed604b..4011d8924 100644 --- a/unittest/force-styles/tests/atomic-pair-yukawa_colloid.yaml +++ b/unittest/force-styles/tests/atomic-pair-yukawa_colloid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 11:57:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-14 prerequisites: ! | atom sphere @@ -55,36 +55,36 @@ init_forces: ! |2 25 3.9091258782696285e+00 -3.5326654057532719e-01 4.7334165925855037e-01 26 -6.0742511180270498e+01 2.1819250139897854e+01 -8.7460910512647203e+00 27 5.1550993740012451e+01 2.7042786325070402e+01 1.3526090147715118e+01 -run_vdwl: 1575.69696944305 +run_vdwl: 1323.07868576666 run_coul: 0 run_stress: ! |2- - 2.4310358996496175e+03 1.0611033965692919e+04 4.2344282495048510e+03 -5.6382618739022053e+02 -1.6935187027968664e+03 4.4593574140700639e+02 + 2.1967177306554954e+03 8.5663931752326953e+03 3.8861287529537371e+03 -4.2921958355450886e+02 -1.4997587809515621e+03 2.8001183019458591e+02 run_forces: ! |2 - 1 -2.7762358875203591e+02 -3.3522704178453480e+01 4.7557590618231694e+02 - 2 2.4317913022941889e-01 1.7744056618982068e-01 -2.2528328998975972e-01 - 3 1.9667784727966133e+01 1.5907025683392845e+01 2.0583766731676139e+01 - 4 -8.3875488981376929e+00 -6.0231217433137303e+00 2.1554309647434778e+01 - 5 -8.5152781963590918e-01 -1.1004305935986665e-01 -1.7275573908544040e-01 - 6 1.8607854912608815e+01 -8.0690580489536075e+00 7.4115121376789652e+00 - 7 1.0037842000566890e+00 3.0469001099466991e-01 -1.0195470002048487e-01 - 8 1.4685549650889422e+00 1.7550536263328533e+00 2.7174655913954795e+00 - 9 2.4043671691288100e+01 -2.2058923465111938e+01 1.8266595927951585e+01 - 10 -3.1657706731408702e-01 -6.9174072637663009e-01 -1.5895894278808675e-01 - 11 -5.4611494262879383e+01 7.4128446442577001e+01 6.9631032221728688e+01 - 12 -9.3695192031995276e+01 2.3124510064923135e+02 6.8667450914211102e+01 - 13 1.4062295602526049e+02 -3.7432297151342027e+01 6.0494178049029969e+01 - 14 3.4958061053466423e+01 1.0855839353901107e+01 -1.3021907727485785e+02 - 15 -8.1926962376847030e+01 8.6656826606398010e+02 1.6051171760696974e+01 - 16 -1.5215416696257074e+00 -1.1191680395224315e+00 -7.6881819686901345e-02 - 17 2.3127260214746213e+00 1.6963005083714262e+00 -3.2413902935921133e+00 - 18 4.1625898583800243e+01 2.6262688172974642e+01 -1.8790281538579794e+01 - 19 7.9364878570280045e-02 -1.1055788876342093e-01 -7.7130870221545716e-02 - 20 3.5776346514385171e-01 6.8880229496094403e-02 1.4704372374891173e-01 - 21 3.9667534272591287e-02 -2.5273561236526559e-01 -6.6940380615943207e-01 - 22 9.8209497163560799e-01 -2.0865597746381209e-01 1.5215865207469648e+00 - 23 4.7751961653513362e+01 -9.6614190202470525e+00 -5.3246818406878642e+00 - 24 1.9549892003142557e+02 -1.1565202031276392e+03 -6.0710783661211360e+02 - 25 4.4269874711416497e+00 -3.2992218538266360e-01 5.5249646592042012e-01 - 26 -5.9394808300145769e+01 2.3498459979633388e+01 -8.7376036002029842e+00 - 27 4.4638009861673993e+01 2.3642358937219718e+01 1.1728724453449056e+01 + 1 -2.5249310877828921e+02 -2.4945770046973646e+01 4.3161147880883379e+02 + 2 2.5794595107526141e-01 1.8755164976885333e-01 -2.3820213021106212e-01 + 3 2.2112042219233306e+01 1.4224822665127668e+01 2.3696724901469047e+01 + 4 -9.9726138437261440e+00 -4.6243998770870478e+00 2.6256472781056406e+01 + 5 -1.0404007171235226e+00 -1.4462051946583487e-01 -2.0675009410223422e-01 + 6 1.9140463719868137e+01 -9.4186960926009178e+00 8.1044346939074714e+00 + 7 1.0237114585742528e+00 3.2874546446902542e-01 -5.3071333522891534e-02 + 8 6.3405180098392711e-01 1.5741657225855421e+00 2.5604883782175962e+00 + 9 2.1725618911172706e+01 -2.0192716442293733e+01 1.6196399447149126e+01 + 10 -3.5731179282367276e-01 -7.0614963500636108e-01 -2.5342046154241299e-01 + 11 -3.9651629401382806e+01 6.6766373363073342e+01 4.8425165538202997e+01 + 12 -7.6890300950610765e+01 1.8484032882931277e+02 5.6595657386931236e+01 + 13 1.2589671618017137e+02 -2.7337021769775838e+01 5.3740137776718150e+01 + 14 3.1095986991292310e+01 1.3684588519026317e+01 -1.1383098769404336e+02 + 15 -8.1622112845551570e+01 4.6845904442913047e+02 4.1096429738368530e+00 + 16 -1.3006854262157681e+00 -9.7151530756541304e-01 -7.6873396313466444e-02 + 17 2.1456613651961907e+00 1.6761186329624558e+00 -3.0699395871280575e+00 + 18 3.8962449077066637e+01 2.3823597716991934e+01 -1.7792685575035719e+01 + 19 8.4399250187231517e-02 -1.0941150172182573e-01 -8.5840974741715453e-02 + 20 3.5132577801247417e-01 6.1819274182332670e-02 1.2730939172922037e-01 + 21 1.1622935836838841e-01 -2.7106053369116795e-01 -7.9186553354537637e-01 + 22 8.7904548187446330e-01 -2.0579352589160624e-01 1.3787559034080152e+00 + 23 4.2410540916742434e+01 -7.6501965295932157e+00 -5.9093527113343374e+00 + 24 1.6863893072044945e+02 -7.2208189472567165e+02 -5.3018457902472585e+02 + 25 4.9960264722835275e+00 -2.6335862866906223e-01 6.6079280675528396e-01 + 26 -5.2213717178367361e+01 2.4028967934574769e+01 -1.0482783999543646e+01 + 27 3.5070735281538624e+01 1.9266480934801731e+01 9.5128917275750453e+00 ... diff --git a/unittest/force-styles/tests/bond-class2.yaml b/unittest/force-styles/tests/bond-class2.yaml index 0af96983c..13c2493d8 100644 --- a/unittest/force-styles/tests/bond-class2.yaml +++ b/unittest/force-styles/tests/bond-class2.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -52,37 +52,37 @@ init_forces: ! |2 27 2.2674229580362422e+00 3.6953663496240573e+01 -8.8003614900515856e+00 28 2.1551008635816927e+01 -9.2616399704789991e+00 1.4581621559271095e+01 29 -2.3818431593853170e+01 -2.7692023525761574e+01 -5.7812600692195097e+00 -run_energy: 11.0473171333048 +run_energy: 26.0946187265871 run_stress: ! |- - -1.4852712504356052e+02 -1.9983434269203804e+02 -1.6958399346360650e+02 2.4915064894614105e+01 2.6429352567045122e+01 1.1402862872836554e+01 + -2.9913778299462206e+02 -3.1023436598826180e+02 -2.6088287404513943e+02 -1.8712697455436544e+01 -1.1958498347651703e-01 1.3198910331468596e+01 run_forces: ! |2 - 1 -3.5631641703490464e+00 -2.6651736992487173e+01 -2.0238295956108619e+01 - 2 -7.2376429946058520e+00 -6.1508458361605616e+00 8.1367348066584384e+00 - 3 4.5938955094915151e+01 -1.4876607602671008e+01 -2.0881097471003674e+01 - 4 1.0657056692901113e+01 -2.8987400139072070e+00 7.4380897526676470e+00 - 5 1.2479840534608451e+00 1.7133652758827786e+00 -5.8796845220898595e+00 - 6 -4.2290686184681540e+01 4.2224824761005884e+01 1.8529188607548278e+01 - 7 -8.7647510815200691e-01 3.4382971960812156e+00 1.5493615318132404e+01 - 8 3.0477512143977243e+00 -2.3136645583767042e+00 -5.5160504880049643e-01 - 9 -9.1772746647337811e-01 -9.6069468430258709e-01 -4.0536371195689593e+00 - 10 5.1799901634548057e+01 -7.5345801673577899e+00 1.0355887001939042e+01 - 11 2.8490552058403762e+00 6.4295335852166620e+00 1.0639003325745083e+01 - 12 -2.6767357398146597e+01 -2.9041586107390195e+01 1.4798850320310191e+01 - 13 -1.2723199064464621e+01 4.6042668036810674e+00 2.8681948350869607e-01 - 14 4.4351200917545039e+00 -8.7592876807178788e-01 1.1844986091191039e+01 - 15 3.1074972597108347e-01 -8.3731012118651407e+00 -3.0761396502245972e+00 - 16 -3.1141292673296054e+01 4.4882099933939173e+01 -2.8367658133311600e+01 - 17 5.2309713463802394e+00 -3.6149016132166203e+00 -1.4475056806593008e+01 - 18 1.2970338177081336e+01 1.5269368987959455e+01 -1.4709441761879583e+01 - 19 3.7030996483351912e+00 2.4471642173460157e+00 4.3118693019952339e+00 - 20 -1.6673437825416528e+01 -1.7716533205305470e+01 1.0397572459884350e+01 - 21 -1.2939143040659487e+00 -1.6310318578056515e-01 -2.9670329043561345e+00 - 22 1.8698597825995587e+00 4.9273673214457669e-01 2.8002381199733750e+00 - 23 -5.7594547853361000e-01 -3.2963354636401154e-01 1.6679478438275974e-01 - 24 4.1876740324734651e+00 -5.2749970947748643e+00 5.3300662359604090e+00 - 25 -6.8200185358534435e+00 8.9526747058374445e-01 -5.7340586378034830e+00 - 26 2.6323445033799779e+00 4.3797296241911194e+00 4.0399240184307428e-01 - 27 2.3146874422269574e+00 3.3337796720029980e+00 4.6938982241463839e-01 - 28 4.0052153544933905e-01 -1.6613934988368023e-01 2.6451006164923158e-01 - 29 -2.7152089776762964e+00 -3.1676403221193179e+00 -7.3389988406386997e-01 + 1 1.3651918252402885e+01 -1.2356103962969076e+01 -4.0988012687927508e+01 + 2 -2.4714700314281977e+01 -2.0382220412157519e+01 2.8982796430200246e+01 + 3 7.7641944478829529e+01 -3.6450973687299566e+01 -4.8034172596556004e+01 + 4 6.2493880797121193e+00 -1.7444044490472885e+00 4.4434648812435560e+00 + 5 -1.5498436703822505e+00 -2.3814114705540157e+00 7.9088922505296928e+00 + 6 -8.0576747259990071e+01 8.0438670299215460e+01 3.8273793347665396e+01 + 7 -1.1193940113353786e-01 5.7290755713981600e-01 2.8474487417886873e+00 + 8 1.7274325373992504e+01 -4.5388997032465852e+00 2.9795912072065420e+01 + 9 -5.4415341749959314e+00 -5.8341291394292192e+00 -2.4054768889603373e+01 + 10 8.0969205693895219e+01 -6.9928232939051824e+00 2.7613829883548981e+01 + 11 -2.3137911347530332e-01 -5.7255217182175522e-01 -9.3929232944496677e-01 + 12 -3.7707135712752660e+01 -3.7908439899857925e+01 2.5195273585098981e+01 + 13 -1.3527009209751405e+01 5.3215484950415082e+00 2.5218706400388341e-01 + 14 3.8117790446633903e+00 -7.6288796592929686e-01 9.8864113907975746e+00 + 15 3.2369389733858400e-01 -1.1557583960521402e+01 -4.1412647038746844e+00 + 16 -4.2188259504974468e+01 5.9428415731321444e+01 -4.0775240830264750e+01 + 17 6.1262935409033714e+00 -4.2791119659794052e+00 -1.6267257609271145e+01 + 18 -5.1130376757854812e+00 6.1242030749942238e+00 -4.7993614318224715e+01 + 19 2.7369111503100481e+01 1.7557504682808002e+01 3.3067260530489335e+01 + 20 -2.2256073827314999e+01 -2.3681707757802226e+01 1.4926353787735382e+01 + 21 6.7142457894295688e+00 1.0665747710006226e+01 -3.7396325700282148e+01 + 22 1.8829913536987412e+01 4.5983773875349936e+00 2.9433273299897191e+01 + 23 -2.5544159326416981e+01 -1.5264125097541219e+01 7.9630524003849557e+00 + 24 -1.2387897286000364e+01 2.9730813467321262e+01 -2.1363605478666756e+01 + 25 2.7498266413398671e+01 -4.3624038171550490e+00 2.3123041118162391e+01 + 26 -1.5110369127398307e+01 -2.5368409650166214e+01 -1.7594356394956356e+00 + 27 2.4547481013821049e+00 3.6129085664580643e+01 -8.3808641781037423e+00 + 28 2.0888740304751369e+01 -8.9619893025623654e+00 1.4104324107743023e+01 + 29 -2.3343488406133474e+01 -2.7167096362018281e+01 -5.7234599296392812e+00 ... diff --git a/unittest/force-styles/tests/bond-fene.yaml b/unittest/force-styles/tests/bond-fene.yaml index 8084639b5..dffbcf6f8 100644 --- a/unittest/force-styles/tests/bond-fene.yaml +++ b/unittest/force-styles/tests/bond-fene.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 01:02:57 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -53,37 +53,37 @@ init_forces: ! |2 27 -7.4105937747798123e+01 6.5722929360523858e+02 -2.2054278458154329e+02 28 4.6683896868291521e+02 -2.0062608322401542e+02 3.1586777609755433e+02 29 -3.9273303093511709e+02 -4.5660321038122316e+02 -9.5324991516011053e+01 -run_energy: 5895.10592527992 -run_stress: ! |2- - 1.1088505355432175e+04 3.5546088807250653e+03 3.2557814341123790e+03 7.2697015624401502e+03 5.4631672295275903e+03 1.4581760347047191e+03 +run_energy: 7049.62378855647 +run_stress: ! |- + -4.9516947557536578e+03 -4.6967963286139684e+03 -6.7329756531097837e+03 -2.3212662371402772e+02 -6.5980197715716599e+02 -4.4431032503962462e+02 run_forces: ! |2 - 1 -1.8918162240225552e+03 -2.4388259927986478e+03 1.2428342729121759e+03 - 2 1.7096002197927919e+03 1.9511234141048665e+03 -1.3725721715298373e+03 - 3 2.7313834789169664e+02 3.5422765758244850e+01 -1.1094964910147857e+02 - 4 2.1401194399739109e+02 -3.6777103788174806e+01 1.5669227887798993e+02 - 5 5.3629985194030354e+01 8.1439316351700484e+01 -2.0956985423585593e+02 - 6 6.2674742087151415e+01 -2.5967590880066624e+01 1.7984763969593359e+01 - 7 -9.5248521397931647e+00 1.1551743847716996e+02 6.2378465431559289e+02 - 8 -3.8149362366999259e+02 -5.1575575737774238e+02 -2.3534731433259367e+03 - 9 3.5568858489555208e+02 4.2994067924873264e+02 1.8565803434051006e+03 - 10 2.4500352533964872e+01 2.3865414593146343e+02 1.3571152956401585e+02 - 11 5.5954132376702262e+01 1.4656975631105090e+02 2.0410359108303498e+02 - 12 -1.4338526173170575e+02 -1.1459273840299397e+02 7.7668777386394311e+01 - 13 -2.4673916116616911e+02 8.4546345963916679e+01 1.0436889165915075e+00 - 14 7.8938191353083695e+01 -1.6856068960303688e+01 2.2141061403549966e+02 - 15 4.3611789176560203e+00 -2.3298539886534661e+02 -9.0757103956575861e+01 - 16 -2.8107598012312189e+02 3.5792138783125625e+02 6.5665942155710695e+01 - 17 1.2153742381331742e+02 -5.9374598905125616e+01 -4.6615853447201522e+02 - 18 1.3993981705833403e+03 5.1766795224034945e+02 3.4778975684492984e+03 - 19 -3.4385661364340335e+03 -2.5545468247867943e+03 -2.8293267196853612e+03 - 20 2.0391679658506932e+03 2.0368788725464449e+03 -6.4857084876393731e+02 - 21 -1.4666708084950656e+03 -1.3837988607988614e+03 4.2478287232452421e+03 - 22 -3.7136423340535798e+03 -1.2988077068535936e+03 -3.8937522841854202e+03 - 23 5.1803131425486454e+03 2.6826065676524549e+03 -3.5407643905982195e+02 - 24 1.6167688018980316e+03 -4.2244379331940263e+03 2.8509543001632555e+03 - 25 -5.4920460574729777e+03 -5.7767130079019933e+02 -4.1476257918441115e+03 - 26 3.8752772555749461e+03 4.8021092339842253e+03 1.2966714916808558e+03 - 27 7.6070725632903213e+02 -4.2646888736392593e+03 1.3495821840825786e+03 - 28 -4.7134055707433517e+03 8.7271793467099371e+02 -2.7949802044610983e+03 - 29 3.9526983144143196e+03 3.3919709389682653e+03 1.4453980203785197e+03 + 1 1.4909836982129673e+02 -3.0502209380133127e+02 -6.2757420887309081e+02 + 2 -3.5036334193686412e+02 -2.8953388111760341e+02 4.1024328781127394e+02 + 3 1.0819346723185731e+02 2.2086227277904538e+02 1.4244032794811710e+02 + 4 3.5352932284382962e+02 -9.8380767702886857e+01 2.5156348873496825e+02 + 5 7.9367021771785701e+01 1.2219087915060807e+02 -4.0464013886328058e+02 + 6 1.0120857209663754e+02 -1.8280110476059812e+02 -5.1025257203496358e+02 + 7 -3.9678531740334371e+01 2.0469179505248601e+02 1.0191866091301292e+03 + 8 1.2495908317245477e+02 2.2555509559631957e+01 1.4323990699506533e+02 + 9 -1.2669716494538783e+02 -1.3596208345878682e+02 -5.6058922752210958e+02 + 10 5.2784748715356955e+01 2.0609626265552507e+02 -1.0739308310384223e+02 + 11 8.9802287804868328e+01 2.2253033884705027e+02 3.6452820848227094e+02 + 12 -8.1163090102629852e+01 -2.4085005056664329e+01 -5.4584450610851491e+01 + 13 -4.2021014133600022e+02 1.6530747049466868e+02 7.7408752901419140e+00 + 14 1.6049833431259259e+02 -3.2113545411347935e+01 4.1630716135492906e+02 + 15 1.1793758165167171e+01 -4.2270753135865743e+02 -1.5156263478181276e+02 + 16 -5.8019020996298377e+02 5.8240267455432263e+02 6.3786991940988253e+02 + 17 3.6706751408835351e+02 -2.5603119042546189e+02 -9.7652346936682727e+02 + 18 1.1002598237746213e+01 1.6524831606526834e+02 -6.9009900291133295e+02 + 19 3.6425256198547049e+02 2.3386379416385125e+02 4.3923643305763704e+02 + 20 -3.7525516022321671e+02 -3.9911211022911959e+02 2.5086256985369587e+02 + 21 1.7274245318398050e+02 2.1666447759640579e+02 -6.5579105233333291e+02 + 22 3.2204240221829184e+02 7.8857798318403511e+01 5.0226813033253569e+02 + 23 -4.9478485540227234e+02 -2.9552227591480931e+02 1.5352292200079725e+02 + 24 -1.5401654351233009e+02 5.8204758952809107e+02 -3.4935119253475386e+02 + 25 4.5838900310608358e+02 -7.2043230233849371e+01 3.8518953120516545e+02 + 26 -3.0437245959375349e+02 -5.1000435929424174e+02 -3.5838338670411581e+01 + 27 -7.3768099571196956e+01 6.4897145587261957e+02 -2.1646364418266955e+02 + 28 4.6234806503086719e+02 -1.9763117462194543e+02 3.1198206154644862e+02 + 29 -3.8857996545967023e+02 -4.5134028125067408e+02 -9.5518417363779079e+01 ... diff --git a/unittest/force-styles/tests/bond-fene_expand.yaml b/unittest/force-styles/tests/bond-fene_expand.yaml index c1c1897ea..8b3513737 100644 --- a/unittest/force-styles/tests/bond-fene_expand.yaml +++ b/unittest/force-styles/tests/bond-fene_expand.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 01:30:26 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -15,7 +15,7 @@ bond_coeff: ! | 3 350 2.6 0.022 1.3 0.06 4 650 2.4 0.015 1.2 0.15 5 450 2 0.018 1 0.09 -equilibrium: 5 1.555 1.117 1.321 1.314 1.06 +equilibrium: 5 1.5550000000000002 1.117 1.321 1.3139999999999998 1.06 extract: ! "" natoms: 29 init_energy: 5926.02085912429 @@ -51,37 +51,37 @@ init_forces: ! |2 27 -6.3329315340599010e+01 5.6398417998805996e+02 -1.8910602077885551e+02 28 4.0041383936090841e+02 -1.7207959413995059e+02 2.7092388905417050e+02 29 -3.3708452402030940e+02 -3.9190458584810938e+02 -8.1817868275314979e+01 -run_energy: 5970.39207741535 -run_stress: ! |2- - 1.6208867736373519e+04 6.7948579600320027e+03 7.1305695826795391e+03 9.7633828322861664e+03 7.2600321463915925e+03 1.5447157157420643e+03 +run_energy: 5884.76273364903 +run_stress: ! |- + -4.3845231413255087e+03 -4.2028636554336808e+03 -5.8135612975015601e+03 -1.5544208427397948e+02 -6.2071051485646331e+02 -3.6919986493529041e+02 run_forces: ! |2 - 1 -2.4528067899599305e+03 -2.9341498758694834e+03 1.8474502628810092e+03 - 2 2.2849953443131358e+03 2.4832132528641532e+03 -1.9734041065370207e+03 - 3 2.4645121926310981e+02 5.6107471210645315e+01 -8.6795186329367851e+01 - 4 1.9616286871603430e+02 -3.4646936665248838e+01 1.4521984946881906e+02 - 5 4.4786043366163092e+01 7.0355159622163413e+01 -1.8206446229257014e+02 - 6 6.3014259396422148e+01 -2.3443604305372531e+01 7.3335878209082523e+01 - 7 -7.5439226250126969e+00 8.8159986346211809e+01 4.7619146069988375e+02 - 8 -5.2794374027797267e+02 -6.7850905833180059e+02 -3.0044325103852425e+03 - 9 5.0875826270523237e+02 5.9895242277843204e+02 2.5707270877003639e+03 - 10 2.2692333933019427e+01 2.2468607061589762e+02 1.0652917744563030e+02 - 11 4.9524433239219128e+01 1.3194159227606778e+02 1.8593459451158319e+02 - 12 -1.2924900910837812e+02 -1.0786813076932702e+02 7.2902771957494465e+01 - 13 -2.2563078857895891e+02 7.9098261816218340e+01 5.9928622881036187e-01 - 14 7.1714363938493051e+01 -1.4069611756278411e+01 1.9685384363446633e+02 - 15 5.3227157848209936e+00 -2.1039435001417377e+02 -8.2608217922982035e+01 - 16 -1.9602835424600102e+02 2.9522300430908854e+02 -1.8289236857613002e+02 - 17 4.5780760140603689e+01 -2.4655654127193632e+01 -1.6354736069382949e+02 - 18 1.4538209315245763e+03 1.8016876637042560e+02 5.1960640192178516e+03 - 19 -4.4445174898483028e+03 -3.2140466357034707e+03 -4.0221471271913274e+03 - 20 2.9906965583237265e+03 3.0338778693330451e+03 -1.1739168920265240e+03 - 21 -1.6853486613016630e+03 -1.8034506859630817e+03 5.9502858979499688e+03 - 22 -4.4700832926138246e+03 -1.4721556143241976e+03 -5.1672896924006909e+03 - 23 6.1554319539154876e+03 3.2756063002872793e+03 -7.8299620554927776e+02 - 24 2.0293017347310815e+03 -5.5779536635571512e+03 3.7011650252507684e+03 - 25 -6.3683824848081467e+03 -2.5625161247114107e+02 -4.9590463888100294e+03 - 26 4.3390807500770652e+03 5.8342052760282922e+03 1.2578813635592610e+03 - 27 6.4608153662309178e+02 -5.9696003016405839e+03 1.7149735844085783e+03 - 28 -5.5676765991366801e+03 1.3628574542763808e+03 -3.3980237947784067e+03 - 29 4.9215950625135883e+03 4.6067428473642030e+03 1.6830502103698284e+03 + 1 1.1497587459548581e+02 -3.0134053639733486e+02 -5.5394326744544264e+02 + 2 -3.0121516678697145e+02 -2.4887823122181376e+02 3.5273852242183267e+02 + 3 8.8702756404430119e+01 2.1544824891360236e+02 1.3945007763329784e+02 + 4 3.2775264128601054e+02 -9.1219172178726211e+01 2.3323183312068522e+02 + 5 7.3556102367448545e+01 1.1326896233131724e+02 -3.7511797717665678e+02 + 6 9.9466297462825793e+01 -1.5645376244148625e+02 -3.6263399717428968e+02 + 7 -3.2143491820697449e+01 1.6585417057363097e+02 8.2584194056142508e+02 + 8 1.0737388983457294e+02 1.1676075582747217e+01 9.5566838460734601e+01 + 9 -1.0877459135269622e+02 -1.1671924950460189e+02 -4.8125152852047523e+02 + 10 3.1667384803742323e+01 1.9054375788533659e+02 -1.0400421568986795e+02 + 11 8.3233114518030064e+01 2.0629020396092935e+02 3.3795539497434856e+02 + 12 -6.4227648365563454e+01 -1.1805744506498797e+01 -5.7954580742417818e+01 + 13 -3.8959106298784081e+02 1.5328193338989010e+02 7.1738554514714545e+00 + 14 1.4882906103106936e+02 -2.9762603602434805e+01 3.8599012783814413e+02 + 15 1.0952278856069599e+01 -3.9190994685554119e+02 -1.4052781259085856e+02 + 16 -4.8840857867583463e+02 4.9951580019580956e+02 4.8967691177140324e+02 + 17 2.9785113882991897e+02 -2.0778990612482565e+02 -7.9219212289333416e+02 + 18 9.2174776015331190e+00 1.4186347038357127e+02 -5.9336705410004004e+02 + 19 3.1316592594094425e+02 2.0103926118027346e+02 3.7774371438422179e+02 + 20 -3.2238340354247737e+02 -3.4290273156384472e+02 2.1562333971581825e+02 + 21 1.4829515554776452e+02 1.8610475098789786e+02 -5.6352560598646892e+02 + 22 2.7662982116380954e+02 6.7710238867027016e+01 4.3158562057592377e+02 + 23 -4.2492497671157406e+02 -2.5381498985492487e+02 1.3193998541054509e+02 + 24 -1.3251242352243315e+02 4.9999728551727469e+02 -3.0026542549110081e+02 + 25 3.9384182097177160e+02 -6.1985906721872603e+01 3.3098404829026578e+02 + 26 -2.6132939744933844e+02 -4.3801137879540209e+02 -3.0718622799164972e+01 + 27 -6.3078338900343454e+01 5.5761923243156696e+02 -1.8582319317055567e+02 + 28 3.9691070991064385e+02 -1.6975490780289928e+02 2.6785246403237801e+02 + 29 -3.3383237101030039e+02 -3.8786432462866770e+02 -8.2029270861822354e+01 ... diff --git a/unittest/force-styles/tests/bond-gromos.yaml b/unittest/force-styles/tests/bond-gromos.yaml index 591ebbbb7..14fc81b49 100644 --- a/unittest/force-styles/tests/bond-gromos.yaml +++ b/unittest/force-styles/tests/bond-gromos.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -53,37 +53,37 @@ init_forces: ! |2 27 2.7144514843627896e+01 2.5934786050804597e+01 8.1210486636920063e+00 28 -3.5319623664811428e+00 1.5178762340275660e+00 -2.3897600089130737e+00 29 -2.3612552477146753e+01 -2.7452662284832162e+01 -5.7312886547789326e+00 -run_energy: 13.1412074484263 +run_energy: 32.0991086197953 run_stress: ! |- - -1.7712817307543553e+01 9.9186570536460863e+01 -6.3071147544166974e+00 1.4368089067985522e+02 -5.7606550682183347e+01 1.7616664326524693e+02 + -4.8073464794278550e+02 -8.2777900460692445e+02 -5.9322822048461876e+02 4.4602479100490783e+01 1.0572617600226262e+02 -2.9197894291678909e+02 run_forces: ! |2 - 1 2.0069180740097899e+01 9.4022485548754133e+01 5.3539525505764772e+01 - 2 1.2872154456647905e+01 1.1728309670913815e+01 -1.3646438316538653e+01 - 3 -1.0851737454072588e+02 -9.0099644358626705e+01 2.4440973419201697e+01 - 4 3.2220343473495070e+01 -7.1247780002486332e+00 2.1731536625773387e+01 - 5 1.6306483804495421e+01 2.1846570781821811e+01 -6.6652071839457818e+01 - 6 1.8698800274051098e+02 -1.8272129568660995e+02 -3.0136854879483039e+01 - 7 -8.3949405309403051e+00 2.6280971485228651e+01 1.0903590830506668e+02 - 8 -1.2716234804514738e+02 1.0821158623332619e+02 -8.6908797762784417e+01 - 9 -3.9769735721222061e+00 -4.3749223075325601e+00 -1.8006043189314209e+01 - 10 -1.3241772755205346e+01 4.4240282053918648e+01 -5.7649112996825494e+01 - 11 7.8455687422309293e+00 1.7885926170222699e+01 3.0155850164259085e+01 - 12 -4.6654648606411833e+01 -4.0116895201730856e+01 2.2679926982676456e+01 - 13 2.8570434558709564e+01 -1.0627517074801393e+01 -4.4951531693236912e-01 - 14 -5.6628883708684112e+00 9.8274362882734767e-01 -1.4665176688583914e+01 - 15 -1.1971963532211141e+00 2.5586651427126576e+01 9.6559136667047980e+00 - 16 6.4628431973822643e+01 -5.3166692485369012e+01 -1.3648600470560012e+02 - 17 -5.4692457715367922e+01 3.7446218114779235e+01 1.5336038102607316e+02 - 18 4.1832430621016663e+01 2.5652919700358634e+01 5.7593570983602341e+01 - 19 -4.6802962707189259e+01 -3.0934968064775745e+01 -5.4490895634844236e+01 - 20 4.9705320861725975e+00 5.2820483644171112e+00 -3.1026753487581034e+00 - 21 4.7897081961244847e+00 -2.8605406833522649e+00 3.0977130920722566e+01 - 22 -1.7918556568867626e+01 -4.6703331955594800e+00 -2.7109680274275405e+01 - 23 1.3128848372743141e+01 7.5308738789117449e+00 -3.8674506464471587e+00 - 24 2.9449876229838878e+01 -2.1491535239090361e+01 3.1513526914075225e+01 - 25 -3.9014446040695326e+01 5.4402718063693252e+00 -3.2922267227318770e+01 - 26 9.5645698108564474e+00 1.6051263432721036e+01 1.4087403132435443e+00 - 27 -2.4578079502596559e+01 -2.7430420037351322e+01 -6.9425626040261061e+00 - 28 9.6689765005450079e-01 -4.0584177852906056e-01 6.4004063349765683e-01 - 29 2.3611181852542057e+01 2.7836261815880384e+01 6.3025219705284492e+00 + 1 -7.1818876902445538e+01 -2.9465569385050316e+02 -1.6462904135531033e+02 + 2 -3.8341693925478921e+01 -3.1654435799965224e+01 4.4927135224300905e+01 + 3 2.8288555816424054e+02 1.4308376051288076e+02 -5.6136706859589694e+01 + 4 2.5947430881561122e+01 -7.2229448128498932e+00 1.8436191785502796e+01 + 5 -5.5114273302098180e+00 -8.4577212631189553e+00 2.8043270271234558e+01 + 6 -2.5793486677349830e+02 2.4643546073094703e+02 5.1024384125995503e+01 + 7 -1.2831416591807185e+00 6.5083616457829647e+00 3.2283383086350774e+01 + 8 8.2113953284927163e+01 -7.7699260130092028e+01 2.7639459202596541e+01 + 9 2.7177589819458690e+00 2.9184553292673812e+00 1.2023424517125301e+01 + 10 6.3262657769639674e+01 -3.7321909987964787e+01 8.0297478870309320e+01 + 11 -8.2139800861651613e-01 -2.0327451727795691e+00 -3.3358229908702866e+00 + 12 1.3854315114874495e+01 3.7996509114354140e+00 -7.2774586434692701e+00 + 13 -5.6590782330737987e+01 2.2272586995327572e+01 1.0504136546360692e+00 + 14 1.5577440019020802e+01 -3.1118006743812514e+00 4.0384109419718968e+01 + 15 1.3393838229178983e+00 -4.7579062940992266e+01 -1.7054284194896660e+01 + 16 -1.2771811919644840e+02 1.3522519386665189e+02 1.0440089340428320e+02 + 17 7.2321808087488648e+01 -5.0507895359645936e+01 -1.9207682951791767e+02 + 18 -2.8610825699702662e+01 -1.0079088959943629e+01 -7.1362318752765262e+01 + 19 4.8195031078891418e+01 3.0917129694483332e+01 5.8230768822528695e+01 + 20 -1.9584205379188756e+01 -2.0838040734539703e+01 1.3131549930236570e+01 + 21 -7.3459634003063385e+00 1.0427752969446877e+00 -2.6533784247398714e+01 + 22 1.5372913566736457e+01 3.7538156879090763e+00 2.4031396257545762e+01 + 23 -8.0269501664301188e+00 -4.7965909848537640e+00 2.5023879898529522e+00 + 24 -2.2642762981781278e+01 7.8631980554510532e+00 -2.0723996592616704e+01 + 25 2.4966389680777311e+01 -3.9621505139784299e+00 2.0994567662107510e+01 + 26 -2.3236266989960326e+00 -3.9010475414726233e+00 -2.7057106949080761e-01 + 27 2.6833515765278801e+01 2.2651637996182501e+01 8.8947881383157821e+00 + 28 -5.3865928127562119e+00 2.3110492356429679e+00 -3.6370967411308390e+00 + 29 -2.1446922952522588e+01 -2.4962687231825470e+01 -5.2576913971849439e+00 ... diff --git a/unittest/force-styles/tests/bond-harmonic.yaml b/unittest/force-styles/tests/bond-harmonic.yaml index 155b28a25..0bbe86c3c 100644 --- a/unittest/force-styles/tests/bond-harmonic.yaml +++ b/unittest/force-styles/tests/bond-harmonic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -53,37 +53,37 @@ init_forces: ! |2 27 6.6999960289138851e+00 6.3808952243186141e+00 2.0100808779497248e+00 28 -8.8466157439236681e-01 3.8018717064230995e-01 -5.9857060538593476e-01 29 -5.8153344545215182e+00 -6.7610823949609244e+00 -1.4115102725637900e+00 -run_energy: 2.83684860023705 +run_energy: 4.7237520119515 run_stress: ! |- - -3.8845087273848591e+01 -8.1129831334544605e+01 -7.2148686127846176e+01 6.0616019783955668e+00 1.8209147944256966e+01 -1.9550003899165365e+01 + -7.6702592470736434e+01 -1.1639544474609609e+02 -9.6841110072418118e+01 -6.8952957303727382e+00 9.8789736990719863e+00 -4.2701363825407341e+01 run_forces: ! |2 - 1 -6.8241653268553852e+00 -2.9318562716153608e+01 -1.7288842008476450e+01 - 2 -4.4977044304336369e+00 -3.8337728675436282e+00 5.0461421358707099e+00 - 3 2.2021680087825608e+01 1.6602219779536021e+01 -3.5830697224507624e+00 - 4 6.5221791595560790e+00 -1.6768327218224681e+00 4.6889272682189098e+00 - 5 1.0214635110435490e-01 1.5611943221737712e-01 -5.0323627149029626e-01 - 6 -1.8635662486158147e+01 1.6654550461254956e+01 -4.0511489699458352e+00 - 7 -6.6385724496932808e-01 3.0468914215284397e+00 1.4336157841115863e+01 - 8 2.7199518446703106e+00 -2.3615257673626768e+00 1.2945878341881591e+00 - 9 -4.0546571195059888e-02 -4.2574614866484208e-02 -1.7930016735330342e-01 - 10 7.8293718314586460e+00 -8.8088917119527501e+00 2.0632944299945866e+00 - 11 1.4289449452688718e+00 3.5030228307558806e+00 5.7585599974007362e+00 - 12 7.1036941681672672e-01 -1.9280521842084131e+00 -4.9989138600792495e+00 - 13 -8.1055792591227274e+00 3.0496276199864645e+00 1.2620656378364231e-01 - 14 3.4610701659618148e+00 -5.7128292882003495e-01 8.9192549102655683e+00 - 15 1.9839135771552102e-01 -4.0967296313583157e+00 -1.5505984773608759e+00 - 16 -1.1166321863118815e+01 1.3119964300691947e+01 3.1795412792252655e+00 - 17 4.9397320214751650e+00 -3.4941707018827093e+00 -1.3257562782906669e+01 - 18 1.2483325913879641e+01 1.3063074718773587e+01 -6.8971702953266796e+00 - 19 -5.5501142419144456e-01 -3.6536974680872897e-01 -6.5214259764664040e-01 - 20 -1.1928314489688196e+01 -1.2697704971964857e+01 7.5493128929733198e+00 - 21 -2.4947171840915869e+00 -1.8301499314042944e+00 3.0384167705842424e+00 - 22 -1.2708061166290454e+00 -3.3104329489702544e-01 -1.9230876962606467e+00 - 23 3.7655233007206323e+00 2.1611932263013198e+00 -1.1153290743235955e+00 - 24 4.8856830027728240e+00 -9.4469527796070771e+00 7.4808498283266793e+00 - 25 -9.7142716248063898e+00 1.3432566023937309e+00 -8.1922635057573245e+00 - 26 4.8285886220335659e+00 8.1036961772133456e+00 7.1141367743064510e-01 - 27 2.5775039024618946e+00 -2.8811820695598049e+00 2.1511068222696847e+00 - 28 -3.6996573174115897e+00 1.5606345314733694e+00 -2.4509265379052949e+00 - 29 1.1221534149496948e+00 1.3205475380864353e+00 2.9981971563561016e-01 + 1 -5.8451344392107210e+00 -3.7483121056581091e+01 -2.7706589128026447e+01 + 2 -9.4646964300593677e+00 -7.8058897743406979e+00 1.1098831258492570e+01 + 3 3.1889039019082389e+01 2.7470464568297871e+01 -7.0188708351084586e+00 + 4 5.1779914557271312e+00 -1.4445033112355963e+00 3.6828852172469597e+00 + 5 -1.2141678843729751e+00 -1.8679023680624958e+00 6.1991888979069154e+00 + 6 -3.0808225922757817e+01 2.8638301737946140e+01 1.1798499743291408e+00 + 7 -2.0604913134024963e-01 1.0570940933189601e+00 5.2566880299481147e+00 + 8 1.2586545354340227e+01 -1.2400605739950080e+01 3.3101406401212161e+00 + 9 6.8844852713505145e-01 7.3814156375955120e-01 3.0433919394264826e+00 + 10 6.2881142291023862e+00 -3.0133124660445754e+00 9.4852680879825328e+00 + 11 -1.9539370656719479e-01 -4.8396221852557930e-01 -7.9389778192408134e-01 + 12 5.3016516940172149e+00 3.1848574584528206e+00 -3.1681386691207596e+00 + 13 -1.1614964074168244e+01 4.5711530408603673e+00 2.1568150395605271e-01 + 14 3.2149959555679350e+00 -6.4233206740591531e-01 8.3354242585640090e+00 + 15 2.7574103217787366e-01 -9.8043293854160094e+00 -3.5141694222449216e+00 + 16 -1.8568784275896846e+01 1.8015479832163017e+01 2.3561673238860777e+01 + 17 1.2494888597223211e+01 -8.7295339072366875e+00 -3.3167357210410103e+01 + 18 -7.0990354207248405e+00 -2.4743922643289666e+00 -1.7824398936159682e+01 + 19 1.2019842510974870e+01 7.7105128268768715e+00 1.4523712108141252e+01 + 20 -4.9208070902500296e+00 -5.2361205625479048e+00 3.3006868280184283e+00 + 21 -1.8548628650934149e+00 2.7467524264262122e-01 -6.7601469408617412e+00 + 22 3.9136757840663186e+00 9.5561415744904055e-01 6.1181929861632272e+00 + 23 -2.0588129189729036e+00 -1.2302894000916618e+00 6.4195395469851357e-01 + 24 -5.7681973234153086e+00 2.0209144998436366e+00 -5.2864044021513967e+00 + 25 6.3696975292216704e+00 -1.0109756418053095e+00 5.3564043759405795e+00 + 26 -6.0150020580636188e-01 -1.0099388580383271e+00 -6.9999973789182365e-02 + 27 6.8467535469188450e+00 5.7500299184200578e+00 2.2775780974490298e+00 + 28 -1.3929430925479587e+00 5.9772788540443345e-01 -9.4056106886485980e-01 + 29 -5.4538104543708865e+00 -6.3477578038244911e+00 -1.3370170285841700e+00 ... diff --git a/unittest/force-styles/tests/bond-harmonic_shift.yaml b/unittest/force-styles/tests/bond-harmonic_shift.yaml index d87cc2ead..bc8fa72d8 100644 --- a/unittest/force-styles/tests/bond-harmonic_shift.yaml +++ b/unittest/force-styles/tests/bond-harmonic_shift.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 6.6999960289138851e+00 6.3808952243186141e+00 2.0100808779497248e+00 28 -8.8466157439236681e-01 3.8018717064230995e-01 -5.9857060538593476e-01 29 -5.8153344545215182e+00 -6.7610823949609244e+00 -1.4115102725637900e+00 -run_energy: -9397.43390320649 +run_energy: -9395.58703375226 run_stress: ! |- - -3.2135965399593786e+01 -7.1712422470372175e+01 -6.6410824318688370e+01 4.8250446554134818e-01 1.6236760434270046e+01 -1.9287995276173849e+01 + -7.2589447210536790e+01 -1.0904313328767000e+02 -9.1935234541261991e+01 -1.2612420335553994e+01 5.3299965845050163e+00 -4.2659944975395902e+01 run_forces: ! |2 - 1 -6.6303898838191584e+00 -2.8540155815137123e+01 -1.6995001145232127e+01 - 2 -4.4914443059403117e+00 -3.8282418798639273e+00 5.0392721591329028e+00 - 3 1.7591417673398869e+01 1.9974572902366241e+01 -5.2938363024210489e-01 - 4 6.4883836353693614e+00 -1.6580826170131322e+00 4.6789938008736822e+00 - 5 2.0724239441280182e-01 3.2148168257803839e-01 -1.0297810237500977e+00 - 6 -1.5298295745114787e+01 1.3297233666849420e+01 -5.6122469344678159e+00 - 7 -5.6626354749956487e-01 2.6604061701082107e+00 1.2589796077359727e+01 - 8 3.1109983094295672e+00 -2.6023086908380129e+00 1.8890835228038811e+00 - 9 -3.5980989606644316e-02 -3.7784851407867907e-02 -1.5911800847063576e-01 - 10 5.4141058584997337e+00 -8.2177175323518785e+00 -9.0221872460218067e-01 - 11 1.6587182557942972e+00 4.0833237391465227e+00 6.7013831495489802e+00 - 12 1.4950243745263418e+00 -1.3750049399115731e+00 -6.4943897563532076e+00 - 13 -8.2274450538027200e+00 3.1013790514156261e+00 1.2406141038380615e-01 - 14 3.7558931325819436e+00 -6.1391854698194925e-01 9.6578452130228385e+00 - 15 1.8469192724602471e-01 -3.7589971090602265e+00 -1.4254584195655271e+00 - 16 -9.4528554729905565e+00 1.0591392580933361e+01 5.3139438097173288e+00 - 17 4.7961994375148027e+00 -3.3975778108317285e+00 -1.2846781500159452e+01 - 18 1.2483325913879641e+01 1.3063074718773587e+01 -6.8971702953266796e+00 - 19 -5.5501142419144456e-01 -3.6536974680872897e-01 -6.5214259764664040e-01 - 20 -1.1928314489688196e+01 -1.2697704971964857e+01 7.5493128929733198e+00 - 21 -2.4947171840915869e+00 -1.8301499314042944e+00 3.0384167705842424e+00 - 22 -1.2708061166290454e+00 -3.3104329489702544e-01 -1.9230876962606467e+00 - 23 3.7655233007206323e+00 2.1611932263013198e+00 -1.1153290743235955e+00 - 24 4.8856830027728240e+00 -9.4469527796070771e+00 7.4808498283266793e+00 - 25 -9.7142716248063898e+00 1.3432566023937309e+00 -8.1922635057573245e+00 - 26 4.8285886220335659e+00 8.1036961772133456e+00 7.1141367743064510e-01 - 27 2.5775039024618946e+00 -2.8811820695598049e+00 2.1511068222696847e+00 - 28 -3.6996573174115897e+00 1.5606345314733694e+00 -2.4509265379052949e+00 - 29 1.1221534149496948e+00 1.3205475380864353e+00 2.9981971563561016e-01 + 1 -5.8431205491152607e+00 -3.7474243038702568e+01 -2.7703412085602935e+01 + 2 -9.4646958112350887e+00 -7.8058892201171295e+00 1.1098830566448399e+01 + 3 2.4708409551762323e+01 3.4675671314169826e+01 -5.1288637730529310e+00 + 4 6.3750478451654438e+00 -1.7783405100755716e+00 4.5344409214171035e+00 + 5 -1.4974196503884174e+00 -2.3040423968543200e+00 7.6461112365825619e+00 + 6 -2.4551995934540248e+01 2.2204545563076426e+01 -2.9975478174894130e+00 + 7 -2.0519188980400765e-01 1.0530145554944690e+00 5.2367464962391823e+00 + 8 1.2590657592089489e+01 -1.2402895940827555e+01 3.3170187453616373e+00 + 9 6.8844902117982198e-01 7.3814210148612514e-01 3.0433941369479638e+00 + 10 3.6246664367591226e+00 -8.9147451598569605e-01 7.3101003596194323e+00 + 11 -2.4124026278305968e-01 -5.9754327716276923e-01 -9.8020098758628782e-01 + 12 8.0528249252622679e+00 5.3725750036554079e+00 -4.9120322990507921e+00 + 13 -1.4319368208650136e+01 5.6356175303245761e+00 2.6583914788969254e-01 + 14 3.9642399125798060e+00 -7.9194830048746834e-01 1.0277723568063539e+01 + 15 3.4002442214699219e-01 -1.2086780102099194e+01 -4.3323478916208442e+00 + 16 -1.6714713171453273e+01 1.5182228962210003e+01 2.6487031390011545e+01 + 17 1.2493425771024222e+01 -8.7286377281045535e+00 -3.3162831714177855e+01 + 18 -7.0990354207248405e+00 -2.4743922643289666e+00 -1.7824398936159682e+01 + 19 1.2019842510974870e+01 7.7105128268768715e+00 1.4523712108141252e+01 + 20 -4.9208070902500296e+00 -5.2361205625479048e+00 3.3006868280184283e+00 + 21 -1.8548628650934149e+00 2.7467524264262122e-01 -6.7601469408617412e+00 + 22 3.9136757840663186e+00 9.5561415744904055e-01 6.1181929861632272e+00 + 23 -2.0588129189729036e+00 -1.2302894000916618e+00 6.4195395469851357e-01 + 24 -5.7681973234153086e+00 2.0209144998436366e+00 -5.2864044021513967e+00 + 25 6.3696975292216704e+00 -1.0109756418053095e+00 5.3564043759405795e+00 + 26 -6.0150020580636188e-01 -1.0099388580383271e+00 -6.9999973789182365e-02 + 27 6.8467535469188450e+00 5.7500299184200578e+00 2.2775780974490298e+00 + 28 -1.3929430925479587e+00 5.9772788540443345e-01 -9.4056106886485980e-01 + 29 -5.4538104543708865e+00 -6.3477578038244911e+00 -1.3370170285841700e+00 ... diff --git a/unittest/force-styles/tests/bond-harmonic_shift_cut.yaml b/unittest/force-styles/tests/bond-harmonic_shift_cut.yaml index f6200ebad..9fe6db9b1 100644 --- a/unittest/force-styles/tests/bond-harmonic_shift_cut.yaml +++ b/unittest/force-styles/tests/bond-harmonic_shift_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/bond-hybrid.yaml b/unittest/force-styles/tests/bond-hybrid.yaml index 56267754c..9e2d6f9be 100644 --- a/unittest/force-styles/tests/bond-hybrid.yaml +++ b/unittest/force-styles/tests/bond-hybrid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -52,37 +52,37 @@ init_forces: ! |2 27 6.6999960289138851e+00 6.3808952243186141e+00 2.0100808779497248e+00 28 -8.8466157439236681e-01 3.8018717064230995e-01 -5.9857060538593476e-01 29 -5.8153344545215182e+00 -6.7610823949609244e+00 -1.4115102725637900e+00 -run_energy: 2.72020085611266 +run_energy: 4.58192378304031 run_stress: ! |- - -3.7602582117112696e+01 -7.5177491246772860e+01 -8.0496376546390593e+01 5.8650301198124719e+00 1.8568949712590435e+01 -1.7092803849573546e+01 + -9.0353248272565622e+01 -1.1407031680171363e+02 -9.9975980410455008e+01 3.5845955601508823e+00 4.2369916798759970e+00 -3.9987300080730968e+01 run_forces: ! |2 - 1 -5.7620229711696869e+00 -2.5260491623504663e+01 -1.5223222805378031e+01 - 2 -4.0687851261583159e+00 -3.4575616702945675e+00 4.5760484473173797e+00 - 3 1.9369911704623934e+01 1.1046188555404491e+01 -2.9524362244736047e-01 - 4 6.5316067081501794e+00 -1.6964534314417670e+00 4.6863926017456139e+00 - 5 1.0375744224750958e+00 1.5888436683858376e+00 -5.1654406551651846e+00 - 6 -1.8547456674617141e+01 1.6430043701092902e+01 -4.5851832091104177e+00 - 7 -6.6828311831073306e-01 3.0889832044221124e+00 1.4560663517158423e+01 - 8 3.0661838854451711e+00 -2.6232962080427971e+00 1.4955890131085310e+00 - 9 -7.9088093294027273e-02 -8.2693869800314665e-02 -3.4901905084988727e-01 - 10 7.3589409427634980e+00 -1.0251236193821910e+01 -1.9373930391790326e+00 - 11 2.3367507948564419e+00 5.7238486963636017e+00 9.4103181737417483e+00 - 12 -1.5057296559864404e+00 -4.2658894812025583e+00 -6.4218409320065728e+00 - 13 -6.7989870669322876e+00 2.5666290999906285e+00 9.8525201687339442e-02 - 14 3.8647266189743146e+00 -6.2670509497653226e-01 9.9150862546987142e+00 - 15 8.9917225641572396e-02 -1.8033052368122520e+00 -6.8525146606533316e-01 - 16 -1.1164622865977545e+01 1.3117018504572005e+01 3.1764757438731355e+00 - 17 4.9393632695159706e+00 -3.4939226203342146e+00 -1.3256504173129066e+01 - 18 1.2483325913879641e+01 1.3063074718773587e+01 -6.8971702953266796e+00 - 19 -5.5501142419144456e-01 -3.6536974680872897e-01 -6.5214259764664040e-01 - 20 -1.1928314489688196e+01 -1.2697704971964857e+01 7.5493128929733198e+00 - 21 -2.4947171840915869e+00 -1.8301499314042944e+00 3.0384167705842424e+00 - 22 -1.2708061166290454e+00 -3.3104329489702544e-01 -1.9230876962606467e+00 - 23 3.7655233007206323e+00 2.1611932263013198e+00 -1.1153290743235955e+00 - 24 4.8856830027728240e+00 -9.4469527796070771e+00 7.4808498283266793e+00 - 25 -9.7142716248063898e+00 1.3432566023937309e+00 -8.1922635057573245e+00 - 26 4.8285886220335659e+00 8.1036961772133456e+00 7.1141367743064510e-01 - 27 2.5775039024618946e+00 -2.8811820695598049e+00 2.1511068222696847e+00 - 28 -3.6996573174115897e+00 1.5606345314733694e+00 -2.4509265379052949e+00 - 29 1.1221534149496948e+00 1.3205475380864353e+00 2.9981971563561016e-01 + 1 -2.5355714435334491e+00 -2.7681329777791586e+01 -2.4105572996495791e+01 + 2 -9.4595798421626167e+00 -7.8013936780542137e+00 1.1093123124900577e+01 + 3 2.5502073307358618e+01 2.0284553867237541e+01 -1.8429306462728462e+01 + 4 9.2160506908549262e+00 -2.5712605737913434e+00 6.5547794411586731e+00 + 5 -2.1826524453151452e+00 -3.3579148840585682e+00 1.1145314182618996e+01 + 6 -2.8773268741045403e+01 2.6971912078545628e+01 2.5916134563765958e+00 + 7 -2.0616294083282705e-01 1.0577895753681701e+00 5.2602697663801292e+00 + 8 9.9932512376274012e+00 -1.0117222128908182e+01 2.0856380361567650e+00 + 9 6.8790355375569234e-01 7.3751719471271993e-01 3.0409017610649793e+00 + 10 7.0107766604854307e+00 -3.2450137606497456e+00 9.9127746385364244e+00 + 11 -3.4914913654342611e-01 -8.6478331824853993e-01 -1.4186052782841612e+00 + 12 1.1574594729457161e+01 7.7620866921993379e+00 -7.1036649259927831e+00 + 13 -2.0620929698324449e+01 8.1159139856811890e+00 3.8272112973340583e-01 + 14 5.7254505955055706e+00 -1.1436608616425221e+00 1.4843403868854542e+01 + 15 4.9057582703485275e-01 -1.7432358796244138e+01 -6.2485357226875564e+00 + 16 -1.8568250882408574e+01 1.8014698250093659e+01 2.3562502976920968e+01 + 17 1.2494888528086237e+01 -8.7295338644494045e+00 -3.3167356996513305e+01 + 18 -7.0990354207248405e+00 -2.4743922643289666e+00 -1.7824398936159682e+01 + 19 1.2019842510974870e+01 7.7105128268768715e+00 1.4523712108141252e+01 + 20 -4.9208070902500296e+00 -5.2361205625479048e+00 3.3006868280184283e+00 + 21 -1.8548628650934149e+00 2.7467524264262122e-01 -6.7601469408617412e+00 + 22 3.9136757840663186e+00 9.5561415744904055e-01 6.1181929861632272e+00 + 23 -2.0588129189729036e+00 -1.2302894000916618e+00 6.4195395469851357e-01 + 24 -5.7681973234153086e+00 2.0209144998436366e+00 -5.2864044021513967e+00 + 25 6.3696975292216704e+00 -1.0109756418053095e+00 5.3564043759405795e+00 + 26 -6.0150020580636188e-01 -1.0099388580383271e+00 -6.9999973789182365e-02 + 27 6.8467535469188450e+00 5.7500299184200578e+00 2.2775780974490298e+00 + 28 -1.3929430925479587e+00 5.9772788540443345e-01 -9.4056106886485980e-01 + 29 -5.4538104543708865e+00 -6.3477578038244911e+00 -1.3370170285841700e+00 ... diff --git a/unittest/force-styles/tests/bond-mm3.yaml b/unittest/force-styles/tests/bond-mm3.yaml index 8ffd94252..f93ee4ace 100644 --- a/unittest/force-styles/tests/bond-mm3.yaml +++ b/unittest/force-styles/tests/bond-mm3.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:12:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 6.4855564979522047e+00 6.1247764189743465e+00 1.9598858571712741e+00 28 -8.8893502113952572e-01 3.8202370302341726e-01 -6.0146206092167276e-01 29 -5.5966214768126790e+00 -6.5068001219977640e+00 -1.3584237962496013e+00 -run_energy: 2.7840031733222 +run_energy: 4.19044466577423 run_stress: ! |- - -3.3176349276076081e+01 -7.0861734750171834e+01 -6.6497177408580541e+01 4.3530530016090383e+00 1.7931488170109755e+01 -1.7412623564820610e+01 + -6.6268610382869184e+01 -9.5040491696347843e+01 -8.5107222328949291e+01 -8.0841795048724130e+00 9.0152703577335060e+00 -3.5164253155520257e+01 run_forces: ! |2 - 1 -5.5715410149592497e+00 -2.5251349741037203e+01 -1.5572905703664894e+01 - 2 -4.3455868180470922e+00 -3.6918164637020947e+00 4.8884563025928447e+00 - 3 1.8581527266815918e+01 1.5322067963758101e+01 -2.8763509151561468e+00 - 4 5.7385479601379714e+00 -1.4883245762717821e+00 4.1334941089743706e+00 - 5 5.3454960860393225e-02 8.2096985629985242e-02 -2.6591691336086609e-01 - 6 -1.6190718726895462e+01 1.4262929577764384e+01 -4.4940476295942577e+00 - 7 -5.7362650250441005e-01 2.6689302823817287e+00 1.2600172725439625e+01 - 8 2.8501589847864786e+00 -2.4475415953933073e+00 1.5189734371540622e+00 - 9 -2.4521717526374557e-02 -2.5781435282419579e-02 -1.0850209995152073e-01 - 10 7.2685702677797366e+00 -8.1602510048302062e+00 1.5022682965625678e+00 - 11 1.3549228094124424e+00 3.3256852283540939e+00 5.4632255772287239e+00 - 12 1.0270734000184392e+00 -1.6029979821696303e+00 -4.8276161180134318e+00 - 13 -8.0732724631956110e+00 3.0369790782484900e+00 1.2627794368744644e-01 - 14 3.3460034675656578e+00 -5.5270997101370589e-01 8.6260386304488001e+00 - 15 2.0286286854793842e-01 -4.2002361458244888e+00 -1.5894053678684026e+00 - 16 -1.0870817984958666e+01 1.2421541116694083e+01 4.8942055159079132e+00 - 17 5.2269632421618955e+00 -3.6992213173060264e+00 -1.4018367790386835e+01 - 18 1.1317439099744606e+01 1.2032816433828868e+01 -7.0977501357068000e+00 - 19 -3.8133884319280338e-02 -2.5101220081763645e-02 -4.4818244511718730e-02 - 20 -1.1279305215425325e+01 -1.2007715213747105e+01 7.1425683802185187e+00 - 21 -2.6039938274492735e+00 -1.8787138667440237e+00 2.9890541959606267e+00 - 22 -1.2255684072563606e+00 -3.1925432678461058e-01 -1.8546497129607979e+00 - 23 3.8295622347056342e+00 2.1979681935286344e+00 -1.1344044829998290e+00 - 24 5.1418191798260491e+00 -9.7969476502364596e+00 7.8173689980005641e+00 - 25 -1.0143244857709243e+01 1.4027589023443698e+00 -8.5540823785769291e+00 - 26 5.0014256778831943e+00 8.3941887478920894e+00 7.3671338057636482e-01 - 27 2.7160036274032340e+00 -2.8021217770496021e+00 2.2088718569043264e+00 - 28 -3.7520449433645222e+00 1.5828960332570374e+00 -2.4856758166887203e+00 - 29 1.0360413159612885e+00 1.2192257437925649e+00 2.7680395978439398e-01 + 1 -2.8655846330653549e+00 -2.7301257407331896e+01 -2.3027902478157920e+01 + 2 -8.8239889749662623e+00 -7.2771923470843580e+00 1.0347800028304571e+01 + 3 2.4090091957444152e+01 2.1355699418438260e+01 -8.0851434732816063e+00 + 4 4.9616802755596590e+00 -1.3842901723343841e+00 3.5291021572050170e+00 + 5 -1.2665576550622382e+00 -1.9486032828524888e+00 6.4673994370309567e+00 + 6 -2.7285296470302836e+01 2.4835518365283868e+01 -2.3414483554775094e+00 + 7 -2.0219685694408593e-01 1.0375028006355311e+00 5.1594504392151794e+00 + 8 1.3430668285612162e+01 -1.3090077991702238e+01 3.9328536947854555e+00 + 9 6.9811186977469375e-01 7.4851537603104712e-01 3.0861354877856866e+00 + 10 5.6222056398550997e+00 -2.1915793881943184e+00 8.5149344369773559e+00 + 11 -1.9674108047688685e-01 -4.8730527755134767e-01 -7.9937631000666987e-01 + 12 4.7074888413593641e+00 2.9591936007425215e+00 -2.9773580789184715e+00 + 13 -1.0733033708985973e+01 4.2240490925563021e+00 1.9930859687585123e-01 + 14 3.0375352800871656e+00 -6.0688465953462722e-01 7.8753629374529881e+00 + 15 2.5812913484894867e-01 -9.1786380177373843e+00 -3.2898967838863289e+00 + 16 -1.6666375915382154e+01 1.6153909507702309e+01 2.1228580855039155e+01 + 17 1.1233864010644540e+01 -7.8485596170667922e+00 -2.9819802590943709e+01 + 18 -6.2757522610211405e+00 -2.0148057274260118e+00 -1.6524875654914226e+01 + 19 1.1034361979356820e+01 7.0783428325941271e+00 1.3332952860227195e+01 + 20 -4.7586097183356797e+00 -5.0635371051681153e+00 3.1919227946870321e+00 + 21 -1.7575829323299708e+00 2.9085819569296201e-01 -6.5679040917394866e+00 + 22 3.7949735844781665e+00 9.2663009854327927e-01 5.9326284731797649e+00 + 23 -2.0373906521481957e+00 -1.2174882942362413e+00 6.3527561855972137e-01 + 24 -5.5511454062544772e+00 1.9808956638012745e+00 -5.1016854762023787e+00 + 25 6.1496142561543978e+00 -9.7604516922373974e-01 5.1713321286475011e+00 + 26 -5.9846884989992077e-01 -1.0048504945775347e+00 -6.9646652445122775e-02 + 27 6.6665282524316618e+00 5.5232057201309459e+00 2.2380005247759494e+00 + 28 -1.4036501637261825e+00 6.0232367732772429e-01 -9.4779117913535593e-01 + 29 -5.2628780887054791e+00 -6.1255293974586698e+00 -1.2902093456405934e+00 ... diff --git a/unittest/force-styles/tests/bond-morse.yaml b/unittest/force-styles/tests/bond-morse.yaml index 35b8d309f..fea8739e5 100644 --- a/unittest/force-styles/tests/bond-morse.yaml +++ b/unittest/force-styles/tests/bond-morse.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -52,37 +52,37 @@ init_forces: ! |2 27 9.3440280239221600e+00 8.8903193246933316e+00 2.8056881098030990e+00 28 -1.2392285181626443e+00 5.3256386141007839e-01 -8.3847404001650405e-01 29 -8.1047995057595159e+00 -9.4228831861034106e+00 -1.9672140697865950e+00 -run_energy: 2.93512285189547 +run_energy: 5.50926684761431 run_stress: ! |- - -3.1267924237437434e+01 -7.7178064407406936e+01 -7.4572643231772119e+01 1.3014493603880005e+01 2.0921266501526119e+01 -1.3402544258943628e+01 + -1.1113687839145564e+02 -1.3016150889234359e+02 -1.4923388171903545e+02 4.8767723596840229e+00 1.5143403262342982e+01 -4.8751226987843182e+01 run_forces: ! |2 - 1 -7.9782897331594516e+00 -2.7635492249481491e+01 -1.3185584565747471e+01 - 2 -2.0523781926098521e+00 -1.7443657459368178e+00 2.3077543476068776e+00 - 3 2.1730756816916443e+01 8.7795470509783868e+00 -1.8197697574427512e+00 - 4 7.0664804632073395e+00 -1.8424346114624681e+00 5.0573486784908388e+00 - 5 1.1477030718746297e+00 1.7412871497471325e+00 -5.6863495147956025e+00 - 6 -2.0392267920708051e+01 1.7186577883679512e+01 -1.0144536450282487e+01 - 7 -1.0505961556650811e+00 4.7766846328594976e+00 2.2422433551783566e+01 - 8 2.9453615500167256e+00 -2.1119950390766897e+00 2.1326154124333536e+00 - 9 -3.2924743415825569e-01 -3.4422903876528793e-01 -1.4529178750978800e+00 - 10 9.4915657011755776e+00 -1.1508588857399364e+01 -3.2964294453993653e-01 - 11 2.4068795295812935e+00 5.8756512305229496e+00 9.6725936037311033e+00 - 12 -2.3892652603353697e+00 -5.1165179952683895e+00 -5.7890543146688884e+00 - 13 -6.9084170863190266e+00 2.6061306737033436e+00 1.0100429670491046e-01 - 14 3.8845330174617585e+00 -6.3211029927418838e-01 9.9722691728496251e+00 - 15 9.4902474816440249e-02 -1.9112306616715593e+00 -7.2587167172707878e-01 - 16 -8.3030755036620096e+00 1.2330023321044887e+01 -1.0824196111117136e+01 - 17 6.3535466156689069e-01 -4.4893744419945164e-01 -1.7080958581810448e+00 - 18 1.7957969728657570e+01 1.7322107185310820e+01 -3.3780033338614492e+00 - 19 -4.4086320218577528e+00 -2.9041876446945807e+00 -5.1723085521178698e+00 - 20 -1.3549337706799816e+01 -1.4417919540616237e+01 8.5503118859793190e+00 - 21 -2.4258823844294564e+00 -2.3049533124775818e+00 5.9876217328634826e+00 - 22 -2.9133830811925550e+00 -7.5905907922828242e-01 -4.4082871396010610e+00 - 23 5.3392654656220113e+00 3.0640123917058641e+00 -1.5793345932624214e+00 - 24 8.1687687509411617e+00 -1.2535294430952119e+01 1.1259156626988446e+01 - 25 -1.4447730301886924e+01 2.0000528212963182e+00 -1.2185178183672727e+01 - 26 6.2789615509457635e+00 1.0535241609655801e+01 9.2602155668428099e-01 - 27 8.3432986828220290e-01 -5.5321449653710282e+00 1.8334651187311577e+00 - 28 -4.0752072342618000e+00 1.7169408304671268e+00 -2.6991936440855149e+00 - 29 3.2408773659795971e+00 3.8152041349039014e+00 8.6572852535435707e-01 + 1 1.0880544183848695e+00 -2.4698889013129453e+01 -2.8360395024403271e+01 + 2 -1.3085589330034784e+01 -1.0791794820976351e+01 1.5345293429044142e+01 + 3 3.0000413387893616e+01 1.5659495420000606e+01 -2.1438241993059407e+01 + 4 9.2229944804268253e+00 -2.5732964121426187e+00 6.5595366142913738e+00 + 5 -2.1814561355298676e+00 -3.3557234375543761e+00 1.1138598818675284e+01 + 6 -3.3099147338417730e+01 3.0713810680200734e+01 1.2003424373237586e+00 + 7 -3.7904819813309776e-01 1.9444135808962832e+00 9.6688934185754238e+00 + 8 9.7170141016581315e+00 -1.0407309391664576e+01 8.7557890892635870e-01 + 9 9.6064300048914708e-01 1.0299274553933901e+00 4.2465560687334287e+00 + 10 9.1401202064767055e+00 -4.7786949332564763e+00 1.1723599477715144e+01 + 11 -3.4844173677996804e-01 -8.6300228279432023e-01 -1.4157019583822816e+00 + 12 1.0880267431365700e+01 7.1002239951648871e+00 -6.6435677612463619e+00 + 13 -2.0622067427670380e+01 8.1163106020024891e+00 3.8276668072784015e-01 + 14 5.7256586340203617e+00 -1.1437341080475252e+00 1.4844032628850311e+01 + 15 4.9057841513525147e-01 -1.7433612552410441e+01 -6.2489531629434465e+00 + 16 -3.0077859933743756e+01 2.7248705046452365e+01 4.8028377014993993e+01 + 17 2.2567866024458972e+01 -1.5766829828134622e+01 -5.9906715597822298e+01 + 18 -9.7510372615676104e+00 -3.3621721115003256e+00 -2.4645773212633973e+01 + 19 1.6596893895405270e+01 1.0646648546665489e+01 2.0054043376108112e+01 + 20 -6.8458566338376601e+00 -7.2844764351651632e+00 4.5917298365258601e+00 + 21 -2.5706486327175679e+00 3.8572275005945000e-01 -9.3956684934112999e+00 + 22 5.4382779157078147e+00 1.3278885976298529e+00 8.5015414316194580e+00 + 23 -2.8676292829902468e+00 -1.7136113476893029e+00 8.9412706179184143e-01 + 24 -8.0049521598620359e+00 2.8096557459047862e+00 -7.3383372453473523e+00 + 25 8.8424855900366168e+00 -1.4034277655002851e+00 7.4358130472801243e+00 + 26 -8.3753343017458071e-01 -1.4062279804045013e+00 -9.7475801932771819e-02 + 27 9.5174260062416103e+00 7.9807291508991787e+00 3.1692684784658258e+00 + 28 -1.9439484950658219e+00 8.3415199277804775e-01 -1.3126130237272469e+00 + 29 -7.5734775111757884e+00 -8.8148811436772263e+00 -1.8566554547385787e+00 ... diff --git a/unittest/force-styles/tests/bond-nonlinear.yaml b/unittest/force-styles/tests/bond-nonlinear.yaml index e94504b83..cb3e10d14 100644 --- a/unittest/force-styles/tests/bond-nonlinear.yaml +++ b/unittest/force-styles/tests/bond-nonlinear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 5.5379883350610015e+00 5.2743959614633891e+00 1.6614192482961685e+00 28 -7.3112718591878911e-01 3.1420509745216413e-01 -4.9468774835180696e-01 29 -4.8068611491422129e+00 -5.5886010589155530e+00 -1.1667314999443616e+00 -run_energy: 1.60221401500865 +run_energy: 1.91075164149706 run_stress: ! |- - -1.7894426220952084e+01 -3.3728250509849055e+01 -3.8856295043767098e+01 2.1722529991079709e+00 1.5291493328513566e+01 -7.9128722449235616e+00 + -4.4707234295634244e+01 -4.7122785809543416e+01 -5.4247920545231537e+01 -6.0088885887139973e+00 1.7708076256400471e+00 -1.4186901411651000e+01 run_forces: ! |2 - 1 -2.0362867484181368e-01 -7.7661831831624930e+00 -7.8761234682409587e+00 - 2 -3.4810156667381889e+00 -2.9344101957342712e+00 3.9400789817696489e+00 - 3 8.2796441224152737e+00 4.0759969945626455e+00 -4.5893352700405661e+00 - 4 3.2276528980611054e+00 -8.5686664815065283e-01 2.3359777219616156e+00 - 5 -2.2516775106081222e-01 -3.4736191903190883e-01 1.1404605390580687e+00 - 6 -8.8542346965421714e+00 7.6299909019776004e+00 -3.1280947967649118e+00 - 7 -2.9805983103953754e-01 1.4811147991049112e+00 7.1034433619716104e+00 - 8 2.0031214069478711e+00 -1.5587637607176430e+00 1.4001390813777994e+00 - 9 -1.0140332348048609e-01 -1.0469732694123478e-01 -4.4478198451781953e-01 - 10 2.9840060497075021e+00 -4.1864303564181435e+00 7.3344758722653447e-01 - 11 6.9255892538096775e-01 1.7075497758508813e+00 2.7996396044598453e+00 - 12 1.9073891668891783e+00 1.0748897639146415e-01 -3.7162239795987126e+00 - 13 -5.6095723806988600e+00 2.1090225222189760e+00 8.9748198363543377e-02 - 14 2.2090020317687751e+00 -3.6613866307767151e-01 5.7018509483836928e+00 - 15 1.4966247043008624e-01 -3.1239358334207394e+00 -1.1807007085230758e+00 - 16 -6.7129019584804128e+00 6.9945739259779200e+00 6.4703764445552885e+00 - 17 4.0329472112815230e+00 -2.8609500094296401e+00 -1.0779902261441602e+01 - 18 1.0105124093497874e+01 1.1002636566890333e+01 -7.4894195218690358e+00 - 19 5.9949649966483409e-01 3.9453161227090916e-01 7.0491172696311766e-01 - 20 -1.0704620593162709e+01 -1.1397168179161241e+01 6.7845077949059185e+00 - 21 -2.3649659661129725e+00 -1.5838854024290856e+00 2.0081259559550184e+00 - 22 -7.2228945076560236e-01 -1.8813954668238861e-01 -1.0930904016107921e+00 - 23 3.0872554168785746e+00 1.7720249491114741e+00 -9.1503555434422634e-01 - 24 3.6571748459721380e+00 -7.9956268669134918e+00 5.9537747107205519e+00 - 25 -7.7800809120053129e+00 1.0752896813936306e+00 -6.5608657570067059e+00 - 26 4.1229060660331749e+00 6.9203371855198617e+00 6.0709104628615407e-01 - 27 2.9223831040004962e+00 -1.9428576702858418e+00 2.1116001356118566e+00 - 28 -3.3660917105146617e+00 1.4207882412977266e+00 -2.2301625565655043e+00 - 29 4.4370860651416555e-01 5.2206942898811515e-01 1.1856242095364797e-01 + 1 3.9783741433541926e+00 -4.9249338272427394e+00 -1.3348811949929276e+01 + 2 -7.8248982351878569e+00 -6.4526978643755477e+00 9.1767462579879773e+00 + 3 9.8895659635788338e+00 4.7823958949827041e+00 -6.2785040641233074e+00 + 4 2.6401226602445611e+00 -7.3675630581846008e-01 1.8779442728705489e+00 + 5 -6.2269995178045157e-01 -9.5807227255873917e-01 3.1802961573375210e+00 + 6 -1.0586144398889392e+01 9.9034629121405828e+00 8.8031488327838003e-01 + 7 -1.0476543109284715e-01 5.3802093323701772e-01 2.6760482949777402e+00 + 8 2.7659716419834774e+00 -3.5381751671579122e+00 -9.1534072721744464e-01 + 9 5.6823698610467566e-01 6.0912651164865939e-01 2.5117227249823975e+00 + 10 2.8748940473952107e+00 -1.5555484885643018e+00 3.6787884767455314e+00 + 11 -1.0098201140516190e-01 -2.5012967176610157e-01 -4.1030605093695544e-01 + 12 3.0574117031532908e+00 1.9563347614073701e+00 -1.8471021252433688e+00 + 13 -5.9443171809399935e+00 2.3393939016947112e+00 1.1039903385898853e-01 + 14 1.6445985825654528e+00 -3.2859910050188751e-01 4.2639822433356205e+00 + 15 1.4106605350898008e-01 -5.0168885928366693e+00 -1.7981835418362853e+00 + 16 -8.7750687923321387e+00 8.1035899963049509e+00 1.3226357951826753e+01 + 17 6.3986342197391668e+00 -4.4705236205936378e+00 -1.6984351837914822e+01 + 18 -5.8870736702730007e+00 -2.0558396440890752e+00 -1.4764124947913340e+01 + 19 9.9585538091931429e+00 6.3882227641417888e+00 1.2033078849530897e+01 + 20 -4.0714801389201423e+00 -4.3323831200527136e+00 2.7310460983824427e+00 + 21 -1.5358598722784684e+00 2.2731805545926798e-01 -5.5968971392714169e+00 + 22 3.2402513855276860e+00 7.9118006809622488e-01 5.0654487550301592e+00 + 23 -1.7043915132492176e+00 -1.0184981235554929e+00 5.3144838424125784e-01 + 24 -4.7767529699401621e+00 1.6736381649874592e+00 -4.3778029428516003e+00 + 25 5.2749051071089843e+00 -8.3721929134939066e-01 4.4357737993623889e+00 + 26 -4.9815213716882267e-01 -8.3641887363806855e-01 -5.7970856510788961e-02 + 27 5.6689348663930090e+00 4.7610101352811238e+00 1.8857394340922640e+00 + 28 -1.1532309600361186e+00 4.9486952942396550e-01 -7.7870085889179219e-01 + 29 -4.5157039063568902e+00 -5.2558796647050894e+00 -1.1070385752004719e+00 ... diff --git a/unittest/force-styles/tests/bond-table_linear.yaml b/unittest/force-styles/tests/bond-table_linear.yaml index 3632b3f80..307c9ef9b 100644 --- a/unittest/force-styles/tests/bond-table_linear.yaml +++ b/unittest/force-styles/tests/bond-table_linear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 6.6999960289139739e+00 6.3808952243177526e+00 2.0100808779500099e+00 28 -8.8466157439297377e-01 3.8018717064257085e-01 -5.9857060538634543e-01 29 -5.8153344545210004e+00 -6.7610823949603231e+00 -1.4115102725636643e+00 -run_energy: 2.86713114422879 +run_energy: 4.76945838689915 run_stress: ! |- - -3.8845087273852101e+01 -8.1129831334567086e+01 -7.2148686127809341e+01 6.0616019784099509e+00 1.8209147944267695e+01 -1.9550003899165137e+01 + -7.6702592470712077e+01 -1.1639544474610237e+02 -9.6841110072560340e+01 -6.8952957303959987e+00 9.8789736990903076e+00 -4.2701363825397813e+01 run_forces: ! |2 - 1 -6.8241653268560887e+00 -2.9318562716155409e+01 -1.7288842008476188e+01 - 2 -4.4977044304335196e+00 -3.8337728675435256e+00 5.0461421358705785e+00 - 3 2.2021680087834575e+01 1.6602219779537073e+01 -3.5830697224642147e+00 - 4 6.5221791595538914e+00 -1.6768327218219701e+00 4.6889272682175376e+00 - 5 1.0214635110197645e-01 1.5611943221374050e-01 -5.0323627147857308e-01 - 6 -1.8635662486160719e+01 1.6654550461257415e+01 -4.0511489699437782e+00 - 7 -6.6385724496941001e-01 3.0468914215288052e+00 1.4336157841117574e+01 - 8 2.7199518446720981e+00 -2.3615257673650500e+00 1.2945878341861583e+00 - 9 -4.0546571195019643e-02 -4.2574614866442075e-02 -1.7930016735312582e-01 - 10 7.8293718314629892e+00 -8.8088917119364698e+00 2.0632944300248117e+00 - 11 1.4289449452623866e+00 3.5030228307399689e+00 5.7585599973745820e+00 - 12 7.1036941682109289e-01 -1.9280521841876928e+00 -4.9989138600625491e+00 - 13 -8.1055792591237292e+00 3.0496276199868118e+00 1.2620656378368919e-01 - 14 3.4610701659581431e+00 -5.7128292881945608e-01 8.9192549102562637e+00 - 15 1.9839135771651495e-01 -4.0967296313793362e+00 -1.5505984773688137e+00 - 16 -1.1166321863120549e+01 1.3119964300694384e+01 3.1795412792232600e+00 - 17 4.9397320214753657e+00 -3.4941707018828492e+00 -1.3257562782907213e+01 - 18 1.2483325913879575e+01 1.3063074718773455e+01 -6.8971702953263447e+00 - 19 -5.5501142419161142e-01 -3.6536974680883855e-01 -6.5214259764683635e-01 - 20 -1.1928314489687963e+01 -1.2697704971964617e+01 7.5493128929731812e+00 - 21 -2.4947171840910114e+00 -1.8301499314039715e+00 3.0384167705841398e+00 - 22 -1.2708061166290832e+00 -3.3104329489703527e-01 -1.9230876962607060e+00 - 23 3.7655233007200946e+00 2.1611932263010067e+00 -1.1153290743234339e+00 - 24 4.8856830027728551e+00 -9.4469527796075567e+00 7.4808498283268863e+00 - 25 -9.7142716248066865e+00 1.3432566023937713e+00 -8.1922635057575697e+00 - 26 4.8285886220338314e+00 8.1036961772137861e+00 7.1141367743068373e-01 - 27 2.5775039024616855e+00 -2.8811820695599946e+00 2.1511068222696137e+00 - 28 -3.6996573174115555e+00 1.5606345314733532e+00 -2.4509265379052705e+00 - 29 1.1221534149498700e+00 1.3205475380866414e+00 2.9981971563565679e-01 + 1 -5.8451344392117903e+00 -3.7483121056583308e+01 -2.7706589128026593e+01 + 2 -9.4646964300589218e+00 -7.8058897743403310e+00 1.1098831258492048e+01 + 3 3.1889039019065883e+01 2.7470464568265545e+01 -7.0188708350007403e+00 + 4 5.1779914557248565e+00 -1.4445033112349632e+00 3.6828852172453432e+00 + 5 -1.2141678843521360e+00 -1.8679023680304336e+00 6.1991888978005143e+00 + 6 -3.0808225922758368e+01 2.8638301737946612e+01 1.1798499743290414e+00 + 7 -2.0604913134031405e-01 1.0570940933192907e+00 5.2566880299497587e+00 + 8 1.2586545354340217e+01 -1.2400605739950663e+01 3.3101406401195796e+00 + 9 6.8844852713521576e-01 7.3814156375972728e-01 3.0433919394272086e+00 + 10 6.2881142290906382e+00 -3.0133124660763184e+00 9.4852680879303470e+00 + 11 -1.9539370655407848e-01 -4.8396221849309168e-01 -7.9389778187078841e-01 + 12 5.3016516939944420e+00 3.1848574584394260e+00 -3.1681386691114475e+00 + 13 -1.1614964074140063e+01 4.5711530408492740e+00 2.1568150395552924e-01 + 14 3.2149959555618381e+00 -6.4233206740469684e-01 8.3354242585481924e+00 + 15 2.7574103217725426e-01 -9.8043293853939879e+00 -3.5141694222370270e+00 + 16 -1.8568784275898512e+01 1.8015479832165042e+01 2.3561673238860799e+01 + 17 1.2494888597223838e+01 -8.7295339072371263e+00 -3.3167357210411765e+01 + 18 -7.0990354207248938e+00 -2.4743922643292118e+00 -1.7824398936158808e+01 + 19 1.2019842510974424e+01 7.7105128268765855e+00 1.4523712108140714e+01 + 20 -4.9208070902495304e+00 -5.2361205625473737e+00 3.3006868280180939e+00 + 21 -1.8548628650936445e+00 2.7467524264233267e-01 -6.7601469408608654e+00 + 22 3.9136757840658900e+00 9.5561415744893585e-01 6.1181929861625566e+00 + 23 -2.0588129189722455e+00 -1.2302894000912685e+00 6.4195395469830840e-01 + 24 -5.7681973234151025e+00 2.0209144998428625e+00 -5.2864044021509322e+00 + 25 6.3696975292210611e+00 -1.0109756418052129e+00 5.3564043759400679e+00 + 26 -6.0150020580595853e-01 -1.0099388580376498e+00 -6.9999973789135431e-02 + 27 6.8467535469189338e+00 5.7500299184191981e+00 2.2775780974493118e+00 + 28 -1.3929430925485631e+00 5.9772788540469279e-01 -9.4056106886526802e-01 + 29 -5.4538104543703705e+00 -6.3477578038238907e+00 -1.3370170285840437e+00 ... diff --git a/unittest/force-styles/tests/bond-table_spline.yaml b/unittest/force-styles/tests/bond-table_spline.yaml index 493259eed..23ee0426d 100644 --- a/unittest/force-styles/tests/bond-table_spline.yaml +++ b/unittest/force-styles/tests/bond-table_spline.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 27 6.6999960289139757e+00 6.3808952243177517e+00 2.0100808779500108e+00 28 -8.8466157439297488e-01 3.8018717064257129e-01 -5.9857060538634621e-01 29 -5.8153344545210004e+00 -6.7610823949603231e+00 -1.4115102725636643e+00 -run_energy: 2.83684860023792 +run_energy: 4.72375201195192 run_stress: ! |- - -3.8845087273850957e+01 -8.1129831334566575e+01 -7.2148686127808588e+01 6.0616019784095654e+00 1.8209147944267901e+01 -1.9550003899165077e+01 + -7.6702592470711849e+01 -1.1639544474610187e+02 -9.6841110072560610e+01 -6.8952957303961480e+00 9.8789736990907233e+00 -4.2701363825397443e+01 run_forces: ! |2 - 1 -6.8241653268561349e+00 -2.9318562716155551e+01 -1.7288842008476234e+01 - 2 -4.4977044304335196e+00 -3.8337728675435252e+00 5.0461421358705776e+00 - 3 2.2021680087835179e+01 1.6602219779537208e+01 -3.5830697224642041e+00 - 4 6.5221791595534153e+00 -1.6768327218218488e+00 4.6889272682171956e+00 - 5 1.0214635110190066e-01 1.5611943221362445e-01 -5.0323627147819949e-01 - 6 -1.8635662486160726e+01 1.6654550461257418e+01 -4.0511489699437710e+00 - 7 -6.6385724496940923e-01 3.0468914215288043e+00 1.4336157841117572e+01 - 8 2.7199518446720981e+00 -2.3615257673650500e+00 1.2945878341861579e+00 - 9 -4.0546571195019546e-02 -4.2574614866441970e-02 -1.7930016735312537e-01 - 10 7.8293718314630532e+00 -8.8088917119363170e+00 2.0632944300250675e+00 - 11 1.4289449452623233e+00 3.5030228307398139e+00 5.7585599973743271e+00 - 12 7.1036941682038046e-01 -1.9280521841878357e+00 -4.9989138600627943e+00 - 13 -8.1055792591230347e+00 3.0496276199865506e+00 1.2620656378367839e-01 - 14 3.4610701659581808e+00 -5.7128292881946285e-01 8.9192549102563650e+00 - 15 1.9839135771649502e-01 -4.0967296313789250e+00 -1.5505984773686587e+00 - 16 -1.1166321863120551e+01 1.3119964300694386e+01 3.1795412792232600e+00 - 17 4.9397320214753666e+00 -3.4941707018828496e+00 -1.3257562782907215e+01 - 18 1.2483325913879574e+01 1.3063074718773453e+01 -6.8971702953263421e+00 - 19 -5.5501142419161198e-01 -3.6536974680883894e-01 -6.5214259764683702e-01 - 20 -1.1928314489687962e+01 -1.2697704971964615e+01 7.5493128929731794e+00 - 21 -2.4947171840910114e+00 -1.8301499314039718e+00 3.0384167705841412e+00 - 22 -1.2708061166290840e+00 -3.3104329489703554e-01 -1.9230876962607073e+00 - 23 3.7655233007200954e+00 2.1611932263010072e+00 -1.1153290743234341e+00 - 24 4.8856830027728533e+00 -9.4469527796075567e+00 7.4808498283268863e+00 - 25 -9.7142716248066847e+00 1.3432566023937711e+00 -8.1922635057575697e+00 - 26 4.8285886220338314e+00 8.1036961772137861e+00 7.1141367743068373e-01 - 27 2.5775039024616855e+00 -2.8811820695599959e+00 2.1511068222696141e+00 - 28 -3.6996573174115563e+00 1.5606345314733534e+00 -2.4509265379052709e+00 - 29 1.1221534149498709e+00 1.3205475380866423e+00 2.9981971563565696e-01 + 1 -5.8451344392117903e+00 -3.7483121056583308e+01 -2.7706589128026593e+01 + 2 -9.4646964300589218e+00 -7.8058897743403310e+00 1.1098831258492048e+01 + 3 3.1889039019065802e+01 2.7470464568265260e+01 -7.0188708349998414e+00 + 4 5.1779914557247793e+00 -1.4445033112349415e+00 3.6828852172452882e+00 + 5 -1.2141678843519697e+00 -1.8679023680301776e+00 6.1991888977996652e+00 + 6 -3.0808225922758375e+01 2.8638301737946620e+01 1.1798499743290431e+00 + 7 -2.0604913134031413e-01 1.0570940933192909e+00 5.2566880299497605e+00 + 8 1.2586545354340217e+01 -1.2400605739950663e+01 3.3101406401195796e+00 + 9 6.8844852713521576e-01 7.3814156375972728e-01 3.0433919394272086e+00 + 10 6.2881142290906169e+00 -3.0133124660763646e+00 9.4852680879302778e+00 + 11 -1.9539370655406080e-01 -4.8396221849304788e-01 -7.9389778187071658e-01 + 12 5.3016516939945593e+00 3.1848574584388780e+00 -3.1681386691111046e+00 + 13 -1.1614964074139955e+01 4.5711530408492305e+00 2.1568150395552721e-01 + 14 3.2149959555616299e+00 -6.4233206740465520e-01 8.3354242585476523e+00 + 15 2.7574103217723872e-01 -9.8043293853934355e+00 -3.5141694222368298e+00 + 16 -1.8568784275898512e+01 1.8015479832165042e+01 2.3561673238860799e+01 + 17 1.2494888597223838e+01 -8.7295339072371263e+00 -3.3167357210411765e+01 + 18 -7.0990354207248965e+00 -2.4743922643292127e+00 -1.7824398936158808e+01 + 19 1.2019842510974426e+01 7.7105128268765863e+00 1.4523712108140716e+01 + 20 -4.9208070902495296e+00 -5.2361205625473737e+00 3.3006868280180934e+00 + 21 -1.8548628650936454e+00 2.7467524264233190e-01 -6.7601469408608637e+00 + 22 3.9136757840658896e+00 9.5561415744893574e-01 6.1181929861625557e+00 + 23 -2.0588129189722442e+00 -1.2302894000912676e+00 6.4195395469830796e-01 + 24 -5.7681973234151016e+00 2.0209144998428621e+00 -5.2864044021509304e+00 + 25 6.3696975292210603e+00 -1.0109756418052127e+00 5.3564043759400661e+00 + 26 -6.0150020580595820e-01 -1.0099388580376494e+00 -6.9999973789135403e-02 + 27 6.8467535469189329e+00 5.7500299184191963e+00 2.2775780974493118e+00 + 28 -1.3929430925485637e+00 5.9772788540469313e-01 -9.4056106886526847e-01 + 29 -5.4538104543703696e+00 -6.3477578038238898e+00 -1.3370170285840433e+00 ... diff --git a/unittest/force-styles/tests/bond-zero.yaml b/unittest/force-styles/tests/bond-zero.yaml index e7e71cf88..9c8771246 100644 --- a/unittest/force-styles/tests/bond-zero.yaml +++ b/unittest/force-styles/tests/bond-zero.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:34 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-addforce_const.yaml b/unittest/force-styles/tests/fix-timestep-addforce_const.yaml index 99ffda3de..bc20d6615 100644 --- a/unittest/force-styles/tests/fix-timestep-addforce_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-addforce_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 20:56:35 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-addforce_variable.yaml b/unittest/force-styles/tests/fix-timestep-addforce_variable.yaml index ab7acf03f..50b9de0c4 100644 --- a/unittest/force-styles/tests/fix-timestep-addforce_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-addforce_variable.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 20:56:35 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-aveforce_const.yaml b/unittest/force-styles/tests/fix-timestep-aveforce_const.yaml index e4da0e595..5495e5191 100644 --- a/unittest/force-styles/tests/fix-timestep-aveforce_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-aveforce_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 20:59:48 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-aveforce_variable.yaml b/unittest/force-styles/tests/fix-timestep-aveforce_variable.yaml index 6971524c1..d374c73a9 100644 --- a/unittest/force-styles/tests/fix-timestep-aveforce_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-aveforce_variable.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 20:59:48 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-drag.yaml b/unittest/force-styles/tests/fix-timestep-drag.yaml index 21278ec22..9b5791f55 100644 --- a/unittest/force-styles/tests/fix-timestep-drag.yaml +++ b/unittest/force-styles/tests/fix-timestep-drag.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:19:50 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-efield_const.yaml b/unittest/force-styles/tests/fix-timestep-efield_const.yaml index 9c71d92e9..394af87fa 100644 --- a/unittest/force-styles/tests/fix-timestep-efield_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-efield_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:58:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-efield_region.yaml b/unittest/force-styles/tests/fix-timestep-efield_region.yaml index abe26b057..f45b6c05c 100644 --- a/unittest/force-styles/tests/fix-timestep-efield_region.yaml +++ b/unittest/force-styles/tests/fix-timestep-efield_region.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:58:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-efield_variable.yaml b/unittest/force-styles/tests/fix-timestep-efield_variable.yaml index f30e173de..94137f59b 100644 --- a/unittest/force-styles/tests/fix-timestep-efield_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-efield_variable.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:58:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-heat.yaml b/unittest/force-styles/tests/fix-timestep-heat.yaml index a5ecba4dd..bfd51fb2a 100644 --- a/unittest/force-styles/tests/fix-timestep-heat.yaml +++ b/unittest/force-styles/tests/fix-timestep-heat.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 11:33:32 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-heat_region.yaml b/unittest/force-styles/tests/fix-timestep-heat_region.yaml index 23d39e93f..1439af67a 100644 --- a/unittest/force-styles/tests/fix-timestep-heat_region.yaml +++ b/unittest/force-styles/tests/fix-timestep-heat_region.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 11:33:32 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-lineforce.yaml b/unittest/force-styles/tests/fix-timestep-lineforce.yaml index e9a9a4939..31ce0a5ef 100644 --- a/unittest/force-styles/tests/fix-timestep-lineforce.yaml +++ b/unittest/force-styles/tests/fix-timestep-lineforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 07:00:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-momentum.yaml b/unittest/force-styles/tests/fix-timestep-momentum.yaml index 5b82c5449..afaf4a3e2 100644 --- a/unittest/force-styles/tests/fix-timestep-momentum.yaml +++ b/unittest/force-styles/tests/fix-timestep-momentum.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Wed Aug 19 14:56:05 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-momentum_chunk.yaml b/unittest/force-styles/tests/fix-timestep-momentum_chunk.yaml index f568a9b08..7946b82f7 100644 --- a/unittest/force-styles/tests/fix-timestep-momentum_chunk.yaml +++ b/unittest/force-styles/tests/fix-timestep-momentum_chunk.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Wed Aug 19 15:06:58 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-nph.yaml b/unittest/force-styles/tests/fix-timestep-nph.yaml index 51c80756e..0eb8716aa 100644 --- a/unittest/force-styles/tests/fix-timestep-nph.yaml +++ b/unittest/force-styles/tests/fix-timestep-nph.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml b/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml index 7cbaae563..3f71f8d87 100644 --- a/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml +++ b/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 2e-12 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-npt_iso.yaml b/unittest/force-styles/tests/fix-timestep-npt_iso.yaml index 7dceafc1f..365b01c29 100644 --- a/unittest/force-styles/tests/fix-timestep-npt_iso.yaml +++ b/unittest/force-styles/tests/fix-timestep-npt_iso.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-npt_tri.yaml b/unittest/force-styles/tests/fix-timestep-npt_tri.yaml index 337b3d94e..b4093b7a3 100644 --- a/unittest/force-styles/tests/fix-timestep-npt_tri.yaml +++ b/unittest/force-styles/tests/fix-timestep-npt_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 5e-12 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-nve.yaml b/unittest/force-styles/tests/fix-timestep-nve.yaml index 3b564d51f..8626163bd 100644 --- a/unittest/force-styles/tests/fix-timestep-nve.yaml +++ b/unittest/force-styles/tests/fix-timestep-nve.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:40 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-nve_limit.yaml b/unittest/force-styles/tests/fix-timestep-nve_limit.yaml index b95f4a984..56f9873dd 100644 --- a/unittest/force-styles/tests/fix-timestep-nve_limit.yaml +++ b/unittest/force-styles/tests/fix-timestep-nve_limit.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Wed Aug 19 14:50:41 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-nve_noforce.yaml b/unittest/force-styles/tests/fix-timestep-nve_noforce.yaml index 7a4bff0af..7bb02e787 100644 --- a/unittest/force-styles/tests/fix-timestep-nve_noforce.yaml +++ b/unittest/force-styles/tests/fix-timestep-nve_noforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:57:37 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-nvt.yaml b/unittest/force-styles/tests/fix-timestep-nvt.yaml index ae16f9fbe..58eeee64d 100644 --- a/unittest/force-styles/tests/fix-timestep-nvt.yaml +++ b/unittest/force-styles/tests/fix-timestep-nvt.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 5e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-oneway.yaml b/unittest/force-styles/tests/fix-timestep-oneway.yaml index 66c92c6fc..4fcef41f5 100644 --- a/unittest/force-styles/tests/fix-timestep-oneway.yaml +++ b/unittest/force-styles/tests/fix-timestep-oneway.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 11:37:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-planeforce.yaml b/unittest/force-styles/tests/fix-timestep-planeforce.yaml index 828a122a1..836c440d6 100644 --- a/unittest/force-styles/tests/fix-timestep-planeforce.yaml +++ b/unittest/force-styles/tests/fix-timestep-planeforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:59:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml b/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml index 891dc4355..975d31692 100644 --- a/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml +++ b/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:44:09 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml b/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml index c461fdaf5..527086e59 100644 --- a/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml +++ b/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml b/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml index c23857f65..1d6daa003 100644 --- a/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml +++ b/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-restrain.yaml b/unittest/force-styles/tests/fix-timestep-restrain.yaml index a3c3ad877..b50455448 100644 --- a/unittest/force-styles/tests/fix-timestep-restrain.yaml +++ b/unittest/force-styles/tests/fix-timestep-restrain.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 15:29:32 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_group.yaml b/unittest/force-styles/tests/fix-timestep-rigid_group.yaml index a252c9ae1..a911989c2 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_group.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_group.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_molecule.yaml b/unittest/force-styles/tests/fix-timestep-rigid_molecule.yaml index 18ac7ea4e..0ecc6afe1 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_molecule.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_molecule.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_molecule_tri.yaml b/unittest/force-styles/tests/fix-timestep-rigid_molecule_tri.yaml index 1a495a93c..d1d1e9492 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_molecule_tri.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_molecule_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:36:31 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 5e-12 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nph.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nph.yaml index 712596142..84b1d8492 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nph.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nph.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:02:05 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nph_small.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nph_small.yaml index a3071c0b7..7844d7fcb 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nph_small.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nph_small.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:08:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_npt.yaml b/unittest/force-styles/tests/fix-timestep-rigid_npt.yaml index 4c7eeb1b2..8409597e0 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_npt.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_npt.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:48:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_npt_small.yaml b/unittest/force-styles/tests/fix-timestep-rigid_npt_small.yaml index 189d490e8..466f5ac5f 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_npt_small.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_npt_small.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:08:15 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:41 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nve_group.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nve_group.yaml index d61dfb013..b11626104 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nve_group.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nve_group.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:29:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nve_molecule.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nve_molecule.yaml index 8d484c2d4..733ae4bed 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nve_molecule.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nve_molecule.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:29:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nve_single.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nve_single.yaml index 123acf559..19416939d 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nve_single.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nve_single.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:29:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nve_small.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nve_small.yaml index 08faeed50..799e039ba 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nve_small.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nve_small.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:37:07 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nvt.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nvt.yaml index 4d5a8b6a4..d2950b829 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nvt.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nvt.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:48:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_nvt_small.yaml b/unittest/force-styles/tests/fix-timestep-rigid_nvt_small.yaml index cf5a8ee79..5a500df24 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_nvt_small.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_nvt_small.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 10:08:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_single.yaml b/unittest/force-styles/tests/fix-timestep-rigid_single.yaml index ab37c9ac6..630cc3424 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_single.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_single.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-rigid_small.yaml b/unittest/force-styles/tests/fix-timestep-rigid_small.yaml index d9f527487..d729cd77b 100644 --- a/unittest/force-styles/tests/fix-timestep-rigid_small.yaml +++ b/unittest/force-styles/tests/fix-timestep-rigid_small.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 09:37:07 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-setforce_const.yaml b/unittest/force-styles/tests/fix-timestep-setforce_const.yaml index 72379e29c..0c55c7a87 100644 --- a/unittest/force-styles/tests/fix-timestep-setforce_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-setforce_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:16 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-setforce_region.yaml b/unittest/force-styles/tests/fix-timestep-setforce_region.yaml index e6e22e992..d1996c73f 100644 --- a/unittest/force-styles/tests/fix-timestep-setforce_region.yaml +++ b/unittest/force-styles/tests/fix-timestep-setforce_region.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 15:15:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-setforce_variable.yaml b/unittest/force-styles/tests/fix-timestep-setforce_variable.yaml index 8f85b9bda..71e96365d 100644 --- a/unittest/force-styles/tests/fix-timestep-setforce_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-setforce_variable.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:31:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-shake_angle.yaml b/unittest/force-styles/tests/fix-timestep-shake_angle.yaml index 7b8b7d89f..e2cc5cb36 100644 --- a/unittest/force-styles/tests/fix-timestep-shake_angle.yaml +++ b/unittest/force-styles/tests/fix-timestep-shake_angle.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-12 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-shake_bond.yaml b/unittest/force-styles/tests/fix-timestep-shake_bond.yaml index f36b1dc90..70e70215c 100644 --- a/unittest/force-styles/tests/fix-timestep-shake_bond.yaml +++ b/unittest/force-styles/tests/fix-timestep-shake_bond.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-12 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-smd_couple.yaml b/unittest/force-styles/tests/fix-timestep-smd_couple.yaml index 6f9a04ad7..3b2858ba0 100644 --- a/unittest/force-styles/tests/fix-timestep-smd_couple.yaml +++ b/unittest/force-styles/tests/fix-timestep-smd_couple.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:09:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-smd_tether.yaml b/unittest/force-styles/tests/fix-timestep-smd_tether.yaml index 38c4318ed..f25b7b033 100644 --- a/unittest/force-styles/tests/fix-timestep-smd_tether.yaml +++ b/unittest/force-styles/tests/fix-timestep-smd_tether.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:09:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-spring_chunk.yaml b/unittest/force-styles/tests/fix-timestep-spring_chunk.yaml index a29f2d6b0..c15135254 100644 --- a/unittest/force-styles/tests/fix-timestep-spring_chunk.yaml +++ b/unittest/force-styles/tests/fix-timestep-spring_chunk.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 14:12:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:42 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-spring_couple.yaml b/unittest/force-styles/tests/fix-timestep-spring_couple.yaml index 3d436c97b..66588fefa 100644 --- a/unittest/force-styles/tests/fix-timestep-spring_couple.yaml +++ b/unittest/force-styles/tests/fix-timestep-spring_couple.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 12:11:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-spring_rg.yaml b/unittest/force-styles/tests/fix-timestep-spring_rg.yaml index 512256240..fbd7e9d87 100644 --- a/unittest/force-styles/tests/fix-timestep-spring_rg.yaml +++ b/unittest/force-styles/tests/fix-timestep-spring_rg.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:28:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-spring_self.yaml b/unittest/force-styles/tests/fix-timestep-spring_self.yaml index 2741e0b90..0e8e85516 100644 --- a/unittest/force-styles/tests/fix-timestep-spring_self.yaml +++ b/unittest/force-styles/tests/fix-timestep-spring_self.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 13:49:05 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-spring_tether.yaml b/unittest/force-styles/tests/fix-timestep-spring_tether.yaml index 1451452a9..bdb2cad1d 100644 --- a/unittest/force-styles/tests/fix-timestep-spring_tether.yaml +++ b/unittest/force-styles/tests/fix-timestep-spring_tether.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 12:11:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 2e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml b/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml index d085588c4..8b05abe90 100644 --- a/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml +++ b/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 07:12:16 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-temp_csld.yaml b/unittest/force-styles/tests/fix-timestep-temp_csld.yaml index 8f37770a9..63940d626 100644 --- a/unittest/force-styles/tests/fix-timestep-temp_csld.yaml +++ b/unittest/force-styles/tests/fix-timestep-temp_csld.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 14:54:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml index ddd1846f4..02592f100 100644 --- a/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml +++ b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 14:53:58 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-temp_rescale.yaml b/unittest/force-styles/tests/fix-timestep-temp_rescale.yaml index 71146a43b..0df32c851 100644 --- a/unittest/force-styles/tests/fix-timestep-temp_rescale.yaml +++ b/unittest/force-styles/tests/fix-timestep-temp_rescale.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 12:17:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-wall_harmonic_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_harmonic_const.yaml index 36ed8a8a3..0f822964a 100644 --- a/unittest/force-styles/tests/fix-timestep-wall_harmonic_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-wall_harmonic_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sun Aug 9 16:30:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-wall_lj1043_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_lj1043_const.yaml index 4228a1932..db63a7678 100644 --- a/unittest/force-styles/tests/fix-timestep-wall_lj1043_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-wall_lj1043_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:39:07 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-wall_lj126_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_lj126_const.yaml index 5fc5e28ca..71b1498ac 100644 --- a/unittest/force-styles/tests/fix-timestep-wall_lj126_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-wall_lj126_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:37:32 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-wall_lj93_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_lj93_const.yaml index bbe201a02..7fa620fae 100644 --- a/unittest/force-styles/tests/fix-timestep-wall_lj93_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-wall_lj93_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:36:00 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/fix-timestep-wall_morse_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_morse_const.yaml index d3be3cd11..65f82f8a8 100644 --- a/unittest/force-styles/tests/fix-timestep-wall_morse_const.yaml +++ b/unittest/force-styles/tests/fix-timestep-wall_morse_const.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 15:41:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:43 202 epsilon: 1e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/in.airebo b/unittest/force-styles/tests/in.airebo index d7d6f86f9..5c8d31e69 100644 --- a/unittest/force-styles/tests/in.airebo +++ b/unittest/force-styles/tests/in.airebo @@ -8,8 +8,8 @@ variable pair_style index 'zero 8.0' atom_style atomic atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.0005 units ${units} +timestep 0.0005 newton ${newton_pair} ${newton_bond} pair_style ${pair_style} diff --git a/unittest/force-styles/tests/in.colloid b/unittest/force-styles/tests/in.colloid index d03cfeb1b..14b301eac 100644 --- a/unittest/force-styles/tests/in.colloid +++ b/unittest/force-styles/tests/in.colloid @@ -9,8 +9,8 @@ variable pair_style index 'zero 8.0' atom_style ${atom_style} atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.01 units ${units} +timestep 0.01 newton ${newton_pair} ${newton_bond} region box block 0 1 0 1 0 1 diff --git a/unittest/force-styles/tests/in.fourmol b/unittest/force-styles/tests/in.fourmol index ca605cac9..37c1d92a0 100644 --- a/unittest/force-styles/tests/in.fourmol +++ b/unittest/force-styles/tests/in.fourmol @@ -16,8 +16,8 @@ variable t_target index 100.0 atom_style full atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.1 units ${units} +timestep 0.1 newton ${newton_pair} ${newton_bond} special_bonds lj/coul ${bond_factor} ${angle_factor} ${dihedral_factor} diff --git a/unittest/force-styles/tests/in.manybody b/unittest/force-styles/tests/in.manybody index b26936784..202c9d097 100644 --- a/unittest/force-styles/tests/in.manybody +++ b/unittest/force-styles/tests/in.manybody @@ -8,8 +8,8 @@ variable pair_style index 'zero 8.0' atom_style atomic atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.0001 units ${units} +timestep 0.0001 newton ${newton_pair} ${newton_bond} pair_style ${pair_style} diff --git a/unittest/force-styles/tests/in.manybody-charge b/unittest/force-styles/tests/in.manybody-charge index f9ca8816f..f03d9927d 100644 --- a/unittest/force-styles/tests/in.manybody-charge +++ b/unittest/force-styles/tests/in.manybody-charge @@ -8,8 +8,8 @@ variable pair_style index 'zero 8.0' atom_style charge atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.0001 units ${units} +timestep 0.0001 newton ${newton_pair} ${newton_bond} pair_style ${pair_style} diff --git a/unittest/force-styles/tests/in.metal b/unittest/force-styles/tests/in.metal index 6cf1dfc45..71b345b4d 100644 --- a/unittest/force-styles/tests/in.metal +++ b/unittest/force-styles/tests/in.metal @@ -8,8 +8,8 @@ variable pair_style index 'zero 8.0' atom_style atomic atom_modify map array neigh_modify delay 2 every 2 check no -timestep 0.0001 units ${units} +timestep 0.0001 newton ${newton_pair} ${newton_bond} pair_style ${pair_style} diff --git a/unittest/force-styles/tests/kspace-ewald.yaml b/unittest/force-styles/tests/kspace-ewald.yaml index 300c7086b..b0c9e4600 100644 --- a/unittest/force-styles/tests/kspace-ewald.yaml +++ b/unittest/force-styles/tests/kspace-ewald.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0867482734735914e-01 8.3574364736602638e-02 2.3859366585165909e-01 - 2 2.0274903616148196e-01 -2.8569598893839182e-01 -1.4769032550284392e-01 - 3 -3.4147604853950062e-02 -9.1090627204342915e-03 2.1035912070905265e-02 - 4 1.6406845115729854e-01 2.7543539883769418e-02 -8.1678227354518865e-02 - 5 1.5795249062185149e-01 7.5138560194176501e-02 -4.3111401163038729e-02 - 6 5.5863364748987443e-01 4.1079611179920561e-01 -7.0858771647783991e-01 - 7 -3.4237649725585267e-01 -4.0311543472850014e-01 4.1426662722349883e-01 - 8 -1.2874171503181930e-01 -6.1355649693097880e-01 3.7351123939364295e-01 - 9 1.7188247077160543e-01 3.1558133464946975e-01 2.9164486652103225e-02 - 10 -5.3387959585852449e-02 1.1160921489579331e-01 -1.9059202702325560e-02 - 11 -8.6636270972111143e-02 1.5449691819383507e-01 -4.3272636382879377e-02 - 12 4.6275716349434198e-01 -4.2637350337910229e-01 5.4575004324550480e-02 - 13 -1.5766852192008335e-01 1.1681031599219645e-01 2.0747636179675545e-02 - 14 -1.7360810164936916e-01 1.3766811932401099e-01 5.6897379083826688e-03 - 15 -1.3806462022003005e-01 8.4210856059166131e-02 -2.2212680975988292e-02 - 16 -3.5506080148101132e-01 4.4005918792192078e-01 5.1104392973553725e-01 - 17 1.4397140841118727e-01 -4.0692481244891143e-01 -7.6547412744407850e-01 - 18 7.7397436657562158e-01 1.6015897231975136e+00 -1.3411009805732605e+00 - 19 -2.7088413374068859e-01 -7.9215425933650285e-01 7.5604613371755158e-01 - 20 -4.2037849752144973e-01 -7.3410538126156533e-01 7.0882595972074158e-01 - 21 5.2076835975486691e-01 4.5601795499973558e-01 -1.1110809178173753e+00 - 22 -2.9120050706059641e-01 -8.0665791336783074e-02 5.6040742991458292e-01 - 23 -2.8866170450889661e-01 -2.5716209793518796e-01 5.3128223623838711e-01 - 24 7.6971773481289488e-02 1.6938942477865231e+00 -2.6190446160899106e-01 - 25 1.1759949732622851e-01 -6.8186152759768226e-01 2.1305657333424061e-01 - 26 -2.2405386988235390e-01 -9.4807680646299108e-01 6.5202747884286760e-02 - 27 -8.6788944488631092e-01 1.6456010755499724e+00 -8.8866425392486648e-01 - 28 5.7544277372884678e-01 -9.1125861496507965e-01 5.1442393569132128e-01 - 29 4.1466363894324065e-01 -8.0453174714178211e-01 4.1596367608693868e-01 + 1 -5.2089439143257787e-01 8.2317232242096278e-02 2.1785292073322313e-01 + 2 2.1559946019474233e-01 -2.8002551774503326e-01 -1.3609048160243994e-01 + 3 -3.4412784327182769e-02 -9.2897631047370102e-03 2.0067536385774416e-02 + 4 1.6312538925024278e-01 2.8731520420584754e-02 -7.8400903521826271e-02 + 5 1.6001861535984185e-01 7.5423176763206673e-02 -3.8313032621139741e-02 + 6 5.6441451368642770e-01 4.1634541172865080e-01 -6.7980463965392413e-01 + 7 -3.4227736460639763e-01 -4.0030357150456719e-01 3.9546239006936379e-01 + 8 -1.4016706554817285e-01 -6.1672064838720586e-01 3.4290917078195016e-01 + 9 1.8127669978482552e-01 3.1974904928290121e-01 4.8660904222038295e-02 + 10 -5.1827667908084740e-02 1.1079181109135029e-01 -1.4889551563932169e-02 + 11 -8.4859298579756048e-02 1.5133683817242191e-01 -3.9648952484906720e-02 + 12 4.5800477918468546e-01 -4.2660012366036421e-01 3.6671314912026971e-02 + 13 -1.5616935091357062e-01 1.1620744305444576e-01 2.6249618527001202e-02 + 14 -1.7243597760463406e-01 1.3669869683409275e-01 9.9059242639644041e-03 + 15 -1.3786552498555960e-01 8.5461447978300506e-02 -1.5166738474013980e-02 + 16 -3.4429097840017731e-01 4.3432797667171452e-01 5.3044572648552502e-01 + 17 1.3494315873345353e-01 -4.1248402247906329e-01 -7.8591218797391893e-01 + 18 7.3475168541998992e-01 1.5520945374068713e+00 -1.3838121245641224e+00 + 19 -2.6050639328655034e-01 -7.7645664569929240e-01 7.6976172951821942e-01 + 20 -3.9652825431975042e-01 -7.0655856735071820e-01 7.2956264579414265e-01 + 21 5.1904311754501509e-01 5.3442741567162244e-01 -1.1582076685782832e+00 + 22 -2.9439123277835261e-01 -1.1887861867458420e-01 5.8099151166289154e-01 + 23 -2.8804433912867961e-01 -2.8932470288680884e-01 5.5394173810088232e-01 + 24 6.4037058990125836e-02 1.7396986763494631e+00 -2.7663793187619495e-01 + 25 1.2855266913320779e-01 -7.0234366194767694e-01 2.2460525428186662e-01 + 26 -2.2254084062530557e-01 -9.7224311090704352e-01 7.3488665085030519e-02 + 27 -8.6033838028255860e-01 1.6506325046532162e+00 -9.3240488186160819e-01 + 28 5.7163992883923487e-01 -9.1726488340566514e-01 5.3821479146425921e-01 + 29 4.1214276860551768e-01 -8.0574990056817841e-01 4.4049725248815286e-01 ... diff --git a/unittest/force-styles/tests/kspace-ewald_disp.yaml b/unittest/force-styles/tests/kspace-ewald_disp.yaml index 52aa4e93c..0bf3fb828 100644 --- a/unittest/force-styles/tests/kspace-ewald_disp.yaml +++ b/unittest/force-styles/tests/kspace-ewald_disp.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -61,33 +61,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -1.4970266486362649e-01 3.4372403672876202e-02 -6.5598363251004863e-02 - 2 3.7999520337955200e-02 -6.4313758942463967e-02 6.5390226490930597e-02 - 3 -9.4699042180547335e-03 -1.4347533114199436e-03 -1.8680749006597026e-03 - 4 5.2770066475408009e-02 6.8071164226195359e-03 6.7183443764792031e-03 - 5 5.0741597149159795e-02 9.7173202717016783e-03 8.1934681538241190e-03 - 6 1.1720787447852149e-01 7.5943383913413778e-02 6.9069604251686983e-02 - 7 -6.2265418927775130e-02 -8.7713387989539010e-02 -7.0417651015392033e-02 - 8 -1.0392109030308579e-04 -1.1124471896924665e-01 -1.0008801432982679e-01 - 9 6.9424621676554066e-04 5.8940205711340662e-02 6.6305228803047470e-02 - 10 -2.0506179819220656e-02 2.3757997485892610e-02 2.1258927959209240e-02 - 11 -2.7729826204133584e-02 3.4328453007554646e-02 2.6048669604111854e-02 - 12 1.4978849443285450e-01 -7.5702211240702394e-02 -9.2725383317014395e-02 - 13 -6.1288731983262019e-02 2.7276880193503682e-02 3.5414115912437948e-02 - 14 -4.8353214411950708e-02 2.4585433180619863e-02 2.6716896438988967e-02 - 15 -4.6114444007539619e-02 1.0941391333662358e-02 2.9836552088380347e-02 - 16 -2.0359253373835512e-01 1.6630353142205662e-01 1.7862190375297360e-01 - 17 1.3931348283662512e-01 -1.4998358801992326e-01 -1.3186011141742607e-01 - 18 3.2398175811172431e-01 3.2679616866579642e-01 -2.8839563918461225e-01 - 19 -1.2638062952721285e-01 -1.5702881490198306e-01 1.0991030898118467e-01 - 20 -1.8426473351667028e-01 -1.8001654992675339e-01 1.4247375482690294e-01 - 21 3.5455481895372609e-01 -1.1747213799606931e-01 -2.7153323698836263e-01 - 22 -1.9597329228971030e-01 8.6163188748671043e-02 8.8768448969550398e-02 - 23 -1.4069009202321978e-01 4.7155301528435702e-02 1.0864344741902889e-01 - 24 1.8405465572886232e-01 3.1006078095362211e-01 1.3971862547044434e-01 - 25 -3.1717403234978236e-02 -1.2410865812518451e-01 -2.8711571503467006e-02 - 26 -1.4176552932905223e-01 -1.7697381880523280e-01 -8.6876906628073472e-02 - 27 -3.3409553366583589e-01 1.7551465655108667e-01 -1.7845147145117968e-01 - 28 2.1494386716472622e-01 -1.1601201834085181e-01 1.1525947738626424e-01 - 29 1.5796367096457195e-01 -5.6659796493483371e-02 7.8178423101572581e-02 + 1 -1.5321369646512287e-01 3.1811336640254428e-02 -7.5291966466499854e-02 + 2 4.1718499667107591e-02 -6.0993280056077008e-02 7.1251624481841025e-02 + 3 -9.5279894353951251e-03 -1.4941462712424192e-03 -2.3308420217005594e-03 + 4 5.2578632823907109e-02 7.1842522102449641e-03 8.4623035788519083e-03 + 5 5.1098021938378535e-02 9.7285355839204727e-03 1.0253349643675837e-02 + 6 1.1944881653432865e-01 7.6133381161564387e-02 8.1359427537698162e-02 + 7 -6.3591857746436040e-02 -8.6414432169993630e-02 -7.9109433076114163e-02 + 8 -3.7433525775956008e-03 -1.0990369365284677e-01 -1.1224509664376907e-01 + 9 3.4723473525535330e-03 5.8483564454419018e-02 7.3945790434835998e-02 + 10 -1.9931615263391753e-02 2.3230336652331492e-02 2.2930261922462034e-02 + 11 -2.7043515997570565e-02 3.3096788353233382e-02 2.7833272909244686e-02 + 12 1.4733114619496521e-01 -7.4907012571817977e-02 -9.9310508068793157e-02 + 13 -6.0568451603864093e-02 2.6904500638990563e-02 3.7502952815534972e-02 + 14 -4.7602620526011358e-02 2.4118387991499554e-02 2.8503007637066029e-02 + 15 -4.5640946475327245e-02 1.1215448404197493e-02 3.2219246480274404e-02 + 16 -2.0008038374075984e-01 1.6245819219836355e-01 1.8812371878208675e-01 + 17 1.3640979614708312e-01 -1.4877360903977560e-01 -1.3970849833566271e-01 + 18 3.1313062271288683e-01 3.0970376465951444e-01 -2.9690888050690195e-01 + 19 -1.2278633817042253e-01 -1.5053154281354220e-01 1.1083205911757414e-01 + 20 -1.7800087923017122e-01 -1.7031941581576107e-01 1.4510467117661957e-01 + 21 3.5089545735563610e-01 -9.5838434134800643e-02 -2.8233685525513896e-01 + 22 -1.9415564585497339e-01 7.5645499568197841e-02 9.1631181795561512e-02 + 23 -1.4017971783984279e-01 3.7892211453094168e-02 1.1299558998235543e-01 + 24 1.7884203136981469e-01 3.1247703983741304e-01 1.4068927063619113e-01 + 25 -2.7624350380010359e-02 -1.2477864845951722e-01 -2.6147141449362275e-02 + 26 -1.3999328961714030e-01 -1.7823800630539485e-01 -8.7261723908124589e-02 + 27 -3.3286289860045476e-01 1.7647878511351975e-01 -1.8733303262234685e-01 + 28 2.1399771535404677e-01 -1.1748172155357729e-01 1.2097428314785649e-01 + 29 1.5762446207378214e-01 -5.6888082076411807e-02 8.3371966274683518e-02 ... diff --git a/unittest/force-styles/tests/kspace-ewald_nozforce.yaml b/unittest/force-styles/tests/kspace-ewald_nozforce.yaml index c0ddcf9d2..d18f965ab 100644 --- a/unittest/force-styles/tests/kspace-ewald_nozforce.yaml +++ b/unittest/force-styles/tests/kspace-ewald_nozforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:14:07 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -60,33 +60,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0922198207275216e-01 8.3299374769207374e-02 0.0000000000000000e+00 - 2 2.0313997125119648e-01 -2.8559662507968914e-01 0.0000000000000000e+00 - 3 -3.4169529669450076e-02 -9.1320476095310878e-03 0.0000000000000000e+00 - 4 1.6415735470196405e-01 2.7630906100053938e-02 0.0000000000000000e+00 - 5 1.5801741050662524e-01 7.5219480567487992e-02 0.0000000000000000e+00 - 6 5.5924732284848488e-01 4.1159692353723032e-01 0.0000000000000000e+00 - 7 -3.4278065443293276e-01 -4.0379989711671849e-01 0.0000000000000000e+00 - 8 -1.2932327988973355e-01 -6.1414548453877604e-01 0.0000000000000000e+00 - 9 1.7224295378348622e-01 3.1583564204538828e-01 0.0000000000000000e+00 - 10 -5.3287915345397070e-02 1.1165778094386405e-01 0.0000000000000000e+00 - 11 -8.6512483505532381e-02 1.5455497998789855e-01 0.0000000000000000e+00 - 12 4.6260824709191073e-01 -4.2658119411285045e-01 0.0000000000000000e+00 - 13 -1.5764562974893831e-01 1.1682487185077797e-01 0.0000000000000000e+00 - 14 -1.7358231824085660e-01 1.3774426850511587e-01 0.0000000000000000e+00 - 15 -1.3804091748748470e-01 8.4301227071595833e-02 0.0000000000000000e+00 - 16 -3.5428477826991744e-01 4.4004208038718706e-01 0.0000000000000000e+00 - 17 1.4336979258817731e-01 -4.0685018683212876e-01 0.0000000000000000e+00 - 18 7.7410627953828881e-01 1.6016860432757520e+00 0.0000000000000000e+00 - 19 -2.7106489742044282e-01 -7.9223413845691382e-01 0.0000000000000000e+00 - 20 -4.2043235259953632e-01 -7.3414545899552996e-01 0.0000000000000000e+00 - 21 5.2066128136749024e-01 4.5609238431952892e-01 0.0000000000000000e+00 - 22 -2.9124694813290708e-01 -8.0658431270677095e-02 0.0000000000000000e+00 - 23 -2.8864262412198810e-01 -2.5712303806367826e-01 0.0000000000000000e+00 - 24 7.6818103390669135e-02 1.6938501771318075e+00 0.0000000000000000e+00 - 25 1.1774898875879186e-01 -6.8178289845849072e-01 0.0000000000000000e+00 - 26 -2.2401379838848151e-01 -9.4803798767516445e-01 0.0000000000000000e+00 - 27 -8.6795336552829527e-01 1.6456749267345261e+00 0.0000000000000000e+00 - 28 5.7535731007479385e-01 -9.1129108719960294e-01 0.0000000000000000e+00 - 29 4.1472845895276644e-01 -8.0463259181767532e-01 0.0000000000000000e+00 + 1 -5.2089990279583454e-01 8.2314471043996459e-02 0.0000000000000000e+00 + 2 2.1560341197423277e-01 -2.8002449702898446e-01 0.0000000000000000e+00 + 3 -3.4413005376679955e-02 -9.2899953440067507e-03 0.0000000000000000e+00 + 4 1.6312628179387048e-01 2.8732402502526046e-02 0.0000000000000000e+00 + 5 1.6001927562717189e-01 7.5423990941858671e-02 0.0000000000000000e+00 + 6 5.6442072297193735e-01 4.1635349742099120e-01 0.0000000000000000e+00 + 7 -3.4228145852366310e-01 -4.0031048562716876e-01 0.0000000000000000e+00 + 8 -1.4017296142731689e-01 -6.1672658931258117e-01 0.0000000000000000e+00 + 9 1.8128033150966946e-01 3.1975163436384418e-01 0.0000000000000000e+00 + 10 -5.1826650621327124e-02 1.1079230078036548e-01 0.0000000000000000e+00 + 11 -8.4858034544214520e-02 1.5133742179371709e-01 0.0000000000000000e+00 + 12 4.5800323052534841e-01 -4.2660221352090305e-01 0.0000000000000000e+00 + 13 -1.5616909666553355e-01 1.1620758592832427e-01 0.0000000000000000e+00 + 14 -1.7243570143086748e-01 1.3669946756500700e-01 0.0000000000000000e+00 + 15 -1.3786529163633698e-01 8.5462352264461222e-02 0.0000000000000000e+00 + 16 -3.4428311989239496e-01 4.3432783305049222e-01 0.0000000000000000e+00 + 17 1.3493710188450822e-01 -4.1248334036208734e-01 0.0000000000000000e+00 + 18 7.3475293747778847e-01 1.5520954288733613e+00 0.0000000000000000e+00 + 19 -2.6050821491708909e-01 -7.7645741589322581e-01 0.0000000000000000e+00 + 20 -3.9652876913465590e-01 -7.0655892980170176e-01 0.0000000000000000e+00 + 21 5.1904196697772176e-01 5.3442818669616998e-01 0.0000000000000000e+00 + 22 -2.9439168906771018e-01 -1.1887855568655381e-01 0.0000000000000000e+00 + 23 -2.8804411070522645e-01 -2.8932430841631773e-01 0.0000000000000000e+00 + 24 6.4035589865014717e-02 1.7396983199974689e+00 0.0000000000000000e+00 + 25 1.2855415975754714e-01 -7.0234290901900953e-01 0.0000000000000000e+00 + 26 -2.2254046991475446e-01 -9.7224275581524910e-01 0.0000000000000000e+00 + 27 -8.6033905536047861e-01 1.6506331623332311e+00 0.0000000000000000e+00 + 28 5.7163906149748867e-01 -9.1726518478577956e-01 0.0000000000000000e+00 + 29 4.1214346015178405e-01 -8.0575087494224429e-01 0.0000000000000000e+00 ... diff --git a/unittest/force-styles/tests/kspace-ewald_slab.yaml b/unittest/force-styles/tests/kspace-ewald_slab.yaml index db3df7e33..6b133a663 100644 --- a/unittest/force-styles/tests/kspace-ewald_slab.yaml +++ b/unittest/force-styles/tests/kspace-ewald_slab.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:13:06 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -60,33 +60,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.1961230445122764e-01 7.3575054602555187e-02 -5.8782096428192632e-01 - 2 2.0737787805944638e-01 -2.7767027752058837e-01 4.0659266771773472e-01 - 3 -3.4157183789806395e-02 -9.2872029558395599e-03 -1.3999532798838633e-02 - 4 1.6119110046521443e-01 2.8213855094480825e-02 7.5084865228924047e-02 - 5 1.6033190269875908e-01 7.6208487852502046e-02 1.1132609100506854e-01 - 6 5.5816641477874607e-01 4.0764127470290545e-01 2.0735398759101753e-01 - 7 -3.2378703810724269e-01 -3.9319841391731630e-01 -5.2600192619734398e-01 - 8 -1.4329109288808964e-01 -6.0719216040848112e-01 -4.7011357224994710e-01 - 9 1.8940418938467887e-01 3.1356657181921910e-01 5.8144817743273647e-01 - 10 -5.0661801622413370e-02 1.0963746206085294e-01 1.0771935003720641e-01 - 11 -8.4219594563415601e-02 1.5068732481535566e-01 1.2086035128812209e-01 - 12 4.5058066316352680e-01 -4.1965300997537580e-01 -4.4232729500288048e-01 - 13 -1.5285664247459638e-01 1.1407805589048045e-01 1.8500838861223956e-01 - 14 -1.6987452549004867e-01 1.3423386493466799e-01 1.7560310176136040e-01 - 15 -1.3422814848275488e-01 8.3779612871949335e-02 1.4301817966786870e-01 - 16 -3.2542370126003872e-01 4.2440677047308406e-01 1.4335299477840748e+00 - 17 9.6856707559469610e-02 -3.9089156801277541e-01 -1.6845244027602280e+00 - 18 7.4327290959697911e-01 1.5227435820791153e+00 -2.9781652275623647e+00 - 19 -2.7839567210225469e-01 -7.4881016624168151e-01 1.6126171023084344e+00 - 20 -3.8359735553826746e-01 -6.7326569047148088e-01 1.5161210715596880e+00 - 21 4.4499838541358216e-01 5.2614861393462908e-01 -2.5742849592390571e+00 - 22 -2.3781939875175795e-01 -1.3417062095022572e-01 1.2921387941874185e+00 - 23 -2.4865386687420440e-01 -2.9204348870999131e-01 1.2536524910607787e+00 - 24 -2.7009830231122915e-02 1.6399415444568417e+00 -1.8553269783213893e+00 - 25 1.7085514123353013e-01 -6.6072824112130302e-01 9.8605585674205232e-01 - 26 -1.8797937383041033e-01 -9.2896608996524477e-01 8.7828261535355356e-01 - 27 -8.9321057146686433e-01 1.6735627941182389e+00 -2.2616319987044329e+00 - 28 5.6823371983147408e-01 -9.2136775625072376e-01 1.2081850450570102e+00 - 29 4.4350908973911252e-01 -8.2118018320585484e-01 1.0995987727231249e+00 + 1 -5.3240971652478197e-01 7.2662007649900454e-02 -6.4319369060623865e-01 + 2 2.2032881756593048e-01 -2.7211835680193924e-01 4.4103068648940624e-01 + 3 -3.4442523560537473e-02 -9.4760570529239599e-03 -1.6456958006293293e-02 + 4 1.6024083918315699e-01 2.9472311151425422e-02 8.4899809110566327e-02 + 5 1.6261503246136524e-01 7.6511331500006385e-02 1.2281819080707146e-01 + 6 5.6441897462404023e-01 4.1344676319727597e-01 2.7483786019095929e-01 + 7 -3.2367777069768117e-01 -3.9036009334137783e-01 -5.8332682789170642e-01 + 8 -1.5581134124967011e-01 -6.1055500735975621e-01 -5.3657351140032716e-01 + 9 1.9938443843470044e-01 3.1796152466827426e-01 6.2450010174801451e-01 + 10 -4.8892582457538983e-02 1.0879847210697292e-01 1.1715923016758441e-01 + 11 -8.2148725964118818e-02 1.4740454521166788e-01 1.3116021963236582e-01 + 12 4.4505491208361719e-01 -4.1959653337744379e-01 -4.8065185547205869e-01 + 13 -1.5112416620011043e-01 1.1330201855747159e-01 1.9720626422247758e-01 + 14 -1.6841447561111805e-01 1.3315142218964690e-01 1.8666762212816290e-01 + 15 -1.3383846488923778e-01 8.4999260974757351e-02 1.5690684481513745e-01 + 16 -3.1328268415395372e-01 4.1914028562203065e-01 1.4905599445033182e+00 + 17 8.6544860254272910e-02 -3.9776769864878547e-01 -1.7431463319937088e+00 + 18 7.0232772906269469e-01 1.4701180246139793e+00 -3.0874003824638456e+00 + 19 -2.6819196904948334e-01 -7.3075435878278583e-01 1.6612303444152468e+00 + 20 -3.5852191542836981e-01 -6.4331427936359975e-01 1.5710944076581728e+00 + 21 4.4063933010913053e-01 6.0712871136926405e-01 -2.6801307674594952e+00 + 22 -2.3900037343651515e-01 -1.7454387596089130e-01 1.3411644457438909e+00 + 23 -2.4652348910112923e-01 -3.2571379987297244e-01 1.3056099466514122e+00 + 24 -3.8507158808220282e-02 1.6919960279067727e+00 -1.9377647455649583e+00 + 25 1.8219260769847390e-01 -6.8375891682469636e-01 1.0304856820631243e+00 + 26 -1.8859041735877854e-01 -9.5721094090409375e-01 9.1886856280288409e-01 + 27 -8.8792896329166382e-01 1.6758865392382769e+00 -2.3632721696314696e+00 + 28 5.6489553637327727e-01 -9.2622577936352402e-01 1.2615138269285648e+00 + 29 4.4266365993224582e-01 -8.2058354830293689e-01 1.1542032504117463e+00 ... diff --git a/unittest/force-styles/tests/kspace-ewald_tri.yaml b/unittest/force-styles/tests/kspace-ewald_tri.yaml index 386d50625..4141dd0cd 100644 --- a/unittest/force-styles/tests/kspace-ewald_tri.yaml +++ b/unittest/force-styles/tests/kspace-ewald_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -25,67 +25,67 @@ init_coul: 0 init_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 init_forces: ! |2 - 1 -5.2206771887658943e-01 8.2092716641334329e-02 2.1545324956261508e-01 - 2 2.1693903829318817e-01 -2.7927861552229305e-01 -1.3475460244562354e-01 - 3 -3.4431684378643801e-02 -9.3072637218381445e-03 1.9955288801521635e-02 - 4 1.6297859881038013e-01 2.8852601805448030e-02 -7.8017660002613662e-02 - 5 1.6019985134449477e-01 7.5436361467604754e-02 -3.7764143515459606e-02 - 6 5.6481531228200665e-01 4.1679985765871463e-01 -6.7651881147911153e-01 - 7 -3.4209721978750263e-01 -3.9984396831970670e-01 3.9336252837675573e-01 - 8 -1.4129044569095472e-01 -6.1689555678793007e-01 3.3944432308292943e-01 - 9 1.8222478940751916e-01 3.2011243047943372e-01 5.0862878355165030e-02 - 10 -5.1661247919076315e-02 1.1067475077169277e-01 -1.4424117291445063e-02 - 11 -8.4669875945943968e-02 1.5095743463211175e-01 -3.9244483347652757e-02 - 12 4.5741440577763515e-01 -4.2654712552449048e-01 3.4699693870060742e-02 - 13 -1.5597032418106432e-01 1.1611461366044702e-01 2.6848241030334750e-02 - 14 -1.7228226924755827e-01 1.3656996830861831e-01 1.0360775552908682e-02 - 15 -1.3781820350751567e-01 8.5592039476758322e-02 -1.4389247636706383e-02 - 16 -3.4310225376566400e-01 4.3356489402218990e-01 5.3260202948641322e-01 - 17 1.3398758000490049e-01 -4.1297852445140776e-01 -7.8816943288763353e-01 - 18 7.3018610540764362e-01 1.5461055670151038e+00 -1.3881536264098457e+00 - 19 -2.5925238656641114e-01 -7.7445922519024368e-01 7.7104511596189840e-01 - 20 -3.9378990654178680e-01 -7.0329956300491681e-01 7.3166048501802450e-01 - 21 5.1865366949828340e-01 5.4317145701042313e-01 -1.1631741076591826e+00 - 22 -2.9464392578389154e-01 -1.2315564069397771e-01 5.8314694239034537e-01 - 23 -2.8787383348123141e-01 -2.9290360518755271e-01 5.5633005396803725e-01 - 24 6.2598634622894167e-02 1.7443480404415288e+00 -2.7842233968885233e-01 - 25 1.2975379714426077e-01 -7.0440473186448149e-01 2.2596057943898584e-01 - 26 -2.2233830537492869e-01 -9.7471462858413116e-01 7.4488656828669883e-02 - 27 -8.5924682160715782e-01 1.6508884428561106e+00 -9.3704327419507161e-01 - 28 5.7108983323284834e-01 -9.1775706639800869e-01 5.4074973616906874e-01 - 29 4.1169480682986315e-01 -8.0573566099654348e-01 4.4310526866546374e-01 + 1 -5.2206771887658898e-01 8.2092716641337368e-02 2.1545324956261647e-01 + 2 2.1693903829318772e-01 -2.7927861552229527e-01 -1.3475460244562465e-01 + 3 -3.4431684378643836e-02 -9.3072637218380733e-03 1.9955288801521722e-02 + 4 1.6297859881038007e-01 2.8852601805447662e-02 -7.8017660002613953e-02 + 5 1.6019985134449496e-01 7.5436361467604379e-02 -3.7764143515459807e-02 + 6 5.6481531228200721e-01 4.1679985765871380e-01 -6.7651881147911297e-01 + 7 -3.4209721978750285e-01 -3.9984396831970576e-01 3.9336252837675645e-01 + 8 -1.4129044569095439e-01 -6.1689555678793073e-01 3.3944432308293065e-01 + 9 1.8222478940751941e-01 3.2011243047943272e-01 5.0862878355164669e-02 + 10 -5.1661247919076503e-02 1.1067475077169291e-01 -1.4424117291445116e-02 + 11 -8.4669875945944231e-02 1.5095743463211211e-01 -3.9244483347652709e-02 + 12 4.5741440577763587e-01 -4.2654712552449142e-01 3.4699693870061096e-02 + 13 -1.5597032418106480e-01 1.1611461366044705e-01 2.6848241030334650e-02 + 14 -1.7228226924755857e-01 1.3656996830861842e-01 1.0360775552908642e-02 + 15 -1.3781820350751586e-01 8.5592039476758239e-02 -1.4389247636706579e-02 + 16 -3.4310225376566489e-01 4.3356489402219101e-01 5.3260202948641344e-01 + 17 1.3398758000490121e-01 -4.1297852445140870e-01 -7.8816943288763264e-01 + 18 7.3018610540764506e-01 1.5461055670151134e+00 -1.3881536264098464e+00 + 19 -2.5925238656641181e-01 -7.7445922519024790e-01 7.7104511596189951e-01 + 20 -3.9378990654178675e-01 -7.0329956300492047e-01 7.3166048501802605e-01 + 21 5.1865366949828229e-01 5.4317145701042013e-01 -1.1631741076591837e+00 + 22 -2.9464392578389098e-01 -1.2315564069397629e-01 5.8314694239034626e-01 + 23 -2.8787383348123075e-01 -2.9290360518755121e-01 5.5633005396803736e-01 + 24 6.2598634622896110e-02 1.7443480404415359e+00 -2.7842233968885444e-01 + 25 1.2975379714425936e-01 -7.0440473186448460e-01 2.2596057943898670e-01 + 26 -2.2233830537492977e-01 -9.7471462858413394e-01 7.4488656828671271e-02 + 27 -8.5924682160715982e-01 1.6508884428561079e+00 -9.3704327419507039e-01 + 28 5.7108983323284945e-01 -9.1775706639800780e-01 5.4074973616906774e-01 + 29 4.1169480682986426e-01 -8.0573566099654215e-01 4.4310526866546252e-01 run_vdwl: 0 run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0867482734735914e-01 8.3574364736602638e-02 2.3859366585165909e-01 - 2 2.0274903616148196e-01 -2.8569598893839182e-01 -1.4769032550284392e-01 - 3 -3.4147604853950062e-02 -9.1090627204342915e-03 2.1035912070905265e-02 - 4 1.6406845115729854e-01 2.7543539883769418e-02 -8.1678227354518865e-02 - 5 1.5795249062185149e-01 7.5138560194176501e-02 -4.3111401163038729e-02 - 6 5.5863364748987443e-01 4.1079611179920561e-01 -7.0858771647783991e-01 - 7 -3.4237649725585267e-01 -4.0311543472850014e-01 4.1426662722349883e-01 - 8 -1.2874171503181930e-01 -6.1355649693097880e-01 3.7351123939364295e-01 - 9 1.7188247077160543e-01 3.1558133464946975e-01 2.9164486652103225e-02 - 10 -5.3387959585852449e-02 1.1160921489579331e-01 -1.9059202702325560e-02 - 11 -8.6636270972111143e-02 1.5449691819383507e-01 -4.3272636382879377e-02 - 12 4.6275716349434198e-01 -4.2637350337910229e-01 5.4575004324550480e-02 - 13 -1.5766852192008335e-01 1.1681031599219645e-01 2.0747636179675545e-02 - 14 -1.7360810164936916e-01 1.3766811932401099e-01 5.6897379083826688e-03 - 15 -1.3806462022003005e-01 8.4210856059166131e-02 -2.2212680975988292e-02 - 16 -3.5506080148101132e-01 4.4005918792192078e-01 5.1104392973553725e-01 - 17 1.4397140841118727e-01 -4.0692481244891143e-01 -7.6547412744407850e-01 - 18 7.7397436657562158e-01 1.6015897231975136e+00 -1.3411009805732605e+00 - 19 -2.7088413374068859e-01 -7.9215425933650285e-01 7.5604613371755158e-01 - 20 -4.2037849752144973e-01 -7.3410538126156533e-01 7.0882595972074158e-01 - 21 5.2076835975486691e-01 4.5601795499973558e-01 -1.1110809178173753e+00 - 22 -2.9120050706059641e-01 -8.0665791336783074e-02 5.6040742991458292e-01 - 23 -2.8866170450889661e-01 -2.5716209793518796e-01 5.3128223623838711e-01 - 24 7.6971773481289488e-02 1.6938942477865231e+00 -2.6190446160899106e-01 - 25 1.1759949732622851e-01 -6.8186152759768226e-01 2.1305657333424061e-01 - 26 -2.2405386988235390e-01 -9.4807680646299108e-01 6.5202747884286760e-02 - 27 -8.6788944488631092e-01 1.6456010755499724e+00 -8.8866425392486648e-01 - 28 5.7544277372884678e-01 -9.1125861496507965e-01 5.1442393569132128e-01 - 29 4.1466363894324065e-01 -8.0453174714178211e-01 4.1596367608693868e-01 + 1 -5.2089439143257799e-01 8.2317232242098817e-02 2.1785292073322454e-01 + 2 2.1559946019474163e-01 -2.8002551774503559e-01 -1.3609048160244133e-01 + 3 -3.4412784327182810e-02 -9.2897631047369339e-03 2.0067536385774475e-02 + 4 1.6312538925024311e-01 2.8731520420584529e-02 -7.8400903521826604e-02 + 5 1.6001861535984199e-01 7.5423176763206423e-02 -3.8313032621139879e-02 + 6 5.6441451368642892e-01 4.1634541172864981e-01 -6.7980463965392623e-01 + 7 -3.4227736460639940e-01 -4.0030357150456736e-01 3.9546239006936468e-01 + 8 -1.4016706554817343e-01 -6.1672064838720642e-01 3.4290917078195182e-01 + 9 1.8127669978482588e-01 3.1974904928290054e-01 4.8660904222037629e-02 + 10 -5.1827667908084761e-02 1.1079181109135051e-01 -1.4889551563932332e-02 + 11 -8.4859298579755937e-02 1.5133683817242244e-01 -3.9648952484906706e-02 + 12 4.5800477918468585e-01 -4.2660012366036376e-01 3.6671314912027568e-02 + 13 -1.5616935091357079e-01 1.1620744305444561e-01 2.6249618527001264e-02 + 14 -1.7243597760463414e-01 1.3669869683409269e-01 9.9059242639643920e-03 + 15 -1.3786552498555998e-01 8.5461447978299909e-02 -1.5166738474014323e-02 + 16 -3.4429097840017620e-01 4.3432797667171602e-01 5.3044572648552413e-01 + 17 1.3494315873345322e-01 -4.1248402247906291e-01 -7.8591218797391893e-01 + 18 7.3475168541999425e-01 1.5520945374068791e+00 -1.3838121245641217e+00 + 19 -2.6050639328655245e-01 -7.7645664569929562e-01 7.6976172951821931e-01 + 20 -3.9652825431975214e-01 -7.0655856735072198e-01 7.2956264579414165e-01 + 21 5.1904311754501320e-01 5.3442741567161767e-01 -1.1582076685782838e+00 + 22 -2.9439123277835166e-01 -1.1887861867458158e-01 5.8099151166289120e-01 + 23 -2.8804433912867861e-01 -2.8932470288680734e-01 5.5394173810088276e-01 + 24 6.4037058990129916e-02 1.7396986763494664e+00 -2.7663793187620117e-01 + 25 1.2855266913320554e-01 -7.0234366194767883e-01 2.2460525428186989e-01 + 26 -2.2254084062530785e-01 -9.7224311090704507e-01 7.3488665085034141e-02 + 27 -8.6033838028255971e-01 1.6506325046532140e+00 -9.3240488186161186e-01 + 28 5.7163992883923587e-01 -9.1726488340566459e-01 5.3821479146426088e-01 + 29 4.1214276860551841e-01 -8.0574990056817763e-01 4.4049725248815425e-01 ... diff --git a/unittest/force-styles/tests/kspace-msm.yaml b/unittest/force-styles/tests/kspace-msm.yaml index 054406a74..ce503e0d0 100644 --- a/unittest/force-styles/tests/kspace-msm.yaml +++ b/unittest/force-styles/tests/kspace-msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:35 202 epsilon: 5e-11 prerequisites: ! | atom full @@ -57,33 +57,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -1.2074180601843908e-01 2.3119965975574454e-02 -1.1855151386610419e-01 - 2 2.4443448954388814e-02 -3.8871920428097999e-02 9.9786657535481771e-02 - 3 -8.1103385046785870e-03 -4.4038690641984909e-04 -5.1479708255539221e-03 - 4 4.7356392723137478e-02 5.3496606673623824e-03 2.0930641412981482e-02 - 5 4.3722499283368813e-02 2.9084411025684402e-03 1.7532314875818043e-02 - 6 8.6205325437296670e-02 3.1132151345670982e-02 1.6403496748115701e-01 - 7 -4.8367922084493462e-02 -5.0733818464368745e-02 -1.3677089016914162e-01 - 8 2.0529391217276313e-02 -5.6229104146331463e-02 -1.6966239180338430e-01 - 9 -2.0919460267992115e-02 2.5416730672516093e-02 8.6327071965656921e-02 - 10 -2.1260287609426037e-02 1.6896602480217661e-02 2.9805778614241166e-02 - 11 -2.6787203590662192e-02 2.7002448821367347e-02 3.7866163729568809e-02 - 12 1.3927684617084721e-01 -4.7499913344737785e-02 -1.1937480424050728e-01 - 13 -5.8902152396003826e-02 2.0637558263331083e-02 4.1449659923341826e-02 - 14 -4.2055621175489395e-02 1.5988551318080933e-02 3.1691352487934213e-02 - 15 -4.2539948683218476e-02 4.3351294215930305e-03 3.8232440914748929e-02 - 16 -2.2510467034624776e-01 1.6316164467757852e-01 1.8773843594214473e-01 - 17 1.6812720929312874e-01 -1.4281858232747241e-01 -9.2519399920476475e-02 - 18 3.0499468408055963e-01 2.2852044290546555e-01 -2.3090422749929418e-01 - 19 -1.1862451953929101e-01 -1.0492932711074587e-01 6.3193927386419380e-02 - 20 -1.8235374654924874e-01 -1.4741020976340594e-01 1.0779510619260978e-01 - 21 3.9431124250062455e-01 -2.0865402929544438e-01 -2.3516889054524270e-01 - 22 -2.1464373504867226e-01 1.2609160477017470e-01 5.6063357195067547e-02 - 23 -1.5462425801748647e-01 9.1610017953232106e-02 8.5280739401894123e-02 - 24 2.2457634351109992e-01 1.9425829869099293e-01 1.9852929969619143e-01 - 25 -5.3068186518768275e-02 -7.6798200522567334e-02 -5.5933369221127897e-02 - 26 -1.5210252771717556e-01 -1.1352200866277845e-01 -1.1787522435544508e-01 - 27 -3.3313001103513895e-01 2.9233201786272634e-02 -1.0541289395459620e-01 - 28 2.1352188632351718e-01 -3.9316658291593511e-02 8.2922389883488268e-02 - 29 1.5542041771094059e-01 2.2020272278419181e-02 3.7340381181198701e-02 + 1 -1.2395679232547130e-01 2.0146109106531619e-02 -1.2827365729808804e-01 + 2 2.7886755727419794e-02 -3.5343748985890343e-02 1.0575224704522333e-01 + 3 -8.1625716027346681e-03 -4.8280853342611387e-04 -5.6177982175900729e-03 + 4 4.7257086969317325e-02 5.6839684424246639e-03 2.2777634266735503e-02 + 5 4.3963228900686525e-02 2.8319210572596903e-03 1.9581568716000513e-02 + 6 8.8542111460945233e-02 3.0663687272810280e-02 1.7623835677487854e-01 + 7 -5.0273595956547790e-02 -4.9409712631872479e-02 -1.4541278378595143e-01 + 8 1.7228328455862987e-02 -5.4120205381585490e-02 -1.8154834899604852e-01 + 9 -1.8485411346972853e-02 2.4302377543661862e-02 9.3708642953056934e-02 + 10 -2.0733723484382856e-02 1.6330981289874657e-02 3.1460670609309009e-02 + 11 -2.6150839514591746e-02 2.5829754004203991e-02 3.9722511565340235e-02 + 12 1.3683195341801987e-01 -4.6496929032343801e-02 -1.2561891227139674e-01 + 13 -5.8193952783161113e-02 2.0243309422281770e-02 4.3465650724609249e-02 + 14 -4.1278872269097378e-02 1.5532496933615860e-02 3.3394515434061488e-02 + 15 -4.1987051617676026e-02 4.5853844307510777e-03 4.0398393863355121e-02 + 16 -2.2207024887164900e-01 1.5899349683620562e-01 1.9759979720199139e-01 + 17 1.6564040019940926e-01 -1.4064308476091039e-01 -9.9954963656764692e-02 + 18 2.9554517271933162e-01 2.1285036802508378e-01 -2.3751859151483867e-01 + 19 -1.1535768373316745e-01 -9.8724859420955033e-02 6.3073202014246779e-02 + 20 -1.7685479806222060e-01 -1.3828729248251947e-01 1.0929448326376728e-01 + 21 3.8967934355535033e-01 -1.9034991050182742e-01 -2.4389765041573847e-01 + 22 -2.1209914094730067e-01 1.1729389051786178e-01 5.7400236525319739e-02 + 23 -1.5388644254257433e-01 8.3394125813440953e-02 8.8340605318399698e-02 + 24 2.1948400481473562e-01 1.9247712275756429e-01 2.0106466883697480e-01 + 25 -4.9063599855698650e-02 -7.5615031940232669e-02 -5.3977787588657525e-02 + 26 -1.4993706158308714e-01 -1.1244058819478711e-01 -1.1923046114238997e-01 + 27 -3.3281163635093119e-01 2.9767190575698314e-02 -1.1185904907137413e-01 + 28 2.1299846015761997e-01 -4.0390340379764550e-02 8.7603408024505169e-02 + 29 1.5539855333679903e-01 2.1856782655404510e-02 4.1246381941839563e-02 ... diff --git a/unittest/force-styles/tests/kspace-msm_cg.yaml b/unittest/force-styles/tests/kspace-msm_cg.yaml index 7fbc2b5c8..835b6dfe2 100644 --- a/unittest/force-styles/tests/kspace-msm_cg.yaml +++ b/unittest/force-styles/tests/kspace-msm_cg.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 5e-11 prerequisites: ! | atom full @@ -61,26 +61,26 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 3.1582134727843630e-02 1.0525330639053641e-01 -3.2324460322267601e-02 - 2 -6.6160643538094296e-02 -1.0356331082127954e-01 5.4961017474437220e-02 - 3 -4.9048984755960159e-04 -9.5676672574722217e-05 -1.7527134572584472e-03 - 4 1.9881095034657546e-02 -4.7850819868125536e-03 1.1570748473501674e-02 - 5 8.2802936115708350e-03 5.8888427269479663e-03 -1.9943351711580902e-03 - 6 -1.2299386501469985e-01 1.0840561812473495e-01 7.5394678802347931e-02 - 7 1.4228329859676106e-01 -1.1334108473575778e-01 -8.7652956372483007e-02 - 8 1.9304947993320218e-01 -1.7075382981210416e-01 -6.3093569819880707e-02 - 9 -1.2781532562408113e-01 9.7588980627559010e-02 2.4360607584706644e-02 - 10 -3.7578410717493078e-02 3.4375124978641168e-02 1.1752529513488054e-02 - 11 -4.7632296836546704e-02 4.7992217820297237e-02 1.2584028400530821e-02 - 12 1.6127852717488811e-01 -9.9008224708952527e-02 -4.8549941777900167e-02 - 13 -4.9138501080648510e-02 3.6328689953309810e-02 1.4985998901335892e-02 - 14 -5.2380283542764028e-02 2.8695223028951909e-02 1.3129766695353123e-02 - 15 -5.3164798901542354e-02 1.7263667381788469e-02 1.7890487256162980e-02 - 16 -2.7405663268345792e-01 2.5602841995090170e-01 1.0606033807750762e-01 - 17 2.4527019222400437e-01 -2.2886981942574974e-01 -7.7292142243327353e-02 - 18 4.0164193113751134e-01 3.3483287244526583e-01 -2.3548690868165364e-01 - 19 -1.7814646520619506e-01 -1.5424841281527338e-01 1.0136034621772110e-01 - 20 -1.9401354132901735e-01 -1.9886601783122751e-01 1.0344630710537639e-01 + 1 2.9669818820252679e-02 1.0065513159865414e-01 -3.7643697927375382e-02 + 2 -6.4048248541941438e-02 -9.9325824303309482e-02 5.9823242563564714e-02 + 3 -4.8925019554389487e-04 -2.3918899684539335e-04 -2.0382383977414322e-03 + 4 1.9669035440249717e-02 -4.2759020233322457e-03 1.2892231463971063e-02 + 5 8.2666838913726514e-03 6.3426985671042792e-03 -1.1969353669726726e-03 + 6 -1.2196917689315118e-01 1.1003642650086232e-01 8.4024611165739241e-02 + 7 1.4126919573019725e-01 -1.1311777772580714e-01 -9.6632053506698623e-02 + 8 1.9120674707788199e-01 -1.7042362790710350e-01 -6.9789900185529788e-02 + 9 -1.2650190038327239e-01 9.7582484839959946e-02 2.7264719943312095e-02 + 10 -3.7265235353218289e-02 3.4039104045313434e-02 1.2715798234546716e-02 + 11 -4.7235409817568977e-02 4.7149413684587159e-02 1.3970904448698755e-02 + 12 1.5955587164429449e-01 -9.9010972081224224e-02 -5.2729890399073720e-02 + 13 -4.8711405435198890e-02 3.6374850924128219e-02 1.6198604939315912e-02 + 14 -5.1745082893613487e-02 2.8459495965303016e-02 1.4717304485897816e-02 + 15 -5.2597164027497631e-02 1.7612412019902598e-02 1.9323228956218047e-02 + 16 -2.7257401586662433e-01 2.5204538891683859e-01 1.1023010444652910e-01 + 17 2.4400175383156192e-01 -2.2594617848845608e-01 -7.8879783666214634e-02 + 18 3.9364403358490585e-01 3.2382289128970781e-01 -2.5046438475023980e-01 + 19 -1.7468036645977733e-01 -1.5029261299490967e-01 1.0724888165180729e-01 + 20 -1.8976913871913864e-01 -1.9234295333362758e-01 1.1029170379874861e-01 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 diff --git a/unittest/force-styles/tests/kspace-pppm.yaml b/unittest/force-styles/tests/kspace-pppm.yaml index df29d61e3..302f51280 100644 --- a/unittest/force-styles/tests/kspace-pppm.yaml +++ b/unittest/force-styles/tests/kspace-pppm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -56,33 +56,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0900177524332380e-01 8.3541312360770559e-02 2.3847626933913957e-01 - 2 2.0293760437213748e-01 -2.8570861986354196e-01 -1.4764907529922344e-01 - 3 -3.4158170718364404e-02 -9.1103261103567309e-03 2.1028676255224140e-02 - 4 1.6407381836362508e-01 2.7543938443804754e-02 -8.1661581263582694e-02 - 5 1.5799678256598612e-01 7.5131693181657300e-02 -4.3093731729494773e-02 - 6 5.5884729319027959e-01 4.1070142887655381e-01 -7.0845348552640675e-01 - 7 -3.4252252488516066e-01 -4.0296980848156633e-01 4.1421689597710110e-01 - 8 -1.2877561673829283e-01 -6.1352311819313976e-01 3.7338100957587267e-01 - 9 1.7184965305565320e-01 3.1557352532666366e-01 2.9184166085517198e-02 - 10 -5.3416314160604578e-02 1.1162618970928689e-01 -1.9056641624128120e-02 - 11 -8.6656970143397835e-02 1.5453217862588842e-01 -4.3260381230061914e-02 - 12 4.6288691229484780e-01 -4.2627837697985460e-01 5.4462739307820834e-02 - 13 -1.5766510975402218e-01 1.1677248221389504e-01 2.0765584899621815e-02 - 14 -1.7364037400975366e-01 1.3763067517397995e-01 5.7227400340144263e-03 - 15 -1.3812467553300772e-01 8.4189156813104071e-02 -2.2189341317061961e-02 - 16 -3.5518552554301230e-01 4.4020942653600509e-01 5.1103809754957041e-01 - 17 1.4412978936104159e-01 -4.0716931333084577e-01 -7.6542748703258823e-01 - 18 7.7452008907550252e-01 1.6011444029485182e+00 -1.3411322152836536e+00 - 19 -2.7106696803117064e-01 -7.9194312531475608e-01 7.5606651125297675e-01 - 20 -4.2067655880426469e-01 -7.3392054862184575e-01 7.0888202878660511e-01 - 21 5.2066009642687827e-01 4.5571443252966459e-01 -1.1108598505670140e+00 - 22 -2.9107834596471255e-01 -8.0497477430417727e-02 5.6024739795440914e-01 - 23 -2.8876713232015855e-01 -2.5703387138535833e-01 5.3126570223700098e-01 - 24 7.7134065884385553e-02 1.6939505170091371e+00 -2.6162012529552015e-01 - 25 1.1769649007263155e-01 -6.8190526638151339e-01 2.1287906681296132e-01 - 26 -2.2425351267435142e-01 -9.4806947839154443e-01 6.5072664668127181e-02 - 27 -8.6783221113018416e-01 1.6459489466934927e+00 -8.8842216340655056e-01 - 28 5.7554532106965894e-01 -9.1140444835486800e-01 5.1430957288504053e-01 - 29 4.1454386992115411e-01 -8.0467652760281361e-01 4.1582695595428282e-01 + 1 -5.2121967435245176e-01 8.2276870813654021e-02 2.1773560937413439e-01 + 2 2.1578994288481759e-01 -2.8002869659340235e-01 -1.3605106288349972e-01 + 3 -3.4423143990413012e-02 -9.2909371996674761e-03 2.0060308171462465e-02 + 4 1.6313020050102955e-01 2.8731921078866858e-02 -7.8385024910183523e-02 + 5 1.6006178911865315e-01 7.5415704057805025e-02 -3.8295136249515270e-02 + 6 5.6462952264442934e-01 4.1624182855963193e-01 -6.7967311997172886e-01 + 7 -3.4242562967716372e-01 -4.0015067950984540e-01 3.9541683216366214e-01 + 8 -1.4020701379221082e-01 -6.1667976214283382e-01 3.4278194920952065e-01 + 9 1.8124898429916622e-01 3.1973551832688457e-01 4.8679453356032874e-02 + 10 -5.1855355655294477e-02 1.1080842257219518e-01 -1.4887415430484094e-02 + 11 -8.4879373474794961e-02 1.5137251285347694e-01 -3.9635895449896492e-02 + 12 4.5813452674267169e-01 -4.2650138398934273e-01 3.6559273076179781e-02 + 13 -1.5616674881100384e-01 1.1616876905548428e-01 2.6267294393488006e-02 + 14 -1.7246801535453529e-01 1.3665986990484524e-01 9.9378099610652956e-03 + 15 -1.3792480482419428e-01 8.5438892236118891e-02 -1.5143107363134312e-02 + 16 -3.4441451062311990e-01 4.3447931551429225e-01 5.3043980639795230e-01 + 17 1.3509863437497058e-01 -4.1273061354574347e-01 -7.8586693366440896e-01 + 18 7.3529995459909447e-01 1.5516414798630132e+00 -1.3838377564847795e+00 + 19 -2.6069023383700890e-01 -7.7624415323479823e-01 7.6977354503230111e-01 + 20 -3.9682998352093402e-01 -7.0637036037829004e-01 7.2961935030942526e-01 + 21 5.1894870245538671e-01 5.3412001808293463e-01 -1.1579882000391111e+00 + 22 -2.9427831151818179e-01 -1.1870833651570281e-01 5.8082924912572309e-01 + 23 -2.8815516721384660e-01 -2.8919507500651698e-01 5.5392999631998374e-01 + 24 6.4192413877094123e-02 1.7397472940254726e+00 -2.7635623439684104e-01 + 25 1.2865943620580228e-01 -7.0237909865397563e-01 2.2442969485026690e-01 + 26 -2.2274275757597931e-01 -9.7223496278843835e-01 7.3360502836559330e-02 + 27 -8.6027250000429512e-01 1.6509815598008886e+00 -9.3216774014291914e-01 + 28 5.7173856114625488e-01 -9.1741141462362830e-01 5.3810155984815722e-01 + 29 4.1202055537605786e-01 -8.0589450256337947e-01 4.4036539256058621e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_ad.yaml b/unittest/force-styles/tests/kspace-pppm_ad.yaml index 5ee485044..bdeacc50a 100644 --- a/unittest/force-styles/tests/kspace-pppm_ad.yaml +++ b/unittest/force-styles/tests/kspace-pppm_ad.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 21:47:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -57,33 +57,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -1.8834250898963276e-01 6.6657076406123394e-02 -2.8423653472418250e-02 - 2 5.0923071028935410e-02 -9.0650511069806081e-02 6.0396122279250133e-02 - 3 -1.2758684306909423e-02 -1.6199659088781395e-03 3.1382046012833895e-05 - 4 6.8052317652903524e-02 8.0871934574719348e-03 5.8783186265100329e-04 - 5 6.6433085284026569e-02 1.2674987427638911e-02 1.4507122141459376e-03 - 6 1.5195556646802180e-01 9.4313651396653084e-02 4.6281834183838161e-02 - 7 -9.6734515351225833e-02 -1.1691091822132349e-01 -9.3363297209904078e-02 - 8 -2.8686342543166127e-02 -1.3685902500722896e-01 -6.0702274355585131e-02 - 9 1.7752282360268889e-02 8.4682996719503065e-02 5.3777039120298617e-02 - 10 -2.3092230505114924e-02 3.0358745050258186e-02 2.2056143342835642e-02 - 11 -3.3564720137186310e-02 4.2660115844543017e-02 2.9432629196959298e-02 - 12 1.8139531601945827e-01 -1.0042886865462694e-01 -1.1066445221288242e-01 - 13 -7.5669074676155190e-02 3.6473097557565760e-02 4.2965417776918563e-02 - 14 -5.9335575599583801e-02 3.4570229129931164e-02 3.4983405107809333e-02 - 15 -5.4955202279481169e-02 1.5388708047612044e-02 3.3116925132106567e-02 - 16 -2.1583076104063117e-01 1.8051729698826868e-01 1.9344615122256537e-01 - 17 1.6241614088828718e-01 -1.9899296834923794e-01 -1.7216162196310389e-01 - 18 4.3300181355249967e-01 4.4983796325005648e-01 -3.6432975738591439e-01 - 19 -1.5156438441617784e-01 -2.1065801940840148e-01 1.6705699261441542e-01 - 20 -2.0487366490054901e-01 -2.4877658176123033e-01 2.1523933399595022e-01 - 21 4.3071279201140239e-01 -6.6862628973778454e-02 -3.3261171272630896e-01 - 22 -2.2246283899632374e-01 1.0273601452208653e-01 1.2833540947417071e-01 - 23 -1.4883424588934729e-01 4.6269968481073787e-02 1.7019654069606110e-01 - 24 2.2345966276517115e-01 4.1782918262451740e-01 1.2498080691733360e-01 - 25 -2.2175388259662289e-02 -1.7496733148287461e-01 -1.0426151543470073e-02 - 26 -1.4290914232963503e-01 -2.4822575910830108e-01 -9.9990437530984994e-02 - 27 -4.3508837805285555e-01 2.9335030557200770e-01 -1.9835661811860353e-01 - 28 2.4497908878851685e-01 -1.6945397252793437e-01 1.5382225140636954e-01 - 29 1.9610679902546660e-01 -9.6274057135849439e-02 1.2680150906039087e-01 + 1 -1.9266800529196806e-01 6.4162317322010678e-02 -4.0192228160444425e-02 + 2 5.5782282875620558e-02 -8.6751001424909394e-02 6.7409941361056394e-02 + 3 -1.2829093552155788e-02 -1.6923515726463203e-03 -5.3259686927080213e-04 + 4 6.7766440198635036e-02 8.5391215056378183e-03 2.6432357391941398e-03 + 5 6.6917679064744634e-02 1.2686518662859214e-02 3.9961778824721596e-03 + 6 1.5458110196282587e-01 9.5088285689323218e-02 6.1509787304780857e-02 + 7 -9.8038707660663721e-02 -1.1557850220901657e-01 -1.0418905704907173e-01 + 8 -3.3428443852007515e-02 -1.3573822373160019e-01 -7.5916033022062832e-02 + 9 2.1332846008413099e-02 8.4383967970654700e-02 6.3417640347456589e-02 + 10 -2.2358218549067402e-02 2.9728452202140859e-02 2.4136884805602655e-02 + 11 -3.2680854464608715e-02 4.1094672585275813e-02 3.1597649785560233e-02 + 12 1.7843113403326086e-01 -9.9629911690778172e-02 -1.1893750613239974e-01 + 13 -7.4784293857901099e-02 3.6009529671006950e-02 4.5613848569483445e-02 + 14 -5.8425695968903492e-02 3.4032390286530392e-02 3.7240675200500423e-02 + 15 -5.4448314679986204e-02 1.5752003890530195e-02 3.6206374481232255e-02 + 16 -2.1132408763780935e-01 1.7598418955117429e-01 2.0513708155109064e-01 + 17 1.5863597873208710e-01 -1.9823831924022500e-01 -1.8198855941696032e-01 + 18 4.1906747748761164e-01 4.2759947575475044e-01 -3.7611089634093481e-01 + 19 -1.4691004260036372e-01 -2.0274568816418684e-01 1.6808436795198520e-01 + 20 -1.9657906969563682e-01 -2.3661866329548434e-01 2.1898077423479534e-01 + 21 4.2712930513197905e-01 -3.8649176981750293e-02 -3.4751652277741119e-01 + 22 -2.2043939372554236e-01 8.9158968167194166e-02 1.3204830571435894e-01 + 23 -1.4839013646689073e-01 3.3807570021389975e-02 1.7623003597762810e-01 + 24 2.1683389500443123e-01 4.2405848872533408e-01 1.2520947395099716e-01 + 25 -1.7613739019339939e-02 -1.7719153718322139e-01 -6.7781966514954420e-03 + 26 -1.4107270847571057e-01 -2.5090648268077331e-01 -9.9771531197746441e-02 + 27 -4.3310317796831621e-01 2.9354582879493007e-01 -2.1083710840074518e-01 + 28 2.4377957868574382e-01 -1.7099722110938442e-01 1.6104061194501174e-01 + 29 1.9583339505509154e-01 -9.6127733992765904e-02 1.3391739381239692e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_cg.yaml b/unittest/force-styles/tests/kspace-pppm_cg.yaml index 77e85ef77..fd892d044 100644 --- a/unittest/force-styles/tests/kspace-pppm_cg.yaml +++ b/unittest/force-styles/tests/kspace-pppm_cg.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -60,26 +60,26 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -2.5272870059014418e-01 7.7993693891669019e-02 2.7413192480528514e-01 - 2 6.0317817543279174e-02 -2.7726219497773258e-01 -9.2328466795041211e-02 - 3 -2.0381925802263216e-02 -7.4169903634883827e-03 1.7718770630259381e-02 - 4 1.4007637687058852e-01 6.0294233349724097e-04 -4.4118635982017075e-02 - 5 7.7661555892458781e-02 5.6660597072423394e-02 -6.2527393985284924e-02 - 6 1.8472776517392236e-02 5.4080910460464371e-01 -6.2683322637258831e-01 - 7 7.1172361943358894e-02 -5.3339808852688553e-01 3.1182624682757953e-01 - 8 5.1931682876258478e-01 -8.4009257264924786e-01 4.1437713723636871e-01 - 9 -2.8926485235033661e-01 3.8545218869697995e-01 -9.6445715585120301e-02 - 10 -1.4130393273230371e-01 1.7154601844601167e-01 -2.4319589810512892e-02 - 11 -1.9820651458435656e-01 2.3998861307221755e-01 -7.2850168561931314e-02 - 12 6.0180481293740029e-01 -6.6352386739919189e-01 1.9241766558675899e-01 - 13 -1.4512210035912929e-01 2.1001807770143230e-01 -4.0833849803347325e-02 - 14 -2.1221325118484802e-01 1.9911652392243312e-01 -4.7359593324180368e-02 - 15 -1.8584239277230100e-01 1.4355785962059972e-01 -6.8625732013099072e-02 - 16 -8.6818324744564379e-01 8.1248951063969599e-01 7.2669223824162077e-01 - 17 6.8330419262914510e-01 -5.4635175697697436e-01 -9.0599066050100585e-01 - 18 9.4795190549104413e-01 1.6607978960168899e+00 -1.6003547491287762e+00 - 19 -3.4101870572315529e-01 -8.2840317570845334e-01 9.3657904772766076e-01 - 20 -4.6581300504277079e-01 -8.0258437941651817e-01 8.0884475080737095e-01 + 1 -2.6184723544424754e-01 6.4931763586645569e-02 2.5894189439282178e-01 + 2 7.1188791893876918e-02 -2.6523591030129384e-01 -7.7726630404083757e-02 + 3 -2.0408303017853801e-02 -7.8139271054585464e-03 1.6988440512661289e-02 + 4 1.3925850162966580e-01 2.0893701760249512e-03 -4.0780445645108694e-02 + 5 7.8183096099570568e-02 5.7889767391384628e-02 -6.0547496822094274e-02 + 6 1.6842096914188347e-02 5.4757490600595837e-01 -6.0229977720300909e-01 + 7 7.4091745761924260e-02 -5.3028606852543980e-01 2.8986050457863077e-01 + 8 5.1743906247767835e-01 -8.4223424500143229e-01 3.9481614099603873e-01 + 9 -2.8726669019634465e-01 3.8827269134141451e-01 -8.9575882138102497e-02 + 10 -1.4122018655812962e-01 1.7109914436122534e-01 -2.1423824132861539e-02 + 11 -1.9806109971818017e-01 2.3824058780919133e-01 -6.9577625183444500e-02 + 12 5.9874264532230170e-01 -6.6559957217340571e-01 1.8173470593183969e-01 + 13 -1.4442493294585693e-01 2.1111397169239157e-01 -3.8247104744656764e-02 + 14 -2.1077245582758927e-01 1.9844582587356627e-01 -4.4210958176665323e-02 + 15 -1.8521403565115369e-01 1.4540627518934821e-01 -6.4234070383117639e-02 + 16 -8.7053850771594010e-01 8.0845140048887487e-01 7.3886675547972425e-01 + 17 6.8557622044198951e-01 -5.4406743642692890e-01 -9.1429966017417896e-01 + 18 9.1148773392625171e-01 1.6206973178682011e+00 -1.6642109599634070e+00 + 19 -3.2955716206615387e-01 -8.1797068321684074e-01 9.6357982882542181e-01 + 20 -4.4349928532599747e-01 -7.8100517903342848e-01 8.4234616425359243e-01 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 diff --git a/unittest/force-styles/tests/kspace-pppm_cg_ad.yaml b/unittest/force-styles/tests/kspace-pppm_cg_ad.yaml index 603edc940..a8c1b364e 100644 --- a/unittest/force-styles/tests/kspace-pppm_cg_ad.yaml +++ b/unittest/force-styles/tests/kspace-pppm_cg_ad.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 21:48:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -61,26 +61,26 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -2.0387329742678935e-02 1.3093485626198467e-01 4.4941845234883940e-02 - 2 -4.7190224794547327e-02 -1.3591566011769315e-01 3.4874814664466743e-02 - 3 -4.1211083826759969e-03 -8.4396978751134918e-04 1.7553081065953371e-03 - 4 4.2824292713787238e-02 -5.6946135413426290e-03 2.4590868069811534e-03 - 5 2.3458478045016443e-02 1.0696770181014904e-02 -1.7448455829307621e-02 - 6 -1.2354294993678852e-01 1.7625775426118406e-01 5.4611471808742741e-04 - 7 1.3525616811583585e-01 -1.8757173987773404e-01 -7.7274432000122809e-02 - 8 2.4306961559298867e-01 -2.7045133134989363e-01 2.3670636141555346e-02 - 9 -1.6251791877317776e-01 1.5695333863221955e-01 -1.3810666834331926e-02 - 10 -5.3421929184117957e-02 5.5794275459234426e-02 6.7768496881506256e-03 - 11 -7.0594977492813057e-02 7.6403957714245907e-02 2.8353383786184601e-03 - 12 2.2672095759286723e-01 -1.8117688574287416e-01 -2.5266618876046022e-02 - 13 -6.5914691787391955e-02 6.3934857391220679e-02 8.8183103202033562e-03 - 14 -7.4848063365856657e-02 5.4941937494976181e-02 8.1042650425130099e-03 - 15 -7.3335632928108713e-02 3.7250978324250415e-02 8.2913944550204125e-03 - 16 -3.4877583051352978e-01 3.3351834698654859e-01 1.6281666597009442e-01 - 17 3.3087423876987276e-01 -3.0809932712483523e-01 -1.8187708498145894e-01 - 18 5.4091814458990728e-01 5.3115175250231761e-01 -4.2121309828638348e-01 - 19 -2.0915508523828744e-01 -2.5027627930253804e-01 2.3836304552818319e-01 - 20 -2.2353933354661040e-01 -3.0241604635861430e-01 2.3639519785962915e-01 + 1 -2.3233851129528121e-02 1.2489062958682691e-01 3.7593107220149205e-02 + 2 -4.3710079975596269e-02 -1.3007485492125456e-01 4.1619894812024730e-02 + 3 -4.1101038516881700e-03 -1.0338456210797354e-03 1.3731944233688245e-03 + 4 4.2484854779506219e-02 -5.0431656127991106e-03 4.1314934565403402e-03 + 5 2.3495742678794253e-02 1.1293632962832032e-02 -1.6387657253880042e-02 + 6 -1.2317200693991601e-01 1.7874967199325814e-01 1.2249260400728630e-02 + 7 1.3501732706022634e-01 -1.8680677718515443e-01 -8.8803106734507947e-02 + 8 2.4124866998056038e-01 -2.7049039124785290e-01 1.4449282962413320e-02 + 9 -1.6119521401868253e-01 1.5726973061502647e-01 -9.8927472116242601e-03 + 10 -5.3140691458439991e-02 5.5433621996643180e-02 8.0786078463782746e-03 + 11 -7.0237764551324522e-02 7.5387559579610713e-02 4.5441344259602697e-03 + 12 2.2474549981791470e-01 -1.8148538859285962e-01 -3.0608244156768657e-02 + 13 -6.5402144538209223e-02 6.4114157800569005e-02 1.0310338340444109e-02 + 14 -7.4055837126060814e-02 5.4632364273015890e-02 1.0035746055978819e-02 + 15 -7.2719679449876867e-02 3.7829512778080589e-02 1.0280821962787632e-02 + 16 -3.4787202229918601e-01 3.2963706578663016e-01 1.6865012423506445e-01 + 17 3.3017352545586054e-01 -3.0555305535426325e-01 -1.8465603427276994e-01 + 18 5.2852873632937447e-01 5.1435455019446552e-01 -4.4360835198012882e-01 + 19 -2.0403882873495049e-01 -2.4514901555243634e-01 2.4686890778415291e-01 + 20 -2.1644898771347529e-01 -2.9350262356524626e-01 2.4698193124499471e-01 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 diff --git a/unittest/force-styles/tests/kspace-pppm_cg_tiled.yaml b/unittest/force-styles/tests/kspace-pppm_cg_tiled.yaml index ca61591ba..9477bcba7 100644 --- a/unittest/force-styles/tests/kspace-pppm_cg_tiled.yaml +++ b/unittest/force-styles/tests/kspace-pppm_cg_tiled.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:36 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -62,26 +62,26 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -2.5272870059014418e-01 7.7993693891669019e-02 2.7413192480528514e-01 - 2 6.0317817543279174e-02 -2.7726219497773258e-01 -9.2328466795041211e-02 - 3 -2.0381925802263216e-02 -7.4169903634883827e-03 1.7718770630259381e-02 - 4 1.4007637687058852e-01 6.0294233349724097e-04 -4.4118635982017075e-02 - 5 7.7661555892458781e-02 5.6660597072423394e-02 -6.2527393985284924e-02 - 6 1.8472776517392236e-02 5.4080910460464371e-01 -6.2683322637258831e-01 - 7 7.1172361943358894e-02 -5.3339808852688553e-01 3.1182624682757953e-01 - 8 5.1931682876258478e-01 -8.4009257264924786e-01 4.1437713723636871e-01 - 9 -2.8926485235033661e-01 3.8545218869697995e-01 -9.6445715585120301e-02 - 10 -1.4130393273230371e-01 1.7154601844601167e-01 -2.4319589810512892e-02 - 11 -1.9820651458435656e-01 2.3998861307221755e-01 -7.2850168561931314e-02 - 12 6.0180481293740029e-01 -6.6352386739919189e-01 1.9241766558675899e-01 - 13 -1.4512210035912929e-01 2.1001807770143230e-01 -4.0833849803347325e-02 - 14 -2.1221325118484802e-01 1.9911652392243312e-01 -4.7359593324180368e-02 - 15 -1.8584239277230100e-01 1.4355785962059972e-01 -6.8625732013099072e-02 - 16 -8.6818324744564379e-01 8.1248951063969599e-01 7.2669223824162077e-01 - 17 6.8330419262914510e-01 -5.4635175697697436e-01 -9.0599066050100585e-01 - 18 9.4795190549104413e-01 1.6607978960168899e+00 -1.6003547491287762e+00 - 19 -3.4101870572315529e-01 -8.2840317570845334e-01 9.3657904772766076e-01 - 20 -4.6581300504277079e-01 -8.0258437941651817e-01 8.0884475080737095e-01 + 1 -2.6184723544424754e-01 6.4931763586645569e-02 2.5894189439282178e-01 + 2 7.1188791893876918e-02 -2.6523591030129384e-01 -7.7726630404083757e-02 + 3 -2.0408303017853801e-02 -7.8139271054585464e-03 1.6988440512661289e-02 + 4 1.3925850162966580e-01 2.0893701760249512e-03 -4.0780445645108694e-02 + 5 7.8183096099570568e-02 5.7889767391384628e-02 -6.0547496822094274e-02 + 6 1.6842096914188347e-02 5.4757490600595837e-01 -6.0229977720300909e-01 + 7 7.4091745761924260e-02 -5.3028606852543980e-01 2.8986050457863077e-01 + 8 5.1743906247767835e-01 -8.4223424500143229e-01 3.9481614099603873e-01 + 9 -2.8726669019634465e-01 3.8827269134141451e-01 -8.9575882138102497e-02 + 10 -1.4122018655812962e-01 1.7109914436122534e-01 -2.1423824132861539e-02 + 11 -1.9806109971818017e-01 2.3824058780919133e-01 -6.9577625183444500e-02 + 12 5.9874264532230170e-01 -6.6559957217340571e-01 1.8173470593183969e-01 + 13 -1.4442493294585693e-01 2.1111397169239157e-01 -3.8247104744656764e-02 + 14 -2.1077245582758927e-01 1.9844582587356627e-01 -4.4210958176665323e-02 + 15 -1.8521403565115369e-01 1.4540627518934821e-01 -6.4234070383117639e-02 + 16 -8.7053850771594010e-01 8.0845140048887487e-01 7.3886675547972425e-01 + 17 6.8557622044198951e-01 -5.4406743642692890e-01 -9.1429966017417896e-01 + 18 9.1148773392625171e-01 1.6206973178682011e+00 -1.6642109599634070e+00 + 19 -3.2955716206615387e-01 -8.1797068321684074e-01 9.6357982882542181e-01 + 20 -4.4349928532599747e-01 -7.8100517903342848e-01 8.4234616425359243e-01 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 diff --git a/unittest/force-styles/tests/kspace-pppm_disp.yaml b/unittest/force-styles/tests/kspace-pppm_disp.yaml index cb1e5395b..55243a9a6 100644 --- a/unittest/force-styles/tests/kspace-pppm_disp.yaml +++ b/unittest/force-styles/tests/kspace-pppm_disp.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:37 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -66,33 +66,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.1093461453486078e-01 8.4815022085316411e-02 2.4050143047391384e-01 - 2 2.0269474561523398e-01 -2.8606588239794262e-01 -1.4735225596995874e-01 - 3 -3.4234048104384122e-02 -9.1015874713007566e-03 2.1083404416076503e-02 - 4 1.6438373502530670e-01 2.7441940405301860e-02 -8.1615371503182793e-02 - 5 1.5842516917697239e-01 7.5103990528938042e-02 -4.3424984281193048e-02 - 6 5.5941228676199561e-01 4.1221869441491793e-01 -7.0564176413559632e-01 - 7 -3.4274893263470213e-01 -4.0528059127777827e-01 4.1318096483327071e-01 - 8 -1.2777293454084585e-01 -6.1501767174147359e-01 3.7303556413311539e-01 - 9 1.7136277006404393e-01 3.1598035915671779e-01 2.7526713981472536e-02 - 10 -5.3469024054543332e-02 1.1184167603917432e-01 -1.8654878979966722e-02 - 11 -8.6660209019354908e-02 1.5477006526467960e-01 -4.3091545463425973e-02 - 12 4.6355464176780437e-01 -4.2682045206782798e-01 5.3496974696444169e-02 - 13 -1.5789989329551102e-01 1.1687908739433006e-01 2.0961753133582020e-02 - 14 -1.7352387660876251e-01 1.3778155898528857e-01 5.6139016025478616e-03 - 15 -1.3840333408815636e-01 8.4271099031796678e-02 -2.1720799488299327e-02 - 16 -3.5551213024667022e-01 4.4037756147175305e-01 5.0887664928278697e-01 - 17 1.4432977109510542e-01 -4.0683056537227713e-01 -7.6285063946774812e-01 - 18 7.7534672311898223e-01 1.6045224553408519e+00 -1.3415940542350133e+00 - 19 -2.7160526226435944e-01 -7.9291227879602810e-01 7.5520266547779302e-01 - 20 -4.2067073613405209e-01 -7.3547251103165268e-01 7.0791040003582539e-01 - 21 5.2439318431794979e-01 4.5758179105996727e-01 -1.1098871964890027e+00 - 22 -2.9332904543762894e-01 -8.1446412559310913e-02 5.6013209397435260e-01 - 23 -2.9000480847347776e-01 -2.5791564110890097e-01 5.3037312577967677e-01 - 24 8.1033095859629076e-02 1.6944167823938079e+00 -2.6303506597244375e-01 - 25 1.1553491354529768e-01 -6.8206587058617596e-01 2.1364870509113207e-01 - 26 -2.2543140440581119e-01 -9.4901345456898767e-01 6.5503109356078865e-02 - 27 -8.7191819163696527e-01 1.6494367603842144e+00 -8.8912982282239705e-01 - 28 5.7664851204580947e-01 -9.1249956089130579e-01 5.1469955262993283e-01 - 29 4.1699889708595433e-01 -8.0699636408609154e-01 4.1625136991022776e-01 + 1 -5.2317848382998045e-01 8.3572610777874534e-02 2.1974444169679017e-01 + 2 2.1555448838459734e-01 -2.8041269517920231e-01 -1.3572527214301303e-01 + 3 -3.4499757973737395e-02 -9.2825796828880248e-03 2.0114518960857249e-02 + 4 1.6343840309627777e-01 2.8631329460442858e-02 -7.8343082915755244e-02 + 5 1.6049594129802885e-01 7.5388906307458467e-02 -3.8623049198759273e-02 + 6 5.6518243168397753e-01 4.1779517912377595e-01 -6.7685056310740987e-01 + 7 -3.4264939953805346e-01 -4.0248782182127990e-01 3.9440641884038957e-01 + 8 -1.3917803580662502e-01 -6.1821183931013157e-01 3.4242132951391419e-01 + 9 1.8074168836781518e-01 3.2016769029981162e-01 4.7030756045788220e-02 + 10 -5.1909940036345928e-02 1.1102738730788746e-01 -1.4485126175730490e-02 + 11 -8.4887248278053870e-02 1.5161766334930829e-01 -3.9466542299216166e-02 + 12 4.5880326700402307e-01 -4.2706225121681990e-01 3.5599817618611390e-02 + 13 -1.5640038795477901e-01 1.1627959215641394e-01 2.6463248806582945e-02 + 14 -1.7235853810760429e-01 1.3682230671031761e-01 9.8139394115601044e-03 + 15 -1.3820348337851615e-01 8.5518238397611621e-02 -1.4675032381252479e-02 + 16 -3.4476146572257921e-01 4.3465165669897132e-01 5.2830485581668774e-01 + 17 1.3531902088182532e-01 -4.1238147880622145e-01 -7.8332326441258637e-01 + 18 7.3613805609492877e-01 1.5549466949914774e+00 -1.3843313511574984e+00 + 19 -2.6120101017538150e-01 -7.7717977934936422e-01 7.6893396713156525e-01 + 20 -3.9685212697403316e-01 -7.0788271109520995e-01 7.2864602794390021e-01 + 21 5.2262631063320797e-01 5.3601778769035480e-01 -1.1570339173968882e+00 + 22 -2.9649122398367417e-01 -1.1966078602303834e-01 5.8075208327649153e-01 + 23 -2.8936413877584560e-01 -2.9010144856464737e-01 5.5302228113360152e-01 + 24 6.8181927756422428e-02 1.7402544485369822e+00 -2.7780470447164479e-01 + 25 1.2643985169049682e-01 -7.0256342653806947e-01 2.2521760458674542e-01 + 26 -2.2393607844376312e-01 -9.7320730020620894e-01 7.3807495049357449e-02 + 27 -8.6442757611841625e-01 1.6544889048043037e+00 -9.3286205434664005e-01 + 28 5.7288025946679377e-01 -9.1851286441160085e-01 5.3848686254913070e-01 + 29 4.1449724873899363e-01 -8.0823341440830831e-01 4.4075831162442020e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_disp_ad.yaml b/unittest/force-styles/tests/kspace-pppm_disp_ad.yaml index 2a0ebb1a3..02f36588b 100644 --- a/unittest/force-styles/tests/kspace-pppm_disp_ad.yaml +++ b/unittest/force-styles/tests/kspace-pppm_disp_ad.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:45:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:37 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -67,33 +67,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0724598451125813e-01 8.4605906369026526e-02 2.4023539149455228e-01 - 2 2.0183966461590086e-01 -2.8652609887043412e-01 -1.4881116802703487e-01 - 3 -3.4147445391883309e-02 -9.0985418694004179e-03 2.1042515097089792e-02 - 4 1.6416134037391608e-01 2.7477073712338231e-02 -8.1855695266502687e-02 - 5 1.5784365489264773e-01 7.5090836947964298e-02 -4.3440014022451554e-02 - 6 5.5681646945073815e-01 4.0940181912948942e-01 -7.1003391670312455e-01 - 7 -3.4329815357999571e-01 -4.0290748897004808e-01 4.1415876123613821e-01 - 8 -1.2888712765002303e-01 -6.1329574858632774e-01 3.7309574020498021e-01 - 9 1.7178353039292121e-01 3.1601173898527257e-01 2.7141518403095730e-02 - 10 -5.3449155548040729e-02 1.1159998980917359e-01 -1.9268569826734024e-02 - 11 -8.6642220167132120e-02 1.5467188146362182e-01 -4.2774265441850812e-02 - 12 4.6235239432856173e-01 -4.2652828743106036e-01 5.4131651032430401e-02 - 13 -1.5768561343589776e-01 1.1701385898496135e-01 2.1050787714544144e-02 - 14 -1.7354096508181352e-01 1.3780484347028346e-01 5.7024298471180790e-03 - 15 -1.3806854613337141e-01 8.4207238294398579e-02 -2.2556652594670781e-02 - 16 -3.5565033729310813e-01 4.3996598309257018e-01 5.1071457472743487e-01 - 17 1.4535098395259033e-01 -4.0858029554870284e-01 -7.6531543239893896e-01 - 18 7.7795133365898461e-01 1.5992575494701202e+00 -1.3495042526783001e+00 - 19 -2.7225702249513323e-01 -7.9245427732289586e-01 7.5607852632115080e-01 - 20 -4.2043594981468596e-01 -7.3261035203161751e-01 7.1087835856347847e-01 - 21 5.1948646341798976e-01 4.5851140631741866e-01 -1.1167896092963290e+00 - 22 -2.9052480659030144e-01 -7.9491449232363828e-02 5.5868278913981273e-01 - 23 -2.8785397967498427e-01 -2.5762428267824639e-01 5.3272370781608880e-01 - 24 8.0806567629280387e-02 1.6935240826607170e+00 -2.6086970148264382e-01 - 25 1.1647619572965967e-01 -6.8024758153127540e-01 2.1445540659082424e-01 - 26 -2.2418447745919995e-01 -9.4911802200180651e-01 6.5472960110187495e-02 - 27 -8.6711854896855400e-01 1.6456499265079672e+00 -8.8271588128156575e-01 - 28 5.7625556131334965e-01 -9.0893365323015285e-01 5.1303862930349953e-01 - 29 4.1417479755849967e-01 -8.0454472919014908e-01 4.1621524549683497e-01 + 1 -5.1946341889849312e-01 8.3342412211911271e-02 2.1950445690422138e-01 + 2 2.1467946062791135e-01 -2.8090698751565413e-01 -1.3725116873680446e-01 + 3 -3.4413241351754477e-02 -9.2794362966421781e-03 2.0073550283003835e-02 + 4 1.6321449178224340e-01 2.8665407645607988e-02 -7.8590087589999483e-02 + 5 1.5991282811013893e-01 7.5377048928172638e-02 -3.8643525681887274e-02 + 6 5.6258181284528852e-01 4.1496830517460553e-01 -6.8120358569469386e-01 + 7 -3.4318549008870414e-01 -4.0010371315964555e-01 3.9531257005727610e-01 + 8 -1.4030252770931945e-01 -6.1643349151149252e-01 3.4247382914884938e-01 + 9 1.8118332548221622e-01 3.2015664251519416e-01 4.6650269281676086e-02 + 10 -5.1889991517941540e-02 1.1078031964521004e-01 -1.5096528564649646e-02 + 11 -8.4867327433075970e-02 1.5150777144042321e-01 -3.9143230124924662e-02 + 12 4.5759056206613674e-01 -4.2674434043432430e-01 3.6239828789925238e-02 + 13 -1.5618729073343188e-01 1.1640826892104200e-01 2.6554627043777635e-02 + 14 -1.7236728967072626e-01 1.3682679559495672e-01 9.9154104239146321e-03 + 15 -1.3787458711741488e-01 8.5462418906941659e-02 -1.5499146149008788e-02 + 16 -3.4488189204985270e-01 4.3423058754252042e-01 5.3019720473429077e-01 + 17 1.3633701681707619e-01 -4.1413175407917729e-01 -7.8570904583243639e-01 + 18 7.3872000179798447e-01 1.5498185824903181e+00 -1.3922558069040474e+00 + 19 -2.6189098475763806e-01 -7.7681863697875009e-01 7.6964397989880229e-01 + 20 -3.9659368278869017e-01 -7.0499133712322315e-01 7.3160665476522657e-01 + 21 5.1772391318270372e-01 5.3685889060646674e-01 -1.1639787967728343e+00 + 22 -2.9362851829547165e-01 -1.1762207847169745e-01 5.7919327109274543e-01 + 23 -2.8723804425578320e-01 -2.8989684312139385e-01 5.5538624244591606e-01 + 24 6.7893999282586479e-02 1.7393025380345151e+00 -2.7549369467776857e-01 + 25 1.2749928227019452e-01 -7.0058140663117596e-01 2.2606383776677208e-01 + 26 -2.2270492724375096e-01 -9.7337385731520798e-01 7.3670604815438620e-02 + 27 -8.5953587038210399e-01 1.6506583369866594e+00 -9.2639055247567981e-01 + 28 5.7244544655935248e-01 -9.1492612363637105e-01 5.3683369811693316e-01 + 29 4.1162405288766107e-01 -8.0577066745735726e-01 4.4073537497118742e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_disp_ad_only.yaml b/unittest/force-styles/tests/kspace-pppm_disp_ad_only.yaml index 79264c45b..6c441a3df 100644 --- a/unittest/force-styles/tests/kspace-pppm_disp_ad_only.yaml +++ b/unittest/force-styles/tests/kspace-pppm_disp_ad_only.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 23:05:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -67,33 +67,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 6.9638112975627505e-11 -6.2952655433984510e-11 -1.7520579341404558e-11 - 2 7.5441280063952564e-13 -1.1565278235052112e-12 1.5428964869214424e-13 - 3 3.9495752841065062e-11 -1.9092781431624742e-11 -1.4273797798954887e-13 - 4 1.5925753071119834e-12 -7.5018590838065349e-13 4.0694176768714727e-13 - 5 1.3773389032846222e-12 -5.2518353267880336e-13 -5.8790169309916104e-13 - 6 2.4346713154520441e-11 -6.0219217022078622e-12 1.1556637696922417e-11 - 7 3.9348886643182682e-11 -4.5159528947341432e-12 4.9885111934485096e-11 - 8 1.9778099538765962e-11 6.2897367226276710e-12 -4.3131958485496316e-13 - 9 6.3695687649969267e-14 3.3892963902521213e-14 -5.1413748665229894e-13 - 10 -9.6012722021579935e-12 1.6233041014363616e-11 6.0003996378633241e-12 - 11 -2.0949350984685278e-13 7.9562479682529135e-13 7.6275214731002570e-13 - 12 -2.9254571969811829e-11 3.7981192304699482e-12 1.7545839680382277e-11 - 13 -1.4582673940336726e-12 3.2818654537516632e-13 6.2347550527444227e-13 - 14 -7.3106004851428835e-13 1.1022739695233736e-13 1.1369294512424691e-12 - 15 -9.4060413626822731e-13 -3.5126188279055496e-13 3.8676904179416883e-13 - 16 -2.2408460889929651e-11 2.7657483426256059e-11 -1.1741964403647136e-11 - 17 -2.1298916095589507e-11 3.8489167711847335e-11 -4.6910251494943480e-11 - 18 -1.7957271474310740e-11 -5.7234788024451294e-11 7.2383088876515692e-11 - 19 -3.6288894307680100e-14 -1.0943572602766692e-12 1.5210320121776364e-12 - 20 -8.3935575478300129e-13 -1.1966327701053927e-12 1.4966158763399045e-12 - 21 -8.9447202173297866e-11 6.3082241565048134e-11 7.4014350079233694e-11 - 22 -1.5510607489175700e-12 1.1907296946509683e-12 1.5210644252358221e-12 - 23 -1.6318182177140126e-12 1.1841207226717162e-12 1.4885209322729697e-12 - 24 -1.5676362809971050e-11 -5.8529118094744956e-11 -7.6215807688416359e-11 - 25 1.0742373795185689e-13 -1.1875074064094843e-12 -1.4571756878225340e-12 - 26 -7.1286524148732120e-13 -1.1757034686897436e-12 -1.5207002392359802e-12 - 27 8.0828500068665394e-11 6.3165679701490667e-11 -6.5424272562687016e-11 - 28 1.6362386625442489e-12 1.1989853840181747e-12 -1.1753814351696325e-12 - 29 1.5246414975786595e-12 1.1846002567244795e-12 -1.4036250137375415e-12 + 1 6.9716113303749101e-11 -6.2920752503129773e-11 -1.7550283192040292e-11 + 2 7.6029523611459948e-13 -1.1542933215573456e-12 1.6211605128039134e-13 + 3 3.9436751219955048e-11 -1.9025191606170229e-11 -1.6413835324755491e-13 + 4 1.5917957064055706e-12 -7.5199354600686732e-13 3.9828628642992979e-13 + 5 1.3756131702964554e-12 -5.2405769743132084e-13 -5.8787297334025978e-13 + 6 2.4326836913978727e-11 -5.9609723028539948e-12 1.1609706484115348e-11 + 7 3.9337219586089660e-11 -4.5740801386758400e-12 4.9824905728630014e-11 + 8 1.9834047660187925e-11 6.2158826826776815e-12 -4.1180348799110650e-13 + 9 6.6698832605719921e-14 2.9315317782217162e-14 -5.1193109681513184e-13 + 10 -9.5676517525503098e-12 1.6257763512056318e-11 5.9867919918528022e-12 + 11 -2.1037516087543741e-13 7.9367468544055238e-13 7.5727409446140179e-13 + 12 -2.9181217202929106e-11 3.7667887531970705e-12 1.7469009245571818e-11 + 13 -1.4530373806583396e-12 3.3404964981044016e-13 6.2201349861738416e-13 + 14 -7.3135137863150484e-13 1.0326140839829726e-13 1.1311553849919165e-12 + 15 -9.4939994820807551e-13 -3.5655846246143222e-13 3.9364658084073759e-13 + 16 -2.2414923397819641e-11 2.7641855142854294e-11 -1.1652209820993156e-11 + 17 -2.1217519159558708e-11 3.8518774501104260e-11 -4.6852628393321696e-11 + 18 -1.8032006674982352e-11 -5.7274598803564346e-11 7.2377391715559542e-11 + 19 -3.7973048207661299e-14 -1.0971995830589840e-12 1.5218316324394455e-12 + 20 -8.2918359789565016e-13 -1.1973654173933729e-12 1.4977122457478968e-12 + 21 -8.9472801587067436e-11 6.3090106957500212e-11 7.4018739160184064e-11 + 22 -1.5543080965745560e-12 1.1915261431273786e-12 1.5208661261126922e-12 + 23 -1.6319388926272388e-12 1.1827993173971893e-12 1.4902181237938873e-12 + 24 -1.5644652211653056e-11 -5.8520597336263483e-11 -7.6237094240179584e-11 + 25 1.1793548185098520e-13 -1.1888224625099667e-12 -1.4557008404485952e-12 + 26 -7.1710103200701943e-13 -1.1746664474030413e-12 -1.5212075056359577e-12 + 27 8.0821584666939128e-11 6.3170014712012626e-11 -6.5469649877835763e-11 + 28 1.6363393816268043e-12 1.1991701417218827e-12 -1.1725081023617520e-12 + 29 1.5219277223773167e-12 1.1846744314415508e-12 -1.4012823370428947e-12 ... diff --git a/unittest/force-styles/tests/kspace-pppm_disp_only.yaml b/unittest/force-styles/tests/kspace-pppm_disp_only.yaml index f25824894..bd7fe7459 100644 --- a/unittest/force-styles/tests/kspace-pppm_disp_only.yaml +++ b/unittest/force-styles/tests/kspace-pppm_disp_only.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 20 23:05:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 2.5e-13 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/kspace-pppm_disp_tip4p.yaml b/unittest/force-styles/tests/kspace-pppm_disp_tip4p.yaml index 5aa5a05ba..d713c813e 100644 --- a/unittest/force-styles/tests/kspace-pppm_disp_tip4p.yaml +++ b/unittest/force-styles/tests/kspace-pppm_disp_tip4p.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -72,33 +72,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -4.9416817512867772e-01 6.9132051029703850e-02 2.2792064131167381e-01 - 2 1.9660742361202765e-01 -2.7683464562350141e-01 -1.1648273172789893e-01 - 3 -3.1817888397655536e-02 -8.3177125596615407e-03 2.0143346803180754e-02 - 4 1.6135377083312791e-01 1.8615530314431788e-02 -7.2800289973365254e-02 - 5 1.4214216789460665e-01 6.8039654886114159e-02 -4.6938009063112060e-02 - 6 4.4643064775342367e-01 4.2893505076831739e-01 -6.8775741743265861e-01 - 7 -2.6518427143059592e-01 -4.2146565969330974e-01 3.8803571987575664e-01 - 8 2.2755127418194528e-02 -6.6244111341856327e-01 3.9507477142358688e-01 - 9 6.2628418722023640e-02 3.3997742016023041e-01 -1.1045993521066751e-02 - 10 -7.4235803547032617e-02 1.2547813301106978e-01 -2.4340676994152301e-02 - 11 -1.0999589290511490e-01 1.7400899022219579e-01 -5.4305967639893100e-02 - 12 4.9188838997932660e-01 -4.7920999533252595e-01 1.0335757604839625e-01 - 13 -1.5676903750934484e-01 1.3683867198176530e-01 -2.5546974252072707e-03 - 14 -1.7824234455718763e-01 1.4834823301136249e-01 -1.0253769467197959e-02 - 15 -1.4863974813164657e-01 1.0007625522926060e-01 -3.4183752770552182e-02 - 16 -4.9738250421898633e-01 5.3394436910964327e-01 5.1450377999736929e-01 - 17 3.0388696425163220e-01 -4.4468807844456010e-01 -7.6073416443984831e-01 - 18 7.9666865236720719e-01 1.6364425505208584e+00 -1.4284227528504352e+00 - 19 -2.7815547522757161e-01 -8.1074285404841884e-01 8.0492927378732204e-01 - 20 -4.2645428445362293e-01 -7.6107435172402105e-01 7.4532895028012247e-01 - 21 2.7663066392490315e-01 1.8585830147489818e-01 -4.1028671092043062e-01 - 22 -1.5264342399799477e-01 4.1845204862800724e-02 2.3292791231181800e-01 - 23 -1.6598780624718837e-01 -1.4216125377787692e-01 1.8665118852067922e-01 - 24 1.7395938705451067e-01 9.9287243622129162e-01 -2.8130582480541087e-03 - 25 8.5371877617921851e-02 -3.4926154571277934e-01 8.3162407279371645e-02 - 26 -2.5438600210343160e-01 -6.0532971001937541e-01 -6.1043920583977639e-02 - 27 -5.9057691296948023e-01 8.8625213081514720e-01 -5.6159426164937487e-01 - 28 4.3869841496745360e-01 -4.9934397596427516e-01 3.4410895587468837e-01 - 29 2.2561766442917175e-01 -4.2579408730022317e-01 2.3941365119325805e-01 + 1 -5.0728924838498457e-01 6.5103666817240183e-02 2.0771985969269591e-01 + 2 2.0970578468723564e-01 -2.6990238835616759e-01 -1.0366824974173225e-01 + 3 -3.2066437963910566e-02 -8.5445840119786152e-03 1.9215225597437227e-02 + 4 1.6058960857281807e-01 1.9794590673415598e-02 -6.9464142132574305e-02 + 5 1.4401675303864259e-01 6.8550944474222344e-02 -4.2794255325082832e-02 + 6 4.5076082733530370e-01 4.3493865193126396e-01 -6.5970849928329278e-01 + 7 -2.6471006056148111e-01 -4.1841442101777337e-01 3.6820548204673820e-01 + 8 1.3883711613101028e-02 -6.6622076425677335e-01 3.6731670742563738e-01 + 9 7.0068614206805949e-02 3.4475930738926119e-01 5.2111357818157089e-03 + 10 -7.3141562721756800e-02 1.2490372794234141e-01 -2.0595483230474849e-02 + 11 -1.0877462942391880e-01 1.7131714331840861e-01 -5.0961332793193488e-02 + 12 4.8774881708507550e-01 -4.8039082119846882e-01 8.7456079997201966e-02 + 13 -1.5545005546897012e-01 1.3679837732431432e-01 2.0140035069784335e-03 + 14 -1.7707969146021821e-01 1.4750775193569457e-01 -6.3315124646896124e-03 + 15 -1.4847204804508199e-01 1.0159108719269096e-01 -2.7725247305327112e-02 + 16 -4.9089660630976073e-01 5.3000511710186116e-01 5.3113862759661623e-01 + 17 2.9902160714541109e-01 -4.4936545742727507e-01 -7.7735621557488321e-01 + 18 7.5831490141002400e-01 1.5898687323037315e+00 -1.4777776136713150e+00 + 19 -2.6762758933820496e-01 -7.9648123537752047e-01 8.2246358285022481e-01 + 20 -4.0323171938583541e-01 -7.3535951411605671e-01 7.6955658801909255e-01 + 21 2.7481172550045330e-01 2.3182904144667085e-01 -4.3592612689754545e-01 + 22 -1.5445997087222735e-01 1.9017115850369956e-02 2.4422992671820404e-01 + 23 -1.6502047814421550e-01 -1.5965569094955745e-01 1.9897743887601410e-01 + 24 1.6740990752198429e-01 1.0161059805286288e+00 -4.2562798692915961e-03 + 25 9.4765621590281415e-02 -3.5914499923967502e-01 8.8041110890983543e-02 + 26 -2.5646564550940448e-01 -6.1883141295136934e-01 -5.9807141396760771e-02 + 27 -5.8762441293580703e-01 8.8932080644220779e-01 -5.8551902466546080e-01 + 28 4.3751943068299948e-01 -5.0319938570161471e-01 3.5737402807942859e-01 + 29 2.2369284613564147e-01 -4.2590136806809287e-01 2.5297132727255545e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_nozforce.yaml b/unittest/force-styles/tests/kspace-pppm_nozforce.yaml index df7202d00..57bb16087 100644 --- a/unittest/force-styles/tests/kspace-pppm_nozforce.yaml +++ b/unittest/force-styles/tests/kspace-pppm_nozforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:24:33 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0954907726477938e-01 8.3266274086806424e-02 0.0000000000000000e+00 - 2 2.0332862442923574e-01 -2.8560926630911393e-01 0.0000000000000000e+00 - 3 -3.4180100439200709e-02 -9.1333128910097757e-03 0.0000000000000000e+00 - 4 1.6416273635882703e-01 2.7631304876496857e-02 0.0000000000000000e+00 - 5 1.5806172624970691e-01 7.5212624428037639e-02 0.0000000000000000e+00 - 6 5.5946099238073066e-01 4.1150228804962435e-01 0.0000000000000000e+00 - 7 -3.4292666609060812e-01 -4.0365422819208752e-01 0.0000000000000000e+00 - 8 -1.2935715162980371e-01 -6.1411220397702304e-01 0.0000000000000000e+00 - 9 1.7221009231114509e-01 3.1582795971570582e-01 0.0000000000000000e+00 - 10 -5.3316283432011259e-02 1.1167476867088882e-01 0.0000000000000000e+00 - 11 -8.6533198364341299e-02 1.5459024385220929e-01 0.0000000000000000e+00 - 12 4.6273802703029476e-01 -4.2648610299718331e-01 0.0000000000000000e+00 - 13 -1.5764223135321295e-01 1.1678705787372101e-01 0.0000000000000000e+00 - 14 -1.7361459296268739e-01 1.3770681956928760e-01 0.0000000000000000e+00 - 15 -1.3810098450786729e-01 8.4279550007386225e-02 0.0000000000000000e+00 - 16 -3.5440964031504807e-01 4.4019245309368626e-01 0.0000000000000000e+00 - 17 1.4352828836775777e-01 -4.0709487891749191e-01 0.0000000000000000e+00 - 18 7.7465198064383789e-01 1.6012407184552440e+00 0.0000000000000000e+00 - 19 -2.7124771942286441e-01 -7.9202301391814001e-01 0.0000000000000000e+00 - 20 -4.2073039292256903e-01 -7.3396062844822219e-01 0.0000000000000000e+00 - 21 5.2055303834890487e-01 4.5578891562948592e-01 0.0000000000000000e+00 - 22 -2.9112480004984048e-01 -8.0490171289320595e-02 0.0000000000000000e+00 - 23 -2.8874806785341345e-01 -2.5699483797836481e-01 0.0000000000000000e+00 - 24 7.6980429336623218e-02 1.6939065179875408e+00 0.0000000000000000e+00 - 25 1.1784596545050058e-01 -6.8182668665977952e-01 0.0000000000000000e+00 - 26 -2.2421345945684157e-01 -9.4803070477566309e-01 0.0000000000000000e+00 - 27 -8.6789609111614596e-01 1.6460227641663672e+00 0.0000000000000000e+00 - 28 5.7545985907402075e-01 -9.1143688682325297e-01 0.0000000000000000e+00 - 29 4.1460869719965082e-01 -8.0477733728583611e-01 0.0000000000000000e+00 + 1 -5.2122518715812993e-01 8.2274109129929746e-02 0.0000000000000000e+00 + 2 2.1579389549876749e-01 -2.8002767595864075e-01 0.0000000000000000e+00 + 3 -3.4423365087839046e-02 -9.2911694574339589e-03 0.0000000000000000e+00 + 4 1.6313109319211677e-01 2.8732803162515214e-02 0.0000000000000000e+00 + 5 1.6006244961693120e-01 7.5416518343349503e-02 0.0000000000000000e+00 + 6 5.6463573215132268e-01 4.1624991470032835e-01 0.0000000000000000e+00 + 7 -3.4242972344737210e-01 -4.0015759322405431e-01 0.0000000000000000e+00 + 8 -1.4021290937594946e-01 -6.1668570401320610e-01 0.0000000000000000e+00 + 9 1.8125261559403655e-01 3.1973810465660241e-01 0.0000000000000000e+00 + 10 -5.1854338502522641e-02 1.1080891238524494e-01 0.0000000000000000e+00 + 11 -8.4878109594851328e-02 1.5137309650675809e-01 0.0000000000000000e+00 + 12 4.5813297839559841e-01 -4.2650347418529577e-01 0.0000000000000000e+00 + 13 -1.5616649470266683e-01 1.1616891212301456e-01 0.0000000000000000e+00 + 14 -1.7246773920610964e-01 1.3666064058896701e-01 0.0000000000000000e+00 + 15 -1.3792457158800447e-01 8.5439796734157886e-02 0.0000000000000000e+00 + 16 -3.4440665348558147e-01 4.3447917321253904e-01 0.0000000000000000e+00 + 17 1.3509257866733732e-01 -4.1272993332476832e-01 0.0000000000000000e+00 + 18 7.3530120645183916e-01 1.5516423712954965e+00 0.0000000000000000e+00 + 19 -2.6069205533486994e-01 -7.7624492347758078e-01 0.0000000000000000e+00 + 20 -3.9683049814826199e-01 -7.0637072288433567e-01 0.0000000000000000e+00 + 21 5.1894755209350685e-01 5.3412078964967169e-01 0.0000000000000000e+00 + 22 -2.9427876791102409e-01 -1.1870827406608175e-01 0.0000000000000000e+00 + 23 -2.8815493896438782e-01 -2.8919468081786759e-01 0.0000000000000000e+00 + 24 6.4190945088748272e-02 1.7397469383910240e+00 0.0000000000000000e+00 + 25 1.2866092667631809e-01 -7.0237834620685025e-01 0.0000000000000000e+00 + 26 -2.2274238705563851e-01 -9.7223460816023455e-01 0.0000000000000000e+00 + 27 -8.6027317464615261e-01 1.6509822171487545e+00 0.0000000000000000e+00 + 28 5.7173769380421424e-01 -9.1741171566328839e-01 0.0000000000000000e+00 + 29 4.1202124697862591e-01 -8.0589547658871363e-01 0.0000000000000000e+00 ... diff --git a/unittest/force-styles/tests/kspace-pppm_slab.yaml b/unittest/force-styles/tests/kspace-pppm_slab.yaml index 063d31758..8aa1adbfd 100644 --- a/unittest/force-styles/tests/kspace-pppm_slab.yaml +++ b/unittest/force-styles/tests/kspace-pppm_slab.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:24:38 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.1980382702370276e-01 7.3258075304451956e-02 -5.8884448723158389e-01 - 2 2.0758813947304111e-01 -2.7757108805185410e-01 4.0635600067945321e-01 - 3 -3.4162269342231516e-02 -9.2810719986610134e-03 -1.3960803397804172e-02 - 4 1.6111410168417928e-01 2.8178491439087572e-02 7.4872176103915430e-02 - 5 1.6027339196041890e-01 7.6270070662830550e-02 1.1158329890147675e-01 - 6 5.5824056669963773e-01 4.0698687751960405e-01 2.0526733430432356e-01 - 7 -3.2398437786476353e-01 -3.9262045586651578e-01 -5.2466373103793285e-01 - 8 -1.4349016762576552e-01 -6.0681600869661745e-01 -4.6778484753127247e-01 - 9 1.8943028615740204e-01 3.1355946051200367e-01 5.8202255534962255e-01 - 10 -5.0682328587717741e-02 1.0961451557690000e-01 1.0735294596712240e-01 - 11 -8.4288978483479590e-02 1.5072850462851256e-01 1.2088127897329901e-01 - 12 4.5076807790973977e-01 -4.1932945491541757e-01 -4.4219745743275551e-01 - 13 -1.5287203679376454e-01 1.1401561919320395e-01 1.8502790735060520e-01 - 14 -1.6998846314430652e-01 1.3415927884910950e-01 1.7537521527696448e-01 - 15 -1.3423922829745591e-01 8.3691443402437365e-02 1.4278856303472770e-01 - 16 -3.2526936190980171e-01 4.2408124226172134e-01 1.4337375304794979e+00 - 17 9.6846304115079843e-02 -3.9104740733329563e-01 -1.6848062309194085e+00 - 18 7.4425878177027538e-01 1.5227615755558004e+00 -2.9766061468893517e+00 - 19 -2.7858940546526562e-01 -7.4870903686235446e-01 1.6118351494098533e+00 - 20 -3.8413421032359651e-01 -6.7334443114621845e-01 1.5152763453466962e+00 - 21 4.4515061502690262e-01 5.2577042821115849e-01 -2.5732230168224519e+00 - 22 -2.3762513779500216e-01 -1.3400179724368511e-01 1.2909924316971939e+00 - 23 -2.4898516961698239e-01 -2.9194672275828559e-01 1.2530985642393218e+00 - 24 -2.6593815203818413e-02 1.6406769074122960e+00 -1.8544569335844177e+00 - 25 1.7083608172105313e-01 -6.6089022431384736e-01 9.8590534016646236e-01 - 26 -1.8834656537880107e-01 -9.2932512613827800e-01 8.7793044793919206e-01 - 27 -8.9324096844002610e-01 1.6739957225114674e+00 -2.2613266808654351e+00 - 28 5.6833293449309008e-01 -9.2164016708225627e-01 1.2078156319956979e+00 - 29 4.4345703028566219e-01 -8.2122522063329662e-01 1.0997516184969873e+00 + 1 -5.3259384573169954e-01 7.2343442479244360e-02 -6.4422549162874732e-01 + 2 2.2053391498293723e-01 -2.7201364101116554e-01 4.4076949093457746e-01 + 3 -3.4447379090314430e-02 -9.4694674661238831e-03 -1.6417889942654796e-02 + 4 1.6016276682838956e-01 2.9436532624636500e-02 8.4683311995258526e-02 + 5 1.6255468363515604e-01 7.6571635959599649e-02 1.2307517890961592e-01 + 6 5.6449491946803487e-01 4.1277143164539537e-01 2.7274254189385055e-01 + 7 -3.2387631379542919e-01 -3.8977250063384861e-01 -5.8197535275639822e-01 + 8 -1.5601840043236284e-01 -6.1016244566107780e-01 -5.3423191934932091e-01 + 9 1.9941867802941349e-01 3.1794232031835917e-01 6.2506831136695484e-01 + 10 -4.8912596825589856e-02 1.0877468216161247e-01 1.1679203284472287e-01 + 11 -8.2218121418234605e-02 1.4744443377429173e-01 1.3118158753820347e-01 + 12 4.4524245399599377e-01 -4.1926593560606901e-01 -4.8051851305744731e-01 + 13 -1.5114177161990044e-01 1.1323876589364487e-01 1.9722651903331162e-01 + 14 -1.6852962599836621e-01 1.3307375667073931e-01 1.8643999170668829e-01 + 15 -1.3384866802244341e-01 8.4907777198653653e-02 1.5668357142999295e-01 + 16 -3.1312759311103316e-01 4.1881775564218482e-01 1.4907425608784677e+00 + 17 8.6528200223237872e-02 -3.9792296542860178e-01 -1.7433962300522441e+00 + 18 7.0332437793279190e-01 1.4701303297989521e+00 -3.0857920946957131e+00 + 19 -2.6838149533818761e-01 -7.3064327060441980e-01 1.6604149592304385e+00 + 20 -3.5906756327225675e-01 -6.4339255615085011e-01 1.5702378180995722e+00 + 21 4.4080988256823056e-01 6.0675455431313230e-01 -2.6790579378922010e+00 + 22 -2.3880980602786145e-01 -1.7437592573993593e-01 1.3400027081402524e+00 + 23 -2.4686646910528884e-01 -3.2562387819549216e-01 1.3050471137078268e+00 + 24 -3.8092673727206643e-02 1.6927238208250392e+00 -1.9368790735466832e+00 + 25 1.8218453365448570e-01 -6.8390524483590309e-01 1.0303361921439291e+00 + 26 -1.8896768627223459e-01 -9.5757427848097887e-01 9.1850696749362526e-01 + 27 -8.8794710219005546e-01 1.6763266026824684e+00 -2.3629604171529102e+00 + 28 5.6498494843391078e-01 -9.2650208608251761e-01 1.2611336112813445e+00 + 29 4.4260775222588289e-01 -8.2063364609097056e-01 1.1543704514456872e+00 ... diff --git a/unittest/force-styles/tests/kspace-pppm_stagger.yaml b/unittest/force-styles/tests/kspace-pppm_stagger.yaml index 61df71617..0e4c9631e 100644 --- a/unittest/force-styles/tests/kspace-pppm_stagger.yaml +++ b/unittest/force-styles/tests/kspace-pppm_stagger.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:27:35 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:38 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -56,33 +56,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0888488962950285e-01 8.3430404180325907e-02 2.3883070350075583e-01 - 2 2.0290231222263222e-01 -2.8552521628160221e-01 -1.4795322214007761e-01 - 3 -3.4147227596864727e-02 -9.1044423234983921e-03 2.1050772312966981e-02 - 4 1.6403639693437871e-01 2.7510909903057143e-02 -8.1700222473303191e-02 - 5 1.5793837855428028e-01 7.5134684921661865e-02 -4.3070400148934276e-02 - 6 5.5874989482134696e-01 4.1097082705147381e-01 -7.0880717747024347e-01 - 7 -3.4244419763693645e-01 -4.0336810330768602e-01 4.1416013762933518e-01 - 8 -1.2867011168103898e-01 -6.1360944335177758e-01 3.7373621646565264e-01 - 9 1.7179361391284365e-01 3.1570434896702448e-01 2.9166730933101400e-02 - 10 -5.3386439917058298e-02 1.1157104966535075e-01 -1.9069019877901452e-02 - 11 -8.6641568612711800e-02 1.5447778751280100e-01 -4.3302035139313286e-02 - 12 4.6277613291799979e-01 -4.2640261166652782e-01 5.4642934467963714e-02 - 13 -1.5768096764682599e-01 1.1678927823658505e-01 2.0726708870285715e-02 - 14 -1.7362409264878331e-01 1.3769878891777848e-01 5.6914483198930487e-03 - 15 -1.3804334923445472e-01 8.4232584350085404e-02 -2.2242211531143450e-02 - 16 -3.5505453326610353e-01 4.4007379281236625e-01 5.1108930583976653e-01 - 17 1.4393262437860022e-01 -4.0681625150263201e-01 -7.6550494257092949e-01 - 18 7.7411316765167837e-01 1.6013845677120058e+00 -1.3406161587038208e+00 - 19 -2.7109483507409249e-01 -7.9220736692047411e-01 7.5606765561780620e-01 - 20 -4.2022391372143653e-01 -7.3398564926630305e-01 7.0862056036484811e-01 - 21 5.2066744810063004e-01 4.5601151336785911e-01 -1.1109669200204870e+00 - 22 -2.9131419157235938e-01 -8.0660148622295896e-02 5.6037505807873789e-01 - 23 -2.8851937111607945e-01 -2.5707916023569388e-01 5.3115241105748146e-01 - 24 7.7132406285747662e-02 1.6936935947231240e+00 -2.6197671637095088e-01 - 25 1.1739827770831035e-01 -6.8172720908194795e-01 2.1292828073010400e-01 - 26 -2.2399952098390596e-01 -9.4806186651755442e-01 6.5237310702708273e-02 - 27 -8.6781949013350235e-01 1.6453631212617197e+00 -8.8867885380482659e-01 - 28 5.7526918079966904e-01 -9.1110567278710985e-01 5.1441520143469011e-01 - 29 4.1483886618353916e-01 -8.0439411171811659e-01 4.1599644392583446e-01 + 1 -5.2110389443047966e-01 8.2174837617142615e-02 2.1808851100884483e-01 + 2 2.1575362837922490e-01 -2.7985507607146648e-01 -1.3635384720562826e-01 + 3 -3.4412499347272141e-02 -9.2851595240179864e-03 2.0082401999342678e-02 + 4 1.6309295424664277e-01 2.8699106597915747e-02 -7.8424598315124466e-02 + 5 1.6000485976650286e-01 7.5419186199252142e-02 -3.8271532199610915e-02 + 6 5.6452922927167792e-01 4.1651437288870052e-01 -6.8002099522971760e-01 + 7 -3.4234246122559975e-01 -4.0055178531012858e-01 3.9535126657784059e-01 + 8 -1.4009341296531477e-01 -6.1677431194167931e-01 3.4313561304132167e-01 + 9 1.8118627304514590e-01 3.1987212964642597e-01 4.8663680015288674e-02 + 10 -5.1826170633221855e-02 1.1075413671703493e-01 -1.4899488513243717e-02 + 11 -8.4864826013217043e-02 1.5131714121992473e-01 -3.9677764977413960e-02 + 12 4.5802321421041658e-01 -4.2663086780254944e-01 3.6737616091024911e-02 + 13 -1.5618224691804056e-01 1.1618618922421080e-01 2.6228930224266901e-02 + 14 -1.7245201237131119e-01 1.3673119094228264e-01 9.9092533250611670e-03 + 15 -1.3784363552277656e-01 8.5481154737307205e-02 -1.5195517836673982e-02 + 16 -3.4428489670225737e-01 4.3434535352096393e-01 5.3049265061272988e-01 + 17 1.3490425019990776e-01 -4.1238003101359266e-01 -7.8594268071624529e-01 + 18 7.3489377624877839e-01 1.5518891144247411e+00 -1.3833209761015994e+00 + 19 -2.6071651353161379e-01 -7.7650154707748187e-01 7.6978890572474756e-01 + 20 -3.9638127767834741e-01 -7.0644000153250031e-01 7.2935384554137617e-01 + 21 5.1893256827191392e-01 5.3441769782139692e-01 -1.1580900287803464e+00 + 22 -2.9449738462629443e-01 -1.1887047311705630e-01 5.8095962163225279e-01 + 23 -2.8790115407696282e-01 -2.8923985224095883e-01 5.5380720899811053e-01 + 24 6.4191177940294664e-02 1.7394984516077767e+00 -2.7670608704288824e-01 + 25 1.2835128052019390e-01 -7.0221042172703485e-01 2.2447137762053931e-01 + 26 -2.2247931035350960e-01 -9.7223221992333508e-01 7.3515699476410554e-02 + 27 -8.6026914570906921e-01 1.6503940402012782e+00 -9.3240873788746348e-01 + 28 5.7146552243716164e-01 -9.1711088161406329e-01 5.3820268912067859e-01 + 29 4.1232210756742665e-01 -8.0561147447049097e-01 4.4052298379611776e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_stagger_tiled.yaml b/unittest/force-styles/tests/kspace-pppm_stagger_tiled.yaml index 95cee4cef..c38767f90 100644 --- a/unittest/force-styles/tests/kspace-pppm_stagger_tiled.yaml +++ b/unittest/force-styles/tests/kspace-pppm_stagger_tiled.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:27:35 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0888488962950285e-01 8.3430404180325907e-02 2.3883070350075583e-01 - 2 2.0290231222263222e-01 -2.8552521628160221e-01 -1.4795322214007761e-01 - 3 -3.4147227596864727e-02 -9.1044423234983921e-03 2.1050772312966981e-02 - 4 1.6403639693437871e-01 2.7510909903057143e-02 -8.1700222473303191e-02 - 5 1.5793837855428028e-01 7.5134684921661865e-02 -4.3070400148934276e-02 - 6 5.5874989482134696e-01 4.1097082705147381e-01 -7.0880717747024347e-01 - 7 -3.4244419763693645e-01 -4.0336810330768602e-01 4.1416013762933518e-01 - 8 -1.2867011168103898e-01 -6.1360944335177758e-01 3.7373621646565264e-01 - 9 1.7179361391284365e-01 3.1570434896702448e-01 2.9166730933101400e-02 - 10 -5.3386439917058298e-02 1.1157104966535075e-01 -1.9069019877901452e-02 - 11 -8.6641568612711800e-02 1.5447778751280100e-01 -4.3302035139313286e-02 - 12 4.6277613291799979e-01 -4.2640261166652782e-01 5.4642934467963714e-02 - 13 -1.5768096764682599e-01 1.1678927823658505e-01 2.0726708870285715e-02 - 14 -1.7362409264878331e-01 1.3769878891777848e-01 5.6914483198930487e-03 - 15 -1.3804334923445472e-01 8.4232584350085404e-02 -2.2242211531143450e-02 - 16 -3.5505453326610353e-01 4.4007379281236625e-01 5.1108930583976653e-01 - 17 1.4393262437860022e-01 -4.0681625150263201e-01 -7.6550494257092949e-01 - 18 7.7411316765167837e-01 1.6013845677120058e+00 -1.3406161587038208e+00 - 19 -2.7109483507409249e-01 -7.9220736692047411e-01 7.5606765561780620e-01 - 20 -4.2022391372143653e-01 -7.3398564926630305e-01 7.0862056036484811e-01 - 21 5.2066744810063004e-01 4.5601151336785911e-01 -1.1109669200204870e+00 - 22 -2.9131419157235938e-01 -8.0660148622295896e-02 5.6037505807873789e-01 - 23 -2.8851937111607945e-01 -2.5707916023569388e-01 5.3115241105748146e-01 - 24 7.7132406285747662e-02 1.6936935947231240e+00 -2.6197671637095088e-01 - 25 1.1739827770831035e-01 -6.8172720908194795e-01 2.1292828073010400e-01 - 26 -2.2399952098390596e-01 -9.4806186651755442e-01 6.5237310702708273e-02 - 27 -8.6781949013350235e-01 1.6453631212617197e+00 -8.8867885380482659e-01 - 28 5.7526918079966904e-01 -9.1110567278710985e-01 5.1441520143469011e-01 - 29 4.1483886618353916e-01 -8.0439411171811659e-01 4.1599644392583446e-01 + 1 -5.2110389443047966e-01 8.2174837617142615e-02 2.1808851100884483e-01 + 2 2.1575362837922490e-01 -2.7985507607146648e-01 -1.3635384720562826e-01 + 3 -3.4412499347272141e-02 -9.2851595240179864e-03 2.0082401999342678e-02 + 4 1.6309295424664277e-01 2.8699106597915747e-02 -7.8424598315124466e-02 + 5 1.6000485976650286e-01 7.5419186199252142e-02 -3.8271532199610915e-02 + 6 5.6452922927167792e-01 4.1651437288870052e-01 -6.8002099522971760e-01 + 7 -3.4234246122559975e-01 -4.0055178531012858e-01 3.9535126657784059e-01 + 8 -1.4009341296531477e-01 -6.1677431194167931e-01 3.4313561304132167e-01 + 9 1.8118627304514590e-01 3.1987212964642597e-01 4.8663680015288674e-02 + 10 -5.1826170633221855e-02 1.1075413671703493e-01 -1.4899488513243717e-02 + 11 -8.4864826013217043e-02 1.5131714121992473e-01 -3.9677764977413960e-02 + 12 4.5802321421041658e-01 -4.2663086780254944e-01 3.6737616091024911e-02 + 13 -1.5618224691804056e-01 1.1618618922421080e-01 2.6228930224266901e-02 + 14 -1.7245201237131119e-01 1.3673119094228264e-01 9.9092533250611670e-03 + 15 -1.3784363552277656e-01 8.5481154737307205e-02 -1.5195517836673982e-02 + 16 -3.4428489670225737e-01 4.3434535352096393e-01 5.3049265061272988e-01 + 17 1.3490425019990776e-01 -4.1238003101359266e-01 -7.8594268071624529e-01 + 18 7.3489377624877839e-01 1.5518891144247411e+00 -1.3833209761015994e+00 + 19 -2.6071651353161379e-01 -7.7650154707748187e-01 7.6978890572474756e-01 + 20 -3.9638127767834741e-01 -7.0644000153250031e-01 7.2935384554137617e-01 + 21 5.1893256827191392e-01 5.3441769782139692e-01 -1.1580900287803464e+00 + 22 -2.9449738462629443e-01 -1.1887047311705630e-01 5.8095962163225279e-01 + 23 -2.8790115407696282e-01 -2.8923985224095883e-01 5.5380720899811053e-01 + 24 6.4191177940294664e-02 1.7394984516077767e+00 -2.7670608704288824e-01 + 25 1.2835128052019390e-01 -7.0221042172703485e-01 2.2447137762053931e-01 + 26 -2.2247931035350960e-01 -9.7223221992333508e-01 7.3515699476410554e-02 + 27 -8.6026914570906921e-01 1.6503940402012782e+00 -9.3240873788746348e-01 + 28 5.7146552243716164e-01 -9.1711088161406329e-01 5.3820268912067859e-01 + 29 4.1232210756742665e-01 -8.0561147447049097e-01 4.4052298379611776e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tiled.yaml b/unittest/force-styles/tests/kspace-pppm_tiled.yaml index b4796b6c2..769826d7c 100644 --- a/unittest/force-styles/tests/kspace-pppm_tiled.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tiled.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0900177524332380e-01 8.3541312360770559e-02 2.3847626933913957e-01 - 2 2.0293760437213748e-01 -2.8570861986354196e-01 -1.4764907529922344e-01 - 3 -3.4158170718364404e-02 -9.1103261103567309e-03 2.1028676255224140e-02 - 4 1.6407381836362508e-01 2.7543938443804754e-02 -8.1661581263582694e-02 - 5 1.5799678256598612e-01 7.5131693181657300e-02 -4.3093731729494773e-02 - 6 5.5884729319027959e-01 4.1070142887655381e-01 -7.0845348552640675e-01 - 7 -3.4252252488516066e-01 -4.0296980848156633e-01 4.1421689597710110e-01 - 8 -1.2877561673829283e-01 -6.1352311819313976e-01 3.7338100957587267e-01 - 9 1.7184965305565320e-01 3.1557352532666366e-01 2.9184166085517198e-02 - 10 -5.3416314160604578e-02 1.1162618970928689e-01 -1.9056641624128120e-02 - 11 -8.6656970143397835e-02 1.5453217862588842e-01 -4.3260381230061914e-02 - 12 4.6288691229484780e-01 -4.2627837697985460e-01 5.4462739307820834e-02 - 13 -1.5766510975402218e-01 1.1677248221389504e-01 2.0765584899621815e-02 - 14 -1.7364037400975366e-01 1.3763067517397995e-01 5.7227400340144263e-03 - 15 -1.3812467553300772e-01 8.4189156813104071e-02 -2.2189341317061961e-02 - 16 -3.5518552554301230e-01 4.4020942653600509e-01 5.1103809754957041e-01 - 17 1.4412978936104159e-01 -4.0716931333084577e-01 -7.6542748703258823e-01 - 18 7.7452008907550252e-01 1.6011444029485182e+00 -1.3411322152836536e+00 - 19 -2.7106696803117064e-01 -7.9194312531475608e-01 7.5606651125297675e-01 - 20 -4.2067655880426469e-01 -7.3392054862184575e-01 7.0888202878660511e-01 - 21 5.2066009642687827e-01 4.5571443252966459e-01 -1.1108598505670140e+00 - 22 -2.9107834596471255e-01 -8.0497477430417727e-02 5.6024739795440914e-01 - 23 -2.8876713232015855e-01 -2.5703387138535833e-01 5.3126570223700098e-01 - 24 7.7134065884385553e-02 1.6939505170091371e+00 -2.6162012529552015e-01 - 25 1.1769649007263155e-01 -6.8190526638151339e-01 2.1287906681296132e-01 - 26 -2.2425351267435142e-01 -9.4806947839154443e-01 6.5072664668127181e-02 - 27 -8.6783221113018416e-01 1.6459489466934927e+00 -8.8842216340655056e-01 - 28 5.7554532106965894e-01 -9.1140444835486800e-01 5.1430957288504053e-01 - 29 4.1454386992115411e-01 -8.0467652760281361e-01 4.1582695595428282e-01 + 1 -5.2121967435245176e-01 8.2276870813654021e-02 2.1773560937413439e-01 + 2 2.1578994288481759e-01 -2.8002869659340235e-01 -1.3605106288349972e-01 + 3 -3.4423143990413012e-02 -9.2909371996674761e-03 2.0060308171462465e-02 + 4 1.6313020050102955e-01 2.8731921078866858e-02 -7.8385024910183523e-02 + 5 1.6006178911865315e-01 7.5415704057805025e-02 -3.8295136249515270e-02 + 6 5.6462952264442934e-01 4.1624182855963193e-01 -6.7967311997172886e-01 + 7 -3.4242562967716372e-01 -4.0015067950984540e-01 3.9541683216366214e-01 + 8 -1.4020701379221082e-01 -6.1667976214283382e-01 3.4278194920952065e-01 + 9 1.8124898429916622e-01 3.1973551832688457e-01 4.8679453356032874e-02 + 10 -5.1855355655294477e-02 1.1080842257219518e-01 -1.4887415430484094e-02 + 11 -8.4879373474794961e-02 1.5137251285347694e-01 -3.9635895449896492e-02 + 12 4.5813452674267169e-01 -4.2650138398934273e-01 3.6559273076179781e-02 + 13 -1.5616674881100384e-01 1.1616876905548428e-01 2.6267294393488006e-02 + 14 -1.7246801535453529e-01 1.3665986990484524e-01 9.9378099610652956e-03 + 15 -1.3792480482419428e-01 8.5438892236118891e-02 -1.5143107363134312e-02 + 16 -3.4441451062311990e-01 4.3447931551429225e-01 5.3043980639795230e-01 + 17 1.3509863437497058e-01 -4.1273061354574347e-01 -7.8586693366440896e-01 + 18 7.3529995459909447e-01 1.5516414798630132e+00 -1.3838377564847795e+00 + 19 -2.6069023383700890e-01 -7.7624415323479823e-01 7.6977354503230111e-01 + 20 -3.9682998352093402e-01 -7.0637036037829004e-01 7.2961935030942526e-01 + 21 5.1894870245538671e-01 5.3412001808293463e-01 -1.1579882000391111e+00 + 22 -2.9427831151818179e-01 -1.1870833651570281e-01 5.8082924912572309e-01 + 23 -2.8815516721384660e-01 -2.8919507500651698e-01 5.5392999631998374e-01 + 24 6.4192413877094123e-02 1.7397472940254726e+00 -2.7635623439684104e-01 + 25 1.2865943620580228e-01 -7.0237909865397563e-01 2.2442969485026690e-01 + 26 -2.2274275757597931e-01 -9.7223496278843835e-01 7.3360502836559330e-02 + 27 -8.6027250000429512e-01 1.6509815598008886e+00 -9.3216774014291914e-01 + 28 5.7173856114625488e-01 -9.1741141462362830e-01 5.3810155984815722e-01 + 29 4.1202055537605786e-01 -8.0589450256337947e-01 4.4036539256058621e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tip4p.yaml b/unittest/force-styles/tests/kspace-pppm_tip4p.yaml index 92d1f3256..8efbeef01 100644 --- a/unittest/force-styles/tests/kspace-pppm_tip4p.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tip4p.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -4.9219502771896501e-01 6.7825997224847945e-02 2.2598593166601669e-01 - 2 1.9686628676608359e-01 -2.7647992818485440e-01 -1.1682378805001441e-01 - 3 -3.1740476737278839e-02 -8.3322063559251886e-03 2.0091489406047627e-02 - 4 1.6104327372087407e-01 1.8740359343432603e-02 -7.2842923742213808e-02 - 5 1.4169065562126218e-01 6.8087179469616468e-02 -4.6611712468708329e-02 - 6 4.4582081641640081e-01 4.2765975618869406e-01 -6.9065804140923281e-01 - 7 -2.6491830003856898e-01 -4.1932903961888013e-01 3.8920400508111164e-01 - 8 2.1750663630862879e-02 -6.6107455002064497e-01 3.9548880092737321e-01 - 9 6.3138767419148076e-02 3.3960523387770963e-01 -9.4174074595916365e-03 - 10 -7.4182059400476397e-02 1.2527324719157631e-01 -2.4725407105719986e-02 - 11 -1.1001056908727042e-01 1.7379666841671579e-01 -5.4471136162800235e-02 - 12 4.9120166434758927e-01 -4.7880127390382993e-01 1.0426194608298796e-01 - 13 -1.5654516872337484e-01 1.3676941444076834e-01 -2.7143405414484542e-03 - 14 -1.7835613370095138e-01 1.4823639812367995e-01 -1.0191553664168348e-02 - 15 -1.4835095818811750e-01 1.0002635324433976e-01 -3.4651819219856168e-02 - 16 -4.9694734554213971e-01 5.3366133353882772e-01 5.1699845182335014e-01 - 17 3.0356874594834365e-01 -4.4479707602841817e-01 -7.6330195947789004e-01 - 18 7.9580551193667981e-01 1.6330892845776124e+00 -1.4280843933893035e+00 - 19 -2.7758996834428540e-01 -8.0979184496537215e-01 8.0581380576548423e-01 - 20 -4.2643861717347870e-01 -7.5953834998145642e-01 7.4633957491615588e-01 - 21 2.7395343006383405e-01 1.8475152808644335e-01 -4.1038545618012684e-01 - 22 -1.5079203752403914e-01 4.2476685034005000e-02 2.3252787926638796e-01 - 23 -1.6542016451010194e-01 -1.4166824269928646e-01 1.8686936039598995e-01 - 24 1.7089946501654973e-01 9.9278766934932650e-01 -2.2010464152487264e-03 - 25 8.7121200182391528e-02 -3.4920803755081598e-01 8.2914509369063472e-02 - 26 -2.5363382914047833e-01 -6.0471629213094835e-01 -6.1123446978768432e-02 - 27 -5.8762776661022798e-01 8.8370142352479475e-01 -5.6114171007003544e-01 - 28 4.3825401851051293e-01 -4.9857983011401458e-01 3.4381309450929098e-01 - 29 2.2363392285922160e-01 -4.2417186007794400e-01 2.3903729312586630e-01 + 1 -5.0528958515915312e-01 6.3772847496381638e-02 2.0580567788445342e-01 + 2 2.0995722164594016e-01 -2.6951982774286420e-01 -1.0404143141795737e-01 + 3 -3.1988341577151524e-02 -8.5589431349216705e-03 1.9164076727936696e-02 + 4 1.6028096525402280e-01 1.9919339673265517e-02 -6.9502988634555368e-02 + 5 1.4355906507482827e-01 6.8598090555334487e-02 -4.2471402858227598e-02 + 6 4.5016322905479517e-01 4.3363502696209233e-01 -6.6262278633936156e-01 + 7 -2.6444732799148624e-01 -4.1625806834627282e-01 3.6935231295207804e-01 + 8 1.2852479951564071e-02 -6.6482065777406996e-01 3.6774973522168702e-01 + 9 7.0598714946933150e-02 3.4436302978768113e-01 6.8285841166595869e-03 + 10 -7.3086323137956224e-02 1.2469572537356102e-01 -2.0980215172271794e-02 + 11 -1.0878533697863976e-01 1.7109821650963311e-01 -5.1125579855820336e-02 + 12 4.8706222038964792e-01 -4.7996877948983002e-01 8.8352489768798378e-02 + 13 -1.5522796258730068e-01 1.3672638175115975e-01 1.8561768748805456e-03 + 14 -1.7718659673869239e-01 1.4738643890661740e-01 -6.2551416182655599e-03 + 15 -1.4818328047479082e-01 1.0154474242004301e-01 -2.8192588532074819e-02 + 16 -4.9044441527471982e-01 5.2971354136714188e-01 5.3361681205572364e-01 + 17 2.9868516341077245e-01 -4.4947570727356501e-01 -7.7989365348130790e-01 + 18 7.5743970315926601e-01 1.5865894961498186e+00 -1.4774123291254486e+00 + 19 -2.6708903474644746e-01 -7.9556510171597783e-01 8.2332489102446160e-01 + 20 -4.0318812684938471e-01 -7.3386329449947307e-01 7.7057126514337904e-01 + 21 2.7218475863045632e-01 2.3072827534371937e-01 -4.3600367328055878e-01 + 22 -1.5264234626958881e-01 1.9639419537596996e-02 2.4379225507619001e-01 + 23 -1.6447825055370321e-01 -1.5915812968993984e-01 1.9919831092239915e-01 + 24 1.6428166353917814e-01 1.0160058575533735e+00 -3.6398373317638060e-03 + 25 9.6560986249990821e-02 -3.5907403850339914e-01 8.7795555003100392e-02 + 26 -2.5570717916513558e-01 -6.1821140128544017e-01 -5.9890872300489485e-02 + 27 -5.8462216271066225e-01 8.8675694055702858e-01 -5.8508002027780726e-01 + 28 4.3704517625454381e-01 -5.0243189173383751e-01 3.5708041982064614e-01 + 29 2.2169492265287377e-01 -4.2426752875485785e-01 2.5262395763351625e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tip4p_ad.yaml b/unittest/force-styles/tests/kspace-pppm_tip4p_ad.yaml index a23d76cb5..7aebfdd2f 100644 --- a/unittest/force-styles/tests/kspace-pppm_tip4p_ad.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tip4p_ad.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 21:47:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -59,33 +59,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -1.6327016159094090e-01 8.0968775080487609e-02 -1.9057740315649177e-02 - 2 3.6756296703766365e-02 -1.0113317380792809e-01 6.0831820828548482e-02 - 3 -1.1220130310185358e-02 -1.2873693746196493e-03 1.7717288421147638e-04 - 4 6.4434176826608319e-02 3.8547971879159763e-03 2.2046180003745417e-03 - 5 5.8146037594448807e-02 1.1493405255261257e-02 -2.1440439235576119e-03 - 6 9.6294438116174594e-02 1.0995910471385580e-01 3.9604998747028788e-02 - 7 -5.3755922780231773e-02 -1.2866538407292144e-01 -9.4614834808219889e-02 - 8 3.3465695467828273e-02 -1.6841232697574429e-01 -3.8778639525166282e-02 - 9 -2.5874980008098788e-02 1.0439592916043203e-01 3.4799270386712267e-02 - 10 -3.0568851350642606e-02 3.6596614752739134e-02 1.7282557508635346e-02 - 11 -4.1696331840499708e-02 5.0675537371867349e-02 2.2292204740086811e-02 - 12 1.9333981270162426e-01 -1.1957318361404981e-01 -8.6368555260783922e-02 - 13 -7.4767725722354822e-02 4.2999279194184899e-02 3.2479575012829658e-02 - 14 -6.2248578079244339e-02 3.8595239986566922e-02 2.8254869347983592e-02 - 15 -5.9777898135139680e-02 2.0923058592942780e-02 2.6730851695055288e-02 - 16 -2.5878563532782828e-01 2.2115632012914738e-01 1.7013872757996668e-01 - 17 2.1682302313483293e-01 -2.3060773748883762e-01 -1.6026158840957294e-01 - 18 4.4898801509343816e-01 4.7792857022602275e-01 -3.9208356519291421e-01 - 19 -1.5901216465920184e-01 -2.2478034484596351e-01 1.8906116902548784e-01 - 20 -2.0699071563879207e-01 -2.6542183627950383e-01 2.2730292314095973e-01 - 21 2.7420236009719984e-01 -9.0375179207321063e-02 -1.0621302555517549e-01 - 22 -1.4319312663828224e-01 1.1158957786318151e-01 3.9044766887204208e-02 - 23 -6.8960913905078261e-02 5.7269183408297925e-02 7.2072688404076241e-02 - 24 1.9906301545208713e-01 2.6110100621290372e-01 1.3838213072573724e-01 - 25 -1.2270276865203059e-02 -1.1406791377804390e-01 -2.1122481536264309e-02 - 26 -1.2083309670186375e-01 -1.8011753211776035e-01 -9.9687933435588183e-02 - 27 -2.9760109703929560e-01 1.4824157042986708e-01 -1.2831121563427098e-01 - 28 1.7494250607632428e-01 -7.7334099291327382e-02 1.1251135785411925e-01 - 29 1.0569277390627015e-01 -1.5202257915681323e-02 8.7850209707002996e-02 + 1 -1.6762004971593314e-01 7.7634681492098803e-02 -2.9919219069368511e-02 + 2 4.1458343401295492e-02 -9.6841073057255936e-02 6.7938135633310276e-02 + 3 -1.1283651332831551e-02 -1.3872896593200611e-03 -3.4641623938155890e-04 + 4 6.4208921919575557e-02 4.3323207856432447e-03 4.1903402797946986e-03 + 5 5.8582476085928543e-02 1.1657876934702296e-02 3.1963068285989167e-05 + 6 9.8459749806163357e-02 1.1121132240464317e-01 5.4066646862814149e-02 + 7 -5.4855054590396760e-02 -1.2743540408667584e-01 -1.0579717542082118e-01 + 8 2.9538379161222324e-02 -1.6783954814319899e-01 -5.2460701710630830e-02 + 9 -2.2910935471555580e-02 1.0449609788740995e-01 4.2951772643626200e-02 + 10 -2.9986019920399561e-02 3.6084204925226626e-02 1.9142123810434269e-02 + 11 -4.1000526608729944e-02 4.9290772210755368e-02 2.4307962704155663e-02 + 12 1.9074404150728236e-01 -1.1920258556144460e-01 -9.3896696288614814e-02 + 13 -7.4004530295054161e-02 4.2748774251628423e-02 3.4804930870812267e-02 + 14 -6.1407417965656810e-02 3.8135220540914595e-02 3.0453027469403360e-02 + 15 -5.9305957179373807e-02 2.1368769125298299e-02 2.9568636897125876e-02 + 16 -2.5557277245409959e-01 2.1724837067486655e-01 1.7997917950468048e-01 + 17 2.1428470585253007e-01 -2.2986355581075507e-01 -1.6793914211442143e-01 + 18 4.3567670135960207e-01 4.5723593937795703e-01 -4.0700590553800403e-01 + 19 -1.5435496779265942e-01 -2.1758628679195235e-01 1.9212080072377266e-01 + 20 -1.9913121371365428e-01 -2.5420052187069747e-01 2.3287689803410225e-01 + 21 2.7172703410579996e-01 -7.2328010810715659e-02 -1.1483024712726259e-01 + 22 -1.4133916771045824e-01 1.0293564401570035e-01 4.0737690797296805e-02 + 23 -6.8772244156400292e-02 4.9766992536104095e-02 7.5591009378523435e-02 + 24 1.9495960206988883e-01 2.6268290919882331e-01 1.4150882662022962e-01 + 25 -8.7996093382516696e-03 -1.1469910337254771e-01 -1.9297273538247988e-02 + 26 -1.2036329665741946e-01 -1.8109967169628960e-01 -1.0098877081356308e-01 + 27 -2.9694892088551206e-01 1.4941196922903843e-01 -1.3502412469827560e-01 + 28 1.7452409462754809e-01 -7.8753587013135992e-02 1.1646467156625034e-01 + 29 1.0556127220921359e-01 -1.5366498166437419e-02 9.1568796811293332e-02 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tip4p_nozforce.yaml b/unittest/force-styles/tests/kspace-pppm_tip4p_nozforce.yaml index a2fbf9874..f214cd164 100644 --- a/unittest/force-styles/tests/kspace-pppm_tip4p_nozforce.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tip4p_nozforce.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:30:43 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -60,33 +60,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -4.9283366697424219e-01 6.7509803271427735e-02 0.0000000000000000e+00 - 2 1.9729546519138016e-01 -2.7636937693778246e-01 0.0000000000000000e+00 - 3 -3.1764479665281724e-02 -8.3565189135967523e-03 0.0000000000000000e+00 - 4 1.6115065870137332e-01 1.8822872782323252e-02 0.0000000000000000e+00 - 5 1.4176429590430786e-01 6.8176243111408491e-02 0.0000000000000000e+00 - 6 4.4629743731897220e-01 4.2854923981812915e-01 0.0000000000000000e+00 - 7 -2.6520596143491332e-01 -4.2004918709246636e-01 0.0000000000000000e+00 - 8 2.1443830084821366e-02 -6.6185221349632251e-01 0.0000000000000000e+00 - 9 6.3353882717635993e-02 3.4000152174552384e-01 0.0000000000000000e+00 - 10 -7.4145873579962537e-02 1.2535995705540501e-01 0.0000000000000000e+00 - 11 -1.0997129715759803e-01 1.7388751392531543e-01 0.0000000000000000e+00 - 12 4.9122130074125170e-01 -4.7920873468718922e-01 0.0000000000000000e+00 - 13 -1.5656460878422412e-01 1.3686280506804901e-01 0.0000000000000000e+00 - 14 -1.7836956322523681e-01 1.4835007830468047e-01 0.0000000000000000e+00 - 15 -1.4837153768194108e-01 1.0017874975385921e-01 0.0000000000000000e+00 - 16 -4.9666159718867298e-01 5.3388893317928054e-01 0.0000000000000000e+00 - 17 3.0328295505737091e-01 -4.4489564059306502e-01 0.0000000000000000e+00 - 18 7.9599319663460444e-01 1.6331931351893643e+00 0.0000000000000000e+00 - 19 -2.7776782365391656e-01 -8.0990246877135663e-01 0.0000000000000000e+00 - 20 -4.2649788848127296e-01 -7.5958251159474921e-01 0.0000000000000000e+00 - 21 2.7391850612082885e-01 1.8476557598354837e-01 0.0000000000000000e+00 - 22 -1.5079422770362008e-01 4.2490216111271656e-02 0.0000000000000000e+00 - 23 -1.6541483158667528e-01 -1.4165127004594436e-01 0.0000000000000000e+00 - 24 1.7076915929729478e-01 9.9271765454153926e-01 0.0000000000000000e+00 - 25 8.7256141071843568e-02 -3.4913406699191918e-01 0.0000000000000000e+00 - 26 -2.5360473736671924e-01 -6.0469118519185039e-01 0.0000000000000000e+00 - 27 -5.8767102571338559e-01 8.8378784057344151e-01 0.0000000000000000e+00 - 28 4.3822292844883004e-01 -4.9861224527564257e-01 0.0000000000000000e+00 - 29 2.2366936290714734e-01 -4.2423672082268232e-01 0.0000000000000000e+00 + 1 -5.0529603092523123e-01 6.3769662854384346e-02 0.0000000000000000e+00 + 2 2.0996156642966082e-01 -2.6951868298974713e-01 0.0000000000000000e+00 + 3 -3.1988583705373490e-02 -8.5591890301844071e-03 0.0000000000000000e+00 + 4 1.6028204771540619e-01 1.9920173873967079e-02 0.0000000000000000e+00 + 5 1.4355981376066948e-01 6.8598987958502292e-02 0.0000000000000000e+00 + 6 4.5016804672990368e-01 4.3364400891992722e-01 0.0000000000000000e+00 + 7 -2.6445024307404086e-01 -4.1626534590536118e-01 0.0000000000000000e+00 + 8 1.2849363338788888e-02 -6.6482850065987587e-01 0.0000000000000000e+00 + 9 7.0600882440033957e-02 3.4436704816443642e-01 0.0000000000000000e+00 + 10 -7.3085953638748702e-02 1.2469659893399382e-01 0.0000000000000000e+00 + 11 -1.0878493139115537e-01 1.7109913198399454e-01 0.0000000000000000e+00 + 12 4.8706238793213125e-01 -4.7997288989983672e-01 0.0000000000000000e+00 + 13 -1.5522814469177917e-01 1.3672732124104281e-01 0.0000000000000000e+00 + 14 -1.7718672158216633e-01 1.4738759387992303e-01 0.0000000000000000e+00 + 15 -1.4818349593981403e-01 1.0154627434173311e-01 0.0000000000000000e+00 + 16 -4.9044152628408411e-01 5.2971586272571813e-01 0.0000000000000000e+00 + 17 2.9868230375022603e-01 -4.4947676023163452e-01 0.0000000000000000e+00 + 18 7.5744153460281161e-01 1.5865904583705077e+00 0.0000000000000000e+00 + 19 -2.6709082805304962e-01 -7.9556618359211384e-01 0.0000000000000000e+00 + 20 -4.0318869557849396e-01 -7.3386370033603066e-01 0.0000000000000000e+00 + 21 2.7218437254925049e-01 2.3072844406205381e-01 0.0000000000000000e+00 + 22 -1.5264235617997401e-01 1.9639538031804991e-02 0.0000000000000000e+00 + 23 -1.6447818055129118e-01 -1.5915796446707134e-01 0.0000000000000000e+00 + 24 1.6428039686991897e-01 1.0160052142022122e+00 0.0000000000000000e+00 + 25 9.6562344965855584e-02 -3.5907333171293843e-01 0.0000000000000000e+00 + 26 -2.5570691268521423e-01 -6.1821117841176987e-01 0.0000000000000000e+00 + 27 -5.8462262664228815e-01 8.8675776679755181e-01 0.0000000000000000e+00 + 28 4.3704486676614068e-01 -5.0243220574365055e-01 0.0000000000000000e+00 + 29 2.2169530307190649e-01 -4.2426815336153884e-01 0.0000000000000000e+00 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tip4p_slab.yaml b/unittest/force-styles/tests/kspace-pppm_tip4p_slab.yaml index 035267fa9..69dcdfaf3 100644 --- a/unittest/force-styles/tests/kspace-pppm_tip4p_slab.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tip4p_slab.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:30:38 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -60,33 +60,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0354821726811139e-01 5.5967846131381935e-02 -5.1985966695336350e-01 - 2 2.0222486815064800e-01 -2.6827509138693428e-01 3.8174919658879292e-01 - 3 -3.1827569249092247e-02 -8.6118627137726084e-03 -1.1373445003762840e-02 - 4 1.5884510347610806e-01 1.9754860539942493e-02 6.8025846474256690e-02 - 5 1.4401187575283883e-01 6.9928630801443029e-02 9.2658665634254483e-02 - 6 4.4757511852983761e-01 4.2745385614446446e-01 1.2847050232720492e-01 - 7 -2.5262128248313159e-01 -4.1322519150847548e-01 -4.5142442746491723e-01 - 8 7.8668596525731087e-03 -6.5836225310240626e-01 -3.5751093292782843e-01 - 9 7.8606817422723047e-02 3.4074009853801468e-01 4.8592767822570571e-01 - 10 -7.1715830727829805e-02 1.2387945822813282e-01 8.8253410001734311e-02 - 11 -1.0768356090563561e-01 1.7087075095931867e-01 9.2378379692929419e-02 - 12 4.8042014088476770e-01 -4.7452461053388789e-01 -3.3912039294236951e-01 - 13 -1.5249102711632326e-01 1.3493433497263962e-01 1.4388497485065629e-01 - 14 -1.7486786117504285e-01 1.4592040512192123e-01 1.4102485981181104e-01 - 15 -1.4490740376759367e-01 1.0021404392401717e-01 1.1275703958375444e-01 - 16 -4.7182047286026119e-01 5.2091789992423199e-01 1.3402111830145120e+00 - 17 2.6451183057843936e-01 -4.3324675568171989e-01 -1.5822695555453863e+00 - 18 7.6153366131732314e-01 1.5679688830295708e+00 -2.8820913963693444e+00 - 19 -2.7709505739544776e-01 -7.7394339602668338e-01 1.5650790746108196e+00 - 20 -3.9117632343532288e-01 -7.1056069742775840e-01 1.4625309334873893e+00 - 21 2.2289308101459848e-01 2.3168859506651321e-01 -1.5087148284954559e+00 - 22 -1.1285725823795631e-01 5.2592648174756979e-03 7.8339690235084547e-01 - 23 -1.4106022560010598e-01 -1.6271731633631403e-01 7.2870145507787210e-01 - 24 1.0567507776161272e-01 9.4863518705455885e-01 -1.2119574136930193e+00 - 25 1.2332508864360726e-01 -3.3234902843161318e-01 6.6369683402887292e-01 - 26 -2.3610725689732170e-01 -5.9227409253955976e-01 5.6153342732297529e-01 - 27 -6.0550030290005896e-01 9.0785621304206510e-01 -1.6001786116251175e+00 - 28 4.3104584110072031e-01 -5.0620710007808045e-01 8.6898263429887912e-01 - 29 2.4674428573343818e-01 -4.3769293252848607e-01 7.5523767363729677e-01 + 1 -5.1741021308022928e-01 5.2164463970109785e-02 -5.7035795586691229e-01 + 2 2.1552845355081662e-01 -2.6145885390966006e-01 4.1455932829319120e-01 + 3 -3.2103136898117973e-02 -8.8506517835662529e-03 -1.3601661681107857e-02 + 4 1.5813149106431929e-01 2.0998590621170252e-02 7.7085061898295948e-02 + 5 1.4611782148177443e-01 7.0495101424978557e-02 1.0262211863021993e-01 + 6 4.5237682723361744e-01 4.3384953789975256e-01 1.9026464391810138e-01 + 7 -2.5220238048340610e-01 -4.1025291093818367e-01 -5.0478860778438306e-01 + 8 -1.8080584227147985e-03 -6.6262062885438788e-01 -4.1641859631215317e-01 + 9 8.6463014670901714e-02 3.4599477171923032e-01 5.2262452042463015e-01 + 10 -7.0489736534953079e-02 1.2334020200473024e-01 9.6566992716111827e-02 + 11 -1.0626441695286094e-01 1.6812163421601856e-01 1.0149591994495212e-01 + 12 4.7577991930135149e-01 -4.7567916757872036e-01 -3.7271573985070183e-01 + 13 -1.5102820761813157e-01 1.3482444566331483e-01 1.5423678933941967e-01 + 14 -1.7348673211954843e-01 1.4502141845434144e-01 1.5087187633492033e-01 + 15 -1.4462875081155377e-01 1.0177069356565076e-01 1.2517182091704590e-01 + 16 -4.6460162929294996e-01 5.1779385845248271e-01 1.3893654572043623e+00 + 17 2.5891442131187525e-01 -4.3950548671559936e-01 -1.6317550757697421e+00 + 18 7.2168431617151652e-01 1.5193451885286362e+00 -2.9893884981487782e+00 + 19 -2.6652798165736163e-01 -7.5811338734451528e-01 1.6128149463359120e+00 + 20 -3.6685702835539502e-01 -6.8322050954334113e-01 1.5165955023073157e+00 + 21 2.1951624771560643e-01 2.7908195130062186e-01 -1.5761953363577819e+00 + 22 -1.1336951380799791e-01 -1.8808477419676436e-02 8.1504600690354212e-01 + 23 -1.3925079650238253e-01 -1.8099002366078934e-01 7.6197026590425576e-01 + 24 1.0040861588721736e-01 9.7605298874640822e-01 -1.2616161159601158e+00 + 25 1.3326916759186308e-01 -3.4383632694371846e-01 6.9190323110048380e-01 + 26 -2.4021815268192853e-01 -6.0890409178886584e-01 5.8556538656853796e-01 + 27 -6.0409904237121848e-01 9.0912495784502378e-01 -1.6654694276801689e+00 + 28 4.3013936095125799e-01 -5.0934391123833689e-01 9.0325113244229294e-01 + 29 2.4601612065863304e-01 -4.3639537669310857e-01 7.9029601422825357e-01 ... diff --git a/unittest/force-styles/tests/kspace-pppm_tri.yaml b/unittest/force-styles/tests/kspace-pppm_tri.yaml index 8c8c499a2..effcc73b4 100644 --- a/unittest/force-styles/tests/kspace-pppm_tri.yaml +++ b/unittest/force-styles/tests/kspace-pppm_tri.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 21:44:44 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:39 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -57,33 +57,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -5.0843742364990996e-01 8.3569106126126350e-02 2.3869004681808798e-01 - 2 2.0260518935158200e-01 -2.8566793801959689e-01 -1.4775769810701245e-01 - 3 -3.4139505427391567e-02 -9.1102369058085123e-03 2.1040845653368005e-02 - 4 1.6406465791494448e-01 2.7545164595545651e-02 -8.1691792626280776e-02 - 5 1.5791593796909401e-01 7.5144624449178840e-02 -4.3123965421254067e-02 - 6 5.5851312864985392e-01 4.1077224620909003e-01 -7.0875889426565009e-01 - 7 -3.4227897192321832e-01 -4.0312831620871242e-01 4.1430278385622954e-01 - 8 -1.2878261710692060e-01 -6.1348587718341163e-01 3.7365470261675804e-01 - 9 1.7193713863996088e-01 3.1551266606826278e-01 2.9126082239639601e-02 - 10 -5.3361619011826684e-02 1.1160136482188633e-01 -1.9064467709022512e-02 - 11 -8.6614682572975221e-02 1.5449083742066666e-01 -4.3265586674859233e-02 - 12 4.6266057277221484e-01 -4.2637234503789284e-01 5.4631794079990720e-02 - 13 -1.5766351315563745e-01 1.1681294899671173e-01 2.0739570820393311e-02 - 14 -1.7358194670913971e-01 1.3767760961555200e-01 5.6877210405980620e-03 - 15 -1.3802730623365403e-01 8.4201730571284966e-02 -2.2237927145963319e-02 - 16 -3.5490847732313496e-01 4.4002574108717546e-01 5.1104890687536175e-01 - 17 1.4381799662287545e-01 -4.0684305003209015e-01 -7.6556380707072857e-01 - 18 7.7360347884960035e-01 1.6015628637885322e+00 -1.3414503835852476e+00 - 19 -2.7075055535649700e-01 -7.9218476427969076e-01 7.5623705153586096e-01 - 20 -4.2017637596849644e-01 -7.3403787959097899e-01 7.0897674847349412e-01 - 21 5.2059100205282216e-01 4.5590197107388841e-01 -1.1112653623539857e+00 - 22 -2.9107812125535448e-01 -8.0590907903335715e-02 5.6053438566033609e-01 - 23 -2.8859166237289663e-01 -2.5712668432634350e-01 5.3135046418560505e-01 - 24 7.6767487630669609e-02 1.6938027047206663e+00 -2.6214620844031322e-01 - 25 1.1758421065045190e-01 -6.8181951132482066e-01 2.1323861346857556e-01 - 26 -2.2389452893046308e-01 -9.4802845116256118e-01 6.5306534311576014e-02 - 27 -8.6762068711954310e-01 1.6454344156843170e+00 -8.8884683045951440e-01 - 28 5.7533865457306710e-01 -9.1120693719773582e-01 5.1453927090719698e-01 - 29 4.1450853843992219e-01 -8.0445309605590509e-01 4.1606740131676273e-01 + 1 -5.2066005369952995e-01 8.2312926132517478e-02 2.1794690426342486e-01 + 2 2.1545552800816861e-01 -2.7999743366706203e-01 -1.3615355322356035e-01 + 3 -3.4404828381332388e-02 -9.2909269445028506e-03 2.0072368518114864e-02 + 4 1.6312184086050974e-01 2.8733183788489530e-02 -7.8413820068942305e-02 + 5 1.5998288173508587e-01 7.5429392790713534e-02 -3.8325472780507110e-02 + 6 5.6429322471915511e-01 4.1632392470550417e-01 -6.7997082279454168e-01 + 7 -3.4217787848313713e-01 -4.0031630708578819e-01 3.9549524869525660e-01 + 8 -1.4020433401299354e-01 -6.1665347320024644e-01 3.4304816273732652e-01 + 9 1.8132825635605060e-01 3.1968389007427361e-01 4.8624691480285538e-02 + 10 -5.1801755908571938e-02 1.1078411703837848e-01 -1.4894362867545230e-02 + 11 -8.4838088216954599e-02 1.5133038412746092e-01 -3.9642611187494042e-02 + 12 4.5790737290508626e-01 -4.2660025549979014e-01 3.6728002734784791e-02 + 13 -1.5616332667345120e-01 1.1621062055790747e-01 2.6241617369287387e-02 + 14 -1.7240959045779145e-01 1.3670835124152958e-01 9.9035091564616835e-03 + 15 -1.3782859404394138e-01 8.5453267996699514e-02 -1.5191634347959509e-02 + 16 -3.4413955003523178e-01 4.3429335634432326e-01 5.3045073568601564e-01 + 17 1.3479324037580023e-01 -4.1240123671314199e-01 -7.8600074498430172e-01 + 18 7.3437657517067756e-01 1.5520667539151771e+00 -1.3841612737612068e+00 + 19 -2.6037265260975972e-01 -7.7648701952768662e-01 7.6995023384636896e-01 + 20 -3.9632059845150869e-01 -7.0649229484403020e-01 7.2971321627976138e-01 + 21 5.1885688107444650e-01 5.3431825160127544e-01 -1.1583910013508996e+00 + 22 -2.9426290836677188e-01 -1.1880721427183608e-01 5.8111657571959252e-01 + 23 -2.8797276848378678e-01 -2.8929210441348968e-01 5.5401068545107957e-01 + 24 6.3838616015083324e-02 1.7396164528887272e+00 -2.7687602390001659e-01 + 25 1.2853115224893416e-01 -7.0231012813830562e-01 2.2478443758057515e-01 + 26 -2.2238181734170709e-01 -9.7219755560364440e-01 7.3591409204545669e-02 + 27 -8.6007440151399339e-01 1.6504670743228838e+00 -9.3258391780908345e-01 + 28 5.7153652856597648e-01 -9.1721425493233788e-01 5.3832873054347319e-01 + 29 4.1199104864548836e-01 -8.0567174268399810e-01 4.4059870980970373e-01 ... diff --git a/unittest/force-styles/tests/manybody-pair-airebo.yaml b/unittest/force-styles/tests/manybody-pair-airebo.yaml index 57c71a632..7a751b4be 100644 --- a/unittest/force-styles/tests/manybody-pair-airebo.yaml +++ b/unittest/force-styles/tests/manybody-pair-airebo.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 5e-06 prerequisites: ! | pair airebo @@ -67,57 +67,57 @@ init_forces: ! |2 46 -6.4059561000704031e-04 1.5796469864722801e-02 8.7781880557686095e-03 47 1.5239882999050557e-02 -3.1268760745643753e-03 1.8994686979097005e-02 48 9.4124555469617685e-04 2.8313380234794853e-02 1.4160015571855478e-02 -run_vdwl: -184.686733268654 +run_vdwl: -184.909469169338 run_coul: 0 run_stress: ! |- - -8.3410051971885424e-01 1.3625323642932721e+00 4.1461501508495013e+00 8.6688227256219996e-01 1.5565717748380517e-01 1.4790555833058188e+00 + -1.7004513060135343e-01 8.3214504293749170e-01 5.8484143488625218e-01 1.5625759760276972e-01 -6.3405563108599003e-02 1.1836497162460788e+00 run_forces: ! |2 - 1 -2.7566525107809318e-02 -1.8961404924034975e-01 5.5232231950330789e-03 - 2 -1.2758309231200282e-01 -1.9769482352839155e-02 -6.3019726921142868e-02 - 3 7.6250703896397640e-02 -8.9398464495202608e-03 1.1147884265844542e-01 - 4 2.3085246545061733e-01 3.1284937254363476e-01 -7.3585264863498745e-01 - 5 -1.9144857312851615e-01 -1.2515355098923714e-01 -1.5959719844577522e-01 - 6 -1.9647387066787372e-01 5.8583959861360932e-02 -5.5802890003857034e-02 - 7 -7.4393491306453985e-01 -2.1031898155941424e+00 -1.3179845766973441e+00 - 8 1.4451248841145776e-02 -7.5094603421028893e-03 5.1335942947151741e-03 - 9 6.3511525939309199e-02 2.9090392490561837e-02 1.3303386864174215e-02 - 10 -1.9672634807891523e-01 1.8083728118630801e-01 4.5651093638569429e-01 - 11 8.4872388548445898e-01 1.9358940575890571e+00 1.7628952060030210e+00 - 12 1.5987186106095264e-01 -9.8208391350393887e-02 1.2853301921141560e-02 - 13 8.2379101312774386e-02 -3.7742159339381581e-01 7.7965598133185904e-02 - 14 -1.5216836068437717e-01 2.2238518425134669e-02 -6.8256075141941222e-02 - 15 1.3519830621083784e-01 1.8694222750179545e-01 -4.5760020752184015e-02 - 16 -9.4122812277554868e-02 3.7460162964963219e-02 -1.8223514295685489e-01 - 17 6.3613595149790536e-02 -3.9090346770006286e-02 3.5671486224074810e-02 - 18 7.8916322295767963e-02 -1.2892708246196263e-01 1.4769704074590567e-01 - 19 -8.3810673528647555e-03 -8.5441646265745450e-02 5.3647900953469149e-02 - 20 -1.6539114897139909e-01 2.1397130301406403e-01 -1.0949816014942894e-02 - 21 1.3818067438426573e-01 -6.8993959043769607e-02 -2.1299386806295124e-02 - 22 -1.5856475763177083e-03 1.5748026932167003e-01 7.4938732730195579e-02 - 23 3.9340145378663122e-02 -1.4061855355790968e-02 -9.4604853769769570e-02 - 24 -4.0312184075427006e-02 1.5211975019366620e-02 2.0132865843451725e-02 - 25 -6.4229350400654264e-02 6.5121223305082257e-02 1.0056877607918861e-01 - 26 -1.7220602843542449e-01 -1.1015144383642610e-01 3.6631722097947343e-02 - 27 2.1703726611672525e-02 -3.5813737565299292e-02 -3.8490244907288140e-02 - 28 -7.9119032244579168e-02 1.3730457326547163e-01 -1.8741773388952015e-01 - 29 1.0488978251101254e-01 -1.1909435018113117e-01 3.7305458437005917e-02 - 30 1.5288232489842238e-01 -1.7372783419202745e-01 5.5596050035545151e-02 - 31 2.7049702020580869e-02 8.7269359923485251e-02 -8.0188955708864224e-02 - 32 -1.5669855197695848e-01 2.6784824182432453e-02 -1.4149188090162742e-02 - 33 1.4491176754189819e-01 5.7431352138432642e-03 -3.3994471687721864e-02 - 34 1.4553829964664816e-01 1.6556081633947264e-01 1.3970048432616899e-01 - 35 -1.0616681119412462e-01 4.6690438466217482e-02 7.4629391229118824e-02 - 36 -7.4068565095854799e-02 -8.2089870709701862e-02 -1.3462256268225453e-01 - 37 -5.7540799130195752e-01 5.0058614364608629e-02 1.7327763650198574e-01 - 38 1.3880800864979662e-01 -1.1430713799896731e-02 -9.5273453741880343e-02 - 39 1.3583699403986030e-01 7.1359222213997292e-02 3.6415542956628806e-02 - 40 2.4826377557322687e-01 -8.7545078947765323e-02 -1.6810450734482277e-01 - 41 -9.9940408667160155e-02 -4.7990932334050156e-02 9.9884783379563344e-02 - 42 -5.1291223401165813e-02 4.7496283547191202e-02 -9.4577003424099033e-04 - 43 3.2988332629179412e-02 -1.0775544344105276e-01 -1.4421909297187224e-01 - 44 7.4156020575267502e-03 -1.6440936142548804e-03 -6.8207536960046720e-03 - 45 6.0379992226191302e-02 1.2659562736103339e-01 2.3394684516017537e-02 - 46 -9.9942524249085951e-02 1.1237800722245612e-01 1.0203699454103866e-01 - 47 1.9442848972770918e-01 6.9497639530798572e-02 -1.3132256701126685e-01 - 48 7.8378396725857863e-02 -1.1885470662272486e-01 1.3371799785827665e-01 + 1 3.1968010536429267e-02 -1.2884732790134934e-01 -7.3055316825839087e-02 + 2 -1.0440064449805800e-01 -1.9966896216231885e-03 -2.2144046666320402e-02 + 3 5.8597586931108392e-02 2.5072941938287643e-02 5.9987930764453211e-02 + 4 4.0209863382041250e-01 1.4126472925755204e-01 1.1868949323312747e-01 + 5 -1.9226594693289298e-01 -1.5049117643415380e-01 -6.8284976548603563e-02 + 6 -1.8456710729022174e-01 7.7071918317271976e-02 7.1084993110922309e-04 + 7 -5.0526945522017275e-01 -1.2162657266083619e+00 -7.5149216755478898e-01 + 8 5.5671480948756596e-02 -6.2457630065793850e-02 3.6683750598605516e-03 + 9 8.0658291206973532e-03 -2.1308648132244055e-02 -2.1315606298215304e-04 + 10 -7.2724439870013424e-02 2.4235938456589429e-01 2.2163584505166794e-02 + 11 3.0556908534798144e-01 1.1995215897668396e+00 6.5498553558875705e-01 + 12 1.1069176871387652e-01 -1.3716128296853117e-01 9.1954344341361918e-02 + 13 7.0763407612768184e-02 -3.2605811902691756e-01 1.0266974718754414e-01 + 14 -1.6160767685985042e-01 2.6330606151604981e-02 -1.3130513186058151e-01 + 15 1.2484911344116754e-01 1.7329649880278464e-01 -3.3624708287369083e-02 + 16 -1.6207993525627984e-01 6.4618343283096943e-02 -1.4517386698711790e-01 + 17 8.0332607793219171e-02 -1.8637784365227728e-02 2.6013965837861124e-02 + 18 1.1769561342852561e-01 -1.3921101108657621e-01 1.7616012550235000e-01 + 19 2.2405141685224676e-02 -2.1757944461114564e-02 5.1135343746829223e-02 + 20 3.4115706904014087e-01 -1.5330230033889341e-02 2.6089432860766756e-02 + 21 -3.2455629900214761e-01 1.2020713536500423e-01 5.5356290559332381e-02 + 22 -8.6411338080703958e-03 1.0759179248253037e-01 7.7124849437731425e-03 + 23 1.8244145641428327e-02 -1.5916841163850084e-02 -6.8262004048871908e-02 + 24 -4.6136375962596260e-02 -2.8812006575362554e-02 -7.6689467951676388e-02 + 25 -4.2340671304237923e-02 5.7556280461314849e-02 6.9754459904136756e-02 + 26 -9.7807355997468759e-02 -9.1727636608371049e-02 2.5849793586968497e-02 + 27 2.3404667167986282e-02 -3.7034604812086383e-02 -4.0009713377594604e-02 + 28 -1.2170293917314898e-01 1.2575850732960484e-01 -1.4012507030874324e-01 + 29 7.4575711204569850e-02 -8.3411325034286526e-02 -1.8370076388071598e-02 + 30 1.5037478713518504e-01 -1.2327519766154285e-01 8.4631834325213970e-02 + 31 6.4033684164725643e-03 -6.6227112441060122e-03 -1.0299803497344922e-02 + 32 -1.3150622126691711e-01 5.2183689859006045e-02 -4.5892537836378124e-02 + 33 1.4494349291901024e-01 3.7021938889985215e-02 -7.2048890491273443e-02 + 34 1.3594744825725130e-01 1.0547720801018456e-01 2.5423855850036391e-02 + 35 -1.4640672445384234e-01 2.6504476724727014e-02 1.4231881636281363e-01 + 36 -4.6464648100379299e-02 -4.9541443727783060e-02 -6.6763188613322186e-02 + 37 -4.6587432880792329e-01 3.4158933022531687e-02 9.3869044291520612e-02 + 38 1.3857105534505579e-01 -5.8154755191060448e-02 -6.2983486068176470e-02 + 39 1.4161589227663957e-01 8.9024112934522781e-02 2.4708214699504748e-02 + 40 2.1797045929526668e-01 -4.8240457427981449e-02 -9.7344416843980680e-02 + 41 -8.1493375869219661e-02 -5.6887943296415049e-02 5.5606126166099765e-02 + 42 -6.1255334606703418e-02 5.8351370960536546e-02 -3.8706548985624639e-03 + 43 -2.2308880352961483e-02 -1.1234080964486098e-01 -7.5904167187310911e-02 + 44 5.3113350117327037e-03 -5.4016012920281064e-03 -1.0334386639022088e-02 + 45 8.5410010097374783e-02 1.4291012736811426e-01 1.2736768731921123e-02 + 46 -1.9777095464111377e-01 7.9504005038384895e-02 7.1145488805480564e-02 + 47 2.2795269965434251e-01 7.1856802346858178e-02 -7.4005003536808084e-02 + 48 7.6590028431596610e-02 -1.0075148849111834e-01 8.4854331694748888e-02 ... diff --git a/unittest/force-styles/tests/manybody-pair-airebo_00.yaml b/unittest/force-styles/tests/manybody-pair-airebo_00.yaml index 30fe7fde4..02a2d2e1a 100644 --- a/unittest/force-styles/tests/manybody-pair-airebo_00.yaml +++ b/unittest/force-styles/tests/manybody-pair-airebo_00.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:27 202 epsilon: 1e-07 prerequisites: ! | pair airebo @@ -67,57 +67,57 @@ init_forces: ! |2 46 7.6023397517703095e-02 -2.2544487533539470e-01 4.2072193193403246e-02 47 -7.6877574240748030e-04 5.5783708545097566e-02 -2.0995954025529923e-02 48 5.1056308529232042e-02 8.5470102504109025e-02 6.8395640494008869e-02 -run_vdwl: -185.084340567887 +run_vdwl: -184.987048108923 run_coul: 0 run_stress: ! |- - -1.3323153386673774e+00 6.5009894327154760e-02 -1.7326291586383442e+00 4.9671868735735564e-01 2.8136179703319608e-02 5.7806981457586715e-01 + -4.3376938809685628e-01 9.4641522574347858e-01 -1.4056170063304145e+00 1.9738399077051577e-01 -1.3923958411780546e-01 6.7259467679991358e-01 run_forces: ! |2 - 1 6.8355528493844298e-02 -1.1944451443270802e-01 -4.4125204825235098e-01 - 2 -1.2861924608968991e-01 -4.4137097431923344e-02 -1.2751824466012474e-01 - 3 8.1494435661480014e-02 -3.6920590518428054e-03 1.0040642950505263e-01 - 4 3.7527017608456914e-01 6.6940856681461991e-02 5.8019895967875557e-01 - 5 -1.8393789675484831e-01 -1.5834568564675960e-01 -8.6224034419114470e-02 - 6 -1.7282212455395130e-01 4.5083734857249647e-02 3.1197253351678889e-02 - 7 -3.3619376905194437e-01 -5.8091977753188084e-01 -5.8107276386347717e-01 - 8 1.0273233422549642e-01 -8.5412334130676976e-02 5.6323287362551079e-02 - 9 -1.3215510856196822e-02 -3.8099218776399491e-02 2.0437541579240195e-01 - 10 1.6412187218573659e-01 4.5430627507431653e-01 -7.0297693657988702e-01 - 11 -4.9902630586834862e-02 6.7017696686888217e-01 8.2705477529688232e-01 - 12 5.2147711171131816e-02 -1.6146646227932876e-01 1.8929213157343128e-01 - 13 6.4751997045543686e-02 -3.5563305441624971e-01 1.2820269624458880e-01 - 14 -1.5333471357819128e-01 1.5914151143699928e-02 -6.5037280503974712e-02 - 15 1.2286738982966094e-01 1.9265004204325895e-01 -4.9637041122573833e-02 - 16 -1.0852990429909931e-01 7.3201982309721483e-02 -2.4712787611616815e-01 - 17 6.0229575881071917e-02 -1.8934283782071015e-02 6.7629621559359809e-02 - 18 9.6466429473633097e-02 -9.9301800509148969e-02 1.5137717899747341e-01 - 19 -7.7003389183944088e-02 -2.3023763423969890e-02 4.8266701905256490e-02 - 20 -1.7916905871455191e-01 1.9867797610853855e-01 4.8402207345646708e-02 - 21 1.6856210984353245e-01 -7.9511292426074076e-02 1.0001675896785096e-02 - 22 3.4304140788237750e-02 1.3519423218540497e-01 6.6300981648753990e-02 - 23 6.2839752037413682e-02 -2.6370577409609117e-02 -1.1545103162740503e-01 - 24 -9.2732980601280657e-02 -1.0950138658861922e-02 -4.0836736654732086e-02 - 25 -1.2036034340714141e-01 5.2468101598679873e-02 4.3362109026140239e-02 - 26 -1.3709346740420025e-01 -9.5632079961340877e-02 5.9007750969542250e-02 - 27 4.0569120071207609e-02 -4.4990684200391068e-02 -4.9804224785798434e-02 - 28 -6.4018377994091560e-02 6.0553928500104437e-02 -1.8776358251620712e-01 - 29 9.6890302093696382e-02 -1.2338057085228121e-01 6.7295979231108971e-03 - 30 1.5163669686192729e-01 -1.4218642480904720e-01 7.9473882014891972e-02 - 31 3.1597012409922437e-02 1.8162006569087685e-01 8.0853434851491893e-02 - 32 -1.5574245261504957e-01 -1.4903833490853655e-02 -5.9160677478346482e-02 - 33 1.4736721012005907e-01 -3.2985065985107143e-02 -6.7005897560507538e-02 - 34 2.2444726480772675e-01 1.4487810359056891e-01 7.1462055528190113e-02 - 35 -8.5673030495807490e-02 6.1015455839103921e-02 1.2177185351699812e-01 - 36 -8.9050814377041709e-02 -9.1447680120703895e-02 -1.4873052627530475e-01 - 37 -6.2333640474717122e-01 5.1087346671760403e-02 1.7873483824820902e-01 - 38 1.1822724805114426e-01 1.3806051076594161e-03 -7.8201063267624660e-02 - 39 1.5210289064479374e-01 6.3318639778475738e-02 2.3309631651053708e-02 - 40 2.9670421707793115e-01 -1.4891122500091292e-01 -2.2577727039126999e-01 - 41 -1.1163722101360789e-01 -1.6291547452462640e-02 1.1570402265470292e-01 - 42 -2.8439534417055767e-02 4.1199861152822509e-02 -2.5621427173460498e-02 - 43 -3.1571378405888584e-01 3.7002322228513365e-02 -1.2890733821154285e-01 - 44 7.4865147797376075e-04 -1.9134731646395786e-03 -2.0910975730097647e-03 - 45 2.7239277705401937e-01 7.6632675253599444e-03 -9.6378796865211891e-03 - 46 -7.4845763922132422e-02 2.0438477364830343e-02 1.4619059575391516e-01 - 47 1.9442828039042842e-01 7.3643646110724048e-02 -1.5176869728387757e-01 - 48 1.2011729494053558e-01 -1.3053139348677081e-01 1.5597458770641501e-01 + 1 1.3612973180768417e-01 -8.1990703046931346e-02 -2.8837110902855390e-01 + 2 -1.4983157541097120e-01 -2.4999105515527864e-02 -1.4517022239602428e-01 + 3 7.5494114617980390e-02 1.4829984678192659e-02 4.9931554804602873e-02 + 4 3.2740853805722142e-01 8.3458722929667217e-02 2.7543952004115502e-01 + 5 -1.9483782743148459e-01 -1.5477165407738652e-01 -3.3868461577429287e-02 + 6 -1.6278402138094014e-01 1.0697502492555483e-01 7.9793040331912368e-02 + 7 -4.1119389228829667e-01 -1.0519733293315172e+00 -5.4952029933065838e-01 + 8 1.0958835343001930e-01 -7.7678442462337363e-02 5.5535531282736219e-03 + 9 6.1445090932611135e-03 3.8682720223998102e-04 1.7059370105667387e-01 + 10 -1.4415854930117872e-01 2.5022809566917303e-01 -3.1449593038988721e-01 + 11 2.5053201952732079e-01 1.0860926259259365e+00 6.7601041505941095e-01 + 12 1.1619019661903532e-01 -1.0458636436547192e-01 1.2399196477525870e-01 + 13 5.0917314290596816e-02 -2.9890652976649884e-01 1.5478234648483979e-01 + 14 -1.6940161871730669e-01 2.7266148178867022e-02 -1.2173671833459808e-01 + 15 1.2225177875112098e-01 1.8126344942866141e-01 -5.4285154847897199e-02 + 16 -1.7047478451410092e-01 1.0700114911170699e-01 -2.1116750882789495e-01 + 17 8.0197606506845931e-02 5.3760115645575812e-03 5.9731884263165724e-02 + 18 1.2793069331244525e-01 -1.0249457522382374e-01 1.7020340896085945e-01 + 19 -3.7061486258523568e-02 1.0520015248531528e-01 8.1203004345150681e-02 + 20 3.2418641595288555e-01 -5.0412255112475185e-02 9.8756072299681530e-02 + 21 -3.2787791373039016e-01 5.4825097206076846e-02 4.9645432729952574e-02 + 22 1.7933925583651644e-02 5.7918407805456262e-02 2.5143643292926357e-02 + 23 5.9546364007956772e-02 -2.9904855294364117e-02 -1.0649366650110899e-01 + 24 -7.5844105921167748e-02 -5.0323538411854912e-02 -1.4048534890569531e-01 + 25 -1.1773111655894919e-01 5.9583156555274353e-02 -1.4386239587577121e-02 + 26 -5.0428772066175909e-02 -7.5077527226974500e-02 6.4236461747708917e-02 + 27 4.1318402660349474e-02 -4.5971682531591368e-02 -4.9887726474734523e-02 + 28 -9.3533143435938979e-02 -4.3176802099098632e-02 -1.4767051611900592e-01 + 29 5.5450648189035674e-02 -5.1511108071291778e-02 -5.9669129258305365e-02 + 30 1.4556963947523718e-01 -4.9734244896982194e-02 1.2306647494181694e-01 + 31 2.1894622024938970e-02 9.7681729228914521e-02 1.7302911324700165e-01 + 32 -1.3101018176376950e-01 5.7931454653965542e-03 -9.8649686980188986e-02 + 33 1.3866542372408736e-01 -8.3087160454619058e-03 -1.1019783085522313e-01 + 34 1.7504748729845210e-01 9.0389882121422099e-02 -1.2511805193457917e-02 + 35 -8.4939500555612918e-02 2.7275160800394844e-02 1.5240922922911493e-01 + 36 -5.8985106331305603e-02 -5.2914675831593552e-02 -6.9656071171885270e-02 + 37 -5.6583778390923878e-01 1.3828981949338270e-01 9.5393732903579220e-02 + 38 1.2591665112704686e-01 -6.9464714066462402e-02 -3.0490770808320078e-02 + 39 1.4582739651194424e-01 3.5359225199400546e-02 -6.4986186224247344e-03 + 40 3.3861541241575083e-01 -2.2091738877425343e-01 -1.3527129839439234e-01 + 41 -1.2316035208259188e-01 3.0555844664782117e-02 7.1728281143000561e-02 + 42 -1.7669879209682382e-02 8.6630067769811026e-02 -5.0020702061193578e-02 + 43 -3.7797768657418890e-01 1.0463358132473431e-01 -5.1581326126599714e-02 + 44 -2.3041892640140033e-03 -6.8086619716243857e-03 -5.2973949593809189e-03 + 45 2.7224826465178009e-01 -3.7375390673382691e-02 -2.2512012997494169e-02 + 46 -1.3917041763515384e-01 -1.1656207286199401e-01 1.0756484530380758e-01 + 47 2.1683596222942297e-01 1.1575350510095996e-01 -1.0659093417774149e-01 + 48 1.2437243247491070e-01 -6.6902477176977559e-02 1.2827880383777929e-01 ... diff --git a/unittest/force-styles/tests/manybody-pair-airebo_m.yaml b/unittest/force-styles/tests/manybody-pair-airebo_m.yaml index e5d4a97ec..6942328f4 100644 --- a/unittest/force-styles/tests/manybody-pair-airebo_m.yaml +++ b/unittest/force-styles/tests/manybody-pair-airebo_m.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:22 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:28 202 epsilon: 1e-07 prerequisites: ! | pair airebo/morse @@ -67,57 +67,57 @@ init_forces: ! |2 46 -1.2686955525069661e-02 1.5757428775066942e-02 7.5875168576671499e-03 47 1.3552850486712849e-02 -1.4399850633487542e-03 1.9372348907855261e-02 48 -3.5635040678223824e-02 1.8069673365221146e-02 4.9559034910065504e-02 -run_vdwl: -184.884287638713 +run_vdwl: -184.906187675512 run_coul: 0 run_stress: ! |- - -1.7553297389663807e+00 -2.0601635049893026e+00 -1.2914715105335668e+00 -1.2164852300255997e-01 -4.6612665537491982e-01 -1.7584106513907777e-01 + -7.3880100944953520e-01 -6.6034554071388640e-01 -1.3687882641804252e+00 -1.9309013048921472e-01 -3.0339410967612923e-01 4.5698202536312321e-01 run_forces: ! |2 - 1 -4.7056658298582076e-04 -1.4634222942799394e-01 -3.1706476526805027e-01 - 2 -1.3535142579879833e-01 -3.4314289056189752e-02 -1.0367582735591681e-01 - 3 6.8650003463217715e-02 -8.3697069795512120e-03 9.6833809476059018e-02 - 4 4.2071591222775861e-01 1.7283632620651795e-01 3.9136383645688072e-01 - 5 -1.7865994780460992e-01 -1.4611726831783364e-01 -1.1398589448509859e-01 - 6 -1.7784101851934428e-01 4.5618526085822425e-02 1.8657271970413374e-02 - 7 2.3090519777513271e-01 9.6499512779086294e-01 3.5569275071901496e-01 - 8 6.8680141620648019e-02 -6.5043644160050693e-02 3.3101755591902426e-02 - 9 1.4039981406452870e-02 -5.8844391944973380e-02 9.9688858750920539e-02 - 10 5.3646218762077855e-02 4.9904730056839725e-01 -2.3006541661968963e-01 - 11 -4.4688380209968831e-01 -1.0148824359301210e+00 -3.2575486748268678e-01 - 12 5.9125769005741756e-02 -1.6455074843131096e-01 1.4182565053188184e-01 - 13 7.4818684100851671e-02 -3.6120445920708949e-01 9.3359386334273653e-02 - 14 -1.5618766168829912e-01 2.0408313847255815e-02 -6.3657252717194857e-02 - 15 1.3274432075484421e-01 1.8890222305075144e-01 -5.3774497785697782e-02 - 16 -1.0939749808088689e-01 7.0297915308787498e-02 -2.0655632465075238e-01 - 17 6.6926827327773053e-02 -4.4104673887093666e-02 3.3117350168894881e-02 - 18 8.4614454722492821e-02 -1.0145181052862164e-01 1.6550368839223134e-01 - 19 -4.1619642190982541e-02 -9.6396190853089911e-02 4.1403847715373324e-02 - 20 -1.9839035226178811e-01 2.1599992066411777e-01 -1.3457232824090459e-02 - 21 1.5383852967224548e-01 -7.2701207696353312e-02 -5.0818378502930973e-04 - 22 -9.4230270862067055e-03 1.7342238753231365e-01 9.0815029821744414e-02 - 23 3.4558368487069897e-02 -1.2078171184596179e-02 -9.1321557338724546e-02 - 24 -4.7349089756643828e-02 7.0930724599967106e-03 9.2840611032212628e-03 - 25 -5.8830023005069586e-02 5.5493152701298960e-02 8.9356007987085137e-02 - 26 -1.6126938215990105e-01 -1.0589550989698598e-01 4.4457820280718992e-02 - 27 3.2050225113605772e-02 -4.6858682187267103e-02 -4.6030115729389323e-02 - 28 -7.5947731462843282e-02 1.3782694351300281e-01 -1.7799302352415669e-01 - 29 1.0756252212717538e-01 -1.2493903809259364e-01 3.7463632651968878e-02 - 30 1.5346237725582387e-01 -1.7193789085169181e-01 5.7093382017703226e-02 - 31 3.7100886471736753e-02 6.6328162647684819e-02 -6.8241776528602388e-02 - 32 -1.5386863547969926e-01 3.1563293915620398e-02 -1.1714437764915764e-02 - 33 1.4713421544405372e-01 2.1760039530633707e-04 -3.2616373504918299e-02 - 34 1.9064328958682114e-01 1.4591501668099530e-01 9.8409456596864342e-02 - 35 -9.9846542261889978e-02 5.2704676893072323e-02 9.6991422347650041e-02 - 36 -7.6502955446541621e-02 -8.5095668829058016e-02 -1.3897135591211321e-01 - 37 -5.9216580817461095e-01 1.2321315564060400e-02 1.7075406198563545e-01 - 38 1.3228377510993414e-01 -1.4179759288390884e-02 -9.3273292141222208e-02 - 39 1.4106998279682412e-01 7.9136335255856782e-02 3.3231256275553296e-02 - 40 2.4863765861074733e-01 -8.9429039881233977e-02 -1.8767583738581864e-01 - 41 -9.8668584541866278e-02 -5.0568392084021939e-02 9.8367911149062015e-02 - 42 -4.9260030547804493e-02 4.8085923600047889e-02 -1.2364163270556597e-02 - 43 -1.1397987292289991e-02 -1.4101799789272826e-01 -1.4770764058051941e-01 - 44 6.9144141741118775e-03 -2.2619416778199885e-03 -6.2863438078055783e-03 - 45 1.0662201618495948e-01 1.1264787973634517e-01 1.1636487874690335e-02 - 46 -1.4095023595362419e-01 1.1420276586190301e-01 1.2027784751424971e-01 - 47 1.8817799678511232e-01 7.9435207983366785e-02 -1.2950610265865653e-01 - 48 6.5358179209163397e-02 -1.3591423997672408e-01 1.4351569940761391e-01 + 1 6.5400803642784982e-03 -1.3407698248315517e-01 -2.0829064600990260e-01 + 2 -1.2374019631170799e-01 -5.5808097430776909e-04 -9.7322153696196373e-02 + 3 5.9974413602739161e-02 2.4243742564423933e-02 3.4995953096788705e-02 + 4 4.0885402522844733e-01 1.2228368183454068e-01 2.1036892163668497e-01 + 5 -1.8781522825010089e-01 -1.5716807555056544e-01 -5.5047926085742355e-02 + 6 -1.7075164498410314e-01 8.6068623377889161e-02 7.5204636125814350e-02 + 7 -1.2378722323844026e-01 -1.2418238300500649e-01 -1.1313965972142538e-01 + 8 1.0850829162078962e-01 -7.1107169738330755e-02 1.2484435591287594e-02 + 9 2.9796548655704465e-03 -3.1447486948678820e-02 9.8939114762694097e-02 + 10 -1.7836089373165765e-02 3.2633259916989377e-01 -1.8708288190918873e-01 + 11 -7.1545104942061344e-02 1.4843840094997976e-01 1.6342165327946376e-01 + 12 8.5299295127662059e-02 -1.4271867557489834e-01 1.1319631861165033e-01 + 13 6.3045629075326765e-02 -3.1285066011730467e-01 1.2234970605917947e-01 + 14 -1.6602891452450111e-01 2.7553444306924853e-02 -1.2649561579823548e-01 + 15 1.2188515832381198e-01 1.7793320138569921e-01 -4.5234548308308128e-02 + 16 -1.6653050399915964e-01 9.7040998866712636e-02 -1.6969060719144943e-01 + 17 8.1985282789922037e-02 -2.3545710844515712e-02 2.3936384108211257e-02 + 18 1.1783979600418429e-01 -1.0685195492531652e-01 1.8751155730497604e-01 + 19 1.0923986581732971e-02 -2.7836698221240488e-02 4.4742992661353856e-02 + 20 3.1125818001703254e-01 -1.0395719270887765e-02 2.6653542195085835e-02 + 21 -3.4016170658571587e-01 1.0361016592361569e-01 6.8015727768209244e-02 + 22 -1.3216379429130931e-02 1.1924495711024556e-01 2.8719019892043222e-02 + 23 1.4117987992248374e-02 -1.2556191241169213e-02 -6.6106435719293158e-02 + 24 -4.9821487711166533e-02 -3.8305367447710133e-02 -8.7825787316056073e-02 + 25 -3.8200055719523111e-02 4.9531824354558392e-02 5.8874184938536939e-02 + 26 -8.6123273768183087e-02 -9.0662134700946792e-02 3.3164146911875560e-02 + 27 3.3641096961341592e-02 -4.8374916063604279e-02 -4.7450081300379400e-02 + 28 -1.2023716113111672e-01 1.2655023140996682e-01 -1.3476486418909092e-01 + 29 8.0835690740263838e-02 -8.6294658700405244e-02 -1.0225704538469847e-02 + 30 1.5065885897513712e-01 -1.2284569368330328e-01 8.4947888101663260e-02 + 31 1.6409303465179929e-02 -2.7070477304714680e-02 3.8844622222190170e-03 + 32 -1.2830315127740369e-01 5.5395533537955260e-02 -4.3188347175822955e-02 + 33 1.4736762103801157e-01 3.1372820968005373e-02 -7.0514285623934636e-02 + 34 1.4765342770363085e-01 8.9181965944806901e-02 -7.9623029153964922e-03 + 35 -1.1103266750654081e-01 2.7614132689766018e-02 1.4772946164377335e-01 + 36 -4.7367059171251974e-02 -5.0644345354705030e-02 -6.7018500502852824e-02 + 37 -4.7377343996754939e-01 2.0491554368492215e-02 9.4362881263611739e-02 + 38 1.3584670381198996e-01 -6.4204709478775809e-02 -5.9835825708327198e-02 + 39 1.2866358813292392e-01 8.9255092923612167e-02 1.5720420489056489e-02 + 40 2.1774482611397211e-01 -4.8504221385642733e-02 -1.0335143406431488e-01 + 41 -8.0271942001259478e-02 -5.8665795487249713e-02 5.3296937810186767e-02 + 42 -5.6780166755342538e-02 5.9800285303330571e-02 -3.3553243097039449e-02 + 43 -4.4730880389237823e-02 -1.2502890976017672e-01 -7.4338829542638346e-02 + 44 4.9561880697838664e-03 -5.5983339983018644e-03 -9.3875494955380830e-03 + 45 1.0836755556594711e-01 9.6801731956160320e-02 -1.2943255755944332e-04 + 46 -2.1850316173635270e-01 8.1151781553099017e-02 7.5426340303164321e-02 + 47 2.2504462197164751e-01 7.6008991017816482e-02 -7.2025553058029768e-02 + 48 4.6156174629442832e-02 -1.1441040925658175e-01 1.1203552874765967e-01 ... diff --git a/unittest/force-styles/tests/manybody-pair-airebo_m00.yaml b/unittest/force-styles/tests/manybody-pair-airebo_m00.yaml index 50325ee19..93c8a77e3 100644 --- a/unittest/force-styles/tests/manybody-pair-airebo_m00.yaml +++ b/unittest/force-styles/tests/manybody-pair-airebo_m00.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:23 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:28 202 epsilon: 1e-07 prerequisites: ! | pair airebo/morse @@ -67,57 +67,57 @@ init_forces: ! |2 46 7.6023397517703095e-02 -2.2544487533539470e-01 4.2072193193403246e-02 47 -7.6877574240748030e-04 5.5783708545097566e-02 -2.0995954025529923e-02 48 5.1056308529232042e-02 8.5470102504109025e-02 6.8395640494008869e-02 -run_vdwl: -185.084340567887 +run_vdwl: -184.987048108923 run_coul: 0 run_stress: ! |- - -1.3323153386673774e+00 6.5009894327154760e-02 -1.7326291586383442e+00 4.9671868735735564e-01 2.8136179703319608e-02 5.7806981457586715e-01 + -4.3376938809685628e-01 9.4641522574347858e-01 -1.4056170063304145e+00 1.9738399077051577e-01 -1.3923958411780546e-01 6.7259467679991358e-01 run_forces: ! |2 - 1 6.8355528493844298e-02 -1.1944451443270802e-01 -4.4125204825235098e-01 - 2 -1.2861924608968991e-01 -4.4137097431923344e-02 -1.2751824466012474e-01 - 3 8.1494435661480014e-02 -3.6920590518428054e-03 1.0040642950505263e-01 - 4 3.7527017608456914e-01 6.6940856681461991e-02 5.8019895967875557e-01 - 5 -1.8393789675484831e-01 -1.5834568564675960e-01 -8.6224034419114470e-02 - 6 -1.7282212455395130e-01 4.5083734857249647e-02 3.1197253351678889e-02 - 7 -3.3619376905194437e-01 -5.8091977753188084e-01 -5.8107276386347717e-01 - 8 1.0273233422549642e-01 -8.5412334130676976e-02 5.6323287362551079e-02 - 9 -1.3215510856196822e-02 -3.8099218776399491e-02 2.0437541579240195e-01 - 10 1.6412187218573659e-01 4.5430627507431653e-01 -7.0297693657988702e-01 - 11 -4.9902630586834862e-02 6.7017696686888217e-01 8.2705477529688232e-01 - 12 5.2147711171131816e-02 -1.6146646227932876e-01 1.8929213157343128e-01 - 13 6.4751997045543686e-02 -3.5563305441624971e-01 1.2820269624458880e-01 - 14 -1.5333471357819128e-01 1.5914151143699928e-02 -6.5037280503974712e-02 - 15 1.2286738982966094e-01 1.9265004204325895e-01 -4.9637041122573833e-02 - 16 -1.0852990429909931e-01 7.3201982309721483e-02 -2.4712787611616815e-01 - 17 6.0229575881071917e-02 -1.8934283782071015e-02 6.7629621559359809e-02 - 18 9.6466429473633097e-02 -9.9301800509148969e-02 1.5137717899747341e-01 - 19 -7.7003389183944088e-02 -2.3023763423969890e-02 4.8266701905256490e-02 - 20 -1.7916905871455191e-01 1.9867797610853855e-01 4.8402207345646708e-02 - 21 1.6856210984353245e-01 -7.9511292426074076e-02 1.0001675896785096e-02 - 22 3.4304140788237750e-02 1.3519423218540497e-01 6.6300981648753990e-02 - 23 6.2839752037413682e-02 -2.6370577409609117e-02 -1.1545103162740503e-01 - 24 -9.2732980601280657e-02 -1.0950138658861922e-02 -4.0836736654732086e-02 - 25 -1.2036034340714141e-01 5.2468101598679873e-02 4.3362109026140239e-02 - 26 -1.3709346740420025e-01 -9.5632079961340877e-02 5.9007750969542250e-02 - 27 4.0569120071207609e-02 -4.4990684200391068e-02 -4.9804224785798434e-02 - 28 -6.4018377994091560e-02 6.0553928500104437e-02 -1.8776358251620712e-01 - 29 9.6890302093696382e-02 -1.2338057085228121e-01 6.7295979231108971e-03 - 30 1.5163669686192729e-01 -1.4218642480904720e-01 7.9473882014891972e-02 - 31 3.1597012409922437e-02 1.8162006569087685e-01 8.0853434851491893e-02 - 32 -1.5574245261504957e-01 -1.4903833490853655e-02 -5.9160677478346482e-02 - 33 1.4736721012005907e-01 -3.2985065985107143e-02 -6.7005897560507538e-02 - 34 2.2444726480772675e-01 1.4487810359056891e-01 7.1462055528190113e-02 - 35 -8.5673030495807490e-02 6.1015455839103921e-02 1.2177185351699812e-01 - 36 -8.9050814377041709e-02 -9.1447680120703895e-02 -1.4873052627530475e-01 - 37 -6.2333640474717122e-01 5.1087346671760403e-02 1.7873483824820902e-01 - 38 1.1822724805114426e-01 1.3806051076594161e-03 -7.8201063267624660e-02 - 39 1.5210289064479374e-01 6.3318639778475738e-02 2.3309631651053708e-02 - 40 2.9670421707793115e-01 -1.4891122500091292e-01 -2.2577727039126999e-01 - 41 -1.1163722101360789e-01 -1.6291547452462640e-02 1.1570402265470292e-01 - 42 -2.8439534417055767e-02 4.1199861152822509e-02 -2.5621427173460498e-02 - 43 -3.1571378405888584e-01 3.7002322228513365e-02 -1.2890733821154285e-01 - 44 7.4865147797376075e-04 -1.9134731646395786e-03 -2.0910975730097647e-03 - 45 2.7239277705401937e-01 7.6632675253599444e-03 -9.6378796865211891e-03 - 46 -7.4845763922132422e-02 2.0438477364830343e-02 1.4619059575391516e-01 - 47 1.9442828039042842e-01 7.3643646110724048e-02 -1.5176869728387757e-01 - 48 1.2011729494053558e-01 -1.3053139348677081e-01 1.5597458770641501e-01 + 1 1.3612973180768417e-01 -8.1990703046931346e-02 -2.8837110902855390e-01 + 2 -1.4983157541097120e-01 -2.4999105515527864e-02 -1.4517022239602428e-01 + 3 7.5494114617980390e-02 1.4829984678192659e-02 4.9931554804602873e-02 + 4 3.2740853805722142e-01 8.3458722929667217e-02 2.7543952004115502e-01 + 5 -1.9483782743148459e-01 -1.5477165407738652e-01 -3.3868461577429287e-02 + 6 -1.6278402138094014e-01 1.0697502492555483e-01 7.9793040331912368e-02 + 7 -4.1119389228829667e-01 -1.0519733293315172e+00 -5.4952029933065838e-01 + 8 1.0958835343001930e-01 -7.7678442462337363e-02 5.5535531282736219e-03 + 9 6.1445090932611135e-03 3.8682720223998102e-04 1.7059370105667387e-01 + 10 -1.4415854930117872e-01 2.5022809566917303e-01 -3.1449593038988721e-01 + 11 2.5053201952732079e-01 1.0860926259259365e+00 6.7601041505941095e-01 + 12 1.1619019661903532e-01 -1.0458636436547192e-01 1.2399196477525870e-01 + 13 5.0917314290596816e-02 -2.9890652976649884e-01 1.5478234648483979e-01 + 14 -1.6940161871730669e-01 2.7266148178867022e-02 -1.2173671833459808e-01 + 15 1.2225177875112098e-01 1.8126344942866141e-01 -5.4285154847897199e-02 + 16 -1.7047478451410092e-01 1.0700114911170699e-01 -2.1116750882789495e-01 + 17 8.0197606506845931e-02 5.3760115645575812e-03 5.9731884263165724e-02 + 18 1.2793069331244525e-01 -1.0249457522382374e-01 1.7020340896085945e-01 + 19 -3.7061486258523568e-02 1.0520015248531528e-01 8.1203004345150681e-02 + 20 3.2418641595288555e-01 -5.0412255112475185e-02 9.8756072299681530e-02 + 21 -3.2787791373039016e-01 5.4825097206076846e-02 4.9645432729952574e-02 + 22 1.7933925583651644e-02 5.7918407805456262e-02 2.5143643292926357e-02 + 23 5.9546364007956772e-02 -2.9904855294364117e-02 -1.0649366650110899e-01 + 24 -7.5844105921167748e-02 -5.0323538411854912e-02 -1.4048534890569531e-01 + 25 -1.1773111655894919e-01 5.9583156555274353e-02 -1.4386239587577121e-02 + 26 -5.0428772066175909e-02 -7.5077527226974500e-02 6.4236461747708917e-02 + 27 4.1318402660349474e-02 -4.5971682531591368e-02 -4.9887726474734523e-02 + 28 -9.3533143435938979e-02 -4.3176802099098632e-02 -1.4767051611900592e-01 + 29 5.5450648189035674e-02 -5.1511108071291778e-02 -5.9669129258305365e-02 + 30 1.4556963947523718e-01 -4.9734244896982194e-02 1.2306647494181694e-01 + 31 2.1894622024938970e-02 9.7681729228914521e-02 1.7302911324700165e-01 + 32 -1.3101018176376950e-01 5.7931454653965542e-03 -9.8649686980188986e-02 + 33 1.3866542372408736e-01 -8.3087160454619058e-03 -1.1019783085522313e-01 + 34 1.7504748729845210e-01 9.0389882121422099e-02 -1.2511805193457917e-02 + 35 -8.4939500555612918e-02 2.7275160800394844e-02 1.5240922922911493e-01 + 36 -5.8985106331305603e-02 -5.2914675831593552e-02 -6.9656071171885270e-02 + 37 -5.6583778390923878e-01 1.3828981949338270e-01 9.5393732903579220e-02 + 38 1.2591665112704686e-01 -6.9464714066462402e-02 -3.0490770808320078e-02 + 39 1.4582739651194424e-01 3.5359225199400546e-02 -6.4986186224247344e-03 + 40 3.3861541241575083e-01 -2.2091738877425343e-01 -1.3527129839439234e-01 + 41 -1.2316035208259188e-01 3.0555844664782117e-02 7.1728281143000561e-02 + 42 -1.7669879209682382e-02 8.6630067769811026e-02 -5.0020702061193578e-02 + 43 -3.7797768657418890e-01 1.0463358132473431e-01 -5.1581326126599714e-02 + 44 -2.3041892640140033e-03 -6.8086619716243857e-03 -5.2973949593809189e-03 + 45 2.7224826465178009e-01 -3.7375390673382691e-02 -2.2512012997494169e-02 + 46 -1.3917041763515384e-01 -1.1656207286199401e-01 1.0756484530380758e-01 + 47 2.1683596222942297e-01 1.1575350510095996e-01 -1.0659093417774149e-01 + 48 1.2437243247491070e-01 -6.6902477176977559e-02 1.2827880383777929e-01 ... diff --git a/unittest/force-styles/tests/manybody-pair-bop.yaml b/unittest/force-styles/tests/manybody-pair-bop.yaml index 14ed8865a..96d1c5c8f 100644 --- a/unittest/force-styles/tests/manybody-pair-bop.yaml +++ b/unittest/force-styles/tests/manybody-pair-bop.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:23 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:28 202 epsilon: 1e-12 prerequisites: ! | pair bop @@ -85,73 +85,73 @@ init_forces: ! |2 62 -3.4726169504324123e+00 5.2740847068077086e+00 -2.8158025997879781e+00 63 9.0442902049721958e+00 -1.4095410747099721e+00 -3.3538816791526131e+00 64 5.7753579488954081e+00 5.6893699286631358e+00 6.1188593857076974e+00 -run_vdwl: 328.12039190566 -run_coul: -363.312225096902 +run_vdwl: 339.667803109578 +run_coul: -368.178518530181 run_stress: ! |2- - 2.8230013128814915e+02 2.8656131447460984e+02 2.9181631824346204e+02 -1.1936544781278243e+01 5.4258103085030932e+01 1.0743049228637322e+01 + 2.9647077096651941e+02 3.0024197785852289e+02 3.0553181737843363e+02 -1.3964698314088370e+01 6.2554353557579624e+01 7.5549419793671859e+00 run_forces: ! |2 - 1 1.2094006584471133e+00 1.4972012980182414e+00 -1.3966614118871765e+00 - 2 -5.5075765243395516e+00 -1.1490755696913171e+00 -1.2010272822402699e+00 - 3 5.6280893116800612e-01 3.3807783301019096e+00 -3.8927085897114910e-01 - 4 1.6449866941055584e+00 1.3157691009108203e+00 -4.8005796253978295e+00 - 5 -9.6600352996619721e-01 -5.5486425670668087e+00 8.0466800051422105e-01 - 6 1.8737050995498130e-02 4.4376121957876951e+00 1.8870203152016429e+00 - 7 -3.8506648858913270e+00 -3.9000788676588707e+00 9.2046483420051983e-01 - 8 1.3897208072975273e+00 2.3855097659298137e+00 -3.1735199887051473e+00 - 9 -4.4862976177645884e+00 -3.8649250462825440e+00 -4.5119249002601522e+00 - 10 9.3797199787040722e-02 -4.9196623851915222e-01 -2.6912698424760753e+00 - 11 3.0734731059713334e+00 -6.7505501313840579e+00 2.0415883121595879e+00 - 12 -4.5867239258321444e+00 -4.9994870019006612e+00 -5.7646682591032015e+00 - 13 8.7721831238569203e-01 5.9997306505759207e+00 -1.8140526415237341e+00 - 14 -2.3949790895045791e+00 5.1078232404778783e+00 1.1090928235716313e+00 - 15 -1.8847664851218144e+00 6.6312098846629608e+00 -3.8884149600049422e+00 - 16 2.5436669799001654e+00 -1.0057929518796414e+00 6.4839169113188433e+00 - 17 4.8083665670664200e+00 4.0667532717743784e+00 -3.9323641938744185e+00 - 18 -4.9278238691878267e+00 3.6754820075571049e+00 2.9552705503994323e+00 - 19 -1.7822908776371351e+00 -4.1630745817047794e+00 -8.9918948897748996e-01 - 20 -4.3187029083473529e+00 5.0333583520922209e+00 5.2930036036827008e+00 - 21 5.2331194905821710e-01 -1.2867428882094816e+00 -7.2027500903962745e+00 - 22 -7.0420904760678154e+00 4.8874483918285243e+00 -4.2523907014654894e+00 - 23 3.3946219231880281e+00 5.1554894158129567e+00 1.4001045047031935e+00 - 24 4.6097367619129404e-01 -7.8636498340568595e-01 -2.2066042710147649e+00 - 25 1.1155416794510971e+00 -1.7075022097207639e+00 4.4944420039447115e+00 - 26 -9.0301834169602868e-01 1.1731702985146959e+00 1.5686119136705698e+00 - 27 2.6810098523443600e+00 -1.7002540834840822e+00 2.3947552507437293e+00 - 28 -2.0038065158576912e+00 7.4961629598766333e-01 8.7125788243024953e+00 - 29 -2.6642634943080372e+00 2.9934911573505811e+00 -5.8750554017726095e+00 - 30 -1.7631227690722784e+00 2.4014697413552710e+00 -1.3580540782727011e+00 - 31 2.9122176189253612e+00 6.8463354598274240e-01 9.6539522572680381e-01 - 32 -1.0716261381239105e+00 -1.4466979138459053e+00 1.2512585618004359e+00 - 33 4.5215187429555277e+00 -5.1886187743287877e+00 5.8085608076614106e+00 - 34 2.9635654591320097e+00 4.5094070096428251e-01 -3.4863299140598214e-01 - 35 2.4928765089432634e+00 -5.3448694059941877e+00 2.3887118108529313e+00 - 36 -6.1947059398008408e-01 -2.2788751004462711e+00 -6.3226292177021803e-01 - 37 -5.0892672185532151e+00 2.7593899198380747e+00 -1.8750975210857241e+00 - 38 -4.4510095261199589e-01 -2.0519825732102226e+00 9.2628347441614856e-01 - 39 4.7796063099958055e-02 1.0725963032581594e+00 1.7181088217424652e+00 - 40 6.1442830836550728e+00 -2.5948798656177550e+00 -2.2293415126040563e+00 - 41 -3.9392661479233299e-01 -3.6326650788264541e+00 -4.4852960786515211e-02 - 42 -5.5692649798368743e+00 -1.6821639303091762e+00 -1.6723324968033218e-01 - 43 -1.4424925399687047e-01 -8.5523666921010619e+00 4.5258384510590621e-01 - 44 5.0531181537102166e+00 -3.4334901733861405e+00 9.3114428555247419e-01 - 45 -2.0903024652290947e+00 6.5403696832838498e-01 -3.8954629800648335e+00 - 46 -2.4348265082156259e-01 -2.4117878531942281e+00 7.4570747320737123e+00 - 47 2.8527903759034379e+00 2.2528612008427649e+00 6.0359906613190466e+00 - 48 2.9273899954311946e+00 1.3452816241286942e+00 -1.2628885222097392e+00 - 49 -5.9485520777752026e+00 -5.5665450586946150e+00 -6.0830757377442710e+00 - 50 -3.8404253960403993e+00 1.8877511590750304e+00 2.5404296022143984e+00 - 51 -2.2828573674769213e+00 2.7781767264767150e+00 5.5620675245726012e+00 - 52 5.4306396741489111e+00 -3.1496371163570522e+00 5.4598735627672799e+00 - 53 3.0848111502772113e+00 3.8405885878548869e+00 2.7427754922007561e+00 - 54 3.7304377536521460e-01 1.0130983067357455e+00 2.2264278235622006e-01 - 55 1.9489480373191797e-02 -3.7664964421140614e+00 -3.5726411020126752e+00 - 56 -1.4207198828513452e+00 3.0787883554068443e+00 -1.5334043620685021e+00 - 57 3.5395757614019313e-01 -3.0475765881143806e+00 -5.9029962853607421e-01 - 58 3.5290378879387294e+00 1.0620195995436412e+00 6.3876917379625520e-01 - 59 4.4138648986537783e+00 7.4012459625505356e-01 -2.5604939889732048e+00 - 60 -2.7430036755452867e+00 -4.7959755743412966e+00 -3.6589121362809793e+00 - 61 -1.2744632882178495e+00 2.9325120669119698e+00 -1.6224561254464971e+00 - 62 -2.9013359109981898e+00 4.7074815481252905e+00 -2.3570644684369930e+00 - 63 8.3675946045751228e+00 -1.0836984638943927e+00 -3.0411489023050922e+00 - 64 5.2745493408596680e+00 5.2305891172169332e+00 5.6658788951829120e+00 + 1 1.4091839992502064e+00 1.7360549037390574e+00 -1.6202615415488748e+00 + 2 -5.8365577950588401e+00 -1.1219250655097486e+00 -1.1485578267544669e+00 + 3 8.7637443534687265e-01 3.3462950717005140e+00 -8.1354193519443951e-01 + 4 1.6600846428193645e+00 1.3250420473640410e+00 -4.9591552717068232e+00 + 5 -9.4927358706048892e-01 -5.8207744891827486e+00 6.4663640426046409e-01 + 6 -4.5177641241089406e-01 4.9415965857014852e+00 1.9433167203323745e+00 + 7 -4.3027424731657185e+00 -4.5613727723940167e+00 1.5699433742266315e+00 + 8 1.5448716740104831e+00 2.4584935221333963e+00 -3.1392453266495832e+00 + 9 -4.6016718878922207e+00 -3.9418857354152159e+00 -4.6668302589862032e+00 + 10 3.7018821505570204e-01 -4.8332779948413346e-01 -3.6854100196951518e+00 + 11 3.8659815755145361e+00 -7.4539978947802821e+00 2.6942416818342840e+00 + 12 -5.6142785311276375e+00 -6.2018561519794231e+00 -6.7409138013789232e+00 + 13 3.3341268697401276e-02 7.0519544310201310e+00 -2.0938811753645661e+00 + 14 -2.3615327387252290e+00 5.8104704577596982e+00 9.3009880532498701e-01 + 15 -2.6654394020492229e+00 7.5481721191930324e+00 -4.8904770990485913e+00 + 16 2.6741246080899321e+00 -5.1059325982456605e-01 7.8828857917194375e+00 + 17 5.6945314266562477e+00 4.7236054909617922e+00 -4.4884300761189735e+00 + 18 -4.9761399252895515e+00 4.0936573214877976e+00 3.2051150163480275e+00 + 19 -1.6198352509091520e+00 -4.2596514231117295e+00 -9.7003027663291963e-01 + 20 -5.1699169667514902e+00 5.8976610804223153e+00 5.9849770972847720e+00 + 21 4.2290118198797466e-01 -1.5086464113580389e+00 -7.5078846527544938e+00 + 22 -8.4609771842609263e+00 5.8493313158190938e+00 -5.7089963852359418e+00 + 23 3.4912605494063254e+00 5.3853896923340061e+00 1.6584475198482456e+00 + 24 1.8362247934488612e-01 -4.7948069874836530e-01 -2.0243810105866009e+00 + 25 1.2730664642521679e+00 -1.9548050105024704e+00 4.6007886613151587e+00 + 26 -8.1062379239462712e-01 9.5002080733760719e-01 1.5848609861121075e+00 + 27 2.9206983020912900e+00 -2.0240217949529793e+00 2.7543561358732331e+00 + 28 -1.9402604684655671e+00 7.6549808473199921e-01 9.6946237758665106e+00 + 29 -3.0268260350623164e+00 3.3951012138008769e+00 -6.0757632771315082e+00 + 30 -1.9700043481990701e+00 2.6914206262981035e+00 -1.5061070094151487e+00 + 31 2.8594848447443253e+00 6.6367275479522425e-01 9.9964129387696310e-01 + 32 -1.2590558999364341e+00 -1.6706356986790980e+00 1.4597882192474283e+00 + 33 5.2588945074813029e+00 -6.0464309786151773e+00 6.8597153564008941e+00 + 34 2.8448140954734642e+00 5.6236358676571219e-01 -4.0638582122053091e-01 + 35 2.7571145619912056e+00 -5.8841373446139507e+00 2.6747482505889608e+00 + 36 -1.9192378159251589e-01 -2.6023953265608939e+00 -1.5640405774044519e-01 + 37 -5.4277219253565221e+00 3.1852612532297750e+00 -2.4472998056154300e+00 + 38 -4.8829683533350837e-01 -2.0914390432681911e+00 1.0262205377056093e+00 + 39 2.9502447093829520e-01 1.3059788840646829e+00 1.7852908396134863e+00 + 40 6.5687128106082486e+00 -3.2783294095611546e+00 -2.4974920679525678e+00 + 41 -7.4527205169992805e-01 -3.7773274264367109e+00 -3.6783371706635798e-01 + 42 -6.1270294335443802e+00 -1.5900980711311963e+00 -1.1670240719726080e-01 + 43 -7.0828337399855903e-02 -9.2972356706171269e+00 5.2769174386777140e-01 + 44 5.4887685616205379e+00 -3.9815326038053809e+00 1.7266069261520267e+00 + 45 -1.9921600835531832e+00 1.3642859652744135e+00 -4.6177178575847746e+00 + 46 -6.8117966634546445e-01 -2.7253492719710746e+00 7.9371626431226243e+00 + 47 3.2952240517696949e+00 2.5414486072276063e+00 6.4494849732535995e+00 + 48 2.9835807284257734e+00 1.1522840799466536e+00 -1.1774476995815222e+00 + 49 -6.0679347563638188e+00 -5.9494390001587254e+00 -6.5551991173203756e+00 + 50 -4.0299128004416813e+00 2.1291405592678179e+00 2.7727902498814490e+00 + 51 -2.3315198872470955e+00 3.2375801443411918e+00 6.0916764782224782e+00 + 52 6.6009412541172470e+00 -4.7168555309699363e+00 7.0071299673943299e+00 + 53 3.4640997962336022e+00 4.1341204844899115e+00 2.5043668546516047e+00 + 54 4.2313664323499350e-01 9.2836045167139480e-01 2.5711773736259202e-01 + 55 6.8701262802213914e-01 -4.3825301043637985e+00 -4.6893545894596320e+00 + 56 -1.6845639804510140e+00 3.5356453689297287e+00 -1.8031520135268144e+00 + 57 4.3948113532658906e-01 -2.8873989478142321e+00 -5.7259772801200692e-01 + 58 3.7547819992001958e+00 5.5227523321764360e-01 1.0948274658191739e+00 + 59 4.8388618290346219e+00 8.6992073730477193e-01 -2.9595235978355734e+00 + 60 -3.0285027354561045e+00 -5.5670092439760976e+00 -3.9776833759043360e+00 + 61 -1.4978056968277800e+00 3.0694058985854147e+00 -1.9187643462989679e+00 + 62 -3.4577032802851959e+00 5.2617506290380360e+00 -2.8027654606912966e+00 + 63 9.0406900000777011e+00 -1.4351171401939544e+00 -3.3870292689615531e+00 + 64 5.8184132098339623e+00 5.7423399100254668e+00 6.1686683686654344e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-bop_save.yaml b/unittest/force-styles/tests/manybody-pair-bop_save.yaml index 72a2351f5..6fd21617a 100644 --- a/unittest/force-styles/tests/manybody-pair-bop_save.yaml +++ b/unittest/force-styles/tests/manybody-pair-bop_save.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:29 202 epsilon: 1e-12 prerequisites: ! | pair bop @@ -85,73 +85,73 @@ init_forces: ! |2 62 -2.1820541673479572e+00 2.4884510598694281e+00 -1.7590338866984598e+00 63 3.7475032428567294e+00 -1.2789954722960686e+00 -1.6076519751193632e+00 64 3.0808261336511231e+00 3.1413604768568071e+00 3.1108884069467564e+00 -run_vdwl: 225.483123234619 -run_coul: -358.525864873204 +run_vdwl: 229.502663827596 +run_coul: -360.670693553116 run_stress: ! |2- - 9.2708340634004202e+01 9.4567250047602442e+01 9.3542392878203984e+01 -3.5188898428941879e+00 2.9172111770024983e+01 2.5838714184808751e+00 + 9.8282643974440674e+01 1.0000658818524373e+02 9.8120756462762017e+01 -4.8888999152522921e+00 3.2427091928416218e+01 5.0773982528491501e-01 run_forces: ! |2 - 1 5.2461464343452280e-02 6.3445874771083419e-02 -6.0047690872422295e-02 - 2 -1.7952445271246664e+00 -1.4218851239799628e+00 -1.1587702523913164e+00 - 3 5.5478781578872816e-01 1.0166262832007475e+00 -4.9270600194063685e-01 - 4 8.3608443721893311e-01 -2.9300301286855118e-01 -1.1300615346589309e+00 - 5 -8.0974284598680624e-01 -1.1743905637767758e+00 2.1194443649806144e-01 - 6 1.2489390499997166e-01 3.6849603458227351e+00 1.6822337738199962e+00 - 7 -1.1517087766541612e+00 -1.3245607639320900e+00 2.1503751717710062e+00 - 8 5.2713815910806328e-01 1.1469424140595932e+00 -1.7206517405282333e+00 - 9 -2.1137406565834995e+00 -1.1189587128414018e+00 -1.8438345474652282e+00 - 10 -4.6803591985296066e-02 -1.9385835289305713e+00 -1.5715631476098573e+00 - 11 2.1224282563066663e+00 -2.9696720334420705e+00 1.8102331225775177e+00 - 12 -3.5004456137542599e+00 -3.8012444953626483e+00 -2.6619954059079718e+00 - 13 3.9516728015980274e-01 3.9884977620308151e+00 -1.3897244200262227e+00 - 14 -1.9138573726925181e+00 3.8523404640765238e+00 7.5928353092630863e-01 - 15 -1.9891876262290782e+00 3.2416687992734254e+00 -1.5262610748773309e+00 - 16 1.3574951697085507e+00 -3.5051996831920607e-01 3.5716346025832233e+00 - 17 2.6289345928448711e+00 2.3763340923405312e+00 -2.0313511348228737e+00 - 18 -1.3798861331946473e+00 1.3762714646580598e+00 1.2919153852528387e+00 - 19 -1.1827353281628663e+00 -2.7464995051745813e+00 -3.6513716492539117e-01 - 20 -2.5961589908050140e+00 2.6426591433127462e+00 2.2346853176560528e+00 - 21 -1.3429601822013132e-01 -5.1202911643149118e-01 -2.5076125153203370e+00 - 22 -4.4355917278004471e+00 3.3178935668910494e+00 -3.2692290811528362e+00 - 23 2.5768083422823507e+00 3.8533003897315776e+00 9.5312752430003289e-01 - 24 3.3664631526424588e-01 -1.5598462775154304e-01 -1.6158927212020158e-01 - 25 2.0909936419783498e-01 -2.2212812320858885e-01 1.2631598119352292e+00 - 26 -9.1319903515587442e-02 -4.9365927912993712e-01 1.2865878118928920e+00 - 27 1.9754081314959220e+00 5.5512144980327649e-01 2.1965106618877410e+00 - 28 -9.1571123990994119e-01 2.8831752088653273e-01 4.0653791576256069e+00 - 29 -1.8897897534108272e+00 1.9770299404566545e+00 -2.2761449369499362e+00 - 30 -1.2621388545199415e+00 8.1319864719143164e-01 -1.1462593883015966e+00 - 31 -1.0066976443270784e-01 4.4203964938993617e-01 4.3880141855445942e-01 - 32 -5.2461464343452280e-02 -6.3445874771083419e-02 6.0047690872422295e-02 - 33 1.7888171042420402e+00 -2.2881077231541429e+00 2.2107802977083013e+00 - 34 1.2954727830525320e-01 -6.0200675544908475e-02 1.8457241518256831e-01 - 35 1.3411637976344630e+00 -7.0966057217261513e-01 1.6154129097815140e+00 - 36 -4.7957755204510966e-01 -2.6483422747174021e+00 -5.3805190516420609e-01 - 37 -1.2572679750686964e+00 9.6992929966066066e-01 -1.2270961498140143e+00 - 38 -1.9027904716765798e-01 -4.3608165108422019e-03 1.9502009170946963e-01 - 39 5.2435475770006990e-01 9.7036165266308726e-03 -1.0441916236238242e+00 - 40 4.6449644387898941e+00 -1.6920062703763807e+00 -2.1914395923558603e+00 - 41 -1.4701041079431029e-01 -2.3080938022581338e-01 -3.2673541047210419e-01 - 42 -4.0727737583055967e+00 -1.6478523453785263e+00 1.4125120578899897e-01 - 43 3.7242001529259333e-01 -3.5616918801080111e+00 6.2600470217084692e-01 - 44 3.3056208366847240e+00 -3.1571749982962367e+00 1.1182639533515728e+00 - 45 -2.2413643960036964e+00 8.0325775766222773e-01 -3.0500826497180862e+00 - 46 -5.5711891827535098e-01 -1.2214898451190077e+00 4.7520809728771933e+00 - 47 1.8346387590092910e+00 1.2824286835337535e+00 1.6235696472149697e+00 - 48 1.4535565137158473e+00 2.5952187241157976e-01 -3.3210475966326744e-02 - 49 -2.9994424951631067e+00 -3.4664174572228661e+00 -3.5674747455451401e+00 - 50 -1.2415474182280879e+00 9.7988551618719577e-01 8.1053008547612437e-01 - 51 -1.9595456145203474e+00 1.8918550738777526e+00 4.0715722065171711e+00 - 52 3.8934964666261980e+00 -3.6369191438635475e+00 3.3519451907149684e+00 - 53 2.8124956399141539e+00 2.9660559514684497e+00 2.0685373458888394e+00 - 54 2.7074545892326524e-01 -6.6977778932741894e-01 1.1922242430325722e-01 - 55 2.3521436347037364e-01 -2.7981702783839077e+00 -2.8171838683883714e+00 - 56 -9.6853921654063602e-01 9.6676984125909227e-01 -9.6934788270562888e-01 - 57 5.1553323845256911e-02 -1.3671813398210970e+00 -3.8987060991398564e-01 - 58 3.0454225555369119e+00 -2.4963396862218679e-01 5.8727287281650487e-01 - 59 2.8374050093362801e+00 1.7351585453119913e+00 -2.4230495267529832e+00 - 60 -1.8398166572824817e+00 -4.3838737927324054e+00 -2.2439588488613342e+00 - 61 -1.5348486017580774e+00 1.8011009782375174e+00 -1.2455408136685975e+00 - 62 -1.9550862969301015e+00 2.2314107372332956e+00 -1.5611613409585052e+00 - 63 3.5357973549417805e+00 -1.2721885918023130e+00 -1.5842416063937024e+00 - 64 3.0311416397213189e+00 3.1186981920332699e+00 3.0736206205182972e+00 + 1 1.1009204415031017e-01 1.3274049929938858e-01 -1.2559710191774259e-01 + 2 -1.8380288564033798e+00 -1.4292718324918479e+00 -1.1543799551996707e+00 + 3 8.0544934412034386e-01 9.4651742848767006e-01 -7.4989294544471019e-01 + 4 5.3595786771098042e-01 -1.8337218759163668e-01 -1.1037025031804346e+00 + 5 -6.9329202426190251e-01 -1.1641131333924961e+00 1.2080496272223019e-01 + 6 -2.8668821354759533e-01 3.9078263905295718e+00 1.6195460514325830e+00 + 7 -1.3676455371761693e+00 -1.5785066983564917e+00 2.4992586371213332e+00 + 8 6.0843953283137930e-01 1.1811919415313210e+00 -1.7192946847175725e+00 + 9 -1.9007031616054586e+00 -1.2578217187881440e+00 -1.7671624997268405e+00 + 10 4.6105273296624200e-02 -2.0775953241226430e+00 -2.1732702993581459e+00 + 11 2.4919153869464248e+00 -3.4164504507055562e+00 2.1135928521929359e+00 + 12 -3.8622969979122388e+00 -4.2993140098275369e+00 -3.1268348994013686e+00 + 13 -1.9492787331696601e-01 4.4881454698701244e+00 -1.6164222224101659e+00 + 14 -1.8443435811512432e+00 4.1492923182800920e+00 7.9736849454026282e-01 + 15 -2.2183997542338383e+00 3.6433257925070865e+00 -1.9027871565082706e+00 + 16 1.4214753545392937e+00 -2.3779523014736953e-01 4.1328313478688674e+00 + 17 3.0072578367116019e+00 2.6651452002446754e+00 -2.2902477771746410e+00 + 18 -1.2404505227936755e+00 1.3316586033686333e+00 1.2837295498014238e+00 + 19 -1.0482982004613466e+00 -2.7077075815993785e+00 -3.5277085736617236e-01 + 20 -3.0006122153087196e+00 3.0332964529014284e+00 2.5796446428556492e+00 + 21 -3.1163781337393975e-01 -4.0270808115658518e-01 -2.4951516332540402e+00 + 22 -5.0381159429263525e+00 3.7137818219199299e+00 -3.8409355653446924e+00 + 23 2.5775519391572570e+00 3.9039623217411346e+00 1.0130972073237978e+00 + 24 1.0676329617167887e-01 5.2923053629105141e-02 3.6577265570856008e-03 + 25 2.1471538866110312e-01 -2.9951069541283099e-01 1.3521317400043389e+00 + 26 1.7785774115774287e-02 -6.7761241168030262e-01 1.2650771096328499e+00 + 27 2.0202258132370035e+00 7.1519647191872504e-01 2.3506137758512442e+00 + 28 -8.4246209085555535e-01 2.2249216453733967e-01 4.3807964680667206e+00 + 29 -1.9985273671001273e+00 2.0868265704436699e+00 -2.3076592673566667e+00 + 30 -1.3785381520693261e+00 1.0233768226540516e+00 -1.2243113445067919e+00 + 31 -1.8823745851368207e-01 3.8564144843582449e-01 4.2476503869174959e-01 + 32 -1.1009204415031017e-01 -1.3274049929938858e-01 1.2559710191774259e-01 + 33 2.0219829569293655e+00 -2.6066971008661581e+00 2.5866110820488903e+00 + 34 3.6036488724907570e-02 1.1937847347008923e-02 1.7429502967269545e-01 + 35 1.3996495429085811e+00 -8.4086322149095072e-01 1.6710687745594768e+00 + 36 -1.8577975430834348e-01 -2.9270628528877132e+00 -2.5615350549268562e-01 + 37 -1.3473345687697966e+00 1.1050535299092412e+00 -1.3724817876136617e+00 + 38 -2.1594841526527239e-01 -4.0090959206060539e-02 2.1676476395793062e-01 + 39 6.2006274352572743e-01 7.8224947526482805e-02 -1.0541107403150165e+00 + 40 4.7388205755081287e+00 -1.9987970847233749e+00 -2.3275780036762477e+00 + 41 -3.3437638474338560e-01 -3.4174513360475517e-01 -5.1939268627490187e-01 + 42 -4.3774479959875467e+00 -1.4734253544604692e+00 2.6630240748261186e-01 + 43 5.7330218842220126e-01 -4.0005337690727059e+00 8.3504432642225790e-01 + 44 3.5109964141941954e+00 -3.4619918127762723e+00 1.5902621993961359e+00 + 45 -2.1895251384156258e+00 1.2996365325786643e+00 -3.4843495399680005e+00 + 46 -7.1915036485983930e-01 -1.3554363152628233e+00 4.9249959522336511e+00 + 47 1.9534572842208102e+00 1.4144925909314245e+00 1.6255425297851802e+00 + 48 1.5167594374807782e+00 9.7182569296298912e-02 4.0874484030841700e-02 + 49 -2.8508511164428150e+00 -3.4624092977872714e+00 -3.6168079503659158e+00 + 50 -1.3113235289520389e+00 1.1093939930016881e+00 9.6169349987325892e-01 + 51 -1.8599473626235867e+00 2.0538335564366914e+00 4.3092343562051418e+00 + 52 4.3196132437180594e+00 -4.4149622814360532e+00 3.9283855476642731e+00 + 53 2.7525986356611165e+00 2.9762725972492654e+00 1.7174674122661944e+00 + 54 2.8646612162311491e-01 -7.2177880648705905e-01 1.0083207256055920e-01 + 55 6.5473344294821056e-01 -3.1086156341024735e+00 -3.3578675125571058e+00 + 56 -1.0553686665450261e+00 1.2834722314048077e+00 -1.0735831225120771e+00 + 57 8.6512248740649111e-02 -1.1020621865101998e+00 -3.3821985097785440e-01 + 58 3.1197778207099738e+00 -5.6734691274546134e-01 8.3076711070021192e-01 + 59 3.0037731396108400e+00 1.7218882459974920e+00 -2.6763368282898470e+00 + 60 -1.7379778045606658e+00 -4.6348831005074125e+00 -2.2082966045041963e+00 + 61 -1.6912233054390582e+00 1.8351370954506829e+00 -1.3654061896758822e+00 + 62 -2.1752941483507673e+00 2.4794801303294101e+00 -1.7529758471564298e+00 + 63 3.7479216341651256e+00 -1.2988740523529445e+00 -1.6303349634644779e+00 + 64 3.1086475916840350e+00 3.1727490910934155e+00 3.1416615902720926e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-comb.yaml b/unittest/force-styles/tests/manybody-pair-comb.yaml index 58de3040c..7a088923d 100644 --- a/unittest/force-styles/tests/manybody-pair-comb.yaml +++ b/unittest/force-styles/tests/manybody-pair-comb.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:29 202 epsilon: 1e-12 prerequisites: ! | pair comb @@ -83,73 +83,73 @@ init_forces: ! |2 62 -3.1661341866163668e+00 3.0572378789319057e+00 -2.1766321256993351e+00 63 2.4681627533803421e+00 -4.3463718591241030e+00 -2.6890657263468221e-01 64 2.9466851841874400e+00 3.1594069934522051e+00 5.2240357776040334e+00 -run_vdwl: -278.64539237138 +run_vdwl: -275.783459965546 run_coul: 0 run_stress: ! |2- - 3.2603718810965603e+01 3.5156988145665579e+01 3.7681890976318726e+01 -5.5775632087859073e+00 2.2840452275450104e+01 2.0531486195056812e+00 + 3.8014765489615172e+01 4.0945069309188604e+01 4.3999047304618138e+01 -6.7428911902544897e+00 2.6683372066660386e+01 2.8012308731515625e+00 run_forces: ! |2 - 1 -5.5397306955905634e-01 2.5532121805668933e+00 1.0779428121145571e+00 - 2 -1.6205109647151392e+00 -1.0452678927072085e+00 -1.3123147689675791e+00 - 3 9.2492584410483392e-01 2.3258483169401423e-01 -8.7074914258129654e-01 - 4 -1.8809319959865389e+00 2.2889432632664413e+00 3.2415430923337407e-01 - 5 -1.8929830622204289e+00 -2.7856584709070237e-01 -1.3871794499142193e-03 - 6 2.6832146152631214e-02 3.1705576574942653e+00 1.2843474477053722e+00 - 7 -7.4098057776004567e-01 -7.4561069525239276e-01 3.0855025146293191e+00 - 8 2.9560919501422128e-01 7.9434657493317973e-01 -1.2758663869501270e+00 - 9 -4.3187667703244870e-01 -2.1894305992975136e+00 -1.8545629391445928e+00 - 10 1.1030480790250274e-01 -1.8828797400505597e+00 -2.5052292079229947e+00 - 11 2.5621539986299333e+00 -3.1047262882622508e+00 2.5939511966583892e+00 - 12 -4.6636574436680380e+00 -3.1353405533941459e+00 -2.2522344584108005e+00 - 13 -2.2531162730421139e-01 4.2000481115201795e+00 -1.1961646085016158e+00 - 14 -1.3679332950923977e+00 3.5129283143613512e+00 2.8193031191732498e-01 - 15 -3.1213951029651739e+00 3.9481419946547267e+00 -2.2067190999598374e+00 - 16 1.4984375278271820e+00 -4.0576209729337531e-01 5.0335590341302918e+00 - 17 1.9789497195844739e+00 2.5740016211163232e+00 -3.1419520414469448e+00 - 18 -4.1880096903474273e-01 2.5856719013810903e-01 3.0862486816165422e+00 - 19 -1.1131273417550649e+00 -2.5169340303232848e+00 -2.0252736699689511e-01 - 20 -5.0584845485949979e+00 4.4822360054849852e-02 7.8274242101248603e-01 - 21 1.8799822442531455e+00 8.6561357765736235e-01 -1.7960994606260285e+00 - 22 -4.0548484069165145e+00 3.2356894546081207e+00 -3.6478999893817523e+00 - 23 1.8742900336278192e+00 3.0198507422284568e+00 8.3337196377476008e-01 - 24 1.7077784543129124e+00 7.9568135448205268e-01 2.7897381771777905e+00 - 25 7.3084794943112108e-01 2.1842857042399189e-02 1.3295697271823153e+00 - 26 1.2343345472846939e-01 -2.9263233644700481e-01 1.0697468816570765e+00 - 27 2.0657370541600910e+00 2.0103654000545167e-02 1.4591662468309909e+00 - 28 5.3872046657870243e-01 1.9102787172287403e+00 3.3715130661571759e+00 - 29 -2.8856028875180844e+00 9.0351646942263053e-01 -1.2676274670625387e+00 - 30 -1.4084547025716105e+00 8.2324986888554441e-01 -8.2858137093834827e-01 - 31 -1.3279936146893441e+00 1.4477088194222376e+00 -1.2765091390576577e-01 - 32 -2.6380662103899648e+00 6.8724849661915322e-01 -7.9931239141381738e-01 - 33 3.7895183341746748e+00 -1.9566198887983730e+00 2.2505126540203988e+00 - 34 8.5883652728199689e-01 -5.3566728436796218e-02 3.9237705744395335e-02 - 35 1.1644578963583530e+00 2.7144660881885407e-01 2.4026536195925643e+00 - 36 -5.3048368793908085e-01 -2.4758426990856779e+00 -3.0463539756172289e-02 - 37 -1.6654318534959174e+00 1.1930142332191604e+00 -1.8603517597249892e+00 - 38 -8.9081952354286464e-01 -2.9114390049618688e-01 6.8706642209427693e-01 - 39 2.6056927414132929e+00 -1.1478222801590530e+00 -3.2064461264819064e+00 - 40 3.7452234011856818e+00 -1.6143442144484257e+00 -1.9653540040056641e+00 - 41 -1.5227324691871935e-02 -8.9734904260981285e-01 -8.3345326021675170e-01 - 42 -3.2399160547926873e+00 -1.2271836120192232e+00 -2.0534738572382941e-01 - 43 9.0052122056985695e-01 -4.2424836367875995e+00 -9.3139821069259665e-02 - 44 2.7878561135455322e+00 -3.0928968455175889e+00 1.5322877363035767e+00 - 45 -2.1040990928666767e+00 1.2877395979091484e+00 -2.5402153820887490e+00 - 46 -2.8057693869514200e-01 -1.2582731837723404e+00 4.4490871461839268e+00 - 47 2.5104050907433013e+00 1.5895434963732580e+00 5.6184826880643790e-01 - 48 1.2692907009127792e+00 -3.0712740683597839e-01 -9.5770674686733281e-02 - 49 -2.3261423089284090e+00 -3.7378754972534836e+00 -1.8872334371865680e+00 - 50 -5.8081173869631009e-01 2.5496046956213245e+00 -1.1433307738006722e+00 - 51 -1.6449177803323278e+00 1.6149408965826320e+00 3.4135148274579401e+00 - 52 3.8302890563828664e+00 -4.0488676686085610e+00 3.4764387160426482e+00 - 53 3.2036103752554803e+00 2.6792299550456202e+00 1.6508090953042884e+00 - 54 2.3261285765448347e+00 -3.0155250108799159e+00 -1.8972572016801941e+00 - 55 8.2522866651108195e-01 -2.6052530646882328e+00 -3.6486212989846201e+00 - 56 -4.1222748994070124e-01 -9.0889178078118249e-02 -1.7263415682221259e+00 - 57 -5.6265630303914287e-02 -7.9967585610695224e-01 -2.6228933098085871e-01 - 58 2.4498430827774502e+00 -7.4597039405006582e-01 1.3844040814812364e+00 - 59 2.5126209260371275e+00 2.1135650148148510e+00 -2.8984636887562001e+00 - 60 -2.3478919343951086e+00 -4.2888509317848458e+00 -2.0619124848417005e+00 - 61 -1.2028214481978468e+00 1.4703329239436540e+00 -1.1112072076318062e+00 - 62 -2.9560311639616308e+00 2.8122848350725427e+00 -1.9886316384994360e+00 - 63 2.2315862818463441e+00 -3.8949051147749056e+00 5.3755961210724124e-03 - 64 2.3294845807056084e+00 2.4989758665119504e+00 4.4859887170485715e+00 + 1 -7.7534206913915771e-01 2.8219413188105253e+00 1.3054329854322777e+00 + 2 -1.8130861104964291e+00 -1.1994378582483485e+00 -1.4733545605818472e+00 + 3 9.6262413423273352e-01 1.7177196419171725e-01 -8.9514567281056201e-01 + 4 -2.1151372557819039e+00 2.6154090557967375e+00 5.8319598241582238e-01 + 5 -1.9932708833589743e+00 -3.0195546362841325e-01 1.0100738474149416e-02 + 6 1.6761043312589871e-01 3.3914255628396850e+00 1.3893125684615457e+00 + 7 -7.8406178333545773e-01 -8.1074032640200067e-01 3.2097784675201004e+00 + 8 3.0528485889348239e-01 8.3510429361952188e-01 -1.3231160998218834e+00 + 9 -5.5650502396062640e-01 -2.3178721582710784e+00 -1.9892744929129198e+00 + 10 7.6636148089585868e-02 -1.9535760664139994e+00 -2.6672075564306685e+00 + 11 3.0334142708807401e+00 -3.4962010429174333e+00 2.9634653854464106e+00 + 12 -5.3237907143660212e+00 -3.8128153681100683e+00 -2.8003371193007176e+00 + 13 -4.4494824281011508e-01 4.7509967202471213e+00 -1.4136935066319520e+00 + 14 -1.5581267916203356e+00 3.9167644303299509e+00 2.6757555350685747e-02 + 15 -3.7108162817126420e+00 4.6350796729234540e+00 -2.8304249142820872e+00 + 16 1.7041447944666661e+00 -1.1393269201002276e-01 5.9145116848020773e+00 + 17 2.3162590395805367e+00 2.9441962202331622e+00 -3.5000049380321943e+00 + 18 -4.0014232990890441e-01 3.0796282485754389e-01 3.3665032517219542e+00 + 19 -1.2556245715589298e+00 -2.7312087083164216e+00 -3.8429646943139034e-01 + 20 -5.7350382502885031e+00 2.0173956623489531e-01 1.0196418942444634e+00 + 21 2.0516494142785047e+00 8.2692009659286758e-01 -2.0101227303861360e+00 + 22 -4.9718882211305306e+00 4.1049730962386928e+00 -4.6827330728700520e+00 + 23 1.9763339865762555e+00 3.2565694611937772e+00 1.0673998501005904e+00 + 24 1.8875859062636131e+00 1.0223259190226388e+00 3.0328207254896142e+00 + 25 7.6007882281974215e-01 -1.4505469046660835e-02 1.3586263881199705e+00 + 26 1.4142617841080299e-01 -3.1410042560692825e-01 1.0842536816375428e+00 + 27 2.2717581763793167e+00 -1.9091535502477902e-01 1.6000267569573223e+00 + 28 4.3384028401163910e-01 1.9887912984749150e+00 3.9031855999610907e+00 + 29 -3.0591700441243037e+00 1.0767212806375315e+00 -1.4424137828933918e+00 + 30 -1.4598855937410891e+00 8.7458207809737021e-01 -8.7190785769613122e-01 + 31 -1.3636082001861620e+00 1.5015317452309269e+00 -1.5350736370460383e-01 + 32 -2.7909066237776918e+00 7.7422060283896244e-01 -8.9877027420604350e-01 + 33 4.3399235010929829e+00 -2.5818570915550407e+00 2.9057580939567385e+00 + 34 8.6694826333752439e-01 -6.6783355869965533e-02 4.0166291067436966e-02 + 35 1.2326410175497016e+00 1.7672448679765296e-01 2.6119736967557130e+00 + 36 -5.3817594019972581e-01 -2.5718664964791067e+00 -2.3238558061914272e-02 + 37 -1.8197664061032051e+00 1.3420073237913557e+00 -2.0308893778226689e+00 + 38 -9.1836178459074791e-01 -3.0360327574790258e-01 7.2923752459227864e-01 + 39 2.9086502488861363e+00 -1.4045959397349890e+00 -3.5305847433602628e+00 + 40 4.1469244700652910e+00 -1.9523268620186027e+00 -2.2537003978701313e+00 + 41 -3.4963246649093449e-03 -9.0450957949459765e-01 -8.3342821373280440e-01 + 42 -3.4472023731895676e+00 -1.3941168669734563e+00 -3.1024311160752382e-01 + 43 1.0269897319794683e+00 -4.6909166388902737e+00 1.6128935654244003e-02 + 44 3.1898872823049222e+00 -3.5068520273855599e+00 1.8104056127730672e+00 + 45 -2.3458685258695731e+00 1.5729147505816061e+00 -2.8752422042742385e+00 + 46 -5.2392060421735298e-01 -1.4424486188077736e+00 4.9780851897838669e+00 + 47 2.6850560257735139e+00 1.7251050915466237e+00 7.6181283293787772e-01 + 48 1.2747125939394275e+00 -2.7703676427000978e-01 -8.9782244307514136e-02 + 49 -2.6955845424176390e+00 -4.1907197832362328e+00 -2.3301295947101792e+00 + 50 -5.6209787715791215e-01 2.6635817222553522e+00 -1.1946264592384601e+00 + 51 -1.9991954953954585e+00 2.0402557248500282e+00 3.7258404750762781e+00 + 52 4.6951644839913822e+00 -4.9418641566017545e+00 4.5138746249764852e+00 + 53 3.6286232825540430e+00 3.0961367575712391e+00 2.0882688547693129e+00 + 54 2.6013303685566123e+00 -3.2840789720859931e+00 -2.2079175587956348e+00 + 55 1.2143609040063765e+00 -3.0255000863991413e+00 -4.0940354115331257e+00 + 56 -5.0010880972516536e-01 -3.0949934817242841e-02 -1.8925849534718477e+00 + 57 -6.6566405053166355e-02 -8.4258478062523789e-01 -2.6021657717986374e-01 + 58 2.5371442159965878e+00 -8.7526440055363264e-01 1.4949346718757783e+00 + 59 2.9916914714794025e+00 2.5062335807851146e+00 -3.1755629216794357e+00 + 60 -2.9243316010019225e+00 -5.0114677474338842e+00 -2.6969232339454456e+00 + 61 -1.2139394584401273e+00 1.5493721114180057e+00 -1.1508838380601498e+00 + 62 -3.1639283471459425e+00 3.0546678694930378e+00 -2.1747042794001317e+00 + 63 2.4654069560179650e+00 -4.3414818100056856e+00 -2.6604151896673933e-01 + 64 2.9397922209293519e+00 3.1520594954801795e+00 5.2155452896559638e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-comb3.yaml b/unittest/force-styles/tests/manybody-pair-comb3.yaml index 1d44d5e28..c29283af1 100644 --- a/unittest/force-styles/tests/manybody-pair-comb3.yaml +++ b/unittest/force-styles/tests/manybody-pair-comb3.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:29 202 epsilon: 1e-13 prerequisites: ! | pair comb3 @@ -83,73 +83,73 @@ init_forces: ! |2 62 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 63 -2.5176670219302633e+00 2.0717736507107034e+00 2.9357584209133982e+00 64 -4.9843077084015803e+00 -5.4592285318606883e+00 -5.6130890399330191e+00 -run_vdwl: -8.49268945242757 +run_vdwl: -4.29564844356388 run_coul: 0 run_stress: ! |- - -7.3797567645145961e+01 -7.7584319730040974e+01 -8.3342647260134825e+01 7.0938246898836974e+00 -2.4910142288706471e+01 -1.1052327572739250e+01 + -5.4267118842024573e+01 -5.6533164301060637e+01 -6.1852222250269804e+01 4.6439791166276025e+00 -2.0590841001386611e+01 -4.3056108355573022e+00 run_forces: ! |2 - 1 1.2601710105866797e+00 -1.0977233863187708e+00 -1.3772696443257477e+00 - 2 -1.6493479379932397e-03 -9.1248445550026159e-05 5.9701311031610301e-03 - 3 3.3820572608969368e-03 8.5521187645746476e-03 -4.6879090640333616e-03 - 4 1.1924413765949562e+00 -1.4326748930991036e+00 -1.4519947462386757e+00 + 1 8.3494705126341784e-01 -7.2493771846828592e-01 -9.1310246042539789e-01 + 2 -2.0599952819931786e-03 -2.1159860049205952e-04 5.7433975703599848e-03 + 3 3.2343088426449998e-03 7.6054893877602831e-03 -3.4462632544207021e-03 + 4 7.8460968674421894e-01 -9.4433562228577117e-01 -9.6018582891732274e-01 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 9 1.1011770288065228e-03 -3.9056394222139741e-03 -7.8316919368359959e-03 - 10 -4.8732624579561692e-03 -7.8247393902565153e-03 -8.4014108100402985e-03 - 11 -3.9198577361272973e+00 3.3943827075612840e+00 -2.9488815032500826e+00 - 12 7.5755907014699142e+00 8.0808716879391778e+00 7.3065108886254571e+00 - 13 3.9230662035375534e+00 -3.3974166138288706e+00 2.9589801889217089e+00 - 14 3.2496221529217930e+00 -2.8998558479006338e+00 3.5763931643737141e+00 - 15 5.8621937724381752e+00 -6.6038599172524277e+00 7.8526619176418473e+00 - 16 -6.0354206691585279e+00 -6.7582792818441808e+00 -8.5510478256619784e+00 - 17 -1.5397733986077347e+00 -1.3315596514305144e+00 1.2402134158101406e+00 - 18 -9.2057661530317806e-03 2.3520318788864589e-03 4.0111516626017418e-03 - 19 2.4618298642403763e-03 -4.4243673049978423e-03 1.3621645427986549e-03 - 20 4.8112624548119189e+00 -4.3444774342909227e+00 -3.5373527320628204e+00 + 9 1.1842604073469079e-03 -3.9108918148415394e-03 -7.5167699970296016e-03 + 10 -4.5599438604482529e-03 -7.8987585389291987e-03 -8.1774322966376468e-03 + 11 -2.4948833534825323e+00 2.1601855707292459e+00 -1.8738342859488117e+00 + 12 5.5643385483259076e+00 5.9410422335956472e+00 5.4164029019975697e+00 + 13 2.4976048571011171e+00 -2.1629501642792461e+00 1.8837841164288345e+00 + 14 2.0725922967561914e+00 -1.8495354195703533e+00 2.2810449147034007e+00 + 15 3.8638120834717755e+00 -4.3527916503593547e+00 5.1757881842971010e+00 + 16 -3.5278846748055805e+00 -4.1927453247969506e+00 -7.0921573280148920e+00 + 17 -2.0360907719082597e+00 -1.7556267911290482e+00 1.6732151808742726e+00 + 18 -8.9242845560341053e-03 2.4016003674604226e-03 4.5818582518493819e-03 + 19 2.5249381398371002e-03 -4.3617102991207147e-03 1.3784796456926798e-03 + 20 3.2986408895968693e+00 -2.5641738362080275e+00 -2.0347705440163981e+00 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 22 7.3369465010957011e+00 -7.1116099715000622e+00 8.8797912269397301e+00 + 22 7.3975039691480013e+00 -7.1703313083946281e+00 8.9533199737625129e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 24 -4.2601836462585518e-01 -5.0395425667637128e-01 -5.1952212818162302e-01 - 25 -2.4327828893773887e-03 -3.7730397656368799e-04 3.8196097788385469e-03 - 26 4.8268242621580916e-03 7.5762727887721860e-04 7.3439109155819761e-03 - 27 4.5058495192822840e-03 1.6931220122220005e-02 8.4998947737821608e-03 - 28 3.9859608719696160e+00 -3.2692360837103860e+00 -4.6455115101164628e+00 + 24 -4.7564194442211905e-01 -5.5443154864832978e-01 -5.7233232930498923e-01 + 25 -2.1556935118786816e-03 -2.2502926291960128e-04 3.3667167429008763e-03 + 26 4.5749641420221570e-03 7.5226319620061801e-04 7.3794845492261459e-03 + 27 4.7132133460953702e-03 1.5651605305978866e-02 7.5034984641947199e-03 + 28 2.5299124348946407e+00 -2.0710916532562793e+00 -2.9477694286413509e+00 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 33 -5.8572235070309899e+00 6.6134174900119067e+00 -7.8508330617950470e+00 - 34 1.0288938857885540e-02 1.2625572334860741e-03 -6.0841713134835908e-03 - 35 2.3110873379904463e-03 6.5845183297797219e-03 3.6286854232872039e-03 - 36 -5.4094241242753673e-03 -7.8666007083064392e-03 2.7581893198741714e-04 + 33 -3.8596733752917172e+00 4.3614373770452666e+00 -5.1744411704736200e+00 + 34 1.0456636829412107e-02 1.2729670626026378e-03 -6.0046524322379790e-03 + 35 2.4470169531081811e-03 6.7597691522252026e-03 3.9347634699543107e-03 + 36 -5.3858751260326600e-03 -7.6017981512386881e-03 5.4017513763485474e-04 37 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 39 -1.1995877109356030e+00 1.4362379370120428e+00 1.4462305723485172e+00 - 40 -3.9480352153322609e+00 4.5237333059017963e+00 3.6309325049885048e+00 - 41 -2.6494392352298893e-03 -6.6629222610104849e-03 -6.3019883521462624e-03 - 42 -1.4002246550612642e-02 -2.7057913731241773e-03 5.5941748010221734e-03 - 43 -9.1048927710541194e-01 1.0539543545232359e+00 -1.1268554602535943e+00 - 44 -3.2385649712771825e+00 2.8948706370093800e+00 -3.5726366381616335e+00 - 45 9.1459582698544972e-01 -1.0643429786328398e+00 1.1267358417879532e+00 - 46 6.5916706816610358e+00 6.1017014127048537e+00 -4.9690282103045202e+00 + 39 -7.9152036833213257e-01 9.4767849104558466e-01 9.5429057953190588e-01 + 40 -2.5050717159708151e+00 2.8703955364990659e+00 2.3038043462815598e+00 + 41 -2.6025991997896424e-03 -6.6859200478153304e-03 -6.2518514205323590e-03 + 42 -1.3564361534715340e-02 -2.0752721989283438e-03 5.5386066743209061e-03 + 43 -6.0594763292082987e-01 6.9900218907917244e-01 -7.5186967976680730e-01 + 44 -2.0620116606726238e+00 1.8448157806167680e+00 -2.2778772249944028e+00 + 45 6.0986762614796286e-01 -7.0971216450227348e-01 7.5133430853119942e-01 + 46 4.2420965588733202e+00 3.9267699641408131e+00 -3.1977435268328223e+00 47 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 49 5.0701430226628075e+00 6.0463196913822923e+00 6.8179001643010757e+00 - 50 -3.9037131687346279e-03 5.4811939162223815e-03 -9.0308942205962763e-05 - 51 3.9473009737523754e+00 -4.5285103708642120e+00 -3.6193454999534920e+00 - 52 -7.3277038458522554e+00 7.1037425858553762e+00 -8.8797730740548300e+00 - 53 -5.0817480094222063e+00 -6.0513157240114719e+00 -6.8214346690872816e+00 - 54 -1.2571926096430224e+00 1.1019241455456459e+00 1.3725852315450791e+00 - 55 -4.3947828280151535e+00 4.8453501895858855e+00 4.0595637281885981e+00 + 49 3.2652289992314980e+00 3.8970122381638301e+00 4.3950182977325092e+00 + 50 -4.4659063476672669e-03 5.7566204791911118e-03 -2.9295727156327691e-04 + 51 2.5045090916600232e+00 -2.8762080607908032e+00 -2.2926872560858529e+00 + 52 -7.3893531737745919e+00 7.1636811361843726e+00 -8.9558761069794262e+00 + 53 -3.2761079220612266e+00 -3.9012486360163225e+00 -4.3977583067886137e+00 + 54 -8.3184063776357497e-01 7.2909226785788461e-01 9.0819468888862132e-01 + 55 -2.8317600718097742e+00 3.1151942715900409e+00 2.6092630680027811e+00 56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 57 9.3904984905926990e-04 8.8840016048667321e-03 -4.2850449790286646e-03 - 58 1.0863597548913782e-02 2.6848117403995568e-03 -1.2614764022259679e-03 - 59 -6.5833231226638445e+00 -6.0935937724583598e+00 4.9517495139799950e+00 - 60 7.2005497067801461e+00 7.8887466219189948e+00 8.1202714484072249e+00 + 57 8.4560494080249560e-04 8.5851799368262677e-03 -4.0594794957523137e-03 + 58 1.0973164630996025e-02 2.6947176827845265e-03 -4.9355515716218237e-04 + 59 -4.2348707481513337e+00 -3.9195011831629256e+00 3.1815804998616071e+00 + 60 5.0003503350884557e+00 5.4789096223510132e+00 5.6418116121482740e+00 61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 62 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 63 -3.9875093604492866e+00 3.2813977842968987e+00 4.6497082934375324e+00 - 64 -7.2108390600335159e+00 -7.8978718354169333e+00 -8.1203029379823484e+00 + 63 -2.5310369105111308e+00 2.0827762779505554e+00 2.9513486849368133e+00 + 64 -5.0095549152388621e+00 -5.4868811086374043e+00 -5.6415198999690421e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-edip_multi.yaml b/unittest/force-styles/tests/manybody-pair-edip_multi.yaml index 3a0cbc7d1..7237a20a4 100644 --- a/unittest/force-styles/tests/manybody-pair-edip_multi.yaml +++ b/unittest/force-styles/tests/manybody-pair-edip_multi.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sun Aug 23 06:09:41 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:29 202 epsilon: 1e-14 prerequisites: ! | pair edip/multi @@ -83,73 +83,73 @@ init_forces: ! |2 62 4.2423023573252649e+00 -4.2437011984036177e+00 3.6301121042163134e+00 63 -1.9168909212115635e+00 1.8588573169033795e-01 -5.3807119221021207e+00 64 3.9655634387022887e+00 4.8051691350629415e+00 -8.3823885520783463e+00 -run_vdwl: -177.241652310606 +run_vdwl: -163.995520403999 run_coul: 0 run_stress: ! |- - -5.5866961119628104e+02 -5.6202637175532345e+02 -5.7347040775767402e+02 1.3878175425837171e+01 -1.9305399809564843e+01 5.4211771437966604e+01 + -5.8954094973774431e+02 -5.9339516790815333e+02 -6.0568479850551216e+02 8.0554817494012099e-01 -3.4594782691712908e+01 5.9968329285625259e+01 run_forces: ! |2 - 1 -7.8387022703049851e+00 -2.9585167295836121e+00 -4.6754986144049306e+00 - 2 6.0367774056712973e+00 -9.7173514262745577e+00 3.8697017382924015e+00 - 3 1.5751655157247322e+00 1.7423739582558442e+00 -3.3243078127399981e+00 - 4 3.7022861428082381e+00 -2.9291509393999022e+00 7.5380469096162770e+00 - 5 4.1441250392040452e+00 6.0443728854185395e+00 8.2208849141316627e+00 - 6 1.6991958371049005e+00 -8.6496644531516740e+00 2.7114613872997548e+00 - 7 -1.3260420454342148e+00 -1.1021183095268512e+00 -9.0587143427625971e+00 - 8 -5.5725496916995620e-01 1.1622161953938059e+00 -1.8918937564479514e+00 - 9 -9.3547078569587363e+00 2.2842290770944356e+00 3.2286948943570244e+00 - 10 -5.4738752237470836e+00 1.1936591337323426e+00 1.1987889597517634e+00 - 11 1.3567320809931942e+00 6.7213983461535909e+00 3.5630238054663717e+00 - 12 6.7316278552165940e+00 -4.9573761860282897e+00 -3.5637171914978896e+00 - 13 -1.0486681441869692e+00 -5.8232551950590894e+00 -3.8676996612392978e-01 - 14 3.6204595613356876e+00 -9.5681481476542052e-01 -5.4616823079877523e+00 - 15 2.2092898286783234e+00 -2.2729008002360107e-01 -8.2388442502544592e+00 - 16 -3.8633983114379036e+00 5.3191731093778012e+00 5.2632812017355479e-01 - 17 4.6665446754641451e+00 1.4630613521690445e+00 6.4921685288797226e+00 - 18 -6.4815120468127141e+00 -5.4098935027308457e+00 -2.4015644500186233e+00 - 19 3.8026928430504747e+00 9.6059180100111063e-01 -5.7038392844807291e+00 - 20 6.3585113010273027e+00 4.3224814252805355e-01 1.1197151255900688e+00 - 21 -3.9151976708442797e+00 -6.1459550190965331e+00 3.6492478134862139e+00 - 22 7.1431912090569405e+00 4.9409705890816458e+00 -4.3383034124427278e+00 - 23 3.6679360759593953e+00 -8.5256610541702731e+00 1.0719818001986527e+00 - 24 2.2905627711249821e-02 5.7462741242460122e+00 8.3775343345666853e-01 - 25 -5.4142490988930012e+00 -4.3704752376928937e+00 -4.8597978205797521e+00 - 26 3.5478038320485097e+00 -3.4130949506585546e+00 -7.3160228108637071e+00 - 27 -1.5811731993594662e+00 -3.8840101840234360e+00 -2.8967259897753204e+00 - 28 -5.1068293467174239e+00 -2.8991633455536507e+00 -1.2814908941693006e+00 - 29 2.1123438878160199e+00 6.3237023155411736e+00 3.2181118606237495e+00 - 30 7.5931250132459667e+00 -5.0819920641022192e+00 5.3033711857717227e+00 - 31 1.0062489439367361e+01 -2.4402461935218056e-01 -3.1713506822712401e-01 - 32 9.9962697395325790e+00 9.4004322837018250e-01 -1.5606271556583589e+00 - 33 -8.4100285720687999e+00 -3.8502767220494118e+00 2.2240996364252714e+00 - 34 -7.8253849439331358e-01 2.3093529175382224e+00 -1.2182248602601256e+01 - 35 -3.8672669011162024e+00 -5.6452417323964603e+00 -2.6575986753614869e+00 - 36 -1.8730113273474853e+00 1.0020962156419264e+01 -1.0526908027819202e+00 - 37 -1.9651884930333763e+00 3.2467452745523495e-01 9.9077979305551569e+00 - 38 3.7059221755897704e+00 8.6241522136862834e+00 -5.4580369625019607e+00 - 39 3.6639476500828310e+00 -1.7763809324112063e+00 1.0384020265413113e+01 - 40 -7.0571253507825471e+00 -1.7580483161363969e+00 -3.9400169429595748e+00 - 41 -1.3660269831205065e+00 -1.4132042410641552e+00 1.2723832371391305e+01 - 42 9.4144613909205628e+00 -2.0570028400934648e+00 -1.6878995801232151e+00 - 43 7.0943877553064061e-01 7.7396990397174861e+00 2.6981742125402286e-01 - 44 -1.9527522122609797e+00 2.6287450794328033e+00 1.0213707649898682e+01 - 45 -3.7258142566229866e+00 3.4202950016110236e+00 -3.1669835238319974e+00 - 46 -6.1285702214107172e+00 4.6738717324685624e+00 5.3080295239515973e-01 - 47 -1.6410269000510276e+00 -2.5225526655635666e+00 7.0460456394918083e+00 - 48 -5.1895516073479540e+00 -8.7938891636343932e+00 6.9602072549934855e+00 - 49 -4.2253652841209801e+00 7.3190814799653001e+00 -3.9882908537574626e+00 - 50 3.7239296036560732e+00 -2.5030136708230355e+00 2.4794497205784318e+00 - 51 -1.0989165826505907e+01 -5.1741030090317430e+00 -1.0560556311543812e+00 - 52 -2.1226596483520344e+00 7.5068705318867590e-01 -1.1681491771381285e+00 - 53 9.0689073791619157e-01 -1.2417894761169748e+00 8.8948857886902317e+00 - 54 -2.4975897277210977e+00 1.8000986772051912e+00 -7.7316695093497980e+00 - 55 7.8385850589926926e+00 1.9344070667390327e+00 7.5869879147580632e-01 - 56 5.9131419320986796e+00 5.8984793095742516e+00 3.6507383942174538e+00 - 57 -5.4223631083583923e-01 1.0621127278677964e+01 1.0685466782549997e+00 - 58 -1.0497593842930605e+01 7.2807301019478754e-01 2.2078467061761184e+00 - 59 2.5201671085800639e+00 3.2591130927743999e+00 -5.9054362566389100e+00 - 60 -5.0276266206989062e+00 7.7967165409544910e+00 -4.3470166793821141e+00 - 61 -2.5885364100234600e+00 -1.1663466602879799e+01 -9.5624864458484793e-01 - 62 3.6054739410819345e+00 -4.3307936809387879e+00 3.5663088631979334e+00 - 63 -1.7438161212371046e+00 -6.8247353491645679e-02 -5.2170145750595598e+00 - 64 4.1036700103821602e+00 4.9699680818580685e+00 -7.6437949958428302e+00 + 1 -8.0220555011379915e+00 -2.7954065189965824e+00 -3.8246519184584495e+00 + 2 7.3359891966118429e+00 -8.2728637605844479e+00 3.7368137760507731e+00 + 3 1.1372874390369812e+00 1.9968665379502415e+00 -3.5237702561732571e+00 + 4 3.2713976571870900e+00 -3.6916921889195056e+00 8.4762933049522857e+00 + 5 4.7457748297579858e+00 5.7631076336492093e+00 7.4749131228285837e+00 + 6 3.4649233099219301e+00 -6.3475405983952333e+00 2.1381022033327923e-02 + 7 -7.6133385643852503e-01 -2.2104658529564607e+00 -8.0747066863704671e+00 + 8 -1.5543798617474320e+00 5.2615213430731744e-01 -1.2543315738694161e+00 + 9 -9.5529448618871555e+00 2.4438240576848838e+00 4.1990250139475265e+00 + 10 -5.7558994866323809e+00 1.1876942509220612e+00 5.7996040228431855e-01 + 11 -2.2372587125364951e-01 5.0897908768820805e+00 4.6709343390068536e+00 + 12 6.9642976206653788e+00 -5.3573941908247722e+00 -3.9672080264992120e+00 + 13 -1.8523229768407761e+00 -6.2813605454639285e+00 -8.7405606053390106e-01 + 14 4.1823229763639569e+00 -6.7510728431312916e-01 -5.7335113687619970e+00 + 15 1.7608083616195089e+00 -6.5784370113224933e-01 -7.3532093786415640e+00 + 16 -4.2252980259641824e+00 5.6336351808665643e+00 1.2442638264868067e+00 + 17 5.7601454834866708e+00 9.9642258086586466e-01 5.7575126087878354e+00 + 18 -5.5528638081479205e+00 -4.4874111063623392e+00 -2.7184889453762415e+00 + 19 1.9892756645497076e+00 -1.8456678259911727e+00 -3.4015336800985954e+00 + 20 6.4441740698596170e+00 6.4451463655550056e-01 1.3218004716961074e+00 + 21 -4.3276945774647615e+00 -5.7317023319350913e+00 4.2611703020531877e+00 + 22 6.7031339598220292e+00 4.3859063125833577e+00 -5.5332816444391826e+00 + 23 3.2238406153018055e+00 -9.2550522333101970e+00 4.3075015921520599e-01 + 24 1.5034426203341655e+00 4.9319111827863846e+00 1.6641410026507630e+00 + 25 -5.2292356773751187e+00 -3.5000347391899580e+00 -6.0327057398453849e+00 + 26 2.1353456008586955e-01 -1.2317747444720886e-01 -7.1082053868937178e+00 + 27 -4.9148377546768918e-01 -2.7493755380212819e+00 -2.1053923992001549e+00 + 28 -5.8947786857947646e+00 -3.1626259127604790e+00 -1.4213192272610362e+00 + 29 4.9288964907931145e+00 4.4368779347008154e+00 1.5594473815316716e+00 + 30 9.3481954839352497e+00 -4.3826699595908156e+00 4.4554185591698063e+00 + 31 8.9252859995336529e+00 -2.7378325370431611e+00 -2.4933669776534861e-01 + 32 1.1092478106983279e+01 1.1795870398928163e+00 -1.6265923869003931e+00 + 33 -8.5388843967609596e+00 -4.3087028540512025e+00 2.7361934722881491e+00 + 34 -2.0964833549736923e+00 2.1389822804486918e+00 -7.6396680907901207e+00 + 35 -4.0786641648221575e+00 -5.9425443849525283e+00 -3.8087216917382682e+00 + 36 -1.1826166678576178e+00 1.1114388925877250e+01 -3.3439686363176724e-01 + 37 8.2550203880548567e-01 -2.1111358393745370e+00 8.6624358797417091e+00 + 38 1.4148179558390370e+00 7.4266744422093076e+00 -3.4579155518004363e+00 + 39 3.8695194585840014e+00 -1.6172647277981356e+00 1.0533057023956776e+01 + 40 -4.7800941266194874e+00 -1.2540613407266383e+00 -5.9042506444729614e+00 + 41 -1.5058590691400475e-01 1.0644712000844541e+00 1.1001362776176288e+01 + 42 9.3095225955201464e+00 -1.2464543650315607e+00 -2.3925833996433203e+00 + 43 8.3508951867717451e-01 7.3909952339824780e+00 1.0666235665763653e+00 + 44 -1.6320186319592185e+00 3.2209548446093552e+00 1.0606037652276948e+01 + 45 -5.1317047934000657e+00 3.4045794000276191e+00 -3.6327464146603137e+00 + 46 -6.8350002710470106e+00 4.3873578756429632e+00 4.4401057581076248e-01 + 47 -8.7654839371940252e-01 -1.4785790646392636e+00 6.0741694700877993e+00 + 48 -7.0228139431086287e+00 -7.9013446506878422e+00 5.5370595418869755e+00 + 49 -4.6548835396273915e+00 8.3699407574479103e+00 -4.4744302639687268e+00 + 50 3.2216554670574213e+00 -3.9362424796466393e+00 1.9599619006328894e+00 + 51 -9.5218688312722044e+00 -4.0210522543527247e+00 -2.8512368178199599e+00 + 52 -5.4239251492979779e-01 2.0691967232134161e+00 1.1555926318771892e+00 + 53 9.5741128200909476e-01 -8.6573336593021055e-01 8.4782938355280368e+00 + 54 -1.7139390220396216e+00 3.1794565196603823e+00 -7.0753309912830957e+00 + 55 8.9152126824862545e+00 1.5463302753175612e+00 8.1161307646314063e-01 + 56 2.5131551126825462e+00 3.0494776872045382e+00 3.8502037153955939e+00 + 57 -2.9321389138450851e+00 9.2614506204464515e+00 3.1123331997835209e+00 + 58 -1.1415727367821292e+01 8.5194355578753811e-01 2.1334574675347273e+00 + 59 2.6488244316885692e+00 4.2412633424447854e+00 -6.9430731768238800e+00 + 60 -5.3687480733269632e+00 8.8673080276064216e+00 -4.5727613286110165e+00 + 61 -1.9399074461340255e+00 -1.2598650216166284e+01 8.3958872481290081e-03 + 62 4.2546615585172241e+00 -4.2305659775567381e+00 3.6073835186698830e+00 + 63 -1.9211215647521063e+00 1.3118494235995115e-01 -5.4126265261604338e+00 + 64 4.0195823433662845e+00 4.8453088071341481e+00 -8.3299673461373196e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-extep.yaml b/unittest/force-styles/tests/manybody-pair-extep.yaml index 2bc3ad35a..424afc87a 100644 --- a/unittest/force-styles/tests/manybody-pair-extep.yaml +++ b/unittest/force-styles/tests/manybody-pair-extep.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 09:00:37 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:29 202 epsilon: 5e-13 prerequisites: ! | pair extep @@ -83,73 +83,73 @@ init_forces: ! |2 62 1.6194631652095164e+00 -1.8915906665160171e+00 1.5968589798885620e+00 63 -4.2153728649170885e+00 3.4681853182576141e+00 4.9192624131836515e+00 64 -5.8791675102747618e+00 -6.4393494182844400e+00 -6.6208407800581917e+00 -run_vdwl: -16.8840416364271 +run_vdwl: -8.5008533235016 run_coul: 0 run_stress: ! |- - -1.3023969384493245e+02 -1.3580025778156107e+02 -1.4536894208589501e+02 1.0061876221810238e+01 -3.8457172367649790e+01 -3.0279819359183634e+01 + -9.8904571780486037e+01 -1.0224033233682025e+02 -1.0995227719752538e+02 7.6528290764675049e+00 -3.3060216107241544e+01 -1.6566570707854311e+01 run_forces: ! |2 - 1 4.2151301161565744e+00 -3.6390534480677870e+00 -4.5749170420795036e+00 - 2 1.4028724319245680e+00 1.2394381665078047e+00 1.2957217065417752e+00 + 1 2.8886892053062878e+00 -2.5280964657256906e+00 -3.1519891646819769e+00 + 2 6.0186695663912726e-01 5.2647147693866492e-01 5.4623463738025380e-01 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 4 3.5466355806205740e+00 -4.0990589769758170e+00 -4.2668261021806391e+00 + 4 2.5596125947544071e+00 -3.0539145435767754e+00 -3.0853162548468998e+00 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 6 -1.4028724319245680e+00 -1.2394381665078047e+00 -1.2957217065417752e+00 + 6 -6.0186695663912726e-01 -5.2647147693866492e-01 -5.4623463738025380e-01 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 9 1.7911969250499551e+00 1.5135568001275594e+00 1.8554935096932752e+00 - 10 2.0533192773920752e+00 1.4903697888444349e+00 1.7191757609118896e+00 - 11 -5.6116842933394402e+00 4.8117752702356062e+00 -4.1259525253696001e+00 - 12 8.0711947714482761e+00 8.5602620535324299e+00 7.8785923127289550e+00 - 13 3.8204873682894860e+00 -6.3253320703631637e+00 2.2704590156763258e+00 - 14 3.4799606919465642e+00 -6.4192117933819910e+00 4.4653642624380883e+00 - 15 6.5373509230334683e+00 -7.2895694468225010e+00 8.6154194974184222e+00 - 16 -2.1885555456604120e+00 -3.4074600593373301e+00 -1.2683943186349305e+01 - 17 -5.8826392257878632e+00 -5.1528019941950971e+00 4.8053508736203465e+00 - 18 1.6217053491716626e+00 -1.9344396286372252e+00 -1.6888131264256891e+00 - 19 2.0493392554028889e+00 1.9514982177673792e+00 2.7878510593492347e+00 - 20 8.6784124790497366e+00 -2.5053128030583505e+00 -1.3162684907853857e+00 - 21 -1.6217053491716626e+00 1.9344396286372252e+00 1.6888131264256891e+00 - 22 7.6636831036306248e+00 -7.3963275970137801e+00 9.2299416767852378e+00 - 23 -2.0493392554028889e+00 -1.9514982177673792e+00 -2.7878510593492347e+00 - 24 -3.0730337640981511e+00 -3.7401994981968523e+00 -3.8854712013832811e+00 + 9 9.0885473795220773e-01 7.8050534633551927e-01 9.4257067178476739e-01 + 10 2.1985546980033264e+00 1.6406913423603557e+00 1.8131075955527416e+00 + 11 -4.4708552401791017e+00 3.8701567453499104e+00 -3.3631973933087438e+00 + 12 6.6485630171911794e+00 7.0998738273852409e+00 6.4867576600465702e+00 + 13 3.5620005022268941e+00 -4.6506620916854287e+00 2.4206267215239761e+00 + 14 1.7168041584898939e+00 -5.1389282549229556e+00 2.5034506825705458e+00 + 15 4.9045008120880560e+00 -5.5195925345285772e+00 6.5592984282892708e+00 + 16 -1.7632107689206968e+00 -2.8883391060148700e+00 -1.0501752129312424e+01 + 17 -4.8853522482704843e+00 -4.2115347213703718e+00 4.0149944692658561e+00 + 18 6.3622689811831712e-01 -7.8809552737385069e-01 -6.8085179265311835e-01 + 19 1.0212801268702387e+00 9.7905642676648208e-01 1.3861366852320880e+00 + 20 6.7925800971625305e+00 -2.1267969907794608e+00 -1.2401097169367601e+00 + 21 -6.4346393066273533e-01 7.9507282593070450e-01 6.7474084460224637e-01 + 22 7.5785797669933821e+00 -7.3427712171262272e+00 9.1681018434926571e+00 + 23 -1.0212801268702387e+00 -9.7905642676648208e-01 -1.3861366852320880e+00 + 24 -2.3573648270388428e+00 -2.7481891460598558e+00 -2.8398019437071551e+00 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 27 -2.0046948454047069e+00 2.3551024906252911e+00 -2.0929842668896361e+00 - 28 4.6754639506958284e+00 -3.0460405146329155e+00 -9.2117664527670176e+00 - 29 2.0046948454047069e+00 -2.3551024906252911e+00 2.0929842668896361e+00 + 27 -1.1125022045767943e+00 1.3126789902483651e+00 -1.1482421105356049e+00 + 28 2.6869825771702995e+00 -1.6438650715472631e+00 -6.5837619274991503e+00 + 29 1.1125022045767943e+00 -1.3126789902483651e+00 1.1482421105356049e+00 30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 33 -6.5373509230334683e+00 7.2895694468225010e+00 -8.6154194974184222e+00 + 32 7.2370325444181633e-03 -6.9772985568538554e-03 6.1109480508719184e-03 + 33 -4.9045008120880560e+00 5.5195925345285772e+00 -6.5592984282892708e+00 34 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 35 -6.4443853389258576e-01 7.5130814567331550e-01 -6.5995236481830388e-01 + 35 -4.3901542077344935e-01 5.0608265591331736e-01 -4.5297061596572230e-01 36 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 37 6.4443853389258576e-01 -7.5130814567331550e-01 6.5995236481830388e-01 + 37 4.3901542077344935e-01 -5.0608265591331736e-01 4.5297061596572230e-01 38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 39 -3.5466355806205740e+00 4.0990589769758170e+00 4.2668261021806391e+00 - 40 -6.6173330934528316e+00 7.7485901268776303e+00 6.1667071332991661e+00 + 39 -2.5596125947544071e+00 3.0539145435767754e+00 3.0853162548468998e+00 + 40 -4.2593286982016405e+00 4.8908169570324276e+00 3.9221520588787371e+00 41 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 42 2.6869907969853011e+00 3.1978611366175671e+00 2.8440560107472512e+00 - 43 -1.0349244510612601e+00 5.3165624791662962e+00 -1.6434441980918395e+00 - 44 -5.5332799693386381e+00 4.9288420045375547e+00 -6.1845400233499790e+00 - 45 3.0409089877497220e+00 -3.5877275612389248e+00 3.7505875102201349e+00 - 46 5.5606611340878409e+00 4.2750056677139590e+00 -9.0030219276983683e+00 - 47 -2.0059845366884623e+00 -1.7288349179273728e+00 -2.1071433121282954e+00 + 42 1.8047350823122612e+00 2.1906275347465418e+00 1.9813238961296786e+00 + 43 -9.2624366160710903e-01 4.0458547448583122e+00 -1.3771540026183513e+00 + 44 -3.9153588564932198e+00 3.4982369125626005e+00 -4.3165582781232885e+00 + 45 2.3876120352336141e+00 -2.7849748602589295e+00 2.9419979336007938e+00 + 46 4.0559560945158921e+00 3.2219194678651446e+00 -6.4024018095255295e+00 + 47 -1.4613683736265051e+00 -1.2608798845993803e+00 -1.5648439309824427e+00 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 49 6.7165455943000545e+00 8.2672242001536667e+00 9.2130977806023040e+00 + 49 4.5557887374533337e+00 5.4424444765584141e+00 6.1282530316953725e+00 50 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 51 6.6173330934528316e+00 -7.7485901268776303e+00 -6.1667071332991661e+00 - 52 -7.6636831036306248e+00 7.3963275970137801e+00 -9.2299416767852378e+00 - 53 -6.7165455943000545e+00 -8.2672242001536667e+00 -9.2130977806023040e+00 - 54 -4.2151301161565744e+00 3.6390534480677870e+00 4.5749170420795036e+00 - 55 -5.6053787149515859e+00 6.2455123012552054e+00 5.2017396921686627e+00 + 51 4.2593286982016405e+00 -4.8908169570324276e+00 -3.9221520588787371e+00 + 52 -7.5785797669933821e+00 7.3427712171262272e+00 -9.1681018434926571e+00 + 53 -4.5557887374533337e+00 -5.4424444765584141e+00 -6.1282530316953725e+00 + 54 -2.8886892053062878e+00 2.5280964657256906e+00 3.1519891646819769e+00 + 55 -4.4352152701236882e+00 4.8749861368393184e+00 4.0799116606439210e+00 56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 57 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 58 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 59 -8.2476519310731433e+00 -7.4728668043315274e+00 6.1589659169511144e+00 - 60 7.7635109064849708e+00 8.7298107718933409e+00 8.8995529941093068e+00 + 59 -5.8606911768281522e+00 -5.4125470026116851e+00 4.4210779133958500e+00 + 60 5.9804073171331211e+00 6.5668735859646929e+00 6.7463558490278501e+00 61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 62 1.8498915690341950e+00 -2.1904456930058798e+00 1.7641018344430419e+00 - 63 -6.5253555197300255e+00 5.2364862076387979e+00 7.4476646183239730e+00 - 64 -7.7635109064849708e+00 -8.7298107718933409e+00 -8.8995529941093068e+00 + 62 1.6063116438047804e+00 -1.8793091827965553e+00 1.5816844684889650e+00 + 63 -4.2932942209750786e+00 3.5231742543438176e+00 5.0020774590101844e+00 + 64 -5.9804073171331211e+00 -6.5668735859646929e+00 -6.7463558490278501e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-gw.yaml b/unittest/force-styles/tests/manybody-pair-gw.yaml index b9e284293..f3b58ca8b 100644 --- a/unittest/force-styles/tests/manybody-pair-gw.yaml +++ b/unittest/force-styles/tests/manybody-pair-gw.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 5e-13 prerequisites: ! | pair gw @@ -83,73 +83,73 @@ init_forces: ! |2 62 2.7519690325090496e+00 -9.9223410854458582e-01 1.1407638591976261e+00 63 -4.8143228297845866e+00 -4.0270544701096345e+00 -6.1213019115492795e+00 64 5.8092450572613377e+00 6.0819193766747937e+00 -9.3149111631847408e+00 -run_vdwl: -193.312864805708 +run_vdwl: -176.024796973854 run_coul: 0 run_stress: ! |- - -5.4066946404968030e+02 -5.3539705120734573e+02 -5.4571811632711672e+02 3.9789054403510207e+00 -2.5639055286872550e+00 5.1038719967247225e+01 + -5.8366571087413683e+02 -5.8423594877692676e+02 -5.9716242780237587e+02 -3.1815762627223547e+00 -2.0790779606907606e+01 6.6758710068664939e+01 run_forces: ! |2 - 1 -8.6277798795624054e+00 -3.6815622035526563e-01 -3.9567082453141946e+00 - 2 3.8589634564297346e+00 -1.2182272415511365e+01 1.2200876906255023e+00 - 3 1.3300303630536732e+00 2.3326294241228762e+00 -1.7282095861020628e+00 - 4 3.7859620745039999e+00 4.7662618068459484e-01 9.6619345448570559e+00 - 5 3.6065089887595296e+00 5.1669430011686659e+00 9.9870487605114597e+00 - 6 4.2244236236724886e+00 -6.1786050351305084e+00 4.4134657034505089e+00 - 7 -2.1046785202808467e+00 -4.0938239124149387e+00 -9.1090089768285694e+00 - 8 -3.8060684015514470e+00 -4.5723044932663481e-01 -6.4461929458864398e-01 - 9 -1.2921199082421369e+01 6.9733873984331585e-01 1.0987604447572705e+00 - 10 -7.2048633787273113e+00 -8.1550180347605306e-01 -1.1253890151943271e+00 - 11 4.7437464253584665e+00 6.4387785208763022e+00 8.4065759815660890e+00 - 12 6.8036849877976984e+00 -5.1988280044239286e+00 -3.5984551032716823e+00 - 13 -1.0854155791565836e+00 -2.4775958244949554e+00 1.1195054660751282e+00 - 14 5.2998514529186513e+00 1.9682617371316087e+00 -6.0760696784610051e+00 - 15 -6.8987501158202225e-01 -1.1242442813924427e+00 -1.1686899502323723e+01 - 16 -6.6413875064969945e+00 5.9302349269882635e+00 3.2559703717735746e+00 - 17 7.7777501510945477e+00 2.7644616910254904e+00 5.6707274818522722e+00 - 18 -5.4427524537043048e+00 -4.0179426490246151e+00 1.0850216369611116e+00 - 19 2.7140607305224616e+00 -1.9413883345089769e+00 -8.9692209726468874e+00 - 20 4.1131403354946947e+00 -1.4860626613635164e-01 5.1220818201154561e-01 - 21 -2.6596070018577223e+00 -9.4619454789250241e+00 1.1729558941784273e+00 - 22 8.6942470489730699e+00 5.8139049031439898e+00 -6.2007015148032405e+00 - 23 8.6236802547201243e+00 -9.1169465049242628e+00 6.3075864900762877e+00 - 24 2.0331437118897773e+00 7.9924622886378982e+00 2.9582471903448839e+00 - 25 -3.3490572228344759e+00 -3.6329693424919318e+00 -8.7373332500681720e+00 - 26 2.5619715103499980e+00 -2.3890336240086594e+00 -7.6784957495940489e+00 - 27 1.6901849786610461e+00 -7.4878198235782731e+00 -1.1555757174490462e+00 - 28 -4.2027661354654899e+00 -3.2897798141811139e+00 2.3654811439472589e-01 - 29 5.2836643266529038e-02 7.7586444923075950e+00 2.0821877168214566e+00 - 30 6.8230136508545502e+00 -3.0045595155403859e+00 2.6132954335670604e+00 - 31 7.0560180290044121e+00 -4.7496845240573371e-01 -2.0845959358299986e+00 - 32 6.9011456891725294e+00 2.0042051227213102e+00 -1.6457810562548612e+00 - 33 -7.1279903554204003e+00 -3.5306966309785830e+00 2.6325811823126530e+00 - 34 1.3564237012886158e+00 1.8876264168932266e+00 -1.1505824128346026e+01 - 35 -3.4146980875472899e+00 -9.7380268825987173e+00 1.1151703291202315e+00 - 36 -3.1018390582490536e+00 8.1181667986228199e+00 -3.2099991161225505e+00 - 37 -5.8484339564150005e+00 4.5884928602723205e+00 8.9741758855614151e+00 - 38 -1.7135927419887675e-01 6.3554185023487069e+00 -4.5417101109085039e+00 - 39 5.9379708204147610e+00 -4.0464116424892840e+00 9.0922229953492550e+00 - 40 -4.1115802782835837e+00 -5.1337672078715557e-01 -2.5851323735447522e+00 - 41 -1.8400572364289123e+00 1.4201593566377635e-01 1.1478634359316157e+01 - 42 7.8777278483406352e+00 -3.5790973798948587e+00 -3.0407987965288816e+00 - 43 -3.8534204387524340e-01 2.8930068300635017e+00 1.0510088118927550e+00 - 44 -3.5292579564572291e-01 1.9997711805972200e+00 1.3016112471305417e+01 - 45 -5.5717226200137109e+00 4.6933518996947239e+00 -6.4188879232681586e+00 - 46 -7.7777235196332217e+00 6.8515631888706823e+00 4.6134653707329480e+00 - 47 9.2950788093183445e-01 -2.3284970590293624e-01 8.1211036777812637e+00 - 48 -6.3517307140140797e+00 -8.9281828600248510e+00 7.6789287567742690e+00 - 49 -3.1045046254934303e+00 6.0501772937557954e+00 -2.9302380344079602e+00 - 50 3.9793021967016564e+00 -4.4234148576269545e+00 -3.3195367986874103e-01 - 51 -1.1667642034478254e+01 -1.6310692693619107e+00 -2.7745502863523579e+00 - 52 -2.7582215166422523e+00 5.1218857342030311e-01 -2.8687362304964287e-01 - 53 3.1268392260466551e+00 -8.0987971044106155e-01 1.0609349758585569e+01 - 54 2.5854711067077090e+00 3.9471811177139955e+00 -9.9596433268722322e+00 - 55 1.0845720108316186e+01 9.3370174351410229e-01 -1.3860179756840392e+00 - 56 5.1626356890365477e+00 5.6647250512757319e+00 3.0358278852642586e+00 - 57 -1.8152866890052484e+00 1.4359221590238048e+01 1.0017438179016009e+00 - 58 -1.1291990567197121e+01 -1.3980521338702996e+00 4.2848456761750349e+00 - 59 5.9828280745310183e+00 5.2968296013142702e+00 -6.6890694908714057e+00 - 60 -3.7907604359541596e+00 6.9367356178894246e+00 -2.7380157783755998e+00 - 61 -4.7142147341717209e+00 -1.3612089754044785e+01 -3.0602646797848516e+00 - 62 2.8612400761146137e+00 -8.2941697712592788e-01 9.1772255106609146e-01 - 63 -3.0969273095825809e+00 -2.9625009679729546e+00 -6.6298480344622881e+00 - 64 3.6903701909626299e+00 3.5226180145711403e+00 -6.9391296757848151e+00 + 1 -8.8288347694027394e+00 -1.8476089642172706e+00 -4.5201013800371292e-01 + 2 4.2273767599233842e+00 -1.0657183896136125e+01 8.0773341174913782e-01 + 3 -7.7265440893636828e-01 3.3988436343168473e+00 -8.9984682995143439e-01 + 4 1.4797448471670909e+00 -1.2386665684507614e+00 1.1436412556837221e+01 + 5 5.6109009094038349e+00 4.9705218520345804e+00 7.3162742200965161e+00 + 6 7.0159753559556064e+00 -5.0944694717483765e+00 4.1475639581220651e+00 + 7 -3.1754470047415233e+00 -6.6751624515335042e+00 -7.0065723186687308e+00 + 8 -3.2466088548992200e+00 -7.6291938445888230e-01 1.0419298763925355e-01 + 9 -1.4775902261958345e+01 4.1411131200836349e-01 1.1590152409076036e+00 + 10 -6.8113336092410615e+00 2.3436150818046082e+00 -3.1965020164690863e+00 + 11 2.2834603344644147e+00 4.3507821302429397e+00 7.8516655292435527e+00 + 12 8.5771418899950067e+00 -8.0711941323459513e+00 -5.8513218079785672e+00 + 13 -8.8580858876420776e-01 -2.8774703446827723e+00 7.9876701415177176e-01 + 14 6.5758642792337634e+00 3.0435658593442834e+00 -7.3851623158522690e+00 + 15 6.1585795555120004e-02 -9.2604762435859111e-01 -9.3401998465195000e+00 + 16 -7.0125969736034275e+00 6.2942583975273232e+00 3.7386579012249470e+00 + 17 9.0776030278979860e+00 3.5040980993316175e+00 6.3491014486514921e+00 + 18 -3.6857938525659191e+00 -3.5609614384773867e+00 1.8596512486802965e+00 + 19 5.2107545490497720e-01 -3.7556147676972338e+00 -8.4900432603844322e+00 + 20 4.2048354638922723e+00 -1.0335988835905185e-01 4.5687969741619394e-01 + 21 -2.7872978061754603e+00 -1.0976708590720317e+01 1.2451903909748583e+00 + 22 8.5360761136845884e+00 5.6061269839674326e+00 -7.5389132395185543e+00 + 23 7.3206154126961840e+00 -8.6089301074326432e+00 5.0804108671733843e+00 + 24 4.5987347944042831e+00 7.3633492700845693e+00 2.0111181715247657e+00 + 25 -4.8234181438388042e+00 -2.1182927274447358e+00 -9.1362679809587455e+00 + 26 1.2651223092425851e-01 -1.9105610114167094e-02 -7.1972809392555694e+00 + 27 1.7845092644777782e+00 -8.0507842956871496e+00 4.9236551746879004e-01 + 28 -6.8071094136664607e+00 -6.1578219280663689e+00 3.2496301033009791e+00 + 29 4.1997906685492961e+00 8.6887687396496940e+00 -2.4700967215791731e+00 + 30 1.0806415791753004e+01 -5.0516004615424883e+00 4.6867338967911838e+00 + 31 8.9281338164999831e+00 -4.8683146577008198e+00 1.4440225721956477e+00 + 32 8.0893633248862642e+00 4.8936003743427143e+00 -4.2707539393864868e+00 + 33 -9.4391056792863104e+00 -6.2163525932119104e+00 4.9175516177252767e+00 + 34 -9.2176219582249841e-01 1.9113485163039023e+00 -6.4553723528082561e+00 + 35 -1.5772669929480374e+00 -1.1040234882516755e+01 -8.0730897992987727e-01 + 36 -1.3428170574740654e+00 1.2615666495802458e+01 -7.5158746483174144e-01 + 37 -2.6164525472078166e+00 1.7598433362136794e+00 6.3492997737429997e+00 + 38 -4.2678661222095382e-01 5.4484842307356542e+00 -2.8651940552428847e+00 + 39 6.8833082828099368e+00 -4.5066170471011997e+00 9.6509569971382057e+00 + 40 -3.6750805836801752e+00 -3.6144190711098161e+00 -7.0537945886636173e+00 + 41 -3.5886747532101815e-01 2.3668040247431748e+00 9.5508985571323244e+00 + 42 8.1535254086259830e+00 -3.9800605856603872e+00 -5.5361168046574853e+00 + 43 -2.5375248783506993e-01 3.1010796178581628e+00 9.6157893258141491e-01 + 44 1.4041814214965032e+00 4.2256601132342055e+00 1.3060903422851387e+01 + 45 -8.5855962712499725e+00 5.1763121690866205e+00 -4.3148901287224817e+00 + 46 -7.4990589831169636e+00 6.6358231079253018e+00 4.2817362055169808e+00 + 47 -3.5569024333246002e-01 3.9700836595550961e+00 9.0970615985590371e+00 + 48 -9.1649838779274173e+00 -8.5382840528706918e+00 5.1130326525123806e+00 + 49 -6.3943804489307112e+00 8.9310807458683286e+00 -6.6340512685849262e+00 + 50 6.3425367841389635e+00 -4.8397194035146924e+00 -2.2480898295444267e+00 + 51 -1.1324878720262252e+01 -6.8109645199938285e-01 -3.9784488198981927e+00 + 52 -1.1377870351558370e+00 1.8142717794334864e+00 1.7994960747775539e+00 + 53 2.6196053868224336e+00 4.1345591071940069e-01 1.1958340066519746e+01 + 54 2.1871968581667622e+00 3.8654339803445454e+00 -9.6543366689078365e+00 + 55 1.2219993738735333e+01 -5.4775682686672611e-01 -2.4085994222462478e-01 + 56 5.6152097601914974e-02 3.9761334833228092e+00 4.2805808847053637e+00 + 57 -3.5325919807391997e+00 1.1824369219123271e+01 2.9460075047380707e+00 + 58 -1.1575313898141397e+01 -1.2641683441057683e+00 4.1479383606112004e+00 + 59 5.3749969965682229e+00 7.6901763466071946e+00 -8.4329252952390643e+00 + 60 -6.9300467125149279e+00 9.9183887806347073e+00 -5.6347580721105315e+00 + 61 -2.3450442005752041e+00 -1.4951116750045928e+01 -1.5191604011099302e-01 + 62 2.7804760686867165e+00 -9.5514677565673356e-01 1.1025937387010289e+00 + 63 -4.8323718129679634e+00 -4.0710662492308103e+00 -6.1247621298054309e+00 + 64 5.8547529245819279e+00 6.1121990928984378e+00 -9.3339793261539974e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-gw_zbl.yaml b/unittest/force-styles/tests/manybody-pair-gw_zbl.yaml index 7d9fd2460..508b5323a 100644 --- a/unittest/force-styles/tests/manybody-pair-gw_zbl.yaml +++ b/unittest/force-styles/tests/manybody-pair-gw_zbl.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 5e-13 prerequisites: ! | pair gw/zbl @@ -83,73 +83,73 @@ init_forces: ! |2 62 2.7519673193592538e+00 -9.9223209492059505e-01 1.1407621379187511e+00 63 -4.8143194318839724e+00 -4.0270585558397460e+00 -6.1213061124576491e+00 64 5.8092540975566473e+00 6.0819293431378529e+00 -9.3149006808172707e+00 -run_vdwl: -193.312853528059 +run_vdwl: -176.024782474281 run_coul: 0 run_stress: ! |- - -5.4066934275981271e+02 -5.3539692137349732e+02 -5.4571796355268998e+02 3.9788786808580205e+00 -2.5638457494512634e+00 5.1038720866332895e+01 + -5.8366556611633632e+02 -5.8423579984632795e+02 -5.9716226264864974e+02 -3.1815930970724891e+00 -2.0790710083930556e+01 6.6758711013558496e+01 run_forces: ! |2 - 1 -8.6277813837170996e+00 -3.6815356912781649e-01 -3.9567072357053927e+00 - 2 3.8589613255677695e+00 -1.2182274186588572e+01 1.2200874450581158e+00 - 3 1.3300307944456162e+00 2.3326301828716520e+00 -1.7282105813177813e+00 - 4 3.7859607366139292e+00 4.7662862010008389e-01 9.6619359571747268e+00 - 5 3.6065082281390186e+00 5.1669427242924169e+00 9.9870488236990909e+00 - 6 4.2244244544978597e+00 -6.1786033433086853e+00 4.4134659256902458e+00 - 7 -2.1046786080633120e+00 -4.0938241912243951e+00 -9.1090084112855756e+00 - 8 -3.8060686137426289e+00 -4.5723011891033372e-01 -6.4461987470546578e-01 - 9 -1.2921199518089869e+01 6.9733763570710705e-01 1.0987591943611239e+00 - 10 -7.2048631108887493e+00 -8.1550354985302786e-01 -1.1253905684192793e+00 - 11 4.7437505164088183e+00 6.4387759986175812e+00 8.4065799145269722e+00 - 12 6.8036757384550999e+00 -5.1988342453747194e+00 -3.5984612443501485e+00 - 13 -1.0854184196104706e+00 -2.4775908643592226e+00 1.1195049109784083e+00 - 14 5.2998494340360915e+00 1.9682641881011902e+00 -6.0760706983373254e+00 - 15 -6.8987939813923393e-01 -1.1242393596560829e+00 -1.1686907073851605e+01 - 16 -6.6413823728598960e+00 5.9302403106086752e+00 3.2559803068427073e+00 - 17 7.7777534204858387e+00 2.7644631040804661e+00 5.6707235317708173e+00 - 18 -5.4427505787065185e+00 -4.0179389213338066e+00 1.0850266660465389e+00 - 19 2.7140599153796292e+00 -1.9413897637657505e+00 -8.9692213629342543e+00 - 20 4.1131351877265230e+00 -1.4860485808821977e-01 5.1220892255762340e-01 - 21 -2.6596058078106477e+00 -9.4619456039413130e+00 1.1729547096952548e+00 - 22 8.6942219833331986e+00 5.8139224763227411e+00 -6.2007309219058415e+00 - 23 8.6236811036531673e+00 -9.1169454341147382e+00 6.3075877532622755e+00 - 24 2.0331453721306119e+00 7.9924636679279146e+00 2.9582497770410177e+00 - 25 -3.3490567048167796e+00 -3.6329701644521282e+00 -8.7373325158615067e+00 - 26 2.5619714884463400e+00 -2.3890335739466586e+00 -7.6784961439679407e+00 - 27 1.6901862855624712e+00 -7.4878193304420178e+00 -1.1555746080127431e+00 - 28 -4.2027671155755355e+00 -3.2897771848501600e+00 2.3655262433935664e-01 - 29 5.2834057778781585e-02 7.7586444900352625e+00 2.0821886041064515e+00 - 30 6.8230121395951482e+00 -3.0045575389791095e+00 2.6132932318988287e+00 - 31 7.0560163648018364e+00 -4.7496724594562700e-01 -2.0845979644689794e+00 - 32 6.9011446653487551e+00 2.0042047039996818e+00 -1.6457805890053665e+00 - 33 -7.1279836004450239e+00 -3.5306988416018426e+00 2.6325849821981895e+00 - 34 1.3564237534349830e+00 1.8876260801910882e+00 -1.1505824014399003e+01 - 35 -3.4146974870449518e+00 -9.7380272865336508e+00 1.1151712285765996e+00 - 36 -3.1018395483505579e+00 8.1181651630917298e+00 -3.2099999230558383e+00 - 37 -5.8484348847859042e+00 4.5884939458598870e+00 8.9741751166255330e+00 - 38 -1.7135968718820438e-01 6.3554195091843040e+00 -4.5417096642033856e+00 - 39 5.9379720913779419e+00 -4.0464133125425690e+00 9.0922204133000708e+00 - 40 -4.1115734183840100e+00 -5.1338091273431097e-01 -2.5851347293479332e+00 - 41 -1.8400571371576810e+00 1.4201619701308155e-01 1.1478634349552040e+01 - 42 7.8777244660031815e+00 -3.5790980571087374e+00 -3.0408007992335033e+00 - 43 -3.8534267211770346e-01 2.8930029804153552e+00 1.0510098476143472e+00 - 44 -3.5292413939131972e-01 1.9997679881601520e+00 1.3016115270182855e+01 - 45 -5.5717230758142824e+00 4.6933529666626095e+00 -6.4188907546899365e+00 - 46 -7.7777256783801354e+00 6.8515617040603516e+00 4.6134701878154249e+00 - 47 9.2951105126052402e-01 -2.3285119436249052e-01 8.1211032721280727e+00 - 48 -6.3517302165875611e+00 -8.9281821597203841e+00 7.6789292438054932e+00 - 49 -3.1045084518164119e+00 6.0501696170918624e+00 -2.9302437903579310e+00 - 50 3.9793029598124665e+00 -4.4234122307884913e+00 -3.3195274578967915e-01 - 51 -1.1667645949283481e+01 -1.6310649792712169e+00 -2.7745454685923630e+00 - 52 -2.7581999498237559e+00 5.1216578668919355e-01 -2.8684044621165616e-01 - 53 3.1268481898543841e+00 -8.0987030580600150e-01 1.0609352284577195e+01 - 54 2.5854723369710229e+00 3.9471787562895742e+00 -9.9596454349695946e+00 - 55 1.0845722416543193e+01 9.3369881118806963e-01 -1.3860210407080367e+00 - 56 5.1626329831011502e+00 5.6647221205380056e+00 3.0358245934402035e+00 - 57 -1.8152871061206437e+00 1.4359220958131830e+01 1.0017442246365476e+00 - 58 -1.1291990057020765e+01 -1.3980521358257956e+00 4.2848454040438746e+00 - 59 5.9828321440987393e+00 5.2968314253914688e+00 -6.6890721950533667e+00 - 60 -3.7907706823025058e+00 6.9367208647219538e+00 -2.7380275039942350e+00 - 61 -4.7142151813942741e+00 -1.3612088795758742e+01 -3.0602653978386143e+00 - 62 2.8612390947195339e+00 -8.2941404606465108e-01 9.1772014051982698e-01 - 63 -3.0969240922921752e+00 -2.9625040944105328e+00 -6.6298511920082674e+00 - 64 3.6903799481384696e+00 3.5226284234465064e+00 -6.9391139634832770e+00 + 1 -8.8288372224929077e+00 -1.8476060855722265e+00 -4.5200747711808864e-01 + 2 4.2273754212837602e+00 -1.0657185028495912e+01 8.0773234584699627e-01 + 3 -7.7265437527090408e-01 3.3988433438498955e+00 -8.9984664935186487e-01 + 4 1.4797425862260514e+00 -1.2386634448958525e+00 1.1436415172307248e+01 + 5 5.6109005399269005e+00 4.9705216836282018e+00 7.3162742683521067e+00 + 6 7.0159762685934126e+00 -5.0944680755652518e+00 4.1475646764841150e+00 + 7 -3.1754476650916965e+00 -6.6751632058907777e+00 -7.0065716657373560e+00 + 8 -3.2466089789640509e+00 -7.6291917537309206e-01 1.0419264965171138e-01 + 9 -1.4775903462782534e+01 4.1411019156251971e-01 1.1590138028858417e+00 + 10 -6.8113346780623871e+00 2.3436139850350162e+00 -3.1965041012340616e+00 + 11 2.2834650861739338e+00 4.3507780785006673e+00 7.8516691541942212e+00 + 12 8.5771305375804729e+00 -8.0712060036914544e+00 -5.8513326821923570e+00 + 13 -8.8581195478518626e-01 -2.8774650538901696e+00 7.9876492605614779e-01 + 14 6.5758623084385039e+00 3.0435708495244751e+00 -7.3851646906415889e+00 + 15 6.1579026257279068e-02 -9.2604006379321202e-01 -9.3402089481493675e+00 + 16 -7.0125907159360006e+00 6.2942660753751678e+00 3.7386730244930968e+00 + 17 9.0776079020726979e+00 3.5041022473206902e+00 6.3490971334313073e+00 + 18 -3.6857938975043743e+00 -3.5609609469018588e+00 1.8596533261626249e+00 + 19 5.2107440139438699e-01 -3.7556162030805247e+00 -8.4900445460594529e+00 + 20 4.2048283762808989e+00 -1.0335724105130240e-01 4.5688139038382447e-01 + 21 -2.7872969744346676e+00 -1.0976709485925660e+01 1.2451890212671826e+00 + 22 8.5360523390116398e+00 5.6061498628018391e+00 -7.5389420105403024e+00 + 23 7.3206166812478308e+00 -8.6089288165344318e+00 5.0804126097652293e+00 + 24 4.5987369922569350e+00 7.3633517753874891e+00 2.0111209683385054e+00 + 25 -4.8234179387312413e+00 -2.1182929389923588e+00 -9.1362678417032122e+00 + 26 1.2651222031790493e-01 -1.9105603045687768e-02 -7.1972809503563147e+00 + 27 1.7845108160808791e+00 -8.0507857530267444e+00 4.9236671398846277e-01 + 28 -6.8071118430957078e+00 -6.1578200708797262e+00 3.2496366370997896e+00 + 29 4.1997890639380735e+00 8.6887700903716567e+00 -2.4700978531661200e+00 + 30 1.0806415627798042e+01 -5.0516002401052962e+00 4.6867337102007447e+00 + 31 8.9281335587758672e+00 -4.8683144240349172e+00 1.4440222793079531e+00 + 32 8.0893620276735891e+00 4.8936008907002932e+00 -4.2707543810015629e+00 + 33 -9.4390988233987123e+00 -6.2163600315101579e+00 4.9175604698892101e+00 + 34 -9.2176218721613212e-01 1.9113484895469215e+00 -6.4553723292171803e+00 + 35 -1.5772662364908177e+00 -1.1040235795520083e+01 -8.0730764511492348e-01 + 36 -1.3428170205156411e+00 1.2615665856571381e+01 -7.5158746127920983e-01 + 37 -2.6164536020404565e+00 1.7598445520632005e+00 6.3492986768417614e+00 + 38 -4.2678658790176272e-01 5.4484842893488068e+00 -2.8651940701499576e+00 + 39 6.8833106703113085e+00 -4.5066199242870235e+00 9.6509540034092822e+00 + 40 -3.6750755936289208e+00 -3.6144239975657255e+00 -7.0537984301042220e+00 + 41 -3.5886747031789917e-01 2.3668040269905259e+00 9.5508985391223344e+00 + 42 8.1535233513382170e+00 -3.9800625012476569e+00 -5.5361185997549720e+00 + 43 -2.5375189650166796e-01 3.1010754844415032e+00 9.6157997246465787e-01 + 44 1.4041852915403126e+00 4.2256564736418323e+00 1.3060907728659830e+01 + 45 -8.5855982733001035e+00 5.1763146420568500e+00 -4.3148931610979941e+00 + 46 -7.4990640791021583e+00 6.6358189310433460e+00 4.2817433955522128e+00 + 47 -3.5568846947670330e-01 3.9700850049935537e+00 9.0970633127548037e+00 + 48 -9.1649838419652490e+00 -8.5382839639485031e+00 5.1130327054377309e+00 + 49 -6.3943859196570552e+00 8.9310736445106205e+00 -6.6340586852410786e+00 + 50 6.3425375853821686e+00 -4.8397185017209008e+00 -2.2480902922550681e+00 + 51 -1.1324883356671544e+01 -6.8109122470765571e-01 -3.9784445107667175e+00 + 52 -1.1377633277130668e+00 1.8142488287630671e+00 1.7995249727290832e+00 + 53 2.6196114640056751e+00 4.1346277145874133e-01 1.1958347331328666e+01 + 54 2.1871995964124955e+00 3.8654314853889620e+00 -9.6543396866029347e+00 + 55 1.2219998362731110e+01 -5.4776188766310163e-01 -2.4086450806328516e-01 + 56 5.6151701616473204e-02 3.9761336986329914e+00 4.2805799364299286e+00 + 57 -3.5325920146380785e+00 1.1824369121297643e+01 2.9460075145846489e+00 + 58 -1.1575313336208911e+01 -1.2641689701473076e+00 4.1479388858630282e+00 + 59 5.3750039496536930e+00 7.6901824125116462e+00 -8.4329303898935315e+00 + 60 -6.9300560420434980e+00 9.9183780958320327e+00 -5.6347686784341882e+00 + 61 -2.3450443123063458e+00 -1.4951116527549770e+01 -1.5191618244594618e-01 + 62 2.7804743737913462e+00 -9.5514476279125082e-01 1.1025920230422281e+00 + 63 -4.8323683471656445e+00 -4.0710704006520100e+00 -6.1247664177534871e+00 + 64 5.8547623173001568e+00 6.1122094669060711e+00 -9.3339684329001660e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-lcbop.yaml b/unittest/force-styles/tests/manybody-pair-lcbop.yaml index c666afd3a..bb818fd8a 100644 --- a/unittest/force-styles/tests/manybody-pair-lcbop.yaml +++ b/unittest/force-styles/tests/manybody-pair-lcbop.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 7.5e-12 prerequisites: ! | pair lcbop @@ -83,73 +83,73 @@ init_forces: ! |2 62 1.6765145761367202e+00 -2.0782148288797191e+00 1.8091954116807478e+00 63 -9.5306462336143234e+00 7.7221239702292852e+00 1.1380605030752243e+01 64 -9.2795211740539081e+00 -1.0180658540458492e+01 -9.9052284360191454e+00 -run_vdwl: -13.4267481536937 +run_vdwl: 7.86535389924738 run_coul: 0 run_stress: ! |- - -1.2438239212694427e+02 -1.3519475156374412e+02 -1.4416839838037882e+02 3.3111116157538284e+01 -2.6229917528593294e+01 -3.8335936139116058e+01 + -1.2481966708403526e+02 -1.2933233823626156e+02 -1.3982248076124634e+02 2.6116999993827992e+01 -2.6247661471622003e+01 -3.1660886467127749e+01 run_forces: ! |2 - 1 1.0237370064906509e+01 -8.5336224828002631e+00 -1.1005218856144294e+01 - 2 -3.4784773723724066e-01 5.8021175531924180e-02 -1.9282844439452179e-01 - 3 -1.2739741644225200e-02 -1.0069277150486099e-01 1.4752434854502247e-01 - 4 8.9627371436596874e+00 -1.0128310565833802e+01 -1.0940462565413972e+01 - 5 -2.0495275652233569e-01 -1.4749158812894328e-01 -6.5325760179552911e-02 - 6 -4.5894166333942159e-02 2.3341167638039803e-01 -1.7638128462845883e-02 - 7 -1.4374607519793065e-01 -1.6048460066541040e-01 1.4246413109296657e-01 - 8 -3.2618862078731652e-02 5.7365897211965229e-02 -1.2265252354866131e-01 - 9 7.3331139213081417e-02 -2.1708990748705911e-01 -3.8855082299377047e-01 - 10 1.2925523782779635e+00 8.3810370446567706e-01 8.0165058045173754e-01 - 11 -1.0807449647989586e+01 9.3190323421622008e+00 -8.0608058890001555e+00 - 12 7.4389513443756421e+00 8.2684938383505884e+00 7.5610754566331932e+00 - 13 1.1129152149348672e+01 -8.9821761744560789e+00 8.1388585875031296e+00 - 14 8.0104267350095917e+00 -8.8014454842160479e+00 9.5085383930126017e+00 - 15 6.7612410424413243e+00 -7.5839731195193565e+00 9.1469746868932056e+00 - 16 2.9587600556486966e+00 9.9277045064699432e-01 -1.5999232898916299e+01 - 17 -1.0723826453215171e+01 -9.2719019245618650e+00 8.3496828025577159e+00 - 18 9.3226069498408137e-01 -8.5891817203702514e-01 -4.4177882049807660e-01 - 19 2.9350610994824984e+00 2.8025568834250123e+00 4.1084216863962597e+00 - 20 1.7044482718522822e+01 1.3061328109505732e-01 2.2303119946056467e+00 - 21 -5.8338801389812611e-01 1.0218169449745131e+00 3.4039795100407311e-01 - 22 5.5682394642391131e+00 -5.6407873706161720e+00 7.0304723086905145e+00 - 23 -2.9158940469675949e+00 -2.5710316825770296e+00 -3.8993309002241676e+00 - 24 -8.3416424357855892e+00 -1.0437082353494505e+01 -1.0712843351776540e+01 - 25 5.9190017383165615e-02 -6.2394668680111620e-02 7.2193542569697025e-02 - 26 -1.1632526714683127e-01 -2.9900942060980998e-02 1.1781801474278579e-01 - 27 -2.4595859093574450e+00 2.9901332424372256e+00 -2.5492929569917444e+00 - 28 6.9884993998993874e+00 -4.7550899162472877e+00 -1.1346594258061893e+01 - 29 2.3459873508897053e+00 -3.0123923174984149e+00 2.7236011429675608e+00 - 30 -1.8177730860772737e-01 8.2698219955128938e-02 -1.0093098691601560e-01 - 31 -2.2907382032950391e-01 7.8009241730791948e-02 -8.5782916261625153e-02 - 32 -4.9748760801256670e-01 4.9348367008571759e-02 5.2208739766674839e-03 - 33 -6.6928977325240897e+00 7.7975849681726119e+00 -9.0638538305403689e+00 - 34 -5.6126119110567502e-02 -2.3113798972523747e-02 9.6664432970543723e-02 - 35 1.6693042892704785e-01 -9.5335461529506227e-02 3.3271260840975686e-01 - 36 8.6324944943528950e-02 -2.9856462667383954e-01 7.0121037648987836e-03 - 37 -2.3493637505619930e-01 2.7400121369297037e-01 -3.8948245198785114e-01 - 38 8.5835563840937878e-02 -9.8310161891456693e-03 2.9209035129394073e-02 - 39 -8.9651124141083933e+00 1.0381179554241854e+01 1.0410019902631097e+01 - 40 -7.7553940777805153e+00 9.3591953874588718e+00 7.6082905873697158e+00 - 41 5.4030428901812401e-02 5.0017457732297564e-02 -7.2601472186096014e-02 - 42 6.3012567393122483e+00 7.7954799812737479e+00 6.9439384760578111e+00 - 43 -8.0723303025037154e+00 1.0836742317896071e+01 -1.0201157607982962e+01 - 44 -9.0041159730939704e+00 7.8790553352461217e+00 -1.0384351288244947e+01 - 45 9.0116677705043458e+00 -1.0570676815817370e+01 1.0796597612607936e+01 - 46 2.5179275242639330e+00 2.4676411569379381e-01 -1.3501552848499399e+01 - 47 -6.8187197393971888e-01 -7.4578247139241105e-01 -7.9681785353501167e-01 - 48 1.6493317319493506e-01 1.8520807878677822e-01 -1.1598082269473209e-01 - 49 6.1403083607061060e+00 7.0503020750142227e+00 8.2284087910300201e+00 - 50 1.9941227344946760e-01 2.9769660530871350e-01 -1.0668103763425291e-01 - 51 8.0998852414652802e+00 -9.0613886920506062e+00 -7.2416058335264752e+00 - 52 -5.6677625995918017e+00 5.5405263265397915e+00 -6.8252324294864213e+00 - 53 -5.9504845141072256e+00 -7.3537318795462356e+00 -8.2909238047311238e+00 - 54 -1.0120499052084817e+01 8.6633616529210720e+00 1.1075973812429934e+01 - 55 -9.2160002516166131e+00 1.0093306328330192e+01 8.4605447762907513e+00 - 56 -1.1756295869275851e-02 3.3043586728988078e-02 -3.0689515156768227e-01 - 57 9.9679963699159629e-02 -1.5477869684997456e-01 -7.2737184302784821e-02 - 58 3.0192838322560334e-01 -1.2796525005797335e-01 2.6886528172325804e-03 - 59 -9.0142198894423622e+00 -8.4170808356547280e+00 6.9481669269588773e+00 - 60 6.3600795921193285e+00 6.7001231408260473e+00 7.1488900250145910e+00 - 61 7.8252823486902240e-02 2.9866501889263264e-01 -7.9878624563153089e-02 - 62 1.5686564027329066e+00 -1.9446009984305463e+00 1.6036033572355219e+00 - 63 -8.6247683835418361e+00 6.7625232752998583e+00 1.0003168078373522e+01 - 64 -6.2628266083598296e+00 -7.0695150998825946e+00 -6.7420733594669890e+00 + 1 6.9638335517718319e+00 -5.7358319345864937e+00 -7.4702488944989760e+00 + 2 -4.6585444014806898e-01 -3.8996461445571506e-02 -3.2323260039548940e-01 + 3 3.1997216218559658e-02 -9.3382881299397327e-02 1.0092600614548927e-01 + 4 6.0780843366829060e+00 -7.0646282962626561e+00 -7.4982698590670918e+00 + 5 -1.7898474281430651e-01 -1.4662087969829846e-01 -8.7800538042048182e-02 + 6 6.5620471824681045e-02 3.5461235127124308e-01 8.1618805435219655e-02 + 7 -1.7391500101344640e-01 -2.1476822500587228e-01 1.8206051134779128e-01 + 8 1.3067716008489303e-02 8.2854348073253203e-02 -1.1781900947957040e-01 + 9 1.2902200757315435e-01 -1.8959738359509407e-01 -3.6939713388993534e-01 + 10 3.4436398737776974e+00 2.4752313944487070e+00 2.5166231804136374e+00 + 11 -1.0455595771167953e+01 9.0156340161402841e+00 -8.0117576759878606e+00 + 12 9.1640376224294915e+00 1.0204761238346668e+01 9.3568782151482246e+00 + 13 1.0704585977181393e+01 -8.7190092304244811e+00 8.0242460008029717e+00 + 14 5.9343217316356061e+00 -1.0528730869042095e+01 7.7271004457007999e+00 + 15 8.5619079934829152e+00 -9.6435648093778035e+00 1.1695932034171493e+01 + 16 1.3046364678712294e+00 -1.1016201359936595e+00 -1.7924584057375171e+01 + 17 -1.0788024523157670e+01 -9.1528174563916203e+00 8.4222615356915629e+00 + 18 1.0379470863755569e-01 1.4551964977358189e-01 4.3944988255910572e-01 + 19 1.8491722532154103e-01 1.8810009833285282e-01 3.3906629833167146e-01 + 20 1.4594923074203495e+01 -4.6358944437181853e+00 -2.6258675441795578e+00 + 21 2.8492773719193365e-01 3.5707159420587720e-02 -4.9519914377954644e-01 + 22 7.6177571196667531e+00 -7.6887485504419768e+00 9.5693306324145357e+00 + 23 -1.4432062913267202e-01 6.2644281982544833e-02 -1.3264958463058721e-01 + 24 -5.2571038268868637e+00 -6.1209830718041820e+00 -6.2062915180121374e+00 + 25 6.0331452399142761e-02 -6.9961785546591160e-02 1.5040124260486523e-01 + 26 -1.0696132380460135e-01 -6.3408459972498915e-02 1.2554956130792608e-01 + 27 -2.1388834586513905e-01 4.1264499817987260e-01 -1.7861882981071631e-01 + 28 7.9678036782049420e+00 -5.6794002989366987e+00 -1.2921493397203195e+01 + 29 5.9430270816456549e-02 -4.0945000832191975e-01 3.9645664952520837e-01 + 30 -2.3337235191374223e-01 1.2470549461779287e-01 -9.9776727666456275e-02 + 31 -2.4230794063012479e-01 1.0589308457096010e-01 -1.1869990843345639e-01 + 32 -5.0531691362661890e-01 3.3079024650000011e-02 1.6233160967822235e-02 + 33 -8.4385535608272200e+00 9.9197322332678279e+00 -1.1618985044399611e+01 + 34 -4.9942517678960296e-02 -2.4927362794904512e-02 7.7321054502123648e-02 + 35 1.6576948916564360e-01 -9.3204073566442683e-02 3.1155839210123992e-01 + 36 8.0414627975626721e-02 -3.3293529942215655e-01 3.4054671116922418e-02 + 37 -2.3473658146215537e-01 3.0506458359448135e-01 -3.7054448750409141e-01 + 38 7.1207222697533268e-02 -5.2793955612526949e-02 -3.8049402841466295e-03 + 39 -6.0924931238061850e+00 7.3092543366779443e+00 6.9865167243739821e+00 + 40 -9.2885309568766967e+00 1.0920369865809439e+01 8.9387721737383572e+00 + 41 6.2984200739205414e-03 3.5745464132513579e-04 -1.1152519680436951e-01 + 42 2.4053765741763269e+00 3.2758512994878632e+00 3.1343857873595735e+00 + 43 -4.5633656610323028e+00 6.9840791850260917e+00 -5.8794048074545602e+00 + 44 -9.0490035471171222e+00 7.9795629779632966e+00 -1.0342754751076381e+01 + 45 5.7193949032941678e+00 -6.5487703049683104e+00 6.6889751628312801e+00 + 46 8.5670625044326183e+00 6.9124914743983501e+00 -1.1413800066051754e+01 + 47 -8.3782992126073541e-01 -9.1149492795826637e-01 -1.0348426992548085e+00 + 48 1.8125844069762900e-01 1.6520681240960194e-01 -9.0053759521286358e-02 + 49 8.7164445418712369e+00 9.8554140985796792e+00 1.1518515670135081e+01 + 50 1.7673202057378362e-01 3.5483188112494823e-01 -9.3642491667151051e-02 + 51 9.6668336902400522e+00 -1.0675001428495493e+01 -8.5336431017677388e+00 + 52 -7.7426252840805363e+00 7.5570997719589430e+00 -9.3872629815021202e+00 + 53 -8.5239759956545260e+00 -1.0180313030502525e+01 -1.1649022596466931e+01 + 54 -6.8416850815069514e+00 5.8989471754669536e+00 7.5176884904776680e+00 + 55 -9.8646410454487370e+00 1.0589224326779130e+01 8.8437417401656155e+00 + 56 -7.2455013061588163e-04 8.2160315157127489e-02 -3.1309996086554270e-01 + 57 1.0953215455690654e-01 -1.1326053238189515e-01 -6.2536861500771132e-02 + 58 3.0904234916490353e-01 -1.3188547005812687e-01 2.3740397563287958e-02 + 59 -1.1224676677205554e+01 -1.0614679778267396e+01 8.6793690663708354e+00 + 60 9.2682126131753559e+00 9.6754193854605788e+00 1.0306175937016986e+01 + 61 3.2996462070742472e-02 2.9577892247610060e-01 -1.0570949296657299e-01 + 62 1.6143228163705936e+00 -2.0089264459490273e+00 1.7462514157005347e+00 + 63 -9.6381029559787272e+00 7.7853452957962421e+00 1.1481951811124606e+01 + 64 -9.2030057932085843e+00 -1.0121970744042107e+01 -9.8408129956067629e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-meam_c.yaml b/unittest/force-styles/tests/manybody-pair-meam_c.yaml index 2f5051aba..6b70bc175 100644 --- a/unittest/force-styles/tests/manybody-pair-meam_c.yaml +++ b/unittest/force-styles/tests/manybody-pair-meam_c.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 23:07:41 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 1e-14 prerequisites: ! | pair meam/c @@ -84,73 +84,73 @@ init_forces: ! |2 62 9.9419545458636727e-01 -8.2884838986402398e-01 7.4103114940356063e-01 63 7.3533009035327668e-02 -7.0509323811366853e-01 2.4535215113611608e-01 64 1.3067722952287268e+00 1.7737090528979478e+00 8.9345357265121406e-01 -run_vdwl: -295.192088572395 +run_vdwl: -294.558633724134 run_coul: 0 run_stress: ! |- - -2.2175069951410873e+02 -2.2317205110225299e+02 -2.2431298874586093e+02 9.1048287816795401e+00 -9.4987002681423558e+00 7.6979617216741225e+00 + -2.2024934072613746e+02 -2.2214156836941581e+02 -2.2227662205685479e+02 7.5246892165404979e+00 -6.5974288946005712e+00 4.4471195201266918e+00 run_forces: ! |2 - 1 4.0670787446735868e-01 -1.0317711814184340e+00 -4.8319998345016724e-01 - 2 1.4759593569094511e+00 4.6982842117000434e-02 7.1830345725449940e-01 - 3 2.3480759213784119e-01 8.6204584235031745e-01 -8.5391363619286831e-01 - 4 -6.7546973314552616e-02 -9.8771183504212567e-01 -1.9249169481366923e-01 - 5 4.3825142164137021e-01 5.5931633306716466e-01 3.4081741963151058e-01 - 6 -3.6487422547644266e-01 -5.2754339584156673e-01 5.0992511084941183e-02 - 7 6.6690897017837036e-01 5.7275944657460887e-01 -1.2955879493279721e-01 - 8 2.7713316239026065e-01 -3.8536279368446280e-02 1.9761490773573187e-01 - 9 -7.0158407881916929e-01 -1.9280646516456101e-01 4.8167139468029985e-01 - 10 -1.0846682409841781e+00 -9.9199523947944535e-01 -3.3746144642664344e-02 - 11 -3.9320694116312449e-02 -5.2704213391571941e-01 9.8194476187464796e-01 - 12 -1.1089396806505385e+00 -1.3747931753813061e+00 -1.2961555310118085e+00 - 13 -1.5785311369733712e-02 -4.5826453800331457e-02 -2.1125704360691355e-01 - 14 -4.0865504150111331e-01 2.6105439977095857e-01 -4.5722577986388024e-01 - 15 -1.5898292365435873e-01 3.2863391146550536e-01 -3.2876446355573907e-01 - 16 5.8669555278132424e-01 6.3199106146143968e-01 1.2002624645092832e+00 - 17 1.0490808439491000e+00 2.9887016902694907e-01 -3.3987630426096538e-01 - 18 -6.5651864201479726e-01 -4.4199521745110326e-01 -4.7485137223301832e-01 - 19 6.3234749391731371e-01 -3.3153825172289109e-01 6.1833659992053658e-01 - 20 -1.8827986198407531e-01 2.6527256983383807e-01 4.8684718006195871e-01 - 21 -3.7648912787472466e-01 4.5747881641337318e-01 1.1211752468057790e+00 - 22 -9.1495997161823628e-01 1.5357454413521077e+00 -1.5355533494339799e+00 - 23 -3.8285685396373348e-01 -7.4607153529957304e-01 -8.5103672499051397e-01 - 24 4.5084850840267476e-01 -2.8967608822591862e-01 2.8343327070097735e-01 - 25 -1.3893818627685284e-01 1.6946175429543886e-01 -5.1150760827142427e-02 - 26 6.6027008865725645e-01 2.9645162761035426e-01 -4.7376603838074027e-01 - 27 -3.6833231098214902e-02 8.3279849745444823e-01 -6.5696629943074702e-01 - 28 -8.6689907665713650e-01 1.3766113990991706e+00 -6.2925780222148298e-01 - 29 3.5413448081855137e-01 -1.5602269160261484e-01 2.1986263282776308e-01 - 30 8.5930763892571349e-01 -5.7232098467301040e-01 3.5997121136899102e-01 - 31 9.0298102453414830e-01 1.8334465941372446e-02 7.0118153750028389e-01 - 32 1.1393594186395417e+00 -1.1583170456818115e-01 -4.2853254122168205e-01 - 33 3.5831939738229734e-01 -5.6637392326550717e-01 6.8389786528409546e-02 - 34 4.4675393762841575e-01 5.7798696320017084e-01 -3.4106479174381077e-01 - 35 -5.3063073909642267e-01 6.8658315257556879e-01 -9.9483095496847840e-01 - 36 -4.9792018759301682e-01 3.9689504644988061e-01 -3.6383934957630482e-01 - 37 5.7382920717186181e-01 -1.0787389193011254e+00 1.3132112013719162e+00 - 38 -7.2159973439426972e-01 1.8692808711749365e-01 4.4225877618024878e-03 - 39 -9.7844594334068891e-02 6.9555645079241391e-01 1.3763510669478296e+00 - 40 2.8563584691769295e-01 -1.1594348088174478e-01 -1.0394834800113810e+00 - 41 -1.7222005031601451e-01 -2.9678275127081055e-01 1.5288133173274843e-01 - 42 3.4089651598414750e-01 1.8804199608678873e-01 -1.1047299757353346e-01 - 43 4.8961516814554262e-01 5.0522492906426142e-01 1.3529511997000920e-01 - 44 5.4960028013981921e-01 2.3870790282120136e-01 1.2845603638499448e+00 - 45 -7.4159284414988891e-01 7.6685930111223488e-02 9.9901645574341114e-02 - 46 3.1165934066052614e-02 1.1077410226400164e-01 6.6216611523358160e-01 - 47 -6.9487648031240079e-02 3.0726564591924554e-01 -4.7192638248719754e-01 - 48 -4.1206355360291824e-01 -7.1607210522567111e-01 4.5841737826668472e-01 - 49 -2.1885876768473125e+00 -2.4666200850218156e-01 -1.4403722341613594e+00 - 50 -6.2144295975833552e-01 3.4828845296387745e-02 -2.6510782605044081e-01 - 51 -1.1017018273088635e+00 -9.4794074449890076e-01 7.6654042867465644e-01 - 52 1.1316397248602508e+00 -1.5418677953100532e+00 1.0873583295382621e+00 - 53 1.1577561275735100e+00 1.0133642434918864e+00 7.1961663012030486e-01 - 54 -2.1271350702614900e-01 2.1991781892438267e-01 4.1335847245509205e-01 - 55 6.2948849310516941e-01 -4.9708323079747485e-02 -3.9374687185917168e-01 - 56 -3.2456453651753758e-02 -2.4642212515486883e-01 5.9778614076612868e-01 - 57 -1.2432048121361294e-01 6.6116781349604881e-01 5.3573029862683130e-01 - 58 -6.0550808831042235e-01 3.3545789236889456e-01 -2.6819996734291918e-03 - 59 3.2551268193959926e-02 1.1731521362159365e+00 -2.3540455311268329e+00 - 60 -2.5102224117639156e+00 -5.5481673641129148e-01 -1.8307625442560351e+00 - 61 -3.9035759234080558e-01 -1.3709294657511926e+00 2.3825124625856176e-02 - 62 9.0959626763815526e-01 -7.7535279401241142e-01 6.5230949186998721e-01 - 63 1.3688789168094173e-01 -7.6162995229896358e-01 8.7931301548221485e-02 - 64 1.3342729822750883e+00 1.7183762238898637e+00 8.3317181713894350e-01 + 1 4.3452465086584469e-01 -1.0945333980647431e+00 -5.5786376695317075e-01 + 2 1.5220588924927005e+00 -1.3986251140694628e-02 6.7808961564634496e-01 + 3 1.1052587565590377e-01 8.2228299338183763e-01 -6.9700688851748760e-01 + 4 -4.9399124477889522e-02 -1.0068360020978067e+00 -2.7372309926487004e-01 + 5 3.4139452948067062e-01 5.0843563812438108e-01 4.2646098072755256e-01 + 6 -2.9716513421464674e-01 -5.8896160048269008e-01 9.5560022245065879e-02 + 7 6.6260694149143751e-01 6.3409905315494619e-01 -1.0080120533437875e-01 + 8 1.8137781354975258e-01 -1.5786692098663346e-02 1.4872177429995093e-01 + 9 -7.4027128611433790e-01 -2.0510444951848517e-01 5.4079644743290922e-01 + 10 -1.1994738019611777e+00 -1.1031903695311243e+00 -1.6817033590853070e-01 + 11 1.5657955522260147e-01 -7.9133410135304305e-01 1.1851434415481910e+00 + 12 -2.0645190669711972e+00 -2.2922503904723355e+00 -2.1046221472555295e+00 + 13 -1.1810561085848614e-01 2.2297324766964288e-01 -4.0429809793494664e-01 + 14 -4.1514641426175791e-01 4.0190997298738185e-01 -4.0640886472517734e-01 + 15 -5.5391298085295659e-01 7.6728773499384861e-01 -7.6270402438966856e-01 + 16 1.0482738691476128e+00 1.1200629533692354e+00 2.3441229312558356e+00 + 17 1.4225259063721245e+00 6.6296077595642089e-01 -6.7423073311524229e-01 + 18 -6.4073603089820241e-01 -4.4255400997938188e-01 -3.1592145610204758e-01 + 19 7.0465604556845718e-01 -2.3033016536294171e-01 7.7396619519799192e-01 + 20 -3.0839238257620005e-01 5.1246836315631161e-01 6.9864342908263122e-01 + 21 -3.3010834475886752e-01 4.1178116953648392e-01 1.1593004082866951e+00 + 22 -3.1545587416310101e+00 3.7020803028849509e+00 -4.1208189214189925e+00 + 23 -5.5578547446697724e-01 -7.7518145073340738e-01 -9.6414236431708700e-01 + 24 4.6543837497534057e-01 -4.1497851297918120e-01 1.7020657399840444e-01 + 25 -1.1495350713117891e-01 1.7471309689149417e-01 -9.1820304967749289e-02 + 26 6.4418091202983563e-01 3.9511331082869605e-01 -4.6697054210720612e-01 + 27 -1.0846150249653452e-01 9.5354759711906545e-01 -7.6761371784363797e-01 + 28 -9.7331798896118671e-01 1.3615831040056061e+00 -8.1646862746384441e-01 + 29 5.2393841183805301e-01 -2.2160391458387740e-01 2.0959556726547079e-01 + 30 8.5843494015838306e-01 -5.6615752211252635e-01 2.9598938581781686e-01 + 31 8.7672200072231521e-01 1.2117860630118660e-03 6.9516773038115587e-01 + 32 1.1579346519623381e+00 -1.0250303446435005e-01 -4.4394251575667931e-01 + 33 9.6230350458621738e-01 -1.0448973232565306e+00 4.0765725423140586e-01 + 34 3.9838100379924546e-01 5.2651426984266814e-01 -3.1607343672648058e-01 + 35 -6.2092589925911246e-01 7.3862449667072760e-01 -1.1041752991798581e+00 + 36 -5.5041331355524292e-01 4.7375401634005843e-01 -4.4719416714071358e-01 + 37 6.0618235646078555e-01 -1.1557081593181864e+00 1.3389674516205603e+00 + 38 -6.3287646686230081e-01 1.7206932687817900e-01 1.0914563244259567e-01 + 39 -1.4380396331190570e-01 7.3740142880855197e-01 1.3799115316232256e+00 + 40 1.2621802276199912e-02 1.8413932633669705e-01 -8.7625781338848818e-01 + 41 -2.8523084442296787e-02 -1.8292088837759213e-01 2.6181629687055885e-01 + 42 3.7423303514029604e-01 2.8042204981507646e-01 -8.2471991270785416e-02 + 43 5.9448610275648162e-01 3.4823906941033811e-01 2.6930569341244048e-01 + 44 6.3059313815601792e-01 1.8879588409183512e-01 1.3158037405375627e+00 + 45 -9.0918981829422574e-01 7.8881682789835983e-02 -7.9558078154380318e-03 + 46 6.0933412752175453e-03 4.7189523191030203e-03 7.8803262062509238e-01 + 47 1.2260134746182594e-03 3.8246834047918621e-01 -5.0858456799945184e-01 + 48 -3.9621498867331617e-01 -7.2473208678693712e-01 4.8121547532646503e-01 + 49 -1.8849302422722727e+00 1.1198269911956826e-01 -1.0661635184217491e+00 + 50 -5.9667461587312465e-01 3.5716118940609332e-02 -2.5573210011839365e-01 + 51 -8.3343796529454084e-01 -1.2142623417859424e+00 5.0733971207385054e-01 + 52 3.4537909157309157e+00 -3.8066504322690005e+00 3.7233142963903947e+00 + 53 8.5533270871773004e-01 8.5727355046111264e-01 3.5401784959397786e-01 + 54 -2.2920044052370425e-01 3.1771446322476016e-01 4.8090928070572314e-01 + 55 7.7272006266430227e-01 -2.7163745794920269e-01 -5.2844056142703710e-01 + 56 -1.7852005957443495e-01 -3.2497408343531364e-01 5.8001704749144523e-01 + 57 -2.0159418419778197e-01 6.6492607828266337e-01 4.5764759442739056e-01 + 58 -5.7426787819324043e-01 3.6928338155668039e-01 -1.0608622641294263e-01 + 59 1.6548612502914883e-01 1.1779666609314898e+00 -2.5310831474375077e+00 + 60 -2.6448273642755424e+00 -7.8499146601288428e-01 -2.0008921705878748e+00 + 61 -3.8203907252351632e-01 -1.2514761655763555e+00 1.1780362295062474e-01 + 62 9.9601403717300108e-01 -8.3291553584528155e-01 7.3916116198964987e-01 + 63 8.3353248392163515e-02 -7.1914822540410928e-01 2.3368052722469845e-01 + 64 1.4077559825934538e+00 1.8762031345701322e+00 1.0011271285792889e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-mliap_snap.yaml b/unittest/force-styles/tests/manybody-pair-mliap_snap.yaml index a45d7a8f4..b2070e73a 100644 --- a/unittest/force-styles/tests/manybody-pair-mliap_snap.yaml +++ b/unittest/force-styles/tests/manybody-pair-mliap_snap.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 5e-13 prerequisites: ! | pair mliap @@ -86,73 +86,73 @@ init_forces: ! |2 62 -6.2693637951458694e+00 5.5593866650560679e+00 -4.0417158962655781e+00 63 5.8570431431678962e+00 -6.2896068000076317e+00 -3.8788666930728688e+00 64 7.5837965251215369e+00 7.5954689486766096e+00 1.6804021764142011e+01 -run_vdwl: -489.468066110652 +run_vdwl: -473.666568306022 run_coul: 0 run_stress: ! |2- - 3.7167872895847819e+02 3.7917710068041862e+02 4.0385320198584714e+02 -1.3691599706785452e+01 9.5517308985477115e+01 9.7589276560912452e+00 + 3.9951053758431499e+02 4.0757094669497650e+02 4.3599209936956868e+02 -2.5012844114476398e+01 1.2751742945242590e+02 3.9821818278564844e+00 run_forces: ! |2 - 1 -2.6200062192163251e+00 6.5895070779555507e+00 5.6608861291961521e+00 - 2 -6.0189354199893055e+00 -5.0918745113944741e-01 -5.3313245647285701e+00 - 3 -8.3868957617449347e-01 -8.8585183150038882e-01 2.9968107645220203e+00 - 4 -3.0213465402043513e+00 6.9725231357285278e+00 2.1167504663792536e+00 - 5 -1.7586848423194312e+00 -3.2933741468811113e+00 -9.3080751290253794e-01 - 6 2.2991165379551211e+00 3.3795036971656218e+00 2.2660197467514911e-01 - 7 -2.0012695381123020e+00 -2.5159443018298786e+00 6.2116996571724714e-01 - 8 -5.4873779786282280e-02 1.5854566692139420e+00 -1.0066392618014335e+00 - 9 8.0189242689618823e-01 -3.0847017825088381e+00 -6.9542340364711075e+00 - 10 -8.9128976791778458e-01 -6.7393019870592596e-02 -3.2723844475537232e+00 - 11 4.5456393443054912e+00 -4.5148464719144190e+00 2.1620709337139968e-01 - 12 -1.0605260639103395e+01 -3.7437284480399846e+00 -4.2782571870680677e+00 - 13 -4.8758021083010261e-01 1.0840591566757563e+01 1.4417301279067696e-01 - 14 -2.8043941505268610e+00 6.4438899074280922e+00 1.6101766369425605e+00 - 15 -5.6397727632249364e+00 5.8479631324846277e+00 -5.1195271857482449e+00 - 16 2.6358192742443949e+00 1.7064832375903805e-01 1.0429654093017419e+01 - 17 2.6492424666949290e+00 4.1865915382220376e+00 -9.0595086171557835e+00 - 18 1.1206473927093965e+00 2.2123081794070867e+00 5.8589201221087297e+00 - 19 -2.7367744247531407e+00 -8.2975485638465030e-01 -2.0790334392182506e+00 - 20 -1.2201950287425824e+01 8.9293356122790912e-01 -6.4486216284160913e-01 - 21 3.4454631697777547e+00 -7.8278081568080715e-01 -9.0435968147049834e+00 - 22 -9.9116182027989090e+00 3.7537117149502626e+00 -6.2041013601325021e+00 - 23 2.3598327627157216e+00 4.6653030563297371e+00 6.1390590162436629e+00 - 24 2.9885018662473075e+00 2.9838762041793117e+00 4.3228545839763353e+00 - 25 6.1001404235465873e-01 -1.1881822928224506e+00 1.5040997261686755e+00 - 26 -1.8763705008872589e+00 -1.2599849620161696e-01 6.2992383249894968e-01 - 27 3.2706304707445661e+00 -1.9852603643313311e+00 4.2180376607986316e+00 - 28 -3.1071530373299328e-01 1.5750530088540251e+00 9.6837465049814817e+00 - 29 -6.1417582599413301e+00 3.9164321009855735e-01 9.7685688363955525e-02 - 30 -3.1388355174211173e+00 1.6122297260129073e+00 -1.1081505352088683e+00 - 31 -2.6098520190441956e+00 2.2795861569825959e-01 -2.7458401111959434e+00 - 32 -6.1422237837124225e+00 -5.1210288634460155e-01 5.4514825686867430e-01 - 33 7.4141036509796692e+00 -2.7884535553661660e+00 6.2033448623898559e+00 - 34 -1.4244505798620721e+00 -3.3429770690737826e-02 1.9184700282588758e+00 - 35 1.5632007556515113e+00 -9.5418452153127342e-01 4.1257737822747131e+00 - 36 1.2821238454090218e+00 -3.9489216486981342e+00 -8.6269270447002055e-01 - 37 -2.7537235028447835e+00 4.6513692386669439e+00 -5.6290489372162664e+00 - 38 1.9992052623036176e+00 -4.2983333004702118e-01 -1.0733048030046968e+00 - 39 2.1765892902345501e+00 -3.8586421759387579e+00 -9.0645286263473626e+00 - 40 7.4374269075019228e+00 -4.3433135301581780e+00 -4.0455383168563580e-01 - 41 1.0342805569134947e+00 1.6523945993277380e+00 -1.5772104911434006e+00 - 42 -8.1195815614370144e+00 -5.8763972130775510e+00 -3.1222551004416625e+00 - 43 -2.7912198462705129e-01 -1.1167330547751890e+01 -6.3698536543297893e-02 - 44 6.9463399563146941e+00 -6.4872117822671056e+00 1.0874644094280277e+00 - 45 3.0267523524516771e-01 2.2378774625062920e+00 -4.7768000279857024e+00 - 46 -2.2570016757486311e+00 -4.0040746828789402e+00 9.8689525243895062e+00 - 47 4.2785305080294540e+00 1.5325832230443668e+00 3.3589203411901578e+00 - 48 2.2413400699812387e+00 3.3580569902180790e+00 -1.2661375290157233e+00 - 49 -1.1421201760383113e+00 -1.0752096896646723e+01 -6.5722133309475623e+00 - 50 3.4180454936299673e+00 5.0411589857253736e+00 -5.8332155561548138e-01 - 51 -1.7223504936879914e+00 9.2697024243389734e+00 7.0442106476591251e+00 - 52 8.0098592133005564e+00 -5.9122394581044277e+00 1.0101406704527049e+01 - 53 3.4161226658911734e+00 5.7780690168335065e+00 4.1927204150859252e+00 - 54 2.4972457061023663e+00 -3.7172022065563901e+00 -2.6131222195234471e+00 - 55 2.5539298626493641e+00 -5.6377686174334087e+00 -3.5151115361687237e+00 - 56 5.1189498205615180e-01 1.1342419773973278e+00 -4.2814131693243027e+00 - 57 2.1690816717712811e+00 -1.3704555520632908e+00 -6.0759785348037931e-01 - 58 4.3539661764216397e+00 -1.4572581960607027e+00 -9.9173296914445030e-01 - 59 6.7962624211316545e+00 2.0240756728926979e+00 -8.0188277109816075e-01 - 60 -2.3372986868253900e+00 -1.1397492261021371e+01 -7.3457073057764761e+00 - 61 1.1003078657122005e+00 3.5366731859023495e+00 -1.4254057900337883e-01 - 62 -5.1368600009373075e+00 3.5663926174152012e+00 -2.2708852648200115e+00 - 63 4.4200660412946746e+00 -4.6975137723775120e+00 -2.5446183902678694e+00 - 64 4.3353125159604282e+00 4.7586391643778274e+00 1.2965475525931360e+01 + 1 -3.7832595710893155e+00 8.8212124103655292e+00 6.7792549500694745e+00 + 2 -7.6693903913873163e+00 -4.4331479267505980e-01 -5.8319844453604492e+00 + 3 -3.5652510811236748e-01 -1.2843261396638010e+00 2.3164336943032460e+00 + 4 -4.6688281400123417e+00 9.2569804046918627e+00 4.2532553525093961e+00 + 5 -2.0698377683688305e+00 -3.0068940885360655e+00 -1.5557558367041349e+00 + 6 1.9121936983089021e+00 4.6485144224151016e+00 3.8302570899366983e-01 + 7 -3.0000564919294019e+00 -3.9598169423628935e+00 1.4730795882443171e+00 + 8 2.2616298546615310e-01 1.3160780554993146e+00 -1.1365737437456360e+00 + 9 4.5475496885290934e-01 -3.0115904820513633e+00 -7.6802788934953448e+00 + 10 -6.5754023848348220e-01 4.3910855294922169e-02 -5.2814927356947416e+00 + 11 8.0870811363765238e+00 -6.6478157150338770e+00 2.5239196033647513e+00 + 12 -1.4266979871278297e+01 -7.9890391049193692e+00 -7.6506348180232058e+00 + 13 -3.0605842642063994e+00 1.3809674690005217e+01 -1.6731082107132822e+00 + 14 -3.0058694850615257e+00 8.5169039650285132e+00 1.8498544937038552e-01 + 15 -8.6057398167379340e+00 9.1431278151038597e+00 -9.5164336499508586e+00 + 16 3.7105123804670184e+00 1.9684880085511294e+00 1.5628485674431591e+01 + 17 5.0446625217738115e+00 6.1086935560886335e+00 -1.0684670022014132e+01 + 18 1.6342572076662352e+00 3.0978003138559700e+00 7.3023410755539730e+00 + 19 -2.9853538081785418e+00 -1.1736228416330263e+00 -2.8772549755196275e+00 + 20 -1.6354717680325663e+01 2.4069036913441169e+00 2.5852528541413577e-01 + 21 3.9596059647558470e+00 -1.1309140461374385e+00 -9.2411865520092746e+00 + 22 -1.5578599385494211e+01 8.8837889458923414e+00 -1.2717012806950681e+01 + 23 2.9286474436436607e+00 5.4115499463398438e+00 7.4875237575502283e+00 + 24 3.2309052666659346e+00 4.6724691716691664e+00 6.3076914533727404e+00 + 25 8.7447853599857761e-01 -1.4447800235404800e+00 1.6369348219913344e+00 + 26 -1.8229284577405889e+00 -3.3721763232208768e-01 6.1531223202321172e-01 + 27 4.3482945496099807e+00 -2.9274873379719288e+00 5.2404893120488989e+00 + 28 -7.6160360457911214e-01 1.1530752576673735e+00 1.3094542130299224e+01 + 29 -6.6257114998810200e+00 1.6523572981586176e+00 -1.0670925651816274e+00 + 30 -3.6586042068050459e+00 2.0111737944853250e+00 -1.5501355511382873e+00 + 31 -3.1601602861552482e+00 3.3256891161094693e-01 -3.0724685917071382e+00 + 32 -7.8275016718590731e+00 4.4236506496773642e-01 8.3868054333668041e-01 + 33 1.0688722918141039e+01 -5.7920158261872583e+00 9.6923706747923646e+00 + 34 -1.3525464452783258e+00 -1.0575652830645854e-01 1.6380965403350563e+00 + 35 2.5193832475087721e+00 -2.2598987796878789e+00 5.6810280412635601e+00 + 36 1.7111787089042565e+00 -4.4473718671663391e+00 9.6398513850121076e-02 + 37 -3.8563809307986823e+00 5.6131073606614059e+00 -6.6177968130852260e+00 + 38 1.5064516388374909e+00 -3.1694753678232956e-01 -8.3526359314898979e-01 + 39 4.1314418694153812e+00 -6.2751004763663678e+00 -1.1210904504268449e+01 + 40 9.5830290785144836e+00 -7.0395435048262769e+00 -1.6267459470122683e+00 + 41 3.1375436243120802e-01 1.0622164383329200e+00 -2.2467935230672076e+00 + 42 -9.4881290346220375e+00 -6.3542967900678029e+00 -3.7436081761319060e+00 + 43 2.2855728522521823e-01 -1.3797673758210431e+01 5.1169123226999269e-01 + 44 8.0135824689800454e+00 -8.1618220152116709e+00 3.4767795780208774e+00 + 45 -2.2793629160624870e-01 3.8533578964252726e+00 -7.3720918772105994e+00 + 46 -3.5217473183911405e+00 -5.1375353430494126e+00 1.2535347493777751e+01 + 47 5.1244898311428937e+00 2.3801653011346930e+00 5.1114297013297003e+00 + 48 2.1906793040748171e+00 3.0345200169741182e+00 -1.0179863236095192e+00 + 49 -2.4788694934316329e+00 -1.2411071815396923e+01 -8.4971983039341392e+00 + 50 3.6569038614206466e+00 5.6055766933888798e+00 -7.2525721879624516e-01 + 51 -3.1071936932427051e+00 1.1143003955179145e+01 8.9003301745210983e+00 + 52 1.2953816665492676e+01 -1.1681525536724189e+01 1.6495289315845085e+01 + 53 5.8923317047264643e+00 7.6559750818830006e+00 5.7413363341910788e+00 + 54 4.6456819257039355e+00 -5.7613868673147293e+00 -4.6785882460677595e+00 + 55 4.9036275837635479e+00 -8.4131355466563491e+00 -6.4652425471547437e+00 + 56 -2.5919766291264371e-02 1.4942725648609447e+00 -5.1846171304946838e+00 + 57 2.1354464802186661e+00 -1.3197172317543322e+00 -8.9084444403811647e-01 + 58 5.2496503717062382e+00 -2.5023030575014631e+00 1.2534239362101771e-01 + 59 9.1088663289515797e+00 4.2501608997098561e+00 -1.8293706034164023e+00 + 60 -5.2377119984886820e+00 -1.5252944642880552e+01 -9.9884309435445626e+00 + 61 9.8418569822230928e-01 3.6718229831397404e+00 -7.9620939417097958e-01 + 62 -6.2529671270584286e+00 5.5348777429740972e+00 -3.9890515783571203e+00 + 63 5.8510809377900035e+00 -6.3420520892802621e+00 -3.9437203585924383e+00 + 64 7.6647749161376320e+00 7.7322248465188412e+00 1.6865884297614787e+01 ... diff --git a/unittest/force-styles/tests/manybody-pair-mliap_snap_chem.yaml b/unittest/force-styles/tests/manybody-pair-mliap_snap_chem.yaml index e4719e6eb..5b6303adc 100644 --- a/unittest/force-styles/tests/manybody-pair-mliap_snap_chem.yaml +++ b/unittest/force-styles/tests/manybody-pair-mliap_snap_chem.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:30 202 epsilon: 5e-13 prerequisites: ! | pair mliap @@ -90,73 +90,73 @@ init_forces: ! |2 62 -2.7862663394350542e+00 2.5876139756856791e+00 -1.7815179130043122e+00 63 2.4339134295594302e+00 -3.1961735689987636e+00 -4.7891394265908094e-01 64 3.0382364587319710e+00 3.0430454898558588e+00 5.3416679902175384e+00 -run_vdwl: -187.654391839485 +run_vdwl: -185.37158003654 run_coul: 0 run_stress: ! |2- - 2.1286434186597302e+02 2.1516140376524692e+02 2.2014270591458137e+02 -4.1189309434634733e+00 2.5671737667284511e+01 3.4094574165486393e+00 + 2.1623225685916989e+02 2.1844347630762962e+02 2.2331780542890360e+02 -5.3222115188692429e+00 2.9861519391528514e+01 1.4556702426797457e+00 run_forces: ! |2 - 1 -7.3369133823405508e-01 2.7667970855721853e+00 1.6328050345720810e+00 - 2 -2.2299658853721520e+00 -7.5585568905659906e-01 -1.5309002377019634e+00 - 3 2.8912410060639326e-01 4.3705738858658788e-01 -2.1722808227078966e-01 - 4 -1.6432999484262196e+00 2.7237882915593286e+00 4.6054246395477511e-01 - 5 -1.9915642544829795e+00 -5.0514454245912743e-01 -2.4023101827231930e-01 - 6 3.1580339744901642e-01 2.2624378988705485e+00 1.0700232878883544e+00 - 7 -4.3667900724170972e-01 -4.6326888074447953e-01 1.8815161287461792e+00 - 8 4.0891558557492069e-01 9.8444761132021874e-01 -1.1994011642190259e+00 - 9 -3.9943153478795002e-01 -2.2209279455737700e+00 -2.5915912103444558e+00 - 10 -1.9471351965318257e-01 -1.4496690804153802e+00 -2.2623893657434899e+00 - 11 2.4362905726150652e+00 -2.3810030225467518e+00 1.8905835689476458e+00 - 12 -4.8961713945288103e+00 -2.6394975897948498e+00 -2.0372233198924383e+00 - 13 1.3378868571704172e-01 4.5775961871578881e+00 -9.1227708328468249e-01 - 14 -1.5297526207810275e+00 3.0522662572662154e+00 4.9107580456119410e-01 - 15 -2.6765425425933294e+00 3.8247215679834969e+00 -2.5375795218582073e+00 - 16 1.5196290196835527e+00 -3.2914146438878389e-01 4.1849431488039173e+00 - 17 2.0043578760825342e+00 2.8234226231079935e+00 -2.9923076186199422e+00 - 18 -5.0347976264338057e-01 8.8149323898758736e-01 2.9370157524159062e+00 - 19 -1.4078018510609827e+00 -2.2820746919860544e+00 -3.7825546052719117e-01 - 20 -5.3044185428231128e+00 -5.5789399083648994e-02 4.5964111618433973e-01 - 21 1.4678310024890862e+00 1.7118675240827930e-01 -2.7319662502952067e+00 - 22 -4.2798753174007294e+00 3.0607656650226120e+00 -3.9192708818666375e+00 - 23 1.8070160916189431e+00 2.8893260418555093e+00 1.4715768249778458e+00 - 24 1.7943331384890695e+00 5.6727833662928906e-01 2.4453386937887558e+00 - 25 9.4127417840102234e-01 -3.2082226320611557e-01 1.0317887157557444e+00 - 26 -4.7367357683060307e-01 -2.6670219998362305e-01 8.5910453505400930e-01 - 27 1.9119897296615520e+00 -3.9246942513009325e-01 1.2080897134422011e+00 - 28 1.8999192393940639e-01 1.6499913470409528e+00 3.7514920356690027e+00 - 29 -2.7287724915818705e+00 7.5140952246304560e-01 -7.1978618410778783e-01 - 30 -1.6121881543481549e+00 4.7145279745822877e-01 -9.4382533006887581e-01 - 31 -6.9302105329788111e-01 8.6622808992775768e-01 -7.1688447301762359e-01 - 32 -2.1877722619109319e+00 3.1241022059139389e-01 -2.0363529214606557e-01 - 33 3.7351462993820110e+00 -2.1144175359802810e+00 2.6418390367829683e+00 - 34 4.3814257629996645e-01 1.4381263658420229e-01 1.5892319607512340e-01 - 35 1.2481610501512843e+00 -1.4422631315933609e-01 2.3732508438175173e+00 - 36 -4.1515332308320585e-01 -2.0958691183365055e+00 -6.0782500168498454e-01 - 37 -1.8737832564668855e+00 1.5868160141680505e+00 -2.1502811274719518e+00 - 38 -8.3799314060681018e-01 -1.1168329368636831e-01 7.5420009101163310e-01 - 39 2.4623601668269162e+00 -1.3731570495025482e+00 -3.1300208221580803e+00 - 40 4.2396805048038360e+00 -1.9896514878251754e+00 -1.6439304927095424e+00 - 41 4.5291426717441341e-01 -2.1649648555890380e-01 -1.0103115219148229e+00 - 42 -3.4063198353810029e+00 -1.7197481999679392e+00 -7.1574757576947756e-01 - 43 6.7969745762235023e-01 -4.4139560697511868e+00 -7.1374160410199727e-02 - 44 2.9022254223989670e+00 -3.0658233607366547e+00 1.4095258293816717e+00 - 45 -1.8021584516545361e+00 1.1139426059206650e+00 -2.3612665451280646e+00 - 46 -6.4055392057875404e-01 -1.5437936507527419e+00 4.7629947723944071e+00 - 47 2.4596732256156768e+00 1.3839195366764612e+00 1.4983351229907538e+00 - 48 1.4286951465559077e+00 2.5226997121023853e-01 -3.1703206977278775e-01 - 49 -2.4980250315840102e+00 -4.2937298563437425e+00 -2.7685866462265776e+00 - 50 2.3859148339052538e-01 2.5999038034992465e+00 -1.1882197967404982e+00 - 51 -1.8541927042572155e+00 2.5220449582545057e+00 3.6251170038994069e+00 - 52 4.0017526007315176e+00 -3.9563125820844278e+00 4.1997432909076782e+00 - 53 2.9944010593604022e+00 3.2831372076580596e+00 2.6928034831187952e+00 - 54 1.5871022597839066e+00 -2.8228944858891349e+00 -1.9576122929926079e+00 - 55 6.8049238759975672e-01 -2.2839449322075804e+00 -2.6675101357177540e+00 - 56 -1.1904103145927025e-01 -4.1523795497197880e-01 -1.6223721062486278e+00 - 57 -1.3403241451059258e-01 -1.1130134152852764e+00 -1.0367473155144330e-01 - 58 2.4136361939725450e+00 -9.4464777619607920e-01 1.2128229032096651e+00 - 59 2.7939168112815209e+00 2.0644797911549650e+00 -2.2194096868290583e+00 - 60 -2.2516089079596044e+00 -4.9525359014312329e+00 -2.6471467342704211e+00 - 61 -9.1969687435720560e-01 1.4906668816471620e+00 -9.1416116187655894e-01 - 62 -2.5974358252612539e+00 2.3448472464785919e+00 -1.4775087114289542e+00 - 63 2.3319640999455080e+00 -3.2577489670850337e+00 -4.7807587290002385e-01 - 64 2.9639114599347880e+00 3.0313370540601499e+00 5.0817272896875831e+00 + 1 -8.9945686093718891e-01 3.1102506844270676e+00 1.7924405901882392e+00 + 2 -2.3568426321865519e+00 -7.2157123823439751e-01 -1.5714999679660120e+00 + 3 5.9411461824307632e-01 2.8183072295935307e-01 -4.5584602006848729e-01 + 4 -2.0142955850044015e+00 2.9566870880684544e+00 9.5256971160575310e-01 + 5 -1.9922574807409990e+00 -4.3135288450095111e-01 -3.7982056237068562e-01 + 6 -5.1798692305348421e-02 2.3723138325448181e+00 9.3505820052018818e-01 + 7 -5.9119307570788093e-01 -7.7558353156540627e-01 2.1544553310334216e+00 + 8 5.8948882611514830e-01 1.0627350289336350e+00 -1.2852382666540922e+00 + 9 -3.3097669603148050e-01 -2.0880700958311560e+00 -2.5728226298711561e+00 + 10 -1.9927857234351742e-01 -1.4707681067903973e+00 -2.8077583365509944e+00 + 11 3.1207021637041077e+00 -2.8777137799483214e+00 2.2513409071418939e+00 + 12 -5.3967388032136201e+00 -3.2755306245890572e+00 -2.5607263918480787e+00 + 13 -5.6089163267500575e-01 5.0895164624360953e+00 -1.2955340742015935e+00 + 14 -1.4424532600588069e+00 3.3397136313988538e+00 4.5056661625381278e-01 + 15 -3.1074264051087690e+00 4.4511163568785594e+00 -3.2255959617646495e+00 + 16 1.7028459742310051e+00 -1.9401543199346183e-01 4.9988885414419002e+00 + 17 2.3696411307116665e+00 3.0980579975818054e+00 -3.3992055709392099e+00 + 18 -2.7992627916472068e-01 7.5956985532908217e-01 3.0731406281977875e+00 + 19 -1.3087170031025481e+00 -2.2579241841048194e+00 -3.5423832115910026e-01 + 20 -5.9291180532530054e+00 3.0139344848989125e-01 6.6702127138861189e-01 + 21 1.4061702325656915e+00 3.6170742151671309e-01 -2.6186453774142455e+00 + 22 -5.1213538363270104e+00 3.6881133786353173e+00 -4.8334441466973619e+00 + 23 1.7799014438457179e+00 2.9383932016836729e+00 1.4889345853939060e+00 + 24 1.6265217601475135e+00 8.8638236910287549e-01 2.7958579602051579e+00 + 25 1.0261772589787777e+00 -4.3124823838990639e-01 1.2394756760658081e+00 + 26 -3.6788963153370424e-01 -3.8430715508218222e-01 8.2234939362562109e-01 + 27 1.9227116387813055e+00 -3.1924343057968851e-01 1.2219662551930728e+00 + 28 2.3558028807578302e-01 1.4603195758319958e+00 4.1124437707751715e+00 + 29 -2.7963204027225057e+00 7.9250484371162710e-01 -8.2374097886304931e-01 + 30 -1.8521850555057384e+00 6.8904513184563698e-01 -9.2377203073191461e-01 + 31 -7.0737710488564920e-01 8.7160390581421554e-01 -7.5132187044876142e-01 + 32 -2.3972194269400724e+00 4.0579824422398403e-01 -1.2192450250956055e-01 + 33 4.3391252363949713e+00 -2.6734632549855011e+00 3.1813837430923790e+00 + 34 5.0892540867377134e-01 1.3196433190574863e-01 9.1854393014863867e-02 + 35 1.2518949422589467e+00 -4.0131662341328833e-01 2.5682121097610247e+00 + 36 -1.4250724827861927e-01 -2.2940369352156500e+00 -2.7656165676472910e-01 + 37 -2.1638911011422111e+00 1.9200057202539940e+00 -2.2495537548075712e+00 + 38 -9.8448646953871100e-01 -1.7353311784227321e-01 6.9784505363718075e-01 + 39 2.8621020667478243e+00 -1.7235695529844155e+00 -3.4231784253086803e+00 + 40 4.3701211996432816e+00 -2.2721992461764238e+00 -1.7277010563698145e+00 + 41 2.7615064013020879e-01 -3.9976618325080288e-01 -1.2290534994924236e+00 + 42 -3.5411751645812308e+00 -1.6301898139986259e+00 -6.9693956624465969e-01 + 43 8.3282307590551552e-01 -4.8791394930408867e+00 1.5641553921436965e-01 + 44 3.0588569737321962e+00 -3.3230712362593824e+00 1.7740893109825144e+00 + 45 -1.8543980101593716e+00 1.5090063048017774e+00 -2.7391343400007346e+00 + 46 -9.0836218859416373e-01 -1.7703257020194161e+00 5.0074804595763203e+00 + 47 2.6157347327468776e+00 1.6066618984181202e+00 1.5922002611321855e+00 + 48 1.4730694115534324e+00 6.0150682431382663e-02 -2.9959320813488199e-01 + 49 -2.4357178268972279e+00 -4.2752924255184093e+00 -2.8456954906038585e+00 + 50 2.5008857416428043e-01 2.7975929070952108e+00 -1.0870819292025393e+00 + 51 -1.8364703217563023e+00 2.6546000140944859e+00 3.7824174449012462e+00 + 52 4.6470415706761310e+00 -4.8541726113169865e+00 5.0978546929624020e+00 + 53 3.0332748609694704e+00 3.3674028164180130e+00 2.5018294078539540e+00 + 54 1.8687605158732028e+00 -3.0896400645801418e+00 -2.2872620802274950e+00 + 55 1.1194011524426077e+00 -2.5850952550361570e+00 -3.2174616299206584e+00 + 56 -1.2168319727714011e-01 -1.1667111392940022e-01 -1.7915767087323147e+00 + 57 -1.3228227178289417e-01 -9.1363578630224795e-01 -5.3462423971004584e-02 + 58 2.4842158694223677e+00 -1.2568730326784874e+00 1.5401682371106145e+00 + 59 3.0140102195799274e+00 2.1895971720503873e+00 -2.3881807893321017e+00 + 60 -2.2877466661828931e+00 -5.2803433601364151e+00 -2.7505525589065760e+00 + 61 -1.0115642352983962e+00 1.5284330358705578e+00 -1.0029499332563923e+00 + 62 -2.7811684029592287e+00 2.5821146485313546e+00 -1.7679954771137567e+00 + 63 2.4383789403708427e+00 -3.2264210802804598e+00 -5.0624191626484460e-01 + 64 3.0873388675112903e+00 3.1015018772904330e+00 5.3730513624445901e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-nb3b_harmonic.yaml b/unittest/force-styles/tests/manybody-pair-nb3b_harmonic.yaml index bd33af6f1..270af9018 100644 --- a/unittest/force-styles/tests/manybody-pair-nb3b_harmonic.yaml +++ b/unittest/force-styles/tests/manybody-pair-nb3b_harmonic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:31 202 epsilon: 1e-12 prerequisites: ! | pair nb3b/harmonic @@ -87,73 +87,73 @@ init_forces: ! |2 62 4.1476164742574909e+01 -9.7738882325904193e+00 2.2124574239200477e+01 63 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 64 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 -run_vdwl: 2496.16387090594 +run_vdwl: 2654.82171289438 run_coul: 0 run_stress: ! |- - -3.1050965336039717e+01 -6.3663930994023112e+01 9.4714896330062459e+01 -1.1897654655567709e+02 -6.4811369677397606e+00 1.2347862730997616e+02 + -5.1017319806446963e+01 -1.3611444901522319e+01 6.4628764707970163e+01 -8.7135896922470280e+01 -1.1070430113320975e+02 7.5452229912420606e+01 run_forces: ! |2 - 1 -6.6214436114187283e+00 6.8003032240473571e-01 8.1610480878961977e-01 - 2 6.8952756210408728e+00 6.9800495995491776e+00 -2.1085653305920989e+01 - 3 -2.5923266064876724e+01 -7.2254055664039996e-01 -6.8249224259047352e+01 - 4 1.7514735996364880e+01 9.1382329672789790e+00 1.4609547038415059e+01 + 1 -1.0877916199696880e+01 2.7818702672253535e+00 5.3261999506236291e-01 + 2 2.3844741743964359e+00 3.8119494975859820e+00 -1.7852993505726616e+01 + 3 -5.5060476477475689e+01 -1.4649752877701623e+01 -8.0050236348996179e+01 + 4 1.7259641752479915e+01 9.3367236247196459e+00 1.5880869558399707e+01 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 6 1.8311337599848397e+01 -5.2737007463348540e+01 1.6786691829845310e+01 - 7 -7.5126152872376224e+01 3.9208090425209887e+00 -7.8501700045948780e+01 - 8 -1.7883231274222544e+02 1.2382156266173226e+01 -5.9370199178252896e+01 - 9 5.5713719759234115e+00 5.2160432479757199e+00 -7.2308807479301160e+00 - 10 -8.8969852437984986e-01 -1.4444413139727912e+00 1.1573923441213648e+01 - 11 1.4439507123611418e+02 -4.2519782552993178e+01 -3.4698021577234364e+01 - 12 -7.9891827746142440e+01 -1.3089531661279866e+01 3.3544238612989574e+01 - 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 14 1.5112474793527515e+01 3.7694869755527549e+01 3.7356461110106380e+01 + 6 1.7794981791163593e+01 -5.3419136769607242e+01 1.6321520194862270e+01 + 7 -6.7476304109574130e+01 6.2075604947450902e+00 -7.5135621817254460e+01 + 8 -2.4916954539513171e+02 3.9444614508591016e+00 -3.9136157099553060e+01 + 9 -4.2488336756946268e+00 4.0607535434839548e+00 -1.2332116161289415e+01 + 10 -5.6137775456441865e+00 1.7826098872220566e+00 1.2020962661719219e+00 + 11 2.7495820988809027e+02 3.6846029087180561e+01 -3.5747270392708273e+01 + 12 -8.5777207355584196e+01 -6.6701918827252396e+00 3.6593196816034450e+01 + 13 2.8148971669949274e+00 4.6881622931164827e+01 -2.8703181200029189e+00 + 14 4.3309350502950068e+01 5.7710597636999225e+01 5.5581382162003663e+01 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 16 8.2461187714193773e-01 -3.3645319303810240e+01 -3.7521462215646316e+01 - 17 -6.1699650496788138e+01 1.2415735742737041e+01 1.3686739582320531e+01 - 18 2.8937858224261145e+01 -3.2763761650136175e+01 -2.1828920543524362e+00 - 19 7.5423787139990097e+01 1.5671749716355956e+01 -7.2118194981816089e+01 - 20 3.1376794755628719e+01 -3.1236998918287412e+01 7.5194815218724109e+00 + 16 1.2607471285851268e+00 -2.9950670515087097e+01 -3.8329115405911018e+01 + 17 -5.6603480809488076e+01 4.4199833293541300e+00 1.6646322746099209e+01 + 18 2.9144882612634291e+01 -3.8254411681864063e+01 -7.8684527917205145e+00 + 19 -3.9052289719793055e+02 -3.4869665476714161e+01 2.4334773779305885e+02 + 20 3.0523801757408044e+01 -2.7070235210655451e+01 5.8409090614110681e+00 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 23 6.8299963765568918e+01 -5.5707235162344176e+01 -3.8157782755725172e+01 + 23 7.4409420690489355e+01 -6.1338308875185476e+01 -4.0331698726077342e+01 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 25 -1.4057244393584650e+01 -2.0289162180649914e+01 -6.8170959892909657e+00 - 26 -2.0187519714808797e+00 -1.7816926619477179e+01 3.6965530794144215e+00 - 27 1.3550009286410142e+02 -6.7838442433020987e+01 4.3133759785536839e+01 - 28 9.6888228678225943e+01 8.8823964822113354e+01 -5.0921310684595440e+00 - 29 5.0758136978827828e+01 -8.8983484466933636e+00 2.4899348744763503e+00 - 30 2.4524050422835546e+02 -1.3660139575889716e+01 -5.9330622488472429e+00 + 25 -1.5434241286382722e+01 -1.8496732610349333e+01 -4.1692111563040104e+00 + 26 -7.2450999487179368e-01 -1.5411352219553073e+01 3.6729754115414410e+00 + 27 1.4857382071179012e+02 -8.7243441240052576e+01 3.5551461566724285e+00 + 28 1.1863305039536399e+02 8.2702890776365251e+01 1.5438625166236708e+00 + 29 4.7622244763792665e+01 2.8036677645410064e+00 2.7605538303246266e+01 + 30 2.8830089479096068e+02 -3.2782832144046630e+01 1.0021042303094610e+01 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 33 -5.9389712314059899e+00 5.1469485825476632e+01 1.5282542616314259e+01 - 34 -4.5946066700985764e+00 -4.4047708825321044e+00 -2.5896753139020143e+00 - 35 -7.6885241750208053e+01 -3.7858402496177828e+00 -1.0416208866746226e+01 - 36 -4.3251004252238602e+01 -3.0812732079587814e+01 1.5493207265310225e+01 + 33 -5.8840045456950794e+00 4.3985933844784583e+01 2.3192861467704642e+01 + 34 -8.7966056614410029e+00 -3.7772050966589195e+00 -5.0823857794889395e+00 + 35 -1.1045571928016574e+02 -2.5865097773377244e+01 -3.3352412609602020e+01 + 36 -3.9928574485931463e+01 -3.7650151639047877e+01 -8.6463622825287718e+00 37 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 38 1.5022834606958035e+00 -6.0344797002288935e+01 9.7293521036630253e+00 + 38 3.7620819432057218e-01 -5.9409169085796123e+01 1.1096825467802800e+01 39 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 40 -2.7902725378002407e+02 1.1520394360420056e+02 7.6029058865840788e+00 - 41 1.9875813960393174e+00 2.5898055298981014e+01 2.5255670110916995e+01 - 42 -1.2584608623742559e+00 -5.6180254661161921e+00 4.3355672941135310e+00 + 40 -4.2080005116230825e+02 1.5031323405600098e+01 2.9501903992797590e+01 + 41 -7.1831560585720933e+00 2.3501750559283572e+01 3.3211486936784340e+01 + 42 -5.4333480181191565e+00 -3.8223468522073816e+00 5.2743674603165180e-01 43 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 44 6.1017414877125219e+01 2.3847994346393616e+01 4.3262891796747923e+01 - 45 -5.7359830701947160e+01 3.4172133537981061e+01 8.2107294758634282e+01 - 46 1.1199817492468897e+02 -2.3757850899635457e+01 1.5384138774546548e+01 + 44 6.3343115031223618e+01 4.9488269049671743e+01 5.0212693134385852e+01 + 45 4.2426107000304461e+02 5.6870576087709601e+01 -2.5997915418336186e+02 + 46 1.5374526292284733e+02 -2.4634557106752883e+01 -5.9682043662955198e-01 47 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 49 -6.7826664559677212e+00 -1.8594048126804452e-01 5.8956046460291018e+00 - 50 -1.9821181472408849e+01 -1.8120466552612466e+00 4.4346376430216274e+00 - 51 -1.4173233779399769e+02 -4.2613815950203332e+01 -1.2166481368092674e+00 - 52 -1.8872790570220135e+02 8.0898507623818233e+01 -1.1989280050987688e+02 + 49 2.4661219205867124e-01 8.5675291946438747e-03 7.1571452556870607e+00 + 50 -2.9771833518729430e+01 -1.3051484212554421e+00 9.5072078108683797e+00 + 51 -1.8696229787240989e+02 -3.0047277992900270e+01 -1.9740545231863507e+01 + 52 -2.3539901102198849e+02 8.1698090987131437e+01 -1.1372895143958984e+02 53 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 54 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 55 -6.3070794314781526e+00 -3.9493489491808290e+01 -3.5654394269934336e+01 - 56 -1.5536342282055219e+02 6.8759186611823921e+01 1.9484632984497484e+01 - 57 -1.6311185567739994e+01 5.5975547175367071e+00 -1.4425077069506760e+00 - 58 -6.4235602672066854e+00 2.6970192907549908e+00 -1.0923186469627662e+01 - 59 9.2546558740453520e+01 4.2666948660770835e+01 4.7533444080031387e+01 - 60 1.4559994425694956e+02 -3.5129424621390541e+01 1.1583916891031554e+02 - 61 5.9875382725562297e+01 6.8646156842044057e+00 2.3254650701763087e+00 - 62 3.9267471066687037e+01 -1.0670715066325148e+01 1.9913762076436925e+01 + 55 -9.9884482402850541e+00 -6.3055658591437627e+01 -3.8790469467358129e+01 + 56 -1.5107682215201132e+02 8.7447856627311296e+01 6.2282327734170792e+01 + 57 -2.4707891921489107e+01 8.1429365092512214e+00 3.7927680043865371e+00 + 58 -7.9324323649416941e+00 1.1054830884521323e+00 -1.1979407816256995e+01 + 59 8.8647414655790897e+01 3.8723530340457934e+01 4.8155613223847489e+01 + 60 2.3037905379117743e+02 -4.6938025305796280e+00 9.6809391630855757e+01 + 61 8.6363991728769733e+01 1.4895986000401711e+01 9.8022745803324582e+00 + 62 4.1476239705230299e+01 -9.7738777271406949e+00 2.2124545502286114e+01 63 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 64 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-polymorphic_sw.yaml b/unittest/force-styles/tests/manybody-pair-polymorphic_sw.yaml index 2aee0ed5f..02200151c 100644 --- a/unittest/force-styles/tests/manybody-pair-polymorphic_sw.yaml +++ b/unittest/force-styles/tests/manybody-pair-polymorphic_sw.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:31 202 epsilon: 1e-12 prerequisites: ! | pair polymorphic @@ -84,73 +84,73 @@ init_forces: ! |2 62 8.3847363183302388e+00 -7.9441779730970898e+00 -1.9428697652986431e+00 63 -6.4026447196181824e+00 -8.9658730208109318e+00 5.5791283935903966e+00 64 -5.7668345333930739e+00 -5.3444816699294773e+00 2.4892095494490190e+00 -run_vdwl: -144.992990349495 +run_vdwl: -111.143397432489 run_coul: 0 run_stress: ! |- - -3.1701076082952088e+01 -3.7656770030899871e+01 -5.4490422529108301e+01 -1.1611843352902998e+01 -1.9941609984748986e+01 5.8892703036043648e-01 + -1.6884876517198332e+01 6.5112126457917583e+01 -2.6558952316833775e+01 -3.7002428812831916e+01 -3.4760986882349549e+01 3.0465464452139759e+01 run_forces: ! |2 - 1 2.6001753980068312e+00 8.8453956044365452e+00 -9.8797166618993941e+00 - 2 4.7965777681525594e+00 3.1418955328442177e-01 -6.7264903627663886e-01 - 3 1.0165193459026138e+00 -6.9858270050310001e+00 1.8628184449968073e+00 - 4 3.8602538711737191e+00 8.4722642593294442e+00 8.8567452606533053e+00 - 5 1.4325862819782447e+00 9.6460774612528724e+00 1.8484498014247425e+01 - 6 9.9340453391254468e-01 1.6560100312784802e+00 7.8977347536819120e-01 - 7 3.8845315180472229e+00 4.1363004105214696e+00 4.1612397006953481e+00 - 8 -2.2825002748067025e+00 -2.1223012980285478e+00 3.5281401425639487e+00 - 9 -1.1481583330859353e+00 3.6688819286639918e+00 2.0596448842899480e+00 - 10 -1.5948540569760689e-01 -1.7804814659974553e+00 -1.0111342802770735e+00 - 11 -2.8695789524802331e+00 8.0006124848439448e+00 2.9516495359219297e+00 - 12 -1.3694287291703762e+00 2.6454487190474807e+00 2.8765938514624372e+00 - 13 -5.4843165416037032e-01 2.4178430786947298e+00 1.1398502101802370e+00 - 14 -6.4833543831883622e-01 1.8793140665316381e+00 -4.1708918178362042e-01 - 15 -4.3970394902375318e+00 2.7529926135490668e-01 -1.0537111051268997e+00 - 16 -3.0802569601088012e+00 9.5925986030005028e-01 2.2666056736776650e+00 - 17 -1.1381825725808325e+01 1.2915502454739507e+01 5.1238681810529574e+00 - 18 9.6111051916319816e+00 -4.7298952633755444e+00 5.5528105778138421e+00 - 19 -7.5431623569785000e-01 -2.1661936391034660e+00 2.4918735731106073e-01 - 20 -5.7550438939721049e+00 -5.8408478677394928e+00 -4.9085613229771701e+00 - 21 5.4549105790401802e+00 2.6630471078722162e+00 6.0325918454019254e+00 - 22 6.8075019401962757e+00 -6.2213593280347208e+00 -1.8529952635070035e+01 - 23 4.6278885706494510e-01 3.8608940279342213e-01 8.5014465678374362e-01 - 24 1.9791326592062606e+00 1.5389863050677755e+00 9.4124356044129698e+00 - 25 1.7333054580403262e-01 1.3337276459680432e+00 -6.1609668099787775e+00 - 26 1.0230811841295624e+00 5.4629680416587312e-01 -2.0268842134531423e-01 - 27 1.2682618334346174e+00 -1.4700543015080925e-01 6.0935929813436018e-01 - 28 -1.8827867210279361e+00 -8.0983579348143708e-02 -8.0957444624412709e+00 - 29 -2.7782453830324263e+00 -2.5573236098459677e+00 6.7705114865425902e+00 - 30 4.8720777514052538e-01 -5.4014658873264407e+00 3.6862303261910623e-01 - 31 -6.7438316872628379e+00 4.4362126872178842e-01 -1.9853303658062882e+00 - 32 -7.1101699485116887e-01 2.7906283637156255e+00 -9.1751469515765138e-01 - 33 -6.8060323342038727e+00 1.2668101760691528e+01 1.0975710263736646e+01 - 34 -7.6430167294980933e+00 3.1186302206809264e+00 -6.4742189675725701e+00 - 35 7.0112612235293548e-01 3.2263957902917295e+00 -1.6627434314520302e+00 - 36 -7.0034117601634915e-01 -7.3481334049701386e-01 -3.2923650090110673e-01 - 37 6.9659019279999326e+00 6.6687056140876833e-01 -1.7233441201475324e+00 - 38 1.0144657031880191e+01 -1.0180115609902439e+01 -8.1296975662497548e+00 - 39 1.2282661288072532e+00 -2.8886872299953255e+00 -8.5998645412511383e+00 - 40 2.2197909873190063e+00 -7.9705770507637119e-01 -1.6269370534025505e+00 - 41 9.9038174862740713e-01 5.2034287095562535e+00 -9.2279549656139437e-01 - 42 -1.7823656100406512e-01 6.3207831041068252e-01 -1.2857226015957983e+00 - 43 7.5310776116899159e-01 4.0022631696456701e+00 -1.4783935084238897e+00 - 44 -4.3138030953488220e-02 -2.1730377457745106e-01 2.5879362252594804e+00 - 45 -1.9253816101880521e+00 1.3252488113122081e+00 -1.2487618876812336e+00 - 46 -1.4334721232398184e+00 1.8708798225467027e-01 -3.4929993475111276e-01 - 47 -1.8506359747177516e+01 6.3237428091566317e-01 -4.1112559217521163e+00 - 48 -3.3460942707282499e+00 -2.1689603476053896e+00 1.6173482627519267e+00 - 49 4.1632394287441876e+00 -2.6793965025719482e+00 2.3094287627967724e+00 - 50 6.3005475103750506e+00 5.0761727277929296e+00 -6.6034546604114785e+00 - 51 -7.6976444738773875e-01 7.2408105720737537e-01 -2.0882810980395097e-01 - 52 6.0477513556601279e+00 -6.8466072151236883e+00 2.9952979114061438e+00 - 53 2.9350764434089260e+00 1.7618197320303048e+00 1.2296397931736294e+00 - 54 5.5219180293126131e+00 -2.1620842486142536e+01 -4.2059340473074602e+00 - 55 9.4497148035695844e-01 -8.8829453241008549e-01 -1.9741545697816292e+00 - 56 1.3986670274834250e+00 -5.8733780758809022e+00 -7.8406096467097630e-01 - 57 -6.9229115466318514e-01 -3.3674905932471810e-01 2.6880467900088900e-01 - 58 1.9591652237395313e-02 -1.3594894300349787e+00 3.5228908450816110e-01 - 59 9.0492207431875471e-01 1.9820913506452942e+00 -2.6150393093642141e+00 - 60 -3.0228065714741517e+00 -1.9614689041002695e+00 -9.8795271024452358e-01 - 61 -1.0808324746228049e+00 -9.8892831798155223e-02 -4.0399214029008695e-01 - 62 6.7102847473646960e+00 -7.3289558365414296e+00 -2.1817303825752870e+00 - 63 -5.6961477142673687e+00 -7.4946638072487755e+00 3.0071800556862467e+00 - 64 -5.4473739150961515e+00 -5.2320794746151691e+00 2.4517511318822947e+00 + 1 -1.1556293868089025e+01 8.1312370864298146e+01 8.4475729136713724e+00 + 2 4.7325634267529875e+00 5.7248878610878484e-01 -9.2395845377706409e-01 + 3 -8.2808493637203523e-03 -6.7644966096487185e+00 1.4234505833145252e+00 + 4 2.1697510791453372e+00 8.9717599866204942e+00 8.4337038932580963e+00 + 5 4.1305994067636789e+00 1.1821353490536708e+01 2.1113270355078729e+01 + 6 8.0760720676111231e-01 1.5991150028774201e+00 5.3690598477677265e-01 + 7 4.2634747684438663e+00 4.0690859882727048e+00 4.3719079483602892e+00 + 8 -2.4455004757360146e+00 -2.2971190726779600e+00 3.4703186761274849e+00 + 9 -2.2492102746344904e+00 4.4305978058752125e+00 1.5477533574302818e+00 + 10 -2.8736360984779136e-01 -1.7434233735687883e+00 -1.2789324367881967e+00 + 11 -3.5267145075815853e+00 9.0586475781339626e+00 3.2323357396592094e+00 + 12 -9.9351562454900488e-01 2.2754645328793344e+00 2.9578766734563366e+00 + 13 -4.9029328348463064e-01 2.4338410171794438e+00 9.4230201143317072e-01 + 14 -6.1231409133489756e-01 2.0083308587636828e+00 -2.6322714445381673e-01 + 15 -4.6661157808842635e+00 4.3172638131881730e-01 -1.0848868221141719e+00 + 16 -3.1940698755775694e+00 6.8388912949952552e-01 2.5615133272337962e+00 + 17 -1.8571250836830494e+01 3.0366260201304620e+01 1.1018244688844041e+01 + 18 1.0727432502928774e+01 -6.5859447181848072e+00 6.8143142080218606e+00 + 19 -7.1989724033091329e-01 -2.1734725252218170e+00 2.9875600509447114e-01 + 20 -6.2550426582426173e+00 -6.7840335445929343e+00 -4.5385628665440034e+00 + 21 5.2146731415850729e+00 2.8677314186089271e+00 5.8746233445735925e+00 + 22 1.2467871689549595e+01 -1.0588718491866205e+01 -3.2762628828378453e+01 + 23 5.7419066995026347e-01 2.9736580804330420e-01 5.7779498512106053e-01 + 24 2.3036877695492168e+00 2.5915708338672672e+00 9.8542199767668119e+00 + 25 3.3989123916123476e-01 1.5272110886126467e+00 -6.1010156075634541e+00 + 26 1.0153293555738558e+00 5.0042590538905740e-01 -2.3666625834888180e-01 + 27 1.1311970853708082e+00 3.8653484081838628e-02 4.1612631895690000e-01 + 28 -2.7455023455187093e+00 -7.3316160088041626e-01 -9.3641566531686067e+00 + 29 -3.0017637017325423e+00 -3.0656281957141851e+00 6.8031594912412219e+00 + 30 1.5722866766210908e-01 -5.4600226985194444e+00 7.0087410263849492e-01 + 31 -6.4828089423567921e+00 5.9409312338134113e-01 -2.2191320500743945e+00 + 32 -4.8561827173649608e-01 4.2637857965822805e+00 -1.4266826964118429e+00 + 33 -1.3554348264725489e+01 1.8396644758423111e+01 2.4246570619766779e+01 + 34 -7.3855164056883185e+00 2.5825880260655047e+00 -5.5088480645941544e+00 + 35 1.3708058685649918e+00 2.7671040942710574e+00 -2.6318937566831253e+00 + 36 -5.5448973146959701e-01 -6.9322852049460726e-01 -2.3487703788572503e-01 + 37 6.6014103886813462e+00 6.3337291043522514e-01 -1.7078228673655296e+00 + 38 1.6915781313933561e+01 -2.8178360971298730e+01 -1.3683364630366128e+01 + 39 2.0030134159115685e+00 -3.9977385349467851e+00 -7.8598456621943722e+00 + 40 2.0810743374187091e+00 -7.8352782122875397e-01 -1.6790554725501237e+00 + 41 1.1472323371991464e+00 5.0614670139812219e+00 -8.5854323842553348e-01 + 42 8.4638551342965853e-03 8.8516371349994594e-01 -1.3295783785018491e+00 + 43 1.1339425512861514e+00 4.0388189881477183e+00 -1.1329909939215335e+00 + 44 1.8760817241763397e-03 -2.7253117309036462e-01 2.6260600939818128e+00 + 45 -1.9118901372951693e+00 1.3828609013658997e+00 -1.2794864388306046e+00 + 46 -1.5596382145416756e+00 1.5798194804315102e-01 -3.9774107738848730e-01 + 47 -1.8631089024648290e+01 2.0518910115384212e+00 -5.4036884508292671e+00 + 48 -3.4336244294715508e+00 -2.5803411367656426e+00 1.9070725124564540e+00 + 49 4.4233263431795304e+00 -2.3501955586125094e+00 2.6559968600884427e+00 + 50 6.9203296008906090e+00 6.8104471993331952e+00 -8.7437425082600306e+00 + 51 -3.2370679027012805e-01 1.0166669954621148e+00 -6.7376310861164002e-01 + 52 7.7305848598223186e+00 -8.2640934747055361e+00 3.9895392084314940e+00 + 53 2.4969335987297763e+00 1.6091058024022127e+00 1.0095024919989739e+00 + 54 1.7537838587236223e+01 -9.6408997378435402e+01 -2.4289119439888243e+01 + 55 1.0479254527968416e+00 -9.5106176762888839e-01 -1.9973738179985112e+00 + 56 1.4729967024661450e+00 -5.6343903633242602e+00 -1.0568943096008123e+00 + 57 -6.4833864525238871e-01 -2.6673792343899760e-01 2.4966744862158544e-01 + 58 -1.0315171171095752e-01 -1.4768548933883365e+00 3.2502828460507582e-01 + 59 1.0142689090743304e+00 1.9737604539796745e+00 -2.7316639570246108e+00 + 60 -2.7228585593264096e+00 -1.6658900084224961e+00 -7.2771794915818411e-01 + 61 -1.1036195081588704e+00 -1.0230609220399908e-01 -3.6208849222667866e-01 + 62 8.3804487634815512e+00 -7.9562896926737885e+00 -1.9561276194153090e+00 + 63 -6.3991443184200376e+00 -8.9930727478183350e+00 5.5664561207427132e+00 + 64 -5.7007789979187606e+00 -5.3120040098313037e+00 2.4731588635915074e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-polymorphic_tersoff.yaml b/unittest/force-styles/tests/manybody-pair-polymorphic_tersoff.yaml index 202506808..3fc38561f 100644 --- a/unittest/force-styles/tests/manybody-pair-polymorphic_tersoff.yaml +++ b/unittest/force-styles/tests/manybody-pair-polymorphic_tersoff.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:31 202 epsilon: 1e-11 prerequisites: ! | pair polymorphic @@ -84,73 +84,73 @@ init_forces: ! |2 62 6.4996283247232540e+00 -7.4637247642767051e+00 -5.0174108531675454e+00 63 -5.7071873855477513e+00 -9.3348074441081295e+00 6.5081800066406998e+00 64 -4.5601626990206690e+00 -4.5257272492649570e+00 3.5749156843886922e+00 -run_vdwl: -203.611092321268 +run_vdwl: -121.544576212893 run_coul: 0 -run_stress: ! |- - -4.2049484348235183e+01 -5.9189088685535481e+01 -5.0689386485552980e+01 -1.8364326484744367e+01 -1.2822694127765459e+01 1.7363774136149935e+01 +run_stress: ! |2- + 4.1813274424716730e+02 5.8447861805552952e+02 4.7956279024041038e+02 -2.1359076310114048e+02 -1.6136565007848719e+02 1.0855996460611711e+02 run_forces: ! |2 - 1 1.7939756373154978e+00 -1.1208319637796436e+01 -4.7866634606556708e+00 - 2 3.7204026301607032e+00 5.0628621597397228e-01 -5.3413782443010405e-01 - 3 1.8471257413913276e+00 -6.2823444167750928e+00 1.3665870486084699e+00 - 4 -3.2320065638233331e+00 6.7270122311417211e+00 8.1723438304257279e+00 - 5 4.6217901401315915e+00 1.0863412036937085e+01 1.1126624417063194e+01 - 6 3.0987750315356288e-01 8.3678762081949221e-01 7.0235938485577731e-01 - 7 2.2209848870416780e+00 3.2189941222874436e+00 2.5910209493227510e+00 - 8 -1.2232870679980579e+00 -1.0004421013562073e+00 2.3099733087226308e+00 - 9 -5.7081176786978531e+00 5.1677579033206058e+00 4.4647480813472766e+00 - 10 -1.3063455353378964e-01 -1.0836814049526238e+00 -3.2753858483337051e-01 - 11 -2.4246549271165598e+00 5.7101324774375772e+00 4.9315474886301178e+00 - 12 -3.7965311006712561e+00 5.8417042217798363e+00 2.7925668054307655e+00 - 13 -9.3612493581427925e-02 1.1534950866682339e+00 1.0344539998300817e-01 - 14 -3.6664330256500349e-01 7.5120063095742429e-01 -2.6314287009643650e-01 - 15 -2.9409678566978847e+00 6.1085688155501927e-01 2.9475390395049600e-01 - 16 -1.6580254677123794e+00 2.1049836131872629e-01 1.5607821069119807e+00 - 17 -1.0130328608941838e+01 1.0319068327042208e+01 5.2364714182394518e+00 - 18 7.4601352685103635e+00 -5.5310059308322508e+00 5.3125956730780217e+00 - 19 -4.0037881131041847e-01 -1.2527014456384118e+00 3.6823689760325146e-01 - 20 -7.0926635534301194e+00 -7.2590543601985615e+00 -6.1674919978387237e+00 - 21 4.1908954283746649e+00 3.0491822757804119e+00 4.4518291509682308e+00 - 22 7.3478252843488718e+00 -6.1689027765702136e+00 -1.2191865417888138e+01 - 23 5.2487632403478568e-01 4.5848786084689036e-01 -2.8426094252701828e-01 - 24 5.7590645389044584e+00 4.3564682716409280e+00 6.4508519865865583e+00 - 25 9.6032966256812280e-01 1.1449000944189454e+00 -4.0054320422643075e+00 - 26 1.4217364583576858e-01 1.4960650360445182e-01 4.5718190780874096e-01 - 27 4.7488975754088597e-01 8.9514263858711571e-02 5.8726290073366536e-02 - 28 1.1349236573774526e+00 2.2761435327220783e+00 -5.9730933464743714e+00 - 29 -2.7867012040747063e+00 -2.4702199788611980e+00 4.7211936268532444e+00 - 30 6.9788385652458373e-04 -3.2692120625975409e+00 2.4134335178597510e-01 - 31 -4.7289364647448959e+00 1.6531052258817445e+00 -1.7169707860995391e+00 - 32 -1.1532642739483379e+00 2.9149579740167866e+00 -5.8998040394914284e+00 - 33 -8.1720168390170969e+00 1.0536116946211063e+01 7.8839425873690150e+00 - 34 -5.4996907115520708e+00 7.5181319813262526e-01 -2.3171213923254221e+00 - 35 4.8106995828675210e+00 7.1169887708264916e+00 -5.6110197589213691e+00 - 36 -3.5717324453145044e-01 -2.2255539137938293e-01 -8.3906857577034130e-02 - 37 3.9037369696598163e+00 -3.5890001237788355e-01 -1.1199415586639974e+00 - 38 9.7334516769680874e+00 -8.8132706217214860e+00 -8.4313924553967841e+00 - 39 6.3364725802017006e+00 -5.4176635698201068e+00 -7.3318779334885562e+00 - 40 9.3358332318778159e-01 -2.4842482840019792e-01 -1.1357782777258685e+00 - 41 4.8936661703074336e-01 3.0547346740064669e+00 -7.3906935937596785e-01 - 42 -3.9528153001845484e-01 1.5597737723367203e-01 5.2784338346775851e-02 - 43 2.2657812576932397e+00 1.9712039200390983e+00 -1.2370089231886103e+00 - 44 1.9541097803380220e-01 -4.4468176101268314e-01 1.0176986248574860e+00 - 45 -1.2260709579840805e+00 6.1245263557219842e-01 -4.3698060412983547e-01 - 46 5.3072693972158191e-02 -4.1780244594259308e-01 -5.8470587436144816e-01 - 47 -1.0420135908179688e+01 5.7001528094305343e-01 -9.0003704553925488e+00 - 48 -1.7851692820511502e+00 -8.2285670190056948e-01 3.5445348939455101e-01 - 49 2.9103116184165554e+00 -2.3426722789735948e+00 2.1935227677704248e+00 - 50 4.9209401662251961e+00 6.4162503219489153e+00 -6.3625199989179393e+00 - 51 -1.5893799847955918e+00 -8.3821253179133404e-01 1.2455496182737864e+00 - 52 2.8234453813943876e+00 -3.2347981236230305e+00 4.6846318946505017e-01 - 53 1.7195958602754113e+00 8.6752486866952305e-01 6.2371405899840404e-01 - 54 -3.3730515088927611e+00 -8.2571374860614952e+00 4.5905709087303457e+00 - 55 2.9111712152328195e-01 -6.0568036958349580e-01 -1.2650082903307274e+00 - 56 1.3734924894688838e+00 -4.7988036888201933e+00 -1.0498689187601902e+00 - 57 -4.1483289858517808e-01 -1.6475409302825694e-01 8.8751421011581177e-02 - 58 5.2202454854535030e-01 -2.0969163457055551e-01 1.0326238710272539e+00 - 59 1.8342901227573127e-01 3.1930603555127135e-01 -8.5429628645135613e-01 - 60 -1.6047921602890547e-01 4.3809780266159670e-01 -4.9231335386324615e-01 - 61 -7.4031928141422254e-01 -2.4982528971416698e-01 -2.7078923661290932e-01 - 62 4.7240540893840048e+00 -6.5824371146058915e+00 -4.5927562090591252e+00 - 63 -4.2130786356549734e+00 -6.8532850187004968e+00 3.8433571293767557e+00 - 64 -4.4865200301162247e+00 -4.4107168742006451e+00 3.9565120242715395e+00 + 1 -3.4139969766911612e+01 1.1460726574047618e+02 3.3269614045286360e+01 + 2 3.2006257391844080e+00 9.4337768665509003e-01 -5.3570821580498063e-01 + 3 6.9337597355694092e-01 -5.1786535750991032e+00 1.8948548308125104e+00 + 4 -9.7704264370481582e+00 1.4859606502805995e+01 8.9122927997833159e+00 + 5 3.0283714885605384e+01 1.0530566672172395e+02 1.2694927490769135e+02 + 6 2.0816191674407269e-01 7.7907529847247925e-01 6.1720327454344270e-01 + 7 2.5198389568125821e+00 3.2746366074914715e+00 2.8123746100701750e+00 + 8 -1.2249272771252224e+00 -1.0172537199298386e+00 2.2677409386319658e+00 + 9 4.0037333434435212e+00 5.4436958371354791e+00 1.2429543241202250e+00 + 10 -1.7199476861296256e-01 -1.0672399003412834e+00 -4.6142334189297374e-01 + 11 -2.0215946102161944e+00 5.0959357422898925e+00 4.4332839813981506e+00 + 12 -2.5704490457931302e+00 3.9035503406683745e+00 2.1595255748638706e+00 + 13 -1.2243393150495380e-01 1.0085717419961040e+00 -1.1130152302012115e-01 + 14 -3.3201636741388285e-01 7.5197054588648715e-01 -1.9270118689180982e-01 + 15 -2.0609427138581971e+01 1.8588994262666702e+01 -1.2036097393327889e+00 + 16 -1.6741237960042259e+00 3.5015088460969745e-01 1.7941954028575400e+00 + 17 -2.3195327056812172e+01 3.2603251793408198e+01 1.7634576877179605e+01 + 18 7.9327707146416273e+00 -9.4991279522955523e+00 8.6952522039028750e+00 + 19 -3.8501675477774100e-01 -1.2939839330998344e+00 4.2992004530201111e-01 + 20 -1.1906945195751472e+01 -1.4229359824539848e+01 -6.5465387857494788e+00 + 21 3.9950952105468933e+00 2.6573483869987533e+00 4.0864782869489460e+00 + 22 3.4812501177367345e+01 -3.2455079423082729e+01 -2.7426321965649542e+01 + 23 4.8515405780909149e-01 4.1850116837241907e-01 -4.1901337798047261e-01 + 24 8.6481822125782379e+00 -6.1702402937753533e+01 7.3055972462672315e+01 + 25 1.1466352699427915e+00 1.3114517183119716e+00 -3.9559251697571280e+00 + 26 1.1119311542123138e+00 -6.8770221839634738e-01 1.0578481341438446e+00 + 27 3.9674613549180926e-01 2.0697990916391892e-01 -6.6799068311386461e-02 + 28 3.5488479164989428e-01 1.6590678745090557e+00 -6.6897284165977471e+00 + 29 -3.3726337231626706e+00 -3.2516357584723687e+00 4.9025499760483431e+00 + 30 -2.6565824506442581e-01 -3.2750744925484088e+00 5.2057050745471756e-01 + 31 -4.7116364632672258e+00 1.9142942431540453e+00 -2.1086405244683508e+00 + 32 -9.1756165720804859e+01 -1.1769208220439097e+01 9.9944662174643796e+01 + 33 -1.8527488956379543e+01 1.9263740112567994e+01 2.5460560907068370e+01 + 34 -4.9950811620313083e+00 1.5440900495686725e+00 -1.5644559520902774e+00 + 35 2.1306691640246420e+00 3.4942527293857797e+00 -3.4563085326425753e+00 + 36 -2.9028719254683788e-01 -2.1766393981761042e-01 -7.8818913718919220e-02 + 37 3.7521800593759633e+00 -4.8630720603023925e-01 -1.3364672536519233e+00 + 38 2.1812080964673640e+01 -3.2177220027707293e+01 -1.9545978181680688e+01 + 39 9.9158950220763096e+00 6.2352000895925990e+01 -7.0478499469258992e+01 + 40 7.9628929910415547e-01 -2.1527603103478721e-01 -1.0918486081046139e+00 + 41 5.4773157860941879e-01 2.9584304976230409e+00 -7.3352916487348097e-01 + 42 3.1111122428385701e-01 6.9784737499610483e-01 -3.9556299005847745e-01 + 43 2.4175321570508874e+00 1.0966120755546349e+00 -1.6378226368467828e+00 + 44 2.8022630606269133e-01 -5.5312649054784446e-01 9.5382615566473683e-01 + 45 -1.2450208809165457e+00 6.5896117004173194e-01 -3.9357950593172225e-01 + 46 7.5955563732264864e-02 -3.8514745246972382e-01 -6.1047591737537132e-01 + 47 -1.3234841004527328e+02 9.8391492858073150e+01 -5.7956557522149978e+00 + 48 -1.8651976130428114e+00 -9.8942277513371302e-01 4.4952444862634700e-01 + 49 3.3096460984349116e+00 -2.2848387179479630e+00 2.6221031794770937e+00 + 50 4.9643379856062282e+00 8.4033634968969579e+00 -9.5777489859649236e+00 + 51 -1.9855610009138225e-01 -9.5050385400926052e-01 -1.8193544142703466e-01 + 52 3.3070299392512315e+00 -3.5925118869020194e+00 2.7074250857591398e-01 + 53 1.5267294225967649e+00 7.6241907363726003e-01 4.7291362186087132e-01 + 54 2.1503460706462675e+02 -3.0173268206490184e+02 -2.6175372172143568e+02 + 55 3.0090920327588577e-01 -5.6430556843749358e-01 -1.2706338589749224e+00 + 56 1.5473885200422810e+00 -4.5878484493660476e+00 -1.2807576330279500e+00 + 57 -4.0698381256666866e-01 -1.0247307337545232e-01 9.3521321519680845e-02 + 58 4.7488500307540238e-01 -6.6818815847154944e-01 5.7357107554437192e-01 + 59 1.5428992341799189e-01 5.4620823020959941e-01 -1.0904146666893264e+00 + 60 1.1520063837235384e-01 6.1113838759913097e-01 -3.4187090834286482e-01 + 61 -7.3512369411841338e-01 -2.1934086359365690e-01 -2.3353709772522482e-01 + 62 6.4754651381744637e+00 -7.4803826375730296e+00 -5.0664724123584381e+00 + 63 -5.7038671280448554e+00 -9.3375760912918011e+00 6.5007609511647004e+00 + 64 -4.4967489315903748e+00 -4.4924127142669672e+00 3.5551373919943430e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-rebo.yaml b/unittest/force-styles/tests/manybody-pair-rebo.yaml index 6cc14a825..1a961837a 100644 --- a/unittest/force-styles/tests/manybody-pair-rebo.yaml +++ b/unittest/force-styles/tests/manybody-pair-rebo.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:31 202 epsilon: 1e-07 prerequisites: ! | pair rebo @@ -67,57 +67,57 @@ init_forces: ! |2 46 1.0998928173472683e-01 -1.5086188432942196e-01 1.6829691363685131e-01 47 -7.6878894879590064e-04 5.5783704671116340e-02 -2.0995953677601979e-02 48 5.1056316250091771e-02 8.5470091106617740e-02 6.8395639456075963e-02 -run_vdwl: -184.51998480396 +run_vdwl: -184.41850184596 run_coul: 0 run_stress: ! |- - -9.7239038536264044e-01 7.4669322717364839e-01 -7.7104364903424294e-01 5.4771494015343014e-01 -2.1796905704783737e-02 1.5820274570202170e-01 + -6.3796800430503467e-02 2.0494433580340701e+00 -1.6992433003987237e-01 2.4088644686118060e-01 -2.1497443283592180e-01 -1.0587984597558675e-01 run_forces: ! |2 - 1 7.4155582187185320e-02 -1.5455609952472066e-01 -4.0185659582818589e-01 - 2 -1.2599664371163707e-01 -4.7270532243529007e-02 -1.2614563997376005e-01 - 3 7.9410728544291417e-02 -6.7788695692031498e-03 1.0261863017785233e-01 - 4 3.7589897293458219e-01 6.5448581597716937e-02 5.8478513706716928e-01 - 5 -1.8406250774366176e-01 -1.5832209948748655e-01 -8.6604265862793073e-02 - 6 -1.7291110116223143e-01 4.4906356654481727e-02 3.0419307237807502e-02 - 7 -3.3201513523500364e-01 -5.7108644658989294e-01 -5.7184715922428109e-01 - 8 1.0238297541360618e-01 -8.5807437101430781e-02 5.5823992026930724e-02 - 9 -1.3228565520703811e-02 -3.7950591025267766e-02 2.0421517542414661e-01 - 10 1.4592100832953753e-01 5.0467945019617289e-01 -7.4626980273333943e-01 - 11 -5.1925532167434674e-02 6.6189711468983248e-01 8.1768796712217684e-01 - 12 5.1995519711525773e-02 -1.5927701231286884e-01 1.9862297055802863e-01 - 13 1.1052397822448223e-01 -4.8902847823072948e-01 2.2436653549186952e-01 - 14 -1.2659521957922421e-01 1.2816580952653644e-02 -3.9238318659560040e-02 - 15 1.0828096163587569e-01 1.5750742059927378e-01 -4.9031658140836099e-02 - 16 -9.3819071598751372e-02 1.1363099411041987e-01 -2.8917292131028305e-01 - 17 6.1264072128814004e-02 -1.0300523555956453e-02 7.5263991898455590e-02 - 18 9.3662574156401057e-02 -9.7235276408278087e-02 1.4807349757758884e-01 - 19 -1.3885588032919249e-01 -5.8043962338309218e-02 2.8993245656022994e-02 - 20 -1.7941687952715857e-01 1.9675979738168892e-01 4.8524391854859461e-02 - 21 1.6055010729342936e-01 -8.1367480026234451e-02 4.7738041806187972e-03 - 22 2.9757987689549029e-02 2.6821741595825943e-01 5.0099879446351969e-03 - 23 8.0001033580391123e-02 9.3334873087038556e-03 -1.0495490808234802e-01 - 24 -1.0140395868207885e-01 -1.0454584382977056e-02 -4.3414162729483508e-02 - 25 -1.0758122712185991e-01 -7.4031425832087994e-02 7.9729207343358754e-02 - 26 -1.1995670080895027e-01 -1.3389321888390909e-01 5.7892521051779777e-02 - 27 5.0374698419944214e-02 -5.5882415283804526e-02 -6.1449715991752973e-02 - 28 -1.4765203681698147e-01 1.0766945779400883e-01 -1.2725063867138145e-01 - 29 9.8604349817134632e-02 -1.1569372528116473e-01 1.0229831981692472e-02 - 30 1.4286353986949066e-01 -1.3879111821390899e-01 7.8927078553209795e-02 - 31 1.3924003711072844e-02 1.3544044195264066e-01 1.3574982086169629e-01 - 32 -1.5074384592659218e-01 -1.6814340709227951e-02 -5.7556964094494831e-02 - 33 1.4184429434188114e-01 -3.5285331907102369e-02 -6.4237440338038271e-02 - 34 2.8579134215307045e-01 2.6727531865785603e-01 -5.8543384904504128e-02 - 35 -6.1822738170098798e-02 5.8781336914225123e-02 9.2908986409371730e-02 - 36 -9.5270981048167308e-02 -5.4657394491328407e-02 -1.4784901819268981e-01 - 37 -6.2050313799109447e-01 6.2522082639067444e-02 1.7931449902055974e-01 - 38 1.1783097105703605e-01 1.6630970573315029e-03 -7.7576019986230649e-02 - 39 1.5246274787180031e-01 6.3970465119924325e-02 2.2789344570593340e-02 - 40 3.0652623048947314e-01 -1.0727327421957705e-01 -3.0878707410990303e-01 - 41 -1.0805211258372868e-01 -1.2213265101714554e-02 1.1407035371979291e-01 - 42 -3.0772480548032222e-02 4.6330303739023915e-02 -2.8690841675368839e-02 - 43 -3.4159822655899680e-01 -6.1488889554779033e-02 -1.2996240931199338e-01 - 44 -3.9497049925369954e-03 -1.1835391368516579e-02 -9.1934856815404364e-03 - 45 2.5974287224213982e-01 -5.1237846099988077e-03 -9.2705797475414742e-03 - 46 -5.2983750718683130e-02 6.0115740314057198e-02 2.2945318498880257e-01 - 47 1.9907355212167138e-01 7.7186684778662140e-02 -1.4956254800833946e-01 - 48 1.1827333461841494e-01 -1.2568916016199683e-01 1.5822209053962674e-01 + 1 1.4523928143818243e-01 -1.3929628774251626e-01 -2.2193202165679504e-01 + 2 -1.4888486635136230e-01 -2.6063526711640916e-02 -1.4478022297928794e-01 + 3 7.4694779039319328e-02 1.3783885098108739e-02 5.0615444244240693e-02 + 4 3.2755484176683269e-01 8.2687145382012606e-02 2.7706418154125073e-01 + 5 -1.9487618076949093e-01 -1.5476548928884720e-01 -3.3995523475865319e-02 + 6 -1.6280484716164040e-01 1.0692512160669293e-01 7.9546957847854927e-02 + 7 -4.1096436025927680e-01 -1.0519083056977498e+00 -5.4911874797486127e-01 + 8 1.0948869227455840e-01 -7.7832299758263862e-02 5.4236852367759471e-03 + 9 6.1348615752589986e-03 4.1598019863209323e-04 1.7058171877151376e-01 + 10 -1.5712808901458009e-01 3.1666150315390695e-01 -3.8673677318414768e-01 + 11 2.5241887109849598e-01 1.0835590298968594e+00 6.7684603260332443e-01 + 12 1.0929561434598015e-01 -9.8721304901145446e-02 1.3607618084362350e-01 + 13 1.9273507357977371e-01 -7.2164963686745287e-01 4.5186768997073656e-01 + 14 -1.5848453973018978e-01 3.3113470557948388e-02 -1.1305514486116396e-01 + 15 1.1252953242087743e-01 1.7048512340132790e-01 -5.9479107526999309e-02 + 16 -1.5157326054362577e-01 1.5953706141320223e-01 -2.6168463347150472e-01 + 17 8.4256321160866149e-02 1.1564410613695841e-02 6.7724525667197083e-02 + 18 1.2490590750439914e-01 -1.0341870693273789e-01 1.7036800725414761e-01 + 19 -1.0739730176730145e-01 5.3330649260414531e-02 7.1708767042092780e-02 + 20 3.2379322474087824e-01 -5.0907444065681512e-02 9.8753956179216673e-02 + 21 -3.2999128236754971e-01 5.4204785681080787e-02 4.8279450219233230e-02 + 22 -7.4765774522692258e-02 4.7699073329804520e-01 -2.2281735026206262e-01 + 23 6.8863508721354438e-02 -1.7878338289392011e-02 -9.9173438125812183e-02 + 24 -7.8577157557266131e-02 -5.0248411888413197e-02 -1.4123364574283181e-01 + 25 -1.9258792989038448e-01 -3.1539276269801941e-01 2.2460900028594111e-01 + 26 -4.2717943368805078e-02 -8.9267364986677339e-02 6.0626469190050991e-02 + 27 4.9831402017722015e-02 -5.5445451236048104e-02 -5.9590911817627157e-02 + 28 -1.8907142209429909e-01 4.5324494805821236e-02 -9.4467229442665751e-02 + 29 5.5930426648412523e-02 -4.8696586677558606e-02 -5.8483687603893331e-02 + 30 1.4262565996850246e-01 -4.8417191613503219e-02 1.2281188659845149e-01 + 31 1.2614216879124895e-02 2.6895603128614665e-02 2.3510164973046432e-01 + 32 -1.2732003045823106e-01 7.1720979707068921e-03 -9.9735809034780853e-02 + 33 1.3527271651173031e-01 -6.6180483103488730e-03 -1.1094914910031367e-01 + 34 3.4722521516009131e-01 4.4959837545311077e-01 -3.5876610050225860e-01 + 35 -7.5624957907766244e-02 1.9671353651186295e-02 1.4365257627104355e-01 + 36 -6.6345951448375795e-02 -4.0269970723331425e-02 -6.4399606392040343e-02 + 37 -5.6500964645498986e-01 1.4144085588212263e-01 9.5494679163035112e-02 + 38 1.2580216714456038e-01 -6.9408948600315268e-02 -3.0321934060620892e-02 + 39 1.4592286611086547e-01 3.5525527763094533e-02 -6.6586600954265940e-03 + 40 3.5383843460474595e-01 -1.5294076173939258e-01 -2.5079960435863197e-01 + 41 -1.2183342418307817e-01 3.1921696868649041e-02 7.1299718159474224e-02 + 42 -1.8595301332172742e-02 8.8416943066543019e-02 -5.0925055070872971e-02 + 43 -4.2007029877545327e-01 -3.4751306431854513e-02 -5.2454756798769708e-02 + 44 -6.2942516395232129e-03 -1.5123696182036517e-02 -1.1259076342248930e-02 + 45 2.6615497453609183e-01 -4.0511430296863229e-02 -2.2095145792143611e-02 + 46 -1.0848220332519289e-01 -5.1475114256489901e-02 2.2347978706754848e-01 + 47 2.1855474680417530e-01 1.1692733664291685e-01 -1.0595061421602284e-01 + 48 1.2371768487044776e-01 -6.5144798898410239e-02 1.2893158600243251e-01 ... diff --git a/unittest/force-styles/tests/manybody-pair-snap.yaml b/unittest/force-styles/tests/manybody-pair-snap.yaml index 2dc2b6a56..8fac28201 100644 --- a/unittest/force-styles/tests/manybody-pair-snap.yaml +++ b/unittest/force-styles/tests/manybody-pair-snap.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:26 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:31 202 epsilon: 5e-13 prerequisites: ! | pair snap @@ -85,73 +85,73 @@ init_forces: ! |2 62 -6.2693637951458694e+00 5.5593866650560679e+00 -4.0417158962655781e+00 63 5.8570431431678962e+00 -6.2896068000076317e+00 -3.8788666930728688e+00 64 7.5837965251215369e+00 7.5954689486766096e+00 1.6804021764142011e+01 -run_vdwl: -489.468066110652 +run_vdwl: -473.666568306022 run_coul: 0 run_stress: ! |2- - 3.7167872895847819e+02 3.7917710068041862e+02 4.0385320198584714e+02 -1.3691599706785452e+01 9.5517308985477115e+01 9.7589276560912452e+00 + 3.9951053758431499e+02 4.0757094669497650e+02 4.3599209936956868e+02 -2.5012844114476398e+01 1.2751742945242590e+02 3.9821818278564844e+00 run_forces: ! |2 - 1 -2.6200062192163251e+00 6.5895070779555507e+00 5.6608861291961521e+00 - 2 -6.0189354199893055e+00 -5.0918745113944741e-01 -5.3313245647285701e+00 - 3 -8.3868957617449347e-01 -8.8585183150038882e-01 2.9968107645220203e+00 - 4 -3.0213465402043513e+00 6.9725231357285278e+00 2.1167504663792536e+00 - 5 -1.7586848423194312e+00 -3.2933741468811113e+00 -9.3080751290253794e-01 - 6 2.2991165379551211e+00 3.3795036971656218e+00 2.2660197467514911e-01 - 7 -2.0012695381123020e+00 -2.5159443018298786e+00 6.2116996571724714e-01 - 8 -5.4873779786282280e-02 1.5854566692139420e+00 -1.0066392618014335e+00 - 9 8.0189242689618823e-01 -3.0847017825088381e+00 -6.9542340364711075e+00 - 10 -8.9128976791778458e-01 -6.7393019870592596e-02 -3.2723844475537232e+00 - 11 4.5456393443054912e+00 -4.5148464719144190e+00 2.1620709337139968e-01 - 12 -1.0605260639103395e+01 -3.7437284480399846e+00 -4.2782571870680677e+00 - 13 -4.8758021083010261e-01 1.0840591566757563e+01 1.4417301279067696e-01 - 14 -2.8043941505268610e+00 6.4438899074280922e+00 1.6101766369425605e+00 - 15 -5.6397727632249364e+00 5.8479631324846277e+00 -5.1195271857482449e+00 - 16 2.6358192742443949e+00 1.7064832375903805e-01 1.0429654093017419e+01 - 17 2.6492424666949290e+00 4.1865915382220376e+00 -9.0595086171557835e+00 - 18 1.1206473927093965e+00 2.2123081794070867e+00 5.8589201221087297e+00 - 19 -2.7367744247531407e+00 -8.2975485638465030e-01 -2.0790334392182506e+00 - 20 -1.2201950287425824e+01 8.9293356122790912e-01 -6.4486216284160913e-01 - 21 3.4454631697777547e+00 -7.8278081568080715e-01 -9.0435968147049834e+00 - 22 -9.9116182027989090e+00 3.7537117149502626e+00 -6.2041013601325021e+00 - 23 2.3598327627157216e+00 4.6653030563297371e+00 6.1390590162436629e+00 - 24 2.9885018662473075e+00 2.9838762041793117e+00 4.3228545839763353e+00 - 25 6.1001404235465873e-01 -1.1881822928224506e+00 1.5040997261686755e+00 - 26 -1.8763705008872589e+00 -1.2599849620161696e-01 6.2992383249894968e-01 - 27 3.2706304707445661e+00 -1.9852603643313311e+00 4.2180376607986316e+00 - 28 -3.1071530373299328e-01 1.5750530088540251e+00 9.6837465049814817e+00 - 29 -6.1417582599413301e+00 3.9164321009855735e-01 9.7685688363955525e-02 - 30 -3.1388355174211173e+00 1.6122297260129073e+00 -1.1081505352088683e+00 - 31 -2.6098520190441956e+00 2.2795861569825959e-01 -2.7458401111959434e+00 - 32 -6.1422237837124225e+00 -5.1210288634460155e-01 5.4514825686867430e-01 - 33 7.4141036509796692e+00 -2.7884535553661660e+00 6.2033448623898559e+00 - 34 -1.4244505798620721e+00 -3.3429770690737826e-02 1.9184700282588758e+00 - 35 1.5632007556515113e+00 -9.5418452153127342e-01 4.1257737822747131e+00 - 36 1.2821238454090218e+00 -3.9489216486981342e+00 -8.6269270447002055e-01 - 37 -2.7537235028447835e+00 4.6513692386669439e+00 -5.6290489372162664e+00 - 38 1.9992052623036176e+00 -4.2983333004702118e-01 -1.0733048030046968e+00 - 39 2.1765892902345501e+00 -3.8586421759387579e+00 -9.0645286263473626e+00 - 40 7.4374269075019228e+00 -4.3433135301581780e+00 -4.0455383168563580e-01 - 41 1.0342805569134947e+00 1.6523945993277380e+00 -1.5772104911434006e+00 - 42 -8.1195815614370144e+00 -5.8763972130775510e+00 -3.1222551004416625e+00 - 43 -2.7912198462705129e-01 -1.1167330547751890e+01 -6.3698536543297893e-02 - 44 6.9463399563146941e+00 -6.4872117822671056e+00 1.0874644094280277e+00 - 45 3.0267523524516771e-01 2.2378774625062920e+00 -4.7768000279857024e+00 - 46 -2.2570016757486311e+00 -4.0040746828789402e+00 9.8689525243895062e+00 - 47 4.2785305080294540e+00 1.5325832230443668e+00 3.3589203411901578e+00 - 48 2.2413400699812387e+00 3.3580569902180790e+00 -1.2661375290157233e+00 - 49 -1.1421201760383113e+00 -1.0752096896646723e+01 -6.5722133309475623e+00 - 50 3.4180454936299673e+00 5.0411589857253736e+00 -5.8332155561548138e-01 - 51 -1.7223504936879914e+00 9.2697024243389734e+00 7.0442106476591251e+00 - 52 8.0098592133005564e+00 -5.9122394581044277e+00 1.0101406704527049e+01 - 53 3.4161226658911734e+00 5.7780690168335065e+00 4.1927204150859252e+00 - 54 2.4972457061023663e+00 -3.7172022065563901e+00 -2.6131222195234471e+00 - 55 2.5539298626493641e+00 -5.6377686174334087e+00 -3.5151115361687237e+00 - 56 5.1189498205615180e-01 1.1342419773973278e+00 -4.2814131693243027e+00 - 57 2.1690816717712811e+00 -1.3704555520632908e+00 -6.0759785348037931e-01 - 58 4.3539661764216397e+00 -1.4572581960607027e+00 -9.9173296914445030e-01 - 59 6.7962624211316545e+00 2.0240756728926979e+00 -8.0188277109816075e-01 - 60 -2.3372986868253900e+00 -1.1397492261021371e+01 -7.3457073057764761e+00 - 61 1.1003078657122005e+00 3.5366731859023495e+00 -1.4254057900337883e-01 - 62 -5.1368600009373075e+00 3.5663926174152012e+00 -2.2708852648200115e+00 - 63 4.4200660412946746e+00 -4.6975137723775120e+00 -2.5446183902678694e+00 - 64 4.3353125159604282e+00 4.7586391643778274e+00 1.2965475525931360e+01 + 1 -3.7832595710893155e+00 8.8212124103655292e+00 6.7792549500694745e+00 + 2 -7.6693903913873163e+00 -4.4331479267505980e-01 -5.8319844453604492e+00 + 3 -3.5652510811236748e-01 -1.2843261396638010e+00 2.3164336943032460e+00 + 4 -4.6688281400123417e+00 9.2569804046918627e+00 4.2532553525093961e+00 + 5 -2.0698377683688305e+00 -3.0068940885360655e+00 -1.5557558367041349e+00 + 6 1.9121936983089021e+00 4.6485144224151016e+00 3.8302570899366983e-01 + 7 -3.0000564919294019e+00 -3.9598169423628935e+00 1.4730795882443171e+00 + 8 2.2616298546615310e-01 1.3160780554993146e+00 -1.1365737437456360e+00 + 9 4.5475496885290934e-01 -3.0115904820513633e+00 -7.6802788934953448e+00 + 10 -6.5754023848348220e-01 4.3910855294922169e-02 -5.2814927356947416e+00 + 11 8.0870811363765238e+00 -6.6478157150338770e+00 2.5239196033647513e+00 + 12 -1.4266979871278297e+01 -7.9890391049193692e+00 -7.6506348180232058e+00 + 13 -3.0605842642063994e+00 1.3809674690005217e+01 -1.6731082107132822e+00 + 14 -3.0058694850615257e+00 8.5169039650285132e+00 1.8498544937038552e-01 + 15 -8.6057398167379340e+00 9.1431278151038597e+00 -9.5164336499508586e+00 + 16 3.7105123804670184e+00 1.9684880085511294e+00 1.5628485674431591e+01 + 17 5.0446625217738115e+00 6.1086935560886335e+00 -1.0684670022014132e+01 + 18 1.6342572076662352e+00 3.0978003138559700e+00 7.3023410755539730e+00 + 19 -2.9853538081785418e+00 -1.1736228416330263e+00 -2.8772549755196275e+00 + 20 -1.6354717680325663e+01 2.4069036913441169e+00 2.5852528541413577e-01 + 21 3.9596059647558470e+00 -1.1309140461374385e+00 -9.2411865520092746e+00 + 22 -1.5578599385494211e+01 8.8837889458923414e+00 -1.2717012806950681e+01 + 23 2.9286474436436607e+00 5.4115499463398438e+00 7.4875237575502283e+00 + 24 3.2309052666659346e+00 4.6724691716691664e+00 6.3076914533727404e+00 + 25 8.7447853599857761e-01 -1.4447800235404800e+00 1.6369348219913344e+00 + 26 -1.8229284577405889e+00 -3.3721763232208768e-01 6.1531223202321172e-01 + 27 4.3482945496099807e+00 -2.9274873379719288e+00 5.2404893120488989e+00 + 28 -7.6160360457911214e-01 1.1530752576673735e+00 1.3094542130299224e+01 + 29 -6.6257114998810200e+00 1.6523572981586176e+00 -1.0670925651816274e+00 + 30 -3.6586042068050459e+00 2.0111737944853250e+00 -1.5501355511382873e+00 + 31 -3.1601602861552482e+00 3.3256891161094693e-01 -3.0724685917071382e+00 + 32 -7.8275016718590731e+00 4.4236506496773642e-01 8.3868054333668041e-01 + 33 1.0688722918141039e+01 -5.7920158261872583e+00 9.6923706747923646e+00 + 34 -1.3525464452783258e+00 -1.0575652830645854e-01 1.6380965403350563e+00 + 35 2.5193832475087721e+00 -2.2598987796878789e+00 5.6810280412635601e+00 + 36 1.7111787089042565e+00 -4.4473718671663391e+00 9.6398513850121076e-02 + 37 -3.8563809307986823e+00 5.6131073606614059e+00 -6.6177968130852260e+00 + 38 1.5064516388374909e+00 -3.1694753678232956e-01 -8.3526359314898979e-01 + 39 4.1314418694153812e+00 -6.2751004763663678e+00 -1.1210904504268449e+01 + 40 9.5830290785144836e+00 -7.0395435048262769e+00 -1.6267459470122683e+00 + 41 3.1375436243120802e-01 1.0622164383329200e+00 -2.2467935230672076e+00 + 42 -9.4881290346220375e+00 -6.3542967900678029e+00 -3.7436081761319060e+00 + 43 2.2855728522521823e-01 -1.3797673758210431e+01 5.1169123226999269e-01 + 44 8.0135824689800454e+00 -8.1618220152116709e+00 3.4767795780208774e+00 + 45 -2.2793629160624870e-01 3.8533578964252726e+00 -7.3720918772105994e+00 + 46 -3.5217473183911405e+00 -5.1375353430494126e+00 1.2535347493777751e+01 + 47 5.1244898311428937e+00 2.3801653011346930e+00 5.1114297013297003e+00 + 48 2.1906793040748171e+00 3.0345200169741182e+00 -1.0179863236095192e+00 + 49 -2.4788694934316329e+00 -1.2411071815396923e+01 -8.4971983039341392e+00 + 50 3.6569038614206466e+00 5.6055766933888798e+00 -7.2525721879624516e-01 + 51 -3.1071936932427051e+00 1.1143003955179145e+01 8.9003301745210983e+00 + 52 1.2953816665492676e+01 -1.1681525536724189e+01 1.6495289315845085e+01 + 53 5.8923317047264643e+00 7.6559750818830006e+00 5.7413363341910788e+00 + 54 4.6456819257039355e+00 -5.7613868673147293e+00 -4.6785882460677595e+00 + 55 4.9036275837635479e+00 -8.4131355466563491e+00 -6.4652425471547437e+00 + 56 -2.5919766291264371e-02 1.4942725648609447e+00 -5.1846171304946838e+00 + 57 2.1354464802186661e+00 -1.3197172317543322e+00 -8.9084444403811647e-01 + 58 5.2496503717062382e+00 -2.5023030575014631e+00 1.2534239362101771e-01 + 59 9.1088663289515797e+00 4.2501608997098561e+00 -1.8293706034164023e+00 + 60 -5.2377119984886820e+00 -1.5252944642880552e+01 -9.9884309435445626e+00 + 61 9.8418569822230928e-01 3.6718229831397404e+00 -7.9620939417097958e-01 + 62 -6.2529671270584286e+00 5.5348777429740972e+00 -3.9890515783571203e+00 + 63 5.8510809377900035e+00 -6.3420520892802621e+00 -3.9437203585924383e+00 + 64 7.6647749161376320e+00 7.7322248465188412e+00 1.6865884297614787e+01 ... diff --git a/unittest/force-styles/tests/manybody-pair-snap_chem.yaml b/unittest/force-styles/tests/manybody-pair-snap_chem.yaml index 8e8c2c8f8..b1816e1e3 100644 --- a/unittest/force-styles/tests/manybody-pair-snap_chem.yaml +++ b/unittest/force-styles/tests/manybody-pair-snap_chem.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:26 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 5e-13 prerequisites: ! | pair snap @@ -87,73 +87,73 @@ init_forces: ! |2 62 -2.7862663394350542e+00 2.5876139756856791e+00 -1.7815179130043122e+00 63 2.4339134295594302e+00 -3.1961735689987636e+00 -4.7891394265908094e-01 64 3.0382364587319710e+00 3.0430454898558588e+00 5.3416679902175384e+00 -run_vdwl: -187.654391839485 +run_vdwl: -185.37158003654 run_coul: 0 run_stress: ! |2- - 2.1286434186597302e+02 2.1516140376524692e+02 2.2014270591458137e+02 -4.1189309434634733e+00 2.5671737667284511e+01 3.4094574165486393e+00 + 2.1623225685916989e+02 2.1844347630762962e+02 2.2331780542890360e+02 -5.3222115188692429e+00 2.9861519391528514e+01 1.4556702426797457e+00 run_forces: ! |2 - 1 -7.3369133823405508e-01 2.7667970855721853e+00 1.6328050345720810e+00 - 2 -2.2299658853721520e+00 -7.5585568905659906e-01 -1.5309002377019634e+00 - 3 2.8912410060639326e-01 4.3705738858658788e-01 -2.1722808227078966e-01 - 4 -1.6432999484262196e+00 2.7237882915593286e+00 4.6054246395477511e-01 - 5 -1.9915642544829795e+00 -5.0514454245912743e-01 -2.4023101827231930e-01 - 6 3.1580339744901642e-01 2.2624378988705485e+00 1.0700232878883544e+00 - 7 -4.3667900724170972e-01 -4.6326888074447953e-01 1.8815161287461792e+00 - 8 4.0891558557492069e-01 9.8444761132021874e-01 -1.1994011642190259e+00 - 9 -3.9943153478795002e-01 -2.2209279455737700e+00 -2.5915912103444558e+00 - 10 -1.9471351965318257e-01 -1.4496690804153802e+00 -2.2623893657434899e+00 - 11 2.4362905726150652e+00 -2.3810030225467518e+00 1.8905835689476458e+00 - 12 -4.8961713945288103e+00 -2.6394975897948498e+00 -2.0372233198924383e+00 - 13 1.3378868571704172e-01 4.5775961871578881e+00 -9.1227708328468249e-01 - 14 -1.5297526207810275e+00 3.0522662572662154e+00 4.9107580456119410e-01 - 15 -2.6765425425933294e+00 3.8247215679834969e+00 -2.5375795218582073e+00 - 16 1.5196290196835527e+00 -3.2914146438878389e-01 4.1849431488039173e+00 - 17 2.0043578760825342e+00 2.8234226231079935e+00 -2.9923076186199422e+00 - 18 -5.0347976264338057e-01 8.8149323898758736e-01 2.9370157524159062e+00 - 19 -1.4078018510609827e+00 -2.2820746919860544e+00 -3.7825546052719117e-01 - 20 -5.3044185428231128e+00 -5.5789399083648994e-02 4.5964111618433973e-01 - 21 1.4678310024890862e+00 1.7118675240827930e-01 -2.7319662502952067e+00 - 22 -4.2798753174007294e+00 3.0607656650226120e+00 -3.9192708818666375e+00 - 23 1.8070160916189431e+00 2.8893260418555093e+00 1.4715768249778458e+00 - 24 1.7943331384890695e+00 5.6727833662928906e-01 2.4453386937887558e+00 - 25 9.4127417840102234e-01 -3.2082226320611557e-01 1.0317887157557444e+00 - 26 -4.7367357683060307e-01 -2.6670219998362305e-01 8.5910453505400930e-01 - 27 1.9119897296615520e+00 -3.9246942513009325e-01 1.2080897134422011e+00 - 28 1.8999192393940639e-01 1.6499913470409528e+00 3.7514920356690027e+00 - 29 -2.7287724915818705e+00 7.5140952246304560e-01 -7.1978618410778783e-01 - 30 -1.6121881543481549e+00 4.7145279745822877e-01 -9.4382533006887581e-01 - 31 -6.9302105329788111e-01 8.6622808992775768e-01 -7.1688447301762359e-01 - 32 -2.1877722619109319e+00 3.1241022059139389e-01 -2.0363529214606557e-01 - 33 3.7351462993820110e+00 -2.1144175359802810e+00 2.6418390367829683e+00 - 34 4.3814257629996645e-01 1.4381263658420229e-01 1.5892319607512340e-01 - 35 1.2481610501512843e+00 -1.4422631315933609e-01 2.3732508438175173e+00 - 36 -4.1515332308320585e-01 -2.0958691183365055e+00 -6.0782500168498454e-01 - 37 -1.8737832564668855e+00 1.5868160141680505e+00 -2.1502811274719518e+00 - 38 -8.3799314060681018e-01 -1.1168329368636831e-01 7.5420009101163310e-01 - 39 2.4623601668269162e+00 -1.3731570495025482e+00 -3.1300208221580803e+00 - 40 4.2396805048038360e+00 -1.9896514878251754e+00 -1.6439304927095424e+00 - 41 4.5291426717441341e-01 -2.1649648555890380e-01 -1.0103115219148229e+00 - 42 -3.4063198353810029e+00 -1.7197481999679392e+00 -7.1574757576947756e-01 - 43 6.7969745762235023e-01 -4.4139560697511868e+00 -7.1374160410199727e-02 - 44 2.9022254223989670e+00 -3.0658233607366547e+00 1.4095258293816717e+00 - 45 -1.8021584516545361e+00 1.1139426059206650e+00 -2.3612665451280646e+00 - 46 -6.4055392057875404e-01 -1.5437936507527419e+00 4.7629947723944071e+00 - 47 2.4596732256156768e+00 1.3839195366764612e+00 1.4983351229907538e+00 - 48 1.4286951465559077e+00 2.5226997121023853e-01 -3.1703206977278775e-01 - 49 -2.4980250315840102e+00 -4.2937298563437425e+00 -2.7685866462265776e+00 - 50 2.3859148339052538e-01 2.5999038034992465e+00 -1.1882197967404982e+00 - 51 -1.8541927042572155e+00 2.5220449582545057e+00 3.6251170038994069e+00 - 52 4.0017526007315176e+00 -3.9563125820844278e+00 4.1997432909076782e+00 - 53 2.9944010593604022e+00 3.2831372076580596e+00 2.6928034831187952e+00 - 54 1.5871022597839066e+00 -2.8228944858891349e+00 -1.9576122929926079e+00 - 55 6.8049238759975672e-01 -2.2839449322075804e+00 -2.6675101357177540e+00 - 56 -1.1904103145927025e-01 -4.1523795497197880e-01 -1.6223721062486278e+00 - 57 -1.3403241451059258e-01 -1.1130134152852764e+00 -1.0367473155144330e-01 - 58 2.4136361939725450e+00 -9.4464777619607920e-01 1.2128229032096651e+00 - 59 2.7939168112815209e+00 2.0644797911549650e+00 -2.2194096868290583e+00 - 60 -2.2516089079596044e+00 -4.9525359014312329e+00 -2.6471467342704211e+00 - 61 -9.1969687435720560e-01 1.4906668816471620e+00 -9.1416116187655894e-01 - 62 -2.5974358252612539e+00 2.3448472464785919e+00 -1.4775087114289542e+00 - 63 2.3319640999455080e+00 -3.2577489670850337e+00 -4.7807587290002385e-01 - 64 2.9639114599347880e+00 3.0313370540601499e+00 5.0817272896875831e+00 + 1 -8.9945686093718891e-01 3.1102506844270676e+00 1.7924405901882392e+00 + 2 -2.3568426321865519e+00 -7.2157123823439751e-01 -1.5714999679660120e+00 + 3 5.9411461824307632e-01 2.8183072295935307e-01 -4.5584602006848729e-01 + 4 -2.0142955850044015e+00 2.9566870880684544e+00 9.5256971160575310e-01 + 5 -1.9922574807409990e+00 -4.3135288450095111e-01 -3.7982056237068562e-01 + 6 -5.1798692305348421e-02 2.3723138325448181e+00 9.3505820052018818e-01 + 7 -5.9119307570788093e-01 -7.7558353156540627e-01 2.1544553310334216e+00 + 8 5.8948882611514830e-01 1.0627350289336350e+00 -1.2852382666540922e+00 + 9 -3.3097669603148050e-01 -2.0880700958311560e+00 -2.5728226298711561e+00 + 10 -1.9927857234351742e-01 -1.4707681067903973e+00 -2.8077583365509944e+00 + 11 3.1207021637041077e+00 -2.8777137799483214e+00 2.2513409071418939e+00 + 12 -5.3967388032136201e+00 -3.2755306245890572e+00 -2.5607263918480787e+00 + 13 -5.6089163267500575e-01 5.0895164624360953e+00 -1.2955340742015935e+00 + 14 -1.4424532600588069e+00 3.3397136313988538e+00 4.5056661625381278e-01 + 15 -3.1074264051087690e+00 4.4511163568785594e+00 -3.2255959617646495e+00 + 16 1.7028459742310051e+00 -1.9401543199346183e-01 4.9988885414419002e+00 + 17 2.3696411307116665e+00 3.0980579975818054e+00 -3.3992055709392099e+00 + 18 -2.7992627916472068e-01 7.5956985532908217e-01 3.0731406281977875e+00 + 19 -1.3087170031025481e+00 -2.2579241841048194e+00 -3.5423832115910026e-01 + 20 -5.9291180532530054e+00 3.0139344848989125e-01 6.6702127138861189e-01 + 21 1.4061702325656915e+00 3.6170742151671309e-01 -2.6186453774142455e+00 + 22 -5.1213538363270104e+00 3.6881133786353173e+00 -4.8334441466973619e+00 + 23 1.7799014438457179e+00 2.9383932016836729e+00 1.4889345853939060e+00 + 24 1.6265217601475135e+00 8.8638236910287549e-01 2.7958579602051579e+00 + 25 1.0261772589787777e+00 -4.3124823838990639e-01 1.2394756760658081e+00 + 26 -3.6788963153370424e-01 -3.8430715508218222e-01 8.2234939362562109e-01 + 27 1.9227116387813055e+00 -3.1924343057968851e-01 1.2219662551930728e+00 + 28 2.3558028807578302e-01 1.4603195758319958e+00 4.1124437707751715e+00 + 29 -2.7963204027225057e+00 7.9250484371162710e-01 -8.2374097886304931e-01 + 30 -1.8521850555057384e+00 6.8904513184563698e-01 -9.2377203073191461e-01 + 31 -7.0737710488564920e-01 8.7160390581421554e-01 -7.5132187044876142e-01 + 32 -2.3972194269400724e+00 4.0579824422398403e-01 -1.2192450250956055e-01 + 33 4.3391252363949713e+00 -2.6734632549855011e+00 3.1813837430923790e+00 + 34 5.0892540867377134e-01 1.3196433190574863e-01 9.1854393014863867e-02 + 35 1.2518949422589467e+00 -4.0131662341328833e-01 2.5682121097610247e+00 + 36 -1.4250724827861927e-01 -2.2940369352156500e+00 -2.7656165676472910e-01 + 37 -2.1638911011422111e+00 1.9200057202539940e+00 -2.2495537548075712e+00 + 38 -9.8448646953871100e-01 -1.7353311784227321e-01 6.9784505363718075e-01 + 39 2.8621020667478243e+00 -1.7235695529844155e+00 -3.4231784253086803e+00 + 40 4.3701211996432816e+00 -2.2721992461764238e+00 -1.7277010563698145e+00 + 41 2.7615064013020879e-01 -3.9976618325080288e-01 -1.2290534994924236e+00 + 42 -3.5411751645812308e+00 -1.6301898139986259e+00 -6.9693956624465969e-01 + 43 8.3282307590551552e-01 -4.8791394930408867e+00 1.5641553921436965e-01 + 44 3.0588569737321962e+00 -3.3230712362593824e+00 1.7740893109825144e+00 + 45 -1.8543980101593716e+00 1.5090063048017774e+00 -2.7391343400007346e+00 + 46 -9.0836218859416373e-01 -1.7703257020194161e+00 5.0074804595763203e+00 + 47 2.6157347327468776e+00 1.6066618984181202e+00 1.5922002611321855e+00 + 48 1.4730694115534324e+00 6.0150682431382663e-02 -2.9959320813488199e-01 + 49 -2.4357178268972279e+00 -4.2752924255184093e+00 -2.8456954906038585e+00 + 50 2.5008857416428043e-01 2.7975929070952108e+00 -1.0870819292025393e+00 + 51 -1.8364703217563023e+00 2.6546000140944859e+00 3.7824174449012462e+00 + 52 4.6470415706761310e+00 -4.8541726113169865e+00 5.0978546929624020e+00 + 53 3.0332748609694704e+00 3.3674028164180130e+00 2.5018294078539540e+00 + 54 1.8687605158732028e+00 -3.0896400645801418e+00 -2.2872620802274950e+00 + 55 1.1194011524426077e+00 -2.5850952550361570e+00 -3.2174616299206584e+00 + 56 -1.2168319727714011e-01 -1.1667111392940022e-01 -1.7915767087323147e+00 + 57 -1.3228227178289417e-01 -9.1363578630224795e-01 -5.3462423971004584e-02 + 58 2.4842158694223677e+00 -1.2568730326784874e+00 1.5401682371106145e+00 + 59 3.0140102195799274e+00 2.1895971720503873e+00 -2.3881807893321017e+00 + 60 -2.2877466661828931e+00 -5.2803433601364151e+00 -2.7505525589065760e+00 + 61 -1.0115642352983962e+00 1.5284330358705578e+00 -1.0029499332563923e+00 + 62 -2.7811684029592287e+00 2.5821146485313546e+00 -1.7679954771137567e+00 + 63 2.4383789403708427e+00 -3.2264210802804598e+00 -5.0624191626484460e-01 + 64 3.0873388675112903e+00 3.1015018772904330e+00 5.3730513624445901e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-sw-multi.yaml b/unittest/force-styles/tests/manybody-pair-sw-multi.yaml index 45d912c0c..883fb81b4 100644 --- a/unittest/force-styles/tests/manybody-pair-sw-multi.yaml +++ b/unittest/force-styles/tests/manybody-pair-sw-multi.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:26 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 2e-08 prerequisites: ! | pair sw @@ -83,73 +83,73 @@ init_forces: ! |2 62 -5.8762448689533544e+00 5.8942813011991326e+00 -4.1862202974892249e+00 63 6.2441950513095250e+00 -4.6853003614172328e+00 -7.1748142164134499e-02 64 3.3607381935199805e+00 3.2378383101927035e+00 8.2922830712908908e+00 -run_vdwl: 19.8072602419103 +run_vdwl: 26.7375240198584 run_coul: 0 run_stress: ! |2- - 9.1390363988714034e+02 9.1951651479659233e+02 9.2668428352248520e+02 -5.2984147862115076e+00 3.7625408334862954e+01 3.2051937916419488e+00 + 9.2206864114246116e+02 9.2921570510249978e+02 9.3635035039956881e+02 -5.4393597598180481e+00 4.2755527181283895e+01 6.4912801883099647e-01 run_forces: ! |2 - 1 -1.5284730763200560e-01 3.8172151545616444e+00 1.0168503497368047e+00 - 2 -2.8515988027093400e+00 -6.0968372901702494e-01 1.7256603688253935e-02 - 3 1.1146389047910072e+00 1.6614111600330044e+00 6.3676683357797126e-01 - 4 -3.3648566765740400e+00 3.6516610474224414e+00 -2.9098414971322515e+00 - 5 -4.5846512855840436e+00 1.6883148551150473e-02 -4.0868370268280718e-01 - 6 -1.3002483767759503e+00 3.2609218497599373e+00 2.9951811804056216e+00 - 7 -6.3758260374982312e-01 -2.3667639719647178e+00 6.1040092602077376e+00 - 8 7.2611045847713540e-01 1.7131228100338296e+00 -3.3331152296001285e+00 - 9 1.0174635499202966e+00 -3.5418896696884814e+00 -5.4414669644351701e+00 - 10 -5.6738756794623413e-01 -3.0401734464229921e+00 -2.9313851917820131e+00 - 11 2.5396723941201182e+00 -4.0685321809935306e+00 4.0718488306335860e+00 - 12 -7.4747296390755338e+00 -4.7547264901392232e+00 -1.1281779474673606e+00 - 13 2.0634964577695856e+00 4.4706508799704379e+00 -2.4133549173203712e+00 - 14 -1.8242975219825477e+00 4.5526371610706891e+00 2.2486039035720937e+00 - 15 -4.2775888742681865e+00 6.1110208958154404e+00 -1.5100458656642235e+00 - 16 2.7354633120474716e+00 -2.3407336807728365e+00 5.3358536263062000e+00 - 17 4.9869793173076431e+00 3.9083882264254277e+00 -5.4224906421086958e+00 - 18 -2.7105387319483438e+00 1.6535632817769448e+00 4.1496667610600042e+00 - 19 -7.9694360631920147e-01 -1.9592570226038628e+00 1.4219890816089698e-01 - 20 -7.4044835455706952e+00 -1.8186532500230552e+00 5.0469677686815106e-01 - 21 3.2554493726424818e+00 1.5504934323383981e+00 -4.2708579190106590e+00 - 22 -3.9165618778402647e+00 4.2015644461033368e+00 -3.9463232078906452e+00 - 23 5.4150041468607126e+00 5.4599185364061054e+00 1.2317227670371538e+00 - 24 3.3200955951465971e+00 -1.7481783651092901e+00 4.4668521639151102e+00 - 25 -3.6588034989779572e-01 -4.2215256641440879e-02 1.5494280204758231e+00 - 26 4.6497724052627754e-01 -1.6913221443008841e-01 4.8305258814543892e+00 - 27 3.0511331655602310e+00 2.4720858701870370e+00 4.1037460797386682e+00 - 28 -3.6412552800645570e-01 5.2968463937220012e+00 4.0851493007455932e+00 - 29 -5.7282950316123102e+00 2.2415836508890341e+00 7.0497683071922301e-01 - 30 -3.9360783853958679e+00 -3.5028641752732259e-01 -1.3267719331100807e+00 - 31 -3.1996908900709831e+00 2.3195381217864712e+00 8.6566113628298269e-01 - 32 -4.1934052619705353e+00 1.7194593831848892e+00 6.6502210951020446e-01 - 33 3.8213735815121259e+00 -2.1848089351257471e-01 3.3432772141767759e+00 - 34 3.2964588414108604e+00 3.3438941542380940e-01 -7.8757625958516719e-01 - 35 2.6355237132468980e+00 1.9438160231764634e+00 3.0017721230704257e+00 - 36 -2.2106118606769889e+00 -4.8369962100390849e+00 -9.7003448295869238e-02 - 37 -2.6166970950140440e+00 1.4135010802769816e+00 -3.0340678569859412e+00 - 38 -1.8547289832196194e+00 -2.4609883854951919e-01 1.3766128066510439e+00 - 39 4.9170205683738795e+00 -7.8307417744462426e-01 -6.4967317836721463e+00 - 40 5.5539742539208694e+00 -3.0418082466398668e+00 -2.6346955977236997e+00 - 41 -7.2084862404026451e-02 -2.9650260148844225e+00 -2.4127376619876548e+00 - 42 -7.1099091722193704e+00 -3.8728995854118531e+00 8.9607000802964587e-01 - 43 1.2772926326457257e+00 -8.0641497847427779e+00 -1.1979253666748355e+00 - 44 6.3275778902329698e+00 -5.0939770334947871e+00 4.5763897463933872e-01 - 45 -4.1384713174295387e+00 -7.5974289099124848e-01 -3.9591244072711658e+00 - 46 -1.5330720102669051e+00 -2.8494350562995168e+00 7.3277629112332159e+00 - 47 4.0927190686131443e+00 2.1401263586348334e+00 3.2786419658628352e-01 - 48 4.1730804015628600e+00 -1.4946280976381667e+00 -1.0493118788579503e+00 - 49 -5.3442444185223668e+00 -6.5696776957306113e+00 -2.6938169215347401e+00 - 50 -8.3761106934299523e-01 4.6845215172232324e+00 -1.6208825157871269e+00 - 51 -2.0065132608046610e+00 1.1092813896356506e+00 7.1705548128000354e+00 - 52 7.0777723708333280e+00 -3.8863255903298635e+00 2.8138153005856772e+00 - 53 4.0594332740789065e+00 3.8197360168002352e+00 3.5791145156414172e+00 - 54 2.5216730877332072e+00 -5.1013242579496811e+00 -3.6211737684524539e+00 - 55 -3.7330754133589483e-01 -3.8341600886844747e+00 -4.4903045860606703e+00 - 56 1.6476459199502638e+00 -1.2042335461580564e+00 -2.1949195755180275e+00 - 57 3.9772214614364254e-01 1.5384162837095778e+00 -1.6369950577440897e+00 - 58 5.4557851448320749e+00 1.5778525958322920e-01 6.3128743400146203e-01 - 59 4.1859078247719612e+00 3.5064680009939551e+00 -5.4012959814404340e+00 - 60 -4.2696629551960559e+00 -5.9899085006017048e+00 -2.5963403311435469e+00 - 61 -3.5502280579768906e+00 3.3258701983012884e+00 -3.7671998220773366e+00 - 62 -5.3282207309127703e+00 5.2572350908152350e+00 -3.5569650679978193e+00 - 63 5.5106246291361662e+00 -4.8535178853780963e+00 2.8414203389183856e-01 - 64 3.2550859360838498e+00 3.1655780052020859e+00 7.3556532516114617e+00 + 1 -2.4304100085068114e-01 4.5462134211866774e+00 1.0882497744448840e+00 + 2 -3.2380857681066026e+00 -5.4612994987041885e-01 -7.2257431719128185e-02 + 3 1.8322924202100461e+00 1.4490491742384457e+00 3.9060011337840983e-01 + 4 -3.7467897625003541e+00 3.9605710693010132e+00 -2.7621892794066669e+00 + 5 -4.9655972645599498e+00 -1.4859279184121577e-01 -4.9433807190478851e-01 + 6 -2.3810797250219498e+00 3.2260849215520855e+00 3.1605748848001172e+00 + 7 -8.9424750238779360e-01 -3.4603679805342775e+00 6.9354319317827251e+00 + 8 1.3867832884972657e+00 2.2462835312103961e+00 -4.0454233863943792e+00 + 9 1.2742804487791946e+00 -3.3110352776609617e+00 -5.6625565750905160e+00 + 10 -7.6062331359411628e-01 -3.2606610178853992e+00 -4.2881824671940922e+00 + 11 3.3582835443034238e+00 -4.9301681840788536e+00 4.2035644696193382e+00 + 12 -8.2396811773936616e+00 -5.6901889366493874e+00 -1.7376658680878201e+00 + 13 1.3045434132495648e+00 5.1332289170759449e+00 -2.8621628753004562e+00 + 14 -1.3648387443492465e+00 5.1696145586419719e+00 2.3663190809032515e+00 + 15 -4.6392483600217496e+00 7.0773925827753237e+00 -2.2978878636074649e+00 + 16 3.0943544298943859e+00 -2.8427485915190447e+00 6.6772847672839895e+00 + 17 6.0015721414278715e+00 4.3646645049701505e+00 -6.4842662018494810e+00 + 18 -2.6226112830859281e+00 1.6149416903002014e+00 4.5025891546176355e+00 + 19 -5.2372425246994436e-01 -1.4860260083470709e+00 -5.8185064413583398e-02 + 20 -8.5407669598249001e+00 -1.5658297727882688e+00 5.7632203274648797e-01 + 21 3.6141386583609418e+00 2.1266922547249862e+00 -4.4702455106789207e+00 + 22 -4.5508403159102269e+00 4.6478029052447383e+00 -4.9978014317798634e+00 + 23 5.7888063637488951e+00 5.8445816221047338e+00 1.4249374539020330e+00 + 24 2.9906540568396149e+00 -1.3213337830369136e+00 5.2936985082723123e+00 + 25 -4.2346908318631243e-01 -3.0975980443962281e-01 2.1791588686318120e+00 + 26 8.2436423950428073e-01 -5.6241056587880867e-01 5.0126938933738909e+00 + 27 2.9535590484529353e+00 3.1542707144458966e+00 4.6763776959349572e+00 + 28 -6.6011913651567788e-01 5.5661858915280353e+00 4.7386324630592176e+00 + 29 -6.4137116500282607e+00 2.2060949637578453e+00 8.0804269750400337e-01 + 30 -4.6136209719540409e+00 -1.2486336391850683e-01 -1.1937779434177376e+00 + 31 -3.4615323515983749e+00 2.0485253693532983e+00 9.5895800721990820e-01 + 32 -4.5892493749560330e+00 1.8983381035967410e+00 1.1037384669100847e+00 + 33 4.6348649868190837e+00 -4.5112120440302717e-01 3.9955174535217948e+00 + 34 3.7510943573105147e+00 3.8894683975315858e-01 -1.1190273849875856e+00 + 35 2.3756852935662098e+00 2.0882328264023649e+00 3.2002826788925844e+00 + 36 -2.1906787152697778e+00 -5.7164362898884820e+00 7.1259587632462562e-01 + 37 -3.1292718044575212e+00 2.2608738603049581e+00 -3.1093495017893149e+00 + 38 -2.1602089738212538e+00 -4.4567372501493985e-01 1.1358600520924704e+00 + 39 5.7098910263512215e+00 -9.3194076057596309e-01 -7.1317899182806093e+00 + 40 5.8237323758626394e+00 -3.6682086278592223e+00 -2.5710595537593686e+00 + 41 -8.2645466383931265e-01 -3.5630665331010274e+00 -3.0052071332503512e+00 + 42 -8.0476775397469265e+00 -3.8020428899810854e+00 1.3390589987683423e+00 + 43 1.5587749366889614e+00 -9.2853372548108677e+00 -7.2377631894979910e-01 + 44 7.2965033590042818e+00 -5.3651622514125723e+00 1.1447137336004101e+00 + 45 -4.2032089279040123e+00 -3.6098581724375822e-01 -4.5523172465247743e+00 + 46 -2.4927796394051409e+00 -3.5146936792342345e+00 8.1662164987386845e+00 + 47 4.5112787900033604e+00 2.4814103603467519e+00 3.3942698293462936e-01 + 48 4.7852374654495531e+00 -2.1114700148647874e+00 -1.2072991024406239e+00 + 49 -5.6543749020940481e+00 -7.1076809711378077e+00 -3.1892162796833352e+00 + 50 -7.3566210652861930e-01 5.2243318643548733e+00 -1.1063020754180508e+00 + 51 -1.8787007295586449e+00 1.3521552049322254e+00 7.8235654790191322e+00 + 52 7.8900955388691045e+00 -4.8532213135044415e+00 3.5028105850857467e+00 + 53 4.0463829538743239e+00 4.0990612160191935e+00 3.5173028166877112e+00 + 54 2.8712704210522695e+00 -5.6973236941393566e+00 -4.2349948470180632e+00 + 55 6.7769811659128168e-02 -4.4310624169590671e+00 -5.1018783996459014e+00 + 56 2.0592660826781684e+00 -8.0320757132874343e-01 -2.5695194491371582e+00 + 57 5.6797581710914358e-01 2.7270925612273489e+00 -1.5864510283841811e+00 + 58 5.7751801840724930e+00 -1.8622333289456705e-01 8.5888217947859669e-01 + 59 4.7406660641088276e+00 3.8104881303137743e+00 -6.0156302344880457e+00 + 60 -4.4870972361105173e+00 -6.9252788897327111e+00 -2.8937987752437366e+00 + 61 -4.0017017498615219e+00 3.6131004949479935e+00 -4.3350979004474555e+00 + 62 -5.8637673910854202e+00 5.8854264935139939e+00 -4.1674014295501642e+00 + 63 6.2425708005017793e+00 -4.7252929486932240e+00 -9.5863130058874341e-02 + 64 3.4125900597490135e+00 3.2938901671035357e+00 8.3095120803725013e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-sw.yaml b/unittest/force-styles/tests/manybody-pair-sw.yaml index 0d18a55a9..cbd02982e 100644 --- a/unittest/force-styles/tests/manybody-pair-sw.yaml +++ b/unittest/force-styles/tests/manybody-pair-sw.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 1e-10 prerequisites: ! | pair sw @@ -83,73 +83,73 @@ init_forces: ! |2 62 -4.0082699844093890e+00 3.5694473660939119e+00 -2.3808957458290636e+00 63 2.3993184954990650e+00 -4.9641865732173134e+00 7.9872123640002823e-01 64 2.4085468400267187e+00 2.7768510607664063e+00 5.9581090618923707e+00 -run_vdwl: -256.9339545343 +run_vdwl: -253.883637392962 run_coul: 0 run_stress: ! |2- - 1.5843188889767147e+01 1.8190455024358112e+01 2.1264292235186090e+01 -4.9797000707308179e+00 2.3968698092935220e+01 4.5927517884771163e+00 + 1.9082434599104968e+01 2.1474531423483540e+01 2.4194121198849512e+01 -5.6218148550674991e+00 2.8428833515697679e+01 2.5800210385074096e+00 run_forces: ! |2 - 1 -3.6578292548544633e-01 2.6938114020987980e+00 1.2766164846443697e+00 - 2 -2.0061314282044962e+00 -1.2342036121209603e+00 -1.8435586584208290e+00 - 3 6.8578843421788593e-01 3.5701803780915492e-01 -7.2036839894006266e-01 - 4 -1.7939057674135981e+00 2.5853973948705740e+00 -1.7032829106267777e-01 - 5 -2.2298900111403315e+00 -5.7368723541200040e-01 1.2977296718837444e-01 - 6 6.7475363082984230e-01 3.9843096464691095e+00 1.7053127915353490e+00 - 7 -5.3211870778708503e-01 -3.3599884060011714e-01 3.2636486915192116e+00 - 8 2.1389899833254722e-01 8.5662191581321001e-01 -1.2599393085210657e+00 - 9 -2.4778546531376899e-01 -3.1598266667047135e+00 -2.5133762395951935e+00 - 10 2.0709733990484658e-01 -2.3290781644694531e+00 -2.2033504477979786e+00 - 11 2.4810243028980135e+00 -3.4670076585046847e+00 2.8449506084234351e+00 - 12 -5.5850741022851071e+00 -2.9458519910050196e+00 -1.9863683514918771e+00 - 13 6.1771554329113421e-01 5.1787177857752020e+00 -1.0890335657342345e+00 - 14 -2.0219351143209856e+00 4.0293679988620807e+00 6.6005920931527284e-01 - 15 -3.6850781851645982e+00 4.5087424623938048e+00 -1.7035374584642433e+00 - 16 1.8355851588651364e+00 -7.4846780831918402e-01 5.1399376836143675e+00 - 17 1.1439347812520357e+00 3.0422446897805635e+00 -3.8269698610724152e+00 - 18 -4.2845652043234950e-01 2.3503246276020195e-01 3.6378973892810853e+00 - 19 -1.5617467469737576e+00 -3.2518255073259681e+00 -2.3399776509865969e-01 - 20 -5.9022686658289807e+00 -4.4443599747613016e-01 9.5453010416851425e-01 - 21 2.4628999326281860e+00 1.2003828959598268e+00 -2.6030925973177972e+00 - 22 -4.4520730716392176e+00 3.3117098541474856e+00 -3.5702683345712267e+00 - 23 2.3154132524078084e+00 4.2295354619246996e+00 7.0192774970576266e-01 - 24 2.4123142711193868e+00 5.8345976075870809e-01 2.7723427223632191e+00 - 25 1.0367388664189889e+00 1.0505702244104692e-01 1.4930827689968442e+00 - 26 -4.2283907151897460e-01 -5.8939802783631923e-01 1.7501899350192609e+00 - 27 2.5175445907126783e+00 -2.7584155775939329e-01 1.4794898139727328e+00 - 28 1.1510771716913335e+00 2.3773229001009710e+00 3.6868660521242318e+00 - 29 -3.4492415239428458e+00 8.7816348687363166e-01 -1.5440589307879455e+00 - 30 -1.5601654953771171e+00 1.0756173859838869e+00 -1.1556923853526757e+00 - 31 -1.4329726782504648e+00 2.0744956749854593e+00 -1.6136629766074723e-01 - 32 -3.1002249351374411e+00 3.9873970766007116e-01 -1.3229350360525922e+00 - 33 4.1653455984867831e+00 -2.0178763996032387e+00 2.2661107852019544e+00 - 34 7.8962141897352622e-01 -1.7291813201580905e-01 2.1455734469338450e-01 - 35 1.3703983500185393e+00 6.3751434723797462e-01 2.8982134075057688e+00 - 36 -9.0399762105375059e-01 -2.9542299588270713e+00 -4.8608322442561586e-01 - 37 -1.7936679156609205e+00 1.1708324245444257e+00 -2.4192322453710844e+00 - 38 -7.2035828994436901e-01 -4.6741417560464382e-01 8.2618393105671006e-01 - 39 2.6747423965046568e+00 -6.1886552588225685e-01 -3.7752112134997056e+00 - 40 4.5766245241245525e+00 -1.4835891243884769e+00 -2.0254579408390461e+00 - 41 3.8234199444261141e-01 -6.7698004720397631e-01 -7.8643727656003715e-01 - 42 -4.0093916318806793e+00 -1.7600197455049928e+00 1.4158067768452562e-01 - 43 1.0810851465046887e+00 -4.9037733502694021e+00 -5.6118074069955282e-01 - 44 3.6592606723183030e+00 -3.9033932782274898e+00 9.1447594561944401e-01 - 45 -2.3979704626150959e+00 1.2492134071413807e+00 -2.6497899219205840e+00 - 46 2.3716733588519823e-01 -1.4351351359916347e+00 5.0137864251962760e+00 - 47 2.8489632446318085e+00 1.6707606130329649e+00 5.6710506567185048e-01 - 48 1.4791743756919560e+00 3.2930311672553897e-01 -3.3251232834027605e-01 - 49 -2.8190036224401576e+00 -4.9756598213987626e+00 -2.2985459069712935e+00 - 50 -9.8083373394835083e-01 3.2894810840183051e+00 -1.8940705065580201e+00 - 51 -1.8835990999898564e+00 2.2102135960125726e+00 3.9823344470968713e+00 - 52 3.9549296687811850e+00 -4.1670071205174999e+00 3.4176842915138534e+00 - 53 3.7802577750393231e+00 3.1818226509456742e+00 1.8978179329696754e+00 - 54 2.4876677131729039e+00 -3.3806730320075102e+00 -1.7675616195950672e+00 - 55 3.0820341820502367e-01 -2.6771926047563457e+00 -3.8161188793303533e+00 - 56 -7.0135086633206289e-01 -2.8264635141509542e-01 -2.0782448637476088e+00 - 57 -1.0278153825775276e-02 -1.7590547717218432e+00 -3.8050385157103833e-01 - 58 3.2097378883129877e+00 -7.2897169480175061e-01 1.6182800942864837e+00 - 59 2.5406360371694832e+00 2.2352821526100755e+00 -3.0033129814690653e+00 - 60 -2.4007353452591169e+00 -4.9535087757235390e+00 -2.3369481395252585e+00 - 61 -1.1046837927728306e+00 2.0121688747133786e+00 -1.0262861972292612e+00 - 62 -3.6496637512835903e+00 3.1293667187055498e+00 -2.0518216022328217e+00 - 63 2.3143355745162886e+00 -4.8762705311639651e+00 6.8436817225651048e-01 - 64 2.5369452958734855e+00 2.7290957114029144e+00 5.6584378752025701e+00 + 1 -5.0047078434347436e-01 3.0092991364072295e+00 1.4647106795089462e+00 + 2 -2.2042610939363962e+00 -1.1920791197909426e+00 -2.0424071148467600e+00 + 3 1.0978843274170564e+00 1.4690647939946536e-01 -1.0823854638522741e+00 + 4 -2.1527275286383589e+00 2.6671789406135429e+00 2.3719670520842917e-01 + 5 -2.1964650791203519e+00 -5.3795115235140334e-01 -2.7557142094556064e-02 + 6 2.8718732350363785e-01 4.2886337141577267e+00 1.6727258910380463e+00 + 7 -7.0809297946903138e-01 -5.9016617409940575e-01 3.7568778845740187e+00 + 8 3.8019317408802883e-01 1.0277756188990579e+00 -1.4010374740816818e+00 + 9 -1.6086153491016075e-01 -3.2061284818970046e+00 -2.5156979326978508e+00 + 10 3.1605290786952206e-01 -2.4487368618320668e+00 -2.8707303654869318e+00 + 11 3.1449667901320408e+00 -4.1163343052929342e+00 3.0899944301070752e+00 + 12 -6.0520757414748125e+00 -3.4351689850965035e+00 -2.5417245626404252e+00 + 13 -7.5174684515533829e-02 5.8408640105383984e+00 -1.2613642425267719e+00 + 14 -1.9822531184353027e+00 4.3525308384498089e+00 6.7042931747478196e-01 + 15 -4.1124718497549066e+00 5.0623775931828288e+00 -2.2683242966141859e+00 + 16 2.0944688355554253e+00 -7.3795671882481928e-01 6.0629768415767087e+00 + 17 1.3327236430177543e+00 3.2507475017745882e+00 -4.3536555713680967e+00 + 18 -8.8516159318900445e-02 1.2785939563305204e-02 3.8621941299735658e+00 + 19 -1.4582565814117761e+00 -3.3156797172369639e+00 -2.2849982398730417e-01 + 20 -6.5449065091447363e+00 -1.9370280741942447e-01 1.1419964847807675e+00 + 21 2.5542466747901260e+00 1.5598496510373028e+00 -2.5183185789902272e+00 + 22 -5.2725865189757730e+00 3.7936117924899726e+00 -4.1734444784818869e+00 + 23 2.2799737385772230e+00 4.3455134643856335e+00 7.6576848834133304e-01 + 24 2.1919558841674354e+00 9.9630080083365757e-01 3.2051855830095755e+00 + 25 1.1325146345034689e+00 1.6579431109634363e-02 1.8273908129372480e+00 + 26 -2.7532421473653745e-01 -8.0676609020322854e-01 1.6702424230032704e+00 + 27 2.5905064309045467e+00 -1.9714802394985745e-01 1.5140493894379532e+00 + 28 1.3316228268388137e+00 2.1633611168967271e+00 4.0249050844508751e+00 + 29 -3.6868692488201371e+00 9.2919805041723169e-01 -1.7084272474964854e+00 + 30 -1.8467842611153555e+00 1.4381337354345938e+00 -1.0574678972705382e+00 + 31 -1.6275669604783278e+00 2.1115917047678168e+00 -1.7617026145532583e-01 + 32 -3.4852391344199631e+00 5.8375700967698896e-01 -1.3473834699296581e+00 + 33 4.8664084210250147e+00 -2.4867733141081754e+00 2.6531652170271913e+00 + 34 8.9648165616315423e-01 -2.1724062266091548e-01 1.9355582977352692e-01 + 35 1.3170824656897520e+00 4.0238142305751784e-01 3.1194768599378300e+00 + 36 -5.9712471764430497e-01 -3.2725272887977548e+00 -2.0117313981789903e-01 + 37 -2.1019256761867102e+00 1.5766950541652696e+00 -2.5382260981748459e+00 + 38 -8.6023363590524549e-01 -5.9141613016681094e-01 7.3431156491783822e-01 + 39 3.0822292525417874e+00 -8.0130036720845288e-01 -4.0901428617469486e+00 + 40 4.6282527863460583e+00 -1.7301683356667212e+00 -2.1432648082443264e+00 + 41 1.4520254833833823e-01 -1.0096266475444606e+00 -1.0513453844180805e+00 + 42 -4.2921631772022097e+00 -1.7146985340506107e+00 2.2864721601923749e-01 + 43 1.2618239681340562e+00 -5.5226098281320120e+00 -3.6740398593383283e-01 + 44 3.8212262784537532e+00 -4.2350300982405606e+00 1.3407639598582619e+00 + 45 -2.3116398414430499e+00 1.8047841385968244e+00 -3.0065127594660637e+00 + 46 1.3559750187185260e-01 -1.5997533862619169e+00 5.2907224781382460e+00 + 47 3.0489891279771046e+00 1.9603403439849445e+00 5.9949888135906992e-01 + 48 1.5156554427921747e+00 1.8028537353089913e-01 -2.6508605516812311e-01 + 49 -2.5989746353371288e+00 -5.0778203272863216e+00 -2.3522478046140027e+00 + 50 -9.5626524448445838e-01 3.5278934977657310e+00 -1.7759776028422380e+00 + 51 -1.7858366482937289e+00 2.3756086868805824e+00 4.1978434384825434e+00 + 52 4.4655566514208882e+00 -4.9749541585832535e+00 4.0985317655687545e+00 + 53 3.7539314594723239e+00 3.2665634828786256e+00 1.5872409513217554e+00 + 54 2.8460936200492077e+00 -3.6263655564882806e+00 -2.1045453114699981e+00 + 55 7.0076157102311465e-01 -2.9212296827894595e+00 -4.4492375410647167e+00 + 56 -7.3357501803003056e-01 1.6927544595277796e-01 -2.3541202943480228e+00 + 57 4.6052325003535156e-02 -1.5375674825464447e+00 -3.3457419238857355e-01 + 58 3.2929259176066075e+00 -1.1079227179714120e+00 2.0116035680818984e+00 + 59 2.7232301852527203e+00 2.2946217387750845e+00 -3.2635286022596897e+00 + 60 -2.2769787120421574e+00 -5.3489945254875737e+00 -2.4298847308752580e+00 + 61 -1.1929763475820885e+00 2.0162795027315701e+00 -1.1046752692831965e+00 + 62 -3.9995880887537769e+00 3.5549308929677719e+00 -2.3691640506349603e+00 + 63 2.3974297170261853e+00 -4.9925587997093261e+00 7.7227378802237823e-01 + 64 2.4589576383720200e+00 2.8197201303719019e+00 5.9814267526406049e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-tersoff.yaml b/unittest/force-styles/tests/manybody-pair-tersoff.yaml index b3f2e22f4..888826cf7 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 5e-13 prerequisites: ! | pair tersoff @@ -83,73 +83,73 @@ init_forces: ! |2 62 3.0202286274163948e+00 -5.8173499219835723e-02 3.7893096308014718e-01 63 -6.1967102136017562e+00 -4.9695212866018759e+00 -5.2998409387882619e+00 64 5.1027628612149876e+00 5.3292269345077372e+00 -8.7272297575101980e+00 -run_vdwl: -178.057797644483 +run_vdwl: -163.22666341025 run_coul: 0 run_stress: ! |- - -5.1394876000526904e+02 -5.0846789891891115e+02 -5.2011743811579913e+02 -8.7897109075449080e+00 5.6462282276932196e+00 4.7065631120726231e+01 + -5.4984932084942841e+02 -5.4747825264498317e+02 -5.6218018236834973e+02 -1.3192159297195820e+01 -1.3022347931562763e+01 5.4632816484748133e+01 run_forces: ! |2 - 1 -9.2566080668166677e+00 1.0077345660602521e+00 -4.8027837358053862e+00 - 2 2.3998549960918485e+00 -1.1947673981292548e+01 1.7252161658738601e+00 - 3 1.7761214518867432e+00 1.9053879815768173e+00 -2.2724172317028390e+00 - 4 3.3347810373798397e+00 1.0397364810786498e+00 8.4324583903881276e+00 - 5 3.5224788421144408e+00 4.8564117258168524e+00 9.6179393026613287e+00 - 6 4.5275612875996325e+00 -4.9223113798304370e+00 3.3528199373209628e+00 - 7 -1.8091201412671638e+00 -4.6871967323166972e+00 -7.9984696770011308e+00 - 8 -3.3580419547204547e+00 -2.4465646973981237e-03 -1.3620840979996087e+00 - 9 -1.1549807405176985e+01 3.3343530555806744e-01 8.9829078829569753e-01 - 10 -5.5043570494496645e+00 -2.4520581125354686e+00 -1.9605063597984129e+00 - 11 4.4274091610325623e+00 5.6792150201161649e+00 9.4332862837992906e+00 - 12 6.1014707687900591e+00 -4.8029860875184038e+00 -3.0355893912254222e+00 - 13 -2.3188614153697360e+00 -1.3290385649650782e+00 2.0742500235150465e+00 - 14 5.1178558951892512e+00 1.6515628496884578e+00 -6.0532912801239496e+00 - 15 -3.5894172212591169e-01 -6.1865516691859401e-01 -1.2154453860523191e+01 - 16 -6.7644759933493575e+00 5.9161982066335010e+00 2.8177782766175898e+00 - 17 8.5459718690297741e+00 1.6413604267406297e+00 3.9669710341314848e+00 - 18 -4.8222944210892980e+00 -4.3708893934198123e+00 3.4937679750767012e+00 - 19 2.2265410166640107e+00 -2.8737227736329869e+00 -7.8165866581232937e+00 - 20 3.2796797669756979e+00 -5.3191473664348798e-01 7.7821286289553404e-01 - 21 -2.7659124274397215e+00 -8.6441488913101203e+00 1.5812554115164845e+00 - 22 7.8148663646910199e+00 5.0038212586600528e+00 -7.0422848225097265e+00 - 23 7.8425232176598900e+00 -8.4405335083437265e+00 5.6779106583756898e+00 - 24 1.2066504210681979e+00 8.3472697578316577e+00 3.1725449496368388e+00 - 25 -3.6623885665286662e+00 -4.1813768417007040e+00 -7.2968160676754019e+00 - 26 2.5713462215706637e+00 -2.5408054310756762e+00 -7.0385969034077789e+00 - 27 3.7275438839555903e+00 -5.2709882923928619e+00 4.4767818672353638e-01 - 28 -3.4150646959468727e+00 -2.3852176188882792e+00 -5.0237355808061657e-02 - 29 1.5236376013573949e-01 7.2360376297632625e+00 2.2791470343821976e+00 - 30 7.0114818183698757e+00 -1.8786174880505371e+00 1.4572736275096392e+00 - 31 5.6883462483239162e+00 -9.6340434155968691e-01 -4.2245906553646080e+00 - 32 6.2466835697011049e+00 2.4999913007009900e+00 -2.1641083204656102e+00 - 33 -5.9880400237419984e+00 -2.7478960497717777e+00 2.8138571408519608e+00 - 34 2.5647931350902438e+00 1.8617472141965041e+00 -9.7172893728458796e+00 - 35 -3.5060328052736081e+00 -9.0237104049998660e+00 1.1770665190158094e+00 - 36 -2.5246589184542718e+00 7.0663241830147019e+00 -3.1349368626458713e+00 - 37 -5.5405600851398740e+00 4.3460948419738035e+00 8.5790385451499276e+00 - 38 -1.3910460017782382e+00 6.8645671813956781e+00 -4.4200912343413501e+00 - 39 5.4184170996144356e+00 -3.4406019213299284e+00 8.6553990435256001e+00 - 40 -2.6474814456519438e+00 -9.6098953161179135e-01 -1.8111368068890648e+00 - 41 -2.6751556738427134e+00 1.0538495035185869e-01 9.7388926801719631e+00 - 42 5.5610935834238182e+00 -2.2468129145203859e+00 -3.4123429349506615e+00 - 43 -9.3679194990337122e-01 9.9722489594945496e-01 1.7818305269282892e+00 - 44 -9.4956239475653748e-01 8.2546724916137393e-01 1.2487370224632080e+01 - 45 -4.4331091299885044e+00 5.2116640750108694e+00 -6.2695747729220717e+00 - 46 -7.3320374431776933e+00 6.8971611306068921e+00 3.8963698210690194e+00 - 47 1.9858560179863964e+00 -1.4852584443949506e+00 8.4274294453710148e+00 - 48 -6.9517337938680814e+00 -7.2112413993202038e+00 7.6606470174297794e+00 - 49 -3.2036171757340735e+00 5.5662326854851774e+00 -2.7617497737709584e+00 - 50 4.3053470939466232e+00 -2.3640368532431211e+00 7.4208386122303893e-01 - 51 -1.0745375893597979e+01 -2.1284285048684288e+00 -1.3329596168537496e+00 - 52 -2.6515821662669508e+00 -7.3145571997004305e-02 1.1061901267020042e+00 - 53 3.5580034191029153e+00 -5.2224354079849489e-01 9.3830808810249469e+00 - 54 1.6688835294759237e+00 2.6487460256538875e+00 -1.0427244374266991e+01 - 55 1.0034709237186064e+01 1.0234440983477382e+00 -8.8643705191119926e-01 - 56 4.5355647349403094e+00 5.0851906158415590e+00 2.1898774836355059e+00 - 57 -2.3065086458088020e+00 1.2871947065650650e+01 9.0847850193887925e-01 - 58 -9.7296598489860848e+00 -1.6561484398383972e+00 3.4072771607410308e+00 - 59 6.8712340624705277e+00 4.5941242868785981e+00 -6.5895961456756549e+00 - 60 -3.9127580559710342e+00 5.8663680661648741e+00 -2.1774465911788097e+00 - 61 -4.1017669917956683e+00 -1.2643475167127736e+01 -2.5183998149672018e+00 - 62 3.5191591081500224e+00 6.4550013919915683e-01 -2.8572943818092944e-01 - 63 -3.7332705534580439e+00 -3.4101641368095517e+00 -6.2778934997510385e+00 - 64 3.3020302368588315e+00 3.1627875726160184e+00 -6.8660451794450079e+00 + 1 -8.2294707224958152e+00 6.6415559858223139e-01 -1.2477806420252646e+00 + 2 2.9539163722155473e+00 -1.0567305774620989e+01 1.1661560767930856e+00 + 3 3.3196144058788746e-01 3.1584903320856981e+00 -1.3990995807552162e+00 + 4 9.5391741269238572e-01 3.7826565316552063e-01 9.5055318246309355e+00 + 5 4.1639673516102560e+00 3.9705390785870254e+00 6.5682616368294298e+00 + 6 6.6727168421938297e+00 -3.6374343121692387e+00 2.7114260395938978e+00 + 7 -4.2186566599771531e+00 -7.5833932377224995e+00 -5.5693511180213600e+00 + 8 -3.4319560756454162e+00 -3.6671624646345102e-01 -4.2144329130681235e-01 + 9 -1.3812189315006259e+01 3.4080905711091208e-01 8.0596405315020814e-01 + 10 -4.7413720402957606e+00 1.8126358752434710e+00 -4.0849671973917960e+00 + 11 2.8522718591694503e+00 4.0370796861985419e+00 8.7789881157941547e+00 + 12 7.8506807861755989e+00 -7.6881532723047741e+00 -5.2541140686568868e+00 + 13 -1.6686186680304886e+00 -2.2717282650628912e+00 1.3414761770932502e+00 + 14 6.2566177844507571e+00 2.6175790060871655e+00 -7.3109911007315738e+00 + 15 -3.5512488500033967e-02 -6.0325420556797837e-01 -1.0115277456055301e+01 + 16 -7.2839584328751013e+00 6.4191562141574678e+00 3.5013328184702615e+00 + 17 9.5592981582460510e+00 2.7178395190361959e+00 5.0809557506572265e+00 + 18 -3.8846765196129365e+00 -3.3430991646140935e+00 3.2802508011790628e+00 + 19 6.2772117004625883e-01 -4.8514804166047600e+00 -7.4198875094560055e+00 + 20 3.3548741544632952e+00 -3.5511160096009542e-01 5.8901206194143274e-01 + 21 -3.2206639942859443e+00 -9.9286364065253387e+00 1.2785694915312740e+00 + 22 7.4555159259077692e+00 5.0895617896923415e+00 -7.7346439701625966e+00 + 23 7.0720409003383446e+00 -8.2326782144613713e+00 4.8999576462066763e+00 + 24 3.8539038122551608e+00 7.6168833469064579e+00 2.3557227019554334e+00 + 25 -3.9459081317767222e+00 -2.5213387528679223e+00 -7.4689143550869241e+00 + 26 1.0113873219042404e+00 1.7546259377383389e-01 -6.2594150246692672e+00 + 27 3.1808032047272534e+00 -6.5432302930946378e+00 1.2618305054207626e+00 + 28 -5.9931907183582211e+00 -5.1409008301595644e+00 2.9141715145646727e+00 + 29 3.4534555052025291e+00 7.9689185757712870e+00 -2.4166494671841887e+00 + 30 9.3924610414928704e+00 -4.1698024569281982e+00 2.6643218056377420e+00 + 31 7.3358370584994654e+00 -4.1973124834250282e+00 -8.3010194948160221e-01 + 32 7.3943960241283753e+00 4.1542308511930637e+00 -3.4245736585107807e+00 + 33 -7.7194343389815030e+00 -5.3308239041411811e+00 4.5490264110666576e+00 + 34 1.5343802734805889e-01 1.9182082520781198e+00 -5.7227161806870903e+00 + 35 -2.2413415929122471e+00 -1.0393995120476315e+01 4.3417636109408975e-01 + 36 -1.1206820076087858e+00 9.8632654350583895e+00 -7.4143452129578413e-01 + 37 -2.4246244313823127e+00 2.3044207485791537e+00 5.7890564801142066e+00 + 38 -5.3738487239109523e-01 5.2786062896097778e+00 -2.3626180572048687e+00 + 39 6.3886523307253746e+00 -4.3399697303274891e+00 9.0181916658118375e+00 + 40 -2.3861586287091283e+00 -3.2836123773823833e+00 -5.5776816127277389e+00 + 41 -9.0646450923129307e-01 1.9914992939773488e+00 8.5107451129879834e+00 + 42 5.9551460186563014e+00 -2.5585603984709628e+00 -5.1987974091154516e+00 + 43 -4.3599168281165374e-01 1.6712528630262453e+00 1.2816846979773100e+00 + 44 8.4974573425527400e-01 3.0899456980185049e+00 1.2851650659811307e+01 + 45 -7.0442538599183102e+00 5.0586696700089222e+00 -4.6674345194080518e+00 + 46 -7.1801875599022162e+00 6.7590934281063877e+00 3.7635120215433013e+00 + 47 5.1317375574659274e-01 2.6779341206371439e+00 9.2741917179814291e+00 + 48 -9.3078567387719691e+00 -7.2851345405527432e+00 5.4021614945753766e+00 + 49 -5.5978655116913218e+00 7.7697351691267835e+00 -5.6054496108177165e+00 + 50 6.8944270702912647e+00 -2.4979106397944975e+00 -1.6711196893660549e+00 + 51 -1.0589443847527470e+01 -1.1433769514195413e+00 -2.5199895713086193e+00 + 52 -1.1738240025250661e+00 1.1071497469678624e+00 2.6529976375043698e+00 + 53 3.0682006246374587e+00 2.0292790278432879e-01 1.0584336521467472e+01 + 54 2.1439346160217654e+00 3.4807655514789477e+00 -1.0404022585935799e+01 + 55 1.1341945870703348e+01 1.1812984132292509e-01 -4.3788684134324690e-01 + 56 -5.0853495208522448e-01 4.3721019098526890e+00 2.6661059733515078e+00 + 57 -3.7840594071371267e+00 1.1089743031131956e+01 2.3884678929613359e+00 + 58 -9.4268734677328467e+00 -2.7210262550267679e+00 4.3142585606710391e+00 + 59 6.4673603867530671e+00 6.8013230672937857e+00 -8.1798771518830709e+00 + 60 -6.3371704156347120e+00 8.2056355573409814e+00 -4.4997023517211074e+00 + 61 -2.3170606856174616e+00 -1.3658343433246674e+01 1.0623172135206077e-01 + 62 3.0553926824435198e+00 -1.4425840477553686e-02 3.3505019908623868e-01 + 63 -6.2122003399241823e+00 -5.0242126599414014e+00 -5.3263529941212209e+00 + 64 5.1584253754664209e+00 5.3709530308188809e+00 -8.7534806643756298e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-tersoff_mod.yaml b/unittest/force-styles/tests/manybody-pair-tersoff_mod.yaml index 6427c8f9f..4a50c7111 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff_mod.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff_mod.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 5e-11 prerequisites: ! | pair tersoff/mod @@ -83,73 +83,73 @@ init_forces: ! |2 62 -3.8148306661769906e+00 3.5439712709911046e+00 -2.7497767002061515e+00 63 2.2829467996296287e+00 -4.8025431165588612e+00 -4.2319407270880705e-01 64 3.5261103084670364e+00 3.7869432645771459e+00 5.8249511151439197e+00 -run_vdwl: -275.301478992035 +run_vdwl: -271.714376157296 run_coul: 0 run_stress: ! |2- - 3.7648596612475586e+01 4.0392775754357999e+01 4.2450922933587087e+01 -6.7686158075529761e+00 2.6503184957410216e+01 6.7047212014675468e+00 + 4.5291635990231477e+01 4.8485451299856685e+01 5.0006323329447035e+01 -9.4533068028372238e+00 3.2503068989512592e+01 4.1820539511498547e+00 run_forces: ! |2 - 1 -8.6494553949113606e-01 2.9723558371616852e+00 1.4612300089162402e+00 - 2 -1.9845814788855547e+00 -1.6963202395628771e+00 -1.7539340797352434e+00 - 3 7.5053913245740167e-01 2.8615760532766732e-01 -6.0978040710802206e-01 - 4 -1.9750433429758454e+00 2.8108734691215282e+00 2.5558748773433981e-01 - 5 -2.2866392379727172e+00 -4.7845815808353476e-01 2.8723762953259424e-01 - 6 1.0571916979749698e+00 3.8102334133881302e+00 1.6922864641606938e+00 - 7 -5.8290348209558207e-01 -5.4259350500699011e-01 3.0320327455855125e+00 - 8 1.1276934750002487e-01 8.0819324031726825e-01 -1.2597707785775791e+00 - 9 -7.8055739111326838e-01 -2.9617708332130066e+00 -2.5154646427817955e+00 - 10 3.1166854744505368e-02 -2.2688125147274176e+00 -2.3982322066311199e+00 - 11 2.7717216440585446e+00 -3.5945289811506926e+00 3.0102532273647937e+00 - 12 -5.4937773786261612e+00 -3.3296255424806929e+00 -2.9047226121830310e+00 - 13 -3.5871963818307803e-02 5.1413632456916005e+00 -7.2849611074393339e-01 - 14 -2.0085952441815622e+00 4.4192308092747723e+00 1.7254612827329116e-01 - 15 -3.6750263422474276e+00 4.3818614117260202e+00 -2.8514923985486029e+00 - 16 1.7870712086580398e+00 -3.1786706739718235e-01 5.9419000924923147e+00 - 17 2.1141670976353346e+00 3.0622487965900937e+00 -3.6979864228899375e+00 - 18 -6.5287327278710539e-01 4.2233991595116249e-01 3.8077283403591333e+00 - 19 -1.7825043678972610e+00 -3.2484299399093142e+00 -6.5730511593208751e-01 - 20 -5.8899125313851677e+00 1.4239019516227858e-01 5.7788343738746750e-01 - 21 2.0367776573932010e+00 3.2353455052636448e-01 -2.3391497908222498e+00 - 22 -5.1283230533645128e+00 4.2073579667546008e+00 -4.5303477801183796e+00 - 23 2.1878137890758995e+00 3.8081812141573153e+00 1.5447266637121240e+00 - 24 2.6829720270132977e+00 9.5208819336551964e-01 2.9131618406393676e+00 - 25 9.9066935306998383e-01 7.2437726480663378e-02 1.3350031099311763e+00 - 26 -8.1420135505578792e-02 -3.7800027508766199e-01 1.3992952453256409e+00 - 27 2.7870666357683986e+00 -5.0716047432483646e-01 1.7077565068755518e+00 - 28 7.5588400802775713e-01 2.3309525558710038e+00 4.2272028065549829e+00 - 29 -3.5916678116084531e+00 1.1678602836540846e+00 -1.7379682157150091e+00 - 30 -1.3525353106049680e+00 1.0418770131892268e+00 -1.1231091152147039e+00 - 31 -1.1879426277484932e+00 1.9083391337509910e+00 -2.4658803119449613e-01 - 32 -2.9014808575985596e+00 5.0853545112312659e-01 -1.2089730389798246e+00 - 33 4.3874388530111021e+00 -2.5897571121334155e+00 2.7688741069572336e+00 - 34 7.0797438096177989e-01 -7.3365476838379795e-02 1.5222575287138618e-01 - 35 1.3875337186072136e+00 3.5684097931366532e-01 3.0067462591936374e+00 - 36 -1.0126806506030355e+00 -2.8248663655987860e+00 -3.3658562392334768e-01 - 37 -1.8304884054052768e+00 1.3533089100273676e+00 -2.3943952988569928e+00 - 38 -7.3772928279941330e-01 -4.1206466474823134e-01 8.1055291957532338e-01 - 39 2.7047865085605665e+00 -1.2845807744438225e+00 -3.4345054112485691e+00 - 40 4.9128963636802077e+00 -2.0433231305774040e+00 -2.5381030557498074e+00 - 41 2.3329293508714910e-01 -6.5236854772015218e-01 -6.3288790137225348e-01 - 42 -3.5858411933352810e+00 -1.6060523138739158e+00 -6.5085586098421877e-01 - 43 6.3821363094632366e-01 -4.8854069787762402e+00 1.0211205553915415e-02 - 44 3.4424067082774608e+00 -3.6458431164550218e+00 1.7989897372666217e+00 - 45 -2.5337896763591088e+00 1.6080565205257269e+00 -2.8885218244909838e+00 - 46 -4.2853467463581274e-01 -1.4780448471152405e+00 5.5699892454382480e+00 - 47 3.0567570449946135e+00 1.7467987759397205e+00 9.3466868808377912e-01 - 48 1.1531569725136972e+00 1.0584511035501354e-01 -2.6324814802482294e-01 - 49 -3.2179925611273097e+00 -5.3897109528177793e+00 -2.9848233906282324e+00 - 50 -2.7853337957895841e-01 2.9097717579818072e+00 -1.4137445645426245e+00 - 51 -2.6625024594691196e+00 2.6035179492511236e+00 4.0503804230479039e+00 - 52 4.7123880350175407e+00 -4.8793528658480181e+00 4.4034891887836318e+00 - 53 4.2543548717694097e+00 3.7982801895545246e+00 2.6629735677036144e+00 - 54 2.7053985262594291e+00 -3.5967294897899285e+00 -2.2499455897230054e+00 - 55 9.6254861475545161e-01 -2.6805899881839550e+00 -3.7502045244401114e+00 - 56 -6.0555550366134159e-01 -2.6412431710414541e-01 -2.0828450845443385e+00 - 57 -3.9975307244232983e-02 -1.5340530158525147e+00 -2.5806622970318549e-01 - 58 2.8251586977789254e+00 -9.9456549595935806e-01 1.4900284243066526e+00 - 59 3.3267083734120622e+00 2.6722437793685465e+00 -3.2265576515575320e+00 - 60 -3.2821645847621683e+00 -5.3370261921599447e+00 -3.0200568539595380e+00 - 61 -1.0900772054127172e+00 1.8693889679020239e+00 -1.1038292115987847e+00 - 62 -3.4780481910334862e+00 3.0637872432615314e+00 -2.3553887395800706e+00 - 63 2.1942936363061740e+00 -4.7135611317994410e+00 -3.4789973397550722e-01 - 64 3.3693961200184583e+00 3.5427020966737439e+00 5.4708241924527599e+00 + 1 -1.1918947657502443e+00 3.4182958773698853e+00 1.7904564868842150e+00 + 2 -2.1101687652926926e+00 -1.7881701543699093e+00 -1.8660770235856479e+00 + 3 1.1499789392004458e+00 3.1318049610578491e-02 -8.7836200802514608e-01 + 4 -2.4949798351279822e+00 3.0641251157847087e+00 8.2683039594171026e-01 + 5 -2.2514955577372913e+00 -4.0959315506362448e-01 1.4354742156609368e-01 + 6 7.5853679534759166e-01 4.0830865102857796e+00 1.5648769292874620e+00 + 7 -8.3974616990465334e-01 -9.0802601082320589e-01 3.4467636036274385e+00 + 8 2.8195376164759800e-01 9.4427386634072752e-01 -1.3590398824468315e+00 + 9 -7.2160097669275269e-01 -2.9019044838478889e+00 -2.4980059604350497e+00 + 10 4.0946707887443035e-02 -2.2856155090316705e+00 -3.1155390552923201e+00 + 11 3.6678589716761860e+00 -4.3961534857252671e+00 3.5604440610775301e+00 + 12 -6.2101124027422259e+00 -4.2512126616859591e+00 -3.8486449827950837e+00 + 13 -9.8853767077466992e-01 5.9366458542951044e+00 -1.2068287185409750e+00 + 14 -1.9856773352251442e+00 4.9508535035552041e+00 5.1907087118496981e-02 + 15 -4.3566350756857020e+00 5.1863898887809476e+00 -3.8756259179244021e+00 + 16 2.0353788519326237e+00 4.9821647276246273e-02 7.3076197835948209e+00 + 17 2.5821777365174290e+00 3.3851247640671103e+00 -4.3213301779394921e+00 + 18 -2.4549291837112097e-01 1.4426026229081623e-01 4.0126239996445410e+00 + 19 -1.7493866873732822e+00 -3.3215455049730376e+00 -7.0069547129065646e-01 + 20 -6.6735215110955934e+00 6.2728540195079896e-01 8.3442129036797907e-01 + 21 1.9797928202781567e+00 5.3718467924465130e-01 -2.1771145177620359e+00 + 22 -6.4696423803182013e+00 5.2723915719066845e+00 -5.8592496217440937e+00 + 23 2.2106731851878831e+00 3.8883816150166508e+00 1.6421949314180517e+00 + 24 2.5579366274973339e+00 1.4444516236897618e+00 3.4218792980966635e+00 + 25 1.0528226353682415e+00 -4.4267986387067471e-02 1.5675838196884007e+00 + 26 4.7782006510255645e-02 -5.5784177621066933e-01 1.3207903722617040e+00 + 27 2.9299528768616572e+00 -5.5817742720001573e-01 1.7996518882221346e+00 + 28 8.7379771231714676e-01 2.0317378135677844e+00 4.7721250877577734e+00 + 29 -3.8000786622703515e+00 1.3577390750496805e+00 -1.9359663581396047e+00 + 30 -1.5906854355814142e+00 1.3662070635843266e+00 -1.0898445148582971e+00 + 31 -1.3025407206366624e+00 1.8964647039008451e+00 -2.7231510761590338e-01 + 32 -3.2539664356372855e+00 7.0262291781245700e-01 -1.2808584386417663e+00 + 33 5.2596408986294385e+00 -3.3953058274223098e+00 3.6491746999779249e+00 + 34 7.8735440926705569e-01 -1.0710243006169362e-01 1.3509866824790451e-01 + 35 1.4141298152530650e+00 4.1771989288174272e-02 3.3205066097919014e+00 + 36 -6.3852185084977231e-01 -3.0622700956246853e+00 3.1902126855895718e-02 + 37 -2.1733919516706246e+00 1.8125832788926235e+00 -2.6019858688777111e+00 + 38 -8.3098475445602260e-01 -5.0280949345705794e-01 7.6501394520272292e-01 + 39 3.1780625780963874e+00 -1.7750842543948364e+00 -3.8107959944239802e+00 + 40 5.0673369602955054e+00 -2.4509029256628851e+00 -2.8122569560279724e+00 + 41 5.6629551882703133e-03 -9.2739987121600331e-01 -8.1709612116132346e-01 + 42 -3.7355733454518281e+00 -1.5221840226661405e+00 -6.8301016026751449e-01 + 43 8.0301654497618169e-01 -5.6336103194257454e+00 3.3280891647299216e-01 + 44 3.7216318428447646e+00 -4.0326457789100685e+00 2.4276411371636955e+00 + 45 -2.5652700459411899e+00 2.3203294847645317e+00 -3.3607002709832861e+00 + 46 -8.0753027345817174e-01 -1.7996067872009192e+00 5.9580854692345699e+00 + 47 3.2285845533416833e+00 2.0924103403786667e+00 1.1194723988537161e+00 + 48 1.1688136956540618e+00 -5.6138674270530431e-02 -2.5474998569863627e-01 + 49 -3.2185678215790032e+00 -5.5312356590367173e+00 -3.1069904590061994e+00 + 50 -2.6356763860242438e-01 3.1036424818659194e+00 -1.2758903391299694e+00 + 51 -2.8071738968594575e+00 2.8702060905481259e+00 4.3081030715942719e+00 + 52 5.8453254803952301e+00 -6.1511156037641070e+00 5.8404459278581990e+00 + 53 4.3893496213428964e+00 3.9529682528455976e+00 2.5293461908066792e+00 + 54 3.1864812498705710e+00 -3.9263054351164062e+00 -2.7996740328705556e+00 + 55 1.6741928863012809e+00 -3.1118648603332209e+00 -4.5507928276719491e+00 + 56 -7.2755429366074531e-01 2.3638688232901517e-01 -2.4423206268377928e+00 + 57 -4.6903040027292120e-03 -1.3232888876597855e+00 -2.0467223907307161e-01 + 58 2.8879619252105058e+00 -1.4685560725608242e+00 1.9392897818363348e+00 + 59 3.7559063578984673e+00 2.9520899615521978e+00 -3.5747082183205041e+00 + 60 -3.4120487353432085e+00 -5.9079921317921702e+00 -3.3313655490934537e+00 + 61 -1.1947245972934271e+00 1.8614078819708411e+00 -1.1807010370078419e+00 + 62 -3.8048373658391457e+00 3.5279689971056665e+00 -2.7361781562145961e+00 + 63 2.2871253489947252e+00 -4.8341223399724607e+00 -4.5508414479585668e-01 + 64 3.5904334294349534e+00 3.8516221789447727e+00 5.8638653440476931e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-tersoff_mod_c.yaml b/unittest/force-styles/tests/manybody-pair-tersoff_mod_c.yaml index f172c9789..614926c32 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff_mod_c.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff_mod_c.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:32 202 epsilon: 1e-12 prerequisites: ! | pair tersoff/mod/c @@ -83,73 +83,73 @@ init_forces: ! |2 62 -4.7911545216150282e+00 4.3378864433672462e+00 -2.6608977921209904e+00 63 3.8818660647417813e+00 -6.6892167616182174e+00 6.9165485826786144e-01 64 5.1815592623345079e+00 6.0301829566070024e+00 1.0737893845502111e+01 -run_vdwl: -275.794870368791 +run_vdwl: -270.224607668554 run_coul: 0 run_stress: ! |2- - 3.2474795701510089e+01 3.4510987071484891e+01 3.8695007722179838e+01 -3.8232466751064074e+00 3.3193703212455567e+01 1.1651133689747770e+01 + 3.7674451362255276e+01 4.0326697108038509e+01 4.5577845337707849e+01 -4.6735158236851788e+00 4.8643168908345842e+01 1.1894000727069708e+01 run_forces: ! |2 - 1 -7.9916337729098008e-01 2.8395319668361365e+00 1.3687637443678211e+00 - 2 -1.9908598696494593e+00 -1.4004484316870771e+00 -1.8145676055549023e+00 - 3 8.4923996979905203e-01 3.1418762059340777e-01 -6.3912272072932219e-01 - 4 -2.0336821018762752e+00 2.8424588959923311e+00 3.3252044603120101e-01 - 5 -2.1959577489014253e+00 -5.3375610794985517e-01 3.0935341215172696e-01 - 6 1.0155423645964312e+00 3.6798897239381803e+00 1.6556939773922417e+00 - 7 -4.6399863391393725e-01 -5.1382489104889850e-01 2.8559566100881222e+00 - 8 1.6353807548321675e-01 8.0887386656658800e-01 -1.1924042469473850e+00 - 9 -4.0222713614306760e-01 -3.4299839962359178e+00 -2.9343220173145870e+00 - 10 -6.3244922266550041e-02 -2.2623367837346486e+00 -2.3386308215641209e+00 - 11 2.7522904492196867e+00 -3.6376794324618826e+00 2.9263944168334208e+00 - 12 -6.8719738770845460e+00 -4.1509297509477712e+00 -2.6379028083278735e+00 - 13 9.6240327585601659e-01 6.0913367240319563e+00 -1.5511863103751238e+00 - 14 -2.3872510774898710e+00 4.6964545685072867e+00 8.7144933207622108e-02 - 15 -5.1483118535835803e+00 5.9508828570962207e+00 -1.7011650335360340e+00 - 16 2.1221231073423663e+00 -5.1299215714532576e-01 6.4956658419632358e+00 - 17 1.3029918045704934e+00 4.2355009939984161e+00 -4.9226387352903016e+00 - 18 -7.9940101898037452e-01 6.3301139977495069e-01 3.8482841555360325e+00 - 19 -1.8467782474594197e+00 -3.1619290842305112e+00 -7.3141992352870522e-01 - 20 -7.3523997387218074e+00 -8.8938490118371005e-01 1.6456233535658136e+00 - 21 3.2378945616894415e+00 1.5421146866664430e+00 -3.3042016258789113e+00 - 22 -5.2188836792454518e+00 4.2555634530532211e+00 -4.3873476691850408e+00 - 23 2.6910591392000378e+00 4.5217377435987434e+00 1.2431414293232086e+00 - 24 2.7630055810652823e+00 1.0349673143123788e+00 2.9527688556547163e+00 - 25 9.7835650126070939e-01 1.6204200310558764e-01 1.3301639932222076e+00 - 26 -7.3056017976262955e-01 -1.0638228894045350e+00 2.0441004906079465e+00 - 27 2.7335748823624391e+00 -2.5792839151285446e-01 1.6492029804597561e+00 - 28 6.4648962756636141e-01 2.6064822661580873e+00 4.6206112630123641e+00 - 29 -3.6207126139010413e+00 1.0543869760675495e+00 -1.6814536890505254e+00 - 30 -1.3462238630781862e+00 1.0418545293477948e+00 -1.1016639019306111e+00 - 31 -1.2137577282937255e+00 2.0268100180314703e+00 -9.7395850996118805e-02 - 32 -2.8257774695522162e+00 3.8783262206394742e-01 -1.2643365178571548e+00 - 33 4.7599487247686429e+00 -2.7597182889335601e+00 2.8229177540882748e+00 - 34 5.4922745006786333e-01 9.3065731147143449e-02 2.1724391371509988e-01 - 35 1.3345226768554266e+00 5.0029742209038197e-01 2.8641229427441424e+00 - 36 -1.1217877109611538e+00 -2.7359037710368241e+00 -2.2514663503374624e-01 - 37 -1.7805140255845884e+00 1.2140214584480664e+00 -2.2265073901788459e+00 - 38 -6.4050934363464929e-01 -6.1238442484364475e-01 7.1329619936905031e-01 - 39 3.5017506527775359e+00 -5.3565729084921365e-01 -4.3470655497656310e+00 - 40 4.7957022364437663e+00 -2.0725765651572310e+00 -2.6958077632617914e+00 - 41 2.0874661037264897e-01 -6.9701598297907597e-01 -5.8203495844387154e-01 - 42 -4.5351533556579531e+00 -2.3915196071777896e+00 2.1058309538404144e-01 - 43 1.2286706775182532e+00 -5.5089849808766029e+00 -7.0217100291119161e-01 - 44 4.9889262122944951e+00 -5.2625564341002029e+00 6.2893319159386329e-01 - 45 -2.5849271883896847e+00 1.6204602869165532e+00 -2.8946576662876069e+00 - 46 -3.0446016113671648e-02 -1.6054137540965632e+00 5.9779174764707381e+00 - 47 3.0542841751222456e+00 1.6659726007819589e+00 8.9127795507627994e-01 - 48 1.2228540754982880e+00 7.8998634910681598e-02 -3.9822088016694884e-01 - 49 -3.3521487664968794e+00 -5.6726783066381348e+00 -3.1052568895711494e+00 - 50 -9.3103591718884804e-01 3.5400288054672151e+00 -2.2077966214036970e+00 - 51 -2.3394093576305144e+00 2.7664815454176295e+00 4.3509700303650565e+00 - 52 4.7940149473631690e+00 -4.9119221166835381e+00 4.2517331562128842e+00 - 53 4.3693214239702955e+00 3.9811506175295404e+00 2.6445458170463865e+00 - 54 2.7201019549059295e+00 -3.5163356288233216e+00 -2.0564993136098142e+00 - 55 8.7397374494345714e-01 -3.0225604582538672e+00 -4.1352355112113433e+00 - 56 -5.8211143716302594e-01 -3.9743235564492085e-01 -2.0095025235163426e+00 - 57 1.1433821124718713e-01 -1.5670170198273878e+00 -2.0814868576955831e-01 - 58 2.6695231003096840e+00 -1.0533780221295008e+00 1.3662688329066752e+00 - 59 3.3933409795739005e+00 2.5675383553329434e+00 -3.2731885334332276e+00 - 60 -3.7574605564721586e+00 -6.0307875427419715e+00 -3.5246947220861968e+00 - 61 -8.9293024279856215e-01 2.0033343537690698e+00 -1.2487352376829823e+00 - 62 -3.9929704993382833e+00 3.2977536362004498e+00 -2.1647714388871426e+00 - 63 3.1330925571892028e+00 -5.7967556323730109e+00 4.6233787916491820e-01 - 64 3.9217198033909910e+00 3.9105913229570115e+00 7.5376626537329443e+00 + 1 -1.1142742666418199e+00 3.2887741993210065e+00 1.7241628867442698e+00 + 2 -2.6148518477021274e+00 -1.1740849208477933e+00 -2.3703008670257626e+00 + 3 1.2089929150716658e+00 -6.7487848951954810e-03 -8.7176891527392342e-01 + 4 -2.8784378291695250e+00 3.4849640896455774e+00 1.2253751868757390e+00 + 5 -2.1768875283676650e+00 -5.0683280025488298e-01 1.8771971799360698e-01 + 6 6.8363271094370026e-01 4.1188116820530274e+00 1.7510959407143254e+00 + 7 -6.9759680551813874e-01 -8.4290063305126406e-01 3.1663839869782047e+00 + 8 3.3563530432502575e-01 9.4980829624164631e-01 -1.2775241043615468e+00 + 9 -1.2090643268521584e-01 -3.7768794974128017e+00 -3.2480515433857793e+00 + 10 -3.9827173027341262e-02 -2.3469800281115409e+00 -3.0340141995027476e+00 + 11 4.1282097269421190e+00 -4.7968097304112458e+00 3.8022999483560960e+00 + 12 -9.6623400503948922e+00 -6.5981540025236161e+00 -4.5946083341882282e+00 + 13 3.0038357850795766e-01 7.9786917485485045e+00 -2.6901638494120639e+00 + 14 -2.8062338737355890e+00 5.6004891316720968e+00 -4.2961390202334887e-01 + 15 -7.2648805745731693e+00 8.3251945285468132e+00 -3.2031777212047521e+00 + 16 3.2631813187452239e+00 1.6950378464586580e-01 9.8836563846805330e+00 + 17 1.7876660581841444e+00 5.6116255374247288e+00 -6.6294360080608064e+00 + 18 -3.3201159487641663e-01 7.3194654839619400e-01 4.3820340292676310e+00 + 19 -1.8206300493373171e+00 -3.3051630706796131e+00 -8.4589712208255907e-01 + 20 -9.8897929988994360e+00 -4.8658336333811736e-01 2.8531210732927477e+00 + 21 4.0736008300140742e+00 2.4398907305541004e+00 -3.9565796667215416e+00 + 22 -8.4440920402106130e+00 6.8547775863267688e+00 -7.2142224018556904e+00 + 23 2.5621567759218009e+00 5.1218946302492041e+00 1.6184144172540929e+00 + 24 2.7919657956955897e+00 1.7126950729205657e+00 3.6356286227515984e+00 + 25 1.0239401894422706e+00 4.9099294217466116e-02 1.5335034952572728e+00 + 26 -7.2866022636019356e-01 -1.3606385629801949e+00 2.0823740177212704e+00 + 27 2.9082225152359640e+00 -2.8957326570201725e-01 1.7118504504699348e+00 + 28 7.5417421527058526e-01 2.2935971057630433e+00 5.6934344720508596e+00 + 29 -3.7987533354094705e+00 1.2044876617925269e+00 -1.8672964369860861e+00 + 30 -1.5427652070949360e+00 1.3593187984081179e+00 -1.0476153051317474e+00 + 31 -1.4767939250923430e+00 2.2127425295346232e+00 9.5875204360308941e-02 + 32 -3.2722890231175139e+00 6.0495488607351211e-01 -1.3043629673763908e+00 + 33 6.8576785534296789e+00 -4.6521173898310870e+00 4.5197885948721925e+00 + 34 5.9268805017826043e-01 5.2042918801102900e-02 2.1374154196651229e-01 + 35 1.3952766836821675e+00 2.4050478171119805e-01 3.1729614847063221e+00 + 36 -7.6808099170433208e-01 -2.9332921244997023e+00 1.2007998407540929e-01 + 37 -2.2027921686068241e+00 1.5570955346907995e+00 -2.5442808648260775e+00 + 38 -7.3699646633911131e-01 -7.0500791082351566e-01 7.0390215916361343e-01 + 39 5.0221753494654973e+00 -7.0085036602650153e-01 -5.8773682809836112e+00 + 40 5.1673030874188219e+00 -2.6815680399585395e+00 -3.0626556877439941e+00 + 41 1.0676789878963255e-02 -9.7021367768748157e-01 -7.5310859725548096e-01 + 42 -5.8443700387458337e+00 -3.2279591656528281e+00 6.9962004533636746e-01 + 43 2.0876420381888621e+00 -7.4907210140762883e+00 -1.1070376746626898e+00 + 44 6.3410913871860650e+00 -6.7523901286198313e+00 1.0930045880468786e+00 + 45 -2.7411980429804692e+00 2.5203975506934992e+00 -3.6867197118973793e+00 + 46 7.7708166258764727e-02 -2.0166728039677793e+00 7.0577312583076841e+00 + 47 3.3346218642295486e+00 2.1393138094643183e+00 1.2524932605254870e+00 + 48 1.2617182562996003e+00 -2.7597261673746321e-02 -4.0954991698920334e-01 + 49 -3.4857756623633440e+00 -6.2071682527566612e+00 -3.6090400242649121e+00 + 50 -1.2375804366925611e+00 4.1994112212565522e+00 -2.6062770185976762e+00 + 51 -2.4338545743769773e+00 3.4676170215863142e+00 5.0923167347867135e+00 + 52 7.4922597808143800e+00 -7.9644243048257097e+00 7.3057144106772487e+00 + 53 4.9226077604518723e+00 4.6027173886959991e+00 2.5390308924823080e+00 + 54 3.3826824333268939e+00 -4.0188767893934827e+00 -2.4723493073275757e+00 + 55 2.0072747016085981e+00 -4.4688586229115996e+00 -5.8026217554186506e+00 + 56 -8.2643969843789811e-01 -3.5785652759206865e-02 -2.4907554185925691e+00 + 57 1.8595428092644131e-01 -1.4292567630963531e+00 -1.8534712150892824e-01 + 58 2.7881040389940166e+00 -1.4502699158114176e+00 1.8440006063741061e+00 + 59 3.9594919422179045e+00 2.9464604530667033e+00 -3.6566709427414494e+00 + 60 -5.3137611446251158e+00 -8.4544236376661512e+00 -5.4988782544210464e+00 + 61 -8.6171618111163240e-01 2.1350195440843511e+00 -1.4658442767416378e+00 + 62 -4.7782055505377610e+00 4.3156805938089189e+00 -2.6385037834899929e+00 + 63 3.8910892690837837e+00 -6.7270549290274504e+00 6.5341336803071237e-01 + 64 5.3129893707953428e+00 6.1163287510784619e+00 1.0836913217935809e+01 ... diff --git a/unittest/force-styles/tests/manybody-pair-tersoff_table.yaml b/unittest/force-styles/tests/manybody-pair-tersoff_table.yaml index 3cb005cf4..87c5733c9 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff_table.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 5e-11 prerequisites: ! | pair tersoff/table @@ -83,73 +83,73 @@ init_forces: ! |2 62 3.0207711149550320e+00 -5.7813674257257364e-02 3.7863400433938121e-01 63 -6.1967090156304634e+00 -4.9695164154437226e+00 -5.2998409073804016e+00 64 5.1027648459718051e+00 5.3292253828779392e+00 -8.7272294951206089e+00 -run_vdwl: -178.058033986288 +run_vdwl: -163.22697978934 run_coul: 0 run_stress: ! |- - -5.1394768731412853e+02 -5.0846653160199179e+02 -5.2011513854153361e+02 -8.7883229436386543e+00 5.6457828153841163e+00 4.7063925693300376e+01 + -5.4984912642329925e+02 -5.4747889955989376e+02 -5.6218018956698495e+02 -1.3191983999982980e+01 -1.3022233748295864e+01 5.4633646266385000e+01 run_forces: ! |2 - 1 -9.2566035348884999e+00 1.0077283504202199e+00 -4.8027801783339070e+00 - 2 2.3998487120357463e+00 -1.1947631024354305e+01 1.7251986198303744e+00 - 3 1.7761229185696443e+00 1.9054018879858150e+00 -2.2724102717374479e+00 - 4 3.3347785572465374e+00 1.0397334593442422e+00 8.4324550053413869e+00 - 5 3.5224792751936431e+00 4.8564111701585588e+00 9.6179331696942683e+00 - 6 4.5275108875256000e+00 -4.9224374871203640e+00 3.3528524831601034e+00 - 7 -1.8093095036034370e+00 -4.6870632389741917e+00 -7.9986911225867274e+00 - 8 -3.3580456698963550e+00 -2.4400667637465290e-03 -1.3620810815360920e+00 - 9 -1.1549806305315341e+01 3.3343498697717511e-01 8.9829395072264329e-01 - 10 -5.5043537244684773e+00 -2.4520398038303037e+00 -1.9605025585455449e+00 - 11 4.4274986064211923e+00 5.6793833478923901e+00 9.4331085728817197e+00 - 12 6.1014992011004878e+00 -4.8029899046342139e+00 -3.0355892483172444e+00 - 13 -2.3188554697832462e+00 -1.3290565032582846e+00 2.0742401835202036e+00 - 14 5.1178562414224791e+00 1.6515608570444342e+00 -6.0532914619417362e+00 - 15 -3.5892947760292770e-01 -6.1866493923735444e-01 -1.2154433323458562e+01 - 16 -6.7644890708483318e+00 5.9162038704925104e+00 2.8177777892073563e+00 - 17 8.5459633198301663e+00 1.6413621151982376e+00 3.9669796408418505e+00 - 18 -4.8222891876168532e+00 -4.3708824274261051e+00 3.4937579569867365e+00 - 19 2.2264463224541462e+00 -2.8733975334529207e+00 -7.8166829931591453e+00 - 20 3.2796801180628909e+00 -5.3191450367785598e-01 7.7821247928959858e-01 - 21 -2.7659211894610944e+00 -8.6441355234481865e+00 1.5812466435689063e+00 - 22 7.8148804202727495e+00 5.0038217200793857e+00 -7.0422846461300344e+00 - 23 7.8425937035300022e+00 -8.4410864460326405e+00 5.6778064251855405e+00 - 24 1.2066522542360372e+00 8.3472687716242522e+00 3.1725426610707537e+00 - 25 -3.6623878162645775e+00 -4.1813758257450804e+00 -7.2968136532147163e+00 - 26 2.5713412068524004e+00 -2.5408002550043456e+00 -7.0385977434330425e+00 - 27 3.7275421200222043e+00 -5.2709856078665993e+00 4.4767837754634376e-01 - 28 -3.4154859921828082e+00 -2.3851066028409340e+00 -5.0316223108728408e-02 - 29 1.5240042016292588e-01 7.2360697725698051e+00 2.2791037638024929e+00 - 30 7.0113846179699513e+00 -1.8787657129693625e+00 1.4574293534812237e+00 - 31 5.6883358059498450e+00 -9.6341549807637272e-01 -4.2245884323528475e+00 - 32 6.2466840236582701e+00 2.4999913216931047e+00 -2.1641073643855426e+00 - 33 -5.9880417986967380e+00 -2.7478931805546631e+00 2.8138567722489123e+00 - 34 2.5647817565489164e+00 1.8617523523366026e+00 -9.7172849593190236e+00 - 35 -3.5060341733584526e+00 -9.0237098060215768e+00 1.1770654221112442e+00 - 36 -2.5246494643706727e+00 7.0663728535561230e+00 -3.1349307977062026e+00 - 37 -5.5405496188611218e+00 4.3460853070738512e+00 8.5790341076662955e+00 - 38 -1.3910399033222542e+00 6.8645625994929125e+00 -4.4200902140846656e+00 - 39 5.4184148388185953e+00 -3.4406000337881224e+00 8.6553968902184817e+00 - 40 -2.6475382751305840e+00 -9.6105514528384273e-01 -1.8110660765453432e+00 - 41 -2.6749746281308302e+00 1.0522701742849794e-01 9.7391280556148896e+00 - 42 5.5610943228802574e+00 -2.2468106492546469e+00 -3.4123407480689298e+00 - 43 -9.3652047930018023e-01 9.9796616927878401e-01 1.7812183103345820e+00 - 44 -9.4956184895320117e-01 8.2547135221670487e-01 1.2487365842645433e+01 - 45 -4.4331175102913996e+00 5.2116495599290911e+00 -6.2695791083891343e+00 - 46 -7.3320350700380148e+00 6.8971581770134662e+00 3.8963658146337847e+00 - 47 1.9858371790970455e+00 -1.4852614449249550e+00 8.4274231441037486e+00 - 48 -6.9517319181050343e+00 -7.2112415844753510e+00 7.6606438686829286e+00 - 49 -3.2036157031172867e+00 5.5662434195554056e+00 -2.7617454643589232e+00 - 50 4.3053409655962884e+00 -2.3640451738266752e+00 7.4207546641204158e-01 - 51 -1.0745364984704796e+01 -2.1284297905694660e+00 -1.3329579329854062e+00 - 52 -2.6515694547782132e+00 -7.3074505448276331e-02 1.1060256600653522e+00 - 53 3.5579108889862212e+00 -5.2237815190825754e-01 9.3831787574673822e+00 - 54 1.6688888928644392e+00 2.6487643134277210e+00 -1.0427233594443427e+01 - 55 1.0034713945938609e+01 1.0234413969920062e+00 -8.8643316171984998e-01 - 56 4.5356429306807264e+00 5.0852597474470889e+00 2.1899165642851095e+00 - 57 -2.3063688729216909e+00 1.2872297695277920e+01 9.0859036310960128e-01 - 58 -9.7296681808057723e+00 -1.6561529998497799e+00 3.4072849729092032e+00 - 59 6.8712291462544846e+00 4.5941231523074855e+00 -6.5895924901577025e+00 - 60 -3.9127677104140677e+00 5.8663584436714515e+00 -2.1774330406300964e+00 - 61 -4.1017636130215696e+00 -1.2643498990124758e+01 -2.5184011843270957e+00 - 62 3.5192808374081448e+00 6.4461039498890293e-01 -2.8499472299838891e-01 - 63 -3.7332743224945890e+00 -3.4101596176779831e+00 -6.2778891731735511e+00 - 64 3.3020300351577703e+00 3.1627843949473773e+00 -6.8660441174914375e+00 + 1 -8.2294664809596352e+00 6.6414930933892902e-01 -1.2477773066233191e+00 + 2 2.9539176939111926e+00 -1.0567284483752168e+01 1.1661462345271116e+00 + 3 3.3196520055415224e-01 3.1585033662973663e+00 -1.3991020258502427e+00 + 4 9.5391597989029775e-01 3.7826206319330608e-01 9.5055287518999929e+00 + 5 4.1639677717323522e+00 3.9705385486906728e+00 6.5682582288263474e+00 + 6 6.6727025113078691e+00 -3.6374678482742935e+00 2.7114295020477472e+00 + 7 -4.2187053365865825e+00 -7.5833549302324847e+00 -5.5694743059860929e+00 + 8 -3.4319528960261474e+00 -3.6671932710177924e-01 -4.2144132149307811e-01 + 9 -1.3812182620743895e+01 3.4080962028262052e-01 8.0596670146508709e-01 + 10 -4.7413791385358577e+00 1.8126389408422379e+00 -4.0849671129860710e+00 + 11 2.8522774075226960e+00 4.0371268976765382e+00 8.7789270256760652e+00 + 12 7.8507054418241271e+00 -7.6881467248612214e+00 -5.2541058678372625e+00 + 13 -1.6686138137623019e+00 -2.2717384819306714e+00 1.3414699447097220e+00 + 14 6.2566159963887245e+00 2.6175751287717706e+00 -7.3109893364750747e+00 + 15 -3.5490310905539335e-02 -6.0326510814190204e-01 -1.0115249973674970e+01 + 16 -7.2839722195342738e+00 6.4191598398015239e+00 3.5013295844019563e+00 + 17 9.5592895784016036e+00 2.7178377237722149e+00 5.0809617498491679e+00 + 18 -3.8846762490834275e+00 -3.3430975102194491e+00 3.2802431368519831e+00 + 19 6.2771452532179073e-01 -4.8514295570110137e+00 -7.4198976450916350e+00 + 20 3.3548793836145525e+00 -3.5511158399242304e-01 5.8901233071052550e-01 + 21 -3.2206597340717873e+00 -9.9286305168118787e+00 1.2785713111980024e+00 + 22 7.4555288573565832e+00 5.0895452010742748e+00 -7.7346401386959638e+00 + 23 7.0720176647243811e+00 -8.2327188987232258e+00 4.8999202252109386e+00 + 24 3.8538954953326297e+00 7.6168843133250412e+00 2.3557193287141263e+00 + 25 -3.9459097567981560e+00 -2.5213358772517909e+00 -7.4689122426612240e+00 + 26 1.0113816925218237e+00 1.7545109778291026e-01 -6.2594250719334976e+00 + 27 3.1807986295508730e+00 -6.5432275034559986e+00 1.2618295733207852e+00 + 28 -5.9934201392146171e+00 -5.1405036574938192e+00 2.9138362289633570e+00 + 29 3.4534597866123775e+00 7.9689150509480244e+00 -2.4166438551739500e+00 + 30 9.3924428425367203e+00 -4.1698364948866242e+00 2.6643733120479514e+00 + 31 7.3358343420464820e+00 -4.1973128890450697e+00 -8.3009919421939493e-01 + 32 7.3943964446947419e+00 4.1542312035276128e+00 -3.4245717866218741e+00 + 33 -7.7194411645166419e+00 -5.3308161128616245e+00 4.5490234210334703e+00 + 34 1.5342684456939937e-01 1.9182147751860050e+00 -5.7227160966501689e+00 + 35 -2.2413378415839249e+00 -1.0393991270144280e+01 4.3416821686799845e-01 + 36 -1.1207049632253476e+00 9.8633130637979356e+00 -7.4140442740704549e-01 + 37 -2.4246181272317759e+00 2.3044112840464521e+00 5.7890548861329147e+00 + 38 -5.3737982537697881e-01 5.2786048565955124e+00 -2.3626167718336388e+00 + 39 6.3886478293877422e+00 -4.3399662707508568e+00 9.0181883395980922e+00 + 40 -2.3861593594587527e+00 -3.2836181616230879e+00 -5.5776748788473061e+00 + 41 -9.0638272528677177e-01 1.9914298116949909e+00 8.5108394396020746e+00 + 42 5.9551465724056314e+00 -2.5585584228208895e+00 -5.1987930447366395e+00 + 43 -4.3618521596071935e-01 1.6708256912543553e+00 1.2820412593527140e+00 + 44 8.4974376086929548e-01 3.0899461586086168e+00 1.2851645764238949e+01 + 45 -7.0442510478937441e+00 5.0586654366954749e+00 -4.6674347162421634e+00 + 46 -7.1801836310972345e+00 6.7590894764552827e+00 3.7635069315580281e+00 + 47 5.1315946987340721e-01 2.6779224986895449e+00 9.2741788011393087e+00 + 48 -9.3078500075984518e+00 -7.2851356503380176e+00 5.4021613046464729e+00 + 49 -5.5978637466341787e+00 7.7697344783588189e+00 -5.6054471231783642e+00 + 50 6.8944202167523922e+00 -2.4979216322657587e+00 -1.6711214757900490e+00 + 51 -1.0589436843774704e+01 -1.1433775235707844e+00 -2.5199897550819053e+00 + 52 -1.1738473359959367e+00 1.1072106099519987e+00 2.6528388936368517e+00 + 53 3.0681274139785946e+00 2.0282658910678988e-01 1.0584416144178798e+01 + 54 2.1439319444508604e+00 3.4807755847240451e+00 -1.0404009610996301e+01 + 55 1.1341939980104106e+01 1.1812374286977510e-01 -4.3787910079773323e-01 + 56 -5.0845126040530175e-01 4.3721508180563360e+00 2.6661830493952841e+00 + 57 -3.7840212290072417e+00 1.1089750351209677e+01 2.3885040079365125e+00 + 58 -9.4268764900724467e+00 -2.7210189751187666e+00 4.3142509107103528e+00 + 59 6.4673533553547227e+00 6.8013180132352824e+00 -8.1798705658283151e+00 + 60 -6.3371711661062164e+00 8.2056355644898247e+00 -4.4996983602855929e+00 + 61 -2.3170591926062212e+00 -1.3658338566213780e+01 1.0623240645720550e-01 + 62 3.0558158168658092e+00 -1.4394172849075848e-02 3.3502596633959625e-01 + 63 -6.2121951105101596e+00 -5.0242044177386420e+00 -5.3263543782017688e+00 + 64 5.1584245301070339e+00 5.3709454591296097e+00 -8.7534754220448452e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-tersoff_zbl.yaml b/unittest/force-styles/tests/manybody-pair-tersoff_zbl.yaml index d11fed80c..00614de50 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff_zbl.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff_zbl.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 5e-11 prerequisites: ! | pair tersoff/zbl @@ -83,73 +83,73 @@ init_forces: ! |2 62 2.6584101684745818e+00 9.8218829465888779e-02 2.4244336018167600e-01 63 -5.8030976211176633e+00 -5.8640980265649132e+00 -4.9661385661230621e+00 64 5.1854732626889648e+00 5.4062029912491161e+00 -7.4682505070688565e+00 -run_vdwl: -168.515804855579 +run_vdwl: -154.378489848664 run_coul: 0 run_stress: ! |- - -5.1841557043298781e+02 -5.1892174147548633e+02 -5.2617752502111762e+02 -1.1314531552299417e+01 8.7875167476580707e+00 5.1815980028093890e+01 + -5.4624007123172817e+02 -5.4721759715152484e+02 -5.5903048343882665e+02 -1.6221103215693379e+01 -6.7886936766953410e+00 5.4672709772731153e+01 run_forces: ! |2 - 1 -9.1301609181552656e+00 1.1957683204487815e+00 -4.5460157073376077e+00 - 2 3.2776810672840515e+00 -1.3085871606564051e+01 1.1806494551293618e+00 - 3 1.8315841558517838e+00 1.3262909027211442e+00 -2.9986780541343045e+00 - 4 3.8787767570488025e+00 1.0720562363070822e+00 9.5864034165261582e+00 - 5 2.4299243014499536e+00 5.0866323414920460e+00 9.7139919882983641e+00 - 6 5.0985768567980276e+00 -2.8555457774588864e+00 2.6253842585461493e+00 - 7 -7.7439181529068757e-01 -4.8310181062524213e+00 -6.0078686870229205e+00 - 8 -2.4926478080666103e+00 8.1851419495890321e-01 -2.6565204652884225e+00 - 9 -1.2006758069598721e+01 -1.0775761244461626e-01 1.0576688982994074e+00 - 10 -4.8060944156753980e+00 -2.6906377370548809e+00 -3.2193306503164898e+00 - 11 3.8346282033681951e+00 4.2063245193633296e+00 9.1383763500636750e+00 - 12 5.6014613299568596e+00 -4.5852098712070246e+00 -3.4691765391064520e+00 - 13 -2.7554683698851719e+00 7.3965653975875301e-01 2.5875764021965244e+00 - 14 4.4201029530371860e+00 2.6546408449900443e+00 -5.5339107464515802e+00 - 15 -4.6144395917172876e-01 2.3640466933840187e-01 -1.1865629739424508e+01 - 16 -5.9881602539519481e+00 5.1615703973749332e+00 3.9522722890022290e+00 - 17 7.8066454734355712e+00 1.9356843569113025e+00 4.0183959460032330e+00 - 18 -4.2048129687598035e+00 -4.0107703447097283e+00 4.1242761620578161e+00 - 19 1.2413487667153138e+00 -4.3779805564052214e+00 -7.2463002623400321e+00 - 20 3.3996176655745556e+00 -5.7342465446724944e-02 5.4967688817860072e-01 - 21 -2.0059193900008001e+00 -8.2626725133010037e+00 7.9178047700536291e-01 - 22 5.8364843151195656e+00 4.4196082996900588e+00 -7.6558901741958403e+00 - 23 7.0325744091503566e+00 -7.0223702574030256e+00 5.3077646024130116e+00 - 24 2.8041674125680007e+00 7.0833805099855329e+00 4.9750118173063154e+00 - 25 -4.1774709120449858e+00 -4.9678314741113541e+00 -6.2607312380148255e+00 - 26 1.9053152499257546e+00 -1.7517119961442660e+00 -8.4726338069977398e+00 - 27 3.6594088209184088e+00 -5.8213707201333351e+00 -9.7349396071893537e-02 - 28 -3.2397345588226778e+00 -2.7462426540062821e+00 3.7542506318260926e-01 - 29 -1.3801123684640757e+00 7.7648130182871817e+00 2.3498640537061890e+00 - 30 6.9424985761025138e+00 -1.5365468622633238e+00 1.0924482547129712e+00 - 31 5.9377496148015423e+00 -4.4922784551999351e-01 -4.0773550421387643e+00 - 32 5.3497803111618376e+00 2.2838226340208188e+00 -1.9283210626990019e+00 - 33 -5.9972742663279579e+00 -3.4333507575957460e+00 2.3025591247805979e+00 - 34 7.0071644178570391e-01 9.6756304631948331e-01 -8.7521477682404800e+00 - 35 -2.9795968885401094e+00 -8.5885588128963448e+00 1.4525876983612640e+00 - 36 -2.9014668114053594e+00 6.9215485497600540e+00 -2.6287602960505483e+00 - 37 -5.4798081033351140e+00 4.3891901412370453e+00 7.8219815334416278e+00 - 38 -1.4114452832435900e+00 6.2046846182972999e+00 -3.9380910474694599e+00 - 39 5.5046258795003506e+00 -3.6734121933735961e+00 7.8548197056507121e+00 - 40 -3.4421192945532586e-02 -6.7084512524494011e-01 -2.7259226462323105e+00 - 41 -2.4325575558185237e+00 1.3608400669370035e+00 1.0325858665182825e+01 - 42 5.5797723756711779e+00 -2.1376550929874067e+00 -4.0413495715073200e+00 - 43 -1.3459189031983463e+00 1.1486677610790905e+00 2.1193773133864147e+00 - 44 -8.9645973513136368e-01 2.8454341478593514e-01 1.2778900767085311e+01 - 45 -5.6032890374369204e+00 4.6996820031013522e+00 -8.0230836793876730e+00 - 46 -6.9158221680072787e+00 6.3575947622331599e+00 5.1651381663367077e+00 - 47 4.0131015467795255e+00 -1.1094771865954856e-01 7.2472616550054099e+00 - 48 -6.1840116866801207e+00 -7.2532543764210109e+00 7.9062093908630056e+00 - 49 -3.2314428261947796e+00 5.1411738528568511e+00 -2.7914758327825977e+00 - 50 4.8382411105825529e+00 -1.5201401041732816e+00 9.3971670483645164e-01 - 51 -1.1573799806332197e+01 -1.5119534851867609e+00 -2.3549528277235590e+00 - 52 -2.0099195969716588e+00 -4.3653471871907124e-01 2.8132126631806047e+00 - 53 5.3787811655827769e+00 1.3525171052070943e+00 8.4804933473882471e+00 - 54 1.1694727578627844e+00 7.7340028625284152e-01 -1.0541423347485072e+01 - 55 9.4611642726669309e+00 4.9437887022790628e-01 -1.6092705652227484e+00 - 56 3.8928323724490936e+00 4.3247888544127688e+00 5.5261512377621991e-01 - 57 -2.6975098048400517e+00 1.0504487768024228e+01 2.3461539049689519e+00 - 58 -9.8957591837494618e+00 -1.0753274251205771e+00 3.8521254579996631e+00 - 59 6.3773097304508113e+00 4.3409941136654648e+00 -6.9533437007241155e+00 - 60 -3.4830354675710242e+00 6.0076208382264751e+00 -2.8700155510928020e+00 - 61 -3.9256945420303895e+00 -1.1566074896871783e+01 -2.4769887519388551e+00 - 62 3.1309032507858996e+00 7.7916774786999388e-01 -3.9410827378090074e-01 - 63 -3.2853115933185668e+00 -4.1199055035244392e+00 -5.8243046369201750e+00 - 64 3.3724731165803483e+00 3.2200570250582743e+00 -5.4250274767730042e+00 + 1 -7.7710895302100775e+00 9.8421268919149085e-01 -9.2597011523665484e-01 + 2 3.7458735949792326e+00 -1.1595362271395059e+01 6.0898696083058723e-01 + 3 3.8507676102829136e-01 2.1249103315545970e+00 -2.1091659350102829e+00 + 4 1.6152778155646761e+00 5.7848628778240530e-01 1.0402974682179648e+01 + 5 2.7649657757706478e+00 4.0900725936990288e+00 6.6835500029952026e+00 + 6 6.5865965591105393e+00 -1.8292495063151177e+00 2.0366573729446835e+00 + 7 -3.3307881220012630e+00 -7.0942328484718971e+00 -3.7457028752467059e+00 + 8 -3.0885795093442283e+00 3.4989222472378345e-01 -1.5424167903817163e+00 + 9 -1.4165950829089580e+01 -5.3940768744079381e-02 6.4139844116377986e-01 + 10 -4.2375705486574775e+00 1.5885910226589701e+00 -4.6304296857792444e+00 + 11 2.5005727825222128e+00 2.7999710123559614e+00 8.2537716086095188e+00 + 12 7.2068862770841138e+00 -7.1262985150488740e+00 -5.5812834302209096e+00 + 13 -1.8167920176170453e+00 -5.1670781420170431e-01 1.5646880590075538e+00 + 14 5.8676882814421871e+00 4.0565941081000698e+00 -7.0973772200470240e+00 + 15 -2.5275560092817706e-01 9.3977172310912849e-02 -9.9716762207694138e+00 + 16 -6.9338836089303175e+00 6.0213296077197844e+00 5.1874273368568140e+00 + 17 8.7953600094300750e+00 2.8793107758462098e+00 4.8499081444476015e+00 + 18 -3.1588600347669251e+00 -3.4138281277311084e+00 3.7471063006923906e+00 + 19 3.4879085903840451e-02 -5.8773630155039998e+00 -7.0587843966793908e+00 + 20 3.4330211575164440e+00 -4.1371194520657628e-02 5.1329944991954957e-01 + 21 -2.4947379150588445e+00 -9.4894349135054981e+00 5.0364943521040173e-01 + 22 5.7290751903491852e+00 4.9148163326514185e+00 -8.0069424396003779e+00 + 23 6.4733242427884665e+00 -7.0483885816608449e+00 4.6473355322331757e+00 + 24 4.6479345521550304e+00 7.0925025187318305e+00 3.8525865642161286e+00 + 25 -3.4506424790473402e+00 -3.5399464500402189e+00 -6.6082903939147188e+00 + 26 5.9997061031751253e-01 6.0541226955683836e-01 -7.0861839854969526e+00 + 27 3.4071088271546022e+00 -7.6531751215214143e+00 7.2787548943419222e-01 + 28 -5.4557756543079119e+00 -5.1680412737283516e+00 2.9604843714511313e+00 + 29 1.7085911862656871e+00 7.9153761626366883e+00 -2.2614782999669041e+00 + 30 8.6713923717970722e+00 -3.6245305638916414e+00 2.1225785953759368e+00 + 31 6.9792669132115908e+00 -3.4772972717074135e+00 -1.2101233867541827e+00 + 32 6.1216044738549016e+00 4.1103412878257624e+00 -3.3121730936202827e+00 + 33 -7.6085526931230545e+00 -6.0171298821199670e+00 4.1648313412889255e+00 + 34 -8.0117159692062412e-01 1.2250441373794045e+00 -5.3195806368378307e+00 + 35 -1.8928310703700715e+00 -9.8771124140652624e+00 8.5290010448185205e-01 + 36 -1.2972038107481758e+00 8.8905397437812486e+00 -5.6974286702164834e-01 + 37 -2.6749889787982033e+00 2.6387889766527675e+00 5.4489977351032781e+00 + 38 -6.4457329686822096e-01 4.7973248360269380e+00 -2.1412759241677901e+00 + 39 6.7111987839588494e+00 -4.7388212995722245e+00 8.5076346108378686e+00 + 40 -1.1502944187229440e-01 -2.7838311317517705e+00 -5.8729430758703129e+00 + 41 -9.1359818351046829e-01 2.6073407276930491e+00 9.1031480730908996e+00 + 42 6.2516745978205881e+00 -2.8059454405892170e+00 -5.8045100753475420e+00 + 43 -9.0162068561726094e-01 1.7535086383109662e+00 1.5881942260025375e+00 + 44 7.4568957675813063e-01 2.3291210910341831e+00 1.2682491711342710e+01 + 45 -7.8827045512830738e+00 5.1136204143684516e+00 -6.0232742119880056e+00 + 46 -7.1909991859724354e+00 6.5930493717367806e+00 5.4969832160946623e+00 + 47 2.1930190183556797e+00 3.3770787280802130e+00 8.3827321095950467e+00 + 48 -8.4316741550207048e+00 -7.2589166508188452e+00 5.6757900084705000e+00 + 49 -5.2787919951503248e+00 6.9617894250151355e+00 -5.1118372569041028e+00 + 50 6.7549914755953635e+00 -1.9686939048679046e+00 -1.5763956001832360e+00 + 51 -1.1722835834823451e+01 -4.6090445788619194e-01 -3.5458019581496889e+00 + 52 -2.9146420150158925e-01 1.0390697544380689e+00 3.8461064397951099e+00 + 53 4.9994022968781895e+00 1.1625746423885346e+00 1.0131719546021975e+01 + 54 1.9501032708877051e+00 2.1828284989853479e+00 -1.0229107175251080e+01 + 55 1.1017951893515445e+01 4.0696912545743419e-01 -2.0395244626507556e+00 + 56 -7.9765871790228693e-01 4.0562421889191471e+00 6.1126701396247074e-01 + 57 -3.9071992996955269e+00 9.4745522825635540e+00 3.5315639655021500e+00 + 58 -9.7049015797211631e+00 -2.9167333408943041e+00 5.4251373767880153e+00 + 59 6.2022134360845467e+00 6.8057985261686955e+00 -8.1728610238859503e+00 + 60 -5.4918491605506929e+00 7.8759347682481566e+00 -4.6821853616106752e+00 + 61 -2.4999011490572789e+00 -1.2787139053923346e+01 -2.1638212824307607e-01 + 62 2.6906159661430955e+00 1.3928009268586639e-01 2.0167150507734921e-01 + 63 -5.8283969248223002e+00 -5.9257942363533367e+00 -5.0040717151583411e+00 + 64 5.2440455790444869e+00 5.4539376835505564e+00 -7.4979555890288445e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-vashishta.yaml b/unittest/force-styles/tests/manybody-pair-vashishta.yaml index d0f2eb94a..1b19a1238 100644 --- a/unittest/force-styles/tests/manybody-pair-vashishta.yaml +++ b/unittest/force-styles/tests/manybody-pair-vashishta.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 5e-13 prerequisites: ! | pair vashishta @@ -83,73 +83,73 @@ init_forces: ! |2 62 -2.6745936396158526e-01 2.8111058048742638e-01 1.6204295193993715e-01 63 3.3265811552668922e-01 -8.0829164437628798e-01 6.1676655388945945e-01 64 2.5167047246154373e-01 2.2796118436162449e-01 -1.2890847486936465e+00 -run_vdwl: -313.860735066532 +run_vdwl: -313.695868863151 run_coul: 0 run_stress: ! |- - -1.6823266272734222e+02 -1.6769002622828248e+02 -1.7052203092220537e+02 1.6390415183743356e+00 -1.1679532092037334e+01 8.3280653475887612e-01 + -1.6862212687979553e+02 -1.6799875916220955e+02 -1.7076495599487473e+02 1.2756734851722502e+00 -1.2318626234293390e+01 1.2479663286743594e+00 run_forces: ! |2 - 1 4.8644131471971841e-01 -9.1232608143660543e-01 -6.2310194460362922e-01 - 2 1.3393977794128566e+00 -2.7348565261442026e-01 8.7655961303357333e-01 - 3 1.5707486941719284e-01 8.1153240527643589e-01 -9.7289836461546320e-01 - 4 1.9796427463902799e-01 -1.0921013729581110e+00 -2.9042812842603660e-01 - 5 -6.7902521648735226e-01 5.8080284239232793e-01 4.0066311685188527e-01 - 6 -2.8452980230104119e-01 -5.0018672753884857e-02 3.5551068635415151e-01 - 7 5.8572215816797180e-01 1.2640037062834633e-01 1.0942180533161248e+00 - 8 5.4834736203953538e-01 3.9763058063722501e-01 -2.0200882443276269e-01 - 9 -6.6261672013750861e-01 8.6603390966248570e-02 7.1554511072340488e-01 - 10 -5.5929402642412196e-01 -7.1960480457817821e-01 -1.4907250085043805e-01 - 11 -3.3250480870141408e-01 -1.6273718034280316e-01 5.7152914630563867e-01 - 12 5.5602656449431520e-01 -2.0378555616033520e-01 7.8990528833246532e-02 - 13 4.7489008863328686e-01 -6.2440679278521216e-01 -3.7631116796095471e-01 - 14 -2.0609926816794977e-01 -2.7580432590210063e-01 -4.0417350127801004e-02 - 15 2.7394322065681798e-01 9.3892857792986395e-02 3.7982358930011673e-02 - 16 -2.5162804323859178e-01 -3.7771297423259487e-01 -9.8238587852850667e-01 - 17 4.1877939802730868e-01 8.5731711109771958e-02 9.3859218724784710e-01 - 18 -7.2471977878478144e-01 -4.0664368465993972e-01 -3.4553372464886356e-01 - 19 -4.8745937087625535e-02 -6.2356012040857323e-01 2.0727390034813520e-01 - 20 8.1232215990984924e-01 2.8338121278738360e-01 2.3413383735199889e-01 - 21 -1.9258260457687104e-01 1.5417500787852179e-01 8.4979385157019172e-01 - 22 9.6739412405966108e-01 1.7094777029994024e-01 1.6519141214180810e-01 - 23 2.9640988596724127e-01 -6.4727860062706630e-02 -5.2331198239284404e-01 - 24 3.1197288934637141e-01 -1.0653738889812776e+00 2.4613115703079824e-01 - 25 -1.3222157048900707e-01 1.9287824417448718e-01 -1.0687909706274114e-01 - 26 6.6963858336879611e-01 2.7536443311377506e-01 -1.3921358926032371e-01 - 27 3.1723875018509745e-01 8.0840008953553444e-01 -1.3402639439359032e-01 - 28 1.6455690667075529e-01 5.7894053910339294e-01 -1.1167034403931775e+00 - 29 -2.8301007482603474e-01 -2.8409275618929547e-01 -5.7362303628387082e-02 - 30 -3.1800791834958703e-01 -1.4722568793242755e-01 -7.2299408071138382e-02 - 31 3.7785555685247557e-01 7.8528837793268580e-03 2.0510546212129288e-01 - 32 7.8568823142872413e-01 3.7621441926789645e-01 -2.2195231721335040e-01 - 33 -8.1204031193767900e-01 -2.5918584535096545e-02 -5.4822621102922708e-01 - 34 9.0377430089083910e-01 2.3556023563222617e-03 -5.4249181274543457e-01 - 35 -3.0228449693476567e-01 7.6823424966386022e-01 1.9710074184774423e-01 - 36 -9.1006897873334558e-01 2.2243346236343808e-01 -1.9589687356432450e-01 - 37 1.4230521719479650e-01 -6.5154051987310280e-01 3.9917443593572977e-01 - 38 -1.1292151026630861e+00 4.0635956316044064e-01 3.6653385069281041e-01 - 39 7.7368097436126093e-01 3.3585148445359836e-01 7.5798069110913358e-01 - 40 2.5675490646756788e-01 4.4146779801073416e-01 -7.5832420936942102e-01 - 41 7.9683299154939075e-02 -5.0998023619050059e-01 -1.6942094109849781e-01 - 42 5.3489923215345148e-01 6.2583893444475647e-01 5.3150357966827078e-01 - 43 4.3150953366175226e-01 3.4251106617468263e-01 1.8713858579638765e-01 - 44 2.7166631736183833e-02 6.3755896938460666e-01 3.1019975268431810e-01 - 45 -1.0266415763007517e+00 1.6282879655478405e-01 2.4889912862867503e-01 - 46 1.6312901571568492e-01 -4.4541049259555897e-02 -1.6364537246217073e-01 - 47 -3.2467268967905150e-01 8.6794088351002507e-01 -1.8425672458764986e-01 - 48 -2.3621080452325272e-01 -1.1969459110188581e+00 5.3625923507429407e-01 - 49 -9.0057183341478408e-01 9.1800333277327995e-01 2.2039239023465473e-01 - 50 -1.3715621346135916e+00 -1.6292126845965993e-01 -1.9130145378467800e-02 - 51 -4.9091417055006148e-01 -1.7653094190066536e+00 -1.9135516672542885e-01 - 52 -6.0210124847882640e-01 -2.7443951813942963e-02 -9.4957908163132521e-01 - 53 8.3243980764689196e-01 8.5420859954954353e-02 2.2294347279673232e-01 - 54 1.2671424980101897e-01 -4.6285869425318049e-01 -3.0047230827733917e-01 - 55 -1.7627588718280662e-01 5.2996528719115910e-01 -2.6201418848310271e-01 - 56 -1.0703755083130259e-01 -5.0757765604513283e-01 2.9114293137467201e-01 - 57 -1.0905729896799360e-01 3.2808582473665598e-01 1.2346577335199894e-01 - 58 4.7688278738147094e-01 1.9738885358609715e-01 6.4289217276979960e-01 - 59 -3.2367672070843334e-01 9.9079666853049564e-01 -1.1595397017822693e+00 - 60 1.7324286279956747e-02 8.9299818746122483e-01 6.4705074359535664e-01 - 61 -1.4935302022207437e+00 -7.9239974668545465e-01 -4.4856933855602110e-01 - 62 -2.1277601252075656e-01 2.1138739770169473e-01 1.6557617222026333e-01 - 63 3.6167529106202745e-01 -7.6209406783076528e-01 6.3677417578544659e-01 - 64 3.3401913832828206e-01 1.9496253621395221e-01 -1.2154197634257087e+00 + 1 4.1515698186142336e-01 -9.1494711145962027e-01 -6.3741531133352769e-01 + 2 1.3988114272352032e+00 -3.3737512082600540e-01 8.0156716864087563e-01 + 3 1.4008937252442286e-01 8.5161551980125649e-01 -9.0429797303823201e-01 + 4 1.6278350053738594e-01 -1.1029068149207020e+00 -2.6074174145538287e-01 + 5 -7.3909385596182453e-01 5.1524058778378268e-01 4.6941837792157948e-01 + 6 -3.3438941520753485e-01 -4.9253238386417014e-02 4.3500871349888104e-01 + 7 6.2046598444901091e-01 1.5315138653781687e-01 1.1426150049769439e+00 + 8 5.3113571448117014e-01 4.3723123060354385e-01 -2.6205798856119739e-01 + 9 -7.0200069399995924e-01 2.2001596083214961e-02 7.9387039548865745e-01 + 10 -6.4407839621658602e-01 -7.0496065237736127e-01 -2.0979163186399438e-01 + 11 -3.6900407576599736e-01 -2.1408317252760645e-01 5.1567964548945144e-01 + 12 5.5090471871687896e-01 -2.0160427046818097e-01 9.4004326267271177e-02 + 13 5.3333763394432265e-01 -5.8563788025804964e-01 -3.5399907058283647e-01 + 14 -1.6495711225763332e-01 -3.4561549042537903e-01 1.1719540779141731e-02 + 15 2.1996037922792389e-01 1.7443264504548958e-01 7.1530691552163628e-02 + 16 -2.8417411872367349e-01 -4.1624597151970777e-01 -8.6345629255869283e-01 + 17 4.3765423845691376e-01 1.2869221068991399e-01 9.5280541391761586e-01 + 18 -8.3549848203942090e-01 -4.3890310122351783e-01 -3.1458308144348712e-01 + 19 -8.0471919276518200e-02 -7.1034511288853652e-01 2.1471115782766470e-01 + 20 8.8863664292602240e-01 2.7800971020900644e-01 1.7462670011707040e-01 + 21 -1.5183819850920277e-01 1.8706406355953664e-01 8.2479520894673142e-01 + 22 1.0184807508662757e+00 1.4889780043425560e-01 1.3448337980901104e-01 + 23 3.1038884646236775e-01 -6.0049717778226132e-02 -5.6582948664382460e-01 + 24 2.6402977473271688e-01 -1.0963221254537747e+00 2.3504331604450934e-01 + 25 -1.2167457497640127e-01 2.2792595669617333e-01 -1.4166074600599024e-01 + 26 7.0250293006106845e-01 3.1407884179824341e-01 -1.7998395731471162e-01 + 27 2.5599451536162199e-01 8.9822587680690258e-01 -2.0198927405117290e-01 + 28 1.4426030510381072e-01 5.7405330272877486e-01 -1.1171092666173585e+00 + 29 -2.5472486572643294e-01 -3.1987265845806023e-01 -7.7390631132202722e-02 + 30 -2.8726232118113015e-01 -1.4016894451814549e-01 -1.9875532912280846e-03 + 31 3.8637896624077306e-01 -8.1894974022263867e-02 2.6486540596936070e-01 + 32 8.5224480726803065e-01 3.4109884397705992e-01 -2.1871622777382216e-01 + 33 -7.4204375970298764e-01 -1.0007228857639283e-01 -5.2302902202163759e-01 + 34 9.3370247429043007e-01 8.3350045944181606e-03 -4.5912832485777266e-01 + 35 -3.3158080199351225e-01 7.6540319999974571e-01 1.9928509117958593e-01 + 36 -8.9702405745624469e-01 2.4008655827107342e-01 -2.6197564401548623e-01 + 37 1.0588449374324238e-01 -6.1403933249017650e-01 3.6126956411686817e-01 + 38 -1.0699977006437462e+00 3.9981631981067567e-01 3.6207387947118175e-01 + 39 8.2444849398014830e-01 3.2965223993162074e-01 6.4409283671253759e-01 + 40 2.6017155725110097e-01 4.1402242965544916e-01 -7.9628612362197670e-01 + 41 1.1714507484519043e-01 -4.9276752289125053e-01 -1.3714761296253586e-01 + 42 5.0093241294506308e-01 7.0508126710819408e-01 5.1144982917211279e-01 + 43 4.7272541261879752e-01 2.3241505737514412e-01 2.2646136155595467e-01 + 44 -2.5876937170599024e-02 6.8092130721140998e-01 2.8122113948263266e-01 + 45 -1.0661885081196474e+00 1.5739625074105568e-01 2.7632860717445440e-01 + 46 1.7643484417603122e-01 -6.1034326275162774e-02 -1.4287512464632052e-01 + 47 -3.2493735356988562e-01 9.3540605275513089e-01 -2.9541155807250696e-01 + 48 -1.6244531278929908e-01 -1.2801245745729810e+00 4.5949358379382055e-01 + 49 -8.3574121866341899e-01 1.0081261321032584e+00 2.8939500845678867e-01 + 50 -1.3375270846260532e+00 -1.5573255771014138e-01 -2.8562348272346050e-02 + 51 -4.8640513078179570e-01 -1.6989987724660187e+00 -2.1200219016251004e-01 + 52 -5.6174602775189331e-01 -7.8059361745833611e-03 -9.2334159836665575e-01 + 53 7.3522566805480571e-01 5.2754129043573850e-02 2.4647467076559415e-01 + 54 1.6355295247776025e-01 -4.3181515470519738e-01 -2.6927885297908127e-01 + 55 -2.0310974962540973e-01 4.6308799071221196e-01 -2.2722645113224527e-01 + 56 -8.8287397642358198e-02 -4.9384998421540510e-01 3.1464301506645287e-01 + 57 -1.4860820885619097e-01 3.6639574225197785e-01 1.1720867410634231e-01 + 58 4.6275352854843915e-01 1.7899967908421616e-01 5.9439183087951564e-01 + 59 -2.7058249149693037e-01 1.0179489376848441e+00 -1.1690002437956235e+00 + 60 7.7037170778347486e-02 8.9082677523281051e-01 6.4356641737403208e-01 + 61 -1.4747138207935717e+00 -7.3565130300681503e-01 -4.0897273434915893e-01 + 62 -2.6386452805826854e-01 2.7597577556184555e-01 1.6332798300784487e-01 + 63 3.3687498480762368e-01 -8.0669308439449527e-01 6.2175103859011904e-01 + 64 2.5974156060981013e-01 2.2440077310655870e-01 -1.2839309152292515e+00 ... diff --git a/unittest/force-styles/tests/manybody-pair-vashishta_table.yaml b/unittest/force-styles/tests/manybody-pair-vashishta_table.yaml index b04f710da..8017dc464 100644 --- a/unittest/force-styles/tests/manybody-pair-vashishta_table.yaml +++ b/unittest/force-styles/tests/manybody-pair-vashishta_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:33 202 epsilon: 1e-12 prerequisites: ! | pair vashishta/table @@ -83,73 +83,73 @@ init_forces: ! |2 62 -2.6746099007558671e-01 2.8111186444558228e-01 1.6204174885500391e-01 63 3.3266077763541602e-01 -8.0829458064608550e-01 6.1676384476099411e-01 64 2.5167391424034580e-01 2.2796564437912092e-01 -1.2890802392853251e+00 -run_vdwl: -313.860787111984 +run_vdwl: -313.695921117013 run_coul: 0 run_stress: ! |- - -1.6823263768839590e+02 -1.6768999741246441e+02 -1.7052199674722613e+02 1.6390291310249023e+00 -1.1679505157505281e+01 8.3282156133592133e-01 + -1.6862210702958757e+02 -1.6799873872591002e+02 -1.7076492974814965e+02 1.2756640884847943e+00 -1.2318605937818671e+01 1.2479616458786664e+00 run_forces: ! |2 - 1 4.8643934396600130e-01 -9.1232450634319884e-01 -6.2309984412029351e-01 - 2 1.3393970551420284e+00 -2.7348631215722752e-01 8.7656003775331692e-01 - 3 1.5707457437048239e-01 8.1153282312124486e-01 -9.7289808708836922e-01 - 4 1.9796308588264225e-01 -1.0920991675744256e+00 -2.9042664590850975e-01 - 5 -6.7902502869429027e-01 5.8080225827896559e-01 4.0066326010564079e-01 - 6 -2.8452906920996102e-01 -5.0017962437035768e-02 3.5551058835958232e-01 - 7 5.8572168296208360e-01 1.2639982283069465e-01 1.0942191505502643e+00 - 8 5.4834728892347584e-01 3.9763083138085875e-01 -2.0200953434963598e-01 - 9 -6.6261848607216822e-01 8.6602325540039729e-02 7.1554334663115393e-01 - 10 -5.5929477357757118e-01 -7.1960607796533893e-01 -1.4907414660880589e-01 - 11 -3.3250197475214827e-01 -1.6273909853793533e-01 5.7153160717989926e-01 - 12 5.5602077298874542e-01 -2.0379120447095356e-01 7.8985281507950367e-02 - 13 4.7488904633716533e-01 -6.2440285917525329e-01 -3.7631163832662479e-01 - 14 -2.0610060963339505e-01 -2.7580114393155308e-01 -4.0418688109324974e-02 - 15 2.7393999196675356e-01 9.3896441261293845e-02 3.7977584906644268e-02 - 16 -2.5162414216378948e-01 -3.7770879299724180e-01 -9.8237995213577300e-01 - 17 4.1878095558303929e-01 8.5733098228963911e-02 9.3859066560991833e-01 - 18 -7.2471999968184031e-01 -4.0664314267379442e-01 -3.4553226041629270e-01 - 19 -4.8747030705768912e-02 -6.2356184236365286e-01 2.0727293941392799e-01 - 20 8.1231821717085750e-01 2.8338281302863888e-01 2.3413423145833803e-01 - 21 -1.9258237982505166e-01 1.5417385585229759e-01 8.4979292938095119e-01 - 22 9.6738761320018796e-01 1.7095434510575469e-01 1.6518343230446453e-01 - 23 2.9641139306938402e-01 -6.4726570340463585e-02 -5.2331086264611826e-01 - 24 3.1197417779939834e-01 -1.0653721542318437e+00 2.4613274275617086e-01 - 25 -1.3222171952250339e-01 1.9287768100206326e-01 -1.0687924976834715e-01 - 26 6.6963886061060252e-01 2.7536385988334566e-01 -1.3921312434497593e-01 - 27 3.1723991553363523e-01 8.0839985005492676e-01 -1.3402533180051507e-01 - 28 1.6455519331940571e-01 5.7894206248936431e-01 -1.1166986726492978e+00 - 29 -2.8301112181298715e-01 -2.8409154360132843e-01 -5.7362916394254039e-02 - 30 -3.1800816279770322e-01 -1.4722530973270934e-01 -7.2299290402477553e-02 - 31 3.7785481684837974e-01 7.8531092069256681e-03 2.0510530482170064e-01 - 32 7.8568752952762599e-01 3.7621476517704400e-01 -2.2195280731906686e-01 - 33 -8.1203720540168001e-01 -2.5922326579699062e-02 -5.4822243399849613e-01 - 34 9.0377460914505237e-01 2.3552141752345435e-03 -5.4249134913710195e-01 - 35 -3.0228327958249046e-01 7.6823370462453611e-01 1.9710205023672339e-01 - 36 -9.1006885272139959e-01 2.2243300075122782e-01 -1.9589762228314500e-01 - 37 1.4230427618173391e-01 -6.5153952938074511e-01 3.9917398015950634e-01 - 38 -1.1292153420865634e+00 4.0635985553749920e-01 3.6653397360164197e-01 - 39 7.7368280707787718e-01 3.3584965342664047e-01 7.5797843838218371e-01 - 40 2.5675885918999680e-01 4.4146399818678894e-01 -7.5832679932908920e-01 - 41 7.9683402196387781e-02 -5.0998040783871934e-01 -1.6942098992427415e-01 - 42 5.3489699626166898e-01 6.2583730851285024e-01 5.3150208371900720e-01 - 43 4.3150956143664604e-01 3.4250825988285294e-01 1.8713887101525389e-01 - 44 2.7168883603989724e-02 6.3755616007026894e-01 3.1020253558756594e-01 - 45 -1.0266429053965518e+00 1.6282994454776395e-01 2.4889701484354437e-01 - 46 1.6312811693107243e-01 -4.4541539004164986e-02 -1.6364110665168197e-01 - 47 -3.2467151696196184e-01 8.6794246035160338e-01 -1.8425592835579940e-01 - 48 -2.3621112329277294e-01 -1.1969456647848244e+00 5.3625977722340679e-01 - 49 -9.0057579467427185e-01 9.1799859977308063e-01 2.2038703217227917e-01 - 50 -1.3715616895198379e+00 -1.6292020343939573e-01 -1.9130780323660446e-02 - 51 -4.9091785462224702e-01 -1.7653059189178366e+00 -1.9135186975074114e-01 - 52 -6.0209469440153063e-01 -2.7450279959428697e-02 -9.4957073476771980e-01 - 53 8.3244449885719096e-01 8.5426208281090654e-02 2.2294898130454177e-01 - 54 1.2671625051150670e-01 -4.6286116542115052e-01 -3.0047463370941307e-01 - 55 -1.7627349548864624e-01 5.2996202650720814e-01 -2.6201655394381895e-01 - 56 -1.0703773816343104e-01 -5.0757761020025316e-01 2.9114207851626195e-01 - 57 -1.0905709388422054e-01 3.2808607558617775e-01 1.2346604726903815e-01 - 58 4.7688344146622963e-01 1.9738924583394712e-01 6.4289279657826992e-01 - 59 -3.2367381008922569e-01 9.9079888938550253e-01 -1.1595418529236365e+00 - 60 1.7321224005276470e-02 8.9299454909940190e-01 6.4704757395763857e-01 - 61 -1.4935302461803932e+00 -7.9239986965629849e-01 -4.4857034231877757e-01 - 62 -2.1277755172895357e-01 2.1138904089935556e-01 1.6557437926064877e-01 - 63 3.6167814594592884e-01 -7.6209767583855903e-01 6.3677139949544848e-01 - 64 3.3402210463290194e-01 1.9496574167957959e-01 -1.2154160662568430e+00 + 1 4.1515538286374110e-01 -9.1494477346358216e-01 -6.3741355278279865e-01 + 2 1.3988106356100691e+00 -3.3737588017337816e-01 8.0156670240830763e-01 + 3 1.4008976808915830e-01 8.5161518524558666e-01 -9.0429816544705632e-01 + 4 1.6278227092228784e-01 -1.1029057871588202e+00 -2.6074123464782173e-01 + 5 -7.3909476020852738e-01 5.1524052360275552e-01 4.6941822410473089e-01 + 6 -3.3438906519027911e-01 -4.9251784253833641e-02 4.3500913636920047e-01 + 7 6.2046591727654388e-01 1.5315057836221693e-01 1.1426160399111331e+00 + 8 5.3113572822356903e-01 4.3723156152892684e-01 -2.6205767695594506e-01 + 9 -7.0200140178318526e-01 2.2000944712625009e-02 7.9386931677893047e-01 + 10 -6.4407844544544224e-01 -7.0496121163107173e-01 -2.0979301655840271e-01 + 11 -3.6900052164981345e-01 -2.1408598717019756e-01 5.1568212070395647e-01 + 12 5.5090189610776152e-01 -2.0160661876708486e-01 9.4002060729617032e-02 + 13 5.3333553420974844e-01 -5.8563425035338823e-01 -3.5400055762611260e-01 + 14 -1.6495849139222596e-01 -3.4561287833660037e-01 1.1718509334940626e-02 + 15 2.1995743437797843e-01 1.7443635305589850e-01 7.1525960531387045e-02 + 16 -2.8417481068469663e-01 -4.1624668486476590e-01 -8.6345151758699390e-01 + 17 4.3765731451133627e-01 1.2869519575280908e-01 9.5280294152044287e-01 + 18 -8.3549865787852662e-01 -4.3890301594746184e-01 -3.1458160596390250e-01 + 19 -8.0473066014504657e-02 -7.1034668107349375e-01 2.1471049419130117e-01 + 20 8.8863453999566411e-01 2.7801066800498980e-01 1.7462705873258183e-01 + 21 -1.5183759111368955e-01 1.8706354588078655e-01 8.2479449018600492e-01 + 22 1.0184720519093395e+00 1.4890619416116113e-01 1.3447330453712114e-01 + 23 3.1038988777314891e-01 -6.0048456218753044e-02 -5.6582897476144323e-01 + 24 2.6403042629089180e-01 -1.0963218520426925e+00 2.3504469411910978e-01 + 25 -1.2167395592389052e-01 2.2792607501839882e-01 -1.4166068952158067e-01 + 26 7.0250300165506241e-01 3.1407898617410240e-01 -1.7998395788399096e-01 + 27 2.5599544419242104e-01 8.9822479151714363e-01 -2.0198815066641440e-01 + 28 1.4425924111076605e-01 5.7405481309254469e-01 -1.1171047742512650e+00 + 29 -2.5472686212276330e-01 -3.1987178046253634e-01 -7.7391605542676142e-02 + 30 -2.8726277778986764e-01 -1.4016907935132078e-01 -1.9882447030266886e-03 + 31 3.8637891685167275e-01 -8.1894344291225940e-02 2.6486548560907397e-01 + 32 8.5224344240986305e-01 3.4109929480132362e-01 -2.1871659265605503e-01 + 33 -7.4204004065169482e-01 -1.0007563953129950e-01 -5.2302494497915419e-01 + 34 9.3370287253542528e-01 8.3350471037466622e-03 -4.5912860251442766e-01 + 35 -3.3158005572805416e-01 7.6540312841367786e-01 1.9928601850786470e-01 + 36 -8.9702443420628963e-01 2.4008598054602306e-01 -2.6197547624247863e-01 + 37 1.0588339177861528e-01 -6.1403844917953698e-01 3.6126862564978435e-01 + 38 -1.0699980926110300e+00 3.9981587127839813e-01 3.6207396376018242e-01 + 39 8.2444966347763615e-01 3.2965079628179444e-01 6.4409138746227068e-01 + 40 2.6017509049083531e-01 4.1401926525554389e-01 -7.9628871384236910e-01 + 41 1.1714437991822722e-01 -4.9276742383744165e-01 -1.3714792341963314e-01 + 42 5.0093046033659550e-01 7.0507995604906848e-01 5.1144840291007987e-01 + 43 4.7272600527862979e-01 2.3241198063192248e-01 2.2646231029427166e-01 + 44 -2.5875326170507362e-02 6.8091934041444135e-01 2.8122354077269629e-01 + 45 -1.0661897790660539e+00 1.5739844336536329e-01 2.7632639724715236e-01 + 46 1.7643230146898875e-01 -6.1036566797445159e-02 -1.4286987663326634e-01 + 47 -3.2493587415562941e-01 9.3540698421772339e-01 -2.9541047459506137e-01 + 48 -1.6244511802216977e-01 -1.2801249853650716e+00 4.5949431012436426e-01 + 49 -8.3574332843559140e-01 1.0081229227306214e+00 2.8939129722137702e-01 + 50 -1.3375265001213588e+00 -1.5573147260598819e-01 -2.8562498833706984e-02 + 51 -4.8640761253983078e-01 -1.6989957128628066e+00 -2.1199932532390037e-01 + 52 -5.6173764236285750e-01 -7.8139060442839747e-03 -9.2333118720627205e-01 + 53 7.3522842153855916e-01 5.2757300073165925e-02 2.4647772705621152e-01 + 54 1.6355487859351880e-01 -4.3181763706870901e-01 -2.6928075424652853e-01 + 55 -2.0310885146136226e-01 4.6308629056388367e-01 -2.2722755522875068e-01 + 56 -8.8287804500188541e-02 -4.9385012112463311e-01 3.1464218672522665e-01 + 57 -1.4860752894273249e-01 3.6639532798389074e-01 1.1720886977031597e-01 + 58 4.6275431765550046e-01 1.7899991387370592e-01 5.9439237331099704e-01 + 59 -2.7057844883279447e-01 1.0179522986234772e+00 -1.1690039768081864e+00 + 60 7.7033398377843398e-02 8.9082166295372334e-01 6.4356230071560427e-01 + 61 -1.4747137527131478e+00 -7.3565119094142473e-01 -4.0897338663556837e-01 + 62 -2.6386648856964912e-01 2.7597771124785198e-01 1.6332641979412388e-01 + 63 3.3687774884205890e-01 -8.0669584120030269e-01 6.2174867723272031e-01 + 64 2.5974532161488995e-01 2.2440507959986022e-01 -1.2839263342582887e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-beck.yaml b/unittest/force-styles/tests/mol-pair-beck.yaml index b0762e2e4..160ed5787 100644 --- a/unittest/force-styles/tests/mol-pair-beck.yaml +++ b/unittest/force-styles/tests/mol-pair-beck.yaml @@ -1,6 +1,6 @@ --- lammps_version: 24 Aug 2020 -date_generated: Thu Aug 27 18:59:06 202 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 9.4354114467686365e+00 -5.0365804752932377e+01 1.8995723437358020e+01 28 -3.8516188448751151e+01 1.6552971779437446e+01 -2.6060734296883002e+01 29 2.9089205657689586e+01 3.3820165138501068e+01 7.0599695508939604e+00 -run_vdwl: 144.638406973716 +run_vdwl: 189.570013008134 run_coul: 0 run_stress: ! |2- - 3.3133682607050150e+02 3.4060217164649231e+02 4.8454706072210047e+02 -7.9080499174653568e+01 3.3297144014338656e+01 5.7256788667282045e+01 + 3.9673505063488938e+02 4.0042483718168398e+02 6.5281237313066970e+02 -7.9842085107845122e+01 3.9349940163427668e+01 7.1644334240795843e+01 run_forces: ! |2 - 1 -5.4915214039797142e-02 4.7086906901310535e+01 5.0231826339113674e+01 - 2 2.2274719163120999e+01 1.8191762273734572e+01 -2.5842857844720946e+01 - 3 -2.5724706716649820e+01 -5.4516330784364939e+01 -2.1349575519597128e+01 - 4 -4.7433294908395087e+00 1.3313080392440735e+00 -3.4491815447070771e+00 - 5 -1.3807514198090951e+00 -2.2642849464423214e+00 6.7171018714111499e+00 - 6 -8.2592245387210966e+01 8.6983321760869828e+01 5.1323806931583903e+01 - 7 2.6798260757118104e+00 -2.3257244891331066e+01 -1.2266876330179147e+02 - 8 2.8150470064615405e+00 -4.3854243250382128e+00 4.6001621319998151e+01 - 9 1.0520851092946350e+01 1.0964067003857657e+01 4.5714683550670443e+01 - 10 5.8452770129703808e+01 -7.5387199282213828e+01 -2.4288657357568539e+01 - 11 -1.4986298700899252e+00 -3.3352660085872596e+00 -5.6314918332399992e+00 - 12 9.8819646623067161e+00 5.1023420678048312e+00 -4.9660765642879339e+00 - 13 4.9179046317794812e+00 -1.8634394522142279e+00 -7.3042165642329501e-02 - 14 -1.8942700959688847e+00 3.0617940045016334e-01 -4.8353794582874929e+00 - 15 -2.4550986071028169e-01 5.3431376753470570e+00 2.0111048989137132e+00 - 16 4.2373583844505298e+01 -3.5222126513219578e+01 -8.6552973189535123e+01 - 17 -3.5750086677468587e+01 2.4946889921492776e+01 9.7643619235526245e+01 - 18 -1.7159699819334771e-02 -3.1037092481215882e-02 2.8549213202403705e-02 - 19 -1.5013130414091906e-04 -7.7689283191413063e-04 2.0462361782961538e-03 - 20 -6.6913370393377079e-04 -7.8647498130642772e-04 6.0497538867195823e-04 - 21 -1.1365861419117126e+01 -1.2452736193977278e+01 3.7513739649609704e+01 - 22 -1.8376119645570274e+01 -4.6868518041054497e+00 -2.8327749791858562e+01 - 23 2.9731217125165866e+01 1.7152023756388417e+01 -9.1744585972541195e+00 - 24 9.6735461503659703e+00 -3.6675052680872092e+01 2.1693999493848398e+01 - 25 -2.8659710803514926e+01 4.3071613853577304e+00 -2.4297537006831149e+01 - 26 1.8974293551121786e+01 3.2356135651292043e+01 2.5800325028055706e+00 - 27 7.0065261991212431e+00 -3.7876324803641708e+01 1.3308628350888517e+01 - 28 -2.8378706931610381e+01 1.2353475951627091e+01 -1.8910569302499486e+01 - 29 2.1380572865116122e+01 2.5530170357525673e+01 5.5969489086824842e+00 + 1 -5.6194822354660188e+00 5.3543229173149975e+01 6.7817133602824896e+01 + 2 3.2827720369189080e+01 2.7055145782023040e+01 -3.8507631755077540e+01 + 3 -2.7331506980823249e+01 -7.2300261386197349e+01 -2.8472353981166894e+01 + 4 -4.9638375577285299e+00 1.3160273938723748e+00 -3.5413609974405680e+00 + 5 -1.5594302229278623e+00 -2.5797390764740000e+00 7.2654520444138688e+00 + 6 -1.0455188178316747e+02 1.1392408325602861e+02 9.9858610175709359e+01 + 7 1.5906487596107046e+00 -3.2555121603396934e+01 -1.8849711531247300e+02 + 8 5.2648030576847749e+00 -9.0895534733957426e+00 4.9598192677218947e+01 + 9 1.4607904074274648e+01 1.5676034867172021e+01 6.4588488477875671e+01 + 10 7.2028824468453919e+01 -9.1201504981638180e+01 -2.6225199330588048e+01 + 11 -1.4102944400989565e+00 -3.5659220542449503e+00 -5.8178275994047421e+00 + 12 1.0363789936535534e+01 5.0647744306185123e+00 -4.4861640257069304e+00 + 13 5.2210416323039723e+00 -2.0605944595386747e+00 -9.3913298412295648e-02 + 14 -2.1373801823250633e+00 4.2473443551167611e-01 -5.5140408112789494e+00 + 15 -1.3830381029283192e-01 5.4700163395059107e+00 1.9506652779158726e+00 + 16 5.9073199642786420e+01 -4.5701766732526472e+01 -1.3429731667490478e+02 + 17 -5.3233918804058554e+01 3.6605507113119756e+01 1.4435994059124903e+02 + 18 -1.7287226092783586e-02 -3.1311733891309847e-02 2.8735282854755632e-02 + 19 -1.1870915163632350e-04 -7.4990065146967786e-04 2.0262019170145338e-03 + 20 -7.2489000257028497e-04 -8.4155157045626226e-04 6.2536967326489617e-04 + 21 -1.5125199914958204e+01 -1.7641439156528715e+01 5.0464207568232396e+01 + 22 -2.4386743597308332e+01 -5.9527942496104851e+00 -3.8130699375255659e+01 + 23 3.9501404517304032e+01 2.3606409907069096e+01 -1.2322236826897278e+01 + 24 9.7410200522310451e+00 -4.6799918503915578e+01 2.6017950613112877e+01 + 25 -3.4364071376873220e+01 5.4566096367650800e+00 -2.8901687215741916e+01 + 26 2.4611397175823150e+01 4.1331615437487727e+01 2.8605589874370301e+00 + 27 9.5482598272428021e+00 -5.0424874189892563e+01 1.8947731798766682e+01 + 28 -3.8620728512401257e+01 1.6578822372658543e+01 -2.6079870227751506e+01 + 29 2.9080896730236471e+01 3.3853382908490524e+01 7.1270987628985161e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born.yaml b/unittest/force-styles/tests/mol-pair-born.yaml index ed7b5976b..05e77a49b 100644 --- a/unittest/force-styles/tests/mol-pair-born.yaml +++ b/unittest/force-styles/tests/mol-pair-born.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 11:30:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -9,22 +9,22 @@ pre_commands: ! "" post_commands: ! "" input_file: in.fourmol pair_style: born 8.0 -pair_coeff: ! | - 1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 141.547923828784 - 1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 4.09225030876458 - 1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 403.51858739517 - 1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 0.177172207445923 - 2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 17.5662073921955 - 2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 0.000703093129207124 - 2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 12.548008396489 - 3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 1019.38354056979 - 3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 +pair_coeff: ! "1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 + 141.547923828784 \n1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 + 4.09225030876458 \n1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 + 403.51858739517 \n1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 + 0.177172207445923 \n2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 + 17.5662073921955 \n2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 + 0.000703093129207124 \n2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 + 12.548008396489 \n3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 + 1019.38354056979 \n3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722\n" extract: ! | a 2 c 2 @@ -64,38 +64,38 @@ init_forces: ! |2 27 1.1754339453870926e+01 -6.1391797882279533e+01 2.3297502014340736e+01 28 -4.7133554549788215e+01 2.0256243416311925e+01 -3.1891313669103603e+01 29 3.5387736817138148e+01 4.1142927584645129e+01 8.5887702016863265e+00 -run_vdwl: 156.543264192972 +run_vdwl: 224.209080812731 run_coul: 0 run_stress: ! |2- - 3.8217409303560629e+02 3.9644927104438381e+02 5.4741622167620551e+02 -9.9916269275610532e+01 3.6853516322661612e+01 6.7569991842117304e+01 + 4.8883233519425096e+02 4.9423423364589024e+02 8.2442006134841051e+02 -1.0519543677321340e+02 4.4500721790869676e+01 9.5216321265483302e+01 run_forces: ! |2 - 1 1.0395674707735731e+00 5.5256813605008816e+01 5.6773276352200661e+01 - 2 2.4481921282193845e+01 1.9879632440195810e+01 -2.8528936799032302e+01 - 3 -3.0770161776503635e+01 -6.2238142906829239e+01 -2.4064417240263371e+01 - 4 -5.1681544316504038e+00 1.4863747534138627e+00 -3.7546490114181550e+00 - 5 -1.4671781617695223e+00 -2.3821362963461601e+00 7.2672287644994524e+00 - 6 -9.8499362763180983e+01 1.0257804525013071e+02 5.3495439213952984e+01 - 7 4.2001835596160104e+00 -2.6937041762260563e+01 -1.3607048811616696e+02 - 8 4.6511093906491512e+00 -5.1080518517972804e+00 5.5257861257710744e+01 - 9 1.1843202778068722e+01 1.2416390727106398e+01 5.1473652467930826e+01 - 10 7.0145695491089597e+01 -8.9295009657311510e+01 -2.9634434514715853e+01 - 11 -1.7228090610547173e+00 -3.6991390929261971e+00 -6.3108366948469161e+00 - 12 1.0660819163349736e+01 5.8147700758899523e+00 -5.4355772152867248e+00 - 13 5.2924774467636020e+00 -2.0068724896508732e+00 -7.8093372156985835e-02 - 14 -2.0358243249672157e+00 3.2827307490873597e-01 -5.1944474119957285e+00 - 15 -2.6827906151865294e-01 5.7618640647259713e+00 2.1709750862347468e+00 - 16 4.7636632061962267e+01 -3.9810879273462064e+01 -9.6151504817851247e+01 - 17 -3.9986659907067860e+01 2.7980343203916043e+01 1.0876993658623469e+02 - 18 -1.7426743545211711e-02 -3.1530831655227590e-02 2.9358218896064495e-02 - 19 -3.2185264613315649e-04 -1.1165230646128495e-03 2.2446047347148388e-03 - 20 -5.4449298929830944e-04 -7.4700830397387554e-04 7.2352482859877815e-04 - 21 -1.2591458573727806e+01 -1.3846681617243361e+01 4.1802224946997235e+01 - 22 -2.0391390443413155e+01 -5.1794508883407548e+00 -3.1545667320662130e+01 - 23 3.2971780932048034e+01 1.9038950539781588e+01 -1.0244642035304839e+01 - 24 1.0960784435729556e+01 -4.0895918302034367e+01 2.4332900990266868e+01 - 25 -3.2019961323106763e+01 4.8905379432638307e+00 -2.7175126429424967e+01 - 26 2.1046878688704115e+01 3.5993356715466817e+01 2.8179811510290729e+00 - 27 7.6414241493444806e+00 -4.2201314723630858e+01 1.4744843719921445e+01 - 28 -3.1401246838529225e+01 1.3739835837624105e+01 -2.0945633715119591e+01 - 29 2.3768302905377848e+01 2.8468844993424415e+01 6.1958078088075466e+00 + 1 -6.7720816831482447e+00 6.5907821418325469e+01 8.3259621296716801e+01 + 2 4.0218136003943194e+01 3.3144591566121157e+01 -4.7179205402082225e+01 + 3 -3.3605736560839055e+01 -9.0074086554447845e+01 -3.5221640621584278e+01 + 4 -5.3787434579773636e+00 1.4327713059655096e+00 -3.8367640795119611e+00 + 5 -1.6881964340011357e+00 -2.7794391363339965e+00 7.9281344469875252e+00 + 6 -1.3549308075000462e+02 1.4851397978813173e+02 1.3461543692336585e+02 + 7 3.3732743566509624e+00 -4.3513858066561703e+01 -2.4498671233727708e+02 + 8 8.7727301845607517e+00 -1.2119006984206598e+01 6.3214651124208046e+01 + 9 1.8114256817307936e+01 1.9437059038834992e+01 8.0084885017316580e+01 + 10 9.3213038635827942e+01 -1.1599072346742265e+02 -3.3586140627464552e+01 + 11 -1.5389008916316567e+00 -3.8826034264396485e+00 -6.3386097018052494e+00 + 12 1.1272490368822744e+01 5.7050481424416581e+00 -4.9149289311673563e+00 + 13 5.6435307449313443e+00 -2.2273911851693224e+00 -1.0161731197758767e-01 + 14 -2.3147461837780545e+00 4.6029615593159096e-01 -5.9730460485940089e+00 + 15 -1.5138442099608745e-01 5.9188929963423460e+00 2.1117705685042187e+00 + 16 7.5618622929084623e+01 -5.7701543760831811e+01 -1.7597146309486109e+02 + 17 -6.9250444832652732e+01 4.7794056707604874e+01 1.8688033250898275e+02 + 18 -1.7635052849151810e-02 -3.1945265850646144e-02 2.9622605883145362e-02 + 19 -2.8475685738301294e-04 -1.0875798652296067e-03 2.2240029016848779e-03 + 20 -5.6771808075055104e-04 -7.7724526147453861e-04 7.2624122793055342e-04 + 21 -1.8529567507036592e+01 -2.1541359290539845e+01 6.1425125521265286e+01 + 22 -2.9663134179851436e+01 -7.2404000756727669e+00 -4.6382419882538244e+01 + 23 4.8181926850128825e+01 2.8794255085088587e+01 -1.5031130788488522e+01 + 24 1.1720758802886031e+01 -5.7100114504488424e+01 3.1619738449833100e+01 + 25 -4.1775103577218694e+01 6.6346552630896181e+00 -3.5134821851574458e+01 + 26 3.0042321280891329e+01 5.0453537034527898e+01 3.4912716505423060e+00 + 27 1.1882430558327535e+01 -6.1419102229093241e+01 2.3221628742485201e+01 + 28 -4.7224359770503817e+01 2.0273214481659444e+01 -3.1890012159211665e+01 + 29 3.5350450244063516e+01 4.1153259788120323e+01 8.6633437379178151e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_dsf.yaml b/unittest/force-styles/tests/mol-pair-born_coul_dsf.yaml index bdb35df83..c139bd0bc 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_dsf.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_dsf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 16:17:46 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -9,22 +9,22 @@ pre_commands: ! "" post_commands: ! "" input_file: in.fourmol pair_style: born/coul/dsf 0.25 8.0 -pair_coeff: ! | - 1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 141.547923828784 - 1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 4.09225030876458 - 1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 403.51858739517 - 1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 0.177172207445923 - 2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 17.5662073921955 - 2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 0.000703093129207124 - 2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 12.548008396489 - 3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 1019.38354056979 - 3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 +pair_coeff: ! "1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 + 141.547923828784 \n1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 + 4.09225030876458 \n1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 + 403.51858739517 \n1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 + 0.177172207445923 \n2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 + 17.5662073921955 \n2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 + 0.000703093129207124 \n2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 + 12.548008396489 \n3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 + 1019.38354056979 \n3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722\n" extract: ! "" natoms: 29 init_vdwl: 225.01325775005 @@ -61,38 +61,38 @@ init_forces: ! |2 27 9.4540809516248068e+00 -5.0442863407123852e+01 1.9202978230103980e+01 28 -4.2634181882990454e+01 1.5556514661238053e+01 -2.8124333709589369e+01 29 3.3595845049033741e+01 3.4856379135410293e+01 8.9087361003241199e+00 -run_vdwl: 158.434782247931 -run_coul: -114.493744545081 +run_vdwl: 224.239908258883 +run_coul: -116.285602012657 run_stress: ! |2- - 3.6457599858106323e+02 3.5447775569312563e+02 5.1484466370895007e+02 -9.2184537777848647e+01 3.3327026119667003e+01 7.7318576297238295e+01 + 4.6541486465261943e+02 4.5000181377675602e+02 7.8360788998458600e+02 -1.0010028697870388e+02 3.8217404146676770e+01 1.0558384978752369e+02 run_forces: ! |2 - 1 3.3128565928816736e+00 5.4462232338907675e+01 5.7819825620081382e+01 - 2 2.4741711089801676e+01 1.7215897652018715e+01 -3.0619730806082021e+01 - 3 -3.0675317991144063e+01 -6.2338014537455528e+01 -2.4093764988937252e+01 - 4 -5.2186950995461077e+00 1.5388493910159622e+00 -4.0518642704153489e+00 - 5 -1.9740472219907386e+00 -1.6710869413430212e+00 7.2060846542775732e+00 - 6 -9.7531884089785336e+01 9.9793556580413593e+01 5.2098481038771901e+01 - 7 4.1240901037470978e+00 -2.6627630139738919e+01 -1.3429437375227437e+02 - 8 4.0961464557336393e+00 -1.6859216412227742e+00 5.7786048678057334e+01 - 9 1.3898962563226151e+01 6.1784815300352385e+00 5.3698406201380600e+01 - 10 6.9395067324736331e+01 -8.8387443730071126e+01 -2.9777902877382065e+01 - 11 -2.6886774410153995e+00 -2.5516346181388614e+00 -6.9603326359120121e+00 - 12 1.3657116374147838e+01 5.0998174536259011e+00 -3.8311422196898803e+00 - 13 5.2106464538019850e+00 -1.9694276886777915e+00 -3.1806000271177143e-01 - 14 -3.2502839177058052e+00 7.6870953022794242e-01 -5.2552653229769204e+00 - 15 2.5381417765419339e-03 5.5670489097503530e+00 1.0731442832077982e+00 - 16 4.7451100017037810e+01 -4.0685593584410093e+01 -9.5760224948203970e+01 - 17 -4.3207417432057618e+01 3.4918390165235508e+01 1.0330298136883876e+02 - 18 -7.8633626956610705e-02 5.1621863754062458e+00 -7.8408453675787255e+00 - 19 2.3491071350704815e+00 -8.8427683425379833e-01 5.9940920406682379e+00 - 20 -2.9045058075719248e+00 -4.1696098186895840e+00 3.9210010976007874e+00 - 21 -1.1670443819074521e+01 -1.0138720509131051e+01 3.5558210752504820e+01 - 22 -1.9698153723974421e+01 -6.0607216096940499e+00 -2.7508478755382473e+01 - 23 3.0835222734122727e+01 1.6748088264051564e+01 -7.4052523774694459e+00 - 24 9.4619363908432437e+00 -3.3810430721396280e+01 2.0200434023345363e+01 - 25 -3.0551295230862227e+01 1.9603242823861462e+00 -2.4994048576690659e+01 - 26 2.0444751175621061e+01 3.1599870621201820e+01 4.0782746097595677e+00 - 27 6.0377133407499386e+00 -3.4167133913114682e+01 1.2057831650379896e+01 - 28 -2.9188933983003132e+01 1.0118794842901607e+01 -1.8843451954617606e+01 - 29 2.3619323491389739e+01 2.4015398350159305e+01 6.7599228374505618e+00 + 1 -4.2502329771710929e+00 6.5529136392074605e+01 8.3802258300262707e+01 + 2 4.0077377873775021e+01 3.0123043653002121e+01 -4.8677361669928018e+01 + 3 -3.3604108953506085e+01 -9.0162431097832780e+01 -3.5191677806100941e+01 + 4 -5.4032950935756565e+00 1.4633073494925779e+00 -4.1349626617067328e+00 + 5 -2.1772201149555879e+00 -2.0735171634794876e+00 7.8263722087795067e+00 + 6 -1.3376700152048573e+02 1.4486899571705158e+02 1.3155821717622825e+02 + 7 3.1281331242910886e+00 -4.2826518648197727e+01 -2.4088832591280109e+02 + 8 7.1655270005238600e+00 -7.9215801387540754e+00 6.5920419578432842e+01 + 9 1.9844173371517151e+01 1.3780515384915445e+01 8.1490226882044936e+01 + 10 9.2945217961425257e+01 -1.1558013528512598e+02 -3.3854112327934878e+01 + 11 -2.4735993688224318e+00 -2.7835843261978006e+00 -6.9580543401127786e+00 + 12 1.4300940351030045e+01 5.0004334212543835e+00 -3.3454174417790696e+00 + 13 5.5289379784883845e+00 -2.1823214846880830e+00 -3.0489132610018110e-01 + 14 -3.4420109812684672e+00 8.8983273971750643e-01 -6.0946826063052288e+00 + 15 1.5399876209866326e-01 5.7688496469887784e+00 1.0513327083961508e+00 + 16 7.4844440489982176e+01 -5.8095648972574523e+01 -1.7391855394815454e+02 + 17 -7.1710330502991084e+01 5.3858238913733231e+01 1.7987854917641081e+02 + 18 4.9843135102303510e-01 5.4321557369843632e+00 -8.4313095652984398e+00 + 19 1.9593550510925100e+00 -1.0603912824554207e+00 5.9376075823874768e+00 + 20 -2.9826432148335580e+00 -4.2603442220140044e+00 4.4199110596054032e+00 + 21 -1.6624110338183115e+01 -1.6734747841033251e+01 5.2093791272604278e+01 + 22 -2.7872832053342002e+01 -7.9607185341977784e+00 -4.0216279288710226e+01 + 23 4.4017316754835633e+01 2.5199592894297819e+01 -1.1308786658777896e+01 + 24 1.0045989470881100e+01 -4.7095885827046523e+01 2.6222749868755432e+01 + 25 -3.8625166666643103e+01 3.3351538332527326e+00 -3.1529313913944947e+01 + 26 2.8007530330046212e+01 4.3518901048232465e+01 4.6653568183008680e+00 + 27 9.5781917136790540e+00 -5.0496776797950730e+01 1.9159966437625883e+01 + 28 -4.2744028388211547e+01 1.5583088438900020e+01 -2.8148473708209686e+01 + 29 3.3581018589300321e+01 3.4883356451650478e+01 8.9754441060301282e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_dsf_cs.yaml b/unittest/force-styles/tests/mol-pair-born_coul_dsf_cs.yaml index 4cad77686..538945559 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_dsf_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_dsf_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 15:40:58 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 9.4540809516248068e+00 -5.0442863407123852e+01 1.9202978230103980e+01 28 -4.2634181882990454e+01 1.5556514661238053e+01 -2.8124333709589369e+01 29 3.3595845049033741e+01 3.4856379135410293e+01 8.9087361003241199e+00 -run_vdwl: 158.434782247931 -run_coul: -114.493744545081 +run_vdwl: 224.239908258883 +run_coul: -116.285602012657 run_stress: ! |2- - 3.6457599858106323e+02 3.5447775569312563e+02 5.1484466370895007e+02 -9.2184537777848647e+01 3.3327026119667003e+01 7.7318576297238295e+01 + 4.6541486465261943e+02 4.5000181377675602e+02 7.8360788998458600e+02 -1.0010028697870388e+02 3.8217404146676770e+01 1.0558384978752369e+02 run_forces: ! |2 - 1 3.3128565928816736e+00 5.4462232338907675e+01 5.7819825620081382e+01 - 2 2.4741711089801676e+01 1.7215897652018715e+01 -3.0619730806082021e+01 - 3 -3.0675317991144063e+01 -6.2338014537455528e+01 -2.4093764988937252e+01 - 4 -5.2186950995461077e+00 1.5388493910159622e+00 -4.0518642704153489e+00 - 5 -1.9740472219907386e+00 -1.6710869413430212e+00 7.2060846542775732e+00 - 6 -9.7531884089785336e+01 9.9793556580413593e+01 5.2098481038771901e+01 - 7 4.1240901037470978e+00 -2.6627630139738919e+01 -1.3429437375227437e+02 - 8 4.0961464557336393e+00 -1.6859216412227742e+00 5.7786048678057334e+01 - 9 1.3898962563226151e+01 6.1784815300352385e+00 5.3698406201380600e+01 - 10 6.9395067324736331e+01 -8.8387443730071126e+01 -2.9777902877382065e+01 - 11 -2.6886774410153995e+00 -2.5516346181388614e+00 -6.9603326359120121e+00 - 12 1.3657116374147838e+01 5.0998174536259011e+00 -3.8311422196898803e+00 - 13 5.2106464538019850e+00 -1.9694276886777915e+00 -3.1806000271177143e-01 - 14 -3.2502839177058052e+00 7.6870953022794242e-01 -5.2552653229769204e+00 - 15 2.5381417765419339e-03 5.5670489097503530e+00 1.0731442832077982e+00 - 16 4.7451100017037810e+01 -4.0685593584410093e+01 -9.5760224948203970e+01 - 17 -4.3207417432057618e+01 3.4918390165235508e+01 1.0330298136883876e+02 - 18 -7.8633626956610705e-02 5.1621863754062458e+00 -7.8408453675787255e+00 - 19 2.3491071350704815e+00 -8.8427683425379833e-01 5.9940920406682379e+00 - 20 -2.9045058075719248e+00 -4.1696098186895840e+00 3.9210010976007874e+00 - 21 -1.1670443819074521e+01 -1.0138720509131051e+01 3.5558210752504820e+01 - 22 -1.9698153723974421e+01 -6.0607216096940499e+00 -2.7508478755382473e+01 - 23 3.0835222734122727e+01 1.6748088264051564e+01 -7.4052523774694459e+00 - 24 9.4619363908432437e+00 -3.3810430721396280e+01 2.0200434023345363e+01 - 25 -3.0551295230862227e+01 1.9603242823861462e+00 -2.4994048576690659e+01 - 26 2.0444751175621061e+01 3.1599870621201820e+01 4.0782746097595677e+00 - 27 6.0377133407499386e+00 -3.4167133913114682e+01 1.2057831650379896e+01 - 28 -2.9188933983003132e+01 1.0118794842901607e+01 -1.8843451954617606e+01 - 29 2.3619323491389739e+01 2.4015398350159305e+01 6.7599228374505618e+00 + 1 -4.2502329771710929e+00 6.5529136392074605e+01 8.3802258300262707e+01 + 2 4.0077377873775021e+01 3.0123043653002121e+01 -4.8677361669928018e+01 + 3 -3.3604108953506085e+01 -9.0162431097832780e+01 -3.5191677806100941e+01 + 4 -5.4032950935756565e+00 1.4633073494925779e+00 -4.1349626617067328e+00 + 5 -2.1772201149555879e+00 -2.0735171634794876e+00 7.8263722087795067e+00 + 6 -1.3376700152048573e+02 1.4486899571705158e+02 1.3155821717622825e+02 + 7 3.1281331242910886e+00 -4.2826518648197727e+01 -2.4088832591280109e+02 + 8 7.1655270005238600e+00 -7.9215801387540754e+00 6.5920419578432842e+01 + 9 1.9844173371517151e+01 1.3780515384915445e+01 8.1490226882044936e+01 + 10 9.2945217961425257e+01 -1.1558013528512598e+02 -3.3854112327934878e+01 + 11 -2.4735993688224318e+00 -2.7835843261978006e+00 -6.9580543401127786e+00 + 12 1.4300940351030045e+01 5.0004334212543835e+00 -3.3454174417790696e+00 + 13 5.5289379784883845e+00 -2.1823214846880830e+00 -3.0489132610018110e-01 + 14 -3.4420109812684672e+00 8.8983273971750643e-01 -6.0946826063052288e+00 + 15 1.5399876209866326e-01 5.7688496469887784e+00 1.0513327083961508e+00 + 16 7.4844440489982176e+01 -5.8095648972574523e+01 -1.7391855394815454e+02 + 17 -7.1710330502991084e+01 5.3858238913733231e+01 1.7987854917641081e+02 + 18 4.9843135102303510e-01 5.4321557369843632e+00 -8.4313095652984398e+00 + 19 1.9593550510925100e+00 -1.0603912824554207e+00 5.9376075823874768e+00 + 20 -2.9826432148335580e+00 -4.2603442220140044e+00 4.4199110596054032e+00 + 21 -1.6624110338183115e+01 -1.6734747841033251e+01 5.2093791272604278e+01 + 22 -2.7872832053342002e+01 -7.9607185341977784e+00 -4.0216279288710226e+01 + 23 4.4017316754835633e+01 2.5199592894297819e+01 -1.1308786658777896e+01 + 24 1.0045989470881100e+01 -4.7095885827046523e+01 2.6222749868755432e+01 + 25 -3.8625166666643103e+01 3.3351538332527326e+00 -3.1529313913944947e+01 + 26 2.8007530330046212e+01 4.3518901048232465e+01 4.6653568183008680e+00 + 27 9.5781917136790540e+00 -5.0496776797950730e+01 1.9159966437625883e+01 + 28 -4.2744028388211547e+01 1.5583088438900020e+01 -2.8148473708209686e+01 + 29 3.3581018589300321e+01 3.4883356451650478e+01 8.9754441060301282e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_long.yaml b/unittest/force-styles/tests/mol-pair-born_coul_long.yaml index e45f7dc6b..e831e0da9 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:16:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -14,22 +14,22 @@ post_commands: ! | kspace_modify compute no input_file: in.fourmol pair_style: born/coul/long 8.0 -pair_coeff: ! | - 1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 141.547923828784 - 1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 4.09225030876458 - 1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 403.51858739517 - 1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 0.177172207445923 - 2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 17.5662073921955 - 2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 0.000703093129207124 - 2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 12.548008396489 - 3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 1019.38354056979 - 3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 +pair_coeff: ! "1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 + 141.547923828784 \n1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 + 4.09225030876458 \n1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 + 403.51858739517 \n1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 + 0.177172207445923 \n2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 + 17.5662073921955 \n2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 + 0.000703093129207124 \n2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 + 12.548008396489 \n3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 + 1019.38354056979 \n3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n" extract: ! | cut_coul 0 natoms: 29 @@ -67,38 +67,38 @@ init_forces: ! |2 27 9.7332846217867477e+00 -5.1358714846286986e+01 1.9618771137954440e+01 28 -4.2804238729856415e+01 1.6023907654535410e+01 -2.8346190173060055e+01 29 3.3466051778384887e+01 3.5333314670147345e+01 8.7040657727458015e+00 -run_vdwl: 158.335900653961 -run_coul: 227.519481819007 +run_vdwl: 224.238305263916 +run_coul: 225.801339422194 run_stress: ! |2- - 3.6506602865392705e+02 3.5585428642457043e+02 5.1680848895408769e+02 -9.2985899169663199e+01 3.2903363837288396e+01 7.6473482635305103e+01 + 4.6605249146168626e+02 4.5140738764070585e+02 7.8583111632678799e+02 -1.0069617899937634e+02 3.7937785898470828e+01 1.0482860432250801e+02 run_forces: ! |2 - 1 3.4740172617853893e+00 5.4427033324580684e+01 5.7644048187576466e+01 - 2 2.4668392407879004e+01 1.7380373624357460e+01 -3.0485716215327244e+01 - 3 -3.0671694156204694e+01 -6.2331978604378747e+01 -2.4103728438777690e+01 - 4 -5.2737304109033136e+00 1.5284950793734031e+00 -3.9921020549772610e+00 - 5 -2.0255504833066849e+00 -1.7100714676635147e+00 7.2330108241256656e+00 - 6 -9.7881003717091190e+01 9.9614229288208861e+01 5.2490654156474861e+01 - 7 4.2990290258145141e+00 -2.6421621905184072e+01 -1.3451140515447671e+02 - 8 4.2808123463930654e+00 -1.4375940794230757e+00 5.7456664036334345e+01 - 9 1.3778430151101199e+01 6.0184722609919223e+00 5.3704099643714095e+01 - 10 6.9397552620698804e+01 -8.8421946595841248e+01 -2.9728905442422285e+01 - 11 -2.6530111571763122e+00 -2.6254018596334130e+00 -6.9016422340163635e+00 - 12 1.3488997362465982e+01 5.3096601150880707e+00 -3.9760994457769940e+00 - 13 5.2476610279725389e+00 -2.0217249662705470e+00 -2.9021868581776433e-01 - 14 -3.1782536776436952e+00 6.9912063047816420e-01 -5.2298939707220180e+00 - 15 5.1522494027486154e-02 5.5229847790669204e+00 1.1243205183142551e+00 - 16 4.7485119758688008e+01 -4.0801416705855239e+01 -9.5835977743002033e+01 - 17 -4.3156226701582234e+01 3.5026671569042200e+01 1.0362037405198822e+02 - 18 -2.8012973552465575e-01 4.4055401288274672e+00 -7.2872695683329436e+00 - 19 2.4157003450197561e+00 -4.9848024029387494e-01 5.6276528831835133e+00 - 20 -2.8096326399244522e+00 -3.8549902379653362e+00 3.5986613451324025e+00 - 21 -1.1657122861906318e+01 -1.0584977359194866e+01 3.5967701923811155e+01 - 22 -1.9631679798958608e+01 -5.8903274066726246e+00 -2.7738959603696525e+01 - 23 3.0820800484847599e+01 1.6933493022289102e+01 -7.6539257504549800e+00 - 24 9.5662786353806979e+00 -3.4566215520575597e+01 2.0565436064892801e+01 - 25 -3.0571269131120637e+01 2.3365486848985686e+00 -2.5139474053763223e+01 - 26 2.0369323073869168e+01 3.1959183261836142e+01 3.8804210831701780e+00 - 27 6.2843919087371987e+00 -3.5026306923410530e+01 1.2415954478371203e+01 - 28 -2.9249610449368891e+01 1.0572621478768298e+01 -1.8990193349027770e+01 - 29 2.3410886016031238e+01 2.4458626624555396e+01 6.5365125135026672e+00 + 1 -4.0613570407635926e+00 6.5516178276709965e+01 8.3581334519814177e+01 + 2 3.9976026776322172e+01 3.0258151045895627e+01 -4.8512324458275756e+01 + 3 -3.3591646961588495e+01 -9.0157756860862079e+01 -3.5206992269860663e+01 + 4 -5.4593245073740917e+00 1.4510008465272830e+00 -4.0785942464401295e+00 + 5 -2.2281674645758853e+00 -2.1153774804090681e+00 7.8585444752868057e+00 + 6 -1.3400719043492126e+02 1.4464619891100577e+02 1.3208522062250364e+02 + 7 3.2934769925903176e+00 -4.2631188124602780e+01 -2.4121630619184353e+02 + 8 7.2264041291531571e+00 -7.5980075019962880e+00 6.5580436873135042e+01 + 9 1.9742689507358499e+01 1.3614190275324797e+01 8.1519640507716360e+01 + 10 9.2962707945613261e+01 -1.1563036142936984e+02 -3.3820312697722471e+01 + 11 -2.4400422416408252e+00 -2.8543153196347522e+00 -6.9013844993560722e+00 + 12 1.4132702622869605e+01 5.2236961123634060e+00 -3.4842609221211633e+00 + 13 5.5693210877098913e+00 -2.2363817961873389e+00 -2.7971447708902519e-01 + 14 -3.3705756739199471e+00 8.1809010490444523e-01 -6.0675081093782985e+00 + 15 2.0412133951019917e-01 5.7164531493154085e+00 1.0979628020940133e+00 + 16 7.4892853529467942e+01 -5.8221977248895648e+01 -1.7407551792910331e+02 + 17 -7.1685128818138537e+01 5.3983974609518860e+01 1.8025811834536321e+02 + 18 3.0344645968048728e-01 4.7181972255519735e+00 -7.8131116800908051e+00 + 19 2.0273542030054554e+00 -6.9321390413689776e-01 5.5378275920979645e+00 + 20 -2.8992330704201019e+00 -3.9663432608154254e+00 4.0721704424312932e+00 + 21 -1.6633730401917283e+01 -1.7203200527305604e+01 5.2562360770071933e+01 + 22 -2.7844833749637054e+01 -7.7953363839723231e+00 -4.0489015258276261e+01 + 23 4.4059843629649691e+01 2.5416342694057001e+01 -1.1566165666559600e+01 + 24 1.0131367137974836e+01 -4.7953608684064065e+01 2.6596957252282817e+01 + 25 -3.8708286708521399e+01 3.7071285639412084e+00 -3.1709073618998058e+01 + 26 2.8012720828539493e+01 4.3989304498157473e+01 4.4933413281732726e+00 + 27 9.8571530362050908e+00 -5.1411301180362486e+01 1.9573051745303612e+01 + 28 -4.2912520665667465e+01 1.6049864253577503e+01 -2.8368159141042312e+01 + 29 3.3449848513435846e+01 3.5359599135763816e+01 8.7714738898832820e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_long_cs.yaml b/unittest/force-styles/tests/mol-pair-born_coul_long_cs.yaml index b8b94b4ff..0b60d5f62 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_long_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_long_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:49:21 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 9.7332883747350500e+00 -5.1358738729048369e+01 1.9618779775225427e+01 28 -4.2804254672220495e+01 1.6023915870224371e+01 -2.8346201341747282e+01 29 3.3466063637323181e+01 3.5333330084781451e+01 8.7040684280919933e+00 -run_vdwl: 158.335895231339 -run_coul: 227.519590946073 +run_vdwl: 224.238305177817 +run_coul: 225.801481092243 run_stress: ! |2- - 3.6506607872257132e+02 3.5585430695764273e+02 5.1680852475657628e+02 -9.2985872714206963e+01 3.2903372377353364e+01 7.6473485678822016e+01 + 4.6605256944302278e+02 4.5140742319668550e+02 7.8583118030792753e+02 -1.0069614109154539e+02 3.7937803815401629e+01 1.0482860650436638e+02 run_forces: ! |2 - 1 3.4740152238342286e+00 5.4427032771462358e+01 5.7644050607261228e+01 - 2 2.4668393756802750e+01 1.7380371975594773e+01 -3.0485718210267223e+01 - 3 -3.0671694157343136e+01 -6.2331978911443215e+01 -2.4103728734957379e+01 - 4 -5.2737305972572290e+00 1.5284954213200210e+00 -3.9921019590551707e+00 - 5 -2.0255506489873780e+00 -1.7100711516331435e+00 7.2330108890907381e+00 - 6 -9.7881004390331213e+01 9.9614229340002908e+01 5.2490655374387138e+01 - 7 4.2990300026077959e+00 -2.6421621698995040e+01 -1.3451140443000605e+02 - 8 4.2808105473872988e+00 -1.4375943632156429e+00 5.7456661936974498e+01 - 9 1.3778431584771887e+01 6.0184702204278206e+00 5.3704103191084705e+01 - 10 6.9397552877966916e+01 -8.8421946235350703e+01 -2.9728905734571811e+01 - 11 -2.6530109984444792e+00 -2.6254014415901397e+00 -6.9016419112800671e+00 - 12 1.3488998124085498e+01 5.3096602787229177e+00 -3.9761002122411222e+00 - 13 5.2476613430945909e+00 -2.0217257375416988e+00 -2.9021832816849991e-01 - 14 -3.1782535244317880e+00 6.9912015288061879e-01 -5.2298944524058166e+00 - 15 5.1523123182285455e-02 5.5229850372892155e+00 1.1243208455267113e+00 - 16 4.7485119907805533e+01 -4.0801416340568281e+01 -9.5835978447194648e+01 - 17 -4.3156228306657582e+01 3.5026675166134119e+01 1.0362037180251906e+02 - 18 -2.8012897800988362e-01 4.4055353783012867e+00 -7.2872468427566126e+00 - 19 2.4156889918730302e+00 -4.9848725828795004e-01 5.6276381133609652e+00 - 20 -2.8096216871892175e+00 -3.8549785221452875e+00 3.5986530414095288e+00 - 21 -1.1657126871430725e+01 -1.0584981033486608e+01 3.5967715673523500e+01 - 22 -1.9631684014878374e+01 -5.8903283927395194e+00 -2.7738969060187113e+01 - 23 3.0820808736751285e+01 1.6933497811435625e+01 -7.6539300667680816e+00 - 24 9.5662821314537769e+00 -3.4566227662991835e+01 2.0565442898031403e+01 - 25 -3.0571276607412333e+01 2.3365514090736861e+00 -2.5139480816317924e+01 - 26 2.0369327324561425e+01 3.1959192933600814e+01 3.8804210385862645e+00 - 27 6.2843935073457615e+00 -3.5026320345857478e+01 1.2415958757322723e+01 - 28 -2.9249617779142788e+01 1.0572626231160866e+01 -1.8990198625607217e+01 - 29 2.3410891377992012e+01 2.4458634968439497e+01 6.5365136627063301e+00 + 1 -4.0613614529622577e+00 6.5516175161290619e+01 8.3581339415120524e+01 + 2 3.9976030532269050e+01 3.0258151508778759e+01 -4.8512329228981017e+01 + 3 -3.3591646867861833e+01 -9.0157757028839043e+01 -3.5206992445996100e+01 + 4 -5.4593246974569336e+00 1.4510012062020472e+00 -4.0785941494187172e+00 + 5 -2.2281676362216203e+00 -2.1153771481062571e+00 7.8585445646213499e+00 + 6 -1.3400719118246235e+02 1.4464619942449545e+02 1.3208522568936021e+02 + 7 3.2934779798581149e+00 -4.2631188537156923e+01 -2.4121630958767483e+02 + 8 7.2264008598726353e+00 -7.5980088961129306e+00 6.5580429256789813e+01 + 9 1.9742692318093127e+01 1.3614189737554845e+01 8.1519650161393756e+01 + 10 9.2962708139352671e+01 -1.1563036116753884e+02 -3.3820313142713935e+01 + 11 -2.4400421253347409e+00 -2.8543148054313039e+00 -6.9013841467758343e+00 + 12 1.4132703533511410e+01 5.2236961852365482e+00 -3.4842615956817222e+00 + 13 5.5693214555896331e+00 -2.2363825694625992e+00 -2.7971411853474509e-01 + 14 -3.3705755456036601e+00 8.1808964264212214e-01 -6.0675086802719047e+00 + 15 2.0412198716393085e-01 5.7164534354552288e+00 1.0979631402077406e+00 + 16 7.4892854506804795e+01 -5.8221977374294710e+01 -1.7407552142916344e+02 + 17 -7.1685131330897889e+01 5.3983978740837856e+01 1.8025811888395418e+02 + 18 3.0344520480337822e-01 4.7181905696230890e+00 -7.8130888841745270e+00 + 19 2.0273439870232144e+00 -6.9321998061025081e-01 5.5378137703490316e+00 + 20 -2.8992212491202918e+00 -3.9663306040180997e+00 4.0721611005788070e+00 + 21 -1.6633737668173215e+01 -1.7203208267774954e+01 5.2562385208269738e+01 + 22 -2.7844843342804037e+01 -7.7953386377407945e+00 -4.0489032890489341e+01 + 23 4.4059860514730161e+01 2.5416352814818115e+01 -1.1566172498242340e+01 + 24 1.0131372075884771e+01 -4.7953630486955021e+01 2.6596969127274438e+01 + 25 -3.8708301090320980e+01 3.7071322352063789e+00 -3.1709086073293854e+01 + 26 2.8012730539952887e+01 4.3989322885086779e+01 4.4933419356886226e+00 + 27 9.8571568073604041e+00 -5.1411324984115083e+01 1.9573060310962312e+01 + 28 -4.2912536559910365e+01 1.6049872443796005e+01 -2.8368170253235682e+01 + 29 3.3449860306859996e+01 3.5359614497132995e+01 8.7714765600775237e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-born_coul_msm.yaml index 779a79dd9..e0def1f39 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:17:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -15,22 +15,22 @@ post_commands: ! | kspace_modify pressure/scalar no # required for USER-OMP with msm input_file: in.fourmol pair_style: born/coul/msm 12.0 -pair_coeff: ! | - 1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 141.547923828784 - 1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 4.09225030876458 - 1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 403.51858739517 - 1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 0.177172207445923 - 2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 17.5662073921955 - 2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 0.000703093129207124 - 2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 12.548008396489 - 3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 1019.38354056979 - 3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 +pair_coeff: ! "1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 + 141.547923828784 \n1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 + 4.09225030876458 \n1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 + 403.51858739517 \n1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 + 0.177172207445923 \n2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 + 17.5662073921955 \n2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 + 0.000703093129207124 \n2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 + 12.548008396489 \n3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 + 1019.38354056979 \n3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n" extract: ! | cut_coul 0 natoms: 29 @@ -68,38 +68,38 @@ init_forces: ! |2 27 9.2127777588853803e+00 -4.9743145817451357e+01 1.8793705897680244e+01 28 -4.2446746701351501e+01 1.5146990306640154e+01 -2.7893182357714910e+01 29 3.3722087930502333e+01 3.4506742102964189e+01 9.1019508745580708e+00 -run_vdwl: 158.517821228768 -run_coul: 115.962240913696 +run_vdwl: 224.237652226166 +run_coul: 114.106006442906 run_stress: ! |2- - 3.6387648397931588e+02 3.5301003752982047e+02 5.1307556406547917e+02 -9.1562321417279833e+01 3.3594654109187168e+01 7.7956883465375853e+01 + 4.6456283590985373e+02 4.4849240500011121e+02 7.8162470384181984e+02 -9.9620431070851126e+01 3.8374186624871044e+01 1.0616278120291805e+02 run_forces: ! |2 - 1 3.1145970722922813e+00 5.4525990307381853e+01 5.7918976793358901e+01 - 2 2.4809254082586381e+01 1.7077500801694065e+01 -3.0676642389207348e+01 - 3 -3.0681041713774849e+01 -6.2343477316464032e+01 -2.4087070040233044e+01 - 4 -5.1593256652650918e+00 1.5471587511193317e+00 -4.1007486840186926e+00 - 5 -1.9072339462680974e+00 -1.6445169266698272e+00 7.1844780492534994e+00 - 6 -9.7227061060233538e+01 9.9934898952367107e+01 5.1846594365018234e+01 - 7 3.9872822224787048e+00 -2.6783719185441875e+01 -1.3414790026540734e+02 - 8 3.9254286479685390e+00 -1.8806812769936683e+00 5.7983856261910056e+01 - 9 1.4010216424977763e+01 6.2974294391086145e+00 5.3689010717585475e+01 - 10 6.9394114287350163e+01 -8.8353236590403000e+01 -2.9800578882665189e+01 - 11 -2.7156479275017289e+00 -2.4963131920388135e+00 -6.9853574089021198e+00 - 12 1.3808226882219833e+01 4.9563009446178379e+00 -3.8000668589540143e+00 - 13 5.1568629281476310e+00 -1.9299562668444334e+00 -3.1250556113418748e-01 - 14 -3.3113070014742112e+00 8.1572283230231080e-01 -5.2530150667850624e+00 - 15 -4.2234869535507903e-02 5.5876265612171423e+00 1.0603082430152573e+00 - 16 4.7392602397085675e+01 -4.0554132567343352e+01 -9.5667482600039818e+01 - 17 -4.3240644435896243e+01 3.4796459526178062e+01 1.0306838335312038e+02 - 18 1.7035976233006297e-01 5.8315308908160244e+00 -8.3008273079895538e+00 - 19 2.2737281999154466e+00 -1.2136493217418693e+00 6.2706215245225865e+00 - 20 -3.0498375670139026e+00 -4.4804073660705370e+00 4.1711099502749791e+00 - 21 -1.1564346721782504e+01 -9.8933258271453663e+00 3.5174887378978461e+01 - 22 -1.9796455445188602e+01 -6.1471247339727784e+00 -2.7299108457038624e+01 - 23 3.0799852418096041e+01 1.6634666356950142e+01 -7.2149017818155388e+00 - 24 9.3653371836176404e+00 -3.3214622489949974e+01 2.0067072450130503e+01 - 25 -3.0504095515309999e+01 1.7046500588910687e+00 -2.4914216393450818e+01 - 26 2.0444518202980291e+01 3.1326578284999453e+01 4.1342439375362732e+00 - 27 5.8450920562190083e+00 -3.3514776371852228e+01 1.1710721520060646e+01 - 28 -2.9102697260303724e+01 9.7310403863154153e+00 -1.8687137784921696e+01 - 29 2.3804456361282547e+01 2.3682385338973308e+01 6.9672949377977824e+00 + 1 -4.4578743829531442e+00 6.5576411541351405e+01 8.3926090104589164e+01 + 2 4.0160317524388127e+01 3.0006655649673458e+01 -4.8749693494665642e+01 + 3 -3.3617811991171500e+01 -9.0166441478576331e+01 -3.5181386991809831e+01 + 4 -5.3432497303839126e+00 1.4739325655529110e+00 -4.1798263073525712e+00 + 5 -2.1116930080740266e+00 -2.0431988239493939e+00 7.8006413930873304e+00 + 6 -1.3352821022289217e+02 1.4503252230736177e+02 1.3123423924371028e+02 + 7 3.0008160252617020e+00 -4.2983645763578231e+01 -2.4067964644701601e+02 + 8 7.0660815498542870e+00 -8.1603991329703600e+00 6.6105244620568101e+01 + 9 1.9942638808836854e+01 1.3910828572060179e+01 8.1474704405494165e+01 + 10 9.2932043277017883e+01 -1.1553639201869628e+02 -3.3867052495488757e+01 + 11 -2.4988213889660633e+00 -2.7287795421097258e+00 -6.9808148703689996e+00 + 12 1.4454120703581667e+01 4.8430653727207691e+00 -3.3218766510728792e+00 + 13 5.4725548767767220e+00 -2.1397142342589963e+00 -2.9758831999010849e-01 + 14 -3.5018274912522860e+00 9.3939421641223020e-01 -6.0910405870092461e+00 + 15 1.0817198069547157e-01 5.7972833490485378e+00 1.0422962406887961e+00 + 16 7.4770727037727184e+01 -5.7947037832798031e+01 -1.7374632584076090e+02 + 17 -7.1716425809992558e+01 5.3713018738139112e+01 1.7957562746066392e+02 + 18 7.4088320320688672e-01 6.0565798451759729e+00 -8.9520152493655232e+00 + 19 1.8826380608560260e+00 -1.3717068947876618e+00 6.2489577515307637e+00 + 20 -3.1176122417206718e+00 -4.5477243705143433e+00 4.6954957227025549e+00 + 21 -1.6505149528196295e+01 -1.6448772072954405e+01 5.1651839835113933e+01 + 22 -2.7929366401322110e+01 -8.0497519925810721e+00 -3.9966578268296935e+01 + 23 4.3927553198302618e+01 2.5047631123869348e+01 -1.1102698543290288e+01 + 24 9.9822817998763806e+00 -4.6407130676166801e+01 2.6100746625635626e+01 + 25 -3.8538470364419197e+01 3.0829268442369431e+00 -3.1437208253477479e+01 + 26 2.7938202295696701e+01 4.3140189552452505e+01 4.6958814005818992e+00 + 27 9.3372481738193081e+00 -4.9797590451821215e+01 1.8753337706599204e+01 + 28 -4.2557989807362048e+01 1.5174019615151627e+01 -2.7919321399704490e+01 + 29 3.3708223852808274e+01 3.4533825992556110e+01 9.1679712087039338e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-born_coul_msm_table.yaml index e3df84b71..fe6a0faf8 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -68,38 +68,38 @@ init_forces: ! |2 27 9.2127777588853803e+00 -4.9743145817451357e+01 1.8793705897680244e+01 28 -4.2446746701351501e+01 1.5146990306640154e+01 -2.7893182357714910e+01 29 3.3722087930502333e+01 3.4506742102964189e+01 9.1019508745580708e+00 -run_vdwl: 158.517821228768 -run_coul: 115.962240913696 +run_vdwl: 224.237652226166 +run_coul: 114.106006442906 run_stress: ! |2- - 3.6387648397931588e+02 3.5301003752982047e+02 5.1307556406547917e+02 -9.1562321417279833e+01 3.3594654109187168e+01 7.7956883465375853e+01 + 4.6456283590985373e+02 4.4849240500011121e+02 7.8162470384181984e+02 -9.9620431070851126e+01 3.8374186624871044e+01 1.0616278120291805e+02 run_forces: ! |2 - 1 3.1145970722922813e+00 5.4525990307381853e+01 5.7918976793358901e+01 - 2 2.4809254082586381e+01 1.7077500801694065e+01 -3.0676642389207348e+01 - 3 -3.0681041713774849e+01 -6.2343477316464032e+01 -2.4087070040233044e+01 - 4 -5.1593256652650918e+00 1.5471587511193317e+00 -4.1007486840186926e+00 - 5 -1.9072339462680974e+00 -1.6445169266698272e+00 7.1844780492534994e+00 - 6 -9.7227061060233538e+01 9.9934898952367107e+01 5.1846594365018234e+01 - 7 3.9872822224787048e+00 -2.6783719185441875e+01 -1.3414790026540734e+02 - 8 3.9254286479685390e+00 -1.8806812769936683e+00 5.7983856261910056e+01 - 9 1.4010216424977763e+01 6.2974294391086145e+00 5.3689010717585475e+01 - 10 6.9394114287350163e+01 -8.8353236590403000e+01 -2.9800578882665189e+01 - 11 -2.7156479275017289e+00 -2.4963131920388135e+00 -6.9853574089021198e+00 - 12 1.3808226882219833e+01 4.9563009446178379e+00 -3.8000668589540143e+00 - 13 5.1568629281476310e+00 -1.9299562668444334e+00 -3.1250556113418748e-01 - 14 -3.3113070014742112e+00 8.1572283230231080e-01 -5.2530150667850624e+00 - 15 -4.2234869535507903e-02 5.5876265612171423e+00 1.0603082430152573e+00 - 16 4.7392602397085675e+01 -4.0554132567343352e+01 -9.5667482600039818e+01 - 17 -4.3240644435896243e+01 3.4796459526178062e+01 1.0306838335312038e+02 - 18 1.7035976233006297e-01 5.8315308908160244e+00 -8.3008273079895538e+00 - 19 2.2737281999154466e+00 -1.2136493217418693e+00 6.2706215245225865e+00 - 20 -3.0498375670139026e+00 -4.4804073660705370e+00 4.1711099502749791e+00 - 21 -1.1564346721782504e+01 -9.8933258271453663e+00 3.5174887378978461e+01 - 22 -1.9796455445188602e+01 -6.1471247339727784e+00 -2.7299108457038624e+01 - 23 3.0799852418096041e+01 1.6634666356950142e+01 -7.2149017818155388e+00 - 24 9.3653371836176404e+00 -3.3214622489949974e+01 2.0067072450130503e+01 - 25 -3.0504095515309999e+01 1.7046500588910687e+00 -2.4914216393450818e+01 - 26 2.0444518202980291e+01 3.1326578284999453e+01 4.1342439375362732e+00 - 27 5.8450920562190083e+00 -3.3514776371852228e+01 1.1710721520060646e+01 - 28 -2.9102697260303724e+01 9.7310403863154153e+00 -1.8687137784921696e+01 - 29 2.3804456361282547e+01 2.3682385338973308e+01 6.9672949377977824e+00 + 1 -4.4578743829531442e+00 6.5576411541351405e+01 8.3926090104589164e+01 + 2 4.0160317524388127e+01 3.0006655649673458e+01 -4.8749693494665642e+01 + 3 -3.3617811991171500e+01 -9.0166441478576331e+01 -3.5181386991809831e+01 + 4 -5.3432497303839126e+00 1.4739325655529110e+00 -4.1798263073525712e+00 + 5 -2.1116930080740266e+00 -2.0431988239493939e+00 7.8006413930873304e+00 + 6 -1.3352821022289217e+02 1.4503252230736177e+02 1.3123423924371028e+02 + 7 3.0008160252617020e+00 -4.2983645763578231e+01 -2.4067964644701601e+02 + 8 7.0660815498542870e+00 -8.1603991329703600e+00 6.6105244620568101e+01 + 9 1.9942638808836854e+01 1.3910828572060179e+01 8.1474704405494165e+01 + 10 9.2932043277017883e+01 -1.1553639201869628e+02 -3.3867052495488757e+01 + 11 -2.4988213889660633e+00 -2.7287795421097258e+00 -6.9808148703689996e+00 + 12 1.4454120703581667e+01 4.8430653727207691e+00 -3.3218766510728792e+00 + 13 5.4725548767767220e+00 -2.1397142342589963e+00 -2.9758831999010849e-01 + 14 -3.5018274912522860e+00 9.3939421641223020e-01 -6.0910405870092461e+00 + 15 1.0817198069547157e-01 5.7972833490485378e+00 1.0422962406887961e+00 + 16 7.4770727037727184e+01 -5.7947037832798031e+01 -1.7374632584076090e+02 + 17 -7.1716425809992558e+01 5.3713018738139112e+01 1.7957562746066392e+02 + 18 7.4088320320688672e-01 6.0565798451759729e+00 -8.9520152493655232e+00 + 19 1.8826380608560260e+00 -1.3717068947876618e+00 6.2489577515307637e+00 + 20 -3.1176122417206718e+00 -4.5477243705143433e+00 4.6954957227025549e+00 + 21 -1.6505149528196295e+01 -1.6448772072954405e+01 5.1651839835113933e+01 + 22 -2.7929366401322110e+01 -8.0497519925810721e+00 -3.9966578268296935e+01 + 23 4.3927553198302618e+01 2.5047631123869348e+01 -1.1102698543290288e+01 + 24 9.9822817998763806e+00 -4.6407130676166801e+01 2.6100746625635626e+01 + 25 -3.8538470364419197e+01 3.0829268442369431e+00 -3.1437208253477479e+01 + 26 2.7938202295696701e+01 4.3140189552452505e+01 4.6958814005818992e+00 + 27 9.3372481738193081e+00 -4.9797590451821215e+01 1.8753337706599204e+01 + 28 -4.2557989807362048e+01 1.5174019615151627e+01 -2.7919321399704490e+01 + 29 3.3708223852808274e+01 3.4533825992556110e+01 9.1679712087039338e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_table_cs.yaml b/unittest/force-styles/tests/mol-pair-born_coul_table_cs.yaml index 4383c55a1..79dd45154 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_table_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_table_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 23:01:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:10 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 9.7332884809348705e+00 -5.1358738629501516e+01 1.9618779693342940e+01 28 -4.2804259382932656e+01 1.6023914430085185e+01 -2.8346203528536542e+01 29 3.3466068368781215e+01 3.5333331417895330e+01 8.7040706686759854e+00 -run_vdwl: 158.33589406052 -run_coul: 227.519616203199 +run_vdwl: 224.238305160725 +run_coul: 225.801509169719 run_stress: ! |2- - 3.6506610142382198e+02 3.5585432196398307e+02 5.1680854242642044e+02 -9.2985868616835177e+01 3.2903389766521045e+01 7.6473484219988137e+01 + 4.6605259652006634e+02 4.5140744303353154e+02 7.8583120168007440e+02 -1.0069613692077770e+02 3.7937821563053788e+01 1.0482860743226058e+02 run_forces: ! |2 - 1 3.4740137122325940e+00 5.4427031477546514e+01 5.7644049810271660e+01 - 2 2.4668394006494108e+01 1.7380374422568075e+01 -3.0485717186930390e+01 - 3 -3.0671694194688300e+01 -6.2331979212361382e+01 -2.4103728809060588e+01 - 4 -5.2737304857458360e+00 1.5284955928957380e+00 -3.9921020143568069e+00 - 5 -2.0255502655412516e+00 -1.7100705193238788e+00 7.2330110746998724e+00 - 6 -9.7881004917114424e+01 9.9614230606340129e+01 5.2490653321805482e+01 - 7 4.2990285326590163e+00 -2.6421621180728582e+01 -1.3451140836832613e+02 - 8 4.2808110486564885e+00 -1.4375951474610740e+00 5.7456664336142353e+01 - 9 1.3778432911071590e+01 6.0184713878678728e+00 5.3704104527341073e+01 - 10 6.9397553151684576e+01 -8.8421946603081096e+01 -2.9728906298815073e+01 - 11 -2.6530111544007715e+00 -2.6254011528391357e+00 -6.9016420719866858e+00 - 12 1.3488997494690972e+01 5.3096597788660667e+00 -3.9761000038075451e+00 - 13 5.2476618246843048e+00 -2.0217253969516493e+00 -2.9021853056035080e-01 - 14 -3.1782541836839560e+00 6.9912061140625337e-01 -5.2298944690262426e+00 - 15 5.1522252095229384e-02 5.5229852065671130e+00 1.1243213270377830e+00 - 16 4.7485121131117580e+01 -4.0801417892954383e+01 -9.5835978095106611e+01 - 17 -4.3156227647458110e+01 3.5026673322355016e+01 1.0362037387690761e+02 - 18 -2.8012872173427644e-01 4.4055348930819980e+00 -7.2872470347236336e+00 - 19 2.4156852945869032e+00 -4.9849041715282327e-01 5.6276372347324282e+00 - 20 -2.8096179678915001e+00 -3.8549753374075713e+00 3.5986537839123063e+00 - 21 -1.1657126725063907e+01 -1.0584980409994705e+01 3.5967714751480528e+01 - 22 -1.9631687853001058e+01 -5.8903303709644561e+00 -2.7738970022953254e+01 - 23 3.0820812352804918e+01 1.6933499181982242e+01 -7.6539279665433311e+00 - 24 9.5662818501205109e+00 -3.4566226551842625e+01 2.0565441879541613e+01 - 25 -3.0571279410409204e+01 2.3365486317254778e+00 -2.5139482149253311e+01 - 26 2.0369330645008652e+01 3.1959194195493058e+01 3.8804233038006255e+00 - 27 6.2843935712978904e+00 -3.5026318882468502e+01 1.2415958172673916e+01 - 28 -2.9249621303753152e+01 1.0572624422891584e+01 -1.8990200158235847e+01 - 29 2.3410895051280438e+01 2.4458635343944739e+01 6.5365157793386128e+00 + 1 -4.0613632117733367e+00 6.5516173298245917e+01 8.3581338666819846e+01 + 2 3.9976030749835736e+01 3.0258154189898068e+01 -4.8512328760142331e+01 + 3 -3.3591646753051712e+01 -9.0157756931374010e+01 -3.5206992395535522e+01 + 4 -5.4593245956120207e+00 1.4510014059218270e+00 -4.0785940852684099e+00 + 5 -2.2281672944313740e+00 -2.1153765972694818e+00 7.8585447910592974e+00 + 6 -1.3400719237373733e+02 1.4464620204728669e+02 1.3208522263787717e+02 + 7 3.2934765488285516e+00 -4.2631188605183709e+01 -2.4121631274255139e+02 + 8 7.2264027739625920e+00 -7.5980115874199408e+00 6.5580432013308979e+01 + 9 1.9742693007325705e+01 1.3614192059187204e+01 8.1519650892370208e+01 + 10 9.2962708124323655e+01 -1.1563036131327461e+02 -3.3820313540957201e+01 + 11 -2.4400422210407657e+00 -2.8543145401133581e+00 -6.9013843344390855e+00 + 12 1.4132703342350098e+01 5.2236952835251422e+00 -3.4842613856968612e+00 + 13 5.5693220477662129e+00 -2.2363821964385515e+00 -2.7971437145876077e-01 + 14 -3.3705761274113146e+00 8.1808991221781091e-01 -6.0675086412045340e+00 + 15 2.0412091534975091e-01 5.7164534404188254e+00 1.0979637522734575e+00 + 16 7.4892854863191417e+01 -5.8221978315398225e+01 -1.7407552096233391e+02 + 17 -7.1685129920680652e+01 5.3983976310233267e+01 1.8025812114252651e+02 + 18 3.0344554349714725e-01 4.7181904879117376e+00 -7.8130896885312948e+00 + 19 2.0273402083263439e+00 -6.9322318455971965e-01 5.5378129351929948e+00 + 20 -2.8992176376048877e+00 -3.9663276457479228e+00 4.0721624440802424e+00 + 21 -1.6633737713961295e+01 -1.7203208165445368e+01 5.2562385095055433e+01 + 22 -2.7844847557443828e+01 -7.7953407984053289e+00 -4.0489034913365863e+01 + 23 4.4059864874789000e+01 2.5416354812928713e+01 -1.1566170698695506e+01 + 24 1.0131372131491679e+01 -4.7953630260857068e+01 2.6596969158757638e+01 + 25 -3.8708304981504511e+01 3.7071296641791713e+00 -3.1709087966863780e+01 + 26 2.8012734697616040e+01 4.3989325330606924e+01 4.4933443626092116e+00 + 27 9.8571567278348269e+00 -5.1411324950212602e+01 1.9573060253383161e+01 + 28 -4.2912541162578357e+01 1.6049871039177582e+01 -2.8368172517392424e+01 + 29 3.3449864994342612e+01 3.5359615809960985e+01 8.7714788591227322e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_wolf.yaml b/unittest/force-styles/tests/mol-pair-born_coul_wolf.yaml index 7d419e2da..f3c37e100 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_wolf.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_wolf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 16:19:43 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -9,90 +9,90 @@ pre_commands: ! "" post_commands: ! "" input_file: in.fourmol pair_style: born/coul/wolf 0.25 8.0 -pair_coeff: ! | - 1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 141.547923828784 - 1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 4.09225030876458 - 1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 403.51858739517 - 1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 303.336540547726 - 2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 0.177172207445923 - 2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 17.5662073921955 - 2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 0.000703093129207124 - 2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 12.548008396489 - 3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 1019.38354056979 - 3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 778.254162800904 - 4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 - 5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 592.979935420722 +pair_coeff: ! "1 1 2.51937098847838 0.148356076521964 1.82166848001002 29.0375806150613 + 141.547923828784 \n1 2 2.87560097202631 0.103769845319212 1.18949647259382 1.7106306969663 + 4.09225030876458 \n1 3 2.73333746288062 0.169158133709025 2.06291417638668 63.7180294456725 + 403.51858739517 \n1 4 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n1 5 2.51591531388789 0.166186965980131 2.01659390849669 49.622913109061 + 303.336540547726 \n2 2 1.0594557710255 0.281261664467988 0.314884389172266 0.271080184997071 + 0.177172207445923 \n2 3 2.12127488295383 0.124576922646243 1.46526793359105 5.10367785279284 + 17.5662073921955 \n2 4 0.523836115049206 0.140093804714855 0.262040872137659 0.00432916334694855 + 0.000703093129207124 \n2 5 2.36887234111228 0.121604450909563 1.39946581861656 3.82529730669145 + 12.548008396489 \n3 3 2.81831917530019 0.189944649028137 2.31041576143228 127.684271782117 + 1019.38354056979 \n3 4 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n3 5 2.5316180773506 0.186976803503293 2.26748506873271 100.602835334624 + 778.254162800904 \n4 4 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n4 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722 \n5 5 2.63841820292211 0.184008285863681 2.19742633928911 79.1465822481912 + 592.979935420722\n" extract: ! "" natoms: 29 init_vdwl: 225.01325775005 init_coul: -115.714526063965 init_stress: ! |2- - 4.6548476353031594e+02 4.5051121181207009e+02 7.8830780607527208e+02 -1.0070292272125866e+02 3.7932502866866926e+01 1.0553864562325973e+02 + 4.6548476353031594e+02 4.5051121181207009e+02 7.8830780607527231e+02 -1.0070292272125855e+02 3.7932502866866884e+01 1.0553864562325978e+02 init_forces: ! |2 1 -4.4641074718374725e+00 6.5654664922425383e+01 8.4289201975265982e+01 2 4.0311842353028624e+01 3.0257535401299727e+01 -4.9096930370239420e+01 3 -3.3553276996952135e+01 -9.0454690885444151e+01 -3.5286204897949617e+01 4 -5.4326075691646443e+00 1.4750070332641836e+00 -4.1453377417337585e+00 - 5 -2.1840552105120996e+00 -2.0820945236498694e+00 7.8504362907775436e+00 + 5 -2.1840552105120996e+00 -2.0820945236498698e+00 7.8504362907775436e+00 6 -1.3458475468447566e+02 1.4573608496561206e+02 1.3350063946264041e+02 7 3.1172252284802022e+00 -4.3128967618489632e+01 -2.4355183830544655e+02 - 8 7.7977506904524718e+00 -8.5382231680036949e+00 6.6109004772120187e+01 - 9 1.9941491302607346e+01 1.3989277582182677e+01 8.2015176223230995e+01 + 8 7.7977506904524736e+00 -8.5382231680036966e+00 6.6109004772120187e+01 + 9 1.9941491302607346e+01 1.3989277582182680e+01 8.2015176223230981e+01 10 9.2986332060941479e+01 -1.1563939008048585e+02 -3.3767913886593711e+01 11 -2.4897126629767046e+00 -2.8321358843182929e+00 -7.0356961622427328e+00 - 12 1.4309767269332688e+01 5.0245809380075492e+00 -3.2735260664726571e+00 - 13 5.5540753662652982e+00 -2.2023993732628724e+00 -3.0618787941595543e-01 - 14 -3.4645291929560260e+00 9.0208906948568501e-01 -6.1598725549849505e+00 - 15 1.6497973196839799e-01 5.7610138437210665e+00 1.0388423002469944e+00 + 12 1.4309767269332687e+01 5.0245809380075501e+00 -3.2735260664726580e+00 + 13 5.5540753662652991e+00 -2.2023993732628724e+00 -3.0618787941595521e-01 + 14 -3.4645291929560260e+00 9.0208906948568457e-01 -6.1598725549849505e+00 + 15 1.6497973196839777e-01 5.7610138437210665e+00 1.0388423002469944e+00 16 7.5198550890136474e+01 -5.8250369682046085e+01 -1.7473483250665461e+02 17 -7.2047911016472383e+01 5.3986247830551854e+01 1.8071845329505268e+02 - 18 5.4865434693948656e-01 5.4795093909080039e+00 -8.4742180617754261e+00 - 19 1.9220633751034335e+00 -1.0885665726844067e+00 5.9236082764536597e+00 + 18 5.4865434693948656e-01 5.4795093909080022e+00 -8.4742180617754261e+00 + 19 1.9220633751034335e+00 -1.0885665726844072e+00 5.9236082764536597e+00 20 -2.9954564482234232e+00 -4.2803216032204512e+00 4.4747365104553065e+00 - 21 -1.6525887219216504e+01 -1.6791180321860907e+01 5.2088959037553671e+01 - 22 -2.7794558712527085e+01 -7.9035624631990204e+00 -4.0215539211939493e+01 + 21 -1.6525887219216497e+01 -1.6791180321860907e+01 5.2088959037553686e+01 + 22 -2.7794558712527092e+01 -7.9035624631990222e+00 -4.0215539211939507e+01 23 4.3840858038837148e+01 2.5199748035048131e+01 -1.1304867969464670e+01 24 9.7024935924746885e+00 -4.6652912712429405e+01 2.5828050400755362e+01 25 -3.8034229076586527e+01 3.3184478584168597e+00 -3.1022383460045873e+01 - 26 2.7759257897664831e+01 4.3090577628646948e+01 4.5508599095678690e+00 - 27 9.4540809516248174e+00 -5.0442863407123866e+01 1.9202978230103987e+01 + 26 2.7759257897664831e+01 4.3090577628646948e+01 4.5508599095678681e+00 + 27 9.4540809516247997e+00 -5.0442863407123895e+01 1.9202978230103980e+01 28 -4.2634181882990461e+01 1.5556514661238062e+01 -2.8124333709589376e+01 - 29 3.3595845049033741e+01 3.4856379135410300e+01 8.9087361003241199e+00 -run_vdwl: 158.434782247931 -run_coul: -113.929272955805 + 29 3.3595845049033763e+01 3.4856379135410322e+01 8.9087361003241234e+00 +run_vdwl: 224.239908258883 +run_coul: -115.738011157081 run_stress: ! |2- - 3.6457599858106312e+02 3.5447775569312563e+02 5.1484466370894995e+02 -9.2184537777848604e+01 3.3327026119666925e+01 7.7318576297238266e+01 + 4.6541486465261943e+02 4.5000181377675614e+02 7.8360788998458611e+02 -1.0010028697870386e+02 3.8217404146676735e+01 1.0558384978752372e+02 run_forces: ! |2 - 1 3.3128565928816602e+00 5.4462232338907683e+01 5.7819825620081396e+01 - 2 2.4741711089801687e+01 1.7215897652018725e+01 -3.0619730806082039e+01 - 3 -3.0675317991144063e+01 -6.2338014537455528e+01 -2.4093764988937252e+01 - 4 -5.2186950995461059e+00 1.5388493910159626e+00 -4.0518642704153480e+00 - 5 -1.9740472219907386e+00 -1.6710869413430216e+00 7.2060846542775741e+00 - 6 -9.7531884089785308e+01 9.9793556580413565e+01 5.2098481038771922e+01 - 7 4.1240901037471023e+00 -2.6627630139738915e+01 -1.3429437375227437e+02 - 8 4.0961464557336074e+00 -1.6859216412227553e+00 5.7786048678057305e+01 - 9 1.3898962563226151e+01 6.1784815300352349e+00 5.3698406201380600e+01 - 10 6.9395067324736331e+01 -8.8387443730071126e+01 -2.9777902877382061e+01 - 11 -2.6886774410154004e+00 -2.5516346181388627e+00 -6.9603326359120139e+00 - 12 1.3657116374147842e+01 5.0998174536259020e+00 -3.8311422196898794e+00 - 13 5.2106464538019859e+00 -1.9694276886777924e+00 -3.1806000271177137e-01 - 14 -3.2502839177058052e+00 7.6870953022794208e-01 -5.2552653229769231e+00 - 15 2.5381417765427787e-03 5.5670489097503548e+00 1.0731442832077978e+00 - 16 4.7451100017037810e+01 -4.0685593584410100e+01 -9.5760224948203970e+01 - 17 -4.3207417432057618e+01 3.4918390165235508e+01 1.0330298136883876e+02 - 18 -7.8633626956627622e-02 5.1621863754062316e+00 -7.8408453675787255e+00 - 19 2.3491071350704971e+00 -8.8427683425378700e-01 5.9940920406682503e+00 - 20 -2.9045058075719230e+00 -4.1696098186895822e+00 3.9210010976007812e+00 - 21 -1.1670443819074549e+01 -1.0138720509131064e+01 3.5558210752504799e+01 - 22 -1.9698153723974411e+01 -6.0607216096940473e+00 -2.7508478755382452e+01 - 23 3.0835222734122745e+01 1.6748088264051574e+01 -7.4052523774694468e+00 - 24 9.4619363908432472e+00 -3.3810430721396251e+01 2.0200434023345355e+01 - 25 -3.0551295230862216e+01 1.9603242823861455e+00 -2.4994048576690645e+01 - 26 2.0444751175621047e+01 3.1599870621201791e+01 4.0782746097595632e+00 - 27 6.0377133407499528e+00 -3.4167133913114654e+01 1.2057831650379898e+01 - 28 -2.9188933983003132e+01 1.0118794842901602e+01 -1.8843451954617603e+01 - 29 2.3619323491389729e+01 2.4015398350159284e+01 6.7599228374505591e+00 + 1 -4.2502329771710929e+00 6.5529136392074619e+01 8.3802258300262707e+01 + 2 4.0077377873775021e+01 3.0123043653002121e+01 -4.8677361669928018e+01 + 3 -3.3604108953506085e+01 -9.0162431097832780e+01 -3.5191677806100941e+01 + 4 -5.4032950935756565e+00 1.4633073494925768e+00 -4.1349626617067328e+00 + 5 -2.1772201149555888e+00 -2.0735171634794867e+00 7.8263722087795067e+00 + 6 -1.3376700152048576e+02 1.4486899571705158e+02 1.3155821717622825e+02 + 7 3.1281331242910890e+00 -4.2826518648197720e+01 -2.4088832591280109e+02 + 8 7.1655270005238618e+00 -7.9215801387540719e+00 6.5920419578432856e+01 + 9 1.9844173371517151e+01 1.3780515384915439e+01 8.1490226882044936e+01 + 10 9.2945217961425243e+01 -1.1558013528512596e+02 -3.3854112327934885e+01 + 11 -2.4735993688224309e+00 -2.7835843261978006e+00 -6.9580543401127777e+00 + 12 1.4300940351030048e+01 5.0004334212543808e+00 -3.3454174417790705e+00 + 13 5.5289379784883801e+00 -2.1823214846880816e+00 -3.0489132610018055e-01 + 14 -3.4420109812684667e+00 8.8983273971750632e-01 -6.0946826063052288e+00 + 15 1.5399876209866378e-01 5.7688496469887793e+00 1.0513327083961508e+00 + 16 7.4844440489982205e+01 -5.8095648972574530e+01 -1.7391855394815460e+02 + 17 -7.1710330502991098e+01 5.3858238913733238e+01 1.7987854917641087e+02 + 18 4.9843135102306041e-01 5.4321557369843898e+00 -8.4313095652984593e+00 + 19 1.9593550510925104e+00 -1.0603912824554194e+00 5.9376075823874759e+00 + 20 -2.9826432148335855e+00 -4.2603442220140337e+00 4.4199110596054219e+00 + 21 -1.6624110338183097e+01 -1.6734747841033244e+01 5.2093791272604278e+01 + 22 -2.7872832053342002e+01 -7.9607185341977784e+00 -4.0216279288710226e+01 + 23 4.4017316754835619e+01 2.5199592894297812e+01 -1.1308786658777890e+01 + 24 1.0045989470881118e+01 -4.7095885827046502e+01 2.6222749868755432e+01 + 25 -3.8625166666643103e+01 3.3351538332527308e+00 -3.1529313913944950e+01 + 26 2.8007530330046198e+01 4.3518901048232451e+01 4.6653568183008680e+00 + 27 9.5781917136790220e+00 -5.0496776797950737e+01 1.9159966437625865e+01 + 28 -4.2744028388211525e+01 1.5583088438900013e+01 -2.8148473708209671e+01 + 29 3.3581018589300328e+01 3.4883356451650492e+01 8.9754441060301300e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-born_coul_wolf_cs.yaml b/unittest/force-styles/tests/mol-pair-born_coul_wolf_cs.yaml index bcf298579..ab1330286 100644 --- a/unittest/force-styles/tests/mol-pair-born_coul_wolf_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-born_coul_wolf_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 15:40:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 9.4540809516247997e+00 -5.0442863407123895e+01 1.9202978230103980e+01 28 -4.2634181882990461e+01 1.5556514661238062e+01 -2.8124333709589376e+01 29 3.3595845049033763e+01 3.4856379135410322e+01 8.9087361003241234e+00 -run_vdwl: 158.434782247931 -run_coul: -113.929272955805 +run_vdwl: 224.239908258883 +run_coul: -115.738011157081 run_stress: ! |2- - 3.6457599858106312e+02 3.5447775569312569e+02 5.1484466370894995e+02 -9.2184537777848661e+01 3.3327026119666925e+01 7.7318576297238266e+01 + 4.6541486465261943e+02 4.5000181377675614e+02 7.8360788998458611e+02 -1.0010028697870386e+02 3.8217404146676735e+01 1.0558384978752372e+02 run_forces: ! |2 - 1 3.3128565928816638e+00 5.4462232338907683e+01 5.7819825620081396e+01 - 2 2.4741711089801687e+01 1.7215897652018725e+01 -3.0619730806082039e+01 - 3 -3.0675317991144063e+01 -6.2338014537455528e+01 -2.4093764988937252e+01 - 4 -5.2186950995461068e+00 1.5388493910159624e+00 -4.0518642704153480e+00 - 5 -1.9740472219907381e+00 -1.6710869413430212e+00 7.2060846542775732e+00 - 6 -9.7531884089785322e+01 9.9793556580413565e+01 5.2098481038771915e+01 - 7 4.1240901037471023e+00 -2.6627630139738915e+01 -1.3429437375227437e+02 - 8 4.0961464557336216e+00 -1.6859216412227556e+00 5.7786048678057305e+01 - 9 1.3898962563226153e+01 6.1784815300352367e+00 5.3698406201380600e+01 - 10 6.9395067324736331e+01 -8.8387443730071126e+01 -2.9777902877382061e+01 - 11 -2.6886774410154004e+00 -2.5516346181388623e+00 -6.9603326359120139e+00 - 12 1.3657116374147842e+01 5.0998174536259002e+00 -3.8311422196898794e+00 - 13 5.2106464538019868e+00 -1.9694276886777924e+00 -3.1806000271177137e-01 - 14 -3.2502839177058052e+00 7.6870953022794231e-01 -5.2552653229769231e+00 - 15 2.5381417765425567e-03 5.5670489097503548e+00 1.0731442832077982e+00 - 16 4.7451100017037810e+01 -4.0685593584410100e+01 -9.5760224948203970e+01 - 17 -4.3207417432057625e+01 3.4918390165235508e+01 1.0330298136883876e+02 - 18 -7.8633626956618755e-02 5.1621863754062369e+00 -7.8408453675787166e+00 - 19 2.3491071350704882e+00 -8.8427683425379233e-01 5.9940920406682432e+00 - 20 -2.9045058075719221e+00 -4.1696098186895822e+00 3.9210010976007812e+00 - 21 -1.1670443819074549e+01 -1.0138720509131064e+01 3.5558210752504799e+01 - 22 -1.9698153723974411e+01 -6.0607216096940473e+00 -2.7508478755382452e+01 - 23 3.0835222734122745e+01 1.6748088264051574e+01 -7.4052523774694468e+00 - 24 9.4619363908432472e+00 -3.3810430721396251e+01 2.0200434023345355e+01 - 25 -3.0551295230862216e+01 1.9603242823861455e+00 -2.4994048576690645e+01 - 26 2.0444751175621047e+01 3.1599870621201791e+01 4.0782746097595632e+00 - 27 6.0377133407499599e+00 -3.4167133913114647e+01 1.2057831650379899e+01 - 28 -2.9188933983003132e+01 1.0118794842901602e+01 -1.8843451954617603e+01 - 29 2.3619323491389721e+01 2.4015398350159277e+01 6.7599228374505573e+00 + 1 -4.2502329771710929e+00 6.5529136392074619e+01 8.3802258300262707e+01 + 2 4.0077377873775021e+01 3.0123043653002121e+01 -4.8677361669928018e+01 + 3 -3.3604108953506085e+01 -9.0162431097832780e+01 -3.5191677806100941e+01 + 4 -5.4032950935756565e+00 1.4633073494925768e+00 -4.1349626617067328e+00 + 5 -2.1772201149555888e+00 -2.0735171634794867e+00 7.8263722087795067e+00 + 6 -1.3376700152048576e+02 1.4486899571705158e+02 1.3155821717622825e+02 + 7 3.1281331242910890e+00 -4.2826518648197720e+01 -2.4088832591280109e+02 + 8 7.1655270005238618e+00 -7.9215801387540719e+00 6.5920419578432856e+01 + 9 1.9844173371517151e+01 1.3780515384915439e+01 8.1490226882044936e+01 + 10 9.2945217961425243e+01 -1.1558013528512596e+02 -3.3854112327934885e+01 + 11 -2.4735993688224309e+00 -2.7835843261978006e+00 -6.9580543401127777e+00 + 12 1.4300940351030048e+01 5.0004334212543808e+00 -3.3454174417790705e+00 + 13 5.5289379784883801e+00 -2.1823214846880816e+00 -3.0489132610018055e-01 + 14 -3.4420109812684667e+00 8.8983273971750632e-01 -6.0946826063052288e+00 + 15 1.5399876209866378e-01 5.7688496469887793e+00 1.0513327083961508e+00 + 16 7.4844440489982205e+01 -5.8095648972574530e+01 -1.7391855394815460e+02 + 17 -7.1710330502991098e+01 5.3858238913733238e+01 1.7987854917641087e+02 + 18 4.9843135102306041e-01 5.4321557369843898e+00 -8.4313095652984593e+00 + 19 1.9593550510925104e+00 -1.0603912824554194e+00 5.9376075823874759e+00 + 20 -2.9826432148335855e+00 -4.2603442220140337e+00 4.4199110596054219e+00 + 21 -1.6624110338183097e+01 -1.6734747841033244e+01 5.2093791272604278e+01 + 22 -2.7872832053342002e+01 -7.9607185341977784e+00 -4.0216279288710226e+01 + 23 4.4017316754835619e+01 2.5199592894297812e+01 -1.1308786658777890e+01 + 24 1.0045989470881118e+01 -4.7095885827046502e+01 2.6222749868755432e+01 + 25 -3.8625166666643103e+01 3.3351538332527308e+00 -3.1529313913944950e+01 + 26 2.8007530330046198e+01 4.3518901048232451e+01 4.6653568183008680e+00 + 27 9.5781917136790220e+00 -5.0496776797950737e+01 1.9159966437625865e+01 + 28 -4.2744028388211525e+01 1.5583088438900013e+01 -2.8148473708209671e+01 + 29 3.3581018589300328e+01 3.4883356451650492e+01 8.9754441060301300e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck.yaml b/unittest/force-styles/tests/mol-pair-buck.yaml index 947e2e975..16866bba3 100644 --- a/unittest/force-styles/tests/mol-pair-buck.yaml +++ b/unittest/force-styles/tests/mol-pair-buck.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 12:07:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -63,38 +63,38 @@ init_forces: ! |2 27 6.6485844671195089e+00 -3.6337865162938726e+01 1.3616306220323644e+01 28 -2.7672101461511541e+01 1.1892759906164907e+01 -1.8723455368858552e+01 29 2.1029504459272502e+01 2.4449997447911123e+01 5.1038895464304854e+00 -run_vdwl: 120.389680224171 +run_vdwl: 143.551911190157 run_coul: 0 run_stress: ! |2- - 2.5557166389926206e+02 2.5949417167124227e+02 3.7925104786399675e+02 -5.4331393627941310e+01 2.7328919467287310e+01 4.1740569884135837e+01 + 2.8577346215348786e+02 2.8738293557155362e+02 4.5969292987124692e+02 -5.4042629413176499e+01 3.0499443960600292e+01 4.6842687890897629e+01 run_forces: ! |2 - 1 -9.5102708897346455e-01 3.5351062606429096e+01 3.9457733214248897e+01 - 2 1.8087890515496976e+01 1.4881434680716316e+01 -2.0866808731191739e+01 - 3 -1.9025508531664734e+01 -4.1963948953355988e+01 -1.6664473721320441e+01 - 4 -3.9859936185258591e+00 1.0788564827143394e+00 -2.9029989743807403e+00 - 5 -1.2023708529709598e+00 -2.0086879656199623e+00 5.6818744336161462e+00 - 6 -6.0409772126459337e+01 6.4308106551875014e+01 4.2296815285620539e+01 - 7 9.3621550069352033e-01 -1.7314144864058704e+01 -9.7141526659041332e+01 - 8 8.4374361809492626e-01 -3.2803089626972723e+00 3.3704954165999396e+01 - 9 8.3054222825151562e+00 8.6081913892167101e+00 3.6111642840146494e+01 - 10 4.2561465006293496e+01 -5.5914110438197461e+01 -1.7451020505581198e+01 - 11 -1.1800071294153933e+00 -2.7475347695713208e+00 -4.5818357717762055e+00 - 12 8.4355441219410157e+00 3.9902239161298425e+00 -4.1474152018012402e+00 - 13 4.1920543033657660e+00 -1.5869427440184440e+00 -6.2698395028072312e-02 - 14 -1.6199437861441099e+00 2.6216625984075043e-01 -4.1331730392715746e+00 - 15 -2.0331861757557249e-01 4.5411724061177665e+00 1.7063136735856890e+00 - 16 3.3204342242339152e+01 -2.7557624751669067e+01 -6.8101189912981496e+01 - 17 -2.7956860933621105e+01 1.9379541761121082e+01 7.7078954287050578e+01 - 18 -1.8741424461778945e-02 -3.1649884712668143e-02 2.8217417081434781e-02 - 19 1.9029936416168166e-04 -1.9563725068207617e-04 1.2476265945711711e-03 - 20 -6.5715774497830453e-04 -6.7847978231991518e-04 2.5322071517207300e-04 - 21 -9.1337259194023357e+00 -9.9740863798564536e+00 2.9985619540557138e+01 - 22 -1.4775512665496439e+01 -3.7890914376536640e+00 -2.2670107265406628e+01 - 23 2.3901611003748002e+01 1.3772048119294055e+01 -7.3071693693756625e+00 - 24 7.5921975362095528e+00 -2.9274148880351355e+01 1.7211334413645822e+01 - 25 -2.2853219834051913e+01 3.3601430585201730e+00 -1.9347508542196454e+01 - 26 1.5250009909775976e+01 2.5905316887603249e+01 2.1161976888390273e+00 - 27 5.7137029453806143e+00 -3.0279106879537387e+01 1.0695172767212116e+01 - 28 -2.2862798673549364e+01 9.8830244186589091e+00 -1.5214423020169862e+01 - 29 1.7155069074839023e+01 2.0400972490095437e+01 4.5160185346096364e+00 + 1 -4.0748989890103937e+00 3.8338239837088423e+01 4.8564689706222993e+01 + 2 2.3558333861475681e+01 1.9416332722491227e+01 -2.7633727086668475e+01 + 3 -1.9576093379866627e+01 -5.0673825969475615e+01 -2.0144948733278433e+01 + 4 -4.1878725407092734e+00 1.0973636098007202e+00 -2.9895733062153305e+00 + 5 -1.3227409011156408e+00 -2.2154154086625057e+00 6.0619957173221994e+00 + 6 -7.0817260011683317e+01 7.6783707175085524e+01 6.5489559324312353e+01 + 7 1.1520568202656330e-01 -2.1384962273116361e+01 -1.2901866692609073e+02 + 8 2.4606737316808216e+00 -6.1187309849584546e+00 3.4980335331961392e+01 + 9 1.0355545820856243e+01 1.1115514424995482e+01 4.5792208247973932e+01 + 10 4.8533764983044421e+01 -6.2921290293995831e+01 -1.7988469177372597e+01 + 11 -1.1729314140619431e+00 -2.9842930684295861e+00 -4.8628575037546087e+00 + 12 8.7481283684487572e+00 4.0129693515269675e+00 -3.7467882925670173e+00 + 13 4.4171075484821403e+00 -1.7438140171022225e+00 -7.9030474231612746e-02 + 14 -1.8044571132811003e+00 3.5738639129504107e-01 -4.6475134342932725e+00 + 15 -1.1445355540488859e-01 4.6203861654872016e+00 1.6465926719575446e+00 + 16 4.0961654253599399e+01 -3.2279608194594402e+01 -9.0141712765485678e+01 + 17 -3.6048089876920173e+01 2.4607810422808438e+01 9.8702845023465940e+01 + 18 -1.8832666390825602e-02 -3.1809296927685429e-02 2.8363978352326218e-02 + 19 2.5268959655596062e-04 -1.4313577314748296e-04 1.2438761339514175e-03 + 20 -7.3241971372391970e-04 -7.4371370535642779e-04 2.5032308159534370e-04 + 21 -1.0852496958323307e+01 -1.2705511021348544e+01 3.6461478783498166e+01 + 22 -1.7633293795019362e+01 -4.3045216142433631e+00 -2.7570260318034393e+01 + 23 2.8478320222689906e+01 1.7018719092017456e+01 -8.8830608129601956e+00 + 24 7.1226808042283052e+00 -3.3729429644568754e+01 1.8830054532236218e+01 + 25 -2.4863047645285185e+01 3.9472474275001792e+00 -2.0910860041184570e+01 + 26 1.7729546240092340e+01 2.9773530484348854e+01 2.0611099135595561e+00 + 27 6.7356557913300854e+00 -3.6409867448434611e+01 1.3592788117943080e+01 + 28 -2.7771356738145869e+01 1.1920740573512976e+01 -1.8753246721723812e+01 + 29 2.1041688007380433e+01 2.4494018407377951e+01 5.1572000458395184e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml index 114d1f4a8..928473176 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:31:23 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 3.8010449618361193e+00 -2.5225906069759308e+01 9.1910688014900863e+00 28 -2.2825681053936801e+01 6.6017216011110555e+00 -1.4642565228293659e+01 29 1.9765892450982200e+01 1.8278061950393514e+01 6.0260822255895716e+00 -run_vdwl: 121.856393385066 -run_coul: -132.208728911611 +run_vdwl: 143.570099579859 +run_coul: -127.532904240752 run_stress: ! |2- - 2.3125182102458243e+02 2.1339994512939825e+02 3.2671928824491391e+02 -5.5590836481435034e+01 2.1510391807758335e+01 4.5472434046733817e+01 + 2.5889909416319711e+02 2.4422213961563290e+02 4.0230661883110236e+02 -5.4878661060050817e+01 2.2536041888677346e+01 4.9831039816737245e+01 run_forces: ! |2 - 1 1.1881449892602052e+00 3.5106122776547423e+01 4.0158213733825264e+01 - 2 1.8286210753030140e+01 1.2244505151482874e+01 -2.2856770151080624e+01 - 3 -1.8984511986402570e+01 -4.2043595713968330e+01 -1.6662333552279158e+01 - 4 -3.9424600872367410e+00 1.0955028554496196e+00 -3.2183514834253617e+00 - 5 -1.6051624807395641e+00 -1.3050339704931941e+00 5.6207089737638505e+00 - 6 -5.8812419652334910e+01 6.1006132019094501e+01 4.0337748094949021e+01 - 7 6.9299847832349259e-01 -1.6743893619428093e+01 -9.4686810382320601e+01 - 8 -2.1649048101506507e-01 5.3397423481739215e-01 3.6104142207143440e+01 - 9 1.0319255366929131e+01 2.4885919412387101e+00 3.8244903850529852e+01 - 10 4.2001448354405532e+01 -5.5214819512158982e+01 -1.7594446275643907e+01 - 11 -2.1882879636010388e+00 -1.5910385954413280e+00 -5.1342698509067706e+00 - 12 1.1700702478279300e+01 3.2384810392846015e+00 -2.8336017206317168e+00 - 13 3.8378471898524991e+00 -1.6168285269932376e+00 -9.7036856366087665e-02 - 14 -2.9003248321168602e+00 7.1772985275257628e-01 -4.1080900073982880e+00 - 15 5.0986111577585175e-03 4.3376468890691573e+00 7.0133665401351142e-01 - 16 3.2555738069691309e+01 -2.8292980330312258e+01 -6.6469220705154200e+01 - 17 -3.0837699761406267e+01 2.6099558232150681e+01 7.0370832566711698e+01 - 18 7.1641063383744930e-01 6.3080560590285568e+00 -9.2994236124820144e+00 - 19 2.0358803834906478e+00 -1.4124766011339269e+00 5.7276692683591479e+00 - 20 -3.3886536051008265e+00 -3.0917531062901746e+00 3.7001261648209476e+00 - 21 -7.1585971086166760e+00 -9.3916902644191929e+00 2.1548450946267980e+01 - 22 -1.3981734139850046e+01 -2.6871092686313132e+00 -1.7368834085034397e+01 - 23 2.0607997725263967e+01 1.0837995076119388e+01 -3.6163728877215422e+00 - 24 5.1237915797245899e+00 -2.1238476890527103e+01 1.5583764424677460e+01 - 25 -2.0194569425183815e+01 4.9546340276310419e-01 -1.6167812445696601e+01 - 26 1.4111221903086335e+01 1.9872766797363060e+01 1.6620168869180629e+00 - 27 3.3782946851552094e+00 -2.0843578612239945e+01 7.2913155553433198e+00 - 28 -1.9227004697378661e+01 5.8450195379361123e+00 -1.2470074811516804e+01 - 29 1.6876875019495472e+01 1.5245729146939324e+01 5.5322195003345218e+00 + 1 -1.8335358526584449e+00 3.8279125860051892e+01 4.8999324436570348e+01 + 2 2.3862450301853411e+01 1.7240689337938360e+01 -2.9516649697100576e+01 + 3 -1.9591212754517695e+01 -5.0760131962576175e+01 -2.0114776116761359e+01 + 4 -4.1354403387833756e+00 1.1075429238116443e+00 -3.2992499771732411e+00 + 5 -1.7209175709571822e+00 -1.5100058418790852e+00 5.9831857999466216e+00 + 6 -6.8809333719368638e+01 7.3044715941542961e+01 6.2533472849091829e+01 + 7 -2.1120790259298339e-01 -2.0641328068369987e+01 -1.2514999315504097e+02 + 8 7.6735147383240854e-01 -1.9449431687023679e+00 3.7412666317523303e+01 + 9 1.2183134460926759e+01 5.4337832238989616e+00 4.7453391725761961e+01 + 10 4.8236571555660710e+01 -6.2493147402433550e+01 -1.8192224341588275e+01 + 11 -2.1617696028753732e+00 -1.8548436985969545e+00 -5.4020614345129800e+00 + 12 1.2058398313904394e+01 3.2488786324932892e+00 -2.4720168490348535e+00 + 13 4.0341416311590974e+00 -1.7564308648246494e+00 -8.8700163694844597e-02 + 14 -3.0340545051488466e+00 8.0596807973919338e-01 -4.6621308597148774e+00 + 15 1.0772751851575614e-01 4.4547116136861789e+00 6.7703608174310270e-01 + 16 3.9914076625885592e+01 -3.2651045494160513e+01 -8.7359949989737615e+01 + 17 -3.8399826068206217e+01 3.0673022000954376e+01 9.0946740640360360e+01 + 18 1.2088369128633794e+00 6.5979689599870657e+00 -9.8388417803007933e+00 + 19 1.6551298164403510e+00 -1.6312070591897594e+00 5.6686037626686065e+00 + 20 -3.4410106726670802e+00 -3.1605458705901572e+00 4.2028677769183211e+00 + 21 -8.3597063047108122e+00 -1.1255790599049920e+01 2.5987395137236426e+01 + 22 -1.6122288386809785e+01 -3.2120151879922618e+00 -2.0842573758228138e+01 + 23 2.3976352745878923e+01 1.3212247373971399e+01 -4.6173048220434376e+00 + 24 4.6809685368341292e+00 -2.3864318321665653e+01 1.6462104834855577e+01 + 25 -2.1257772699725841e+01 8.4686158338843365e-01 -1.6942825616609866e+01 + 26 1.5652738153621510e+01 2.2136692399375434e+01 1.5992905383414486e+00 + 27 3.8782654410945074e+00 -2.5303982890265715e+01 9.1953584757540021e+00 + 28 -2.2926812341843778e+01 6.6323732958828492e+00 -1.4688469157588738e+01 + 29 1.9788745232395168e+01 1.8325155203574731e+01 6.0663293423586628e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml index f93f53861..75b2c40fb 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:33:03 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6275296350353301e+00 -2.6304782126946165e+01 9.9375753439373486e+00 28 -2.3342785641579749e+01 7.6604241443883918e+00 -1.5178331872815008e+01 29 1.9107819420519249e+01 1.8640384533413339e+01 5.2191851174899595e+00 -run_vdwl: 121.726025515065 -run_coul: 226.519738503438 +run_vdwl: 143.568625155378 +run_coul: 225.788771269962 run_stress: ! |2- - 2.3590204527232930e+02 2.1786393126646044e+02 3.4555759318888516e+02 -4.8490269243807084e+01 2.2044769313031058e+01 5.0730483761672595e+01 + 2.6294592507175832e+02 2.4453683519459824e+02 4.2104381906443354e+02 -4.9562449442644926e+01 2.3914873260658716e+01 5.6454583403156704e+01 run_forces: ! |2 - 1 1.5698395725255632e+00 3.4705556898309830e+01 4.0148491866687017e+01 - 2 1.8094875652358763e+01 1.2213630078485197e+01 -2.2605062548525957e+01 - 3 -1.8970349974421204e+01 -4.2047722899416314e+01 -1.6680481083122142e+01 - 4 -4.0730430309457528e+00 1.1077146510796576e+00 -3.1425822003985977e+00 - 5 -1.7469087373654009e+00 -1.3413009601224979e+00 5.6286880883787322e+00 - 6 -5.9373579553237860e+01 6.0904871315190007e+01 4.0745560815144948e+01 - 7 9.5244057493357503e-01 -1.6629783568045990e+01 -9.4751671277804491e+01 - 8 -5.2492178373685479e-02 8.2699339057486621e-01 3.5936464226984832e+01 - 9 1.0123263972386875e+01 2.3916817645843187e+00 3.8071793104925966e+01 - 10 4.2031045095599453e+01 -5.5269901976988372e+01 -1.7617529134712779e+01 - 11 -2.0952561898940187e+00 -1.6935815390946372e+00 -5.1512427397552836e+00 - 12 1.1255682986610847e+01 3.5014143175130537e+00 -2.7019794585819308e+00 - 13 4.1367916699665335e+00 -1.6074665893708489e+00 -2.5938631878569418e-01 - 14 -2.7211635378819987e+00 6.2995917240926558e-01 -4.1812665894137560e+00 - 15 1.3850219876212774e-01 4.3143675373140447e+00 6.6656278185689377e-01 - 16 3.2834764837529342e+01 -2.8386832139907479e+01 -6.7144586519238246e+01 - 17 -3.0854759910701400e+01 2.6148951816432504e+01 7.1307049881498244e+01 - 18 -2.1756807799842454e-01 4.3443600520466976e+00 -7.4141279833337226e+00 - 19 2.4152971434356765e+00 -4.3993293029158609e-01 5.6618008951619228e+00 - 20 -2.8256323844508793e+00 -3.8503505970848262e+00 3.6226831451184687e+00 - 21 -7.7979007642415388e+00 -6.3680923555356408e+00 2.2973695774273427e+01 - 22 -1.3550747679201207e+01 -4.3873029016943512e+00 -1.8044475303852892e+01 - 23 2.0908983051842561e+01 1.1185886498098533e+01 -4.3920068262594638e+00 - 24 6.0257564312999392e+00 -2.1770275627355794e+01 1.2877121314067731e+01 - 25 -2.0654126913428446e+01 6.5561692975690544e-01 -1.6655661388994947e+01 - 26 1.4031287466748058e+01 2.0860799256575362e+01 3.1333900079652808e+00 - 27 4.0575741331511228e+00 -2.1951936355694336e+01 7.9047074667543615e+00 - 28 -1.9856066053289215e+01 6.2812958827502214e+00 -1.2673997852836846e+01 - 29 1.6213490198280610e+01 1.5671380879482207e+01 4.7380478567989384e+00 + 1 -1.3621135640006612e+00 3.7949612217237110e+01 4.8882911770034070e+01 + 2 2.3313153869079933e+01 1.6527266977591971e+01 -2.8962794908453183e+01 + 3 -1.9562188749764410e+01 -5.0757827693454637e+01 -2.0130265312393753e+01 + 4 -4.2682567576263812e+00 1.1154383829571408e+00 -3.2314369033488046e+00 + 5 -1.8625495790390756e+00 -1.5514326346946348e+00 5.9921921274097478e+00 + 6 -6.9326246292616347e+01 7.2909926700545839e+01 6.2944603532443004e+01 + 7 3.4833019711274400e-02 -2.0499393819089175e+01 -1.2522826428680204e+02 + 8 9.0670490934900494e-01 -1.5919131756863347e+00 3.7346443269187354e+01 + 9 1.1981951807443503e+01 5.2954782869128554e+00 4.7222271778521652e+01 + 10 4.8287238754971433e+01 -6.2564954718226566e+01 -1.8223696195056686e+01 + 11 -2.0738817513021779e+00 -1.9562281165449606e+00 -5.4253443729976301e+00 + 12 1.1608249914843578e+01 3.5317862425447268e+00 -2.3163267756785313e+00 + 13 4.3427807771306544e+00 -1.7528747036760544e+00 -2.5693740566192669e-01 + 14 -2.8597828596444779e+00 7.1515084746908741e-01 -4.7421276602685118e+00 + 15 2.4127304065743677e-01 4.4180890865952271e+00 6.3290125489597160e-01 + 16 4.0230680375247310e+01 -3.2795677042674910e+01 -8.8232776641743996e+01 + 17 -3.8476989074957146e+01 3.0792148986909186e+01 9.2067865118055551e+01 + 18 3.0293665475176790e-01 4.7176245277810818e+00 -7.8157677161864418e+00 + 19 2.0278948817780891e+00 -6.9160950764535112e-01 5.5372100474801691e+00 + 20 -2.8995661963827475e+00 -3.9662484410974566e+00 4.0719654669423555e+00 + 21 -8.9496490210427968e+00 -8.3606434785434907e+00 2.7578426209972317e+01 + 22 -1.5805963565819596e+01 -4.8571767303174251e+00 -2.1662155130897567e+01 + 23 2.4340458644685043e+01 1.3631563845869001e+01 -5.4128684078510529e+00 + 24 5.5322204299737487e+00 -2.4563087082647591e+01 1.3798829950605292e+01 + 25 -2.1784355677693327e+01 1.0178271666357910e+00 -1.7475080985723537e+01 + 26 1.5689517589504657e+01 2.3291490240194342e+01 3.0620298201660923e+00 + 27 4.7041578022551178e+00 -2.6382316290516904e+01 9.9352117534137463e+00 + 28 -2.3442592997898139e+01 7.6899947560017203e+00 -1.5219901355058184e+01 + 29 1.9130083616404715e+01 1.8687985169570389e+01 5.2628819589945639e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_long_cs.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_long_cs.yaml index 096d70179..f4ee478ef 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_long_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_long_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 15:41:08 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6275333879969409e+00 -2.6304806009769145e+01 9.9375839812325601e+00 28 -2.3342801583992202e+01 7.6604323600981470e+00 -1.5178343041534969e+01 29 1.9107831279492629e+01 1.8640399948088248e+01 5.2191877728446663e+00 -run_vdwl: 121.726021397984 -run_coul: 226.519864227088 +run_vdwl: 143.568625105105 +run_coul: 225.788913139166 run_stress: ! |2- - 2.3590210804280926e+02 2.1786395843908812e+02 3.4555764036774764e+02 -4.8490237619585969e+01 2.2044782891695231e+01 5.0730487177566317e+01 + 2.6294600325205585e+02 2.4453687085649130e+02 4.2104388324691058e+02 -4.9562411450219372e+01 2.3914891250634774e+01 5.6454585594366279e+01 run_forces: ! |2 - 1 1.5698367038652314e+00 3.4705555432477674e+01 4.0148495145485683e+01 - 2 1.8094877879300377e+01 1.2213629203816074e+01 -2.2605065528813306e+01 - 3 -1.8970349934787674e+01 -4.2047723164606872e+01 -1.6680481344594416e+01 - 4 -4.0730432213967767e+00 1.1077149988692201e+00 -3.1425821033544610e+00 - 5 -1.7469089033807963e+00 -1.3413006418074174e+00 5.6286881597925031e+00 - 6 -5.9373580253429608e+01 6.0904871533586139e+01 4.0745563464653024e+01 - 7 9.5244155104591166e-01 -1.6629783603845969e+01 -9.4751672087153182e+01 - 8 -5.2494535873200798e-02 8.2699275803757188e-01 3.5936460128389527e+01 - 9 1.0123265947958654e+01 2.3916801760091393e+00 3.8071798885035371e+01 - 10 4.2031045334951330e+01 -5.5269901646859410e+01 -1.7617529470189773e+01 - 11 -2.0952560506049047e+00 -1.6935810901655985e+00 -5.1512424096198437e+00 - 12 1.1255683815117536e+01 3.5014144406315308e+00 -2.7019802123955969e+00 - 13 4.1367919950050558e+00 -1.6074673508380461e+00 -2.5938596328607399e-01 - 14 -2.7211633893296785e+00 6.2995870272787413e-01 -4.1812670814343598e+00 - 15 1.3850283229350577e-01 4.3143678083771508e+00 6.6656311100920196e-01 - 16 3.2834765302797493e+01 -2.8386831969723996e+01 -6.7144588311733870e+01 - 17 -3.0854761903948553e+01 2.6148955671849190e+01 7.1307048710301942e+01 - 18 -2.1756733058960365e-01 4.3443553055098540e+00 -7.4141052350973782e+00 - 19 2.4152857869651942e+00 -4.3993995851680523e-01 5.6617861171893606e+00 - 20 -2.8256214275283784e+00 -3.8503388764478457e+00 3.6226748367146877e+00 - 21 -7.7979062187730026e+00 -6.3680975531159705e+00 2.2973713947406520e+01 - 22 -1.3550754213700873e+01 -4.3873045091728118e+00 -1.8044488138371928e+01 - 23 2.0908995062392187e+01 1.1185893435074707e+01 -4.3920121814613511e+00 - 24 6.0257608926219657e+00 -2.1770292188622655e+01 1.2877130609166661e+01 - 25 -2.0654137829320170e+01 6.5562003803256719e-01 -1.6655671026794312e+01 - 26 1.4031294179965156e+01 2.0860812951995253e+01 3.1333903652914961e+00 - 27 4.0575767962360931e+00 -2.1951954196875235e+01 7.9047134211113796e+00 - 28 -1.9856077043315821e+01 6.2813021056391332e+00 -1.2674005530868751e+01 - 29 1.6213498175463346e+01 1.5671392187965550e+01 4.7380497236212751e+00 + 1 -1.3621179935161061e+00 3.7949609083398094e+01 4.8882916683448194e+01 + 2 2.3313157642764963e+01 1.6527267456449952e+01 -2.8962799699254443e+01 + 3 -1.9562188655629967e+01 -5.0757827859916176e+01 -2.0130265487504900e+01 + 4 -4.2682569477759458e+00 1.1154387427015442e+00 -3.2314368063227725e+00 + 5 -1.8625497507048236e+00 -1.5514323023571639e+00 5.9921922168335291e+00 + 6 -6.9326247036478748e+01 7.2909927215703362e+01 6.2944608636106025e+01 + 7 3.4834006743257026e-02 -2.0499394237551297e+01 -1.2522826771903358e+02 + 8 9.0670162602859061e-01 -1.5919145762213782e+00 3.7346435607869722e+01 + 9 1.1981954628769937e+01 5.2954777599528189e+00 4.7222281478615329e+01 + 10 4.8287238948193796e+01 -6.2564954456691069e+01 -1.8223696640937831e+01 + 11 -2.0738816352271376e+00 -1.9562276020127676e+00 -5.4253440203788941e+00 + 12 1.1608250826207126e+01 3.5317863149695943e+00 -2.3163274490171739e+00 + 13 4.3427811451229781e+00 -1.7528754768371870e+00 -2.5693704713666604e-01 + 14 -2.8597827313709696e+00 7.1515038529699626e-01 -4.7421282313087456e+00 + 15 2.4127368836901122e-01 4.4180893728828448e+00 6.3290159302534132e-01 + 16 4.0230681360289417e+01 -3.2795677172964012e+01 -8.8232780165563540e+01 + 17 -3.8476991596183382e+01 3.0792153123776057e+01 9.2067865680237347e+01 + 18 3.0293539974833961e-01 4.7176178718949711e+00 -7.8157449200300952e+00 + 19 2.0278846657624059e+00 -6.9161558422871527e-01 5.5371962256703604e+00 + 20 -2.8995543750444202e+00 -3.9662357842445881e+00 4.0719561250490379e+00 + 21 -8.9496563121177104e+00 -8.3606512468006748e+00 2.7578450723258072e+01 + 22 -1.5805973197832641e+01 -4.8571789940455403e+00 -2.1662172820437682e+01 + 23 2.4340475593384308e+01 1.3631574004404172e+01 -5.4128752572344530e+00 + 24 5.5322253782341146e+00 -2.4563108956642964e+01 1.3798841861867489e+01 + 25 -2.1784370110463172e+01 1.0178308439258250e+00 -1.7475093482220196e+01 + 26 1.5689527341415724e+01 2.3291508692078978e+01 3.0620304334886712e+00 + 27 4.7041615929281395e+00 -2.6382340168097741e+01 9.9352203498613001e+00 + 28 -2.3442608955868842e+01 7.6900029712817490e+00 -1.5219912509634174e+01 + 29 1.9130095454251759e+01 1.8688000579894339e+01 5.2628846406847254e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml index 8082009c4..70a34e372 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 08:36:45 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -68,38 +68,38 @@ init_forces: ! |2 27 4.5726620680707963e+00 -2.6041323711122949e+01 9.8983244066517280e+00 28 -2.3279647768186493e+01 7.5396562185096743e+00 -1.5121646456861377e+01 29 1.9119389758156409e+01 1.8491995912109910e+01 5.2026425513360959e+00 -run_vdwl: 121.764878699463 -run_coul: 227.174468571459 +run_vdwl: 143.569113032674 +run_coul: 226.430521327767 run_stress: ! |2- - 2.3542362350854432e+02 2.1732857470978792e+02 3.4472872871544200e+02 -4.8097476436750938e+01 2.2369545314645602e+01 5.0594671233200948e+01 + 2.6243406797837577e+02 2.4399058654210910e+02 4.2011422155477402e+02 -4.9244420696743255e+01 2.4198040116799781e+01 5.6330831633160550e+01 run_forces: ! |2 - 1 1.6703129529188125e+00 3.4615582607988060e+01 4.0156155487042973e+01 - 2 1.8087345537075151e+01 1.2247204990680453e+01 -2.2665758471508582e+01 - 3 -1.8969092698810176e+01 -4.2052594493213547e+01 -1.6679347422023483e+01 - 4 -4.0762667520270668e+00 1.1088205577625916e+00 -3.1416367224964117e+00 - 5 -1.7678353724119078e+00 -1.3301897054473499e+00 5.6330370956881159e+00 - 6 -5.9319268507752213e+01 6.0841537480092008e+01 4.0526115553361379e+01 - 7 8.8197849278017915e-01 -1.6601884583255984e+01 -9.4662430990127262e+01 - 8 -9.0664542798844002e-03 8.3849196112176427e-01 3.6094764212959127e+01 - 9 1.0122083928370071e+01 2.3532006764935063e+00 3.8098586062348510e+01 - 10 4.2012980601056533e+01 -5.5259625245129641e+01 -1.7635039095700673e+01 - 11 -2.1198968586681946e+00 -1.6662336986889545e+00 -5.1830106293186446e+00 - 12 1.1303967282261448e+01 3.4217489934165921e+00 -2.5868228383514604e+00 - 13 4.1464470139290048e+00 -1.5944726495865951e+00 -2.8930972653980136e-01 - 14 -2.7453263746156091e+00 6.5881424768576058e-01 -4.2024319297101744e+00 - 15 1.2798850726417882e-01 4.3346698713149454e+00 6.2227752479031195e-01 - 16 3.2800909379922267e+01 -2.8372092411729398e+01 -6.7005163968173846e+01 - 17 -3.0833546436884490e+01 2.6162284883577250e+01 7.1085692250425879e+01 - 18 -2.6243189073280659e-01 4.4893832376191423e+00 -7.7149617889642652e+00 - 19 2.4655330016857104e+00 -4.9990485216883768e-01 5.8662127723815907e+00 - 20 -2.8386657032986222e+00 -3.9057484936458429e+00 3.7658352426302830e+00 - 21 -7.8025665187305808e+00 -6.1434141193403526e+00 2.2713506699381345e+01 - 22 -1.3535975224784096e+01 -4.4827843399063267e+00 -1.7867515969273331e+01 - 23 2.0843097978764426e+01 1.1110852346733548e+01 -4.2354694728748186e+00 - 24 6.0068797217371701e+00 -2.1571306718840283e+01 1.2644273378870498e+01 - 25 -2.0661723875999876e+01 5.7300982588680638e-01 -1.6538850991387701e+01 - 26 1.4038902406895604e+01 2.0734396551962067e+01 3.2302015846198913e+00 - 27 4.0044507075362379e+00 -2.1705500021459482e+01 7.8803384605089679e+00 - 28 -1.9812970429932285e+01 6.1603163670174572e+00 -1.2629825517655037e+01 - 29 1.6241755586731013e+01 1.5535436733060664e+01 4.7205792090965915e+00 + 1 -1.2757811586901033e+00 3.7859462759891258e+01 4.8904192089977769e+01 + 2 2.3312134316199352e+01 1.6557043899045592e+01 -2.9031785921231187e+01 + 3 -1.9560987841087197e+01 -5.0758214561694849e+01 -2.0126870657196012e+01 + 4 -4.2710432463755845e+00 1.1163696415920661e+00 -3.2310236254547133e+00 + 5 -1.8829891977115301e+00 -1.5409024501890234e+00 5.9959142021752525e+00 + 6 -6.9291121840975720e+01 7.2859207861739023e+01 6.2672849487117389e+01 + 7 -3.3941432761874890e-02 -2.0467049714704427e+01 -1.2508820038694822e+02 + 8 9.7135692686096398e-01 -1.6000872263659844e+00 3.7516654340785408e+01 + 9 1.1976273723630957e+01 5.2591957010810928e+00 4.7233848287395091e+01 + 10 4.8269243322479355e+01 -6.2551286279213876e+01 -1.8238632230659217e+01 + 11 -2.0979072646781423e+00 -1.9308882726569763e+00 -5.4574243116843952e+00 + 12 1.1655527136541025e+01 3.4520074447708269e+00 -2.1993967967178509e+00 + 13 4.3520048271367813e+00 -1.7403439483354903e+00 -2.8651463618419420e-01 + 14 -2.8842819209934296e+00 7.4403142783289633e-01 -4.7663807596456191e+00 + 15 2.3077474615461135e-01 4.4394965065462992e+00 5.8889096278368569e-01 + 16 4.0184896402242984e+01 -3.2777341577015157e+01 -8.8054552212989506e+01 + 17 -3.8442155564387306e+01 3.0797081679351834e+01 9.1811213465508317e+01 + 18 2.5713313688813649e-01 4.8629906374393537e+00 -8.1283626782215297e+00 + 19 2.0750303475282221e+00 -7.5370892142132540e-01 5.7450962880204601e+00 + 20 -2.9072069291195777e+00 -4.0198888705957714e+00 4.2225931479049201e+00 + 21 -8.9413063712256964e+00 -8.1291836461180562e+00 2.7285555741041787e+01 + 22 -1.5776922394482424e+01 -4.9460395173332472e+00 -2.1461188288743791e+01 + 23 2.4250997390270030e+01 1.3540687199627147e+01 -5.2512797401613120e+00 + 24 5.5054521106192453e+00 -2.4337357824659158e+01 1.3547435998766442e+01 + 25 -2.1770108961369576e+01 9.3063752713023895e-01 -1.7341313112832811e+01 + 26 1.5683506058105445e+01 2.3144091643812548e+01 3.1596020672958836e+00 + 27 4.6490439783719744e+00 -2.6119205046887529e+01 9.8966843536694249e+00 + 28 -2.3379575395739540e+01 7.5693626896076207e+00 -1.5163667144540781e+01 + 29 1.9141955096568608e+01 1.8539831237723078e+01 5.2460620707692787e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml index c5aa956f6..b78affb56 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -68,38 +68,38 @@ init_forces: ! |2 27 4.5726620680707963e+00 -2.6041323711122949e+01 9.8983244066517280e+00 28 -2.3279647768186493e+01 7.5396562185096743e+00 -1.5121646456861377e+01 29 1.9119389758156409e+01 1.8491995912109910e+01 5.2026425513360959e+00 -run_vdwl: 121.764878699463 -run_coul: 227.174468571459 +run_vdwl: 143.569113032674 +run_coul: 226.430521327767 run_stress: ! |2- - 2.3542362350854432e+02 2.1732857470978792e+02 3.4472872871544200e+02 -4.8097476436750938e+01 2.2369545314645602e+01 5.0594671233200948e+01 + 2.6243406797837577e+02 2.4399058654210910e+02 4.2011422155477402e+02 -4.9244420696743255e+01 2.4198040116799781e+01 5.6330831633160550e+01 run_forces: ! |2 - 1 1.6703129529188125e+00 3.4615582607988060e+01 4.0156155487042973e+01 - 2 1.8087345537075151e+01 1.2247204990680453e+01 -2.2665758471508582e+01 - 3 -1.8969092698810176e+01 -4.2052594493213547e+01 -1.6679347422023483e+01 - 4 -4.0762667520270668e+00 1.1088205577625916e+00 -3.1416367224964117e+00 - 5 -1.7678353724119078e+00 -1.3301897054473499e+00 5.6330370956881159e+00 - 6 -5.9319268507752213e+01 6.0841537480092008e+01 4.0526115553361379e+01 - 7 8.8197849278017915e-01 -1.6601884583255984e+01 -9.4662430990127262e+01 - 8 -9.0664542798844002e-03 8.3849196112176427e-01 3.6094764212959127e+01 - 9 1.0122083928370071e+01 2.3532006764935063e+00 3.8098586062348510e+01 - 10 4.2012980601056533e+01 -5.5259625245129641e+01 -1.7635039095700673e+01 - 11 -2.1198968586681946e+00 -1.6662336986889545e+00 -5.1830106293186446e+00 - 12 1.1303967282261448e+01 3.4217489934165921e+00 -2.5868228383514604e+00 - 13 4.1464470139290048e+00 -1.5944726495865951e+00 -2.8930972653980136e-01 - 14 -2.7453263746156091e+00 6.5881424768576058e-01 -4.2024319297101744e+00 - 15 1.2798850726417882e-01 4.3346698713149454e+00 6.2227752479031195e-01 - 16 3.2800909379922267e+01 -2.8372092411729398e+01 -6.7005163968173846e+01 - 17 -3.0833546436884490e+01 2.6162284883577250e+01 7.1085692250425879e+01 - 18 -2.6243189073280659e-01 4.4893832376191423e+00 -7.7149617889642652e+00 - 19 2.4655330016857104e+00 -4.9990485216883768e-01 5.8662127723815907e+00 - 20 -2.8386657032986222e+00 -3.9057484936458429e+00 3.7658352426302830e+00 - 21 -7.8025665187305808e+00 -6.1434141193403526e+00 2.2713506699381345e+01 - 22 -1.3535975224784096e+01 -4.4827843399063267e+00 -1.7867515969273331e+01 - 23 2.0843097978764426e+01 1.1110852346733548e+01 -4.2354694728748186e+00 - 24 6.0068797217371701e+00 -2.1571306718840283e+01 1.2644273378870498e+01 - 25 -2.0661723875999876e+01 5.7300982588680638e-01 -1.6538850991387701e+01 - 26 1.4038902406895604e+01 2.0734396551962067e+01 3.2302015846198913e+00 - 27 4.0044507075362379e+00 -2.1705500021459482e+01 7.8803384605089679e+00 - 28 -1.9812970429932285e+01 6.1603163670174572e+00 -1.2629825517655037e+01 - 29 1.6241755586731013e+01 1.5535436733060664e+01 4.7205792090965915e+00 + 1 -1.2757811586901033e+00 3.7859462759891258e+01 4.8904192089977769e+01 + 2 2.3312134316199352e+01 1.6557043899045592e+01 -2.9031785921231187e+01 + 3 -1.9560987841087197e+01 -5.0758214561694849e+01 -2.0126870657196012e+01 + 4 -4.2710432463755845e+00 1.1163696415920661e+00 -3.2310236254547133e+00 + 5 -1.8829891977115301e+00 -1.5409024501890234e+00 5.9959142021752525e+00 + 6 -6.9291121840975720e+01 7.2859207861739023e+01 6.2672849487117389e+01 + 7 -3.3941432761874890e-02 -2.0467049714704427e+01 -1.2508820038694822e+02 + 8 9.7135692686096398e-01 -1.6000872263659844e+00 3.7516654340785408e+01 + 9 1.1976273723630957e+01 5.2591957010810928e+00 4.7233848287395091e+01 + 10 4.8269243322479355e+01 -6.2551286279213876e+01 -1.8238632230659217e+01 + 11 -2.0979072646781423e+00 -1.9308882726569763e+00 -5.4574243116843952e+00 + 12 1.1655527136541025e+01 3.4520074447708269e+00 -2.1993967967178509e+00 + 13 4.3520048271367813e+00 -1.7403439483354903e+00 -2.8651463618419420e-01 + 14 -2.8842819209934296e+00 7.4403142783289633e-01 -4.7663807596456191e+00 + 15 2.3077474615461135e-01 4.4394965065462992e+00 5.8889096278368569e-01 + 16 4.0184896402242984e+01 -3.2777341577015157e+01 -8.8054552212989506e+01 + 17 -3.8442155564387306e+01 3.0797081679351834e+01 9.1811213465508317e+01 + 18 2.5713313688813649e-01 4.8629906374393537e+00 -8.1283626782215297e+00 + 19 2.0750303475282221e+00 -7.5370892142132540e-01 5.7450962880204601e+00 + 20 -2.9072069291195777e+00 -4.0198888705957714e+00 4.2225931479049201e+00 + 21 -8.9413063712256964e+00 -8.1291836461180562e+00 2.7285555741041787e+01 + 22 -1.5776922394482424e+01 -4.9460395173332472e+00 -2.1461188288743791e+01 + 23 2.4250997390270030e+01 1.3540687199627147e+01 -5.2512797401613120e+00 + 24 5.5054521106192453e+00 -2.4337357824659158e+01 1.3547435998766442e+01 + 25 -2.1770108961369576e+01 9.3063752713023895e-01 -1.7341313112832811e+01 + 26 1.5683506058105445e+01 2.3144091643812548e+01 3.1596020672958836e+00 + 27 4.6490439783719744e+00 -2.6119205046887529e+01 9.8966843536694249e+00 + 28 -2.3379575395739540e+01 7.5693626896076207e+00 -1.5163667144540781e+01 + 29 1.9141955096568608e+01 1.8539831237723078e+01 5.2460620707692787e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml index a3c62dca7..5e89b1ddf 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 15:41:16 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6275295196719846e+00 -2.6304781961228922e+01 9.9375751500151814e+00 28 -2.3342788353122209e+01 7.6604232094857601e+00 -1.5178333088875645e+01 29 1.9107822043893268e+01 1.8640385042681956e+01 5.2191866233149646e+00 -run_vdwl: 121.72602510166 -run_coul: 226.519774165273 +run_vdwl: 143.568625150522 +run_coul: 225.788808998821 run_stress: ! |2- - 2.3590206455782524e+02 2.1786393554347234e+02 3.4555760593485883e+02 -4.8490263782953043e+01 2.2044773916959052e+01 5.0730484710634187e+01 + 2.6294594847725642e+02 2.4453683914902376e+02 4.2104383378157951e+02 -4.9562445401925707e+01 2.3914879352797943e+01 5.6454589328617381e+01 run_forces: ! |2 - 1 1.5698380426262339e+00 3.4705555983414101e+01 4.0148491150528848e+01 - 2 1.8094875195460087e+01 1.2213629349120797e+01 -2.2605061326560314e+01 - 3 -1.8970349847156903e+01 -4.2047723119965269e+01 -1.6680481248003424e+01 - 4 -4.0730430515537330e+00 1.1077151965771483e+00 -3.1425820623845948e+00 - 5 -1.7469084072611365e+00 -1.3412999918968127e+00 5.6286882795018061e+00 - 6 -5.9373580190201231e+01 6.0904871373123008e+01 4.0745559922898323e+01 - 7 9.5244031569426668e-01 -1.6629782817584864e+01 -9.4751673269733672e+01 - 8 -5.2493033632859135e-02 8.2699289311857904e-01 3.5936467383090253e+01 - 9 1.0123265560129658e+01 2.3916809470760430e+00 3.8071794408270385e+01 - 10 4.2031045152490051e+01 -5.5269901461148180e+01 -1.7617529778225279e+01 - 11 -2.0952562172079094e+00 -1.6935810862928227e+00 -5.1512427021700233e+00 - 12 1.1255683391783911e+01 3.5014142496916238e+00 -2.7019805744032594e+00 - 13 4.1367917904389815e+00 -1.6074667147240793e+00 -2.5938611866422112e-01 - 14 -2.7211639170322091e+00 6.2995899971405989e-01 -4.1812663995873720e+00 - 15 1.3850198820589768e-01 4.3143672379574030e+00 6.6656325463887756e-01 - 16 3.2834765942862944e+01 -2.8386833163892344e+01 -6.7144586125291966e+01 - 17 -3.0854760170167282e+01 2.6148952918424637e+01 7.1307049320266643e+01 - 18 -2.1756684303242008e-01 4.3443608150631192e+00 -7.4141300753157147e+00 - 19 2.4152948496139519e+00 -4.3993465704734075e-01 5.6618010839710147e+00 - 20 -2.8256302650142282e+00 -3.8503490593732099e+00 3.6226838902522798e+00 - 21 -7.7979010596755893e+00 -6.3680915921891454e+00 2.2973695904074496e+01 - 22 -1.3550749996734330e+01 -4.3873044494246489e+00 -1.8044476425314251e+01 - 23 2.0908985698673831e+01 1.1185887360008451e+01 -4.3920058684199237e+00 - 24 6.0257563207762432e+00 -2.1770275213677817e+01 1.2877120062186021e+01 - 25 -2.0654128498856888e+01 6.5561565722712545e-01 -1.6655661876851308e+01 - 26 1.4031289401144244e+01 2.0860800314907351e+01 3.1333915981632487e+00 - 27 4.0575740027613083e+00 -2.1951935650781735e+01 7.9047069807695820e+00 - 28 -1.9856068499319342e+01 6.2812947369436456e+00 -1.2673998851417471e+01 - 29 1.6213492344184434e+01 1.5671380945631144e+01 4.7380494637310022e+00 + 1 -1.3621151007759384e+00 3.7949611681165642e+01 4.8882910701267754e+01 + 2 2.3313153075555253e+01 1.6527266162744677e+01 -2.8962793540179902e+01 + 3 -1.9562188637517966e+01 -5.0757827783982343e+01 -2.0130265405492420e+01 + 4 -4.2682568034340393e+00 1.1154389084555678e+00 -3.2314366998201445e+00 + 5 -1.8625493970002989e+00 -1.5514316497597296e+00 5.9921923115893669e+00 + 6 -6.9326247061858254e+01 7.2909927111590818e+01 6.2944602193560634e+01 + 7 3.4832663581628100e-02 -2.0499393301450638e+01 -1.2522826643820707e+02 + 8 9.0670403346768502e-01 -1.5919138753711515e+00 3.7346445794995468e+01 + 9 1.1981952988875207e+01 5.2954780010491298e+00 4.7222273270737610e+01 + 10 4.8287238827624648e+01 -6.2564954274070864e+01 -1.8223696863479493e+01 + 11 -2.0738818091213398e+00 -1.9562274367942059e+00 -5.4253443096505780e+00 + 12 1.1608251223594838e+01 3.5317859313813327e+00 -2.3163278555520344e+00 + 13 4.3427809492359231e+00 -1.7528748909332694e+00 -2.5693726482457357e-01 + 14 -2.8597830375190867e+00 7.1515056834637325e-01 -4.7421273851472252e+00 + 15 2.4127304609604885e-01 4.4180887752398439e+00 6.3290182085992674e-01 + 16 4.0230681127975522e+01 -3.2795677718536780e+01 -8.8232776722459903e+01 + 17 -3.8476988589339669e+01 3.0792149589958601e+01 9.2067864482403124e+01 + 18 3.0293743026365305e-01 4.7176246301139759e+00 -7.8157692762739392e+00 + 19 2.0278927660766186e+00 -6.9161128852287146e-01 5.5372099589687478e+00 + 20 -2.8995643155647226e+00 -3.9662472043348713e+00 4.0719664982348496e+00 + 21 -8.9496495866893770e+00 -8.3606427522374158e+00 2.7578427002265748e+01 + 22 -1.5805965794056222e+01 -4.8571783278624654e+00 -2.1662156654758807e+01 + 23 2.4340461414385292e+01 1.3631564888989741e+01 -5.4128676690577224e+00 + 24 5.5322204891796574e+00 -2.4563086688211044e+01 1.3798829395773595e+01 + 25 -2.1784357359702700e+01 1.0178260747662937e+00 -1.7475081320671158e+01 + 26 1.5689519749259118e+01 2.3291491650045245e+01 3.0620313921466829e+00 + 27 4.7041574213610797e+00 -2.6382316193081344e+01 9.9352115707765005e+00 + 28 -2.3442595887193505e+01 7.6899937910318199e+00 -1.5219902699160384e+01 + 29 1.9130086173240947e+01 1.8687985620269931e+01 5.2628837111553093e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_table_cs.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_table_cs.yaml index 0fb00390f..800e9fe8c 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_table_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_table_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 15:41:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6275334941967543e+00 -2.6304805910222296e+01 9.9375838993500700e+00 28 -2.3342806294704374e+01 7.6604309199589586e+00 -1.5178345228324231e+01 29 1.9107836010950663e+01 1.8640401281202131e+01 5.2191900134286620e+00 -run_vdwl: 121.726020551997 -run_coul: 226.519891527114 +run_vdwl: 143.56862509507 +run_coul: 225.788942792757 run_stress: ! |2- - 2.3590213320105298e+02 2.1786398072409648e+02 3.4555765831337095e+02 -4.8490232761656124e+01 2.2044798503485261e+01 5.0730484185008791e+01 + 2.6294603382624263e+02 2.4453689432875228e+02 4.2104390406708438e+02 -4.9562407809564661e+01 2.3914908449773719e+01 5.6454587144561422e+01 run_forces: ! |2 - 1 1.5698351611194183e+00 3.4705553776289968e+01 4.0148494651537312e+01 - 2 1.8094878098906385e+01 1.2213631773040380e+01 -2.2605064731153583e+01 - 3 -1.8970349854476876e+01 -4.2047723222875746e+01 -1.6680481370294771e+01 - 4 -4.0730430941125020e+00 1.1077152158174526e+00 -3.1425820973356440e+00 - 5 -1.7469084162435471e+00 -1.3413000117496374e+00 5.6286883327968571e+00 - 6 -5.9373581582284892e+01 6.0904872991287156e+01 4.0745561282511730e+01 - 7 9.5244044268409656e-01 -1.6629783269354995e+01 -9.4751675379705475e+01 - 8 -5.2493263464385931e-02 8.2699080659578028e-01 3.5936462900284091e+01 - 9 1.0123266774078781e+01 2.3916821855713142e+00 3.8071799624151225e+01 - 10 4.2031045467708729e+01 -5.5269901926409460e+01 -1.7617529988444300e+01 - 11 -2.0952561704599284e+00 -1.6935809829444961e+00 -5.1512425273817612e+00 - 12 1.1255683037659663e+01 3.5014137616697600e+00 -2.7019801840306688e+00 - 13 4.1367924272221339e+00 -1.6074669601497877e+00 -2.5938612593137478e-01 - 14 -2.7211641736513119e+00 6.2995908596480965e-01 -4.1812670667980667e+00 - 15 1.3850192107718087e-01 4.3143680324661409e+00 6.6656344056949879e-01 - 16 3.2834766603049488e+01 -2.8386833646881232e+01 -6.7144587837832404e+01 - 17 -3.0854760806896543e+01 2.6148953355815848e+01 7.1307051071989193e+01 - 18 -2.1756644257912217e-01 4.3443558484688607e+00 -7.4141063956992026e+00 - 19 2.4152819132912429e+00 -4.3994318940508109e-01 5.6617857267410594e+00 - 20 -2.8256177155624167e+00 -3.8503357047228968e+00 3.6226757330654120e+00 - 21 -7.7979060759600456e+00 -6.3680972163068592e+00 2.2973713283248994e+01 - 22 -1.3550758515675300e+01 -4.3873066049378355e+00 -1.8044489585951414e+01 - 23 2.0908999210401618e+01 1.1185895163314989e+01 -4.3920100694955240e+00 - 24 6.0257606039077398e+00 -2.1770291575230864e+01 1.2877129718840269e+01 - 25 -2.0654141227382446e+01 6.5561755638050379e-01 -1.6655672718417502e+01 - 26 1.4031297826602067e+01 2.0860814734922215e+01 3.1333927179461671e+00 - 27 4.0575768351367785e+00 -2.1951953181136162e+01 7.9047129234045492e+00 - 28 -1.9856080995920323e+01 6.2813004282678371e+00 -1.2674007240243292e+01 - 29 1.6213502011824300e+01 1.5671392776232038e+01 4.7380519116286353e+00 + 1 -1.3621199027493425e+00 3.7949607702924197e+01 4.8882916313404522e+01 + 2 2.3313157867950807e+01 1.6527270113321286e+01 -2.8962799161736825e+01 + 3 -1.9562188566504478e+01 -5.0757827749580272e+01 -2.0130265427121511e+01 + 4 -4.2682568521136668e+00 1.1154389220504597e+00 -3.2314367344437489e+00 + 5 -1.8625494099162438e+00 -1.5514316696579493e+00 5.9921923774469192e+00 + 6 -6.9326248846010301e+01 7.2909929345114691e+01 6.2944605650407588e+01 + 7 3.4832843392563942e-02 -2.0499394221925314e+01 -1.2522827101288422e+02 + 8 9.0670345517928519e-01 -1.5919171711785822e+00 3.7346438046271523e+01 + 9 1.1981955007348237e+01 5.2954801641556903e+00 4.7222282191608592e+01 + 10 4.8287238944148442e+01 -6.2564954573007540e+01 -1.8223697111704148e+01 + 11 -2.0738817614556897e+00 -1.9562273188610155e+00 -5.4253441161365323e+00 + 12 1.1608250811418873e+01 3.5317854110260010e+00 -2.3163273598373202e+00 + 13 4.3427816721122996e+00 -1.7528751754554350e+00 -2.5693727825179619e-01 + 14 -2.8597833269081243e+00 7.1515062618017067e-01 -4.7421281353057756e+00 + 15 2.4127302503213674e-01 4.4180895223899936e+00 6.3290208861055530e-01 + 16 4.0230682454575309e+01 -3.2795678645593668e+01 -8.8232780243079972e+01 + 17 -3.8476989915912796e+01 3.0792150517113221e+01 9.2067868003188195e+01 + 18 3.0293580773856771e-01 4.7176178480952675e+00 -7.8157457052082124e+00 + 19 2.0278808012092422e+00 -6.9161896428255576e-01 5.5371955023537645e+00 + 20 -2.8995507282470983e+00 -3.9662327464831852e+00 4.0719573840566738e+00 + 21 -8.9496565375797150e+00 -8.3606510250205250e+00 2.7578451026930235e+01 + 22 -1.5805977447169866e+01 -4.8571811726218810e+00 -2.1662174875834740e+01 + 23 2.4340480018363444e+01 1.3631576006586620e+01 -5.4128734726359378e+00 + 24 5.5322254144434551e+00 -2.4563108694478935e+01 1.3798841905404794e+01 + 25 -2.1784373830993722e+01 1.0178286910853316e+00 -1.7475095172557069e+01 + 26 1.5689531295191534e+01 2.3291511039902296e+01 3.0620327342993763e+00 + 27 4.7041614326790899e+00 -2.6382340132449535e+01 9.9352202778448717e+00 + 28 -2.3442613842200721e+01 7.6900014985529461e+00 -1.5219914823759163e+01 + 29 1.9130100116978522e+01 1.8688001852098214e+01 5.2628871286693109e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_long_coul_long.yaml b/unittest/force-styles/tests/mol-pair-buck_long_coul_long.yaml index 55a6a2e8a..0cf95ba93 100644 --- a/unittest/force-styles/tests/mol-pair-buck_long_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_long_coul_long.yaml @@ -1,7 +1,7 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 16:17:55 202 -epsilon: 2.0e-9 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 +epsilon: 2e-09 prerequisites: ! | atom full pair buck/long/coul/long @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6260665161027301e+00 -2.6306305085064849e+01 9.9386139884880809e+00 28 -2.3342848199176302e+01 7.6603913259359970e+00 -1.5178322120241885e+01 29 1.9107789198971762e+01 1.8640339901000139e+01 5.2192425301227203e+00 -run_vdwl: 121.820811602613 -run_coul: 226.519747786328 +run_vdwl: 143.664033848008 +run_coul: 225.788771362758 run_stress: ! |2- - 2.3593826615226715e+02 2.1792041311943646e+02 3.4560172019637611e+02 -4.8502991882245020e+01 2.2039232897011228e+01 5.0726515973183886e+01 + 2.6298251505235868e+02 2.4459390353665563e+02 4.2108843574777688e+02 -4.9575317711225544e+01 2.3909358907758179e+01 5.6450588933021592e+01 run_forces: ! |2 - 1 1.5666349315550070e+00 3.4710341729971233e+01 4.0150016624471270e+01 - 2 1.8094852293428666e+01 1.2213721963181198e+01 -2.2605094931423100e+01 - 3 -1.8972759900386876e+01 -4.2046446200548125e+01 -1.6680121843579688e+01 - 4 -4.0732080275625835e+00 1.1077591067974766e+00 -3.1426639160757777e+00 - 5 -1.7470375420510103e+00 -1.3412893586407983e+00 5.6287509744521405e+00 - 6 -5.9374893247539525e+01 6.0904801984442493e+01 4.0744682370820570e+01 - 7 9.5035278476552676e-01 -1.6630191907063832e+01 -9.4755377787677503e+01 - 8 -5.2839734253333180e-02 8.2576919029247553e-01 3.5936866412989822e+01 - 9 1.0123301274237967e+01 2.3916603464783495e+00 3.8071865058884910e+01 - 10 4.2032052513924498e+01 -5.5271381220551213e+01 -1.7617825372285733e+01 - 11 -2.0952499237216089e+00 -1.6936830167814483e+00 -5.1513365645737856e+00 - 12 1.1258226282283310e+01 3.5013170056485041e+00 -2.7030060623201391e+00 - 13 4.1369567084763776e+00 -1.6074660616626129e+00 -2.5942400910620228e-01 - 14 -2.7210873109150038e+00 6.2997282675475852e-01 -4.1814031245502870e+00 - 15 1.3864535151294002e-01 4.3144196624027567e+00 6.6650913421220614e-01 - 16 3.2836204918206377e+01 -2.8388909520897705e+01 -6.7143482381600165e+01 - 17 -3.0853057205736906e+01 2.6146330027088322e+01 7.1310453964177825e+01 - 18 -2.1605114860824609e-01 4.3473937723876128e+00 -7.4170087655066741e+00 - 19 2.4153215918830799e+00 -4.3985844086151810e-01 5.6616775862947568e+00 - 20 -2.8256043659788608e+00 -3.8503050834533785e+00 3.6226183681059667e+00 - 21 -7.7964610147496218e+00 -6.3696771205908504e+00 2.2972351483612805e+01 - 22 -1.3550751699151741e+01 -4.3873374684600659e+00 -1.8044545103541214e+01 - 23 2.0909059754303637e+01 1.1185892669525137e+01 -4.3920460191479851e+00 - 24 6.0266164809593787e+00 -2.1768589654262495e+01 1.2879762843410042e+01 - 25 -2.0654046618469081e+01 6.5567897619738069e-01 -1.6655521944235243e+01 - 26 1.4031376619245492e+01 2.0860933227930797e+01 3.1334455011603048e+00 - 27 4.0561477120321729e+00 -2.1953415241922812e+01 7.9057583516568517e+00 - 28 -1.9856121989870729e+01 6.2812691511501226e+00 -1.2673991867254060e+01 - 29 1.6213420512180701e+01 1.5671288655448231e+01 4.7380910186280625e+00 + 1 -1.3652720446656716e+00 3.7954572140886413e+01 4.8884538610219984e+01 + 2 2.3313139975676521e+01 1.6527407427439215e+01 -2.8962850556748574e+01 + 3 -1.9564712492477259e+01 -5.0756725254438585e+01 -2.0129969655577696e+01 + 4 -4.2684079132961532e+00 1.1154799200799748e+00 -3.2315050710172626e+00 + 5 -1.8626808257808209e+00 -1.5514191365901677e+00 5.9922525317567326e+00 + 6 -6.9327725793824527e+01 7.2910029709312454e+01 6.2943842478017125e+01 + 7 3.2729296511785085e-02 -2.0499844250721825e+01 -1.2523227297784275e+02 + 8 9.0645129380789513e-01 -1.5931691793865552e+00 3.7347008229957787e+01 + 9 1.1981987334884325e+01 5.2954472303848910e+00 4.7222348781695430e+01 + 10 4.8288299691503205e+01 -6.2566569339379377e+01 -1.8224017564064091e+01 + 11 -2.0738715074249523e+00 -1.9563279663018796e+00 -5.4254319559511295e+00 + 12 1.1610862764961743e+01 3.5316918655662044e+00 -2.3173751221395720e+00 + 13 4.3429255708311079e+00 -1.7528672352564680e+00 -2.5697582206668895e-01 + 14 -2.8597049731416870e+00 7.1516577588292751e-01 -4.7422665041230756e+00 + 15 2.4141777805199607e-01 4.4181497005137018e+00 6.3284863696190541e-01 + 16 4.0232203794586695e+01 -3.2797821300800962e+01 -8.8231810120087630e+01 + 17 -3.8475340336751799e+01 3.0789552016439433e+01 9.2071434975793437e+01 + 18 3.0444737165682245e-01 4.7206637253266726e+00 -7.8186561033362132e+00 + 19 2.0279176824528000e+00 -6.9153978261739135e-01 5.5370947284278174e+00 + 20 -2.8995246410850308e+00 -3.9661906680569294e+00 4.0718950075472362e+00 + 21 -8.9482093919054275e+00 -8.3621998308864107e+00 2.7577075884535351e+01 + 22 -1.5805953773942205e+01 -4.8572145959519402e+00 -2.1662217002199810e+01 + 23 2.4340519096091096e+01 1.3631551507334764e+01 -5.4129063248356344e+00 + 24 5.5331809337240436e+00 -2.4561349924805576e+01 1.3801516502339091e+01 + 25 -2.1784339531775434e+01 1.0179046192128527e+00 -1.7474990059161328e+01 + 26 1.5689568156175840e+01 2.3291559483700894e+01 3.0620904827826170e+00 + 27 4.7026950421097862e+00 -2.6383838671315459e+01 9.9362503961500153e+00 + 28 -2.3442655453950238e+01 7.6899620172100764e+00 -1.5219891622806223e+01 + 29 1.9130052896995540e+01 1.8687939997219068e+01 5.2629392157731738e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_long_coul_off.yaml b/unittest/force-styles/tests/mol-pair-buck_long_coul_off.yaml index 10f203e9c..1c8ab223e 100644 --- a/unittest/force-styles/tests/mol-pair-buck_long_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_long_coul_off.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 23:02:01 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 2e-09 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 6.6471213343142246e+00 -3.6339388133461938e+01 1.3617344872617608e+01 28 -2.7672164019886065e+01 1.1892727087278390e+01 -1.8723445616363609e+01 29 2.1029474237843658e+01 2.4449952815322550e+01 5.1039469596637526e+00 -run_vdwl: 120.48447237796 +run_vdwl: 143.647338332642 run_coul: 0 run_stress: ! |2- - 2.5560791695843616e+02 2.5955067689101872e+02 3.7929520405743182e+02 -5.4344098211783205e+01 2.7323388083588551e+01 4.1736578225862743e+01 + 2.8581008766933104e+02 2.8744003840903019e+02 4.5973758784231285e+02 -5.4055502782848421e+01 3.0493928735622941e+01 4.6838674166921798e+01 run_forces: ! |2 - 1 -9.5423782156393466e-01 3.5355849554383006e+01 3.9459261148114848e+01 - 2 1.8087871295661856e+01 1.4881519859391114e+01 -2.0866843680067909e+01 - 3 -1.9027922286140750e+01 -4.1962668972973702e+01 -1.6664111490158596e+01 - 4 -3.9861577392755856e+00 1.0789007349388922e+00 -2.9030806983555042e+00 - 5 -1.2024986283474461e+00 -2.0086759088416675e+00 5.6819366740049313e+00 - 6 -6.0411079021207421e+01 6.4308036846356444e+01 4.2295934042357331e+01 - 7 9.3411892973315525e-01 -1.7314556167603708e+01 -9.7145242612140095e+01 - 8 8.4339828571339459e-01 -3.2815402668674825e+00 3.3705365813037062e+01 - 9 8.3054609193954665e+00 8.6081689391846101e+00 3.6111714795767149e+01 - 10 4.2562455332119846e+01 -5.5915592218979391e+01 -1.7451318081551776e+01 - 11 -1.1800008468264949e+00 -2.7476355482242560e+00 -4.5819298247616285e+00 - 12 8.4381026224138100e+00 3.9901359169710848e+00 -4.1484486359669743e+00 - 13 4.1922197505175003e+00 -1.5869425169594502e+00 -6.2736131649322499e-02 - 14 -1.6198688551593283e+00 2.6218095773260064e-01 -4.1333087365492887e+00 - 15 -2.0317698812261975e-01 4.5412250211743395e+00 1.7062595754533034e+00 - 16 3.3205785822180545e+01 -2.7559707901232976e+01 -6.8100078278090351e+01 - 17 -2.7955159795389019e+01 1.9376925644175991e+01 7.7082357538893760e+01 - 18 -1.7234098205033060e-02 -2.8617943773465764e-02 2.5334906858207568e-02 - 19 2.1311927426645208e-04 -1.2593084524492978e-04 1.1317884520592708e-03 - 20 -6.1559789281937362e-04 -6.2113408214011076e-04 1.8348082185836218e-04 - 21 -9.1322831737495420e+00 -9.9756772263016167e+00 2.9984274402265925e+01 - 22 -1.4775520148479893e+01 -3.7891241963825881e+00 -2.2670176991803608e+01 - 23 2.3901688449621179e+01 1.3772058086739575e+01 -7.3072073521359870e+00 - 24 7.5930494067873147e+00 -2.9272464037912094e+01 1.7213978162346269e+01 - 25 -2.2853132577427619e+01 3.3602003461898797e+00 -1.9347366858589186e+01 - 26 1.5250101683917144e+01 2.5905455052973377e+01 2.1162495837544468e+00 - 27 5.7122783234562746e+00 -3.0280583145530287e+01 1.0696226744792906e+01 - 28 -2.2862852701915180e+01 9.8829997246936809e+00 -1.5214418492444372e+01 - 29 1.7154996338910930e+01 2.0400876431605472e+01 4.5160592073445374e+00 + 1 -4.0780575684756375e+00 3.8343201078042995e+01 4.8566316730487088e+01 + 2 2.3558320032272075e+01 1.9416473146756662e+01 -2.7633782760128167e+01 + 3 -1.9578623299155520e+01 -5.0672717268775735e+01 -2.0144648901054541e+01 + 4 -4.1880238125695106e+00 1.0974051158050393e+00 -2.9896415403507244e+00 + 5 -1.3228723800418190e+00 -2.2154024133663084e+00 6.0620563493337700e+00 + 6 -7.0818734078473682e+01 7.6783804251577209e+01 6.5488794241357795e+01 + 7 1.1309799603792690e-01 -2.1385410911460792e+01 -1.2902268425774031e+02 + 8 2.4604202689059580e+00 -6.1199890113694506e+00 3.4980909444304672e+01 + 9 1.0355581344818233e+01 1.1115483446268541e+01 4.5792285423128384e+01 + 10 4.8534807433366431e+01 -6.2922905885363519e+01 -1.7988794890063392e+01 + 11 -1.1729211740823362e+00 -2.9843929313915698e+00 -4.8629451267761752e+00 + 12 8.7507568552130461e+00 4.0128863151631649e+00 -3.7478461640152223e+00 + 13 4.4172524225100487e+00 -1.7438065327814165e+00 -7.9068917624980611e-02 + 14 -1.8043792174461146e+00 3.5740133687690190e-01 -4.6476523082432299e+00 + 15 -1.1430862485221240e-01 4.6204469482105406e+00 1.6465399865100188e+00 + 16 4.0963184652111032e+01 -3.2281763251737623e+01 -9.0140735363827034e+01 + 17 -3.6046440783883845e+01 2.4605212619276578e+01 9.8706416931027917e+01 + 18 -1.7321975132796541e-02 -2.8770013153885918e-02 2.5475466648253731e-02 + 19 2.7546621135809480e-04 -7.3461757339628110e-05 1.1286203326349028e-03 + 20 -6.9071671481796336e-04 -6.8581180192935716e-04 1.7980698518347521e-04 + 21 -1.0851057277826667e+01 -1.2707067474055004e+01 3.6460128432467748e+01 + 22 -1.7633284049019544e+01 -4.3045594584066800e+00 -2.7570322192454565e+01 + 23 2.8478380689664192e+01 1.7018706805248986e+01 -8.8830987157376544e+00 + 24 7.1236412048378055e+00 -3.3727692515534756e+01 1.8832741152461406e+01 + 25 -2.4863031391084892e+01 3.9473248269608003e+00 -2.0910769057588812e+01 + 26 1.7729596865564748e+01 2.9773599814772606e+01 2.0611705371656086e+00 + 27 6.7341930575826403e+00 -3.6411389795540032e+01 1.3593826815415273e+01 + 28 -2.7771419175114392e+01 1.1920707861091199e+01 -1.8753237011504332e+01 + 29 2.1041657234778249e+01 2.4493973170444821e+01 5.1572572694833640e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_long_cut_coul_long.yaml b/unittest/force-styles/tests/mol-pair-buck_long_cut_coul_long.yaml index 64c3bd396..4c54416a1 100644 --- a/unittest/force-styles/tests/mol-pair-buck_long_cut_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_long_cut_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:40:37 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 2e-09 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6275296350353177e+00 -2.6304782126946186e+01 9.9375753439373451e+00 28 -2.3342785641579749e+01 7.6604241443883918e+00 -1.5178331872815008e+01 29 1.9107819420519260e+01 1.8640384533413357e+01 5.2191851174899631e+00 -run_vdwl: 121.726025515065 -run_coul: 226.519738503437 +run_vdwl: 143.568625155378 +run_coul: 225.788771269962 run_stress: ! |2- - 2.3590204527232925e+02 2.1786393126646038e+02 3.4555759318888499e+02 -4.8490269243807141e+01 2.2044769313031111e+01 5.0730483761672573e+01 + 2.6294592507175838e+02 2.4453683519459824e+02 4.2104381906443348e+02 -4.9562449442644890e+01 2.3914873260658684e+01 5.6454583403156704e+01 run_forces: ! |2 - 1 1.5698395725255674e+00 3.4705556898309830e+01 4.0148491866687003e+01 - 2 1.8094875652358759e+01 1.2213630078485194e+01 -2.2605062548525950e+01 - 3 -1.8970349974421204e+01 -4.2047722899416321e+01 -1.6680481083122142e+01 - 4 -4.0730430309457528e+00 1.1077146510796581e+00 -3.1425822003985973e+00 - 5 -1.7469087373654002e+00 -1.3413009601224968e+00 5.6286880883787296e+00 - 6 -5.9373579553237860e+01 6.0904871315189993e+01 4.0745560815144955e+01 - 7 9.5244057493357359e-01 -1.6629783568045990e+01 -9.4751671277804491e+01 - 8 -5.2492178373691460e-02 8.2699339057486687e-01 3.5936464226984853e+01 - 9 1.0123263972386873e+01 2.3916817645843178e+00 3.8071793104925952e+01 - 10 4.2031045095599445e+01 -5.5269901976988372e+01 -1.7617529134712779e+01 - 11 -2.0952561898940183e+00 -1.6935815390946380e+00 -5.1512427397552827e+00 - 12 1.1255682986610852e+01 3.5014143175130528e+00 -2.7019794585819299e+00 - 13 4.1367916699665317e+00 -1.6074665893708475e+00 -2.5938631878569440e-01 - 14 -2.7211635378819987e+00 6.2995917240926580e-01 -4.1812665894137560e+00 - 15 1.3850219876212885e-01 4.3143675373140438e+00 6.6656278185689333e-01 - 16 3.2834764837529349e+01 -2.8386832139907472e+01 -6.7144586519238231e+01 - 17 -3.0854759910701400e+01 2.6148951816432497e+01 7.1307049881498230e+01 - 18 -2.1756807799839875e-01 4.3443600520467207e+00 -7.4141279833337226e+00 - 19 2.4152971434356703e+00 -4.3993293029159058e-01 5.6618008951619156e+00 - 20 -2.8256323844508984e+00 -3.8503505970848475e+00 3.6226831451184780e+00 - 21 -7.7979007642415299e+00 -6.3680923555356372e+00 2.2973695774273409e+01 - 22 -1.3550747679201205e+01 -4.3873029016943530e+00 -1.8044475303852884e+01 - 23 2.0908983051842547e+01 1.1185886498098528e+01 -4.3920068262594558e+00 - 24 6.0257564312999286e+00 -2.1770275627355794e+01 1.2877121314067722e+01 - 25 -2.0654126913428435e+01 6.5561692975690367e-01 -1.6655661388994940e+01 - 26 1.4031287466748058e+01 2.0860799256575362e+01 3.1333900079652808e+00 - 27 4.0575741331511441e+00 -2.1951936355694329e+01 7.9047074667543722e+00 - 28 -1.9856066053289229e+01 6.2812958827502268e+00 -1.2673997852836854e+01 - 29 1.6213490198280603e+01 1.5671380879482198e+01 4.7380478567989348e+00 + 1 -1.3621135640006652e+00 3.7949612217237110e+01 4.8882911770034070e+01 + 2 2.3313153869079940e+01 1.6527266977591974e+01 -2.8962794908453187e+01 + 3 -1.9562188749764413e+01 -5.0757827693454644e+01 -2.0130265312393760e+01 + 4 -4.2682567576263821e+00 1.1154383829571408e+00 -3.2314369033488037e+00 + 5 -1.8625495790390767e+00 -1.5514326346946354e+00 5.9921921274097514e+00 + 6 -6.9326246292616347e+01 7.2909926700545839e+01 6.2944603532443004e+01 + 7 3.4833019711276329e-02 -2.0499393819089175e+01 -1.2522826428680203e+02 + 8 9.0670490934900727e-01 -1.5919131756863334e+00 3.7346443269187361e+01 + 9 1.1981951807443499e+01 5.2954782869128536e+00 4.7222271778521637e+01 + 10 4.8287238754971433e+01 -6.2564954718226566e+01 -1.8223696195056686e+01 + 11 -2.0738817513021792e+00 -1.9562281165449593e+00 -5.4253443729976301e+00 + 12 1.1608249914843579e+01 3.5317862425447264e+00 -2.3163267756785313e+00 + 13 4.3427807771306526e+00 -1.7528747036760546e+00 -2.5693740566192724e-01 + 14 -2.8597828596444774e+00 7.1515084746908764e-01 -4.7421276602685118e+00 + 15 2.4127304065743671e-01 4.4180890865952271e+00 6.3290125489597138e-01 + 16 4.0230680375247317e+01 -3.2795677042674917e+01 -8.8232776641744010e+01 + 17 -3.8476989074957153e+01 3.0792148986909194e+01 9.2067865118055565e+01 + 18 3.0293665475176745e-01 4.7176245277810782e+00 -7.8157677161864259e+00 + 19 2.0278948817780829e+00 -6.9160950764535467e-01 5.5372100474801593e+00 + 20 -2.8995661963827413e+00 -3.9662484410974490e+00 4.0719654669423493e+00 + 21 -8.9496490210427986e+00 -8.3606434785434907e+00 2.7578426209972310e+01 + 22 -1.5805963565819592e+01 -4.8571767303174234e+00 -2.1662155130897560e+01 + 23 2.4340458644685043e+01 1.3631563845869001e+01 -5.4128684078510529e+00 + 24 5.5322204299737487e+00 -2.4563087082647606e+01 1.3798829950605297e+01 + 25 -2.1784355677693330e+01 1.0178271666357932e+00 -1.7475080985723540e+01 + 26 1.5689517589504662e+01 2.3291490240194356e+01 3.0620298201660923e+00 + 27 4.7041578022551196e+00 -2.6382316290516918e+01 9.9352117534137498e+00 + 28 -2.3442592997898146e+01 7.6899947560017257e+00 -1.5219901355058191e+01 + 29 1.9130083616404725e+01 1.8687985169570400e+01 5.2628819589945648e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_mdf.yaml b/unittest/force-styles/tests/mol-pair-buck_mdf.yaml index 0674c1f56..3eb30c04f 100644 --- a/unittest/force-styles/tests/mol-pair-buck_mdf.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_mdf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 20:03:37 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:11 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -63,38 +63,38 @@ init_forces: ! |2 27 6.6487363315433221e+00 -3.6337564791281956e+01 1.3616115657254987e+01 28 -2.7672094503404313e+01 1.1892775106158119e+01 -1.8723460085236635e+01 29 2.1029505808433630e+01 2.4450001388294194e+01 5.1038879408118385e+00 -run_vdwl: 120.390339444037 +run_vdwl: 143.552545224348 run_coul: 0 run_stress: ! |2- - 2.5557076115460899e+02 2.5949083036036279e+02 3.7924820713448941e+02 -5.4331912086309863e+01 2.7329510888117166e+01 4.1741880429358943e+01 + 2.8577259755322768e+02 2.8737964903764203e+02 4.5969023465882259e+02 -5.4043181576015463e+01 3.0500021516712550e+01 4.6844040968177744e+01 run_forces: ! |2 - 1 -9.5106296778717858e-01 3.5350903139580076e+01 3.9457788501955015e+01 - 2 1.8087885768281200e+01 1.4881431751248465e+01 -2.0866803303326282e+01 - 3 -1.9025510717853550e+01 -4.1963958840837172e+01 -1.6664478809553827e+01 - 4 -3.9859941166892718e+00 1.0788502407049387e+00 -2.9029954145128887e+00 - 5 -1.2023709090005723e+00 -2.0086881004005659e+00 5.6818744816238880e+00 - 6 -6.0409708693069774e+01 6.4308051724265454e+01 4.2296795072550239e+01 - 7 9.3619774012754076e-01 -1.7314182498123468e+01 -9.7141371175003627e+01 - 8 8.4374815617239507e-01 -3.2803127898386091e+00 3.3704959962345320e+01 - 9 8.3054223919475838e+00 8.6081913218743473e+00 3.6111642806027483e+01 - 10 4.2561464320368003e+01 -5.5914107881428244e+01 -1.7451016581627673e+01 - 11 -1.1800067991818264e+00 -2.7475271110814830e+00 -4.5818283809538558e+00 - 12 8.4354686158616836e+00 3.9901659185061922e+00 -4.1473570573211056e+00 - 13 4.1920571556670385e+00 -1.5869395008460414e+00 -6.2699936272915119e-02 - 14 -1.6199433911252872e+00 2.6217248188321979e-01 -4.1331654538138283e+00 - 15 -2.0331708492334666e-01 4.5411734718704624e+00 1.7063124925553061e+00 - 16 3.3204345703794395e+01 -2.7557620088049639e+01 -6.8101198549810292e+01 - 17 -2.7956867632127889e+01 1.9379723739082340e+01 7.7078799406759330e+01 - 18 -1.8736484154392354e-02 -3.1832301275527011e-02 2.8465565812628272e-02 - 19 1.9235280815687152e-04 -1.9937323111483010e-04 1.2555083173809050e-03 - 20 -6.5720491792300236e-04 -6.8003272156836258e-04 2.7292955437743918e-04 - 21 -9.1337929183030120e+00 -9.9740199991125511e+00 2.9985651190373691e+01 - 22 -1.4775515115956688e+01 -3.7890888804029199e+00 -2.2670105420722507e+01 - 23 2.3901606557704575e+01 1.3772050192861254e+01 -7.3071673474361880e+00 - 24 7.5921777719466190e+00 -2.9274214151414398e+01 1.7211122387283904e+01 - 25 -2.2853224935112188e+01 3.3601440486173679e+00 -1.9347511864642978e+01 - 26 1.5250008770356276e+01 2.5905305780853841e+01 2.1161920651718211e+00 - 27 5.7138512823990517e+00 -3.0278816202265425e+01 1.0694975152036214e+01 - 28 -2.2862795498173114e+01 9.8830391808041718e+00 -1.5214428418290540e+01 - 29 1.7155077880941484e+01 2.0400984758876589e+01 4.5160201909218829e+00 + 1 -4.0749451323440358e+00 3.8338058994819875e+01 4.8564749454042492e+01 + 2 2.3558333802487390e+01 1.9416332680359428e+01 -2.7633727005365373e+01 + 3 -1.9576093409585059e+01 -5.0673826084664533e+01 -2.0144948791052112e+01 + 4 -4.1878729241956831e+00 1.0973576678456383e+00 -2.9895698802656701e+00 + 5 -1.3227409017433305e+00 -2.2154154101839159e+00 6.0619957178967114e+00 + 6 -7.0817200842906701e+01 7.6783652634093755e+01 6.5489529010339211e+01 + 7 1.1518821866535379e-01 -2.1384996563467549e+01 -1.2901851796119064e+02 + 8 2.4606737827880369e+00 -6.1187310266942676e+00 3.4980335399836171e+01 + 9 1.0355545905370894e+01 1.1115514342067280e+01 4.5792208146868852e+01 + 10 4.8533765358010278e+01 -6.2921286561803974e+01 -1.7988466287658937e+01 + 11 -1.1729309963871586e+00 -2.9842850564118404e+00 -4.8628496527329768e+00 + 12 8.7480482652846625e+00 4.0129079628228954e+00 -3.7467277048000205e+00 + 13 4.4171108237168841e+00 -1.7438111524997726e+00 -7.9031850488319275e-02 + 14 -1.8044569013307694e+00 3.5739218054994526e-01 -4.6475063173623861e+00 + 15 -1.1445191434118464e-01 4.6203877919389891e+00 1.6465915680176713e+00 + 16 4.0961653965716309e+01 -3.2279598149543482e+01 -9.0141714311253594e+01 + 17 -3.6048093115090182e+01 2.4607986178530748e+01 9.8702684997697574e+01 + 18 -1.8828262805695318e-02 -3.1988648294699579e-02 2.8607097012584678e-02 + 19 2.5463116093512992e-04 -1.4681038240970268e-04 1.2512327036832780e-03 + 20 -7.3265904121176174e-04 -7.4605791775119866e-04 2.7007494364068429e-04 + 21 -1.0852553549478591e+01 -1.2705455921321224e+01 3.6461505312549392e+01 + 22 -1.7633296172630661e+01 -4.3045190789061669e+00 -2.7570258456689778e+01 + 23 2.8478316029647406e+01 1.7018722003498905e+01 -8.8830587913915942e+00 + 24 7.1226605897416633e+00 -3.3729485286722110e+01 1.8829860837175961e+01 + 25 -2.4863047710268091e+01 3.9472473181311103e+00 -2.0910860209109767e+01 + 26 1.7729545980209686e+01 2.9773521223643780e+01 2.0611037308016176e+00 + 27 6.7358075170230478e+00 -3.6409567398137227e+01 1.3592597626830239e+01 + 28 -2.7771349841046678e+01 1.1920755749600227e+01 -1.8753251440508908e+01 + 29 2.1041689463372474e+01 2.4494022479048336e+01 5.1571984531543320e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_table_coul_long.yaml b/unittest/force-styles/tests/mol-pair-buck_table_coul_long.yaml index aaabfcd1d..d2a027b20 100644 --- a/unittest/force-styles/tests/mol-pair-buck_table_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_table_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:13:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 2e-09 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 4.6260665022831926e+00 -2.6306305097421209e+01 9.9386139962010169e+00 28 -2.3342848199929932e+01 7.6603913255098890e+00 -1.5178322120309636e+01 29 1.9107789199068538e+01 1.8640339900820063e+01 5.2192425307102530e+00 -run_vdwl: 121.820825901609 -run_coul: 226.519747770181 +run_vdwl: 143.664052317798 +run_coul: 225.788771362651 run_stress: ! |2- - 2.3593829017644876e+02 2.1792044162360438e+02 3.4560175301048969e+02 -4.8502992604961904e+01 2.2039232760362367e+01 5.0726500806511929e+01 + 2.6298255039302433e+02 2.4459393792599337e+02 4.2108847694849635e+02 -4.9575322988350926e+01 2.3909358001492738e+01 5.6450569845567607e+01 run_forces: ! |2 - 1 1.5666349308748257e+00 3.4710342742354641e+01 4.0150016936063771e+01 - 2 1.8094852325517561e+01 1.2213722025257505e+01 -2.2605094936489639e+01 - 3 -1.8972764030069886e+01 -4.2046442566512148e+01 -1.6680119363391821e+01 - 4 -4.0732081623735210e+00 1.1077591111378640e+00 -3.1426639915212573e+00 - 5 -1.7470376120241193e+00 -1.3412894299953042e+00 5.6287510804214440e+00 - 6 -5.9374890020083242e+01 6.0904798391126072e+01 4.0744679719207113e+01 - 7 9.5034995701770009e-01 -1.6630190440089113e+01 -9.4755384658126189e+01 - 8 -5.2837337094888845e-02 8.2576795840735340e-01 3.5936873175859219e+01 - 9 1.0123301399189680e+01 2.3916604961995334e+00 3.8071865572717144e+01 - 10 4.2032036605899663e+01 -5.5271385693424492e+01 -1.7617826796410039e+01 - 11 -2.0952498098944980e+00 -1.6936833902275663e+00 -5.1513369730147245e+00 - 12 1.1258237998299577e+01 3.5013284075330748e+00 -2.7030140093994710e+00 - 13 4.1369568794483298e+00 -1.6074660976695168e+00 -2.5942402457912178e-01 - 14 -2.7210873224773366e+00 6.2997283112559455e-01 -4.1814031805656784e+00 - 15 1.3864549458477479e-01 4.3144198177742474e+00 6.6650912032449383e-01 - 16 3.2836210041505360e+01 -2.8388917370840122e+01 -6.7143474917156894e+01 - 17 -3.0853057250678230e+01 2.6146329698133453e+01 7.1310455819000708e+01 - 18 -2.1605111154692405e-01 4.3473938615434999e+00 -7.4170088346486720e+00 - 19 2.4153215863143864e+00 -4.3985844504479843e-01 5.6616775835399764e+00 - 20 -2.8256043612795856e+00 -3.8503050803195893e+00 3.6226183691002083e+00 - 21 -7.7964609920424381e+00 -6.3696771485886652e+00 2.2972351459771641e+01 - 22 -1.3550751703342016e+01 -4.3873374702386210e+00 -1.8044545105391247e+01 - 23 2.0909059758580067e+01 1.1185892672463510e+01 -4.3920460169748559e+00 - 24 6.0266165085563976e+00 -2.1768589638868864e+01 1.2879762890287099e+01 - 25 -2.0654046611647885e+01 6.5567897851752432e-01 -1.6655521932647208e+01 - 26 1.4031376620563028e+01 2.0860933229015561e+01 3.1334455018104905e+00 - 27 4.0561476968538468e+00 -2.1953415255215369e+01 7.9057583604740760e+00 - 28 -1.9856121995401349e+01 6.2812691494221520e+00 -1.2673991869655868e+01 - 29 1.6213420516750695e+01 1.5671288657022597e+01 4.7380910213953102e+00 + 1 -1.3652720834913872e+00 3.7954573428893653e+01 4.8884538768567211e+01 + 2 2.3313140000276228e+01 1.6527407480697487e+01 -2.8962850562790791e+01 + 3 -1.9564718648998063e+01 -5.0756719009672679e+01 -2.0129965499491334e+01 + 4 -4.2684080397011703e+00 1.1154798915252910e+00 -3.2315051380395223e+00 + 5 -1.8626810684298665e+00 -1.5514196433458887e+00 5.9922527662981784e+00 + 6 -6.9327720428761197e+01 7.2910023777990332e+01 6.2943838487614350e+01 + 7 3.2725413575234112e-02 -2.0499842427453078e+01 -1.2523228158702395e+02 + 8 9.0645146482434036e-01 -1.5931711433128468e+00 3.7347017326013869e+01 + 9 1.1981987319786127e+01 5.2954473119820076e+00 4.7222348956138958e+01 + 10 4.8288281283241211e+01 -6.2566570313673793e+01 -1.8224021898179114e+01 + 11 -2.0738715107442012e+00 -1.9563279892221894e+00 -5.4254319974534670e+00 + 12 1.1610878306182146e+01 3.5317031800292078e+00 -2.3173846192294150e+00 + 13 4.3429256471375499e+00 -1.7528672157516656e+00 -2.5697584876871321e-01 + 14 -2.8597049516896171e+00 7.1516578251600804e-01 -4.7422665426269432e+00 + 15 2.4141798699136682e-01 4.4181498652897266e+00 6.3284857377761916e-01 + 16 4.0232210771887296e+01 -3.2797832088125205e+01 -8.8231799296350033e+01 + 17 -3.8475339976542394e+01 3.0789551136261498e+01 9.2071437063477575e+01 + 18 3.0444744477064167e-01 4.7206638354378541e+00 -7.8186562239958901e+00 + 19 2.0279176776301284e+00 -6.9153978563237972e-01 5.5370947240341719e+00 + 20 -2.8995246349593420e+00 -3.9661906625717398e+00 4.0718950082849990e+00 + 21 -8.9482093742378090e+00 -8.3621998524444923e+00 2.7577075866326783e+01 + 22 -1.5805953774618484e+01 -4.8572145966987890e+00 -2.1662217002943464e+01 + 23 2.4340519097197131e+01 1.3631551507589224e+01 -5.4129063246406988e+00 + 24 5.5331809762303870e+00 -2.4561349908121304e+01 1.3801516566637739e+01 + 25 -2.1784339528710312e+01 1.0179046212179157e+00 -1.7474990048954393e+01 + 26 1.5689568160805367e+01 2.3291559486511172e+01 3.0620904858254310e+00 + 27 4.7026950277905115e+00 -2.6383838683653600e+01 9.9362504040080157e+00 + 28 -2.3442655457749130e+01 7.6899620159343804e+00 -1.5219891624403587e+01 + 29 1.9130052900307323e+01 1.8687939997803873e+01 5.2629392178863972e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml b/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml index 2ddb3e071..75ea5e64f 100644 --- a/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 23:02:10 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 2e-08 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 6.6471213343673661e+00 -3.6339388133413763e+01 1.3617344872587314e+01 28 -2.7672164019861725e+01 1.1892727087286405e+01 -1.8723445616353175e+01 29 2.1029474237821791e+01 2.4449952815317836e+01 5.1039469596507772e+00 -run_vdwl: 120.484472325336 +run_vdwl: 143.647338255486 run_coul: 0 run_stress: ! |2- - 2.5560791683599416e+02 2.5955067679291733e+02 3.7929520396358282e+02 -5.4344098200411409e+01 2.7323388133105919e+01 4.1736578236562195e+01 + 2.8581008751513525e+02 2.8744003827131843e+02 4.5973758767091698e+02 -5.4055502759640746e+01 3.0493928747153301e+01 4.6838674234102271e+01 run_forces: ! |2 - 1 -9.5423782226238540e-01 3.5355849549637227e+01 3.9459261146570960e+01 - 2 1.8087871295293311e+01 1.4881519858790725e+01 -2.0866843679938697e+01 - 3 -1.9027922249572359e+01 -4.1962669006938583e+01 -1.6664111513503091e+01 - 4 -3.9861577386176270e+00 1.0789007352012596e+00 -2.9030806978306991e+00 - 5 -1.2024986278241963e+00 -2.0086759078665737e+00 5.6819366733811281e+00 - 6 -6.0411079053534863e+01 6.4308036881032180e+01 4.2295934065867662e+01 - 7 9.3411893473413510e-01 -1.7314556169546478e+01 -9.7145242597961655e+01 - 8 8.4339830086843803e-01 -3.2815402671581326e+00 3.3705365792311191e+01 - 9 8.3054609190186408e+00 8.6081689385993361e+00 3.6111714793889732e+01 - 10 4.2562455368196623e+01 -5.5915592185803341e+01 -1.7451318096606581e+01 - 11 -1.1800008472399635e+00 -2.7476355467456273e+00 -4.5819298232993786e+00 - 12 8.4381025688373850e+00 3.9901358827390290e+00 -4.1484486029546446e+00 - 13 4.1922197500184888e+00 -1.5869425167725510e+00 -6.2736131625576702e-02 - 14 -1.6198688553301024e+00 2.6218095750360043e-01 -4.1333087357838076e+00 - 15 -2.0317698904186313e-01 4.5412250202397484e+00 1.7062595755992198e+00 - 16 3.3205785819014075e+01 -2.7559707896688831e+01 -6.8100078281434477e+01 - 17 -2.7955159796323354e+01 1.9376925646763990e+01 7.7082357531468730e+01 - 18 -1.7234098547717430e-02 -2.8617944174253653e-02 2.5334907277426644e-02 - 19 2.1311928069761311e-04 -1.2593084265390901e-04 1.1317884582618472e-03 - 20 -6.1559790119996899e-04 -6.2113409007452994e-04 1.8348082246759078e-04 - 21 -9.1322831738110057e+00 -9.9756772262305891e+00 2.9984274402340770e+01 - 22 -1.4775520148470900e+01 -3.7891241963773772e+00 -2.2670176991800012e+01 - 23 2.3901688449611445e+01 1.3772058086736260e+01 -7.3072073521401570e+00 - 24 7.5930494066244343e+00 -2.9272464037977382e+01 1.7213978162090275e+01 - 25 -2.2853132577424361e+01 3.3602003461941621e+00 -1.9347366858602769e+01 - 26 1.5250101683894883e+01 2.5905455052957613e+01 2.1162495837425519e+00 - 27 5.7122783235103043e+00 -3.0280583145488144e+01 1.0696226744763296e+01 - 28 -2.2862852701906395e+01 9.8829997246980774e+00 -1.5214418492441709e+01 - 29 1.7154996338905416e+01 2.0400876431607390e+01 4.5160592073395982e+00 + 1 -4.0780575684306717e+00 3.8343201073833633e+01 4.8566316729987996e+01 + 2 2.3558320032174674e+01 1.9416473146571452e+01 -2.7633782760101798e+01 + 3 -1.9578623267930656e+01 -5.0672717300632485e+01 -2.0144648922380778e+01 + 4 -4.1880238122786730e+00 1.0974051159967873e+00 -2.9896415401206262e+00 + 5 -1.3228723791692272e+00 -2.2154024118302078e+00 6.0620563484806738e+00 + 6 -7.0818734107457118e+01 7.6783804282895332e+01 6.5488794262838582e+01 + 7 1.1309801510842932e-01 -2.1385410921374302e+01 -1.2902268421722979e+02 + 8 2.4604202701285041e+00 -6.1199890034695672e+00 3.4980909398853022e+01 + 9 1.0355581344855061e+01 1.1115483446009216e+01 4.5792285422551643e+01 + 10 4.8534807503095628e+01 -6.2922905871197045e+01 -1.7988794883334638e+01 + 11 -1.1729211741239904e+00 -2.9843929304951633e+00 -4.8629451258520904e+00 + 12 8.7507567880887080e+00 4.0128862681982769e+00 -3.7478461233071658e+00 + 13 4.4172524223983336e+00 -1.7438065327910270e+00 -7.9068917575988981e-02 + 14 -1.8043792176766149e+00 3.5740133664098367e-01 -4.6476523077237877e+00 + 15 -1.1430862573372844e-01 4.6204469476162568e+00 1.6465399867767654e+00 + 16 4.0963184628698215e+01 -3.2281763216228022e+01 -9.0140735399541271e+01 + 17 -3.6046440785108473e+01 2.4605212622254449e+01 9.8706416923973038e+01 + 18 -1.7321975324331537e-02 -2.8770013455033605e-02 2.5475466889975408e-02 + 19 2.7546621675555966e-04 -7.3461756413933165e-05 1.1286203434366770e-03 + 20 -6.9071672306946451e-04 -6.8581180988141544e-04 1.7980698477595663e-04 + 21 -1.0851057277895070e+01 -1.2707067473978693e+01 3.6460128432537758e+01 + 22 -1.7633284048992667e+01 -4.3045594583932667e+00 -2.7570322192442134e+01 + 23 2.8478380689635763e+01 1.7018706805237262e+01 -8.8830987157484103e+00 + 24 7.1236412047020847e+00 -3.3727692515599244e+01 1.8832741152246722e+01 + 25 -2.4863031391094157e+01 3.9473248269553833e+00 -2.0910769057624272e+01 + 26 1.7729596865547389e+01 2.9773599814762232e+01 2.0611705371549407e+00 + 27 6.7341930576220896e+00 -3.6411389795500369e+01 1.3593826815387089e+01 + 28 -2.7771419175085303e+01 1.1920707861100684e+01 -1.8753237011491930e+01 + 29 2.1041657234752105e+01 2.4493973170438739e+01 5.1572572694682766e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-buck_table_coul_table.yaml b/unittest/force-styles/tests/mol-pair-buck_table_coul_table.yaml index dad433514..6618461c9 100644 --- a/unittest/force-styles/tests/mol-pair-buck_table_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_table_coul_table.yaml @@ -1,7 +1,7 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 16:19:57 202 -epsilon: 2.0e-9 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 +epsilon: 2e-09 prerequisites: ! | atom full pair buck/long/coul/long @@ -66,38 +66,38 @@ init_forces: ! |2 27 4.6260663831346509e+00 -2.6306304919818423e+01 9.9386137948272868e+00 28 -2.3342851186798200e+01 7.6603903379992113e+00 -1.5178323537904395e+01 29 1.9107792107500899e+01 1.8640340506299360e+01 5.2192442271064312e+00 -run_vdwl: 121.820811174747 -run_coul: 226.519779327483 +run_vdwl: 143.664033843465 +run_coul: 225.788807114573 run_stress: ! |2- - 2.3593828311531067e+02 2.1792041447703937e+02 3.4560173074099583e+02 -4.8502987007707979e+01 2.2039236390686625e+01 5.0726518075329388e+01 + 2.6298253730875990e+02 2.4459390608852283e+02 4.2108844885702558e+02 -4.9575312662970951e+01 2.3909364645213543e+01 5.6450595032795320e+01 run_forces: ! |2 - 1 1.5666336476558516e+00 3.4710340735943547e+01 4.0150015906461057e+01 - 2 1.8094851719624781e+01 1.2213721319307918e+01 -2.2605093361501442e+01 - 3 -1.8972759760766699e+01 -4.2046446452804858e+01 -1.6680122025798195e+01 - 4 -4.0732080866775995e+00 1.1077596985639770e+00 -3.1426637515944358e+00 - 5 -1.7470372057186203e+00 -1.3412883498662873e+00 5.6287511101390555e+00 - 6 -5.9374893723688764e+01 6.0904802176265854e+01 4.0744681307863793e+01 - 7 9.5035272247093594e-01 -1.6630191232250677e+01 -9.4755379474405075e+01 - 8 -5.2840283153666248e-02 8.2576863281819446e-01 3.5936869041431308e+01 - 9 1.0123302870381252e+01 2.3916594187825106e+00 3.8071866586900164e+01 - 10 4.2032052615497982e+01 -5.5271380738304742e+01 -1.7617826057984569e+01 - 11 -2.0952499605927404e+00 -1.6936824639761423e+00 -5.1513363973327619e+00 - 12 1.1258226560006035e+01 3.5013168863334507e+00 -2.7030070912206816e+00 - 13 4.1369568258344680e+00 -1.6074661725341111e+00 -2.5942379642036356e-01 - 14 -2.7210877808553948e+00 6.2997271608412531e-01 -4.1814029225947422e+00 - 15 1.3864508170975598e-01 4.3144193952372261e+00 6.6650959918063413e-01 - 16 3.2836205581650404e+01 -2.8388909989967203e+01 -6.7143482154741079e+01 - 17 -3.0853057481930961e+01 2.6146331075385735e+01 7.1310453403946326e+01 - 18 -2.1605010062640223e-01 4.3473940983592199e+00 -7.4170105019458124e+00 - 19 2.4153196732988351e+00 -4.3985988569658213e-01 5.6616777622951444e+00 - 20 -2.8256025302358752e+00 -3.8503038467031216e+00 3.6226189712808039e+00 - 21 -7.7964612100524233e+00 -6.3696763896712412e+00 2.2972351468662996e+01 - 22 -1.3550754673803114e+01 -4.3873393107242089e+00 -1.8044546475572663e+01 - 23 2.0909063065072814e+01 1.1185893785532425e+01 -4.3920447748615032e+00 - 24 6.0266162461751840e+00 -2.1768589178988204e+01 1.2879761373823287e+01 - 25 -2.0654047790104684e+01 6.5567791008472831e-01 -1.6655522228404184e+01 - 26 1.4031378125645212e+01 2.0860933964637251e+01 3.1334468359540177e+00 - 27 4.0561475878712745e+00 -2.1953414600495083e+01 7.9057579216210740e+00 - 28 -1.9856123914484094e+01 6.2812681762834028e+00 -1.2673992646820372e+01 - 29 1.6213422179796229e+01 1.5671288622362908e+01 4.7380923716381620e+00 + 1 -1.3652735543008816e+00 3.7954571133178902e+01 4.8884537377309172e+01 + 2 2.3313139309989094e+01 1.6527406547056287e+01 -2.8962849270283392e+01 + 3 -1.9564712384032376e+01 -5.0756725329741236e+01 -2.0129969747702308e+01 + 4 -4.2684080200768406e+00 1.1154804510128165e+00 -3.2315048619404054e+00 + 5 -1.8626805980022214e+00 -1.5514180174720389e+00 5.9922526428223755e+00 + 6 -6.9327726613063405e+01 7.2910030587436125e+01 6.2943841090264428e+01 + 7 3.2729124302063782e-02 -2.0499844044312820e+01 -1.2523227476685206e+02 + 8 9.0645037724821509e-01 -1.5931699446420091e+00 3.7347010853073435e+01 + 9 1.1981988562945483e+01 5.2954468151255067e+00 4.7222350357045890e+01 + 10 4.8288299835295966e+01 -6.2566569083557049e+01 -1.8224018086894844e+01 + 11 -2.0738716050222630e+00 -1.9563271603792205e+00 -5.4254318756542368e+00 + 12 1.1610864028639977e+01 3.5316916580070092e+00 -2.3173763560781429e+00 + 13 4.3429257276773807e+00 -1.7528673949822231e+00 -2.5697563580528093e-01 + 14 -2.8597051905279471e+00 7.1516550165881965e-01 -4.7422662564667295e+00 + 15 2.4141775499873258e-01 4.4181494329616786e+00 6.3284916283478820e-01 + 16 4.0232204451083376e+01 -3.2797821752234313e+01 -8.8231810184066035e+01 + 17 -3.8475340125721864e+01 3.0789552823136074e+01 9.2071434225822074e+01 + 18 3.0444797968268300e-01 4.7206637648615688e+00 -7.8186573872028138e+00 + 19 2.0279150125912517e+00 -6.9154201326913600e-01 5.5370944385616223e+00 + 20 -2.8995220719101922e+00 -3.9661888702042210e+00 4.0718961555885951e+00 + 21 -8.9482098879923537e+00 -8.3621991830172071e+00 2.7577076547654709e+01 + 22 -1.5805955548410763e+01 -4.8572159943051245e+00 -2.1662218351727955e+01 + 23 2.4340521395832020e+01 1.3631552339738477e+01 -5.4129057423025664e+00 + 24 5.5331810643516564e+00 -2.4561349600827779e+01 1.3801515937783783e+01 + 25 -2.1784341755480526e+01 1.0179032133762751e+00 -1.7474990741497301e+01 + 26 1.5689570822659292e+01 2.3291561154430479e+01 3.0620923138000120e+00 + 27 4.7026946479168608e+00 -2.6383838593099334e+01 9.9362502379539066e+00 + 28 -2.3442657625683115e+01 7.6899612511865811e+00 -1.5219892618907782e+01 + 29 1.9130054885010718e+01 1.8687940308877128e+01 5.2629405428671072e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-cosine_squared.yaml b/unittest/force-styles/tests/mol-pair-cosine_squared.yaml index ca126203b..b1d44726c 100644 --- a/unittest/force-styles/tests/mol-pair-cosine_squared.yaml +++ b/unittest/force-styles/tests/mol-pair-cosine_squared.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 20:46:36 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 5.1824366297393510e+01 -2.2703801913974428e+02 9.0836214781190961e+01 28 -1.8041288881401439e+02 7.7534058664543707e+01 -1.2206933806761211e+02 29 1.2861074587519965e+02 1.4952779475291308e+02 3.1215155717207590e+01 -run_vdwl: 138.84942616973 +run_vdwl: 713.680218065791 run_coul: 0 run_stress: ! |2- - 6.0136495846745959e+02 6.4995379171192496e+02 4.4475273022545485e+02 -3.1112386858484194e+02 -3.8009536720666702e+01 1.1540848783367785e+02 + 2.1151561780082525e+03 2.1391864702510302e+03 4.3628262575018016e+03 -7.3487635005949642e+02 3.3936602729076704e+01 6.2489239167002916e+02 run_forces: ! |2 - 1 1.3042154705346858e+01 8.0539904184860575e+01 6.0051447572075141e+01 - 2 1.8554316294662915e+01 1.4018577318380505e+01 -2.2755279352656078e+01 - 3 -2.5324783988415788e+02 1.0110410533211522e+02 8.7528442607718034e+01 - 4 -3.1809660168349504e-02 -2.9491971926033152e-02 -2.8716284896025381e-02 - 5 -1.3134256417056422e-01 -3.4400226320027077e-01 1.1098031453974591e-01 - 6 1.1180852439110377e+02 -9.3599360558085635e+01 -1.3909061025984050e+02 - 7 3.8005994053101322e+00 -1.0712738979126327e+01 -4.2380800195414281e+01 - 8 -1.8783668075963579e+01 1.8908456129170442e+01 5.5074604837454501e+01 - 9 1.1196856732765058e+01 1.3206239484542412e+01 4.9873499745541842e+01 - 10 5.7965329924045115e+01 -8.3681759892771666e+01 -9.1665713246054210e+01 - 11 1.3671615245526030e-02 -2.5204645899117618e-02 -2.6347907195008107e-02 - 12 1.8108990545723650e+01 1.7512000634737458e+01 -1.2075917323361118e+01 - 13 -5.8213794872194876e-03 -3.2451580623202463e-03 -6.3493288084304797e-04 - 14 -5.7939768065234064e-03 -3.1571165821108705e-03 1.0479945975082779e-02 - 15 1.3062052018860064e-02 1.4052867528740513e-02 -7.1561812543424388e-03 - 16 5.2367855810691822e+01 -6.6912813000960085e+01 1.4594377909777540e+01 - 17 -1.4633796486592749e+01 1.0018854994891072e+01 4.0794380526150178e+01 - 18 -7.7947805595989725e-03 -2.5197372022914562e-02 2.4146653203441139e-02 - 19 -9.1635211634190947e-04 -2.3212580299985489e-03 8.8815289457890041e-03 - 20 -2.3872690758600574e-03 -1.8164416505834064e-03 1.1047554549732644e-03 - 21 -9.9508590154574730e+00 -1.2000590725923971e+01 3.8883052797020682e+01 - 22 -1.8316449775420068e+01 -4.4398813533025958e+00 -2.9440297227159924e+01 - 23 2.8241464838542413e+01 1.6469765778370956e+01 -9.4184978256053515e+00 - 24 1.2412523684255213e+01 -3.6443308440388385e+01 2.3773749179572128e+01 - 25 -3.0030497348451107e+01 5.3791965267018789e+00 -2.5777972255019399e+01 - 26 1.7601898030125380e+01 3.1030277597742348e+01 1.9565163453989600e+00 - 27 3.4853021063422780e+00 -3.8980356049683181e+01 1.1690463271668129e+01 - 28 -2.5472026590932217e+01 1.1754820471432726e+01 -1.7174321002767144e+01 - 29 2.2008453023180525e+01 2.7248993907140910e+01 5.4661360036080850e+00 + 1 -2.0294243706474319e+01 2.6682156955527495e+02 3.2356807053495771e+02 + 2 1.5298810742000524e+02 1.2596363018259272e+02 -1.7961027183066872e+02 + 3 -1.4362713262624229e+02 -3.8063234569097489e+02 -1.3648408468697579e+02 + 4 -6.2576190157820163e-02 -5.1830838565680604e-02 -5.3133550716876768e-02 + 5 -1.7035307469074132e-01 -4.3728769202487455e-01 1.6130749271791961e-01 + 6 -8.0681455876811572e+02 9.2165769130531362e+02 1.0270812568882275e+03 + 7 5.5776427092333222e+01 -3.1118382180784130e+02 -1.5746960044334473e+03 + 8 1.3461054111757804e+02 -1.0072528675706494e+02 3.8851297655159868e+02 + 9 7.6750481367667845e+01 8.2496779655387130e+01 3.3943652316390541e+02 + 10 5.1881653468278580e+02 -6.0493655851463643e+02 -1.9081451382755913e+02 + 11 1.8776492028196635e-02 -3.6063071590219140e-02 -3.3138545014102114e-02 + 12 2.1986858702990794e+01 1.6610830349206719e+01 -1.3807267750853123e+01 + 13 -7.7822194710090598e-03 -2.7208878593256158e-03 -2.9821304154455867e-04 + 14 -5.5520342325908276e-03 -3.1364195097908780e-03 1.0086021905389961e-02 + 15 9.9711053540576348e-03 1.1508857976842850e-02 -4.6895235792463793e-03 + 16 4.3475532048366301e+02 -3.1169892469406295e+02 -1.1135223538617900e+03 + 17 -4.2469805378688568e+02 2.9615600745263441e+02 1.1302622883470312e+03 + 18 -7.5890223472870845e-03 -2.5117082829046143e-02 2.3929172838967932e-02 + 19 -1.1150961704237015e-03 -2.7797418420691202e-03 9.1938769044943476e-03 + 20 -2.5384315290892397e-03 -1.8870718985052213e-03 1.3049262134599217e-03 + 21 -7.0508518593170763e+01 -7.9729894921437534e+01 2.2172552906373949e+02 + 22 -1.0638675193721760e+02 -2.5949572601826933e+01 -1.6645604522677093e+02 + 23 1.7686792156961170e+02 1.0570988527426883e+02 -5.5243684579604249e+01 + 24 3.8203727337468834e+01 -2.1024958073006744e+02 1.1258431432725853e+02 + 25 -1.4918875807753517e+02 2.3761014976412064e+01 -1.2549285882029760e+02 + 26 1.1096864024187968e+02 1.8645406512982811e+02 1.2859524494795947e+01 + 27 5.0814773830531422e+01 -2.2294939210725309e+02 8.8594459335290367e+01 + 28 -1.7694173107954848e+02 7.6029961096854777e+01 -1.1950494849729685e+02 + 29 1.2614917319989095e+02 1.4694325679553475e+02 3.0892529150230125e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_cut.yaml b/unittest/force-styles/tests/mol-pair-coul_cut.yaml index fadb57e87..6f5c85343 100644 --- a/unittest/force-styles/tests/mol-pair-coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 28 4.8464204075747359e+00 -5.2910383050538492e+00 4.0808901405648896e+00 29 -1.2636120082903082e+00 -6.1719354975176035e+00 9.2219267915908476e-01 run_vdwl: 0 -run_coul: -133.983254381457 +run_coul: -127.551092913469 run_stress: ! |- - -2.9029228026762524e+01 -4.7573327487884960e+01 -5.7380698866809482e+01 -3.2224764165452648e+00 -8.3136462136537173e+00 3.8580823835036311e+00 + -2.6928416018548067e+01 -4.3177725729834854e+01 -5.7444951165085541e+01 -8.5814323779813129e-01 -7.9912081348585087e+00 2.9897259857467389e+00 run_forces: ! |2 - 1 2.2564701281641590e+00 -4.6545775177230686e-02 4.5537899149033256e-01 - 2 -3.4695487094418276e-02 -2.7916175085207686e+00 -1.6750910798407033e+00 - 3 -1.6070344135957058e-02 -8.8707939298132352e-02 2.9850103957041615e-02 - 4 6.0724031822398217e-02 7.8541943086222477e-03 -3.1674366161858925e-01 - 5 -3.8861466891353741e-01 7.0588082320363477e-01 -8.9502350335743608e-02 - 6 1.9568472260395531e+00 -3.7138524896052094e+00 -2.9099850522282180e+00 - 7 -2.7725075046289444e-01 7.2195129467480568e-01 3.8137333733427647e+00 - 8 -1.5985876611329046e+00 4.1287289152384457e+00 2.4505997426206374e+00 - 9 1.7964752649984477e+00 -5.7446918706703096e+00 1.7239971054438081e+00 - 10 -2.9862478846390395e-01 4.2089152071376568e-01 -2.1668426311115738e-01 - 11 -9.9143974025309189e-01 1.1369753216711196e+00 -5.2984874445867702e-01 - 12 3.3083334611111890e+00 -7.5444201948198408e-01 1.3082963167090651e+00 - 13 -3.9245109921014831e-01 -1.7674905846608802e-02 -1.6494449350534152e-02 - 14 -1.2323774597836901e+00 4.5904597694950711e-01 -1.5357848939833330e-02 - 15 2.3475657449943318e-01 -1.8450627279750365e-01 -9.9683151760569788e-01 - 16 -1.0757522533553132e+00 -3.5619453393437395e-01 2.7891805803000320e+00 - 17 -2.3579800359556558e+00 6.1761116527272888e+00 -7.8377116271281464e+00 - 18 8.4358977397620794e-01 6.2025109786958055e+00 -9.5480427233060539e+00 - 19 2.0327182516541309e+00 -1.3019753483606640e+00 5.8033133097078853e+00 - 20 -3.4192262498601749e+00 -3.0630648371509626e+00 3.7539121042840673e+00 - 21 2.6048756220585023e+00 1.2540656998422910e+00 -1.0538494588722333e+01 - 22 1.8345488139657191e+00 1.3197962019323795e+00 6.8642756779472611e+00 - 23 -4.9280367530555917e+00 -3.8625255031755548e+00 4.1807704011496369e+00 - 24 -2.6293397493852990e+00 1.0164939096175077e+01 -2.6124799008988271e+00 - 25 4.0555582728585051e+00 -3.0265414368335657e+00 4.3601780061873852e+00 - 26 -2.3161677444873732e+00 -7.9864440950349662e+00 -5.8725171893851713e-01 - 27 -3.0837921407193472e+00 1.1340403815376193e+01 -4.3006741216245246e+00 - 28 5.4288186465120187e+00 -4.7839026582106792e+00 3.9346883086822206e+00 - 29 -1.3733091413909575e+00 -6.3164682974104238e+00 7.2301962628542193e-01 + 1 2.2424368291189611e+00 -5.7157845887417236e-02 4.3210281185121069e-01 + 2 3.0183044940246062e-01 -2.1770211242302246e+00 -1.8796316672405435e+00 + 3 -1.5579134024760494e-02 -8.6577075665555045e-02 3.0374580927846943e-02 + 4 5.2605597845996610e-02 1.0081774332824270e-02 -3.0969764881211892e-01 + 5 -3.9802063955902828e-01 7.0541551998225649e-01 -7.9105180426906119e-02 + 6 2.0115016302231399e+00 -3.7433268305651115e+00 -2.9688564502920158e+00 + 7 -3.2650169036425236e-01 7.4540116984953042e-01 3.8864116015671808e+00 + 8 -1.6992053224967520e+00 4.1770597030834642e+00 2.4329396564406349e+00 + 9 1.8250267620013743e+00 -5.6775189439742455e+00 1.6562371734234631e+00 + 10 -2.9411864176775349e-01 4.2484150168808632e-01 -2.0454722162066086e-01 + 11 -9.8864600485826815e-01 1.1292383541031983e+00 -5.3894807546123469e-01 + 12 3.3107287761242974e+00 -7.6414239662660099e-01 1.2747075215620911e+00 + 13 -3.8336813011366144e-01 -1.2486400314578122e-02 -9.4718485253563467e-03 + 14 -1.2290837060322926e+00 4.4862678961891689e-01 -1.5069551071827086e-02 + 15 2.2244012017801007e-01 -1.6546887582342559e-01 -9.6944707732754809e-01 + 16 -1.0531155341397860e+00 -3.6654926990083037e-01 2.7960996028622298e+00 + 17 -2.3452245945824948e+00 6.0586966641613316e+00 -7.7701709031633026e+00 + 18 1.2287925114358347e+00 6.6283596097346500e+00 -9.8694991818018014e+00 + 19 1.6548495610099294e+00 -1.6299328734082061e+00 5.6681416753764280e+00 + 20 -3.4405939298489487e+00 -3.1595057592530829e+00 4.2031829943411507e+00 + 21 2.4999236613139768e+00 1.4581441593082431e+00 -1.0498791509490704e+01 + 22 1.5230738475837411e+00 1.0948611353935194e+00 6.7461577757855986e+00 + 23 -4.5208030817248321e+00 -3.8176488387685179e+00 4.2715025892256220e+00 + 24 -2.4424910840260479e+00 9.8889784537097576e+00 -2.3784455147561552e+00 + 25 3.6199382208005479e+00 -3.1023007862101899e+00 3.9803408068580102e+00 + 26 -2.0901080780170158e+00 -7.6586474495008154e+00 -4.6300658746615819e-01 + 27 -2.8661140489132810e+00 1.1127847846706011e+01 -4.4084385064798797e+00 + 28 4.8657388732889295e+00 -5.2969930881855793e+00 4.0790567237989928e+00 + 29 -1.2659132198580254e+00 -6.1822751233574085e+00 9.0587140991575621e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml index 16cf63add..25dfcf21b 100644 --- a/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 16:44:46 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 -9.9836895788385449e-02 1.4297838277829034e-01 -8.3166582485281443e-02 28 1.9219157401333040e-02 -1.2519846747100560e-01 4.0097586180285402e-02 29 1.2624368927628452e-01 -4.3232086807339080e-02 8.4752873604395568e-02 -run_vdwl: 7.26269331801932 -run_coul: -6.97644456126866 +run_vdwl: 8.04574227926329 +run_coul: -6.5763762724911 run_stress: ! |2- - 3.0127651057118101e+01 3.4453839719562993e+01 2.1931283076276625e+01 -2.8900662879329531e+00 -8.5061591823548035e+00 -1.5709082735595215e+01 + 3.2985189723499374e+01 3.8807044085436232e+01 2.4623156057296914e+01 -2.9100443799265778e+00 -9.1414563324874862e+00 -1.7887412154189317e+01 run_forces: ! |2 - 1 1.6556394726179854e-02 -2.7823379429844208e-02 1.4399677662288241e-01 - 2 9.4728034633916783e-02 -9.6607229539929881e-02 -2.1057064241428827e-01 - 3 -9.5252899376491769e+00 9.7744730287893145e+00 6.3175856254776654e+00 - 4 1.3655766591042394e-03 -3.5997743625432767e-03 -2.1349661918632211e-02 - 5 -2.1731377938146137e-02 2.3431645306487836e-02 -4.6654114471729909e-03 - 6 9.5191836369739669e+00 -9.8414923421708664e+00 -6.3311607800906744e+00 - 7 2.3517013080299586e-03 6.4887395872065962e-03 8.0968146370040933e-02 - 8 -6.5838979183396623e-02 1.2723201485976468e-01 -1.4419462918936282e-02 - 9 1.0313127627543547e-01 -2.2472548628113920e-01 2.0855309453153736e-01 - 10 -2.3739961682275993e+01 -2.4021039351345070e+00 -2.5419544715889462e+00 - 11 -4.5692627637436159e-02 5.4310758581633464e-02 -2.1901108463684524e-02 - 12 1.5826336404623913e+01 1.4709948043443138e+01 -1.0255550569951657e+01 - 13 -1.3818470838464466e-02 -1.1232611873072887e-02 3.7144773555590370e-03 - 14 -5.8490465389199123e-02 1.9301559724291283e-02 -1.2702918464188331e-02 - 15 1.2275528798406529e-02 2.7004032851716945e-03 -4.4613261269571644e-02 - 16 8.1200565933619018e+00 -1.2447066846418169e+01 1.2859636395191094e+01 - 17 -1.7638808312729590e-01 3.4818610512262499e-01 -2.7525242695298618e-01 - 18 5.6517864566760591e-02 2.5743689521073448e-01 -8.2783753163049645e-02 - 19 -7.7792613266639957e-02 -1.9170617577268992e-01 3.1577861474679558e-02 - 20 -8.8034975891165858e-03 5.8710275590654226e-02 2.0464803602355808e-02 - 21 8.6237157627901892e-03 -1.3793322582438144e-01 -1.0801683428494860e-01 - 22 -5.2927593667993142e-02 7.9773787719114295e-02 5.4085134651948211e-02 - 23 1.4941691289898021e-02 -3.8796926532710010e-02 8.3574667474682035e-02 - 24 -4.2502706797988267e-02 1.0996091704567368e-01 1.6694289564006998e-01 - 25 -3.4188441462138668e-02 -6.3799095585925017e-02 3.7273979200262057e-04 - 26 2.4230764689621518e-02 -1.0154509989638259e-01 -7.2645178020573520e-02 - 27 -1.0128872753518126e-01 1.4355720870604366e-01 -7.8397657663983225e-02 - 28 3.8620989756577413e-02 -8.3428605295058175e-02 2.2781457173507890e-02 - 29 1.2579503093166530e-01 -4.3650648854632823e-02 8.1730063255268340e-02 + 1 1.6050782507029147e-02 -2.6078730006410714e-02 1.4351800481985966e-01 + 2 1.1625756851986224e-01 -5.4768376297643223e-02 -2.2592663886383685e-01 + 3 -1.0349756210628753e+01 1.0644993045064131e+01 6.9303319136439860e+00 + 4 7.0010623206865231e-04 -3.6201066797243602e-03 -2.0958818087995258e-02 + 5 -2.1957168522498304e-02 2.3207211608700751e-02 -3.9732803093604357e-03 + 6 1.0347224330260305e+01 -1.0716888057317050e+01 -6.9425950369880676e+00 + 7 1.5731989642803266e-03 9.7265357194650758e-03 8.1473555765251809e-02 + 8 -6.8377787421483177e-02 1.2721902691108997e-01 -1.6607896494200122e-02 + 9 1.0421956624441388e-01 -2.2225185783066181e-01 2.0820907177000875e-01 + 10 -2.6511267577231315e+01 -2.5405166099348495e+00 -3.0495615030933045e+00 + 11 -4.5661352137133820e-02 5.3945894119480822e-02 -2.2042288127314943e-02 + 12 1.7536382620480762e+01 1.6537918601653054e+01 -1.1442493368981003e+01 + 13 -1.3284378606505524e-02 -1.1274030516072515e-02 4.2342745200784080e-03 + 14 -5.8444061747007565e-02 1.8998922702114614e-02 -1.2985734039552933e-02 + 15 1.1591841790340096e-02 3.4132627013536230e-03 -4.3365317671842298e-02 + 16 9.1801708625447542e+00 -1.4134796354887596e+01 1.4554847698305965e+01 + 17 -1.7708923141118771e-01 3.4503512413942239e-01 -2.7534181032520555e-01 + 18 5.6845568434139994e-02 2.5589101124313485e-01 -8.8363562421386765e-02 + 19 -8.2311355390861457e-02 -1.9317443144811264e-01 2.9488688134537672e-02 + 20 -5.6015314959625478e-03 6.0630907938511433e-02 2.6654777526122483e-02 + 21 8.3881069431191654e-03 -1.2994355124557430e-01 -1.1236012261174161e-01 + 22 -5.5861541787982381e-02 7.4635151543855763e-02 5.5439560471246166e-02 + 23 1.7966090066570250e-02 -4.0375526008277228e-02 8.6738952068275546e-02 + 24 -4.1728432894936537e-02 1.1200443904426141e-01 1.6705198440321248e-01 + 25 -3.6284183220760165e-02 -6.5412795564482221e-02 -1.3151644909725961e-03 + 26 2.4711102163948260e-02 -1.0304576198044443e-01 -7.1687307197367794e-02 + 27 -1.0003096947578713e-01 1.4305957749357823e-01 -8.2689568194586144e-02 + 28 1.9340533934056076e-02 -1.2523706579407970e-01 3.9829864276751115e-02 + 29 1.2623350288652876e-01 -4.3295456371176447e-02 8.4449072192442673e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_debye.yaml b/unittest/force-styles/tests/mol-pair-coul_debye.yaml index 2c4486f3c..064ea744c 100644 --- a/unittest/force-styles/tests/mol-pair-coul_debye.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_debye.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 28 3.9278723048824835e+00 -2.8448931691021575e+00 2.9712370170163287e+00 29 -2.7543534640139833e+00 -4.6411608299539902e+00 -3.1592271326037225e-01 run_vdwl: 0 -run_coul: -26.7363942698936 +run_coul: -26.1343293229347 run_stress: ! |- - -2.0732300718905861e+01 -1.9209074745869675e+01 -2.3132934645466868e+01 -6.3161596692840760e+00 -5.4218162903831324e+00 1.8861623457646086e+00 + -1.9796181192968501e+01 -1.8919669181296651e+01 -2.3274796553207828e+01 -5.9462383223665567e+00 -4.7655599165740519e+00 2.4302137541325664e+00 run_forces: ! |2 - 1 1.5221613673212682e+00 7.3800582861652264e-01 -1.4999524114545353e+00 - 2 -1.2977101457423323e+00 -1.1351536757967029e+00 1.3705739732396769e+00 - 3 -1.0013043538270892e-02 -6.0455721426990974e-02 -1.4676033848494785e-02 - 4 3.4415934971992510e-02 5.7942614009635740e-02 1.8965829412771400e-02 - 5 -3.9135502371120172e-02 2.9204607516122416e-01 -1.2188105815795465e-02 - 6 1.0593857750297182e+00 -1.6064221683831421e+00 -2.3267602465361232e+00 - 7 -1.7995246298546952e-01 6.1719190001050039e-01 2.1591177995255362e+00 - 8 -3.5709988419546917e-01 1.5341918994251074e+00 2.1825561021316000e+00 - 9 1.6436956489233376e-01 -1.9098273465641575e+00 -1.3157274032006159e+00 - 10 -1.5302763253145099e-01 2.7141741780884138e-01 -4.4002295643011433e-02 - 11 -2.2663349987942388e-01 2.4697401193418389e-01 -1.4711822651519871e-01 - 12 5.4472335745188571e-01 -7.1393516439230018e-02 7.2979513413788610e-02 - 13 -1.8195338755053136e-01 1.1953977747054922e-01 -4.0507894640771681e-02 - 14 -2.6105439639746797e-01 1.1646817811129195e-01 1.9052885304984593e-01 - 15 3.7061248293195743e-02 -2.2178079283709129e-01 -2.4268163708404775e-01 - 16 -7.6109855336212229e-01 3.6533684358971247e-01 2.5580989123824516e+00 - 17 3.0544068227102678e-01 6.8785199669572838e-01 -3.1016871827579484e+00 - 18 -6.3474497067817187e-02 1.8193022154311944e+00 -7.0952130760733230e+00 - 19 2.7720342759037018e+00 1.4220145599321679e+00 4.5030797974110204e+00 - 20 -2.8312706156737448e+00 -3.2802298378463441e+00 2.8682608695623166e+00 - 21 2.1557141464837954e+00 2.5413992048479561e+00 -7.5773752894892388e+00 - 22 2.2537491169301807e+00 2.6262895255920277e-01 5.1461943662033542e+00 - 23 -4.4369961356563552e+00 -2.7738504706350446e+00 2.4653597766730968e+00 - 24 -1.7728065348534996e+00 7.1044021231209342e+00 -4.1311621911261991e+00 - 25 3.9867050947691802e+00 -1.6775751410695763e+00 3.7451066123169614e+00 - 26 -2.3034237209693882e+00 -5.4693551515029633e+00 2.7636944950180270e-01 - 27 -1.2863722526133241e+00 7.7080386685573714e+00 -2.6117844802407251e+00 - 28 4.1449531457084792e+00 -2.9194633807033168e+00 3.0334717611502784e+00 - 29 -2.8186914446389726e+00 -4.7792450640775623e+00 -4.2982714154846891e-01 + 1 1.5054153347379775e+00 6.9883068119619363e-01 -1.5288831160683676e+00 + 2 -1.2700900588762341e+00 -1.0942954058506478e+00 1.3971404178940361e+00 + 3 -9.5647922127033123e-03 -5.9484201629836628e-02 -1.4471617254734686e-02 + 4 3.4132757735131934e-02 5.9038133856109565e-02 2.1926922536915864e-02 + 5 -4.2467066356104165e-02 2.9362372059840602e-01 -1.1413456486652032e-02 + 6 1.0785148418431587e+00 -1.6193064769333489e+00 -2.3669695729318678e+00 + 7 -1.8722721253017702e-01 6.1795448299466305e-01 2.2075496938166670e+00 + 8 -3.9540706480602605e-01 1.5604578720117437e+00 2.1736929223085282e+00 + 9 1.7518420297909387e-01 -1.9044614290421611e+00 -1.3376740802270120e+00 + 10 -1.5294136549513135e-01 2.7484568812465399e-01 -4.0264480261956954e-02 + 11 -2.2873722674868363e-01 2.4840214303953650e-01 -1.5331141867990536e-01 + 12 5.5165085516344814e-01 -7.6933908308673957e-02 6.0558642454570918e-02 + 13 -1.8041539229409415e-01 1.2657188294473340e-01 -4.1485666747339979e-02 + 14 -2.6174571935758034e-01 1.1017739537805640e-01 1.9378665792833361e-01 + 15 3.1394974411260032e-02 -2.1650815503402313e-01 -2.3165892623956708e-01 + 16 -7.5993816212111087e-01 3.5721277572635790e-01 2.5435093094893895e+00 + 17 3.1627331425439353e-01 6.6674574316572122e-01 -3.0606333443394531e+00 + 18 2.9043967376618934e-01 2.1835563151047439e+00 -7.2655529407051809e+00 + 19 2.5092237985129624e+00 1.1863107189539281e+00 4.3780860876606278e+00 + 20 -2.9240013841119548e+00 -3.4073589851669843e+00 3.1665666203158871e+00 + 21 2.0632431473639667e+00 2.6292060008460183e+00 -7.4877116669834098e+00 + 22 2.0515347604841203e+00 1.3190182613875737e-01 5.0360706865484088e+00 + 23 -4.1427436355566423e+00 -2.7300802606020964e+00 2.4865387047443077e+00 + 24 -1.5834142050153466e+00 6.8461769592716388e+00 -3.9390290654702111e+00 + 25 3.6356138064690113e+00 -1.7010427066433258e+00 3.4438245591155008e+00 + 26 -2.1456828072170744e+00 -5.1914222016831300e+00 3.7820036053230066e-01 + 27 -1.1447001850173439e+00 7.5089314418746564e+00 -2.6556671610484832e+00 + 28 3.9424973358275786e+00 -2.8495791288814507e+00 2.9730695452276517e+00 + 29 -2.7560425258320835e+00 -4.6494709214502397e+00 -3.2579461712898655e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_diel.yaml b/unittest/force-styles/tests/mol-pair-coul_diel.yaml index 9ca39e21f..565cd5f7b 100644 --- a/unittest/force-styles/tests/mol-pair-coul_diel.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_diel.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 16:48:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -49,37 +49,37 @@ init_forces: ! |2 28 1.6767931231659799e+02 -7.2921408226350152e+01 1.1368791383676802e+02 29 -1.4216184138962501e+02 -1.6631243169258107e+02 -3.4224951645102870e+01 run_vdwl: 0 -run_coul: -2092.61621052671 +run_coul: -1591.64057163164 run_stress: ! |- - -2.5835542711961170e+02 -4.0830594354577454e+02 -8.0832344995945766e+02 1.6551306630429931e+02 -6.0859844175845382e+01 2.1537987958590304e+02 + -1.1342477067094678e+03 -7.5980312317690573e+02 -1.7706410549187392e+03 -1.5299745851214874e+02 -2.3212824809529764e+02 -1.0602549277167981e+02 run_forces: ! |2 - 1 5.0207261735861927e+01 4.4093840121759534e+01 -5.4843966898253484e+01 - 2 -4.9240956739653328e+01 -4.1348472014801196e+01 5.5832090002875724e+01 - 3 -2.8892070493539128e+00 -2.8293230589520788e+00 -5.5683054464161952e-01 - 4 1.6092163492725446e+00 -4.3232640484940460e-01 1.1715304062750105e+00 - 5 3.2110655492472651e-01 5.0864720336398239e-01 -1.6078702016291260e+00 - 6 2.3252020169366273e+02 -2.1321754275707110e+02 2.7228690450445402e+01 - 7 5.0301322868105167e+00 2.5571822388820774e+01 1.7812213334376412e+02 - 8 -2.0450916247097010e+02 1.8976668464848589e+02 -1.2876074806221098e+02 - 9 -2.2125285294273056e+01 -1.4005381762430083e+01 -7.9778206165934250e+01 - 10 -9.1532664051386838e+00 1.6347005897933350e+01 9.0674827410641790e+00 - 11 -1.5257249690854073e+00 -3.9164663917087243e+00 -6.3481217473734093e+00 - 12 1.2649597033606225e+01 1.3667078715053833e+01 -1.4669183309607776e+01 - 13 -2.3090094450895993e+01 8.7998855993439697e+00 2.8354306696230930e-01 - 14 8.9627215611514579e+00 -1.3782358705138984e+00 2.2845519082416089e+01 - 15 1.1110244249991956e+00 -2.1431648121799217e+01 -8.2160322373480259e+00 - 16 -5.4861609538399563e+01 3.9003052969814945e+01 1.4686184379874288e+02 - 17 5.4984045277480924e+01 -3.9198621162450515e+01 -1.4663187372554722e+02 - 18 -9.7749169667518210e-01 5.7055448637731878e+01 -2.5802459627857917e+02 - 19 6.8992902062645143e+01 2.9955230922360169e+01 1.5034324025620501e+02 - 20 -6.8015410365970098e+01 -8.7010679560092086e+01 1.0768135602237436e+02 - 21 7.4727897615920085e+01 8.2648732368076963e+01 -2.5978639132895773e+02 - 22 -6.6463839603807656e+01 -5.4094367992894824e+01 1.1602527437490761e+02 - 23 -8.2640580121124287e+00 -2.8554364375182132e+01 1.4376111695405010e+02 - 24 -6.2543493971558348e+01 2.3879742647042542e+02 -1.4037567194054481e+02 - 25 -1.1982132618469649e+01 -1.4514958652416922e+02 4.5739839007275478e+01 - 26 7.4525626590027940e+01 -9.3647839946256227e+01 9.4635832933269256e+01 - 27 -4.1919989608558296e+01 2.6320965441100014e+02 -8.6870900359954021e+01 - 28 6.3606406332803829e+00 -1.3867824190866168e+02 3.7007526659684544e+01 - 29 3.5559348975277913e+01 -1.2453141250233848e+02 4.9863373700269470e+01 + 1 5.3967736691136487e+01 4.6806868442126337e+01 -6.0833703838776778e+01 + 2 -5.2890524441131120e+01 -4.3613263166582961e+01 6.2030275425098544e+01 + 3 -2.9168018642878404e+00 -3.3449404287486968e+00 -7.7315416810591864e-01 + 4 1.5900434708282254e+00 -4.4290193019530966e-01 1.1306331231797124e+00 + 5 3.2641168469461762e-01 5.1517567326381986e-01 -1.6054994139559349e+00 + 6 2.4407731257350011e+02 -2.7948457749076852e+02 -3.1505359339826737e+02 + 7 -1.8254441820991811e+01 9.4878854168139455e+01 4.7316314017882826e+02 + 8 -1.8546142364742033e+02 1.8082943251399669e+02 -8.2515788299012144e+01 + 9 -1.8791692607073657e+01 -2.0060510131969892e+01 -8.2899465152476751e+01 + 10 -2.0257737600068879e+01 2.8093638140748716e+01 1.1847127455694688e+01 + 11 -1.3087128656423925e+00 -3.2430366839494682e+00 -5.3191562570746411e+00 + 12 1.5940921217796108e+01 1.7615190208028327e+01 -1.6555319273209587e+01 + 13 -2.7109365542166685e+01 1.0669846417503223e+01 5.0320100658458933e-01 + 14 9.9900751886894277e+00 -1.9985059964263956e+00 2.5898002924436362e+01 + 15 7.5249905962776675e-01 -2.6692621444821331e+01 -9.5643506931421616e+00 + 16 -1.6376691897966862e+02 1.1413429201085633e+02 4.3615151466892740e+02 + 17 1.6411261948218052e+02 -1.1466294030119970e+02 -4.3560386428872823e+02 + 18 1.4639676372728185e+00 5.8907074778154040e+01 -2.5598577283090773e+02 + 19 1.3493774015706077e+02 8.6395200919369742e+01 1.6378089040602865e+02 + 20 -1.3640170779433461e+02 -1.4530227569752387e+02 9.2204882424880580e+01 + 21 6.2540682068012757e+01 7.8920002681751356e+01 -2.3995131183155840e+02 + 22 1.1579109480209155e+02 2.7892535922807493e+01 1.8303504531140456e+02 + 23 -1.7833177687010431e+02 -1.0681253860455885e+02 5.6916266520153826e+01 + 24 -5.7126132920864578e+01 2.1230331836712858e+02 -1.2816536852541861e+02 + 25 1.6659877087406062e+02 -2.7261333208044462e+01 1.4041940315559930e+02 + 26 -1.0947263795319692e+02 -1.8504198515908456e+02 -1.2254034630182193e+01 + 27 -2.5808393703604480e+01 2.3743056739188282e+02 -7.8536503954124697e+01 + 28 1.6677406715349974e+02 -7.2382640312422396e+01 1.1283174142442391e+02 + 29 -1.4096567344989526e+02 -1.6504792707946041e+02 -3.4295237470299213e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_dsf.yaml b/unittest/force-styles/tests/mol-pair-coul_dsf.yaml index f91fc42ba..b586a73bb 100644 --- a/unittest/force-styles/tests/mol-pair-coul_dsf.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_dsf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 1e-12 prerequisites: ! | atom full @@ -50,37 +50,37 @@ init_forces: ! |2 28 4.4993862952213046e+00 -4.6997333684039182e+00 3.7669887588771984e+00 29 -1.7919023403128935e+00 -6.2865597340851354e+00 3.1996268167139896e-01 run_vdwl: 0 -run_coul: -117.261868355649 +run_coul: -116.316659290258 run_stress: ! |- - -2.4835437251658863e+01 -4.4541508533251616e+01 -4.0539173849400385e+01 4.4718873975737230e+00 -7.2757946935143565e+00 9.6680925269163058e+00 + -2.3519522188558341e+01 -4.4269932768479741e+01 -4.0933175350698548e+01 5.0512182532098944e+00 -6.3318312229387574e+00 1.0364966661114028e+01 run_forces: ! |2 - 1 2.5264739936457774e+00 -3.5349115107621693e-01 5.2968492668371270e-01 - 2 -2.1644835351460373e-01 -3.0494016245517774e+00 -1.4761763741851357e+00 - 3 7.8557998538647533e-05 -9.0782772520745819e-02 2.8647471657112955e-02 - 4 -1.5581543977692826e-02 2.7348490345169479e-02 -3.0157314588147172e-01 - 5 -4.7638630379957447e-01 7.0484642826088451e-01 -1.0673629414733561e-01 - 6 1.6933640937840126e+00 -3.6363991593382532e+00 -2.9943331090047010e+00 - 7 -2.0589895105213518e-01 6.8253707845726119e-01 4.0359957762514922e+00 - 8 -1.5353789959160238e+00 4.1710482036532825e+00 2.6915009267303547e+00 - 9 1.7087994127140180e+00 -5.7243484166606571e+00 1.4839205236071202e+00 - 10 -2.6316779350407588e-01 3.9689045331236816e-01 -2.7650652507928281e-01 - 11 -9.3411964246483492e-01 1.1019014779925247e+00 -6.0367081113757226e-01 - 12 3.0199259101956861e+00 -6.8575303259281783e-01 1.5805470950435241e+00 - 13 -1.2328524349057027e-01 3.6130355311534329e-02 -2.0249625811993430e-01 - 14 -1.1276376313960275e+00 4.3647116924972529e-01 -1.1549603587311816e-01 - 15 3.1919490371467302e-01 -1.7075524156810862e-01 -1.0791969234575223e+00 - 16 -7.9425558761612802e-01 -3.9123467534596695e-01 2.1007542237885417e+00 - 17 -2.4727234591692810e+00 6.1784821009411228e+00 -7.1232388356230096e+00 - 18 1.1361459605497989e-01 5.0270725613929717e+00 -8.2174283291267187e+00 - 19 2.3419855554035678e+00 -7.3442231652208279e-01 6.0994037191234867e+00 - 20 -2.9518304935422548e+00 -4.1534972920682582e+00 3.9962641207541236e+00 - 21 2.0495708863658444e+00 4.6441219130208005e+00 -9.4697355025312433e+00 - 22 2.1031543652318185e+00 -5.0227443858874676e-01 6.3379751524503112e+00 - 23 -4.6112536769802821e+00 -3.6693539959050474e+00 3.6768985211164438e+00 - 24 -1.8961506392790932e+00 1.0361933129644495e+01 -5.6412783530701089e+00 - 25 3.6317311911578263e+00 -3.2477861735091622e+00 4.0176691355235707e+00 - 26 -2.2733448884903922e+00 -7.3197472946275193e+00 1.0396360380063099e+00 - 27 -2.5160754653215793e+00 1.1212553676515755e+01 -4.0078310113253046e+00 - 28 4.8077230678349530e+00 -4.7963868170060717e+00 3.8416539656252633e+00 - 29 -1.9020778645871468e+00 -6.4557026362164613e+00 1.5514591220109011e-01 + 1 2.5258976000701256e+00 -3.7288014210100567e-01 5.3513963043452173e-01 + 2 -1.4715866954912132e-01 -3.0264608376618756e+00 -1.4894414652235879e+00 + 3 1.0499334611855839e-03 -8.8875115034698859e-02 3.0280805398836083e-02 + 4 -2.4189187088159807e-02 3.0252262839385820e-02 -2.9826027272555228e-01 + 5 -4.8867928406987493e-01 7.0581152066390695e-01 -1.0225843190468716e-01 + 6 1.7338129556284032e+00 -3.6553529462648395e+00 -3.0871837052174924e+00 + 7 -2.4591880354215465e-01 6.9285525309209972e-01 4.1380438652288145e+00 + 8 -1.6193036137723393e+00 4.2062803365259169e+00 2.7079670953998445e+00 + 9 1.7251151021987865e+00 -5.6500640133558226e+00 1.3947814099879134e+00 + 10 -2.6093175344149183e-01 4.0329389268696469e-01 -2.6964107951589344e-01 + 11 -9.3431466446895450e-01 1.0985184897232450e+00 -6.1888106515687957e-01 + 12 3.0287021668327263e+00 -7.0433773867478511e-01 1.5692003169951105e+00 + 13 -1.1503855090924842e-01 4.5047144575577770e-02 -2.0284261715887472e-01 + 14 -1.1262739966567483e+00 4.2950852210485563e-01 -1.2226298556480060e-01 + 15 3.0586183043586629e-01 -1.4976407410934928e-01 -1.0601740079323845e+00 + 16 -7.8459974914580832e-01 -3.8543387918414884e-01 2.0794229041268872e+00 + 17 -2.4480099887224087e+00 6.0527077647803367e+00 -7.0277150479891954e+00 + 18 5.1790874812027476e-01 5.4622875048238244e+00 -8.4646612303200310e+00 + 19 1.9595881218021158e+00 -1.0576912044630822e+00 5.9364949108432512e+00 + 20 -2.9825806250079405e+00 -4.2593912974143793e+00 4.4200019207835490e+00 + 21 1.9207773432521598e+00 4.8208814003119764e+00 -9.3758635653143028e+00 + 22 1.8104680751759934e+00 -7.1506330770416415e-01 6.1985139972675736e+00 + 23 -4.1994389560443004e+00 -3.6148470628092020e+00 3.7335976747308113e+00 + 24 -1.6771737529589250e+00 1.0048025115527503e+01 -5.4155191253207562e+00 + 25 3.1768175364507591e+00 -3.3033385325912215e+00 3.6279828488037653e+00 + 26 -2.0583166577041081e+00 -6.9742608614406336e+00 1.1712068555836355e+00 + 27 -2.3176898499453351e+00 1.0965693092469477e+01 -4.0813802475201326e+00 + 28 4.5181378359184414e+00 -4.7061625417874433e+00 3.7671102530368570e+00 + 29 -1.7945191463199177e+00 -6.2972387455284125e+00 3.0634035824320066e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_long.yaml b/unittest/force-styles/tests/mol-pair-coul_long.yaml index 18064d3a5..884599ba7 100644 --- a/unittest/force-styles/tests/mol-pair-coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -55,37 +55,37 @@ init_forces: ! |2 28 4.3293158199317929e+00 -4.2323357617765147e+00 3.5451234960435416e+00 29 -1.9216850387532598e+00 -5.8096129144977837e+00 1.1529557105947399e-01 run_vdwl: 0 -run_coul: 224.909639556406 +run_coul: 225.77204969693 run_stress: ! |- - -2.4177687450956277e+01 -4.3228791078721606e+01 -3.8432663130184878e+01 3.8956865142029145e+00 -7.5417694404634359e+00 8.9949556191402547e+00 + -2.2879015704740524e+01 -4.2864538419179809e+01 -3.8706402302178340e+01 4.4580847142714477e+00 -6.6095294971406071e+00 9.6124862794454575e+00 run_forces: ! |2 - 1 2.7109657160262515e+00 -3.6201485933878924e-01 3.0781850446095560e-01 - 2 -3.1547425186471290e-01 -2.9225837882796721e+00 -1.3102562699895977e+00 - 3 1.2440790885304519e-02 -8.6206074730236351e-02 1.3270332936516607e-02 - 4 -7.1953113246056924e-02 1.5675556981555788e-02 -2.4547723635143864e-01 - 5 -5.2622831359691469e-01 6.6333462463161907e-01 -7.3639026129573543e-02 - 6 1.4614329674374775e+00 -3.8541251085179087e+00 -2.4608111536106447e+00 - 7 -4.3961513312929787e-02 8.7400067762974210e-01 3.7021917668058246e+00 - 8 -1.4843945092088080e+00 4.4911188687763941e+00 2.3473571787371985e+00 - 9 1.6148067652081364e+00 -5.8867824690539940e+00 1.5179656963402448e+00 - 10 -2.4457505539486776e-01 3.4620195878556015e-01 -2.4227310794460818e-01 - 11 -8.9962097356447135e-01 1.0300984124552697e+00 -5.4674544632969768e-01 - 12 2.8517300538076422e+00 -4.6397503398552714e-01 1.4379847883945076e+00 - 13 -8.2902510553543682e-02 -1.8153939948291717e-02 -1.7588995801666132e-01 - 14 -1.0565639508858879e+00 3.6536129934773104e-01 -8.7292743829377947e-02 - 15 3.6852732464028037e-01 -2.2242606503809276e-01 -1.0312041024499539e+00 - 16 -7.3889472669779188e-01 -5.2111408107618262e-01 1.9426908308091160e+00 - 17 -2.4555705132945458e+00 6.3034467113265586e+00 -6.7474058925207725e+00 - 18 -1.0336964431550867e-01 4.3012481816977619e+00 -7.6231494717237132e+00 - 19 2.4118643341067236e+00 -3.6910048279464569e-01 5.7130691523360300e+00 - 20 -2.8494121604229754e+00 -3.8456743487331444e+00 3.6585476912066213e+00 - 21 2.0416875811779365e+00 4.2101044485144969e+00 -9.0267699177025378e+00 - 22 2.1218587474923298e+00 -3.5562793436448115e-01 6.0768492170012758e+00 - 23 -4.5631530592159937e+00 -3.4639073803318272e+00 3.4347836551997912e+00 - 24 -1.8208984990830235e+00 9.5312473429069744e+00 -5.2832129304472817e+00 - 25 3.5479661742036712e+00 -2.8963045491118997e+00 3.8431111312116171e+00 - 26 -2.2582465472670314e+00 -6.8576799168649503e+00 8.8016091029922594e-01 - 27 -2.2318807440921171e+00 1.0309673551055681e+01 -3.6137305376391500e+00 - 28 4.6284601915512180e+00 -4.3315145423319015e+00 3.6242202977164215e+00 - 29 -2.0246405605197868e+00 -5.9843210596078027e+00 -3.2163358770335049e-02 + 1 2.7152070954400989e+00 -3.8535756511867636e-01 3.1353916077190680e-01 + 2 -2.4897493210584251e-01 -2.8919706918222232e+00 -1.3238616897535056e+00 + 3 1.3593021114561996e-02 -8.4182843604158092e-02 1.4907389728891364e-02 + 4 -8.0235613079270962e-02 1.7933045056896774e-02 -2.4193235368961732e-01 + 5 -5.3961349096385514e-01 6.6392493615929837e-01 -7.0018267321363931e-02 + 6 1.4953413467763614e+00 -3.8784817457305438e+00 -2.5571794432695345e+00 + 7 -8.0769449574364591e-02 8.8768858548462626e-01 3.8075271196268932e+00 + 8 -1.5603802456548008e+00 4.5308707198240743e+00 2.3676241154041695e+00 + 9 1.6239551552265754e+00 -5.8163354720142104e+00 1.4245483057943482e+00 + 10 -2.4316707026927847e-01 3.5280676219369833e-01 -2.3605449645579366e-01 + 11 -9.0077241090177584e-01 1.0278081676199378e+00 -5.6223541632808260e-01 + 12 2.8604610860999227e+00 -4.8095026764865145e-01 1.4303891092258765e+00 + 13 -7.4617438284707835e-02 -9.0352658649546364e-03 -1.7768192206725944e-01 + 14 -1.0548492470568465e+00 3.5774891222314620e-01 -9.5058168374419827e-02 + 15 3.5598753464184141e-01 -2.0223991493613130e-01 -1.0135801686950703e+00 + 16 -7.3568889315468022e-01 -5.1206831275202358e-01 1.9209438671429868e+00 + 17 -2.4234386146020599e+00 6.1787769683462139e+00 -6.6468971929277663e+00 + 18 3.2276285635575880e-01 4.7486600851026308e+00 -7.8459996135323715e+00 + 19 2.0276089782265463e+00 -6.9074288314344190e-01 5.5364926662546914e+00 + 20 -2.8990827716449217e+00 -3.9654571603549051e+00 4.0720884279524601e+00 + 21 1.9107865496627854e+00 4.3524489023652277e+00 -8.9066047296094961e+00 + 22 1.8377631235990368e+00 -5.5000731457532015e-01 5.9251863722007823e+00 + 23 -4.1559059263253060e+00 -3.3977003366300726e+00 3.4762190243030173e+00 + 24 -1.5922274230091398e+00 9.1889856356835189e+00 -5.0412678939177846e+00 + 25 3.0927918643531056e+00 -2.9316139886858892e+00 3.4477458259679166e+00 + 26 -2.0518158378136868e+00 -6.5022573392462704e+00 9.9964664018626870e-01 + 27 -2.0380210633816347e+00 1.0050296882330244e+01 -3.6676074009822237e+00 + 28 4.3477809651802204e+00 -4.2390804459845794e+00 3.5462693828850469e+00 + 29 -1.9244791488546378e+00 -5.8204680542774661e+00 1.0285134947904022e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_long_cs.yaml b/unittest/force-styles/tests/mol-pair-coul_long_cs.yaml index 777d006c8..164acce93 100644 --- a/unittest/force-styles/tests/mol-pair-coul_long_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_long_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -54,37 +54,37 @@ init_forces: ! |2 28 4.3292998774941402e+00 -4.2323275460559282e+00 3.5451123273065317e+00 29 -1.9216731797611686e+00 -5.8095974998011188e+00 1.1529822641872207e-01 run_vdwl: 0 -run_coul: 224.909791595302 +run_coul: 225.772191836741 run_stress: ! |- - -2.4177602814292069e+01 -4.3228752825592032e+01 -3.8432597525320709e+01 3.8957271613479412e+00 -7.5417472236596073e+00 8.9949599403585125e+00 + -2.2878937289293937e+01 -4.2864502634905364e+01 -3.8706337905477625e+01 4.4581228060192499e+00 -6.6095114178790277e+00 9.6124884782943258e+00 run_forces: ! |2 - 1 2.7109612254885977e+00 -3.6201808835192451e-01 3.0782343996496409e-01 - 2 -3.1547033848566997e-01 -2.9225831340716777e+00 -1.3102611125750512e+00 - 3 1.2440883438640870e-02 -8.6206239949923519e-02 1.3270160992097497e-02 - 4 -7.1953310564946832e-02 1.5675914712206078e-02 -2.4547713670936208e-01 - 5 -5.2622847952600738e-01 6.6333495264194897e-01 -7.3638944753004559e-02 - 6 1.4614323529841164e+00 -3.8541246848405040e+00 -2.4608061329561579e+00 - 7 -4.3960561894726351e-02 8.7400024647297159e-01 3.7021884749324676e+00 - 8 -1.4843979005923720e+00 4.4911176200388567e+00 2.3473494125841738e+00 - 9 1.6148096644287326e+00 -5.8867831951190617e+00 1.5179754686017131e+00 - 10 -2.4457485596029208e-01 3.4620222522117688e-01 -2.4227354094872239e-01 - 11 -8.9962085609084486e-01 1.0300989098518474e+00 -5.4674509659548587e-01 - 12 2.8517309657923398e+00 -4.6397498005356264e-01 1.4379840578432590e+00 - 13 -8.2902159761750971e-02 -1.8154693098295965e-02 -1.7588960755143909e-01 - 14 -1.0565638126860279e+00 3.6536084059055074e-01 -8.7293264927138903e-02 - 15 3.6852796428469686e-01 -2.2242575972581050e-01 -1.0312037660015649e+00 - 16 -7.3889369977643693e-01 -5.2111425813025991e-01 1.9426871642187142e+00 - 17 -2.4555731608117699e+00 6.3034509950719739e+00 -6.7474052127708477e+00 - 18 -1.0336891622024783e-01 4.3012434383628984e+00 -7.6231266860662128e+00 - 19 2.4118529748326991e+00 -3.6910752315943762e-01 5.7130543603350770e+00 - 20 -2.8494011970062618e+00 -3.8456626213963014e+00 3.6585393754647328e+00 - 21 2.0416794886091147e+00 4.2100965090459708e+00 -9.0267438408601972e+00 - 22 2.1218478911513245e+00 -3.5563073610421903e-01 6.0768302748052614e+00 - 23 -4.5631340939868421e+00 -3.4638965036055742e+00 3.4347765105210448e+00 - 24 -1.8208924300115101e+00 9.5312229206385819e+00 -5.2831993407682569e+00 - 25 3.5479490574878976e+00 -2.8963008802866534e+00 3.8430963580027671e+00 - 26 -2.2582352589715415e+00 -6.8576589362093694e+00 8.8016209210122176e-01 - 27 -2.2318760687242349e+00 1.0309647811450557e+01 -3.6137215368153903e+00 - 28 4.6284423963048207e+00 -4.3315057221698003e+00 3.6242081942246904e+00 - 29 -2.0246277637314947e+00 -5.9843044278271638e+00 -3.2160124293355415e-02 + 1 2.7152026455335023e+00 -3.8536072080446226e-01 3.1354409555002505e-01 + 2 -2.4897113736868351e-01 -2.8919701938956996e+00 -1.3238665043040136e+00 + 3 1.3593115768741441e-02 -8.4183008629867287e-02 1.4907215803298637e-02 + 4 -8.0235803315449522e-02 1.7933404905601205e-02 -2.4193225664141646e-01 + 5 -5.3961366263356447e-01 6.6392526859869250e-01 -7.0018177782189300e-02 + 6 1.4953406051359934e+00 -3.8784812285434622e+00 -2.5571743077124962e+00 + 7 -8.0768462984023806e-02 8.8768816194214184e-01 3.8075236547498643e+00 + 8 -1.5603835423686825e+00 4.5308693110585008e+00 2.3676164068628238e+00 + 9 1.6239579878461774e+00 -5.8163359871664122e+00 1.4245580562186968e+00 + 10 -2.4316687759500349e-01 3.5280702308272538e-01 -2.3605494352722844e-01 + 11 -9.0077229505784262e-01 1.0278086826586754e+00 -5.6223506350814789e-01 + 12 2.8604619983023358e+00 -4.8095019592693028e-01 1.4303884361918779e+00 + 13 -7.4617070016519585e-02 -9.0360389427034914e-03 -1.7768156359409124e-01 + 14 -1.0548491188897153e+00 3.5774845017276408e-01 -9.5058739754223159e-02 + 15 3.5598818242578689e-01 -2.0223962830157247e-01 -1.0135798304973809e+00 + 16 -7.3568790094320835e-01 -5.1206844741845770e-01 1.9209403201252107e+00 + 17 -2.4234411439389181e+00 6.1787811104042127e+00 -6.6468966077923710e+00 + 18 3.2276160113885649e-01 4.7486534292429958e+00 -7.8459768170016826e+00 + 19 2.0275987621872908e+00 -6.9074895984218421e-01 5.5364788443272115e+00 + 20 -2.8990709502495311e+00 -3.9654445034343486e+00 4.0720790859942770e+00 + 21 1.9107792297780513e+00 4.3524411012535236e+00 -8.9065801261840463e+00 + 22 1.8377534440588030e+00 -5.5000959061575849e-01 5.9251686132757255e+00 + 23 -4.1558889013375939e+00 -3.3976901328966846e+00 3.4762121542270044e+00 + 24 -1.5922224610932063e+00 9.1889636773137475e+00 -5.0412559385114006e+00 + 25 3.0927773690736706e+00 -2.9316103044748538e+00 3.4477332778869569e+00 + 26 -2.0518060372271414e+00 -6.5022388100702369e+00 9.9964726077645183e-01 + 27 -2.0380172514129269e+00 1.0050272916324426e+01 -3.6675987688214153e+00 + 28 4.3477649316076707e+00 -4.2390722015733342e+00 3.5462581781964069e+00 + 29 -1.9244672564248668e+00 -5.8204525844210409e+00 1.0285404544626625e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml index fa47d9484..c1a683271 100644 --- a/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 16:47:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 3e-13 prerequisites: ! | atom full @@ -63,38 +63,38 @@ init_forces: ! |2 27 -1.4965727761262813e-03 2.5382973054268645e-03 -1.1621717469704692e-03 28 5.3244608348053033e-04 -1.5238550051417405e-03 6.4940813491634836e-04 29 1.6207581161454922e-03 -1.1057207815271884e-03 5.2719941898918515e-04 -run_vdwl: 7.26365406475285 -run_coul: 0.248568703723301 +run_vdwl: 8.04575303732549 +run_coul: 0.250424874957335 run_stress: ! |2- - 3.0455458551527069e+01 3.6060658785946110e+01 2.3963060954014825e+01 -3.0917610764641701e+00 -8.3692413122878833e+00 -1.5762259681730853e+01 + 3.3248117757660225e+01 4.0121187333028409e+01 2.6631046971692410e+01 -3.2415913680324784e+00 -8.9641268171316373e+00 -1.7836648325526387e+01 run_forces: ! |2 - 1 -1.2241448393434258e-02 2.5678835346021285e-02 8.6551025659508465e-03 - 2 2.2141682262831661e-03 -3.4548192779372483e-03 -5.6358894590200119e-03 - 3 -9.5274258203311106e+00 9.7780244611750256e+00 6.3165209597242820e+00 - 4 -3.2811588830172249e-06 -2.6819228515587412e-05 -2.1518475973500507e-04 - 5 -7.7415759108086647e-04 6.4407102146438666e-04 -4.0525139680045488e-04 - 6 9.4737117718410655e+00 -9.7260810517073768e+00 -6.3285042083939871e+00 - 7 7.0425307253221521e-03 5.7709245539115696e-03 4.7653372189467146e-03 - 8 1.1398612415401431e-02 -2.3627301955902472e-02 -4.8618995958358531e-03 - 9 2.3359916535966785e-03 -5.0329472804706947e-03 4.7522391301401462e-03 - 10 -2.3734753080885344e+01 -2.4097202312244441e+00 -2.5316780905568450e+00 - 11 -7.2829817664630018e-04 1.9125242121991804e-03 -9.2494743303999445e-04 - 12 1.5659329657060242e+01 1.4751610959352956e+01 -1.0328793684751705e+01 - 13 -4.4580690123627005e-04 4.5558037008791715e-05 -3.8438956158700824e-04 - 14 -9.5984490482516126e-04 7.9693734429197576e-05 3.5395752765417639e-04 - 15 3.1625630081963450e-04 -6.6553770631136617e-04 -1.5826845213627427e-03 - 16 8.1343632186169703e+00 -1.2399514212841058e+01 1.2873016002623592e+01 - 17 -7.1074247952365261e-03 1.1926215502945592e-02 -1.1009929932674739e-02 - 18 -4.5970055016503111e-03 -3.6143197105911154e-03 3.9584488744033308e-03 - 19 -8.3200916550028306e-04 -3.4741972394973001e-03 1.2266616877061479e-03 - 20 7.4081426229622829e-05 -8.7350906552230933e-04 4.9764218126009034e-04 - 21 -1.1906009089604943e-03 2.5756563144885654e-03 -4.2302404729008136e-07 - 22 8.1412767645127314e-05 -8.7201669043244362e-04 4.3407541600694560e-04 - 23 3.0266704925954112e-04 -9.3347119735523009e-04 5.3885441015159310e-04 - 24 5.4003503505448407e-04 2.3414457884219351e-03 -8.7864315011120843e-04 - 25 -1.1998517807961144e-03 -1.2195798451887995e-03 -3.9268574712746714e-04 - 26 -9.4397579697665411e-05 -1.4188935351813869e-03 5.4472747495768327e-04 - 27 -1.5112178836960491e-03 2.5509163238533351e-03 -1.1115968431743000e-03 - 28 5.6209546531181933e-04 -1.5103589786084138e-03 6.2212850427396894e-04 - 29 1.5917473748970931e-03 -1.1219938783333908e-03 4.9337178773007230e-04 + 1 -1.2621618633247523e-02 2.6445311660778285e-02 8.8455538620465859e-03 + 2 2.2813863905827383e-03 -3.4676792234678987e-03 -5.6871974246311824e-03 + 3 -1.0349444852930485e+01 1.0646088700807303e+01 6.9275811645214400e+00 + 4 -5.9855855441538127e-06 -2.7358483128221356e-05 -2.0239976432235362e-04 + 5 -7.7980828944355278e-04 6.4238697608266836e-04 -4.1223289414248754e-04 + 6 1.0297653308090030e+01 -1.0596642642101703e+01 -6.9391771198065610e+00 + 7 7.0596271162234594e-03 5.8416136587964747e-03 4.8304400482313600e-03 + 8 1.1743467937318373e-02 -2.4368370371460474e-02 -4.9929709211399241e-03 + 9 2.3377563446109616e-03 -4.9843785266564357e-03 4.7274934895631584e-03 + 10 -2.6504272816622205e+01 -2.5467737861189477e+00 -3.0404980344006880e+00 + 11 -7.3132449972175616e-04 1.9046934954095444e-03 -9.3201958960163343e-04 + 12 1.7368456567504101e+01 1.6578004412953426e+01 -1.1513126562551951e+01 + 13 -4.4707924824132682e-04 6.4701902774150319e-05 -3.9403068037557724e-04 + 14 -9.3064708097139522e-04 9.9320520432717352e-05 3.6413397577619475e-04 + 15 2.9266369831891845e-04 -6.6901023144687961e-04 -1.6065216859902415e-03 + 16 9.1928705075653845e+00 -1.4086392215977925e+01 1.4565742062506375e+01 + 17 -7.1347150355124183e-03 1.1872210024815300e-02 -1.0988299865763104e-02 + 18 -4.6090959178726422e-03 -3.6846444287922811e-03 3.9249678187756780e-03 + 19 -8.3580317458288188e-04 -3.4249225601077926e-03 1.1996378615643690e-03 + 20 5.1737152983203196e-05 -9.0524987008056012e-04 5.7171495062024525e-04 + 21 -1.1981858486129239e-03 2.6620938163051341e-03 -3.3107989726000896e-05 + 22 5.6578657221595620e-05 -9.1210109274013460e-04 4.5407292683930536e-04 + 23 3.2723037850410048e-04 -9.5765039235482441e-04 5.5955166867300589e-04 + 24 5.6376243719201738e-04 2.3627626804375531e-03 -8.6222231333610679e-04 + 25 -1.2623616561313598e-03 -1.2638134934896206e-03 -4.6679133642703828e-04 + 26 -7.4995088247149954e-05 -1.4225922922816211e-03 5.6487216135638453e-04 + 27 -1.4983516556868650e-03 2.5396068270423181e-03 -1.1571072673648762e-03 + 28 5.3486582538735746e-04 -1.5239493387790301e-03 6.4718455654824616e-04 + 29 1.6181821686505897e-03 -1.1074508202444796e-03 5.2376814420771888e-04 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_msm.yaml b/unittest/force-styles/tests/mol-pair-coul_msm.yaml index 1661e3b7d..83e633d42 100644 --- a/unittest/force-styles/tests/mol-pair-coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,37 +56,37 @@ init_forces: ! |2 28 4.6868038343367324e+00 -5.1092484627949588e+00 3.9981377814736256e+00 29 -1.6656557300256520e+00 -6.6361744834632246e+00 5.1318676181502421e-01 run_vdwl: 0 -run_coul: 113.058275915621 +run_coul: 114.073732191852 run_stress: ! |- - -2.5695959459059903e+01 -4.5981163670332165e+01 -4.2433702831593934e+01 4.9052469418880120e+00 -7.1301489107310783e+00 1.0197236878083897e+01 + -2.4369860466323860e+01 -4.5768876443818435e+01 -4.2913169324790253e+01 5.5285317121469078e+00 -6.1771738134590590e+00 1.0942889304741621e+01 run_forces: ! |2 - 1 2.3257707680581112e+00 -3.0941336340598180e-01 6.5879977035669657e-01 - 2 -1.3947440143357007e-01 -3.1637607682942153e+00 -1.5506784217020082e+00 - 3 -1.3501459837129351e-02 -9.4693313819328565e-02 3.9215383972458911e-02 - 4 4.4390325890852268e-02 3.7461282908092169e-02 -3.4679112610166390e-01 - 5 -4.1240510929778024e-01 7.3494995912218164e-01 -1.3401800128741961e-01 - 6 1.9229818086142780e+00 -3.4765252263748523e+00 -3.3275985636150849e+00 - 7 -3.2865466163966656e-01 5.2742963614088179e-01 4.2528726901673508e+00 - 8 -1.6241606017118224e+00 3.9340616378562987e+00 2.8844869968769271e+00 - 9 1.7990485359061625e+00 -5.5959888305461476e+00 1.4618557782995310e+00 - 10 -2.7761090830631663e-01 4.4114683648260772e-01 -2.9059114451132745e-01 - 11 -9.6058004793649865e-01 1.1580598818661270e+00 -6.2754031455922199e-01 - 12 3.1741794393274620e+00 -8.4292213427956075e-01 1.6107420372089416e+00 - 13 -1.8014385045482115e-01 7.9043417736362892e-02 -1.9737482140352569e-01 - 14 -1.1875092158587197e+00 4.8600215697145560e-01 -1.1399760925591533e-01 - 15 2.7386113298990328e-01 -1.4253750156078876e-01 -1.0907260268397767e+00 - 16 -8.7550733779057743e-01 -2.3897365239612584e-01 2.2704718792724470e+00 - 17 -2.4705765694223767e+00 6.0345388735728447e+00 -7.4206361562591194e+00 - 18 3.7629548772825072e-01 5.6654721426313861e+00 -8.7189930954035635e+00 - 19 2.2635603443602026e+00 -1.0437750912632295e+00 6.3986651700010313e+00 - 20 -3.1041979248087230e+00 -4.4566393135574707e+00 4.2630597429452211e+00 - 21 2.1685842919313907e+00 4.8958241736387942e+00 -9.8875398979382254e+00 - 22 2.0543359042284735e+00 -5.7288028523336854e-01 6.5771296555274299e+00 - 23 -4.7062449920642138e+00 -3.8094491510487254e+00 3.8689547447821786e+00 - 24 -1.9486310953135175e+00 1.1028753184737154e+01 -5.7541888913447776e+00 - 25 3.7178613793477506e+00 -3.4866927689582266e+00 4.1071469225364883e+00 - 26 -2.3505728478586123e+00 -7.6942427732895267e+00 1.0642773408897548e+00 - 27 -2.7656634085957443e+00 1.1908437182381663e+01 -4.3968858750106383e+00 - 28 5.0074553141505680e+00 -5.2000177034736668e+00 4.0672947171032261e+00 - 29 -1.7828903002033130e+00 -6.8026684885446400e+00 3.3258711529258089e-01 + 1 2.3180621955283938e+00 -3.2609981574090857e-01 6.5939964218076752e-01 + 2 -6.4032196871323638e-02 -3.1424821514471439e+00 -1.5620651293790369e+00 + 3 -1.2785166681925465e-02 -9.2867011846349282e-02 4.0653874578113175e-02 + 4 3.5863428871473264e-02 4.0897861843014513e-02 -3.4308089672094960e-01 + 5 -4.2318069530721597e-01 7.3617025920409984e-01 -1.2804656835436440e-01 + 6 1.9715254991723985e+00 -3.4917374060986712e+00 -3.4128661557470630e+00 + 7 -3.7302025113238069e-01 5.3593586809586213e-01 4.3483007350658474e+00 + 8 -1.7175871841302215e+00 3.9668842346959479e+00 2.8927612548319437e+00 + 9 1.8233431096657253e+00 -5.5196894352295809e+00 1.3791831311941298e+00 + 10 -2.7432505293593845e-01 4.4724094527867309e-01 -2.8245537320307923e-01 + 11 -9.5952936990359672e-01 1.1533366921938331e+00 -6.4162391887289449e-01 + 12 3.1818989685273795e+00 -8.6185214608354188e-01 1.5927361289487900e+00 + 13 -1.7145797252772163e-01 8.7692112578206749e-02 -1.9554151285637433e-01 + 14 -1.1860782136519354e+00 4.7909551948471918e-01 -1.1862402925928710e-01 + 15 2.6002809831710583e-01 -1.2125209038344763e-01 -1.0691923535563215e+00 + 16 -8.5881767051143232e-01 -2.3637261234227167e-01 2.2530870061915831e+00 + 17 -2.4534944316266891e+00 5.9072066381809387e+00 -7.3319737562602141e+00 + 18 7.6048419835667402e-01 6.0861663930266818e+00 -8.9856986733331112e+00 + 19 1.8828336035073703e+00 -1.3688004104272848e+00 6.2480802290910971e+00 + 20 -3.1176107925571772e+00 -4.5466694258715670e+00 4.6957620158083868e+00 + 21 2.0402729515061697e+00 5.1070675645358152e+00 -9.8186300672842162e+00 + 22 1.7546279409274907e+00 -8.0388343779090066e-01 6.4487299927619581e+00 + 23 -4.2901216936185671e+00 -3.7672704604903036e+00 3.9397610232886793e+00 + 24 -1.7401520606172627e+00 1.0737923656124469e+01 -5.5375666396680945e+00 + 25 3.2640553980230558e+00 -3.5553990949682173e+00 3.7202816093372864e+00 + 26 -2.1287365987904998e+00 -7.3544783269669560e+00 1.2013794457614206e+00 + 27 -2.5598029041709633e+00 1.1665817614143277e+01 -4.4886021187151250e+00 + 28 4.7059345437317637e+00 -5.1155567129463302e+00 3.9973639426381569e+00 + 29 -1.6681976811001524e+00 -6.6470248207520717e+00 4.9848716153196510e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-coul_msm_table.yaml index 20d4092a1..05418a2f7 100644 --- a/unittest/force-styles/tests/mol-pair-coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:12 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,37 +56,37 @@ init_forces: ! |2 28 4.6868036569188680e+00 -5.1092487641625155e+00 3.9981377912030145e+00 29 -1.6656553611471538e+00 -6.6361744518519572e+00 5.1318690040709902e-01 run_vdwl: 0 -run_coul: 113.058278557077 +run_coul: 114.073734371379 run_stress: ! |- - -2.5695957966588988e+01 -4.5981169313887513e+01 -4.2433702988798949e+01 4.9052466337291829e+00 -7.1301483187493266e+00 1.0197238660774085e+01 + -2.4369860366231670e+01 -4.5768875963865973e+01 -4.2913165044785742e+01 5.5285342990604489e+00 -6.1771719727954659e+00 1.0942888523546028e+01 run_forces: ! |2 - 1 2.3257705447467725e+00 -3.0941342747436373e-01 6.5880016059557889e-01 - 2 -1.3947454543444543e-01 -3.1637609203207386e+00 -1.5506784401654559e+00 - 3 -1.3501468089142533e-02 -9.4693297871044219e-02 3.9215391415630213e-02 - 4 4.4390369968501979e-02 3.7461281743725233e-02 -3.4679110740559621e-01 - 5 -4.1240515231104102e-01 7.3495006173040534e-01 -1.3401795642039521e-01 - 6 1.9229817470285877e+00 -3.4765249742743793e+00 -3.3275985038787672e+00 - 7 -3.2865465377006303e-01 5.2742951123680060e-01 4.2528727749433388e+00 - 8 -1.6241606992068600e+00 3.9340613353418044e+00 2.8844871680749176e+00 - 9 1.7990485715469549e+00 -5.5959890430769823e+00 1.4618558883071644e+00 - 10 -2.7761093745666804e-01 4.4114683002656824e-01 -2.9059112554914118e-01 - 11 -9.6058018626142461e-01 1.1580599432799330e+00 -6.2754026009395514e-01 - 12 3.1741794086629773e+00 -8.4292239402730706e-01 1.6107421415442400e+00 - 13 -1.8014382636779289e-01 7.9043389696342142e-02 -1.9737478903795086e-01 - 14 -1.1875091158199436e+00 4.8600216681926522e-01 -1.1399770942841514e-01 - 15 2.7386113048081051e-01 -1.4253751708511392e-01 -1.0907260540827179e+00 - 16 -8.7550768068249074e-01 -2.3897348755219194e-01 2.2704719703311018e+00 - 17 -2.4705763748799603e+00 6.0345390897601661e+00 -7.4206364034699179e+00 - 18 3.7629574650683789e-01 5.6654728131047181e+00 -8.7189931352643928e+00 - 19 2.2635603864135616e+00 -1.0437750539445705e+00 6.3986649377434608e+00 - 20 -3.1041980586399185e+00 -4.4566395693871916e+00 4.2630597894210052e+00 - 21 2.1685843975388770e+00 4.8958239601552114e+00 -9.8875399885346518e+00 - 22 2.0543356817887046e+00 -5.7288055423943229e-01 6.5771296114913929e+00 - 23 -4.7062446099170252e+00 -3.8094489766104949e+00 3.8689546597030233e+00 - 24 -1.9486309348760944e+00 1.1028753107789740e+01 -5.7541887048587794e+00 - 25 3.7178614197912321e+00 -3.4866928057490392e+00 4.1071469026299114e+00 - 26 -2.3505729309823300e+00 -7.6942423581408788e+00 1.0642772360399546e+00 - 27 -2.7656630156568407e+00 1.1908437194961415e+01 -4.3968861734940354e+00 - 28 5.0074553961332953e+00 -5.2000175890681524e+00 4.0672946896522948e+00 - 29 -1.7828906102550728e+00 -6.8026687168242104e+00 3.3258702979115212e-01 + 1 2.3180623680303487e+00 -3.2609983127105080e-01 6.5940005848967154e-01 + 2 -6.4032286045296996e-02 -3.1424821336730178e+00 -1.5620653051217133e+00 + 3 -1.2785178060517530e-02 -9.2867010494925489e-02 4.0653873594596261e-02 + 4 3.5863509869063254e-02 4.0897871383801417e-02 -3.4308087288762096e-01 + 5 -4.2318083815284874e-01 7.3617029177472837e-01 -1.2804656608883350e-01 + 6 1.9715253799510331e+00 -3.4917375609491703e+00 -3.4128659717475287e+00 + 7 -3.7302048135536592e-01 5.3593566000989890e-01 4.3483007875834474e+00 + 8 -1.7175869496495360e+00 3.9668842888607414e+00 2.8927611416841525e+00 + 9 1.8233429855740326e+00 -5.5196894082716597e+00 1.3791829521730103e+00 + 10 -2.7432503984590434e-01 4.4724097233167148e-01 -2.8245537296904150e-01 + 11 -9.5952939981710406e-01 1.1533367435737101e+00 -6.4162390978062567e-01 + 12 3.1818990440354122e+00 -8.6185217104679857e-01 1.5927363238448540e+00 + 13 -1.7145808278228322e-01 8.7692114230558976e-02 -1.9554145278766596e-01 + 14 -1.1860782137913906e+00 4.7909544990499342e-01 -1.1862395607876282e-01 + 15 2.6002812803776459e-01 -1.2125206600662436e-01 -1.0691923032354100e+00 + 16 -8.5881756562280109e-01 -2.3637266425549674e-01 2.2530869074589845e+00 + 17 -2.4534944004561692e+00 5.9072060713767707e+00 -7.3319738574413389e+00 + 18 7.6048416018651344e-01 6.0861665269091221e+00 -8.9856985574662236e+00 + 19 1.8828337076369179e+00 -1.3688004321958069e+00 6.2480801416720775e+00 + 20 -3.1176106204658853e+00 -4.5466692992056963e+00 4.6957619299555668e+00 + 21 2.0402728911632577e+00 5.1070680159431419e+00 -9.8186301803967755e+00 + 22 1.7546277243143387e+00 -8.0388350700730160e-01 6.4487301016075733e+00 + 23 -4.2901219141811922e+00 -3.7672705478306487e+00 3.9397609672746654e+00 + 24 -1.7401520790293017e+00 1.0737924309073959e+01 -5.5375666641444647e+00 + 25 3.2640553739692026e+00 -3.5553991978140917e+00 3.7202815137220799e+00 + 26 -2.1287367098784680e+00 -7.3544784257871871e+00 1.2013792434176844e+00 + 27 -2.5598028400155859e+00 1.1665817516916357e+01 -4.4886021084878216e+00 + 28 4.7059346110837108e+00 -5.1155568615011973e+00 3.9973639060165405e+00 + 29 -1.6681972847019395e+00 -6.6470247149787784e+00 4.9848723013891438e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_shield.yaml b/unittest/force-styles/tests/mol-pair-coul_shield.yaml index bbfa36fd4..58e75ad6d 100644 --- a/unittest/force-styles/tests/mol-pair-coul_shield.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_shield.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 18:26:33 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -49,37 +49,37 @@ init_forces: ! |2 28 5.3948559878015667e-01 -3.6126692887874567e-01 4.3474815055657107e-01 29 1.5093654276198996e+00 -2.8556829848826217e-02 8.1850682818626952e-01 run_vdwl: 0 -run_coul: -13.9222164928582 -run_stress: ! |2- - 6.3846359230897015e-02 -1.4274980924452828e+01 -8.0511502483361088e+00 1.3442490137305978e+01 -7.0454716825042958e+00 1.3238357010515275e+01 +run_coul: -13.9882142666038 +run_stress: ! |- + -5.0303504432780546e-02 -1.4412580708305903e+01 -8.0482064683964456e+00 1.3472795686380804e+01 -7.0700180111056925e+00 1.3195887812103887e+01 run_forces: ! |2 - 1 -8.2829616924967731e-01 -8.7942337904713352e-01 3.7705529458425273e+00 - 2 2.2010167661815956e+00 -2.4538648095609710e+00 -3.0701491422442633e+00 - 3 -5.8501780634176610e-02 -9.2796449039489790e-02 7.3651314427949283e-02 - 4 7.0939435158627884e-02 3.4170134764875115e-01 -4.0100734804526722e-01 - 5 -1.1848694561498962e-01 4.3643748543166433e-01 -2.6912456199804630e-01 - 6 1.0558646310126123e+00 1.8158455318547506e+00 1.9033730291307576e+00 - 7 3.6938308628432404e-01 -5.1303581437163457e+00 -6.8075342445347042e-01 - 8 -3.4150724823969991e+00 -1.6322265768547461e-01 4.0091572971784251e+00 - 9 2.0195654762772097e+00 2.4740078593382160e+00 -1.9092646818543559e+00 - 10 1.9293240601530245e-01 3.0644759045730052e-01 -6.8479206774054990e-01 - 11 -2.4664935181959252e-01 1.0549389089793042e+00 -9.3935917140296088e-01 - 12 3.0571124960610421e+00 -9.9848013048389384e-01 2.4027525900422693e+00 - 13 -2.3839174149267300e-01 -1.8625574280518084e-01 -4.2128850686948194e-01 - 14 -6.0477948993323660e-01 1.8065082904004592e-01 -5.2926999846492739e-01 - 15 3.2551515234071215e-01 2.6164884577386427e-01 -9.4586548193481357e-01 - 16 1.1865508410150032e+00 7.8852237492292432e-01 -5.7709422971950177e+00 - 17 -4.3374358719403103e+00 1.4106507712006804e+00 7.7496345279151146e-01 - 18 1.4439255859326150e+00 5.4867200638127738e+00 4.5874819685837425e+00 - 19 -1.2221301990021287e+00 -3.7201768272437858e+00 -7.7475406142682812e-01 - 20 -1.9676532833551535e-01 -1.4595465580745777e+00 -1.3222262670282532e+00 - 21 -2.9027636847946336e+00 2.1830471725541134e+00 5.2302600133232255e+00 - 22 6.0571570108867667e-01 -6.6579136204655043e-01 -2.4112118948325967e+00 - 23 1.7169639482996479e+00 -6.7928212590558523e-01 -2.1328255146873705e+00 - 24 1.5056990036140117e+00 2.0843711359240055e-01 7.5177296621379930e-01 - 25 -1.1802789475990605e+00 8.2993881817474621e-03 -1.2473788870556333e+00 - 26 -6.6122853734323517e-01 -4.2183162573783016e-03 -1.8291307113178104e-01 - 27 -1.7747453708496228e+00 -1.3552414053590983e-01 -1.0484594788709782e+00 - 28 5.3838083889316657e-01 -3.5585173256538738e-01 4.3023670782481371e-01 - 29 1.4959605328313004e+00 -3.2562907820875224e-02 8.0738357187756948e-01 + 1 -8.2628804957637314e-01 -8.2083615812596067e-01 3.7881151307409362e+00 + 2 2.2301109138725446e+00 -2.4798467386235696e+00 -3.0603928343320135e+00 + 3 -5.8962164631783727e-02 -9.2358043843405485e-02 7.4154260740156047e-02 + 4 6.8413924052375452e-02 3.3904146430824589e-01 -4.0906142147562774e-01 + 5 -1.1686665081240510e-01 4.3664858238115722e-01 -2.6573515131861486e-01 + 6 1.0719890796118037e+00 1.8229758072311457e+00 1.9008179898094957e+00 + 7 3.6106729033844370e-01 -5.1310333503233112e+00 -6.7310177048809239e-01 + 8 -3.4644011496997216e+00 -2.0211670184566133e-01 3.9862671825200593e+00 + 9 2.0597365203664681e+00 2.5246050575173999e+00 -1.8713244294986808e+00 + 10 1.9930896564108522e-01 3.1003259158863516e-01 -6.8220821368786022e-01 + 11 -2.3786323057854278e-01 1.0463218337027125e+00 -9.4862117728469386e-01 + 12 3.0495954464645454e+00 -1.0296362744318199e+00 2.3813583857357661e+00 + 13 -2.3134060284410654e-01 -1.8271044656465266e-01 -4.1331343621758360e-01 + 14 -5.9722147064569631e-01 1.8917679314906433e-01 -5.3417643829217043e-01 + 15 3.0564728637939292e-01 2.7507618157398572e-01 -9.2658671836792306e-01 + 16 1.2361737241222199e+00 8.0594277451394891e-01 -5.7658791437531267e+00 + 17 -4.3862961248948027e+00 1.3553417043742413e+00 7.3862723383015072e-01 + 18 1.4292772814426986e+00 5.4173527470643839e+00 4.5923989672061349e+00 + 19 -1.1983458561439557e+00 -3.6603289562524628e+00 -7.6941790863004822e-01 + 20 -2.1321962641123318e-01 -1.4679848556444524e+00 -1.3244535589137421e+00 + 21 -2.9170260210275223e+00 2.2082124373434047e+00 5.2414089945561404e+00 + 22 6.0816877960826798e-01 -6.7108284967928333e-01 -2.4121706220923276e+00 + 23 1.7138799369053130e+00 -6.6721737087751520e-01 -2.1445743118197309e+00 + 24 1.5134605360328814e+00 1.9717418102490181e-01 8.1888111036841393e-01 + 25 -1.1842624619823408e+00 8.5968901391985028e-03 -1.3084543335865155e+00 + 26 -6.7176773931733436e-01 -5.2445578075239092e-03 -2.1574274840986898e-01 + 27 -1.7886169614899603e+00 -1.3485003353765823e-01 -1.0492942937206458e+00 + 28 5.3859857891975771e-01 -3.6132956098818159e-01 4.3451350134917011e-01 + 29 1.5070498462979818e+00 -2.9923147366968470e-02 8.1796575503284286e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_slater_cut.yaml b/unittest/force-styles/tests/mol-pair-coul_slater_cut.yaml index 20b60528c..85a334336 100644 --- a/unittest/force-styles/tests/mol-pair-coul_slater_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_slater_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 16:56:33 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -49,37 +49,37 @@ init_forces: ! |2 28 2.8230911883048382e-01 -2.0611466256162410e+00 6.4791114237918257e-01 29 1.9949846086168725e+00 -8.3162337272672793e-01 1.3169633021457043e+00 run_vdwl: 0 -run_coul: -104.399510080979 +run_coul: -98.7686740591697 run_stress: ! |- - -4.8842845981058369e+00 -2.6018407416320478e+01 -3.1150846552086172e+01 4.5626077097026778e+00 -1.8324811991751708e+00 1.8636834885551101e+00 + -3.9441728537986704e+00 -2.1934646124985438e+01 -3.0960344658063224e+01 6.4395871296778004e+00 -2.3402895121217258e+00 4.0603864607751117e-01 run_forces: ! |2 - 1 5.3914903439833339e-01 -9.4350951528037275e-01 2.3111164083632736e+00 - 2 1.5376521892859070e+00 -1.5028793382620949e+00 -3.4207162103735778e+00 - 3 -4.0052833073556948e-03 -1.7096435443836648e-02 5.0937640220841920e-02 - 4 2.3627488457979656e-02 -6.4124969615286964e-02 -3.5097694829529691e-01 - 5 -3.6735254538409956e-01 3.8133198734786572e-01 -7.7973102068831401e-02 - 6 6.9999396149438819e-01 -1.8517911936204885e+00 -2.8007057479331121e-01 - 7 -9.4893409677601070e-02 -1.4548256608734711e-02 1.3133179903441394e+00 - 8 -1.1736864441699209e+00 2.3975205533114909e+00 -2.3920495011324761e-02 - 9 1.6777546768186666e+00 -3.6878013071719415e+00 3.3636636635942021e+00 - 10 -1.2651135886091344e-01 1.0383347852203878e-01 -1.7293291122426283e-01 - 11 -7.6321247579492180e-01 8.9087262011848523e-01 -3.8282397342275915e-01 - 12 2.7727019998891316e+00 -7.1671333594644948e-01 1.3070958764685812e+00 - 13 -1.7082335609974836e-01 -1.5402271292006020e-01 1.7369804469215572e-02 - 14 -9.8155360449750950e-01 3.4953963721902837e-01 -2.5614642585382463e-01 - 15 2.0535975719752672e-01 9.3463373696486857e-02 -7.6418772700390747e-01 - 16 -1.6719500949859575e-01 -8.3584157992901975e-01 -1.9400770842230719e-01 - 17 -2.8256359422564463e+00 5.5683637247000721e+00 -4.3419559187035874e+00 - 18 8.6858343979227481e-01 4.2077366670613694e+00 -1.3341830626791205e+00 - 19 -1.2270479821798683e+00 -3.0863506915488941e+00 6.5978761397334651e-01 - 20 -7.6141017020746493e-02 7.6774471715056514e-01 4.6560353474898253e-01 - 21 1.0927715451724163e-01 -1.6310669049692355e+00 -1.8201225194502328e+00 - 22 -8.3681364429449634e-01 9.8137172944332074e-01 9.2008327944064605e-01 - 23 2.4970151286662690e-01 -6.5379606010600289e-01 1.3916591367782196e+00 - 24 -6.1339899979124346e-01 2.0164995378862804e+00 2.1359080545521776e+00 - 25 -6.1807904666490376e-01 -1.1682821455215742e+00 -7.0247347657730330e-03 - 26 4.1191921126548325e-01 -1.6622498773276331e+00 -8.7414940096721028e-01 - 27 -1.5992681452658024e+00 2.5341208229402961e+00 -1.2990523987481271e+00 - 28 5.6852143109160336e-01 -1.4686010317729494e+00 4.0157396519648914e-01 - 29 1.9813764076890126e+00 -8.3372349335272600e-01 1.2621271436333392e+00 + 1 5.3850369736252190e-01 -9.2475092179720508e-01 2.3099355677854083e+00 + 2 1.8418678704712730e+00 -9.1719432249685906e-01 -3.6413858812288349e+00 + 3 -3.7571179654198386e-03 -1.5712308243678245e-02 5.0925799527529902e-02 + 4 1.3813157930625430e-02 -6.4150416064864837e-02 -3.4677252498442090e-01 + 5 -3.7224105501324373e-01 3.7801306301398907e-01 -6.7947621907362310e-02 + 6 7.2183842117417440e-01 -1.8772555407581020e+00 -2.8552357597160860e-01 + 7 -1.1845589135332596e-01 1.6271090125268617e-02 1.3490064424088415e+00 + 8 -1.2235007564256837e+00 2.4082964727987735e+00 -5.2788592072401164e-02 + 9 1.6897292790131706e+00 -3.6277015964379729e+00 3.3409579049784996e+00 + 10 -1.2251954365807333e-01 1.0299231708394263e-01 -1.6487745599201256e-01 + 11 -7.6019898232371885e-01 8.8163049209349387e-01 -3.8531621433008656e-01 + 12 2.7645598242391225e+00 -7.1989087816594766e-01 1.2888063089979349e+00 + 13 -1.6289704059154625e-01 -1.5497617836075625e-01 2.5202638201288624e-02 + 14 -9.7635236258441283e-01 3.4527621772796913e-01 -2.6418022661227081e-01 + 15 1.9888531111102284e-01 1.0610656359143858e-01 -7.4565306696245004e-01 + 16 -1.5509150128223684e-01 -8.3103327816201999e-01 -1.5743044771310766e-01 + 17 -2.8204268916669739e+00 5.4880830889905141e+00 -4.3442757951211277e+00 + 18 8.8120469662147705e-01 4.2050680769377484e+00 -1.4483198335402254e+00 + 19 -1.3035001984157437e+00 -3.1154564972082244e+00 6.3651596588814519e-01 + 20 -2.1816906992676313e-02 7.9218492877455116e-01 5.7734947581408425e-01 + 21 1.0649894066270638e-01 -1.5152874435944785e+00 -1.8884955641842169e+00 + 22 -8.8918571448007677e-01 9.0217062588794217e-01 9.4115122438002041e-01 + 23 3.0093959356593764e-01 -6.7074441796455808e-01 1.4458672444992389e+00 + 24 -6.0677894249037578e-01 2.0545188651090585e+00 2.1413894551167281e+00 + 25 -6.5221213286294422e-01 -1.2023769417997185e+00 -3.7201501344390930e-02 + 26 4.2666832260964543e-01 -1.6837542554690930e+00 -8.6049221092125272e-01 + 27 -1.5748076663568731e+00 2.5341233873789557e+00 -1.3722589556112923e+00 + 28 2.8455268626815133e-01 -2.0617865301630411e+00 6.4373464207848174e-01 + 29 1.9946809034334969e+00 -8.3266366282712601e-01 1.3120767988208639e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml b/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml index b72319c0d..0b4d27d72 100644 --- a/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 16:57:48 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -54,37 +54,37 @@ init_forces: ! |2 28 -5.1807337133621779e+01 2.4969152478376095e+01 -3.5819948334944876e+01 29 4.1532654602026298e+01 5.0825271587590592e+01 9.0234792187328665e+00 run_vdwl: 0 -run_coul: 500.19044642625 +run_coul: 531.631693843525 run_stress: ! |2- - 2.3604989230809835e+02 1.4654098331359799e+02 2.2211060476915455e+02 1.0054182443905275e+02 6.9714225885295079e+01 4.4599344081348935e+00 + 2.6009236274938775e+02 1.6019149935649892e+02 2.4091972549720990e+02 1.1287278205291214e+02 7.6421249875941328e+01 1.0477154416076908e+00 run_forces: ! |2 - 1 -1.3308487268524495e+01 -1.2185824531441567e+01 1.9343590241845714e+01 - 2 1.6077413879048358e+01 1.0367868880473193e+01 -2.0165204498083938e+01 - 3 1.9026493615992526e-01 8.5658752539425753e-01 3.3756345064885951e-01 - 4 -3.7921399949191409e-01 -4.6933012122361678e-01 -6.1790314917135880e-01 - 5 -8.0096977790548329e-01 -7.0707189032869788e-01 8.4086173801815892e-02 - 6 -1.5143911890982688e+01 1.5484750773444844e+01 1.9684931769895115e+01 - 7 2.5638285849488858e+00 -6.5422848917158873e+00 -2.4469677895615710e+01 - 8 5.6993157689000009e+00 -1.2393575506122033e+01 -1.7868260999403226e+01 - 9 6.3965150696189319e+00 2.0365071693021672e+00 2.7111223893466306e+01 - 10 1.6169529070496655e+00 -3.8464005946419157e+00 -3.7632042198883643e-02 - 11 -3.3809660610421788e-01 6.3439039336431247e-01 3.9328889092972236e-01 - 12 4.3581726869584925e-01 -1.4895899490254929e+00 3.2779939077188143e+00 - 13 3.0519057026678094e+00 -1.2989630095548408e+00 -1.9717469892332759e-01 - 14 -1.8667540927482460e+00 4.2452933274262333e-01 -3.2856530876346590e+00 - 15 4.4333553696083644e-01 3.2229389318591175e+00 1.6755312321422247e-01 - 16 9.0519454746723031e+00 -7.1950888487291431e+00 -2.7345564181439372e+01 - 17 -1.2645408138273741e+01 1.2763068658327089e+01 2.1923189600715833e+01 - 18 -4.3071215089134407e-01 -1.2434737255099568e+01 6.5968597609965130e+01 - 19 -3.1997661257421015e+01 -2.1741597800196157e+01 -4.0516171734011309e+01 - 20 3.1934955283265566e+01 3.4346976651245875e+01 -2.3748860193691414e+01 - 21 -1.9569089076089188e+01 -2.0202230904343903e+01 6.6599873776969034e+01 - 22 -2.8323683507373818e+01 -6.7981489254824652e+00 -4.8498092192918243e+01 - 23 4.7470589204665430e+01 2.7410741494122153e+01 -1.7587497408200463e+01 - 24 1.6108321976271881e+01 -6.0528861746332566e+01 3.5741155748572666e+01 - 25 -4.4474122172672985e+01 8.9118115293290980e+00 -3.8594057273878882e+01 - 26 2.7847861318215831e+01 5.1391946083629762e+01 2.3184209889531142e+00 - 27 9.8033887832114033e+00 -6.5878073982531987e+01 2.2063009078495845e+01 - 28 -4.4248759927765477e+01 2.1902253188351867e+01 -3.0187170333541843e+01 - 29 3.4834458171891903e+01 4.3957409345183478e+01 8.1044414335204280e+00 + 1 -1.4505263340624662e+01 -1.3069826884538898e+01 2.1092273240232334e+01 + 2 1.7216929699569594e+01 1.1222653354918181e+01 -2.1892026658892760e+01 + 3 1.9689659133582163e-01 8.4089709839905469e-01 3.2691229507601138e-01 + 4 -4.1534123724459276e-01 -4.7942040205303499e-01 -6.2372283685814967e-01 + 5 -8.0983629907930077e-01 -7.0364522896705939e-01 1.0613059784230094e-01 + 6 -1.5349604856791370e+01 1.5522546924799940e+01 2.0756281297832874e+01 + 7 2.5720205395173057e+00 -6.5136694191526150e+00 -2.5754699982146299e+01 + 8 5.4783011177980798e+00 -1.3193790377127209e+01 -1.9732158944509290e+01 + 9 6.7823956616450456e+00 2.9328643102381267e+00 2.9267293877977238e+01 + 10 1.5701490834675309e+00 -3.8293776378819531e+00 -4.4681502716367193e-02 + 11 -3.4080685500280089e-01 6.3394138301719993e-01 4.2521300521638838e-01 + 12 3.6335920149821210e-01 -1.4542882227067147e+00 3.4250588402471536e+00 + 13 3.1021896119350991e+00 -1.3629775427304498e+00 -1.9236601260012270e-01 + 14 -1.8791529231416744e+00 4.5416896729772194e-01 -3.4214086468019449e+00 + 15 4.9947705909602841e-01 3.2294681516348525e+00 1.5065456540899641e-01 + 16 9.3152895494380115e+00 -7.2584606007912740e+00 -2.8037105174417249e+01 + 17 -1.2853807315028448e+01 1.2730457404190695e+01 2.2646649542757135e+01 + 18 -3.8896274444740597e+00 -1.8742984005196448e+01 7.8575622292818892e+01 + 19 -3.6657681210304887e+01 -2.4147367233205287e+01 -4.6880920994817359e+01 + 20 4.0110836482195197e+01 4.3026017430590635e+01 -3.0166674909873894e+01 + 21 -2.2266717418800365e+01 -2.5007792207614962e+01 7.7439548112199361e+01 + 22 -3.2986424583514150e+01 -7.4943575521934962e+00 -5.6719145374965272e+01 + 23 5.4861504180702049e+01 3.2888028352139067e+01 -2.0245497429195499e+01 + 24 1.6994333620812245e+01 -6.9071608975734406e+01 4.0281992417369800e+01 + 25 -5.0022578934028282e+01 1.0236526699813956e+01 -4.3029340089682030e+01 + 26 3.2556772729625038e+01 5.8630191330865074e+01 2.2575959885742858e+00 + 27 1.0740675179027832e+01 -7.5810812405906574e+01 2.6655288241835144e+01 + 28 -5.1859214575097845e+01 2.4967730720910470e+01 -3.5779461664571272e+01 + 29 4.1474926685469335e+01 5.0824886566985427e+01 9.1126959066595141e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_streitz_long.yaml b/unittest/force-styles/tests/mol-pair-coul_streitz_long.yaml index 2c37a7cba..dc1acb086 100644 --- a/unittest/force-styles/tests/mol-pair-coul_streitz_long.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_streitz_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 18:05:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -11,8 +11,9 @@ pre_commands: ! | variable newton_pair delete variable newton_pair index on post_commands: ! | + timestep 0.001 pair_modify mix arithmetic - velocity all scale 100.0 + velocity all scale 10.0 pair_modify table 0 kspace_style ewald 1.0e-6 kspace_modify gewald 0.3 @@ -59,37 +60,37 @@ init_forces: ! |2 28 1.4599082339749709e+00 -1.1137079999601494e+00 1.1194166285875853e+00 29 -1.0388110297844579e+00 -1.8210443500550793e+00 -9.9526404197437260e-02 run_vdwl: 0 -run_coul: 17.6107797790349 +run_coul: 17.8169760115007 run_stress: ! |- - -5.7306972095366415e+00 -3.8270510700116196e+00 -7.2779289330125732e+00 -2.5362745653990735e+00 -7.8565195626099893e-01 -1.3039738114740602e+00 + -5.5793011954282141e+00 -3.8070193642083279e+00 -7.4794630173410894e+00 -2.4558653142135030e+00 -7.0075036097944821e-01 -1.0383497954708332e+00 run_forces: ! |2 - 1 -9.2469944376363478e-01 -1.4633990604614862e+00 6.1623324473144792e-01 - 2 9.8769980028585203e-01 1.0246168054119145e+00 -9.9555728698479706e-01 - 3 3.2795947395595054e-01 7.3990072299044563e-01 2.0964247130025565e-01 - 4 -4.3816074220748102e-01 9.3677606560656823e-02 -3.1713411018068471e-01 - 5 -1.7952682653513213e-01 -1.6505898170269842e-01 5.4467602013728056e-01 - 6 1.4393079881714252e-01 -8.4360752690500496e-01 -3.6132694843745248e+00 - 7 5.7463149876039572e-02 5.5667854235582193e-01 3.3580529175679255e+00 - 8 2.5755285591544669e-01 -5.4230668534859150e-01 -1.7678224361644457e+00 - 9 4.0439090182406828e-01 3.5935731614353328e-01 2.1420550846668656e+00 - 10 -3.2060541264126202e-01 8.4296326730048421e-01 -4.9149743886351099e-02 - 11 -1.8625599585102814e-01 -2.8622315342513477e-01 -5.1047977683976953e-01 - 12 -6.9917040965471888e-01 -4.0095737678873944e-01 5.2949097463363126e-01 - 13 4.6175524623413344e-01 -1.0368824662732480e-01 -4.9311690547319188e-02 - 14 -1.6996836045964978e-01 9.0738886674394365e-02 -4.8811626882649645e-01 - 15 5.2186719741275256e-02 4.9901704129949681e-01 9.9548046955244912e-02 - 16 -5.7746801629210798e-01 -1.8477427567456291e-02 3.3035800908683361e+00 - 17 8.4578770140175308e-01 -3.9183056934394106e-01 -3.1272609108735243e+00 - 18 1.1534016407507593e-02 7.3129309519506891e-01 -2.7341472962337385e+00 - 19 1.1195851145146967e+00 6.0217647054773749e-01 1.7300303327527813e+00 - 20 -1.1636306814896318e+00 -1.3439631451481258e+00 1.0910159858362631e+00 - 21 7.6793445512724079e-01 8.9579468101024207e-01 -2.8104002419134653e+00 - 22 9.1200586623602120e-01 1.4075388341601403e-01 1.9417689855355895e+00 - 23 -1.6979025524191678e+00 -1.0179017340175387e+00 8.8976666169167618e-01 - 24 -6.8161874955847124e-01 2.5837248403707593e+00 -1.5235371697927560e+00 - 25 1.5229269410706676e+00 -5.6677307068306881e-01 1.4598684598913816e+00 - 26 -8.4661937069642890e-01 -2.0149673927706684e+00 7.0260249515732662e-02 - 27 -4.7328933846867238e-01 2.9391689652428674e+00 -9.1013338727296678e-01 - 28 1.5533967438622545e+00 -1.0953629455445881e+00 1.1065174454831872e+00 - 29 -1.0671938852326637e+00 -1.8453448081850712e+00 -1.9618716767675881e-01 + 1 -9.1190089645849814e-01 -1.4426833954851044e+00 6.5366207461919212e-01 + 2 9.9050416235937055e-01 1.0185584253929938e+00 -1.0372711584203895e+00 + 3 3.2854323302159361e-01 7.2180882061045459e-01 2.0545894310901905e-01 + 4 -4.4895654584658728e-01 9.9620700148318128e-02 -3.1489055288436202e-01 + 5 -1.8062320036166105e-01 -1.6557069347761144e-01 5.4861980303050650e-01 + 6 1.3691893202381827e-01 -8.3615264727683236e-01 -3.6772100085399089e+00 + 7 5.7828712570460454e-02 5.4685082761176984e-01 3.4205071020338274e+00 + 8 2.5689349384498611e-01 -5.5447588323833152e-01 -1.7791715062737306e+00 + 9 4.0982900973348751e-01 3.7744344351281323e-01 2.1493172837748733e+00 + 10 -3.2140634331347612e-01 8.5629705410110690e-01 -2.8547571610599551e-02 + 11 -1.9052752165411513e-01 -2.9588592767795074e-01 -5.2673389192484266e-01 + 12 -7.1050119711924609e-01 -3.9909749541367889e-01 5.4896086302121960e-01 + 13 4.6787145486822035e-01 -1.1333625434671461e-01 -5.1978444149741537e-02 + 14 -1.7328845518589209e-01 9.8862087814187136e-02 -5.0080127335216096e-01 + 15 5.7845766331816921e-02 4.9704874413201350e-01 9.2348848198947064e-02 + 16 -5.7403371985401919e-01 -3.8393206517259547e-02 3.2989226333694934e+00 + 17 8.4849938590025509e-01 -3.7939834805923978e-01 -3.1162061402158328e+00 + 18 6.2147938566784779e-02 8.0482456395585789e-01 -2.8550037949612861e+00 + 19 1.0601488743203664e+00 5.2939513082993228e-01 1.7477182981153030e+00 + 20 -1.1555031291313740e+00 -1.3452670635808766e+00 1.1937863633828258e+00 + 21 7.6444406063760995e-01 9.9556940326777899e-01 -2.8767120525513690e+00 + 22 8.5718037553261928e-01 8.1619670544840678e-02 1.9670279526542149e+00 + 23 -1.6397830901477590e+00 -1.0579861885722810e+00 9.3111330738949771e-01 + 24 -6.5853378523882022e-01 2.6302208616054235e+00 -1.5551966675627231e+00 + 25 1.4910178984812363e+00 -6.1717242420251250e-01 1.4368700773132415e+00 + 26 -8.3809699307472507e-01 -2.0113035250387350e+00 1.2507630856795623e-01 + 27 -4.2594440737867778e-01 2.9316034150569141e+00 -9.8443803478891678e-01 + 28 1.5236077842735218e+00 -1.0963012501421914e+00 1.1316028001336618e+00 + 29 -1.0841817977012969e+00 -1.8366988455550839e+00 -1.4683156147791585e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_streitz_wolf.yaml b/unittest/force-styles/tests/mol-pair-coul_streitz_wolf.yaml index fcb8b9112..1b1044ba6 100644 --- a/unittest/force-styles/tests/mol-pair-coul_streitz_wolf.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_streitz_wolf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 17:58:41 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -10,8 +10,9 @@ pre_commands: ! | variable newton_pair delete variable newton_pair index on post_commands: ! | + timestep 0.001 pair_modify mix arithmetic - velocity all scale 100.0 + velocity all scale 10.0 input_file: in.fourmol pair_style: coul/streitz 8.0 wolf 0.25 pair_coeff: ! | @@ -53,37 +54,37 @@ init_forces: ! |2 28 1.4672946614091067e+00 -1.1339632350120408e+00 1.1290303061925724e+00 29 -1.0331746995782534e+00 -1.8417135865371881e+00 -9.0661681750742795e-02 run_vdwl: 0 -run_coul: 2.78075250188602 +run_coul: 2.98904393402013 run_stress: ! |- - -5.7589740747404425e+00 -3.8737473874024548e+00 -7.3573126149975385e+00 -2.5143257039647411e+00 -7.7561600251146512e-01 -1.2842633088937629e+00 + -5.6078601708855027e+00 -3.8555192197060535e+00 -7.5568621153826454e+00 -2.4336548878477799e+00 -6.9060480033072891e-01 -1.0163079058723261e+00 run_forces: ! |2 - 1 -9.3128585103467421e-01 -1.4616893717996533e+00 6.2506771777797521e-01 - 2 9.9071843787358538e-01 1.0179453831421861e+00 -1.0018467536007236e+00 - 3 3.2738862523605139e-01 7.3961485179912378e-01 2.1031861326785153e-01 - 4 -4.3570490323349020e-01 9.4014176356369397e-02 -3.1939631015404735e-01 - 5 -1.7749610624243761e-01 -1.6340042458227050e-01 5.4321830282534356e-01 - 6 1.5298263043785579e-01 -8.3596553476744107e-01 -3.6363585347816545e+00 - 7 5.0981026787524579e-02 5.4981977020740402e-01 3.3723449387033395e+00 - 8 2.5638650322834017e-01 -5.5576305085263611e-01 -1.7524972652803890e+00 - 9 4.0778863226841844e-01 3.6609515100176848e-01 2.1400447288877578e+00 - 10 -3.2159814476754445e-01 8.4502007492935960e-01 -5.0562869608917954e-02 - 11 -1.8790431507333358e-01 -2.8300006615889345e-01 -5.1285840704641150e-01 - 12 -6.9142308356287230e-01 -4.1008262499004605e-01 5.3572171975141014e-01 - 13 4.6001850371065678e-01 -1.0141349891338225e-01 -5.0547820730950384e-02 - 14 -1.7312661472286200e-01 9.3686247295773600e-02 -4.8916660652219174e-01 - 15 4.9914154233852218e-02 5.0091152023434993e-01 9.7339949880540566e-02 - 16 -5.8125997969989962e-01 -1.2279912187758157e-02 3.3102125078790734e+00 - 17 8.4626952031853975e-01 -3.9709096494138280e-01 -3.1424785110825222e+00 - 18 2.1864863169689927e-02 7.6236371184048335e-01 -2.7557044957753711e+00 - 19 1.1165309584966197e+00 5.8715426575082763e-01 1.7442176730237862e+00 - 20 -1.1689321882211814e+00 -1.3575484708613954e+00 1.1028226120139750e+00 - 21 7.6809695561300151e-01 9.1119397074810926e-01 -2.8259007666833904e+00 - 22 9.1175488552355965e-01 1.3597417945171963e-01 1.9511945805061304e+00 - 23 -1.7000136380435098e+00 -1.0254084262251817e+00 8.9820251215424329e-01 - 24 -6.8314166457271142e-01 2.6146284166471978e+00 -1.5361984137600566e+00 - 25 1.5256776337067839e+00 -5.7933550776987075e-01 1.4663995955600964e+00 - 26 -8.4805771113863260e-01 -2.0325653194590081e+00 7.5982750507623417e-02 - 27 -4.8492481270327847e-01 2.9736485046479002e+00 -9.2449873137985972e-01 - 28 1.5613821808695787e+00 -1.1130593922337220e+00 1.1148658058223095e+00 - 29 -1.0628864984576303e+00 -1.8634676583099292e+00 -1.8993852215497148e-01 + 1 -9.1866956848470793e-01 -1.4409102708155139e+00 6.6221748453175722e-01 + 2 9.9377758408469896e-01 1.0119671524279183e+00 -1.0434230455866973e+00 + 3 3.2796922438484583e-01 7.2151854299660534e-01 2.0612397965275281e-01 + 4 -4.4655158005759582e-01 9.9978963667272214e-02 -3.1712205918975250e-01 + 5 -1.7855422372347737e-01 -1.6391007745800426e-01 5.4723039151925690e-01 + 6 1.4595836252213046e-01 -8.2838348850319532e-01 -3.6998661055061217e+00 + 7 5.1504936738721661e-02 5.4011487034048555e-01 3.4345809432278593e+00 + 8 2.5555977903688681e-01 -5.6805216236796219e-01 -1.7643314027807044e+00 + 9 4.1339473986983188e-01 3.8432878947491628e-01 2.1476103914413471e+00 + 10 -3.2237662766829278e-01 8.5834055692880529e-01 -2.9893391716868577e-02 + 11 -1.9215361351962243e-01 -2.9272897678121107e-01 -5.2907509074572556e-01 + 12 -7.0281403544808241e-01 -4.0823854547693611e-01 5.5488357218925810e-01 + 13 4.6615115759381887e-01 -1.1107656447203886e-01 -5.3123225213991557e-02 + 14 -1.7643948673550111e-01 1.0178486218705525e-01 -5.0180262418023580e-01 + 15 5.5566018673665632e-02 4.9897087021754927e-01 9.0275432936434183e-02 + 16 -5.7762713075081085e-01 -3.2264205594541191e-02 3.3057687167126275e+00 + 17 8.4881221903575121e-01 -3.8485817234715897e-01 -3.1317500342839124e+00 + 18 7.1344415314004692e-02 8.3464821546511880e-01 -2.8776918271653908e+00 + 19 1.0574474879011440e+00 5.1478331099782149e-01 1.7623820414950653e+00 + 20 -1.1601115405360105e+00 -1.3581750136465052e+00 1.2068544423702161e+00 + 21 7.6476557341309759e-01 1.0127482021750456e+00 -2.8934456604780445e+00 + 22 8.5675394736202704e-01 7.5991739204285064e-02 1.9771086333331795e+00 + 23 -1.6419410214731109e+00 -1.0662239543407159e+00 9.4015746880187734e-01 + 24 -6.6042185581478263e-01 2.6627288089817074e+00 -1.5694360699189704e+00 + 25 1.4940837692187392e+00 -6.3055638456256036e-01 1.4438636481631659e+00 + 26 -8.3957740054582342e-01 -2.0298126533200298e+00 1.3126434372877979e-01 + 27 -4.3734021023703462e-01 2.9663697300152885e+00 -9.9995666531149929e-01 + 28 1.5315146151867913e+00 -1.1141598437207245e+00 1.1405583477750376e+00 + 29 -1.0800255353413026e+00 -1.8549243016727766e+00 -1.3996263580069690e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_table.yaml b/unittest/force-styles/tests/mol-pair-coul_table.yaml index a9b85bf46..aa9ab5406 100644 --- a/unittest/force-styles/tests/mol-pair-coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -55,37 +55,37 @@ init_forces: ! |2 28 4.3293131083893304e+00 -4.2323366966791456e+00 3.5451222799829045e+00 29 -1.9216824153792407e+00 -5.8096124052291662e+00 1.1529707688447896e-01 run_vdwl: 0 -run_coul: 224.909674746873 +run_coul: 225.772087269724 run_stress: ! |- - -2.4177666881877958e+01 -4.3228790522018691e+01 -3.8432649533450345e+01 3.8956934951377669e+00 -7.5417612031631780e+00 8.9949616983409637e+00 + -2.2878994271888388e+01 -4.2864533290609835e+01 -3.8706386047553700e+01 4.4580897260806838e+00 -6.6095207311155475e+00 9.6124915253697747e+00 run_forces: ! |2 - 1 2.7109644180849042e+00 -3.6201563109056334e-01 3.0781678571659954e-01 - 2 -3.1547480426329355e-01 -2.9225847662330460e+00 -1.3102551200066217e+00 - 3 1.2440897030891053e-02 -8.6206179986100653e-02 1.3270243133354643e-02 - 4 -7.1953021353264410e-02 1.5676072135005360e-02 -2.4547708618355668e-01 - 5 -5.2622813207471753e-01 6.6333560822006121e-01 -7.3638828419772484e-02 - 6 1.4614324435656001e+00 -3.8541245530962462e+00 -2.4608127878325363e+00 - 7 -4.3961934648836319e-02 8.7400151328539466e-01 3.7021894600221033e+00 - 8 -1.4843945950999273e+00 4.4911182344511849e+00 2.3473597771083714e+00 - 9 1.6148085031154136e+00 -5.8867839001899087e+00 1.5179678832984742e+00 - 10 -2.4457491143848711e-01 3.4620236209648592e-01 -2.4227373815613129e-01 - 11 -8.9962120592844896e-01 1.0300990833439330e+00 -5.4674543794192032e-01 - 12 2.8517302792791486e+00 -4.6397509315187579e-01 1.4379838788375441e+00 - 13 -8.2902416598215109e-02 -1.8154039205488810e-02 -1.7588986523465394e-01 - 14 -1.0565639125872499e+00 3.6536095120802453e-01 -8.7292669604895873e-02 - 15 3.6852712818840638e-01 -2.2242623312378468e-01 -1.0312037418978262e+00 - 16 -7.3889420663954775e-01 -5.2111442165355937e-01 1.9426909115914799e+00 - 17 -2.4555704326971588e+00 6.3034480649051101e+00 -6.7474067421461186e+00 - 18 -1.0336923121386729e-01 4.3012479468724809e+00 -7.6231504797701417e+00 - 19 2.4118621303140504e+00 -3.6910245494651645e-01 5.7130695717420359e+00 - 20 -2.8494102074172507e+00 -3.8456729568700498e+00 3.6585485709006438e+00 - 21 2.0416870806048508e+00 4.2101051450620091e+00 -9.0267690736572188e+00 - 22 2.1218560882030011e+00 -3.5562955290409215e-01 6.0768475618763729e+00 - 23 -4.5631498423843766e+00 -3.4639062038634814e+00 3.4347844323344709e+00 - 24 -1.8208981599929361e+00 9.5312477010907344e+00 -5.2832131741706485e+00 - 25 3.5479638714471280e+00 -2.8963059471228672e+00 3.8431101665258320e+00 - 26 -2.2582439029945234e+00 -6.8576781531763542e+00 8.8016282885121500e-01 - 27 -2.2318809914189890e+00 1.0309673624043880e+01 -3.6137307294402792e+00 - 28 4.6284575323495201e+00 -4.3315154570931655e+00 3.6242190376726811e+00 - 29 -2.0246384634318173e+00 -5.9843207630072062e+00 -3.2161635148851002e-02 + 1 2.7152055868674823e+00 -3.8535792319502099e-01 3.1353781079098386e-01 + 2 -2.4897598131978885e-01 -2.8919714823383722e+00 -1.3238603900523260e+00 + 3 1.3593141246817909e-02 -8.4182943048315126e-02 1.4907289884468631e-02 + 4 -8.0235563162550774e-02 1.7933525919587689e-02 -2.4193215584754454e-01 + 5 -5.3961335061119153e-01 6.6392593487949181e-01 -7.0018072828985534e-02 + 6 1.4953404698804982e+00 -3.8784815567166753e+00 -2.5571810810348352e+00 + 7 -8.0770017768648339e-02 8.8768899444553118e-01 3.8075246247302146e+00 + 8 -1.5603805537939754e+00 4.5308700100818067e+00 2.3676266934552581e+00 + 9 1.6239567472392482e+00 -5.8163363022192733e+00 1.4245498439069466e+00 + 10 -2.4316694088219371e-01 3.5280717285053842e-01 -2.3605514058372806e-01 + 11 -9.0077253615050978e-01 1.0278089198707780e+00 -5.6223529822072205e-01 + 12 2.8604614444769632e+00 -4.8095017104066118e-01 1.4303881587890019e+00 + 13 -7.4617353501218439e-02 -9.0353918252165620e-03 -1.7768173185013028e-01 + 14 -1.0548494073394574e+00 3.5774863641039711e-01 -9.5057915823286113e-02 + 15 3.5598746934965936e-01 -2.0224024102144539e-01 -1.0135796404876678e+00 + 16 -7.3568797801783725e-01 -5.1206905117328005e-01 1.9209438829516599e+00 + 17 -2.4234384491530956e+00 6.1787774621005918e+00 -6.6468976464886316e+00 + 18 3.2276359457509635e-01 4.7486602908469004e+00 -7.8460007809125312e+00 + 19 2.0276068771467335e+00 -6.9074472165764544e-01 5.5364925353129468e+00 + 20 -2.8990805891589191e+00 -3.9654557830754129e+00 4.0720891953701459e+00 + 21 1.9107859127621578e+00 4.3524496687183412e+00 -8.9066039172216946e+00 + 22 1.8377605206087311e+00 -5.5000907834657364e-01 5.9251847581875516e+00 + 23 -4.1559027879031767e+00 -3.3976991549491418e+00 3.4762199195542709e+00 + 24 -1.5922270909776661e+00 9.1889861977552467e+00 -5.0412680266701351e+00 + 25 3.0927901648115603e+00 -2.9316150970878323e+00 3.4477454021895992e+00 + 26 -2.0518136943378162e+00 -6.5022559958279951e+00 9.9964822285187349e-01 + 27 -2.0380214426769445e+00 1.0050296935507305e+01 -3.6676075289183494e+00 + 28 4.3477782161891660e+00 -4.2390813450336458e+00 3.5462680771906347e+00 + 29 -1.9244764083991259e+00 -5.8204675108300137e+00 1.0285291177501629e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_table_cs.yaml b/unittest/force-styles/tests/mol-pair-coul_table_cs.yaml index e42e9f6fd..2691280d7 100644 --- a/unittest/force-styles/tests/mol-pair-coul_table_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_table_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -54,37 +54,37 @@ init_forces: ! |2 28 4.3292951667819661e+00 -4.2323289861951165e+00 3.5451101405172691e+00 29 -1.9216684483031334e+00 -5.8095961666872364e+00 1.1530046700271843e-01 run_vdwl: 0 -run_coul: 224.909818302574 +run_coul: 225.772221336362 run_stress: ! |- - -2.4177576349316283e+01 -4.3228733392580892e+01 -3.8432577520012693e+01 3.8957326728955022e+00 -7.5417278054088150e+00 8.9949617227097534e+00 + -2.2878908674571353e+01 -4.2864477977439549e+01 -3.8706315539466445e+01 4.4581274178491608e+00 -6.6094915432451486e+00 9.6124893446999895e+00 run_forces: ! |2 - 1 2.7109595180212671e+00 -3.6201973358568518e-01 3.0782236692390208e-01 - 2 -3.1546989524848768e-01 -2.9225806870421827e+00 -1.3102607131313959e+00 - 3 1.2440966921168584e-02 -8.6206142726935317e-02 1.3270223332551373e-02 - 4 -7.1953067060459466e-02 1.5676084697299756e-02 -2.4547711901588759e-01 - 5 -5.2622814503398063e-01 6.6333558751718114e-01 -7.3638766479759171e-02 - 6 1.4614307359711127e+00 -3.8541223679724341e+00 -2.4608094196624259e+00 - 7 -4.3961773792208635e-02 8.7400059623591153e-01 3.7021849901178454e+00 - 8 -1.4843952836754974e+00 4.4911150894752812e+00 2.3473519271845915e+00 - 9 1.6148105833588493e+00 -5.8867818887848289e+00 1.5179768394453568e+00 - 10 -2.4457479177725883e-01 3.4620207224278932e-01 -2.4227397403162149e-01 - 11 -8.9962116524957869e-01 1.0300992114479344e+00 -5.4674523429941102e-01 - 12 2.8517298816064591e+00 -4.6397562834027656e-01 1.4379843084410198e+00 - 13 -8.2901706156215435e-02 -1.8154307675481363e-02 -1.7588987813068491e-01 - 14 -1.0565641874187421e+00 3.6536099838575520e-01 -8.7293368371138963e-02 - 15 3.6852708780886761e-01 -2.2242547713173680e-01 -1.0312034612887613e+00 - 16 -7.3889282749816854e-01 -5.2111541016751062e-01 1.9426872371346828e+00 - 17 -2.4555720459936921e+00 6.3034489524052004e+00 -6.7474030019115334e+00 - 18 -1.0336885854768851e-01 4.3012430638788466e+00 -7.6231268769287972e+00 - 19 2.4118491926398073e+00 -3.6911096680866534e-01 5.7130541575361287e+00 - 20 -2.8493976508251588e+00 -3.8456595561733597e+00 3.6585403952094682e+00 - 21 2.0416793090179399e+00 4.2100966874769554e+00 -9.0267434292525550e+00 - 22 2.1218434187009301e+00 -3.5563282842323618e-01 6.0768281458682374e+00 - 23 -4.5631294039057657e+00 -3.4638944653195418e+00 3.4347782049418702e+00 - 24 -1.8208920817976899e+00 9.5312230970686578e+00 -5.2831989388209184e+00 - 25 3.5479448823917772e+00 -2.8963032231985988e+00 3.8430941119115216e+00 - 26 -2.2582310007744866e+00 -6.8576562809388175e+00 8.8016465248866882e-01 - 27 -2.2318758651787958e+00 1.0309647872525765e+01 -3.6137216473528730e+00 - 28 4.6284376021796199e+00 -4.3315071182841525e+00 3.6242058547831020e+00 - 29 -2.0246234286839222e+00 -5.9843032307841364e+00 -3.2157586641189964e-02 + 1 2.7152007593015330e+00 -3.8536192537578429e-01 3.1354344999384254e-01 + 2 -2.4897116372602540e-01 -2.8919675101602169e+00 -1.3238660402923370e+00 + 3 1.3593213034846334e-02 -8.4182906714495742e-02 1.4907269633475440e-02 + 4 -8.0235611865635464e-02 1.7933539515371154e-02 -2.4193219048823125e-01 + 5 -5.3961336352176992e-01 6.6392591500926279e-01 -7.0018006929538495e-02 + 6 1.4953386837907496e+00 -3.8784793174634102e+00 -2.5571775970596695e+00 + 7 -8.0769837746909878e-02 8.8768806869780859e-01 3.8075200194218226e+00 + 8 -1.5603811387543487e+00 4.5308667010389820e+00 2.3676189013049012e+00 + 9 1.6239587764628702e+00 -5.8163341281107650e+00 1.4245588122216029e+00 + 10 -2.4316682667406447e-01 3.5280687601449534e-01 -2.3605538925181616e-01 + 11 -9.0077248850469838e-01 1.0278090378673623e+00 -5.6223510465523951e-01 + 12 2.8604610318238275e+00 -4.8095069188029732e-01 1.4303886549746336e+00 + 13 -7.4616630252296673e-02 -9.0356764875037347e-03 -1.7768174528529643e-01 + 14 -1.0548496969122974e+00 3.5774869428499362e-01 -9.5058666491324384e-02 + 15 3.5598744828536261e-01 -2.0223949340616121e-01 -1.0135793725725744e+00 + 16 -7.3568664239381787e-01 -5.1206998443041074e-01 1.9209403378171090e+00 + 17 -2.4234397848414497e+00 6.1787783955631665e+00 -6.6468941012152927e+00 + 18 3.2276197204398049e-01 4.7486535088235806e+00 -7.8459772098462928e+00 + 19 2.0275949122801498e+00 -6.9075239741748373e-01 5.5364780787004264e+00 + 20 -2.8990670018355376e+00 -3.9654413252180456e+00 4.0720800811883811e+00 + 21 1.9107789317003225e+00 4.3524413619285580e+00 -8.9065797982185355e+00 + 22 1.8377488179523636e+00 -5.5001193612254962e-01 5.9251664644971260e+00 + 23 -4.1558841042105401e+00 -3.3976879903293571e+00 3.4762140942516306e+00 + 24 -1.5922221502038949e+00 9.1889641028507310e+00 -5.0412554700332324e+00 + 25 3.0927736271807826e+00 -2.9316124731510218e+00 3.4477314956609746e+00 + 26 -2.0518020975751390e+00 -6.5022365249517664e+00 9.9964957264261278e-01 + 27 -2.0380174094836576e+00 1.0050272902530462e+01 -3.6675987843756177e+00 + 28 4.3477601819180736e+00 -4.2390736067799910e+00 3.5462558999706566e+00 + 29 -1.9244624072727825e+00 -5.8204512161255186e+00 1.0285634443581056e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_wolf.yaml b/unittest/force-styles/tests/mol-pair-coul_wolf.yaml index ebeae6e67..4918adc09 100644 --- a/unittest/force-styles/tests/mol-pair-coul_wolf.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_wolf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -49,37 +49,37 @@ init_forces: ! |2 28 4.4993726667977505e+00 -4.6997287550738651e+00 3.7669799595142255e+00 29 -1.7918917681043876e+00 -6.2865484492348012e+00 3.1996589863779817e-01 run_vdwl: 0 -run_coul: -116.71802082193 +run_coul: -115.769113007043 run_stress: ! |- - -2.4835363775665854e+01 -4.4541474310543748e+01 -4.0539113771971820e+01 4.4719161213604117e+00 -7.2757660582635388e+00 9.6680948137112992e+00 + -2.3519451591948346e+01 -4.4269900044019352e+01 -4.0933115596461185e+01 5.0512455245215024e+00 -6.3318043371823549e+00 1.0364967781882934e+01 run_forces: ! |2 - 1 2.5264709462229580e+00 -3.5349624989409451e-01 5.2968707966332063e-01 - 2 -2.1644503540213622e-01 -3.0493980950234292e+00 -1.4761795027065561e+00 - 3 7.8662307249288688e-05 -9.0782707866260720e-02 2.8647427052925105e-02 - 4 -1.5581725903996060e-02 2.7348972550788296e-02 -3.0157299144931854e-01 - 5 -4.7638641996990144e-01 7.0484709221202535e-01 -1.0673581876119338e-01 - 6 1.6933615277685805e+00 -3.6363966212223238e+00 -2.9943312397967108e+00 - 7 -2.0589965854398640e-01 6.8253754850272963e-01 4.0359888564617492e+00 - 8 -1.5353784477358678e+00 4.1710449220763124e+00 2.6914984183951272e+00 - 9 1.7088024044852790e+00 -5.7243484246895990e+00 1.4839287495158691e+00 - 10 -2.6316758590971912e-01 3.9688997260182618e-01 -2.7650670411410727e-01 - 11 -9.3411998640142624e-01 1.1019023500184586e+00 -6.0367081301819114e-01 - 12 3.0199261242397877e+00 -6.8575414927573008e-01 1.5805474097616101e+00 - 13 -1.2328424351207645e-01 3.6130220893863113e-02 -2.0249629480781231e-01 - 14 -1.1276383894807320e+00 4.3647122449185954e-01 -1.1549649379142429e-01 - 15 3.1919482477018180e-01 -1.7075468040744196e-01 -1.0791965480316745e+00 - 16 -7.9425478786572790e-01 -3.9123456725839634e-01 2.1007508866438482e+00 - 17 -2.4727245471287915e+00 6.1784837273567002e+00 -7.1232353533540893e+00 - 18 1.1361430692220097e-01 5.0270678285625703e+00 -8.2174116527091314e+00 - 19 2.3419751693240562e+00 -7.3442896062841045e-01 6.0993929162842093e+00 - 20 -2.9518202542241632e+00 -4.1534867741629560e+00 3.9962590196433561e+00 - 21 2.0495665906126987e+00 4.6441160885790538e+00 -9.4697190095723265e+00 - 22 2.1031441705947640e+00 -5.0227727391775001e-01 6.3379615662525399e+00 - 23 -4.6112387473570271e+00 -3.6693454202882467e+00 3.6768950684426365e+00 - 24 -1.8961469671260887e+00 1.0361917724880996e+01 -5.6412693313741427e+00 - 25 3.6317176164293778e+00 -3.2477856843784463e+00 4.0176574036198609e+00 - 26 -2.2733350545047011e+00 -7.3197323277944895e+00 1.0396381803200354e+00 - 27 -2.5160721548806420e+00 1.1212536958850635e+01 -4.0078254654596908e+00 - 28 4.8077085609858141e+00 -4.7963819555676261e+00 3.8416447791070776e+00 - 29 -1.9020668987159577e+00 -6.4556907392026206e+00 1.5514945778221004e-01 + 1 2.5258946173516779e+00 -3.7288518169560009e-01 5.3514177027598298e-01 + 2 -1.4715545408270148e-01 -3.0264574124754033e+00 -1.4894445493806217e+00 + 3 1.0500390574150736e-03 -8.8875049027054814e-02 3.0280760123272236e-02 + 4 -2.4189379124307187e-02 3.0252742144844740e-02 -2.9826010992109114e-01 + 5 -4.8867941094417855e-01 7.0581218051020234e-01 -1.0225794667203067e-01 + 6 1.7338103026781466e+00 -3.6553504352471182e+00 -3.0871817746687089e+00 + 7 -2.4591949705749722e-01 6.9285573075088747e-01 4.1380368669371013e+00 + 8 -1.6193029647498256e+00 4.2062769598680880e+00 2.7079646597699227e+00 + 9 1.7251180544160765e+00 -5.6500639093108367e+00 1.3947895607866703e+00 + 10 -2.6093154854977652e-01 4.0329339910642592e-01 -2.6964125221098018e-01 + 11 -9.3431501443295562e-01 1.0985193660815762e+00 -6.1888106474593496e-01 + 12 3.0287023600695879e+00 -7.0433884248093270e-01 1.5692006774271818e+00 + 13 -1.1503753462631820e-01 4.5047007437605889e-02 -2.0284266108139365e-01 + 14 -1.1262747615470290e+00 4.2950858049025109e-01 -1.2226347643254003e-01 + 15 3.0586177111686119e-01 -1.4976352243802399e-01 -1.0601736345371104e+00 + 16 -7.8459903507755857e-01 -3.8543367152004171e-01 2.0794197223712256e+00 + 17 -2.4480109848719396e+00 6.0527092793793438e+00 -7.0277116770798056e+00 + 18 5.1790759961983357e-01 5.4622818990979116e+00 -8.4646445525226994e+00 + 19 1.9595783860640854e+00 -1.0576972141958818e+00 5.9364845403361928e+00 + 20 -2.9825701578035031e+00 -4.2593805399508611e+00 4.4199963469455579e+00 + 21 1.9207734206997651e+00 4.8208755188061545e+00 -9.3758477661719208e+00 + 22 1.8104585031930387e+00 -7.1506586437848596e-01 6.1985009569166687e+00 + 23 -4.1994250069900838e+00 -3.6148387253329828e+00 3.7335943463573038e+00 + 24 -1.6771706051867461e+00 1.0048010794669619e+01 -5.4155107883397040e+00 + 25 3.1768050750067891e+00 -3.3033380107108909e+00 3.6279721117024319e+00 + 26 -2.0583074007305582e+00 -6.9742470044044724e+00 1.1712086943398961e+00 + 27 -2.3176869767772779e+00 1.0965677277242001e+01 -4.0813748034761499e+00 + 28 4.5181241679075521e+00 -4.7061579173489960e+00 3.7671014420833107e+00 + 29 -1.7945085646285721e+00 -6.2972274350673265e+00 3.0634360086797174e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-coul_wolf_cs.yaml b/unittest/force-styles/tests/mol-pair-coul_wolf_cs.yaml index b00c6f2c1..50447386b 100644 --- a/unittest/force-styles/tests/mol-pair-coul_wolf_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_wolf_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -49,37 +49,37 @@ init_forces: ! |2 28 4.4993726667977505e+00 -4.6997287550738651e+00 3.7669799595142255e+00 29 -1.7918917681043876e+00 -6.2865484492348012e+00 3.1996589863779817e-01 run_vdwl: 0 -run_coul: -116.71802082193 +run_coul: -115.769113007043 run_stress: ! |- - -2.4835363775665854e+01 -4.4541474310543748e+01 -4.0539113771971820e+01 4.4719161213604117e+00 -7.2757660582635388e+00 9.6680948137112992e+00 + -2.3519451591948346e+01 -4.4269900044019352e+01 -4.0933115596461185e+01 5.0512455245215024e+00 -6.3318043371823549e+00 1.0364967781882934e+01 run_forces: ! |2 - 1 2.5264709462229580e+00 -3.5349624989409451e-01 5.2968707966332063e-01 - 2 -2.1644503540213622e-01 -3.0493980950234292e+00 -1.4761795027065561e+00 - 3 7.8662307249288688e-05 -9.0782707866260720e-02 2.8647427052925105e-02 - 4 -1.5581725903996060e-02 2.7348972550788296e-02 -3.0157299144931854e-01 - 5 -4.7638641996990144e-01 7.0484709221202535e-01 -1.0673581876119338e-01 - 6 1.6933615277685805e+00 -3.6363966212223238e+00 -2.9943312397967108e+00 - 7 -2.0589965854398640e-01 6.8253754850272963e-01 4.0359888564617492e+00 - 8 -1.5353784477358678e+00 4.1710449220763124e+00 2.6914984183951272e+00 - 9 1.7088024044852790e+00 -5.7243484246895990e+00 1.4839287495158691e+00 - 10 -2.6316758590971912e-01 3.9688997260182618e-01 -2.7650670411410727e-01 - 11 -9.3411998640142624e-01 1.1019023500184586e+00 -6.0367081301819114e-01 - 12 3.0199261242397877e+00 -6.8575414927573008e-01 1.5805474097616101e+00 - 13 -1.2328424351207645e-01 3.6130220893863113e-02 -2.0249629480781231e-01 - 14 -1.1276383894807320e+00 4.3647122449185954e-01 -1.1549649379142429e-01 - 15 3.1919482477018180e-01 -1.7075468040744196e-01 -1.0791965480316745e+00 - 16 -7.9425478786572790e-01 -3.9123456725839634e-01 2.1007508866438482e+00 - 17 -2.4727245471287915e+00 6.1784837273567002e+00 -7.1232353533540893e+00 - 18 1.1361430692220097e-01 5.0270678285625703e+00 -8.2174116527091314e+00 - 19 2.3419751693240562e+00 -7.3442896062841045e-01 6.0993929162842093e+00 - 20 -2.9518202542241632e+00 -4.1534867741629560e+00 3.9962590196433561e+00 - 21 2.0495665906126987e+00 4.6441160885790538e+00 -9.4697190095723265e+00 - 22 2.1031441705947640e+00 -5.0227727391775001e-01 6.3379615662525399e+00 - 23 -4.6112387473570271e+00 -3.6693454202882467e+00 3.6768950684426365e+00 - 24 -1.8961469671260887e+00 1.0361917724880996e+01 -5.6412693313741427e+00 - 25 3.6317176164293778e+00 -3.2477856843784463e+00 4.0176574036198609e+00 - 26 -2.2733350545047011e+00 -7.3197323277944895e+00 1.0396381803200354e+00 - 27 -2.5160721548806420e+00 1.1212536958850635e+01 -4.0078254654596908e+00 - 28 4.8077085609858141e+00 -4.7963819555676261e+00 3.8416447791070776e+00 - 29 -1.9020668987159577e+00 -6.4556907392026206e+00 1.5514945778221004e-01 + 1 2.5258946173516779e+00 -3.7288518169560009e-01 5.3514177027598298e-01 + 2 -1.4715545408270148e-01 -3.0264574124754033e+00 -1.4894445493806217e+00 + 3 1.0500390574150736e-03 -8.8875049027054814e-02 3.0280760123272236e-02 + 4 -2.4189379124307187e-02 3.0252742144844740e-02 -2.9826010992109114e-01 + 5 -4.8867941094417855e-01 7.0581218051020234e-01 -1.0225794667203067e-01 + 6 1.7338103026781466e+00 -3.6553504352471182e+00 -3.0871817746687089e+00 + 7 -2.4591949705749722e-01 6.9285573075088747e-01 4.1380368669371013e+00 + 8 -1.6193029647498256e+00 4.2062769598680880e+00 2.7079646597699227e+00 + 9 1.7251180544160765e+00 -5.6500639093108367e+00 1.3947895607866703e+00 + 10 -2.6093154854977652e-01 4.0329339910642592e-01 -2.6964125221098018e-01 + 11 -9.3431501443295562e-01 1.0985193660815762e+00 -6.1888106474593496e-01 + 12 3.0287023600695879e+00 -7.0433884248093270e-01 1.5692006774271818e+00 + 13 -1.1503753462631820e-01 4.5047007437605889e-02 -2.0284266108139365e-01 + 14 -1.1262747615470290e+00 4.2950858049025109e-01 -1.2226347643254003e-01 + 15 3.0586177111686119e-01 -1.4976352243802399e-01 -1.0601736345371104e+00 + 16 -7.8459903507755857e-01 -3.8543367152004171e-01 2.0794197223712256e+00 + 17 -2.4480109848719396e+00 6.0527092793793438e+00 -7.0277116770798056e+00 + 18 5.1790759961983357e-01 5.4622818990979116e+00 -8.4646445525226994e+00 + 19 1.9595783860640854e+00 -1.0576972141958818e+00 5.9364845403361928e+00 + 20 -2.9825701578035031e+00 -4.2593805399508611e+00 4.4199963469455579e+00 + 21 1.9207734206997651e+00 4.8208755188061545e+00 -9.3758477661719208e+00 + 22 1.8104585031930387e+00 -7.1506586437848596e-01 6.1985009569166687e+00 + 23 -4.1994250069900838e+00 -3.6148387253329828e+00 3.7335943463573038e+00 + 24 -1.6771706051867461e+00 1.0048010794669619e+01 -5.4155107883397040e+00 + 25 3.1768050750067891e+00 -3.3033380107108909e+00 3.6279721117024319e+00 + 26 -2.0583074007305582e+00 -6.9742470044044724e+00 1.1712086943398961e+00 + 27 -2.3176869767772779e+00 1.0965677277242001e+01 -4.0813748034761499e+00 + 28 4.5181241679075521e+00 -4.7061579173489960e+00 3.7671014420833107e+00 + 29 -1.7945085646285721e+00 -6.2972274350673265e+00 3.0634360086797174e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-dpd.yaml b/unittest/force-styles/tests/mol-pair-dpd.yaml index aef725b43..5f747fa0b 100644 --- a/unittest/force-styles/tests/mol-pair-dpd.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 21:10:43 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -25,69 +25,69 @@ natoms: 29 init_vdwl: 50.8160702483393 init_coul: 0 init_stress: ! |2- - 3.6659006242073438e+01 5.4261754086936989e+01 3.3682647206296181e+01 -1.0639502210269674e+01 -1.3242166325151132e+01 -1.4005742776704770e+00 + 3.6892707387868946e+01 6.7100128759684480e+01 2.4650529885588522e+01 -1.5957061281779284e+01 -1.8149194861854802e+01 -5.8188961718178627e+00 init_forces: ! |2 - 1 -1.1844697157183162e+00 1.6367083324345932e+00 -1.6164431978301712e+00 - 2 5.9078058310112114e-01 -6.0553807698868589e-01 -2.1617375342810174e-01 - 3 -7.6670713851187267e-01 9.5003276134905523e-01 -6.7203322276142896e-01 - 4 4.4787169248842112e-01 -4.3914625391182971e-01 -5.8111112052406744e-01 - 5 -1.2566744054424648e+00 1.8761399407436345e+00 -4.8645772466641685e-01 - 6 -1.6171557231152949e+00 7.1464499795349412e-01 -1.1092084859232529e+00 - 7 1.1956986434615127e-01 1.2135254550373868e+00 2.6819777778344200e-01 - 8 -2.1606790779612939e+00 -1.0009077427785185e+00 1.7624525183721518e+00 - 9 1.3390099051452800e+00 -2.4735014123573014e+00 2.6740746462472815e+00 - 10 -7.8052872767806614e-01 -5.1102960795557006e-01 1.2478278288073179e+00 - 11 4.0096519237235989e-01 2.7454704972916344e-01 -3.3778771500254134e-01 - 12 3.9978944625028723e-01 3.4308831109613191e-01 -1.5338273501432327e+00 - 13 1.5638145849054872e+00 -1.6306100536412178e+00 -6.9077800227627340e-01 - 14 -4.5890077116425876e-01 1.1040393265955490e+00 -6.5255433176928690e-01 - 15 9.9955212362127699e-01 3.1523397810554382e-01 7.6033632594470357e-01 - 16 1.5206637793429758e+00 -6.8865472048468579e-01 4.3111441160847097e-01 - 17 1.2013544348947844e+00 -1.4553000830334836e-01 -2.1134769947313517e-01 - 18 -3.8609684136209549e-01 1.9552632553349421e+00 -1.0993171536681696e+00 - 19 -8.7985885053838198e-02 1.1064297962553900e+00 -6.4383823839455312e-01 - 20 -4.9390620910171601e-01 -6.2494494552751112e-01 5.9205844998622170e-01 - 21 1.8588598933035880e+00 -2.0526524676732811e+00 -1.6157827761100985e+00 - 22 3.0244171858353114e-01 -2.0994555123327979e-01 -4.2015481943755384e-01 - 23 1.1308097884067911e+00 -7.4934399707572041e-01 -7.2061737164241713e-01 - 24 -9.7930735171085498e-02 -7.1020024239408686e-01 -1.3895944206820467e+00 - 25 -6.7072087315358186e-02 2.5524051048184027e+00 2.5032108743828103e+00 - 26 5.8007929647205347e-01 1.1494769544353340e+00 1.2006491604999117e+00 - 27 -8.5101327467370091e-01 -1.3381699849691291e+00 4.7454538915767125e-01 - 28 -5.0171482039485948e-01 -7.6930558428086560e-01 6.3938995552320765e-01 - 29 -1.7447268905698865e+00 -1.2420546143135882e+00 1.4431700454195584e+00 -run_vdwl: 50.7374424640537 + 1 -6.1811945724710027e-01 2.3173883571664340e+00 -5.7927743070743345e+00 + 2 2.8929655050793355e+00 -4.2032369049876186e+00 -4.5732102302996736e-01 + 3 1.2111415459590413e+00 1.6558234808322891e+00 -2.2961228671122371e+00 + 4 3.5394004143194646e+00 -2.3035015829595218e+00 -1.3641987601371781e+00 + 5 -1.8832502792421750e+00 5.0906425469293781e+00 -2.2057512109247330e+00 + 6 -2.2333912801170257e+00 2.2657582324664594e+00 -3.0734510518473508e+00 + 7 2.2298272918462989e+00 3.7138822465230423e+00 2.5183334318922919e+00 + 8 -6.3492168885446878e+00 -1.8828521215298335e+00 5.2030707083876209e+00 + 9 4.0929931591392581e+00 -7.4054775241769404e+00 7.4915838856534567e+00 + 10 -3.5586310254099738e+00 5.3603421342951407e-01 3.7197577264422352e+00 + 11 1.0545983888793937e+00 2.2487334905601659e+00 -3.8191671705714930e-01 + 12 -1.5652344136101608e+00 2.2541934214449273e+00 -4.5220008905007409e+00 + 13 2.9243943649558548e+00 -4.9866441037279090e+00 -1.8565392165406420e+00 + 14 -2.8069161382250161e+00 3.7027724692593043e+00 -4.2624825734854405e-01 + 15 7.7052459866296241e-01 5.3708815883671424e-01 2.9059187282982779e+00 + 16 3.0575856982307155e+00 4.9924530450306781e-01 -2.6653711669894414e-01 + 17 2.6495080101004591e+00 1.2978224993899932e+00 -2.5632209407738165e+00 + 18 -2.1683893991964789e+00 3.7691362947665716e+00 -1.1918735044626905e+00 + 19 -5.8713827717704992e-01 1.7228164810783004e+00 4.4129286219489205e-01 + 20 -2.4088777177527940e+00 -3.5847907968828845e+00 3.4285635166590178e+00 + 21 4.0089795873488763e+00 -4.1418472837398728e+00 -3.4518728418911024e+00 + 22 3.0846056053219562e-01 4.3785944212578609e-01 -9.9181014238192505e-02 + 23 2.3617912754383887e+00 -1.5720129064982027e+00 -1.3546495408095991e+00 + 24 -1.3523740060071268e+00 -4.3697535216990699e+00 -7.7979874182561053e+00 + 25 -5.6710838477103620e-01 6.3846221568324069e+00 5.8112107624113110e+00 + 26 1.1594567498693216e+00 2.5148956294408302e+00 2.5279988363479085e+00 + 27 -1.2551354817636557e+00 -2.4343811771905930e+00 2.9640832530850625e-01 + 28 -4.6829625062261160e-01 -1.4739473222403159e+00 1.4861524185706241e+00 + 29 -4.4395481506746695e+00 -2.5902691799524233e+00 3.2713554765371877e+00 +run_vdwl: 50.8096741022807 run_coul: 0 run_stress: ! |2- - 4.1422955803623331e+01 4.3064652697165656e+01 4.1559179146658437e+01 7.4714571002631666e-02 -6.1411164156467883e+00 1.4393452677580411e+01 + 2.2678525097938930e+01 1.2784099465722879e+02 8.7854358412948542e+01 -1.0634323344871795e+01 1.4108052497366335e+01 8.9515364908436243e+00 run_forces: ! |2 - 1 3.4481229012955250e-02 8.7676427505874033e-01 8.6953159985570505e-01 - 2 -6.0685163413262000e-01 1.8054270473749765e+00 -1.3447724583087066e+00 - 3 -1.5489568074370474e+00 -1.1697195695126381e+00 -4.2016898199405944e-01 - 4 6.6483248479230617e-01 -2.8537552833949398e-01 -1.4262159415572853e-01 - 5 -2.5079573819493115e+00 -5.4749684288447742e-01 -9.2176487630526061e-01 - 6 -3.3683366742684075e+00 -2.8370086919843733e+00 2.3787004700359460e+00 - 7 -1.1088909812982797e+00 1.0662320225284174e+00 -1.5547571601775303e+00 - 8 4.8274899963537232e-02 -1.2662741349835094e+00 -1.1264999586848734e-02 - 9 -7.9392140576769521e-01 6.6309466709101994e-01 -9.3428302967917221e-01 - 10 6.5582745048635882e-01 -1.3935631322559230e+00 3.9652481372835024e-01 - 11 -8.9581634608744354e-01 5.8270221289096336e-01 -1.3470229861712517e+00 - 12 -2.4813480073283825e-01 -2.7914371015992118e-01 8.8475895601011501e-01 - 13 1.4411772191850578e+00 3.4229035626071758e-01 -9.6466421809601099e-01 - 14 -3.1820502106474224e-01 2.1107989751378229e+00 -8.3403511682963416e-01 - 15 2.0411952060439429e+00 -5.1687781239112196e-01 3.4118955931228845e-01 - 16 3.0305751663940432e+00 -2.4465966801613774e+00 1.3803648518062497e+00 - 17 -1.0562126497005115e+00 9.6026338984160364e-01 -2.3396185799019276e-01 - 18 -7.5924641415145447e-02 7.1108337715179815e-01 -1.6611081292757415e-01 - 19 3.1563313366696760e-01 9.5045473920794418e-02 -1.0350203415743287e+00 - 20 7.1217787971185398e-01 8.5821099595470418e-01 -6.2148643809194115e-01 - 21 1.1641790863537491e+00 -1.2981288871776584e+00 -1.0807519983757896e+00 - 22 6.7878931351872340e-01 -9.8995510259034769e-01 -9.1730222916933746e-01 - 23 8.2288292170920641e-01 -5.9516667563818060e-01 -3.0490413116568965e-01 - 24 1.5162054875185491e+00 2.0320373989442251e+00 3.4664118563573796e+00 - 25 -3.1630494516391483e-01 6.7230329810281941e-01 -3.3471315058754225e-01 - 26 1.5511596931497584e+00 1.6116056217251533e+00 2.0701295755454581e+00 - 27 -3.7771214801276926e-01 5.3972810782104752e-01 1.8785917006737876e-01 - 28 -6.7292064687859554e-01 -5.3102331619676224e-01 1.3811176625034274e-01 - 29 -7.8124508759768641e-01 -7.7125713552902087e-01 1.0560237622173840e+00 + 1 -1.7817873269727535e+00 6.2958320592412083e+00 2.6140480773916126e+00 + 2 -4.4668514450366299e+00 1.8131714921158988e+00 -3.9607614963066364e+00 + 3 -1.8360646410869066e+00 1.3242249407188427e+00 -6.3507884122851603e+00 + 4 3.0092138359786547e-01 2.7395496956815835e-01 -1.0763191332361717e+00 + 5 4.1513500319666843e+00 -3.3813450528795141e-01 -3.0570629049500382e+00 + 6 -1.2260313156327576e+00 -2.8493442951267669e+00 -3.8060524656173294e+00 + 7 -1.3044270874988177e+00 2.8398523334618928e+00 -1.7647525584948087e+00 + 8 -6.2683632958193503e-01 1.3979093255941417e+00 -4.2665185505765928e+00 + 9 -1.9549427106357171e+00 3.4247967137764723e+00 2.4584448055910790e-01 + 10 -2.8933741028250828e+00 1.7423599866923007e+00 2.3222166524863680e-01 + 11 -2.9946611781847885e+00 7.7799079023894357e-01 -1.9660842792388940e+00 + 12 5.6191580163197248e+00 -3.1933819064589040e+00 -5.9496481627234021e-01 + 13 -8.1307257033710965e+00 8.7441296873458327e+00 5.1434628221701804e+00 + 14 -5.7764739992206438e-01 -3.7916450385835008e+00 -1.6242549437078972e+00 + 15 4.3521554990960247e+00 1.5350547261912393e+00 -4.2769795281650569e-01 + 16 3.1094674789710601e+00 -1.1286007702341864e+01 4.4378713310985392e+00 + 17 3.6730722564407965e+00 -1.8174230235240803e+00 7.5054301291157599e-01 + 18 -2.0755971173056276e+00 -5.2810808660261943e-01 2.7831781157151609e+00 + 19 6.1844675625589784e-01 -9.0508801091877344e-01 -1.2260404189643337e+00 + 20 1.0928003864053180e+00 1.7480100531348799e+00 -7.2333813053057794e-01 + 21 2.4344679854458739e+00 -2.7774459023705229e+00 -2.3341327389925390e+00 + 22 1.1690463549067964e+00 -1.5966715112595395e+00 -1.5065928249789802e+00 + 23 8.6972535785731409e-01 -1.8149971317231608e+00 -7.4430485209621311e-01 + 24 3.0914870963050090e-01 1.6741775832908039e+00 3.7805111454740654e+00 + 25 2.5727763210556320e+00 6.4836809086378526e+00 9.3960305698174285e+00 + 26 1.2803074900998423e+00 -7.1054142754679894e-01 -3.2342724777823051e-01 + 27 -4.7655979592968084e-01 -2.6983379944944734e+00 1.6792409122971659e+00 + 28 9.4585460171677649e-01 3.4741640704938903e-01 -6.3920598934117945e-02 + 29 -2.1531924757822534e+00 -6.1154354408188967e+00 4.7540621930938949e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml index 888480c84..43f513697 100644 --- a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 21:31:49 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -25,69 +25,69 @@ natoms: 29 init_vdwl: 0 init_coul: 0 init_stress: ! |- - -1.4863518588872060e+01 1.5507190667237291e+01 6.1320555319686756e+00 3.9903391393997706e-01 8.4645463107459147e+00 9.5549166743249305e+00 + -4.6687539855295086e+01 4.9351871918169586e+01 1.9462073390484221e+01 1.1522898817888347e+00 2.6715868685014787e+01 3.0212103324046076e+01 init_forces: ! |2 - 1 -2.2862827209360765e+00 1.8273528276910633e+00 -6.0159909432330982e-01 - 2 -1.4856656887782247e+00 8.2761293548833348e-01 4.2555006425664910e-01 - 3 2.1292650733221401e+00 -1.8951288305607377e+00 -1.0712180441166039e+00 - 4 2.1475547687962981e+00 1.4267316029329133e-01 2.3856061975565590e-01 - 5 7.2250550075718567e-01 -9.8475783851067783e-02 -2.2535728434952168e-01 - 6 1.2405083695898295e-01 8.3877987836870205e-01 -1.8325499188852330e+00 - 7 -6.8641567371201515e-02 -2.2059602234048303e+00 8.0324856247662213e-01 - 8 7.2737406915213798e-02 1.6777618193756783e-02 -2.0734596877401831e-01 - 9 1.4450773135946633e+00 1.2980713925188412e+00 -8.2828426571510438e-01 - 10 4.1171139262563566e-01 -1.3556848612751655e+00 -1.0739762365888486e+00 - 11 2.6835323013616164e-01 -1.9588302977733782e+00 2.6813105151748928e-01 - 12 -1.6632137162094256e+00 1.9498046949511176e+00 1.0143819707834012e-02 - 13 -8.7976243986653102e-01 1.3631910113257160e+00 1.1410083492464635e+00 - 14 -1.8965600133047860e+00 9.3937776064309891e-02 2.0467744909156078e+00 - 15 1.6976061149407253e+00 -1.1280904614799869e+00 5.1319657625596116e-01 - 16 -1.5977255554923007e+00 1.0221367042201095e-02 -5.8489694260239411e-01 - 17 9.5438719219347445e-01 -1.7720481905618479e-01 1.0156393167078182e-01 - 18 -9.8730930021237306e-01 -1.3247846104852807e+00 1.8813126261912012e+00 - 19 -1.3254672806140730e-01 1.8620333793350834e+00 -1.9282622481261882e+00 - 20 7.2225428344170295e-01 -2.5659914253624355e-03 -2.2920240922768265e-01 - 21 -2.4203470930416701e-01 2.4120310618804819e-01 1.8895553235188441e-02 - 22 5.2798332199600295e-01 -9.3201542918092561e-01 -7.4176429016929357e-01 - 23 -5.2845051218111827e-01 -4.1317228656597849e-01 -2.5007643564248250e-01 - 24 5.6707723481417194e-01 5.1429055736404905e-01 7.3131657174007469e-01 - 25 -6.6896850435818875e-02 3.3284288810290708e-01 4.5699653538675844e-01 - 26 -2.6362901957130650e-02 4.6946935629112840e-01 8.0786005811105099e-01 - 27 -3.9512178307521062e-01 -6.2478190671493694e-01 2.4875747677438484e-01 - 28 9.4276840865047695e-01 1.2060543067370164e+00 -7.3475860849092600e-01 - 29 -4.7675759195706352e-01 -8.7762075418173024e-01 6.1597545976988388e-01 + 1 -7.2328456924427584e+00 5.7940882979878516e+00 -1.9113458994953860e+00 + 2 -4.7012552053477972e+00 2.6790433622112029e+00 1.3635054923932115e+00 + 3 6.7026840921825519e+00 -5.9676736223445852e+00 -3.3915830059988763e+00 + 4 6.7720348606807050e+00 4.4897514073361894e-01 7.3699294700173423e-01 + 5 2.2641402851829380e+00 -3.0068528179815801e-01 -7.0405550435704589e-01 + 6 3.8060724417554281e-01 2.6748465545886400e+00 -5.7964182766309769e+00 + 7 -2.2133732408803938e-01 -6.9774772305119797e+00 2.5264591006359773e+00 + 8 2.4465313596787006e-01 4.6326099237548796e-02 -6.5548290876933113e-01 + 9 4.6008975462626109e+00 4.0741970716807616e+00 -2.6046982182064569e+00 + 10 1.3105173187870238e+00 -4.2815681824719514e+00 -3.4031103728174159e+00 + 11 8.6105544885335550e-01 -6.2190550613015629e+00 8.2127965805063419e-01 + 12 -5.2306627073584071e+00 6.1558020734960950e+00 1.5159055020244949e-02 + 13 -2.7417536790402499e+00 4.3217599539828084e+00 3.5954257245416121e+00 + 14 -5.9590226706683529e+00 2.6364375602318019e-01 6.4280529689211257e+00 + 15 5.3060104549347393e+00 -3.5896971016923067e+00 1.6530175660965871e+00 + 16 -5.0488486467589757e+00 2.3817820556776698e-02 -1.8345561896126288e+00 + 17 3.0232227817807069e+00 -5.6139986964704991e-01 3.2862426659496424e-01 + 18 -3.1264281718723121e+00 -4.1924022873627225e+00 5.9512680247918723e+00 + 19 -4.3407167757777054e-01 5.8428103842327390e+00 -6.0433393810444853e+00 + 20 2.3026133842723451e+00 2.9552056159787593e-02 -7.4952789772228434e-01 + 21 -7.7473655187022250e-01 7.7388893262883784e-01 6.2736158342296552e-02 + 22 1.6603364866966335e+00 -2.9367801261543445e+00 -2.3342260342469818e+00 + 23 -1.6699329114530093e+00 -1.3088087271620072e+00 -7.9172253827715888e-01 + 24 1.7900804065908333e+00 1.6304805621017786e+00 2.3038915888846510e+00 + 25 -1.9674546833730522e-01 1.0510983853497511e+00 1.4541486874270233e+00 + 26 -8.8313762566712167e-02 1.4804367928896129e+00 2.5513639280965590e+00 + 27 -1.2490320852115100e+00 -1.9737520890838323e+00 7.8565948584169509e-01 + 28 2.9789779555230393e+00 3.8088456373801565e+00 -2.3195005779078426e+00 + 29 -1.5228448472974749e+00 -2.7903133017106532e+00 1.9619821524466814e+00 run_vdwl: 0 run_coul: 0 run_stress: ! |2- - 8.3092195130617679e+00 8.8087197187448734e+00 1.0866432257972122e+01 -8.1281050865178219e+00 6.1784321167959544e-01 1.2769573774314161e+01 + 2.4294890492962999e+01 3.0347325682966968e+01 3.3820201867786089e+01 -7.1105145407394744e+01 -3.5810693265581229e+01 4.3483684612321461e+01 run_forces: ! |2 - 1 -2.6266020324984418e+00 8.2201323231265433e-01 1.4749772754591481e+00 - 2 -6.7727359927535269e-01 3.4376214998698523e-01 3.3945746781764990e-01 - 3 1.2005782584962879e+00 -1.2936196454264879e+00 -2.2402845222284338e+00 - 4 -4.6620764610046389e-01 1.2647101563213287e-01 5.5250822226653018e-01 - 5 4.7978394625545873e-01 8.4332151113409659e-01 4.0792830629323895e-01 - 6 -1.9542443055945939e+00 1.8975617142665895e+00 -1.4594911348609056e+00 - 7 -1.4108099415497104e+00 2.3954491258832861e-01 -1.2427949751680076e-01 - 8 -1.1547560498892029e+00 -1.8379407309448745e+00 -4.6290176506793662e-01 - 9 8.7444831756269625e-01 1.7307448537307921e-01 -9.4793513740431135e-01 - 10 -1.5440048971445408e+00 1.1902331107098123e+00 1.5660650435305974e+00 - 11 3.2614898531042802e-01 -4.2343515656746933e-01 5.0440985609457700e-02 - 12 1.3776465372608324e+00 1.4429336351759697e-01 -1.6572768459783505e+00 - 13 -8.6025935005236043e-01 2.7602052190506163e+00 2.5047228082143205e+00 - 14 4.4891746327495946e-01 1.3153910663546353e-01 -3.2960784140102711e-01 - 15 2.8031565087975010e+00 -4.0492304325231793e-02 -4.5542531410557574e-01 - 16 1.1568450190673436e+00 -1.1170400443284660e+00 -1.2861306908004659e+00 - 17 -8.2046202580916117e-01 -6.3104829619459157e-01 8.5616193459003953e-01 - 18 6.0985267110501340e-01 2.9694956148679935e-01 -4.9116597815368851e-01 - 19 8.9776027762713906e-01 -2.1131588536445838e+00 9.4252335520116859e-02 - 20 -6.9884697162063159e-01 -5.5952187995536673e-01 5.5287452375002544e-01 - 21 1.1130356718786313e-01 -1.5375054927828511e+00 -8.7481829335361294e-01 - 22 -2.2236601797334588e-01 -3.7232353752499980e-01 -1.2962704074569753e-01 - 23 5.4653190458065948e-01 -2.7157662292855400e-01 -1.4905757681812964e-01 - 24 -2.8461666700526816e-01 -1.1789184552344745e+00 -1.5110335752078661e+00 - 25 2.9600652072485212e-01 1.6062798669357845e+00 2.8507004383966761e+00 - 26 4.3391222627809989e-01 5.1464600762894475e-01 7.3814317764947623e-01 - 27 -4.1598115100324368e-01 -7.2346157494410113e-01 8.9386495870487659e-01 - 28 1.6883094994906600e+00 1.4344049162319250e+00 -1.0316591583781085e+00 - 29 -1.1477104750347786e-01 -4.2425757868875719e-01 2.6859689421875543e-01 + 1 -3.5547855575570111e+00 4.0287093684262114e+00 -3.9869645340884801e+00 + 2 -3.4493541354285702e+00 9.0642805501380508e+00 4.7388958769792158e+00 + 3 2.1895616374799748e-01 8.7321671206312459e+00 9.1138305051058843e-01 + 4 4.0454725776111961e-01 1.1703825070353404e+00 1.4277276437467361e+00 + 5 3.0836945546572569e-02 -6.3338891074957600e+00 2.0556931620779189e+00 + 6 5.2049045911099254e+00 -3.6946697560174835e+00 -8.3534127639509101e+00 + 7 -7.8387806180394759e-01 -4.3841559354291073e+00 1.9271443633409984e+00 + 8 -2.1556872088183845e-01 -1.9081189969060461e+00 2.2019550032145827e+00 + 9 1.6263303460860108e+00 -4.3714904472485632e+00 6.6163769327397326e-01 + 10 -7.4675899614036663e+00 4.1823518367578707e+00 2.8891805669669477e+00 + 11 -9.1059932159297263e-01 -2.2661895638947338e+00 -1.1543544444219824e+00 + 12 9.4058428289210614e+00 -2.5968139783935786e+00 -5.3500027307520048e-01 + 13 5.9138904151835652e+00 -1.2562008243524563e+00 -2.3294348371173941e+00 + 14 2.0646879566692116e+00 5.9041586885258601e-01 -1.3733700322276128e+00 + 15 3.8374784910105875e-02 -2.8326258645669506e+00 -2.8927477810003452e+00 + 16 -5.3239770591399713e+00 8.9328312197975523e-01 2.7598521055662952e+00 + 17 -3.9540055528974118e+00 1.4357468212883817e+00 3.4721582095959200e+00 + 18 -3.0279611313340724e+00 1.2681073034400807e+00 -1.1503209559626970e+00 + 19 -1.9239678902706352e+00 -1.3242134762883913e+00 4.4911356430445117e+00 + 20 -1.2623991049252579e+00 -2.1960965962407810e+00 9.1988403548467634e-01 + 21 4.3082688438050791e+00 -1.1420444331518340e+00 -3.2727837285152765e+00 + 22 2.5209084474771229e-02 5.3116215226482488e-01 -8.5735240307672556e-01 + 23 2.7289139734873071e+00 -3.9899287773647423e+00 -4.0853667579875497e+00 + 24 1.0926031561365961e+00 1.2988189830146233e+00 4.2022394276776094e+00 + 25 -2.2885914839897685e+00 2.9633916090002344e+00 3.4649649113986380e+00 + 26 -2.6664626977409487e+00 -2.8815741087188123e+00 -5.2586580088091219e+00 + 27 1.1757585471555640e+00 1.6420797748418081e+00 -7.9517257143923448e-01 + 28 4.7550022255629969e+00 6.8091435471752524e+00 -2.8253787377246828e+00 + 29 -2.1649864415918119e+00 -3.4320286987770263e+00 2.7464661365186007e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-e3b.yaml b/unittest/force-styles/tests/mol-pair-e3b.yaml index 961cd7778..22705b123 100644 --- a/unittest/force-styles/tests/mol-pair-e3b.yaml +++ b/unittest/force-styles/tests/mol-pair-e3b.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 08:52:27 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 -1.0470258927690863e+00 9.2906307144144673e+00 -3.6990588127802435e+00 28 8.5365856050054738e+00 -2.4636423220451302e+00 4.2276358718634395e+00 29 -3.8831706532739356e+00 -5.2900046950811053e+00 -1.5026494435836046e+00 -run_vdwl: 102.202850692313 -run_coul: -113.74103929774 +run_vdwl: 557.066176544541 +run_coul: -128.962676522943 run_stress: ! |2- - 4.0014750547554610e+02 4.7040900572683694e+02 2.6188180201410347e+02 -3.3090394877678114e+02 -8.0167848651330445e+01 1.2621115498095926e+02 + 1.3827073371577881e+03 1.6513097461669279e+03 3.5578978559523357e+03 -1.0466353253226539e+03 -1.9198540562801580e+02 6.8418143769098492e+02 run_forces: ! |2 - 1 3.1753218849895195e+01 8.3621920552134796e+01 3.0316318454889249e+01 - 2 1.4286535205016118e-01 -2.2824035719485072e+00 -7.5551038919350355e-01 - 3 -2.3574837309870125e+02 9.7602019200417502e+01 8.4388048810067190e+01 - 4 -8.8996093986925678e-02 3.2157992415099795e-01 -2.6834893584213759e-01 - 5 -5.1176909694949801e-01 6.2243255012750509e-01 3.0305985432304289e-01 - 6 1.0988093506139059e+02 -9.6340562635087679e+01 -1.2877640891894038e+02 - 7 4.4591375102032806e+00 -1.1562280722232016e+01 -3.8449881125068998e+01 - 8 -1.8500977069146241e+00 3.2142650450768677e+01 1.0393367243164468e+02 - 9 1.6031488329434944e+00 -6.7043925776626629e+00 9.3597399196991460e-01 - 10 3.9843479450387534e+01 -6.6883719610197858e+01 -8.8591570116850775e+01 - 11 -1.2251023547936200e+00 1.4050644132057466e+00 -8.2053515811467215e-01 - 12 2.1038151487042072e+01 1.6333275200719637e+01 -1.0224098677807561e+01 - 13 -3.5460669347482632e-01 3.4985633903056490e-01 -2.8587442295445253e-01 - 14 -1.5532009179877173e+00 6.6724074348461260e-01 -4.7736430412614694e-01 - 15 1.8618152589723655e-01 -1.8742421063994502e-01 -1.0508719338896062e+00 - 16 5.0203982778403507e+01 -6.4427805216374551e+01 1.3348312651468889e+01 - 17 -1.7324433827001716e+01 1.5943398209626597e+01 3.6242072305639176e+01 - 18 -5.1244673656886619e-01 4.6503724792902705e+00 -7.5634833647837292e+00 - 19 2.1299064571460709e+00 -1.7007860994064594e+00 6.5142742813041359e+00 - 20 -3.2615898343840461e+00 -5.6090812774873386e+00 4.2429891063539174e+00 - 21 8.0741655650871391e-01 3.0937838483255220e+00 -7.2914969367797333e+00 - 22 3.9626151599754680e+00 1.5703953876725520e+00 4.8509806980792467e+00 - 23 -7.0701628159593684e+00 -4.4624515654731045e+00 2.0542173004071516e+00 - 24 -9.5064820343282552e-01 8.5254518575092533e+00 -5.0323755005400344e+00 - 25 5.5723194185180853e+00 -7.0640318784218714e-01 4.4527210593220081e+00 - 26 -4.8649543979323449e+00 -7.4562688050941262e+00 -1.0189293139994318e+00 - 27 -1.5562227560397666e+00 9.3814184738732589e+00 -3.7918644430887172e+00 - 28 8.9221127912602523e+00 -2.5727955175008117e+00 4.4191999926606860e+00 - 29 -3.6328666974943009e+00 -5.3344846333902503e+00 -1.6032273961495329e+00 + 1 1.3438372823206160e+02 3.9110638276480222e+02 1.4372190964431556e+02 + 2 8.4106430622620895e-02 -3.3170823819419391e+00 -1.2959311763442800e+00 + 3 -1.4344524748502198e+02 -3.7987705614850756e+02 -1.3597975758214656e+02 + 4 2.0104083686159213e-01 2.0190452797471847e-01 -1.9461145870043403e-01 + 5 -4.0783322496182373e-01 6.8277414809831072e-01 -7.6705008563570071e-02 + 6 -8.0186612421623647e+02 9.1519502179029337e+02 1.0260107904368799e+03 + 7 5.5599224683477999e+01 -3.1060608252120670e+02 -1.5710863704241419e+03 + 8 2.0820414389974499e+02 -1.2566261033899949e+01 7.2888745132514362e+02 + 9 1.6417569323299031e+00 -5.6607012833177039e+00 1.5389913437564537e+00 + 10 5.1708870956353542e+02 -6.0320283837277157e+02 -1.9112447307581908e+02 + 11 -1.0678895704188260e+00 1.3261191280665403e+00 -5.3274878053149755e-01 + 12 2.5353982085205910e+01 1.5685564381134430e+01 -1.2430711964445356e+01 + 13 -3.8442948570595092e-01 1.8389867402248558e-01 -1.7991908151570851e-01 + 14 -1.2584695940382640e+00 5.7738186322955465e-01 -2.9305045014002512e-01 + 15 2.0536323375519605e-01 -1.2706294668727180e-01 -9.9768424520152044e-01 + 16 4.3290443408744238e+02 -3.1045375328804931e+02 -1.1106960352489104e+03 + 17 -4.2667740865094578e+02 3.0193016998901015e+02 1.1235221351356097e+03 + 18 6.1047700133823865e-02 4.7332652961324921e+00 -8.3868091494446517e+00 + 19 1.7492231630110235e+00 -1.5857723638191670e+00 6.5897569908934397e+00 + 20 -3.2978359356737288e+00 -5.6022684341222755e+00 4.7827042876857000e+00 + 21 9.3480335441838858e-01 3.1326587455432593e+00 -7.8330933298287642e+00 + 22 3.7261519551649847e+00 1.4172437334214478e+00 5.0324960181202583e+00 + 23 -6.8415441517820241e+00 -4.4532263148509799e+00 2.2887846666634930e+00 + 24 -8.9090753628727304e-01 7.8520494498642224e+00 -3.8247020552615014e+00 + 25 5.0643483844706942e+00 -9.2686987367170670e-01 4.2180069432013081e+00 + 26 -4.6718698047003722e+00 -7.1817047523823518e+00 -6.8611498894351219e-01 + 27 -1.0649835466087993e+00 9.2995618780684364e+00 -3.6890686846484355e+00 + 28 8.5542886653272330e+00 -2.4660445238995101e+00 4.2306093742730209e+00 + 29 -3.8818100051825755e+00 -5.2972721305338064e+00 -1.5158494619558829e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-gauss.yaml b/unittest/force-styles/tests/mol-pair-gauss.yaml index b5e69bcfa..c83d82f39 100644 --- a/unittest/force-styles/tests/mol-pair-gauss.yaml +++ b/unittest/force-styles/tests/mol-pair-gauss.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 20:26:38 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -54,38 +54,38 @@ init_forces: ! |2 27 1.3703266730383692e-03 6.2247400367154799e-03 -2.6349027873549895e-03 28 4.1766990025931270e-03 -1.2043760854333907e-03 2.6647558305012602e-03 29 -3.5922837617955406e-03 -3.4710661493005325e-03 -1.0719806881093012e-03 -run_vdwl: -0.385719521571276 +run_vdwl: -0.386350865161716 run_coul: 0 run_stress: ! |- - -2.2127965562428206e-01 -2.4542254865102489e-01 -2.1311997533750865e-01 6.1590688961780077e-02 6.4710641726297407e-03 2.3860454991976896e-02 + -2.2160110236171965e-01 -2.4617131296379000e-01 -2.1305840663314177e-01 6.1838681126107659e-02 6.6381976968359312e-03 2.4402003044659750e-02 run_forces: ! |2 - 1 6.6339333601653496e-03 -2.2524710536472679e-02 -1.1066345716895123e-02 - 2 -4.2961292258735032e-03 -6.1061479512316179e-03 3.4551164581031772e-03 - 3 1.4098065137618113e-02 -6.5678509183120749e-03 -3.4500687443776165e-03 - 4 9.1297675704199062e-03 -9.2076983650763843e-04 5.6840784353467486e-03 - 5 4.8219769409920893e-03 3.8775965045406420e-03 -9.4999301521243983e-03 - 6 1.1609395172886160e-02 -1.6632611491897907e-04 8.8250864738019970e-03 - 7 9.2908574507960771e-03 2.0985971946703226e-03 2.0875679703349952e-02 - 8 8.2759269711901937e-03 3.2662972774544475e-03 -5.5734651879111030e-03 - 9 -8.6095270639503178e-04 -2.9570902523862082e-03 -1.1304425504033978e-02 - 10 -3.3641016068010651e-03 1.5129181364746619e-02 -1.1518357751169970e-03 - 11 2.8587329807512056e-03 8.3847827232913473e-03 9.4470919859432449e-03 - 12 -2.2597109016745633e-02 -4.9138934453695823e-03 8.5228034828072150e-03 - 13 -9.3773477120218055e-03 1.3383307270982115e-03 1.4498073944369861e-03 - 14 -3.2078148525200705e-04 -1.7694120286299623e-03 1.0809373712305968e-02 - 15 -4.3466909449344617e-03 -9.8479849482436283e-03 -1.3508873267368364e-03 - 16 -1.0974266662518333e-02 1.9734995902988880e-02 -1.1223816880544343e-02 - 17 -3.3460215145044428e-03 8.1754449563126684e-03 -1.8717672604331326e-02 - 18 -4.4353904552827620e-03 -7.9518043425390473e-03 6.6190908651599786e-03 - 19 8.6941905763071418e-04 6.7650975132080727e-04 5.6027618284191876e-04 - 20 -8.7479291857212624e-04 -8.1183654654835304e-04 2.8482497810329193e-05 - 21 -1.1799787391022290e-03 4.1795656349224598e-03 -1.9487781014492240e-03 - 22 3.1900249662174147e-03 9.9110559625285627e-04 3.9154102410000361e-03 - 23 -4.4537086142730992e-03 -2.4503511342288857e-03 7.2603134815082612e-04 - 24 -3.0597697342257743e-03 1.8858645847803469e-03 -6.4766291832782374e-03 - 25 3.7186580773971665e-03 -1.6137182737049823e-04 2.6515841867995930e-03 - 26 -2.9661843277505790e-03 -4.1377685212392670e-03 -7.6528608606584066e-04 - 27 1.3269926264425885e-03 6.2138292007353785e-03 -2.5379560415173348e-03 - 28 4.2062291078341146e-03 -1.1839109861043232e-03 2.6401605387391131e-03 - 29 -3.5767537560882274e-03 -3.4808720290122512e-03 -1.1429762022147198e-03 + 1 6.6413062980785250e-03 -2.2643146328241739e-02 -1.1142942591208689e-02 + 2 -4.2827175516235612e-03 -6.1293692790411374e-03 3.5544412327760560e-03 + 3 1.4119948940250827e-02 -6.4770130378595647e-03 -3.4543300745505934e-03 + 4 9.1950674649061044e-03 -9.6181880037213058e-04 5.6407327955521839e-03 + 5 4.8139605807970181e-03 3.8756785373474725e-03 -9.5265345859732731e-03 + 6 1.1686087085798024e-02 -1.2058408819619352e-04 8.9440737448735885e-03 + 7 9.2903951061620062e-03 2.0470436506746757e-03 2.0893971575447097e-02 + 8 8.2293078546638102e-03 3.2320594356858930e-03 -5.5960424447553192e-03 + 9 -9.0531229139671548e-04 -2.9682892647793285e-03 -1.1310091180000625e-02 + 10 -3.3259540649788755e-03 1.5162058066139865e-02 -1.2051475979010121e-03 + 11 2.8653459452275495e-03 8.4232873380028633e-03 9.4992751088281042e-03 + 12 -2.2597913046721457e-02 -4.9554168226113669e-03 8.4125389603604290e-03 + 13 -9.4443544519883221e-03 1.4213463221588211e-03 1.5001514052453023e-03 + 14 -3.4584663474122380e-04 -1.8589408798251432e-03 1.0867482270335016e-02 + 15 -4.3501928045490360e-03 -9.8084491667171560e-03 -1.3028078079482534e-03 + 16 -1.1016280904427918e-02 1.9779721304587411e-02 -1.1270569619019189e-02 + 17 -3.3423858079814819e-03 8.2235538802195984e-03 -1.8736744422015096e-02 + 18 -4.3608515422088765e-03 -7.8746354806103706e-03 6.5742308189911851e-03 + 19 9.1906994708977803e-04 7.1287404601029134e-04 5.6400074161977465e-04 + 20 -9.9447892889066537e-04 -9.1770728964396954e-04 4.8034421345478542e-05 + 21 -1.1680763991239612e-03 4.2792686042234344e-03 -2.0399769668755026e-03 + 22 3.1591713175596393e-03 9.5574540137949749e-04 3.9720638190945401e-03 + 23 -4.4307388063199804e-03 -2.5263233108993562e-03 7.5473099454995423e-04 + 24 -3.0620441606671513e-03 1.9754767097317143e-03 -6.5470110878329164e-03 + 25 3.7077221581000219e-03 -2.6401622505421555e-04 2.6260279440605853e-03 + 26 -2.9551493935843225e-03 -4.1316756613083479e-03 -6.7756590474090739e-04 + 27 1.3660170615493567e-03 6.2236935799399491e-03 -2.6252513993441232e-03 + 28 4.1796626204497374e-03 -1.2023509872189564e-03 2.6623174423427176e-03 + 29 -3.5907655914288470e-03 -3.4720702537225047e-03 -1.0790575932565119e-03 ... diff --git a/unittest/force-styles/tests/mol-pair-gauss_cut.yaml b/unittest/force-styles/tests/mol-pair-gauss_cut.yaml index b1f7feebf..ff11a0e41 100644 --- a/unittest/force-styles/tests/mol-pair-gauss_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-gauss_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 18:12:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 3.9020791209522708e-19 -3.1697607441541547e-19 3.0469446378497774e-19 28 -3.1076733010138523e-06 -1.1895073734336863e-06 2.1100984785083611e-07 29 1.2358705891224646e-02 5.2235910555193882e-03 -3.9039969829795730e-03 -run_vdwl: 0.0297607377669548 +run_vdwl: 0.0296077380266488 run_coul: 0 run_stress: ! |2- - 8.4413269615324596e-02 1.4305073323767251e-01 -4.8606904275938563e-02 2.0356362611530763e-02 -3.4982107855006710e-02 -3.5259263224818829e-02 + 8.8680865019362426e-02 1.4349057803580620e-01 -4.5973648658997335e-02 2.9363278878411954e-02 -3.9116155698441124e-02 -3.6539257116222253e-02 run_forces: ! |2 - 1 -1.7830664249401495e-11 -1.4969268038495937e-11 2.0250883552085066e-11 - 2 1.4178175920839877e-08 -7.3697962919950125e-07 -4.1244001268726125e-07 - 3 5.6136460067454974e-11 3.9177902044777682e-11 -1.3300901059628180e-10 - 4 -2.4377712542219803e-02 -1.0017984669481575e-02 1.4771463887828649e-02 - 5 -5.1228989224576162e-03 4.9679073335221480e-03 -1.2247342483054577e-03 - 6 -2.0628489457810832e-29 1.7000842073947994e-29 -1.4302373667858642e-29 - 7 -7.7399556138061246e-03 -2.1999585749180296e-02 9.4221675259845671e-03 - 8 -2.7226188721382977e-11 -2.7934731865021723e-11 -1.1906455487070280e-10 - 9 -9.3735314545896758e-05 -4.0792214287657208e-04 4.7167673264872010e-04 - 10 9.3555163663047772e-12 2.3173351316150496e-11 3.7918620449507853e-11 - 11 -1.0040398341613101e-06 -1.4591470943875194e-05 4.7257961212508983e-06 - 12 -7.8882050589939000e-12 -2.6866600596139369e-11 5.2165018680301052e-12 - 13 2.3908436181055556e-03 -1.5319257908136898e-02 6.7499194499905874e-03 - 14 -2.6640107655912597e-03 -1.2039951177220549e-02 2.7533428618008431e-02 - 15 -2.7635661286362588e-05 -9.5181221762579826e-05 8.5483736288557313e-05 - 16 3.5409626294832339e-41 -5.4502479778330161e-41 5.6514646025750365e-41 - 17 -5.8537714360823072e-03 1.4478434130439201e-03 -2.2089421699365612e-02 - 18 1.6248952129955554e-02 2.7081431359609345e-02 -2.3257774508959484e-02 - 19 -2.2665817278921912e-07 -4.8840537098062461e-07 3.2059715992398887e-07 - 20 1.3566057309634724e-02 2.0630773984863602e-02 -8.1307578055212701e-03 - 21 -5.9656611092286106e-19 -4.0526611917347085e-19 5.3947355913806896e-19 - 22 -2.4822589864760596e-07 -1.1170974613554103e-07 -1.0403649969244409e-07 - 23 2.4822589865714970e-07 1.1170974612658140e-07 1.0403649968747813e-07 - 24 2.5396992331576891e-19 -2.4305669471382462e-18 1.1318569604668770e-18 - 25 -2.5106591825534745e-07 -1.4432577907151545e-07 -1.4024173072938962e-07 - 26 2.5042776337133356e-07 1.4805757501912900e-07 1.4119367516876123e-07 - 27 1.0613799709945434e-18 -7.3652122633088193e-19 7.7457795533500760e-19 - 28 -2.7944434474379508e-06 -1.0675724747329571e-06 1.6381843442049784e-07 - 29 1.3677878787179965e-02 5.7688074816616601e-03 -4.3362502235574744e-03 + 1 -1.9983471713875107e-11 -1.6478425807214718e-11 2.3436584192848479e-11 + 2 1.1752890960261998e-08 -4.0562815333464385e-07 -2.2999627439677565e-07 + 3 7.0121841354659564e-11 4.2712610082764094e-11 -1.4950011807054957e-10 + 4 -2.4282485354996101e-02 -9.9744723990687727e-03 1.4807333676691037e-02 + 5 -4.0709985877625393e-03 3.9540442345700122e-03 -9.7143935018961509e-04 + 6 -3.5669765485600082e-29 2.9173726232333531e-29 -2.4897626690964109e-29 + 7 -9.3274049711830394e-03 -2.3376333443918092e-02 9.9833234226275464e-03 + 8 -3.1450538419589704e-11 -3.3711334680343452e-11 -1.3901303373559009e-10 + 9 -1.0512820303240983e-04 -4.5262130540319183e-04 5.2363363807784156e-04 + 10 2.0889843449970419e-11 5.1745744479650302e-11 8.4880776429700299e-11 + 11 -9.8787329754596071e-07 -1.4314531049052044e-05 4.6645727961341728e-06 + 12 -8.4918054442983585e-12 -2.1468051040691028e-11 2.2542888172765731e-11 + 13 2.6232295937281620e-03 -1.4839850357518839e-02 6.5661505308537366e-03 + 14 -2.6745026090566385e-03 -1.2117620229502447e-02 2.7314986645229980e-02 + 15 -3.8393201005256402e-05 -1.3310469356122458e-04 1.1944673018541207e-04 + 16 7.5178246536054148e-41 -1.1492886729949488e-40 1.1887445410114181e-40 + 17 -5.6972313004165429e-03 3.0605729923779863e-03 -2.2541071345007591e-02 + 18 1.6560610174626181e-02 2.6490828201963149e-02 -2.3035006484580914e-02 + 19 -3.9069798601078254e-07 -7.9140600938758528e-07 4.9017895472763834e-07 + 20 1.4528402858087944e-02 2.2127990446583451e-02 -8.8261190798898555e-03 + 21 -2.0857351014988469e-19 -1.5938476807825324e-19 2.4939830065789834e-19 + 22 -3.5820582053613295e-07 -1.6428904273016267e-07 -1.5235470178113875e-07 + 23 3.5820582054282208e-07 1.6428904272357111e-07 1.5235470177766600e-07 + 24 -1.0812865812172532e-19 -4.0165395265764163e-19 7.4193153057059789e-20 + 25 -1.2636810218286013e-07 -7.0412571865848833e-08 -6.8858366630379255e-08 + 26 1.2598352880057076e-07 7.2636393761079444e-08 6.9421275083545521e-08 + 27 4.3204688630310294e-19 -3.4505241486769817e-19 3.3483584537398166e-19 + 28 -3.0739890700130939e-06 -1.1764549959581118e-06 2.0640421328402140e-07 + 29 1.2488342761960357e-02 5.2772523270632676e-03 -3.9463699489428712e-03 ... diff --git a/unittest/force-styles/tests/mol-pair-hybrid-overlay.yaml b/unittest/force-styles/tests/mol-pair-hybrid-overlay.yaml index bf8b4deab..ce962d5a3 100644 --- a/unittest/force-styles/tests/mol-pair-hybrid-overlay.yaml +++ b/unittest/force-styles/tests/mol-pair-hybrid-overlay.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -64,38 +64,38 @@ init_forces: ! |2 27 4.8962849172262665e+01 -2.1594262411895852e+02 8.6423873663236122e+01 28 -1.7556665080686602e+02 7.2243004627719102e+01 -1.1798867746650107e+02 29 1.2734696054095977e+02 1.4335517724642804e+02 3.2138218235426962e+01 -run_vdwl: 147.040065814649 -run_coul: -127.747672342407 +run_vdwl: 719.583657033589 +run_coul: -127.40544584254 run_stress: ! |2- - 6.0353509820250508e+02 6.2447471116277541e+02 4.3791294157096706e+02 -3.1645318541172105e+02 -3.0029798575498035e+01 1.2366108597811234e+02 + 2.1066855251881925e+03 2.1118463017620702e+03 4.3411898896739367e+03 -7.3939094916433964e+02 3.4004309224046892e+01 6.3091802194682043e+02 run_forces: ! |2 - 1 1.4816258935374702e+01 7.9738868793090887e+01 6.1442737817877052e+01 - 2 1.9651626448525320e+01 1.2289294477288282e+01 -2.5586353371037866e+01 - 3 -2.4593633701115834e+02 1.0324846670571520e+02 8.5001166000982366e+01 - 4 -8.7489075884776160e+00 3.2824727936520817e+00 -6.5528798306918095e+00 - 5 -2.2204206343813988e+00 -1.8704582015328923e+00 1.0433415108183867e+01 - 6 1.1566131521214062e+02 -9.9315663534270840e+01 -1.4165902676145916e+02 - 7 4.0530505100252476e+00 -1.0452547067632675e+01 -4.1479272246007291e+01 - 8 -2.0168008364678318e+01 2.2738988000067643e+01 5.6628323305217698e+01 - 9 1.3835859409009439e+01 6.0277308745157825e+00 5.3337858214897246e+01 - 10 6.4066997022166078e+01 -7.5535419832111913e+01 -7.5482793144574828e+01 - 11 -7.4023562406880670e+00 -6.6466433894459529e+00 -1.6954367240728217e+01 - 12 1.7791559823640885e+01 1.1417548579903798e+01 -6.8410096513254501e+00 - 13 7.0142861686879012e+00 -2.7644703601833713e+00 -2.3054062295858999e-01 - 14 -4.3979315220313415e+00 8.9942304798025985e-01 -7.0797565188053522e+00 - 15 -3.6033014868002700e-01 7.7431258533822884e+00 2.0411497412228172e+00 - 16 5.2319712931355340e+01 -6.8429084217935340e+01 1.4574303577719457e+01 - 17 -1.8290397829438874e+01 1.7655932720572732e+01 3.5962621645704566e+01 - 18 1.7867907806054892e-01 7.0934614357985906e+00 -8.1844141958354655e+00 - 19 2.0601991693593105e+00 -2.0654589608626632e+00 5.3342092678817314e+00 - 20 -3.2420367329211275e+00 -3.2567434492056524e+00 3.4326643925936779e+00 - 21 -9.0117457730121355e+00 -1.2245005015929308e+01 3.4149936200903596e+01 - 22 -1.8574631445394388e+01 -3.4425623886537839e+00 -2.6438008043441616e+01 - 23 2.6836518382487309e+01 1.4678672942582715e+01 -6.8586307159717981e+00 - 24 1.0582727383347613e+01 -3.1420812038055800e+01 2.3645383857939045e+01 - 25 -2.9311976591768808e+01 3.1879557244811685e+00 -2.4340490474783000e+01 - 26 1.7484078871479785e+01 2.7212266002547196e+01 1.3601992482095069e+00 - 27 1.4388299191593470e+00 -3.2689051660410506e+01 9.3413587271242218e+00 - 28 -2.3474877047306364e+01 8.9025648931823174e+00 -1.5678531186995576e+01 - 29 2.3348257665117334e+01 2.4017147271469948e+01 6.6807468981591338e+00 + 1 -1.8063372896871861e+01 2.6678105157873705e+02 3.2402996659149238e+02 + 2 1.5330358878115447e+02 1.2380492572678898e+02 -1.8151333240574237e+02 + 3 -1.3354888440944052e+02 -3.7931758440809585e+02 -1.4288689214683646e+02 + 4 -7.7881294728555828e+00 2.1395223669670709e+00 -5.8946911982403414e+00 + 5 -2.9015406841040750e+00 -3.3190775902304690e+00 1.2028378254388521e+01 + 6 -8.0488833369818803e+02 9.1802981835006187e+02 1.0244099127408372e+03 + 7 5.5465440662485150e+01 -3.1049131627300432e+02 -1.5711945284966396e+03 + 8 1.3295629283853211e+02 -9.6566834572636509e+01 3.9097872808487460e+02 + 9 7.8594917874857543e+01 7.6787239820699739e+01 3.4114513928465578e+02 + 10 5.2093084326233679e+02 -5.9871672888830824e+02 -1.8144904320802175e+02 + 11 -3.3489474910616370e+00 -4.7299066233626039e+00 -1.0148722292306179e+01 + 12 2.0817110693939330e+01 9.8621648346024777e+00 -6.7801624810903709e+00 + 13 7.6705047254095406e+00 -3.1868508087899996e+00 -1.5820764985177732e-01 + 14 -4.5784791310044675e+00 1.1138053855319887e+00 -8.6502065778611730e+00 + 15 -2.0858645012343142e-03 8.3343285345071436e+00 2.0653788728248101e+00 + 16 4.3381526742384807e+02 -3.1216388880293573e+02 -1.1109931745334770e+03 + 17 -4.2715774864577224e+02 3.0231264864237801e+02 1.1227484174344033e+03 + 18 1.2031503133104606e+00 6.6109154581424221e+00 -9.8172457746610178e+00 + 19 1.6542029696015907e+00 -1.6435312394752812e+00 5.6634735276627497e+00 + 20 -3.4397850729417945e+00 -3.1640002526012512e+00 4.1983600861482540e+00 + 21 -6.8065111490654829e+01 -7.8373161130023504e+01 2.1145341222255522e+02 + 22 -1.0497862711706458e+02 -2.4878742273401844e+01 -1.5988817620288421e+02 + 23 1.7253257365878264e+02 1.0200250230245655e+02 -5.1030905034776815e+01 + 24 3.5759299481226734e+01 -2.0057859782619599e+02 1.1032111627497152e+02 + 25 -1.4570195714964908e+02 2.0679748005808605e+01 -1.2162175868970056e+02 + 26 1.0901403460528100e+02 1.7901644500696690e+02 1.2412674623332103e+01 + 27 4.8035883250870448e+01 -2.1205445789284894e+02 8.4315888267103702e+01 + 28 -1.7229323056476886e+02 7.0823266235363889e+01 -1.1557273097021344e+02 + 29 1.2500312314724302e+02 1.4088629633289813e+02 3.1828931397054006e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-hybrid.yaml b/unittest/force-styles/tests/mol-pair-hybrid.yaml index d05ec202b..3630d4bdd 100644 --- a/unittest/force-styles/tests/mol-pair-hybrid.yaml +++ b/unittest/force-styles/tests/mol-pair-hybrid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:13 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 5.1810388677546058e+01 -2.2705458321213791e+02 9.0849111082069683e+01 28 -1.8041307121444072e+02 7.7534042932772934e+01 -1.2206956760706599e+02 29 1.2861057254925004e+02 1.4952711274394565e+02 3.1216025556267869e+01 -run_vdwl: 146.141836987454 +run_vdwl: 719.443281677466 run_coul: 0 run_stress: ! |2- - 6.2607988552877578e+02 6.7186280241273096e+02 4.8484819691920609e+02 -3.1994902849391821e+02 -2.8454539240635299e+01 1.2292176520346769e+02 + 2.1330153957371017e+03 2.1547728168285512e+03 4.3976497417710170e+03 -7.3873328448298525e+02 4.1743821105367225e+01 6.2788012209191243e+02 run_forces: ! |2 - 1 1.2964030026503499e+01 8.0892417983392860e+01 6.0323171805698586e+01 - 2 1.8550226578809266e+01 1.4016238769007140e+01 -2.2757523569074309e+01 - 3 -2.4823726947100783e+02 1.0508771501194346e+02 8.6172357110011120e+01 - 4 -8.6006925534652421e+00 3.1744203980427432e+00 -6.2092172202266447e+00 - 5 -1.7308376123887230e+00 -2.5575751550228349e+00 1.0273464025428190e+01 - 6 1.1683391960947706e+02 -9.8726695183085397e+01 -1.4208735499091139e+02 - 7 3.8041613300899502e+00 -1.0704960296538383e+01 -4.2399902752909654e+01 - 8 -1.9935814763091376e+01 1.9886801199499324e+01 5.5348117494317826e+01 - 9 1.1205804510458954e+01 1.3198927444631410e+01 4.9879829976468997e+01 - 10 6.4812484185184985e+01 -7.6374994239094534e+01 -7.5660079469021809e+01 - 11 -6.2988689622844021e+00 -8.0952569922471049e+00 -1.6391410763300943e+01 - 12 1.4369424941840268e+01 1.2193286907138495e+01 -8.2527851277097728e+00 - 13 7.3377072945505901e+00 -2.7955027633737624e+00 -1.0299065873202272e-01 - 14 -2.7952431412531218e+00 4.3888485932889676e-01 -7.1101001485813109e+00 - 15 -3.9779897784867790e-01 8.1106017381646627e+00 3.0711122407595379e+00 - 16 5.2787469038597280e+01 -6.7733534943232669e+01 1.5088280949220392e+01 - 17 -1.4633179608614546e+01 1.0014131160474449e+01 4.0800233262287627e+01 - 18 -1.8062194307514216e-02 -3.1579322126553462e-02 2.9610641532920361e-02 - 19 2.5526682113820960e-04 -2.4264461640287623e-04 1.6746264185020616e-03 - 20 -8.8300470711392097e-04 -9.1308556306666610e-04 3.5978614842012722e-04 - 21 -9.9360372198460070e+00 -1.2017932968052305e+01 3.8871041034331796e+01 - 22 -1.8317762813232619e+01 -4.4399941394322759e+00 -2.9440618398390594e+01 - 23 2.8242493946263711e+01 1.6470734211867914e+01 -9.4179972623790267e+00 - 24 1.2413322573750337e+01 -3.6423454531495011e+01 2.3794740530518389e+01 - 25 -3.0031409430564317e+01 5.3796477034973407e+00 -2.5778433763492661e+01 - 26 1.7604739564575269e+01 3.1032215151226218e+01 1.9586534056054055e+00 - 27 3.4725392000145359e+00 -3.8995311241163883e+01 1.1703192201614458e+01 - 28 -2.5472496456851680e+01 1.1754691498741272e+01 -1.7174782055443067e+01 - 29 2.2007778142526295e+01 2.7247233468088044e+01 5.4673570898110109e+00 + 1 -2.0299419751359796e+01 2.6686193378822901e+02 3.2358785870694004e+02 + 2 1.5298617928491248e+02 1.2596516341409225e+02 -1.7961292655338647e+02 + 3 -1.3353630652439793e+02 -3.7923748696131213e+02 -1.4291839793625775e+02 + 4 -7.8374717836161771e+00 2.1276610789823414e+00 -5.5845014473820624e+00 + 5 -2.5014258630866699e+00 -4.0250131424704385e+00 1.2103512372025625e+01 + 6 -8.0681462887292412e+02 9.2165637136761688e+02 1.0270795806932804e+03 + 7 5.5780279349903594e+01 -3.1117530951561696e+02 -1.5746991292869038e+03 + 8 1.3452983055534955e+02 -1.0064659350255846e+02 3.8851791558207583e+02 + 9 7.6746213883426122e+01 8.2501469877402286e+01 3.3944351200617950e+02 + 10 5.2128033527695618e+02 -5.9920098848285909e+02 -1.8126029815043356e+02 + 11 -2.3573118090915246e+00 -5.8616944550888350e+00 -9.6049808811326240e+00 + 12 1.7503975847822890e+01 1.0626930310560827e+01 -8.0603160272054950e+00 + 13 8.0530313322973104e+00 -3.1756495170399104e+00 -1.4618315664740525e-01 + 14 -3.3416065168069760e+00 6.6492606336082127e-01 -8.6345131440469647e+00 + 15 -2.2253843262374870e-01 8.5025661635348619e+00 3.0369735873081569e+00 + 16 4.3476311264989528e+02 -3.1171086735551455e+02 -1.1135217194927461e+03 + 17 -4.2469846140777202e+02 2.9615411776780638e+02 1.1302573488400678e+03 + 18 -1.8849981672825901e-02 -3.3371636477421286e-02 3.0986293443778724e-02 + 19 3.0940277774413972e-04 -2.4634536455373055e-04 1.7433360008861018e-03 + 20 -9.8648131277150768e-04 -1.0112587134526944e-03 3.6932948773965422e-04 + 21 -7.0490745283106705e+01 -7.9749153581142281e+01 2.2171003384646417e+02 + 22 -1.0638717908920059e+02 -2.5949502163177943e+01 -1.6645589526812256e+02 + 23 1.7686797710735050e+02 1.0571018898885526e+02 -5.5243337084099444e+01 + 24 3.8206017656281247e+01 -2.1022820141992992e+02 1.1260711266189016e+02 + 25 -1.4918881473530885e+02 2.3762151395876515e+01 -1.2549188139143089e+02 + 26 1.1097059498808326e+02 1.8645503634228552e+02 1.2861559677865269e+01 + 27 5.0800844984832011e+01 -2.2296588090685447e+02 8.8607367716323097e+01 + 28 -1.7694190504288861e+02 7.6029945485181912e+01 -1.1950518150242056e+02 + 29 1.2614894925528131e+02 1.4694250820033537e+02 3.0893386672863009e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lennard_mdf.yaml b/unittest/force-styles/tests/mol-pair-lennard_mdf.yaml index caa4e04ed..6ba6c42bb 100644 --- a/unittest/force-styles/tests/mol-pair-lennard_mdf.yaml +++ b/unittest/force-styles/tests/mol-pair-lennard_mdf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Jul 30 11:43:01 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 5.1810629413951034e+01 -2.2705426061698427e+02 9.0848881987846823e+01 28 -1.8041314536249808e+02 7.7534100857114538e+01 -1.2206963127965679e+02 29 1.2861063445049953e+02 1.4952718810862598e+02 3.1216037810340779e+01 -run_vdwl: 146.142938771306 +run_vdwl: 719.44436226705 run_coul: 0 run_stress: ! |2- - 6.2607827422370826e+02 6.7185771646959927e+02 4.8484269825432062e+02 -3.1994971119380659e+02 -2.8453599030981216e+01 1.2292331223237372e+02 + 2.1330145141050125e+03 2.1547683543089838e+03 4.3976473968701512e+03 -7.3873403814571338e+02 4.1744535857045207e+01 6.2788233468659791e+02 run_forces: ! |2 - 1 1.2964000396689146e+01 8.0892267678816864e+01 6.0323237031964297e+01 - 2 1.8550219067108042e+01 1.4016234288534708e+01 -2.2757514465613156e+01 - 3 -2.4823731194481803e+02 1.0508770689878342e+02 8.6172340602494984e+01 - 4 -8.6006937785047128e+00 3.1744103796518282e+00 -6.2092116768831902e+00 - 5 -1.7308376426194816e+00 -2.5575752575563615e+00 1.0273464022561958e+01 - 6 1.1683409017502134e+02 -9.8726850559552091e+01 -1.4208744781635963e+02 - 7 3.8041358692158358e+00 -1.0705007215066624e+01 -4.2399446322832375e+01 - 8 -1.9935799766053112e+01 1.9886787977710259e+01 5.5348128888062327e+01 - 9 1.1205806049421172e+01 1.3198926774269228e+01 4.9879830296866828e+01 - 10 6.4812479379225579e+01 -7.6374990958105826e+01 -7.5660080738756506e+01 - 11 -6.2988692484756150e+00 -8.0952467316475403e+00 -1.6391401801081937e+01 - 12 1.4369329449673979e+01 1.2193215509952948e+01 -8.2527090649331516e+00 - 13 7.3377104327473912e+00 -2.7954976458396401e+00 -1.0299311972585752e-01 - 14 -2.7952420267096518e+00 4.3889411992317034e-01 -7.1100894724883545e+00 - 15 -3.9779622065865505e-01 8.1106030137207288e+00 3.0711098878236167e+00 - 16 5.2787474086118777e+01 -6.7733534176990759e+01 1.5088298239601448e+01 - 17 -1.4633177660642183e+01 1.0014392510695107e+01 4.0799972741104774e+01 - 18 -1.8058839496734813e-02 -3.1846480759107010e-02 2.9996583084227670e-02 - 19 2.5788523138616643e-04 -2.4689081230698301e-04 1.6839267797863844e-03 - 20 -8.8284959462040197e-04 -9.1548924391997993e-04 3.8796476197999974e-04 - 21 -9.9361952309492949e+00 -1.2017775020353746e+01 3.8871115643964693e+01 - 22 -1.8317763935337126e+01 -4.4399886451888442e+00 -2.9440610409402939e+01 - 23 2.8242484527873138e+01 1.6470730701095345e+01 -9.4179941582837472e+00 - 24 1.2413262420490618e+01 -3.6423612222048455e+01 2.3794298924499856e+01 - 25 -3.0031415092604043e+01 5.3796434394870465e+00 -2.5778439006629586e+01 - 26 1.7604732980064579e+01 3.1032191967689151e+01 1.9586447754505298e+00 - 27 3.4727551332751974e+00 -3.8994887375138603e+01 1.1702853254878343e+01 - 28 -2.5472489346144421e+01 1.1754711219486996e+01 -1.7174787246988220e+01 - 29 2.2007795730451438e+01 2.7247258188486931e+01 5.4673625160789685e+00 + 1 -2.0299483970468870e+01 2.6686167842003806e+02 3.2358794351143570e+02 + 2 1.5298617825018479e+02 1.2596516267939987e+02 -1.7961292532505738e+02 + 3 -1.3353630733858580e+02 -3.7923748873514427e+02 -1.4291839863818629e+02 + 4 -7.8374723356679361e+00 2.1276525511055815e+00 -5.5844965312958958e+00 + 5 -2.5014258639526683e+00 -4.0250131447717257e+00 1.2103512373047467e+01 + 6 -8.0681457718283696e+02 9.2165643419425294e+02 1.0270802040062219e+03 + 7 5.5780278090467903e+01 -3.1117549206486041e+02 -1.5746995928952642e+03 + 8 1.3452984131498815e+02 -1.0064660161181109e+02 3.8851792665142312e+02 + 9 7.6746214024736858e+01 8.2501469783788309e+01 3.3944351195208981e+02 + 10 5.2128033582397245e+02 -5.9920098305718943e+02 -1.8126029452767671e+02 + 11 -2.3573112124487703e+00 -5.8616829800823993e+00 -9.6049696388996306e+00 + 12 1.7503861563048307e+01 1.0626842688754657e+01 -8.0602294985301004e+00 + 13 8.0530360122279134e+00 -3.1756454088670130e+00 -1.4618513119289753e-01 + 14 -3.3416062070388262e+00 6.6493435828911596e-01 -8.6345029507261550e+00 + 15 -2.2253607683164670e-01 8.5025684882163297e+00 3.0369719991901274e+00 + 16 4.3476329869780926e+02 -3.1171098373261623e+02 -1.1135222159414589e+03 + 17 -4.2469865215216663e+02 2.9615449807381680e+02 1.1302576161402028e+03 + 18 -1.8843465769147888e-02 -3.3627587100536989e-02 3.1332032445636239e-02 + 19 3.1218159469813766e-04 -2.5159362090997495e-04 1.7538449047824480e-03 + 20 -9.8682030804098943e-04 -1.0146265016975999e-03 3.9763320020084846e-04 + 21 -7.0490859712787113e+01 -7.9749108770702094e+01 2.2171017328750804e+02 + 22 -1.0638723085061226e+02 -2.5949510267883088e+01 -1.6645596823812903e+02 + 23 1.7686805120008714e+02 1.0571024098680195e+02 -5.5243359251479447e+01 + 24 3.8206006621090950e+01 -2.1022837727829352e+02 1.1260688647003239e+02 + 25 -1.4918888339202778e+02 2.3762162226044708e+01 -1.2549193923503653e+02 + 26 1.1097064474668477e+02 1.8645510732429506e+02 1.2861556661395463e+01 + 27 5.0801083902745148e+01 -2.2296555492728430e+02 8.8607134948693158e+01 + 28 -1.7694197577890267e+02 7.6030001738400870e+01 -1.1950524256938751e+02 + 29 1.2614900993076657e+02 1.4694258227352466e+02 3.0893398860530120e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj96_cut.yaml b/unittest/force-styles/tests/mol-pair-lj96_cut.yaml index b2d610219..85191fe5e 100644 --- a/unittest/force-styles/tests/mol-pair-lj96_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj96_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Jul 30 17:50:31 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 6.4971923893309373e+00 -3.1514490531631594e+01 1.2213590546072449e+01 28 -2.4531453852672385e+01 1.0543491079658937e+01 -1.6598700916460793e+01 29 1.8044637138654299e+01 2.0979972864085106e+01 4.3789473475744867e+00 -run_vdwl: 85.3637858985071 +run_vdwl: 111.831461661122 run_coul: 0 run_stress: ! |2- - 2.2754228627541102e+02 2.3244361909607221e+02 3.4720338018814073e+02 -6.2752907332006977e+01 2.0031328703307860e+01 4.5642299883984968e+01 + 2.7182104129385465e+02 2.7435027767758265e+02 5.0483269558351475e+02 -7.3587953393135308e+01 1.6159137974645954e+01 6.4540935527934977e+01 run_forces: ! |2 - 1 -1.7102885069784018e-01 3.1533956108996044e+01 3.3930989107796911e+01 - 2 1.5242712436518843e+01 1.2559448850532041e+01 -1.7559550179061056e+01 - 3 -1.6411191452119652e+01 -3.9259275347259468e+01 -1.5175265603764856e+01 - 4 -2.1129024607003992e+00 5.5899779277359796e-01 -1.5412444123368652e+00 - 5 -6.5399311226949464e-01 -1.0992854083637122e+00 3.0847441904927702e+00 - 6 -6.6956140190141298e+01 7.0695358389850611e+01 4.4363555461094826e+01 - 7 3.2006694637513582e+00 -1.9015134117876272e+01 -9.4508817328761609e+01 - 8 4.3709804685094014e+00 -3.7828942844862610e+00 3.4420665964407604e+01 - 9 7.4255513265294741e+00 7.7714111044319969e+00 3.2469284047194634e+01 - 10 4.7868465571922641e+01 -5.7873993481240355e+01 -1.8445892867106085e+01 - 11 -6.4282354742693992e-01 -1.4901411864631078e+00 -2.4825345769459188e+00 - 12 4.6644382526129480e+00 2.3675273515613648e+00 -2.3210885143837441e+00 - 13 2.1755706764185181e+00 -8.2537435725404673e-01 -3.1764318332116126e-02 - 14 -8.4883782554397047e-01 1.3856669869330718e-01 -2.1638310551977069e+00 - 15 -9.8065086650338654e-02 2.4014804591867152e+00 8.9535982313950302e-01 - 16 3.1356115121770181e+01 -2.4553533117975913e+01 -7.1922364887796476e+01 - 17 -2.8374813038610231e+01 1.9897527415171968e+01 7.6971515508623952e+01 - 18 -1.7388092460317611e-02 -3.2978151143102555e-02 3.1978967188726254e-02 - 19 2.3207237645516519e-04 -5.8898238853603954e-04 2.5835874691380401e-03 - 20 -1.2239441378849943e-03 -1.3073743382692831e-03 6.0511915291252378e-04 - 21 -7.9294050694887739e+00 -8.5054797415804853e+00 2.5228413587702210e+01 - 22 -1.2417380443045314e+01 -3.1901494132514641e+00 -1.9020413060598994e+01 - 23 2.0333472638959208e+01 1.1711012905410914e+01 -6.1937024286615507e+00 - 24 6.6338736703656007e+00 -2.5347184037135683e+01 1.4941978068506790e+01 - 25 -1.9872316686870089e+01 2.8994801273220521e+00 -1.6817508030632830e+01 - 26 1.3225082814853838e+01 2.2433588031877850e+01 1.8484145884308429e+00 - 27 5.2058354737312715e+00 -2.5482655118182759e+01 9.2158010863084936e+00 - 28 -1.9559411413838472e+01 8.4316105041505196e+00 -1.3009506428903164e+01 - 29 1.4363921225681294e+01 1.7060008378980431e+01 3.7875945849736650e+00 + 1 -3.2765106954554541e+00 3.5508461938177319e+01 4.4109198495072327e+01 + 2 2.1157682412246391e+01 1.7435625347626843e+01 -2.4815261318586018e+01 + 3 -1.7961531321986183e+01 -4.9103383153934402e+01 -1.8873379317141161e+01 + 4 -2.1954859251980454e+00 5.6341751039551513e-01 -1.5698132189445235e+00 + 5 -7.0530647640844724e-01 -1.1896061013790642e+00 3.2351657392154434e+00 + 6 -8.6423845257703178e+01 9.7108192154799625e+01 1.0043870721322519e+02 + 7 3.8880004902810921e+00 -3.0917464096946087e+01 -1.6550061300724536e+02 + 8 9.5978620456843444e+00 -9.0597936192973574e+00 4.1121172090638574e+01 + 9 9.9414685202178639e+00 1.0673963090156525e+01 4.3964603634643446e+01 + 10 5.7876198053260524e+01 -6.9260595597443839e+01 -2.0521096096065520e+01 + 11 -6.1828067755042126e-01 -1.5868897788784542e+00 -2.5776822343297239e+00 + 12 4.7874311004779901e+00 2.3619268747321511e+00 -2.0773078346580207e+00 + 13 2.2821846764355924e+00 -9.0460279695460211e-01 -3.9141905733860463e-02 + 14 -9.4159713818536617e-01 1.8644206521761386e-01 -2.4164798163962851e+00 + 15 -5.3977666872053950e-02 2.4044127730456597e+00 8.5207983604492366e-01 + 16 4.8198548579409525e+01 -3.5687554733888078e+01 -1.1776205347539367e+02 + 17 -4.5518359227060614e+01 3.1492663005087032e+01 1.2241568789768577e+02 + 18 -1.7513720943233505e-02 -3.3307121244521641e-02 3.2084080497343570e-02 + 19 3.1601813587628093e-04 -5.2104575812172700e-04 2.5669463055814326e-03 + 20 -1.3320856399782900e-03 -1.4040683462598817e-03 6.1086616776507814e-04 + 21 -9.7470553513608049e+00 -1.1176069815280830e+01 3.1559878199458730e+01 + 22 -1.5201625663979673e+01 -3.7106714060196335e+00 -2.3767932555466270e+01 + 23 2.4935588581671482e+01 1.4901869193037058e+01 -7.7779044916380276e+00 + 24 5.7602339264000664e+00 -2.9584984184035648e+01 1.6129794779922900e+01 + 25 -2.1363275091573545e+01 3.3904593638534326e+00 -1.7968765677026294e+01 + 26 1.5589806717955115e+01 2.6180442003629910e+01 1.8120422976664758e+00 + 27 6.5942402669386126e+00 -3.1615145343769925e+01 1.2215448459139898e+01 + 28 -2.4657976802752760e+01 1.0584520556606840e+01 -1.6651043402933762e+01 + 29 1.8074111713555286e+01 2.1039596986811269e+01 4.4294338158741109e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm.yaml index 3b4a4b9eb..6c91f1a9a 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -58,38 +58,38 @@ init_forces: ! |2 27 4.8640279708056994e+01 -2.1561983683662956e+02 8.6562127166872585e+01 28 -1.7529971979703151e+02 7.2819913213128288e+01 -1.1821539358587464e+02 29 1.2695492725304132e+02 1.4275558335476956e+02 3.1862100795322899e+01 -run_vdwl: 147.093316474173 -run_coul: -107.524969350146 +run_vdwl: 719.58713774632 +run_coul: -108.261820989327 run_stress: ! |2- - 6.0472332225507603e+02 6.2463969247134105e+02 4.5741207137765275e+02 -3.0627232158543762e+02 -2.7631939280649636e+01 1.2428442807824517e+02 + 2.1093940982116214e+03 2.1110892652935627e+03 4.3584103399795022e+03 -7.3252709893204678e+02 3.4960525980576286e+01 6.3293986693153204e+02 run_forces: ! |2 - 1 1.4636338810557943e+01 7.8990458314634267e+01 6.1789901857107964e+01 - 2 1.9596523819358236e+01 1.1985525298296235e+01 -2.5456573485255888e+01 - 3 -2.4588954504898194e+02 1.0308552180775459e+02 8.4912716776967457e+01 - 4 -8.7492624335406699e+00 3.2826631075397446e+00 -6.5530012808136524e+00 - 5 -2.2205594234764581e+00 -1.8705837362033275e+00 1.0433242794492402e+01 - 6 1.1602242588833293e+02 -9.9552264174228881e+01 -1.4186759924970184e+02 - 7 3.8275727512770570e+00 -1.0853934518612219e+01 -4.2038279638487246e+01 - 8 -2.0150689801534561e+01 2.2723171225506540e+01 5.6642967537413689e+01 - 9 1.3841301917937191e+01 6.0237347868762061e+00 5.3329583985487822e+01 - 10 6.4055450449424782e+01 -7.5496465283188272e+01 -7.5489860332608316e+01 - 11 -7.4130440356840985e+00 -6.6937891913421410e+00 -1.7014153263261896e+01 - 12 1.7821631230632654e+01 1.1382447581980387e+01 -6.7969595154856197e+00 - 13 7.2932462432164762e+00 -2.5788840148322767e+00 -4.0802163537404046e-01 - 14 -4.3204846149013187e+00 1.0478084602870137e+00 -7.1171742014134152e+00 - 15 -2.8414418953697973e-01 7.8457859458507464e+00 1.9572322988113258e+00 - 16 5.2329317954186322e+01 -6.7940112521041129e+01 1.4734318140161111e+01 - 17 -1.8341586203566280e+01 1.6730172621870182e+01 3.6803795955644276e+01 - 18 2.1986146849403945e-01 6.8671611727164033e+00 -7.9750636703699733e+00 - 19 2.0647896414171742e+00 -1.5556537241026003e+00 5.5885212803724897e+00 - 20 -2.9230798260818687e+00 -4.1244209312568048e+00 3.6680088697049955e+00 - 21 -9.3003291331577795e+00 -9.6822986660208343e+00 3.4277203700006737e+01 - 22 -1.8329208228009360e+01 -4.5888824563098920e+00 -2.6511148603829110e+01 - 23 2.6346728063663672e+01 1.5314687679470973e+01 -6.7501977929722372e+00 - 24 1.0942430665048066e+01 -3.0736153016320571e+01 2.1488996555482899e+01 - 25 -2.9421179405231840e+01 3.0744344987550472e+00 -2.4385440714087167e+01 - 26 1.7591271506406482e+01 2.6971302782504505e+01 2.5923320357775061e+00 - 27 1.0692276933883669e+00 -3.2307802023951083e+01 9.3915720813866859e+00 - 28 -2.3520067548049180e+01 8.8522154443479000e+00 -1.5689255008528605e+01 - 29 2.3205061788410958e+01 2.3804153529019295e+01 6.4423345233716729e+00 + 1 -1.8221020778484519e+01 2.6613487461761378e+02 3.2426453786513639e+02 + 2 1.5298884020511960e+02 1.2295148882715566e+02 -1.8119107180442339e+02 + 3 -1.3355051974645676e+02 -3.7932233416661376e+02 -1.4288898910070751e+02 + 4 -7.7881334345388060e+00 2.1395217065485159e+00 -5.8946929268967461e+00 + 5 -2.9015445109455120e+00 -3.3190831052229823e+00 1.2028380952522522e+01 + 6 -8.0483940188564600e+02 9.1799511335498823e+02 1.0243794994546904e+03 + 7 5.5376504453623248e+01 -3.1064868918271219e+02 -1.5714119469665220e+03 + 8 1.3295703558738302e+02 -9.6567460892613056e+01 3.9097937295108841e+02 + 9 7.8594914085571460e+01 7.6787252785592045e+01 3.4114513353302948e+02 + 10 5.2093082199901414e+02 -5.9871659717771183e+02 -1.8144896763336735e+02 + 11 -3.3311436962188563e+00 -4.6142814738310394e+00 -1.0054956534721319e+01 + 12 2.0830484386967058e+01 9.8359811860591329e+00 -6.7470268030612051e+00 + 13 7.9556932352531149e+00 -3.0199737978231878e+00 -3.3381267080342475e-01 + 14 -4.5048190148448652e+00 1.2366438658785257e+00 -8.7072259286607423e+00 + 15 7.6518704071558807e-02 8.4398000095294243e+00 1.9861125818949517e+00 + 16 4.3381296266289803e+02 -3.1190583338616324e+02 -1.1110606514106275e+03 + 17 -4.2720560307353452e+02 3.0149319103540404e+02 1.1234772599633429e+03 + 18 1.2630964266278211e+00 6.3488380738480483e+00 -9.6349645043027810e+00 + 19 1.6272072833476035e+00 -1.2095747915609669e+00 5.9466049910707817e+00 + 20 -3.1631085008312381e+00 -4.1756016382716759e+00 4.5297654641969540e+00 + 21 -6.8217051119898244e+01 -7.5759116087449215e+01 2.1162668641367432e+02 + 22 -1.0477186813147894e+02 -2.6038970050702488e+01 -1.6002322181394777e+02 + 23 1.7237301977570527e+02 1.0235648073923498e+02 -5.1092438468760214e+01 + 24 3.6310865167664254e+01 -1.9939407498878762e+02 1.0821190496607940e+02 + 25 -1.4581092012417736e+02 2.0403401206705201e+01 -1.2163373774050837e+02 + 26 1.0890745840378194e+02 1.7860946463061990e+02 1.3342443993066926e+01 + 27 4.7703209640957581e+01 -2.1174031771736648e+02 8.4450485701286823e+01 + 28 -1.7202641552387982e+02 7.1398793807348127e+01 -1.1579849642075412e+02 + 29 1.2462291752294976e+02 1.4030106261030423e+02 3.1554011896983862e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm_implicit.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm_implicit.yaml index d39a8e71a..a8333d8d9 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm_implicit.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_charmm_implicit.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -58,38 +58,38 @@ init_forces: ! |2 27 4.6364112435702893e+01 -2.0540113175488810e+02 8.3024621447653075e+01 28 -1.6662994528688827e+02 6.9019404330712874e+01 -1.1270127644409283e+02 29 1.2070793463535765e+02 1.3443766216040447e+02 3.1390940542732309e+01 -run_vdwl: 149.009117740838 -run_coul: -90.3908387207222 +run_vdwl: 719.802040379616 +run_coul: -106.341473801626 run_stress: ! |2- - 5.9073640911534471e+02 6.2615965991827704e+02 4.0382975386706943e+02 -3.3897298050529599e+02 -4.4419259024255759e+01 1.2556886744368744e+02 + 2.0683942556220563e+03 2.0937841185371062e+03 4.2833742375515549e+03 -7.6367164626762872e+02 1.8160880891129729e+01 6.2876371589411906e+02 run_forces: ! |2 - 1 1.5779554709535391e+01 8.1519822591755329e+01 5.8924529890131240e+01 - 2 1.8625083759821656e+01 1.3563035427983593e+01 -2.3987031735673693e+01 - 3 -2.4473971970016581e+02 1.0257663357399493e+02 8.4704265469540303e+01 - 4 -8.7624884608556535e+00 3.4350976438612362e+00 -6.3846274960444962e+00 - 5 -2.1937643211796058e+00 -1.5681231066222112e+00 1.0492882457502699e+01 - 6 1.1348385925524497e+02 -9.7363859862605864e+01 -1.4184818493420980e+02 - 7 4.4176432194072275e+00 -9.3683870926426689e+00 -3.9660041974002759e+01 - 8 -2.0034170675511103e+01 2.2562166970654104e+01 5.7937681465235841e+01 - 9 1.3639151335514230e+01 5.5631290912870099e+00 5.2388572678583373e+01 - 10 6.4044467078616549e+01 -7.5333493433103911e+01 -7.5092202965262445e+01 - 11 -7.4789220216562642e+00 -6.4645607591943754e+00 -1.6921711420222323e+01 - 12 1.7800826152007964e+01 1.1877483823810685e+01 -7.7480413623983715e+00 - 13 6.9015180041421837e+00 -2.5021698946697595e+00 -4.9659041929773728e-01 - 14 -4.4731996125570062e+00 6.7964943389089649e-01 -6.7701057828699387e+00 - 15 -6.2997458072834589e-01 7.2089946775319032e+00 2.1322927872015152e+00 - 16 5.1928574160349022e+01 -7.0175834298531115e+01 1.5865089781942281e+01 - 17 -1.7388268859695039e+01 1.8379830418987627e+01 3.3881999037263526e+01 - 18 -2.3007936927825379e-01 8.1598312197805090e+00 -2.2622378286820922e+01 - 19 9.0855270747999715e+00 2.1390252597216910e+00 1.6121854632976017e+01 - 20 -9.2636029438423755e+00 -8.7275405965515525e+00 1.0604625423164237e+01 - 21 -7.4665116872946840e+00 -1.3382938645215097e+01 2.8650110487533087e+01 - 22 -1.6688555936661778e+01 -2.9604436427598060e+00 -2.3573305601904213e+01 - 23 2.5102003784019622e+01 1.2802665530346442e+01 -5.7308116407283984e+00 - 24 8.8957059893468173e+00 -2.9522892814009253e+01 1.6448858178443100e+01 - 25 -2.7068993471873746e+01 2.8105690960670850e+00 -2.2522401350433690e+01 - 26 1.5822660977136078e+01 2.5518125552162676e+01 3.4629645868280838e+00 - 27 1.8674017174584279e-01 -3.0804525210086524e+01 9.2104491762385763e+00 - 28 -2.0583873546152482e+01 8.1670032419991436e+00 -1.4313009095623309e+01 - 29 2.1288809515764669e+01 2.1211705802157248e+01 6.8442680129081586e+00 + 1 -1.5129771205612867e+01 2.7066574563609669e+02 3.1952521904043977e+02 + 2 1.5016337955163840e+02 1.2282065923628616e+02 -1.7756235149343095e+02 + 3 -1.3356094399622185e+02 -3.7938237628073676e+02 -1.4290787045680457e+02 + 4 -7.7202868698877447e+00 2.2469666590383830e+00 -5.7139847275962303e+00 + 5 -2.8065309101609777e+00 -3.0399527872617305e+00 1.2003566560845917e+01 + 6 -8.0408532750760412e+02 9.1688485491142615e+02 1.0209147201924046e+03 + 7 5.5652420374536611e+01 -3.0880841996173331e+02 -1.5669024958799864e+03 + 8 1.3301686211530941e+02 -9.5121659110787292e+01 3.9523520782864074e+02 + 9 7.7861368985289985e+01 7.5403468868182173e+01 3.3656373111119353e+02 + 10 5.2070647731456370e+02 -5.9826365052557230e+02 -1.8143789172881785e+02 + 11 -3.3536068730703978e+00 -4.4934420835098807e+00 -1.0020986731946994e+01 + 12 2.0815708532549159e+01 1.0477941588903212e+01 -7.6100451250045946e+00 + 13 7.4533596851548385e+00 -2.8993566462799438e+00 -3.6997055982413091e-01 + 14 -4.6076620984450880e+00 8.7981637680874913e-01 -8.3140044445579786e+00 + 15 -2.2816966304882333e-01 7.7216582919187546e+00 2.0917824297082395e+00 + 16 4.3278108976650361e+02 -3.1333569907338682e+02 -1.1065630869598206e+03 + 17 -4.2536825012716150e+02 3.0241059173897941e+02 1.1182696149338719e+03 + 18 1.5097247866196886e+00 8.7387633844478518e+00 -2.3503332723074632e+01 + 19 7.7523402421078416e+00 1.6805080156212493e+00 1.5397939970741051e+01 + 20 -9.3813469476685025e+00 -8.9016111466384764e+00 1.1634713462731368e+01 + 21 -6.4442614974466736e+01 -7.6677708317569525e+01 1.9778126942184755e+02 + 22 -1.0006984202489978e+02 -2.2951976128538636e+01 -1.5040373559075843e+02 + 23 1.6439670945082227e+02 9.7189708364543591e+01 -4.7322396387386640e+01 + 24 3.1814216519099642e+01 -1.9111869303463661e+02 9.8460151602281428e+01 + 25 -1.3768260086912937e+02 1.9366352436176101e+01 -1.1481643023238536e+02 + 26 1.0406439536232693e+02 1.7043143350344852e+02 1.3858493259751047e+01 + 27 4.5507258772070102e+01 -2.0186767724744396e+02 8.1086654793747158e+01 + 28 -1.6362694087675510e+02 6.7742972101935834e+01 -1.1049345057705291e+02 + 29 1.1856858348554051e+02 1.3220078123028219e+02 3.1118969010244374e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long.yaml index efe8949ec..7e377ec89 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -64,38 +64,38 @@ init_forces: ! |2 27 4.9789629454245969e+01 -2.1702104505766846e+02 8.7170153066070696e+01 28 -1.7608382764129951e+02 7.3301762786387741e+01 -1.1852450858699228e+02 29 1.2668895346087699e+02 1.4371758145657193e+02 3.1331337070942034e+01 -run_vdwl: 146.970429004051 -run_coul: 231.547223073329 +run_vdwl: 719.571434348956 +run_coul: 225.90423714484 run_stress: ! |2- - 6.0914868583355224e+02 6.3099174675511199e+02 4.5850515742081433e+02 -3.1002852431338994e+02 -2.9988864898490455e+01 1.3053552528291112e+02 + 2.1107000227891581e+03 2.1121506817933068e+03 4.3598676778975105e+03 -7.3407478186600042e+02 3.5368419084644287e+01 6.3752997609587146e+02 run_forces: ! |2 - 1 1.5318846122784146e+01 7.9282036136866253e+01 6.1573554867613048e+01 - 2 1.9396962626678739e+01 1.2345001382248773e+01 -2.5332919947055153e+01 - 3 -2.4626013508174745e+02 1.0353982156296955e+02 8.5144823476686938e+01 - 4 -8.8799791704657007e+00 3.3241583803105565e+00 -6.4497295970199575e+00 - 5 -2.3921298390339487e+00 -1.8640446620004008e+00 1.0409771151867107e+01 - 6 1.1514352236596542e+02 -9.9343283423942239e+01 -1.4128644510491168e+02 - 7 4.4121942388738020e+00 -1.0659283390330337e+01 -4.1672998318426281e+01 - 8 -1.9867783895866637e+01 2.2748958892753517e+01 5.6456514179741944e+01 - 9 1.3497118113636914e+01 6.1641779137290209e+00 5.3035388381960558e+01 - 10 6.4064111016710228e+01 -7.5531395853487993e+01 -7.5546928484831085e+01 - 11 -7.3191397189440250e+00 -6.8855082152501428e+00 -1.7097015836507254e+01 - 12 1.7331976857466412e+01 1.1587221956869117e+01 -6.6949825091441735e+00 - 13 7.3167729967205588e+00 -2.7360194029050513e+00 -4.0451257779563710e-01 - 14 -4.2029829453821117e+00 8.3858175804035184e-01 -7.1469625297628934e+00 - 15 -2.3375248849778257e-01 7.7706176900785291e+00 2.0011128719802369e+00 - 16 5.2778368335231271e+01 -6.8528202587235441e+01 1.3739543204418455e+01 - 17 -1.8300842424727513e+01 1.7606322005646781e+01 3.7169239313991639e+01 - 18 -6.3717682912635631e-01 4.7970852297088831e+00 -6.5668103376421083e+00 - 19 2.4125207206834425e+00 -8.7927211713720499e-01 5.4233065485927945e+00 - 20 -2.7248763628994244e+00 -3.8904604034024199e+00 3.4619968272165651e+00 - 21 -9.8191660743738822e+00 -9.2644161229915074e+00 3.5602735097878899e+01 - 22 -1.7981865291465141e+01 -5.1466118164720598e+00 -2.7099136568523761e+01 - 23 2.7159814795066108e+01 1.5032337048108387e+01 -7.6944543401414212e+00 - 24 1.1638945421480624e+01 -3.2222691242895301e+01 2.1229936633276676e+01 - 25 -2.9814604902083850e+01 3.4701650785544889e+00 -2.4986496030631489e+01 - 26 1.7326614092687471e+01 2.8422683612159716e+01 2.8029894329231881e+00 - 27 2.2658957933007109e+00 -3.4112279099815822e+01 1.0080657200420177e+01 - 28 -2.4164731665143936e+01 9.4962630831560961e+00 -1.5922785886420032e+01 - 29 2.2535503192471925e+01 2.4638036606665924e+01 5.7706088802447679e+00 + 1 -1.7606251902923159e+01 2.6643882119930413e+02 3.2393419321484339e+02 + 2 1.5276960834008764e+02 1.2310582389585005e+02 -1.8097790195926436e+02 + 3 -1.3352077765449729e+02 -3.7931683694591061e+02 -1.4290297624584181e+02 + 4 -7.9208285225109849e+00 2.1478471735960927e+00 -5.8261886319696634e+00 + 5 -3.0434261578205852e+00 -3.3598894239789812e+00 1.2036984947303530e+01 + 6 -8.0541313090425797e+02 9.1789625338526901e+02 1.0248072977047568e+03 + 7 5.5714037909338003e+01 -3.1034952603212901e+02 -1.5712584053396683e+03 + 8 1.3310127264176666e+02 -9.6223382412254793e+01 3.9089950657873197e+02 + 9 7.8393522941199691e+01 7.6654620261161327e+01 3.4092253731960818e+02 + 10 5.2097807318872481e+02 -5.9878505315395330e+02 -1.8147944856121683e+02 + 11 -3.2607805887634553e+00 -4.8311046866092857e+00 -1.0171664794478403e+01 + 12 2.0366458915692469e+01 1.0143701787721827e+01 -6.6251278978227210e+00 + 13 7.9792434663096206e+00 -3.1830851066821841e+00 -3.2638620352005043e-01 + 14 -4.4038503948129541e+00 1.0233419205929188e+00 -8.7296859400167399e+00 + 15 1.3132947018333163e-01 8.2983881708484031e+00 2.0214566838297885e+00 + 16 4.3411275534322431e+02 -3.1229238652040181e+02 -1.1118141267684105e+03 + 17 -4.2721342182754506e+02 3.0241462990472007e+02 1.1238199764754720e+03 + 18 2.9838847807764635e-01 4.7247980026015819e+00 -7.8003688102693083e+00 + 19 2.0269974911843942e+00 -7.0026238992620549e-01 5.5351716846162295e+00 + 20 -2.8986968191969709e+00 -3.9675652109748709e+00 4.0697923801610969e+00 + 21 -6.8660187346191208e+01 -7.5471678271387688e+01 2.1302659044166259e+02 + 22 -1.0464810891818183e+02 -2.6524409454552028e+01 -1.6069138979151450e+02 + 23 1.7288784518246300e+02 1.0241550529178181e+02 -5.1825368367469061e+01 + 24 3.6620147999791428e+01 -2.0126087087164177e+02 1.0765575810476680e+02 + 25 -1.4622314319412877e+02 2.0851583458861896e+01 -1.2215092201442228e+02 + 26 1.0903608870284839e+02 1.8015263565726292e+02 1.3874299412995388e+01 + 27 4.8838950039633943e+01 -2.1313338017466026e+02 8.5042914346204270e+01 + 28 -1.7278635244680558e+02 7.1874890491129364e+01 -1.1608943659248607e+02 + 29 1.2434423656711061e+02 1.4125659005436137e+02 3.1022918623418885e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml index 631be6b3d..174f78aed 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 15:02:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -65,38 +65,38 @@ init_forces: ! |2 27 -1.7551531704171702e-01 6.6588106276847814e-01 -2.5211663664373374e-01 28 1.5473142633686865e-01 -3.3070958116386345e-01 1.7192605646732770e-01 29 7.9295234000756817e-02 -3.3696482169090269e-01 7.7692317052364929e-02 -run_vdwl: 0.0865454802879452 -run_coul: 26.3541935677558 +run_vdwl: 0.0870093421955066 +run_coul: 26.4738674237813 run_stress: ! |- - -9.5966819495319222e-01 -4.3941446226053111e+00 -3.1568771272196665e+00 1.5037730423097684e+00 -3.0350157968660951e-01 1.1569330698181230e+00 + -9.1724546220915149e-01 -4.3886311602289378e+00 -3.1927905190886716e+00 1.5279209924481243e+00 -2.6997992353776179e-01 1.1833674648942241e+00 run_forces: ! |2 - 1 2.4521222884076485e-01 -1.6086055657684817e-01 2.3890727709466764e-01 - 2 1.1736624317717813e-01 -3.1162687225181640e-01 -3.8761965478873905e-01 - 3 -2.9397470178107211e-03 3.4449772999398404e-03 9.6382941374364185e-03 - 4 -2.1733581187266381e-02 9.5402025505375446e-05 -4.6004840657874191e-02 - 5 -8.1637509297970243e-02 6.6925993223235142e-02 8.5173732336092829e-04 - 6 1.4189875272902974e-01 -4.4079190202677654e-01 -1.7282627914331100e-01 - 7 -2.0301283658280156e-02 8.1257684149718595e-02 3.2277925765230681e-01 - 8 -2.3176063039570383e-01 5.2671226809675886e-01 1.2053172553853687e-01 - 9 2.4851502997934918e-01 -6.8279100017572170e-01 4.2797251478983028e-01 - 10 -2.4005564061921746e-02 3.2665494506592459e-02 -4.5205317615484117e-02 - 11 -1.1843268179239209e-01 1.3673113110807389e-01 -7.8855615918135114e-02 - 12 4.1597764291342687e-01 -8.1785317044642980e-02 2.1998758510599548e-01 - 13 1.4754826472231841e-02 -1.7373529526282367e-02 -2.4742116546111935e-02 - 14 -1.4296016288807473e-01 4.7016645219744843e-02 -4.1094711597367460e-02 - 15 4.9775572369939805e-02 -3.7100239286285905e-04 -1.3337003405538669e-01 - 16 -3.9452087906060015e-02 -1.1223938303599601e-01 5.6594394612351093e-02 - 17 -3.9249180413714146e-01 8.6969704042383988e-01 -7.1560967422273125e-01 - 18 -6.5582088091562969e-03 4.6994263270377179e-01 -3.2849093510825489e-01 - 19 2.9863411122556297e-03 -2.7345780466997288e-01 3.4516149872881963e-01 - 20 -7.0778225573514611e-02 -1.8121331357752646e-01 2.3808694552706999e-01 - 21 4.2611610529174039e-02 3.5416302876012218e-01 -4.7545752535460878e-01 - 22 1.1514478572165697e-02 -1.1066278566656357e-01 3.0020944221363216e-01 - 23 -1.1773373891969874e-01 -1.8142495094717720e-01 2.5204331681638553e-01 - 24 -6.8821583242620554e-02 6.0915382973282572e-01 -3.2115938333173072e-01 - 25 1.4339999292415251e-02 -2.7422591321865630e-01 1.1162318514453656e-01 - 26 -2.2422826391878561e-02 -3.6755245162965111e-01 1.2917485895331829e-01 - 27 -1.8396738355957404e-01 6.7144647923408374e-01 -2.4138764142052668e-01 - 28 1.6141740622512213e-01 -3.3248921877856086e-01 1.6748278322747401e-01 - 29 7.9626886626010862e-02 -3.4038660496515699e-01 7.0778912894540136e-02 + 1 2.4609606850009486e-01 -1.5962032295319289e-01 2.4131732544303194e-01 + 2 1.2503486089423080e-01 -3.1084681203702791e-01 -3.9022869799787663e-01 + 3 -3.0752178063832240e-03 3.8776087464347780e-03 9.9328823244583080e-03 + 4 -2.3255573899808379e-02 -6.0181106742661339e-05 -4.5664999923266392e-02 + 5 -8.2607836694423675e-02 6.6475382346891460e-02 1.2496198560526485e-03 + 6 1.4468522405622342e-01 -4.4534632717709588e-01 -1.7945306173087108e-01 + 7 -2.2967555439944588e-02 8.5565616245094886e-02 3.3301428592578358e-01 + 8 -2.3874177165963287e-01 5.2880254322691966e-01 1.2081022329195877e-01 + 9 2.5037019206969180e-01 -6.7566512092835374e-01 4.2115693586375141e-01 + 10 -2.3714999960277566e-02 3.2818725398865510e-02 -4.4735319197398066e-02 + 11 -1.1854448066999541e-01 1.3621771199070484e-01 -8.0391418703489093e-02 + 12 4.1601034380971919e-01 -8.3138652549638772e-02 2.1994657549535751e-01 + 13 1.5916913229232395e-02 -1.6711363322243069e-02 -2.4815301265361373e-02 + 14 -1.4260823722372873e-01 4.6337787803529838e-02 -4.3081428571496085e-02 + 15 4.7945182121078719e-02 1.7130678335819860e-03 -1.3099869671281095e-01 + 16 -3.9311473706916539e-02 -1.1056952519161997e-01 5.6688027591615765e-02 + 17 -3.9076382166178070e-01 8.5907196316509138e-01 -7.0991607639899390e-01 + 18 7.0569166364468586e-03 4.8282312105704622e-01 -3.4669593723106334e-01 + 19 -1.8703190527014416e-02 -2.8825681467591763e-01 3.3753986500191918e-01 + 20 -6.3865631101552356e-02 -1.7995434869372545e-01 2.6371874554630853e-01 + 21 3.9685304128381810e-02 3.6892418448366560e-01 -4.8052777569329075e-01 + 22 -1.2907765741553730e-03 -1.2285444388508636e-01 2.9924506222626268e-01 + 23 -1.0266389571525412e-01 -1.8239922422520066e-01 2.5896234212817737e-01 + 24 -5.9860963489428064e-02 6.0674585383800106e-01 -3.1618236748339129e-01 + 25 1.7333461972413033e-03 -2.7731493941124225e-01 9.8991667669034528e-02 + 26 -2.0889464684633364e-02 -3.6478664842794994e-01 1.3264797191663721e-01 + 27 -1.7634512557760201e-01 6.6646075645199676e-01 -2.5105814899587581e-01 + 28 1.5533494692154048e-01 -3.3098631398103334e-01 1.7151091613956651e-01 + 29 7.9340717828649765e-02 -3.3732328402175366e-01 7.7016783485269039e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm.yaml index 6d0931e44..93677fc67 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:17 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -65,38 +65,38 @@ init_forces: ! |2 27 4.9268791156186467e+01 -2.1540598686099841e+02 8.6345383147942030e+01 28 -1.7572634950721937e+02 7.2424827220244183e+01 -1.1807149076862123e+02 29 1.2694498050495100e+02 1.4289100035784023e+02 3.1729222907581573e+01 -run_vdwl: 147.043776354413 -run_coul: 120.8001336586 +run_vdwl: 719.582815872373 +run_coul: 114.220463594378 run_stress: ! |2- - 6.0714663732455847e+02 6.2725635024897929e+02 4.5374173505793243e+02 -3.0771637435262659e+02 -2.8793288214453245e+01 1.3172686539751524e+02 + 2.1092358422575135e+03 2.1092549801735081e+03 4.3557355823049138e+03 -7.3297396422976431e+02 3.5809159341023125e+01 6.3889365673654538e+02 run_forces: ! |2 - 1 1.4901689497002673e+01 7.9362943043807562e+01 6.1758300172742871e+01 - 2 1.9582049295544049e+01 1.2033717464596441e+01 -2.5527893246658085e+01 - 3 -2.4595995274306111e+02 1.0320599115625998e+02 8.5016527839149120e+01 - 4 -8.7666850222795709e+00 3.3307143092276532e+00 -6.5800981227645350e+00 - 5 -2.2550238900574606e+00 -1.8189558045057175e+00 1.0381639740922882e+01 - 6 1.1566144772418748e+02 -9.8961452276409219e+01 -1.4206288460675808e+02 - 7 4.0310101760712618e+00 -1.0796608823311569e+01 -4.1053737256776316e+01 - 8 -2.0278669575384164e+01 2.2416739720380750e+01 5.7007587841926366e+01 - 9 1.3831275751679584e+01 6.3233091137430222e+00 5.3125632481524498e+01 - 10 6.4034493545834522e+01 -7.5459379892522009e+01 -7.5613081952827940e+01 - 11 -7.3900443422452895e+00 -6.7494602793513412e+00 -1.7185400273734476e+01 - 12 1.7678277368693390e+01 1.1269091689483144e+01 -6.5110753356592701e+00 - 13 7.2168896746806110e+00 -2.6444828106073990e+00 -4.2612461496077447e-01 - 14 -4.3479906208348362e+00 9.4719521998375111e-01 -7.1776577509678638e+00 - 15 -3.2415898288956818e-01 7.8105564987591878e+00 1.9327777250212246e+00 - 16 5.2553219908630844e+01 -6.8222989365710632e+01 1.4027040597925742e+01 - 17 -1.8352933937800863e+01 1.7361841967356249e+01 3.6403387946531019e+01 - 18 -2.7788331281660261e-01 6.3931124445056247e+00 -7.3568516246360884e+00 - 19 2.2961494163672729e+00 -1.7083532799577157e+00 5.9508356507753817e+00 - 20 -2.9296182744834875e+00 -4.5612268259720796e+00 3.9549262882923650e+00 - 21 -9.6780982404581639e+00 -8.5051107638770294e+00 3.4792566443434403e+01 - 22 -1.8186664032920348e+01 -5.4051689653752444e+00 -2.6632304684934020e+01 - 23 2.7110232310369650e+01 1.4702213669044736e+01 -7.2378949155518617e+00 - 24 1.1387747553146534e+01 -3.0705432102675168e+01 2.0564397762222427e+01 - 25 -2.9706818756014833e+01 2.8110986385072838e+00 -2.4644099460850164e+01 - 26 1.7395573933239262e+01 2.7712408754881206e+01 3.1227835707147404e+00 - 27 1.6512708481313663e+00 -3.2507870515337615e+01 9.2893136573735475e+00 - 28 -2.3920411895363195e+01 8.5646513497662067e+00 -1.5561037429156526e+01 - 29 2.3043626623030995e+01 2.3800906665309942e+01 6.2424235576793725e+00 + 1 -1.7999958651139561e+01 2.6650220376142943e+02 3.2427411672041313e+02 + 2 1.5295092927418344e+02 1.2285076809736039e+02 -1.8121178788865851e+02 + 3 -1.3354657044056273e+02 -3.7932510264482579e+02 -1.4287738513477268e+02 + 4 -7.8048800402432592e+00 2.1706108746038639e+00 -5.9279614887122101e+00 + 5 -2.9268135885522399e+00 -3.2880101863464972e+00 1.1979386762201212e+01 + 6 -8.0491590172128531e+02 9.1828131102672694e+02 1.0240065729185576e+03 + 7 5.5420439303116630e+01 -3.1071126172697780e+02 -1.5707651475222281e+03 + 8 1.3292010784000286e+02 -9.6771896004261109e+01 3.9141958071668591e+02 + 9 7.8595882731933969e+01 7.6950478042604828e+01 3.4087971763031140e+02 + 10 5.2095074847875298e+02 -5.9869413915320217e+02 -1.8152806254130201e+02 + 11 -3.3197977605242772e+00 -4.7054866217415467e+00 -1.0251470783128028e+01 + 12 2.0688464326512960e+01 9.7635793973681970e+00 -6.4620221318471094e+00 + 13 7.8823383865009076e+00 -3.0863662104585874e+00 -3.4439926048423242e-01 + 14 -4.5353746273775366e+00 1.1445573705688963e+00 -8.7536573377881552e+00 + 15 3.5480054357629312e-02 8.3788945096360887e+00 1.9655234400822692e+00 + 16 4.3399998874055484e+02 -3.1202397787989349e+02 -1.1115111692053708e+03 + 17 -4.2725557813046021e+02 3.0215080349368594e+02 1.1231612730457389e+03 + 18 7.3476463816010618e-01 6.0666118189304905e+00 -8.9345234339407575e+00 + 19 1.8823942145922286e+00 -1.3809922306196758e+00 6.2441745118004324e+00 + 20 -3.1167307983103498e+00 -4.5499286214809649e+00 4.6915549590584540e+00 + 21 -6.8535262129661291e+01 -7.4719827764346419e+01 2.1212551553994729e+02 + 22 -1.0473851857948546e+02 -2.6780591695996627e+01 -1.6017575373739973e+02 + 23 1.7276488737521515e+02 1.0205150286586321e+02 -5.1364081524921431e+01 + 24 3.6465655158215206e+01 -1.9972898980297612e+02 1.0715960216791886e+02 + 25 -1.4605945804774697e+02 2.0226992034236233e+01 -1.2188220036755411e+02 + 26 1.0897285156309762e+02 1.7931951848028274e+02 1.4080001779209764e+01 + 27 4.8327647923321152e+01 -2.1153106396396677e+02 8.4231626928895977e+01 + 28 -1.7244926892638290e+02 7.1003976646642542e+01 -1.1565182248919838e+02 + 29 1.2461153343321486e+02 1.4043582608715323e+02 3.1422797726485516e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm_table.yaml index da153afa6..0c0bc8609 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -65,38 +65,38 @@ init_forces: ! |2 27 4.9268790999233929e+01 -2.1540598666832003e+02 8.6345383063447272e+01 28 -1.7572634968463726e+02 7.2424826918876605e+01 -1.1807149075889181e+02 29 1.2694498087382951e+02 1.4289100038945139e+02 3.1729223046173637e+01 -run_vdwl: 147.043776338633 -run_coul: 120.800133817676 +run_vdwl: 719.582815872361 +run_coul: 114.220460933603 run_stress: ! |2- - 6.0714663311745971e+02 6.2725634708136886e+02 4.5374173242579457e+02 -3.0771637405213085e+02 -2.8793287826109200e+01 1.3172686086977939e+02 + 2.1092358424448466e+03 2.1092549782135725e+03 4.3557355834206801e+03 -7.3297396482794727e+02 3.5809159695238378e+01 6.3889365386521877e+02 run_forces: ! |2 - 1 1.4901689535860479e+01 7.9362943315789622e+01 6.1758299937921862e+01 - 2 1.9582049051333076e+01 1.2033717565360126e+01 -2.5527893317457991e+01 - 3 -2.4595995282925898e+02 1.0320599122943503e+02 8.5016527877222359e+01 - 4 -8.7666850483451171e+00 3.3307143270895119e+00 -6.5800981487831054e+00 - 5 -2.2550238252519654e+00 -1.8189558325611479e+00 1.0381639706668242e+01 - 6 1.1566144809091207e+02 -9.8961452523049076e+01 -1.4206288484204066e+02 - 7 4.0310097102795677e+00 -1.0796608303994823e+01 -4.1053737720803127e+01 - 8 -2.0278669408347216e+01 2.2416739338834109e+01 5.7007588075069044e+01 - 9 1.3831275616847163e+01 6.3233093276437895e+00 5.3125632370161163e+01 - 10 6.4034493496778907e+01 -7.5459379922332801e+01 -7.5613081848628468e+01 - 11 -7.3900442377866602e+00 -6.7494604284263069e+00 -1.7185400236387881e+01 - 12 1.7678277469830054e+01 1.1269091649304952e+01 -6.5110753072794152e+00 - 13 7.2168896794944652e+00 -2.6444828686963686e+00 -4.2612463395781347e-01 - 14 -4.3479906531649180e+00 9.4719526295738032e-01 -7.1776577441146348e+00 - 15 -3.2415894349659252e-01 7.8105564183168070e+00 1.9327777783774476e+00 - 16 5.2553220358744781e+01 -6.8222989829586311e+01 1.4027040949009853e+01 - 17 -1.8352933977506851e+01 1.7361842537843906e+01 3.6403387920358220e+01 - 18 -2.7788368930208829e-01 6.3931125373835611e+00 -7.3568514904287898e+00 - 19 2.2961493263766268e+00 -1.7083534014704733e+00 5.9508358805826278e+00 - 20 -2.9296182765742396e+00 -4.5612267825102339e+00 3.9549263809911017e+00 - 21 -9.6780978167157254e+00 -8.5051106959227312e+00 3.4792566153070915e+01 - 22 -1.8186664029647432e+01 -5.4051690417593203e+00 -2.6632304585921133e+01 - 23 2.7110232217737764e+01 1.4702213683923395e+01 -7.2378947376832157e+00 - 24 1.1387747767279770e+01 -3.0705432107706503e+01 2.0564397900216544e+01 - 25 -2.9706818761609675e+01 2.8110985578415022e+00 -2.4644099885398674e+01 - 26 1.7395573900768980e+01 2.7712408960708544e+01 3.1227837959301090e+00 - 27 1.6512707537981939e+00 -3.2507870938781259e+01 9.2893135681090975e+00 - 28 -2.3920412291442325e+01 8.5646513166516911e+00 -1.5561037446647953e+01 - 29 2.3043626812407886e+01 2.3800906647713308e+01 6.2424236518441303e+00 + 1 -1.7999958534597678e+01 2.6650220380633561e+02 3.2427411686661628e+02 + 2 1.5295092956615622e+02 1.2285076834385553e+02 -1.8121178790064576e+02 + 3 -1.3354657043336115e+02 -3.7932510262572384e+02 -1.4287738513245807e+02 + 4 -7.8048800373320182e+00 2.1706108554518577e+00 -5.9279614855119700e+00 + 5 -2.9268136066275927e+00 -3.2880101788622138e+00 1.1979386729076214e+01 + 6 -8.0491590191159560e+02 9.1828131092160993e+02 1.0240065728834425e+03 + 7 5.5420439185880127e+01 -3.1071126186649246e+02 -1.5707651477573208e+03 + 8 1.3292010790971605e+02 -9.6771896026318842e+01 3.9141958093630365e+02 + 9 7.8595882803289612e+01 7.6950477921529910e+01 3.4087971767238093e+02 + 10 5.2095074851131176e+02 -5.9869413917988186e+02 -1.8152806260974813e+02 + 11 -3.3197978395474737e+00 -4.7054865114182398e+00 -1.0251470734706650e+01 + 12 2.0688464328993344e+01 9.7635793544853193e+00 -6.4620222708568908e+00 + 13 7.8823384665156597e+00 -3.0863662741254583e+00 -3.4439935477699635e-01 + 14 -4.5353744792099047e+00 1.1445572786244358e+00 -8.7536572508997814e+00 + 15 3.5480058129770439e-02 8.3788943669261293e+00 1.9655235360789840e+00 + 16 4.3399998826196747e+02 -3.1202397751523739e+02 -1.1115111691418194e+03 + 17 -4.2725557800389646e+02 3.0215080370087367e+02 1.1231612727717761e+03 + 18 7.3476448709364495e-01 6.0666117033030833e+00 -8.9345233278560006e+00 + 19 1.8823942133877596e+00 -1.3809921215600505e+00 6.2441746349524756e+00 + 20 -3.1167308010143540e+00 -4.5499285671859813e+00 4.6915550027239519e+00 + 21 -6.8535262069478335e+01 -7.4719827733611808e+01 2.1212551579244735e+02 + 22 -1.0473851837111761e+02 -2.6780591640507414e+01 -1.6017575358604219e+02 + 23 1.7276488725236862e+02 1.0205150266569815e+02 -5.1364081581733082e+01 + 24 3.6465655023295483e+01 -1.9972898972859414e+02 1.0715960155975262e+02 + 25 -1.4605945814840032e+02 2.0226991934856777e+01 -1.2188220020391657e+02 + 26 1.0897285166956409e+02 1.7931951853770977e+02 1.4080001820762044e+01 + 27 4.8327647905239694e+01 -2.1153106394943887e+02 8.4231626849616404e+01 + 28 -1.7244926873175294e+02 7.1003976576726402e+01 -1.1565182252674140e+02 + 29 1.2461153332502221e+02 1.4043582595097195e+02 3.1422797809103873e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_table.yaml index f90ad83d2..31eea37ef 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -64,38 +64,38 @@ init_forces: ! |2 27 4.9789629338882591e+01 -2.1702104489195116e+02 8.7170152872148577e+01 28 -1.7608383035284197e+02 7.3301761851485111e+01 -1.1852450980305292e+02 29 1.2668895608425100e+02 1.4371758196584054e+02 3.1331338576767038e+01 -run_vdwl: 146.970428550859 -run_coul: 231.547229122181 +run_vdwl: 719.571434315538 +run_coul: 225.904269147748 run_stress: ! |2- - 6.0914869625175493e+02 6.3099173882592959e+02 4.5850514936740979e+02 -3.1002851479683875e+02 -2.9988861801303777e+01 1.3053553001153833e+02 + 2.1107000376249293e+03 2.1121506818905805e+03 4.3598676876880390e+03 -7.3407477695911439e+02 3.5368424794838099e+01 6.3752998026727164e+02 run_forces: ! |2 - 1 1.5318845015613133e+01 7.9282035518233755e+01 6.1573554194174804e+01 - 2 1.9396961957636936e+01 1.2345000771165349e+01 -2.5332918485221477e+01 - 3 -2.4626013487752948e+02 1.0353982092730607e+02 8.5144823240682257e+01 - 4 -8.8799795062002786e+00 3.3241590535278189e+00 -6.4497294593410652e+00 - 5 -2.3921296436671118e+00 -1.8640436723589162e+00 1.0409771584665240e+01 - 6 1.1514352702606354e+02 -9.9343286724221088e+01 -1.4128644844359440e+02 - 7 4.4121937861445062e+00 -1.0659282218566750e+01 -4.1672994745356952e+01 - 8 -1.9867788053020071e+01 2.2748961127880438e+01 5.6456513911125221e+01 - 9 1.3497119289171929e+01 6.1641764448035072e+00 5.3035389155856542e+01 - 10 6.4064110893437459e+01 -7.5531395248562106e+01 -7.5546928140878578e+01 - 11 -7.3191398561235221e+00 -6.8855076682705514e+00 -1.7097015930804318e+01 - 12 1.7331977565835931e+01 1.1587221600961438e+01 -6.6949835780119562e+00 - 13 7.3167731484986946e+00 -2.7360195519736314e+00 -4.0451246068408414e-01 - 14 -4.2029830220428801e+00 8.3858162563415783e-01 -7.1469624624951251e+00 - 15 -2.3375280743648877e-01 7.7706173472191979e+00 2.0011134834750193e+00 - 16 5.2778367253903184e+01 -6.8528201447251220e+01 1.3739546884116592e+01 - 17 -1.8300840901681177e+01 1.7606322913242291e+01 3.7169234134596515e+01 - 18 -6.3717628857406194e-01 4.7970851570438056e+00 -6.5668113725744455e+00 - 19 2.4125187250034315e+00 -8.7927379109343828e-01 5.4233063603242204e+00 - 20 -2.7248745150975320e+00 -3.8904592977149006e+00 3.4619977969996802e+00 - 21 -9.8191665437368503e+00 -9.2644149677025247e+00 3.5602735153447462e+01 - 22 -1.7981866451948409e+01 -5.1466129909329492e+00 -2.7099137180729258e+01 - 23 2.7159816406359141e+01 1.5032337345346214e+01 -7.6944538058697152e+00 - 24 1.1638945306995451e+01 -3.2222690401249281e+01 2.1229935434748501e+01 - 25 -2.9814605699538674e+01 3.4701639693735968e+00 -2.4986496346643086e+01 - 26 1.7326615310496610e+01 2.8422684112931258e+01 2.8029906895710659e+00 - 27 2.2658952132855354e+00 -3.4112278499734508e+01 1.0080656809842090e+01 - 28 -2.4164733159739395e+01 9.4962621407073975e+00 -1.5922786483795804e+01 - 29 2.2535504427890473e+01 2.4638036424255674e+01 5.7706100623750975e+00 + 1 -1.7606252953481889e+01 2.6643882049802971e+02 3.2393419245585523e+02 + 2 1.5276960786642002e+02 1.2310582328079646e+02 -1.8097790035072214e+02 + 3 -1.3352077751880532e+02 -3.7931683705577746e+02 -1.4290297637700311e+02 + 4 -7.9208284549050267e+00 2.1478477064551331e+00 -5.8261884661865864e+00 + 5 -3.0434259068966933e+00 -3.3598884249995993e+00 1.2036985120619381e+01 + 6 -8.0541313113836111e+02 9.1789625385894567e+02 1.0248072957584175e+03 + 7 5.5714038030654166e+01 -3.1034952539775895e+02 -1.5712584075496775e+03 + 8 1.3310127213682222e+02 -9.6223383131159139e+01 3.9089950954844187e+02 + 9 7.8393524581744217e+01 7.6654619432607774e+01 3.4092253927940965e+02 + 10 5.2097807339671249e+02 -5.9878505281797004e+02 -1.8147944927027896e+02 + 11 -3.2607806728392306e+00 -4.8311039789426893e+00 -1.0171664807544021e+01 + 12 2.0366459007319261e+01 1.0143701993244955e+01 -6.6251292626582101e+00 + 13 7.9792436295382245e+00 -3.1830852851835849e+00 -3.2638612217084206e-01 + 14 -4.4038504552635640e+00 1.0233417101199214e+00 -8.7296858424650310e+00 + 15 1.3132923771369195e-01 8.2983878377543530e+00 2.0214571971589890e+00 + 16 4.3411275535888331e+02 -3.1229238667270590e+02 -1.1118141266301659e+03 + 17 -4.2721342178178230e+02 3.0241463055951266e+02 1.1238199760715595e+03 + 18 2.9838884189958087e-01 4.7247977257304212e+00 -7.8003698477877208e+00 + 19 2.0269953079575300e+00 -7.0026411368405606e-01 5.5351718359110240e+00 + 20 -2.8986948593461075e+00 -3.9675640309799531e+00 4.0697933676307843e+00 + 21 -6.8660187924841551e+01 -7.5471677470050565e+01 2.1302659122049695e+02 + 22 -1.0464811106939686e+02 -2.6524410939730384e+01 -1.6069139111994346e+02 + 23 1.7288784788886190e+02 1.0241550621228672e+02 -5.1825367716889822e+01 + 24 3.6620147798049850e+01 -2.0126087082687755e+02 1.0765575689523214e+02 + 25 -1.4622314526116523e+02 2.0851582226527505e+01 -1.2215092296867101e+02 + 26 1.0903609104386310e+02 1.8015263715915256e+02 1.3874301048850125e+01 + 27 4.8838949755146118e+01 -2.1313338007884275e+02 8.5042914156751607e+01 + 28 -1.7278635474909387e+02 7.1874889653604811e+01 -1.1608943768632795e+02 + 29 1.2434423886459305e+02 1.4125659036989407e+02 3.1022920062157464e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_charmmfsw.yaml b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_charmmfsw.yaml index f09851333..5348900e5 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_charmmfsw.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_charmmfsw.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -58,38 +58,38 @@ init_forces: ! |2 27 4.9228931276512100e+01 -2.1477290997466739e+02 8.6128208087847014e+01 28 -1.7560470224833779e+02 7.2224321811604753e+01 -1.1795950384540764e+02 29 1.2681366777620973e+02 1.4256971961228845e+02 3.1806925095570197e+01 -run_vdwl: 147.12292278395 -run_coul: -74.6915019522078 +run_vdwl: 719.605610058691 +run_coul: -81.7415665262046 run_stress: ! |2- - 6.0712398692643421e+02 6.2916822545545722e+02 4.5370753073861300e+02 -3.0974045317767610e+02 -2.7978231115876788e+01 1.3098191331295374e+02 + 2.1089926489561076e+03 2.1113852262883292e+03 4.3560155848098948e+03 -7.3504060382009311e+02 3.6514409677293408e+01 6.3806441362950068e+02 run_forces: ! |2 - 1 1.4642385106623093e+01 7.9632876006293088e+01 6.1668039676610277e+01 - 2 1.9476078109802518e+01 1.2264917745439952e+01 -2.5213178366311432e+01 - 3 -2.4595703188898531e+02 1.0319756203047633e+02 8.5063024198438555e+01 - 4 -8.6984452583500751e+00 3.3219390551321775e+00 -6.5722330495112651e+00 - 5 -2.1731127714594782e+00 -1.8369154265934875e+00 1.0364140170250522e+01 - 6 1.1581673009750675e+02 -9.8676217606271834e+01 -1.4259755528204636e+02 - 7 3.8636137552235721e+00 -1.0908019170584268e+01 -4.1020037352656296e+01 - 8 -2.0318757997486646e+01 2.2064790269687450e+01 5.7117682705811255e+01 - 9 1.3796175688554445e+01 6.6507001266853756e+00 5.2810959812749104e+01 - 10 6.4100900683302541e+01 -7.5542463035782987e+01 -7.5586609877183832e+01 - 11 -7.3574728807596319e+00 -6.7901029297567055e+00 -1.7150320458081499e+01 - 12 1.7467601280644249e+01 1.1212388002290647e+01 -6.6568663037765115e+00 - 13 7.1995993347412846e+00 -2.5654206629285845e+00 -4.1943726429832473e-01 - 14 -4.3376605501038021e+00 1.0019317748614860e+00 -7.1673626922572637e+00 - 15 -3.6296140721588305e-01 7.8680554289683107e+00 1.9716802034745051e+00 - 16 5.2532411500903336e+01 -6.8094037412928145e+01 1.4591497058133163e+01 - 17 -1.7997040755524775e+01 1.6591471201203984e+01 3.6537600964320440e+01 - 18 -1.8572396559811857e-01 6.3674188967844119e+00 -7.9180659895253456e+00 - 19 2.3573889007955318e+00 -1.5453202989747150e+00 6.1093730988733173e+00 - 20 -3.0232654668565111e+00 -4.6372505110417821e+00 4.1678172319201430e+00 - 21 -9.3760049729652071e+00 -8.7025949402372902e+00 3.4165117726438503e+01 - 22 -1.8283489403401408e+01 -5.2738028319553809e+00 -2.6371952652109695e+01 - 23 2.6954576924807782e+01 1.4685367759575291e+01 -6.9629472131005841e+00 - 24 1.1144740931947064e+01 -3.0158118540595797e+01 2.0459423586004277e+01 - 25 -2.9510430920728709e+01 2.5039866978829473e+00 -2.4516774142608895e+01 - 26 1.7516251317809235e+01 2.7341006511380236e+01 3.1946568343895811e+00 - 27 1.5819137950101556e+00 -3.1817124025057765e+01 9.0287143097764986e+00 - 28 -2.3852732105282829e+01 8.3255910357516161e+00 -1.5471913834940676e+01 - 29 2.2983762917046811e+01 2.3517384850295382e+01 6.3755269012178246e+00 + 1 -1.8184246648509227e+01 2.6674988497841485e+02 3.2415242921533365e+02 + 2 1.5282421924935963e+02 1.2311789169008429e+02 -1.8088865232373999e+02 + 3 -1.3355233655834584e+02 -3.7932316949551102e+02 -1.4287272156124843e+02 + 4 -7.7415199373426971e+00 2.1699416917769021e+00 -5.9097167127823482e+00 + 5 -2.8525372406066816e+00 -3.2964406681906633e+00 1.1964240450742944e+01 + 6 -8.0496131038825683e+02 9.1872887241784997e+02 1.0235426009506300e+03 + 7 5.5324361919893050e+01 -3.1088888966109738e+02 -1.5708275074838587e+03 + 8 1.3311773885941705e+02 -9.7293250117326636e+01 3.9158486902702919e+02 + 9 7.8532288598446897e+01 7.7250465502060194e+01 3.4053759386577298e+02 + 10 5.2094330782053748e+02 -5.9868403193398808e+02 -1.8151170354113142e+02 + 11 -3.2871191610171069e+00 -4.7379796115870336e+00 -1.0226770419668879e+01 + 12 2.0475254744465115e+01 9.6937988696290525e+00 -6.5787605022643465e+00 + 13 7.8609528974990024e+00 -3.0083663766437256e+00 -3.4920577957356147e-01 + 14 -4.5349434470042356e+00 1.1965960670918734e+00 -8.7461996101238348e+00 + 15 -7.3901598178960238e-03 8.4369842336538436e+00 1.9965512019932852e+00 + 16 4.3402649830961428e+02 -3.1193604415753691e+02 -1.1110287461816129e+03 + 17 -4.2692589858346116e+02 3.0140354598812337e+02 1.1233830574476840e+03 + 18 8.0146498670867894e-01 6.0599146215162927e+00 -9.4843385902219239e+00 + 19 1.9434357545875738e+00 -1.2461960945989918e+00 6.4072076249934131e+00 + 20 -3.2042610207553373e+00 -4.6235444013162796e+00 4.9143641296783551e+00 + 21 -6.8304095266063513e+01 -7.4843863158529416e+01 2.1156785917937765e+02 + 22 -1.0475308091881627e+02 -2.6656480314558113e+01 -1.5990716197676156e+02 + 23 1.7257862422546037e+02 1.0198384526792196e+02 -5.1138913750734844e+01 + 24 3.6247854216791907e+01 -1.9917238129196423e+02 1.0705299845802779e+02 + 25 -1.4581090869009472e+02 1.9974161481890068e+01 -1.2170738334813588e+02 + 26 1.0900311907862222e+02 1.7892380181420981e+02 1.4099324490723095e+01 + 27 4.8287759966603957e+01 -2.1090465279453045e+02 8.4016764473404507e+01 + 28 -1.7233343768085393e+02 7.0805232793907280e+01 -1.1554407516478341e+02 + 29 1.2448620507293813e+02 1.4012035265924914e+02 3.1501996431251023e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_long.yaml index cfd5f5ffb..898a0759a 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 4.9789244657638250e+01 -2.1702149805292603e+02 8.7170399036639779e+01 28 -1.7608373894634312e+02 7.3301640361340901e+01 -1.1852441542581737e+02 29 1.2668889886115156e+02 1.4371742559187234e+02 3.1331337671189914e+01 -run_vdwl: 146.984418782184 -run_coul: 231.552718447771 +run_vdwl: 719.585473962865 +run_coul: 225.909604651644 run_stress: ! |2- - 6.0915007856838156e+02 6.3099838824423102e+02 4.5850607554549310e+02 -3.1002755587228529e+02 -2.9990072405370924e+01 1.3053392942843757e+02 + 2.1107012998513460e+03 2.1121572220770449e+03 4.3598683165615039e+03 -7.3407390560460340e+02 3.5367139753286040e+01 6.3752843926070409e+02 run_forces: ! |2 - 1 1.5318997633012293e+01 7.9282470099947048e+01 6.1573393434443460e+01 - 2 1.9396999272425202e+01 1.2344971844181330e+01 -2.5333000837759226e+01 - 3 -2.4626005501506296e+02 1.0353984998006756e+02 8.5144829284640295e+01 - 4 -8.8799856259659204e+00 3.3241617300288668e+00 -6.4497351833339280e+00 - 5 -2.3921454141208414e+00 -1.8640281437312123e+00 1.0409774478944096e+01 - 6 1.1514346384921204e+02 -9.9343286537715102e+01 -1.4128641584477512e+02 - 7 4.4122093406572382e+00 -1.0659281597809141e+01 -4.1672980599867493e+01 - 8 -1.9867781402617986e+01 2.2749027849638232e+01 5.6456538922288530e+01 - 9 1.3497172957239414e+01 6.1640093294898106e+00 5.3035463862509943e+01 - 10 6.4064102255027365e+01 -7.5531370201594868e+01 -7.5546935814661325e+01 - 11 -7.3191636842038346e+00 -6.8854904578062648e+00 -1.7097042061708187e+01 - 12 1.7332228392863261e+01 1.1587346868424788e+01 -6.6950828934139412e+00 - 13 7.3167791822564405e+00 -2.7360169821442826e+00 -4.0452212374013435e-01 - 14 -4.2030077377596005e+00 8.3859907399272549e-01 -7.1469744464368024e+00 - 15 -2.3373953646206069e-01 7.7706204798387661e+00 2.0010820558039732e+00 - 16 5.2778367018314924e+01 -6.8528235621428024e+01 1.3739509534437326e+01 - 17 -1.8300930156419284e+01 1.7606503994603081e+01 3.7169152012489683e+01 - 18 -6.3733286099871089e-01 4.7975690998211729e+00 -6.5669661826136148e+00 - 19 2.4125661259633855e+00 -8.7927489495834799e-01 5.4234307798268855e+00 - 20 -2.7249482919955481e+00 -3.8905672633229722e+00 3.4620649386386178e+00 - 21 -9.8190004451258179e+00 -9.2647209839754137e+00 3.5602652792868142e+01 - 22 -1.7981853924556582e+01 -5.1466292474179509e+00 -2.7099080824449683e+01 - 23 2.7159792255320504e+01 1.5032297318008172e+01 -7.6944157996404696e+00 - 24 1.1638937100298360e+01 -3.2222558430587675e+01 2.1229903540337908e+01 - 25 -2.9814598104604816e+01 3.4701195764509549e+00 -2.4986476262046722e+01 - 26 1.7326607847651687e+01 2.8422634525836045e+01 2.8030168332301861e+00 - 27 2.2655457281168090e+00 -3.4112829458217902e+01 1.0080954761238065e+01 - 28 -2.4164705442321125e+01 9.4961850732044546e+00 -1.5922742944628450e+01 - 29 2.2535478683856013e+01 2.4637922977176196e+01 5.7706045873779974e+00 + 1 -1.7606054744243849e+01 2.6643935170038111e+02 3.2393402086560275e+02 + 2 1.5276960542084925e+02 1.2310575764680296e+02 -1.8097793701547178e+02 + 3 -1.3352077587545628e+02 -3.7931683476095429e+02 -1.4290297409420063e+02 + 4 -7.9208305032831872e+00 2.1478476528321591e+00 -5.8261943745784057e+00 + 5 -3.0434390335176182e+00 -3.3598736175132911e+00 1.2036983365185725e+01 + 6 -8.0541310179784648e+02 9.1789616693195660e+02 1.0248072456682105e+03 + 7 5.5714036350087746e+01 -3.1034950638669142e+02 -1.5712583234436763e+03 + 8 1.3310123864849695e+02 -9.6223277255507455e+01 3.9089956309356938e+02 + 9 7.8393562085414203e+01 7.6654481328923197e+01 3.4092257246715269e+02 + 10 5.2097806612053682e+02 -5.9878504317168847e+02 -1.8147945385561414e+02 + 11 -3.2608026887326114e+00 -4.8310920056635434e+00 -1.0171689827683169e+01 + 12 2.0366715723989692e+01 1.0143836101841853e+01 -6.6252341816213169e+00 + 13 7.9792475629220929e+00 -3.1830819937644996e+00 -3.2639415085388418e-01 + 14 -4.4038655901828996e+00 1.0233590086507924e+00 -8.7296988309094452e+00 + 15 1.3134752167725597e-01 8.2983929398506966e+00 2.0214260219646869e+00 + 16 4.3411273979730333e+02 -3.1229241302890745e+02 -1.1118140842280764e+03 + 17 -4.2721348156849120e+02 3.0241477868660672e+02 1.1238198234527401e+03 + 18 2.9825129163526715e-01 4.7252819959614465e+00 -7.8005494298999070e+00 + 19 2.0270330832265619e+00 -7.0026269856052192e-01 5.5352980464408335e+00 + 20 -2.8987699640030677e+00 -3.9676711350036298e+00 4.0698733438314365e+00 + 21 -6.8659983406655371e+01 -7.5471946699767429e+01 2.1302638096463886e+02 + 22 -1.0464806743778219e+02 -2.6524422943569245e+01 -1.6069125265115332e+02 + 23 1.7288775459987889e+02 1.0241542378186385e+02 -5.1825289078112618e+01 + 24 3.6620120928669557e+01 -2.0126062690385479e+02 1.0765566776546679e+02 + 25 -1.4622307256079125e+02 2.0851514433095996e+01 -1.2215084254566423e+02 + 26 1.0903604271977566e+02 1.8015249170425312e+02 1.3874326479926701e+01 + 27 4.8838567707859980e+01 -2.1313383587809523e+02 8.5043163402200662e+01 + 28 -1.7278626703392575e+02 7.1874769788312193e+01 -1.1608934611992937e+02 + 29 1.2434418264258851e+02 1.4125643477820870e+02 3.1022918890514465e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_table.yaml index e41f9acef..2e578773a 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmmfsw_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -64,38 +64,38 @@ init_forces: ! |2 27 4.9789244542272257e+01 -2.1702149788720484e+02 8.7170398842712999e+01 28 -1.7608374165795001e+02 7.3301639426416060e+01 -1.1852441664190688e+02 29 1.2668890148458790e+02 1.4371742610115308e+02 3.1331339177050701e+01 -run_vdwl: 146.984418333719 -run_coul: 231.552725961131 +run_vdwl: 719.585473929458 +run_coul: 225.909636643767 run_stress: ! |2- - 6.0915008968811571e+02 6.3099838081275243e+02 4.5850607170133424e+02 -3.1002754682793403e+02 -2.9990069780615620e+01 1.3053393453920179e+02 + 2.1107013146571121e+03 2.1121572221710703e+03 4.3598683263365974e+03 -7.3407390071038674e+02 3.5367145460328587e+01 6.3752844341643333e+02 run_forces: ! |2 - 1 1.5318995910125460e+01 7.9282469634690031e+01 6.1573392699889702e+01 - 2 1.9396998539676865e+01 1.2344970897516079e+01 -2.5332999435007466e+01 - 3 -2.4626005477914342e+02 1.0353984934087974e+02 8.5144829036555933e+01 - 4 -8.8799860073584345e+00 3.3241623919790304e+00 -6.4497350519808929e+00 - 5 -2.3921452052382874e+00 -1.8640271537990853e+00 1.0409774877440578e+01 - 6 1.1514346823163386e+02 -9.9343289799744497e+01 -1.4128641892004165e+02 - 7 4.4122088674494888e+00 -1.0659280227837462e+01 -4.1672977065114083e+01 - 8 -1.9867785374340034e+01 2.2749029807824162e+01 5.6456538707386606e+01 - 9 1.3497174248527294e+01 6.1640073026156017e+00 5.3035464571236112e+01 - 10 6.4064102152186308e+01 -7.5531369637128918e+01 -7.5546935459095678e+01 - 11 -7.3191638508600736e+00 -6.8854898294001972e+00 -1.7097042144309583e+01 - 12 1.7332229235751768e+01 1.1587346258874572e+01 -6.6950839103949100e+00 - 13 7.3167793046676231e+00 -2.7360170830865727e+00 -4.0452201578913238e-01 - 14 -4.2030076856419818e+00 8.3859883187277029e-01 -7.1469744247797582e+00 - 15 -2.3373989937748721e-01 7.7706202291388324e+00 2.0010826243313318e+00 - 16 5.2778365701162542e+01 -6.8528234397569662e+01 1.3739513472082363e+01 - 17 -1.8300929035647204e+01 1.7606505158419548e+01 3.7169146794031612e+01 - 18 -6.3733187698960281e-01 4.7975693677488946e+00 -6.5669679631106268e+00 - 19 2.4125640650501561e+00 -8.7927656747981853e-01 5.4234306831688412e+00 - 20 -2.7249464934230132e+00 -3.8905661747529630e+00 3.4620659708669037e+00 - 21 -9.8190007373276114e+00 -9.2647198956789936e+00 3.5602652582750416e+01 - 22 -1.7981854995850391e+01 -5.1466303609713089e+00 -2.7099081350276776e+01 - 23 2.7159793746415861e+01 1.5032297555741883e+01 -7.6944152847992209e+00 - 24 1.1638937309868592e+01 -3.2222557388852941e+01 2.1229902851357355e+01 - 25 -2.9814598859424500e+01 3.4701185326760626e+00 -2.4986476479246740e+01 - 26 1.7326609064046309e+01 2.8422635043514923e+01 2.8030181117927224e+00 - 27 2.2655452453828886e+00 -3.4112828807137646e+01 1.0080954351469114e+01 - 28 -2.4164706734321207e+01 9.4961842418766675e+00 -1.5922743500852999e+01 - 29 2.2535479912998230e+01 2.4637922728071242e+01 5.7706056704399087e+00 + 1 -1.7606055793393171e+01 2.6643935099262779e+02 3.2393402010887354e+02 + 2 1.5276960494717764e+02 1.2310575703384730e+02 -1.8097793541016156e+02 + 3 -1.3352077573971147e+02 -3.7931683487102111e+02 -1.4290297422528761e+02 + 4 -7.9208304353082282e+00 2.1478481864988788e+00 -5.8261942086603211e+00 + 5 -3.0434387827624612e+00 -3.3598726165527566e+00 1.2036983538075097e+01 + 6 -8.0541310203093474e+02 9.1789616741207783e+02 1.0248072437178089e+03 + 7 5.5714036467952724e+01 -3.1034950575816862e+02 -1.5712583256521220e+03 + 8 1.3310123814282730e+02 -9.6223277979433377e+01 3.9089956606601993e+02 + 9 7.8393563724263217e+01 7.6654480508424001e+01 3.4092257442256783e+02 + 10 5.2097806632858817e+02 -5.9878504283496500e+02 -1.8147945456506989e+02 + 11 -3.2608027724119415e+00 -4.8310912973888067e+00 -1.0171689840917328e+01 + 12 2.0366715817043328e+01 1.0143836304830934e+01 -6.6252355441543065e+00 + 13 7.9792477260910202e+00 -3.1830821722479046e+00 -3.2639407011034843e-01 + 14 -4.4038656508124987e+00 1.0233587992910147e+00 -8.7296987337467264e+00 + 15 1.3134728922889097e-01 8.2983926079762504e+00 2.0214265339551494e+00 + 16 4.3411273981160394e+02 -3.1229241317770021e+02 -1.1118140840917993e+03 + 17 -4.2721348151894750e+02 3.0241477933278958e+02 1.1238198230533415e+03 + 18 2.9825165541799303e-01 4.7252817193329726e+00 -7.8005504652810282e+00 + 19 2.0270309050263218e+00 -7.0026441756918356e-01 5.5352981991292163e+00 + 20 -2.8987680088461030e+00 -3.9676699587294721e+00 4.0698743299353559e+00 + 21 -6.8659983985932712e+01 -7.5471945897983176e+01 2.1302638174453821e+02 + 22 -1.0464806958302354e+02 -2.6524424425698260e+01 -1.6069125397667364e+02 + 23 1.7288775729997960e+02 1.0241542469963436e+02 -5.1825288429969127e+01 + 24 3.6620120726235598e+01 -2.0126062686016724e+02 1.0765566655466355e+02 + 25 -1.4622307462281736e+02 2.0851513204518042e+01 -1.2215084349640854e+02 + 26 1.0903604505607386e+02 1.8015249320354400e+02 1.3874328113432986e+01 + 27 4.8838567422422287e+01 -2.1313383578292778e+02 8.5043163212886967e+01 + 28 -1.7278626932978099e+02 7.1874768952726413e+01 -1.1608934721076707e+02 + 29 1.2434418493475097e+02 1.4125643509243335e+02 3.1022920325900511e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2.yaml b/unittest/force-styles/tests/mol-pair-lj_class2.yaml index 4a2071cc1..dfded5210 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:14 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -55,38 +55,38 @@ init_forces: ! |2 27 1.9470947395789979e+00 -9.4718634154663608e+00 3.6661077043913615e+00 28 -7.3682981937517198e+00 3.1669679119534848e+00 -4.9856163529580284e+00 29 5.4261127187922513e+00 6.3089559593072444e+00 1.3167924699154427e+00 -run_vdwl: 30.7669719012008 +run_vdwl: 33.5535584108716 run_coul: 0 run_stress: ! |2- - 7.9136207567186872e+01 7.9607828632355080e+01 1.3325422686754521e+02 -2.0777385917448161e+01 5.9532528005971104e+00 1.8364492129715465e+01 + 8.2178916463120643e+01 8.3101853054825369e+01 1.5253160065343116e+02 -2.2684668843204484e+01 4.9830146128102255e+00 1.9995112924898351e+01 run_forces: ! |2 - 1 -3.0497501573125252e-01 1.0618884929485422e+01 1.1985335137681993e+01 - 2 5.5914775661602887e+00 4.6672725010623743e+00 -6.3782649181997000e+00 - 3 -5.1539740455000098e+00 -1.4169374038983115e+01 -5.5868989094487311e+00 - 4 -7.4084134872265817e-01 1.8442220456228106e-01 -5.4070380104616300e-01 - 5 -2.4055992934632561e-01 -4.0240824953711490e-01 1.1018577587985452e+00 - 6 -2.3966860047827822e+01 2.6398105337726218e+01 2.2540423441721142e+01 - 7 1.1991100726533528e+00 -7.8865425633173629e+00 -4.0080781415567408e+01 - 8 1.5842617494081925e+00 -1.2906817188189366e+00 1.2069062683547472e+01 - 9 2.6462037191310377e+00 2.7370054642440187e+00 1.1582644249513473e+01 - 10 1.7299174137393255e+01 -2.0337215459882643e+01 -6.0819871239265693e+00 - 11 -2.0303480091074094e-01 -5.0919542096542936e-01 -8.2780579347021477e-01 - 12 1.1617019581474322e+00 4.8411818632811876e-01 -5.2487935491213744e-01 - 13 7.7361539799575219e-01 -2.9115330606278883e-01 -1.2533320559757886e-02 - 14 -2.9866530388551099e-01 5.0616451980998303e-02 -7.7740274746494575e-01 - 15 -2.6051512700693891e-02 8.5891312860075553e-01 3.1584057101408997e-01 - 16 1.2711812406259678e+01 -9.5689969445870382e+00 -3.1116191951116210e+01 - 17 -1.2010675400189923e+01 8.4765600996061856e+00 3.2319577182902201e+01 - 18 -1.4213632800113502e-02 -2.4307342400779700e-02 2.0957577983657830e-02 - 19 3.0779951763449883e-04 7.2352271761717487e-05 5.9991789595708711e-04 - 20 -4.8462904187052895e-04 -4.8982048890138202e-04 8.9625077392507858e-05 - 21 -2.9622283962573377e+00 -3.1221222453351363e+00 9.1341353960748304e+00 - 22 -4.5299641026963622e+00 -1.1743778906978988e+00 -6.8836224637708687e+00 - 23 7.4864560471413979e+00 4.3029192689006752e+00 -2.2442900804965058e+00 - 24 2.3322774672668420e+00 -9.3014753803047725e+00 5.3981635963693648e+00 - 25 -7.2502178738417475e+00 1.0183468318460600e+00 -6.1201641268829992e+00 - 26 4.9114412822313289e+00 8.2770456627739026e+00 7.0954321463934678e-01 - 27 2.0659693003689581e+00 -9.2344924913591395e+00 3.4348341169410710e+00 - 28 -7.2688609354523379e+00 3.0962987387988594e+00 -4.8237251142338300e+00 - 29 5.2077980712295622e+00 6.1422517145534217e+00 1.3861866509355112e+00 + 1 -7.2028355945649480e-01 1.1036549345644323e+01 1.3157243617301344e+01 + 2 6.2093310988605763e+00 5.1196766529404618e+00 -7.2813480706568106e+00 + 3 -5.2293300740619584e+00 -1.5116479750108223e+01 -5.9209169039558960e+00 + 4 -7.7618515472930638e-01 1.9667841841257760e-01 -5.5451181336240807e-01 + 5 -2.5006105409056872e-01 -4.1663873050592765e-01 1.1358987907979552e+00 + 6 -2.6624626203592950e+01 2.9861540361823693e+01 3.0527545110834630e+01 + 7 1.3052302825638467e+00 -9.4624984132129661e+00 -5.0192244037044020e+01 + 8 3.0891327626963356e+00 -2.6310455642542521e+00 1.3084432187441275e+01 + 9 2.9098330482182133e+00 3.1257033352499906e+00 1.2874569513155064e+01 + 10 1.7996486933927695e+01 -2.1155657220543489e+01 -6.1259079404840344e+00 + 11 -2.1725888811295199e-01 -5.6177052090214696e-01 -9.0825143496418992e-01 + 12 1.1665969664226503e+00 5.0471072166941133e-01 -4.3331505242688978e-01 + 13 8.0639630627499503e-01 -3.1793111587656048e-01 -1.4753250225777290e-02 + 14 -3.2779372179727351e-01 6.6432087506937590e-02 -8.5563614458572157e-01 + 15 -1.1251102741667329e-02 8.5090888940413900e-01 2.9786217570029622e-01 + 16 1.4569217024149671e+01 -1.0709121613330563e+01 -3.5959796379479897e+01 + 17 -1.3873793122551177e+01 9.6293305117690657e+00 3.7156476780961249e+01 + 18 -1.4193755176748280e-02 -2.4295184465282348e-02 2.0939414445256748e-02 + 19 3.5311531721400992e-04 1.1014273739151982e-04 6.0258710234401046e-04 + 20 -5.4171383128375807e-04 -5.3829164384553579e-04 8.5454641935657814e-05 + 21 -2.9348404035675384e+00 -3.3629708681255250e+00 9.5082011225205783e+00 + 22 -4.5796721637134112e+00 -1.1179745792018687e+00 -7.1600877071354123e+00 + 23 7.5088182456340435e+00 4.4873035922750368e+00 -2.3419437904030640e+00 + 24 1.7350669904393381e+00 -8.9101894582033481e+00 4.8541316198522777e+00 + 25 -6.4355930032282149e+00 1.0216155540922900e+00 -5.4123600303272603e+00 + 26 4.6940518952166315e+00 7.8824915761811472e+00 5.4579976094828442e-01 + 27 1.9819335744719364e+00 -9.5203132550551288e+00 3.6747442671572164e+00 + 28 -7.4224378958873913e+00 3.1858170630334715e+00 -5.0121244255220603e+00 + 29 5.4454135723457959e+00 6.3385563126891906e+00 1.3346645777137225e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut.yaml index cebacf753..719e42f49 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 -9.0044476570438503e-01 1.6400956777130575e+00 -7.5912971444220345e-01 28 -2.5218777861769843e+00 -2.1240703931003635e+00 -9.0472621239313922e-01 29 4.1625007105019449e+00 1.3702046178964156e-01 2.2389851490745278e+00 -run_vdwl: 31.2868390409629 -run_coul: -133.427833092137 +run_vdwl: 33.5589655379567 +run_coul: -127.545695939556 run_stress: ! |2- - 5.2160863497586838e+01 3.2834169266753790e+01 7.8345659555157752e+01 -2.3242356168151407e+01 -1.4004724841548939e+00 2.2290503453930789e+01 + 5.5270252973268654e+01 3.9931680555834149e+01 9.5114369967849470e+01 -2.3535631988638428e+01 -2.9991612450934029e+00 2.2985558038048861e+01 run_forces: ! |2 - 1 1.9130321536845847e+00 1.0491269009708587e+01 1.2503341841064177e+01 - 2 5.6280699831696763e+00 1.9367298426226680e+00 -8.1463622317215911e+00 - 3 -5.1580935290817420e+00 -1.4240619621467227e+01 -5.5570945689037181e+00 - 4 -6.8886659848921994e-01 1.9679312352460565e-01 -8.5820819628727285e-01 - 5 -6.3501172331105471e-01 3.0367622972631625e-01 1.0242836391806447e+00 - 6 -2.2208670273705508e+01 2.2938288171208598e+01 2.0216995266675436e+01 - 7 9.4487346951683215e-01 -7.2831528464181554e+00 -3.7061880535496442e+01 - 8 2.9749106764019256e-01 2.6138512102222942e+00 1.4566249733696596e+01 - 9 4.5159581074344981e+00 -3.1333510544460834e+00 1.3442553266536963e+01 - 10 1.6854473237872167e+01 -1.9760977747635575e+01 -6.2576778167669520e+00 - 11 -1.2025064120867381e+00 6.3542551190177599e-01 -1.3698434249415565e+00 - 12 4.4691908221339443e+00 -2.7137917605663620e-01 7.9340701872256003e-01 - 13 3.8862946681639782e-01 -3.0833565273236963e-01 -3.6184372164797779e-02 - 14 -1.5525114098302235e+00 5.0980666943060238e-01 -7.8757083267495898e-01 - 15 2.0063413660118906e-01 6.6664589059323442e-01 -6.8577497014364763e-01 - 16 1.1884837140172593e+01 -1.0137880267624070e+01 -2.8966733946137431e+01 - 17 -1.4646951573106861e+01 1.4913260945855075e+01 2.5104716479256638e+01 - 18 8.0088184640572546e-01 6.2265501811392632e+00 -9.4571311351534462e+00 - 19 2.0320703699600453e+00 -1.3422525066507403e+00 5.7807903463178958e+00 - 20 -3.4116704061770506e+00 -3.0736433749535874e+00 3.7369185994062657e+00 - 21 -6.1785135121508095e-01 -2.1361379279700072e+00 -5.8512325773982921e-01 - 22 -3.1079050108257031e+00 5.2267767623570771e-02 -6.3096546369324424e-01 - 23 3.2197653339401491e+00 8.1427197627467363e-01 1.7445305639017428e+00 - 24 -2.6081380163823903e-01 -1.7484835327317955e-02 3.1670977349077774e+00 - 25 -3.7492709025608604e+00 -1.9481729171821436e+00 -2.2234300833216647e+00 - 26 3.0982077610249736e+00 1.1107881198386880e+00 1.8861108337241206e-01 - 27 -6.6952755589313262e-01 1.3618652860121270e+00 -4.8437698234111803e-01 - 28 -2.5908703586073316e+00 -1.3834301314475286e+00 -1.3848962189197769e+00 - 29 4.2524060101557897e+00 2.6532812422936525e-01 2.2237584633683567e+00 + 1 1.5218837333978088e+00 1.0978650420608972e+01 1.3589864325566593e+01 + 2 6.5117731776906389e+00 2.9431743449732375e+00 -9.1618158590824130e+00 + 3 -5.2447971244973903e+00 -1.5202864438841178e+01 -5.8905365397959200e+00 + 4 -7.2366908436779365e-01 2.0680864864524393e-01 -8.6421588850498710e-01 + 5 -6.4814393168216333e-01 2.8878282637659569e-01 1.0569164965030304e+00 + 6 -2.4615271603046352e+01 2.6121078400674190e+01 2.7566317214071994e+01 + 7 9.7893583729237355e-01 -8.7185228108006250e+00 -4.6315825016328610e+01 + 8 1.3932902626222305e+00 1.5435855454193703e+00 1.5517912125203926e+01 + 9 4.7356656468115039e+00 -2.5531112327016094e+00 1.4532339545297882e+01 + 10 1.7700797635608353e+01 -2.0729135671769559e+01 -6.3300223005420175e+00 + 11 -1.2059908028726922e+00 5.6754957963584651e-01 -1.4473280261186678e+00 + 12 4.4773161129531136e+00 -2.5943670561629695e-01 8.4149730989914229e-01 + 13 4.2310559883419946e-01 -3.3041221471598614e-01 -2.4301740090833052e-02 + 14 -1.5571015955708161e+00 5.1505787687795535e-01 -8.7064840129357779e-01 + 15 2.1111150472481885e-01 6.8535942633920621e-01 -6.7163957727469092e-01 + 16 1.3518998095233263e+01 -1.1078105550266086e+01 -3.3171041676006915e+01 + 17 -1.6222214694751603e+01 1.5690931597053465e+01 2.9393489395952585e+01 + 18 1.2143075157140271e+00 6.6045613463894259e+00 -9.8478394411558856e+00 + 19 1.6551919484771718e+00 -1.6302334206064237e+00 5.6685129104669034e+00 + 20 -3.4410557604364014e+00 -3.1601500124933306e+00 4.2030918388059497e+00 + 21 -4.3742352139367285e-01 -1.9076725666404504e+00 -9.8222396666838185e-01 + 22 -3.0606188468747182e+00 -2.3939354905786470e-02 -4.2014021553851411e-01 + 23 2.9944250342612340e+00 6.7345470007497521e-01 1.9275610055207339e+00 + 24 -7.0741070923281479e-01 9.7059040047286804e-01 2.4790354103647321e+00 + 25 -2.8204037722816402e+00 -2.0800215310774455e+00 -1.4359798914889759e+00 + 26 2.6085264662904235e+00 2.3137161762434111e-01 8.3247959405553185e-02 + 27 -8.8089347575820520e-01 1.6000655510138135e+00 -7.2977290173747711e-01 + 28 -2.5640863698008176e+00 -2.1081339992410646e+00 -9.3804997872928686e-01 + 29 4.1837527226559299e+00 1.6071722749634887e-01 2.2415958832981269e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml index 8e2c0e3e5..0ba6aa760 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:23:57 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -57,38 +57,38 @@ init_forces: ! |2 27 -2.8153635630686236e-01 6.4443404010992456e-01 -3.0459961833196159e-01 28 1.6087710176599712e-01 -4.2329027587759382e-01 1.9390264301028309e-01 29 2.3361353867664425e-01 -2.7922358027060867e-01 2.0657270027457103e-01 -run_vdwl: -0.0279409051337663 -run_coul: -17.8524160178072 +run_vdwl: -0.027955336404486 +run_coul: -16.9161102196865 run_stress: ! |- - -1.4291891053500811e+00 -4.7726937336417867e+00 -5.7887863563427944e+00 4.8239023891542065e-01 -4.2708193312429249e-01 3.1857255955017738e-01 + -1.2609422845016363e+00 -4.0968951390172528e+00 -5.7617307980358792e+00 7.9602111013010879e-01 -5.0064987959633445e-01 9.5505298242496761e-02 run_forces: ! |2 - 1 1.3698045557692529e-01 -1.2653483822273043e-01 2.9204846991156019e-01 - 2 1.8899632255844270e-01 -2.7138082755827064e-01 -4.7308644826518781e-01 - 3 -5.4658571168653136e-04 -5.2433212171929255e-03 7.1525916086689310e-03 - 4 4.5093813701484742e-03 -5.6467411572141100e-03 -5.2414314790801469e-02 - 5 -5.7062361978861303e-02 7.3862111311376571e-02 -1.0864397490678114e-02 - 6 1.6405697733198579e-01 -3.6641315088054893e-01 -1.3406203920934517e-01 - 7 -2.0630213458580807e-02 3.0720287290657594e-02 2.8346481082220043e-01 - 8 -2.1052323546453777e-01 4.4082735810137930e-01 6.7289207681595853e-02 - 9 2.7654530198393618e-01 -6.5186716940524470e-01 4.9234424978060892e-01 - 10 -2.7286871885132555e-02 2.9149989879862042e-02 -3.0254912036148041e-02 - 11 -1.2705593446949909e-01 1.4860516951130073e-01 -6.2694459702265143e-02 - 12 4.5027781712835890e-01 -1.1004603422341599e-01 1.9604733869615679e-01 - 13 -3.5426864572901326e-02 -2.1365847533075039e-02 4.2996964539162956e-03 - 14 -1.6370959204290966e-01 5.7022288370350574e-02 -2.8945034317939218e-02 - 15 3.2369823106643429e-02 2.7196628107690191e-03 -1.2380653441133911e-01 - 16 -6.3417186454514385e-02 -1.0919492310531859e-01 8.1738272452588134e-02 - 17 -4.2181264882891739e-01 8.9448506895663094e-01 -8.0783672503109427e-01 - 18 1.4058089795576939e-01 7.1643723138047699e-01 -4.6383066879808843e-01 - 19 -1.1070418519442088e-01 -4.4039431386058453e-01 2.4858835314022704e-01 - 20 -1.0225717618341726e-01 2.7839100846041194e-02 1.7205514308984293e-01 - 21 9.4693223912728219e-02 -2.0663484146899153e-01 -5.4533175309275717e-01 - 22 -7.6376677283854139e-02 1.7209997110498060e-01 3.1141478757022478e-01 - 23 -9.2778477816302385e-02 -1.8428237909243911e-01 3.0991369137436953e-01 - 24 -1.6499083071028064e-01 5.3960511982550485e-01 2.2352204481494231e-01 - 25 2.5345593993470028e-02 -2.4336206855244683e-01 1.1694349525743708e-01 - 26 6.7425350744113426e-03 -4.3015751098937594e-01 -1.3335175295659357e-01 - 27 -2.9047808261004182e-01 6.4842554326535384e-01 -2.8849125540639670e-01 - 28 2.1009072477591795e-01 -3.2730215032810456e-01 1.5241918713982527e-01 - 29 2.3386786989712011e-01 -2.8197278505973034e-01 1.9572895571446983e-01 + 1 1.3605459605719827e-01 -1.2446734577735225e-01 2.9019787654283430e-01 + 2 2.4029535066869884e-01 -1.7365846381710656e-01 -5.0797114128542675e-01 + 3 -5.1049264876689392e-04 -4.9371731084387263e-03 7.1270188627942464e-03 + 4 3.0453418732254260e-03 -5.6861253470872550e-03 -5.1336873648742641e-02 + 5 -5.7707774894234461e-02 7.3426479196150321e-02 -9.3913625692251812e-03 + 6 1.6764032928855199e-01 -3.7164392489833686e-01 -1.3372466224007140e-01 + 7 -2.3076886553018205e-02 3.6926093318032080e-02 2.8843365950239086e-01 + 8 -2.1931539371878953e-01 4.4332748877376182e-01 6.1138549046804824e-02 + 9 2.7956574428582875e-01 -6.4442108944447174e-01 4.8988779252013070e-01 + 10 -2.6707010759133898e-02 2.9123009132626099e-02 -2.8798244809747915e-02 + 11 -1.2683919279463718e-01 1.4739691716653991e-01 -6.3253703457377825e-02 + 12 4.4901552374031273e-01 -1.1072176754439710e-01 1.9221580291673152e-01 + 13 -3.4053249344444314e-02 -2.1089084654258447e-02 5.5137426790866986e-03 + 14 -1.6304184506196379e-01 5.6014790918673216e-02 -2.9942707347839739e-02 + 15 3.0903843417421556e-02 4.9002866597820521e-03 -1.2009769743866971e-01 + 16 -6.1336255122220164e-02 -1.0907759581135976e-01 8.7094277785786656e-02 + 17 -4.2165699049275651e-01 8.8368753584754389e-01 -8.0784129154525697e-01 + 18 1.4881193514966992e-01 7.2270230290313064e-01 -4.8761312511439431e-01 + 19 -1.2961610432663978e-01 -4.5153920118819718e-01 2.4255346209553874e-01 + 20 -9.4017458660485220e-02 3.0705842832758352e-02 1.9816638300390577e-01 + 21 9.2582730635039384e-02 -1.8328271252290529e-01 -5.5694683848225601e-01 + 22 -8.8680840226768892e-02 1.5557583034072803e-01 3.1395987295688915e-01 + 23 -7.8939310878633984e-02 -1.8810142503919575e-01 3.1992842870295524e-01 + 24 -1.5894957725563566e-01 5.4280801304418314e-01 2.2649680703310326e-01 + 25 1.4438143438505580e-02 -2.4893789362595167e-01 1.0736620487770498e-01 + 26 9.3537606243441901e-03 -4.3089256796610448e-01 -1.2881703152395971e-01 + 27 -2.8242487752570622e-01 6.4488852437667243e-01 -3.0301363524952424e-01 + 28 1.6149988723792774e-01 -4.2348872909516361e-01 1.9315320978483302e-01 + 29 2.3366607384711091e-01 -2.7953801467025652e-01 2.0551522640100245e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long.yaml index 941a0a520..0fdcc79f5 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 -7.3960092505173103e-02 5.6121962052620200e-01 -1.2623171994937926e-02 28 -3.0389823738199273e+00 -1.0653678498230301e+00 -1.4404928569144864e+00 29 3.5044276800389929e+00 4.9934304480946157e-01 1.4320880409749164e+00 -run_vdwl: 31.2381433071159 -run_coul: 225.412871184765 +run_vdwl: 33.5584908485278 +run_coul: 225.776975154965 run_stress: ! |2- - 5.6896514006631762e+01 3.7173465325544029e+01 9.7159008229697733e+01 -1.6133914451166369e+01 -7.0922237643763986e-01 2.7432388946646739e+01 + 5.9318588735059329e+01 4.0244979361299769e+01 1.1385148389618509e+02 -1.8219393739254063e+01 -1.6182598333884533e+00 2.9608183451995330e+01 run_forces: ! |2 - 1 2.3348605295201672e+00 1.0142046773937388e+01 1.2410304554033228e+01 - 2 5.3854024994557568e+00 1.8452830191268854e+00 -7.8277742280632774e+00 - 3 -5.1336173303440660e+00 -1.4242689749191451e+01 -5.5751677380204576e+00 - 4 -8.2102817084144253e-01 2.0615382505613863e-01 -7.8499961561366249e-01 - 5 -7.7390536294205103e-01 2.6338645353977519e-01 1.0379094880359461e+00 - 6 -2.2730870504929236e+01 2.2808460489222242e+01 2.0636187161011485e+01 - 7 1.1874699093697643e+00 -7.1383195947324927e+00 -3.7141842793024807e+01 - 8 4.3220196238266717e-01 2.9468242278111538e+00 1.4430743651522047e+01 - 9 4.3310853842238952e+00 -3.2580642382714080e+00 1.3255802548072870e+01 - 10 1.6897840757640495e+01 -1.9825758472541157e+01 -6.2807985316950852e+00 - 11 -1.1100055705857286e+00 5.2961534232305096e-01 -1.3863091956394025e+00 - 12 4.0138545074514766e+00 1.2103538956258330e-02 9.2259023757384206e-01 - 13 6.9654478100503092e-01 -3.0679535123882018e-01 -1.9611444921608789e-01 - 14 -1.3754928028906186e+00 4.1774693288584369e-01 -8.5891802067653411e-01 - 15 3.3410360278628798e-01 6.3248882976618159e-01 -7.2000218625576307e-01 - 16 1.2178717557993828e+01 -1.0262106940173862e+01 -2.9695114929831281e+01 - 17 -1.4693440170455304e+01 1.4997008153066593e+01 2.6083838365348520e+01 - 18 -1.4169170461658745e-01 4.3050988892641655e+00 -7.5496312433287525e+00 - 19 2.4111368864615441e+00 -3.9616736355716953e-01 5.7001920720700241e+00 - 20 -2.8437737383500137e+00 -3.8485060831143305e+00 3.6485590471016058e+00 - 21 -1.2055629257991081e+00 8.4549910672859385e-01 8.7127633964992357e-01 - 22 -2.7625456607861936e+00 -1.6281285733989832e+00 -1.3611493410358015e+00 - 23 3.5523099674618441e+00 1.1896098913840625e+00 9.9530574245822168e-01 - 24 5.8789159698526861e-01 -5.8672006822472145e-01 4.7931789577687473e-01 - 25 -4.2330541256871985e+00 -1.8106870297915438e+00 -2.7235083534683291e+00 - 26 3.0930920272963029e+00 2.1640862482998395e+00 1.6554065451725886e+00 - 27 9.8000321445767480e-02 3.1717009594636858e-01 1.6000098084133127e-01 - 28 -3.3090586506998938e+00 -9.4859126037912489e-01 -1.6430264529876857e+00 - 29 3.5995344274473520e+00 6.2995290730052034e-01 1.4569224501884304e+00 + 1 1.9941646520688603e+00 1.0650001111738824e+01 1.3472051479002717e+01 + 2 5.9615076425210614e+00 2.2287491162447290e+00 -8.6067164614053944e+00 + 3 -5.2156667388003450e+00 -1.5200519052056094e+01 -5.9060200708927910e+00 + 4 -8.5650436107369099e-01 2.1467510409040411e-01 -7.9643008168326868e-01 + 5 -7.8974894616090630e-01 2.4731465609131867e-01 1.0659815525207901e+00 + 6 -2.5131719092763134e+01 2.5986004456043354e+01 2.7977617336897133e+01 + 7 1.2247745676622082e+00 -8.5762902655880655e+00 -4.6394310300065797e+01 + 8 1.5323213476365918e+00 1.8970818965524396e+00 1.5452205095931522e+01 + 9 4.5345703100894657e+00 -2.6917358278091936e+00 1.4300902982648179e+01 + 10 1.7751633956484774e+01 -2.0801063206076051e+01 -6.3615030075467622e+00 + 11 -1.1181098224972963e+00 4.6613023649926072e-01 -1.4706091768613045e+00 + 12 4.0270612608364429e+00 2.3684500392069780e-02 9.9716912687026860e-01 + 13 7.3183930418433285e-01 -3.2693992290552504e-01 -1.9251595960656570e-01 + 14 -1.3828544642765703e+00 4.2419649936973408e-01 -9.5062932775510733e-01 + 15 3.4465608141073084e-01 6.4862579098336737e-01 -7.1576983327244104e-01 + 16 1.3835904005843481e+01 -1.1223158301986283e+01 -3.4044781093059456e+01 + 17 -1.6299825748922206e+01 1.5810516301711402e+01 3.0515418580502313e+01 + 18 3.0832233074837695e-01 4.7246555235828671e+00 -7.8245234183564589e+00 + 19 2.0279506081565981e+00 -6.9090924789479047e-01 5.5369632704108218e+00 + 20 -2.8995632514558789e+00 -3.9660219347832681e+00 4.0720710007864964e+00 + 21 -1.0267877148131421e+00 9.8688955714871940e-01 6.0940926520888228e-01 + 22 -2.7453786980597368e+00 -1.6688613594729969e+00 -1.2405509073130643e+00 + 23 3.3590108143963895e+00 1.0931721612916427e+00 1.1322562704143213e+00 + 24 1.4320578901161379e-01 2.7113686311916746e-01 -1.8390919078376983e-01 + 25 -3.3473478572100261e+00 -1.9092726980599062e+00 -1.9684520815016238e+00 + 26 2.6462745491768236e+00 1.3871221756504548e+00 1.5458941852989594e+00 + 27 -5.3627644744666303e-02 5.2237681664744506e-01 1.0640909123091596e-02 + 28 -3.0812294185151559e+00 -1.0503958866061964e+00 -1.4703168679243717e+00 + 29 3.5251665390650051e+00 5.2283493608118259e-01 1.4384567224127209e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_cs.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_cs.yaml index 0bff88fe3..a8a65171f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -60,38 +60,38 @@ init_forces: ! |2 27 -7.3956339548580607e-02 5.6119573772282538e-01 -1.2614534707879488e-02 28 -3.0389983162164067e+00 -1.0653596341201383e+00 -1.4405040256236372e+00 29 3.5044395390014174e+00 4.9935845947163410e-01 1.4320906963269642e+00 -run_vdwl: 31.2381419059821 -run_coul: 225.413015359955 +run_vdwl: 33.5584908346898 +run_coul: 225.777117217651 run_stress: ! |2- - 5.6896590400211338e+01 3.7173499334623791e+01 9.7159066081383997e+01 -1.6133877216977108e+01 -7.0920330109520702e-01 2.7432392749257392e+01 + 5.9318667074017746e+01 4.0245015104909228e+01 1.1385154821050502e+02 -1.8219355680157076e+01 -1.6182417814766263e+00 2.9608185646082884e+01 run_forces: ! |2 - 1 2.3348566333130436e+00 1.0142044198151781e+01 1.2410308896131927e+01 - 2 5.3854058046523328e+00 1.8452831155308445e+00 -7.8277784020314387e+00 - 3 -5.1336172548799937e+00 -1.4242689973069051e+01 -5.5751679487439052e+00 - 4 -8.2102836546169466e-01 2.0615417982373091e-01 -7.8499951575799864e-01 - 5 -7.7390552835051585e-01 2.6338677944515620e-01 1.0379095660600777e+00 - 6 -2.2730871263899576e+01 2.2808460851952216e+01 2.0636190788282317e+01 - 7 1.1874708636258040e+00 -7.1383197940716157e+00 -3.7141844715665570e+01 - 8 4.3219908399699947e-01 2.9468231475212887e+00 1.4430737433643785e+01 - 9 4.3310879108096341e+00 -3.2580653053601236e+00 1.3255810727506868e+01 - 10 1.6897840978745428e+01 -1.9825758197202031e+01 -6.2807989313041137e+00 - 11 -1.1100054440836309e+00 5.2961582575432975e-01 -1.3863088481178798e+00 - 12 4.0138553914885282e+00 1.2103613576104934e-02 9.2258949797255330e-01 - 13 6.9654512587767936e-01 -3.0679610862897866e-01 -1.9611409737421698e-01 - 14 -1.3754926624971942e+00 4.1774647050779157e-01 -8.5891853484866398e-01 - 15 3.3410424028749808e-01 6.3248912722466388e-01 -7.2000185125721705e-01 - 16 1.2178718278311147e+01 -1.0262106917227845e+01 -2.9695117655312050e+01 - 17 -1.4693442481679391e+01 1.4997012209851640e+01 2.6083838109112630e+01 - 18 -1.4169097234769584e-01 4.3050941439650519e+00 -7.5496084664927023e+00 - 19 2.4111255289537885e+00 -3.9617439888299877e-01 5.7001772823780374e+00 - 20 -2.8437627769973974e+00 -3.8484943583890519e+00 3.6485507332946776e+00 - 21 -1.2055699697911366e+00 8.4549221969877975e-01 8.7129949249208072e-01 - 22 -2.7625549392040325e+00 -1.6281309404052826e+00 -1.3611660445042866e+00 - 23 3.5523263081162351e+00 1.1896192797783363e+00 9.9529928056375150e-01 - 24 5.8789709353680242e-01 -5.8674143230036202e-01 4.7932985747728679e-01 - 25 -4.2330688937209482e+00 -1.8106835808578736e+00 -2.7235211792428893e+00 - 26 3.0931015442504006e+00 2.1641043954489261e+00 1.6554074121764655e+00 - 27 9.8004112784295050e-02 3.1714728299075595e-01 1.6000877477690328e-01 - 28 -3.3090738320141488e+00 -9.4858344694546248e-01 -1.6430368537943576e+00 - 29 3.5995454861777372e+00 6.2996761211928543e-01 1.4569251925779336e+00 + 1 1.9941602087097641e+00 1.0649997963109637e+01 1.3472056406980780e+01 + 2 5.9615114305512460e+00 2.2287496080968507e+00 -8.6067212683682026e+00 + 3 -5.2156666443083157e+00 -1.5200519217685903e+01 -5.9060202452241262e+00 + 4 -8.5650455127455816e-01 2.1467546390696754e-01 -7.9642998462869019e-01 + 5 -7.8974911782305479e-01 2.4731498851118477e-01 1.0659816420167900e+00 + 6 -2.5131719836194566e+01 2.5986004972400142e+01 2.7977622454969691e+01 + 7 1.2247755542806396e+00 -8.5762906862726460e+00 -4.6394313747848578e+01 + 8 1.5323180567941888e+00 1.8970804897912579e+00 1.5452197404880309e+01 + 9 4.5345731386175538e+00 -2.6917363470642428e+00 1.4300912715237359e+01 + 10 1.7751634149353933e+01 -2.0801062945047608e+01 -6.3615034542389344e+00 + 11 -1.1181097065599637e+00 4.6613075139620197e-01 -1.4706088240615376e+00 + 12 4.0270621727575016e+00 2.3684572320209242e-02 9.9716845373161267e-01 + 13 7.3183967238738190e-01 -3.2694069602473830e-01 -1.9251560112042287e-01 + 14 -1.3828543360875107e+00 4.2419603728090227e-01 -9.5062989905369200e-01 + 15 3.4465672917130813e-01 6.4862607753711399e-01 -7.1576949509006160e-01 + 16 1.3835904994556945e+01 -1.1223158434418782e+01 -3.4044784629479537e+01 + 17 -1.6299828274462282e+01 1.5810520441268935e+01 3.0515419155087077e+01 + 18 3.0832107557679361e-01 4.7246488677057599e+00 -7.8245006219098245e+00 + 19 2.0279403921336332e+00 -6.9091532454520244e-01 5.5369494484977784e+00 + 20 -2.8995514300794785e+00 -3.9660092778897313e+00 4.0720616588453442e+00 + 21 -1.0267950250624465e+00 9.8688176676867434e-01 6.0943383979413734e-01 + 22 -2.7453883626992712e+00 -1.6688636316949119e+00 -1.2405686442485144e+00 + 23 3.3590278148667290e+00 1.0931823504643228e+00 1.1322494071641620e+00 + 24 1.4321074707070675e-01 2.7111493217902410e-01 -1.8389724926370074e-01 + 25 -3.3473623329628914e+00 -1.9092690161581232e+00 -1.9684646134125683e+00 + 26 2.6462843341392004e+00 1.3871406797554291e+00 1.5458948036527980e+00 + 27 -5.3623840508944975e-02 5.2235287903358041e-01 1.0649529317726225e-02 + 28 -3.0812454274213970e+00 -1.0503876519048128e+00 -1.4703280562059038e+00 + 29 3.5251784144771601e+00 5.2285038718050869e-01 1.4384594139786839e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml index 7f0100291..b18417ceb 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:25:25 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 -1.8097814888562413e-01 6.9820913337890733e-01 -2.6340710165001457e-01 28 1.7042543108693975e-01 -3.4356300367399606e-01 1.8420405608797991e-01 29 6.8969492557682449e-02 -3.5687123235543355e-01 7.6959216046372347e-02 -run_vdwl: -0.0279418173888648 -run_coul: 26.8201360341214 +run_vdwl: -0.0279553455281711 +run_coul: 26.9396548204497 run_stress: ! |- - -1.1474158179052636e+00 -4.5913254242436174e+00 -3.3846887285760752e+00 1.5415499440939435e+00 -3.4927879486424995e-01 1.2022024524829980e+00 + -1.1026962923291113e+00 -4.5860313379070510e+00 -3.4217830579049293e+00 1.5673542930346522e+00 -3.1379252211484654e-01 1.2305760388108615e+00 run_forces: ! |2 - 1 2.4785371424044841e-01 -1.7744585501409318e-01 2.2908622448585458e-01 - 2 1.1208574586184081e-01 -3.1728948196584505e-01 -3.8331129955499721e-01 - 3 3.8672958174749885e-03 -8.4638290562189036e-03 3.6804944393340226e-03 - 4 -1.4908210107554554e-02 9.1263670694041396e-04 -4.0582807546513638e-02 - 5 -7.9010469883058737e-02 7.8655044199497925e-02 -7.3456373321684771e-03 - 6 1.4210275150117604e-01 -4.4262469999273130e-01 -1.7622693840330184e-01 - 7 -7.3671818618165526e-03 8.0461163251868140e-02 3.5812783086127464e-01 - 8 -2.1486667164805373e-01 5.2760625595983124e-01 1.2123697649482454e-01 - 9 2.5120326346302924e-01 -6.9738854073180823e-01 4.2544264553181460e-01 - 10 -2.6981423578011067e-02 3.3823491926006359e-02 -3.9727627882606691e-02 - 11 -1.1971285966868087e-01 1.4299991947654064e-01 -7.3606567838715942e-02 - 12 3.9616115191218104e-01 -8.2973575600471777e-02 2.2840969062553673e-01 - 13 9.2089010152039304e-03 -1.4357807115272092e-02 -2.5374002351636657e-02 - 14 -1.4164933289091716e-01 4.7606633868259293e-02 -3.6053447515452981e-02 - 15 5.0466515663197861e-02 -7.5407233516649854e-03 -1.3717507875786389e-01 - 16 -4.9282386378155150e-02 -1.0120792510703974e-01 6.0585078104901109e-02 - 17 -4.0162649553783158e-01 8.9288816584113617e-01 -7.5654097850534352e-01 - 18 -6.2166126605120312e-03 4.8017772312820972e-01 -3.5714456173358294e-01 - 19 1.2477034771840437e-02 -2.6997050692373975e-01 3.6280081675592402e-01 - 20 -8.0743209253462581e-02 -1.9332415162158362e-01 2.4973921501054613e-01 - 21 5.1979772871987143e-02 3.6464922171365610e-01 -5.0824928062082519e-01 - 22 1.9787748090259981e-02 -1.1037985730200084e-01 3.2157468867319638e-01 - 23 -1.3498574986299636e-01 -1.9274302053604020e-01 2.6311576355618921e-01 - 24 -7.5570051489166040e-02 6.3995557872087350e-01 -3.3757635738253905e-01 - 25 2.9520715443940637e-02 -2.8218957231969999e-01 1.2674950009258862e-01 - 26 -3.0757842125759015e-02 -3.8997146868550769e-01 1.3123703696619110e-01 - 27 -1.8994396856382390e-01 7.0415663122604488e-01 -2.5223088765765900e-01 - 28 1.7757264890985036e-01 -3.4548880985210345e-01 1.7971077337889108e-01 - 29 6.9335205947368736e-02 -3.6053264084304387e-01 6.9648738106139821e-02 + 1 2.4850450536207871e-01 -1.7655785125203852e-01 2.3121033526961068e-01 + 2 1.1986579313335718e-01 -3.1635728172748850e-01 -3.8578261393735735e-01 + 3 3.9594855513948460e-03 -8.1191847775762827e-03 3.8749446600929880e-03 + 4 -1.6235031669405178e-02 8.6329633493965636e-04 -4.0154670644606406e-02 + 5 -8.0021004487115452e-02 7.8262890922548067e-02 -6.9369131447638505e-03 + 6 1.4510171562700402e-01 -4.4739015742889765e-01 -1.8305529994650566e-01 + 7 -1.0071873114787232e-02 8.4845491960648098e-02 3.6877711517259260e-01 + 8 -2.2242173766394432e-01 5.2967870115070137e-01 1.2153363676171534e-01 + 9 2.5308344207119454e-01 -6.9013911243858383e-01 4.1846588995512696e-01 + 10 -2.6701888159924202e-02 3.4135851111596630e-02 -3.9139254388951036e-02 + 11 -1.1988325009528257e-01 1.4252334786630158e-01 -7.5217636451565040e-02 + 12 3.9607125192235154e-01 -8.4378937807855409e-02 2.2829565344550662e-01 + 13 1.0490220717480375e-02 -1.3574638302506024e-02 -2.5462739690254404e-02 + 14 -1.4132627732561981e-01 4.6830196564326874e-02 -3.8123407503654706e-02 + 15 4.8767511500278207e-02 -5.3061472726927570e-03 -1.3474455425152584e-01 + 16 -4.9155178159854082e-02 -9.9537414749390540e-02 6.0703007352616419e-02 + 17 -3.9977849478277072e-01 8.8209053870131149e-01 -7.5070387664257465e-01 + 18 8.6861588927746487e-03 4.9445425634142198e-01 -3.7632733008203573e-01 + 19 -1.0241211944605519e-02 -2.8570100729006076e-01 3.5485621655315613e-01 + 20 -7.4095899133020227e-02 -1.9251926012482456e-01 2.7669095023693369e-01 + 21 4.8853576657922164e-02 3.8000471376514117e-01 -5.1345410988285123e-01 + 22 6.3254317305929276e-03 -1.2310120350700200e-01 3.2050271189958962e-01 + 23 -1.1906656325953678e-01 -1.9376706831254129e-01 2.7028662314589791e-01 + 24 -6.6059659487828437e-02 6.3714289758615628e-01 -3.3225072677187534e-01 + 25 1.6089263822735567e-02 -2.8542078733727022e-01 1.1338730786602649e-01 + 26 -2.8974609268342544e-02 -3.8668098379139088e-01 1.3504471354792696e-01 + 27 -1.8185757694740179e-01 6.9882652738878759e-01 -2.6230398358017365e-01 + 28 1.7107237935277819e-01 -3.4385420192164151e-01 1.8378306454668003e-01 + 29 6.9019519157496073e-02 -3.5725347165211990e-01 7.6244946505222636e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_table.yaml index d4c63c29c..3c31c1bde 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 -7.3960207868523087e-02 5.6121978624344637e-01 -1.2623365917105417e-02 28 -3.0389850853623903e+00 -1.0653687847256605e+00 -1.4404940729751226e+00 29 3.5044303034130113e+00 4.9934355407807918e-01 1.4320895467999217e+00 -run_vdwl: 31.2381431724517 -run_coul: 225.412906260833 +run_vdwl: 33.5584908471932 +run_coul: 225.777011309739 run_stress: ! |2- - 5.6896531807680304e+01 3.7173465326595945e+01 9.7159022446947844e+01 -1.6133908564612518e+01 -7.0921776866299557e-01 2.7432393219208787e+01 + 5.9318609074982867e+01 4.0244984094007023e+01 1.1385149722834394e+02 -1.8219387751229995e+01 -1.6182523439558310e+00 2.9608187931460801e+01 run_forces: ! |2 - 1 2.3348595354023018e+00 1.0142045860231777e+01 1.2410303990431604e+01 - 2 5.3854018883253918e+00 1.8452824764633970e+00 -7.8277729825216529e+00 - 3 -5.1336172096722965e+00 -1.4242689896419133e+01 -5.5751678811009775e+00 - 4 -8.2102810961665740e-01 2.0615438841366032e-01 -7.8499943824664320e-01 - 5 -7.7390518152710719e-01 2.6338742377392760e-01 1.0379097332157670e+00 - 6 -2.2730870563177618e+01 2.2808460871078690e+01 2.0636185552114778e+01 - 7 1.1874693891620132e+00 -7.1383192175945762e+00 -3.7141845193380348e+01 - 8 4.3220148775033085e-01 2.9468231439745201e+00 1.4430746640267813e+01 - 9 4.3310867073071542e+00 -3.2580646208569521e+00 1.3255804559456905e+01 - 10 1.6897840862268119e+01 -1.9825758076749004e+01 -6.2807990864728884e+00 - 11 -1.1100057039042242e+00 5.2961597974741659e-01 -1.3863091127744707e+00 - 12 4.0138548701163481e+00 1.2104049779693826e-02 9.2258920742353612e-01 - 13 6.9654488236339840e-01 -3.0679553519537062e-01 -1.9611430027392213e-01 - 14 -1.3754929746024402e+00 4.1774687626387502e-01 -8.5891783956736578e-01 - 15 3.3410364550238236e-01 6.3248848814539971e-01 -7.2000166400580579e-01 - 16 1.2178717933256884e+01 -1.0262107053831510e+01 -2.9695114738365589e+01 - 17 -1.4693440434456498e+01 1.4997009063389351e+01 2.6083837609521826e+01 - 18 -1.4169132015400324e-01 4.3050983921115087e+00 -7.5496321083737241e+00 - 19 2.4111350738390542e+00 -3.9616889824595419e-01 5.7001916852066596e+00 - 20 -2.8437717980191919e+00 -3.8485046392236315e+00 3.6485596548025629e+00 - 21 -1.2055633257768064e+00 8.4549978470435949e-01 8.7127670881309827e-01 - 22 -2.7625482218442610e+00 -1.6281302971057046e+00 -1.3611507882368714e+00 - 23 3.5523131127886032e+00 1.1896108813070840e+00 9.9530657328641114e-01 - 24 5.8789146609400433e-01 -5.8671979342468006e-01 4.7931688214845181e-01 - 25 -4.2330556542839410e+00 -1.8106883777470766e+00 -2.7235087940759017e+00 - 26 3.0930939227205014e+00 2.1640873850179121e+00 1.6554079727132640e+00 - 27 9.7999995930949768e-02 3.1717026013231997e-01 1.6000078590931424e-01 - 28 -3.3090612285603669e+00 -9.4859229563116987e-01 -1.6430276092035754e+00 - 29 3.5995369527679815e+00 6.2995337748987346e-01 1.4569239812877377e+00 + 1 1.9941631636975010e+00 1.0650000684935266e+01 1.3472050603168622e+01 + 2 5.9615069361026451e+00 2.2287481753133509e+00 -8.6067155317437365e+00 + 3 -5.2156666176542084e+00 -1.5200519141339001e+01 -5.9060201736048876e+00 + 4 -8.5650430266661115e-01 2.1467560402123012e-01 -7.9642990297995886e-01 + 5 -7.8974876621859913e-01 2.4731562242461655e-01 1.0659816952066479e+00 + 6 -2.5131719428898087e+01 2.5986004659684586e+01 2.7977615769396468e+01 + 7 1.2247737200447046e+00 -8.5762898753750427e+00 -4.6394312514102459e+01 + 8 1.5323210524330655e+00 1.8970809967615174e+00 1.5452207978927772e+01 + 9 4.5345717300282766e+00 -2.6917367916829367e+00 1.4300904699003521e+01 + 10 1.7751634044818271e+01 -2.0801062755734964e+01 -6.3615036674671828e+00 + 11 -1.1181099347755763e+00 4.6613095235213881e-01 -1.4706091348634840e+00 + 12 4.0270620167728017e+00 2.3684550739822206e-02 9.9716798664451156e-01 + 13 7.3183942204439101e-01 -3.2694006266497339e-01 -1.9251578553427381e-01 + 14 -1.3828548061558315e+00 4.2419625893105700e-01 -9.5062905509627738e-01 + 15 3.4465601517600214e-01 6.4862546146597011e-01 -7.1576927367010723e-01 + 16 1.3835904950234164e+01 -1.1223159094460197e+01 -3.4044781104235447e+01 + 17 -1.6299825697714304e+01 1.5810517258049423e+01 3.0515417686143010e+01 + 18 3.0832295055671816e-01 4.7246558311627709e+00 -7.8245245390966804e+00 + 19 2.0279486272993985e+00 -6.9091092406051247e-01 5.5369630920505433e+00 + 20 -2.8995611730878585e+00 -3.9660205695096002e+00 4.0720718152794246e+00 + 21 -1.0267884224934809e+00 9.8689036081831660e-01 6.0941024711925795e-01 + 22 -2.7453809513833103e+00 -1.6688629915181326e+00 -1.2405524426395249e+00 + 23 3.3590135638195915e+00 1.0931732197129398e+00 1.1322570891338859e+00 + 24 1.4320574915899606e-01 2.7113716516426656e-01 -1.8391002694607936e-01 + 25 -3.3473499296060023e+00 -1.9092738678449872e+00 -1.9684524669119252e+00 + 26 2.6462771458999281e+00 1.3871238044011456e+00 1.5458960140681610e+00 + 27 -5.3628000212604277e-02 5.2237692232631916e-01 1.0640734096643623e-02 + 28 -3.0812319702194437e+00 -1.0503967385745230e+00 -1.4703180316186621e+00 + 29 3.5251689129994657e+00 5.2283528450012740e-01 1.4384582402721926e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_table_cs.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_table_cs.yaml index 46d2259a5..6d4064039 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_coul_table_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_table_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -60,38 +60,38 @@ init_forces: ! |2 27 -7.3956233348773326e-02 5.6119583726967459e-01 -1.2614616590367472e-02 28 -3.0390030269285795e+00 -1.0653610742593265e+00 -1.4405062124128989e+00 29 3.5044442704594507e+00 4.9935979258551688e-01 1.4320929369109603e+00 -run_vdwl: 31.2381416233791 -run_coul: 225.413041476168 +run_vdwl: 33.55849083188 +run_coul: 225.777145298871 run_stress: ! |2- - 5.6896614628159512e+01 3.7173518202151804e+01 9.7159084598536126e+01 -1.6133871877221807e+01 -7.0918741228314364e-01 2.7432392765883961e+01 + 5.9318694590157293e+01 4.0245039362292594e+01 1.1385156765039514e+02 -1.8219350091906414e+01 -1.6182231844537791e+00 2.9608185748066493e+01 run_forces: ! |2 - 1 2.3348555411341776e+00 1.0142042562567646e+01 1.2410309216855408e+01 - 2 5.3854063528998513e+00 1.8452859185946684e+00 -7.8277781902932198e+00 - 3 -5.1336171659346643e+00 -1.4242689938886043e+01 -5.5751679487056318e+00 - 4 -8.2102815507046889e-01 2.0615440111282279e-01 -7.8499947088694932e-01 - 5 -7.7390519446930195e-01 2.6338740279841244e-01 1.0379097944765308e+00 - 6 -2.2730872146741220e+01 2.2808462882723045e+01 2.0636187691326448e+01 - 7 1.1874695294178468e+00 -7.1383198967138890e+00 -3.7141848371548640e+01 - 8 4.3220098704215798e-01 2.9468204353923264e+00 1.4430740167011162e+01 - 9 4.3310884343913729e+00 -3.2580629157945875e+00 1.3255812041445541e+01 - 10 1.6897841095501175e+01 -1.9825758466557129e+01 -6.2807993352147857e+00 - 11 -1.1100056574805355e+00 5.2961608826847029e-01 -1.3863089323843822e+00 - 12 4.0138544801751754e+00 1.2103523549538205e-02 9.2258962969886349e-01 - 13 6.9654558405505884e-01 -3.0679580178778626e-01 -1.9611431186169320e-01 - 14 -1.3754932288349184e+00 4.1774689547713656e-01 -8.5891852677578140e-01 - 15 3.3410360750315582e-01 6.3248923699472948e-01 -7.2000138834856453e-01 - 16 1.2178718931609737e+01 -1.0262107771688425e+01 -2.9695117391038831e+01 - 17 -1.4693441369260942e+01 1.4997009813765155e+01 2.6083840284019065e+01 - 18 -1.4169124860959650e-01 4.3050935024132722e+00 -7.5496080647892247e+00 - 19 2.4111218767664853e+00 -3.9617762638606974e-01 5.7001762151726556e+00 - 20 -2.8437589726904129e+00 -3.8484910588739081e+00 3.6485515218343094e+00 - 21 -1.2055699966124682e+00 8.4549242144649139e-01 8.7129927772266258e-01 - 22 -2.7625592456967643e+00 -1.6281331152574583e+00 -1.3611678524414454e+00 - 23 3.5523307839865463e+00 1.1896210891994561e+00 9.9530107758402098e-01 - 24 5.8789689042146498e-01 -5.8674116769391371e-01 4.7932935341413768e-01 - 25 -4.2330726332052198e+00 -1.8106861749774830e+00 -2.7235232798402587e+00 - 26 3.0931052642335088e+00 2.1641064482851808e+00 1.6554096297073766e+00 - 27 9.8003978911014089e-02 3.1714750202002984e-01 1.6000864705443718e-01 - 28 -3.3090784653337177e+00 -9.4858504896640816e-01 -1.6430389859433081e+00 - 29 3.5995501418915117e+00 6.2996885897472765e-01 1.4569275027501090e+00 + 1 1.9941583445500541e+00 1.0649996690661112e+01 1.3472056233511076e+01 + 2 5.9615117454681377e+00 2.2287521404759656e+00 -8.6067211725789026e+00 + 3 -5.2156665461235123e+00 -1.5200519105833209e+01 -5.9060201943564250e+00 + 4 -8.5650435136305259e-01 2.1467561761716761e-01 -7.9642993761578673e-01 + 5 -7.8974877912822949e-01 2.4731560255324003e-01 1.0659817610927536e+00 + 6 -2.5131721214349827e+01 2.5986006896085879e+01 2.7977619238514130e+01 + 7 1.2247738998688775e+00 -8.5762907982730994e+00 -4.6394317103246919e+01 + 8 1.5323204697282506e+00 1.8970776926872086e+00 1.5452200202313781e+01 + 9 4.5345737553907686e+00 -2.6917346214849411e+00 1.4300913650443380e+01 + 10 1.7751634160176028e+01 -2.0801063053683041e+01 -6.3615039161390463e+00 + 11 -1.1181098871154973e+00 4.6613107034408707e-01 -1.4706089412881032e+00 + 12 4.0270616042036114e+00 2.3684029991971927e-02 9.9716848274135450e-01 + 13 7.3184014521470775e-01 -3.2694034729675597e-01 -1.9251579896825166e-01 + 14 -1.3828550956903727e+00 4.2419631679791647e-01 -9.5062980566218691e-01 + 15 3.4465599411287540e-01 6.4862620898726508e-01 -7.1576900578883151e-01 + 16 1.3835906281530111e+01 -1.1223160024710380e+01 -3.4044784637788382e+01 + 17 -1.6299827029057823e+01 1.5810518188484121e+01 3.0515421219843752e+01 + 18 3.0832132803014145e-01 4.7246490491427302e+00 -7.8245009680307209e+00 + 19 2.0279366624321074e+00 -6.9091859982026804e-01 5.5369486354360218e+00 + 20 -2.8995475857688628e+00 -3.9660061116565428e+00 4.0720627011004176e+00 + 21 -1.0267953934370697e+00 9.8688206518157773e-01 6.0943433583458395e-01 + 22 -2.7453926384567495e+00 -1.6688658452486340e+00 -1.2405707132356283e+00 + 23 3.3590322218108639e+00 1.0931843691344434e+00 1.1322512710249235e+00 + 24 1.4321068546133889e-01 2.7111509919871768e-01 -1.8389748519619820e-01 + 25 -3.3473664463738184e+00 -1.9092712464570885e+00 -1.9684663561954765e+00 + 26 2.6462887262711479e+00 1.3871432488873980e+00 1.5458973615009040e+00 + 27 -5.3623975004379987e-02 5.2235291955679120e-01 1.0649466026253135e-02 + 28 -3.0812499785043896e+00 -1.0503890106081664e+00 -1.4703301915288831e+00 + 29 3.5251828961245724e+00 5.2285155928452565e-01 1.4384616682364129e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml index efcd2dc1c..55368adbb 100644 --- a/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:22:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 7.7740979900039434e-04 6.3935242647477069e-04 -4.2466184497333940e-04 28 8.3048734749811267e-05 3.1248528966866243e-05 3.0822826083793829e-05 29 -5.7532973042045847e-05 -2.7672412467805212e-06 -5.4275513300832731e-05 -run_vdwl: -0.0279415055756731 +run_vdwl: -0.0279553425114641 run_coul: 0 run_stress: ! |- - -2.3600292753029325e-02 -3.1234050931138665e-02 -1.9247707998720477e-02 3.4602601994415398e-03 4.7405330909736755e-03 3.7183453784611869e-03 + -2.3562497940688085e-02 -3.1203935875414219e-02 -1.9194579565053604e-02 3.4356817659739595e-03 4.7042319658996100e-03 3.7443202278747310e-03 run_forces: ! |2 - 1 2.9461191709398626e-03 -1.6186860870491483e-03 -5.1694945479188422e-04 - 2 3.7466792722222388e-05 -1.4468218886644094e-04 1.3966909511272580e-06 - 3 2.7812682065410350e-04 4.4590913552799971e-04 6.4297819899768952e-04 - 4 2.4050654370892218e-05 -8.0122099814915152e-05 -1.4106363870070515e-05 - 5 3.7711409385897576e-05 -8.6020820506596226e-05 -1.3836806910756170e-05 - 6 3.6161040572478685e-03 -1.7641009232103740e-03 -3.9803999549915939e-04 - 7 1.6483463512744548e-03 1.1735896532072284e-03 -7.4165852183726575e-04 - 8 -1.8112412873781628e-03 2.1293568387560796e-03 1.2020232557053414e-03 - 9 1.2165248590554398e-05 1.0314413172020949e-04 -2.9748405733251166e-05 - 10 -1.3878814217341794e-03 1.0879706557175700e-03 -1.5462313770384457e-03 - 11 -1.1037554785516019e-05 2.5021131368802229e-05 -6.3131363381438603e-05 - 12 -1.1725161490596422e-03 1.1384318353601138e-03 -3.8599172950790680e-04 - 13 -1.6975841674364453e-04 -4.6039739151595695e-05 4.7451253324091769e-05 - 14 -1.1134529086303964e-04 -4.8074818305833470e-06 1.3832458683156625e-04 - 15 -1.6952425285043099e-04 -4.2877320396484933e-05 -1.4773108759162220e-05 - 16 6.7683902185082333e-05 3.4097779564949937e-04 -6.7940593957424556e-04 - 17 -5.1814120369824670e-04 4.2027922253817785e-04 4.0213091794390996e-04 - 18 -2.1575585922524914e-03 -3.7329276272613015e-03 3.2518676518168339e-03 - 19 5.0502840332106572e-05 1.1303158602344533e-05 9.8730624731965594e-05 - 20 -7.9576904730036045e-05 -8.0665940949843258e-05 1.5122535874939930e-05 - 21 -9.1010799612846591e-04 1.0159537501040340e-03 9.8400919688341072e-04 - 22 7.0646668921940504e-05 4.8270837688354870e-05 4.5452488640379622e-05 - 23 -9.1426907720905685e-05 -2.4058421983277910e-05 -2.2344225963570847e-05 - 24 -9.4400600934426814e-04 -9.3196178272884574e-04 -1.8471362495367906e-03 - 25 2.5888590079299666e-05 1.0168705295242309e-06 -5.1182885649010081e-05 - 26 -8.3683807999153389e-05 -5.1555698330583508e-05 -5.7697602296658660e-05 - 27 7.7778199020865526e-04 6.3924465276693704e-04 -4.2417803977789494e-04 - 28 8.4537818527806631e-05 3.1881437318165007e-05 3.2032875559797422e-05 - 29 -5.9326520152563993e-05 -3.8449747750497481e-06 -5.5108207133542701e-05 + 1 2.9471966061947433e-03 -1.6248909026272094e-03 -5.2039716156328242e-04 + 2 4.0187637479818580e-05 -1.4289687563539088e-04 4.9482850159808653e-07 + 3 2.5963745685813428e-04 4.5937710622813340e-04 6.6524544280291192e-04 + 4 2.6176129904759341e-05 -8.0518066703836225e-05 -1.2483785872170527e-05 + 5 3.7622244556842598e-05 -8.4989972829161217e-05 -1.5359188863904940e-05 + 6 3.6102549297706696e-03 -1.7502462135889753e-03 -3.9056302919800894e-04 + 7 1.6450117828417700e-03 1.1595564134451342e-03 -7.5281575645849317e-04 + 8 -1.7902728661096611e-03 2.1105682760528700e-03 1.2022880862136171e-03 + 9 1.1530185695947092e-05 1.0182100394923798e-04 -2.8295814541630738e-05 + 10 -1.3844113621233770e-03 1.0807750228841407e-03 -1.5472769190117272e-03 + 11 -1.4741512710008569e-05 2.4558881616280292e-05 -6.4281635843125293e-05 + 12 -1.1642389246668535e-03 1.1491498128561361e-03 -3.8382511322574271e-04 + 13 -1.7019593437041518e-04 -4.4385833961518003e-05 4.6555155127893520e-05 + 14 -1.0930550011101614e-04 -1.8687046184492555e-06 1.4116191179091293e-04 + 15 -1.7082936549063895e-04 -5.0415606870236278e-05 -1.7614437674235132e-05 + 16 6.1748972937400451e-05 3.4689453514395084e-04 -6.8243201840703150e-04 + 17 -5.2529639428977549e-04 4.2531735700165738e-04 4.0280789213587075e-04 + 18 -2.1524445938444353e-03 -3.7269211354649776e-03 3.2411879918685534e-03 + 19 5.7733246409219178e-05 1.7485013447671341e-05 9.8972782585536170e-05 + 20 -8.8697013761046469e-05 -8.8390569258032394e-05 1.4491911410760020e-05 + 21 -9.0858497001571753e-04 1.0111002016753821e-03 9.8178060353890594e-04 + 22 7.2498213655366222e-05 4.9612572457372574e-05 4.6508094986019202e-05 + 23 -9.3209710242519604e-05 -2.5537936027392307e-05 -2.3590038538246392e-05 + 24 -9.4253447039346558e-04 -9.3191386445644440e-04 -1.8454879167823033e-03 + 25 2.2954124469444609e-05 -2.3188308737417029e-06 -5.3923891738891677e-05 + 26 -8.0721243764433391e-05 -4.8700516945959188e-05 -5.5119628002938598e-05 + 27 7.7744699246571150e-04 6.3934185640117033e-04 -4.2461355236803180e-04 + 28 8.3197280592727177e-05 3.1311457336335474e-05 3.0942515447824996e-05 + 29 -5.7711941939189852e-05 -2.8744806341488351e-06 -5.4357328320640147e-05 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cubic.yaml b/unittest/force-styles/tests/mol-pair-lj_cubic.yaml index 385074733..8faf4790e 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cubic.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cubic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 13:39:00 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 8.2825859209946024e+00 -3.6194570066818969e+01 1.4492694351988913e+01 28 -2.8773892796642542e+01 1.2366374307374247e+01 -1.9468877181285176e+01 29 2.0497044211022661e+01 2.3831279505404666e+01 4.9748677441078746e+00 -run_vdwl: 79.459582219472 +run_vdwl: 164.176727313193 run_coul: 0 run_stress: ! |2- - 2.8197379297818031e+02 3.0260558095059764e+02 3.8765574362116956e+02 -1.0905901632823100e+02 3.0930722299390514e+01 5.9721064287049053e+01 + 4.5696669905868288e+02 4.7904134871830234e+02 1.0582153129928076e+03 -2.0794233475912671e+02 -2.0206236780739086e+00 1.5948889983617320e+02 run_forces: ! |2 - 1 5.7364816733270043e+00 4.8826091245220319e+01 4.0484055230609655e+01 - 2 1.5152543625514337e+01 1.2330478535741458e+01 -1.7629500449007072e+01 - 3 -2.1945576997338240e+01 -5.9228685158029649e+01 -2.2165382878034098e+01 - 4 -5.5101442494614994e-01 1.6279902820586076e-01 -4.0083522160429147e-01 - 5 -1.6314686953713331e-01 -2.7035079466371192e-01 8.3673889091302278e-01 - 6 -1.0091977557231503e+02 9.9705750812750679e+01 2.7903332958229683e+01 - 7 2.3325576535716728e+00 -1.8741937876977101e+01 -9.8326617643256895e+01 - 8 7.4406947659069260e+00 -9.3083477405389781e-01 5.9587690755476338e+01 - 9 9.2198929941443168e+00 1.0023247338277198e+01 4.0746752969806359e+01 - 10 8.0632692845063744e+01 -9.0477073735512889e+01 -3.1328725861429071e+01 - 11 -2.1251972838611299e-01 -4.3086218339213173e-01 -7.4767276338663180e-01 - 12 1.6881949522637432e+00 6.7402869524616305e-01 -9.0424908298899653e-01 - 13 5.3581867495519786e-01 -2.0297962207577527e-01 -7.9144916257942836e-03 - 14 -2.1326514213286024e-01 3.2884447390125957e-02 -5.3175547144697932e-01 - 15 -3.5029703079029570e-02 6.0353442532597712e-01 2.3165386387703416e-01 - 16 3.1617401865739485e+01 -2.3194664672557987e+01 -8.0374807668659074e+01 - 17 -3.0297787034018821e+01 2.1146243292953393e+01 8.2614363246853188e+01 - 18 -1.6270158686193692e-02 -2.7332194137397819e-02 2.6134484038471462e-02 - 19 4.5449712778471369e-04 3.9472342243307532e-04 1.0871666744021695e-04 - 20 -4.5449712778471369e-04 -3.9472342243307532e-04 -1.0871666744021695e-04 - 21 -8.2830369813115379e+00 -8.8565148940098286e+00 2.6034439647522099e+01 - 22 -1.2775982418697025e+01 -3.2766248662529702e+00 -1.9601532969236267e+01 - 23 2.1059019400008562e+01 1.2133139760262798e+01 -6.4329066782858337e+00 - 24 7.2400848235609949e+00 -2.6724510040594957e+01 1.5960418840724049e+01 - 25 -2.1148553033910595e+01 3.1132710884148063e+00 -1.7903420226707137e+01 - 26 1.3900713253902822e+01 2.3607710307365942e+01 1.9310149243610120e+00 - 27 5.4940239114605429e+00 -2.6311053976203734e+01 9.5893098426576113e+00 - 28 -2.0254974355059364e+01 8.7487110559286130e+00 -1.3477284741487235e+01 - 29 1.4766811979998725e+01 1.7565534755378685e+01 3.8867004920868924e+00 + 1 9.2483453892728740e+00 7.5945844239974676e+01 6.1367289784738311e+01 + 2 2.2732852134554197e+01 1.8737493288759875e+01 -2.6669600068587577e+01 + 3 -3.1964986246503269e+01 -9.3734416340601200e+01 -3.4671255449722295e+01 + 4 -5.5001585694065913e-01 1.5070776418957152e-01 -3.9275226164990551e-01 + 5 -1.7969915375876547e-01 -3.0362292678324765e-01 8.6793365916706400e-01 + 6 -1.9796806590003533e+02 2.2990162655369829e+02 2.7501790745035373e+02 + 7 7.9109888171861886e+00 -7.6524641847864288e+01 -4.2032627555539375e+02 + 8 4.5992175211879918e+01 -1.9873148355500923e+01 1.3922798515578887e+02 + 9 1.1403303962503362e+01 1.2231165268449960e+01 5.0409090529604853e+01 + 10 1.3047784096912977e+02 -1.4556513307073578e+02 -4.4756481385998420e+01 + 11 -1.6346238349194633e-01 -4.0922088697872150e-01 -6.7303941060221573e-01 + 12 1.7689668574627495e+00 6.3166692380469824e-01 -8.3233385524693426e-01 + 13 5.6480104331071312e-01 -2.2395151872256039e-01 -9.5790993973179691e-03 + 14 -2.4030540495346994e-01 4.5179188229734012e-02 -6.0304369153488313e-01 + 15 -2.3220111317111478e-02 5.9408611078423390e-01 2.1676726911830960e-01 + 16 1.0963039832302356e+02 -7.7096357855469549e+01 -2.8842624961188653e+02 + 17 -1.0862142117090467e+02 7.5521002117836630e+01 2.9024023117219969e+02 + 18 -1.6565212275867415e-02 -2.7990268691876326e-02 2.6458602067006932e-02 + 19 7.1473709241289744e-04 6.1248437925700357e-04 1.7889258733572757e-04 + 20 -7.1473709241289744e-04 -6.1248437925700357e-04 -1.7889258733572757e-04 + 21 -1.1536904971247665e+01 -1.3021625993962397e+01 3.6108894191673429e+01 + 22 -1.7333879764643559e+01 -4.2314763344327275e+00 -2.7103019136756011e+01 + 23 2.8870784735891224e+01 1.7253102328395126e+01 -9.0058750549174214e+00 + 24 6.1437425316795213e+00 -3.4297207023632204e+01 1.8296742414004438e+01 + 25 -2.4276461284621075e+01 3.8560435260643189e+00 -2.0415720860228767e+01 + 26 1.8125049871956215e+01 3.0437790982988908e+01 2.1072387594169975e+00 + 27 8.4078124309265192e+00 -3.6323119973255714e+01 1.4505938075037919e+01 + 28 -2.8937319168272772e+01 1.2421253477627801e+01 -1.9540501416079319e+01 + 29 2.0535244350189391e+01 2.3904950625827414e+01 5.0332497948309163e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_cut.yaml index ab398f000..1a45b3d44 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -55,38 +55,38 @@ init_forces: ! |2 27 5.1810412832327984e+01 -2.2705468907750401e+02 9.0849153441059272e+01 28 -1.8041315533250560e+02 7.7534079082878250e+01 -1.2206962452216491e+02 29 1.2861063251415729e+02 1.4952718246094855e+02 3.1216040111076961e+01 -run_vdwl: 146.141845881934 +run_vdwl: 719.443455554292 run_coul: 0 run_stress: ! |2- - 6.2607996919539414e+02 6.7186287711451007e+02 4.8484814811319825e+02 -3.1994912366099993e+02 -2.8454570233694202e+01 1.2292177984785774e+02 + 2.1330157554553721e+03 2.1547730555430498e+03 4.3976512412988704e+03 -7.3873325485023690e+02 4.1743707190786367e+01 6.2788040986774604e+02 run_forces: ! |2 - 1 1.2964030360656510e+01 8.0892418867139781e+01 6.0323172149265375e+01 - 2 1.8550226580094343e+01 1.4016238769424406e+01 -2.2757523570742769e+01 - 3 -2.4823737467155107e+02 1.0508780361006465e+02 8.6172398279574821e+01 - 4 -8.6006926615992221e+00 3.1744204309217805e+00 -6.2092173142411182e+00 - 5 -1.7308376123424425e+00 -2.5575751812921999e+00 1.0273464092969368e+01 - 6 1.1683402508628048e+02 -9.8726787907693534e+01 -1.4208741286778547e+02 - 7 3.8041576193059332e+00 -1.0704953187717335e+01 -4.2399881156863238e+01 - 8 -1.9935816824605183e+01 1.9886802905972718e+01 5.5348113977772961e+01 - 9 1.1205804476066335e+01 1.3198927883119472e+01 4.9879830769414433e+01 - 10 6.4812481374149925e+01 -7.6374989222973383e+01 -7.5660087866976198e+01 - 11 -6.2988690058862247e+00 -8.0952570407173248e+00 -1.6391410857465811e+01 - 12 1.4369425068541616e+01 1.2193286964902716e+01 -8.2527851881139291e+00 - 13 7.3377072957109331e+00 -2.7955027646062254e+00 -1.0299065890019726e-01 - 14 -2.7952431407275968e+00 4.3888485898644758e-01 -7.1101001480669570e+00 - 15 -3.9779897755537197e-01 8.1106017384425098e+00 3.0711122406901890e+00 - 16 5.2787469706921414e+01 -6.7733540563012909e+01 1.5088305700997223e+01 - 17 -1.4633172233841803e+01 1.0014125744838747e+01 4.0800214574133925e+01 - 18 -1.8062200355604661e-02 -3.1579332593788222e-02 2.9610653727964883e-02 - 19 2.5526683623032693e-04 -2.4264459877787570e-04 1.6746263982979498e-03 - 20 -8.8300470444450951e-04 -9.1308555583455059e-04 3.5978615104468762e-04 - 21 -9.9360349613693106e+00 -1.2017930751810615e+01 3.8871035002640411e+01 - 22 -1.8317759630270601e+01 -4.4399932580014960e+00 -2.9440613848490948e+01 - 23 2.8242488499993318e+01 1.6470731119742439e+01 -9.4179957751083716e+00 - 24 1.2413321115135656e+01 -3.6423447910437126e+01 2.3794736840993508e+01 - 25 -3.0031404252373655e+01 5.3796471699550121e+00 -2.5778429463380107e+01 - 26 1.7604735840312014e+01 3.1032209060135433e+01 1.9586527866121384e+00 - 27 3.4725372932416243e+00 -3.8995305110569163e+01 1.1703189641257278e+01 - 28 -2.5472491016132231e+01 1.1754689301175528e+01 -1.7174778481945946e+01 - 29 2.2007774610068502e+01 2.7247229536758095e+01 5.4673560754821722e+00 + 1 -2.0299419744961853e+01 2.6686193379336862e+02 3.2358785871037435e+02 + 2 1.5298617928501707e+02 1.2596516341411088e+02 -1.7961292655320204e+02 + 3 -1.3353630670276337e+02 -3.7923748676909099e+02 -1.4291839777232494e+02 + 4 -7.8374717836014440e+00 2.1276610789788282e+00 -5.5845014473593908e+00 + 5 -2.5014258629959469e+00 -4.0250131424457525e+00 1.2103512372172734e+01 + 6 -8.0681466162480228e+02 9.2165651041424792e+02 1.0270802401119468e+03 + 7 5.5780302775854629e+01 -3.1117544157318957e+02 -1.5746997989225999e+03 + 8 1.3452983973683908e+02 -1.0064660034658631e+02 3.8851792520911869e+02 + 9 7.6746213900459267e+01 8.2501469902247322e+01 3.3944351209160590e+02 + 10 5.2128033526109800e+02 -5.9920098832868121e+02 -1.8126029871233908e+02 + 11 -2.3573118088794365e+00 -5.8616944553482790e+00 -9.6049808813641668e+00 + 12 1.7503975897697522e+01 1.0626930302269722e+01 -8.0603160114673909e+00 + 13 8.0530313324242417e+00 -3.1756495175042607e+00 -1.4618315691984202e-01 + 14 -3.3416065166863160e+00 6.6492606318663194e-01 -8.6345131440736740e+00 + 15 -2.2253843262483208e-01 8.5025661635305223e+00 3.0369735873547175e+00 + 16 4.3476329769010187e+02 -3.1171099668258086e+02 -1.1135222104230591e+03 + 17 -4.2469864617016134e+02 2.9615424659116564e+02 1.1302578406458213e+03 + 18 -1.8849988250623853e-02 -3.3371648038832503e-02 3.0986306282264790e-02 + 19 3.0940278115793517e-04 -2.4634536779368854e-04 1.7433360016754916e-03 + 20 -9.8648131231171901e-04 -1.0112587092668940e-03 3.6932949186791988e-04 + 21 -7.0490777148272102e+01 -7.9749189729874402e+01 2.2171013458550721e+02 + 22 -1.0638722739944252e+02 -2.5949513934649758e+01 -1.6645597092015180e+02 + 23 1.7686805727889882e+02 1.0571023691370021e+02 -5.5243362166860535e+01 + 24 3.8206035227327114e+01 -2.1022829679057392e+02 1.1260716393332923e+02 + 25 -1.4918888258035881e+02 2.3762162241718098e+01 -1.2549193847418988e+02 + 26 1.1097064525776703e+02 1.8645512086371158e+02 1.2861565481437625e+01 + 27 5.0800867695850584e+01 -2.2296598219372009e+02 8.8607407764830413e+01 + 28 -1.7694198509380672e+02 7.6029979926844589e+01 -1.1950523558040682e+02 + 29 1.2614900659680345e+02 1.4694257504728043e+02 3.0893400701043568e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut.yaml index 1fbeb6c96..9140d352d 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 4.8962873327044548e+01 -2.1594272998432456e+02 8.6423916022225754e+01 28 -1.7556673492493090e+02 7.2243040777824405e+01 -1.1798873438160003e+02 29 1.2734702050586698e+02 1.4335524696343094e+02 3.2138232790236046e+01 -run_vdwl: 147.040074247861 -run_coul: -127.747670332952 +run_vdwl: 719.583830971028 +run_coul: -127.405445776932 run_stress: ! |2- - 6.0353517979442461e+02 6.2447478504848948e+02 4.3791289213232773e+02 -3.1645327985666916e+02 -3.0029829817918461e+01 1.2366110043709419e+02 + 2.1066858851705115e+03 2.1118465406255077e+03 4.3411913895839261e+03 -7.3939091944008499e+02 3.4004195376224864e+01 6.3091830979292831e+02 run_forces: ! |2 - 1 1.4816259361577874e+01 7.9738869562670203e+01 6.1442738232730541e+01 - 2 1.9651626467903323e+01 1.2289294619079556e+01 -2.5586353509806141e+01 - 3 -2.4593644124097807e+02 1.0324855454274562e+02 8.5001206846979514e+01 - 4 -8.7489077305197966e+00 3.2824728394222484e+00 -6.5528799573062919e+00 - 5 -2.2204206882210045e+00 -1.8704582174988531e+00 1.0433415249486350e+01 - 6 1.1566141963558714e+02 -9.9315755376883999e+01 -1.4165908414891499e+02 - 7 4.0530470234906968e+00 -1.0452540107716739e+01 -4.1479250736990721e+01 - 8 -2.0168010454983431e+01 2.2738989716140548e+01 5.6628319680633581e+01 - 9 1.3835859550747433e+01 6.0277311554736261e+00 5.3337859370227775e+01 - 10 6.4066994216039774e+01 -7.5535414830831073e+01 -7.5482801528224059e+01 - 11 -7.4023563023183270e+00 -6.6466434385434114e+00 -1.6954367419722207e+01 - 12 1.7791559893799452e+01 1.1417548631540143e+01 -6.8410096003357665e+00 - 13 7.0142861949738426e+00 -2.7644703358745439e+00 -2.3054066305694912e-01 - 14 -4.3979315901951148e+00 8.9942305965266567e-01 -7.0797565928935784e+00 - 15 -3.6033012007078330e-01 7.7431258565450438e+00 2.0411497046102869e+00 - 16 5.2319713741321443e+01 -6.8429089937297093e+01 1.4574327949254149e+01 - 17 -1.8290390749253813e+01 1.7655927425392367e+01 3.5962602984966971e+01 - 18 1.7867918017204881e-01 7.0934616451774222e+00 -8.1844140157389447e+00 - 19 2.0601990795228655e+00 -2.0654591624016017e+00 5.3342092406989181e+00 - 20 -3.2420367636703245e+00 -3.2567435108459528e+00 3.4326643507650694e+00 - 21 -9.0117437110976208e+00 -1.2245002769510558e+01 3.4149930665027604e+01 - 22 -1.8574628130247383e+01 -3.4425614243623759e+00 -2.6438003631560957e+01 - 23 2.6836512900560486e+01 1.4678669844998341e+01 -6.8586294639912868e+00 - 24 1.0582726005225370e+01 -3.1420805532367773e+01 2.3645380201169598e+01 - 25 -2.9311971392394881e+01 3.1879553971926993e+00 -2.4340486203032285e+01 - 26 1.7484074968176976e+01 2.7212259853477590e+01 1.3601985482950725e+00 - 27 1.4388278299715864e+00 -3.2689045840403274e+01 9.3413561221835106e+00 - 28 -2.3474871411852092e+01 8.9025628034955400e+00 -1.5678527522469286e+01 - 29 2.3348254236732291e+01 2.4017143531533620e+01 6.6807458470145322e+00 + 1 -1.8063372888457248e+01 2.6678105157974818e+02 3.2402996659496131e+02 + 2 1.5330358878132770e+02 1.2380492573183011e+02 -1.8151333240831045e+02 + 3 -1.3354888458750841e+02 -3.7931758421613472e+02 -1.4288689198300239e+02 + 4 -7.7881294738604874e+00 2.1395223674591102e+00 -5.8946911989454955e+00 + 5 -2.9015406852050791e+00 -3.3190775898026192e+00 1.2028378256240142e+01 + 6 -8.0488836645146307e+02 9.1802995742119299e+02 1.0244105723213747e+03 + 7 5.5465464098325384e+01 -3.1049144836294226e+02 -1.5711951982951696e+03 + 8 1.3295630201259283e+02 -9.6566841410072513e+01 3.9097873770998279e+02 + 9 7.8594917898008077e+01 7.6787239841058849e+01 3.4114513938297250e+02 + 10 5.2093084324648896e+02 -5.9871672873400735e+02 -1.8144904377081838e+02 + 11 -3.3489474917396755e+00 -4.7299066233185947e+00 -1.0148722295617299e+01 + 12 2.0817110742449266e+01 9.8621648257347747e+00 -6.7801624603116055e+00 + 13 7.6705047262823136e+00 -3.1868508084474771e+00 -1.5820765158864744e-01 + 14 -4.5784791339277771e+00 1.1138053859274337e+00 -8.6502065803942223e+00 + 15 -2.0858633584574827e-03 8.3343285348201466e+00 2.0653788711429386e+00 + 16 4.3381545251296427e+02 -3.1216401817067458e+02 -1.1109936655779304e+03 + 17 -4.2715793345995348e+02 3.0231277750751610e+02 1.1227489093457698e+03 + 18 1.2031503105804986e+00 6.6109154534518462e+00 -9.8172457568052227e+00 + 19 1.6542029668604283e+00 -1.6435312455072308e+00 5.6634735273939238e+00 + 20 -3.4397850740453881e+00 -3.1640002543644230e+00 4.1983600848944107e+00 + 21 -6.8065143389991434e+01 -7.8373197315307209e+01 2.1145351307231158e+02 + 22 -1.0497867547894900e+02 -2.4878754055951781e+01 -1.5988825193627287e+02 + 23 1.7253265391442073e+02 1.0200255027683434e+02 -5.1030930144720486e+01 + 24 3.5759317049142027e+01 -2.0057869330513705e+02 1.1032116758762990e+02 + 25 -1.4570202505334191e+02 2.0679758861139810e+01 -1.2162181582102188e+02 + 26 1.0901408493572302e+02 1.7901652962808640e+02 1.2412680433322016e+01 + 27 4.8035906008231706e+01 -2.1205455927739035e+02 8.4315928367662238e+01 + 28 -1.7229331071416993e+02 7.0823300717627717e+01 -1.1557278511416141e+02 + 29 1.2500318054257448e+02 1.4088636323663022e+02 3.1828945439412077e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml index bf33642d4..d3039c6bc 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:15:05 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -57,38 +57,38 @@ init_forces: ! |2 27 -2.7476246020103456e-01 6.0493120625631469e-01 -2.9064786520929453e-01 28 1.4347513760734865e-01 -4.0704325460185131e-01 1.7976862032283397e-01 29 2.4405118264850023e-01 -2.5553143701616343e-01 2.0641926054763102e-01 -run_vdwl: 0.0864716901746354 -run_coul: -17.6587395670533 +run_vdwl: 0.0869352789338978 +run_coul: -16.7246300810242 run_stress: ! |- - -1.2310312129721028e+00 -4.5583725028040067e+00 -5.5364023232766897e+00 4.4511499980738989e-01 -3.8421601156790053e-01 2.7245801051758678e-01 + -1.0652447352865699e+00 -3.8829939850981972e+00 -5.5076420739725851e+00 7.5662871430955769e-01 -4.5956180716232609e-01 4.7459476145516044e-02 run_forces: ! |2 - 1 1.3377812535034600e-01 -1.0924552244195854e-01 3.0239582004374232e-01 - 2 1.9460749443182726e-01 -2.6531388283407620e-01 -4.7746130828464767e-01 - 3 -7.3347251089237678e-03 6.7726180164356786e-03 1.3105788420142546e-02 - 4 -2.4720968172563737e-03 -6.6869065041733379e-03 -5.7765308408484296e-02 - 5 -5.9754628828893659e-02 6.1630076614972391e-02 -2.7107215069287413e-03 - 6 1.6177650967868279e-01 -3.6344034648305823e-01 -1.2604556810786538e-01 - 7 -3.2239571524180818e-02 3.0913302936171783e-02 2.4534996491066566e-01 - 8 -2.2676583476715423e-01 4.3995105114930455e-01 6.3973199849776202e-02 - 9 2.7319683986147475e-01 -6.3675023590992430e-01 4.9490604677475736e-01 - 10 -2.4007119482593237e-02 2.7432938158340029e-02 -3.5492353767146795e-02 - 11 -1.2539511829806502e-01 1.4171637355869635e-01 -6.7569520102284536e-02 - 12 4.6905278568502473e-01 -1.0758310955374528e-01 1.8684895409281049e-01 - 13 -2.9697664050240720e-02 -2.4665398443543356e-02 5.0886376051148818e-03 - 14 -1.6454344876677607e-01 5.6073213873294614e-02 -3.4014308973892751e-02 - 15 3.1922038230522476e-02 9.8295314721195057e-03 -1.1966470952487746e-01 - 16 -5.2189856602250576e-02 -1.2154014338234553e-01 7.3781930151778169e-02 - 17 -4.1368004335324016e-01 8.7196340075264467e-01 -7.6220547504382663e-01 - 18 1.3959047510496031e-01 7.0273728786051104e-01 -4.2880450213821364e-01 - 19 -1.2073764490270647e-01 -4.4273905993924212e-01 2.2727648381069462e-01 - 20 -9.1024270602754434e-02 4.1820961074671939e-02 1.5737208729124524e-01 - 21 8.4018567420766091e-02 -2.1919260947637767e-01 -5.0638967445418503e-01 - 22 -8.4808406581946549e-02 1.7222319120223384e-01 2.8644210773617212e-01 - 23 -7.3803722181464818e-02 -1.7123414848426477e-01 2.9603622690956416e-01 - 24 -1.5687511678945418e-01 5.0269183876489443e-01 2.4272556319363958e-01 - 25 8.7949907645514802e-03 -2.3291170111515980e-01 9.9768489166636165e-02 - 26 1.5326708047237462e-02 -4.0392869905991208e-01 -1.3631522337860857e-01 - 27 -2.8313881941350294e-01 6.0861991277426597e-01 -2.7516392301985793e-01 - 28 1.9217325598129187e-01 -3.1106027014648929e-01 1.3846948667801418e-01 - 29 2.4423029751471897e-01 -2.5808366443428632e-01 1.9606181007606516e-01 + 1 1.3310895645616766e-01 -1.0681595049750980e-01 3.0085236253669118e-01 + 2 2.4571009670418076e-01 -1.6788907386249957e-01 -5.1245807586070902e-01 + 3 -7.5268518645741200e-03 7.1661146019244186e-03 1.3180907638251131e-02 + 4 -4.1289420040324203e-03 -6.8349678325925999e-03 -5.6781128366431670e-02 + 5 -6.0361311986348545e-02 6.1137403741571512e-02 -1.2526584296330828e-03 + 6 1.6514176179024320e-01 -3.6847402329884132e-01 -1.2552219958172284e-01 + 7 -3.4644099331851919e-02 3.7052524070668308e-02 2.4991081993821770e-01 + 8 -2.3495958648495197e-01 4.4247934431171310e-01 5.7839183696183349e-02 + 9 2.7616789375454981e-01 -6.2943393841818618e-01 4.9259580649859591e-01 + 10 -2.3415732327898876e-02 2.7246294408891134e-02 -3.4160986124308297e-02 + 11 -1.2511926093347320e-01 1.4047304783736411e-01 -6.8053216512128561e-02 + 12 4.6791162950936793e-01 -1.0820205078650559e-01 1.8310571378428026e-01 + 13 -2.8448024066891765e-02 -2.4513074229488261e-02 6.3150274798712547e-03 + 14 -1.6384348920571432e-01 5.5165978075921537e-02 -3.4925711302384588e-02 + 15 3.0327701075787250e-02 1.1856445436090129e-02 -1.1602653610775190e-01 + 16 -5.0098240129186532e-02 -1.2141351027157907e-01 7.9086098545887926e-02 + 17 -4.1364010237208132e-01 8.6134564660977198e-01 -7.6233422636254988e-01 + 18 1.4668186650437032e-01 7.0771571062364214e-01 -4.5142530425490018e-01 + 19 -1.3860405850507804e-01 -4.5292036846630285e-01 2.2148236716416778e-01 + 20 -8.2678142913861163e-02 4.5005019249796011e-02 1.8207031350080727e-01 + 21 8.2067553413077851e-02 -1.9663066117862987e-01 -5.1768001642114692e-01 + 22 -9.6408651946793114e-02 1.5632236616914591e-01 2.8900238102773318e-01 + 23 -6.0816579444908439e-02 -1.7491057988735531e-01 3.0569773374514952e-01 + 24 -1.5132057470587493e-01 5.0606666262523992e-01 2.4550239792309519e-01 + 25 -1.3775483042360315e-03 -2.3824387936460084e-01 9.0827766168260937e-02 + 26 1.7720935450783622e-02 -4.0504924971059914e-01 -1.3216838133552986e-01 + 27 -2.7559626433129880e-01 6.0535312818022313e-01 -2.8912347247958758e-01 + 28 1.4405444085303620e-01 -4.0722970446283180e-01 1.7903436961078445e-01 + 29 2.4409462534749074e-01 -2.5582465367444085e-01 2.0540866388080661e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_debye.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_debye.yaml index 160bb8a4a..b46030757 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_debye.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_debye.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 00:48:33 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 5.0678817618137757e+01 -2.1955868715215880e+02 8.8185424604605416e+01 28 -1.7648528302762318e+02 7.4689185913776114e+01 -1.1909838750514861e+02 29 1.2585627905014329e+02 1.4488602163099455e+02 3.0900117397816587e+01 -run_vdwl: 147.037481382738 -run_coul: -20.1396343068848 +run_vdwl: 719.558238411404 +run_coul: -26.0154865952564 run_stress: ! |2- - 6.1398311849820323e+02 6.5650378455092607e+02 4.7137690161054064e+02 -3.2151120852672523e+02 -2.9570968547778616e+01 1.2424694343279589e+02 + 2.1137295549845740e+03 2.1361119148624657e+03 4.3751903724677404e+03 -7.4447931599140713e+02 3.7119035795274364e+01 6.3036601258050814e+02 run_forces: ! |2 - 1 1.3656133179073334e+01 8.0616522225015075e+01 5.9787740302241787e+01 - 2 1.8262033273818670e+01 1.3821167826707487e+01 -2.2481138367950884e+01 - 3 -2.4696376905768912e+02 1.0400184139427286e+02 8.5553136859879714e+01 - 4 -8.6517952963319953e+00 3.2781731694128835e+00 -6.2006727512600381e+00 - 5 -1.8277213518969997e+00 -2.2560960623185209e+00 1.0356813604086874e+01 - 6 1.1608487236138744e+02 -9.8399758360108862e+01 -1.4233144177572672e+02 - 7 3.8113653005996682e+00 -1.0499207826060230e+01 -4.2018625863609152e+01 - 8 -1.9893408596978592e+01 2.0489771831848163e+01 5.6229297988676983e+01 - 9 1.1824584724858680e+01 1.1195851879728872e+01 5.0139753693178491e+01 - 10 6.4554997939405595e+01 -7.6012639785135818e+01 -7.5542376502726427e+01 - 11 -6.5748733588681647e+00 -7.7990959880951172e+00 -1.6575485595249791e+01 - 12 1.4948937065846792e+01 1.2042990120717016e+01 -8.1891280989530770e+00 - 13 7.1968271507898942e+00 -2.6556913166996550e+00 -1.6475347720452121e-01 - 14 -3.1471276485632989e+00 5.7382783420357153e-01 -6.9252291084669633e+00 - 15 -4.2751360019494283e-01 7.8775503859408849e+00 2.8504190622534749e+00 - 16 5.2517152292875338e+01 -6.7579893612621319e+01 1.5789380652455790e+01 - 17 -1.5010925963976343e+01 1.1385435455720447e+01 3.9487236133316003e+01 - 18 -1.6058487306952166e-01 1.8341667176067371e+00 -6.9227011741431905e+00 - 19 2.7669821917014534e+00 1.3639552565299315e+00 4.4799861516830930e+00 - 20 -2.8203542331384761e+00 -3.2814628693165981e+00 2.8519909470358940e+00 - 21 -9.0662706850320856e+00 -1.0832588571643534e+01 3.5533172888070368e+01 - 22 -1.7803051058649928e+01 -4.5676701546936922e+00 -2.7335747130829528e+01 - 23 2.6812396157412302e+01 1.5459928438900373e+01 -8.1258919568836152e+00 - 24 1.1683664199640521e+01 -3.3377687787214661e+01 2.2030233455002143e+01 - 25 -2.8943396971892735e+01 4.3197033192717331e+00 -2.4606011114273198e+01 - 26 1.7093642657859082e+01 2.8976406535796528e+01 2.3495982101517199e+00 - 27 2.9540767016519176e+00 -3.5544695703269284e+01 1.0562622773069535e+01 - 28 -2.4164991452937812e+01 1.0332761765377002e+01 -1.6088852658796529e+01 - 29 2.1288118952299396e+01 2.5236433880127677e+01 5.5066728549716784e+00 + 1 -1.8850116524500098e+01 2.6750398742112424e+02 3.2212002573979976e+02 + 2 1.5177360061305382e+02 1.2492177866697244e+02 -1.7828171233170880e+02 + 3 -1.3354376001550293e+02 -3.7929233320613139e+02 -1.4293015907103938e+02 + 4 -7.8044802371099902e+00 2.1873902616753824e+00 -5.5626647967726006e+00 + 5 -2.5447820905308132e+00 -3.7310172984064001e+00 1.2093419175179086e+01 + 6 -8.0575369834425612e+02 9.2008902885141470e+02 1.0249426222251068e+03 + 7 5.5598762670989785e+01 -3.1060243714926219e+02 -1.5727454565415762e+03 + 8 1.3414313518230159e+02 -9.9131838734727097e+01 3.9060855904162321e+02 + 9 7.6949311057526231e+01 8.0609160007446093e+01 3.3820996000893223e+02 + 10 5.2110664585053644e+02 -5.9890391923115692e+02 -1.8129626551646098e+02 + 11 -2.5870452266073940e+00 -5.6124899507838597e+00 -9.7593629835170717e+00 + 12 1.8056436851343982e+01 1.0548800793866546e+01 -7.9994173193010303e+00 + 13 7.8731456598044600e+00 -3.0486895711630533e+00 -1.8808283553085520e-01 + 14 -3.6053238735007667e+00 7.7543952321558740e-01 -8.4407687315842885e+00 + 15 -1.9197172854213437e-01 8.2857723981028961e+00 2.8053671394068060e+00 + 16 4.3407702010886265e+02 -3.1140636915906424e+02 -1.1111717737274280e+03 + 17 -4.2445761246541235e+02 2.9687831779167681e+02 1.1273900871563064e+03 + 18 2.7071116622471947e-01 2.1510347566976735e+00 -7.2327325768742892e+00 + 19 2.5093527201693968e+00 1.1850398357540333e+00 4.3796572749698033e+00 + 20 -2.9248560906269887e+00 -3.4084027814117608e+00 3.1667276400919597e+00 + 21 -6.8491974236243891e+01 -7.7189426947567725e+01 2.1441037806339691e+02 + 22 -1.0442564919386164e+02 -2.5839826591224636e+01 -1.6155990536680312e+02 + 23 1.7287948336468713e+02 1.0307202571208197e+02 -5.2804454362505375e+01 + 24 3.6645942918971727e+01 -2.0356418786519046e+02 1.0875801445224408e+02 + 25 -1.4567525590900686e+02 2.2079344144901555e+01 -1.2215075308742135e+02 + 26 1.0892295493864584e+02 1.8142725689301699e+02 1.3251595476695716e+01 + 27 4.9709716266438022e+01 -2.1564520174942828e+02 8.6032564716874248e+01 + 28 -1.7315799247679203e+02 7.3247576468195362e+01 -1.1663895046825905e+02 + 29 1.2349829904293837e+02 1.4241418670937597e+02 3.0593481606155571e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_dsf.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_dsf.yaml index 734c3d08f..7560b3a2d 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_dsf.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_dsf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 00:52:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -54,38 +54,38 @@ init_forces: ! |2 27 4.9510151487508807e+01 -2.1610573882407331e+02 8.6754624199142910e+01 28 -1.7591376903728431e+02 7.2834345714474324e+01 -1.1830263576328773e+02 29 1.2681873017384437e+02 1.4324062272686339e+02 3.1536002792748356e+01 -run_vdwl: 147.008060446671 -run_coul: -110.026726248646 +run_vdwl: 719.578470973931 +run_coul: -116.176575988872 run_stress: ! |2- - 6.0820780927891394e+02 6.2909366518094589e+02 4.5592745072763000e+02 -3.0875653496511961e+02 -2.9254620305019234e+01 1.3119770070557351e+02 + 2.1100746518878036e+03 2.1107555585308155e+03 4.3576864807684560e+03 -7.3346402806051049e+02 3.5650252706810363e+01 6.3830265269970880e+02 run_forces: ! |2 - 1 1.5134473114100514e+01 7.9297375288186558e+01 6.1698262280418547e+01 - 2 1.9492353335707506e+01 1.2180224387103351e+01 -2.5467933105054531e+01 - 3 -2.4608896877947512e+02 1.0335292833233845e+02 8.5076026047718685e+01 - 4 -8.8270143737980895e+00 3.3293325207604409e+00 -6.5208673798885481e+00 - 5 -2.3322397786389115e+00 -1.8342325065262206e+00 1.0393567860829311e+01 - 6 1.1541029697740895e+02 -9.9127814712810391e+01 -1.4177223344434583e+02 - 7 4.1974993705709425e+00 -1.0742404842162358e+01 -4.1304879342671640e+01 - 8 -2.0077233371171015e+01 2.2552627740809307e+01 5.6805752978480058e+01 - 9 1.3672700264225048e+01 6.2632211758933467e+00 5.3086665987173134e+01 - 10 6.4044904525894978e+01 -7.5494440377997009e+01 -7.5591655350112489e+01 - 11 -7.3602635664814038e+00 -6.8054310848539128e+00 -1.7159096031151137e+01 - 12 1.7518728056100517e+01 1.1390706161715798e+01 -6.5432337738239106e+00 - 13 7.2750817186047101e+00 -2.6817325061683714e+00 -4.3336909964440545e-01 - 14 -4.2823789423712100e+00 9.0575384542264037e-01 -7.1761774369663138e+00 - 15 -2.8162090674887824e-01 7.8029123227039587e+00 1.9463933868866656e+00 - 16 5.2669772525281886e+01 -6.8368610583394442e+01 1.3871320318988881e+01 - 17 -1.8329251167834933e+01 1.7480034704749944e+01 3.6736048055583765e+01 - 18 -4.8101459939687513e-01 5.6390181965229216e+00 -7.0115511912932771e+00 - 19 2.3578384879920895e+00 -1.3232181252999953e+00 5.7361264856213143e+00 - 20 -2.8026159459670557e+00 -4.2259620416431369e+00 3.7472616397975669e+00 - 21 -9.8227228644506184e+00 -8.7706594518178385e+00 3.5182632283387818e+01 - 22 -1.8061043512597657e+01 -5.3220336438674192e+00 -2.6849515155237750e+01 - 23 2.7161077168088735e+01 1.4826995938586842e+01 -7.4311155016693373e+00 - 24 1.1514028586814977e+01 -3.1384307041140335e+01 2.0791376280617694e+01 - 25 -2.9773910254299999e+01 3.0778136679510091e+00 -2.4785715622181414e+01 - 26 1.7398251997633054e+01 2.8016682306841474e+01 3.0305957884268930e+00 - 27 1.9298037775719799e+00 -3.3193477501971017e+01 9.6773389871286284e+00 - 28 -2.4055552109743736e+01 8.9967277703321518e+00 -1.5744714093244385e+01 - 29 2.2799020266979589e+01 2.4161970059734259e+01 6.0126881462259378e+00 + 1 -1.7792943521603757e+01 2.6645383700140468e+02 3.2415190435541945e+02 + 2 1.5286883868316676e+02 1.2296846286073968e+02 -1.8114053589113064e+02 + 3 -1.3353303667047959e+02 -3.7932127560091612e+02 -1.4288769241509985e+02 + 4 -7.8648923847153336e+00 2.1600891709552585e+00 -5.8828397496457923e+00 + 5 -2.9924327926263268e+00 -3.3181575539341637e+00 1.2004984196958844e+01 + 6 -8.0516135562547504e+02 9.1811763217639532e+02 1.0243121852538879e+03 + 7 5.5548346485856172e+01 -3.1055074438124672e+02 -1.5709575521364955e+03 + 8 1.3302690720451216e+02 -9.6537932766893448e+01 3.9123529933167828e+02 + 9 7.8496448257293210e+01 7.6820771104982541e+01 3.4089495453485119e+02 + 10 5.2096254066550057e+02 -5.9873665722031797e+02 -1.8151441488403566e+02 + 11 -3.2944836199221044e+00 -4.7602869260775034e+00 -1.0228555012766925e+01 + 12 2.0535133555358616e+01 9.9206723764397573e+00 -6.4859111412492352e+00 + 13 7.9387898050424734e+00 -3.1289615766720895e+00 -3.5165446967719338e-01 + 14 -4.4754430059415409e+00 1.0950679976166948e+00 -8.7570953500120154e+00 + 15 8.1260159017173345e-02 8.3506372305181618e+00 1.9746664614772871e+00 + 16 4.3406904005597522e+02 -3.1216923732439295e+02 -1.1116703913324768e+03 + 17 -4.2724408635938352e+02 3.0229240300737462e+02 1.1234521841141011e+03 + 18 4.9279954524318048e-01 5.4406617345792103e+00 -8.4163463868920090e+00 + 19 1.9590466935465241e+00 -1.0685999486340458e+00 5.9340123510746583e+00 + 20 -2.9819491617818641e+00 -4.2620518685975046e+00 4.4168296896446133e+00 + 21 -6.8652572149544426e+01 -7.5004248297031765e+01 2.1256293189182577e+02 + 22 -1.0467906369326084e+02 -2.6690867948355478e+01 -1.6042220261752567e+02 + 23 1.7285011850367707e+02 1.0220098550771043e+02 -5.1568954068990031e+01 + 24 3.6532538332952150e+01 -2.0041090138728489e+02 1.0728220967098598e+02 + 25 -1.4614387843046578e+02 2.0479399667181145e+01 -1.2197335974204638e+02 + 26 1.0903689626523267e+02 1.7969056899230262e+02 1.4047991060510757e+01 + 27 4.8563635867741269e+01 -2.1222540040242961e+02 8.4634115875972114e+01 + 28 -1.7262678142482110e+02 7.1410598177394959e+01 -1.1587548847711145e+02 + 29 1.2448057875990584e+02 1.4078353619718939e+02 3.1228724886766766e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long.yaml index 33bb3bbe2..b4981269c 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9789358000243809e+01 -2.1702160604151146e+02 8.7170422564672961e+01 28 -1.7608383951257380e+02 7.3301743321101739e+01 -1.1852450102612136e+02 29 1.2668894747540401e+02 1.4371756954645073e+02 3.1331335682136434e+01 -run_vdwl: 146.969932845685 -run_coul: 231.547223819221 +run_vdwl: 719.570991322032 +run_coul: 225.904237156271 run_stress: ! |2- - 6.0915003500707246e+02 6.3099734489395064e+02 4.5850631347176483e+02 -3.1002781778199568e+02 -2.9989785213832519e+01 1.3053414139517639e+02 + 2.1107014053468865e+03 2.1121563786867737e+03 4.3598688519011475e+03 -7.3407401306070096e+02 3.5367507798830353e+01 6.3752854031292122e+02 run_forces: ! |2 - 1 1.5318919850572806e+01 7.9282401393560946e+01 6.1573406079985290e+01 - 2 1.9396976103452584e+01 1.2345009578188996e+01 -2.5332936381019135e+01 - 3 -2.4626010838248081e+02 1.0353987453079894e+02 8.5144848064076527e+01 - 4 -8.8799790196154174e+00 3.3241582453182850e+00 -6.4497295145390607e+00 - 5 -2.3921298369027211e+00 -1.8640446027230397e+00 1.0409771237667691e+01 - 6 1.1514350774120550e+02 -9.9343273705726290e+01 -1.4128643713842419e+02 - 7 4.4121943913120507e+00 -1.0659283246845636e+01 -4.1672997953406181e+01 - 8 -1.9867783268323649e+01 2.2748959518230702e+01 5.6456512822888548e+01 - 9 1.3497118196591632e+01 6.1641778280888868e+00 5.3035388456119485e+01 - 10 6.4064118589590365e+01 -7.5531391512657578e+01 -7.5546937349480885e+01 - 11 -7.3191394313773790e+00 -6.8855181594816397e+00 -1.7097024407609748e+01 - 12 1.7332128235292799e+01 1.1587338382628545e+01 -6.6950974554233937e+00 - 13 7.3167736710828617e+00 -2.7360217555016577e+00 -4.0451132381702781e-01 - 14 -4.2029786654038359e+00 8.3858585765595739e-01 -7.1469688262826514e+00 - 15 -2.3374818519103110e-01 7.7706237191767702e+00 2.0011105405761827e+00 - 16 5.2778367300681317e+01 -6.8528214427924539e+01 1.3739542066296107e+01 - 17 -1.8300842492788746e+01 1.7606322050821845e+01 3.7169239078137288e+01 - 18 -6.3726923555038051e-01 4.7973251807363830e+00 -6.5668081899777073e+00 - 19 2.4125111059935511e+00 -8.7925981492705563e-01 5.4232992638105104e+00 - 20 -2.7248803445351588e+00 -3.8904686920602902e+00 3.4619755015532667e+00 - 21 -9.8190589026954900e+00 -9.2646568261250746e+00 3.5602732479020787e+01 - 22 -1.7981862279708128e+01 -5.1466131620539572e+00 -2.7099137281623833e+01 - 23 2.7159817699916164e+01 1.5032332828113882e+01 -7.6944563510728319e+00 - 24 1.1638953097463977e+01 -3.2222663983679347e+01 2.1229971509788882e+01 - 25 -2.9814603307050731e+01 3.4701648992084406e+00 -2.4986494993856635e+01 - 26 1.7326614420233987e+01 2.8422694630059919e+01 2.8029958169551819e+00 - 27 2.2656453938690255e+00 -3.4112795985711898e+01 1.0080919795658271e+01 - 28 -2.4164736062669249e+01 9.4962417865107938e+00 -1.5922775191014225e+01 - 29 2.2535473617034118e+01 2.4637995446318733e+01 5.7705996450135073e+00 + 1 -1.7606142793076749e+01 2.6643926307046581e+02 3.2393404572969047e+02 + 2 1.5276961014074985e+02 1.2310582522538586e+02 -1.8097790409337895e+02 + 3 -1.3352077650117798e+02 -3.7931683361579132e+02 -1.4290297478525997e+02 + 4 -7.9208285226142063e+00 2.1478471737321314e+00 -5.8261886321640270e+00 + 5 -3.0434261568568131e+00 -3.3598894212644921e+00 1.2036984946331104e+01 + 6 -8.0541313484802379e+02 9.1789625610950111e+02 1.0248072995522964e+03 + 7 5.5714037919441722e+01 -3.1034952601723677e+02 -1.5712584052219481e+03 + 8 1.3310127259258437e+02 -9.6223382357033117e+01 3.9089950651360147e+02 + 9 7.8393522942762402e+01 7.6654620259890507e+01 3.4092253732020578e+02 + 10 5.2097807328526937e+02 -5.9878505306906447e+02 -1.8147944863639378e+02 + 11 -3.2607811586788422e+00 -4.8311153825438842e+00 -1.0171675280728461e+01 + 12 2.0366619859559268e+01 1.0143826177861232e+01 -6.6252476933424669e+00 + 13 7.9792433546369628e+00 -3.1830852438863468e+00 -3.2638614914808783e-01 + 14 -4.4038447225257134e+00 1.0233467375694187e+00 -8.7296919912837012e+00 + 15 1.3133426132912757e-01 8.2983929635832361e+00 2.0214534374217288e+00 + 16 4.3411275526574292e+02 -3.1229239798358736e+02 -1.1118141251770460e+03 + 17 -4.2721342181191176e+02 3.0241462992285562e+02 1.1238199764275951e+03 + 18 2.9829381947885125e-01 4.7250405977390875e+00 -7.8003652237555299e+00 + 19 2.0269884088744856e+00 -7.0025053570314300e-01 5.5351648557651831e+00 + 20 -2.8987000898360979e+00 -3.9675724464585955e+00 4.0697706853489324e+00 + 21 -6.8660081449902577e+01 -7.5471920609481757e+01 2.1302658856042896e+02 + 22 -1.0464810880554202e+02 -2.6524409337682410e+01 -1.6069138969395593e+02 + 23 1.7288784900937006e+02 1.0241550235163950e+02 -5.1825370208042415e+01 + 24 3.6620155558030788e+01 -2.0126084711015025e+02 1.0765579249989915e+02 + 25 -1.4622314304154384e+02 2.0851583564250021e+01 -1.2215092193502841e+02 + 26 1.0903608867125941e+02 1.8015264098527939e+02 1.3874302220319249e+01 + 27 4.8838679617657306e+01 -2.1313393915077953e+02 8.5043184029612945e+01 + 28 -1.7278636365265947e+02 7.1874870944214777e+01 -1.1608942874009084e+02 + 29 1.2434422884760258e+02 1.4125657619669576e+02 3.1022916683050951e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_cs.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_cs.yaml index e3075004d..0cd8d0ce0 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:15 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9789361752827517e+01 -2.1702162992279213e+02 8.7170431201336527e+01 28 -1.7608385545374182e+02 7.3301751536276697e+01 -1.1852451219399934e+02 29 1.2668895933351085e+02 1.4371758496011822e+02 3.1331338337280808e+01 -run_vdwl: 146.969929538219 -run_coul: 231.547264708378 +run_vdwl: 719.570990985203 +run_coul: 225.904377274686 run_stress: ! |2- - 6.0915005812817071e+02 6.3099735259936688e+02 4.5850632798383162e+02 -3.1002780229416248e+02 -2.9989789593280726e+01 1.3053414712792963e+02 + 2.1107014816059227e+03 2.1121564133075194e+03 4.3598689136584017e+03 -7.3407397590385597e+02 3.5367525146098124e+01 6.3752854232069581e+02 run_forces: ! |2 - 1 1.5318919274287161e+01 7.9282402689767522e+01 6.1573406995103099e+01 - 2 1.9396975672712376e+01 1.2345006413759098e+01 -2.5332936418250078e+01 - 3 -2.4626010953940070e+02 1.0353987528938436e+02 8.5144848313417469e+01 - 4 -8.8799791960752703e+00 3.3241585635154105e+00 -6.4497294227693063e+00 - 5 -2.3921300208834291e+00 -1.8640442852709882e+00 1.0409771277454372e+01 - 6 1.1514350991129784e+02 -9.9343275643233497e+01 -1.4128643682471943e+02 - 7 4.4121956417521897e+00 -1.0659283249353107e+01 -4.1672995676673636e+01 - 8 -1.9867785591059242e+01 2.2748960676152095e+01 5.6456512758704058e+01 - 9 1.3497118516138364e+01 6.1641755893752510e+00 5.3035388445873195e+01 - 10 6.4064118711318343e+01 -7.5531390986309731e+01 -7.5546937595754869e+01 - 11 -7.3191391401304138e+00 -6.8855179514389633e+00 -1.7097024150430183e+01 - 12 1.7332128534369886e+01 1.1587338787527001e+01 -6.6950982284603437e+00 - 13 7.3167739546895616e+00 -2.7360226017305367e+00 -4.0451096791732105e-01 - 14 -4.2029784848341114e+00 8.3858532487319060e-01 -7.1469692881780098e+00 - 15 -2.3374757771468560e-01 7.7706239405600224e+00 2.0011108550611731e+00 - 16 5.2778367561845492e+01 -6.8528214293833656e+01 1.3739542340740513e+01 - 17 -1.8300843740178685e+01 1.7606325466806506e+01 3.7169235758254487e+01 - 18 -6.3726844859522769e-01 4.7973204031635337e+00 -6.5667855687451171e+00 - 19 2.4124997833840771e+00 -8.7926676388707059e-01 5.4232845317552982e+00 - 20 -2.7248694153143038e+00 -3.8904570058984658e+00 3.4619672230089416e+00 - 21 -9.8190604496526213e+00 -9.2646576803347855e+00 3.5602737459636401e+01 - 22 -1.7981862049227122e+01 -5.1466130088156756e+00 -2.7099140070738564e+01 - 23 2.7159819088592272e+01 1.5032333629456989e+01 -7.6944586308781631e+00 - 24 1.1638954275987080e+01 -3.2222667812651558e+01 2.1229973339134027e+01 - 25 -2.9814604043690224e+01 3.4701667034149346e+00 -2.4986496061386624e+01 - 26 1.7326614310426660e+01 2.8422696986266970e+01 2.8029951547009917e+00 - 27 2.2656455991073692e+00 -3.4112800647789015e+01 1.0080921171286972e+01 - 28 -2.4164736857777790e+01 9.4962437758555840e+00 -1.5922776145711470e+01 - 29 2.2535473718625141e+01 2.4637997690668584e+01 5.7705994264820708e+00 + 1 -1.7606147052368666e+01 2.6643926011968244e+02 3.2393405046567216e+02 + 2 1.5276961374094321e+02 1.2310582554779802e+02 -1.8097790868655164e+02 + 3 -1.3352077641123395e+02 -3.7931683379961038e+02 -1.4290297497058080e+02 + 4 -7.9208287117839342e+00 2.1478475327241595e+00 -5.8261885347151088e+00 + 5 -3.0434263281485183e+00 -3.3598890892245263e+00 1.2036985034729364e+01 + 6 -8.0541313566135284e+02 9.1789625659666649e+02 1.0248073040312925e+03 + 7 5.5714038902580512e+01 -3.1034952633146509e+02 -1.5712584080562649e+03 + 8 1.3310126950081738e+02 -9.6223383716278235e+01 3.9089949937485790e+02 + 9 7.8393525644334616e+01 7.6654619616252845e+01 3.4092254650665501e+02 + 10 5.2097807348430342e+02 -5.9878505280648403e+02 -1.8147944907383413e+02 + 11 -3.2607810397540566e+00 -4.8311148710922414e+00 -1.0171674927450505e+01 + 12 2.0366620763156142e+01 1.0143826254952790e+01 -6.6252483694791637e+00 + 13 7.9792437219814696e+00 -3.1830860186670313e+00 -3.2638579038233423e-01 + 14 -4.4038445941266335e+00 1.0233462744494963e+00 -8.7296925612823539e+00 + 15 1.3133490837501172e-01 8.2983932489527827e+00 2.0214537755076414e+00 + 16 4.3411275613476903e+02 -3.1229239803824976e+02 -1.1118141283595969e+03 + 17 -4.2721342420933951e+02 3.0241463397685948e+02 1.1238199766493274e+03 + 18 2.9829256496076040e-01 4.7250339409969158e+00 -7.8003424289494658e+00 + 19 2.0269781935277655e+00 -7.0025661070798384e-01 5.5351510338409824e+00 + 20 -2.8986882688581943e+00 -3.9675597902871531e+00 4.0697613437170741e+00 + 21 -6.8660088493324238e+01 -7.5471928107726896e+01 2.1302661236194893e+02 + 22 -1.0464811807717095e+02 -2.6524411510084470e+01 -1.6069140684586975e+02 + 23 1.7288786535060308e+02 1.0241551214854091e+02 -5.1825376884048268e+01 + 24 3.6620160422769324e+01 -2.0126086829670484e+02 1.0765580407356124e+02 + 25 -1.4622315700311762e+02 2.0851587182237804e+01 -1.2215093403990628e+02 + 26 1.0903609803638186e+02 1.8015265881022725e+02 1.3874302780623614e+01 + 27 4.8838683195701421e+01 -2.1313396232481796e+02 8.5043192317845737e+01 + 28 -1.7278637899039225e+02 7.1874878910423590e+01 -1.1608943948074774e+02 + 29 1.2434424027576669e+02 1.4125659115063533e+02 3.1022919260079941e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml index 55a6da404..772d8c6c3 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 15:56:55 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 7.5e-14 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 -1.7556081111367022e-01 6.6578706971019974e-01 -2.5207147463850749e-01 28 1.5472943489635349e-01 -3.3071284636771298e-01 1.7192732481352638e-01 29 7.9294229865242635e-02 -3.3696681975738607e-01 7.7692084065202061e-02 -run_vdwl: 0.0864714816774496 -run_coul: 26.3541936197395 +run_vdwl: 0.086935277212183 +run_coul: 26.4738674243055 run_stress: ! |- - -9.5943500509065494e-01 -4.3931838814803301e+00 -3.1566818906460279e+00 1.5039013339900946e+00 -3.0365435646198807e-01 1.1566928612390874e+00 + -9.1701350463041709e-01 -4.3876757420292520e+00 -3.1925937335520391e+00 1.5280501208185095e+00 -2.7013227375472720e-01 1.1831272134729816e+00 run_forces: ! |2 - 1 2.4523107562386903e-01 -1.6078569028728237e-01 2.3888244638374972e-01 - 2 1.1736624438051382e-01 -3.1162685052999267e-01 -3.8761966142324977e-01 - 3 -2.9397469229226845e-03 3.4449773659216186e-03 9.6382943011141982e-03 - 4 -2.1733581870825226e-02 9.5402178044510307e-05 -4.6004841478389714e-02 - 5 -8.1637510267219243e-02 6.6925991791127043e-02 8.5173798023068827e-04 - 6 1.4189806429437651e-01 -4.4079142217864081e-01 -1.7282595371707801e-01 - 7 -2.0301280063735605e-02 8.1257685497630808e-02 3.2277925971411670e-01 - 8 -2.3176063002636704e-01 5.2671227056062875e-01 1.2053172498561873e-01 - 9 2.4851503392872357e-01 -6.8279100291337380e-01 4.2797251627008076e-01 - 10 -2.4005564262187033e-02 3.2665494018744010e-02 -4.5205317316130401e-02 - 11 -1.1843278168067750e-01 1.3672928500970477e-01 -7.8857426677346534e-02 - 12 4.1600468540510127e-01 -8.1764456207382624e-02 2.1996745968645920e-01 - 13 1.4754680963957358e-02 -1.7373619613073755e-02 -2.4742031226991913e-02 - 14 -1.4295920510708943e-01 4.7017453379342669e-02 -4.1095731310254784e-02 - 15 4.9776498137740523e-02 -3.7008089405950011e-04 -1.3337066092899458e-01 - 16 -3.9452099323863399e-02 -1.1224129478450499e-01 5.6594683739796946e-02 - 17 -3.9249180832888381e-01 8.6969704011923854e-01 -7.1560967522838825e-01 - 18 -6.5742744649267340e-03 4.6998380753213276e-01 -3.2849033116391196e-01 - 19 2.9847873425093764e-03 -2.7345575965390795e-01 3.4516019021230460e-01 - 20 -7.0778812687921133e-02 -1.8121462217481474e-01 2.3808324070557918e-01 - 21 4.2629583866925107e-02 3.5412196658243855e-01 -4.7545781642782881e-01 - 22 1.1514494215742289e-02 -1.1066279119021936e-01 3.0020943897738017e-01 - 23 -1.1773303656546849e-01 -1.8142545543954808e-01 2.5204299074099740e-01 - 24 -6.8820300407286955e-02 6.0915783855578642e-01 -3.2115334328347539e-01 - 25 1.4340007371772712e-02 -2.7422588777471385e-01 1.1162318382843600e-01 - 26 -2.2422836566002184e-02 -3.6755159816117794e-01 1.2917531556408018e-01 - 27 -1.8401296920116900e-01 6.7135246775402002e-01 -2.4134247472235965e-01 - 28 1.6141537749494994e-01 -3.3249258592595410e-01 1.6748408084762209e-01 - 29 7.9625904720364071e-02 -3.4038856261611400e-01 7.0778700966832864e-02 + 1 2.4611484962109012e-01 -1.5954551222030339e-01 2.4129249478046075e-01 + 2 1.2503486238661154e-01 -3.1084679982801422e-01 -3.9022870476770205e-01 + 3 -3.0752178054498326e-03 3.8776087471007531e-03 9.9328823260894511e-03 + 4 -2.3255573906739289e-02 -6.0181105139248950e-05 -4.5664999931594168e-02 + 5 -8.2607836704040469e-02 6.6475382332478489e-02 1.2496198626423703e-03 + 6 1.4468457066243465e-01 -4.4534587039942053e-01 -1.7945275004100597e-01 + 7 -2.2967555513015426e-02 8.5565616063036726e-02 3.3301428567060948e-01 + 8 -2.3874177165591512e-01 5.2880254325164011e-01 1.2081022328651085e-01 + 9 2.5037019210951722e-01 -6.7566512095592535e-01 4.2115693587857200e-01 + 10 -2.3714999962253881e-02 3.2818725393976234e-02 -4.4735319194422300e-02 + 11 -1.1854457683827549e-01 1.3621591601919320e-01 -8.0393180262496755e-02 + 12 4.1603734220654320e-01 -8.3117789602578818e-02 2.1992648469398871e-01 + 13 1.5916891956389203e-02 -1.6711382764381444e-02 -2.4815293645369756e-02 + 14 -1.4260728252978117e-01 4.6338597397842365e-02 -4.3082443140726706e-02 + 15 4.7945988359729130e-02 1.7138709187173029e-03 -1.3099924412733521e-01 + 16 -3.9311484024176342e-02 -1.1057143329827207e-01 5.6688295044658936e-02 + 17 -3.9076382168499796e-01 8.5907196284032294e-01 -7.0991607607339391e-01 + 18 7.0410393450860004e-03 4.8286380578862376e-01 -3.4669533255469498e-01 + 19 -1.8704713669038954e-02 -2.8825482614460002e-01 3.3753871817441183e-01 + 20 -6.3866178833720103e-02 -1.7995556104599100e-01 2.6371510453473040e-01 + 21 3.9703028365558592e-02 3.6888355667480144e-01 -4.8052806459421610e-01 + 22 -1.2907626112322003e-03 -1.2285444324242886e-01 2.9924505985287586e-01 + 23 -1.0266322971835282e-01 -1.8239970041576559e-01 2.5896203143480129e-01 + 24 -5.9859679474760605e-02 6.0674983323021470e-01 -3.1617658632612033e-01 + 25 1.7333544879220009e-03 -2.7731491756280779e-01 9.8991668412426015e-02 + 26 -2.0889473337117173e-02 -3.6478577467895851e-01 1.3264843726712322e-01 + 27 -1.7639062900164981e-01 6.6636676126323380e-01 -2.5101298507232828e-01 + 28 1.5533295294938937e-01 -3.3098958767926839e-01 1.7151218685480088e-01 + 29 7.9339714820245280e-02 -3.3732527897732617e-01 7.7016551656704277e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm.yaml index 783939caa..d150f9ee7 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 4.9268806567247346e+01 -2.1540599266520917e+02 8.6345394436784431e+01 28 -1.7572634923909956e+02 7.2424827393790522e+01 -1.1807149056284722e+02 29 1.2694498092952055e+02 1.4289100071158703e+02 3.1729222911990778e+01 -run_vdwl: 147.043158293232 -run_coul: 120.800133568184 +run_vdwl: 719.582182590996 +run_coul: 114.220463593576 run_stress: ! |2- - 6.0714736178199996e+02 6.2725764177379574e+02 4.5374246696160844e+02 -3.0771618211335505e+02 -2.8793232490221200e+01 1.3172685327790495e+02 + 2.1092365276732253e+03 2.1092562258583794e+03 4.3557362156705476e+03 -7.3297378066110355e+02 3.5809210365937368e+01 6.3889360029491104e+02 run_forces: ! |2 - 1 1.4901675541185393e+01 7.9362893190165494e+01 6.1758304021013508e+01 - 2 1.9582047807065450e+01 1.2033716111587802e+01 -2.5527890849545621e+01 - 3 -2.4595994776578007e+02 1.0320598804297596e+02 8.5016525898038509e+01 - 4 -8.7666838955959570e+00 3.3307148955442347e+00 -6.5800974544778326e+00 - 5 -2.2550234258401574e+00 -1.8189556044156958e+00 1.0381639896835960e+01 - 6 1.1566145203968264e+02 -9.8961460001337485e+01 -1.4206288177802986e+02 - 7 4.0310214007184113e+00 -1.0796589046204041e+01 -4.1053720345307482e+01 - 8 -2.0278671065073532e+01 2.2416743324882720e+01 5.7007585309011439e+01 - 9 1.3831275838761206e+01 6.3233083481016310e+00 5.3125632501675732e+01 - 10 6.4034498202885743e+01 -7.5459355451933178e+01 -7.5613086118755277e+01 - 11 -7.3900440825588758e+00 -6.7494588207315127e+00 -1.7185399982016623e+01 - 12 1.7678272698747335e+01 1.1269091206486449e+01 -6.5110680123955236e+00 - 13 7.2168880103155031e+00 -2.6444826435940221e+00 -4.2612452408505841e-01 - 14 -4.3479905182835603e+00 9.4719508865379132e-01 -7.1776577935096615e+00 - 15 -3.2415867625154432e-01 7.8105556767018367e+00 1.9327787399546656e+00 - 16 5.2553213225186234e+01 -6.8222972483339788e+01 1.4027042239369928e+01 - 17 -1.8352944471521234e+01 1.7361877908286655e+01 3.6403366175682187e+01 - 18 -2.7787652857121087e-01 6.3930913892933505e+00 -7.3568724155247649e+00 - 19 2.2961499554879796e+00 -1.7083543392295206e+00 5.9508355438033469e+00 - 20 -2.9296176078546390e+00 -4.5612278049900050e+00 3.9549252590661639e+00 - 21 -9.6780947508028436e+00 -8.5051159538315542e+00 3.4792558615710917e+01 - 22 -1.8186663092251703e+01 -5.4051681192769436e+00 -2.6632304952295339e+01 - 23 2.7110231811687829e+01 1.4702212710562977e+01 -7.2378958778892555e+00 - 24 1.1387734102372550e+01 -3.0705433937299183e+01 2.0564412733372382e+01 - 25 -2.9706819413926937e+01 2.8110979952854009e+00 -2.4644098698605937e+01 - 26 1.7395573678803508e+01 2.7712407567875360e+01 3.1227837792584263e+00 - 27 1.6512844269882598e+00 -3.2507877868527643e+01 9.2893210890173936e+00 - 28 -2.3920410543003026e+01 8.5646512291710888e+00 -1.5561036534939182e+01 - 29 2.3043627097427251e+01 2.3800907389135812e+01 6.2424235355667932e+00 + 1 -1.7999976542692593e+01 2.6650214510672248e+02 3.2427412111027434e+02 + 2 1.5295092894602979e+02 1.2285076759106163e+02 -1.8121178706306870e+02 + 3 -1.3354656250357593e+02 -3.7932509935884764e+02 -1.4287738387288024e+02 + 4 -7.8048790325957969e+00 2.1706115032139381e+00 -5.9279609061968737e+00 + 5 -2.9268131454404811e+00 -3.2880099870229649e+00 1.1979386965924915e+01 + 6 -8.0491589727549240e+02 9.1828130675777049e+02 1.0240065785817026e+03 + 7 5.5420450683042112e+01 -3.1071124828356329e+02 -1.5707651411916399e+03 + 8 1.3292010744109820e+02 -9.6771893671896734e+01 3.9141957774353091e+02 + 9 7.8595882787749247e+01 7.6950477513372206e+01 3.4087971766440711e+02 + 10 5.2095075170718064e+02 -5.9869411487559285e+02 -1.8152806486403168e+02 + 11 -3.3197976675369905e+00 -4.7054852767253372e+00 -1.0251471017789195e+01 + 12 2.0688458959030626e+01 9.7635783711233142e+00 -6.4620142344593470e+00 + 13 7.8823367497246535e+00 -3.0863664535393047e+00 -3.4439910504845911e-01 + 14 -4.5353745688889457e+00 1.1445572319648432e+00 -8.7536575231642519e+00 + 15 3.5480273557935878e-02 8.3788936372541638e+00 1.9655244193130663e+00 + 16 4.3399998187679734e+02 -3.1202395714925473e+02 -1.1115111685521927e+03 + 17 -4.2725559071111928e+02 3.0215084374641049e+02 1.1231612631882110e+03 + 18 7.3477073368865831e-01 6.0665841875388358e+00 -8.9345506481795454e+00 + 19 1.8823946702293057e+00 -1.3809932691775066e+00 6.2441741711608474e+00 + 20 -3.1167301406453363e+00 -4.5499296443377206e+00 4.6915538550059175e+00 + 21 -6.8535255941617820e+01 -7.4719832553900204e+01 2.1212550983756208e+02 + 22 -1.0473851733521646e+02 -2.6780590892743330e+01 -1.6017575352013642e+02 + 23 1.7276488674667343e+02 1.0205150187774427e+02 -5.1364082421903007e+01 + 24 3.6465642013650822e+01 -1.9972898884216869e+02 1.0715961138715387e+02 + 25 -1.4605945856940923e+02 2.0226991546286779e+01 -1.2188219949680312e+02 + 26 1.0897285130168409e+02 1.7931951772394115e+02 1.4080001918056960e+01 + 27 4.8327663237971876e+01 -2.1153106978615131e+02 8.4231638065224729e+01 + 28 -1.7244926856477656e+02 7.1003976783117437e+01 -1.1565182222127899e+02 + 29 1.2461153387089912e+02 1.4043582646739915e+02 3.1422797731244469e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm_table.yaml index 610ce1621..1c53c025f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 4.9268806410294808e+01 -2.1540599247253076e+02 8.6345394352289631e+01 28 -1.7572634941651745e+02 7.2424827092422973e+01 -1.1807149055311780e+02 29 1.2694498129839906e+02 1.4289100074319830e+02 3.1729223050582846e+01 -run_vdwl: 147.043158278144 -run_coul: 120.800133551438 +run_vdwl: 719.582182590983 +run_coul: 114.22046093329 run_stress: ! |2- - 6.0714735740280275e+02 6.2725763883474872e+02 4.5374246399858856e+02 -3.0771618191338013e+02 -2.8793231854467404e+01 1.3172684870552641e+02 + 2.1092365278604757e+03 2.1092562238992905e+03 4.3557362167859274e+03 -7.3297378125979174e+02 3.5809210720302019e+01 6.3889359742297256e+02 run_forces: ! |2 - 1 1.4901675583492649e+01 7.9362893485607074e+01 6.1758303801776677e+01 - 2 1.9582047650794976e+01 1.2033716239720336e+01 -2.5527891030087925e+01 - 3 -2.4595994786662976e+02 1.0320598812414032e+02 8.5016525942643483e+01 - 4 -8.7666839250043687e+00 3.3307149120245305e+00 -6.5800974835544821e+00 - 5 -2.2550233650943934e+00 -1.8189556399495419e+00 1.0381639864492326e+01 - 6 1.1566145240868445e+02 -9.8961460261867614e+01 -1.4206288203855189e+02 - 7 4.0310209390432030e+00 -1.0796588511368931e+01 -4.1053720801867243e+01 - 8 -2.0278670881257984e+01 2.2416742936565260e+01 5.7007585559173336e+01 - 9 1.3831275694806225e+01 6.3233085873332664e+00 5.3125632363022113e+01 - 10 6.4034498149769362e+01 -7.5459355479744090e+01 -7.5613086008100510e+01 - 11 -7.3900439809383522e+00 -6.7494589952608370e+00 -1.7185399937194173e+01 - 12 1.7678272792401259e+01 1.1269091176034271e+01 -6.5110679865879675e+00 - 13 7.2168880154879682e+00 -2.6444827040094014e+00 -4.2612454283250001e-01 - 14 -4.3479905468099984e+00 9.4719512701402819e-01 -7.1776577863788580e+00 - 15 -3.2415863415535051e-01 7.8105555959089106e+00 1.9327787931880600e+00 - 16 5.2553213679928191e+01 -6.8222972952036258e+01 1.4027042589531810e+01 - 17 -1.8352944498401982e+01 1.7361878444285995e+01 3.6403366162658173e+01 - 18 -2.7787692318779877e-01 6.3930914662408584e+00 -7.3568722694957902e+00 - 19 2.2961498690818205e+00 -1.7083544552471590e+00 5.9508357697061820e+00 - 20 -2.9296176821651323e+00 -4.5612277581705190e+00 3.9549254419787103e+00 - 21 -9.6780943328486053e+00 -8.5051158809872085e+00 3.4792558330370234e+01 - 22 -1.8186663082382136e+01 -5.4051681950087875e+00 -2.6632304851060997e+01 - 23 2.7110231716026480e+01 1.4702212722177208e+01 -7.2378957033999054e+00 - 24 1.1387734320341307e+01 -3.0705433946606558e+01 2.0564412882298658e+01 - 25 -2.9706819424206476e+01 2.8110979147921533e+00 -2.4644099136588650e+01 - 26 1.7395573642934945e+01 2.7712407773302992e+01 3.1227839975096043e+00 - 27 1.6512843306132134e+00 -3.2507878288627197e+01 9.2893210007872344e+00 - 28 -2.3920410938056225e+01 8.5646511943612946e+00 -1.5561036552169440e+01 - 29 2.3043627287732598e+01 2.3800907369375526e+01 6.2424236287337598e+00 + 1 -1.7999976426133060e+01 2.6650214515181756e+02 3.2427412125660521e+02 + 2 1.5295092923808676e+02 1.2285076783763247e+02 -1.8121178707516731e+02 + 3 -1.3354656249637318e+02 -3.7932509933974711e+02 -1.4287738387056390e+02 + 4 -7.8048790297285642e+00 2.1706114840405877e+00 -5.9279609030334095e+00 + 5 -2.9268131635616554e+00 -3.2880099796300217e+00 1.1979386932830135e+01 + 6 -8.0491589746575914e+02 9.1828130665248409e+02 1.0240065785464715e+03 + 7 5.5420450565848100e+01 -3.1071124842289993e+02 -1.5707651414266074e+03 + 8 1.3292010751075108e+02 -9.6771893693832965e+01 3.9141957796318582e+02 + 9 7.8595882859054669e+01 7.6950477392458978e+01 3.4087971770628661e+02 + 10 5.2095075173973555e+02 -5.9869411490228333e+02 -1.8152806493246885e+02 + 11 -3.3197977465493196e+00 -4.7054851664261221e+00 -1.0251470969374971e+01 + 12 2.0688458961440961e+01 9.7635783283288315e+00 -6.4620143734875004e+00 + 13 7.8823368297445500e+00 -3.0863665172264012e+00 -3.4439919934134849e-01 + 14 -4.5353744206869901e+00 1.1445571399747621e+00 -8.7536574362789690e+00 + 15 3.5480277352423921e-02 8.3788934945421687e+00 1.9655245153074883e+00 + 16 4.3399998139824589e+02 -3.1202395678463461e+02 -1.1115111684886247e+03 + 17 -4.2725559058443753e+02 3.0215084395331075e+02 1.1231612629143822e+03 + 18 7.3477058251652871e-01 6.0665840717787463e+00 -8.9345505420506512e+00 + 19 1.8823946690469171e+00 -1.3809931600694831e+00 6.2441742942936029e+00 + 20 -3.1167301433533106e+00 -4.5499295900321144e+00 4.6915538986974976e+00 + 21 -6.8535255881466938e+01 -7.4719832523112046e+01 2.1212551009011275e+02 + 22 -1.0473851712676519e+02 -2.6780590837238236e+01 -1.6017575336875876e+02 + 23 1.7276488662375942e+02 1.0205150167752677e+02 -5.1364082478756941e+01 + 24 3.6465641878783920e+01 -1.9972898876781122e+02 1.0715961077911943e+02 + 25 -1.4605945867011229e+02 2.0226991446903675e+01 -1.2188219933329994e+02 + 26 1.0897285140810953e+02 1.7931951778135391e+02 1.4080001959532630e+01 + 27 4.8327663219873052e+01 -2.1153106977158239e+02 8.4231637985952958e+01 + 28 -1.7244926837014603e+02 7.1003976713177565e+01 -1.1565182225882279e+02 + 29 1.2461153376272446e+02 1.4043582633119530e+02 3.1422797813860065e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_table.yaml index a983dc02b..2da0d8556 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9789357884880488e+01 -2.1702160587579414e+02 8.7170422370750828e+01 28 -1.7608384222411630e+02 7.3301742386199109e+01 -1.1852450224218201e+02 29 1.2668895009877801e+02 1.4371757005571936e+02 3.1331337187961438e+01 -run_vdwl: 146.969932394973 -run_coul: 231.547231027259 +run_vdwl: 719.570991288614 +run_coul: 225.904269157132 run_stress: ! |2- - 6.0915004559646684e+02 6.3099733874173205e+02 4.5850630772502740e+02 -3.1002780853804836e+02 -2.9989782729351909e+01 1.3053414635397095e+02 + 2.1107014201839611e+03 2.1121563787791556e+03 4.3598688616907511e+03 -7.3407400815170706e+02 3.5367513511177357e+01 6.3752854448547271e+02 run_forces: ! |2 - 1 1.5318918280577572e+01 7.9282401106958375e+01 6.1573405787971858e+01 - 2 1.9396975392512381e+01 1.2345008979618576e+01 -2.5332934850094649e+01 - 3 -2.4626010819298389e+02 1.0353987390000911e+02 8.5144847833756302e+01 - 4 -8.8799793333953971e+00 3.3241589367507962e+00 -6.4497293597128627e+00 - 5 -2.3921296273181305e+00 -1.8640436356405086e+00 1.0409771669906656e+01 - 6 1.1514351252024848e+02 -9.9343277045289526e+01 -1.4128644060090235e+02 - 7 4.4121937585568691e+00 -1.0659282122293529e+01 -4.1672994426592965e+01 - 8 -1.9867787327847278e+01 2.2748961526464992e+01 5.6456512542354062e+01 - 9 1.3497119328072609e+01 6.1641760514132971e+00 5.3035389141893411e+01 - 10 6.4064118449943933e+01 -7.5531390901048468e+01 -7.5546937006353559e+01 - 11 -7.3191394758279866e+00 -6.8855176883411877e+00 -1.7097024484707848e+01 - 12 1.7332128989954910e+01 1.1587337945376177e+01 -6.6950986294568242e+00 - 13 7.3167737972056504e+00 -2.7360218586026361e+00 -4.0451118789154500e-01 - 14 -4.2029787248146784e+00 8.3858573354128096e-01 -7.1469687848927164e+00 - 15 -2.3374852087826420e-01 7.7706234158029703e+00 2.0011111418920482e+00 - 16 5.2778366262337954e+01 -6.8528213317173908e+01 1.3739545725184309e+01 - 17 -1.8300841112803944e+01 1.7606322828257291e+01 3.7169233988593675e+01 - 18 -6.3726835259723758e-01 4.7973251619048618e+00 -6.5668096068804322e+00 - 19 2.4125091433118486e+00 -8.7926146006510375e-01 5.4232990590521926e+00 - 20 -2.7248785129452946e+00 -3.8904675805353075e+00 3.4619764299980011e+00 - 21 -9.8190594543264798e+00 -9.2646555708689924e+00 3.5602732603740016e+01 - 22 -1.7981863440577431e+01 -5.1466143340317450e+00 -2.7099137891686084e+01 - 23 2.7159819315283109e+01 1.5032333117821219e+01 -7.6944558215758123e+00 - 24 1.1638953036548925e+01 -3.2222662903256705e+01 2.1229970497291735e+01 - 25 -2.9814604103781551e+01 3.4701637896625570e+00 -2.4986495288736702e+01 - 26 1.7326615656323938e+01 2.8422695140957792e+01 2.8029970928606471e+00 - 27 2.2656449067225992e+00 -3.4112795339715859e+01 1.0080919387176698e+01 - 28 -2.4164737463031166e+01 9.4962408965485530e+00 -1.5922775772772074e+01 - 29 2.2535474805527961e+01 2.4637995225775605e+01 5.7706008105849014e+00 + 1 -1.7606143843665603e+01 2.6643926236673082e+02 3.2393404496993196e+02 + 2 1.5276960966682898e+02 1.2310582461029462e+02 -1.8097790248434339e+02 + 3 -1.3352077636549797e+02 -3.7931683372564936e+02 -1.4290297491642545e+02 + 4 -7.9208284546974577e+00 2.1478477067733284e+00 -5.8261884661194525e+00 + 5 -3.0434259054809751e+00 -3.3598884213335838e+00 1.2036985119274538e+01 + 6 -8.0541313508185738e+02 9.1789625658488922e+02 1.0248072976066528e+03 + 7 5.5714038039772895e+01 -3.1034952538411062e+02 -1.5712584074325553e+03 + 8 1.3310127208740178e+02 -9.6223383077112004e+01 3.9089950948357239e+02 + 9 7.8393524582657548e+01 7.6654619432531391e+01 3.4092253927938810e+02 + 10 5.2097807349337040e+02 -5.9878505273289102e+02 -1.8147944934558069e+02 + 11 -3.2607812425685045e+00 -4.8311146746579672e+00 -1.0171675293791326e+01 + 12 2.0366619951529383e+01 1.0143826382674556e+01 -6.6252490574308824e+00 + 13 7.9792435178768564e+00 -3.1830854225008709e+00 -3.2638606798253195e-01 + 14 -4.4038447829706557e+00 1.0233465273297468e+00 -8.7296918938573551e+00 + 15 1.3133402877496533e-01 8.2983926307052993e+00 2.0214539505544544e+00 + 16 4.3411275528100384e+02 -3.1229239813547588e+02 -1.1118141250394415e+03 + 17 -4.2721342176502185e+02 3.0241463057767442e+02 1.1238199760240952e+03 + 18 2.9829418314312800e-01 4.7250403208006384e+00 -7.8003662602094979e+00 + 19 2.0269862260643698e+00 -7.0025225915454226e-01 5.5351650067009563e+00 + 20 -2.8986981300682491e+00 -3.9675712665246805e+00 4.0697716723304662e+00 + 21 -6.8660082028753777e+01 -7.5471919807937937e+01 2.1302658933963116e+02 + 22 -1.0464811095682553e+02 -2.6524410822869573e+01 -1.6069139102240243e+02 + 23 1.7288785171586329e+02 1.0241550327213942e+02 -5.1825369557485480e+01 + 24 3.6620155356259367e+01 -2.0126084706541766e+02 1.0765579129027019e+02 + 25 -1.4622314510855665e+02 2.0851582331914560e+01 -1.2215092288908080e+02 + 26 1.0903609101250031e+02 1.8015264248730023e+02 1.3874303856392180e+01 + 27 4.8838679332636701e+01 -2.1313393905520871e+02 8.5043183840124925e+01 + 28 -1.7278636595501050e+02 7.1874870106702986e+01 -1.1608942983399382e+02 + 29 1.2434423114529115e+02 1.4125657651238311e+02 3.1022918121780496e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_table_cs.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_table_cs.yaml index 84462fa46..eddedd29d 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_table_cs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_table_cs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:18 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9789361859027338e+01 -2.1702162982324529e+02 8.7170431119454051e+01 28 -1.7608386016445402e+02 7.3301750096137496e+01 -1.1852451438078860e+02 29 1.2668896406496889e+02 1.4371758629323210e+02 3.1331340577864808e+01 -run_vdwl: 146.969928706786 -run_coul: 231.547284956704 +run_vdwl: 719.570990914285 +run_coul: 225.90440119896 run_stress: ! |2- - 6.0915007504981611e+02 6.3099736121260946e+02 4.5850632923628029e+02 -3.1002779221768753e+02 -2.9989774106737205e+01 1.3053414718596068e+02 + 2.1107015034365818e+03 2.1121564327937999e+03 4.3598689294362703e+03 -7.3407397138118756e+02 3.5367541930236200e+01 6.3752854218562106e+02 run_forces: ! |2 - 1 1.5318917913998423e+01 7.9282401075238297e+01 6.1573406501467240e+01 - 2 1.9396975912642198e+01 1.2345009310312596e+01 -2.5332935479992813e+01 - 3 -2.4626010970607831e+02 1.0353987493157926e+02 8.5144848450080104e+01 - 4 -8.8799793792533528e+00 3.3241589546099952e+00 -6.4497293923710250e+00 - 5 -2.3921296326904220e+00 -1.8640436519553909e+00 1.0409771718361517e+01 - 6 1.1514351430345427e+02 -9.9343278439348040e+01 -1.4128644149173567e+02 - 7 4.4121937105623523e+00 -1.0659282055304553e+01 -4.1672994216340925e+01 - 8 -1.9867787969993614e+01 2.2748961876933816e+01 5.6456512020200691e+01 - 9 1.3497119413122370e+01 6.1641761607304568e+00 5.3035389461784376e+01 - 10 6.4064118708908936e+01 -7.5531391362862877e+01 -7.5546937245829895e+01 - 11 -7.3191394032015262e+00 -6.8855175915282079e+00 -1.7097024291252982e+01 - 12 1.7332128669672841e+01 1.1587337518954648e+01 -6.6950982800562135e+00 - 13 7.3167744206112229e+00 -2.7360220869328438e+00 -4.0451120729657158e-01 - 14 -4.2029789682975176e+00 8.3858577610080898e-01 -7.1469693889093362e+00 - 15 -2.3374855723158977e-01 7.7706240764194980e+00 2.0011113886105751e+00 - 16 5.2778366202621179e+01 -6.8528213293826852e+01 1.3739545983764470e+01 - 17 -1.8300841028167838e+01 1.7606322780566334e+01 3.7169233760348867e+01 - 18 -6.3726798676735386e-01 4.7973202783225739e+00 -6.5667860161419780e+00 - 19 2.4124962236064058e+00 -8.7926998063031792e-01 5.4232836819417152e+00 - 20 -2.7248660983527304e+00 -3.8904542983056145e+00 3.4619684384082627e+00 - 21 -9.8190605000754303e+00 -9.2646568135013290e+00 3.5602736550901255e+01 - 22 -1.7981865173915267e+01 -5.1466147266930236e+00 -2.7099140823578551e+01 - 23 2.7159822090428914e+01 1.5032334761247675e+01 -7.6944568355962275e+00 - 24 1.1638953894622333e+01 -3.2222666358885888e+01 2.1229972504563992e+01 - 25 -2.9814606552965838e+01 3.4701643199475036e+00 -2.4986497429352909e+01 - 26 1.7326617238525905e+01 2.8422698057964208e+01 2.8029972149516653e+00 - 27 2.2656453905895795e+00 -3.4112799325915127e+01 1.0080920666391256e+01 - 28 -2.4164739821793603e+01 9.4962422393668877e+00 -1.5922777430204471e+01 - 29 2.2535476685417503e+01 2.4637997867395594e+01 5.7706011868836118e+00 + 1 -1.7606148422521336e+01 2.6643925859668008e+02 3.2393405034597754e+02 + 2 1.5276961424214133e+02 1.2310582837729281e+02 -1.8097790785616914e+02 + 3 -1.3352077630126863e+02 -3.7931683371531966e+02 -1.4290297495116457e+02 + 4 -7.9208285033562849e+00 2.1478477204184605e+00 -5.8261885007207894e+00 + 5 -3.0434259183480754e+00 -3.3598884411289385e+00 1.2036985184999580e+01 + 6 -8.0541313684757517e+02 9.1789625871850717e+02 1.0248073005311012e+03 + 7 5.5714038209293065e+01 -3.1034952620155894e+02 -1.5712584114396543e+03 + 8 1.3310127157464962e+02 -9.6223386225124159e+01 3.9089950219015094e+02 + 9 7.8393526488697233e+01 7.6654621482484330e+01 3.4092254771262782e+02 + 10 5.2097807364824928e+02 -5.9878505307048147e+02 -1.8147944959800557e+02 + 11 -3.2607811943805842e+00 -4.8311145564487177e+00 -1.0171675099396719e+01 + 12 2.0366619539954595e+01 1.0143825863024786e+01 -6.6252485623883146e+00 + 13 7.9792442402299963e+00 -3.1830857068297878e+00 -3.2638608139684028e-01 + 14 -4.4038450721097862e+00 1.0233465851035188e+00 -8.7296926433317132e+00 + 15 1.3133400771500281e-01 8.2983933772545964e+00 2.0214542180961210e+00 + 16 4.3411275646493368e+02 -3.1229239896302664e+02 -1.1118141281803844e+03 + 17 -4.2721342294870078e+02 3.0241463140500736e+02 1.1238199791654361e+03 + 18 2.9829256061758702e-01 4.7250335387815925e+00 -7.8003426891453422e+00 + 19 2.0269742611977413e+00 -7.0025993491371019e-01 5.5351505500875415e+00 + 20 -2.8986845427508006e+00 -3.9675568086729669e+00 4.0697625581525010e+00 + 21 -6.8660088719015491e+01 -7.5471927799167588e+01 2.1302661261462677e+02 + 22 -1.0464812223201402e+02 -2.6524413570697618e+01 -1.6069140867711204e+02 + 23 1.7288786968128767e+02 1.0241551401125147e+02 -5.1825375177761046e+01 + 24 3.6620160182518617e+01 -2.0126086834380607e+02 1.0765580343593786e+02 + 25 -1.4622316107345330e+02 2.0851584882592697e+01 -1.2215093632091408e+02 + 26 1.0903610215104297e+02 1.8015266121491891e+02 1.3874305142455558e+01 + 27 4.8838683123596752e+01 -2.1313396224286851e+02 8.5043192221159856e+01 + 28 -1.7278638325401769e+02 7.1874877549469588e+01 -1.1608944152023807e+02 + 29 1.2434424465338670e+02 1.4125659225725749e+02 3.1022921426973376e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_wolf.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_wolf.yaml index 7f4e8e422..47c261986 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_wolf.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_wolf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 14:17:47 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 4.9510154330081832e+01 -2.1610575460234838e+02 8.6754629656822544e+01 28 -1.7591378266570788e+02 7.2834350327804387e+01 -1.1830264456265071e+02 29 1.2681874074605287e+02 1.4324063401171372e+02 3.1536006009714757e+01 -run_vdwl: 147.008057550173 -run_coul: -109.411993197965 +run_vdwl: 719.578470681595 +run_coul: -115.628022767293 run_stress: ! |2- - 6.0820784761336290e+02 6.2909367646211854e+02 4.5592747121783481e+02 -3.0875651605601536e+02 -2.9254604713703628e+01 1.3119770190009501e+02 + 2.1100747209994188e+03 2.1107555903838120e+03 4.3576865384721177e+03 -7.3346400125986247e+02 3.5650279092755696e+01 6.3830265374008570e+02 run_forces: ! |2 - 1 1.5134473196301899e+01 7.9297372642048387e+01 6.1698261607518290e+01 - 2 1.9492354063491280e+01 1.2180225814150159e+01 -2.5467933293207761e+01 - 3 -2.4608897019259976e+02 1.0335292874082795e+02 8.5076026454062657e+01 - 4 -8.8270147103313903e+00 3.3293331495059153e+00 -6.5208672113494437e+00 - 5 -2.3322399271900935e+00 -1.8342317405423807e+00 1.0393568418565797e+01 - 6 1.1541029951927480e+02 -9.9127817108479533e+01 -1.4177223658797249e+02 - 7 4.1974984913950211e+00 -1.0742403001406398e+01 -4.1304879171141707e+01 - 8 -2.0077234922620988e+01 2.2552628467874136e+01 5.6805753445670071e+01 - 9 1.3672702035007825e+01 6.2632192141841729e+00 5.3086668384005144e+01 - 10 6.4044904397682686e+01 -7.5494440461564480e+01 -7.5591655488264394e+01 - 11 -7.3602640356129116e+00 -6.8054301152790835e+00 -1.7159096070543988e+01 - 12 1.7518728594475672e+01 1.1390704850320676e+01 -6.5432336920221772e+00 - 13 7.2750827371955040e+00 -2.6817325502156359e+00 -4.3336915876618881e-01 - 14 -4.2823797713588414e+00 9.0575393460082532e-01 -7.1761777836347234e+00 - 15 -2.8162107618009602e-01 7.8029127584300211e+00 1.9463937752641929e+00 - 16 5.2669770930132493e+01 -6.8368608525725733e+01 1.3871323292392928e+01 - 17 -1.8329249948630331e+01 1.7480034937441982e+01 3.6736045842799314e+01 - 18 -4.8101494694124480e-01 5.6390132977311653e+00 -7.0115344414881982e+00 - 19 2.3578280811370878e+00 -1.3232246833708847e+00 5.7361157467409898e+00 - 20 -2.8026057371621729e+00 -4.2259515213575769e+00 3.7472565742152164e+00 - 21 -9.8227230053510546e+00 -8.7706613544879826e+00 3.5182635435421481e+01 - 22 -1.8061047413316121e+01 -5.3220347857558936e+00 -2.6849518874783598e+01 - 23 2.7161081898168934e+01 1.4826998706582364e+01 -7.4311157820847571e+00 - 24 1.1514028919324179e+01 -3.1384309863154904e+01 2.0791377972802547e+01 - 25 -2.9773914267061652e+01 3.0778124815551657e+00 -2.4785719485435660e+01 - 26 1.7398255476045538e+01 2.8016686360772457e+01 3.0305971280808950e+00 - 27 1.9298046896192673e+00 -3.3193481194535309e+01 9.6773399225664285e+00 - 28 -2.4055556840788153e+01 8.9967283754341736e+00 -1.5744716788519868e+01 - 29 2.2799023765892649e+01 2.4161973174416243e+01 6.0126898291090143e+00 + 1 -1.7792946342594352e+01 2.6645383211396648e+02 3.2415190634203998e+02 + 2 1.5286884175488979e+02 1.2296846616985287e+02 -1.8114053880774088e+02 + 3 -1.3353303658065479e+02 -3.7932127557620339e+02 -1.4288769247773089e+02 + 4 -7.8648925795809248e+00 2.1600896529277689e+00 -5.8828395864342298e+00 + 5 -2.9924329210640512e+00 -3.3181568918555735e+00 1.2004984684614231e+01 + 6 -8.0516135816368035e+02 9.1811763451333798e+02 1.0243121867363757e+03 + 7 5.5548345788708005e+01 -3.1055074380631493e+02 -1.5709575585886541e+03 + 8 1.3302690779501100e+02 -9.6537935936927155e+01 3.9123529718219589e+02 + 9 7.8496451130073694e+01 7.6820771106619858e+01 3.4089496231063345e+02 + 10 5.2096254090254445e+02 -5.9873665774722485e+02 -1.8151441506443922e+02 + 11 -3.2944839720674017e+00 -4.7602860470872495e+00 -1.0228555012707281e+01 + 12 2.0535133754237439e+01 9.9206712688021383e+00 -6.4859107831874407e+00 + 13 7.9387908218948908e+00 -3.1289617124657054e+00 -3.5165451410066206e-01 + 14 -4.4754437727860141e+00 1.0950680564936419e+00 -8.7570958389266060e+00 + 15 8.1260098544565687e-02 8.3506377806962000e+00 1.9746668350437246e+00 + 16 4.3406904063312129e+02 -3.1216923701492101e+02 -1.1116703941662186e+03 + 17 -4.2724408722184211e+02 3.0229240443182016e+02 1.1234521871428756e+03 + 18 4.9279839587409746e-01 5.4406561253192027e+00 -8.4163297084059803e+00 + 19 1.9590369576600561e+00 -1.0686059564419070e+00 5.9340019811299216e+00 + 20 -2.9819386948856899e+00 -4.2620411109083669e+00 4.4168241160640687e+00 + 21 -6.8652575886781506e+01 -7.5004253984006255e+01 2.1256294714068008e+02 + 22 -1.0467907300241406e+02 -2.6690870438463541e+01 -1.6042221524803463e+02 + 23 1.7285013200800543e+02 1.0220099358148249e+02 -5.1568957261234843e+01 + 24 3.6532541396412746e+01 -2.0041091518131489e+02 1.0728221773681435e+02 + 25 -1.4614389052788377e+02 2.0479400130809104e+01 -1.2197337017803238e+02 + 26 1.0903690524098899e+02 1.7969058238036004e+02 1.4047992865925650e+01 + 27 4.8563638589192109e+01 -2.1222541567909917e+02 8.4634121087429691e+01 + 28 -1.7262679463848258e+02 7.1410602610008269e+01 -1.1587549698186544e+02 + 29 1.2448058903755918e+02 1.4078354716073807e+02 3.1228728055890034e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml index 6c0765189..266af0029 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 15:51:49 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -55,38 +55,38 @@ init_forces: ! |2 27 1.1801272518921629e-03 8.4343877491515880e-04 -6.0291518540734278e-04 28 5.0297112779360527e-05 9.5876022121673079e-05 -2.0039893686618438e-05 29 1.9742577290027754e-05 1.1615471308058326e-04 -9.4148494816978075e-05 -run_vdwl: -0.0427945069849374 +run_vdwl: -0.0428351033601986 run_coul: 0 run_stress: ! |- - -3.7077026602753520e-02 -4.4304571891824726e-02 -3.3438830487491980e-02 4.0619773242517527e-03 1.2107484872063253e-02 5.0087996826964397e-03 + -3.7143510580415713e-02 -4.4273572202555178e-02 -3.3391348752582796e-02 3.9866884723237378e-03 1.2191704594944272e-02 5.0749603414497867e-03 run_forces: ! |2 - 1 4.8779602458416489e-03 2.4167235416423243e-04 5.8194904228117369e-04 - 2 3.8219046216389241e-06 -1.1278571464746119e-03 -5.3194108737420112e-06 - 3 1.4420451326719666e-03 1.0789598971605156e-03 8.6688922192258515e-04 - 4 -1.1974684890799616e-04 -6.3663796799752221e-04 -5.0434813898866634e-04 - 5 4.1926845981048714e-04 -1.7686339999561645e-03 1.0539619591224379e-04 - 6 4.3576972844038084e-03 -1.3882149719460883e-03 -1.3616194080329750e-04 - 7 4.5212058755108350e-04 9.3883355301563895e-04 -1.6310591540156755e-03 - 8 -2.2302146046123414e-03 3.5790324521175637e-03 -9.7121760766989782e-04 - 9 -1.0550533635039201e-04 4.0156054939886621e-04 -9.5829490460631883e-04 - 10 8.5916672576631214e-04 1.4337462634341999e-03 -1.2745681621108272e-03 - 11 3.2696648572825849e-04 6.3517034152612753e-05 -1.0047641759833470e-04 - 12 -7.4690432551832698e-04 9.7559633855103531e-04 2.3309081974175655e-04 - 13 -8.1087278313617030e-04 -5.4431538064706191e-04 4.6238493027678620e-04 - 14 -1.3616269035648270e-03 -1.6114550030841903e-04 1.1930419316555066e-03 - 15 -1.2988356048942603e-03 -1.3783875198096138e-04 2.7166385519536635e-04 - 16 -4.0216418867975449e-04 8.2820608601573767e-04 -1.4197354103451449e-03 - 17 -6.5426067848996087e-04 2.9465377932046420e-04 8.4324801540805201e-04 - 18 -2.7890073788538919e-03 -5.0435458655068259e-03 4.5580195167431404e-03 - 19 3.3464587924712261e-05 -5.7671397258467865e-05 2.9174099395921818e-04 - 20 -1.4410679478107482e-04 -1.5109108725904223e-04 6.3206967430658374e-05 - 21 -1.5562595549768990e-03 1.7392533542833746e-03 1.7660916000341450e-03 - 22 3.3036353864837681e-05 7.1080653361986140e-05 -7.6107800450805168e-06 - 23 -6.1088350185363964e-05 2.9256205868140015e-05 -4.5685106771347217e-05 - 24 -1.3147368971916822e-03 -1.5225200528371987e-03 -2.6445898558296044e-03 - 25 -3.5875110481443001e-04 -1.8006883640044865e-04 -7.0409438339007896e-04 - 26 -1.0135572040521528e-04 -9.8728435343067203e-06 -1.1820795924276317e-04 - 27 1.1809009905794216e-03 8.4667862926581135e-04 -6.0614495192442251e-04 - 28 5.4684599143430459e-05 9.5202149420063522e-05 -1.5520338657392948e-05 - 29 1.4303717454981147e-05 1.1216450257687707e-04 -9.3688567688039523e-05 + 1 4.9179753566963623e-03 2.7880489306387872e-04 6.2451091398125981e-04 + 2 1.5854909784693434e-05 -1.1402946851361111e-03 -5.2217988611027067e-06 + 3 1.4279481248264962e-03 1.0683802571273572e-03 8.8606581800090031e-04 + 4 -1.5012931965780379e-04 -6.6185551501038832e-04 -5.2517397188308528e-04 + 5 4.2578739735561495e-04 -1.7745394639823119e-03 9.8868837644475391e-05 + 6 4.3235868463184857e-03 -1.3586411567116225e-03 -1.3396944270398250e-04 + 7 4.3753444912876337e-04 9.2607441416307171e-04 -1.6528191277804705e-03 + 8 -2.1201753422247609e-03 3.6349084228465339e-03 -9.8211911947676338e-04 + 9 -1.1587242802233657e-04 4.1035529809133162e-04 -9.6935890809456268e-04 + 10 8.6095630567445815e-04 1.4173796945384117e-03 -1.2701531539121924e-03 + 11 3.2603200746467203e-04 5.1885777228767506e-05 -1.0016376375038365e-04 + 12 -7.1482775893599013e-04 9.9824809293107383e-04 2.3529271298241682e-04 + 13 -8.4365866469579521e-04 -5.5321455402244663e-04 4.7712890865149910e-04 + 14 -1.3726007294188477e-03 -1.5879826923401145e-04 1.2072958162163724e-03 + 15 -1.3469908790780011e-03 -1.8203963229455804e-04 2.8970371756166779e-04 + 16 -4.0108174617012722e-04 8.2623100851197636e-04 -1.4325148797109583e-03 + 17 -6.6549024650506606e-04 2.9991925168686666e-04 8.3898344933492686e-04 + 18 -2.7843338894779721e-03 -5.0381414640097294e-03 4.5449454846909244e-03 + 19 4.5445732970835383e-05 -4.6532019157102453e-05 2.8777033593681425e-04 + 20 -1.5787395375523576e-04 -1.6303764211468081e-04 6.3060612117585104e-05 + 21 -1.5547242092208281e-03 1.7263932864537283e-03 1.7680189528462462e-03 + 22 3.5591731252474187e-05 7.3726925789800106e-05 -9.5979872417651088e-06 + 23 -6.1732560714860052e-05 3.0337632776569072e-05 -4.9360526912293699e-05 + 24 -1.3087697637068068e-03 -1.5319050774376809e-03 -2.6346755697571412e-03 + 25 -3.7512947791779592e-04 -1.8922680576827743e-04 -7.2416326476211642e-04 + 26 -9.3460624522841837e-05 2.5432353610204029e-07 -1.1542588855396935e-04 + 27 1.1802069090204258e-03 8.4376995195380167e-04 -6.0324467398612522e-04 + 28 5.0738209800477895e-05 9.5805573030583130e-05 -1.9585067238333448e-05 + 29 1.9193613731309914e-05 1.1575148114906841e-04 -9.4098415339843714e-05 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml index 3c550f4a7..9a84104b0 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 4 00:08:57 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -58,38 +58,38 @@ init_forces: ! |2 27 -1.0468877328824875e+00 9.2905066770498319e+00 -3.6991349617673341e+00 28 8.5365856050054738e+00 -2.4636423220451302e+00 4.2276358718634395e+00 29 -3.8831706532739356e+00 -5.2900046950811053e+00 -1.5026494435836046e+00 -run_vdwl: 102.201551627136 -run_coul: -113.741038555643 +run_vdwl: 557.065052509673 +run_coul: -128.962676495281 run_stress: ! |2- - 4.0014600129344200e+02 4.7040479159512131e+02 2.6187982187362940e+02 -3.3090359512659597e+02 -8.0167395608208707e+01 1.2621079474133124e+02 + 1.3827058216866565e+03 1.6513055817059324e+03 3.5578975730219054e+03 -1.0466349203417344e+03 -1.9198520770024712e+02 6.8418126100260508e+02 run_forces: ! |2 - 1 3.1753236607870527e+01 8.3621965560621064e+01 3.0316315705469126e+01 - 2 1.4286521816346817e-01 -2.2824033053781676e+00 -7.5551028598716607e-01 - 3 -2.3574844485150459e+02 9.7602108049923189e+01 8.4388085098137793e+01 - 4 -8.8996147506143097e-02 3.2157993972313093e-01 -2.6834896820998838e-01 - 5 -5.1176916574565534e-01 6.2243255603457825e-01 3.0305994432614902e-01 - 6 1.0988105846786355e+02 -9.6340673534605699e+01 -1.2877648279860219e+02 - 7 4.4591402242519891e+00 -1.1562262283680836e+01 -3.8449891020868478e+01 - 8 -1.8500965167232737e+00 3.2142650056503392e+01 1.0393367138995389e+02 - 9 1.6031489636542831e+00 -6.7043927734105306e+00 9.3597428383141301e-01 - 10 3.9843477308596469e+01 -6.6883715988133289e+01 -8.8591575899663255e+01 - 11 -1.2251023797384710e+00 1.4050643967343674e+00 -8.2053525232354940e-01 - 12 2.1038151524680664e+01 1.6333275303649856e+01 -1.0224098598118850e+01 - 13 -3.5460666553890013e-01 3.4985635732495085e-01 -2.8587446855444615e-01 - 14 -1.5532009832170448e+00 6.6724072634342102e-01 -4.7736439663808239e-01 - 15 1.8618156771424255e-01 -1.8742423255956700e-01 -1.0508719656263246e+00 - 16 5.0203980325375476e+01 -6.4427827617601864e+01 1.3348341161221096e+01 - 17 -1.7324426977223428e+01 1.5943360667512028e+01 3.6242060039458565e+01 - 18 -5.1241102539663741e-01 4.6504778154450488e+00 -7.5635987942225089e+00 - 19 2.1299065183839345e+00 -1.7007859776984058e+00 6.5142740712969927e+00 - 20 -3.2615904151011352e+00 -5.6090817211786161e+00 4.2429891830803017e+00 - 21 8.0725664470101466e-01 3.0937836217001409e+00 -7.2913744396245024e+00 - 22 3.9626147738858628e+00 1.5703953178352748e+00 4.8509809061089939e+00 - 23 -7.0701622215717324e+00 -4.4624511069210673e+00 2.0542173473160599e+00 - 24 -9.5073882777578100e-01 8.5254907477746880e+00 -5.0322651147010440e+00 - 25 5.5723193594212104e+00 -7.0640302764433882e-01 4.4527213493097140e+00 - 26 -4.8649545576039950e+00 -7.4562686931111752e+00 -1.0189291230630704e+00 - 27 -1.5560829938132452e+00 9.3812896556818455e+00 -3.7919414490477714e+00 - 28 8.9221125088199820e+00 -2.5727956403610084e+00 4.4191995401320501e+00 - 29 -3.6328662849226316e+00 -5.3344848705224015e+00 -1.6032274443909087e+00 + 1 1.3438375342158926e+02 3.9110642816251857e+02 1.4372190752714806e+02 + 2 8.4106429095207311e-02 -3.3170823758015047e+00 -1.2959311762410586e+00 + 3 -1.4344519989621637e+02 -3.7987708230672075e+02 -1.3597977808226500e+02 + 4 2.0104083565832373e-01 2.0190452848197293e-01 -1.9461145938896965e-01 + 5 -4.0783322633016794e-01 6.8277414844865625e-01 -7.6705006700348827e-02 + 6 -8.0186615694034811e+02 9.1519516082735095e+02 1.0260114500036984e+03 + 7 5.5599248138592777e+01 -3.1060621462072316e+02 -1.5710870401814741e+03 + 8 2.0820415305744132e+02 -1.2566267816593898e+01 7.2888746099816581e+02 + 9 1.6417569373062881e+00 -5.6607012881361740e+00 1.5389913561632200e+00 + 10 5.1708870955116777e+02 -6.0320283822349461e+02 -1.9112447363246730e+02 + 11 -1.0678895715239982e+00 1.3261191283663689e+00 -5.3274878367629763e-01 + 12 2.5353982133768074e+01 1.5685564372515525e+01 -1.2430711943419782e+01 + 13 -3.8442948493060969e-01 1.8389867493075468e-01 -1.7991908306243917e-01 + 14 -1.2584695970769821e+00 5.7738186359033883e-01 -2.9305045282072617e-01 + 15 2.0536323499005485e-01 -1.2706294654252201e-01 -9.9768424692172109e-01 + 16 4.3290461801079573e+02 -3.1045390201206732e+02 -1.1106965200034711e+03 + 17 -4.2667759403527555e+02 3.0193026655083895e+02 1.1235226337920615e+03 + 18 6.1082968433295110e-02 4.7333706242967715e+00 -8.3869246946931550e+00 + 19 1.7492231619269210e+00 -1.5857723664399319e+00 6.5897569891026793e+00 + 20 -3.2978359425201340e+00 -5.6022684398528027e+00 4.7827042879418062e+00 + 21 9.3464341888466151e-01 3.1326595138308151e+00 -7.8329702964580425e+00 + 22 3.7261519509645886e+00 1.4172437328149747e+00 5.0324960189488532e+00 + 23 -6.8415441457481441e+00 -4.4532263102842933e+00 2.2887846661504776e+00 + 24 -8.9099229952160253e-01 7.8521000920890973e+00 -3.8246236083932734e+00 + 25 5.0643483846258022e+00 -9.2686987131123955e-01 4.2180069472530741e+00 + 26 -4.6718698060965753e+00 -7.1817047510844354e+00 -6.8611498689473316e-01 + 27 -1.0648453522271635e+00 9.2994377672447701e+00 -3.6891448565432285e+00 + 28 8.5542886626843373e+00 -2.4660445253370153e+00 4.2306093701903063e+00 + 29 -3.8818100001089704e+00 -5.2972721329290016e+00 -1.5158494619329801e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml index 7b334554b..1e43c1f82 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -68,38 +68,38 @@ init_forces: ! |2 27 -1.5292288824966405e+00 7.3670370809055621e+00 -2.7248017347638225e+00 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 -run_vdwl: 102.179240398644 -run_coul: 221.720424546992 +run_vdwl: 557.056030476991 +run_coul: 220.91388439321 run_stress: ! |2- - 3.9536843184623075e+02 4.7478735082143152e+02 2.6697778872541824e+02 -3.2473557133602441e+02 -9.3384532451696117e+01 1.1447113381864786e+02 + 1.3775223750599198e+03 1.6566888200245041e+03 3.5747572154246241e+03 -1.0386782389667430e+03 -2.0694915325068985e+02 6.6732651501863472e+02 run_forces: ! |2 - 1 3.2379540774112940e+01 8.3517527414743427e+01 3.0446322576408370e+01 - 2 -2.6293126959640789e-01 -1.8753551336903787e+00 -6.6074949251544546e-01 - 3 -2.3593857243623478e+02 9.7836073928631833e+01 8.4490011242546615e+01 - 4 -3.7637774235278060e-01 1.4515275288094828e-01 -2.8559910145119410e-01 - 5 -6.8204117190800306e-01 6.2446578533889874e-01 2.7378988248683184e-01 - 6 1.0933365729165321e+02 -9.6549045037005016e+01 -1.2841653298209613e+02 - 7 4.9593737826049917e+00 -1.0982207225663631e+01 -4.0074345311087725e+01 - 8 -1.6165014052240547e+00 3.2404345058645795e+01 1.0398184289445268e+02 - 9 1.3998347047175768e+00 -6.8051250780067472e+00 5.7998397476985875e-01 - 10 3.9959095982478168e+01 -6.7059878898971292e+01 -8.8447803032655685e+01 - 11 -1.0802301059782982e+00 1.1219888940584297e+00 -8.4425239997392743e-01 - 12 2.0545804720403741e+01 1.6756506821178750e+01 -1.0147383979092723e+01 - 13 -4.0343321874813348e-02 1.7788265176798995e-01 -2.9853594465807470e-01 - 14 -1.3513516710629265e+00 4.4595934938156750e-01 -2.6265884551665236e-01 - 15 3.1593487998441483e-01 -2.5515183537208080e-01 -1.0797891014048080e+00 - 16 5.1256244569865018e+01 -6.6172009677024661e+01 1.2070939136664409e+01 - 17 -1.7692907416727866e+01 1.6463320315378233e+01 3.6795640394681172e+01 - 18 -1.6194696510616974e-01 4.5570017780853052e+00 -7.3322970257924407e+00 - 19 2.3514102714689615e+00 -7.5578860560606387e-01 5.6642936508687214e+00 - 20 -2.8597552719569386e+00 -3.9142546520933768e+00 3.6472607860602464e+00 - 21 1.4156882123083809e+00 3.1994560956847562e+00 -6.4435678999424217e+00 - 22 4.7559025720967556e+00 1.1887804903972874e+00 5.7934257053883416e+00 - 23 -6.5791547151845498e+00 -3.9974753494116477e+00 1.1725336611476698e+00 - 24 -1.2476216693532436e+00 7.0412609028878901e+00 -3.7704984044487455e+00 - 25 5.3901883576076450e+00 -3.4508321180203627e-01 4.2395901334590524e+00 - 26 -4.6303654307411399e+00 -6.8134281037859301e+00 -1.0346808880595877e+00 - 27 -1.8378768075421317e+00 7.4880775093473533e+00 -2.6847264242122688e+00 - 28 6.6966633089203391e+00 -2.2313684816363604e+00 4.2842114180410844e+00 - 29 -4.4013620273780845e+00 -5.2116284583392112e+00 -1.6564246240672249e+00 + 1 1.3484812617575406e+02 3.9092060908116650e+02 1.4373313186999437e+02 + 2 -2.0271633709568476e-01 -2.8298288761956423e+00 -1.1989313018422760e+00 + 3 -1.4342325174055713e+02 -3.7982436396313483e+02 -1.3597762518906370e+02 + 4 -8.2852639170312839e-02 1.8300393499842461e-02 -2.3762389449286375e-01 + 5 -5.4791673481254732e-01 6.5614563468856779e-01 -6.3941396758903993e-02 + 6 -8.0227485954791564e+02 9.1496525050525736e+02 1.0264249558300912e+03 + 7 5.5771542735465054e+01 -3.1037336726230450e+02 -1.5711704577668090e+03 + 8 2.0819248556765436e+02 -1.2101254281688261e+01 7.2875382923317341e+02 + 9 1.5634160486512318e+00 -5.8771942140939055e+00 1.3776856876345804e+00 + 10 5.1715702524063988e+02 -6.0329367024604721e+02 -1.9113876792726958e+02 + 11 -9.4002639917994568e-01 1.0582108302448794e+00 -5.6167252695046399e-01 + 12 2.4863938867166016e+01 1.6062869875084793e+01 -1.2360609625898558e+01 + 13 -7.5840697146929953e-02 4.0077788713113287e-02 -1.8559573885665315e-01 + 14 -1.0625298051164564e+00 3.6955553582007694e-01 -1.0916767715816915e-01 + 15 3.5311739874004949e-01 -1.9448880341844976e-01 -1.0191647907497523e+00 + 16 4.3394626801693573e+02 -3.1219927017642328e+02 -1.1116473874381602e+03 + 17 -4.2707030283376548e+02 3.0243865797177563e+02 1.1237993836385190e+03 + 18 3.0368404844222635e-01 4.7171896888581104e+00 -7.8295030918480828e+00 + 19 2.0270801847430087e+00 -6.9918333167659397e-01 5.5492247587169610e+00 + 20 -2.8995874776653414e+00 -3.9821844731834624e+00 4.0840163265257070e+00 + 21 1.5208456586487942e+00 3.1993261879629280e+00 -6.7421857269435970e+00 + 22 4.4874876087889790e+00 1.0719243022009861e+00 5.8233438927261929e+00 + 23 -6.3183698445659342e+00 -3.9593735948101023e+00 1.3084674471388333e+00 + 24 -1.1079754642593542e+00 6.8112748289396228e+00 -3.6957336164134329e+00 + 25 5.0093760593140946e+00 -5.0836369922018387e-01 3.9583976051551146e+00 + 26 -4.3931344945026183e+00 -6.5025659801902629e+00 -8.3304413261248733e-01 + 27 -1.5441431651250574e+00 7.3753658402581390e+00 -2.7159697072843980e+00 + 28 6.4199810218643059e+00 -2.1795392395603654e+00 4.1762085294336435e+00 + 29 -4.5208674519292567e+00 -5.1801103225235723e+00 -1.5012632699970143e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml index 254b45b51..fc4d8f870 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:19:13 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -38,7 +38,7 @@ natoms: 29 init_vdwl: 0.0532418429363291 init_coul: 25.1120046635773 init_stress: ! |- - -1.1823845649927931e+00 -4.2392955721273395e+00 -3.0504224276732574e+00 1.3375722516580166e+00 -4.6999744312072966e-01 1.0363313128899019e+00 + -1.1823845649927935e+00 -4.2392955721273395e+00 -3.0504224276732574e+00 1.3375722516580162e+00 -4.6999744312072916e-01 1.0363313128899019e+00 init_forces: ! |2 1 2.2512096861770253e-01 -1.8740688078761694e-01 2.2052104900950886e-01 2 1.3173879266315808e-01 -3.0359264792129725e-01 -3.7090396697507122e-01 @@ -59,48 +59,48 @@ init_forces: ! |2 17 -3.6848559949347010e-01 8.6366272148906253e-01 -7.1321686785098026e-01 18 8.3610843147371369e-03 4.8341177598296525e-01 -3.5186167592372880e-01 19 -2.0989444325957580e-02 -2.8996329236732543e-01 3.3842448506500600e-01 - 20 -6.2897495577854026e-02 -1.8216250555647226e-01 2.6861492030483108e-01 - 21 2.6667761816071455e-02 2.4610772454403823e-01 -3.1483931015868893e-01 - 22 1.0695109869553227e-01 -2.8187422421879341e-02 2.4837146666322471e-01 + 20 -6.2897495577854026e-02 -1.8216250555647229e-01 2.6861492030483108e-01 + 21 2.6667761816071459e-02 2.4610772454403823e-01 -3.1483931015868893e-01 + 22 1.0695109869553232e-01 -2.8187422421879341e-02 2.4837146666322471e-01 23 -1.8131317693295523e-01 -1.7012181853891384e-01 1.2626515451131032e-01 24 -2.2408122810289834e-02 4.0182710900117258e-01 -1.9972843596474568e-01 - 25 7.2496306885383888e-02 -1.2398014854290455e-01 8.9356605678754406e-02 - 26 -1.1843155896821461e-01 -3.0524787880164289e-01 3.2179839155708233e-02 + 25 7.2496306885383902e-02 -1.2398014854290454e-01 8.9356605678754406e-02 + 26 -1.1843155896821461e-01 -3.0524787880164284e-01 3.2179839155708233e-02 27 -1.2560375316578029e-01 4.3585239984075247e-01 -1.6791098393172349e-01 - 28 2.1929824730708886e-01 -1.8521499231588329e-01 1.7256183204536221e-01 + 28 2.1929824730708886e-01 -1.8521499231588326e-01 1.7256183204536221e-01 29 -4.1398301000284597e-02 -2.4960242874190633e-01 -1.0023685346890519e-02 -run_vdwl: 0.0528000604213919 -run_coul: 25.020401368015 +run_vdwl: 0.053197202996133 +run_coul: 25.1032924856292 run_stress: ! |- - -1.2152682106213510e+00 -4.2383992440977636e+00 -3.0137001241100956e+00 1.3161599582310535e+00 -5.0255833152626950e-01 1.0102620792386101e+00 + -1.1856867406701521e+00 -4.2391316930158291e+00 -3.0468277969956912e+00 1.3354423157961397e+00 -4.7326789214355075e-01 1.0337076519425354e+00 run_forces: ! |2 - 1 2.2521603387743647e-01 -1.8768935702268316e-01 2.1886000788395826e-01 - 2 1.2340816471539112e-01 -3.0369376464518449e-01 -3.6875522119889853e-01 - 3 -9.9864462701352245e-03 2.9690554208496008e-03 1.1524202877801546e-02 - 4 -1.4728603073137763e-02 6.2827922080486195e-04 -3.9702747729673617e-02 - 5 -7.9292408907535597e-02 7.5862894949764198e-02 -7.0207335780499598e-03 - 6 1.3538119212001773e-01 -4.4364841265574684e-01 -1.6906101357078565e-01 - 7 -1.7710564831626134e-02 8.1461218390717835e-02 3.2061074065082196e-01 - 8 -2.1733155328519646e-01 5.2862513141878864e-01 1.1907694319246311e-01 - 9 2.3839745632641282e-01 -6.9119717534365765e-01 4.1971468039517601e-01 - 10 -2.9204353950307196e-02 3.0734531326734569e-02 -4.8221384800030243e-02 - 11 -1.2363687190505000e-01 1.4559085646736353e-01 -7.1753737579386037e-02 - 12 4.2351996560435773e-01 -8.6898582839451829e-02 2.1697353561224830e-01 - 13 9.6748041071259908e-03 -7.6716592550597216e-03 -2.5991964832502584e-02 - 14 -1.3960825609450481e-01 4.8558116820824400e-02 -3.8385674416581701e-02 - 15 4.9534988628362961e-02 -5.3091041865985103e-03 -1.3593867154429479e-01 - 16 -6.5198253620668667e-02 -9.7876170924149325e-02 8.2979949003467765e-02 - 17 -3.7104646597329349e-01 8.7500032779300763e-01 -7.1960058607560573e-01 - 18 -6.6967730021862118e-03 4.6923953918731032e-01 -3.3146459455844518e-01 - 19 3.1353838600166276e-03 -2.7351794216199476e-01 3.4689711564813464e-01 - 20 -7.0674586855426783e-02 -1.8364790640371656e-01 2.3996414120374035e-01 - 21 2.7268030087815295e-02 2.3399931058463413e-01 -3.0605349636359641e-01 - 22 1.1864259704565838e-01 -1.9118895956294703e-02 2.4611128870225038e-01 - 23 -1.9316245289829134e-01 -1.6826372577694942e-01 1.1892678284838995e-01 - 24 -2.8255860984460084e-02 3.9814298046803465e-01 -2.0115633039130043e-01 - 25 7.9352259442701759e-02 -1.1812225604002058e-01 9.9162084213316751e-02 - 26 -1.1769705717312680e-01 -3.0474249942492926e-01 2.7843846870852451e-02 - 27 -1.3066130483271576e-01 4.3788740168428864e-01 -1.6027445220157291e-01 - 28 2.2238377862636136e-01 -1.8583567315176039e-01 1.6966056472713356e-01 - 29 -4.1022840783995984e-02 -2.5146651794492630e-01 -1.4925274989030790e-02 + 1 2.2515759181189710e-01 -1.8744081780322747e-01 2.2036083375471624e-01 + 2 1.3088182258500233e-01 -3.0359798084820050e-01 -3.7069639883669325e-01 + 3 -1.0109638426236914e-02 3.5137314787161630e-03 1.1876223781697807e-02 + 4 -1.6029003405172097e-02 5.8211219889801131e-04 -3.9265801968439797e-02 + 5 -8.0282863602622115e-02 7.5479013603448261e-02 -6.6373779008253603e-03 + 6 1.3814111413269586e-01 -4.4827805590549635e-01 -1.7556273816352397e-01 + 7 -2.0419146078490578e-02 8.5846439276159800e-02 3.3079236027032338e-01 + 8 -2.2443687887198313e-01 5.3058309539118753e-01 1.1939332950980001e-01 + 9 2.4010403911190709e-01 -6.8414645526220441e-01 4.1264211187801092e-01 + 10 -2.8898580291097004e-02 3.0933311552927105e-02 -4.7699628489899143e-02 + 11 -1.2379045024933663e-01 1.4513573670835719e-01 -7.3339099686212494e-02 + 12 4.2351853639278397e-01 -8.8115485775300748e-02 2.1713419854490379e-01 + 13 1.0946230077514855e-02 -6.8620803282392270e-03 -2.6225569166600772e-02 + 14 -1.3920791669730190e-01 4.7721194422916932e-02 -4.0488531618032071e-02 + 15 4.7881176034794082e-02 -3.0946420686009330e-03 -1.3358634801786293e-01 + 16 -6.5681777285234014e-02 -9.5917716175049281e-02 8.3361518261437118e-02 + 17 -3.6870254073736414e-01 8.6472569858423276e-01 -7.1381515161261344e-01 + 18 6.8838287537187036e-03 4.8207425398923148e-01 -3.4980885101559767e-01 + 19 -1.8549963379690799e-02 -2.8834276686988675e-01 3.3934741639311172e-01 + 20 -6.3721619074029082e-02 -1.8234302462573818e-01 2.6567123372901674e-01 + 21 2.6729746690178722e-02 2.4491417137829163e-01 -3.1397663847033719e-01 + 22 1.0812637308037400e-01 -2.7274015558010685e-02 2.4816216350183623e-01 + 23 -1.8250661316660058e-01 -1.6995822070622135e-01 1.2553191522711452e-01 + 24 -2.3012819270894842e-02 4.0149682819531080e-01 -1.9991065955281512e-01 + 25 7.3198317364363802e-02 -1.2341417165153418e-01 9.0369299068891157e-02 + 26 -1.1835690996305653e-01 -3.0520828965041896e-01 3.1760585617696020e-02 + 27 -1.2610197423468816e-01 4.3606560274790129e-01 -1.6715235430730835e-01 + 28 2.1960326248825138e-01 -1.8527786781275643e-01 1.7227536758576417e-01 + 29 -4.1363343789683142e-02 -2.4979959848669397e-01 -1.0513408317558107e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml index cab2e7c3c..9a642affa 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -68,38 +68,38 @@ init_forces: ! |2 27 -1.5292288657572302e+00 7.3670372933400197e+00 -2.7248019284366976e+00 28 6.4035005649493479e+00 -2.1779026033513014e+00 4.1727097093108574e+00 29 -4.5201927345996555e+00 -5.1735150000565087e+00 -1.4886414114327997e+00 -run_vdwl: 102.179240281819 -run_coul: 221.72043369007 +run_vdwl: 557.056030469831 +run_coul: 220.913919083366 run_stress: ! |2- - 3.9536844685406197e+02 4.7478735366545340e+02 2.6697778712793865e+02 -3.2473556197508509e+02 -9.3384529246395616e+01 1.1447113568800172e+02 + 1.3775223934446942e+03 1.6566888251808541e+03 3.5747572317224108e+03 -1.0386782354472311e+03 -2.0694914638197031e+02 6.6732651943459655e+02 run_forces: ! |2 - 1 3.2379539694040083e+01 8.3517527420396235e+01 3.0446322003427230e+01 - 2 -2.6293176067774748e-01 -1.8753559256825343e+00 -6.6074805412350757e-01 - 3 -2.3593857200361191e+02 9.7836073260611272e+01 8.4490010947326468e+01 - 4 -3.7637798569411851e-01 1.4515335713562016e-01 -2.8559897785164967e-01 - 5 -6.8204117043071300e-01 6.2446673118754414e-01 2.7379021833098716e-01 - 6 1.0933366022646435e+02 -9.6549048092587924e+01 -1.2841653624074331e+02 - 7 4.9593739734408855e+00 -1.0982206357338827e+01 -4.0074341840062111e+01 - 8 -1.6165053869904651e+00 3.2404346873061620e+01 1.0398184151912643e+02 - 9 1.3998364906824199e+00 -6.8051265118796431e+00 5.7998551394435172e-01 - 10 3.9959095810012961e+01 -6.7059878243072802e+01 -8.8447802744729799e+01 - 11 -1.0802302719514865e+00 1.1219894748386876e+00 -8.4425247683472560e-01 - 12 2.0545804874003100e+01 1.6756506862182029e+01 -1.0147384903004356e+01 - 13 -4.0343127361420671e-02 1.7788248239998272e-01 -2.9853580182052586e-01 - 14 -1.3513519617740402e+00 4.4595903368860967e-01 -2.6265873012314578e-01 - 15 3.1593459896798887e-01 -2.5515203222240529e-01 -1.0797884994466638e+00 - 16 5.1256243181143134e+01 -6.6172008507524183e+01 1.2070943382988711e+01 - 17 -1.7692905581269478e+01 1.6463320079069746e+01 3.6795635735036896e+01 - 18 -1.6194608116032930e-01 4.5570024281493904e+00 -7.3322988040856369e+00 - 19 2.3514081526937800e+00 -7.5579018716331670e-01 5.6642935667801204e+00 - 20 -2.8597532637256351e+00 -3.9142531545167625e+00 3.6472614532374061e+00 - 21 1.4156879408475120e+00 3.1994561323777044e+00 -6.4435674872296671e+00 - 22 4.7559002343686556e+00 1.1887791928870963e+00 5.7934241510228901e+00 - 23 -6.5791517502191210e+00 -3.9974743969812185e+00 1.1725342766620361e+00 - 24 -1.2476217506160352e+00 7.0412610417789230e+00 -3.7704986625434631e+00 - 25 5.3901862848597801e+00 -3.4508437671681635e-01 4.2395892090132064e+00 - 26 -4.6303631204520315e+00 -6.8134266068066900e+00 -1.0346794667680241e+00 - 27 -1.8378773182657191e+00 7.4880773687654925e+00 -2.6847264500512029e+00 - 28 6.6966605937639985e+00 -2.2313693477537879e+00 4.2842101037191496e+00 - 29 -4.4013595210884091e+00 -5.2116279982831486e+00 -1.6564229411980371e+00 + 1 1.3484812458193562e+02 3.9092060820272775e+02 1.4373313060925250e+02 + 2 -2.0271724576864500e-01 -2.8298293703098536e+00 -1.1989296849899209e+00 + 3 -1.4342325159697427e+02 -3.7982436406208285e+02 -1.3597762532698775e+02 + 4 -8.2852557682836489e-02 1.8300839390364997e-02 -2.3762369428769306e-01 + 5 -5.4791649880925075e-01 6.5614654605115452e-01 -6.3941225083457814e-02 + 6 -8.0227486025518272e+02 9.1496525076695025e+02 1.0264249542249584e+03 + 7 5.5771542841519476e+01 -3.1037336688986818e+02 -1.5711704598747106e+03 + 8 2.0819248477299502e+02 -1.2101254493941784e+01 7.2875383137572339e+02 + 9 1.5634176673212918e+00 -5.8771950641449795e+00 1.3776873851251876e+00 + 10 5.1715702534091861e+02 -6.0329366985338106e+02 -1.9113876860769739e+02 + 11 -9.4002654695067100e-01 1.0582116371163433e+00 -5.6167245691268242e-01 + 12 2.4863939238898698e+01 1.6062869954522981e+01 -1.2360610768592334e+01 + 13 -7.5840544665858420e-02 4.0077591041632957e-02 -1.8559566471961014e-01 + 14 -1.0625300502140214e+00 3.6955525891777913e-01 -1.0916740089156407e-01 + 15 3.5311725764940138e-01 -1.9448901674478278e-01 -1.0191642654205224e+00 + 16 4.3394626824611737e+02 -3.1219927079095663e+02 -1.1116473869680606e+03 + 17 -4.2707030268639977e+02 3.0243865798515020e+02 1.1237993834250688e+03 + 18 3.0368465053262250e-01 4.7171897376749774e+00 -7.8295045691114238e+00 + 19 2.0270781964195321e+00 -6.9918483689541933e-01 5.5492243019673921e+00 + 20 -2.8995854438015898e+00 -3.9821831016261662e+00 4.0840171235891640e+00 + 21 1.5208453377454156e+00 3.1993263793291407e+00 -6.7421852744799429e+00 + 22 4.4874850856125166e+00 1.0719228880003933e+00 5.8233424639110787e+00 + 23 -6.3183668431688318e+00 -3.9593725025428363e+00 1.3084682986869924e+00 + 24 -1.1079754399775081e+00 6.8112751692510498e+00 -3.6957337923580944e+00 + 25 5.0093745613577711e+00 -5.0836446005267644e-01 3.9583974028947910e+00 + 26 -4.3931323238960998e+00 -6.5025646047626475e+00 -8.3304266442571762e-01 + 27 -1.5441431926990006e+00 7.3753659769975322e+00 -2.7159698341830385e+00 + 28 6.4199783043718526e+00 -2.1795401460420911e+00 4.1762072379295017e+00 + 29 -4.5208648572036525e+00 -5.1801097397697644e+00 -1.5012617761955023e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_expand.yaml b/unittest/force-styles/tests/mol-pair-lj_expand.yaml index 87c2403f4..4732d26d9 100644 --- a/unittest/force-styles/tests/mol-pair-lj_expand.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_expand.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 14:23:58 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 8.0791097396502110e+01 -3.4145820848332988e+02 1.3823799113869208e+02 28 -2.7341726154320116e+02 1.1750274135971229e+02 -1.8499697414648216e+02 29 1.9263223000268806e+02 2.2396045020016581e+02 4.6755745272658565e+01 -run_vdwl: 105.769870653234 +run_vdwl: 803.724793123497 run_coul: 0 run_stress: ! |2- - 5.5919886341401138e+02 5.9056277429748297e+02 3.1556412799897203e+02 -3.2712598325824143e+02 -5.7456535749279233e+01 1.3388321144586834e+02 + 2.5304401272819955e+03 2.3885464610512931e+03 6.2026324553844561e+03 -7.3991414666775518e+02 -9.2728731427343305e+01 9.6357546380783651e+02 run_forces: ! |2 - 1 1.2622577840854714e+01 7.2306152095506903e+01 5.1769027477994335e+01 - 2 1.5111286588611829e+01 1.1521466961735610e+01 -1.8434221843849684e+01 - 3 -2.9785865257622436e+02 1.5761055970006069e+02 1.0159294246172287e+02 - 4 -4.3795721911063037e+00 1.5878306538385780e+00 -3.1596999407686672e+00 - 5 -9.5071790273647028e-01 -1.4384908245629466e+00 5.4249439302793379e+00 - 6 1.9467784787513247e+02 -1.6889033651714735e+02 -1.5959182509696740e+02 - 7 5.5989145131974816e-01 -2.9221015393805496e+00 -1.4498033502167790e+01 - 8 -3.0623870714029255e+01 3.0924217565886220e+01 4.0597797245425369e+01 - 9 8.5808028467165798e+00 1.0656401306446934e+01 3.9380906132616040e+01 - 10 7.1399064824194994e+01 -7.6240017026572815e+01 -6.2756068590520222e+01 - 11 -3.6075629424513789e+00 -4.5730802480655965e+00 -9.2804470665442800e+00 - 12 6.6930673996903005e+00 5.1681293769967382e+00 -3.7755027135657038e+00 - 13 3.5483144276309622e+00 -1.3439679938041256e+00 -5.3395540960037874e-02 - 14 -1.3689466943334485e+00 2.2046638215986786e-01 -3.4984532715968801e+00 - 15 -1.8924963590809024e-01 4.0245776731453899e+00 1.5176965343067166e+00 - 16 3.1183467182781921e+01 -4.2137510917953882e+01 1.9157672319256250e+01 - 17 -5.3668488492829391e+00 3.5478069644324060e+00 1.5597950165237275e+01 - 18 -1.6449475041133567e-02 -2.6608771633793087e-02 2.2963405901219255e-02 - 19 2.3563475613184851e-04 -5.7083898477123822e-06 1.0194085847430878e-03 - 20 -6.1262823675532394e-04 -5.9264442034338664e-04 2.2734457428664768e-04 - 21 -6.5968572733843196e+00 -8.4218337453890193e+00 2.8199418649066065e+01 - 22 -1.3103053873612744e+01 -3.1051875366645176e+00 -2.1422496054647837e+01 - 23 1.9691608113258347e+01 1.1536423242212930e+01 -6.7678787066037884e+00 - 24 9.6021427524893372e+00 -2.5736123640772611e+01 1.7476473623252115e+01 - 25 -2.1697758784945854e+01 4.1408174402756943e+00 -1.8717977235982890e+01 - 26 1.2083784780634586e+01 2.1585943205769777e+01 1.2200057474152532e+00 - 27 1.3277093755251768e+00 -2.8209541991146107e+01 7.8324357336334520e+00 - 28 -1.7285320765557636e+01 8.1620186911777957e+00 -1.1711536653507673e+01 - 29 1.5963673213253486e+01 2.0052587846257904e+01 3.8760560384175684e+00 + 1 -4.4893098860429525e+01 2.2746491096886214e+02 3.3238396844234887e+02 + 2 1.6869016146051172e+02 1.3891057618737318e+02 -1.9803780910775083e+02 + 3 -1.2322894663810673e+02 -3.6054155521471591e+02 -1.3468219384771822e+02 + 4 -3.8160323795217863e+00 1.0270324145911112e+00 -2.7205766811127363e+00 + 5 -1.2918915927644710e+00 -2.1137832483271835e+00 6.1275016636375081e+00 + 6 -8.9170732696783682e+02 1.1336303776228358e+03 1.8341324036472010e+03 + 7 9.0209064735254984e+01 -4.7978209578138126e+02 -2.4047457612748985e+03 + 8 1.6507130538758162e+02 -1.4125826463012089e+02 3.7429689932223988e+02 + 9 8.6448904075000073e+01 9.2980274373559254e+01 3.8245658895390380e+02 + 10 5.4145696821895808e+02 -6.0775639664097935e+02 -1.8560787541217596e+02 + 11 -1.1668368139077483e+00 -2.9113367935435024e+00 -4.7722931605316647e+00 + 12 7.7553657783799705e+00 4.2466142559032791e+00 -3.3990171604209083e+00 + 13 3.8475336129608180e+00 -1.5183469523276023e+00 -6.9482230855407029e-02 + 14 -1.6156869174742725e+00 3.1965109201768399e-01 -4.1622851657417339e+00 + 15 -1.0981786158274637e-01 4.0853306382914027e+00 1.4606814784734348e+00 + 16 6.3963970009771799e+02 -4.5023905203314621e+02 -1.6807298578962293e+03 + 17 -6.3526018981287336e+02 4.4347993035669845e+02 1.6880582545716725e+03 + 18 -1.7139648729061180e-02 -2.7763283498578040e-02 2.4635802167823514e-02 + 19 2.6820236541837166e-04 -6.9073836347033328e-06 1.0737875636362001e-03 + 20 -6.9061610329794844e-04 -6.7109894834207616e-04 2.3721828176671614e-04 + 21 -1.0519650644266801e+02 -1.1847160637230165e+02 3.2791578988361539e+02 + 22 -1.5710630193804369e+02 -3.8301287787066798e+01 -2.4591596292922665e+02 + 23 2.6229572605300245e+02 1.5678115064858059e+02 -8.1992222423368503e+01 + 24 5.5482137873708794e+01 -3.1206838372597048e+02 1.6620799913559264e+02 + 25 -2.2024822757568614e+02 3.5144092419408679e+01 -1.8528700813957465e+02 + 26 1.6475549189248940e+02 2.7691562464185097e+02 1.9059545260680842e+01 + 27 7.7188962159559637e+01 -3.3016053360997910e+02 1.3231132212179759e+02 + 28 -2.6334718003703682e+02 1.1322798035510930e+02 -1.7788193665173253e+02 + 29 1.8616428455527324e+02 2.1693753810460859e+02 4.5567380792161970e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml index 29a2f86c4..e177df874 100644 --- a/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 08:37:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:16 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 7.8770042564417935e+01 -3.3142512544733739e+02 1.3455926026230580e+02 28 -2.6908794572326946e+02 1.1327040559793579e+02 -1.8145185065043862e+02 29 1.9071054496393484e+02 2.1815083728566805e+02 4.6871040843718049e+01 -run_vdwl: 106.16792769211 -run_coul: 232.783864793706 +run_vdwl: 803.912465809843 +run_coul: 225.97330421207 run_stress: ! |2- - 5.4033888248203050e+02 5.4892480012296539e+02 2.8955268865699099e+02 -3.1667993938546078e+02 -5.9418517757321624e+01 1.4135196526059173e+02 + 2.5084553180562311e+03 2.3461212422412018e+03 6.1654627283929622e+03 -7.3514733668882184e+02 -9.9027297179894418e+01 9.7331742020710783e+02 run_forces: ! |2 - 1 1.5042193015751637e+01 7.0524187021246291e+01 5.3102809431837898e+01 - 2 1.6025096019454882e+01 1.0007003422930383e+01 -2.1158888230513998e+01 - 3 -2.9508462511221728e+02 1.5540065134595568e+02 1.0032166848378883e+02 - 4 -4.6990135745775357e+00 1.7664562746630565e+00 -3.4155588447655587e+00 - 5 -1.6647491427755032e+00 -7.1384505520861741e-01 5.6231908788594200e+00 - 6 1.9229113379974908e+02 -1.6879183079864617e+02 -1.5821197940587550e+02 - 7 1.3268776214088212e+00 -3.0212070504821389e+00 -1.3945917603050320e+01 - 8 -3.0767948041849035e+01 3.3774723064931294e+01 4.1455210291132609e+01 - 9 1.0981624610986977e+01 3.5815171517217190e+00 4.2835213459206827e+01 - 10 7.0651343131573768e+01 -7.5364530217274577e+01 -6.2700552936028060e+01 - 11 -4.6552674358648485e+00 -3.3640968147579642e+00 -1.0071392966729430e+01 - 12 9.6965594010440821e+00 4.5621471489456713e+00 -2.1188025874175360e+00 - 13 3.5106358717622150e+00 -1.2472767160147971e+00 -3.8580287143749975e-01 - 14 -2.8511582585326667e+00 6.3130353605272560e-01 -3.6224095602913993e+00 - 15 -2.5947961667870077e-02 3.6550638292073843e+00 4.1732465355119469e-01 - 16 3.1351531521993351e+01 -4.3039259230988741e+01 1.7506976000755010e+01 - 17 -9.2563379856300898e+00 1.1242483524947740e+01 1.2152716943210445e+01 - 18 -5.9670106666608946e-01 4.9523970836146356e+00 -6.4763569969688159e+00 - 19 2.3605537941351202e+00 -1.0192980643878549e+00 5.4296196146473630e+00 - 20 -2.7295307430735738e+00 -3.9126961062803156e+00 3.4455294221899790e+00 - 21 -6.6351053993518860e+00 -5.6936051291677838e+00 2.5340192737673494e+01 - 22 -1.2600719852052331e+01 -3.7030527797125199e+00 -1.9178428988156423e+01 - 23 1.8521698071959683e+01 1.0087220143578394e+01 -5.2549329175309047e+00 - 24 8.9245861393053083e+00 -2.1746250247417159e+01 1.5024118744729005e+01 - 25 -2.1454838578353829e+01 2.4698375849765086e+00 -1.7961262545369252e+01 - 26 1.1612405148647868e+01 1.8957323157416415e+01 1.9242901272291062e+00 - 27 8.6191024303209324e-02 -2.3639345894753781e+01 6.2652733477098339e+00 - 28 -1.5812874994926165e+01 6.0673559816231579e+00 -1.0405039947171305e+01 - 29 1.6452388975462700e+01 1.7576623833281324e+01 4.0631922647850391e+00 + 1 -4.2201967439243404e+01 2.2703250983095930e+02 3.3273392051993801e+02 + 2 1.6847858989992068e+02 1.3606134489060020e+02 -1.9941085059706748e+02 + 3 -1.2321340716608640e+02 -3.6062056365855199e+02 -1.3466646666846512e+02 + 4 -3.9006885040278334e+00 1.0481957806883793e+00 -2.9623264745545179e+00 + 5 -1.8354593716717451e+00 -1.4475994382320179e+00 6.0631539744943916e+00 + 6 -8.9032783101510438e+02 1.1299289305885302e+03 1.8321300119293321e+03 + 7 9.0158583771343928e+01 -4.7901213040148201e+02 -2.4015892760304437e+03 + 8 1.6365573761456858e+02 -1.3684972283305612e+02 3.7667492961072566e+02 + 9 8.8106365647529614e+01 8.7126560608788935e+01 3.8395970200706773e+02 + 10 5.4114622567987544e+02 -6.0733095378797589e+02 -1.8582514393146081e+02 + 11 -2.0714190719805106e+00 -1.8800125951531275e+00 -5.3424054856455951e+00 + 12 1.0617704304256534e+01 3.7630397867420831e+00 -1.9585654176594229e+00 + 13 3.7741407109328673e+00 -1.5246123952739465e+00 -2.5130664051917095e-01 + 14 -2.6822843452260079e+00 6.7873523557851312e-01 -4.2603414485281519e+00 + 15 2.4508135158868269e-01 3.8809577686630301e+00 4.4310022459047804e-01 + 16 6.3905092328769251e+02 -4.5086948970379478e+02 -1.6791697715704149e+03 + 17 -6.3783959481118188e+02 4.4979249499725233e+02 1.6817610545006303e+03 + 18 3.0272221992801335e-01 4.7379289334210108e+00 -7.8034274548610547e+00 + 19 2.0244748324560748e+00 -7.0657644704839884e-01 5.5357060633722295e+00 + 20 -2.8988797307031717e+00 -3.9684014416767193e+00 4.0691984896498097e+00 + 21 -1.0341263011500889e+02 -1.1423840259028262e+02 3.1936020959257451e+02 + 22 -1.5542365386429265e+02 -3.8890274379954505e+01 -2.4024326622976275e+02 + 23 2.5841715588364093e+02 1.5354615473405551e+02 -7.8607988144712394e+01 + 24 5.3896922949324541e+01 -3.0322949753557248e+02 1.6130632854075756e+02 + 25 -2.1735274042268719e+02 3.2245936055411342e+01 -1.8200420417168144e+02 + 26 1.6288955880558305e+02 2.7072960985993097e+02 2.0080123841076546e+01 + 27 7.5273518297032268e+01 -3.2045428876396397e+02 1.2880796789211973e+02 + 28 -2.5930439369097223e+02 1.0912216273757431e+02 -1.7454256996133410e+02 + 29 1.8442724429251268e+02 2.1132796416382220e+02 4.5712503040781087e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml index b427c7229..2ca2d354a 100644 --- a/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 08:37:46 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2e-13 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 7.8770042449054543e+01 -3.3142512528162013e+02 1.3455926006838362e+02 28 -2.6908794843481189e+02 1.1327040466303316e+02 -1.8145185186649925e+02 29 1.9071054758730884e+02 2.1815083779493665e+02 4.6871042349543053e+01 -run_vdwl: 106.167927306934 -run_coul: 232.783872560844 +run_vdwl: 803.912465762587 +run_coul: 225.973340544803 run_stress: ! |2- - 5.4033889185122246e+02 5.4892479679809765e+02 2.8955268188032755e+02 -3.1667993134714584e+02 -5.9418514448016722e+01 1.4135196542323126e+02 + 2.5084553392801040e+03 2.3461212458808004e+03 6.1654627414386759e+03 -7.3514732916023047e+02 -9.9027288618554820e+01 9.7331742333795171e+02 run_forces: ! |2 - 1 1.5042191731528032e+01 7.0524187035940841e+01 5.3102809100251832e+01 - 2 1.6025095744488677e+01 1.0007002564822953e+01 -2.1158887488756886e+01 - 3 -2.9508462401688416e+02 1.5540064992154834e+02 1.0032166792537170e+02 - 4 -4.6990139078806985e+00 1.7664569920998929e+00 -3.4155586861921678e+00 - 5 -1.6647490390909379e+00 -7.1384403123709927e-01 5.6231913002355691e+00 - 6 1.9229113649576860e+02 -1.6879183322567181e+02 -1.5821198229106906e+02 - 7 1.3268779483228397e+00 -3.0212055830968931e+00 -1.3945914850434395e+01 - 8 -3.0767951196938704e+01 3.3774724457681103e+01 4.1455210935792906e+01 - 9 1.0981625491800322e+01 3.5815167138957573e+00 4.2835213672255946e+01 - 10 7.0651342880628548e+01 -7.5364529395568468e+01 -6.2700552629269403e+01 - 11 -4.6552675714512306e+00 -3.3640962703239836e+00 -1.0071392993905647e+01 - 12 9.6965597982755973e+00 4.5621468027776313e+00 -2.1188034676686951e+00 - 13 3.5106360312289651e+00 -1.2472769016775080e+00 -3.8580273777294372e-01 - 14 -2.8511586869301606e+00 6.3130344465834132e-01 -3.6224094710691888e+00 - 15 -2.5948083380200986e-02 3.6550635613088232e+00 4.1732526656150110e-01 - 16 3.1351530288856495e+01 -4.3039257792019207e+01 1.7506979549615181e+01 - 17 -9.2563361597161808e+00 1.1242483077205343e+01 1.2152712647114377e+01 - 18 -5.9670063451193034e-01 4.9523968092195076e+00 -6.4763579876532082e+00 - 19 2.3605517380981142e+00 -1.0192995004118002e+00 5.4296195197490729e+00 - 20 -2.7295289246110710e+00 -3.9126947888476593e+00 3.4455303030875251e+00 - 21 -6.6351057460657072e+00 -5.6936042652828442e+00 2.5340192741066605e+01 - 22 -1.2600721158161978e+01 -3.7030538274119085e+00 -1.9178429616278798e+01 - 23 1.8521699843022176e+01 1.0087220490406569e+01 -5.2549324889294233e+00 - 24 8.9245858291795237e+00 -2.1746249717816461e+01 1.5024117239152851e+01 - 25 -2.1454839054527017e+01 2.4698362443277517e+00 -1.7961262718374137e+01 - 26 1.1612406206864165e+01 1.8957323737221003e+01 1.9242912492915349e+00 - 27 8.6190447470516060e-02 -2.3639345383014803e+01 6.2652730906494423e+00 - 28 -1.5812876277619852e+01 6.0673551856385073e+00 -1.0405040442005870e+01 - 29 1.6452389982237243e+01 1.7576623643628043e+01 4.0631933291837985e+00 + 1 -4.2201968983480818e+01 2.2703250918183244e+02 3.3273391857664939e+02 + 2 1.6847858917522532e+02 1.3606134425305123e+02 -1.9941084927862011e+02 + 3 -1.2321340705603887e+02 -3.6062056377045991e+02 -1.3466646681149803e+02 + 4 -3.9006884714982819e+00 1.0481963482537391e+00 -2.9623262208753411e+00 + 5 -1.8354590445993366e+00 -1.4475985458822811e+00 6.0631541616850688e+00 + 6 -8.9032783165875003e+02 1.1299289305600901e+03 1.8321300104691832e+03 + 7 9.0158583662611690e+01 -4.7901213016750285e+02 -2.4015892783915565e+03 + 8 1.6365573654861791e+02 -1.3684972290604640e+02 3.7667493258180303e+02 + 9 8.8106367580194899e+01 8.7126559913584771e+01 3.8395970377730640e+02 + 10 5.4114622586876146e+02 -6.0733095341541161e+02 -1.8582514463785989e+02 + 11 -2.0714191218560298e+00 -1.8800119690008286e+00 -5.3424055254285800e+00 + 12 1.0617705006319277e+01 3.7630395021704914e+00 -1.9585665078285754e+00 + 13 3.7741408187689349e+00 -1.5246126016888013e+00 -2.5130650630696405e-01 + 14 -2.6822847012173630e+00 6.7873500916113760e-01 -4.2603412055046181e+00 + 15 2.4508105587150078e-01 3.8809575253492499e+00 4.4310063545952177e-01 + 16 6.3905092407863981e+02 -4.5086949033001724e+02 -1.6791697715339947e+03 + 17 -6.3783959427127570e+02 4.4979249601458264e+02 1.6817610536555267e+03 + 18 3.0272280708718891e-01 4.7379291651913418e+00 -7.8034285340864544e+00 + 19 2.0244726205539298e+00 -7.0657827206446511e-01 5.5357060725112586e+00 + 20 -2.8988776137183003e+00 -3.9683999544111010e+00 4.0691993477934831e+00 + 21 -1.0341263075995995e+02 -1.1423840166039041e+02 3.1936021053378994e+02 + 22 -1.5542365647206464e+02 -3.8890276027745244e+01 -2.4024326774935034e+02 + 23 2.5841715889810058e+02 1.5354615590321063e+02 -7.8607987174134777e+01 + 24 5.3896923102196574e+01 -3.0322949731248093e+02 1.6130632782089333e+02 + 25 -2.1735274208997180e+02 3.2245934788915356e+01 -1.8200420439742288e+02 + 26 1.6288956112688177e+02 2.7072961131831073e+02 2.0080125537481287e+01 + 27 7.5273517621355438e+01 -3.2045428878968869e+02 1.2880796778486720e+02 + 28 -2.5930439613689083e+02 1.0912216185993132e+02 -1.7454257114826569e+02 + 29 1.8442724641013544e+02 2.1132796437915553e+02 4.5712504667783321e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_gromacs.yaml b/unittest/force-styles/tests/mol-pair-lj_gromacs.yaml index dcf683ad6..ecf6b8f0f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_gromacs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_gromacs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 5.1810361121351349e+01 -2.2705479029845463e+02 9.0849203605408761e+01 28 -1.8041315712092242e+02 7.7534077323673401e+01 -1.2206962346673878e+02 29 1.2861062995923899e+02 1.4952717734503142e+02 3.1216039459072466e+01 -run_vdwl: 146.15575719602 +run_vdwl: 719.457367180371 run_coul: 0 run_stress: ! |2- - 6.2608035182867502e+02 6.7186461286200517e+02 4.8484847453761853e+02 -3.1994914560659902e+02 -2.8454770801518002e+01 1.2292146057509750e+02 + 2.1330161071748348e+03 2.1547745889566568e+03 4.3976515435475667e+03 -7.3873328645548486e+02 4.1743535389589049e+01 6.2788015373311089e+02 run_forces: ! |2 - 1 1.2964048166307254e+01 8.0892504914468461e+01 6.0323138623572646e+01 - 2 1.8550229074295306e+01 1.4016240276207807e+01 -2.2757526592444570e+01 - 3 -2.4823736955439679e+02 1.0508781293562058e+02 8.6172402565047776e+01 - 4 -8.6006926302907907e+00 3.1744204069114930e+00 -6.2092172936082353e+00 - 5 -1.7308376011665407e+00 -2.5575751500351536e+00 1.0273464100488859e+01 - 6 1.1683402205982716e+02 -9.8726785920479415e+01 -1.4208741138786152e+02 - 7 3.8041576190481150e+00 -1.0704953181094805e+01 -4.2399881130260994e+01 - 8 -1.9935816728655603e+01 1.9886802961162925e+01 5.5348113833615706e+01 - 9 1.1205804474540194e+01 1.3198927882661575e+01 4.9879830767324208e+01 - 10 6.4812482412786068e+01 -7.6374988223988879e+01 -7.5660088701897905e+01 - 11 -6.2988689831808973e+00 -8.0952577500251213e+00 -1.6391411468971999e+01 - 12 1.4369447518025066e+01 1.2193303985668861e+01 -8.2528018928818252e+00 - 13 7.3377131420587967e+00 -2.7954994026129980e+00 -1.0299429376473945e-01 - 14 -2.7952390796961164e+00 4.3888836965868994e-01 -7.1101044440471428e+00 - 15 -3.9779450267415739e-01 8.1106062400072290e+00 3.0711091987572563e+00 - 16 5.2787469620402128e+01 -6.7733542160278702e+01 1.5088305226468673e+01 - 17 -1.4633172229966092e+01 1.0014125748924098e+01 4.0800214563713354e+01 - 18 -1.8105964829099427e-02 -3.1466548764589292e-02 2.9611748980726414e-02 - 19 2.5237035695420342e-04 -2.3897699023843862e-04 1.6765558437881385e-03 - 20 -8.8360803344684634e-04 -9.1649277814230036e-04 3.6622203059894030e-04 - 21 -9.9359866079055514e+00 -1.2018044268816880e+01 3.8871033597676345e+01 - 22 -1.8317759455531416e+01 -4.4399925525744806e+00 -2.9440613291059400e+01 - 23 2.8242488788859244e+01 1.6470730203128170e+01 -9.4179961635146547e+00 - 24 1.2413323041041599e+01 -3.6423443806571285e+01 2.3794728955241478e+01 - 25 -3.0031401614640423e+01 5.3796404363583212e+00 -2.5778429343614480e+01 - 26 1.7604735970849916e+01 3.1032210684062360e+01 1.9586535547389803e+00 - 27 3.4724766463282917e+00 -3.8995419418540514e+01 1.1703248881149843e+01 - 28 -2.5472491462737928e+01 1.1754687221646966e+01 -1.7174776671148638e+01 - 29 2.2007769118978800e+01 2.7247221587063649e+01 5.4673542804259307e+00 + 1 -2.0299401337247144e+01 2.6686200937195582e+02 3.2358783336177362e+02 + 2 1.5298617961842683e+02 1.2596516370316934e+02 -1.7961292693910221e+02 + 3 -1.3353630650620045e+02 -3.7923748620274159e+02 -1.4291839752379730e+02 + 4 -7.8374717835470538e+00 2.1276610790031159e+00 -5.5845014473104264e+00 + 5 -2.5014258627145556e+00 -4.0250131417627699e+00 1.2103512371915890e+01 + 6 -8.0681466178617609e+02 9.2165651052593478e+02 1.0270802401876938e+03 + 7 5.5780302776153682e+01 -3.1117544157272658e+02 -1.5746997989181548e+03 + 8 1.3452983973632254e+02 -1.0064660034451825e+02 3.8851792520587509e+02 + 9 7.6746213900458727e+01 8.2501469902245205e+01 3.3944351209160266e+02 + 10 5.2128033527339403e+02 -5.9920098831743178e+02 -1.8126029872119136e+02 + 11 -2.3573118530876016e+00 -5.8616952179557700e+00 -9.6049816230143357e+00 + 12 1.7503996291421551e+01 1.0626945955538536e+01 -8.0603310631787117e+00 + 13 8.0530371741972182e+00 -3.1756461581373729e+00 -1.4618680284205970e-01 + 14 -3.3416025504292381e+00 6.6492947312561146e-01 -8.6345172932446665e+00 + 15 -2.2253393818863992e-01 8.5025706340296079e+00 3.0369705422273578e+00 + 16 4.3476329768229630e+02 -3.1171099752667209e+02 -1.1135222101611312e+03 + 17 -4.2469864617078838e+02 2.9615424659320524e+02 1.1302578406473324e+03 + 18 -1.8893709843599168e-02 -3.3259605193409043e-02 3.0987964166540621e-02 + 19 3.0648909040644835e-04 -2.4265052595433303e-04 1.7453099945162023e-03 + 20 -9.8724149812852153e-04 -1.0150327438916598e-03 3.7575978684168114e-04 + 21 -7.0490729691514588e+01 -7.9749301207105603e+01 2.2171013347346081e+02 + 22 -1.0638722737507929e+02 -2.5949513889727239e+01 -1.6645597087394029e+02 + 23 1.7686805738190992e+02 1.0571023671472115e+02 -5.5243362216761177e+01 + 24 3.8206037773851328e+01 -2.1022829091587377e+02 1.1260715595385297e+02 + 25 -1.4918888259083087e+02 2.3762162261280174e+01 -1.2549193848438334e+02 + 26 1.1097064528755762e+02 1.8645512121553429e+02 1.2861565606598850e+01 + 27 5.0800815997841156e+01 -2.2296608344204725e+02 8.8607458099219912e+01 + 28 -1.7694198676244446e+02 7.6029978153204070e+01 -1.1950523446736976e+02 + 29 1.2614900377666902e+02 1.4694256964221637e+02 3.0893399959920114e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_gromacs_coul_gromacs.yaml b/unittest/force-styles/tests/mol-pair-lj_gromacs_coul_gromacs.yaml index ca52f7435..75d194333 100644 --- a/unittest/force-styles/tests/mol-pair-lj_gromacs_coul_gromacs.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_gromacs_coul_gromacs.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 4.8633559941452859e+01 -2.1563836677030434e+02 8.6569402670577887e+01 28 -1.7529561093172813e+02 7.2824409510325737e+01 -1.1821767641024830e+02 29 1.2695735068811611e+02 1.4275665966842291e+02 3.1866592810219235e+01 -run_vdwl: 147.106223505251 -run_coul: -88.0181496295026 +run_vdwl: 719.600597109584 +run_coul: -94.8970614160366 run_stress: ! |2- - 6.0473673500614530e+02 6.2468290742213208e+02 4.5723269818457078e+02 -3.0636033356604156e+02 -2.7697660163542309e+01 1.2424596365996064e+02 + 2.1093758219790202e+03 2.1111134180135791e+03 4.3582271150751021e+03 -7.3256586907634733e+02 3.4925363586198564e+01 6.3287307153174061e+02 run_forces: ! |2 - 1 1.4638986050558614e+01 7.9003500887296738e+01 6.1783710067766307e+01 - 2 1.9597653216372638e+01 1.1990817387976653e+01 -2.5458994025283527e+01 - 3 -2.4589142354441532e+02 1.0308967796017140e+02 8.4915025450855552e+01 - 4 -8.7492567283090263e+00 3.2826600712649410e+00 -6.5529992331834324e+00 - 5 -2.2205547755496640e+00 -1.8705786897575125e+00 1.0433248492709971e+01 - 6 1.1601659265069097e+02 -9.9548533013862013e+01 -1.4186378024518066e+02 - 7 3.8305696134925711e+00 -1.0848631948937308e+01 -4.2030935219195563e+01 - 8 -2.0151208426198728e+01 2.2723632239461111e+01 5.6642537901157702e+01 - 9 1.3841034325332599e+01 6.0239966665819278e+00 5.3329932980427941e+01 - 10 6.4056301224226530e+01 -7.5497227469537208e+01 -7.5488789359613989e+01 - 11 -7.4130718443226131e+00 -6.6926501053343390e+00 -1.7013146563054732e+01 - 12 1.7823653418358468e+01 1.1384723402053535e+01 -6.7994740155030762e+00 - 13 7.2933361929821308e+00 -2.5792036639391167e+00 -4.0831889828000661e-01 - 14 -4.3211606596874050e+00 1.0459777790671654e+00 -7.1177090446032070e+00 - 15 -2.8522141189532446e-01 7.8447367612325438e+00 1.9580561988106853e+00 - 16 5.2328744483151631e+01 -6.7952312359117400e+01 1.4731525384678141e+01 - 17 -1.8341951384201863e+01 1.6737505351966501e+01 3.6796280312203002e+01 - 18 2.2116782957255141e-01 6.8668483269884364e+00 -7.9775022652038485e+00 - 19 2.0659518977595299e+00 -1.5604856358322019e+00 5.5957940240817141e+00 - 20 -2.9208126649228521e+00 -4.1104827973220139e+00 3.6726287424252271e+00 - 21 -9.2996435734693979e+00 -9.7112803360741147e+00 3.4275230308096020e+01 - 22 -1.8328831615598830e+01 -4.5784962683180899e+00 -2.6511981530769187e+01 - 23 2.6350733448566761e+01 1.5314306924839622e+01 -6.7524710023215677e+00 - 24 1.0934877607047740e+01 -3.0753036692271866e+01 2.1479344426514839e+01 - 25 -2.9420615617561008e+01 3.0786845149171138e+00 -2.4386104157423823e+01 - 26 1.7588580095482119e+01 2.6976721476643121e+01 2.5937234715558533e+00 - 27 1.0626051530702441e+00 -3.2326397779922907e+01 9.4000010798252909e+00 - 28 -2.3515150345794389e+01 8.8574909946771463e+00 -1.5691635313340278e+01 - 29 2.3208115385261358e+01 2.3808036015088103e+01 6.4468020318486037e+00 + 1 -1.8217911652035756e+01 2.6614893097994866e+02 3.2425956142546721e+02 + 2 1.5299015008448055e+02 1.2295689448258861e+02 -1.8119362846323855e+02 + 3 -1.3355048408617654e+02 -3.7932222997531602e+02 -1.4288894297322366e+02 + 4 -7.7881334074088704e+00 2.1395217193854359e+00 -5.8946929179602154e+00 + 5 -2.9015444286606513e+00 -3.3190829796152856e+00 1.2028380931617720e+01 + 6 -8.0484129028316397e+02 9.1799644625289068e+02 1.0243806102315264e+03 + 7 5.5378957126927745e+01 -3.1064435407458916e+02 -1.5714059594977134e+03 + 8 1.3295700649802455e+02 -9.6567436467982247e+01 3.9097934804559617e+02 + 9 7.8594914243725086e+01 7.6787252700004487e+01 3.4114513360728796e+02 + 10 5.2093082526478292e+02 -5.9871659705999900e+02 -1.8144896482663628e+02 + 11 -3.3310986696137470e+00 -4.6132542590968511e+00 -1.0053933154105646e+01 + 12 2.0832205881737366e+01 9.8380083815319139e+00 -6.7491322247524863e+00 + 13 7.9556776794119175e+00 -3.0200942149984238e+00 -3.3390261468833859e-01 + 14 -4.5054953463026166e+00 1.2349672537097798e+00 -8.7075707951712076e+00 + 15 7.5475229137198022e-02 8.4386999995846139e+00 1.9868799359302005e+00 + 16 4.3381294394222925e+02 -3.1191414488148644e+02 -1.1110586005359376e+03 + 17 -4.2720569066992869e+02 3.0150116351301472e+02 1.1234695990176058e+03 + 18 1.2645017920500252e+00 6.3482226610559547e+00 -9.6372215828519163e+00 + 19 1.6279676762980013e+00 -1.2131793710941685e+00 5.9522435918059564e+00 + 20 -3.1613514822255295e+00 -4.1638724005490113e+00 4.5348407077862349e+00 + 21 -6.8218044719492440e+01 -7.5788276035500402e+01 2.1162422101668167e+02 + 22 -1.0477177131474664e+02 -2.6026083199314531e+01 -1.6002215180243934e+02 + 23 1.7237227715051338e+02 1.0236095826437335e+02 -5.1092054266127739e+01 + 24 3.6302346974627021e+01 -1.9941064805237883e+02 1.0820239233102942e+02 + 25 -1.4580835050590196e+02 2.0410351676825194e+01 -1.2163354937375415e+02 + 26 1.0890638112998862e+02 1.7861119591487008e+02 1.3341584067103536e+01 + 27 4.7696545847302744e+01 -2.1175877137859771e+02 8.4457795009889622e+01 + 28 -1.7202226794251729e+02 7.1403330554170680e+01 -1.1580078652542318e+02 + 29 1.2462525798693827e+02 1.4030207999656395e+02 3.1558501634695819e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_long_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_coul_long.yaml index 04b5611d7..caa7d765b 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9787264851761520e+01 -2.1702378491087205e+02 8.7171908546104049e+01 28 -1.7608392919959783e+02 7.3301696261828440e+01 -1.1852448703320457e+02 29 1.2668890412925685e+02 1.4371750554769054e+02 3.1331418002784233e+01 -run_vdwl: 147.102364449349 -run_coul: 231.547234893114 +run_vdwl: 719.707445870818 +run_coul: 225.904237287787 run_stress: ! |2- - 6.0919934118071239e+02 6.3107471521131993e+02 4.5857012318705995e+02 -3.1004403425353422e+02 -2.9997157619130096e+01 1.3052867733884497e+02 + 2.1107536793307468e+03 2.1122379201857452e+03 4.3599324498565293e+03 -7.3409238214538516e+02 3.5359613445860141e+01 6.3752279062951925e+02 run_forces: ! |2 - 1 1.5314331896585333e+01 7.9288612705254039e+01 6.1575303543287625e+01 - 2 1.9396919110722632e+01 1.2345122082075413e+01 -2.5332948337919333e+01 - 3 -2.4626133633956260e+02 1.0354035883241509e+02 8.5144455581577418e+01 - 4 -8.8802501201458810e+00 3.3242344664852630e+00 -6.4498814606261714e+00 - 5 -2.3923101673531990e+00 -1.8640348534929125e+00 1.0409864013482242e+01 - 6 1.1513979120129747e+02 -9.9341734829867377e+01 -1.4128601583311328e+02 - 7 4.4093114886184308e+00 -1.0659980678044519e+01 -4.1678743692198765e+01 - 8 -1.9868169606612661e+01 2.2747117382132245e+01 5.6457083742188118e+01 - 9 1.3497169620877925e+01 6.1641437968071635e+00 5.3035465738468233e+01 - 10 6.4065528250627793e+01 -7.5533327610494879e+01 -7.5547040409161468e+01 - 11 -7.3191433509572548e+00 -6.8856552787967793e+00 -1.7097166892623680e+01 - 12 1.7335565084896462e+01 1.1587180404709747e+01 -6.6964789973567180e+00 - 13 7.3170462601746324e+00 -2.7360331742062498e+00 -4.0456571436371597e-01 - 14 -4.2028744890021663e+00 8.3860835839777936e-01 -7.1471580735433990e+00 - 15 -2.3354928682031384e-01 7.7706840682891771e+00 2.0010265861877201e+00 - 16 5.2780263247990256e+01 -6.8530904228861573e+01 1.3740498128927118e+01 - 17 -1.8298620946547935e+01 1.7602795219413657e+01 3.7174296946979396e+01 - 18 -6.3511714051266999e-01 4.8016018397768159e+00 -6.5708472215915563e+00 - 19 2.4125453765660763e+00 -8.7915573144057468e-01 5.4231247641999305e+00 - 20 -2.7248412496986525e+00 -3.8904055262085024e+00 3.4618835682768090e+00 - 21 -9.8169830353169907e+00 -9.2669725250391188e+00 3.5600823008740939e+01 - 22 -1.7981884124423797e+01 -5.1466604402270937e+00 -2.7099256232094518e+01 - 23 2.7159949528736021e+01 1.5032360508548862e+01 -7.6945205386426236e+00 - 24 1.1640105258469951e+01 -3.2220309693627385e+01 2.1233691115535787e+01 - 25 -2.9814417733874027e+01 3.4702385006909036e+00 -2.4986236124647096e+01 - 26 1.7326774130651149e+01 2.8422945631353727e+01 2.8030693256692554e+00 - 27 2.2636828404399232e+00 -3.4114834861595448e+01 1.0082389575087330e+01 - 28 -2.4164812531595764e+01 9.4962047242377423e+00 -1.5922767590798220e+01 - 29 2.2535326825769825e+01 2.4637800911314709e+01 5.7706514800725639e+00 + 1 -1.7610671323869674e+01 2.6644632319809125e+02 3.2393635185737048e+02 + 2 1.5276958689054419e+02 1.2310601845342437e+02 -1.8097797853205338e+02 + 3 -1.3352437924496681e+02 -3.7931520927920576e+02 -1.4290253280020417e+02 + 4 -7.9210454699422739e+00 2.1479068853687990e+00 -5.8262866027728446e+00 + 5 -3.0436142186020652e+00 -3.3598700412150313e+00 1.2037071546308955e+01 + 6 -8.0541518106738181e+02 9.1789632182348248e+02 1.0248061101238054e+03 + 7 5.5711025014807248e+01 -3.1035014369487737e+02 -1.5712639984017087e+03 + 8 1.3310087453577813e+02 -9.6225162152811720e+01 3.9090026703160601e+02 + 9 7.8393574070627366e+01 7.6654576853511799e+01 3.4092264679070774e+02 + 10 5.2097956066949666e+02 -5.9878732018277447e+02 -1.8147991237770523e+02 + 11 -3.2607667066270936e+00 -4.8312582714797552e+00 -1.0171800769012659e+01 + 12 2.0370356353863581e+01 1.0143689941206798e+01 -6.6267466555479961e+00 + 13 7.9794514497078781e+00 -3.1830746501709997e+00 -3.2644127587370575e-01 + 14 -4.4037331584323880e+00 1.0233682011991643e+00 -8.7298909905895190e+00 + 15 1.3154168744955988e-01 8.2984798374513744e+00 2.0213779317532383e+00 + 16 4.3411491239178514e+02 -3.1229545621436057e+02 -1.1118126613117161e+03 + 17 -4.2721103677584034e+02 3.0241089748456909e+02 1.1238250106811154e+03 + 18 3.0045457761221517e-01 4.7293875917389530e+00 -7.8044958131791784e+00 + 19 2.0270210763586318e+00 -7.0015059579377714e-01 5.5349995515760559e+00 + 20 -2.8986405349039099e+00 -3.9674896299813454e+00 4.0696696823518108e+00 + 21 -6.8658022402852936e+01 -7.5474151287218916e+01 2.1302465879802361e+02 + 22 -1.0464809690544206e+02 -2.6524463281118258e+01 -1.6069148016249562e+02 + 23 1.7288793881586659e+02 1.0241548772353890e+02 -5.1825425141802349e+01 + 24 3.6621512242007107e+01 -2.0125837141004371e+02 1.0765962820446694e+02 + 25 -1.4622310926571268e+02 2.0851692216922846e+01 -1.2215078336950006e+02 + 26 1.0903616825360248e+02 1.8015275208029206e+02 1.3874388664482883e+01 + 27 4.8836594023392919e+01 -2.1313610883088290e+02 8.5044672096502211e+01 + 28 -1.7278645223316221e+02 7.1874824697301463e+01 -1.1608941518893110e+02 + 29 1.2434417725483669e+02 1.4125650253383503e+02 3.1022996433022094e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_long_coul_off.yaml b/unittest/force-styles/tests/mol-pair-lj_long_coul_off.yaml index 090f2fbf2..25043b3ff 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_coul_off.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:51:24 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 5.1808319664002056e+01 -2.2705686796460878e+02 9.0850639433566855e+01 28 -1.8041324502064901e+02 7.7534032022981322e+01 -1.2206961052936214e+02 29 1.2861058916818402e+02 1.4952711846193802e+02 3.1216122432587827e+01 -run_vdwl: 146.274336045943 +run_vdwl: 719.579930262569 run_coul: 0 run_stress: ! |2- - 6.2612940858666786e+02 6.7194041553066359e+02 4.8491203168600907e+02 -3.1996539109718168e+02 -2.8461924805315942e+01 1.2291631216125924e+02 + 2.1330680690655749e+03 2.1548546310661609e+03 4.3977148876379333e+03 -7.3875161698392253e+02 4.1735811475391252e+01 6.2787463670975160e+02 run_forces: ! |2 - 1 1.2959444194738845e+01 8.0898657781884836e+01 6.0325084614883416e+01 - 2 1.8550175209963768e+01 1.4016344275214038e+01 -2.2757540152374148e+01 - 3 -2.4823858542693634e+02 1.0508823543408165e+02 8.6171981312581735e+01 - 4 -8.6009635382922092e+00 3.1744963675682092e+00 -6.2093700605490287e+00 - 5 -1.7310166722161666e+00 -2.5575649257863291e+00 1.0273556182888123e+01 - 6 1.1683023651623166e+02 -9.8725175789905080e+01 -1.4208699506900228e+02 - 7 3.8012668079406629e+00 -1.0705658909259578e+01 -4.2405641385391803e+01 - 8 -1.9936207186723550e+01 1.9884969056476368e+01 5.5348739481022683e+01 - 9 1.1205857996363660e+01 1.3198889372191456e+01 4.9879908126077417e+01 - 10 6.4813933039033500e+01 -7.6376996513659606e+01 -7.5660201231994151e+01 - 11 -6.2988735276650250e+00 -8.0953930898506492e+00 -1.6391554679785166e+01 - 12 1.4372880910920143e+01 1.2193137383094831e+01 -8.2541733867590636e+00 - 13 7.3379802062643069e+00 -2.7955143739745485e+00 -1.0304519348193049e-01 - 14 -2.7951413222466086e+00 4.3890905663444740e-01 -7.1102884788721745e+00 - 15 -3.9760226178493857e-01 8.1106630333311713e+00 3.0710276619837260e+00 - 16 5.2789368835854596e+01 -6.7736228403319828e+01 1.5089237177921778e+01 - 17 -1.4630960101266135e+01 1.0010612922715861e+01 4.0805291250567549e+01 - 18 -1.5924442862563063e-02 -2.7304351418597654e-02 2.5570260244284840e-02 - 19 2.8731962520741353e-04 -1.4554852984096180e-04 1.5107946033024373e-03 - 20 -8.2455683493138537e-04 -8.3306875079146043e-04 2.6070403093194841e-04 - 21 -9.9339560550336277e+00 -1.2020250112213802e+01 3.8869124159616057e+01 - 22 -1.8317783646564060e+01 -4.4400391077958137e+00 -2.9440731934380462e+01 - 23 2.8242619540411720e+01 1.6470760764061239e+01 -9.4180585767606804e+00 - 24 1.2414476508929853e+01 -3.6421089095847393e+01 2.3798463813179126e+01 - 25 -3.0031215500644425e+01 5.3797110538284896e+00 -2.5778173574848172e+01 - 26 1.7604893833924972e+01 3.1032456854172594e+01 1.9587231049711544e+00 - 27 3.4705701804029294e+00 -3.8997340262787105e+01 1.1704660044327099e+01 - 28 -2.5472565911683386e+01 1.1754653690855724e+01 -1.7174771794465958e+01 - 29 2.2007629050148079e+01 2.7247036506988046e+01 5.4674068297666185e+00 + 1 -2.0303948253619541e+01 2.6686899597328244e+02 3.2359016518250826e+02 + 2 1.5298615610834415e+02 1.2596535657077229e+02 -1.7961300102549995e+02 + 3 -1.3353991129277216e+02 -3.7923586068867468e+02 -1.4291795467443200e+02 + 4 -7.8376889602486495e+00 2.1277206678551259e+00 -5.5845995847245833e+00 + 5 -2.5016143012156595e+00 -4.0249945622192174e+00 1.2103599342802388e+01 + 6 -8.0681670693591195e+02 9.2165657466521770e+02 1.0270790494057853e+03 + 7 5.5777283228104892e+01 -3.1117605600409308e+02 -1.5747054058778699e+03 + 8 1.3452944362030502e+02 -1.0064838301134324e+02 3.8851870011559919e+02 + 9 7.6746265070990688e+01 8.2501426552731928e+01 3.3944362176728907e+02 + 10 5.2128180171852955e+02 -5.9920326845416275e+02 -1.8126075713274949e+02 + 11 -2.3572972792767430e+00 -5.8618376313571554e+00 -9.6051066986812188e+00 + 12 1.7507734908757325e+01 1.0626811634898042e+01 -8.0618288171219934e+00 + 13 8.0532394775905232e+00 -3.1756389228295707e+00 -1.4623829725561222e-01 + 14 -3.3414949298568608e+00 6.6494754643547804e-01 -8.6347121971496943e+00 + 15 -2.2233074485763379e-01 8.5026532137771742e+00 3.0368979894626635e+00 + 16 4.3476545824839587e+02 -3.1171406024735273e+02 -1.1135207416223748e+03 + 17 -4.2469626069510781e+02 2.9615051307131426e+02 1.1302628778733349e+03 + 18 -1.6689275604006022e-02 -2.9024552073430049e-02 2.6855550296639670e-02 + 19 3.4203553457734433e-04 -1.4647978262003367e-04 1.5781229975745795e-03 + 20 -9.2671515682736982e-04 -9.2825802499149808e-04 2.6824552607823584e-04 + 21 -7.0488718026086644e+01 -7.9751420547608120e+01 2.2170820478144546e+02 + 22 -1.0638721556454050e+02 -2.5949567848622863e+01 -1.6645606139245572e+02 + 23 1.7686814710647900e+02 1.0571022235711051e+02 -5.5243417079269719e+01 + 24 3.8207391775211661e+01 -2.1022582111879339e+02 1.1261099973451064e+02 + 25 -1.4918884866023038e+02 2.3762270819489512e+01 -1.2549179983560357e+02 + 26 1.1097072491581635e+02 1.8645523206947036e+02 1.2861651870232906e+01 + 27 5.0798782132985139e+01 -2.2296815183213087e+02 8.8608895906940688e+01 + 28 -1.7694207364537917e+02 7.6029933717047740e+01 -1.1950522205851642e+02 + 29 1.2614895493282015e+02 1.4694250129966593e+02 3.0893480404972788e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_long_cut_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_cut_coul_long.yaml index e0f11394e..64af0de1a 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_cut_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_cut_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:30:48 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 4.9789358000243837e+01 -2.1702160604151149e+02 8.7170422564672975e+01 28 -1.7608383951257386e+02 7.3301743321101753e+01 -1.1852450102612138e+02 29 1.2668894747540404e+02 1.4371756954645076e+02 3.1331335682136437e+01 -run_vdwl: 146.969932845685 -run_coul: 231.547223819221 +run_vdwl: 719.570991322032 +run_coul: 225.904237156271 run_stress: ! |2- - 6.0915003500707246e+02 6.3099734489395087e+02 4.5850631347176477e+02 -3.1002781778199557e+02 -2.9989785213832896e+01 1.3053414139517670e+02 + 2.1107014053468861e+03 2.1121563786867741e+03 4.3598688519011475e+03 -7.3407401306070096e+02 3.5367507798830019e+01 6.3752854031292134e+02 run_forces: ! |2 - 1 1.5318919850572801e+01 7.9282401393560932e+01 6.1573406079985290e+01 - 2 1.9396976103452584e+01 1.2345009578188996e+01 -2.5332936381019135e+01 - 3 -2.4626010838248081e+02 1.0353987453079895e+02 8.5144848064076541e+01 - 4 -8.8799790196154138e+00 3.3241582453182845e+00 -6.4497295145390598e+00 - 5 -2.3921298369027224e+00 -1.8640446027230397e+00 1.0409771237667691e+01 - 6 1.1514350774120571e+02 -9.9343273705726460e+01 -1.4128643713842411e+02 - 7 4.4121943913120516e+00 -1.0659283246845636e+01 -4.1672997953406181e+01 - 8 -1.9867783268324125e+01 2.2748959518231153e+01 5.6456512822888591e+01 - 9 1.3497118196591618e+01 6.1641778280888824e+00 5.3035388456119442e+01 - 10 6.4064118589590649e+01 -7.5531391512657834e+01 -7.5546937349480942e+01 - 11 -7.3191394313774030e+00 -6.8855181594816681e+00 -1.7097024407609805e+01 - 12 1.7332128235292796e+01 1.1587338382628550e+01 -6.6950974554233973e+00 - 13 7.3167736710828635e+00 -2.7360217555016586e+00 -4.0451132381702737e-01 - 14 -4.2029786654038350e+00 8.3858585765595717e-01 -7.1469688262826487e+00 - 15 -2.3374818519103108e-01 7.7706237191767675e+00 2.0011105405761818e+00 - 16 5.2778367300681317e+01 -6.8528214427924524e+01 1.3739542066296099e+01 - 17 -1.8300842492788753e+01 1.7606322050821845e+01 3.7169239078137288e+01 - 18 -6.3726923555036208e-01 4.7973251807363990e+00 -6.5668081899777047e+00 - 19 2.4125111059935440e+00 -8.7925981492706007e-01 5.4232992638105015e+00 - 20 -2.7248803445351695e+00 -3.8904686920603009e+00 3.4619755015532716e+00 - 21 -9.8190589026954900e+00 -9.2646568261250746e+00 3.5602732479020787e+01 - 22 -1.7981862279708125e+01 -5.1466131620539555e+00 -2.7099137281623833e+01 - 23 2.7159817699916161e+01 1.5032332828113880e+01 -7.6944563510728345e+00 - 24 1.1638953097463874e+01 -3.2222663983679347e+01 2.1229971509788818e+01 - 25 -2.9814603307050636e+01 3.4701648992084255e+00 -2.4986494993856571e+01 - 26 1.7326614420233994e+01 2.8422694630059933e+01 2.8029958169551832e+00 - 27 2.2656453938689189e+00 -3.4112795985711863e+01 1.0080919795658197e+01 - 28 -2.4164736062669146e+01 9.4962417865107440e+00 -1.5922775191014150e+01 - 29 2.2535473617034121e+01 2.4637995446318744e+01 5.7705996450135064e+00 + 1 -1.7606142793076721e+01 2.6643926307046576e+02 3.2393404572969035e+02 + 2 1.5276961014074979e+02 1.2310582522538580e+02 -1.8097790409337887e+02 + 3 -1.3352077650117795e+02 -3.7931683361579115e+02 -1.4290297478525994e+02 + 4 -7.9208285226142072e+00 2.1478471737321305e+00 -5.8261886321640279e+00 + 5 -3.0434261568568144e+00 -3.3598894212644921e+00 1.2036984946331106e+01 + 6 -8.0541313484802390e+02 9.1789625610950122e+02 1.0248072995522964e+03 + 7 5.5714037919441722e+01 -3.1034952601723683e+02 -1.5712584052219481e+03 + 8 1.3310127259258448e+02 -9.6223382357033231e+01 3.9089950651360147e+02 + 9 7.8393522942762402e+01 7.6654620259890507e+01 3.4092253732020578e+02 + 10 5.2097807328526937e+02 -5.9878505306906447e+02 -1.8147944863639378e+02 + 11 -3.2607811586788413e+00 -4.8311153825438842e+00 -1.0171675280728463e+01 + 12 2.0366619859559272e+01 1.0143826177861230e+01 -6.6252476933424669e+00 + 13 7.9792433546369645e+00 -3.1830852438863477e+00 -3.2638614914808800e-01 + 14 -4.4038447225257142e+00 1.0233467375694183e+00 -8.7296919912836977e+00 + 15 1.3133426132912818e-01 8.2983929635832361e+00 2.0214534374217288e+00 + 16 4.3411275526574292e+02 -3.1229239798358736e+02 -1.1118141251770460e+03 + 17 -4.2721342181191176e+02 3.0241462992285562e+02 1.1238199764275951e+03 + 18 2.9829381947886702e-01 4.7250405977390981e+00 -7.8003652237555103e+00 + 19 2.0269884088744741e+00 -7.0025053570314899e-01 5.5351648557651636e+00 + 20 -2.8987000898361028e+00 -3.9675724464586000e+00 4.0697706853489324e+00 + 21 -6.8660081449902535e+01 -7.5471920609481757e+01 2.1302658856042896e+02 + 22 -1.0464810880554204e+02 -2.6524409337682414e+01 -1.6069138969395595e+02 + 23 1.7288784900937003e+02 1.0241550235163949e+02 -5.1825370208042415e+01 + 24 3.6620155558030760e+01 -2.0126084711015031e+02 1.0765579249989915e+02 + 25 -1.4622314304154384e+02 2.0851583564250021e+01 -1.2215092193502841e+02 + 26 1.0903608867125944e+02 1.8015264098527945e+02 1.3874302220319253e+01 + 27 4.8838679617657235e+01 -2.1313393915077955e+02 8.5043184029612917e+01 + 28 -1.7278636365265945e+02 7.1874870944214763e+01 -1.1608942874009082e+02 + 29 1.2434422884760262e+02 1.4125657619669582e+02 3.1022916683050962e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml index 46cf6930c..123706c3d 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:37:29 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -67,38 +67,38 @@ init_forces: ! |2 27 -1.5292288824966405e+00 7.3670370809055621e+00 -2.7248017347638225e+00 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 -run_vdwl: 102.179240398644 -run_coul: 221.720424546992 +run_vdwl: 557.056030476991 +run_coul: 220.91388439321 run_stress: ! |2- - 3.9536843184623058e+02 4.7478735082143146e+02 2.6697778872541829e+02 -3.2473557133602441e+02 -9.3384532451696145e+01 1.1447113381864791e+02 + 1.3775223750599198e+03 1.6566888200245044e+03 3.5747572154246241e+03 -1.0386782389667430e+03 -2.0694915325068990e+02 6.6732651501863495e+02 run_forces: ! |2 - 1 3.2379540774112940e+01 8.3517527414743427e+01 3.0446322576408370e+01 - 2 -2.6293126959640789e-01 -1.8753551336903787e+00 -6.6074949251544501e-01 - 3 -2.3593857243623478e+02 9.7836073928631833e+01 8.4490011242546615e+01 - 4 -3.7637774235278060e-01 1.4515275288094828e-01 -2.8559910145119410e-01 - 5 -6.8204117190800306e-01 6.2446578533889874e-01 2.7378988248683184e-01 - 6 1.0933365729165328e+02 -9.6549045037005087e+01 -1.2841653298209610e+02 - 7 4.9593737826049953e+00 -1.0982207225663634e+01 -4.0074345311087718e+01 - 8 -1.6165014052241138e+00 3.2404345058645852e+01 1.0398184289445261e+02 - 9 1.3998347047175768e+00 -6.8051250780067472e+00 5.7998397476985875e-01 - 10 3.9959095982478154e+01 -6.7059878898971292e+01 -8.8447803032655671e+01 - 11 -1.0802301059782982e+00 1.1219888940584297e+00 -8.4425239997392743e-01 - 12 2.0545804720403741e+01 1.6756506821178750e+01 -1.0147383979092723e+01 - 13 -4.0343321874813348e-02 1.7788265176798995e-01 -2.9853594465807470e-01 - 14 -1.3513516710629263e+00 4.4595934938156750e-01 -2.6265884551665269e-01 - 15 3.1593487998441483e-01 -2.5515183537208080e-01 -1.0797891014048080e+00 - 16 5.1256244569865025e+01 -6.6172009677024647e+01 1.2070939136664387e+01 - 17 -1.7692907416727870e+01 1.6463320315378233e+01 3.6795640394681179e+01 - 18 -1.6194696510616974e-01 4.5570017780853052e+00 -7.3322970257924407e+00 - 19 2.3514102714689615e+00 -7.5578860560606387e-01 5.6642936508687214e+00 - 20 -2.8597552719569386e+00 -3.9142546520933768e+00 3.6472607860602464e+00 - 21 1.4156882123083809e+00 3.1994560956847562e+00 -6.4435678999424217e+00 - 22 4.7559025720967556e+00 1.1887804903972874e+00 5.7934257053883416e+00 - 23 -6.5791547151845498e+00 -3.9974753494116477e+00 1.1725336611476698e+00 - 24 -1.2476216693532436e+00 7.0412609028878910e+00 -3.7704984044487455e+00 - 25 5.3901883576076450e+00 -3.4508321180203627e-01 4.2395901334590524e+00 - 26 -4.6303654307411399e+00 -6.8134281037859301e+00 -1.0346808880595877e+00 - 27 -1.8378768075421317e+00 7.4880775093473533e+00 -2.6847264242122688e+00 - 28 6.6966633089203391e+00 -2.2313684816363604e+00 4.2842114180410844e+00 - 29 -4.4013620273780845e+00 -5.2116284583392112e+00 -1.6564246240672249e+00 + 1 1.3484812617575406e+02 3.9092060908116656e+02 1.4373313186999439e+02 + 2 -2.0271633709568476e-01 -2.8298288761956423e+00 -1.1989313018422760e+00 + 3 -1.4342325174055713e+02 -3.7982436396313489e+02 -1.3597762518906373e+02 + 4 -8.2852639170312839e-02 1.8300393499842461e-02 -2.3762389449286375e-01 + 5 -5.4791673481254732e-01 6.5614563468856779e-01 -6.3941396758903993e-02 + 6 -8.0227485954791541e+02 9.1496525050525736e+02 1.0264249558300917e+03 + 7 5.5771542735465069e+01 -3.1037336726230455e+02 -1.5711704577668092e+03 + 8 2.0819248556765413e+02 -1.2101254281688034e+01 7.2875382923317329e+02 + 9 1.5634160486512318e+00 -5.8771942140939055e+00 1.3776856876345804e+00 + 10 5.1715702524064000e+02 -6.0329367024604733e+02 -1.9113876792726961e+02 + 11 -9.4002639917994568e-01 1.0582108302448794e+00 -5.6167252695046399e-01 + 12 2.4863938867166024e+01 1.6062869875084797e+01 -1.2360609625898562e+01 + 13 -7.5840697146929953e-02 4.0077788713113287e-02 -1.8559573885665315e-01 + 14 -1.0625298051164564e+00 3.6955553582007694e-01 -1.0916767715816915e-01 + 15 3.5311739874004949e-01 -1.9448880341844976e-01 -1.0191647907497523e+00 + 16 4.3394626801693568e+02 -3.1219927017642323e+02 -1.1116473874381600e+03 + 17 -4.2707030283376542e+02 3.0243865797177557e+02 1.1237993836385187e+03 + 18 3.0368404844222635e-01 4.7171896888581104e+00 -7.8295030918480828e+00 + 19 2.0270801847430087e+00 -6.9918333167659397e-01 5.5492247587169610e+00 + 20 -2.8995874776653414e+00 -3.9821844731834624e+00 4.0840163265257070e+00 + 21 1.5208456586487942e+00 3.1993261879629280e+00 -6.7421857269435970e+00 + 22 4.4874876087889790e+00 1.0719243022009861e+00 5.8233438927261929e+00 + 23 -6.3183698445659342e+00 -3.9593735948101023e+00 1.3084674471388333e+00 + 24 -1.1079754642593542e+00 6.8112748289396228e+00 -3.6957336164134329e+00 + 25 5.0093760593140946e+00 -5.0836369922018387e-01 3.9583976051551146e+00 + 26 -4.3931344945026183e+00 -6.5025659801902629e+00 -8.3304413261248733e-01 + 27 -1.5441431651250574e+00 7.3753658402581390e+00 -2.7159697072843980e+00 + 28 6.4199810218643059e+00 -2.1795392395603654e+00 4.1762085294336435e+00 + 29 -4.5208674519292567e+00 -5.1801103225235723e+00 -1.5012632699970143e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml index 6e7a91b1d..4ab935583 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -69,38 +69,38 @@ init_forces: ! |2 27 -1.5292288622987564e+00 7.3670370982215285e+00 -2.7248017460341405e+00 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 -run_vdwl: 102.179199415441 -run_coul: 221.720424574749 +run_vdwl: 557.056017138723 +run_coul: 220.913884393424 run_stress: ! |2- - 3.9536835059836926e+02 4.7478727611832153e+02 2.6697772213138023e+02 -3.2473551759563611e+02 -9.3384517251004624e+01 1.1447113389415061e+02 + 1.3775223471877366e+03 1.6566887898319319e+03 3.5747571933396416e+03 -1.0386782468208169e+03 -2.0694914366906673e+02 6.6732653084085644e+02 run_forces: ! |2 - 1 3.2379543694095091e+01 8.3517533474668468e+01 3.0446324765540297e+01 - 2 -2.6293125777812743e-01 -1.8753551403615376e+00 -6.6074952829379852e-01 - 3 -2.3593858206223834e+02 9.7836074500199430e+01 8.4490012732579075e+01 - 4 -3.7637774005430330e-01 1.4515275632134367e-01 -2.8559909908376452e-01 - 5 -6.8204117349047333e-01 6.2446579392733381e-01 2.7378988196032061e-01 - 6 1.0933369738542135e+02 -9.6549081355773367e+01 -1.2841652861671275e+02 - 7 4.9593741374539011e+00 -1.0982205074490270e+01 -4.0074332344657762e+01 - 8 -1.6164964517423828e+00 3.2404329611838293e+01 1.0398180359347695e+02 - 9 1.3998347270020033e+00 -6.8051250475180849e+00 5.7998401767503571e-01 - 10 3.9959069894677036e+01 -6.7059817009427704e+01 -8.8447797754483830e+01 - 11 -1.0802301092614446e+00 1.1219889054918024e+00 -8.4425239848885403e-01 - 12 2.0545790084555332e+01 1.6756491338556909e+01 -1.0147374279852464e+01 - 13 -4.0343318322652054e-02 1.7788264857546254e-01 -2.9853594387645793e-01 - 14 -1.3513516832918893e+00 4.4595934974454032e-01 -2.6265884057965921e-01 - 15 3.1593486994562392e-01 -2.5515183581051726e-01 -1.0797891016742802e+00 - 16 5.1256241085467899e+01 -6.6172009357322054e+01 1.2070958681248744e+01 - 17 -1.7692901792987310e+01 1.6463316638296604e+01 3.6795624043957609e+01 - 18 -1.6194704208387012e-01 4.5570016549279950e+00 -7.3322968877636425e+00 - 19 2.3514102703359612e+00 -7.5578860697558603e-01 5.6642936542150100e+00 - 20 -2.8597552716536678e+00 -3.9142546509175768e+00 3.6472607846262273e+00 - 21 1.4156881924178144e+00 3.1994561223697122e+00 -6.4435678803173531e+00 - 22 4.7559025715875727e+00 1.1887804903696844e+00 5.7934257065424006e+00 - 23 -6.5791547155256112e+00 -3.9974753505492755e+00 1.1725336618552618e+00 - 24 -1.2476217160082337e+00 7.0412608813835638e+00 -3.7704984785654614e+00 - 25 5.3901883666295767e+00 -3.4508321075479997e-01 4.2395901512378646e+00 - 26 -4.6303654285662210e+00 -6.8134281022640790e+00 -1.0346808859877155e+00 - 27 -1.8378767955039563e+00 7.4880775187281907e+00 -2.6847264287897374e+00 - 28 6.6966633084764231e+00 -2.2313684819595649e+00 4.2842114179050474e+00 - 29 -4.4013620295570117e+00 -5.2116284612748736e+00 -1.6564246236923319e+00 + 1 1.3484812659843513e+02 3.9092060800918989e+02 1.4373313137859998e+02 + 2 -2.0271633707648873e-01 -2.8298288761987318e+00 -1.1989313018491383e+00 + 3 -1.4342324899553293e+02 -3.7982436667370501e+02 -1.3597762688785588e+02 + 4 -8.2852639177138657e-02 1.8300393504026149e-02 -2.3762389449071866e-01 + 5 -5.4791673482209124e-01 6.5614563469546494e-01 -6.3941396753216292e-02 + 6 -8.0227486127425436e+02 9.1496525291694797e+02 1.0264249576311956e+03 + 7 5.5771543379925383e+01 -3.1037336716922317e+02 -1.5711704568990347e+03 + 8 2.0819248601410811e+02 -1.2101254710546570e+01 7.2875382950845608e+02 + 9 1.5634160487619546e+00 -5.8771942139639481e+00 1.3776856877372210e+00 + 10 5.1715704548744839e+02 -6.0329365711832054e+02 -1.9113877357061190e+02 + 11 -9.4002639920539743e-01 1.0582108303494102e+00 -5.6167252694801739e-01 + 12 2.4863919762583155e+01 1.6062852620618131e+01 -1.2360597545829215e+01 + 13 -7.5840697095099607e-02 4.0077788679094964e-02 -1.8559573885370806e-01 + 14 -1.0625298052267247e+00 3.6955553581650585e-01 -1.0916767712595477e-01 + 15 3.5311739865286279e-01 -1.9448880340077307e-01 -1.0191647907359309e+00 + 16 4.3394626492285823e+02 -3.1219926534478418e+02 -1.1116473917803178e+03 + 17 -4.2707030325761536e+02 3.0243865908364359e+02 1.1237993806924117e+03 + 18 3.0368395429039413e-01 4.7171895570379352e+00 -7.8295029342293025e+00 + 19 2.0270801847492161e+00 -6.9918333164961344e-01 5.5492247587141375e+00 + 20 -2.8995874776604742e+00 -3.9821844731531963e+00 4.0840163265138711e+00 + 21 1.5208456305724503e+00 3.1993262189952332e+00 -6.7421856947959524e+00 + 22 4.4874876087857585e+00 1.0719243021957119e+00 5.8233438927252603e+00 + 23 -6.3183698445588599e+00 -3.9593735948248070e+00 1.3084674471345548e+00 + 24 -1.1079755165485650e+00 6.8112748041127560e+00 -3.6957336981034130e+00 + 25 5.0093760593232943e+00 -5.0836369921098123e-01 3.9583976051674381e+00 + 26 -4.3931344945010125e+00 -6.5025659801859046e+00 -8.3304413261264720e-01 + 27 -1.5441431471578715e+00 7.3753658554767467e+00 -2.7159697179439259e+00 + 28 6.4199810218638094e+00 -2.1795392395617279e+00 4.1762085294330520e+00 + 29 -4.5208674519252963e+00 -5.1801103225337508e+00 -1.5012632699978348e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_mdf.yaml b/unittest/force-styles/tests/mol-pair-lj_mdf.yaml index 127547cd8..47f8b5ca0 100644 --- a/unittest/force-styles/tests/mol-pair-lj_mdf.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_mdf.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:19 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -55,38 +55,38 @@ init_forces: ! |2 27 5.1810629413950949e+01 -2.2705426061698401e+02 9.0848881987846696e+01 28 -1.8041314536249783e+02 7.7534100857114439e+01 -1.2206963127965662e+02 29 1.2861063445049936e+02 1.4952718810862581e+02 3.1216037810340740e+01 -run_vdwl: 146.142938771306 +run_vdwl: 719.44436226705 run_coul: 0 run_stress: ! |2- - 6.2607827422370883e+02 6.7185771646959995e+02 4.8484269825432040e+02 -3.1994971119380688e+02 -2.8453599030980964e+01 1.2292331223237350e+02 + 2.1330145141050098e+03 2.1547683543089806e+03 4.3976473968701594e+03 -7.3873403814571213e+02 4.1744535857041868e+01 6.2788233468660019e+02 run_forces: ! |2 - 1 1.2964000396689100e+01 8.0892267678816779e+01 6.0323237031964290e+01 - 2 1.8550219067108070e+01 1.4016234288534728e+01 -2.2757514465613184e+01 - 3 -2.4823731194481798e+02 1.0508770689878355e+02 8.6172340602494870e+01 - 4 -8.6006937785047199e+00 3.1744103796518286e+00 -6.2092116768831964e+00 - 5 -1.7308376426194827e+00 -2.5575752575563651e+00 1.0273464022561964e+01 - 6 1.1683409017502125e+02 -9.8726850559552034e+01 -1.4208744781635966e+02 - 7 3.8041358692158114e+00 -1.0705007215066576e+01 -4.2399446322832219e+01 - 8 -1.9935799766053155e+01 1.9886787977710259e+01 5.5348128888062327e+01 - 9 1.1205806049421183e+01 1.3198926774269243e+01 4.9879830296866871e+01 - 10 6.4812479379225636e+01 -7.6374990958105926e+01 -7.5660080738756648e+01 - 11 -6.2988692484755910e+00 -8.0952467316475172e+00 -1.6391401801081880e+01 - 12 1.4369329449674010e+01 1.2193215509952983e+01 -8.2527090649331765e+00 - 13 7.3377104327473983e+00 -2.7954976458396432e+00 -1.0299311972585762e-01 - 14 -2.7952420267096540e+00 4.3889411992317068e-01 -7.1100894724883599e+00 - 15 -3.9779622065865550e-01 8.1106030137207359e+00 3.0711098878236198e+00 - 16 5.2787474086118877e+01 -6.7733534176990901e+01 1.5088298239601505e+01 - 17 -1.4633177660642213e+01 1.0014392510695110e+01 4.0799972741104789e+01 - 18 -1.8058839496734806e-02 -3.1846480759106975e-02 2.9996583084227656e-02 - 19 2.5788523138616681e-04 -2.4689081230698263e-04 1.6839267797863840e-03 - 20 -8.8284959462040197e-04 -9.1548924391997983e-04 3.8796476197999985e-04 - 21 -9.9361952309491066e+00 -1.2017775020353685e+01 3.8871115643964899e+01 - 22 -1.8317763935337275e+01 -4.4399886451888806e+00 -2.9440610409403156e+01 - 23 2.8242484527873099e+01 1.6470730701095320e+01 -9.4179941582837330e+00 - 24 1.2413262420490540e+01 -3.6423612222048767e+01 2.3794298924499884e+01 - 25 -3.0031415092604146e+01 5.3796434394870500e+00 -2.5778439006629661e+01 - 26 1.7604732980064760e+01 3.1032191967689467e+01 1.9586447754505791e+00 - 27 3.4727551332752293e+00 -3.8994887375138561e+01 1.1702853254878343e+01 - 28 -2.5472489346144421e+01 1.1754711219486996e+01 -1.7174787246988213e+01 - 29 2.2007795730451406e+01 2.7247258188486892e+01 5.4673625160789614e+00 + 1 -2.0299483970468955e+01 2.6686167842003738e+02 3.2358794351143524e+02 + 2 1.5298617825018465e+02 1.2596516267939977e+02 -1.7961292532505720e+02 + 3 -1.3353630733858557e+02 -3.7923748873514353e+02 -1.4291839863818603e+02 + 4 -7.8374723356679432e+00 2.1276525511055837e+00 -5.5844965312959012e+00 + 5 -2.5014258639526701e+00 -4.0250131447717283e+00 1.2103512373047474e+01 + 6 -8.0681457718283571e+02 9.2165643419425271e+02 1.0270802040062281e+03 + 7 5.5780278090468116e+01 -3.1117549206486143e+02 -1.5746995928952692e+03 + 8 1.3452984131498775e+02 -1.0064660161181091e+02 3.8851792665142210e+02 + 9 7.6746214024736787e+01 8.2501469783788238e+01 3.3944351195208947e+02 + 10 5.2128033582397154e+02 -5.9920098305718830e+02 -1.8126029452767636e+02 + 11 -2.3573112124487730e+00 -5.8616829800824046e+00 -9.6049696388996413e+00 + 12 1.7503861563048297e+01 1.0626842688754651e+01 -8.0602294985300915e+00 + 13 8.0530360122279205e+00 -3.1756454088670161e+00 -1.4618513119289767e-01 + 14 -3.3416062070388288e+00 6.6493435828911651e-01 -8.6345029507261621e+00 + 15 -2.2253607683164695e-01 8.5025684882163368e+00 3.0369719991901301e+00 + 16 4.3476329869781063e+02 -3.1171098373261719e+02 -1.1135222159414625e+03 + 17 -4.2469865215216799e+02 2.9615449807381776e+02 1.1302576161402064e+03 + 18 -1.8843465769147881e-02 -3.3627587100536954e-02 3.1332032445636218e-02 + 19 3.1218159469813760e-04 -2.5159362090997479e-04 1.7538449047824485e-03 + 20 -9.8682030804098922e-04 -1.0146265016976002e-03 3.9763320020084862e-04 + 21 -7.0490859712787085e+01 -7.9749108770702009e+01 2.2171017328750770e+02 + 22 -1.0638723085061208e+02 -2.5949510267883046e+01 -1.6645596823812878e+02 + 23 1.7686805120008694e+02 1.0571024098680182e+02 -5.5243359251479376e+01 + 24 3.8206006621090879e+01 -2.1022837727829318e+02 1.1260688647003221e+02 + 25 -1.4918888339202755e+02 2.3762162226044669e+01 -1.2549193923503633e+02 + 26 1.1097064474668461e+02 1.8645510732429477e+02 1.2861556661395445e+01 + 27 5.0801083902745049e+01 -2.2296555492728402e+02 8.8607134948693030e+01 + 28 -1.7694197577890242e+02 7.6030001738400770e+01 -1.1950524256938733e+02 + 29 1.2614900993076641e+02 1.4694258227352447e+02 3.0893398860530084e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk.yaml b/unittest/force-styles/tests/mol-pair-lj_sdk.yaml index a87a28cda..dbaf863ae 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_sdk.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 00:02:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -71,38 +71,38 @@ init_forces: ! |2 27 5.4452027737546072e+00 -2.3829292146895021e+01 9.5314145895722433e+00 28 -1.8937124096490784e+01 8.1392940248192893e+00 -1.2813499842672824e+01 29 1.3501717387036802e+01 1.5698317050429724e+01 3.2764339258442270e+00 -run_vdwl: 73.6458728660128 +run_vdwl: 96.4078276545056 run_coul: 0 run_stress: ! |2- - 2.0103239980364833e+02 2.0908398949580166e+02 3.3068398239652697e+02 -6.6185478556080000e+01 2.0456160093938930e+01 3.9817039843186876e+01 + 2.3882078825593069e+02 2.4514690319818953e+02 4.7570129095250257e+02 -7.9694877750512205e+01 1.8767838175742067e+01 5.5428941470529864e+01 run_forces: ! |2 - 1 2.8789712911621974e+00 3.1956184389606619e+01 2.8241872181518019e+01 - 2 1.1217219497561373e+01 9.2538272251515217e+00 -1.2909672055055649e+01 - 3 -1.7087073499299219e+01 -3.6882766368064949e+01 -1.3258080606115344e+01 - 4 -7.8128461942266469e-01 2.1815999405776354e-01 -5.7018903455546577e-01 - 5 -2.2563771429213575e-01 -3.6941224583936511e-01 1.1556926014811564e+00 - 6 -6.1537221100458254e+01 6.5376977215802569e+01 4.3377160835540103e+01 - 7 -1.3141978226288904e+00 -1.5597655982346112e+01 -9.9484349281232767e+01 - 8 7.8524652936140402e+00 -3.4099928520157632e+00 4.5262207093438292e+01 - 9 6.0403701547207733e+00 6.3592450851588307e+00 2.6467276453980539e+01 - 10 4.4402327763748708e+01 -5.5514158833675758e+01 -1.9106591955369954e+01 - 11 -2.4249997202743770e-01 -5.5010863363200702e-01 -9.2744244874351034e-01 - 12 5.2783962537235229e+00 3.4066569882156204e+00 -3.0652398974378348e+00 - 13 8.1265577542932110e-01 -3.1078839802637392e-01 -1.0658518929806475e-02 - 14 -3.2326045782523144e-01 5.0339459346113891e-02 -8.0614850160147289e-01 - 15 -5.4009167820397150e-02 8.9466357251930217e-01 3.4232151211232059e-01 - 16 3.0466169486415559e+01 -2.3890015422270686e+01 -6.9718916574429969e+01 - 17 -2.7350731243535666e+01 1.9032741870343287e+01 7.4993265645546742e+01 - 18 -1.7436514080089029e-02 -3.2032111864131942e-02 3.1615274280265365e-02 - 19 4.8316152340419143e-04 -2.3569702316489607e-04 2.0562369590308911e-03 - 20 -1.2203658453407982e-03 -1.2668070818852130e-03 5.7442728002615100e-04 - 21 -6.3673545292470459e+00 -6.6930614361525258e+00 1.9500140223331378e+01 - 22 -9.5935211076502664e+00 -2.4721117708355891e+00 -1.4655788245236106e+01 - 23 1.5948640393672484e+01 9.1791380004207657e+00 -4.8311726326428674e+00 - 24 5.2957437164750827e+00 -2.0233666282158847e+01 1.1923746757015094e+01 - 25 -1.5900975306564844e+01 2.2919579881111143e+00 -1.3445546180782143e+01 - 26 1.0593201882961953e+01 1.7929066616564072e+01 1.4974704291650875e+00 - 27 4.4291375954718095e+00 -1.9712318494618408e+01 7.3490716103887994e+00 - 28 -1.5460012735416790e+01 6.6366264690857690e+00 -1.0274780070214032e+01 - 29 1.1040653889634033e+01 1.3084006461222209e+01 2.9201047203100541e+00 + 1 1.5664848962423554e+00 3.6792896090376161e+01 3.5595994354486024e+01 + 2 1.4985828112752897e+01 1.2348763878366595e+01 -1.7578052249472016e+01 + 3 -1.8481240381848338e+01 -4.5774542206181074e+01 -1.6567606455454335e+01 + 4 -8.0032988110181813e-01 2.1915399902309440e-01 -5.7160759564399222e-01 + 5 -2.3991665834913181e-01 -3.9337242658184912e-01 1.1878688255013135e+00 + 6 -8.0496149802561419e+01 9.0869238506243093e+01 9.6107460316209014e+01 + 7 -2.1944679180868203e+00 -2.5933838742693958e+01 -1.6973370595253942e+02 + 8 1.6506757109804209e+01 -9.6752577307307703e+00 5.8709458670876629e+01 + 9 7.4922593827105626e+00 8.0356490220018628e+00 3.3113602286416700e+01 + 10 5.3176855115087804e+01 -6.5485335456193695e+01 -2.0626064068220355e+01 + 11 -2.3177698492715690e-01 -5.7729152820357887e-01 -9.5069402064952779e-01 + 12 5.4588425083462360e+00 3.4144623077681988e+00 -3.0256581879169993e+00 + 13 8.4287591776380910e-01 -3.3638409934758418e-01 -1.3422800863955713e-02 + 14 -3.5425783113460918e-01 6.7754887547925316e-02 -8.9035908757652937e-01 + 15 -3.5671644034407181e-02 8.8327622990313359e-01 3.2051095907038979e-01 + 16 4.5837487652469434e+01 -3.4034630372676780e+01 -1.1152549699248610e+02 + 17 -4.3001047362779360e+01 2.9603935805467692e+01 1.1643030180944059e+02 + 18 -1.7581461994463577e-02 -3.2389430110425915e-02 3.1737209713517275e-02 + 19 5.4868175235251761e-04 -1.8599377728544190e-04 2.0500116666288693e-03 + 20 -1.3106855416156785e-03 -1.3476888269991945e-03 5.7956299125904104e-04 + 21 -7.6151608866207638e+00 -8.5717643349095880e+00 2.3825798016638498e+01 + 22 -1.1432989941482161e+01 -2.7907588809382999e+00 -1.7875305137668455e+01 + 23 1.9036102717245900e+01 1.1376271886494386e+01 -5.9375402892665452e+00 + 24 4.0521573827736672e+00 -2.2621475804189028e+01 1.2055560139380747e+01 + 25 -1.6013773262174137e+01 2.5416783035032937e+00 -1.3468758706060497e+01 + 26 1.1949679351584987e+01 2.0067175781516866e+01 1.3889991330228972e+00 + 27 5.5398232081244032e+00 -2.3947219577490479e+01 9.5559147519353722e+00 + 28 -1.9075290407310298e+01 8.1879779168539706e+00 -1.2881149482252750e+01 + 29 1.3545263073287861e+01 1.5767559657785107e+01 3.3195849787219087e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml index 46da2726a..53097bb23 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 00:02:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:17 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -77,38 +77,38 @@ init_forces: ! |2 27 3.4241479416704426e+00 -1.3796209110902463e+01 5.8526837131859448e+00 28 -1.4607808276558991e+01 3.9069582630427737e+00 -9.2683763466292834e+00 29 1.1580032348283542e+01 9.8887041359319383e+00 3.3917294969037011e+00 -run_vdwl: 74.6353256669958 -run_coul: 226.185803354306 +run_vdwl: 96.4212032046822 +run_coul: 225.785423219965 run_stress: ! |2- - 1.8196373869968056e+02 1.6813268507731888e+02 2.9802311554755647e+02 -6.0326572499381633e+01 1.5314286739900409e+01 4.8903736438732203e+01 + 2.1600118274105742e+02 2.0230919666468455e+02 4.3707688756974488e+02 -7.5214751729052296e+01 1.2184165306644045e+01 6.5043382029051401e+01 run_forces: ! |2 - 1 5.4387814004285771e+00 3.1297278073082666e+01 2.8792183901236029e+01 - 2 1.1155010820877212e+01 6.6014946401870009e+00 -1.4524961030174843e+01 - 3 -1.7040097787672522e+01 -3.6948493488727550e+01 -1.3254067974085952e+01 - 4 -8.8370677310548440e-01 2.5265235354355259e-01 -8.1614799307928299e-01 - 5 -7.7196823798829795e-01 2.9942420634818079e-01 1.1132594213912526e+00 - 6 -6.0712624726238658e+01 6.2222664430191990e+01 4.2113952344462206e+01 - 7 -1.2480888584598575e+00 -1.5034374826702805e+01 -9.7493630380443520e+01 - 8 7.2509693269555768e+00 4.2596471506533251e-01 4.7659255732370923e+01 - 9 7.8261753763198962e+00 1.9056963071490252e-01 2.8358952426431827e+01 - 10 4.3764467250944094e+01 -5.4749702698196330e+01 -1.9229851477566786e+01 - 11 -1.1615994078925702e+00 4.9650172747259391e-01 -1.5138402680405441e+00 - 12 8.1273059393004292e+00 2.9207235244438916e+00 -1.5841098639082083e+00 - 13 7.3721720447022732e-01 -3.1497053265915570e-01 -2.0813614679366255e-01 - 14 -1.4343787843456994e+00 4.2194159088217015e-01 -8.9885845560224431e-01 - 15 2.9667968478745704e-01 6.5551531129015883e-01 -7.0086584598946733e-01 - 16 3.0197942107207769e+01 -2.4796805494957503e+01 -6.9006910559684087e+01 - 17 -3.0327086774230381e+01 2.5823999723997151e+01 6.9451909736691647e+01 - 18 -1.7551758233236292e-01 4.3470404747295346e+00 -7.4554673028313001e+00 - 19 2.4042188033723924e+00 -4.4972876029399672e-01 5.6817208547075353e+00 - 20 -2.8371398712357649e+00 -3.8548153691075084e+00 3.6344074919911602e+00 - 21 -5.0739819779584296e+00 -3.1197538254987776e+00 1.2477220688900395e+01 - 22 -8.3764197722844553e+00 -3.0728693931200537e+00 -1.0019850505364664e+01 - 23 1.3008692359769363e+01 6.6253194039443786e+00 -1.9184830997027504e+00 - 24 3.6907560264832364e+00 -1.2865929376602351e+01 7.6215484990137474e+00 - 25 -1.3747384615114337e+01 -4.0936660568293037e-01 -1.0783624180639340e+01 - 26 9.4772934495688510e+00 1.3031088850215601e+01 2.5363479331029981e+00 - 27 2.8833769175962649e+00 -1.1390165141708167e+01 4.6221620688961931e+00 - 28 -1.2554933825701482e+01 3.0646725754458437e+00 -7.7995649842864445e+00 - 29 1.0086042326478960e+01 8.3301242817022008e+00 3.1454489689971212e+00 + 1 4.2796615606791031e+00 3.6403979204232137e+01 3.5912661048384891e+01 + 2 1.4739949906550462e+01 9.4599803457545573e+00 -1.8905789806690944e+01 + 3 -1.8467381276880111e+01 -4.5858328642080529e+01 -1.6552711537758750e+01 + 4 -8.8088728150762785e-01 2.3729296815293061e-01 -8.1353823407400083e-01 + 5 -7.7974954517143369e-01 2.7062663025802619e-01 1.1181902181808236e+00 + 6 -7.9008592066971346e+01 8.7000103718659261e+01 9.3572996431411411e+01 + 7 -2.2742181320252088e+00 -2.5050866445263257e+01 -1.6595618370266772e+02 + 8 1.4957588924866874e+01 -5.1527405006646161e+00 6.1078426180691906e+01 + 9 9.1183472611137866e+00 2.2161980309617260e+00 3.4542938315416130e+01 + 10 5.2928632867931938e+01 -6.5127142300007989e+01 -2.0860698393535692e+01 + 11 -1.1327693296334713e+00 4.5070312068479201e-01 -1.5133710260773143e+00 + 12 8.3192755236695390e+00 2.9332871356133974e+00 -1.5947752594898761e+00 + 13 7.6833903610487808e-01 -3.4526258568641244e-01 -1.9134536429530155e-01 + 14 -1.4097208247190178e+00 4.2556702879275632e-01 -9.8548153434778607e-01 + 15 3.2015077343891318e-01 6.8085811043506583e-01 -6.9322002237653135e-01 + 16 4.5109153997405208e+01 -3.4552819328287057e+01 -1.0962282637339656e+02 + 17 -4.5432370685433696e+01 3.5789850222666402e+01 1.0980141999197143e+02 + 18 3.0462578438819499e-01 4.7171257505699931e+00 -7.8128291376358341e+00 + 19 2.0280595075961263e+00 -6.9179531445223874e-01 5.5382200076423036e+00 + 20 -2.9002592098192279e+00 -3.9668997552159921e+00 4.0724086754441160e+00 + 21 -5.7129881011577766e+00 -4.2274346281495880e+00 1.4943083417813535e+01 + 22 -9.6058536854681886e+00 -3.3434555245476942e+00 -1.1967359580877590e+01 + 23 1.4899130074436968e+01 7.9896717153595604e+00 -2.4675486769220587e+00 + 24 2.4605790225579067e+00 -1.3456281166524066e+01 7.0240065300110546e+00 + 25 -1.2934640597191718e+01 -3.8774464882678061e-01 -1.0032546256649661e+01 + 26 9.9105156669922927e+00 1.3586433556274224e+01 2.3900555369644527e+00 + 27 3.5100744088986255e+00 -1.3920367883804094e+01 5.8994726010851979e+00 + 28 -1.4748276770221633e+01 3.9579376850629950e+00 -9.3489676797376990e+00 + 29 1.1633623189569631e+01 9.9615235000324684e+00 3.4253136315160804e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml index 6724cf2eb..8c3a199e3 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 00:02:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -78,38 +78,38 @@ init_forces: ! |2 27 2.9037104384113634e+00 -1.2180625028459321e+01 5.0275817117954995e+00 28 -1.4250304655397576e+01 3.0300324399816163e+00 -8.8153806706582216e+00 29 1.1836082667745567e+01 9.0621100202489338e+00 3.7896043026981410e+00 -run_vdwl: 74.734252113714 -run_coul: 114.477092548625 +run_vdwl: 96.417135798345 +run_coul: 114.088538843245 run_stress: ! |2- - 1.8073976329712028e+02 1.6546464380835602e+02 2.9434759881235703e+02 -5.9041359453882365e+01 1.5901861587517107e+01 5.0299665184445395e+01 + 2.1450745266430917e+02 1.9939196325836133e+02 4.3286812098542731e+02 -7.4141060775112749e+01 1.2618785660759315e+01 6.6376039818113469e+01 run_forces: ! |2 - 1 5.0720669595815160e+00 3.1372737551075350e+01 2.9095987910667755e+01 - 2 1.1307952469643597e+01 6.3291707652916172e+00 -1.4733646520972163e+01 - 3 -1.7059001240104038e+01 -3.6956250959706757e+01 -1.3230585585847036e+01 - 4 -7.6865276103639990e-01 2.7308975030195387e-01 -9.2233199717562020e-01 - 5 -6.5570287538017447e-01 3.6800621821301410e-01 1.0577533784644608e+00 - 6 -6.0114236229466378e+01 6.2566916331015982e+01 4.1457850913456554e+01 - 7 -1.5445643382145751e+00 -1.5411481744887944e+01 -9.7111604688020890e+01 - 8 6.9542708000543136e+00 -4.0058864798828753e-02 4.8165519226075553e+01 - 9 8.0381202875137969e+00 4.7371595162885199e-01 2.8332304731172172e+01 - 10 4.3755234610008166e+01 -5.4675082968454596e+01 -1.9293462492289059e+01 - 11 -1.2242383289097776e+00 6.2498821314798625e-01 -1.5972308491538092e+00 - 12 8.4518565745523748e+00 2.5475977232497082e+00 -1.4071496574842153e+00 - 13 6.3969619390747512e-01 -2.1778268192560010e-01 -2.3005839839672385e-01 - 14 -1.5673413175669992e+00 5.4153166291047461e-01 -9.2853459743791844e-01 - 15 2.0342685490293833e-01 7.3131241533643976e-01 -7.6174831307830326e-01 - 16 3.0105343032987673e+01 -2.4546470094827004e+01 -6.8808712654197819e+01 - 17 -3.0400990748104363e+01 2.5590470812597360e+01 6.8885048044356409e+01 - 18 2.9029774916558887e-01 5.7405231315809777e+00 -8.5019334947122740e+00 - 19 2.2584765287591950e+00 -1.1454610706546606e+00 6.3424578851626752e+00 - 20 -3.0863426914947700e+00 -4.4738060233786090e+00 4.2219710191368449e+00 - 21 -4.9892661440949535e+00 -2.4483411647209676e+00 1.1705159334703836e+01 - 22 -8.5093405552341892e+00 -3.3143035214714343e+00 -9.5860802350723588e+00 - 23 1.2967980176333754e+01 6.3255094499961562e+00 -1.5004337089526723e+00 - 24 3.5060357395619790e+00 -1.1529287701698376e+01 7.1572025627195472e+00 - 25 -1.3660083109860075e+01 -1.0151675041727555e+00 -1.0565992388698906e+01 - 26 9.5211324701976441e+00 1.2381558278728567e+01 2.7625770687377056e+00 - 27 2.4457437106321236e+00 -9.9002673116106550e+00 3.9197604188908408e+00 - 28 -1.2367913915967870e+01 2.2433754951007341e+00 -7.4760014606211884e+00 - 29 1.0430040097632430e+01 7.5632578621330113e+00 3.5519145485666201e+00 + 1 3.8828871311104876e+00 3.6463725767704510e+01 3.6257896912351882e+01 + 2 1.4924546190916049e+01 9.2090399694789280e+00 -1.9143537921544581e+01 + 3 -1.8493623285610447e+01 -4.5867021233508012e+01 -1.6527038965887563e+01 + 4 -7.6479647480287960e-01 2.6024357876344628e-01 -9.1474924867293816e-01 + 5 -6.6328793235900707e-01 3.4283715795991820e-01 1.0602029782853455e+00 + 6 -7.8530531563194515e+01 8.7386729823446302e+01 9.2721533421840036e+01 + 7 -2.5666474231821828e+00 -2.5403375999561160e+01 -1.6541907652213715e+02 + 8 1.4798246231556492e+01 -5.7154817247779999e+00 6.1603071270883099e+01 + 9 9.3180365325957464e+00 2.5127851969336237e+00 3.4497875337797424e+01 + 10 5.2897821112305849e+01 -6.5033051770344969e+01 -2.0907304154983144e+01 + 11 -1.1915478672936513e+00 5.7622541123231685e-01 -1.5927961335922629e+00 + 12 8.6407536264459655e+00 2.5524462960902867e+00 -1.4323860402401392e+00 + 13 6.7150802501939044e-01 -2.4853514347890460e-01 -2.0921312545040957e-01 + 14 -1.5409719119227185e+00 5.4690853150351615e-01 -1.0090960647608160e+00 + 15 2.2421432151789944e-01 7.6181422901609708e-01 -7.4885523915406216e-01 + 16 4.4986872874785490e+01 -3.4277777689597990e+01 -1.0929296446675518e+02 + 17 -4.5463398792908464e+01 3.5518777454122514e+01 1.0911844498205159e+02 + 18 7.4222786513355365e-01 6.0551897779435926e+00 -8.9521239394424530e+00 + 19 1.8833047723317178e+00 -1.3700710459032031e+00 6.2495414808278991e+00 + 20 -3.1187344786430065e+00 -4.5482196225404286e+00 4.6959057124516539e+00 + 21 -5.5843392283067583e+00 -3.4731095231697524e+00 1.4032433407295938e+01 + 22 -9.6897849337390980e+00 -3.5975878922596269e+00 -1.1444642856294776e+01 + 23 1.4766131366554932e+01 7.6207126802449272e+00 -2.0042161572542052e+00 + 24 2.3118471086551904e+00 -1.1909120754150765e+01 6.5280171729310599e+00 + 25 -1.2764216202301073e+01 -1.0116260787608502e+00 -9.7604700435993266e+00 + 26 9.8350457437265444e+00 1.2736285875229832e+01 2.5921787306063373e+00 + 27 2.9897355288214653e+00 -1.2306381964437204e+01 5.0793326161587435e+00 + 28 -1.4392398538427003e+01 3.0820636140076432e+00 -8.8993523228056315e+00 + 29 1.1891100201213998e+01 9.1355750788134333e+00 3.8213891790935688e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml index c35f5d7c1..6c97aa9d8 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:05:54 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -78,38 +78,38 @@ init_forces: ! |2 27 2.9037102814588285e+00 -1.2180624835780948e+01 5.0275816273007337e+00 28 -1.4250304832815443e+01 3.0300321386140592e+00 -8.8153806609288345e+00 29 1.1836083036624068e+01 9.0621100518602020e+00 3.7896044412902152e+00 -run_vdwl: 74.7342521124953 -run_coul: 114.477093451889 +run_vdwl: 96.41713579845 +run_coul: 114.088541875396 run_stress: ! |2- - 1.8073976304151648e+02 1.6546464431202676e+02 2.9434760578205413e+02 -5.9041359865100034e+01 1.5901862039479150e+01 5.0299664956031876e+01 + 2.1450745398007408e+02 1.9939196542234055e+02 4.3286812623303888e+02 -7.4141058257828249e+01 1.2618786425639284e+01 6.6376041002915073e+01 run_forces: ! |2 - 1 5.0720673386300685e+00 3.1372737640509989e+01 2.9095987810352344e+01 - 2 1.1307952415771164e+01 6.3291707652771878e+00 -1.4733646596577190e+01 - 3 -1.7059001227023501e+01 -3.6956250979301672e+01 -1.3230585592914581e+01 - 4 -7.6865277133023691e-01 2.7308980119907567e-01 -9.2233193415774428e-01 - 5 -6.5570289876695731e-01 3.6800613176525593e-01 1.0577533761918376e+00 - 6 -6.0114236760779129e+01 6.2566916086590808e+01 4.1457851153494595e+01 - 7 -1.5445644682017661e+00 -1.5411481764084417e+01 -9.7111604752474165e+01 - 8 6.9542709638649072e+00 -4.0059060120689480e-02 4.8165519281907571e+01 - 9 8.0381201831761704e+00 4.7371613333586310e-01 2.8332304868623229e+01 - 10 4.3755234593318242e+01 -5.4675082985544329e+01 -1.9293462529707895e+01 - 11 -1.2242383799455581e+00 6.2498818361923714e-01 -1.5972308246825191e+00 - 12 8.4518567321118638e+00 2.5475977398264344e+00 -1.4071497824803458e+00 - 13 6.3969617700223647e-01 -2.1778270741514713e-01 -2.3005840637595679e-01 - 14 -1.5673412610561024e+00 5.4153161593712684e-01 -9.2853461250465397e-01 - 15 2.0342679190436708e-01 7.3131233966783793e-01 -7.6174832898700773e-01 - 16 3.0105343210851437e+01 -2.4546470086741568e+01 -6.8808712420063088e+01 - 17 -3.0400991200475612e+01 2.5590470801017116e+01 6.8885048107547732e+01 - 18 2.9029803288998091e-01 5.7405233903947002e+00 -8.5019336119143194e+00 - 19 2.2584765619309159e+00 -1.1454608830507993e+00 6.3424579647253072e+00 - 20 -3.0863427527774303e+00 -4.4738061119916726e+00 4.2219710843087261e+00 - 21 -4.9892659452493335e+00 -2.4483410137505488e+00 1.1705159097816299e+01 - 22 -8.5093402713626460e+00 -3.3143034580955666e+00 -9.5860798789826429e+00 - 23 1.2967980174140818e+01 6.3255093357461938e+00 -1.5004336929053061e+00 - 24 3.5060356644410446e+00 -1.1529287766502682e+01 7.1572025894365243e+00 - 25 -1.3660083035582883e+01 -1.0151676247673949e+00 -1.0565992640651116e+01 - 26 9.5211323632394791e+00 1.2381558293734670e+01 2.7625770178818838e+00 - 27 2.4457436082871862e+00 -9.9002670260458654e+00 3.9197599195423201e+00 - 28 -1.2367913977887723e+01 2.2433754166930502e+00 -7.4760013078640846e+00 - 29 1.0430040138879031e+01 7.5632577920978168e+00 3.5519146414142320e+00 + 1 3.8828872653343498e+00 3.6463725556427619e+01 3.6257896849517820e+01 + 2 1.4924545940177273e+01 9.2090398695070466e+00 -1.9143537856252454e+01 + 3 -1.8493623279553017e+01 -4.5867021235207915e+01 -1.6527038968345217e+01 + 4 -7.6479646849219141e-01 2.6024357744121046e-01 -9.1474919999545456e-01 + 5 -6.6328801425565920e-01 3.4283718001069768e-01 1.0602029810556921e+00 + 6 -7.8530531552063351e+01 8.7386730163882874e+01 9.2721533083164829e+01 + 7 -2.5666474823727818e+00 -2.5403376222192239e+01 -1.6541907662571850e+02 + 8 1.4798246325068357e+01 -5.7154820495685827e+00 6.1603071652534581e+01 + 9 9.3180361785185521e+00 2.5127852284655998e+00 3.4497875229370322e+01 + 10 5.2897821081096858e+01 -6.5033051751345383e+01 -2.0907304133782173e+01 + 11 -1.1915478678681515e+00 5.7622541458440502e-01 -1.5927961449898853e+00 + 12 8.6407539107557021e+00 2.5524462479356780e+00 -1.4323860218817954e+00 + 13 6.7150798013844337e-01 -2.4853516090447680e-01 -2.0921307052603769e-01 + 14 -1.5409719878339987e+00 5.4690842216529922e-01 -1.0090959664212136e+00 + 15 2.2421449452525308e-01 7.6181421958015849e-01 -7.4885515862640728e-01 + 16 4.4986872666673108e+01 -3.4277777116405055e+01 -1.0929296448182528e+02 + 17 -4.5463398538442803e+01 3.5518777374819898e+01 1.0911844472603258e+02 + 18 7.4222764304575850e-01 6.0551892628111412e+00 -8.9521238829033081e+00 + 19 1.8833048803056203e+00 -1.3700709619469276e+00 6.2495413997112834e+00 + 20 -3.1187343946311867e+00 -4.5482194718391051e+00 4.6959056855629351e+00 + 21 -5.5843391518688481e+00 -3.4731093423482911e+00 1.4032433003745099e+01 + 22 -9.6897849663878759e+00 -3.5975878340976410e+00 -1.1444642682572457e+01 + 23 1.4766131006485551e+01 7.6207126959288134e+00 -2.0042163300131395e+00 + 24 2.3118471712710682e+00 -1.1909120223594128e+01 6.5280172157462850e+00 + 25 -1.2764216123968907e+01 -1.0116261962196811e+00 -9.7604697387323327e+00 + 26 9.8350458155314868e+00 1.2736285755878990e+01 2.5921787621956915e+00 + 27 2.9897354745952294e+00 -1.2306382022562630e+01 5.0793326703424180e+00 + 28 -1.4392398222761230e+01 3.0820635930425020e+00 -8.8993522121934525e+00 + 29 1.1891100216977380e+01 9.1355750257501018e+00 3.8213892157995759e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml index 8bb8f1885..24ffccc29 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 00:02:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -77,38 +77,38 @@ init_forces: ! |2 27 3.4241478263070952e+00 -1.3796208945185219e+01 5.8526835192637785e+00 28 -1.4607810988101456e+01 3.9069573281401428e+00 -9.2683775626899187e+00 29 1.1580034971657559e+01 9.8887046452005567e+00 3.3917310027287062e+00 -run_vdwl: 74.6353253661386 -run_coul: 226.18584060491 +run_vdwl: 96.4212032011243 +run_coul: 225.785462165742 run_stress: ! |2- - 1.8196375844953110e+02 1.6813268919461680e+02 2.9802312811483387e+02 -6.0326566882353447e+01 1.5314292493078778e+01 4.8903738317927143e+01 + 2.1600120582585106e+02 2.0230920430734940e+02 4.3707690506386808e+02 -7.5214748198931886e+01 1.2184171804318320e+01 6.5043388456772135e+01 run_forces: ! |2 - 1 5.4387798109561540e+00 3.1297277509838523e+01 2.8792183025854602e+01 - 2 1.1155010426944102e+01 6.6014944402078450e+00 -1.4524959578860893e+01 - 3 -1.7040097668383112e+01 -3.6948493664439667e+01 -1.3254068120301108e+01 - 4 -8.8370671460782957e-01 2.5265282859817129e-01 -8.1614786384030191e-01 - 5 -7.7196798219066065e-01 2.9942513216334049e-01 1.1132595304565729e+00 - 6 -6.0712625115138231e+01 6.2222664527468950e+01 4.2113951379335617e+01 - 7 -1.2480898372392426e+00 -1.5034374656309424e+01 -9.7493632700255603e+01 - 8 7.2509693876664665e+00 4.2596347493201492e-01 4.7659258821656891e+01 - 9 7.8261765462749384e+00 1.9056919877306999e-01 2.8358953648924473e+01 - 10 4.3764467295160998e+01 -5.4749702165772057e+01 -1.9229852169224216e+01 - 11 -1.1615995938763630e+00 4.9650242817407941e-01 -1.5138401578504623e+00 - 12 8.1273065651531411e+00 2.9207231934793958e+00 -1.5841108686261918e+00 - 13 7.3721746670559596e-01 -3.1497068225635821e-01 -2.0813605094138948e-01 - 14 -1.4343789170387748e+00 4.2194147498562029e-01 -8.9885824319157570e-01 - 15 2.9667965428440818e-01 6.5551492314164905e-01 -7.0086526869336918e-01 - 16 3.0197943073086250e+01 -2.4796806143002627e+01 -6.9006910497215713e+01 - 17 -3.0327087076249128e+01 2.5824000511546728e+01 6.9451909278721288e+01 - 18 -1.7551671343023845e-01 4.3470408185697025e+00 -7.4554687833088060e+00 - 19 2.4042166697874880e+00 -4.4973014139967343e-01 5.6817206370633473e+00 - 20 -2.8371379462792321e+00 -3.8548140394921160e+00 3.6344083401151428e+00 - 21 -5.0739823983454535e+00 -3.1197527040584880e+00 1.2477220985515279e+01 - 22 -8.3764218822638927e+00 -3.0728708395548616e+00 -1.0019851498204231e+01 - 23 1.3008694823045252e+01 6.6253201264274235e+00 -1.9184823117985736e+00 - 24 3.6907563030212365e+00 -1.2865928687196272e+01 7.6215478221247448e+00 - 25 -1.3747386384768939e+01 -4.0936802922320981e-01 -1.0783625221745158e+01 - 26 9.4772953324857223e+00 1.3031089848429815e+01 2.5363495626664423e+00 - 27 2.8833765001841245e+00 -1.1390164589761469e+01 4.6221617502967387e+00 - 28 -1.2554936113372037e+01 3.0646714467305114e+00 -7.7995660047652127e+00 - 29 1.0086044488427257e+01 8.3301244589993839e+00 3.1454505560916437e+00 + 1 4.2796597114904324e+00 3.6403979010061875e+01 3.5912659741722948e+01 + 2 1.4739949205893973e+01 9.4599795481966353e+00 -1.8905788546704152e+01 + 3 -1.8467381140621082e+01 -4.5858328756063123e+01 -1.6552711652602305e+01 + 4 -8.8088732856953211e-01 2.3729349962852248e-01 -8.1353804424809850e-01 + 5 -7.7974938725084553e-01 2.7062763448512961e-01 1.1181904743251248e+00 + 6 -7.9008592904952238e+01 8.7000104497958077e+01 9.3572994447006906e+01 + 7 -2.2742184516678119e+00 -2.5050866411317585e+01 -1.6595618595499690e+02 + 8 1.4957588645166137e+01 -5.1527415446134395e+00 6.1078429270246382e+01 + 9 9.1183485175356118e+00 2.2161974773872304e+00 3.4542939908949478e+01 + 10 5.2928632974275565e+01 -6.5127141931788884e+01 -2.0860699041951300e+01 + 11 -1.1327694365656851e+00 4.5070379306314967e-01 -1.5133709355463731e+00 + 12 8.3192763402157262e+00 2.9332870312016905e+00 -1.5947763000306718e+00 + 13 7.6833913861050451e-01 -3.4526273723498407e-01 -1.9134516413379404e-01 + 14 -1.4097210448112365e+00 4.2556675510813297e-01 -9.8548125330876379e-01 + 15 3.2015079225668147e-01 6.8085776970431122e-01 -6.9321948881295903e-01 + 16 4.5109154740699481e+01 -3.4552820005430682e+01 -1.0962282619975888e+02 + 17 -4.5432370240070540e+01 3.5789850947623378e+01 1.0980141917259230e+02 + 18 3.0462622346154156e-01 4.7171258255019612e+00 -7.8128303698810022e+00 + 19 2.0280576306818405e+00 -6.9179672117043456e-01 5.5382195902992457e+00 + 20 -2.9002573480422362e+00 -3.9668985984706917e+00 4.0724097232094278e+00 + 21 -5.7129884718581989e+00 -4.2274340987079739e+00 1.4943083923686077e+01 + 22 -9.6058560638376616e+00 -3.3434571785263514e+00 -1.1967361140923240e+01 + 23 1.4899132999247600e+01 7.9896727918211035e+00 -2.4675478927225631e+00 + 24 2.4605793061352186e+00 -1.3456280625087775e+01 7.0240062982177403e+00 + 25 -1.2934642208568818e+01 -3.8774560178529960e-01 -1.0032546463242987e+01 + 26 9.9105177763255696e+00 1.3586434886089229e+01 2.3900570614677861e+00 + 27 3.5100738839466112e+00 -1.3920367869467380e+01 5.8994724820924489e+00 + 28 -1.4748279177624394e+01 3.9579368385061908e+00 -9.3489687889113586e+00 + 29 1.1633625318497806e+01 9.9615237733279596e+00 3.4253151439594753e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_smooth.yaml b/unittest/force-styles/tests/mol-pair-lj_smooth.yaml index abe5f9b70..0171513b4 100644 --- a/unittest/force-styles/tests/mol-pair-lj_smooth.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_smooth.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 00:34:30 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 5.1810556888375629e+01 -2.2705478382763954e+02 9.0849114461863849e+01 28 -1.8041315308300508e+02 7.7534078237359694e+01 -1.2206962621857849e+02 29 1.2861063646262821e+02 1.4952717884185427e+02 3.1216037219026877e+01 -run_vdwl: 146.140201104582 +run_vdwl: 719.441849866247 run_coul: 0 run_stress: ! |2- - 6.2607869255854428e+02 6.7185935716209224e+02 4.8484672980964689e+02 -3.1994875670441837e+02 -2.8454125838604742e+01 1.2292130538864528e+02 + 2.1330144733952702e+03 2.1547695598297596e+03 4.3976498516149932e+03 -7.3873283558449202e+02 4.1744169147817587e+01 6.2787994171090793e+02 run_forces: ! |2 - 1 1.2964027666668644e+01 8.0892473836186625e+01 6.0323178333978760e+01 - 2 1.8550227128203201e+01 1.4016237299764452e+01 -2.2757522969597570e+01 - 3 -2.4823735994055684e+02 1.0508780865668027e+02 8.6172401416640668e+01 - 4 -8.6006897788338179e+00 3.1744185838912187e+00 -6.2092171417158557e+00 - 5 -1.7308351659069339e+00 -2.5575770135257994e+00 1.0273461780840321e+01 - 6 1.1683407005002351e+02 -9.8726827964031244e+01 -1.4208743884798838e+02 - 7 3.8041578104045111e+00 -1.0704952899782750e+01 -4.2399882223710534e+01 - 8 -1.9935816442375188e+01 1.9886802580668885e+01 5.5348114205810440e+01 - 9 1.1205804476223435e+01 1.3198927883778676e+01 4.9879830771072960e+01 - 10 6.4812481447547484e+01 -7.6374989318931966e+01 -7.5660087772570876e+01 - 11 -6.2988689994396125e+00 -8.0952570014100260e+00 -1.6391410822211562e+01 - 12 1.4369425065670107e+01 1.2193286965194813e+01 -8.2527851907755192e+00 - 13 7.3377072687712763e+00 -2.7955027860950659e+00 -1.0299063707022700e-01 - 14 -2.7952431432511928e+00 4.3888488369497097e-01 -7.1101002094132086e+00 - 15 -3.9779897756476146e-01 8.1106017384357578e+00 3.0711122406850242e+00 - 16 5.2787469708283275e+01 -6.7733541455041035e+01 1.5088305872904641e+01 - 17 -1.4633172234372394e+01 1.0014125749436921e+01 4.0800214573633710e+01 - 18 -1.8028153526068517e-02 -3.1478003036874300e-02 2.9497503702109903e-02 - 19 2.5608665018438527e-04 -2.4060786218484977e-04 1.6747466032127258e-03 - 20 -8.8119691756921635e-04 -9.1957330234813809e-04 3.6010929876267243e-04 - 21 -9.9361885123522189e+00 -1.2017934732110618e+01 3.8871119112785586e+01 - 22 -1.8317762559806862e+01 -4.4399907151191718e+00 -2.9440612297434306e+01 - 23 2.8242479060889675e+01 1.6470727201178818e+01 -9.4179917526157304e+00 - 24 1.2413241765502574e+01 -3.6423445235111693e+01 2.3794829786222476e+01 - 25 -3.0031404924460354e+01 5.3796420063449064e+00 -2.5778429443332506e+01 - 26 1.7604730358636736e+01 3.1032212583348112e+01 1.9586506054247899e+00 - 27 3.4726778116541972e+00 -3.8995406248953039e+01 1.1703140923859431e+01 - 28 -2.5472483864251586e+01 1.1754686271616464e+01 -1.7174775925733577e+01 - 29 2.2007778188486551e+01 2.7247227314092985e+01 5.4673532507069602e+00 + 1 -2.0299408890617482e+01 2.6686198774043669e+02 3.2358786395898318e+02 + 2 1.5298617830583268e+02 1.2596516001613786e+02 -1.7961292412773386e+02 + 3 -1.3353625491264617e+02 -3.7923753431857955e+02 -1.4291842517057540e+02 + 4 -7.8374698545372867e+00 2.1276595409313774e+00 -5.5845021045905883e+00 + 5 -2.5014234400796904e+00 -4.0250152160121688e+00 1.2103510683933884e+01 + 6 -8.0681466160571040e+02 9.2165651039460602e+02 1.0270802400991045e+03 + 7 5.5780302775989263e+01 -3.1117544157336710e+02 -1.5746997989229897e+03 + 8 1.3452983973712702e+02 -1.0064660034683908e+02 3.8851792520917405e+02 + 9 7.6746213900458955e+01 8.2501469902247152e+01 3.3944351209160567e+02 + 10 5.2128033526125228e+02 -5.9920098832888846e+02 -1.8126029871210736e+02 + 11 -2.3573118085994382e+00 -5.8616944580241723e+00 -9.6049808819513984e+00 + 12 1.7503975897666376e+01 1.0626930302276850e+01 -8.0603160114975267e+00 + 13 8.0530312980441163e+00 -3.1756495387769390e+00 -1.4618313445749978e-01 + 14 -3.3416065188171613e+00 6.6492607746111398e-01 -8.6345131808752118e+00 + 15 -2.2253843262491158e-01 8.5025661635304886e+00 3.0369735873546735e+00 + 16 4.3476329769367510e+02 -3.1171099744319548e+02 -1.1135222101911554e+03 + 17 -4.2469864617238591e+02 2.9615424648621286e+02 1.1302578406684256e+03 + 18 -1.8816432005217709e-02 -3.3271372684193570e-02 3.0874946314379197e-02 + 19 3.1022308843950126e-04 -2.4431620057673199e-04 1.7434458866107878e-03 + 20 -9.8460342929776326e-04 -1.0179522388672935e-03 3.6959818180361790e-04 + 21 -7.0490935597732090e+01 -7.9749195525465950e+01 2.2171021891721188e+02 + 22 -1.0638723087343764e+02 -2.5949511112332345e+01 -1.6645596795129123e+02 + 23 1.7686805487280785e+02 1.0571023813493646e+02 -5.5243360339017698e+01 + 24 3.8205955916915428e+01 -2.1022829659622406e+02 1.1260725306863242e+02 + 25 -1.4918888746173289e+02 2.3762163600586600e+01 -1.2549193901922531e+02 + 26 1.1097064120525103e+02 1.8645512635173802e+02 1.2861564234540340e+01 + 27 5.0801011261313093e+01 -2.2296607701540572e+02 8.8607368249771739e+01 + 28 -1.7694198230016079e+02 7.6029978859986301e+01 -1.1950523684817306e+02 + 29 1.2614901055509456e+02 1.4694257154314704e+02 3.0893397836520268e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_smooth_linear.yaml b/unittest/force-styles/tests/mol-pair-lj_smooth_linear.yaml index 008a34501..ccd05990b 100644 --- a/unittest/force-styles/tests/mol-pair-lj_smooth_linear.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_smooth_linear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Aug 7 18:09:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -53,38 +53,38 @@ init_forces: ! |2 27 5.1809791369511800e+01 -2.2705548670842322e+02 9.0849693244516942e+01 28 -1.8041317714556408e+02 7.7534055022302738e+01 -1.2206961203464421e+02 29 1.2861061471308315e+02 1.4952715208640333e+02 3.1216058453122045e+01 -run_vdwl: 1451.32997824325 +run_vdwl: 7168.74470801024 run_coul: 0 run_stress: ! |2- - 6.2608837054871594e+02 6.7187938581855144e+02 4.8486033694196726e+02 -3.1995066505043610e+02 -2.8457032344025496e+01 1.2292065232782427e+02 + 2.1330243778591253e+03 2.1547897736668579e+03 4.3976633892748978e+03 -7.3873489722118427e+02 4.1741192200028131e+01 6.2787933430487840e+02 run_forces: ! |2 - 1 1.2963405855876360e+01 8.0893182167601040e+01 6.0323200856885379e+01 - 2 1.8550219001901059e+01 1.4016252768086382e+01 -2.2757528510013309e+01 - 3 -2.4823751408330577e+02 1.0508794682789653e+02 8.6172297626974924e+01 - 4 -8.6007183363538218e+00 3.1744348123323252e+00 -6.2092350062706263e+00 - 5 -1.7308528921718875e+00 -2.5575658156580716e+00 1.0273462340393680e+01 - 6 1.1683370608347786e+02 -9.8726612681864083e+01 -1.4208743592586663e+02 - 7 3.8037628613549117e+00 -1.0704864355853315e+01 -4.2400416872541562e+01 - 8 -1.9935895935843018e+01 1.9886682429879365e+01 5.5348045949279246e+01 - 9 1.1205807105575637e+01 1.3198922475875237e+01 4.9879822367692121e+01 - 10 6.4812607837816216e+01 -7.6375193298952965e+01 -7.5660067361874837e+01 - 11 -6.2988646915587649e+00 -8.0952700733263612e+00 -1.6391426488541690e+01 - 12 1.4369771872020793e+01 1.2193178433177252e+01 -8.2529083743765703e+00 - 13 7.3377409923499268e+00 -2.7955083685120261e+00 -1.0300224782769388e-01 - 14 -2.7952279692219490e+00 4.3888447038815859e-01 -7.1101226781043563e+00 - 15 -3.9777679154148493e-01 8.1106042464594488e+00 3.0710989792887191e+00 - 16 5.2787693023584708e+01 -6.7733866109949943e+01 1.5088403159681988e+01 - 17 -1.4632827756747478e+01 1.0013562721308679e+01 4.0800761565499371e+01 - 18 -1.7813525545675762e-02 -3.0690348613229682e-02 2.8788664386281224e-02 - 19 2.5622655159858725e-04 -2.1989232478118571e-04 1.6460925636792155e-03 - 20 -8.7073544339873622e-04 -8.9682982183893764e-04 3.3721102126432485e-04 - 21 -9.9354509595654612e+00 -1.2018605553686941e+01 3.8870580939383316e+01 - 22 -1.8317758497802007e+01 -4.4400043374329234e+00 -2.9440635405981823e+01 - 23 2.8242517085206991e+01 1.6470733435386162e+01 -9.4180106534681354e+00 - 24 1.2413508412532980e+01 -3.6422775520347059e+01 2.3795712776966507e+01 - 25 -3.0031357111430587e+01 5.3796503257095969e+00 -2.5778375588686725e+01 - 26 1.7604771350184603e+01 3.1032271222888891e+01 1.9586733277470683e+00 - 27 3.4719422456324827e+00 -3.8996058569609829e+01 1.1703736447802768e+01 - 28 -2.5472504536515963e+01 1.1754667067298493e+01 -1.7174765723168974e+01 - 29 2.2007723868981163e+01 2.7247158351665757e+01 5.4673625311566338e+00 + 1 -2.0300016638239374e+01 2.6686276100071370e+02 3.2358791307145037e+02 + 2 1.5298617050564732e+02 1.2596518374406095e+02 -1.7961293408527445e+02 + 3 -1.3353662059549973e+02 -3.7923729143063815e+02 -1.4291845546689859e+02 + 4 -7.8374907594784888e+00 2.1276732011208002e+00 -5.5845137034497254e+00 + 5 -2.5014421677365739e+00 -4.0250039428858377e+00 1.2103512377632354e+01 + 6 -8.0681487553077852e+02 9.2165659259825065e+02 1.0270801088891853e+03 + 7 5.5779903080065630e+01 -3.1117534568205093e+02 -1.5747003113940646e+03 + 8 1.3452975207256222e+02 -1.0064670751771551e+02 3.8851788290665741e+02 + 9 7.6746217793669032e+01 8.2501466685807060e+01 3.3944351408418254e+02 + 10 5.2128046285397249e+02 -5.9920120971636516e+02 -1.8126033214251675e+02 + 11 -2.3573064235661199e+00 -5.8617080694738677e+00 -9.6049951346357094e+00 + 12 1.7504343830406029e+01 1.0626823878086091e+01 -8.0604485390804168e+00 + 13 8.0530579930117696e+00 -3.1756526850347249e+00 -1.4619455387727065e-01 + 14 -3.3415910040121988e+00 6.6492557370927052e-01 -8.6345371705564329e+00 + 15 -2.2251554849270444e-01 8.5025732291624170e+00 3.0369621593348208e+00 + 16 4.3476354794547154e+02 -3.1171136583955035e+02 -1.1135220593407212e+03 + 17 -4.2469829193061946e+02 2.9615367044368941e+02 1.1302583746065238e+03 + 18 -1.8600021872156442e-02 -3.2478395490369905e-02 3.0160446893216387e-02 + 19 3.1044910230457868e-04 -2.2338673784857088e-04 1.7147941315548483e-03 + 20 -9.7422800656540094e-04 -9.9498254733123279e-04 3.4675628539447589e-04 + 21 -7.0490188738084598e+01 -7.9749848061701101e+01 2.2170966765757075e+02 + 22 -1.0638721771005983e+02 -2.5949527579075717e+01 -1.6645598674768777e+02 + 23 1.7686807490251056e+02 1.0571022723730751e+02 -5.5243374736950010e+01 + 24 3.8206277550368334e+01 -2.1022759113509190e+02 1.1260816384839144e+02 + 25 -1.4918887505409612e+02 2.3762183115009840e+01 -1.2549191141746211e+02 + 26 1.1097065922803087e+02 1.8645514699888329e+02 1.2861589409694247e+01 + 27 5.0800248265849334e+01 -2.2296677692103663e+02 8.8607948328422225e+01 + 28 -1.7694200626376056e+02 7.6029956032608752e+01 -1.1950522306166276e+02 + 29 1.2614898614363591e+02 1.4694254160698580e+02 3.0893418158482131e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_table_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_table_coul_long.yaml index c5c38fe07..a7be6a954 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:12:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 4.9787264831993880e+01 -2.1702378492854734e+02 8.7171908557137229e+01 28 -1.7608392920068218e+02 7.3301696261216364e+01 -1.1852448703330357e+02 29 1.2668890412939926e+02 1.4371750554743343e+02 3.1331418003628617e+01 -run_vdwl: 147.102426694524 -run_coul: 231.547234871665 +run_vdwl: 719.7074660584 +run_coul: 225.904237287567 run_stress: ! |2- - 6.0919946201421988e+02 6.3107486633797907e+02 4.5857020422771228e+02 -3.1004410289258726e+02 -2.9997162347755431e+01 1.3052869362890030e+02 + 2.1107537186691984e+03 2.1122379540627758e+03 4.3599324980929077e+03 -7.3409237544465191e+02 3.5359612060552294e+01 6.3752276735532018e+02 run_forces: ! |2 - 1 1.5314341205678486e+01 7.9288642490784369e+01 6.1575316271714996e+01 - 2 1.9396919695303119e+01 1.2345122420340662e+01 -2.5332949177150759e+01 - 3 -2.4626133682135156e+02 1.0354031953861355e+02 8.5144438448546651e+01 - 4 -8.8802510400027757e+00 3.3242343941129051e+00 -6.4498821695174051e+00 - 5 -2.3923102678705463e+00 -1.8640351082303857e+00 1.0409864216935313e+01 - 6 1.1513973578816243e+02 -9.9341683946117257e+01 -1.4128602776413862e+02 - 7 4.4093102526473835e+00 -1.0659981388734394e+01 -4.1678753369598915e+01 - 8 -1.9868178149055055e+01 2.2747136541665622e+01 5.6457133898202095e+01 - 9 1.3497169875038249e+01 6.1641440267915044e+00 5.3035466619223691e+01 - 10 6.4065571996948023e+01 -7.5533401579373077e+01 -7.5547052764835286e+01 - 11 -7.3191434942599534e+00 -6.8856558572360669e+00 -1.7097167936812113e+01 - 12 1.7335578038078207e+01 1.1587192649732790e+01 -6.6964876090846452e+00 - 13 7.3170467155828272e+00 -2.7360333230130927e+00 -4.0456573322628303e-01 - 14 -4.2028744833248162e+00 8.3860844630055698e-01 -7.1471584120941243e+00 - 15 -2.3354898897002949e-01 7.7706845408805894e+00 2.0010266047280063e+00 - 16 5.2780269298568335e+01 -6.8530907103753592e+01 1.3740476761760695e+01 - 17 -1.8298627906569415e+01 1.7602799822808429e+01 3.7174317049593419e+01 - 18 -6.3511706684870328e-01 4.8016019623842849e+00 -6.5708473263134044e+00 - 19 2.4125453719401606e+00 -8.7915573566205618e-01 5.4231247570072538e+00 - 20 -2.7248412430551321e+00 -3.8904055215701314e+00 3.4618835711051537e+00 - 21 -9.8169830034493941e+00 -9.2669725639388130e+00 3.5600822975931536e+01 - 22 -1.7981884126072515e+01 -5.1466604416467439e+00 -2.7099256235688927e+01 - 23 2.7159949532535283e+01 1.5032360511224208e+01 -7.6945205389021263e+00 - 24 1.1640105316120435e+01 -3.2220309671551597e+01 2.1233691209615991e+01 - 25 -2.9814417745628266e+01 3.4702385031723315e+00 -2.4986236145968000e+01 - 26 1.7326774130667435e+01 2.8422945634017008e+01 2.8030693229220005e+00 - 27 2.2636828242526583e+00 -3.4114834877109693e+01 1.0082389585491104e+01 - 28 -2.4164812532041658e+01 9.4962047236856133e+00 -1.5922767590329363e+01 - 29 2.2535326826976828e+01 2.4637800911422538e+01 5.7706514808820266e+00 + 1 -1.7610671215592912e+01 2.6644632521102045e+02 3.2393635216395325e+02 + 2 1.5276958690669434e+02 1.2310601849290569e+02 -1.8097797853681732e+02 + 3 -1.3352438104601353e+02 -3.7931520757706460e+02 -1.4290253172546900e+02 + 4 -7.9210457135617531e+00 2.1479067663275164e+00 -5.8262867701536001e+00 + 5 -3.0436146101513000e+00 -3.3598708462465376e+00 1.2037071926940142e+01 + 6 -8.0541518026485835e+02 9.1789632036689375e+02 1.0248061088860331e+03 + 7 5.5711018479636273e+01 -3.1035014039673541e+02 -1.5712640121118625e+03 + 8 1.3310087648888313e+02 -9.6225164931796002e+01 3.9090028134664328e+02 + 9 7.8393574096383631e+01 7.6654576916777046e+01 3.4092264699930962e+02 + 10 5.2097953985081574e+02 -5.9878733318004220e+02 -1.8147990706416718e+02 + 11 -3.2607666284816870e+00 -4.8312585716220333e+00 -1.0171801099251301e+01 + 12 2.0370378732483267e+01 1.0143707466773128e+01 -6.6267604575040622e+00 + 13 7.9794514940241115e+00 -3.1830746441555182e+00 -3.2644128902287028e-01 + 14 -4.4037331181238306e+00 1.0233682059040270e+00 -8.7298910565806924e+00 + 15 1.3154197257894473e-01 8.2984800086853898e+00 2.0213778454816551e+00 + 16 4.3411491582998713e+02 -3.1229546154719185e+02 -1.1118126564243598e+03 + 17 -4.2721103632379203e+02 3.0241089633145083e+02 1.1238250136941531e+03 + 18 3.0045467348052834e-01 4.7293877278044141e+00 -7.8044959744010605e+00 + 19 2.0270210691329429e+00 -7.0015060135378171e-01 5.5349995459804822e+00 + 20 -2.8986405261586912e+00 -3.9674896221940701e+00 4.0696696835430410e+00 + 21 -6.8658022376668754e+01 -7.5474151318292641e+01 2.1302465876853705e+02 + 22 -1.0464809690827120e+02 -2.6524463282991348e+01 -1.6069148016428093e+02 + 23 1.7288793881936073e+02 1.0241548772465130e+02 -5.1825425140727546e+01 + 24 3.6621512295556656e+01 -2.0125837138511807e+02 1.0765962828816227e+02 + 25 -1.4622310926189377e+02 2.0851692219011852e+01 -1.2215078335601069e+02 + 26 1.0903616826045678e+02 1.8015275208443350e+02 1.3874388668809031e+01 + 27 4.8836594003509347e+01 -2.1313610884803569e+02 8.5044672108250779e+01 + 28 -1.7278645223632475e+02 7.1874824696108448e+01 -1.1608941518997334e+02 + 29 1.2434417725690928e+02 1.4125650253409245e+02 3.1022996434785735e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml b/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml index 93482e60d..22af7a535 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml @@ -1,7 +1,7 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:52:08 202 -epsilon: 2.0e-08 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 +epsilon: 2e-08 prerequisites: ! | atom full pair lj/long/coul/long @@ -61,38 +61,38 @@ init_forces: ! |2 27 5.1808319664078056e+01 -2.2705686796453989e+02 9.0850639433523526e+01 28 -1.8041324502061397e+02 7.7534032022992875e+01 -1.2206961052934710e+02 29 1.2861058916815250e+02 1.4952711846193120e+02 3.1216122432569136e+01 -run_vdwl: 146.274335893558 +run_vdwl: 719.579930165123 run_coul: 0 run_stress: ! |2- - 6.2612940829357342e+02 6.7194041520958228e+02 4.8491203145001367e+02 -3.1996539092594355e+02 -2.8461924774289425e+01 1.2291631209662745e+02 + 2.1330680688707021e+03 2.1548546308869545e+03 4.3977148874255754e+03 -7.3875161697424380e+02 4.1735811498020226e+01 6.2787463680556255e+02 run_forces: ! |2 - 1 1.2959444179898764e+01 8.0898657729742709e+01 6.0325084589735106e+01 - 2 1.8550175207515242e+01 1.4016344273823519e+01 -2.2757540148832035e+01 - 3 -2.4823858541661636e+02 1.0508823550185259e+02 8.6171981341141617e+01 - 4 -8.6009635351279385e+00 3.1744963674267583e+00 -6.2093700583047982e+00 - 5 -1.7310166723102316e+00 -2.5575649261036912e+00 1.0273556182687628e+01 - 6 1.1683023663322314e+02 -9.8725175915846080e+01 -1.4208699510986790e+02 - 7 3.8012667991063935e+00 -1.0705658885469246e+01 -4.2405641297857031e+01 - 8 -1.9936207146662344e+01 1.9884969005876030e+01 5.5348739365179455e+01 - 9 1.1205857995419088e+01 1.3198889371141741e+01 4.9879908122698716e+01 - 10 6.4813932923855788e+01 -7.6376996345479810e+01 -7.5660201199421323e+01 - 11 -6.2988735275266627e+00 -8.0953930874938713e+00 -1.6391554676297908e+01 - 12 1.4372880877777362e+01 1.2193137364133001e+01 -8.2541733662791366e+00 - 13 7.3379802047718004e+00 -2.7955143737428960e+00 -1.0304519329579827e-01 - 14 -2.7951413224074608e+00 4.3890905624726723e-01 -7.1102884778086555e+00 - 15 -3.9760226239019958e-01 8.1106630324186835e+00 3.0710276620073889e+00 - 16 5.2789368843161938e+01 -6.7736228415187810e+01 1.5089237193010232e+01 - 17 -1.4630960101062319e+01 1.0010612924423388e+01 4.0805291240926856e+01 - 18 -1.5924443076776620e-02 -2.7304351832779711e-02 2.5570260683432443e-02 - 19 2.8731963107011155e-04 -1.4554852722407848e-04 1.5107946171005703e-03 - 20 -8.2455684558128603e-04 -8.3306876171628387e-04 2.6070403075870245e-04 - 21 -9.9339560551715245e+00 -1.2020250112071123e+01 3.8869124159774046e+01 - 22 -1.8317783646559480e+01 -4.4400391077928063e+00 -2.9440731934378256e+01 - 23 2.8242619540405755e+01 1.6470760764059182e+01 -9.4180585767627232e+00 - 24 1.2414476508828987e+01 -3.6421089095920166e+01 2.3798463812991059e+01 - 25 -3.0031215500694653e+01 5.3797110538054911e+00 -2.5778173574937060e+01 - 26 1.7604893833914652e+01 3.1032456854162618e+01 1.9587231049669485e+00 - 27 3.4705701804687381e+00 -3.8997340262741318e+01 1.1704660044295883e+01 - 28 -2.5472565911678490e+01 1.1754653690860275e+01 -1.7174771794465844e+01 - 29 2.2007629050151305e+01 2.7247036506997258e+01 5.4674068297622522e+00 + 1 -2.0303948254424395e+01 2.6686899596789556e+02 3.2359016518213178e+02 + 2 1.5298615610822677e+02 1.2596535657051209e+02 -1.7961300102545684e+02 + 3 -1.3353991126069081e+02 -3.7923586072070503e+02 -1.4291795469580529e+02 + 4 -7.8376889593604737e+00 2.1277206683680054e+00 -5.5845995840633478e+00 + 5 -2.5016142999803752e+00 -4.0249945596909882e+00 1.2103599341586277e+01 + 6 -8.0681670696274170e+02 9.2165657469319763e+02 1.0270790494256896e+03 + 7 5.5777283247313925e+01 -3.1117605601312488e+02 -1.5747054058355266e+03 + 8 1.3452944362304228e+02 -1.0064838300331942e+02 3.8851870006775812e+02 + 9 7.6746265071088587e+01 8.2501426552177634e+01 3.3944362176605415e+02 + 10 5.2128180181906839e+02 -5.9920326842737029e+02 -1.8126075712685659e+02 + 11 -2.3572972797764962e+00 -5.8618376289140928e+00 -9.6051066964302620e+00 + 12 1.7507734812865966e+01 1.0626811563667351e+01 -8.0618287578047862e+00 + 13 8.0532394773674234e+00 -3.1756389228762600e+00 -1.4623829718812770e-01 + 14 -3.3414949300981007e+00 6.6494754629484709e-01 -8.6347121966705647e+00 + 15 -2.2233074511952422e-01 8.5026532135760018e+00 3.0368979895244679e+00 + 16 4.3476545821901254e+02 -3.1171406020147833e+02 -1.1135207416691405e+03 + 17 -4.2469626069708210e+02 2.9615051307634303e+02 1.1302628778609944e+03 + 18 -1.6689275893143968e-02 -2.9024552446949899e-02 2.6855550699586259e-02 + 19 3.4203554321050975e-04 -1.4647978125451492e-04 1.5781230116024621e-03 + 20 -9.2671516942585024e-04 -9.2825803716101163e-04 2.6824552636968272e-04 + 21 -7.0488718026206328e+01 -7.9751420547479015e+01 2.2170820478157603e+02 + 22 -1.0638721556449802e+02 -2.5949567848601184e+01 -1.6645606139243640e+02 + 23 1.7686814710643398e+02 1.0571022235709120e+02 -5.5243417079287390e+01 + 24 3.8207391775024341e+01 -2.1022582111888909e+02 1.1261099973420413e+02 + 25 -1.4918884866022873e+02 2.3762270819489441e+01 -1.2549179983564363e+02 + 26 1.1097072491577600e+02 1.8645523206944495e+02 1.2861651870208744e+01 + 27 5.0798782133063142e+01 -2.2296815183206172e+02 8.8608895906892457e+01 + 28 -1.7694207364534284e+02 7.6029933717060288e+01 -1.1950522205850056e+02 + 29 1.2614895493278584e+02 1.4694250129965764e+02 3.0893480404953333e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_table_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_table_coul_table.yaml index a470fcf7f..d3cfee267 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:12:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:18 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -62,38 +62,38 @@ init_forces: ! |2 27 4.9787264699025812e+01 -2.1702378476330091e+02 8.7171908363476405e+01 28 -1.7608393218830406e+02 7.3301695273279591e+01 -1.1852448845096609e+02 29 1.2668890703792840e+02 1.4371750615273265e+02 3.1331419700612329e+01 -run_vdwl: 147.102426252189 -run_coul: 231.547240508456 +run_vdwl: 719.707466025823 +run_coul: 225.904271605306 run_stress: ! |2- - 6.0919947319091500e+02 6.3107485884082109e+02 4.5857019809383860e+02 -3.1004409243413562e+02 -2.9997158953251258e+01 1.3052869846250803e+02 + 2.1107537361360182e+03 2.1122379552504867e+03 4.3599325102107177e+03 -7.3409236921986474e+02 3.5359618646489480e+01 6.3752277106167185e+02 run_forces: ! |2 - 1 1.5314339795060784e+01 7.9288641930908128e+01 6.1575315626625084e+01 - 2 1.9396919081319222e+01 1.2345121810564475e+01 -2.5332947835208468e+01 - 3 -2.4626133652413094e+02 1.0354031882871385e+02 8.5144438140135122e+01 - 4 -8.8802513813183328e+00 3.3242349706201999e+00 -6.4498821105100426e+00 - 5 -2.3923100708478890e+00 -1.8640342413197746e+00 1.0409864667075016e+01 - 6 1.1513974050725666e+02 -9.9341687390456983e+01 -1.4128603080915775e+02 - 7 4.4093096541452406e+00 -1.0659980189336562e+01 -4.1678749715799299e+01 - 8 -1.9868182770560075e+01 2.2747138895158351e+01 5.6457133354183995e+01 - 9 1.3497171256693235e+01 6.1641422842189559e+00 5.3035467396262327e+01 - 10 6.4065571824833668e+01 -7.5533400846362341e+01 -7.5547052498106879e+01 - 11 -7.3191436494832258e+00 -6.8856552890805203e+00 -1.7097168099011714e+01 - 12 1.7335578971692541e+01 1.1587192170630598e+01 -6.6964886678137896e+00 - 13 7.3170468008917791e+00 -2.7360333933701577e+00 -4.0456561032518107e-01 - 14 -4.2028745485810726e+00 8.3860826594211069e-01 -7.1471583459905927e+00 - 15 -2.3354931800432668e-01 7.7706842779976029e+00 2.0010271442033600e+00 - 16 5.2780267916599563e+01 -6.8530905717040810e+01 1.3740481378769744e+01 - 17 -1.8298626339154829e+01 1.7602800600136661e+01 3.7174311321441081e+01 - 18 -6.3511626475557825e-01 4.8016020177453607e+00 -6.5708486375920021e+00 - 19 2.4125435975258989e+00 -8.7915717913018132e-01 5.4231245776300163e+00 - 20 -2.7248396412540692e+00 -3.8904046105623187e+00 3.4618845567120786e+00 - 21 -9.8169833619373925e+00 -9.2669714765580018e+00 3.5600822876657119e+01 - 22 -1.7981885551113407e+01 -5.1466617338674601e+00 -2.7099256947813377e+01 - 23 2.7159951413085466e+01 1.5032360896188315e+01 -7.6945199178482415e+00 - 24 1.1640105339912965e+01 -3.2220308619296183e+01 2.1233690207804660e+01 - 25 -2.9814418744116274e+01 3.4702372618794599e+00 -2.4986236455127472e+01 - 26 1.7326775614638048e+01 2.8422946228984497e+01 2.8030707439800522e+00 - 27 2.2636822313312095e+00 -3.4114834398602163e+01 1.0082389239437273e+01 - 28 -2.4164813812212220e+01 9.4962039155387128e+00 -1.5922768136149232e+01 - 29 2.2535327972483309e+01 2.4637800729756204e+01 5.7706525555370849e+00 + 1 -1.7610672394852518e+01 2.6644632431248175e+02 3.2393635089865097e+02 + 2 1.5276958665434356e+02 1.2310601776366123e+02 -1.8097797708732665e+02 + 3 -1.3352438090081597e+02 -3.7931520769127167e+02 -1.4290253187512442e+02 + 4 -7.9210457502731337e+00 2.1479072302584812e+00 -5.8262865881732351e+00 + 5 -3.0436143880288782e+00 -3.3598699332093314e+00 1.2037072102081241e+01 + 6 -8.0541518082653477e+02 9.1789632113858670e+02 1.0248061071437037e+03 + 7 5.5711018458375385e+01 -3.1035014009885305e+02 -1.5712640143719445e+03 + 8 1.3310087603897301e+02 -9.6225165597898780e+01 3.9090028438361139e+02 + 9 7.8393575753793314e+01 7.6654576011259167e+01 3.4092264932690875e+02 + 10 5.2097954014410857e+02 -5.9878733287058924e+02 -1.8147990781552721e+02 + 11 -3.2607667885017424e+00 -4.8312578569403319e+00 -1.0171801083768701e+01 + 12 2.0370379096141331e+01 1.0143707584718694e+01 -6.6267618398320325e+00 + 13 7.9794516510200149e+00 -3.1830748244242582e+00 -3.2644123113676088e-01 + 14 -4.4037332344604563e+00 1.0233679901829353e+00 -8.7298909255223993e+00 + 15 1.3154176233801926e-01 8.2984797069251162e+00 2.0213784297286561e+00 + 16 4.3411491593864054e+02 -3.1229546190218986e+02 -1.1118126562209209e+03 + 17 -4.2721103637272705e+02 3.0241089725386945e+02 1.1238250131223806e+03 + 18 3.0045497286062922e-01 4.7293876819816942e+00 -7.8044970354168486e+00 + 19 2.0270184104294646e+00 -7.0015259332978552e-01 5.5349993106565272e+00 + 20 -2.8986380429838490e+00 -3.9674879282981315e+00 4.0696708689118921e+00 + 21 -6.8658022887173402e+01 -7.5474150549115890e+01 2.1302465943201270e+02 + 22 -1.0464809900208587e+02 -2.6524464715312742e+01 -1.6069148144898165e+02 + 23 1.7288794145455157e+02 1.0241548860658946e+02 -5.1825424501001599e+01 + 24 3.6621512241170926e+01 -2.0125837126005027e+02 1.0765962729257420e+02 + 25 -1.4622311074707821e+02 2.0851691259343362e+01 -1.2215078389014762e+02 + 26 1.0903617012781143e+02 1.8015275330755517e+02 1.3874390065113388e+01 + 27 4.8836593718258968e+01 -2.1313610871443578e+02 8.5044671920562294e+01 + 28 -1.7278645515645024e+02 7.1874823687510073e+01 -1.1608941660277667e+02 + 29 1.2434418006914902e+02 1.4125650300099602e+02 3.1022998220703990e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml index 970c36a8d..8dc5a5371 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:12:39 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -70,38 +70,38 @@ init_forces: ! |2 27 -1.5292288824197682e+00 7.3670370809736765e+00 -2.7248017348072757e+00 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 -run_vdwl: 102.17924022107 -run_coul: 221.720424547052 +run_vdwl: 557.056030414379 +run_coul: 220.913884393211 run_stress: ! |2- - 3.9536843152958863e+02 4.7478735052880882e+02 2.6697778836010133e+02 -3.2473557116721821e+02 -9.3384532444390231e+01 1.1447113380823491e+02 + 1.3775223749165898e+03 1.6566888199057378e+03 3.5747572153094793e+03 -1.0386782389365808e+03 -2.0694915319826390e+02 6.6732651503606473e+02 run_forces: ! |2 - 1 3.2379540762392146e+01 8.3517527376500595e+01 3.0446322562899013e+01 - 2 -2.6293126954969470e-01 -1.8753551337504288e+00 -6.6074949266768956e-01 - 3 -2.3593857244579175e+02 9.7836073990929123e+01 8.4490011269483034e+01 - 4 -3.7637774233534965e-01 1.4515275289051174e-01 -2.8559910144033024e-01 - 5 -6.8204117190585078e-01 6.2446578537000408e-01 2.7378988247551717e-01 - 6 1.0933365749740351e+02 -9.6549045229238345e+01 -1.2841653297832025e+02 - 7 4.9593737763184675e+00 -1.0982207204081561e+01 -4.0074345224736312e+01 - 8 -1.6165015030147969e+00 3.2404345132568395e+01 1.0398184275222998e+02 - 9 1.3998347047690538e+00 -6.8051250778537886e+00 5.7998397496119269e-01 - 10 3.9959095943331178e+01 -6.7059878784865489e+01 -8.8447803029101166e+01 - 11 -1.0802301059891917e+00 1.1219888941003999e+00 -8.4425239996511192e-01 - 12 2.0545804674151686e+01 1.6756506789728121e+01 -1.0147383950574667e+01 - 13 -4.0343321860028536e-02 1.7788265175415657e-01 -2.9853594465493405e-01 - 14 -1.3513516711060465e+00 4.4595934938291676e-01 -2.6265884549659041e-01 - 15 3.1593487994627950e-01 -2.5515183536659702e-01 -1.0797891014057148e+00 - 16 5.1256244542267822e+01 -6.6172009664417871e+01 1.2070939236446156e+01 - 17 -1.7692907383703862e+01 1.6463320293114926e+01 3.6795640301371016e+01 - 18 -1.6194696530598809e-01 4.5570017775494565e+00 -7.3322970254852580e+00 - 19 2.3514102714651339e+00 -7.5578860560185779e-01 5.6642936508844102e+00 - 20 -2.8597552719562440e+00 -3.9142546520874975e+00 3.6472607860552211e+00 - 21 1.4156882122230650e+00 3.1994560957760751e+00 -6.4435678998356867e+00 - 22 4.7559025720950281e+00 1.1887804903968897e+00 5.7934257053926705e+00 - 23 -6.5791547151855934e+00 -3.9974753494160717e+00 1.1725336611501176e+00 - 24 -1.2476216696331957e+00 7.0412609027869220e+00 -3.7704984048769328e+00 - 25 5.3901883576434351e+00 -3.4508321180138424e-01 4.2395901335300090e+00 - 26 -4.6303654307322102e+00 -6.8134281037798567e+00 -1.0346808880509224e+00 - 27 -1.8378768074685554e+00 7.4880775093982148e+00 -2.6847264242404041e+00 - 28 6.6966633089189811e+00 -2.2313684816367823e+00 4.2842114180401456e+00 - 29 -4.4013620273874521e+00 -5.2116284583490931e+00 -1.6564246240665144e+00 + 1 1.3484812617643655e+02 3.9092060907905881e+02 1.4373313186875424e+02 + 2 -2.0271633709558251e-01 -2.8298288761954420e+00 -1.1989313018422827e+00 + 3 -1.4342325169135404e+02 -3.7982436401312367e+02 -1.3597762522196101e+02 + 4 -8.2852639170403378e-02 1.8300393499896591e-02 -2.3762389449286367e-01 + 5 -5.4791673481260883e-01 6.5614563468859632e-01 -6.3941396758813898e-02 + 6 -8.0227485959117564e+02 9.1496525055055213e+02 1.0264249558607539e+03 + 7 5.5771542742901516e+01 -3.1037336726418590e+02 -1.5711704577486075e+03 + 8 2.0819248557622822e+02 -1.2101254278469153e+01 7.2875382921366111e+02 + 9 1.5634160486515425e+00 -5.8771942140936604e+00 1.3776856876347048e+00 + 10 5.1715702528567328e+02 -6.0329367021473058e+02 -1.9113876793739885e+02 + 11 -9.4002639918005437e-01 1.0582108302452642e+00 -5.6167252695039538e-01 + 12 2.4863938807569784e+01 1.6062869835057732e+01 -1.2360609590287279e+01 + 13 -7.5840697146843009e-02 4.0077788712999760e-02 -1.8559573885663116e-01 + 14 -1.0625298051169374e+00 3.6955553582006323e-01 -1.0916767715798915e-01 + 15 3.5311739873969084e-01 -1.9448880341844133e-01 -1.0191647907497325e+00 + 16 4.3394626801111173e+02 -3.1219927016684147e+02 -1.1116473874470314e+03 + 17 -4.2707030283561585e+02 3.0243865797663881e+02 1.1237993836262522e+03 + 18 3.0368404811702365e-01 4.7171896884788271e+00 -7.8295030913577346e+00 + 19 2.0270801847430513e+00 -6.9918333167655178e-01 5.5492247587169476e+00 + 20 -2.8995874776653250e+00 -3.9821844731833815e+00 4.0840163265256679e+00 + 21 1.5208456585642767e+00 3.1993261880616224e+00 -6.7421857268432062e+00 + 22 4.4874876087889630e+00 1.0719243022009792e+00 5.8233438927261991e+00 + 23 -6.3183698445659218e+00 -3.9593735948101436e+00 1.3084674471388218e+00 + 24 -1.1079754643213167e+00 6.8112748288931053e+00 -3.6957336165248171e+00 + 25 5.0093760593141283e+00 -5.0836369922012981e-01 3.9583976051551799e+00 + 26 -4.3931344945026298e+00 -6.5025659801902727e+00 -8.3304413261248367e-01 + 27 -1.5441431650516397e+00 7.3753658403140143e+00 -2.7159697073224933e+00 + 28 6.4199810218643165e+00 -2.1795392395603739e+00 4.1762085294336417e+00 + 29 -4.5208674519292238e+00 -5.1801103225235803e+00 -1.5012632699970256e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml index b14f9befe..bbd2e3033 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Aug 2020 -date_generated: Sat Aug 22 22:12:40 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 2.5e-09 prerequisites: ! | atom full @@ -70,38 +70,38 @@ init_forces: ! |2 27 -1.5292288656803577e+00 7.3670372934081341e+00 -2.7248019284801495e+00 28 6.4035005649493479e+00 -2.1779026033513014e+00 4.1727097093108574e+00 29 -4.5201927345996555e+00 -5.1735150000565087e+00 -1.4886414114327997e+00 -run_vdwl: 102.179240104247 -run_coul: 221.720433690232 +run_vdwl: 557.056030407218 +run_coul: 220.913919083367 run_stress: ! |2- - 3.9536844653740309e+02 4.7478735337315516e+02 2.6697778676259202e+02 -3.2473556180637638e+02 -9.3384529239080990e+01 1.1447113567750279e+02 + 1.3775223933013649e+03 1.6566888250620884e+03 3.5747572316072610e+03 -1.0386782354170655e+03 -2.0694914632954348e+02 6.6732651945202394e+02 run_forces: ! |2 - 1 3.2379539682333338e+01 8.3517527382245007e+01 3.0446321989943470e+01 - 2 -2.6293176063144369e-01 -1.8753559257400856e+00 -6.6074805427162742e-01 - 3 -2.3593857201316504e+02 9.7836073322917471e+01 8.4490010974265999e+01 - 4 -3.7637798569004405e-01 1.4515335713556210e-01 -2.8559897785029431e-01 - 5 -6.8204117043080026e-01 6.2446673119397145e-01 2.7379021832220585e-01 - 6 1.0933366043217671e+02 -9.6549048284871404e+01 -1.2841653623699446e+02 - 7 4.9593739671988599e+00 -1.0982206335730501e+01 -4.0074341753629255e+01 - 8 -1.6165054847990841e+00 3.2404346947076910e+01 1.0398184137676870e+02 - 9 1.3998364907524725e+00 -6.8051265117854554e+00 5.7998551416406108e-01 - 10 3.9959095770863861e+01 -6.7059878128982533e+01 -8.8447802741173149e+01 - 11 -1.0802302719547214e+00 1.1219894748520014e+00 -8.4425247682312676e-01 - 12 2.0545804827691136e+01 1.6756506830789714e+01 -1.0147384874511031e+01 - 13 -4.0343127344079334e-02 1.7788248238110288e-01 -2.9853580181601497e-01 - 14 -1.3513519617990646e+00 4.4595903368229645e-01 -2.6265873011204899e-01 - 15 3.1593459894485221e-01 -2.5515203222124527e-01 -1.0797884994456801e+00 - 16 5.1256243153570345e+01 -6.6172008494980304e+01 1.2070943482776888e+01 - 17 -1.7692905548242845e+01 1.6463320056800892e+01 3.6795635641783470e+01 - 18 -1.6194608137186223e-01 4.5570024276229395e+00 -7.3322988037745080e+00 - 19 2.3514081526928847e+00 -7.5579018716763013e-01 5.6642935667905210e+00 - 20 -2.8597532637247314e+00 -3.9142531545165622e+00 3.6472614532353766e+00 - 21 1.4156879407556928e+00 3.1994561324730202e+00 -6.4435674871132829e+00 - 22 4.7559002343678038e+00 1.1887791928852809e+00 5.7934241510246531e+00 - 23 -6.5791517502195074e+00 -3.9974743969842192e+00 1.1725342766635378e+00 - 24 -1.2476217508740006e+00 7.0412610416940824e+00 -3.7704986629353101e+00 - 25 5.3901862848724358e+00 -3.4508437673520470e-01 4.2395892090383196e+00 - 26 -4.6303631204497515e+00 -6.8134266068057583e+00 -1.0346794667667554e+00 - 27 -1.8378773181966237e+00 7.4880773688139994e+00 -2.6847264500779100e+00 - 28 6.6966605937638537e+00 -2.2313693477542045e+00 4.2842101037182259e+00 - 29 -4.4013595210906642e+00 -5.2116279982892006e+00 -1.6564229412009841e+00 + 1 1.3484812458261860e+02 3.9092060820062204e+02 1.4373313060801320e+02 + 2 -2.0271724576855651e-01 -2.8298293703098856e+00 -1.1989296849899502e+00 + 3 -1.4342325154777177e+02 -3.7982436411207340e+02 -1.3597762535988574e+02 + 4 -8.2852557682848257e-02 1.8300839390360278e-02 -2.3762369428769628e-01 + 5 -5.4791649880925641e-01 6.5614654605114098e-01 -6.3941225083442493e-02 + 6 -8.0227486029844295e+02 9.1496525081224513e+02 1.0264249542556211e+03 + 7 5.5771542848956415e+01 -3.1037336689174958e+02 -1.5711704598565091e+03 + 8 2.0819248478157255e+02 -1.2101254490726097e+01 7.2875383135620928e+02 + 9 1.5634176673215814e+00 -5.8771950641448552e+00 1.3776873851257587e+00 + 10 5.1715702538594792e+02 -6.0329366982206068e+02 -1.9113876861782543e+02 + 11 -9.4002654695071730e-01 1.0582116371164560e+00 -5.6167245691260903e-01 + 12 2.4863939179301873e+01 1.6062869914496368e+01 -1.2360610732981309e+01 + 13 -7.5840544665736601e-02 4.0077591041474431e-02 -1.8559566471956526e-01 + 14 -1.0625300502142863e+00 3.6955525891769109e-01 -1.0916740089147572e-01 + 15 3.5311725764920687e-01 -1.9448901674478142e-01 -1.0191642654204769e+00 + 16 4.3394626824029342e+02 -3.1219927078137397e+02 -1.1116473869769277e+03 + 17 -4.2707030268825002e+02 3.0243865799001213e+02 1.1237993834127983e+03 + 18 3.0368465020738139e-01 4.7171897372959002e+00 -7.8295045686211466e+00 + 19 2.0270781964195828e+00 -6.9918483689546762e-01 5.5492243019674161e+00 + 20 -2.8995854438015924e+00 -3.9821831016261777e+00 4.0840171235891711e+00 + 21 1.5208453376608937e+00 3.1993263794278342e+00 -6.7421852743795583e+00 + 22 4.4874850856125059e+00 1.0719228880003817e+00 5.8233424639110876e+00 + 23 -6.3183668431688345e+00 -3.9593725025428608e+00 1.3084682986869964e+00 + 24 -1.1079754400394768e+00 6.8112751692045608e+00 -3.6957337924694280e+00 + 25 5.0093745613578013e+00 -5.0836446005267866e-01 3.9583974028948030e+00 + 26 -4.3931323238960998e+00 -6.5025646047626475e+00 -8.3304266442572217e-01 + 27 -1.5441431926255507e+00 7.3753659770534217e+00 -2.7159698342211347e+00 + 28 6.4199783043718526e+00 -2.1795401460420964e+00 4.1762072379294972e+00 + 29 -4.5208648572036436e+00 -5.1801097397697831e+00 -1.5012617761955092e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-mie_cut.yaml b/unittest/force-styles/tests/mol-pair-mie_cut.yaml index c766f0041..286d201e3 100644 --- a/unittest/force-styles/tests/mol-pair-mie_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-mie_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Fri Jul 31 12:10:52 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -57,38 +57,38 @@ init_forces: ! |2 27 2.0888442237096100e+01 -9.4688431023944986e+01 3.7478527939720465e+01 28 -7.4711699859811475e+01 3.2108421478054176e+01 -5.0551006653560087e+01 29 5.3833799408056237e+01 6.2589370938775232e+01 1.3066022522941514e+01 -run_vdwl: 131.819620520303 +run_vdwl: 554.397373452421 run_coul: 0 run_stress: ! |2- - 5.2376360693642835e+02 5.7808495843346577e+02 4.5321969785624492e+02 -2.2533910749543824e+02 2.5446238074471928e+01 9.3000624407488445e+01 + 1.4870680633544989e+03 1.5866563229080662e+03 3.4640437814661673e+03 -6.3299620387308835e+02 -6.5104809831557432e+01 5.0161494781835211e+02 run_forces: ! |2 - 1 1.5269882261159061e+01 8.5457734305401502e+01 6.0203135045526906e+01 - 2 1.7309256021708190e+01 1.3327906939297119e+01 -2.0973172027242693e+01 - 3 -1.1348668391073240e+02 -1.6907934425683319e+01 8.8304974127351166e+00 - 4 -7.2611685656686955e+00 2.5440247467996895e+00 -5.2310253850736599e+00 - 5 -1.6331788851006233e+00 -2.4563580828052327e+00 9.1291658252154164e+00 - 6 -3.6304751097556647e+01 3.5989039476331882e+01 -6.1606249993575794e+01 - 7 4.4576729445436856e+00 -1.3824126675019009e+01 -5.7320638969633400e+01 - 8 -1.2611247591832864e+01 1.9534487230325507e+01 7.5227958247422706e+01 - 9 9.2896774614026967e+00 1.0731713246245308e+01 4.1288720638654937e+01 - 10 9.4327776819515861e+01 -1.0894475298691272e+02 -5.8475394508772112e+01 - 11 -4.5695652120382260e+00 -6.5415420663552508e+00 -1.2704215257635372e+01 - 12 1.0795905949967926e+01 7.6703950291745073e+00 -5.7682240949128900e+00 - 13 6.4628140331599777e+00 -2.4523641841992529e+00 -9.5484896445262660e-02 - 14 -2.4700568763322290e+00 3.9611003778965026e-01 -6.3058734689697280e+00 - 15 -3.3806295897988964e-01 7.1471351946850925e+00 2.6960805597741961e+00 - 16 4.0160220118648304e+01 -4.5015800901539421e+01 -2.2343490283291196e+01 - 17 -1.9362591683165103e+01 1.3367106544264416e+01 5.3433992362426636e+01 - 18 -1.8269471792509578e-02 -3.2492174873532322e-02 3.0338390664931467e-02 - 19 3.2503350050501191e-04 -2.8639278101074735e-04 1.8513053603820379e-03 - 20 -9.6205495509295920e-04 -1.0114694627461503e-03 4.4443061856092806e-04 - 21 -1.2403203032317574e+01 -1.3904861539263642e+01 4.2624743908416868e+01 - 22 -2.0606176232885055e+01 -5.1765533341392338e+00 -3.2178356967253826e+01 - 23 3.2995214962355504e+01 1.9097540785043826e+01 -1.0431241015469915e+01 - 24 1.2353976144502097e+01 -4.1826884116759601e+01 2.5796189871409752e+01 - 25 -3.3536020084019192e+01 5.3434177835053038e+00 -2.8542923861815211e+01 - 26 2.1168768190727246e+01 3.6468979949788483e+01 2.7194251563161034e+00 - 27 6.7596879628888722e+00 -4.2934067896212120e+01 1.4454254639022803e+01 - 28 -3.0946671037079934e+01 1.3715958306415276e+01 -2.0695277777595567e+01 - 29 2.4197430790376114e+01 2.9227486670938596e+01 6.2347707141212778e+00 + 1 -5.4061199004025212e+01 1.8129670868853398e+02 3.0210306844559409e+02 + 2 1.5973239485029316e+02 1.3155902771877368e+02 -1.8749172109738140e+02 + 3 -1.0456393163997480e+02 -3.0273001627940300e+02 -1.1486829470470664e+02 + 4 -6.8827329197155906e+00 1.8571499845313781e+00 -4.9057251530066708e+00 + 5 -2.2121462783987482e+00 -3.5851167133602386e+00 1.0603744059511396e+01 + 6 -6.3234802907071150e+02 7.2271107715732205e+02 8.0714882564097979e+02 + 7 4.1513795915696114e+01 -2.4278786542296422e+02 -1.2399307207699733e+03 + 8 8.4938823539894955e+01 -9.8785079687441510e+01 2.2184223380691790e+02 + 9 7.9859005201632385e+01 8.5793226334896829e+01 3.5315604492958715e+02 + 10 4.1258854249248560e+02 -4.7060666729759089e+02 -1.4140001251947066e+02 + 11 -2.0533296174172486e+00 -5.1271607698595885e+00 -8.3919966746653412e+00 + 12 1.2326917269974862e+01 6.4024316237576109e+00 -5.0536198780255166e+00 + 13 7.0797462176615564e+00 -2.7927545014097785e+00 -1.2834080147879287e-01 + 14 -2.9360321564990559e+00 5.8395159589434320e-01 -7.5832698841216093e+00 + 15 -1.9354237875785993e-01 7.4727070564778888e+00 2.6677948016730761e+00 + 16 3.4115511199346531e+02 -2.4397630453805252e+02 -8.7696227605451929e+02 + 17 -3.3390850984375930e+02 2.3273959973150392e+02 8.8917925298328271e+02 + 18 -1.8942355741861452e-02 -3.3972265797066456e-02 3.1524767520303830e-02 + 19 3.7924327072389944e-04 -2.8111336837416298e-04 1.9075305444196703e-03 + 20 -1.0709978068558514e-03 -1.1145013292765600e-03 4.6168821790303294e-04 + 21 -2.9639170010601383e+01 -3.3661321147291389e+01 9.3997170721687226e+01 + 22 -4.5171933265574033e+01 -1.1024470954326327e+01 -7.0642652852574358e+01 + 23 7.4797908095022223e+01 4.4701017742758943e+01 -2.3340535410484033e+01 + 24 1.6467280961303903e+01 -8.8826793302143372e+01 4.7819201028404621e+01 + 25 -6.3362049294267955e+01 1.0070222983003081e+01 -5.3291065921864472e+01 + 26 4.6882172231240233e+01 7.8742436783769293e+01 5.4454536424440496e+00 + 27 2.0993917715476478e+01 -9.4414232129112776e+01 3.7224306922481865e+01 + 28 -7.4578825198088978e+01 3.2022373639799575e+01 -5.0363635505100518e+01 + 29 5.3595448303922865e+01 6.2401219582427984e+01 1.3132876258526228e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-morse.yaml b/unittest/force-styles/tests/mol-pair-morse.yaml index 60e5f8736..cf75cd6db 100644 --- a/unittest/force-styles/tests/mol-pair-morse.yaml +++ b/unittest/force-styles/tests/mol-pair-morse.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 06:16:31 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -9,22 +9,17 @@ pre_commands: ! "" post_commands: ! "" input_file: in.fourmol pair_style: morse 8.0 -pair_coeff: ! | - 1 1 0.0202798941614106 2.78203488021395 2.725417159299 - 1 2 0.0101167811264648 3.9793050302425 1.90749569018897 - 1 3 0.0202934330695928 2.43948720203264 3.10711749999622 - 1 4 0.0175731334238374 2.48316585521317 3.05258880102438 - 1 5 0.0175731334238374 2.48316585521317 3.05258880102438 - 2 2 0.00503064360487288 6.98433077606902 1.08960295117864 - 2 3 0.0101296013842819 3.31380153807866 2.28919067558352 - 2 4 0.00497405122588691 14.0508902925745 0.544416409093563 - 2 5 0.00877114211614446 3.39491256196178 2.23466262511073 - 3 3 0.0203039874239943 2.17204344301477 3.48881895084762 - 3 4 0.0175825321440736 2.20660439192238 3.43428999287994 - 3 5 0.0175825321440736 2.20660439192238 3.43428999287994 - 4 4 0.0152259201379927 2.24227873774009 3.37976131582396 - 4 5 0.0152259201379927 2.24227873774009 3.37976131582396 - 5 5 0.0152259201379927 2.24227873774009 3.37976131582396 +pair_coeff: ! "1 1 0.0202798941614106 2.78203488021395 2.725417159299 \n1 2 0.0101167811264648 + 3.9793050302425 1.90749569018897 \n1 3 0.0202934330695928 2.43948720203264 3.10711749999622 + \n1 4 0.0175731334238374 2.48316585521317 3.05258880102438 \n1 5 0.0175731334238374 + 2.48316585521317 3.05258880102438 \n2 2 0.00503064360487288 6.98433077606902 1.08960295117864 + \n2 3 0.0101296013842819 3.31380153807866 2.28919067558352 \n2 4 0.00497405122588691 + 14.0508902925745 0.544416409093563 \n2 5 0.00877114211614446 3.39491256196178 2.23466262511073 + \n3 3 0.0203039874239943 2.17204344301477 3.48881895084762 \n3 4 0.0175825321440736 + 2.20660439192238 3.43428999287994 \n3 5 0.0175825321440736 2.20660439192238 3.43428999287994 + \n4 4 0.0152259201379927 2.24227873774009 3.37976131582396 \n4 5 0.0152259201379927 + 2.24227873774009 3.37976131582396 \n5 5 0.0152259201379927 2.24227873774009 3.37976131582396 + \n" extract: ! | d0 2 r0 2 @@ -64,38 +59,38 @@ init_forces: ! |2 27 4.7651790357913413e+00 -2.6604506061914726e+01 9.9133183430581937e+00 28 -2.0185283324331216e+01 8.6749457172768381e+00 -1.3657622292205492e+01 29 1.5422773526309053e+01 1.7931256324764902e+01 3.7433644842857023e+00 -run_vdwl: 98.4173659727247 +run_vdwl: 110.4949161861 run_coul: 0 run_stress: ! |2- - 1.9601409825764244e+02 1.9700352340793867e+02 2.9154284456666102e+02 -3.7890862068884516e+01 2.2194711647529434e+01 2.9595945401409004e+01 + 2.0994784428585552e+02 2.1021437576600792e+02 3.3123757135001267e+02 -3.7734658940331229e+01 2.3722482472838379e+01 3.1022635675675680e+01 run_forces: ! |2 - 1 -1.2307232908171140e+00 2.6447499604123792e+01 3.0470800988824852e+01 - 2 1.4299083252799704e+01 1.1826264809267556e+01 -1.6429998371091589e+01 - 3 -1.4157388308806942e+01 -3.1600857564116438e+01 -1.2693607798578579e+01 - 4 -3.3658701232884636e+00 8.8274427095692809e-01 -2.4548191697219108e+00 - 5 -1.0445920667596209e+00 -1.7759542284198366e+00 4.8041006695477559e+00 - 6 -4.3663248915575750e+01 4.6750257813837699e+01 3.2568898523181730e+01 - 7 -1.1941585252067125e-01 -1.2508304303814786e+01 -7.4567460991176873e+01 - 8 -2.8365089471509214e-01 -2.4283979863317655e+00 2.4825226034160149e+01 - 9 6.4234184494220852e+00 6.6360503305956495e+00 2.7951975466134691e+01 - 10 3.0610662535207027e+01 -4.1069618937762037e+01 -1.2566492808646194e+01 - 11 -9.5038761635530500e-01 -2.2898897318967251e+00 -3.7835192659808552e+00 - 12 7.2054240205507911e+00 3.1352365394706498e+00 -3.4732363827171837e+00 - 13 3.5724625921834581e+00 -1.3512903536346499e+00 -5.3544979287141810e-02 - 14 -1.3844723448954175e+00 2.2392513620749629e-01 -3.5288110787305649e+00 - 15 -1.6704585547662304e-01 3.8585136572758363e+00 1.4472031468930326e+00 - 16 2.5395500733365513e+01 -2.1203013326039397e+01 -5.1476844050837393e+01 - 17 -2.1109003525403882e+01 1.4497432185225815e+01 5.8945083044906688e+01 - 18 -2.0411066352797054e-02 -3.1623199720373009e-02 2.7105749669223678e-02 - 19 1.8505526918757687e-04 1.5148739166929051e-04 1.4466635015436468e-04 - 20 -2.1725954571798952e-04 -1.8964940343340269e-04 -3.4850035544525785e-05 - 21 -7.1560637225634522e+00 -7.8117345647459393e+00 2.3472478984082034e+01 - 22 -1.1620561400949969e+01 -2.9918170109617419e+00 -1.7768473766611599e+01 - 23 1.8773358841033328e+01 1.0807449311421589e+01 -5.7001611255271971e+00 - 24 5.8670747051779903e+00 -2.2854071160991367e+01 1.3389356812028607e+01 - 25 -1.7841968973681702e+01 2.5813804372924047e+00 -1.5089203976763809e+01 - 26 1.1965180488998783e+01 2.0268154591354669e+01 1.6847641157829507e+00 - 27 4.4982247159202604e+00 -2.3705153120939599e+01 8.3847072928631317e+00 - 28 -1.7971511804048767e+01 7.7287341482634551e+00 -1.1947618540558626e+01 - 29 1.3475957631829143e+01 1.5978120816092874e+01 3.5619816618400466e+00 + 1 -2.9949017644684575e+00 2.7890771224635174e+01 3.5293938136664877e+01 + 2 1.7158688826048412e+01 1.4142621040632889e+01 -2.0127688379634918e+01 + 3 -1.4241795107312500e+01 -3.5953756504442524e+01 -1.4432038361312786e+01 + 4 -3.5399187105772074e+00 9.1442215062895182e-01 -2.5289646197198121e+00 + 5 -1.1270464055366556e+00 -1.9137960141693937e+00 5.0708742928807489e+00 + 6 -4.8897916549024529e+01 5.2786691723033719e+01 4.4006443103914378e+01 + 7 -6.5388756406709769e-01 -1.4335460960644983e+01 -9.0587643230115702e+01 + 8 9.0933757058782227e-01 -4.2458191038511464e+00 2.5351078976724200e+01 + 9 7.4635563343943865e+00 8.0135407700724564e+00 3.3008830083102289e+01 + 10 3.3237259137762393e+01 -4.4167898555830625e+01 -1.2586861365338137e+01 + 11 -9.7631219986326634e-01 -2.5035581780285936e+00 -4.0723007500665842e+00 + 12 7.4120289525395924e+00 3.1816492976234616e+00 -3.1421609207993830e+00 + 13 3.7404015831565980e+00 -1.4769618241143294e+00 -6.6399627802732897e-02 + 14 -1.5253062768370498e+00 3.0086770481785063e-01 -3.9207523822780224e+00 + 15 -9.3578413684673442e-02 3.9066679443797896e+00 1.3911472549235808e+00 + 16 2.9069532644644443e+01 -2.3346523003884744e+01 -6.1762724187622787e+01 + 17 -2.4909601215265024e+01 1.6837320952626239e+01 6.9089962309526371e+01 + 18 -2.0470938715755362e-02 -3.1697065344220808e-02 2.7212163257336146e-02 + 19 2.3769880435706004e-04 1.9470350146815464e-04 1.5538300065802600e-04 + 20 -2.7373478426002653e-04 -2.3641470477911943e-04 -4.7279594689656269e-05 + 21 -7.9023993697657549e+00 -9.2872157186011268e+00 2.6717873280510201e+01 + 22 -1.2930841791065506e+01 -3.1568634976868610e+00 -2.0217222860067601e+01 + 23 2.0830079726403813e+01 1.2447856580023767e+01 -6.4969351046655150e+00 + 24 5.2735047568299764e+00 -2.4662311420900391e+01 1.3820347884273886e+01 + 25 -1.8242339680719812e+01 2.8958785393126072e+00 -1.5342197195392686e+01 + 26 1.2959293627242783e+01 2.1761919864735567e+01 1.5070124593757419e+00 + 27 4.8304165549645841e+00 -2.6669072622590612e+01 9.9001441373968397e+00 + 28 -2.0267106973368605e+01 8.6989143653622385e+00 -1.3685582988629843e+01 + 29 1.5439359281676991e+01 1.7971854023408181e+01 3.7844997874901063e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml b/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml index ed6f0501f..e933b47a0 100644 --- a/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml +++ b/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Tue Aug 11 09:15:04 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -59,38 +59,38 @@ init_forces: ! |2 27 4.7651727706625060e+00 -2.6604514922840195e+01 9.9133238206128400e+00 28 -2.0185283324769507e+01 8.6749457166585184e+00 -1.3657622291951469e+01 29 1.5422773525965512e+01 1.7931256323978314e+01 3.7433644846642018e+00 -run_vdwl: 98.417588075604 +run_vdwl: 110.495138818121 run_coul: 0 run_stress: ! |2- - 1.9601417183585471e+02 1.9700368853406772e+02 2.9154296827992243e+02 -3.7890872102168025e+01 2.2194690018415880e+01 2.9595931426759432e+01 + 2.0994791829876567e+02 2.1021454119496974e+02 3.3123769551317008e+02 -3.7734669012057381e+01 2.3722460842313350e+01 3.1022622056857038e+01 run_forces: ! |2 - 1 -1.2307305201683669e+00 2.6447509305163727e+01 3.0470800924098523e+01 - 2 1.4299083308853650e+01 1.1826264766972807e+01 -1.6429998389881643e+01 - 3 -1.4157389063933350e+01 -3.1600856808471050e+01 -1.2693607969343061e+01 - 4 -3.3658701307181786e+00 8.8274427277102663e-01 -2.4548191756434177e+00 - 5 -1.0445920630425243e+00 -1.7759542240829833e+00 4.8041006652309290e+00 - 6 -4.3663249501195480e+01 4.6750257951934081e+01 3.2568897712249886e+01 - 7 -1.1941996581070721e-01 -1.2508303885030813e+01 -7.4567467003068529e+01 - 8 -2.8365183621696771e-01 -2.4283998406502945e+00 2.4825225007617721e+01 - 9 6.4234184377526304e+00 6.6360503245786022e+00 2.7951975394615243e+01 - 10 3.0610663078987621e+01 -4.1069619835647295e+01 -1.2566492949739969e+01 - 11 -9.5038761789038062e-01 -2.2898897341045954e+00 -3.7835192708263246e+00 - 12 7.2054253435572519e+00 3.1352360891284623e+00 -3.4732368787593755e+00 - 13 3.5724626043568888e+00 -1.3512903581673283e+00 -5.3544979313710710e-02 - 14 -1.3844723456086208e+00 2.2392513651771506e-01 -3.5288110784726916e+00 - 15 -1.6704585605001740e-01 3.8585136513780287e+00 1.4472031447069291e+00 - 16 2.5395501554353512e+01 -2.1203014586738636e+01 -5.1476843446578606e+01 - 17 -2.1108999005587926e+01 1.4497424828459637e+01 5.8945089304411582e+01 - 18 -2.0407885139876018e-02 -3.1613478806902184e-02 2.7095801901916405e-02 - 19 1.8505535479816727e-04 1.5148781843684435e-04 1.4466565142221593e-04 - 20 -2.1725919415478855e-04 -1.8964914225522977e-04 -3.4850592786958239e-05 - 21 -7.1560574272745390e+00 -7.8117417587142493e+00 2.3472474332002371e+01 - 22 -1.1620561455492469e+01 -2.9918169870657452e+00 -1.7768473787797753e+01 - 23 1.8773358904345674e+01 1.0807449396958578e+01 -5.7001611321217229e+00 - 24 5.8670774694819343e+00 -2.2854064241583384e+01 1.3389367814003592e+01 - 25 -1.7841968739230779e+01 2.5813803672129412e+00 -1.5089203819513493e+01 - 26 1.1965180636297607e+01 2.0268154831625505e+01 1.6847640847945964e+00 - 27 4.4982185784244653e+00 -2.3705161804550581e+01 8.3847128455906059e+00 - 28 -1.7971511747703875e+01 7.7287341777176994e+00 -1.1947618548178538e+01 - 29 1.3475957448492176e+01 1.5978120604518875e+01 3.5619815829562675e+00 + 1 -2.9949087976819229e+00 2.7890781130771526e+01 3.5293938159832514e+01 + 2 1.7158688826588087e+01 1.4142621040511322e+01 -2.0127688380089431e+01 + 3 -1.4241796025389565e+01 -3.5953756000129594e+01 -1.4432038652954839e+01 + 4 -3.5399187109943040e+00 9.1442215082775247e-01 -2.5289646201022111e+00 + 5 -1.1270464057739491e+00 -1.9137960140172265e+00 5.0708742927823947e+00 + 6 -4.8897917242451186e+01 5.2786691962858590e+01 4.4006442598308624e+01 + 7 -6.5389164522256060e-01 -1.4335460607133173e+01 -9.0587649604798543e+01 + 8 9.0933668903138698e-01 -4.2458209668557325e+00 2.5351077968927864e+01 + 9 7.4635563344507521e+00 8.0135407697692642e+00 3.3008830082259657e+01 + 10 3.3237259659677832e+01 -4.4167899475774021e+01 -1.2586861531745368e+01 + 11 -9.7631219971795646e-01 -2.5035581784400525e+00 -4.0723007504906770e+00 + 12 7.4120303015522531e+00 3.1816488451789557e+00 -3.1421614261346109e+00 + 13 3.7404015839411642e+00 -1.4769618243099540e+00 -6.6399628099666555e-02 + 14 -1.5253062764527310e+00 3.0086770473712071e-01 -3.9207523828828470e+00 + 15 -9.3578413099124499e-02 3.9066679444066881e+00 1.3911472545816475e+00 + 16 2.9069533572907829e+01 -2.3346524378694934e+01 -6.1762723697255623e+01 + 17 -2.4909596781921106e+01 1.6837313668891120e+01 6.9089968672568290e+01 + 18 -2.0467748444343341e-02 -3.1687330984241723e-02 2.7202219169591400e-02 + 19 2.3769889051058541e-04 1.9470393063382961e-04 1.5538230192573859e-04 + 20 -2.7373443481373735e-04 -2.3641444522853002e-04 -4.7280153782468369e-05 + 21 -7.9023930607676673e+00 -9.2872228004672888e+00 2.6717868594779091e+01 + 22 -1.2930841791489545e+01 -3.1568634976586356e+00 -2.0217222860587789e+01 + 23 2.0830079727387908e+01 1.2447856580801901e+01 -6.4969351049462327e+00 + 24 5.2735078914496984e+00 -2.4662304324639546e+01 1.3820359014440585e+01 + 25 -1.8242339678097228e+01 2.8958785389703747e+00 -1.5342197193178686e+01 + 26 1.2959293629204160e+01 2.1761919867795044e+01 1.5070124595519931e+00 + 27 4.8304102908366637e+00 -2.6669081481164319e+01 9.9001496153843362e+00 + 28 -2.0267106973145214e+01 8.6989143650880294e+00 -1.3685582988456929e+01 + 29 1.5439359279164998e+01 1.7971854020175634e+01 3.7844997869886874e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-morse_soft.yaml b/unittest/force-styles/tests/mol-pair-morse_soft.yaml index 2eac54623..d57e3a155 100644 --- a/unittest/force-styles/tests/mol-pair-morse_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-morse_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 17:10:43 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -40,7 +40,7 @@ init_forces: ! |2 2 1.7072811991139108e+01 1.4045271856538758e+01 -2.0095944568992625e+01 3 -1.4025085996867746e+01 -3.5538505512353709e+01 -1.4266146234771622e+01 4 -3.5376204321278601e+00 9.1664299228139023e-01 -2.5211044377337370e+00 - 5 -1.1241238069956936e+00 -1.9082029209833646e+00 5.0529865621374874e+00 + 5 -1.1241238069956936e+00 -1.9082029209833649e+00 5.0529865621374874e+00 6 -4.8218002152189477e+01 5.1606236050098254e+01 4.1142630587317633e+01 7 -7.7221049787055362e-01 -1.3638968099119190e+01 -8.7287023318719548e+01 8 9.7922852984742914e-01 -4.3872500720308913e+00 2.4854499288733074e+01 @@ -65,38 +65,38 @@ init_forces: ! |2 27 4.6456501792718932e+00 -2.6023140263358044e+01 9.6880319377243431e+00 28 -1.9732921668033161e+01 8.4805413222287829e+00 -1.3351550006152580e+01 29 1.5089940726667313e+01 1.7544294921333940e+01 3.6625786035313128e+00 -run_vdwl: 97.3341961541961 +run_vdwl: 108.803617927324 run_coul: 0 run_stress: ! |2- - 1.9319979778883916e+02 1.9434741743350793e+02 2.8510713154844848e+02 -3.7239727436617017e+01 2.2388547684685680e+01 2.8444127184772217e+01 + 2.0644682696505629e+02 2.0700759596517148e+02 3.2180109348277563e+02 -3.7100564027840441e+01 2.4043065132969296e+01 2.9430825945498110e+01 run_forces: ! |2 - 1 -1.2861689236158784e+00 2.6124775571833457e+01 3.0238621702044544e+01 - 2 1.4224150243987660e+01 1.1766201131718656e+01 -1.6341829843443257e+01 - 3 -1.3984995579871924e+01 -3.1285028739057193e+01 -1.2575280302967942e+01 - 4 -3.3473594528059039e+00 8.7703152903671666e-01 -2.4414113598418896e+00 - 5 -1.0397415103295957e+00 -1.7686521538234090e+00 4.7774139976666676e+00 - 6 -4.2965959632773547e+01 4.5788501008332908e+01 3.0780964589104197e+01 - 7 -2.2405319643293076e-01 -1.2029536192419945e+01 -7.2313478446117216e+01 - 8 -4.0905921418197766e-01 -2.3740611048794991e+00 2.4396591699082343e+01 - 9 6.3828517076449023e+00 6.5929945550547782e+00 2.7775326860615209e+01 - 10 3.0208911016544072e+01 -4.0556055803458612e+01 -1.2389739450444475e+01 - 11 -9.4367369401912182e-01 -2.2762320136153318e+00 -3.7598184234474146e+00 - 12 7.1589233203138241e+00 3.0988532310292505e+00 -3.4462702027649317e+00 - 13 3.5539607180805932e+00 -1.3442600631983403e+00 -5.3277726703797677e-02 - 14 -1.3774167613538149e+00 2.2280711633443001e-01 -3.5107835729532928e+00 - 15 -1.6599974080859461e-01 3.8380488820831258e+00 1.4394284632993852e+00 - 16 2.4655339294769281e+01 -2.0644459521071692e+01 -4.9673945184824333e+01 - 17 -2.0408955961303882e+01 1.3999678648125169e+01 5.7082432128988373e+01 - 18 -2.0415519764652862e-02 -3.1629865924393243e-02 2.7112886381819818e-02 - 19 1.8503878045281037e-04 1.5145652856423606e-04 1.4470529045297712e-04 - 20 -2.1726034031919374e-04 -1.8965028143025351e-04 -3.4849273244762223e-05 - 21 -7.0280784818649487e+00 -7.6737317981520885e+00 2.3064455189377767e+01 - 22 -1.1422385338560913e+01 -2.9414907058328290e+00 -1.7461807267673567e+01 - 23 1.8447200134551053e+01 1.0619117977690159e+01 -5.5988073260761881e+00 - 24 5.7575692689381226e+00 -2.2441828398210717e+01 1.3144700900274648e+01 - 25 -1.7520089936062256e+01 2.5322614167293449e+00 -1.4816077823942399e+01 - 26 1.1752809396468171e+01 1.9905032096165826e+01 1.6562984436553274e+00 - 27 4.4145736295533631e+00 -2.3292454132649759e+01 8.2354615899678194e+00 - 28 -1.7657926613336663e+01 7.5915269420119964e+00 -1.1738450553275785e+01 - 29 1.3246023047795436e+01 1.5702628579900875e+01 3.5020591780011472e+00 + 1 -3.0418938864425789e+00 2.7497875362047161e+01 3.4974708930778164e+01 + 2 1.7039869247865973e+01 1.4044681110521092e+01 -1.9988295833223752e+01 + 3 -1.4068051020584504e+01 -3.5501248010932251e+01 -1.4258653342252227e+01 + 4 -3.5205088222816121e+00 9.0902992992199472e-01 -2.5151544035275708e+00 + 5 -1.1210925596575030e+00 -1.9045204650082403e+00 5.0409562139309374e+00 + 6 -4.8038960398950742e+01 5.1467310602564559e+01 4.0859119307939793e+01 + 7 -7.6693296527418353e-01 -1.3611312359414333e+01 -8.6828021140416737e+01 + 8 7.7761228962152851e-01 -4.2022858348693175e+00 2.4806785246525685e+01 + 9 7.4079245963640838e+00 7.9538807382443846e+00 3.2762921286800477e+01 + 10 3.2731168910831741e+01 -4.3532318588302651e+01 -1.2398206522689085e+01 + 11 -9.7047758709066512e-01 -2.4891064839127925e+00 -4.0485970123943371e+00 + 12 7.3618565875839170e+00 3.1455124556732428e+00 -3.1171863241850382e+00 + 13 3.7202859291722929e+00 -1.4690446071037684e+00 -6.6026331839073679e-02 + 14 -1.5169804392186463e+00 2.9920425336073847e-01 -3.8991652206284901e+00 + 15 -9.2991290088826437e-02 3.8854624227334407e+00 1.3835512422389811e+00 + 16 2.7963361756384661e+01 -2.2549687646622449e+01 -5.8948830764786997e+01 + 17 -2.3833648229382590e+01 1.6087347568977723e+01 6.6224834448818697e+01 + 18 -2.0472057230728469e-02 -3.1698776001860288e-02 2.7212994529145024e-02 + 19 2.3769866217786525e-04 1.9470320661417107e-04 1.5538340222098293e-04 + 20 -2.7373481812661618e-04 -2.3641473602392272e-04 -4.7279591946940947e-05 + 21 -7.7230695135015370e+00 -9.0810459049009697e+00 2.6136638933923734e+01 + 22 -1.2650768580189945e+01 -3.0884943385377168e+00 -1.9779298158110127e+01 + 23 2.0370676685015422e+01 1.2173317584848661e+01 -6.3536254946762831e+00 + 24 5.1671631719464033e+00 -2.4117478226326064e+01 1.3522773289220167e+01 + 25 -1.7848794065153790e+01 2.8333629551088286e+00 -1.5011235944210352e+01 + 26 1.2672089418195311e+01 2.1279602208028223e+01 1.4736255602555779e+00 + 27 4.7092400105154830e+00 -2.6086481690039683e+01 9.6750731382545556e+00 + 28 -1.9812943801792429e+01 8.5039584065382066e+00 -1.3378898059346936e+01 + 29 1.5106372649499408e+01 1.7584219044933242e+01 3.7028858552608477e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-nm_cut.yaml b/unittest/force-styles/tests/mol-pair-nm_cut.yaml index b206aab87..b05678514 100644 --- a/unittest/force-styles/tests/mol-pair-nm_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-nm_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 1.2882964877239125e+01 -5.6361972106685570e+01 2.2561805670401998e+01 28 -4.4799490702516259e+01 1.9253130813645878e+01 -3.0311947397740930e+01 29 3.1921004443145875e+01 3.7112558101945595e+01 7.7475966898074331e+00 -run_vdwl: 87.3805301522505 +run_vdwl: 182.369864828409 run_coul: 0 run_stress: ! |2- - 3.2220848997846764e+02 3.3970982498430038e+02 4.0549081602547108e+02 -1.0911586410655545e+02 3.1721734197563578e+01 5.9904472580667928e+01 + 5.3658199964385449e+02 5.4150593348929669e+02 1.1351000214934920e+03 -1.8648219712419237e+02 5.7793252452314690e+00 1.6371501081324359e+02 run_forces: ! |2 - 1 2.6909892703148977e+00 4.8467146468678010e+01 4.6436777787770538e+01 - 2 1.9140909330783455e+01 1.5556017767601208e+01 -2.2294815501056796e+01 - 3 -2.7728726663214978e+01 -5.7270691389297163e+01 -2.0394195609633350e+01 - 4 -5.8011549844082200e-01 1.6648262512610876e-01 -4.2336366435149325e-01 - 5 -1.7940449100115799e-01 -3.1155730279714389e-01 8.5069320888114552e-01 - 6 -1.0279767377150741e+02 1.0129545699137525e+02 2.3755271681023000e+01 - 7 5.9210274646992609e+00 -2.1219330699633812e+01 -9.3044466451442958e+01 - 8 6.0063554365050491e+00 -2.4343067888524783e+00 5.1948415111977027e+01 - 9 1.0296157246519867e+01 1.1136689876602833e+01 4.5421080165663469e+01 - 10 7.8914522223584413e+01 -9.3708686539009378e+01 -3.3793019770182894e+01 - 11 -2.1334920775551727e-01 -4.3406272072677082e-01 -7.5374799100455325e-01 - 12 4.7144371811227055e+00 3.7306767541893193e+00 -2.9238551688511478e+00 - 13 5.7965012982799591e-01 -2.2247544988006879e-01 -6.9144867837503962e-03 - 14 -2.3290607454827431e-01 3.5689720853724412e-02 -5.7463955199372629e-01 - 15 -3.9179374976013356e-02 6.4083141494904250e-01 2.4555152913937292e-01 - 16 3.4262986487221760e+01 -2.7157079887673600e+01 -7.6693091300069824e+01 - 17 -3.0731777593630067e+01 2.1749060797504754e+01 8.2233717747339597e+01 - 18 -1.3922196387781534e-02 -2.3448898920973363e-02 1.9494185574706925e-02 - 19 4.7350467313252411e-05 -2.8574399923812961e-04 9.8256484718186959e-04 - 20 -4.1672805476179774e-04 -4.6737847668254311e-04 2.2341858407757333e-04 - 21 -1.0244890466878260e+01 -1.1161890912597492e+01 3.3400934862718010e+01 - 22 -1.6307421863240453e+01 -4.1510601766304225e+00 -2.5182091146175654e+01 - 23 2.6546070943422158e+01 1.5320133943014929e+01 -8.2119515624220654e+00 - 24 9.5510915284075306e+00 -3.3711360947123012e+01 2.0468641909251474e+01 - 25 -2.6910802160058282e+01 4.0814024426984608e+00 -2.2827450375147130e+01 - 26 1.7351880245334943e+01 2.9623394119689706e+01 2.3443234100954937e+00 - 27 6.2823683362652609e+00 -3.3698901911436543e+01 1.1873623002496267e+01 - 28 -2.5247952800915591e+01 1.1008685262680311e+01 -1.6830364275817590e+01 - 29 1.8970045716132763e+01 2.2693938562091112e+01 4.9542362695715862e+00 + 1 -5.4778956190699208e+00 6.6843936636126571e+01 8.1925954632347313e+01 + 2 3.8942931067098776e+01 3.2095899838755557e+01 -4.5685291782235495e+01 + 3 -3.5257574788891993e+01 -9.6071976074729903e+01 -3.4951600335607260e+01 + 4 -5.7872310269190108e-01 1.5159653737290335e-01 -4.1446480665619639e-01 + 5 -1.9547321079378863e-01 -3.4419646696467382e-01 8.7346215605735678e-01 + 6 -2.0473427308535852e+02 2.3656093517189871e+02 2.7690794790084516e+02 + 7 1.4377143074966078e+01 -8.1831208393579288e+01 -4.1597619743648136e+02 + 8 3.4385725011721043e+01 -2.5703211342013805e+01 9.8539531088749399e+01 + 9 1.9492847734029986e+01 2.0908978437361238e+01 8.6167137387345775e+01 + 10 1.3162825859528147e+02 -1.5255375844986639e+02 -4.7320859069782465e+01 + 11 -1.6472584323996889e-01 -4.1603177894608384e-01 -6.8286846515929644e-01 + 12 4.9148985874513507e+00 3.5943204216303304e+00 -2.9063112642430200e+00 + 13 6.0130650812448860e-01 -2.4061247550396436e-01 -8.9307579387740369e-03 + 14 -2.5529672216026605e-01 4.8214740612278789e-02 -6.3383306564958009e-01 + 15 -2.6792395383306702e-02 6.3032728114599068e-01 2.2933015378876953e-01 + 16 1.1367534494555517e+02 -8.1304366113321720e+01 -2.9211232182092215e+02 + 17 -1.1130422887098715e+02 7.7651344536367816e+01 2.9603840553250421e+02 + 18 -1.3984545985384055e-02 -2.3577563173234579e-02 1.9803527970834227e-02 + 19 8.4549524236179606e-05 -2.6178474613463708e-04 9.8588488233312694e-04 + 20 -4.6672152887543977e-04 -5.1332111959438720e-04 2.2540199102641481e-04 + 21 -1.7917152584342652e+01 -2.0217277118466999e+01 5.6106108116745915e+01 + 22 -2.6931177341209175e+01 -6.5738667182021437e+00 -4.2110559748776460e+01 + 23 4.4842343883807359e+01 2.6798072899759976e+01 -1.3988970621037902e+01 + 24 9.5666605658100625e+00 -5.3272679301256396e+01 2.8440453247101271e+01 + 25 -3.7723979523724850e+01 5.9919743032297568e+00 -3.1726457580194225e+01 + 26 2.8149721534478338e+01 4.7274219670983307e+01 3.2718657124676223e+00 + 27 1.3029591157341287e+01 -5.6431331356612219e+01 2.2520076681536963e+01 + 28 -4.4933501271039816e+01 1.9289076763233361e+01 -3.0342741980678817e+01 + 29 3.1908388411217857e+01 3.7145971020024788e+01 7.8201213110292978e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-nm_cut_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-nm_cut_coul_cut.yaml index ab56b7792..0161426c6 100644 --- a/unittest/force-styles/tests/mol-pair-nm_cut_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-nm_cut_coul_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 5e-13 prerequisites: ! | atom full @@ -66,38 +66,38 @@ init_forces: ! |2 27 1.0035511306793698e+01 -4.5249946085110551e+01 1.8136503701331897e+01 28 -3.9953070294941519e+01 1.3962092508592026e+01 -2.6231057257176037e+01 29 3.0657392434855581e+01 3.0940622604427993e+01 8.6697893689665211e+00 -run_vdwl: 88.9175999419531 -run_coul: -138.787333288031 +run_vdwl: 182.405654760453 +run_coul: -135.342822931701 run_stress: ! |2- - 3.0151851275109726e+02 2.8788003764456943e+02 3.5781730323314935e+02 -1.1135409996112588e+02 2.7888145964470993e+01 6.3524744479689346e+01 + 5.0949331883645084e+02 4.9079274612266465e+02 1.0779924919705209e+03 -1.8978874005409725e+02 -2.3414288930535676e+00 1.6680086396779814e+02 run_forces: ! |2 - 1 4.9445212873106597e+00 4.8604615143812858e+01 4.7122128212972150e+01 - 2 1.9509100336298566e+01 1.3173861972463717e+01 -2.4435825230222051e+01 - 3 -2.7666690627572226e+01 -5.7174704804112359e+01 -2.0312202913351406e+01 - 4 -5.9165543023177547e-01 2.1130423212016050e-01 -7.5184772141344403e-01 - 5 -6.0582161037353077e-01 3.9965042494578573e-01 8.4001344709756087e-01 - 6 -1.0200835568981525e+02 9.8851903276497609e+01 2.2431072258563226e+01 - 7 5.8603879833891792e+00 -2.0934488863775119e+01 -9.1739711020933825e+01 - 8 6.0588124647054942e+00 3.8680189169215584e-01 5.4478682186983576e+01 - 9 1.2477759595545781e+01 4.7458417509794693e+00 4.7903544783340884e+01 - 10 7.7897050228512299e+01 -9.2618565907995446e+01 -3.3771026542016330e+01 - 11 -1.2629054611570685e+00 7.5028580843540960e-01 -1.3737807401582940e+00 - 12 8.0971113295008710e+00 2.9619739555102487e+00 -1.5156612407719772e+00 - 13 1.8419778641790938e-01 -2.0876409352990058e-01 -6.8918587781582497e-02 - 14 -1.6166592074637764e+00 4.9899997991549006e-01 -6.1017936467869205e-01 - 15 1.4134672864564285e-01 3.8682976827810273e-01 -7.8264810328605128e-01 - 16 3.3742288366815032e+01 -2.8839898654159462e+01 -7.6161801510332623e+01 - 17 -3.4040510122767664e+01 2.8871469436517536e+01 7.6530600798863290e+01 - 18 6.5408944378899125e-01 6.4997668701115323e+00 -9.0846882436637184e+00 - 19 2.0267694810591834e+00 -1.5719325080621274e+00 5.6577247326467335e+00 - 20 -3.3715760959410086e+00 -3.1317623048619483e+00 3.6465746194545696e+00 - 21 -8.7234762888499251e+00 -1.1111049866840020e+01 2.6611632047652662e+01 - 22 -1.6222512975167248e+01 -3.2059138553395936e+00 -2.1059186457983976e+01 - 23 2.4430942281728669e+01 1.3064470763019658e+01 -4.9657856238936882e+00 - 24 7.2136498689090596e+00 -2.7417616225778659e+01 1.9584994653769748e+01 - 25 -2.5309520522992685e+01 1.4170230804280064e+00 -2.0530781135740853e+01 - 26 1.7108327644087961e+01 2.5152426930937015e+01 2.0021671580140268e+00 - 27 4.5128227256949884e+00 -2.5732727186368709e+01 9.1700664328635781e+00 - 28 -2.2899233533808879e+01 7.5797252783122557e+00 -1.4962456949477756e+01 - 29 1.9459740013730769e+01 1.8390473706846340e+01 6.1473000534842477e+00 + 1 -3.0222512967714557e+00 6.7548505252631742e+01 8.2368596588550062e+01 + 2 3.9249247328631569e+01 2.9923489231546629e+01 -4.7570871930892892e+01 + 3 -3.5327226055520775e+01 -9.6102750283993871e+01 -3.4890589040756382e+01 + 4 -5.2696455605069259e-01 1.6213860296922811e-01 -7.2430457126338410e-01 + 5 -5.9400169113171586e-01 3.6136912208033589e-01 7.9530286564994024e-01 + 6 -2.0274433560773628e+02 2.3284786713406370e+02 2.7401951211582013e+02 + 7 1.4053553144930220e+01 -8.1102084254822103e+01 -4.1219124551744085e+02 + 8 3.2718675446198795e+01 -2.1551046804011083e+01 1.0097962112112319e+02 + 9 2.1323856224128093e+01 1.5222193966786529e+01 8.7834851199368813e+01 + 10 1.3130268818222987e+02 -1.5219622702094762e+02 -4.7515342312770102e+01 + 11 -1.1541261444752642e+00 7.1381752451384339e-01 -1.2230561924848902e+00 + 12 8.2264000446385346e+00 2.8299212831552727e+00 -1.6299507774035358e+00 + 13 2.1792987819368359e-01 -2.5267817510362128e-01 -1.9040070778804069e-02 + 14 -1.4863827602148627e+00 4.9691341825375590e-01 -6.4929126993868946e-01 + 15 1.9516446161304488e-01 4.6409461483290748e-01 -7.4066880359248788e-01 + 16 1.1245063534493042e+02 -8.2380964098503739e+01 -2.8939941367324343e+02 + 17 -1.1367888495468203e+02 8.3736413965239862e+01 2.8833591319216583e+02 + 18 1.2131213413750925e+00 6.6087858905244472e+00 -9.8443684782076062e+00 + 19 1.6546892701962139e+00 -1.6335518483372100e+00 5.6675264381026587e+00 + 20 -3.4406155231052553e+00 -3.1608955862760086e+00 4.2021081664244280e+00 + 21 -1.5380842837515630e+01 -1.8832663749099712e+01 4.5639191584555739e+01 + 22 -2.5437261250740086e+01 -5.4851555768258553e+00 -3.5409747254511750e+01 + 23 4.0368809860056317e+01 2.3008461599616822e+01 -9.7324663526701478e+00 + 24 7.1229399666679027e+00 -4.3444645139181588e+01 2.6085435505612736e+01 + 25 -3.4137823679541398e+01 2.8946896673905611e+00 -2.7774080649897098e+01 + 26 2.6093689208699011e+01 3.9671650206452789e+01 2.8124886686652082e+00 + 27 1.0189565500107717e+01 -4.5358416256293751e+01 1.8141445825723800e+01 + 28 -4.0123206182868742e+01 1.4015089779144132e+01 -2.6301107890805710e+01 + 29 3.0672957337757669e+01 3.0995677534193614e+01 8.7335515148952023e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-nm_cut_coul_long.yaml b/unittest/force-styles/tests/mol-pair-nm_cut_coul_long.yaml index 00bc31016..e8739a734 100644 --- a/unittest/force-styles/tests/mol-pair-nm_cut_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-nm_cut_coul_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:19 202 epsilon: 7.5e-13 prerequisites: ! | atom full @@ -72,38 +72,38 @@ init_forces: ! |2 27 1.0861995979992932e+01 -4.6328822142297405e+01 1.8883010243779164e+01 28 -4.0470174882584459e+01 1.5020795051869365e+01 -2.6766823901697389e+01 29 2.9999319404392626e+01 3.1302945187447804e+01 7.8628922608669090e+00 -run_vdwl: 88.7890427418616 -run_coul: 227.618554400417 +run_vdwl: 182.402559295073 +run_coul: 225.805231222371 run_stress: ! |2- - 3.0635598308393634e+02 2.9999995329835991e+02 3.7651679958332102e+02 -1.0183873776657552e+02 2.8406303805291618e+01 6.8731216510498299e+01 + 5.1384631551491782e+02 4.9870417055031982e+02 1.0966342093912015e+03 -1.8197324336578851e+02 -7.7105078556388151e-01 1.7333789878387816e+02 run_forces: ! |2 - 1 5.1280232738595588e+00 4.7497083333751377e+01 4.7207507633508961e+01 - 2 1.9339058688571782e+01 1.3183894955355052e+01 -2.4214413817124775e+01 - 3 -2.7636357984251024e+01 -5.7337574124714479e+01 -2.0403805085496774e+01 - 4 -7.2317785854410477e-01 2.3012123701053938e-01 -6.6823608613143703e-01 - 5 -7.5185963468190198e-01 3.7240533102585693e-01 8.4489581899975552e-01 - 6 -1.0262924881477738e+02 9.8816237387658376e+01 2.2855193724464026e+01 - 7 6.1333589842761382e+00 -2.0873161524587445e+01 -9.1814842253625784e+01 - 8 6.2570948076915096e+00 5.9968199248334608e-01 5.4229326873841451e+01 - 9 1.2262349493515732e+01 4.7122380894283964e+00 4.7760547137590017e+01 - 10 7.7930468518609217e+01 -9.2569654855083058e+01 -3.3800107011685476e+01 - 11 -1.1664506658804463e+00 6.4847483437734510e-01 -1.3877843843303697e+00 - 12 7.6322944950278178e+00 3.2220877270364383e+00 -1.3912715610612059e+00 - 13 4.9946998979692925e-01 -2.0404029362764034e-01 -2.3038049522475929e-01 - 14 -1.4338048782589126e+00 4.1530831676547275e-01 -6.7535160187062604e-01 - 15 2.7208381309904195e-01 3.6587486744073483e-01 -8.1685924248146502e-01 - 16 3.4214015839121672e+01 -2.8191470216648039e+01 -7.6737915466954263e+01 - 17 -3.4009785374980900e+01 2.8847636510026227e+01 7.7410681470074508e+01 - 18 -2.5869095557408950e-01 4.4686551047675911e+00 -7.2828189151954286e+00 - 19 2.4019142416935022e+00 -5.5367962380624247e-01 5.6339568740020347e+00 - 20 -2.8152373515552673e+00 -3.8648878320546749e+00 3.5989260194555599e+00 - 21 -9.4559928456115223e+00 -8.0099001470229094e+00 2.7906114629104394e+01 - 22 -1.5683872196782563e+01 -4.8962608979739901e+00 -2.1602316089641171e+01 - 23 2.4665467682660644e+01 1.3368880909004346e+01 -5.7175965801059361e+00 - 24 8.1932098112220579e+00 -2.7824981451273331e+01 1.6895024121350271e+01 - 25 -2.5722474282894748e+01 1.5860619601688897e+00 -2.1000349201418295e+01 - 26 1.6906584472297784e+01 2.5988679456562966e+01 3.4371702387023735e+00 - 27 5.0614248732351106e+00 -2.6848508064764058e+01 9.7078824781754722e+00 - 28 -2.3388993359146266e+01 7.9794289283979971e+00 -1.5074199889115411e+01 - 29 1.8779127218260577e+01 1.8871368090294894e+01 5.3310206621943710e+00 + 1 -2.7683190788522740e+00 6.6449095933852917e+01 8.2247798763054263e+01 + 2 3.8702194737017720e+01 2.9212212087553127e+01 -4.7019606503568262e+01 + 3 -3.5243454712977965e+01 -9.6154953753202179e+01 -3.4936504547233788e+01 + 4 -6.5977694961123645e-01 1.7011044348999105e-01 -6.5636000725760957e-01 + 5 -7.3566520752177100e-01 3.2004552783623724e-01 8.0428279587216267e-01 + 6 -2.0326269571945986e+02 2.3271299846462981e+02 2.7442711029956843e+02 + 7 1.4300022426556877e+01 -8.0959802783401827e+01 -4.1226588339681336e+02 + 8 3.2858865815794836e+01 -2.1199692716643838e+01 1.0091081448967174e+02 + 9 2.1122712553671928e+01 1.5084944366082448e+01 8.7605507483986727e+01 + 10 1.3136998924075732e+02 -1.5218480626807963e+02 -4.7552578947927799e+01 + 11 -1.0661815519248918e+00 6.1243966630893298e-01 -1.2462619432373649e+00 + 12 7.7760226803888877e+00 3.1127903917502313e+00 -1.4744683960464942e+00 + 13 5.2674567614856260e-01 -2.4917750370694214e-01 -1.8723948852408964e-01 + 14 -1.3120520030459297e+00 4.0614121490067551e-01 -7.2914653810616858e-01 + 15 3.2867638556545775e-01 4.2750422420803547e-01 -7.8475645386864112e-01 + 16 1.1296204426736116e+02 -8.1834725178344044e+01 -2.9024712497341085e+02 + 17 -1.1375160210673371e+02 8.3851461683740141e+01 2.8944627577285223e+02 + 18 3.0738271507674780e-01 4.7275452047652715e+00 -7.8225407640491564e+00 + 19 2.0274564843313856e+00 -6.9333851982762851e-01 5.5367198586609998e+00 + 20 -2.8992094355719793e+00 -3.9662518101373307e+00 4.0716447585419049e+00 + 21 -1.6026802334504676e+01 -1.5883942063853187e+01 4.7256123626066532e+01 + 22 -2.5118526633549543e+01 -7.1302229414472507e+00 -3.6226155173751806e+01 + 23 4.0731190500597606e+01 2.3426593800522156e+01 -1.0527512154067734e+01 + 24 7.9759015134187958e+00 -4.4140032709411031e+01 2.3421942671527756e+01 + 25 -3.4663427794559517e+01 3.0656502790867206e+00 -2.8305771158291158e+01 + 26 2.6127821098995337e+01 4.0822834309889892e+01 4.2748874027969199e+00 + 27 1.1011144648995060e+01 -4.6436392031462617e+01 1.8878782007839565e+01 + 28 -4.0634772085359785e+01 1.5071357955251854e+01 -2.6829753884337045e+01 + 29 3.0014314868995513e+01 3.1359612725649200e+01 7.9297744000519685e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-nm_cut_coul_table.yaml b/unittest/force-styles/tests/mol-pair-nm_cut_coul_table.yaml index 31d54fd00..128309d34 100644 --- a/unittest/force-styles/tests/mol-pair-nm_cut_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-nm_cut_coul_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-12 prerequisites: ! | atom full @@ -72,38 +72,38 @@ init_forces: ! |2 27 1.0861995864629581e+01 -4.6328821976580151e+01 1.8883010049856995e+01 28 -4.0470177594126923e+01 1.5020794116966732e+01 -2.6766825117758021e+01 29 2.9999322027766638e+01 3.1302945696716428e+01 7.8628937666919105e+00 -run_vdwl: 88.7890422789723 -run_coul: 227.618586939201 +run_vdwl: 182.402559286578 +run_coul: 225.805266218016 run_stress: ! |2- - 3.0635600098872106e+02 2.9999995289189127e+02 3.7651680833706763e+02 -1.0183873211601917e+02 2.8406309590055290e+01 6.8731222756055018e+01 + 5.1384633450263470e+02 4.9870417152157029e+02 1.0966342229480442e+03 -1.8197323856665997e+02 -7.7104387031605370e-01 1.7333790492919763e+02 run_forces: ! |2 - 1 5.1280215043131987e+00 4.7497083318141257e+01 4.7207506076282677e+01 - 2 1.9339058453227608e+01 1.3183894289572546e+01 -2.4214412700412733e+01 - 3 -2.7636357943608498e+01 -5.7337574523637755e+01 -2.0403805282314181e+01 - 4 -7.2317789779541941e-01 2.3012174062259275e-01 -6.6823592461312853e-01 - 5 -7.5185946215991617e-01 3.7240620371666983e-01 8.4489606238073323e-01 - 6 -1.0262924878381020e+02 9.8816237249108255e+01 2.2855192964190866e+01 - 7 6.1333586737843051e+00 -2.0873160449701448e+01 -9.1814844136140763e+01 - 8 6.2570940260324752e+00 5.9968126670698441e-01 5.4229329539586693e+01 - 9 1.2262351504698112e+01 4.7122358361183512e+00 4.7760548283524834e+01 - 10 7.7930468463002626e+01 -9.2569654139327270e+01 -3.3800107666501951e+01 - 11 -1.1664508451530349e+00 6.4847545619732350e-01 -1.3877843715123990e+00 - 12 7.6322954402554641e+00 3.2220875190003779e+00 -1.3912725743532917e+00 - 13 4.9947012164950816e-01 -2.0404050057584325e-01 -2.3038024525948572e-01 - 14 -1.4338049088950942e+00 4.1530810571010296e-01 -6.7535138868887457e-01 - 15 2.7208370482131622e-01 3.6587465686794030e-01 -8.1685862767273021e-01 - 16 3.4214016589614211e+01 -2.8191470627142657e+01 -7.6737915428339093e+01 - 17 -3.4009785880008764e+01 2.8847638686563727e+01 7.7410680077600475e+01 - 18 -2.5869082563799595e-01 4.4686548401107347e+00 -7.2828196393286673e+00 - 19 2.4019122527189483e+00 -5.5368134730505247e-01 5.6339568269314775e+00 - 20 -2.8152355285376500e+00 -3.8648865796955136e+00 3.5989268468207034e+00 - 21 -9.4559930331241464e+00 -8.0098991004632829e+00 2.7906114436487847e+01 - 22 -1.5683873987266850e+01 -4.8962622933594009e+00 -2.1602316781003321e+01 - 23 2.4665469650798119e+01 1.3368881448015728e+01 -5.7175956219170798e+00 - 24 8.1932100263784342e+00 -2.7824980073290487e+01 1.6895023389689289e+01 - 25 -2.5722475501144746e+01 1.5860605449071223e+00 -2.1000349420565563e+01 - 26 1.6906586232236457e+01 2.5988680146207475e+01 3.4371717443579688e+00 - 27 5.0614242834928946e+00 -2.6848507245527379e+01 9.7078819846058231e+00 - 28 -2.3388994927528717e+01 7.9794278762031974e+00 -1.5074200518113049e+01 - 29 1.8779128597647372e+01 1.8871367696255678e+01 5.3310220942768991e+00 + 1 -2.7683205204507280e+00 6.6449095490165703e+01 8.2247797711895885e+01 + 2 3.8702193821877493e+01 2.9212211419425969e+01 -4.7019604804325617e+01 + 3 -3.5243454585514591e+01 -9.6154953863738911e+01 -3.4936504643788560e+01 + 4 -6.5977687131041252e-01 1.7011085278366439e-01 -6.5635985341126124e-01 + 5 -7.3566505234358270e-01 3.2004653103552905e-01 8.0428307532511589e-01 + 6 -2.0326269614835340e+02 2.3271299913843555e+02 2.7442710822013873e+02 + 7 1.4300021996054623e+01 -8.0959802494991251e+01 -4.1226588541677728e+02 + 8 3.2858865265765651e+01 -2.1199693568720125e+01 1.0091081733429107e+02 + 9 2.1122714604067934e+01 1.5084943250328770e+01 8.7605509332947179e+01 + 10 1.3136998941143941e+02 -1.5218480590048722e+02 -4.7552579577409830e+01 + 11 -1.0661815608329375e+00 6.1244026211185132e-01 -1.2462619124968015e+00 + 12 7.7760233760077231e+00 3.1127902634122728e+00 -1.4744694804987457e+00 + 13 5.2674586924271427e-01 -2.4917758586878880e-01 -1.8723934835850795e-01 + 14 -1.3120523259791150e+00 4.0614108203397964e-01 -7.2914636677516875e-01 + 15 3.2867610981988737e-01 4.2750390948272482e-01 -7.8475586802253572e-01 + 16 1.1296204447867072e+02 -8.1834725270478103e+01 -2.9024712501702589e+02 + 17 -1.1375160235079549e+02 8.3851462518713276e+01 2.8944627514695969e+02 + 18 3.0738345014064944e-01 4.7275451584201162e+00 -7.8225421226147951e+00 + 19 2.0274544872239728e+00 -6.9334025263478072e-01 5.5367196067976767e+00 + 20 -2.8992075327228490e+00 -3.9662506277601803e+00 4.0716458277265861e+00 + 21 -1.6026802838192324e+01 -1.5883941405520059e+01 4.7256124362739875e+01 + 22 -2.5118529350290316e+01 -7.1302246487029537e+00 -3.6226156710291576e+01 + 23 4.0731193744183564e+01 2.3426594982025247e+01 -1.0527511305357223e+01 + 24 7.9759015601633747e+00 -4.4140032390736621e+01 2.3421941942737131e+01 + 25 -3.4663429593566200e+01 3.0656489475373521e+00 -2.8305771699474640e+01 + 26 2.6127823323620827e+01 4.0822835743219649e+01 4.2748889953069069e+00 + 27 1.1011144344413010e+01 -4.6436391929690870e+01 1.8878781879279799e+01 + 28 -4.0634774700271556e+01 1.5071357061734957e+01 -2.6829755168650092e+01 + 29 3.0014317587931910e+01 3.1359613328463354e+01 7.9297758591329561e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml index e8fb26069..189a321fe 100644 --- a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml +++ b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 17:51:49 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -49,38 +49,38 @@ init_forces: ! |2 27 5.8858131514524516e+01 -2.5934658519982310e+02 1.0378659589349859e+02 28 -2.1004851662389484e+02 8.7061736878465183e+01 -1.4131944246679177e+02 29 1.5193395589309270e+02 1.7194075642255194e+02 3.8106025733269696e+01 -run_vdwl: 145.774836401433 -run_coul: -142.001672647389 +run_vdwl: 738.975921529802 +run_coul: -127.388878149465 run_stress: ! |2- - 5.9383525774485156e+02 6.0808146948988235e+02 4.3447102407954065e+02 -3.1367656108012937e+02 -3.3473859201760604e+01 1.2397858084799522e+02 + 2.2173727908784563e+03 2.1780484935540412e+03 4.3978310588967724e+03 -6.9936430337437957e+02 8.2321786589523725e+01 6.2596079360064653e+02 run_forces: ! |2 - 1 1.4832995973686170e+01 7.9776687213625252e+01 6.1502475376960476e+01 - 2 1.9653644405660430e+01 1.2276384921396586e+01 -2.5616350279108055e+01 - 3 -2.4593229040543631e+02 1.0324817388734876e+02 8.5000613152551139e+01 - 4 -8.7492562881244140e+00 3.2814846537200122e+00 -6.5557432751371865e+00 - 5 -2.2193986160004506e+00 -1.8736682348780977e+00 1.0432132523702611e+01 - 6 1.1567651108409385e+02 -9.9327087024067481e+01 -1.4166521367866525e+02 - 7 4.0383302895685285e+00 -1.0438666847173314e+01 -4.1479991151179689e+01 - 8 -2.0195494612421022e+01 2.2750024345139270e+01 5.6630890758924743e+01 - 9 1.3863634324490205e+01 6.0273384530541829e+00 5.3346856258210913e+01 - 10 6.4071029621033190e+01 -7.5538706154994941e+01 -7.5482377594635125e+01 - 11 -7.3938990739669297e+00 -6.6541891823595511e+00 -1.6954609981462021e+01 - 12 1.7782670476115754e+01 1.1436818682806711e+01 -6.8461323924619544e+00 - 13 7.0142523732388282e+00 -2.7743547704825042e+00 -2.2972569037802196e-01 - 14 -4.3951111547271191e+00 8.9351928590546470e-01 -7.0768324366602169e+00 - 15 -3.5776161647673893e-01 7.7391165764571905e+00 2.0440411346847966e+00 - 16 5.2356125055814530e+01 -6.8461465060623581e+01 1.4548920682036552e+01 - 17 -1.8339663864786544e+01 1.7659748258170925e+01 3.5971402502023636e+01 - 18 1.7393982522053547e-01 7.1073524680869795e+00 -8.1841236137870848e+00 - 19 2.0603004385900459e+00 -2.0735217551082559e+00 5.3320473022271813e+00 - 20 -3.2409845658166634e+00 -3.2645830355908463e+00 3.4324196803320355e+00 - 21 -8.1437559216355577e+00 -1.1349332196095922e+01 3.1674737849067995e+01 - 22 -1.7185201896219699e+01 -3.0425686380379369e+00 -2.4510915216827922e+01 - 23 2.4562355825010041e+01 1.3401421455896168e+01 -6.2894741072227554e+00 - 24 9.9751672213715388e+00 -2.8727909978269032e+01 2.2125945151340339e+01 - 25 -2.7882046939224672e+01 4.7174965096460877e+00 -2.2641592997635790e+01 - 26 1.5893787897689318e+01 2.4691263883074651e+01 1.0754239197674487e+00 - 27 1.4348611082706770e+00 -3.1909073783329251e+01 8.3825805242462721e+00 - 28 -2.1199284731841054e+01 8.0433746282727565e+00 -1.4196288516485287e+01 - 29 2.1844543766823431e+01 2.2384921438409787e+01 6.2288841155702457e+00 + 1 -1.8063062097386016e+01 2.6678164271241985e+02 3.2403093673891783e+02 + 2 1.5330363775490687e+02 1.2380469463260739e+02 -1.8151375632138877e+02 + 3 -1.3354881884043172e+02 -3.7931754885090822e+02 -1.4288676523165671e+02 + 4 -7.7881289397041860e+00 2.1395107180008677e+00 -5.8947301247776469e+00 + 5 -2.9014964847648832e+00 -3.3191093240014604e+00 1.2028384066999243e+01 + 6 -8.0488796652549945e+02 9.1802969886724088e+02 1.0244105721734165e+03 + 7 5.5465229324511789e+01 -3.1049125109244693e+02 -1.5711951630598628e+03 + 8 1.3295579854044223e+02 -9.6566612790576784e+01 3.9097884435895446e+02 + 9 7.8595357487517475e+01 7.6787212039036987e+01 3.4114530915103359e+02 + 10 5.2093101347691447e+02 -5.9871691329638986e+02 -1.8144911191468893e+02 + 11 -3.3487592446207044e+00 -4.7300628926372168e+00 -1.0148735160905664e+01 + 12 2.0817060168777708e+01 9.8623174017223292e+00 -6.7803396152863709e+00 + 13 7.6705243427562264e+00 -3.1871057947884363e+00 -1.5823953972492252e-01 + 14 -4.5784145674531809e+00 1.1136730678426814e+00 -8.6501573817353421e+00 + 15 -2.0466585885842055e-03 8.3342554681802365e+00 2.0654380804866337e+00 + 16 4.3381609882629601e+02 -3.1216461898460142e+02 -1.1109941632549444e+03 + 17 -4.2715883344093606e+02 3.0231287329421139e+02 1.1227490612130075e+03 + 18 1.2031002833670406e+00 6.6111421207392080e+00 -9.8172176435234633e+00 + 19 1.6541911655815720e+00 -1.6436698313621414e+00 5.6634437888934404e+00 + 20 -3.4397786908218730e+00 -3.1641367900785045e+00 4.1983572647332572e+00 + 21 -8.1062607701956438e+01 -9.3130367840907837e+01 2.5259755690947785e+02 + 22 -1.2470895578566348e+02 -2.9684717670399102e+01 -1.9078947716543931e+02 + 23 2.0525958907843324e+02 1.2156663696816827e+02 -6.1272852819749417e+01 + 24 4.2949506070177428e+01 -2.3951856762877495e+02 1.3127057427172971e+02 + 25 -1.7341368098382370e+02 2.5112347023584114e+01 -1.4493904346686341e+02 + 26 1.2953491044220081e+02 2.1352319150959516e+02 1.4779391560421260e+01 + 27 5.7285683181473601e+01 -2.5341784479391708e+02 1.0065732097817624e+02 + 28 -2.0496228364637119e+02 8.4881953846331427e+01 -1.3764298653172222e+02 + 29 1.4842313346466511e+02 1.6819137791210869e+02 3.7557548676022350e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-python_lj.yaml b/unittest/force-styles/tests/mol-pair-python_lj.yaml index 3fdfc7401..614741a0a 100644 --- a/unittest/force-styles/tests/mol-pair-python_lj.yaml +++ b/unittest/force-styles/tests/mol-pair-python_lj.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 17:43:06 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -47,38 +47,38 @@ init_forces: ! |2 27 6.1705671019807909e+01 -2.7045854429300255e+02 1.0821183331233215e+02 28 -2.1489493703146951e+02 9.2352775183519000e+01 -1.4540033260735669e+02 29 1.5319756790138297e+02 1.7811269192006952e+02 3.7183833054110600e+01 -run_vdwl: 144.99121733439 +run_vdwl: 738.819757395753 run_coul: 0 run_stress: ! |2- - 6.1910947424358005e+02 6.6812349898828040e+02 4.8166005669601208e+02 -3.2243037433905363e+02 -3.1553495127500625e+01 1.2293864137610495e+02 + 2.2435980702046804e+03 2.2209196675879020e+03 4.4542444945862735e+03 -6.9874341432935455e+02 9.0014475862275745e+01 6.2292770158619999e+02 run_forces: ! |2 - 1 1.2964191381427986e+01 8.0892463766898743e+01 6.0323463721142069e+01 - 2 1.8550239926888143e+01 1.4016238728353951e+01 -2.2757489148001437e+01 - 3 -2.4823730089528280e+02 1.0508783069196251e+02 8.6172505981756643e+01 - 4 -8.6006869865351767e+00 3.1744189165443339e+00 -6.2092108081116582e+00 - 5 -1.7308191055169313e+00 -2.5575674947797902e+00 1.0273486422902376e+01 - 6 1.1683405293890358e+02 -9.8726786219094180e+01 -1.4208733055613467e+02 - 7 3.8041958263985713e+00 -1.0704991988460705e+01 -4.2399846201367069e+01 - 8 -1.9935762534695186e+01 1.9886759828526795e+01 5.5348231962077570e+01 - 9 1.1205808704436020e+01 1.3198959164683011e+01 4.9879862371149436e+01 - 10 6.4812569038175369e+01 -7.6375096178338595e+01 -7.5660183712959508e+01 - 11 -6.2988185446946430e+00 -8.0952950149914233e+00 -1.6391435626117183e+01 - 12 1.4369525712683764e+01 1.2193091004148052e+01 -8.2528580195976922e+00 - 13 7.3377287957067914e+00 -2.7955925311462675e+00 -1.0304162098803582e-01 - 14 -2.7952228613619492e+00 4.3885108338982148e-01 -7.1101066312581809e+00 - 15 -3.9779877100946709e-01 8.1105950563503288e+00 3.0711189972946089e+00 - 16 5.2787573015811034e+01 -6.7733680417848447e+01 1.5088112278617384e+01 - 17 -1.4633314393749638e+01 1.0014097705511523e+01 4.0800217361197326e+01 - 18 -1.8057970282348051e-02 -3.1590780148621544e-02 2.9639566122554754e-02 - 19 2.5586453211434333e-04 -2.4342393239688300e-04 1.6748438254610368e-03 - 20 -8.8290898809219689e-04 -9.1225710977274350e-04 3.6051894590879177e-04 - 21 -9.0304081561032916e+00 -1.1103433454817829e+01 3.6299916176334428e+01 - 22 -1.6981581435543042e+01 -4.0761763782947185e+00 -2.7498400714898658e+01 - 23 2.5999992597280002e+01 1.5193231067436271e+01 -8.7883538971483457e+00 - 24 1.1753997481833450e+01 -3.3680929542642666e+01 2.2223889003823036e+01 - 25 -2.7860155418603220e+01 5.1330896626531599e+00 -2.3967009562126073e+01 - 26 1.6092479124198338e+01 2.8535719425627722e+01 1.7172356582298487e+00 - 27 2.7712739453658171e+00 -3.6389758020369179e+01 1.0673782030059142e+01 - 28 -2.3268224624332859e+01 1.0849152796202816e+01 -1.5722447060249483e+01 - 29 2.0505150253057547e+01 2.5547554803685497e+01 5.0442166654802838e+00 + 1 -2.0299299356823447e+01 2.6686195212932063e+02 3.2358804213062479e+02 + 2 1.5298619654210464e+02 1.2596516536248232e+02 -1.7961288739941020e+02 + 3 -1.3353623724452208e+02 -3.7923746132210925e+02 -1.4291828140248026e+02 + 4 -7.8374686653721231e+00 2.1276606472950892e+00 -5.5844964594837334e+00 + 5 -2.5014075892893772e+00 -4.0250054101453694e+00 1.2103532921564140e+01 + 6 -8.0681463857048971e+02 9.2165650465798001e+02 1.0270803092037731e+03 + 7 5.5780336810088954e+01 -3.1117547800452053e+02 -1.5746997598875225e+03 + 8 1.3452985999685069e+02 -1.0064661844246370e+02 3.8851804788505058e+02 + 9 7.6746216117382275e+01 8.2501489148064735e+01 3.3944353584584888e+02 + 10 5.2128042079513079e+02 -5.9920110059796048e+02 -1.8126035901553985e+02 + 11 -2.3572665611232537e+00 -5.8617279891145326e+00 -9.6050034568394995e+00 + 12 1.7504071474949331e+01 1.0626741933241489e+01 -8.0603929519705346e+00 + 13 8.0530530237966840e+00 -3.1757334144096352e+00 -1.4623404029462050e-01 + 14 -3.3415864672305058e+00 6.6489364135279705e-01 -8.6345195747458359e+00 + 15 -2.2253842857323938e-01 8.5025653550974170e+00 3.0369819791012240e+00 + 16 4.3476333446054446e+02 -3.1171108804548999e+02 -1.1135223442253114e+03 + 17 -4.2469879726674083e+02 2.9615420713994877e+02 1.1302578473070766e+03 + 18 -1.8845742881288187e-02 -3.3382739220504248e-02 3.1017014037648886e-02 + 19 3.1000432316549681e-04 -2.4711296768421348e-04 1.7436044116378880e-03 + 20 -9.8640310995367188e-04 -1.0104590877852502e-03 3.7013943200290205e-04 + 21 -8.3475128675092776e+01 -9.4490859008250382e+01 2.6281158503012904e+02 + 22 -1.2609655050936539e+02 -3.0751012272885209e+01 -1.9732505680443498e+02 + 23 2.0956114179778157e+02 1.2525410481555450e+02 -6.5475093973418495e+01 + 24 4.5396782206224216e+01 -2.4912415021966007e+02 1.3353846272093693e+02 + 25 -1.7687625944269698e+02 2.8191341748196347e+01 -1.4878844136371131e+02 + 26 1.3146698711695055e+02 2.2092132554324604e+02 1.5226056816995065e+01 + 27 6.0031174195841004e+01 -2.6428946702389879e+02 1.0492713364874194e+02 + 28 -2.0957080124928456e+02 9.0071918487064323e+01 -1.4154842391689823e+02 + 29 1.4954792763062741e+02 1.7422447145333953e+02 3.6616628224337767e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-soft.yaml b/unittest/force-styles/tests/mol-pair-soft.yaml index e4d08c80f..7a8a5322e 100644 --- a/unittest/force-styles/tests/mol-pair-soft.yaml +++ b/unittest/force-styles/tests/mol-pair-soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 06:22:52 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -23,23 +23,23 @@ natoms: 29 init_vdwl: 1.84744817921225 init_coul: 0 init_stress: ! |2- - 2.6985212108047096e+00 1.8929069643988077e+00 1.7058942753638846e+00 -6.5932149182557875e-01 6.7921581099237543e-02 -3.2192722305869170e-01 + 2.6985212108047096e+00 1.8929069643988077e+00 1.7058942753638846e+00 -6.5932149182557853e-01 6.7921581099237488e-02 -3.2192722305869165e-01 init_forces: ! |2 1 2.8065059411338959e-02 1.4475400640818467e-01 6.2167976642541665e-02 2 3.5911509159733825e-02 7.5792446542598854e-02 -1.6618358082877357e-02 3 -1.4978210463219779e-01 6.4481690232657984e-02 4.0565044686902113e-02 4 -7.6956178069581604e-02 5.6986638675930908e-03 -4.0814530409352151e-02 5 -4.0306591454846857e-02 -4.0167644420758424e-02 7.2397076865240495e-02 - 6 -2.7680420938296790e-01 2.5803299543823072e-02 -7.6840385376372625e-02 - 7 -2.4311862474414389e-01 6.9534442210756123e-02 -2.5757742214265328e-01 + 6 -2.7680420938296796e-01 2.5803299543823072e-02 -7.6840385376372625e-02 + 7 -2.4311862474414386e-01 6.9534442210756109e-02 -2.5757742214265328e-01 8 -1.4609308552009195e-01 3.5839567510574058e-02 8.7965658071998507e-02 - 9 -2.2929283546198997e-02 5.7589458497830828e-02 1.4659458498861072e-01 - 10 7.6881898642091440e-02 -2.1261632693724342e-01 2.3398538464963828e-02 + 9 -2.2929283546198991e-02 5.7589458497830821e-02 1.4659458498861072e-01 + 10 7.6881898642091454e-02 -2.1261632693724336e-01 2.3398538464963800e-02 11 -2.5548488247743126e-02 -9.5728272008179738e-02 -8.5017558264751270e-02 12 4.5575293493957508e-01 4.4215285128865606e-02 -1.0838174668791306e-01 - 13 8.7385440814045964e-02 1.4369146254701298e-02 -3.2854342757696768e-02 + 13 8.7385440814045950e-02 1.4369146254701294e-02 -3.2854342757696761e-02 14 5.4238600872785710e-02 1.2802731437212927e-02 -1.1831929886630289e-01 - 15 1.2787389224046808e-01 1.0432267515211492e-01 7.7710287049113339e-04 + 15 1.2787389224046808e-01 1.0432267515211492e-01 7.7710287049113512e-04 16 9.3724777378964522e-02 -2.2611686804396253e-01 1.2700219209206529e-01 17 2.1704452138768593e-02 -8.0574301376769353e-02 1.7555546790510568e-01 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 @@ -50,42 +50,42 @@ init_forces: ! |2 23 3.5596601622601455e-02 1.8706980983859325e-02 2.8227689234540335e-03 24 5.0712775121559053e-03 -1.9757475974717414e-02 1.1753823978318308e-02 25 -3.1967679147319392e-02 -7.0718964196126964e-03 -2.2042768641089366e-02 - 26 2.6896401635163485e-02 2.6829372394330111e-02 1.0288944662771058e-02 + 26 2.6896401635163492e-02 2.6829372394330111e-02 1.0288944662771058e-02 27 2.6771292067361979e-03 -2.1880100266431633e-02 7.4597018341065590e-03 - 28 -3.4007977163362471e-02 1.3475065504780902e-03 -1.9395024081220218e-02 + 28 -3.4007977163362471e-02 1.3475065504780894e-03 -1.9395024081220218e-02 29 3.1330847956626273e-02 2.0532593715953545e-02 1.1935322247113659e-02 -run_vdwl: 1.83829828942125 +run_vdwl: 1.84654240191966 run_coul: 0 run_stress: ! |2- - 2.6892905229741615e+00 1.8773074522980040e+00 1.6971210837031294e+00 -6.5045070186391307e-01 7.2382715610406489e-02 -3.1681519062327174e-01 + 2.6976828829307093e+00 1.8913987677475295e+00 1.7050584522746157e+00 -6.5843276532938932e-01 6.8347915320120189e-02 -3.2141442928461578e-01 run_forces: ! |2 - 1 2.7626736118196951e-02 1.4393320832535667e-01 6.1549716299969727e-02 - 2 3.6117855438409743e-02 7.4101092202603608e-02 -1.5982378744262574e-02 - 3 -1.4724464325147221e-01 6.3219011620168297e-02 4.0388108895068615e-02 - 4 -7.6142171668294706e-02 5.6496466639128981e-03 -4.0386869007112844e-02 - 5 -4.0845938192134723e-02 -3.9805571389576196e-02 7.1745451157293180e-02 - 6 -2.7527768022693161e-01 2.5778246462400661e-02 -7.7040603979213237e-02 - 7 -2.4250670528501000e-01 6.8897598543317229e-02 -2.5678447165959417e-01 - 8 -1.4768375175165319e-01 3.4263039142501096e-02 8.6711776256619397e-02 - 9 -2.4526067920006105e-02 5.8596447742611704e-02 1.4573287230011606e-01 - 10 7.6802510950124692e-02 -2.1164687608059429e-01 2.3118841931212428e-02 - 11 -2.6559265146753799e-02 -9.4978549234924270e-02 -8.4152147696980151e-02 - 12 4.5379546778717467e-01 4.3667011070801773e-02 -1.0853187850141469e-01 - 13 8.5243479408163791e-02 1.3932000514239925e-02 -3.1381748012984677e-02 - 14 5.1435367326329827e-02 1.3343258442794605e-02 -1.1493564124751957e-01 - 15 1.3339128203385975e-01 1.0558053320609068e-01 2.3707977032699952e-05 - 16 9.4366892717143866e-02 -2.2462180300122347e-01 1.2495235545192762e-01 - 17 2.2006631662853070e-02 -7.9908294230480917e-02 1.7497290857984224e-01 + 1 2.8021457878677658e-02 1.4467291039105015e-01 6.2107336544985257e-02 + 2 3.5933759651122339e-02 7.5625635446820785e-02 -1.6553662557456834e-02 + 3 -1.4953083087768484e-01 6.4356787277812619e-02 4.0546792775363494e-02 + 4 -7.6876011198384525e-02 5.6933574372011152e-03 -4.0773854569594412e-02 + 5 -4.0360715298366961e-02 -4.0131486399087368e-02 7.2333099443335186e-02 + 6 -2.7666371613293117e-01 2.5803983191036953e-02 -7.6855333801116907e-02 + 7 -2.4306146079883487e-01 6.9471726026947511e-02 -2.5750027890960958e-01 + 8 -1.4625709217613972e-01 3.5681868748308587e-02 8.7845805417251233e-02 + 9 -2.3090277372651916e-02 5.7689930568517525e-02 1.4651099934495118e-01 + 10 7.6873550367854301e-02 -2.1252309576700446e-01 2.3372747913703487e-02 + 11 -2.5649747202333727e-02 -9.5657316707501883e-02 -8.4933472400048698e-02 + 12 4.5556357306148948e-01 4.4159972771502631e-02 -1.0839965518703726e-01 + 13 8.7178304346775815e-02 1.4325442409469098e-02 -3.2707330125854084e-02 + 14 5.3962241133021845e-02 1.2852863204544790e-02 -1.1799353587912334e-01 + 15 1.2843268408308708e-01 1.0445791698748079e-01 7.0133326761527537e-04 + 16 9.3789547398550430e-02 -2.2597161008520258e-01 1.2680003049676788e-01 + 17 2.1734733136748875e-02 -8.0508885501896221e-02 1.7549897822586810e-01 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 - 19 -1.3898431312129608e-02 -1.2070560777062287e-02 -3.3245364297847099e-03 - 20 1.3898431312129608e-02 1.2070560777062287e-02 3.3245364297847099e-03 - 21 -5.8721416852572598e-03 -6.8221851033155260e-03 2.1661339404847622e-02 - 22 -2.9638222891418445e-02 -1.1252824193905071e-02 -2.4457744535956755e-02 - 23 3.5510364576675703e-02 1.8075009297220598e-02 2.7964051311091332e-03 - 24 5.0213385208849031e-03 -1.9249804126643937e-02 1.1342934749424504e-02 - 25 -3.2261395726667752e-02 -7.9697928334289368e-03 -2.2443097170728836e-02 - 26 2.7240057205782847e-02 2.7219596960072874e-02 1.1100162421304330e-02 - 27 2.8815022657343505e-03 -2.1811274153260882e-02 7.0034740967186253e-03 - 28 -3.4289853071041654e-02 1.1414224698740975e-03 -1.9420628895038074e-02 - 29 3.1408350805307308e-02 2.0669851683386784e-02 1.2417154798319450e-02 + 19 -1.5278655650603584e-02 -1.3092839338036009e-02 -3.8241169675135491e-03 + 20 1.5278655650603584e-02 1.3092839338036009e-02 3.8241169675135491e-03 + 21 -5.9186609708756395e-03 -7.3501306505093060e-03 2.2078404305702896e-02 + 22 -2.9670361472641450e-02 -1.1293942933499636e-02 -2.4898465486256988e-02 + 23 3.5589022443517089e-02 1.8644073584008942e-02 2.8200611805540921e-03 + 24 5.0666604984185449e-03 -1.9707620208804153e-02 1.1713458275370110e-02 + 25 -3.1999675543599282e-02 -7.1612288281288272e-03 -2.2083420966021235e-02 + 26 2.6933015045180732e-02 2.6868849036932978e-02 1.0369962690651126e-02 + 27 2.6974802412111330e-03 -2.1873376180687285e-02 7.4142388029855844e-03 + 28 -3.4036696326963115e-02 1.3269227492356461e-03 -1.9397774681892695e-02 + 29 3.1339216085751985e-02 2.0546453431451638e-02 1.1983535878907112e-02 ... diff --git a/unittest/force-styles/tests/mol-pair-table.yaml b/unittest/force-styles/tests/mol-pair-table.yaml index 7418352c0..8d70bac4a 100644 --- a/unittest/force-styles/tests/mol-pair-table.yaml +++ b/unittest/force-styles/tests/mol-pair-table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -61,38 +61,38 @@ init_forces: ! |2 27 5.3953257632741014e+01 -2.3246330657484364e+02 9.3521822143445291e+01 28 -1.8537423924296499e+02 7.9666126830459447e+01 -1.2542634211727822e+02 29 1.3142887167232908e+02 1.5280375224826219e+02 3.1900088976429561e+01 -run_vdwl: 146.327829985032 +run_vdwl: 726.065960788881 run_coul: 0 run_stress: ! |2- - 6.2914745307898283e+02 6.7439990734333583e+02 4.8382994180885322e+02 -3.2311602844067630e+02 -2.9168790037089135e+01 1.2280146536160866e+02 + 2.1627688622718279e+03 2.1802718284070047e+03 4.4504401769393571e+03 -7.4341026090182379e+02 4.5735462684900419e+01 6.3447537883393807e+02 run_forces: ! |2 - 1 1.3092386727121557e+01 8.0975258006863527e+01 6.0162717183582615e+01 - 2 1.8402173670762625e+01 1.3899059683375182e+01 -2.2581973215530972e+01 - 3 -2.5170415829369691e+02 1.0807957243252388e+02 8.7902068634117185e+01 - 4 -8.7521679338772564e+00 3.2350894298919783e+00 -6.3183019964749780e+00 - 5 -1.7372909950509312e+00 -2.5663073053399832e+00 1.0327280945285382e+01 - 6 1.2021318256369948e+02 -1.0159989935597440e+02 -1.4455046866801038e+02 - 7 3.7064970613492512e+00 -1.0481522858827926e+01 -4.1617502928655071e+01 - 8 -1.9012552812922401e+01 1.9341369900133493e+01 5.6061660162509632e+01 - 9 1.1002966844626583e+01 1.2955046425976752e+01 4.8964009756379951e+01 - 10 6.3968310015089294e+01 -7.5154164336910185e+01 -7.5921779563234097e+01 - 11 -6.3974181801433527e+00 -8.2015044886741890e+00 -1.6623131445951760e+01 - 12 1.4375970778558539e+01 1.2183815698169100e+01 -8.2849268567516905e+00 - 13 7.4327969687776196e+00 -2.8316539598264616e+00 -1.0441307986265116e-01 - 14 -2.8220099744921270e+00 4.4312152330104282e-01 -7.1784838499077441e+00 - 15 -4.0482676064288375e-01 8.2478176580999758e+00 3.1232194954592902e+00 - 16 5.3215666467083004e+01 -6.8452018298715132e+01 1.6067414590921679e+01 - 17 -1.4543993736556850e+01 9.9518135650728148e+00 4.0557829246754260e+01 - 18 -1.8054106711718410e-02 -3.1568964918282955e-02 2.9599553823736552e-02 - 19 2.5604832046069535e-04 -2.4189898030892005e-04 1.6743691237745819e-03 - 20 -8.8390456832979493e-04 -9.1401459749508313e-04 3.6013486968785625e-04 - 21 -9.8223704263420135e+00 -1.1937831142654984e+01 3.8747486275879332e+01 - 22 -1.8260879394786041e+01 -4.4231132834754163e+00 -2.9364817699370402e+01 - 23 2.8071936064676528e+01 1.6373759184425133e+01 -9.3702350107338450e+00 - 24 1.2590957134158188e+01 -3.6189602254037929e+01 2.3845923499083668e+01 - 25 -3.0061118850595161e+01 5.3993721695176697e+00 -2.5809444960387523e+01 - 26 1.7456807738003775e+01 3.0778628058022715e+01 1.9384675815059120e+00 - 27 3.0641658609965634e+00 -3.8727506359895912e+01 1.1409481341404170e+01 - 28 -2.5002749675394742e+01 1.1546639020795190e+01 -1.6860888288423549e+01 - 29 2.1946401102557179e+01 2.7187485766660277e+01 5.4471747925943950e+00 + 1 -2.0878358044493719e+01 2.6834370753548973e+02 3.2633975153330812e+02 + 2 1.5448089212199824e+02 1.2719483233725651e+02 -1.8136896821625663e+02 + 3 -1.3439668625747109e+02 -3.8185790269661686e+02 -1.4407487208975627e+02 + 4 -7.8866569893994338e+00 2.1413531724956845e+00 -5.6194872946004120e+00 + 5 -2.5446546745422127e+00 -4.0917431257113561e+00 1.2323404818007186e+01 + 6 -8.1519071631863869e+02 9.3100053220982159e+02 1.0363563891078907e+03 + 7 5.6405025633298848e+01 -3.1416751797911792e+02 -1.5893439874611265e+03 + 8 1.3502696439028787e+02 -1.0339222658789051e+02 3.8673227211503382e+02 + 9 7.8764876461711623e+01 8.4672592935155919e+01 3.4837194700537725e+02 + 10 5.2646346170857407e+02 -6.0492984818690832e+02 -1.8287026994608306e+02 + 11 -2.4038248230180987e+00 -5.9753289110034027e+00 -9.7920371810043427e+00 + 12 1.7502018647455181e+01 1.0625113637199297e+01 -8.0537631267675263e+00 + 13 8.2009437409945285e+00 -3.2338659979088766e+00 -1.4892782787939277e-01 + 14 -3.3864748863490344e+00 6.7388898143519982e-01 -8.7508490777918091e+00 + 15 -2.2639054981325318e-01 8.6399065191016025e+00 3.0861958694266831e+00 + 16 4.3947683238132146e+02 -3.1503627501478906e+02 -1.1258697812654755e+03 + 17 -4.2937346594151563e+02 2.9942031611829958e+02 1.1426667194079319e+03 + 18 -1.8848497553241517e-02 -3.3369315110061332e-02 3.0984544093077489e-02 + 19 3.1047227533696498e-04 -2.4552036311543181e-04 1.7440413557473253e-03 + 20 -9.8793699538152744e-04 -1.0126788520361655e-03 3.6972665526019031e-04 + 21 -7.3122512848595093e+01 -8.2108395593345449e+01 2.2670383444966822e+02 + 22 -1.0860645778336577e+02 -2.6490049694012395e+01 -1.6993231450683069e+02 + 23 1.8171902304236116e+02 1.0860997889370684e+02 -5.6760718070089567e+01 + 24 3.7875988908556863e+01 -2.1590055311231009e+02 1.1458662288694117e+02 + 25 -1.5196832871712732e+02 2.4207361309592546e+01 -1.2783082450126705e+02 + 26 1.1408013753668000e+02 1.9168217794435230e+02 1.3220992164815904e+01 + 27 5.3389794067221601e+01 -2.2776238213692358e+02 9.1350575584137488e+01 + 28 -1.8183793673246399e+02 7.8135840411748148e+01 -1.2281250572835543e+02 + 29 1.2845603188860537e+02 1.4963311454520777e+02 3.1457503038642685e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml index 2d9e3c766..f5e302e7c 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Thu Aug 6 16:52:44 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 1e-14 prerequisites: ! | atom full @@ -51,37 +51,37 @@ init_forces: ! |2 28 8.5365856050054738e+00 -2.4636423220451302e+00 4.2276358718634395e+00 29 -3.8831706532739356e+00 -5.2900046950811053e+00 -1.5026494435836046e+00 run_vdwl: 0 -run_coul: -129.949194697702 +run_coul: -129.022909187485 run_stress: ! |- - -2.7373545909757116e+01 -4.7619902456842951e+01 -5.4955746331101679e+01 -8.4354247849594639e+00 2.8556004776515653e+00 2.2680107191632974e+01 + -2.6283108873476834e+01 -4.7364418931021810e+01 -5.5375381382986646e+01 -7.8830194106596636e+00 3.7088788510613115e+00 2.3292677092809960e+01 run_forces: ! |2 - 1 2.1731129716367894e+00 -3.0359630130864101e-01 1.9689058481708605e-01 - 2 -2.5187294382426201e-03 -3.3608481267162218e+00 -1.3119213751017902e+00 - 3 -9.6307768304685140e-03 -1.3988357941344462e-01 1.0655374939144235e-02 - 4 2.1319604879652515e-01 1.9805215830831333e-01 -2.0188041651959643e-01 - 5 -3.9561469763572954e-01 6.8460440342577755e-01 -9.1652226785774921e-02 - 6 1.8057649368898745e+00 -3.6328889111256149e+00 -2.9064572582811845e+00 - 7 -1.8645037758062377e-01 6.3858608507958059e-01 3.8207582000901184e+00 - 8 -1.3644596894520975e+00 4.0266232799443822e+00 2.5056741670073581e+00 - 9 1.6141884117762555e+00 -5.7093420281010747e+00 1.6125128872571388e+00 - 10 -3.3876683507655569e-01 4.5625636856301977e-01 -2.2270872899688871e-01 - 11 -1.0661377354776251e+00 1.3306573981020033e+00 -5.1727644042507814e-01 - 12 3.3674120384998285e+00 -9.0254269436131329e-01 1.3969523359972873e+00 - 13 -3.9447349396668052e-01 1.7266560408783169e-01 -1.8146992894843716e-01 - 14 -1.2555568358665219e+00 5.8593467386234799e-01 -2.8845967907797077e-01 - 15 2.1799499774881195e-01 -1.4683255064260636e-01 -1.0213517646377870e+00 - 16 -1.9784947825856509e+00 1.3443211176669605e+00 3.1052993742909374e+00 - 17 -1.8937251877872778e+00 5.8162279373690353e+00 -7.0947472171927881e+00 - 18 -2.8245625769401583e-01 4.3430449579772281e+00 -8.1334960023499914e+00 - 19 2.1238777128539854e+00 -1.2515675369854860e+00 6.7314413559230628e+00 - 20 -3.2938038216536878e+00 -5.5139575377250107e+00 4.3402271048916621e+00 - 21 1.0412724944160896e+00 2.9524248290069153e+00 -7.7884355652821311e+00 - 22 3.9827323456330239e+00 1.5819911842787004e+00 5.0648862292480308e+00 - 23 -7.1874234969604149e+00 -4.4652438369386518e+00 2.1989530866629137e+00 - 24 -1.0288368031402566e+00 8.0019286229285811e+00 -3.9358931701361035e+00 - 25 5.4552153399013532e+00 -7.6641521947114144e-01 4.5674192984452393e+00 - 26 -4.8980251753204662e+00 -7.4679303407279329e+00 -8.8033330598173476e-01 - 27 -1.2256806179748461e+00 9.4771714127619173e+00 -3.6287999614993955e+00 - 28 8.8232519857898257e+00 -2.5133610275463045e+00 4.3250504707518429e+00 - 29 -4.0159639695011995e+00 -5.4360803422991459e+00 -1.6718374291051665e+00 + 1 2.1510313488303772e+00 -3.2588548729582545e-01 1.7287362037901779e-01 + 2 8.2685986363260036e-02 -3.3347823804107537e+00 -1.3023708393810225e+00 + 3 -9.1175416025119638e-03 -1.3764838920098921e-01 1.1182310650180452e-02 + 4 2.0556889992233213e-01 1.9991380387619512e-01 -1.9353879974170118e-01 + 5 -4.0569865788471693e-01 6.8323112863535895e-01 -8.2666837844988295e-02 + 6 1.8565505118664696e+00 -3.6606831302025808e+00 -2.9662910062777925e+00 + 7 -2.3516710159077769e-01 6.5977324736039444e-01 3.8919986190051432e+00 + 8 -1.4564979056051137e+00 4.0728942646241464e+00 2.4921633048095426e+00 + 9 1.6363144927447899e+00 -5.6442215729303786e+00 1.5367957558037968e+00 + 10 -3.3586459894817972e-01 4.6123775574262932e-01 -2.1117545051542833e-01 + 11 -1.0649623613670438e+00 1.3243807535247829e+00 -5.2684953409232582e-01 + 12 3.3715936829779358e+00 -9.1692871020467148e-01 1.3694671871607116e+00 + 13 -3.8516471808984087e-01 1.8100265085258063e-01 -1.7754894621447448e-01 + 14 -1.2518600050608419e+00 5.7602289401893891e-01 -2.8945303433104164e-01 + 15 2.0523949050766088e-01 -1.2632422164824050e-01 -9.9595239466049146e-01 + 16 -1.9708945350573397e+00 1.3477517898735492e+00 3.1061770436216021e+00 + 17 -1.8659851579598774e+00 5.6927555327265562e+00 -7.0139147946145526e+00 + 18 8.1081999421300968e-02 4.7584352686989879e+00 -8.4285354984889675e+00 + 19 1.7503844230967744e+00 -1.5765924719373108e+00 6.5927790408022071e+00 + 20 -3.2977762125801369e+00 -5.6000220813410806e+00 4.7848401779282623e+00 + 21 9.4636654833075007e-01 3.1215113181828489e+00 -7.8505662403445138e+00 + 22 3.7267523813071994e+00 1.4171513777854932e+00 5.0359723088770476e+00 + 23 -6.8431990521090249e+00 -4.4533263573685691e+00 2.2912999336586943e+00 + 24 -8.8008175670296163e-01 7.8585190166777661e+00 -3.8047386636936951e+00 + 25 5.0628590310261492e+00 -9.2755715563555763e-01 4.2159205049851005e+00 + 26 -4.6721063304353843e+00 -7.1812521855917666e+00 -6.8705550814531924e-01 + 27 -1.0670039596216387e+00 9.2941898257919373e+00 -3.6827477927300176e+00 + 28 8.5529806613736703e+00 -2.4649842609631443e+00 4.2291216368127555e+00 + 29 -3.8880295631532764e+00 -5.2985622236412961e+00 -1.5171861034177168e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long.yaml index 9d96a981c..f80d4587b 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_long.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -61,37 +61,37 @@ init_forces: ! |2 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 run_vdwl: 0 -run_coul: 220.048510859325 +run_coul: 220.863348207268 run_stress: ! |- - -3.2535424832930019e+01 -4.2286524075903131e+01 -3.8162313208279478e+01 -4.1743354710271896e-01 -1.2139232458029813e+01 5.8729467776122277e+00 + -3.1470779253640760e+01 -4.1975172229753817e+01 -3.8436275607335894e+01 8.1781431494844209e-02 -1.1280185768529634e+01 6.4589599260454849e+00 run_forces: ! |2 - 1 2.6131680688578154e+00 -4.8342036562208102e-01 1.7840269686868443e-01 - 2 -2.6939190738423663e-01 -2.8744087695580736e+00 -1.1967949910131610e+00 - 3 1.2241135645135771e-02 -8.6362308224595855e-02 1.1995426233952385e-02 - 4 -7.0078081577080231e-02 1.4086570549491383e-02 -2.4078706748322398e-01 - 5 -5.3142632409359181e-01 6.5625319261530102e-01 -7.2314716767237025e-02 - 6 1.4298787244106805e+00 -3.8679855040858215e+00 -2.4359356032175739e+00 - 7 -2.8086280811704004e-02 8.7464586204498906e-01 3.6888214179346623e+00 - 8 -1.4124231673653769e+00 4.5103522011087218e+00 2.3342920102440403e+00 - 9 1.5527910417285362e+00 -5.9309328825446554e+00 1.4750790176848587e+00 - 10 -2.6235523448699766e-01 3.5757233063187277e-01 -2.3417827221851351e-01 - 11 -9.3594524483215680e-01 1.0583932974703241e+00 -5.4054985783631648e-01 - 12 2.8734736478986935e+00 -5.2369178235061564e-01 1.4455704041055824e+00 - 13 -8.4886264911342699e-02 2.7649029763421085e-02 -1.8007451630217339e-01 - 14 -1.0584924718013251e+00 3.7660596014862868e-01 -9.7984064821398389e-02 - 15 3.6566431724606685e-01 -2.1408413234424195e-01 -1.0347874829171970e+00 - 16 -9.0367323048165127e-01 -4.2277164147395230e-01 2.1071808187769565e+00 - 17 -2.3201090242227158e+00 6.3375931983791283e+00 -6.7748042498550483e+00 - 18 -1.0367666932119959e-01 4.2968689902744623e+00 -7.6416292443809883e+00 - 19 2.4130269465315481e+00 -3.6969316688457571e-01 5.7255888895370948e+00 - 20 -2.8499218759756748e+00 -3.8615438627050023e+00 3.6703556042733458e+00 - 21 1.6073193457487478e+00 3.0641132400813054e+00 -6.7626431241090277e+00 - 22 4.7465924706127307e+00 1.2150404360141627e+00 5.8893302084534209e+00 - 23 -6.6490042695559275e+00 -3.9871914593958206e+00 1.2434831896174121e+00 - 24 -1.2659428719544588e+00 6.9952347078745021e+00 -3.8287643151949902e+00 - 25 5.4119777555846147e+00 -3.6930902052235925e-01 4.3221517005393322e+00 - 26 -4.6115306062268111e+00 -6.7996016068395502e+00 -1.0144993079163778e+00 - 27 -1.6939299606678804e+00 7.5603905691193454e+00 -2.6741555445541247e+00 - 28 6.6722824605425552e+00 -2.2264192462822541e+00 4.2717918034742217e+00 - 29 -4.6475424291369931e+00 -5.3273838372420599e+00 -1.6341408291562105e+00 + 1 2.6126721373267778e+00 -5.1384149607139928e-01 1.8262776526672733e-01 + 2 -2.0233943395292947e-01 -2.8461408755101711e+00 -1.2059157336151138e+00 + 3 1.3418048055888844e-02 -8.4298065586250623e-02 1.3663159824193010e-02 + 4 -7.8373011560401495e-02 1.6197335592831999e-02 -2.3716932400378021e-01 + 5 -5.4542163691896994e-01 6.5615633696780862e-01 -6.9295425054217458e-02 + 6 1.4628990164108011e+00 -3.8942462058396154e+00 -2.5320617121804587e+00 + 7 -6.5024199365023488e-02 8.8941390323221492e-01 3.7938019413853290e+00 + 8 -1.4863229232500490e+00 4.5523492648959873e+00 2.3547463214159232e+00 + 9 1.5601502427039782e+00 -5.8628479230028114e+00 1.3784241946325972e+00 + 10 -2.6137072522821686e-01 3.6429055724338488e-01 -2.2799172462909839e-01 + 11 -9.3740796794171599e-01 1.0566231843413287e+00 -5.5607360201687261e-01 + 12 2.8815448499254384e+00 -5.4026761806574441e-01 1.4400576075789646e+00 + 13 -7.6643387750816555e-02 3.7584628615999968e-02 -1.8322371069434826e-01 + 14 -1.0560945158388588e+00 3.6837306207388432e-01 -1.0627100037424113e-01 + 15 3.5328495213033484e-01 -1.9374502177914096e-01 -1.0174842904826447e+00 + 16 -9.0605712876756495e-01 -4.1048281585346552e-01 2.0876805215362397e+00 + 17 -2.2835060013581376e+00 6.2153331137334842e+00 -6.6717040171043740e+00 + 18 3.2180978436188923e-01 4.7437893966680686e+00 -7.8653662538049369e+00 + 19 2.0288522291323581e+00 -6.9155098837552076e-01 5.5492944084309137e+00 + 20 -2.8992048246646975e+00 -3.9809854219991765e+00 4.0844277578891299e+00 + 21 1.5321742492121815e+00 3.1881589401464372e+00 -6.7564012771646125e+00 + 22 4.4874105861042590e+00 1.0722318617276856e+00 5.8247490358768745e+00 + 23 -6.3193967984917281e+00 -3.9592298112882309e+00 1.3095745914394106e+00 + 24 -1.0991319457135824e+00 6.8191011851011458e+00 -3.6792341920588876e+00 + 25 5.0094926319648785e+00 -5.0907691134122246e-01 3.9588366197029314e+00 + 26 -4.3929273308583143e+00 -6.5024222851550268e+00 -8.3283568838929034e-01 + 27 -1.5490455062947230e+00 7.3707637100993928e+00 -2.7118323367419230e+00 + 28 6.4196385695870228e+00 -2.1793889995975908e+00 4.1759747819576800e+00 + 29 -4.5250799589600685e+00 -5.1818420409742814e+00 -1.5009984186221175e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml index c55d60adf..8e66ab096 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 10 17:03:53 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -37,7 +37,7 @@ natoms: 29 init_vdwl: 8.07036960332134 init_coul: 100.236229731909 init_stress: ! |2- - 2.0560777882594444e+01 2.1654965423904063e+01 1.0056493693519297e+01 -2.4240063285208659e+00 -1.3467251681546395e+01 -1.4781331319647906e+01 + 2.0560777882594444e+01 2.1654965423904063e+01 1.0056493693519297e+01 -2.4240063285208642e+00 -1.3467251681546395e+01 -1.4781331319647904e+01 init_forces: ! |2 1 1.1274640438568120e+00 -2.7751438713476445e-01 1.8790157920119499e-01 2 -8.1752474659205140e-03 -1.2699647841871851e+00 -6.6459159127307632e-01 @@ -60,46 +60,46 @@ init_forces: ! |2 19 7.5955373016364403e-01 -4.4338928207346051e-01 2.3485104425164778e+00 20 -1.1613012874078987e+00 -1.6523434765045006e+00 1.7676741920085632e+00 21 6.0531811555082471e-01 1.3729063968893083e+00 -2.7923868706589650e+00 - 22 1.7600151197582461e+00 3.8208254002861425e-01 2.3799251532831041e+00 + 22 1.7600151197582465e+00 3.8208254002861425e-01 2.3799251532831041e+00 23 -2.5067133471709186e+00 -1.6128262839507992e+00 5.9072667161630799e-01 24 -4.3247234229563630e-01 2.8558353857286596e+00 -1.5284257874942948e+00 - 25 1.9422682067556065e+00 -2.8471459149302958e-01 1.5547858160286778e+00 - 26 -1.7355243132931133e+00 -2.6615580136173165e+00 -2.8544328258369955e-01 + 25 1.9422682067556061e+00 -2.8471459149302947e-01 1.5547858160286778e+00 + 26 -1.7355243132931133e+00 -2.6615580136173165e+00 -2.8544328258369961e-01 27 -6.6046529049546032e-01 3.0880567198108069e+00 -1.1428285831811784e+00 28 2.5715778047995865e+00 -9.5077350547568862e-01 1.6962019769146084e+00 - 29 -1.7484754906688658e+00 -2.1330220551799459e+00 -5.7043877074333793e-01 -run_vdwl: 7.24904956330063 -run_coul: 99.911855870525 + 29 -1.7484754906688658e+00 -2.1330220551799459e+00 -5.7043877074333837e-01 +run_vdwl: 8.04558943628112 +run_coul: 100.215621837161 run_stress: ! |2- - 1.7268554752664841e+01 1.7311029436658394e+01 7.4057024614157427e+00 -2.3588244888881453e+00 -1.3227628622475972e+01 -1.2896658593010248e+01 + 2.0456129545317090e+01 2.1511633584982544e+01 9.9821425921767180e+00 -2.3971084012987660e+00 -1.3531454922401075e+01 -1.4734205092861696e+01 run_forces: ! |2 - 1 1.1278716657036829e+00 -2.6258678041342415e-01 1.9538437509672252e-01 - 2 -3.9676823681212982e-02 -1.2850233836949423e+00 -6.6803498770516612e-01 - 3 -9.4760567468241792e+00 9.6957989045886777e+00 6.2944176336550850e+00 - 4 -3.3168171571644096e-02 5.7704850010495169e-03 -1.1426546444723396e-01 - 5 -2.5048894068746391e-01 3.0038236609978475e-01 -3.3751199287618265e-02 - 6 1.0055350163583444e+01 -1.1431044936813379e+01 -7.3653563187915854e+00 - 7 -4.6209803855489368e-03 3.8543231435584174e-01 1.6515226454394019e+00 - 8 -6.5234607389721311e-01 2.0255440893673859e+00 9.5127903951105719e-01 - 9 7.4452791812005681e-01 -2.7066417590171179e+00 8.1503724100149588e-01 - 10 -2.3829098729829035e+01 -2.2599021701791333e+00 -2.6314817812596623e+00 - 11 -4.3274368894391779e-01 4.9145021406791028e-01 -2.4945411427223665e-01 - 12 1.6980364542766559e+01 1.4489682516099752e+01 -9.6372227483708528e+00 - 13 -3.0499236362302704e-02 8.5704383262029168e-03 -8.4575528296466557e-02 - 14 -4.8927749265401771e-01 1.7489541546329301e-01 -5.6958241413008877e-02 - 15 1.7309877483511280e-01 -8.8541792285525320e-02 -4.8073433757675438e-01 - 16 7.7170020069871450e+00 -1.2582802138795630e+01 1.3749590325801609e+01 - 17 -1.1014220836499897e+00 2.9517040521006654e+00 -3.0758280750634763e+00 - 18 -5.3109684989899320e-02 1.9235656396790723e+00 -3.1515066237287179e+00 - 19 9.2467038597949081e-01 -3.0844991584141779e-01 2.4155443336900446e+00 - 20 -1.1282027113852207e+00 -1.5870971471270534e+00 1.5624094409756832e+00 - 21 6.2530066466767331e-01 1.3012413310446329e+00 -2.7547234320822804e+00 - 22 1.8558491629776710e+00 4.4201627758048212e-01 2.3787636307402855e+00 - 23 -2.6209180821234201e+00 -1.6054037314698315e+00 5.5158435669485273e-01 - 24 -5.0167023518445786e-01 2.8919413595177517e+00 -1.5751546389610793e+00 - 25 2.0828183410931089e+00 -2.2433373855840710e-01 1.6879138663646718e+00 - 26 -1.7999157459828961e+00 -2.7490806231475635e+00 -3.5718231595876937e-01 - 27 -7.1445352480310931e-01 3.1361391652740100e+00 -1.1076521775768413e+00 - 28 2.6447579347741770e+00 -9.6083364912278246e-01 1.7125826632673491e+00 - 29 -1.7739426085325893e+00 -2.1723928021003038e+00 -6.2214756744651156e-01 + 1 1.1278439441099926e+00 -2.7654184989381891e-01 1.8890234600678754e-01 + 2 -1.1279459137044581e-02 -1.2710817626395172e+00 -6.6538132044832066e-01 + 3 -1.0341696254354687e+01 1.0607851838287697e+01 6.9339173827891791e+00 + 4 -3.8316844684149136e-02 6.8657251417226645e-03 -1.1254209833942347e-01 + 5 -2.5619910763317022e-01 3.0024059254517593e-01 -3.1133704414474678e-02 + 6 1.0941566374279041e+01 -1.2359521119063869e+01 -8.0388223393001841e+00 + 7 -2.1693378522531462e-02 4.0024661772395109e-01 1.6865077777458173e+00 + 8 -6.8164515432690909e-01 2.0351021086574028e+00 9.7076841416844717e-01 + 9 7.4832444961001310e-01 -2.6768446189678357e+00 7.7344611578733347e-01 + 10 -2.6621991141496402e+01 -2.3851298167858790e+00 -3.1488016887830241e+00 + 11 -4.3450335990225841e-01 4.9347734668790100e-01 -2.5713262313148982e-01 + 12 1.8704099319295494e+01 1.6317736459684507e+01 -1.0831563867887432e+01 + 13 -2.4924083857409924e-02 1.2345058963785915e-02 -8.5997232279262245e-02 + 14 -4.9165208763668156e-01 1.7078253316520831e-01 -6.1549115131241179e-02 + 15 1.6432803488761938e-01 -7.8657986318675821e-02 -4.7093818884765665e-01 + 16 8.7963957647958733e+00 -1.4291753269630572e+01 1.5448567243713468e+01 + 17 -1.0947309258498463e+00 2.9116600724391031e+00 -3.0311520206078693e+00 + 18 1.2176589126451223e-01 2.1021715038498350e+00 -3.2708216926274347e+00 + 19 7.7548329648482928e-01 -4.3071461376929726e-01 2.3549522160883622e+00 + 20 -1.1569211066411751e+00 -1.6446204989304276e+00 1.7455198182307381e+00 + 21 6.0677353978147630e-01 1.3655265573721065e+00 -2.7871848244300339e+00 + 22 1.7688094579385083e+00 3.8785296440440226e-01 2.3787336339786989e+00 + 23 -2.5168289031311870e+00 -1.6115794550191709e+00 5.8646873140180955e-01 + 24 -4.3929448668657883e-01 2.8581360075713982e+00 -1.5326782499979357e+00 + 25 1.9551077161645343e+00 -2.7892693629841941e-01 1.5671751170631401e+00 + 26 -1.7409317259822499e+00 -2.6687278252122200e+00 -2.9215488375330978e-01 + 27 -6.6535612664997257e-01 3.0913880899374520e+00 -1.1386957756241485e+00 + 28 2.5773815333852679e+00 -9.5126890919231843e-01 1.6969249566974134e+00 + 29 -1.7499151755049087e+00 -2.1360148147096250e+00 -5.7533412806795425e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml index 6dd612151..9a1f5fcce 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 1e-13 prerequisites: ! | atom full @@ -61,37 +61,37 @@ init_forces: ! |2 28 6.4035005649493479e+00 -2.1779026033513014e+00 4.1727097093108574e+00 29 -4.5201927345996555e+00 -5.1735150000565087e+00 -1.4886414114327997e+00 run_vdwl: 0 -run_coul: 220.048541377423 +run_coul: 220.863382474572 run_stress: ! |- - -3.2535405916224512e+01 -4.2286526215363089e+01 -3.8162304092021678e+01 -4.1742748647560030e-01 -1.2139227317063249e+01 5.8729501738513443e+00 + -3.1470758245374078e+01 -4.1975168324204809e+01 -3.8436259019780465e+01 8.1785199354007770e-02 -1.1280178602908324e+01 6.4589630165689149e+00 run_forces: ! |2 - 1 2.6131675620626957e+00 -4.8342108816212009e-01 1.7840139015318485e-01 - 2 -2.6939257921550613e-01 -2.8744098401696889e+00 -1.1967928088793305e+00 - 3 1.2241259773574325e-02 -8.6362408992429140e-02 1.1995342559376516e-02 - 4 -7.0078077055623619e-02 1.4087069024816368e-02 -2.4078691820694409e-01 - 5 -5.3142614187760306e-01 6.5625399492829017e-01 -7.2314492758889487e-02 - 6 1.4298780394211723e+00 -3.8679850343094273e+00 -2.4359369048563075e+00 - 7 -2.8086639919708251e-02 8.7464641544273769e-01 3.6888195452226435e+00 - 8 -1.4124236133803434e+00 4.5103519470052440e+00 2.3342939104384985e+00 - 9 1.5527926392812765e+00 -5.9309339716964642e+00 1.4750811061607958e+00 - 10 -2.6235506334999131e-01 3.5757268720932400e-01 -2.3417893643720158e-01 - 11 -9.3594544743035835e-01 1.0583939420604174e+00 -5.4054986589332599e-01 - 12 2.8734741786398170e+00 -5.2369188362701680e-01 1.4455694473537846e+00 - 13 -8.4886198171748181e-02 2.7648979597421929e-02 -1.8007437885365010e-01 - 14 -1.0584925211398808e+00 3.7660569088986723e-01 -9.7983950072822318e-02 - 15 3.6566403882131659e-01 -2.1408431113338988e-01 -1.0347870333586919e+00 - 16 -9.0367294925276953e-01 -4.2277206587351052e-01 2.1071811794978932e+00 - 17 -2.3201086740429728e+00 6.3375946426957102e+00 -6.7748049161424788e+00 - 18 -1.0367602029395590e-01 4.2968689122358867e+00 -7.6416306203848512e+00 - 19 2.4130248299281480e+00 -3.6969491557297141e-01 5.7255889563403839e+00 - 20 -2.8499198414634797e+00 -3.8615423159636864e+00 3.6703562849190474e+00 - 21 1.6073189487148916e+00 3.0641134602207658e+00 -6.7626425202537233e+00 - 22 4.7465898385759111e+00 1.2150390778261659e+00 5.8893287037989293e+00 - 23 -6.6490012091986657e+00 -3.9871903064823808e+00 1.2434840445445134e+00 - 24 -1.2659430276242256e+00 6.9952346907092071e+00 -3.8287648620264005e+00 - 25 5.4119756491924846e+00 -3.6931027143530271e-01 4.3221506404676067e+00 - 26 -4.6115283404180980e+00 -6.7996002056086891e+00 -1.0144979626160757e+00 - 27 -1.6939302030776722e+00 7.5603906120245083e+00 -2.6741556990278545e+00 - 28 6.6722795781933559e+00 -2.2264201542857061e+00 4.2717904189750353e+00 - 29 -4.6475400156920399e+00 -5.3273833485575768e+00 -1.6341391006631409e+00 + 1 2.6126701380156825e+00 -5.1384213438003423e-01 1.8262650746948519e-01 + 2 -2.0234020342060893e-01 -2.8461416881860266e+00 -1.2059145100860869e+00 + 3 1.3418167775538925e-02 -8.4298158546130986e-02 1.3663059895056973e-02 + 4 -7.8373018931196997e-02 1.6197872393034461e-02 -2.3716907933027048e-01 + 5 -5.4542144637052392e-01 6.5615734783718471e-01 -6.9295288216445580e-02 + 6 1.4628983998616958e+00 -3.8942457566204158e+00 -2.5320632462911150e+00 + 7 -6.5024864509100985e-02 8.8941438280952534e-01 3.7937992925620718e+00 + 8 -1.4863231667476109e+00 4.5523483915116456e+00 2.3547492635664589e+00 + 9 1.5601518871887179e+00 -5.8628489542625442e+00 1.3784256661381713e+00 + 10 -2.6137062368279806e-01 3.6429093202906582e-01 -2.2799236582829233e-01 + 11 -9.3740811993808426e-01 1.0566239757878046e+00 -5.5607349742844847e-01 + 12 2.8815457611865893e+00 -5.4026790849189221e-01 1.4400566889262820e+00 + 13 -7.6643349207281705e-02 3.7584408189430971e-02 -1.8322358960584995e-01 + 14 -1.0560948563480665e+00 3.6837286979344552e-01 -1.0627068019328174e-01 + 15 3.5328486858453939e-01 -1.9374536039764703e-01 -1.0174837001118207e+00 + 16 -9.0605651819426014e-01 -4.1048346820875181e-01 2.0876810048407144e+00 + 17 -2.2835062474836745e+00 6.2153340922364215e+00 -6.6717045655354719e+00 + 18 3.2181053695750833e-01 4.7437898128563498e+00 -7.8653678393314879e+00 + 19 2.0288502629648786e+00 -6.9155256508836294e-01 5.5492940706580418e+00 + 20 -2.8992028172906519e+00 -3.9809839579754458e+00 4.0844285463451264e+00 + 21 1.5321739805397558e+00 3.1881591374881828e+00 -6.7564009349621053e+00 + 22 4.4874080875262727e+00 1.0722304592248977e+00 5.8247475765354597e+00 + 23 -6.3193938935096501e+00 -3.9592286478482368e+00 1.3095755182280862e+00 + 24 -1.0991317979628923e+00 6.8191013126473603e+00 -3.6792343035816821e+00 + 25 5.0094911880584965e+00 -5.0907777830310241e-01 3.9588363971551268e+00 + 26 -4.3929251741105517e+00 -6.5024209581188135e+00 -8.3283426066550503e-01 + 27 -1.5490455383414639e+00 7.3707638642939921e+00 -2.7118324923965882e+00 + 28 6.4196358126420474e+00 -2.1793899391197633e+00 4.1759735329668368e+00 + 29 -4.5250774552533084e+00 -5.1818415835511704e+00 -1.5009967717224653e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-ufm.yaml b/unittest/force-styles/tests/mol-pair-ufm.yaml index 921cb38b8..494f1cb5b 100644 --- a/unittest/force-styles/tests/mol-pair-ufm.yaml +++ b/unittest/force-styles/tests/mol-pair-ufm.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Mon Aug 3 07:56:59 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -56,38 +56,38 @@ init_forces: ! |2 27 1.6145714500530384e-01 -1.1022323446883984e+00 3.9068430664596004e-01 28 -8.1023255837556163e-01 3.4809165087801702e-01 -5.4818142230389000e-01 29 6.4875279039251865e-01 7.5412850363458084e-01 1.5750233339920508e-01 -run_vdwl: 15.8616853432207 +run_vdwl: 15.9412052324003 run_coul: 0 run_stress: ! |2- - 1.9704622560525500e+01 1.9754158723084281e+01 2.6918293581501548e+01 -5.9193995790449732e+00 2.5978531689912998e+00 -6.8056943099087752e-01 + 1.9733523957315395e+01 1.9830296762262655e+01 2.7150737657801326e+01 -6.0174818337155500e+00 2.5979696973782067e+00 -8.0135796716948637e-01 run_forces: ! |2 - 1 4.6903795102238893e-01 3.4471790043074155e+00 2.2640326341430215e+00 - 2 7.6427680253286634e-01 6.4702697653716934e-01 -8.6215350378922051e-01 - 3 -1.8902490585622824e+00 -2.1559409924348119e+00 -6.9086875111459189e-01 - 4 -4.7430793207488930e-01 6.2813433399308227e-02 -3.5076010872032221e-01 - 5 -1.9879364631586235e-01 -3.8501258616973499e-01 6.1824037742347249e-01 - 6 -2.5716612036374440e+00 2.4177563896101719e+00 1.0062676333138174e+00 - 7 -1.3347634312538770e+00 -1.4511347465531174e-01 -6.9675921787319837e+00 - 8 -7.1498788348429509e-01 1.5391724346667593e-01 4.4685151545430370e+00 - 9 2.9615072254263686e-01 3.3708016766855387e-01 1.3713681175110519e+00 - 10 1.6655332876219688e+00 -3.0788062316905531e+00 -1.3504181585572872e+00 - 11 -1.0306905364905536e-01 -3.3356589147782040e-01 -4.8759025549290741e-01 - 12 2.5169000137107895e+00 6.4582882727212410e-01 -1.1056167824067793e+00 - 13 4.7054556829988514e-01 -1.7465871278068992e-01 -8.8125330381007318e-03 - 14 -1.7032572507595736e-01 3.5259835099716995e-02 -4.8334906008812817e-01 - 15 4.2767520433916968e-02 5.2350958298539818e-01 1.6209825101785580e-01 - 16 2.1143962306578636e+00 -2.1840227122816378e+00 -2.4240301278985545e+00 - 17 -8.9533735300142869e-01 1.6722226177508540e-01 4.8470364684175822e+00 - 18 1.2261297596017708e-02 1.9073134618042799e-02 -8.6622912414690278e-03 - 19 -9.2155271780368733e-05 -7.6243732200517104e-05 -3.8917607684509680e-05 - 20 8.7189700241686489e-05 7.8281328511723715e-05 9.4703340946688672e-06 - 21 -3.1869976742612299e-01 -3.5843123331627225e-01 1.1070634590860970e+00 - 22 -5.5867106087024820e-01 -1.4541411463906775e-01 -8.4593741645822229e-01 - 23 8.7738409629915826e-01 5.0382698964562944e-01 -2.6114213167044648e-01 - 24 2.6498504176502491e-01 -1.0258227472014936e+00 6.0360128434208293e-01 - 25 -8.0774237261472659e-01 1.1152388846740779e-01 -6.8104225005845753e-01 - 26 5.4439728655438058e-01 9.1478096833295830e-01 7.9776496092276342e-02 - 27 1.7993245937868463e-01 -1.1162011028189709e+00 3.7656761514775627e-01 - 28 -8.3013122622639413e-01 3.5173620238034337e-01 -5.5033868810132658e-01 - 29 6.5017640134854016e-01 7.6445285630405291e-01 1.7377619360333854e-01 + 1 4.5658218306419890e-01 3.4786841558075059e+00 2.2910196440198360e+00 + 2 7.6344278949952815e-01 6.3679683221806327e-01 -8.8774774699202441e-01 + 3 -1.8711894077288016e+00 -2.1649732292470762e+00 -6.8334005835437306e-01 + 4 -4.8902443375527560e-01 6.5530424546390798e-02 -3.5466057807047885e-01 + 5 -2.0088409393936635e-01 -3.8919298780938122e-01 6.2475952528845047e-01 + 6 -2.6229262262265678e+00 2.4331540244103600e+00 1.0350290471883823e+00 + 7 -1.3548544037556671e+00 -1.2922688678209870e-01 -7.0916055463092187e+00 + 8 -6.4771915121645030e-01 1.1149124793613344e-01 4.5390521035815947e+00 + 9 2.9514471586617724e-01 3.4855081393643911e-01 1.3795909106960154e+00 + 10 1.6410990702692774e+00 -3.0593219456908085e+00 -1.3368022117414391e+00 + 11 -1.0708756874354178e-01 -3.4833114795230929e-01 -5.0948853518011605e-01 + 12 2.5468844205875123e+00 6.5750281080203177e-01 -1.0885696766401811e+00 + 13 4.7565592223283537e-01 -1.8471934496167394e-01 -1.0090700411202599e-02 + 14 -1.7545513966125945e-01 4.2662510332093687e-02 -5.0094079011637893e-01 + 15 4.5113416731606300e-02 5.1911864394440665e-01 1.5498262916252087e-01 + 16 2.1314253923200939e+00 -2.1866568773709258e+00 -2.4091813593876648e+00 + 17 -8.9994657867325423e-01 1.4960548305682386e-01 4.8542956856524393e+00 + 18 1.2120537883908381e-02 1.8863492235979964e-02 -8.5693133349231121e-03 + 19 -1.2872057359581538e-04 -1.0707463332994037e-04 -4.6583575427746445e-05 + 20 1.3512284083101226e-04 1.2022426267032834e-04 1.4110730822532208e-05 + 21 -3.1088203549147747e-01 -3.7686734830266871e-01 1.1107046019533251e+00 + 22 -5.4083772391789320e-01 -1.3209806312782557e-01 -8.4527103914848134e-01 + 23 8.5173266334864417e-01 5.0894778384085559e-01 -2.6544926470067137e-01 + 24 2.4134882693229798e-01 -1.0053967567360456e+00 5.8542781502441610e-01 + 25 -7.6647286766567213e-01 1.2157846322697134e-01 -6.4446828421527236e-01 + 26 5.2674588355268426e-01 8.8429692556900008e-01 6.1350407261560255e-02 + 27 1.6330526063052253e-01 -1.1038977643449348e+00 3.8939205523675491e-01 + 28 -8.1242080328061084e-01 3.4853111332341019e-01 -5.4854956310988301e-01 + 29 6.4909294886931534e-01 7.5535447750994145e-01 1.5916271549161906e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-yukawa.yaml b/unittest/force-styles/tests/mol-pair-yukawa.yaml index bbb754afa..209afc79b 100644 --- a/unittest/force-styles/tests/mol-pair-yukawa.yaml +++ b/unittest/force-styles/tests/mol-pair-yukawa.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 18:01:12 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -52,38 +52,38 @@ init_forces: ! |2 27 9.4797146110160047e-02 -6.8646247310384589e-01 2.4639304651374588e-01 28 -5.1616210292097298e-01 2.1221625027252755e-01 -3.4651058440874610e-01 29 4.1219979792460537e-01 4.6817817771676995e-01 1.0395196284048441e-01 -run_vdwl: 12.0568557171451 +run_vdwl: 12.1106731762831 run_coul: 0 run_stress: ! |2- - 1.5330000071826197e+01 1.5239894051288136e+01 1.9897262789051808e+01 -4.7587838511570570e+00 1.3293139763213948e+00 -3.6500487827547595e-01 + 1.5341399191544641e+01 1.5284077161484550e+01 2.0071770286124949e+01 -4.8293824290737088e+00 1.3289380906389465e+00 -4.4772561803272076e-01 run_forces: ! |2 - 1 2.4975440071812444e-01 2.4792701761727871e+00 1.4325644398779867e+00 - 2 4.3722176194250578e-01 4.2270920801895068e-01 -4.7047803648254372e-01 - 3 -1.3217795113851245e+00 -1.3237236534495787e+00 -3.7619349309100752e-01 - 4 -3.3441758497253044e-01 2.1746063589894216e-02 -2.3341724720843662e-01 - 5 -1.7902515320967879e-01 -2.3570567001146420e-01 4.0022831379592089e-01 - 6 -2.1131663779213752e+00 1.8738175513340289e+00 1.2185758983803003e+00 - 7 -1.0832597573629019e+00 -3.1214009378381086e-01 -5.1703647184513262e+00 - 8 -4.5689695827862370e-01 7.2729060242302149e-02 2.7897946190178557e+00 - 9 1.5181644796517385e-01 2.1252275080244398e-01 8.8106700117376502e-01 - 10 1.3826246193191662e+00 -2.2989979235807922e+00 -8.2945828121334308e-01 - 11 -8.4017809589640072e-02 -2.8842393883530787e-01 -3.3758871339567337e-01 - 12 1.8849845925556798e+00 4.0051218037170749e-01 -6.6606866421666999e-01 - 13 3.2520800533491434e-01 -8.1065392330917391e-02 -2.7689170375300241e-02 - 14 -1.7055234529525065e-02 4.3269029062384674e-02 -3.8697701850574379e-01 - 15 1.7869578995751320e-01 3.8596685663725833e-01 5.7300850943067409e-02 - 16 1.5804080557913573e+00 -1.6610668419278056e+00 -2.0542271263536747e+00 - 17 -7.3877483193751703e-01 1.4523777955675660e-01 3.8371392727298597e+00 - 18 8.9747195983243683e-02 1.4449283346224664e-01 -9.6968621917516526e-02 - 19 -1.3253521272585549e-02 -8.3094669208279397e-03 -1.3050917979350433e-02 - 20 1.4949572105708266e-02 1.4324580084895622e-02 -1.4930986692723782e-03 - 21 -1.8461121263224514e-01 -2.4356169781155593e-01 6.6889447440320360e-01 - 22 -3.5912054426479384e-01 -9.6623282650012576e-02 -5.3028367804642962e-01 - 23 5.6011812529580063e-01 3.1907494235924094e-01 -1.5756674673910209e-01 - 24 1.9136147522334027e-01 -6.2910044529930087e-01 4.1784800880923728e-01 - 25 -5.0574657365861708e-01 6.9048712650996977e-02 -4.1281223901052716e-01 - 26 3.5337381289277175e-01 5.8004107025814688e-01 5.7416816758216777e-02 - 27 1.0755942410536246e-01 -6.9796191232134375e-01 2.3910802875620396e-01 - 28 -5.3147795503156714e-01 2.1552315291984012e-01 -3.4983801773915779e-01 - 29 4.1477974685606378e-01 4.7639437139883750e-01 1.1453806474945682e-01 + 1 2.3990428496530675e-01 2.4962673602651551e+00 1.4471254854634277e+00 + 2 4.3741441158281585e-01 4.1949111511687709e-01 -4.8511797201544454e-01 + 3 -1.3120834243754111e+00 -1.3278434292946755e+00 -3.7028400967801967e-01 + 4 -3.4258433063701094e-01 2.2806655422113242e-02 -2.3532754279844456e-01 + 5 -1.8004137927103023e-01 -2.3736697970614465e-01 4.0366304246099249e-01 + 6 -2.1595301277630266e+00 1.8964542996682365e+00 1.2671995566090462e+00 + 7 -1.0929881829412107e+00 -3.0700203853448182e-01 -5.2854131121496586e+00 + 8 -3.9516875217341030e-01 3.5641416123221609e-02 2.8352547987927066e+00 + 9 1.5348070660830757e-01 2.1805456839624637e-01 8.8711002493998015e-01 + 10 1.3617865980825534e+00 -2.2832794212919345e+00 -8.2009242125035819e-01 + 11 -8.6230851147092308e-02 -2.9685756575867833e-01 -3.4957332405235692e-01 + 12 1.9028452453693832e+00 4.0753075730128602e-01 -6.5717469292387998e-01 + 13 3.2974826379686534e-01 -8.6052139281362919e-02 -2.9396128718666710e-02 + 14 -1.7604160183109719e-02 4.7658716478541890e-02 -3.9728606633636421e-01 + 15 1.7515735018262865e-01 3.8102680685067197e-01 5.4706777076264784e-02 + 16 1.5895672352060144e+00 -1.6598858314195963e+00 -2.0387171855884594e+00 + 17 -7.4082686726195213e-01 1.3023633534737625e-01 3.8365547392751798e+00 + 18 8.8848848606426487e-02 1.4342148016761838e-01 -9.6108817763167848e-02 + 19 -1.4131068045422883e-02 -8.9846726542200904e-03 -1.3159448571200610e-02 + 20 1.6271449594289743e-02 1.5425671434382067e-02 -1.5376586468238450e-03 + 21 -1.7830318015525881e-01 -2.5348904678993889e-01 6.6838707151096455e-01 + 22 -3.4694803406242730e-01 -8.8231293599025054e-02 -5.2801418258629995e-01 + 23 5.4154278231779074e-01 3.2079939845419797e-01 -1.5924976863527920e-01 + 24 1.7322574112078132e-01 -6.1003765994548520e-01 4.0130373522386309e-01 + 25 -4.7300600750253985e-01 7.4983608306114904e-02 -3.8384148652984351e-01 + 26 3.3881573705040829e-01 5.5529734663709185e-01 4.5156802638362969e-02 + 27 9.6061123816099214e-02 -6.8774612875962648e-01 2.4572975132901353e-01 + 28 -5.1778242193798241e-01 2.1258370164472984e-01 -3.4691901133304465e-01 + 29 4.1255900915721433e-01 4.6909696942130824e-01 1.0502104425751069e-01 ... diff --git a/unittest/force-styles/tests/mol-pair-zbl.yaml b/unittest/force-styles/tests/mol-pair-zbl.yaml index 8aca11425..465ae3059 100644 --- a/unittest/force-styles/tests/mol-pair-zbl.yaml +++ b/unittest/force-styles/tests/mol-pair-zbl.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 21 Jul 2020 -date_generated: Sat Aug 1 14:40:56 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:20 202 epsilon: 1e-12 prerequisites: ! | atom full @@ -51,38 +51,38 @@ init_forces: ! |2 27 2.8071648439996488e+02 -1.7944615572570910e+03 6.4638439317319535e+02 28 -1.4822931703357754e+03 5.2788334997428888e+02 -9.7294220179957915e+02 29 1.1993303417258362e+03 1.2647795624653104e+03 3.2787996069407274e+02 -run_vdwl: 1597.67938098158 +run_vdwl: 7354.46773228783 run_coul: 0 run_stress: ! |2- - 2.2131788132852066e+03 2.2584320728186476e+03 2.7465571540710180e+03 -2.8644772512795839e+02 -1.8548106098712325e-01 3.1461651502100391e+01 + 1.0013885258522969e+04 7.4142306464809189e+03 1.0129116432148794e+04 2.4013899531618986e+03 2.8619465741008166e+03 3.1548199080913969e+02 run_forces: ! |2 - 1 -3.3397827266233826e+01 9.2719545607910007e+01 1.2564487829192640e+02 - 2 7.2935903882937254e+01 9.6314224427719935e+01 -7.3446962912029434e+01 - 3 -1.3017211282527197e+02 8.2009932327349446e+01 2.3509558716835954e+01 - 4 -1.1360941255175152e+02 2.5171965717762198e+01 -6.6147621394233397e+01 - 5 -5.2699653220814930e+01 -3.7263837943923370e+01 1.1724677805654935e+02 - 6 -1.8145530220345751e+01 -9.4294775999163303e+00 8.0828014072607658e+01 - 7 -4.4188635874992706e+01 -5.4261241330323671e+01 -3.3346599907912366e+02 - 8 -2.7183677992414690e+01 -2.3268547683291182e+01 3.7324606242905666e+01 - 9 1.0606951289675619e+01 7.4914137900025480e+01 1.6151489059667983e+02 - 10 -8.4154190777535746e+01 -1.4037604345380635e+02 2.3135227572074236e+01 - 11 -4.0298192926874684e+01 -1.0434794609504070e+02 -9.0083998147218509e+01 - 12 1.3937116170542836e+02 9.4226613013197877e+01 -7.8644408408283610e+01 - 13 1.3213694350083796e+02 -3.3906965043667526e+01 -8.0092372719519851e+00 - 14 1.6151643690612822e+01 2.1088000961637619e+01 -1.3705543456388733e+02 - 15 3.3570667553727567e+01 1.2909477821460365e+02 3.6360533691970794e+01 - 16 2.0156880902174672e+02 -2.5009607151098638e+02 -1.0889674623429238e+02 - 17 -7.5809448797016898e+01 1.9040931443108217e+01 2.9609170051581680e+02 - 18 8.4136814114318614e+00 -7.1697152333493825e+00 6.7566829269964614e+01 - 19 -4.3086952586539617e+01 -2.1527634266490139e+01 -6.1527721947855987e+01 - 20 4.1990309443939729e+01 4.5473990311662398e+01 -3.0042800660705627e+01 - 21 -1.8052080726424052e+01 -2.8549862755166224e+01 7.5406885748417210e+01 - 22 -3.5594417055460326e+01 -9.5139205858225218e+00 -5.9814008330995456e+01 - 23 5.7725140267424919e+01 3.2145578672846270e+01 -2.0354406160061416e+01 - 24 2.1766991303226565e+01 -7.0004990850740526e+01 4.5951723753706908e+01 - 25 -4.9101066522934538e+01 2.0527583186968833e+01 -2.9978487509696063e+01 - 26 3.4338908953712291e+01 6.0717750996678035e+01 3.5720436041120567e+00 - 27 8.0099050107556398e+00 -7.9876654894156658e+01 2.5402516730363104e+01 - 28 -5.2671989874270409e+01 2.4309289636209993e+01 -3.5589881297164752e+01 - 29 3.9578172183424321e+01 5.1838586829000988e+01 1.3501527053568978e+01 + 1 -2.1964026841032555e+02 -4.7234074031128642e+01 3.9447605671260231e+02 + 2 3.3823489174046506e+02 3.3060495237876921e+02 -3.4909048370845267e+02 + 3 6.4685417372011796e+02 3.4155202880193968e+01 -3.4174114126656468e+02 + 4 -7.8636608717163301e+02 2.1116526508162781e+02 -5.7402049394393225e+02 + 5 -2.0592641259710490e+02 -3.1948415325376283e+02 1.0031850248504331e+03 + 6 -8.1882893400670710e+01 1.2476197042773522e+02 4.3622252572363595e+02 + 7 -3.5213767307761508e+01 -1.2723175258439858e+02 -7.4725473313603186e+02 + 8 -1.3797315181953186e+02 -1.0667979260487471e+02 -3.4719880941196129e+02 + 9 9.3159158688188953e+01 1.9852861539466952e+02 6.7969874493271277e+02 + 10 7.4695004039795307e+01 1.9549958922326650e+02 6.3962695471886514e+02 + 11 -2.6505553984641926e+02 -6.1810315751406802e+02 -7.8981179237467131e+02 + 12 -2.2346838083276788e+02 -3.6199049551848668e+02 4.0605240658339346e+02 + 13 9.5587584380171472e+02 -3.7492941562796443e+02 4.0805962837945048e-01 + 14 -3.1069707611253369e+02 9.5117789303193206e+01 -1.0209392058202187e+03 + 15 2.3071061809145419e+01 9.7760385712320067e+02 3.7462314574853553e+02 + 16 3.2004032451991884e+02 -3.2579940900810800e+02 -3.9361728625224595e+02 + 17 -1.9645819266557575e+02 1.0114769018445848e+02 6.4130619645861555e+02 + 18 -9.0902384665251375e+01 -4.5650524026929924e+02 1.6740149613103997e+03 + 19 -9.7189381502626054e+02 -6.4245968864884060e+02 -1.0761175420746144e+03 + 20 1.0683318533033168e+03 1.1147497688890060e+03 -6.1516206221046548e+02 + 21 -4.7823778180174588e+02 -5.8003797951613853e+02 1.6903621008493662e+03 + 22 -9.6233115523949709e+02 -2.6660425100288847e+02 -1.3469332514089249e+03 + 23 1.4443299243683423e+03 8.4139011025108914e+02 -3.4761086309865806e+02 + 24 3.5961549568150497e+02 -1.5399143881018006e+03 8.8843768689705325e+02 + 25 -1.2856259401506550e+03 1.1768761084036100e+02 -1.0419848986287443e+03 + 26 9.2973303483051620e+02 1.4263752465428192e+03 1.6173146504057354e+02 + 27 2.6192087563564087e+02 -1.6858700886083643e+03 6.0207113463710118e+02 + 28 -1.3836989194119137e+03 4.9654891848146218e+02 -9.0784312494212747e+02 + 29 1.1195101243209804e+03 1.1875072992882710e+03 3.0710922418594498e+02 ... diff --git a/unittest/force-styles/tests/mol-pair-zero.yaml b/unittest/force-styles/tests/mol-pair-zero.yaml index a0e95e668..d243cab95 100644 --- a/unittest/force-styles/tests/mol-pair-zero.yaml +++ b/unittest/force-styles/tests/mol-pair-zero.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 09:44:21 202 epsilon: 1e-14 prerequisites: ! | atom full -- GitLab From 238730b13dd819ebad57f417677d7f6d1753eb09 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 09:55:58 -0400 Subject: [PATCH 44/52] update epsilon --- unittest/force-styles/tests/atomic-pair-momb.yaml | 2 +- unittest/force-styles/tests/mol-pair-coul_slater_long.yaml | 2 +- unittest/force-styles/tests/mol-pair-lj_cubic.yaml | 2 +- unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unittest/force-styles/tests/atomic-pair-momb.yaml b/unittest/force-styles/tests/atomic-pair-momb.yaml index 00ae66c4e..525198b07 100644 --- a/unittest/force-styles/tests/atomic-pair-momb.yaml +++ b/unittest/force-styles/tests/atomic-pair-momb.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:23 202 -epsilon: 7.5e-13 +epsilon: 2.5e-12 prerequisites: ! | pair momb pre_commands: ! "" diff --git a/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml b/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml index 0b4d27d72..9000f80d0 100644 --- a/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml +++ b/unittest/force-styles/tests/mol-pair-coul_slater_long.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:13 202 -epsilon: 1e-13 +epsilon: 2e-13 prerequisites: ! | atom full pair coul/slater/long diff --git a/unittest/force-styles/tests/mol-pair-lj_cubic.yaml b/unittest/force-styles/tests/mol-pair-lj_cubic.yaml index 8faf4790e..ad7f0666c 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cubic.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cubic.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:15 202 -epsilon: 5e-14 +epsilon: 2e-13 prerequisites: ! | atom full pair lj/cubic diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml index d3039c6bc..bfd5a20a3 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:15 202 -epsilon: 5e-14 +epsilon: 2e-13 prerequisites: ! | atom full pair lj/cut/coul/cut/soft -- GitLab From 27941088370236fa0e88baf48d29021168983c3c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 10:12:07 -0400 Subject: [PATCH 45/52] don't update per-atom pair data if not available --- src/USER-OMP/thr_omp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index 6e096defa..a31a56893 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -485,7 +485,7 @@ void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j, } } } - if (pair->eflag_atom) { + if (pair->eflag_atom && thr->eatom_pair) { const double epairhalf = 0.5 * (evdwl + ecoul); if (newton_pair || i < nlocal) thr->eatom_pair[i] += epairhalf; if (newton_pair || j < nlocal) thr->eatom_pair[j] += epairhalf; -- GitLab From e30864431f484409822d92f373e12df22786a3d5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 10:12:18 -0400 Subject: [PATCH 46/52] add test for missing quartic bond style --- unittest/force-styles/tests/bond-quartic.yaml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 unittest/force-styles/tests/bond-quartic.yaml diff --git a/unittest/force-styles/tests/bond-quartic.yaml b/unittest/force-styles/tests/bond-quartic.yaml new file mode 100644 index 000000000..b7248b64c --- /dev/null +++ b/unittest/force-styles/tests/bond-quartic.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 24 Aug 2020 +date_generated: Tue Sep 15 10:06:36 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + bond quartic +pre_commands: ! | + variable bond_factor index 1.0 + variable angle_factor index 1.0 + variable dihedral_factor index 1.0 +post_commands: ! | + angle_style none + dihedral_style none + improper_style none +input_file: in.fourmol +bond_style: quartic +bond_coeff: ! | + 1 250.0 -1.5 2.5 4.5 200.0 + 2 300.0 -1.1 1.5 3.0 150.0 + 3 350.0 -1.3 2.0 4.0 180.0 + 4 650.0 -1.2 1.8 3.5 150.0 + 5 450.0 -1.0 1.5 2.5 100.0 +equilibrium: 5 0.97 0.97 0.97 0.97 0.97 +extract: ! "" +natoms: 29 +init_energy: 167209.410281733 +init_stress: ! |2- + 1.1753456675032635e+05 1.3835980307256946e+05 1.5724445231627452e+05 -2.7936859754795376e+04 -1.2046754178952258e+03 5.6387492312733202e+03 +init_forces: ! |2 + 1 4.6956800875874014e+03 2.0472937717827292e+04 1.2027201754709746e+04 + 2 3.0590716273302569e+03 2.5173798188200635e+03 -3.6004401360962788e+03 + 3 -1.6916885277131136e+04 -5.4050553961881196e+03 -4.3567875766137786e+02 + 4 -5.9725149513863216e+03 1.6743328672755986e+03 -4.2376525995450702e+03 + 5 -1.4385482132256664e+03 -2.2106594103463872e+03 7.3454120851860725e+03 + 6 -4.2023167708453129e+03 5.0828004370465569e+03 5.8117109557187723e+03 + 7 1.1952999972582454e+03 -6.1310578303676666e+03 -3.0587812075188107e+04 + 8 1.9679779752279865e+02 2.7879224826067621e+03 1.4504728844847421e+04 + 9 1.2103943033067626e+03 1.3036689261379081e+03 5.3564142408040225e+03 + 10 -9.7348400193182970e+03 -1.6265583628171433e+04 -5.5677991993594978e+03 + 11 -1.5813949025857787e+03 -3.9172551529699554e+03 -6.4274265849373469e+03 + 12 1.4188864641728289e+04 1.2538822046344654e+04 -7.4505608846138512e+03 + 13 6.8609402930169372e+03 -2.7141171165864444e+03 -1.2895185675735570e+02 + 14 -2.6785581646522701e+03 5.4505107084386884e+02 -6.9463641203219941e+03 + 15 -1.8171180777173680e+02 6.9822084024631531e+03 2.4882118329749433e+03 + 16 2.1619461388304608e+04 -2.4457937014757008e+04 -9.5295830144483989e+03 + 17 -1.0319740029138784e+04 7.1965417800211544e+03 2.7378589514688298e+04 + 18 -3.1050863589525034e+02 -1.6517613457596451e+03 6.0850536393413622e+03 + 19 -3.1154051279309001e+03 -1.9930673120892022e+03 -3.7742216993999405e+03 + 20 3.4259137638261504e+03 3.6448286578488473e+03 -2.3108319399414218e+03 + 21 -1.6723965541556663e+03 -2.0482599213174267e+03 6.0183836362132142e+03 + 22 -2.9188583957407518e+03 -7.0735770858124772e+02 -4.5793635421738209e+03 + 23 4.5912549498964181e+03 2.7556176298986743e+03 -1.4390200940393936e+03 + 24 1.2946658701734100e+03 -5.4295062107657122e+03 3.1531473798518000e+03 + 25 -4.1322655499375960e+03 6.6523487455228360e+02 -3.4739180857782485e+03 + 26 2.8375996797641860e+03 4.7642713362134282e+03 3.2077070592644861e+02 + 27 8.5984161170060497e+02 -5.9701302410694389e+03 2.1078126071300521e+03 + 28 -4.3769632510310885e+03 1.8810190502032892e+03 -2.9614958067113644e+03 + 29 3.5171216393304835e+03 4.0891111908661501e+03 8.5368319958131212e+02 +run_energy: 149949.975299821 +run_stress: ! |2- + 1.1559313036629684e+05 1.3470803777015215e+05 1.4770452427692583e+05 -3.0214612515800167e+04 -2.7173569285153673e+02 8.0043369128736695e+03 +run_forces: ! |2 + 1 4.7682104861259668e+03 1.8427723033194783e+04 1.1083641344952379e+04 + 2 2.7783081773688250e+03 2.1087569715116256e+03 -3.4537269346053713e+03 + 3 -1.8194539283847658e+04 -3.7132599381541695e+03 6.2369348207960411e+02 + 4 -5.5497559186230656e+03 1.7238999629937771e+03 -4.1577878764594188e+03 + 5 -1.0214642630268183e+03 -1.9429788743811871e+03 6.7520829112388255e+03 + 6 -3.0886338007542909e+03 4.5775499085445681e+03 2.7425666722962706e+03 + 7 1.2921721683524154e+03 -5.6887288787494417e+03 -2.7115466580890934e+04 + 8 1.2890225879697864e+03 3.1511008849614773e+03 1.5164957973292663e+04 + 9 1.2132513506773985e+03 1.2684475127408166e+03 5.1927198743923145e+03 + 10 -1.0424892073804695e+04 -1.5987818126899887e+04 -6.5805580986338045e+03 + 11 -1.3911717639191986e+03 -3.5972200277226557e+03 -6.2870353769532876e+03 + 12 1.3260239907977559e+04 1.2008002692820337e+04 -6.6052219140757106e+03 + 13 6.2995194294025350e+03 -2.7799467490051547e+03 7.3944189407332561e-01 + 14 -2.6608809191035825e+03 2.8477572309444338e+02 -6.1907610923999418e+03 + 15 -4.2371521440525009e+02 6.4499546262559861e+03 2.5100909760900568e+03 + 16 2.1205976504828723e+04 -2.3306695328546717e+04 -5.9734905929702272e+03 + 17 -9.3516473752186484e+03 7.0164366073413985e+03 2.2293555790752507e+04 + 18 -2.3887993732500081e+02 -1.4370973904564300e+03 5.4201112335319158e+03 + 19 -2.7384504871997729e+03 -1.7434583829002743e+03 -3.3672857568789314e+03 + 20 2.9773304245247737e+03 3.1805557733567043e+03 -2.0528254766529849e+03 + 21 -1.4892855408773066e+03 -1.8140806853237350e+03 5.3649682558757886e+03 + 22 -2.5417852610112091e+03 -6.0509619122406104e+02 -4.0552251198254353e+03 + 23 4.0310708018885157e+03 2.4191768765477959e+03 -1.3097431360503535e+03 + 24 1.1745542254038287e+03 -4.8514444047893039e+03 2.8271146283486160e+03 + 25 -3.6462266476494815e+03 6.2805959085837810e+02 -3.0855482194001679e+03 + 26 2.4716724222456528e+03 4.2233848139309257e+03 2.5843359105155213e+02 + 27 7.6376965408212982e+02 -5.3381664719150931e+03 1.8690167349256878e+03 + 28 -3.8336892869940743e+03 1.6996889288400032e+03 -2.6036191702020892e+03 + 29 3.0699196329119445e+03 3.6384775430750897e+03 7.3460243527640137e+02 +... -- GitLab From 2f3c73217b0a78e23f843a984cbb6f67d02f8993 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 10:50:44 -0400 Subject: [PATCH 47/52] detect if dt has been changed from default and print warning if reset by units command --- src/USER-EFF/pair_eff_cut.cpp | 2 +- src/USER-SMD/fix_smd_adjust_dt.cpp | 1 + src/fix_dt_reset.cpp | 1 + src/input.cpp | 1 + src/update.cpp | 29 ++++++++++++++++++++++------- src/update.h | 1 + 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index f4e7af658..72281c4a5 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -869,7 +869,7 @@ void PairEffCut::init_style() // make sure to use the appropriate timestep when using real units if (update->whichflag == 1) { - if (force->qqr2e == 332.06371 && update->dt == 1.0) + if (utils::strmatch(update->unit_style,"^real") && update->dt_default) error->all(FLERR,"Must lower the default real units timestep for pEFF "); } diff --git a/src/USER-SMD/fix_smd_adjust_dt.cpp b/src/USER-SMD/fix_smd_adjust_dt.cpp index b5dab3d3a..2acf6bd3e 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.cpp +++ b/src/USER-SMD/fix_smd_adjust_dt.cpp @@ -186,6 +186,7 @@ void FixSMDTlsphDtReset::end_of_step() { update->dt = dt; + update->dt_default = 0; if (force->pair) force->pair->reset_dt(); for (int i = 0; i < modify->nfix; i++) diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index 360f0d299..4a9465e69 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -190,6 +190,7 @@ void FixDtReset::end_of_step() update->update_time(); update->dt = dt; + update->dt_default = 0; if (respaflag) update->integrate->reset_dt(); if (force->pair) force->pair->reset_dt(); for (int i = 0; i < modify->nfix; i++) modify->fix[i]->reset_dt(); diff --git a/src/input.cpp b/src/input.cpp index 6456f6c22..3a136cd44 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1871,6 +1871,7 @@ void Input::timestep() { if (narg != 1) error->all(FLERR,"Illegal timestep command"); update->dt = utils::numeric(FLERR,arg[0],false,lmp); + update->dt_default = 0; } /* ---------------------------------------------------------------------- */ diff --git a/src/update.cpp b/src/update.cpp index 399584473..d591e0513 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -12,18 +12,22 @@ ------------------------------------------------------------------------- */ #include "update.h" -#include -#include "integrate.h" -#include "min.h" + #include "style_integrate.h" // IWYU pragma: keep #include "style_minimize.h" // IWYU pragma: keep -#include "neighbor.h" + +#include "comm.h" +#include "compute.h" +#include "integrate.h" +#include "error.h" +#include "fix.h" #include "force.h" +#include "min.h" #include "modify.h" -#include "fix.h" -#include "compute.h" +#include "neighbor.h" #include "output.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -48,6 +52,7 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) eflag_global = vflag_global = -1; + dt_default = 1; unit_style = NULL; set_units("lj"); @@ -121,6 +126,8 @@ void Update::set_units(const char *style) // http://physics.nist.gov/cuu/Constants/Table/allascii.txt // using thermochemical calorie = 4.184 J + double dt_old = dt; + if (strcmp(style,"lj") == 0) { force->boltz = 1.0; force->hplanck = 1.0; @@ -295,6 +302,14 @@ void Update::set_units(const char *style) int n = strlen(style) + 1; unit_style = new char[n]; strcpy(unit_style,style); + + // check if timestep was changed from default value + if (!dt_default && (comm->me == 0)) { + error->warning(FLERR,fmt::format("Changing timestep from {:.6} to {:.6} " + "due to changing units to {}", + dt_old, dt, unit_style)); + } + dt_default = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/update.h b/src/update.h index 558719f4c..1d1e04b8b 100644 --- a/src/update.h +++ b/src/update.h @@ -37,6 +37,7 @@ class Update : protected Pointers { int setupflag; // set when setup() is computing forces int post_integrate; // 1 if now at post_integrate() in timestep int multireplica; // 1 if min across replicas, else 0 + int dt_default; // 1 if dt is at default value, else 0 bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on bigint vflag_global,vflag_atom; // ditto for virial -- GitLab From 2f3c916a573e8dc1e29717362c527ee8b349aa3a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 12:29:03 -0400 Subject: [PATCH 48/52] add unit test for lammps_memory_usage() --- unittest/c-library/test_library_properties.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index 3b1393e5c..5db779521 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -54,6 +54,17 @@ TEST_F(LibraryProperties, version) EXPECT_GE(20200824, lammps_version(lmp)); }; +TEST_F(LibraryProperties, memory_usage) +{ + double meminfo[3]; + lammps_memory_usage(lmp,meminfo); + EXPECT_GT(meminfo[0], 0.0); +#if defined(__linux__) || defined(_WIN32) + EXPECT_GT(meminfo[1], 0.0); +#endif + EXPECT_GT(meminfo[2], 0.0); +}; + TEST_F(LibraryProperties, get_mpi_comm) { int f_comm = lammps_get_mpi_comm(lmp); -- GitLab From 5da50d64c920a80454f0b3d7bf59615fb515e074 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 12:32:43 -0400 Subject: [PATCH 49/52] reformulate --- src/library.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index 5207a5cc1..6ebda8e61 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -544,11 +544,11 @@ LAMMPS instance or process. The *meminfo* buffer will be filled with is the tally (in MBytes) of all large memory allocations made by LAMMPS. This is a lower boundary of how much memory is requested and does not account for memory allocated on the stack or allocations via ``new``. -The second number is the current memory allocation of the process as -returned by the memory allocator in the C-library. The third number -is the maximum amount of RAM (not swap) used by the process so far. -If any of the two latter parameters is not supported by the operating -system, the number value is 0. +The second number is the current memory allocation of the current process +as returned by a memory allocation reporting in the system library. The +third number is the maximum amount of RAM (not swap) used by the process +so far. If any of the two latter parameters is not supported by the operating +system it will be set to zero. .. versionadded:: 15Sep2020 -- GitLab From baa49984c25765a35d43b45a43f34752ace0b8a2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 14:19:40 -0400 Subject: [PATCH 50/52] update comments --- src/write_restart.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 01ad917e8..09fe85fd1 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -631,7 +631,7 @@ void WriteRestart::version_numeric() } /* ---------------------------------------------------------------------- - write a flag and an int into restart file + write a flag and an int into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_int(int flag, int value) @@ -641,7 +641,7 @@ void WriteRestart::write_int(int flag, int value) } /* ---------------------------------------------------------------------- - write a flag and a bigint into restart file + write a flag and a bigint into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_bigint(int flag, bigint value) @@ -651,7 +651,7 @@ void WriteRestart::write_bigint(int flag, bigint value) } /* ---------------------------------------------------------------------- - write a flag and a double into restart file + write a flag and a double into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_double(int flag, double value) @@ -661,7 +661,8 @@ void WriteRestart::write_double(int flag, double value) } /* ---------------------------------------------------------------------- - write a flag and a char string (including nullptr) into restart file + write a flag and a C-style char string (including the terminating null + byte) into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_string(int flag, const char *value) @@ -673,7 +674,7 @@ void WriteRestart::write_string(int flag, const char *value) } /* ---------------------------------------------------------------------- - write a flag and vector of N ints into restart file + write a flag and vector of N ints into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_int_vec(int flag, int n, int *vec) @@ -684,7 +685,7 @@ void WriteRestart::write_int_vec(int flag, int n, int *vec) } /* ---------------------------------------------------------------------- - write a flag and vector of N doubles into restart file + write a flag and vector of N doubles into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_double_vec(int flag, int n, double *vec) -- GitLab From 16749566f8a6b16450d11dcf5cf74c7538fc082a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 14:42:00 -0400 Subject: [PATCH 51/52] Revert "fix issue with local variable shadowing a global variable" This reverts commit 3368eb79d843265d1a35570fb4f9965beae5de22. --- src/KSPACE/msm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 2634b7633..2b025fbe3 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -1028,7 +1028,6 @@ void MSM::set_grid_global() int flag = 0; int xlevels,ylevels,zlevels; - xlevels = ylevels = zlevels = 1; while (!factorable(nx_max,flag,xlevels)) { double k = log(nx_max)/log(2.0); @@ -1433,15 +1432,16 @@ void MSM::setup_grid() return 1 if yes, 0 if no ------------------------------------------------------------------------- */ -int MSM::factorable(int n, int &flag, int &nlevels) +int MSM::factorable(int n, int &flag, int &levels) { int i; + levels = 1; while (n > 1) { for (i = 0; i < nfactors; i++) { if (n % factors[i] == 0) { n /= factors[i]; - nlevels++; + levels++; break; } } -- GitLab From 3dd3c6a2a56f5f69781bd2091cf377d572c71621 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 15 Sep 2020 14:48:55 -0400 Subject: [PATCH 52/52] redo fix for class member shadowing while avoiding overflowing levels --- src/KSPACE/msm.cpp | 6 +- .../force-styles/tests/kspace-msm_nopbc.yaml | 60 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 2b025fbe3..fa96123b2 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -1432,16 +1432,16 @@ void MSM::setup_grid() return 1 if yes, 0 if no ------------------------------------------------------------------------- */ -int MSM::factorable(int n, int &flag, int &levels) +int MSM::factorable(int n, int &flag, int &nlevels) { int i; - levels = 1; + nlevels = 1; while (n > 1) { for (i = 0; i < nfactors; i++) { if (n % factors[i] == 0) { n /= factors[i]; - levels++; + nlevels++; break; } } diff --git a/unittest/force-styles/tests/kspace-msm_nopbc.yaml b/unittest/force-styles/tests/kspace-msm_nopbc.yaml index 99bbd2ae9..028ee43aa 100644 --- a/unittest/force-styles/tests/kspace-msm_nopbc.yaml +++ b/unittest/force-styles/tests/kspace-msm_nopbc.yaml @@ -1,6 +1,6 @@ --- lammps_version: 24 Aug 2020 -date_generated: Sat Sep 12 10:33:36 202 +date_generated: Tue Sep 15 14:47:38 202 epsilon: 5e-11 prerequisites: ! | atom full @@ -58,33 +58,33 @@ run_coul: 0 run_stress: ! |2- 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 run_forces: ! |2 - 1 -1.0348864007239668e-01 3.2761800817797082e-01 -2.7223154925249687e-01 - 2 1.1547721105281426e-02 -2.2227221129297944e-01 1.9829831292225819e-01 - 3 -6.1369788686855553e-03 1.1473670690755385e-02 -1.2235119385263003e-02 - 4 2.8809534480886322e-02 -4.5070713784827680e-02 4.5263724656363712e-02 - 5 4.2323185781698226e-02 -5.2976717776467216e-02 4.9736627529403242e-02 - 6 3.8194733647326694e-02 -2.4587855825158134e-01 4.1856615868672892e-01 - 7 4.5246314631942265e-02 2.0099417967365288e-01 -4.3512916657147588e-01 - 8 2.2478550451619471e-02 2.0362301286740869e-01 -4.3516590120465981e-01 - 9 -1.4178329999306901e-03 -1.5368030392367521e-01 2.6080100301013964e-01 - 10 -2.0495450209946312e-02 -2.0851530662446178e-02 7.4319850349891012e-02 - 11 -3.0029358892398838e-02 -2.0702279983167187e-02 9.8520949030575691e-02 - 12 1.3289689675296273e-01 9.3775108342107519e-02 -3.0419584939008770e-01 - 13 -5.5922486140088226e-02 -2.4843666409380370e-02 1.0515381624429042e-01 - 14 -4.4208019862361184e-02 -2.8633675987750289e-02 9.8140924300998925e-02 - 15 -3.8534805055538454e-02 -4.3447767456428393e-02 9.5052177465633700e-02 - 16 -2.0197663776900704e-01 -9.6067608908760441e-02 5.1267317994067874e-01 - 17 1.1536172816123620e-01 1.2150176721849106e-01 -4.0576909205923889e-01 - 18 3.2654836490027450e-01 4.3181659922436294e-01 -6.4631937847140064e-01 - 19 -1.7012391318923387e-01 -1.9294196901436866e-01 3.0171461650625692e-01 - 20 -1.6090393021018687e-01 -1.8797301084913640e-01 2.9016061976069074e-01 - 21 4.6464803590088510e-01 2.0966755173124815e-01 -8.4865286121979111e-01 - 22 -2.2714234064511640e-01 -1.1056430229170305e-01 3.8599855632265567e-01 - 23 -1.9865351580467286e-01 -1.1110079780224448e-01 3.9440435138483038e-01 - 24 -1.1755770692492392e-02 7.9361803570205403e-01 -3.4523386783293764e-01 - 25 5.0411795551073120e-02 -3.8916839645964540e-01 1.9278646898979940e-01 - 26 -2.9733815594164319e-02 -4.1142305819442143e-01 1.7495936527287648e-01 - 27 -5.2243746980854566e-01 2.4806539986837281e-01 -3.8666209074075969e-01 - 28 2.9308687168280761e-01 -1.5702803664966208e-01 2.0612286277862657e-01 - 29 2.5153793410884945e-01 -1.2745488321867574e-01 1.8930202039662150e-01 + 1 -1.0725057415020919e-01 3.3019907950838151e-01 -2.9323265400347975e-01 + 2 1.4273516924286595e-02 -2.2195304769099961e-01 2.1172398888943439e-01 + 3 -6.2191160687439613e-03 1.1636479086601327e-02 -1.3193542766995693e-02 + 4 2.8789530000554349e-02 -4.5707077957577419e-02 4.8949304170325961e-02 + 5 4.2918140819301939e-02 -5.3982290008046191e-02 5.4071851700930415e-02 + 6 4.0693195898835278e-02 -2.5124364388294529e-01 4.4409525619111351e-01 + 7 4.3902199408654773e-02 2.0718378754835146e-01 -4.5693181215217060e-01 + 8 1.8355056045104463e-02 2.1019458646438235e-01 -4.5977818830587547e-01 + 9 1.6926987410114289e-03 -1.5785316258950571e-01 2.7688718669924633e-01 + 10 -1.9845368939794925e-02 -2.2016564601343797e-02 7.7877659664832483e-02 + 11 -2.9242294066982408e-02 -2.2678746148089381e-02 1.0272772972867131e-01 + 12 1.2960469545860479e-01 9.7367043788644400e-02 -3.1763881493481549e-01 + 13 -5.4829808348627301e-02 -2.6026456048508360e-02 1.0948080578658986e-01 + 14 -4.3113220503693823e-02 -2.9962591673432723e-02 1.0219446255502410e-01 + 15 -3.7688395823574243e-02 -4.4115392571750824e-02 9.9676983434799277e-02 + 16 -1.9855722830658068e-01 -1.0361163893486998e-01 5.3648057305505858e-01 + 17 1.1217353766495122e-01 1.2665752635347602e-01 -4.2776774483665475e-01 + 18 3.1619456057296186e-01 4.2101932424007404e-01 -6.7203553906529401e-01 + 19 -1.6723605125535490e-01 -1.8745079364937817e-01 3.1118730606879103e-01 + 20 -1.5510498316646221e-01 -1.8060202958376245e-01 3.0126314730021070e-01 + 21 4.5618585311145787e-01 2.3416325579619782e-01 -8.7525764015858531e-01 + 22 -2.2272028927958532e-01 -1.2422014484239144e-01 3.9660449946839177e-01 + 23 -1.9381556909487696e-01 -1.2213865056926680e-01 4.0697283949615592e-01 + 24 -1.7632222754297714e-02 8.0868006192947306e-01 -3.6871343152445346e-01 + 25 5.5196078243586418e-02 -3.9602778003476646e-01 2.0694223014380941e-01 + 26 -2.8010525620160029e-02 -4.1949748612714061e-01 1.8579634676877732e-01 + 27 -5.3081154989654455e-01 2.5084075406488837e-01 -4.1028201045412238e-01 + 28 2.9697439332712672e-01 -1.5978637451711275e-01 2.1926787644097381e-01 + 29 2.5525638787732113e-01 -1.2899390363572455e-01 2.0303208126884240e-01 ... -- GitLab