Merge remote-tracking branch 'origin/master' into python_interface_guide
This commit is contained in:
@ -2,6 +2,8 @@ set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
|
||||
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
||||
|
||||
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
|
||||
|
||||
# Build Lepton by default
|
||||
option(COLVARS_LEPTON "Build and link the Lepton library" ON)
|
||||
|
||||
@ -21,6 +23,11 @@ set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACH
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
target_link_libraries(lammps PRIVATE colvars)
|
||||
|
||||
if(COLVARS_DEBUG)
|
||||
# Need to export the macro publicly to also affect the proxy
|
||||
target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG)
|
||||
endif()
|
||||
|
||||
if(COLVARS_LEPTON)
|
||||
target_link_libraries(lammps PRIVATE lepton)
|
||||
target_compile_definitions(colvars PRIVATE -DLEPTON)
|
||||
|
||||
@ -431,6 +431,7 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_page.h \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \
|
||||
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
||||
Binary file not shown.
@ -10,7 +10,7 @@ strings into specific types of numbers with checking for validity. This
|
||||
reduces redundant implementations and encourages consistent behavior.
|
||||
|
||||
I/O with status check
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
These are wrappers around the corresponding C library calls like
|
||||
``fgets()`` or ``fread()``. They will check if there were errors
|
||||
@ -26,6 +26,8 @@ indicating the name of the problematic file, if possible.
|
||||
.. doxygenfunction:: sfread
|
||||
:project: progguide
|
||||
|
||||
----------
|
||||
|
||||
String to number conversions with validity check
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -281,6 +283,8 @@ This code example should produce the following output:
|
||||
:project: progguide
|
||||
:members: what
|
||||
|
||||
----------
|
||||
|
||||
File reader classes
|
||||
====================
|
||||
|
||||
@ -333,6 +337,8 @@ convert numbers, so that LAMMPS will be aborted.
|
||||
|
||||
A file that would be parsed by the reader code fragment looks like this:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
# DATE: 2015-02-19 UNITS: metal CONTRIBUTOR: Ray Shan CITATION: Streitz and Mintmire, Phys Rev B, 50, 11996-12003 (1994)
|
||||
#
|
||||
# X (eV) J (eV) gamma (1/\AA) zeta (1/\AA) Z (e)
|
||||
@ -351,7 +357,6 @@ A file that would be parsed by the reader code fragment looks like this:
|
||||
:project: progguide
|
||||
:members:
|
||||
|
||||
|
||||
----------
|
||||
|
||||
Memory pool classes
|
||||
@ -415,3 +420,43 @@ its size is registered later with :cpp:func:`vgot()
|
||||
.. doxygenclass:: LAMMPS_NS::MyPoolChunk
|
||||
:project: progguide
|
||||
:members:
|
||||
|
||||
----------
|
||||
|
||||
Eigensolver functions
|
||||
=====================
|
||||
|
||||
The ``MathEigen`` sub-namespace of the ``LAMMPS_NS`` namespace contains
|
||||
functions and classes for eigensolvers. Currently only the
|
||||
:cpp:func:`jacobi3 function <MathEigen::jacobi3>` is used in various
|
||||
places in LAMMPS. That function is built on top of a group of more
|
||||
generic eigensolvers that are maintained in the ``math_eigen_impl.h``
|
||||
header file. This header contains the implementation of three template
|
||||
classes:
|
||||
|
||||
#. "Jacobi" calculates all of the eigenvalues and eigenvectors
|
||||
of a dense, symmetric, real matrix.
|
||||
|
||||
#. The "PEigenDense" class only calculates the principal eigenvalue
|
||||
(ie. the largest or smallest eigenvalue), and its corresponding
|
||||
eigenvector. However it is much more efficient than "Jacobi" when
|
||||
applied to large matrices (larger than 13x13). PEigenDense also can
|
||||
understand complex-valued Hermitian matrices.
|
||||
|
||||
#. The "LambdaLanczos" class is a generalization of "PEigenDense" which can be
|
||||
applied to arbitrary sparse matrices.
|
||||
|
||||
The "math_eigen_impl.h" code is an amalgamation of `jacobi_pd
|
||||
<https://github.com/jewettaij/jacobi_pd>`_ by Andrew Jewett at Scripps
|
||||
Research (under CC0-1.0 license) and `Lambda Lanczos
|
||||
<https://github.com/mrcdr/lambda-lanczos>`_ by Yuya Kurebayashi at
|
||||
Tohoku University (under MIT license)
|
||||
|
||||
----------
|
||||
|
||||
.. doxygenfunction:: MathEigen::jacobi3(double const *const *mat, double *eval, double **evec)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3])
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -1,9 +1,51 @@
|
||||
Retrieving LAMMPS configuration information
|
||||
===========================================
|
||||
|
||||
The following library functions can be used to query the
|
||||
LAMMPS library about compile time settings and included
|
||||
packages and styles.
|
||||
The following library functions can be used to query the LAMMPS library
|
||||
about compile time settings and included packages and styles. This
|
||||
enables programs that use the library interface to run LAMMPS
|
||||
simulations to determine, whether the linked LAMMPS library is compatible
|
||||
with the requirements of the application without crashing during the
|
||||
LAMMPS functions (e.g. due to missing pair styles from packages) or to
|
||||
choose between different options (e.g. whether to use ``lj/cut``,
|
||||
``lj/cut/opt``, ``lj/cut/omp`` or ``lj/cut/intel``). Most of the
|
||||
functions can be called directly without first creating a LAMMPS
|
||||
instance. While crashes within LAMMPS may be recovered from through
|
||||
enabling :ref:`exceptions <exceptions>`, avoiding them proactively is
|
||||
a safer approach.
|
||||
|
||||
.. code-block:: C
|
||||
:caption: Example for using configuration settings functions
|
||||
|
||||
#include "library.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
void *handle;
|
||||
|
||||
handle = lammps_open_no_mpi(0, NULL, NULL);
|
||||
lammps_file(handle, "in.missing");
|
||||
if (lammps_has_error(handle)) {
|
||||
char errmsg[256];
|
||||
int errtype;
|
||||
errtype = lammps_get_last_error_message(handle, errmsg, 256);
|
||||
fprintf(stderr, "LAMMPS failed with error: %s\n", errmsg);
|
||||
return 1;
|
||||
}
|
||||
/* write compressed dump file depending on available of options */
|
||||
if (lammps_has_style(handle, "dump", "atom/zstd")) {
|
||||
lammps_command(handle, "dump d1 all atom/zstd 100 dump.zst");
|
||||
} else if (lammps_has_style(handle, "dump", "atom/gz")) {
|
||||
lammps_command(handle, "dump d1 all atom/gz 100 dump.gz");
|
||||
} else if (lammps_config_has_gzip_support()) {
|
||||
lammps_command(handle, "dump d1 all atom 100 dump.gz");
|
||||
} else {
|
||||
lammps_command(handle, "dump d1 all atom 100 dump");
|
||||
}
|
||||
lammps_close(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
-----------------------
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ Retrieving or setting LAMMPS system properties
|
||||
==============================================
|
||||
|
||||
The library interface allows to extract different kinds of information
|
||||
about the active simulation instance and also to modify some of them.
|
||||
This allows to combine MD simulation steps with other processing and
|
||||
about the active simulation instance and also to modify some of it.
|
||||
This enables combining MD simulation steps with other processing and
|
||||
simulation methods computed in the calling code or another code that is
|
||||
coupled to LAMMPS via the library interface. In some cases the data
|
||||
returned is direct reference to the original data inside LAMMPS cast
|
||||
@ -14,6 +14,34 @@ is the per-processor **local** data and indexed accordingly. These arrays
|
||||
can change sizes and order at every neighbor list rebuild and atom sort
|
||||
event as atoms are migrating between sub-domains.
|
||||
|
||||
.. code-block:: C
|
||||
|
||||
#include "library.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
void *handle;
|
||||
int i;
|
||||
|
||||
handle = lammps_open_no_mpi(0, NULL, NULL);
|
||||
lammps_file(handle,"in.sysinit");
|
||||
printf("running simulation with %g atoms\n",
|
||||
lammps_get_natoms(handle));
|
||||
|
||||
lammps_command(handle,"run 1000 post no");
|
||||
|
||||
for (i=0; i < 10; ++i) {
|
||||
lammps_command(handle,"run 100 pre no post no");
|
||||
printf("PE = %g\nKE = %g\n",
|
||||
lammps_get_thermo(handle,"pe"),
|
||||
lammps_get_thermo(handle,"ke"));
|
||||
}
|
||||
lammps_close(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_version
|
||||
@ -21,6 +49,11 @@ event as atoms are migrating between sub-domains.
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_memory_usage
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_get_mpi_comm
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -325,6 +325,7 @@ Buyl
|
||||
Bybee
|
||||
bz
|
||||
cadetblue
|
||||
calc
|
||||
calibre
|
||||
caltech
|
||||
Caltech
|
||||
@ -397,6 +398,7 @@ ChiralIDs
|
||||
chiralIDs
|
||||
chirality
|
||||
Cho
|
||||
ChooseOffset
|
||||
chris
|
||||
Christoph
|
||||
Chu
|
||||
@ -469,6 +471,7 @@ config
|
||||
configfile
|
||||
configurational
|
||||
conformational
|
||||
ConstMatrix
|
||||
Contrib
|
||||
cooperativity
|
||||
coord
|
||||
@ -639,7 +642,10 @@ dhex
|
||||
dia
|
||||
diag
|
||||
diagonalization
|
||||
diagonalize
|
||||
diagonalized
|
||||
diagonalizers
|
||||
diagonalizing
|
||||
Diallo
|
||||
diel
|
||||
differentiable
|
||||
@ -778,8 +784,15 @@ Eggebrecht
|
||||
ehex
|
||||
eHEX
|
||||
Ei
|
||||
Eigen
|
||||
Eigensolve
|
||||
eigen
|
||||
eigensolve
|
||||
eigensolver
|
||||
eigensolvers
|
||||
eigendecomposition
|
||||
eigenvalue
|
||||
eigenvalues
|
||||
eigenvector
|
||||
eigenvectors
|
||||
eij
|
||||
Eij
|
||||
Eijnden
|
||||
@ -893,6 +906,11 @@ eV
|
||||
evalue
|
||||
Evanseck
|
||||
evdwl
|
||||
evector
|
||||
evec
|
||||
evecs
|
||||
eval
|
||||
evals
|
||||
Everaers
|
||||
Evgeny
|
||||
evirials
|
||||
@ -1069,6 +1087,7 @@ Germann
|
||||
Germano
|
||||
gerolf
|
||||
Gerolf
|
||||
Gershgorin
|
||||
gettimeofday
|
||||
gewald
|
||||
Gezelter
|
||||
@ -1184,6 +1203,7 @@ Henkelman
|
||||
Henkes
|
||||
henrich
|
||||
Henrich
|
||||
Hermitian
|
||||
Herrmann
|
||||
Hertizian
|
||||
hertzian
|
||||
@ -1257,6 +1277,7 @@ icosahedral
|
||||
idealgas
|
||||
IDR
|
||||
idx
|
||||
ie
|
||||
ielement
|
||||
ieni
|
||||
ifdefs
|
||||
@ -1279,6 +1300,7 @@ Imageint
|
||||
Imagemagick
|
||||
imd
|
||||
Impey
|
||||
impl
|
||||
impropers
|
||||
Impropers
|
||||
includelink
|
||||
@ -1348,6 +1370,8 @@ isothermal
|
||||
isotropically
|
||||
isovolume
|
||||
Isralewitz
|
||||
iter
|
||||
iters
|
||||
iteratively
|
||||
Ith
|
||||
Itsets
|
||||
@ -1524,6 +1548,7 @@ Kub
|
||||
Kubo
|
||||
Kumagai
|
||||
Kumar
|
||||
Kurebayashi
|
||||
Kuronen
|
||||
Kusters
|
||||
Kutta
|
||||
@ -1534,12 +1559,14 @@ Ladd
|
||||
lagrangian
|
||||
lambdai
|
||||
lamda
|
||||
LambdaLanczos
|
||||
lammps
|
||||
Lammps
|
||||
LAMMPS
|
||||
lammpsplot
|
||||
Lampis
|
||||
Lamoureux
|
||||
Lanczos
|
||||
Lande
|
||||
Landron
|
||||
langevin
|
||||
@ -1847,6 +1874,7 @@ Microscale
|
||||
midnightblue
|
||||
mie
|
||||
Mie
|
||||
Mij
|
||||
Mikami
|
||||
Militzer
|
||||
Minary
|
||||
@ -1945,6 +1973,7 @@ Muccioli
|
||||
mui
|
||||
Mukherjee
|
||||
Mulders
|
||||
mult
|
||||
multi
|
||||
multibody
|
||||
Multibody
|
||||
@ -2332,6 +2361,7 @@ peachpuff
|
||||
Pearlman
|
||||
Pedersen
|
||||
peID
|
||||
PEigenDense
|
||||
Peng
|
||||
peptide
|
||||
peratom
|
||||
@ -2560,6 +2590,8 @@ rdf
|
||||
RDideal
|
||||
rdx
|
||||
reacter
|
||||
realTypeMap
|
||||
real_t
|
||||
README
|
||||
realtime
|
||||
reamin
|
||||
@ -2742,6 +2774,7 @@ Schuring
|
||||
Schwen
|
||||
screenshot
|
||||
screenshots
|
||||
Scripps
|
||||
Scripta
|
||||
sdk
|
||||
sdpd
|
||||
@ -3070,6 +3103,7 @@ Tmin
|
||||
tmp
|
||||
tN
|
||||
Tobias
|
||||
Tohoku
|
||||
tokenizer
|
||||
tokyo
|
||||
tol
|
||||
@ -3133,6 +3167,8 @@ tu
|
||||
Tuckerman
|
||||
tue
|
||||
tunable
|
||||
tuple
|
||||
tuples
|
||||
Turkand
|
||||
Tutein
|
||||
tweakable
|
||||
@ -3426,6 +3462,7 @@ Yuh
|
||||
yukawa
|
||||
Yukawa
|
||||
Yusof
|
||||
Yuya
|
||||
yx
|
||||
yy
|
||||
yz
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
configuration {
|
||||
step 200
|
||||
dt 2.000000e+00
|
||||
version 2018-11-16
|
||||
version 2020-07-07
|
||||
}
|
||||
|
||||
colvar {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
configuration {
|
||||
step 100
|
||||
dt 2.000000e+00
|
||||
version 2018-11-16
|
||||
version 2020-07-07
|
||||
}
|
||||
|
||||
colvar {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
configuration {
|
||||
step 300
|
||||
dt 2.000000e+00
|
||||
version 2018-11-16
|
||||
version 2020-07-07
|
||||
}
|
||||
|
||||
colvar {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
configuration {
|
||||
step 100
|
||||
dt 2.000000e+00
|
||||
version 2018-11-16
|
||||
version 2020-07-07
|
||||
}
|
||||
|
||||
colvar {
|
||||
|
||||
@ -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 a null pointer, puts the found value there
|
||||
virtual int Find(long i, long j, T *retval=nullptr)=0;
|
||||
virtual int Find(long i, long j, T **retval=nullptr)=0;
|
||||
virtual int Del(long i, long j)=0;
|
||||
virtual int Put(long i, long j, const T *value)=0;
|
||||
virtual int Put(long i, long j, const T& value)=0;
|
||||
@ -621,7 +621,7 @@ public:
|
||||
indm.Set(-1);
|
||||
arr= new T[n*(n+1)/2];
|
||||
}
|
||||
int Find(long i, long j, T *retval=NULL){
|
||||
int Find(long i, long j, T *retval=nullptr){
|
||||
long ind=indm(i,j);
|
||||
if(ind>=0){
|
||||
if(retval){
|
||||
|
||||
@ -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 null pointers) 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 null pointers, \n
|
||||
/// the forces may be obtained then using \ref get_el_forces() for all WPs \n
|
||||
/// or separately for each WP using \ref get_wp_force()
|
||||
/// if PBCs are used the coords must be within a range [0, cell)
|
||||
|
||||
@ -116,8 +116,8 @@ public:
|
||||
/// \a n is the number of electrons of a given spin component
|
||||
/// Electron velocity v is multiplied by mass to obtain momentum.
|
||||
/// Default mass (-1) means me.
|
||||
/// Electronic charges q are -1 by default (when q=NULL), otherwise the charges are assigned for each split
|
||||
int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=NULL);
|
||||
/// Electronic charges q are -1 by default (when q=nullptr), otherwise the charges are assigned for each split
|
||||
int set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass=-1, double *q=nullptr);
|
||||
|
||||
|
||||
///\en Starts adding new electron: continue with \ref add_split functions.
|
||||
@ -141,7 +141,7 @@ public:
|
||||
|
||||
|
||||
///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron
|
||||
int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1);
|
||||
int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1);
|
||||
|
||||
|
||||
void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref,
|
||||
@ -164,8 +164,8 @@ public:
|
||||
cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2);
|
||||
|
||||
//e same as interaction, but using Hartee factorization (no antisymmetrization)
|
||||
int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL,
|
||||
Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL);
|
||||
int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr,
|
||||
Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr);
|
||||
|
||||
///\en Calculates interaction in the system of ni ions + electrons
|
||||
/// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions
|
||||
@ -174,12 +174,12 @@ public:
|
||||
/// 0x4 -- calculate electronic forces \n
|
||||
/// 0x8 -- add electronic forces to the existing arrays \n
|
||||
/// 0x10 -- calculate internal electronic derivatives only: \n
|
||||
/// will not update electronic force arrays, which may be NULL, \n
|
||||
/// will not update electronic force arrays, which may be null pointers, \n
|
||||
/// the forces may be obtained then using \ref get_el_forces() for all WPs \n
|
||||
/// or separately for each WP using \ref get_wp_force()
|
||||
/// if PBCs are used the coords must be within a range [0, cell)
|
||||
int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL,
|
||||
Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL);
|
||||
int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr,
|
||||
Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr);
|
||||
|
||||
///\en Get electronic forcess in the arrays provided, using calculated internal representation
|
||||
/// Valid flag settings are:\n
|
||||
|
||||
@ -38,6 +38,7 @@ COLVARS_SRCS = \
|
||||
colvarcomp_gpath.cpp \
|
||||
colvarcomp_protein.cpp \
|
||||
colvarcomp_rotations.cpp \
|
||||
colvarcomp_volmaps.cpp \
|
||||
colvar.cpp \
|
||||
colvardeps.cpp \
|
||||
colvargrid.cpp \
|
||||
@ -46,7 +47,12 @@ COLVARS_SRCS = \
|
||||
colvarparse.cpp \
|
||||
colvarproxy.cpp \
|
||||
colvarproxy_replicas.cpp \
|
||||
colvarproxy_tcl.cpp \
|
||||
colvarproxy_volmaps.cpp \
|
||||
colvarscript.cpp \
|
||||
colvarscript_commands.cpp \
|
||||
colvarscript_commands_bias.cpp \
|
||||
colvarscript_commands_colvar.cpp \
|
||||
colvartypes.cpp \
|
||||
colvarvalue.cpp
|
||||
|
||||
@ -61,7 +67,7 @@ ifeq ($(COLVARS_LEPTON),no)
|
||||
LEPTON_INCFLAGS =
|
||||
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o)
|
||||
else
|
||||
LEPTON_INCFLAGS = -Ilepton/include -DLEPTON -DLEPTON_USE_STATIC_LIBRARIES
|
||||
LEPTON_INCFLAGS = -Ilepton/include -DLEPTON
|
||||
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) $(LEPTON_SRCS:.cpp=.o)
|
||||
endif
|
||||
|
||||
@ -77,25 +83,9 @@ Makefile.deps: $(COLVARS_SRCS)
|
||||
@echo > $@
|
||||
@for src in $^ ; do \
|
||||
obj=`basename $$src .cpp`.o ; \
|
||||
$(CXX) -MM $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) \
|
||||
$(CXX) $(CXXFLAGS) -MM $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) \
|
||||
-MT '$$(COLVARS_OBJ_DIR)'$$obj $$src >> $@ ; \
|
||||
done
|
||||
|
||||
include Makefile.deps
|
||||
|
||||
# Exceptions to pattern rule above for Lepton objects
|
||||
|
||||
lepton/src/CompiledExpression.o: lepton/src/CompiledExpression.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
lepton/src/ExpressionProgram.o: lepton/src/ExpressionProgram.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
lepton/src/ExpressionTreeNode.o: lepton/src/ExpressionTreeNode.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
lepton/src/Operation.o: lepton/src/Operation.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
lepton/src/ParsedExpression.o: lepton/src/ParsedExpression.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
lepton/src/Parser.o: lepton/src/Parser.cpp
|
||||
$(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $<
|
||||
|
||||
include Makefile.lepton.deps # Hand-generated
|
||||
|
||||
@ -1,84 +1,103 @@
|
||||
|
||||
$(COLVARS_OBJ_DIR)colvaratoms.o: colvaratoms.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarparse.h colvarparams.h colvaratoms.h colvardeps.h
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvarparse.h colvarparams.h \
|
||||
colvaratoms.h colvardeps.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias_abf.o: colvarbias_abf.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvarbias_abf.h colvarbias.h \
|
||||
colvargrid.h colvar_UIestimator.h
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvar.h colvarparse.h \
|
||||
colvarparams.h colvardeps.h colvarbias_abf.h colvarbias.h colvargrid.h \
|
||||
colvar_UIestimator.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias_alb.o: colvarbias_alb.cpp colvarmodule.h \
|
||||
colvars_version.h colvarbias.h colvar.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvarbias_alb.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias.o: colvarbias.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvarbias.h \
|
||||
colvar.h colvarparse.h colvarparams.h colvardeps.h colvargrid.h
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvarbias.h colvar.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvargrid.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias_histogram.o: colvarbias_histogram.cpp \
|
||||
colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \
|
||||
colvarvalue.h colvar.h colvarparse.h colvarparams.h colvardeps.h \
|
||||
colvarbias_histogram.h colvarbias.h colvargrid.h
|
||||
colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h colvar.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvarbias_histogram.h \
|
||||
colvarbias.h colvargrid.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias_meta.o: colvarbias_meta.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvarbias_meta.h colvarbias.h \
|
||||
colvargrid.h
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvar.h colvarparse.h \
|
||||
colvarparams.h colvardeps.h colvarbias_meta.h colvarbias.h colvargrid.h
|
||||
$(COLVARS_OBJ_DIR)colvarbias_restraint.o: colvarbias_restraint.cpp \
|
||||
colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \
|
||||
colvarvalue.h colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \
|
||||
colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \
|
||||
colvarparams.h colvardeps.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_angles.o: colvarcomp_angles.cpp \
|
||||
colvarmodule.h colvars_version.h colvar.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvardeps.h colvarcomp.h colvaratoms.h \
|
||||
colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_apath.o: colvarcomp_apath.cpp colvarmodule.h \
|
||||
colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \
|
||||
colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \
|
||||
colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_coordnums.o: colvarcomp_coordnums.cpp \
|
||||
colvarmodule.h colvars_version.h colvarparse.h colvarvalue.h \
|
||||
colvartypes.h colvarparams.h colvaratoms.h colvarproxy.h colvardeps.h \
|
||||
colvar.h colvarcomp.h colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
colvartypes.h colvarparams.h colvaratoms.h colvarproxy.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvar.h \
|
||||
colvarcomp.h colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp.o: colvarcomp.cpp colvarmodule.h \
|
||||
colvars_version.h colvarvalue.h colvartypes.h colvar.h colvarparse.h \
|
||||
colvarparams.h colvardeps.h colvarcomp.h colvaratoms.h colvarproxy.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvar_arithmeticpath.h \
|
||||
colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_distances.o: colvarcomp_distances.cpp \
|
||||
colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \
|
||||
colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \
|
||||
colvar_geometricpath.h
|
||||
colvaratoms.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_gpath.o: colvarcomp_gpath.cpp colvarmodule.h \
|
||||
colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \
|
||||
colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \
|
||||
colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_protein.o: colvarcomp_protein.cpp \
|
||||
colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \
|
||||
colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \
|
||||
colvar_geometricpath.h
|
||||
colvaratoms.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_rotations.o: colvarcomp_rotations.cpp \
|
||||
colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \
|
||||
colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \
|
||||
colvar_geometricpath.h
|
||||
colvaratoms.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarcomp_volmaps.o: colvarcomp_volmaps.cpp \
|
||||
colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \
|
||||
colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \
|
||||
colvaratoms.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvar.o: colvar.cpp colvarmodule.h colvars_version.h \
|
||||
colvarvalue.h colvartypes.h colvarparse.h colvarparams.h colvar.h \
|
||||
colvardeps.h colvarcomp.h colvaratoms.h colvarproxy.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h colvarscript.h \
|
||||
colvarbias.h
|
||||
colvardeps.h colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \
|
||||
colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h \
|
||||
colvarscript.h colvarbias.h colvarscript_commands.h \
|
||||
colvarscript_commands_colvar.h colvarscript_commands_bias.h
|
||||
$(COLVARS_OBJ_DIR)colvardeps.o: colvardeps.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvardeps.h \
|
||||
colvarparse.h colvarparams.h
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvarparse.h \
|
||||
colvarparams.h
|
||||
$(COLVARS_OBJ_DIR)colvargrid.o: colvargrid.cpp colvarmodule.h \
|
||||
colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \
|
||||
colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \
|
||||
colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h \
|
||||
colvargrid.h
|
||||
colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h colvargrid.h
|
||||
$(COLVARS_OBJ_DIR)colvarmodule.o: colvarmodule.cpp colvarmodule.h \
|
||||
colvars_version.h colvarparse.h colvarvalue.h colvartypes.h \
|
||||
colvarparams.h colvarproxy.h colvar.h colvardeps.h colvarbias.h \
|
||||
colvarbias_abf.h colvargrid.h colvar_UIestimator.h colvarbias_alb.h \
|
||||
colvarbias_histogram.h colvarbias_meta.h colvarbias_restraint.h \
|
||||
colvarscript.h colvaratoms.h colvarcomp.h colvar_arithmeticpath.h \
|
||||
colvar_geometricpath.h
|
||||
colvarparams.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \
|
||||
colvar.h colvardeps.h colvarbias.h colvarbias_abf.h colvargrid.h \
|
||||
colvar_UIestimator.h colvarbias_alb.h colvarbias_histogram.h \
|
||||
colvarbias_meta.h colvarbias_restraint.h colvarscript.h \
|
||||
colvarscript_commands.h colvarscript_commands_colvar.h \
|
||||
colvarscript_commands_bias.h colvaratoms.h colvarcomp.h \
|
||||
colvar_arithmeticpath.h colvar_geometricpath.h
|
||||
$(COLVARS_OBJ_DIR)colvarparams.o: colvarparams.cpp colvarmodule.h \
|
||||
colvars_version.h colvarvalue.h colvartypes.h colvarparams.h
|
||||
$(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \
|
||||
@ -86,15 +105,43 @@ $(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \
|
||||
colvarparams.h
|
||||
$(COLVARS_OBJ_DIR)colvarproxy.o: colvarproxy.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarscript.h colvarbias.h colvar.h colvarparse.h colvarparams.h \
|
||||
colvardeps.h colvaratoms.h
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvarscript.h colvarbias.h \
|
||||
colvar.h colvarparse.h colvarparams.h colvardeps.h \
|
||||
colvarscript_commands.h colvarscript_commands_colvar.h \
|
||||
colvarscript_commands_bias.h colvaratoms.h
|
||||
$(COLVARS_OBJ_DIR)colvarproxy_replicas.o: colvarproxy_replicas.cpp \
|
||||
colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \
|
||||
colvarvalue.h
|
||||
$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarscript.h \
|
||||
colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \
|
||||
colvarbias.h colvar.h colvarparse.h colvarparams.h colvardeps.h \
|
||||
colvarproxy.h
|
||||
colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h
|
||||
$(COLVARS_OBJ_DIR)colvarproxy_tcl.o: colvarproxy_tcl.cpp colvarmodule.h \
|
||||
colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvaratoms.h colvarparse.h \
|
||||
colvarparams.h colvardeps.h
|
||||
$(COLVARS_OBJ_DIR)colvarproxy_volmaps.o: colvarproxy_volmaps.cpp \
|
||||
colvarmodule.h colvars_version.h colvarproxy_volmaps.h
|
||||
$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarproxy.h \
|
||||
colvarmodule.h colvars_version.h colvartypes.h colvarvalue.h \
|
||||
colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvarparse.h \
|
||||
colvarparams.h colvarscript.h colvarbias.h colvar.h \
|
||||
colvarscript_commands.h colvarscript_commands_colvar.h \
|
||||
colvarscript_commands_bias.h
|
||||
$(COLVARS_OBJ_DIR)colvarscript_commands.o: colvarscript_commands.cpp \
|
||||
colvarproxy.h colvarmodule.h colvars_version.h colvartypes.h \
|
||||
colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h \
|
||||
colvarparse.h colvarparams.h colvarscript.h colvarbias.h colvar.h \
|
||||
colvarscript_commands.h colvarscript_commands_colvar.h \
|
||||
colvarscript_commands_bias.h
|
||||
$(COLVARS_OBJ_DIR)colvarscript_commands_bias.o: \
|
||||
colvarscript_commands_bias.cpp colvarproxy.h colvarmodule.h \
|
||||
colvars_version.h colvartypes.h colvarvalue.h colvarproxy_tcl.h \
|
||||
colvarproxy_volmaps.h colvardeps.h colvarparse.h colvarparams.h \
|
||||
colvarscript.h colvarbias.h colvar.h colvarscript_commands.h \
|
||||
colvarscript_commands_colvar.h colvarscript_commands_bias.h
|
||||
$(COLVARS_OBJ_DIR)colvarscript_commands_colvar.o: \
|
||||
colvarscript_commands_colvar.cpp colvarproxy.h colvarmodule.h \
|
||||
colvars_version.h colvartypes.h colvarvalue.h colvarproxy_tcl.h \
|
||||
colvarproxy_volmaps.h colvardeps.h colvarparse.h colvarparams.h \
|
||||
colvarscript.h colvarbias.h colvar.h colvarscript_commands.h \
|
||||
colvarscript_commands_colvar.h colvarscript_commands_bias.h
|
||||
$(COLVARS_OBJ_DIR)colvartypes.o: colvartypes.cpp colvarmodule.h \
|
||||
colvars_version.h colvartypes.h colvarparse.h colvarvalue.h \
|
||||
colvarparams.h
|
||||
|
||||
@ -541,7 +541,7 @@ int colvar::init_grid_parameters(std::string const &conf)
|
||||
cvm::log("Reading legacy options lowerWall and lowerWallConstant: "
|
||||
"consider using a harmonicWalls restraint (caution: force constant would then be scaled by width^2).\n");
|
||||
if (!get_keyval(conf, "lowerWall", lower_wall)) {
|
||||
error_code != cvm::error("Error: the value of lowerWall must be set "
|
||||
error_code |= cvm::error("Error: the value of lowerWall must be set "
|
||||
"explicitly.\n", INPUT_ERROR);
|
||||
}
|
||||
lw_conf = std::string("\n\
|
||||
@ -554,7 +554,7 @@ int colvar::init_grid_parameters(std::string const &conf)
|
||||
cvm::log("Reading legacy options upperWall and upperWallConstant: "
|
||||
"consider using a harmonicWalls restraint (caution: force constant would then be scaled by width^2).\n");
|
||||
if (!get_keyval(conf, "upperWall", upper_wall)) {
|
||||
error_code != cvm::error("Error: the value of upperWall must be set "
|
||||
error_code |= cvm::error("Error: the value of upperWall must be set "
|
||||
"explicitly.\n", INPUT_ERROR);
|
||||
}
|
||||
uw_conf = std::string("\n\
|
||||
@ -616,7 +616,7 @@ harmonicWalls {\n\
|
||||
"are enabled).\n", INPUT_ERROR);
|
||||
}
|
||||
|
||||
return COLVARS_OK;
|
||||
return error_code;
|
||||
}
|
||||
|
||||
|
||||
@ -681,6 +681,9 @@ int colvar::init_extended_Lagrangian(std::string const &conf)
|
||||
// Adjust Langevin sigma for slow time step if time_step_factor != 1
|
||||
ext_sigma = cvm::sqrt(2.0 * cvm::boltzmann() * temp * ext_gamma * ext_mass / (cvm::dt() * cvm::real(time_step_factor)));
|
||||
}
|
||||
|
||||
get_keyval_feature(this, conf, "reflectingLowerBoundary", f_cv_reflecting_lower_boundary, false);
|
||||
get_keyval_feature(this, conf, "reflectingUpperBoundary", f_cv_reflecting_upper_boundary, false);
|
||||
}
|
||||
|
||||
return COLVARS_OK;
|
||||
@ -863,6 +866,8 @@ int colvar::init_components(std::string const &conf)
|
||||
error_code |= init_components_type<aspathCV>(conf, "arithmetic path collective variables (s) for other CVs", "aspathCV");
|
||||
error_code |= init_components_type<azpathCV>(conf, "arithmetic path collective variables (s) for other CVs", "azpathCV");
|
||||
|
||||
error_code |= init_components_type<map_total>(conf, "total value of atomic map", "mapTotal");
|
||||
|
||||
if (!cvcs.size() || (error_code != COLVARS_OK)) {
|
||||
cvm::error("Error: no valid components were provided "
|
||||
"for this collective variable.\n",
|
||||
@ -1040,85 +1045,93 @@ int colvar::init_dependencies() {
|
||||
init_feature(f_cv_gradient, "gradient", f_type_dynamic);
|
||||
require_feature_children(f_cv_gradient, f_cvc_gradient);
|
||||
|
||||
init_feature(f_cv_collect_gradient, "collect gradient", f_type_dynamic);
|
||||
init_feature(f_cv_collect_gradient, "collect_gradient", f_type_dynamic);
|
||||
require_feature_self(f_cv_collect_gradient, f_cv_gradient);
|
||||
require_feature_self(f_cv_collect_gradient, f_cv_scalar);
|
||||
// The following exlusion could be lifted by implementing the feature
|
||||
exclude_feature_self(f_cv_collect_gradient, f_cv_scripted);
|
||||
require_feature_children(f_cv_collect_gradient, f_cvc_explicit_gradient);
|
||||
|
||||
init_feature(f_cv_fdiff_velocity, "velocity from finite differences", f_type_dynamic);
|
||||
init_feature(f_cv_fdiff_velocity, "velocity_from_finite_differences", f_type_dynamic);
|
||||
|
||||
// System force: either trivial (spring force); through extended Lagrangian, or calculated explicitly
|
||||
init_feature(f_cv_total_force, "total force", f_type_dynamic);
|
||||
init_feature(f_cv_total_force, "total_force", f_type_dynamic);
|
||||
require_feature_alt(f_cv_total_force, f_cv_extended_Lagrangian, f_cv_total_force_calc);
|
||||
|
||||
// Deps for explicit total force calculation
|
||||
init_feature(f_cv_total_force_calc, "total force calculation", f_type_dynamic);
|
||||
init_feature(f_cv_total_force_calc, "total_force_calculation", f_type_dynamic);
|
||||
require_feature_self(f_cv_total_force_calc, f_cv_scalar);
|
||||
require_feature_self(f_cv_total_force_calc, f_cv_linear);
|
||||
require_feature_children(f_cv_total_force_calc, f_cvc_inv_gradient);
|
||||
require_feature_self(f_cv_total_force_calc, f_cv_Jacobian);
|
||||
|
||||
init_feature(f_cv_Jacobian, "Jacobian derivative", f_type_dynamic);
|
||||
init_feature(f_cv_Jacobian, "Jacobian_derivative", f_type_dynamic);
|
||||
require_feature_self(f_cv_Jacobian, f_cv_scalar);
|
||||
require_feature_self(f_cv_Jacobian, f_cv_linear);
|
||||
require_feature_children(f_cv_Jacobian, f_cvc_Jacobian);
|
||||
|
||||
init_feature(f_cv_hide_Jacobian, "hide Jacobian force", f_type_user);
|
||||
init_feature(f_cv_hide_Jacobian, "hide_Jacobian_force", f_type_user);
|
||||
require_feature_self(f_cv_hide_Jacobian, f_cv_Jacobian); // can only hide if calculated
|
||||
|
||||
init_feature(f_cv_extended_Lagrangian, "extended Lagrangian", f_type_user);
|
||||
init_feature(f_cv_extended_Lagrangian, "extended_Lagrangian", f_type_user);
|
||||
require_feature_self(f_cv_extended_Lagrangian, f_cv_scalar);
|
||||
require_feature_self(f_cv_extended_Lagrangian, f_cv_gradient);
|
||||
|
||||
init_feature(f_cv_Langevin, "Langevin dynamics", f_type_user);
|
||||
init_feature(f_cv_Langevin, "Langevin_dynamics", f_type_user);
|
||||
require_feature_self(f_cv_Langevin, f_cv_extended_Lagrangian);
|
||||
|
||||
init_feature(f_cv_single_cvc, "single component", f_type_static);
|
||||
init_feature(f_cv_single_cvc, "single_component", f_type_static);
|
||||
|
||||
init_feature(f_cv_linear, "linear", f_type_static);
|
||||
|
||||
init_feature(f_cv_scalar, "scalar", f_type_static);
|
||||
|
||||
init_feature(f_cv_output_energy, "output energy", f_type_user);
|
||||
init_feature(f_cv_output_energy, "output_energy", f_type_user);
|
||||
|
||||
init_feature(f_cv_output_value, "output value", f_type_user);
|
||||
init_feature(f_cv_output_value, "output_value", f_type_user);
|
||||
|
||||
init_feature(f_cv_output_velocity, "output velocity", f_type_user);
|
||||
init_feature(f_cv_output_velocity, "output_velocity", f_type_user);
|
||||
require_feature_self(f_cv_output_velocity, f_cv_fdiff_velocity);
|
||||
|
||||
init_feature(f_cv_output_applied_force, "output applied force", f_type_user);
|
||||
init_feature(f_cv_output_applied_force, "output_applied_force", f_type_user);
|
||||
|
||||
init_feature(f_cv_output_total_force, "output total force", f_type_user);
|
||||
init_feature(f_cv_output_total_force, "output_total_force", f_type_user);
|
||||
require_feature_self(f_cv_output_total_force, f_cv_total_force);
|
||||
|
||||
init_feature(f_cv_subtract_applied_force, "subtract applied force from total force", f_type_user);
|
||||
init_feature(f_cv_subtract_applied_force, "subtract_applied_force_from_total_force", f_type_user);
|
||||
require_feature_self(f_cv_subtract_applied_force, f_cv_total_force);
|
||||
|
||||
init_feature(f_cv_lower_boundary, "lower boundary", f_type_user);
|
||||
init_feature(f_cv_lower_boundary, "lower_boundary", f_type_user);
|
||||
require_feature_self(f_cv_lower_boundary, f_cv_scalar);
|
||||
|
||||
init_feature(f_cv_upper_boundary, "upper boundary", f_type_user);
|
||||
init_feature(f_cv_upper_boundary, "upper_boundary", f_type_user);
|
||||
require_feature_self(f_cv_upper_boundary, f_cv_scalar);
|
||||
|
||||
init_feature(f_cv_hard_lower_boundary, "hard lower boundary", f_type_user);
|
||||
init_feature(f_cv_hard_lower_boundary, "hard_lower_boundary", f_type_user);
|
||||
require_feature_self(f_cv_hard_lower_boundary, f_cv_lower_boundary);
|
||||
|
||||
init_feature(f_cv_hard_upper_boundary, "hard upper boundary", f_type_user);
|
||||
init_feature(f_cv_hard_upper_boundary, "hard_upper_boundary", f_type_user);
|
||||
require_feature_self(f_cv_hard_upper_boundary, f_cv_upper_boundary);
|
||||
|
||||
init_feature(f_cv_reflecting_lower_boundary, "reflecting_lower_boundary", f_type_user);
|
||||
require_feature_self(f_cv_reflecting_lower_boundary, f_cv_lower_boundary);
|
||||
require_feature_self(f_cv_reflecting_lower_boundary, f_cv_extended_Lagrangian);
|
||||
|
||||
init_feature(f_cv_reflecting_upper_boundary, "reflecting_upper_boundary", f_type_user);
|
||||
require_feature_self(f_cv_reflecting_upper_boundary, f_cv_upper_boundary);
|
||||
require_feature_self(f_cv_reflecting_upper_boundary, f_cv_extended_Lagrangian);
|
||||
|
||||
init_feature(f_cv_grid, "grid", f_type_dynamic);
|
||||
require_feature_self(f_cv_grid, f_cv_lower_boundary);
|
||||
require_feature_self(f_cv_grid, f_cv_upper_boundary);
|
||||
|
||||
init_feature(f_cv_runave, "running average", f_type_user);
|
||||
init_feature(f_cv_runave, "running_average", f_type_user);
|
||||
|
||||
init_feature(f_cv_corrfunc, "correlation function", f_type_user);
|
||||
init_feature(f_cv_corrfunc, "correlation_function", f_type_user);
|
||||
|
||||
init_feature(f_cv_scripted, "scripted", f_type_user);
|
||||
|
||||
init_feature(f_cv_custom_function, "custom function", f_type_user);
|
||||
init_feature(f_cv_custom_function, "custom_function", f_type_user);
|
||||
exclude_feature_self(f_cv_custom_function, f_cv_scripted);
|
||||
|
||||
init_feature(f_cv_periodic, "periodic", f_type_static);
|
||||
@ -1129,7 +1142,7 @@ int colvar::init_dependencies() {
|
||||
|
||||
// because total forces are obtained from the previous time step,
|
||||
// we cannot (currently) have colvar values and total forces for the same timestep
|
||||
init_feature(f_cv_multiple_ts, "multiple timestep colvar", f_type_static);
|
||||
init_feature(f_cv_multiple_ts, "multiple_timestep", f_type_static);
|
||||
exclude_feature_self(f_cv_multiple_ts, f_cv_total_force_calc);
|
||||
|
||||
// check that everything is initialized
|
||||
@ -1199,8 +1212,17 @@ colvar::~colvar()
|
||||
(*ci)->remove_all_children();
|
||||
delete *ci;
|
||||
}
|
||||
cvcs.clear();
|
||||
|
||||
// remove reference to this colvar from the CVM
|
||||
while (biases.size() > 0) {
|
||||
size_t const i = biases.size()-1;
|
||||
cvm::log("Warning: before deleting colvar " + name
|
||||
+ ", deleting related bias " + biases[i]->name);
|
||||
delete biases[i];
|
||||
}
|
||||
biases.clear();
|
||||
|
||||
// remove reference to this colvar from the module
|
||||
colvarmodule *cv = cvm::main();
|
||||
for (std::vector<colvar *>::iterator cvi = cv->variables()->begin();
|
||||
cvi != cv->variables()->end();
|
||||
@ -1211,6 +1233,8 @@ colvar::~colvar()
|
||||
}
|
||||
}
|
||||
|
||||
cv->config_changed();
|
||||
|
||||
#ifdef LEPTON
|
||||
for (std::vector<Lepton::CompiledExpression *>::iterator cei = value_evaluators.begin();
|
||||
cei != value_evaluators.end();
|
||||
@ -1599,6 +1623,15 @@ int colvar::calc_colvar_properties()
|
||||
// just calculated from the cvcs
|
||||
if ((cvm::step_relative() == 0 && !after_restart) || x_ext.type() == colvarvalue::type_notset) {
|
||||
x_ext = x;
|
||||
if (is_enabled(f_cv_reflecting_lower_boundary) && x_ext < lower_boundary) {
|
||||
cvm::log("Warning: initializing extended coordinate to reflective lower boundary, as colvar value is below.");
|
||||
x_ext = lower_boundary;
|
||||
}
|
||||
if (is_enabled(f_cv_reflecting_upper_boundary) && x_ext > upper_boundary) {
|
||||
cvm::log("Warning: initializing extended coordinate to reflective upper boundary, as colvar value is above.");
|
||||
x_ext = upper_boundary;
|
||||
}
|
||||
|
||||
v_ext.reset(); // (already 0; added for clarity)
|
||||
}
|
||||
|
||||
@ -1672,10 +1705,10 @@ cvm::real colvar::update_forces_energy()
|
||||
cvm::log("Updating extended-Lagrangian degree of freedom.\n");
|
||||
}
|
||||
|
||||
if (prev_timestep > -1) {
|
||||
if (prev_timestep > -1L) {
|
||||
// Keep track of slow timestep to integrate MTS colvars
|
||||
// the colvar checks the interval after waking up twice
|
||||
int n_timesteps = cvm::step_relative() - prev_timestep;
|
||||
cvm::step_number n_timesteps = cvm::step_relative() - prev_timestep;
|
||||
if (n_timesteps != 0 && n_timesteps != time_step_factor) {
|
||||
cvm::error("Error: extended-Lagrangian " + description + " has timeStepFactor " +
|
||||
cvm::to_str(time_step_factor) + ", but was activated after " + cvm::to_str(n_timesteps) +
|
||||
@ -1737,6 +1770,14 @@ cvm::real colvar::update_forces_energy()
|
||||
}
|
||||
v_ext += (0.5 * dt) * f_ext / ext_mass;
|
||||
x_ext += dt * v_ext;
|
||||
|
||||
cvm::real delta = 0; // Length of overshoot past either reflecting boundary
|
||||
if ((is_enabled(f_cv_reflecting_lower_boundary) && (delta = x_ext - lower_boundary) < 0) ||
|
||||
(is_enabled(f_cv_reflecting_upper_boundary) && (delta = x_ext - upper_boundary) > 0)) {
|
||||
x_ext -= 2.0 * delta;
|
||||
v_ext *= -1.0;
|
||||
}
|
||||
|
||||
x_ext.apply_constraints();
|
||||
this->wrap(x_ext);
|
||||
} else {
|
||||
@ -2082,7 +2123,7 @@ void colvar::wrap(colvarvalue &x_unwrapped) const
|
||||
|
||||
std::istream & colvar::read_state(std::istream &is)
|
||||
{
|
||||
size_t const start_pos = is.tellg();
|
||||
std::streampos const start_pos = is.tellg();
|
||||
|
||||
std::string conf;
|
||||
if ( !(is >> colvarparse::read_block("colvar", &conf)) ) {
|
||||
@ -2163,7 +2204,7 @@ std::istream & colvar::read_state(std::istream &is)
|
||||
|
||||
std::istream & colvar::read_traj(std::istream &is)
|
||||
{
|
||||
size_t const start_pos = is.tellg();
|
||||
std::streampos const start_pos = is.tellg();
|
||||
|
||||
if (is_enabled(f_cv_output_value)) {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user