From 0d6ec02d5acffefb18dc39990cc1377d2d64b64f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 12 Jan 2020 14:31:05 -0500 Subject: [PATCH] small corrections and more cleanup --- doc/src/Commands_fix.rst | 1 - src/USER-MISC/README | 1 + src/USER-MISC/fix_npt_cauchy.cpp | 15 +++++++++++---- src/USER-MISC/fix_npt_cauchy.h | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 0a6f6db343..9629093fde 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -238,4 +238,3 @@ OPT. * :doc:`wall/region ` * :doc:`wall/region/ees ` * :doc:`wall/srd ` - * diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 18b8cfb58d..99187c0d9f 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -57,6 +57,7 @@ fix gle, Michele Ceriotti (EPFL Lausanne), michele.ceriotti at gmail.com, 24 Nov fix grem, David Stelter, dstelter@bu.edu, 22 Nov 16 fix imd, Axel Kohlmeyer, akohlmey at gmail.com, 9 Nov 2009 fix ipi, Michele Ceriotti (EPFL Lausanne), michele.ceriotti at gmail.com, 24 Nov 2014 +fix npt/cauchy, R. E. Miller (Carleton University), F. Pavia and S. Pattamatta, 12 Jan 2020 fix nvk, Efrem Braun (UC Berkeley), efrem.braun at gmail.com, https://github.com/lammps/lammps/pull/310 fix pimd, Yuxing Peng (U Chicago), yuxing at uchicago.edu, 24 Nov 2014 fix rhok, Ulf Pedersen (Roskilde U), ulf at urp.dk, 25 Sep 2017 diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index ea09a36f4b..41d76f0bfc 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -2729,11 +2729,18 @@ void FixNPTCauchy::CauchyStat_Step(double (&Fi)[3][3], double (&Fdot)[3][3], int i,j,m,n; double deltastress[6],fdotvec[6]; - double dsdf[6][6]={0.0}; //zeroed, used in incremental form - double dsds[6][6]={0.0}; //zeroed, used in incremental form + double dsdf[6][6]; + double dsds[6][6]; double jac; - double deltaF[6]={0.0}; //zeroed, used in incremental form - double deltaPK[6]={0.0}; //zeroed, used in incremental form + double deltaF[6]; + double deltaPK[6]; + + // zero arrays + for (i = 0; i < 6; ++i) { + deltaF[i] = deltaPK[i] = deltastress[i] = fdotvec[i] = 0.0; + for (j = 0; j < 6; ++j) + dsdf[i][j] = dsds[i][j] = 0.0; + } int uv[6][2]; uv(1,1)=1; uv(1,2)=1; diff --git a/src/USER-MISC/fix_npt_cauchy.h b/src/USER-MISC/fix_npt_cauchy.h index ca85d90579..052a5686ad 100644 --- a/src/USER-MISC/fix_npt_cauchy.h +++ b/src/USER-MISC/fix_npt_cauchy.h @@ -179,6 +179,7 @@ class FixNPTCauchy : public Fix { } +#endif #endif /* ERROR/WARNING messages: