forked from lijiext/lammps
Manually resolve two rebase conflicts.
This commit is contained in:
parent
50b80e078d
commit
9a5d8fd18b
|
@ -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<int> 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -114,10 +114,10 @@ namespace ATC {
|
|||
FIELDS &rhs,
|
||||
const Array< std::set <int> > atomMaterialGroups,
|
||||
const VectorDependencyManager<SPAR_MAT * > * shpFcnDerivs,
|
||||
const SPAR_MAN * shpFcn = NULL,
|
||||
const DIAG_MAN * atomicWeights = NULL,
|
||||
const MatrixDependencyManager<DenseMatrix, bool> * elementMask = NULL,
|
||||
const SetDependencyManager<int> * nodeSet = NULL);
|
||||
const SPAR_MAN * shpFcn = nullptr,
|
||||
const DIAG_MAN * atomicWeights = nullptr,
|
||||
const MatrixDependencyManager<DenseMatrix, bool> * elementMask = nullptr,
|
||||
const SetDependencyManager<int> * nodeSet = nullptr);
|
||||
/** access to full right hand side / forcing vector */
|
||||
FIELDS &rhs() {return rhs_;};
|
||||
Array2D <bool> 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<FieldName,FieldName> 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<FieldName,FieldName> 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<bool> & 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<bool> & 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 */
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<double> * 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) {
|
||||
|
|
|
@ -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_);
|
||||
|
|
|
@ -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<int> & type_list() { return typeList_; }
|
||||
std::vector<int> & group_list() { return groupList_; }
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ protected:
|
|||
template<typename T>
|
||||
Array<T>::Array(void) {
|
||||
len_ = 0;
|
||||
data_ = NULL;
|
||||
data_ = nullptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -90,8 +90,8 @@ Array<T>::Array(int len) {
|
|||
template<typename T>
|
||||
Array<T>::Array(const Array<T>& 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<len_;i++)
|
||||
|
@ -101,7 +101,7 @@ Array<T>::Array(const Array<T>& A) {
|
|||
|
||||
template<typename T>
|
||||
Array<T>::~Array() {
|
||||
if (data_ != NULL) delete[] data_;
|
||||
if (data_ != nullptr) delete[] data_;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -111,12 +111,12 @@ void Array<T>::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<T>::resize(int len, bool copy) {
|
|||
else { // size change, realloc memory
|
||||
len_ = len;
|
||||
if (len_ > 0) {
|
||||
if (copy && data_ != NULL) {
|
||||
if (copy && data_ != nullptr) {
|
||||
Array<T> temp(*this);
|
||||
delete[] data_;
|
||||
data_ = new T[len_];
|
||||
|
@ -140,12 +140,12 @@ void Array<T>::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<T>::operator() (int i) {
|
|||
|
||||
template<typename T>
|
||||
Array<T>& Array<T>::operator= (const Array<T> &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<T>::ptr() const {
|
|||
template<typename T>
|
||||
void Array<T>::print(std::string name) const {
|
||||
std::cout << "------- Begin "<<name<<" -----------------\n";
|
||||
if (data_ != NULL) {
|
||||
if (data_ != nullptr) {
|
||||
for(int i=0;i<len_;i++) std::cout << data_[i] << " ";
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ AliasArray<T>::AliasArray(const Array<T>& A) {
|
|||
template<typename T>
|
||||
AliasArray<T>::~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<typename T>
|
||||
|
|
|
@ -57,7 +57,7 @@ template<typename T>
|
|||
Array2D<T>::Array2D() {
|
||||
nrows_ = 0;
|
||||
ncols_ = 0;
|
||||
data_ = NULL;
|
||||
data_ = nullptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -71,8 +71,8 @@ template<typename T>
|
|||
Array2D<T>::Array2D(const Array2D<T>& 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<nrows_*ncols_;i++)
|
||||
|
@ -88,12 +88,12 @@ void Array2D<T>::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<T> Array2D<T>::column(int col) const {
|
|||
|
||||
template<typename T>
|
||||
Array2D<T>& Array2D<T>::operator= (const Array2D<T>& 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<T>::write_restart(FILE *f) const {
|
|||
|
||||
template<typename T>
|
||||
Array2D<T>::~Array2D() {
|
||||
if (data_ != NULL)
|
||||
if (data_ != nullptr)
|
||||
delete[] data_;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Array2D<T>::print(std::string name) const {
|
||||
std::cout << "------- Begin "<<name<<" -----------------\n";
|
||||
if (data_ != NULL) {
|
||||
if (data_ != nullptr) {
|
||||
for(int col=0;col<ncols_;col++) {
|
||||
for(int row=0;row<nrows_;row++) {
|
||||
std::cout << data_[col*nrows_ + row] << " ";
|
||||
|
|
|
@ -47,8 +47,8 @@ namespace ATC {
|
|||
nLocal_(0),
|
||||
useLocalizedLambda_(false),
|
||||
useLumpedLambda_(false),
|
||||
timeFilter_(NULL),
|
||||
regulatorMethod_(NULL),
|
||||
timeFilter_(nullptr),
|
||||
regulatorMethod_(nullptr),
|
||||
boundaryIntegrationType_(NO_QUADRATURE),
|
||||
regulatorPrefix_(regulatorPrefix)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ namespace ATC {
|
|||
//--------------------------------------------------------
|
||||
DENS_MAN * AtomicRegulator::regulator_data(const string tag, int nCols)
|
||||
{
|
||||
DENS_MAN * data(NULL);
|
||||
DENS_MAN * data(nullptr);
|
||||
map<string, pair<bool,DENS_MAN * > >::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<string, pair<bool,DENS_MAN * > >::const_iterator it = regulatorData_.find(tag);
|
||||
if (it == regulatorData_.end()) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
return const_cast<DENS_MAN * >((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())
|
||||
{
|
||||
|
|
|
@ -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_;};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
//============================================================================
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -52,7 +52,7 @@ private:
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
CloneVector<T>::CloneVector(const Vector<T> &c)
|
||||
: Vector<T>(), _baseV(const_cast<Vector<T>*>(&c)), _baseM(NULL)
|
||||
: Vector<T>(), _baseV(const_cast<Vector<T>*>(&c)), _baseM(nullptr)
|
||||
{}
|
||||
//-----------------------------------------------------------------------------
|
||||
// Construct from a matrix, the const_cast isn't pretty
|
||||
|
@ -65,7 +65,7 @@ CloneVector<T>::CloneVector(const Vector<T> &c)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
CloneVector<T>::CloneVector(const Matrix<T> &c, int dim, INDEX idx)
|
||||
: Vector<T>(), _baseV(NULL), _baseM(const_cast<Matrix<T>*>(&c))
|
||||
: Vector<T>(), _baseV(nullptr), _baseM(const_cast<Matrix<T>*>(&c))
|
||||
, _clone_type(dim), _idx(idx)
|
||||
{}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -73,7 +73,7 @@ CloneVector<T>::CloneVector(const Matrix<T> &c, int dim, INDEX idx)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
CloneVector<T>::CloneVector(const DiagonalMatrix<T> &c, INDEX /* idx */)
|
||||
: Vector<T>(), _baseV(NULL), _baseM(const_cast<DiagonalMatrix<T>*>(&c))
|
||||
: Vector<T>(), _baseV(nullptr), _baseM(const_cast<DiagonalMatrix<T>*>(&c))
|
||||
, _clone_type(CLONE_DIAG), _idx(0)
|
||||
{}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -16,10 +16,10 @@ template <typename T>
|
|||
class DenseMatrix : public Matrix<T>
|
||||
{
|
||||
public:
|
||||
DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); }
|
||||
DenseMatrix(const DenseMatrix<T>& c) : Matrix<T>(), _data(NULL){ _copy(c); }
|
||||
DenseMatrix(const SparseMatrix<T>& c): Matrix<T>(), _data(NULL){ c.dense_copy(*this);}
|
||||
DenseMatrix(const Matrix<T>& c) : Matrix<T>(), _data(NULL){ _copy(c); }
|
||||
DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(nullptr){ _create(rows, cols, z); }
|
||||
DenseMatrix(const DenseMatrix<T>& c) : Matrix<T>(), _data(nullptr){ _copy(c); }
|
||||
DenseMatrix(const SparseMatrix<T>& c): Matrix<T>(), _data(nullptr){ c.dense_copy(*this);}
|
||||
DenseMatrix(const Matrix<T>& c) : Matrix<T>(), _data(nullptr){ _copy(c); }
|
||||
// const SparseMatrix<T> * p = sparse_cast(&c);
|
||||
// (p) ? p->dense_copy(*this) : _copy(c); }
|
||||
~DenseMatrix() { _delete();}
|
||||
|
@ -261,7 +261,7 @@ void DenseMatrix<T>::_delete()
|
|||
_nRows = _nCols = 0;
|
||||
if (_data){
|
||||
delete [] _data;
|
||||
_data = NULL;
|
||||
_data = nullptr;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -273,7 +273,7 @@ void DenseMatrix<T>::_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();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -16,9 +16,9 @@ class DenseVector : public Vector<T>
|
|||
{
|
||||
public:
|
||||
explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); }
|
||||
DenseVector(const DenseVector<T> &c) : Vector<T>(), _data(NULL) { _copy(c); }
|
||||
DenseVector(const Vector<T> &c) : Vector<T>(), _data(NULL) { _copy(c); }
|
||||
DenseVector(const T * ptr, INDEX nrows) : Vector<T>(), _data(NULL) { copy(ptr,nrows); }
|
||||
DenseVector(const DenseVector<T> &c) : Vector<T>(), _data(nullptr) { _copy(c); }
|
||||
DenseVector(const Vector<T> &c) : Vector<T>(), _data(nullptr) { _copy(c); }
|
||||
DenseVector(const T * ptr, INDEX nrows) : Vector<T>(), _data(nullptr) { copy(ptr,nrows); }
|
||||
virtual ~DenseVector() { _delete(); }
|
||||
|
||||
//* resizes the Vector, ignores nCols, optionally copys what fits
|
||||
|
@ -123,7 +123,7 @@ template <typename T>
|
|||
inline void DenseVector<T>::_create(INDEX n, bool zero)
|
||||
{
|
||||
_size=n;
|
||||
_data = _size ? new T [_size] : NULL ;
|
||||
_data = _size ? new T [_size] : nullptr ;
|
||||
if (zero) this->zero();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -205,7 +205,7 @@ DiagonalMatrix<T> operator-(const DiagonalMatrix<T> &A, const DiagonalMatrix<T>
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
DiagonalMatrix<T>::DiagonalMatrix(INDEX rows, bool zero)
|
||||
: _data(NULL)
|
||||
: _data(nullptr)
|
||||
{
|
||||
reset(rows, zero);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ DiagonalMatrix<T>::DiagonalMatrix(INDEX rows, bool zero)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
DiagonalMatrix<T>::DiagonalMatrix(const DiagonalMatrix<T>& c)
|
||||
: Matrix<T>(), _data(NULL)
|
||||
: Matrix<T>(), _data(nullptr)
|
||||
{
|
||||
reset(c);
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ DiagonalMatrix<T>::DiagonalMatrix(const DiagonalMatrix<T>& c)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
DiagonalMatrix<T>::DiagonalMatrix(const Vector<T>& v)
|
||||
: Matrix<T>(), _data(NULL)
|
||||
: Matrix<T>(), _data(nullptr)
|
||||
{
|
||||
reset(v);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()),
|
||||
|
|
|
@ -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<std::string,double> & 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<std::string,double> ¶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<std::string,double> & 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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -36,7 +36,7 @@ static const double localCoordinatesTolerance = 1.e-09;
|
|||
tolerance_(localCoordinatesTolerance),
|
||||
projectionGuess_(COORDINATE_ALIGNED)
|
||||
{
|
||||
feInterpolate_ = NULL;
|
||||
feInterpolate_ = nullptr;
|
||||
}
|
||||
|
||||
FE_Element::~FE_Element()
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ATC{
|
|||
//-----------------------------------------------------------------
|
||||
FE_Engine::FE_Engine(MPI_Comm comm)
|
||||
: communicator_(comm),
|
||||
feMesh_(NULL),
|
||||
feMesh_(nullptr),
|
||||
initialized_(false),
|
||||
outputManager_()
|
||||
{
|
||||
|
|
|
@ -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<int> &elementMaterials,
|
||||
SPAR_MAT &tangent,
|
||||
const DenseMatrix<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<int> &elementMaterials,
|
||||
CON_MASS_MATS &mass_matrix,
|
||||
const DenseMatrix<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<int> &elementMaterials,
|
||||
MASS_MATS &mass_matrix,
|
||||
const DenseMatrix<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<int> &elementMaterials,
|
||||
FIELD_MATS &energy,
|
||||
const DenseMatrix<bool> *elementMask=NULL,
|
||||
const DenseMatrix<bool> *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<int> &elementMaterials,
|
||||
FIELDS &rhs,
|
||||
bool freeOnly=false,
|
||||
const DenseMatrix<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<int> &elementMaterials,
|
||||
GRAD_FIELD_MATS &flux,
|
||||
const DenseMatrix<bool> *elementMask=NULL) const;
|
||||
const DenseMatrix<bool> *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<bool> *elementMask=NULL,
|
||||
const std::set<int> *nodeSet=NULL) const;
|
||||
const DenseMatrix<bool> *elementMask=nullptr,
|
||||
const std::set<int> *nodeSet=nullptr) const;
|
||||
|
||||
/** compute prescribed flux given an array of functions of x & t */
|
||||
void add_fluxes(const Array<bool> &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)
|
||||
|
|
|
@ -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<int> > > *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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -271,7 +271,7 @@ typedef PerAtomQuantity<double> 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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace ATC {
|
|||
double unitsConversion,
|
||||
AtomType atomType) :
|
||||
ShallowAtomQuantity<double>(atc,0,atomType),
|
||||
computePointer_(NULL),
|
||||
computePointer_(nullptr),
|
||||
computeTag_(tag),
|
||||
unitsConversion_(unitsConversion)
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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<double> & gamma,
|
||||
const vector<double> & 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<double> & gamma,
|
||||
const vector<double> & 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()),
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
|
|
|
@ -277,7 +277,7 @@ namespace ATC {
|
|||
data * return_quantity(std::map<std::string,data * > & list, const std::string & tag)
|
||||
{
|
||||
typename std::map<std::string,data * >::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<std::string,data * >::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 */
|
||||
|
|
|
@ -83,17 +83,17 @@ KD_Tree::KD_Tree(vector<Node> *points, vector<Elem> *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<int> 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<int> result = vector<int>();
|
||||
for (vector<Elem>::iterator elem = candElems_->begin();
|
||||
elem != candElems_->end(); elem++) {
|
||||
|
@ -119,7 +119,7 @@ vector<int> 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<int> result = vector<int>();
|
||||
for (vector<Elem>::iterator elem = candElems_->begin();
|
||||
elem != candElems_->end(); elem++) {
|
||||
|
@ -147,7 +147,7 @@ vector<vector<int> > 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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<double> &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_NS::PairEAM*> (lammps_->force->pair);
|
||||
if (pair_eam != NULL) {
|
||||
if (pair_eam != nullptr) {
|
||||
return pair_eam;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace ATC {
|
|||
virtual void clear();
|
||||
|
||||
/** initialize global data */
|
||||
virtual void initialize(std::map<int, double> * globalAtomsPerMolecule = NULL);
|
||||
virtual void initialize(std::map<int, double> * 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<int> * bondList = NULL,
|
||||
PerAtomQuantity<int> * numBond = NULL);
|
||||
PerAtomQuantity<int> * bondList = nullptr,
|
||||
PerAtomQuantity<int> * numBond = nullptr);
|
||||
|
||||
virtual ~SmallMoleculeSet();
|
||||
|
||||
|
@ -117,7 +117,7 @@ namespace ATC {
|
|||
virtual void clear();
|
||||
|
||||
/** initialize global data */
|
||||
virtual void initialize(std::map<int, double> * globalAtomsPerMolecule = NULL);
|
||||
virtual void initialize(std::map<int, double> * globalAtomsPerMolecule = nullptr);
|
||||
|
||||
/** access molecule atoms by lammps id */
|
||||
std::set<int> atoms_by_global_molecule(int id) const;
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
|
|
@ -48,8 +48,8 @@ OutputManager::OutputManager(string outputPrefix, set<int> & 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");
|
||||
}
|
||||
|
|
|
@ -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<int> *connectivity=NULL);
|
||||
const Array2D<int> *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<std::string>& list) {
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace ATC {
|
|||
AtomType atomType) :
|
||||
atc_(atc),
|
||||
atomType_(atomType),
|
||||
myNlocal(NULL)
|
||||
myNlocal(nullptr)
|
||||
{
|
||||
switch (atomType_) {
|
||||
case ALL:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -233,8 +233,8 @@ DenseMatrix<double> ParSparseMatrix<double>::transMat(
|
|||
SparseMatrix<double> C_local = ((SparseMatrix<double>)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<double>::partition(
|
|||
// Prepare an A_local matrix for deletion after it has been loaded with
|
||||
// data members from another matrix.
|
||||
void ParSparseMatrix<double>::finalize() {
|
||||
_val = NULL;
|
||||
_ja = NULL;
|
||||
_val = nullptr;
|
||||
_ja = nullptr;
|
||||
}
|
||||
|
||||
void ParSparseMatrix<double>::operator=(const SparseMatrix<double> &source)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomToElementMap(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomPositions = NULL,
|
||||
PerAtomQuantity<double> * atomPositions = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -304,7 +304,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomVolumeElement(ATC_Method * atc,
|
||||
PerAtomQuantity<int> * atomElement = NULL,
|
||||
PerAtomQuantity<int> * 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<double> * atomPositions = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomReferencePositions = NULL,
|
||||
PerAtomQuantity<double> * atomPositions = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
PerAtomQuantity<double> * atomReferencePositions = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -462,8 +462,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
FluctuatingVelocity(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -497,8 +497,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
ChargeVelocity(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * fluctuatingVelocities = NULL,
|
||||
FundamentalAtomQuantity * atomCharges = NULL,
|
||||
PerAtomQuantity<double> * fluctuatingVelocities = nullptr,
|
||||
FundamentalAtomQuantity * atomCharges = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -532,8 +532,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
SpeciesVelocity(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * fluctuatingVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomTypeVector = NULL,
|
||||
PerAtomQuantity<double> * fluctuatingVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomTypeVector = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -567,8 +567,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicMomentum(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -631,8 +631,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
TwiceKineticEnergy(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -670,8 +670,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
KineticTensor(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -707,9 +707,9 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
FluctuatingKineticTensor(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -747,9 +747,9 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
TwiceFluctuatingKineticEnergy(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
PerAtomQuantity<double> * atomMeanVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -793,8 +793,8 @@ namespace ATC {
|
|||
MixedKePeEnergy(ATC_Method * atc,
|
||||
double keMultiplier,
|
||||
double peMultiplier,
|
||||
PerAtomQuantity<double> * twiceKineticEnergy = NULL,
|
||||
PerAtomQuantity<double> * potentialEnergy = NULL,
|
||||
PerAtomQuantity<double> * twiceKineticEnergy = nullptr,
|
||||
PerAtomQuantity<double> * potentialEnergy = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -838,8 +838,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
TotalEnergy(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * twiceKineticEnergy = NULL,
|
||||
PerAtomQuantity<double> * potentialEnergy = NULL,
|
||||
PerAtomQuantity<double> * twiceKineticEnergy = nullptr,
|
||||
PerAtomQuantity<double> * potentialEnergy = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -871,8 +871,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
FluctuatingPotentialEnergy(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * potentialEnergy = NULL,
|
||||
PerAtomQuantity<double> * referencePotential = NULL,
|
||||
PerAtomQuantity<double> * potentialEnergy = nullptr,
|
||||
PerAtomQuantity<double> * referencePotential = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -911,8 +911,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
DotTwiceKineticEnergy(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomForces = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomForces = nullptr,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -948,7 +948,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
VelocitySquared(ATC_Method *atc,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -981,9 +981,9 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
LambdaSquared(ATC_Method *atc,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomVelocitiesSquared = NULL,
|
||||
PerAtomQuantity<double> * atomLambdas = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
PerAtomQuantity<double> * atomVelocitiesSquared = nullptr,
|
||||
PerAtomQuantity<double> * atomLambdas = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1149,7 +1149,7 @@ namespace ATC {
|
|||
// constructor
|
||||
AtomToNodeset(ATC_Method * atc,
|
||||
SetDependencyManager<int> * subsetNodes,
|
||||
PerAtomQuantity<int> * atomElement = NULL,
|
||||
PerAtomQuantity<int> * atomElement = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1194,7 +1194,7 @@ namespace ATC {
|
|||
// constructor
|
||||
AtomToElementset(ATC_Method * atc,
|
||||
MatrixDependencyManager<DenseMatrix, bool> * elementMask,
|
||||
PerAtomQuantity<int> * atomElement = NULL,
|
||||
PerAtomQuantity<int> * atomElement = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1273,7 +1273,7 @@ namespace ATC {
|
|||
// constructor
|
||||
VelocitySquaredMapped(ATC_Method *atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * atomMap,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1307,9 +1307,9 @@ namespace ATC {
|
|||
// constructor
|
||||
LambdaSquaredMapped(ATC_Method *atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * atomMap,
|
||||
PerAtomQuantity<double> * atomMasses = NULL,
|
||||
PerAtomQuantity<double> * atomVelocitiesSquared = NULL,
|
||||
PerAtomQuantity<double> * atomLambdas = NULL,
|
||||
PerAtomQuantity<double> * atomMasses = nullptr,
|
||||
PerAtomQuantity<double> * atomVelocitiesSquared = nullptr,
|
||||
PerAtomQuantity<double> * atomLambdas = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1371,7 +1371,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicVelocityRescaleFactor(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomLambdas = NULL,
|
||||
PerAtomQuantity<double> * atomLambdas = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1403,8 +1403,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicFluctuatingVelocityRescaled(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomRescaleFactor = NULL,
|
||||
PerAtomQuantity<double> * atomFluctuatingVelocity = NULL,
|
||||
PerAtomQuantity<double> * atomRescaleFactor = nullptr,
|
||||
PerAtomQuantity<double> * atomFluctuatingVelocity = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1439,10 +1439,10 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicCombinedRescaleThermostatError(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomFluctuatingMomentumRescaled = NULL,
|
||||
PerAtomQuantity<double> * atomMeanVelocity = NULL,
|
||||
PerAtomQuantity<double> * atomStreamingVelocity = NULL,
|
||||
PerAtomQuantity<double> * atomMass = NULL,
|
||||
PerAtomQuantity<double> * atomFluctuatingMomentumRescaled = nullptr,
|
||||
PerAtomQuantity<double> * atomMeanVelocity = nullptr,
|
||||
PerAtomQuantity<double> * atomStreamingVelocity = nullptr,
|
||||
PerAtomQuantity<double> * atomMass = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1483,8 +1483,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicThermostatForce(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomLambdas = NULL,
|
||||
PerAtomQuantity<double> * atomVelocities = NULL,
|
||||
PerAtomQuantity<double> * atomLambdas = nullptr,
|
||||
PerAtomQuantity<double> * atomVelocities = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1519,8 +1519,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicKinetostatForceDisplacement(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomLambda = NULL,
|
||||
PerAtomQuantity<double> * atomMass = NULL,
|
||||
PerAtomQuantity<double> * atomLambda = nullptr,
|
||||
PerAtomQuantity<double> * atomMass = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1558,8 +1558,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicKinetostatForceVelocity(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomLambda = NULL,
|
||||
PerAtomQuantity<double> * atomMass = NULL,
|
||||
PerAtomQuantity<double> * atomLambda = nullptr,
|
||||
PerAtomQuantity<double> * atomMass = nullptr,
|
||||
AtomType atomType = INTERNAL) :
|
||||
AtomicKinetostatForceDisplacement(atc,atomLambda,atomMass,atomType) {};
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomicKinetostatForceStress(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomLambda = NULL,
|
||||
PerAtomQuantity<double> * atomLambda = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1621,7 +1621,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
PerAtomKernelFunction(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomPositions = NULL,
|
||||
PerAtomQuantity<double> * atomPositions = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1656,8 +1656,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
PerAtomShapeFunction(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * atomPositions = NULL,
|
||||
PerAtomQuantity<int> * atomElements = NULL,
|
||||
PerAtomQuantity<double> * atomPositions = nullptr,
|
||||
PerAtomQuantity<int> * atomElements = nullptr,
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
// destructor
|
||||
|
@ -1695,8 +1695,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
LambdaCouplingMatrix(ATC_Method * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = NULL,
|
||||
SPAR_MAN * shapeFunction = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = nullptr,
|
||||
SPAR_MAN * shapeFunction = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~LambdaCouplingMatrix() {
|
||||
|
@ -1734,9 +1734,9 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
LocalLambdaCouplingMatrix(ATC_Method * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * lambdaAtomMap = NULL,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = NULL,
|
||||
SPAR_MAN * shapeFunction = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * lambdaAtomMap = nullptr,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = nullptr,
|
||||
SPAR_MAN * shapeFunction = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~LocalLambdaCouplingMatrix() {
|
||||
|
@ -1771,7 +1771,7 @@ namespace ATC {
|
|||
GhostCouplingMatrix(ATC_Method * atc,
|
||||
SPAR_MAN * shapeFunction,
|
||||
SetDependencyManager<int> * subsetNodes,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodeToOverlapMap = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~GhostCouplingMatrix() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace ATC
|
|||
const WeakEquation * weak_equation(FieldName field) const
|
||||
{
|
||||
std::map<FieldName,WeakEquation *>::const_iterator itr = weakEqns_.find(field);
|
||||
if (itr == weakEqns_.end()) return NULL;
|
||||
if (itr == weakEqns_.end()) return nullptr;
|
||||
return (weakEqns_.find(field))->second;
|
||||
}
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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<int>::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<int,int> 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<int,int> face = *iset;
|
||||
Array < UXT_Function * > & dof = faceSourcesRobin_[thisField][face];
|
||||
dof(thisIndex) = NULL;
|
||||
dof(thisIndex) = nullptr;
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -342,7 +342,7 @@ namespace ATC {
|
|||
set<int>::const_iterator iset;
|
||||
for (iset = elemSet.begin(); iset != elemSet.end(); iset++) {
|
||||
int ielem = *iset;
|
||||
elementSources_[thisField](ielem,thisIndex) = NULL;
|
||||
elementSources_[thisField](ielem,thisIndex) = nullptr;
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -17,14 +17,14 @@ TRI_COORD<T>::TRI_COORD(INDEX row, INDEX col, T val, bool add_to)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
SparseMatrix<T>::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<typename T>
|
||||
SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
|
||||
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
|
||||
: Matrix<T>(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false)
|
||||
{
|
||||
_copy(C);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
|
|||
//-----------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
SparseMatrix<T>::SparseMatrix(const DenseMatrix<T>& C)
|
||||
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
|
||||
: Matrix<T>(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false)
|
||||
{
|
||||
reset(C);
|
||||
}
|
||||
|
@ -67,9 +67,9 @@ void SparseMatrix<T>::_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<T>::_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
|
||||
|
|
|
@ -88,7 +88,7 @@ protected:
|
|||
//@{
|
||||
SparseVector(const Matrix<T> &c);
|
||||
SparseVector<T>& operator=(Matrix<T> &c);
|
||||
T* ptr() const {return NULL; }
|
||||
T* ptr() const {return nullptr; }
|
||||
//@}
|
||||
|
||||
STORE data_; //*> sparse data structure
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace ATC {
|
|||
const std::map<std::string,std::pair<MolSize,int> > & moleculeIds);
|
||||
|
||||
// destructor
|
||||
virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=NULL;};
|
||||
virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=nullptr;};
|
||||
|
||||
/** create and get necessary transfer operators */
|
||||
virtual void construct_transfers();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<double>(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<SPAR_MAT * >(),
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
NodalAtomVolumeElement(ATC_Method * atc, SPAR_MAN * shapeFunction,
|
||||
PerAtomQuantity<int> * atomElement=NULL);
|
||||
PerAtomQuantity<int> * atomElement=nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~NodalAtomVolumeElement() {
|
||||
|
@ -173,7 +173,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomTypeElement(ATC_Coupling * atc,
|
||||
PerAtomQuantity<int> * atomElement = NULL);
|
||||
PerAtomQuantity<int> * atomElement = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~AtomTypeElement() {
|
||||
|
@ -211,8 +211,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
ElementMask(ATC_Coupling * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = NULL,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasGhost = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = nullptr,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasGhost = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~ElementMask() {
|
||||
|
@ -251,7 +251,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
AtomElementMask(ATC_Coupling * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasAtoms = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasAtoms = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~AtomElementMask() {
|
||||
|
@ -287,8 +287,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
NodalGeometryType(ATC_Coupling * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = NULL,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasGhost = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = nullptr,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasGhost = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~NodalGeometryType() {
|
||||
|
@ -338,7 +338,7 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
NodalGeometryTypeElementSet(ATC_Coupling * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * hasInternal = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~NodalGeometryTypeElementSet() {
|
||||
|
@ -659,7 +659,7 @@ namespace ATC {
|
|||
// constructor
|
||||
RegulatedNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL);
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~RegulatedNodes() {
|
||||
|
@ -721,7 +721,7 @@ namespace ATC {
|
|||
// constructor
|
||||
FluxNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
RegulatedNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -751,7 +751,7 @@ namespace ATC {
|
|||
// constructor
|
||||
BoundaryNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
RegulatedNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -781,7 +781,7 @@ namespace ATC {
|
|||
// constructor
|
||||
FluxBoundaryNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
FluxNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -811,7 +811,7 @@ namespace ATC {
|
|||
// constructor
|
||||
AllRegulatedNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
FluxBoundaryNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -841,7 +841,7 @@ namespace ATC {
|
|||
// constructor
|
||||
FixedNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
RegulatedNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -871,7 +871,7 @@ namespace ATC {
|
|||
// constructor
|
||||
FixedBoundaryNodes(ATC_Coupling * atc,
|
||||
FieldName fieldName = NUM_TOTAL_FIELDS,
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = NULL) :
|
||||
MatrixDependencyManager<DenseMatrix, int> * nodalGeometryType = nullptr) :
|
||||
FixedNodes(atc,fieldName,nodalGeometryType) {};
|
||||
|
||||
// destructor
|
||||
|
@ -1052,8 +1052,8 @@ namespace ATC {
|
|||
|
||||
// constructor
|
||||
PerAtomShapeFunctionGradient(ATC_Method * atc,
|
||||
MatrixDependencyManager<DenseMatrix, int>* atomToElementMap = NULL,
|
||||
DENS_MAN* atomPositions = NULL,
|
||||
MatrixDependencyManager<DenseMatrix, int>* atomToElementMap = nullptr,
|
||||
DENS_MAN* atomPositions = nullptr,
|
||||
const std::string & tag = "AtomicShapeFunctionGradient",
|
||||
AtomType atomType = INTERNAL);
|
||||
|
||||
|
|
|
@ -542,7 +542,7 @@ namespace ATC {
|
|||
AtfProjection(ATC_Method * atc,
|
||||
PerAtomQuantity<double> * source,
|
||||
SPAR_MAN * accumulant,
|
||||
DIAG_MAN * weights = NULL);
|
||||
DIAG_MAN * weights = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~AtfProjection();
|
||||
|
@ -587,7 +587,7 @@ namespace ATC {
|
|||
PerAtomQuantity<double> * 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<double> * source,
|
||||
SPAR_MAN * accumulant,
|
||||
DENS_MAN * reference,
|
||||
DIAG_MAN * weights = NULL);
|
||||
DIAG_MAN * weights = nullptr);
|
||||
|
||||
// destructor
|
||||
virtual ~AtfProjectionReferenced();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -158,7 +158,7 @@ public:
|
|||
using base_t::second;
|
||||
using base_t::first;
|
||||
|
||||
mngptr(T* ptr=NULL, int managed=0): pair<T*,int>(ptr,managed){
|
||||
mngptr(T* ptr=nullptr, int managed=0): pair<T*,int>(ptr,managed){
|
||||
//if(managed==2)ptr= new T(*ptr);
|
||||
}
|
||||
mngptr(const mngarg<T> &arg): pair<T*,int>(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 T, class delete_t=delete_ptr<T> >
|
|||
class shptr{
|
||||
template<class Y, class Z> 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<class Y>
|
||||
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<T> &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 {
|
||||
|
|
|
@ -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<N; i++) {
|
||||
|
@ -389,7 +389,7 @@ struct Vector_Nt {
|
|||
|
||||
|
||||
//e returns the corrd having maximal absolute value
|
||||
T maxabscoord(int *ind=NULL) const {
|
||||
T maxabscoord(int *ind=nullptr) const {
|
||||
int im=0;
|
||||
T vv=fabs(v[0]);
|
||||
for (int i=1; i<N; i++) {
|
||||
|
@ -403,7 +403,7 @@ struct Vector_Nt {
|
|||
}
|
||||
|
||||
//e returns the corrd having minimal absolute value
|
||||
T minabscoord(int *ind=NULL) const {
|
||||
T minabscoord(int *ind=nullptr) const {
|
||||
int im=0;
|
||||
T vv=fabs(v[0]);
|
||||
for (int i=1; i<N; i++) {
|
||||
|
@ -417,7 +417,7 @@ struct Vector_Nt {
|
|||
}
|
||||
|
||||
|
||||
T mincoord(int *ind=NULL) const {
|
||||
T mincoord(int *ind=nullptr) const {
|
||||
int im=0;
|
||||
T vv=v[0];
|
||||
for (int i=1; i<N; i++) {
|
||||
|
@ -485,7 +485,7 @@ vec_type dist_av(Vector_3 *va1,Vector_3 *va2,int n);
|
|||
|
||||
//e finds the average difference norm between two vector sets of the same length
|
||||
/*e optionally gives the indexes for maximal and minimal difference
|
||||
va2 can be NULL, then the norm of va1 is used */
|
||||
va2 can be nullptr, then the norm of va1 is used */
|
||||
|
||||
vec_type diff_av(Vector_3 *va1,Vector_3 *va2,int n, int *minind=0, int *maxind=0);
|
||||
|
||||
|
@ -615,9 +615,9 @@ inline Vector_3 randdir(){
|
|||
|
||||
///\en Calculates extent of the vector container.
|
||||
/// \return the center of the vector set, optionally
|
||||
/// (if arguments are not NULL) fills the bounding box in \a box_min, \a box_max.
|
||||
/// (if arguments are not nullptr) fills the bounding box in \a box_min, \a box_max.
|
||||
template<class vec_inp_it>
|
||||
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++);
|
||||
|
|
|
@ -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,...){
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<typename def_class_name> 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<Lepton::CompiledExpression *>::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<Lepton::CompiledExpression *>::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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<colvarvalue> 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");
|
||||
|
|
|
@ -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<colvarvalue> 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<colvarvalue> const *values);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<int> 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<cvm::real> colvar_forces_scalar(num_variables());
|
||||
|
||||
std::vector<int> he_ix = he->new_index();
|
||||
std::vector<int> hg_ix = (hg != NULL) ? hg->new_index() : std::vector<int> (0);
|
||||
std::vector<int> hg_ix = (hg != nullptr) ? hg->new_index() : std::vector<int> (0);
|
||||
cvm::real hills_energy_here = 0.0;
|
||||
std::vector<colvarvalue> 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);
|
||||
|
|
|
@ -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<colvarvalue const *>(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();
|
||||
|
|
|
@ -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<int flags> void colvar::coordnum::main_loop(bool **pairlist_elem)
|
|||
|
||||
template<int compute_flags> 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 compute_flags> int colvar::coordnum::compute_coordnum()
|
|||
} else {
|
||||
|
||||
int const flags = compute_flags | ef_anisotropic;
|
||||
main_loop<flags>(NULL);
|
||||
main_loop<flags>(nullptr);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -257,7 +257,7 @@ template<int compute_flags> int colvar::coordnum::compute_coordnum()
|
|||
} else {
|
||||
|
||||
int const flags = compute_flags;
|
||||
main_loop<flags>(NULL);
|
||||
main_loop<flags>(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ void colvar::h_bond::calc_value()
|
|||
coordnum::switching_function<flags>(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<flags>(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 compute_flags> 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<flags>(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<flags>(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<flags>(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<flags>(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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<features.size(); i++) {
|
||||
// if (features[i] != NULL) delete features[i];
|
||||
// if (features[i] != nullptr) delete features[i];
|
||||
// }
|
||||
|
||||
remove_all_children();
|
||||
|
|
|
@ -34,21 +34,21 @@ colvar_grid_count::colvar_grid_count(std::vector<colvar *> &colvars,
|
|||
{}
|
||||
|
||||
colvar_grid_scalar::colvar_grid_scalar()
|
||||
: colvar_grid<cvm::real>(), samples(NULL)
|
||||
: colvar_grid<cvm::real>(), samples(nullptr)
|
||||
{}
|
||||
|
||||
colvar_grid_scalar::colvar_grid_scalar(colvar_grid_scalar const &g)
|
||||
: colvar_grid<cvm::real>(g), samples(NULL)
|
||||
: colvar_grid<cvm::real>(g), samples(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
colvar_grid_scalar::colvar_grid_scalar(std::vector<int> const &nx_i)
|
||||
: colvar_grid<cvm::real>(nx_i, 0.0, 1), samples(NULL)
|
||||
: colvar_grid<cvm::real>(nx_i, 0.0, 1), samples(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
colvar_grid_scalar::colvar_grid_scalar(std::vector<colvar *> &colvars, bool margin)
|
||||
: colvar_grid<cvm::real>(colvars, 0.0, 1, margin), samples(NULL)
|
||||
: colvar_grid<cvm::real>(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<cvm::real>(), samples(NULL)
|
||||
: colvar_grid<cvm::real>(), samples(nullptr)
|
||||
{}
|
||||
|
||||
colvar_grid_gradient::colvar_grid_gradient(std::vector<int> const &nx_i)
|
||||
: colvar_grid<cvm::real>(nx_i, 0.0, nx_i.size()), samples(NULL)
|
||||
: colvar_grid<cvm::real>(nx_i, 0.0, nx_i.size()), samples(nullptr)
|
||||
{}
|
||||
|
||||
colvar_grid_gradient::colvar_grid_gradient(std::vector<colvar *> &colvars)
|
||||
: colvar_grid<cvm::real>(colvars, 0.0, colvars.size()), samples(NULL)
|
||||
: colvar_grid<cvm::real>(colvars, 0.0, colvars.size()), samples(nullptr)
|
||||
{}
|
||||
|
||||
void colvar_grid_gradient::write_1D_integral(std::ostream &os)
|
||||
|
|
|
@ -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<size_t>(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;
|
||||
|
|
|
@ -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 -
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue