fix up some comments

This commit is contained in:
Axel Kohlmeyer
2020-09-12 14:26:34 -04:00
parent bc850bcd97
commit 93a0d4c096
34 changed files with 50 additions and 50 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
};
}

View File

@ -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) {

View File

@ -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
------------------------------------------------------------------------- */

View File

@ -94,7 +94,7 @@ struct PairComputeFunctor {
dup_vatom = Kokkos::Experimental::create_scatter_view<Kokkos::Experimental::ScatterSum, typename NeedDup<NEIGHFLAG,device_type>::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 {

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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");

View File

@ -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++)

View File

@ -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

View File

@ -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");

View File

@ -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

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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
------------------------------------------------------------------------- */

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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<int> (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<int> (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]);

View File

@ -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;
}

View File

@ -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,