Files
lammps/lib/atc/PaqAtcUtility.cpp
Anne Gunn f1ef7d85a8 T2345: Replace instances of NULL with nullptr
The following changes have been applied to src and lib folders:
regex replace: ([^"_])NULL ⇒ \1nullptr (8968 chgs in src, 1153 in lib)
Manually find/change: (void \*) nullptr ⇒ nullptr (1 case)
regex find: ".*?nullptr.*?"
  Manually ~14 cases back to "NULL" in src, ~2 in lib
  regex finds a few false positive where nullptr appears between two
  strings in a function call
2020-09-12 09:34:38 -06:00

90 lines
2.4 KiB
C++

// ATC transfer headers
#include "PaqAtcUtility.h"
#include "ATC_Method.h"
#include "FE_Engine.h"
namespace ATC {
//--------------------------------------------------------
//--------------------------------------------------------
// Class PaqAtcUtility
//--------------------------------------------------------
//--------------------------------------------------------
//--------------------------------------------------------
// Constructor
//--------------------------------------------------------
PaqAtcUtility::PaqAtcUtility(ATC_Method * atc,
AtomType atomType) :
atc_(atc),
atomType_(atomType),
myNlocal(nullptr)
{
switch (atomType_) {
case ALL:
myNlocal = &ATC_Method::nlocal_total;
break;
case INTERNAL:
myNlocal = &ATC_Method::nlocal;
break;
case GHOST:
myNlocal = &ATC_Method::nlocal_ghost;
break;
case PROC_GHOST:
myNlocal = &ATC_Method::nproc_ghost;
break;
default: // default cases to avoid compiler warnings
break;
}
}
//--------------------------------------------------------
// nlocal
//--------------------------------------------------------
int PaqAtcUtility::nlocal() const
{
return (atc_->*myNlocal)();
}
//--------------------------------------------------------
// nlocal_total
//--------------------------------------------------------
int PaqAtcUtility::nlocal_total() const
{
return atc_->nlocal_total();
}
//--------------------------------------------------------
// nsd
//--------------------------------------------------------
int PaqAtcUtility::nsd() const
{
return atc_->nsd();
}
//--------------------------------------------------------
// dt
//--------------------------------------------------------
double PaqAtcUtility::dt() const
{
return atc_->dt();
}
//--------------------------------------------------------
// atc_to_lammps_map
//--------------------------------------------------------
const Array<int> & PaqAtcUtility::atc_to_lammps_map() const
{
return (atomType_==INTERNAL) ? (atc_->internal_to_atom_map()) : (atc_->ghost_to_atom_map());
}
//--------------------------------------------------------
// fe_engine
//--------------------------------------------------------
const FE_Engine * PaqAtcUtility::fe_engine() const
{
return atc_->fe_engine();
}
};