Merge pull request #2347 from jewettaij/math_eigen

Replace eigensolver code in LAMMPS with math_eigen.h and updated docs
This commit is contained in:
Axel Kohlmeyer
2020-09-17 00:28:12 -04:00
committed by GitHub
42 changed files with 3041 additions and 2240 deletions

View File

@ -431,6 +431,7 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
@LAMMPS_SOURCE_DIR@/my_page.h \ @LAMMPS_SOURCE_DIR@/my_page.h \
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \ @LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \ @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 # 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 # directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -10,7 +10,7 @@ strings into specific types of numbers with checking for validity. This
reduces redundant implementations and encourages consistent behavior. reduces redundant implementations and encourages consistent behavior.
I/O with status check I/O with status check
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
These are wrappers around the corresponding C library calls like These are wrappers around the corresponding C library calls like
``fgets()`` or ``fread()``. They will check if there were errors ``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 .. doxygenfunction:: sfread
:project: progguide :project: progguide
----------
String to number conversions with validity check String to number conversions with validity check
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -281,6 +283,8 @@ This code example should produce the following output:
:project: progguide :project: progguide
:members: what :members: what
----------
File reader classes 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: 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) # 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) # 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 :project: progguide
:members: :members:
---------- ----------
Memory pool classes Memory pool classes
@ -415,3 +420,43 @@ its size is registered later with :cpp:func:`vgot()
.. doxygenclass:: LAMMPS_NS::MyPoolChunk .. doxygenclass:: LAMMPS_NS::MyPoolChunk
:project: progguide :project: progguide
:members: :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

View File

@ -325,6 +325,7 @@ Buyl
Bybee Bybee
bz bz
cadetblue cadetblue
calc
calibre calibre
caltech caltech
Caltech Caltech
@ -397,6 +398,7 @@ ChiralIDs
chiralIDs chiralIDs
chirality chirality
Cho Cho
ChooseOffset
chris chris
Christoph Christoph
Chu Chu
@ -469,6 +471,7 @@ config
configfile configfile
configurational configurational
conformational conformational
ConstMatrix
Contrib Contrib
cooperativity cooperativity
coord coord
@ -639,7 +642,10 @@ dhex
dia dia
diag diag
diagonalization diagonalization
diagonalize
diagonalized diagonalized
diagonalizers
diagonalizing
Diallo Diallo
diel diel
differentiable differentiable
@ -778,8 +784,15 @@ Eggebrecht
ehex ehex
eHEX eHEX
Ei Ei
Eigen eigen
Eigensolve eigensolve
eigensolver
eigensolvers
eigendecomposition
eigenvalue
eigenvalues
eigenvector
eigenvectors
eij eij
Eij Eij
Eijnden Eijnden
@ -893,6 +906,11 @@ eV
evalue evalue
Evanseck Evanseck
evdwl evdwl
evector
evec
evecs
eval
evals
Everaers Everaers
Evgeny Evgeny
evirials evirials
@ -1069,6 +1087,7 @@ Germann
Germano Germano
gerolf gerolf
Gerolf Gerolf
Gershgorin
gettimeofday gettimeofday
gewald gewald
Gezelter Gezelter
@ -1184,6 +1203,7 @@ Henkelman
Henkes Henkes
henrich henrich
Henrich Henrich
Hermitian
Herrmann Herrmann
Hertizian Hertizian
hertzian hertzian
@ -1257,6 +1277,7 @@ icosahedral
idealgas idealgas
IDR IDR
idx idx
ie
ielement ielement
ieni ieni
ifdefs ifdefs
@ -1279,6 +1300,7 @@ Imageint
Imagemagick Imagemagick
imd imd
Impey Impey
impl
impropers impropers
Impropers Impropers
includelink includelink
@ -1348,6 +1370,8 @@ isothermal
isotropically isotropically
isovolume isovolume
Isralewitz Isralewitz
iter
iters
iteratively iteratively
Ith Ith
Itsets Itsets
@ -1524,6 +1548,7 @@ Kub
Kubo Kubo
Kumagai Kumagai
Kumar Kumar
Kurebayashi
Kuronen Kuronen
Kusters Kusters
Kutta Kutta
@ -1534,12 +1559,14 @@ Ladd
lagrangian lagrangian
lambdai lambdai
lamda lamda
LambdaLanczos
lammps lammps
Lammps Lammps
LAMMPS LAMMPS
lammpsplot lammpsplot
Lampis Lampis
Lamoureux Lamoureux
Lanczos
Lande Lande
Landron Landron
langevin langevin
@ -1847,6 +1874,7 @@ Microscale
midnightblue midnightblue
mie mie
Mie Mie
Mij
Mikami Mikami
Militzer Militzer
Minary Minary
@ -1945,6 +1973,7 @@ Muccioli
mui mui
Mukherjee Mukherjee
Mulders Mulders
mult
multi multi
multibody multibody
Multibody Multibody
@ -2331,6 +2360,7 @@ peachpuff
Pearlman Pearlman
Pedersen Pedersen
peID peID
PEigenDense
Peng Peng
peptide peptide
peratom peratom
@ -2559,6 +2589,8 @@ rdf
RDideal RDideal
rdx rdx
reacter reacter
realTypeMap
real_t
README README
realtime realtime
reamin reamin
@ -2741,6 +2773,7 @@ Schuring
Schwen Schwen
screenshot screenshot
screenshots screenshots
Scripps
Scripta Scripta
sdk sdk
sdpd sdpd
@ -3069,6 +3102,7 @@ Tmin
tmp tmp
tN tN
Tobias Tobias
Tohoku
tokenizer tokenizer
tokyo tokyo
tol tol
@ -3132,6 +3166,8 @@ tu
Tuckerman Tuckerman
tue tue
tunable tunable
tuple
tuples
Turkand Turkand
Tutein Tutein
tweakable tweakable
@ -3425,6 +3461,7 @@ Yuh
yukawa yukawa
Yukawa Yukawa
Yusof Yusof
Yuya
yx yx
yy yy
yz yz

1
src/.gitignore vendored
View File

@ -33,7 +33,6 @@
/pair_kim.h /pair_kim.h
/superpose3d.h /superpose3d.h
/math_eigen.h
/kokkos.cpp /kokkos.cpp
/kokkos.h /kokkos.h

View File

@ -17,6 +17,7 @@
#include "atom_vec_body.h" #include "atom_vec_body.h"
#include "error.h" #include "error.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "my_pool_chunk.h" #include "my_pool_chunk.h"
@ -136,7 +137,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble,
double *inertia = bonus->inertia; double *inertia = bonus->inertia;
double evectors[3][3]; double evectors[3][3];
int ierror = MathExtra::jacobi(tensor,inertia,evectors); int ierror = MathEigen::jacobi3(tensor,inertia,evectors);
if (ierror) error->one(FLERR, if (ierror) error->one(FLERR,
"Insufficient Jacobi rotations for body nparticle"); "Insufficient Jacobi rotations for body nparticle");

View File

@ -22,6 +22,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "my_pool_chunk.h" #include "my_pool_chunk.h"
@ -198,7 +199,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble,
double *inertia = bonus->inertia; double *inertia = bonus->inertia;
double evectors[3][3]; double evectors[3][3];
int ierror = MathExtra::jacobi(tensor,inertia,evectors); int ierror = MathEigen::jacobi3(tensor,inertia,evectors);
if (ierror) error->one(FLERR, if (ierror) error->one(FLERR,
"Insufficient Jacobi rotations for body nparticle"); "Insufficient Jacobi rotations for body nparticle");

View File

@ -21,6 +21,7 @@
#include "atom_vec_body.h" #include "atom_vec_body.h"
#include "error.h" #include "error.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "my_pool_chunk.h" #include "my_pool_chunk.h"
@ -242,7 +243,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble,
double *inertia = bonus->inertia; double *inertia = bonus->inertia;
double evectors[3][3]; double evectors[3][3];
int ierror = MathExtra::jacobi(tensor,inertia,evectors); int ierror = MathEigen::jacobi3(tensor,inertia,evectors);
if (ierror) error->one(FLERR, if (ierror) error->one(FLERR,
"Insufficient Jacobi rotations for body nparticle"); "Insufficient Jacobi rotations for body nparticle");

View File

@ -34,8 +34,7 @@
#include "citeme.h" #include "citeme.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
#include "math_eigen.h"
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
using namespace FixConst; using namespace FixConst;
@ -44,7 +43,6 @@ using namespace FixConst;
#define DELTA 128 #define DELTA 128
#define TOLERANCE 1.0e-6 #define TOLERANCE 1.0e-6
#define EPSILON 1.0e-7 #define EPSILON 1.0e-7
#define MAXJACOBI 50
static const char cite_fix_poems[] = static const char cite_fix_poems[] =
"fix poems command:\n\n" "fix poems command:\n\n"
@ -492,7 +490,7 @@ void FixPOEMS::init()
tensor[1][2] = tensor[2][1] = all[ibody][4]; tensor[1][2] = tensor[2][1] = all[ibody][4];
tensor[0][2] = tensor[2][0] = all[ibody][5]; tensor[0][2] = tensor[2][0] = all[ibody][5];
ierror = jacobi(tensor,inertia[ibody],evectors); ierror = MathEigen::jacobi3(tensor,inertia[ibody],evectors);
if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for POEMS body"); if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for POEMS body");
ex_space[ibody][0] = evectors[0][0]; ex_space[ibody][0] = evectors[0][0];
@ -1283,88 +1281,6 @@ int FixPOEMS::loopcheck(int nvert, int nedge, tagint **elist)
return 0; return 0;
} }
/* ----------------------------------------------------------------------
compute evalues and evectors of 3x3 real symmetric matrix
based on Jacobi rotations
adapted from Numerical Recipes jacobi() function
------------------------------------------------------------------------- */
int FixPOEMS::jacobi(double **matrix, double *evalues, double **evectors)
{
int i,j,k;
double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3];
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) evectors[i][j] = 0.0;
evectors[i][i] = 1.0;
}
for (i = 0; i < 3; i++) {
b[i] = evalues[i] = matrix[i][i];
z[i] = 0.0;
}
for (int iter = 1; iter <= MAXJACOBI; iter++) {
sm = 0.0;
for (i = 0; i < 2; i++)
for (j = i+1; j < 3; j++)
sm += fabs(matrix[i][j]);
if (sm == 0.0) return 0;
if (iter < 4) tresh = 0.2*sm/(3*3);
else tresh = 0.0;
for (i = 0; i < 2; i++) {
for (j = i+1; j < 3; j++) {
g = 100.0*fabs(matrix[i][j]);
if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
&& fabs(evalues[j])+g == fabs(evalues[j]))
matrix[i][j] = 0.0;
else if (fabs(matrix[i][j]) > tresh) {
h = evalues[j]-evalues[i];
if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
else {
theta = 0.5*h/(matrix[i][j]);
t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
if (theta < 0.0) t = -t;
}
c = 1.0/sqrt(1.0+t*t);
s = t*c;
tau = s/(1.0+c);
h = t*matrix[i][j];
z[i] -= h;
z[j] += h;
evalues[i] -= h;
evalues[j] += h;
matrix[i][j] = 0.0;
for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
}
}
}
for (i = 0; i < 3; i++) {
evalues[i] = b[i] += z[i];
z[i] = 0.0;
}
}
return 1;
}
/* ----------------------------------------------------------------------
perform a single Jacobi rotation
------------------------------------------------------------------------- */
void FixPOEMS::rotate(double **matrix, int i, int j, int k, int l,
double s, double tau)
{
double g = matrix[i][j];
double h = matrix[k][l];
matrix[i][j] = g-s*(h+g*tau);
matrix[k][l] = h+s*(g-h*tau);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
compute omega from angular momentum compute omega from angular momentum
w = omega = angular velocity in space frame w = omega = angular velocity in space frame

View File

@ -106,8 +106,6 @@ class FixPOEMS : public Fix {
void jointbuild(); void jointbuild();
void sortlist(int, tagint **); void sortlist(int, tagint **);
int loopcheck(int, int, tagint **); int loopcheck(int, int, tagint **);
int jacobi(double **, double *, double **);
void rotate(double **, int, int, int, int, double, double);
void omega_from_mq(double *, double *, double *, double *, void omega_from_mq(double *, double *, double *, double *,
double *, double *); double *, double *);
void set_v(); void set_v();

View File

@ -17,6 +17,7 @@
#include <cstring> #include <cstring>
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "atom.h" #include "atom.h"
#include "atom_vec_ellipsoid.h" #include "atom_vec_ellipsoid.h"
#include "atom_vec_line.h" #include "atom_vec_line.h"
@ -1959,7 +1960,7 @@ void FixRigid::setup_bodies_static()
tensor[0][2] = tensor[2][0] = all[ibody][4]; tensor[0][2] = tensor[2][0] = all[ibody][4];
tensor[0][1] = tensor[1][0] = all[ibody][5]; tensor[0][1] = tensor[1][0] = all[ibody][5];
ierror = MathExtra::jacobi(tensor,inertia[ibody],evectors); ierror = MathEigen::jacobi3(tensor,inertia[ibody],evectors);
if (ierror) error->all(FLERR, if (ierror) error->all(FLERR,
"Insufficient Jacobi rotations for rigid body"); "Insufficient Jacobi rotations for rigid body");

View File

@ -18,6 +18,7 @@
#include <cstring> #include <cstring>
#include <utility> #include <utility>
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "atom.h" #include "atom.h"
#include "atom_vec_ellipsoid.h" #include "atom_vec_ellipsoid.h"
#include "atom_vec_line.h" #include "atom_vec_line.h"
@ -2100,7 +2101,7 @@ void FixRigidSmall::setup_bodies_static()
tensor[0][1] = tensor[1][0] = itensor[ibody][5]; tensor[0][1] = tensor[1][0] = itensor[ibody][5];
inertia = body[ibody].inertia; inertia = body[ibody].inertia;
ierror = MathExtra::jacobi(tensor,inertia,evectors); ierror = MathEigen::jacobi3(tensor,inertia,evectors);
if (ierror) error->all(FLERR, if (ierror) error->all(FLERR,
"Insufficient Jacobi rotations for rigid body"); "Insufficient Jacobi rotations for rigid body");

View File

@ -21,6 +21,7 @@
#include <cstring> #include <cstring>
#include "error.h" #include "error.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "math_special.h" #include "math_special.h"
#include "modify.h" #include "modify.h"
#include "update.h" #include "update.h"
@ -95,7 +96,7 @@ void ComputeGyrationShape::compute_vector()
ione[1][2] = ione[2][1] = gyration_tensor[4]; ione[1][2] = ione[2][1] = gyration_tensor[4];
ione[0][2] = ione[2][0] = gyration_tensor[5]; ione[0][2] = ione[2][0] = gyration_tensor[5];
int ierror = MathExtra::jacobi(ione,evalues,evectors); int ierror = MathEigen::jacobi3(ione,evalues,evectors);
if (ierror) error->all(FLERR, "Insufficient Jacobi rotations " if (ierror) error->all(FLERR, "Insufficient Jacobi rotations "
"for gyration/shape"); "for gyration/shape");

View File

@ -21,6 +21,7 @@
#include <cstring> #include <cstring>
#include "error.h" #include "error.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "math_special.h" #include "math_special.h"
#include "modify.h" #include "modify.h"
#include "memory.h" #include "memory.h"
@ -125,7 +126,7 @@ void ComputeGyrationShapeChunk::compute_array()
ione[0][2] = ione[2][0] = gyration_tensor[ichunk][4]; ione[0][2] = ione[2][0] = gyration_tensor[ichunk][4];
ione[1][2] = ione[2][1] = gyration_tensor[ichunk][5]; ione[1][2] = ione[2][1] = gyration_tensor[ichunk][5];
int ierror = MathExtra::jacobi(ione,evalues,evectors); int ierror = MathEigen::jacobi3(ione,evalues,evectors);
if (ierror) error->all(FLERR, "Insufficient Jacobi rotations " if (ierror) error->all(FLERR, "Insufficient Jacobi rotations "
"for gyration/shape"); "for gyration/shape");

View File

@ -22,10 +22,10 @@
/// @author Andrew Jewett /// @author Andrew Jewett
/// @license MIT /// @license MIT
#ifndef _SUPERPOSE3D_H #ifndef LMP_SUPERPOSE3D_H
#define _SUPERPOSE3D_H #define LMP_SUPERPOSE3D_H
#include "math_eigen.h" //functions to calculate eigenvalues and eigenvectors #include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors
// ----------------------------------------------------------- // -----------------------------------------------------------
// ------------------------ INTERFACE ------------------------ // ------------------------ INTERFACE ------------------------
@ -144,11 +144,6 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object
ConstArrayOfCoords aaXm, // coords for the "mobile" object ConstArrayOfCoords aaXm, // coords for the "mobile" object
bool allow_rescale) // rescale mobile object? (c!=1?) bool allow_rescale) // rescale mobile object? (c!=1?)
{ {
assert(aaXf && aaXm);
assert(aaXf_shifted && aaXm_shifted);
assert(aWeights);
assert(R && T);
// Find the center of mass of each object: // Find the center of mass of each object:
Scalar aCenter_f[3] = {0.0, 0.0, 0.0}; Scalar aCenter_f[3] = {0.0, 0.0, 0.0};
Scalar aCenter_m[3] = {0.0, 0.0, 0.0}; Scalar aCenter_m[3] = {0.0, 0.0, 0.0};
@ -161,7 +156,9 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object
} }
sum_weights += weight; sum_weights += weight;
} }
assert(sum_weights != 0.0);
//assert(sum_weights != 0.0);
for (int d=0; d < 3; d++) { for (int d=0; d < 3; d++) {
aCenter_f[d] /= sum_weights; aCenter_f[d] /= sum_weights;
aCenter_m[d] /= sum_weights; aCenter_m[d] /= sum_weights;
@ -425,7 +422,9 @@ Superpose3D(const Superpose3D<Scalar, ConstArrayOfCoords, ConstArray>& source)
{ {
Init(); Init();
Alloc(source.N); Alloc(source.N);
assert(N == source.N);
//assert(N == source.N);
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
std::copy(source.aaXf_shifted[i], std::copy(source.aaXf_shifted[i],
source.aaXf_shifted[i] + 3, source.aaXf_shifted[i] + 3,
@ -463,4 +462,4 @@ operator = (Superpose3D<Scalar, ConstArrayOfCoords, ConstArray> source) {
} }
#endif //#ifndef _SUPERPOSE3D_H #endif //#ifndef LMP_SUPERPOSE3D_H

View File

@ -19,6 +19,7 @@
#include "fix.h" #include "fix.h"
#include "math_const.h" #include "math_const.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "modify.h" #include "modify.h"
@ -555,7 +556,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values)
tensor[0][2] = tensor[2][0] = inertia[4]; tensor[0][2] = tensor[2][0] = inertia[4];
tensor[0][1] = tensor[1][0] = inertia[5]; tensor[0][1] = tensor[1][0] = inertia[5];
int ierror = MathExtra::jacobi(tensor,bonus[nlocal_bonus].inertia,evectors); int ierror = MathEigen::jacobi3(tensor,bonus[nlocal_bonus].inertia,evectors);
if (ierror) error->one(FLERR,"Insufficient Jacobi rotations for triangle"); if (ierror) error->one(FLERR,"Insufficient Jacobi rotations for triangle");
double ex_space[3],ey_space[3],ez_space[3]; double ex_space[3],ey_space[3],ez_space[3];

View File

@ -20,6 +20,7 @@
#include "compute_chunk_atom.h" #include "compute_chunk_atom.h"
#include "domain.h" #include "domain.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
@ -250,10 +251,10 @@ void ComputeOmegaChunk::compute_array()
// handle each (nearly) singular I matrix // handle each (nearly) singular I matrix
// due to 2-atom chunk or linear molecule // due to 2-atom chunk or linear molecule
// use jacobi() and angmom_to_omega() to calculate valid omega // use jacobi3() and angmom_to_omega() to calculate valid omega
} else { } else {
int ierror = MathExtra::jacobi(ione,idiag,evectors); int ierror = MathEigen::jacobi3(ione,idiag,evectors);
if (ierror) error->all(FLERR, if (ierror) error->all(FLERR,
"Insufficient Jacobi rotations for omega/chunk"); "Insufficient Jacobi rotations for omega/chunk");

View File

@ -23,6 +23,7 @@
#include "force.h" #include "force.h"
#include "input.h" #include "input.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "modify.h" #include "modify.h"
#include "output.h" #include "output.h"
@ -1727,11 +1728,11 @@ void Group::omega(double *angmom, double inertia[3][3], double *w)
// handle (nearly) singular I matrix // handle (nearly) singular I matrix
// typically due to 2-atom group or linear molecule // typically due to 2-atom group or linear molecule
// use jacobi() and angmom_to_omega() to calculate valid omega // use jacobi3() and angmom_to_omega() to calculate valid omega
// less exact answer than matrix inversion, due to iterative Jacobi method // less exact answer than matrix inversion, due to iterative Jacobi method
} else { } else {
int ierror = MathExtra::jacobi(inertia,idiag,evectors); int ierror = MathEigen::jacobi3(inertia, idiag, evectors);
if (ierror) error->all(FLERR, if (ierror) error->all(FLERR,
"Insufficient Jacobi rotations for group::omega"); "Insufficient Jacobi rotations for group::omega");

78
src/math_eigen.cpp Normal file
View File

@ -0,0 +1,78 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Andrew Jewett (Scripps Research)
------------------------------------------------------------------------- */
#include "math_eigen.h"
#include "math_eigen_impl.h"
#include<array>
using std::vector;
using std::array;
using namespace MathEigen;
// Special case: 3x3 matrices
typedef Jacobi<double,double*,double(*)[3],double const(*)[3]> Jacobi_v1;
typedef Jacobi<double,double*,double**,double const*const*> Jacobi_v2;
int MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3])
{
// make copy of const matrix
double mat_cpy[3][3] = { {mat[0][0], mat[0][1], mat[0][2]},
{mat[1][0], mat[1][1], mat[1][2]},
{mat[2][0], mat[2][1], mat[2][2]} };
double *M[3] = { &(mat_cpy[0][0]), &(mat_cpy[1][0]), &(mat_cpy[2][0]) };
int midx[3];
// create instance of generic Jacobi class and get eigenvalues and -vectors
Jacobi_v1 ecalc3(3, M, midx);
int ierror = ecalc3.Diagonalize(mat, eval, evec, Jacobi_v1::SORT_DECREASING_EVALS);
// transpose the evec matrix
for (int i=0; i<3; i++)
for (int j=i+1; j<3; j++)
std::swap(evec[i][j], evec[j][i]);
return ierror;
}
int MathEigen::jacobi3(double const* const* mat, double *eval, double **evec)
{
// make copy of const matrix
double mat_cpy[3][3] = { {mat[0][0], mat[0][1], mat[0][2]},
{mat[1][0], mat[1][1], mat[1][2]},
{mat[2][0], mat[2][1], mat[2][2]} };
double *M[3] = { &(mat_cpy[0][0]), &(mat_cpy[1][0]), &(mat_cpy[2][0]) };
int midx[3];
// create instance of generic Jacobi class and get eigenvalues and -vectors
Jacobi_v2 ecalc3(3, M, midx);
int ierror = ecalc3.Diagonalize(mat, eval, evec, Jacobi_v2::SORT_DECREASING_EVALS);
// transpose the evec matrix
for (int i=0; i<3; i++)
for (int j=i+1; j<3; j++)
std::swap(evec[i][j], evec[j][i]);
return ierror;
}

36
src/math_eigen.h Normal file
View File

@ -0,0 +1,36 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_MATH_EIGEN_H
#define LMP_MATH_EIGEN_H
namespace MathEigen {
/** A specialized function which finds the eigenvalues and eigenvectors
* of a 3x3 matrix (in double ** format).
*
* \param mat the 3x3 matrix you wish to diagonalize
* \param eval store the eigenvalues here
* \param evec store the eigenvectors here...
* \return 0 if eigenvalue calculation converged, 1 if it failed */
int jacobi3(double const* const* mat, double *eval, double **evec);
/** \overload */
int jacobi3(double const mat[3][3], double *eval, double evec[3][3]);
}
#endif //#ifndef LMP_MATH_EIGEN_H

View File

@ -16,31 +16,31 @@
Andrew Jewett (Scripps Research, Jacobi algorithm) Andrew Jewett (Scripps Research, Jacobi algorithm)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifndef _MATH_EIGEN_H #ifndef LMP_MATH_EIGEN_IMPL_H
#define _MATH_EIGEN_H #define LMP_MATH_EIGEN_IMPL_H
/// @file This file contains a library of functions and classes which can // This file contains a library of functions and classes which can
/// efficiently perform eigendecomposition for an extremely broad // efficiently perform eigendecomposition for an extremely broad
/// range of matrix types: both real and complex, dense and sparse. // range of matrix types: both real and complex, dense and sparse.
/// Matrices need not be of type "double **", for example. // Matrices need not be of type "double **", for example.
/// In principle, almost any type of C++ container can be used. // In principle, almost any type of C++ container can be used.
/// Some general C++11 compatible functions for allocating matrices and // Some general C++11 compatible functions for allocating matrices and
/// calculating norms of real and complex vectors are also provided. // calculating norms of real and complex vectors are also provided.
/// @note // note
/// The "Jacobi" and "PEigenDense" classes are used for calculating // The "Jacobi" and "PEigenDense" classes are used for calculating
/// eigenvalues and eigenvectors of conventional dense square matrices. // eigenvalues and eigenvectors of conventional dense square matrices.
/// @note // note
/// The "LambdaLanczos" class can calculate eigenalues and eigenvectors // The "LambdaLanczos" class can calculate eigenalues and eigenvectors
/// of more general types of matrices, especially large, sparse matrices. // of more general types of matrices, especially large, sparse matrices.
/// It uses C++ lambda expressions to simplify and generalize the way // It uses C++ lambda expressions to simplify and generalize the way
/// matrices can be represented. This allows it to be applied to // matrices can be represented. This allows it to be applied to
/// nearly any kind of sparse (or dense) matrix representation. // nearly any kind of sparse (or dense) matrix representation.
/// @note // note
/// The source code for Jacobi and LambdaLanczos is also available at: // The source code for Jacobi and LambdaLanczos is also available at:
/// https://github.com/jewettaij/jacobi_pd (CC0-1.0 license) // https://github.com/jewettaij/jacobi_pd (CC0-1.0 license)
/// https://github.com/mrcdr/lambda-lanczos (MIT license) // https://github.com/mrcdr/lambda-lanczos (MIT license)
#include <cassert> //#include <cassert>
#include <numeric> #include <numeric>
#include <complex> #include <complex>
#include <limits> #include <limits>
@ -51,118 +51,94 @@
namespace MathEigen { namespace MathEigen {
// --- Memory allocation for matrices --- // --- Memory allocation for matrices ---
/// @brief Allocate an arbitrary 2-dimensional array. (Uses row-major order.) // Allocate an arbitrary 2-dimensional array. (Uses row-major order.)
/// @note This function was intended for relatively small matrices (eg 4x4). // note This function was intended for relatively small matrices (eg 4x4).
/// For large arrays, please use the 2d create() function from "memory.h" // For large arrays, please use the 2d create() function from "memory.h"
template<typename Entry> template<typename Entry>
void Alloc2D(size_t nrows, //!< size of the array (number of rows) void Alloc2D(size_t nrows, // size of the array (number of rows)
size_t ncols, //!< size of the array (number of columns) size_t ncols, // size of the array (number of columns)
Entry ***paaX); //!< pointer to a 2D C-style array Entry ***paaX); // pointer to a 2D C-style array
/// @brief Deallocate arrays that were created using Alloc2D(). // Deallocate arrays that were created using Alloc2D().
template<typename Entry> template<typename Entry>
void Dealloc2D(Entry ***paaX); //!< pointer to 2D multidimensional array void Dealloc2D(Entry ***paaX); // pointer to 2D multidimensional array
// --- Complex numbers --- // --- Complex numbers ---
/// @brief "realTypeMap" struct is used to the define "real_t<T>" type mapper /// @brief
/// which returns the C++ type corresponding to the real component of T. /// "realTypeMap" struct is used to the define "real_t<T>" type mapper.
/// @details Consider a function ("l2_norm()") that calculates the /// The "real_t" type mapper is used by the "LambdaLanczos" and "PEigenDense"
/// (Euclidian) length of a vector of numbers (either real or complex): /// classes, so it is documented here to help users understand those classes.
/// @code /// "real_t<T>" returns the C++ type corresponding to the real component of T.
/// template <typename T> real_t<T> l2_norm(const std::vector<T>& vec); ///
/// @endcode /// @details
/// The l2_norm is always real by definition. /// For example, suppose you have a matrix of type std::complex<double>**.
/// (See https://en.wikipedia.org/wiki/Norm_(mathematics)#Euclidean_norm) /// The eigenvalues calculated by "LambdaLanczos" and "PEigenDense" should be
/// The return type of this function ("real_t<T>") indicates that /// of type "double" (which is the same as "real_T<std::complex<double>>"),
/// it returns a real number, even if the entries (of type T) /// not "std::complex<double>". (This is because the algorithm assumes the
/// are complex numbers. In other words, by default, real_t<T> returns T. /// matrix is Hermitian, and the eigenvalues of a Hermitian matrix are always
/// However real_t<std::complex<T>> returns T (not std::complex<T>). /// real. So if you attempt to pass a reference to a complex number as the
/// We define "real_t<T>" below using C++ template specializations: /// first argument to LambdaLanczos::run(), the compiler will complain.)
///
/// Implementation details: "real_t<T>" is defined using C++ template
/// specializations.
template <typename T> template <typename T>
struct realTypeMap { struct realTypeMap {
typedef T type; typedef T type;
}; };
template <typename T> template <typename T>
struct realTypeMap<std::complex<T>> { struct realTypeMap<std::complex<T>> {
typedef T type; typedef T type;
}; };
template <typename T> template <typename T>
using real_t = typename realTypeMap<T>::type; using real_t = typename realTypeMap<T>::type;
// --- Operations on vectors (of real and complex numbers) --- // --- Operations on vectors (of real and complex numbers) ---
/// @brief Calculate the inner product of two vectors. // Calculate the inner product of two vectors.
/// (For vectors of complex numbers, std::conj() is used.) // (For vectors of complex numbers, std::conj() is used.)
template <typename T> template <typename T>
T inner_prod(const std::vector<T>& v1, const std::vector<T>& v2); T inner_prod(const std::vector<T>& v1, const std::vector<T>& v2);
/// @brief Compute the sum of the absolute values of the entries in v // Compute the sum of the absolute values of the entries in v
/// @returns a real number (of type real_t<T>). // returns a real number (of type real_t<T>).
template <typename T> template <typename T>
real_t<T> l1_norm(const std::vector<T>& v); real_t<T> l1_norm(const std::vector<T>& v);
/// @brief Calculate the l2_norm (Euclidian length) of vector v. // Calculate the l2_norm (Euclidian length) of vector v.
/// @returns a real number (of type real_t<T>). // returns a real number (of type real_t<T>).
template <typename T> template <typename T>
real_t<T> l2_norm(const std::vector<T>& v); real_t<T> l2_norm(const std::vector<T>& v);
/// @brief Multiply a vector (v) by a scalar (c). /// Multiply a vector (v) by a scalar (c).
template <typename T1, typename T2> template <typename T1, typename T2>
void scalar_mul(T1 c, std::vector<T2>& v); void scalar_mul(T1 c, std::vector<T2>& v);
/// @brief Divide vector "v" in-place by it's length (l2_norm(v)). /// Divide vector "v" in-place by it's length (l2_norm(v)).
template <typename T> template <typename T>
void normalize(std::vector<T>& v); void normalize(std::vector<T>& v);
// ---- Eigendecomposition of small dense symmetric matrices ----
// ---- Eigendecomposition of small dense symmetric matrices ---- /// @class Jacobi
/// @brief Calculate the eigenvalues and eigenvectors of a symmetric matrix
/// using the Jacobi eigenvalue algorithm. This code (along with tests
/// and benchmarks) is available free of license restrictions at:
/// https://github.com/jewettaij/jacobi_pd
/// @note The "Vector", "Matrix", and "ConstMatrix" type arguments can be any
/// C or C++ object that supports indexing, including pointers or vectors.
/// @class Jacobi template<typename Scalar,
/// @brief Calculate the eigenvalues and eigevectors of a symmetric matrix
/// using the Jacobi eigenvalue algorithm. Code for the Jacobi class
/// (along with tests and benchmarks) is available free of copyright at
/// https://github.com/jewettaij/jacobi_pd
/// @note The "Vector" and "Matrix" type arguments can be any
/// C or C++ object that support indexing, including pointers or vectors.
/// @details
/// -- Example: --
///
/// int n = 5; // Matrix size
/// double **M; // A symmetric n x n matrix you want to diagonalize
/// double *evals; // Store the eigenvalues here.
/// double **evects; // Store the eigenvectors here.
/// // Allocate space for M, evals, and evects, and load contents of M (omitted)
///
/// // Now create an instance of Jacobi ("eigen_calc"). This will allocate space
/// // for storing intermediate calculations. Once created, it can be reused
/// // multiple times without paying the cost of allocating memory on the heap.
///
/// Jacobi<double, double*, double**> eigen_calc(n);
///
/// // Note:
/// // If the matrix you plan to diagonalize (M) is read-only, use this instead:
/// // Jacobi<double, double*, double**, double const*const*> eigen_calc(n);
/// // If you prefer using vectors over C-style pointers, this works also:
/// // Jacobi<double, vector<double>&, vector<vector<double>>&> eigen_calc(n);
///
/// // Now, calculate the eigenvalues and eigenvectors of M
///
/// eigen_calc.Diagonalize(M, evals, evects);
///
/// --- end of example ---
template<typename Scalar,
typename Vector, typename Vector,
typename Matrix, typename Matrix,
typename ConstMatrix=Matrix> typename ConstMatrix=Matrix>
class Jacobi class Jacobi
{ {
int n; //!< the size of the matrices you want to diagonalize int n; //!< the size of the matrices you want to diagonalize
Scalar **M; //!< local copy of the current matrix being analyzed Scalar **M; //!< local copy of the current matrix being analyzed
// Precomputed cosine, sine, and tangent of the most recent rotation angle: // Precomputed cosine, sine, and tangent of the most recent rotation angle:
@ -171,16 +147,17 @@ class Jacobi
Scalar t; //!< = tan(θ), (note |t|<=1) Scalar t; //!< = tan(θ), (note |t|<=1)
int *max_idx_row; //!< = keep track of the the maximum element in row i (>i) int *max_idx_row; //!< = keep track of the the maximum element in row i (>i)
public: public:
/// @brief Specify the size of the matrices you want to diagonalize later. /// @brief Specify the size of the matrices you want to diagonalize later.
/// @param n the size (ie. number of rows) of the (square) matrix. /// @param n the size (ie. number of rows) of the (square) matrix.
Jacobi(int n);
~Jacobi();
/// @brief Change the size of the matrices you want to diagonalize.
/// @param n the size (ie. number of rows) of the (square) matrix.
void SetSize(int n); void SetSize(int n);
Jacobi(int n = 0) { Init(); SetSize(n); }
~Jacobi() { Dealloc(); }
// @typedef choose the criteria for sorting eigenvalues and eigenvectors // @typedef choose the criteria for sorting eigenvalues and eigenvectors
typedef enum eSortCriteria { typedef enum eSortCriteria {
DO_NOT_SORT, DO_NOT_SORT,
@ -190,10 +167,12 @@ public:
SORT_INCREASING_ABS_EVALS SORT_INCREASING_ABS_EVALS
} SortCriteria; } SortCriteria;
/// @brief Calculate the eigenvalues and eigevectors of a symmetric matrix /// @brief Calculate the eigenvalues and eigenvectors of a symmetric matrix
/// using the Jacobi eigenvalue algorithm. /// using the Jacobi eigenvalue algorithm.
/// @returns The number_of_sweeps (= number_of_iterations / (n*(n-1)/2)). /// @returns 0 if the algorithm converged,
/// If this equals max_num_sweeps, the algorithm failed to converge. /// 1 if the algorithm failed to converge. (IE, if the number of
/// pivot iterations exceeded max_num_sweeps * iters_per_sweep,
/// where iters_per_sweep = (n*(n-1)/2))
/// @note To reduce the computation time further, set calc_evecs=false. /// @note To reduce the computation time further, set calc_evecs=false.
int int
Diagonalize(ConstMatrix mat, //!< the matrix you wish to diagonalize (size n) Diagonalize(ConstMatrix mat, //!< the matrix you wish to diagonalize (size n)
@ -201,10 +180,28 @@ public:
Matrix evec, //!< store the eigenvectors here (in rows) Matrix evec, //!< store the eigenvectors here (in rows)
SortCriteria sort_criteria=SORT_DECREASING_EVALS,//!<sort results? SortCriteria sort_criteria=SORT_DECREASING_EVALS,//!<sort results?
bool calc_evecs=true, //!< calculate the eigenvectors? bool calc_evecs=true, //!< calculate the eigenvectors?
int max_num_sweeps = 50); //!< limit the number of iterations int max_num_sweeps=50 //!< limit the number of iterations
);
// An alternative constructor is provided, if, for some reason,
// you want to avoid allocating memory on the heap during
// initialization. In that case, you can allocate space for the "M"
// and "max_idx_row" arrays on the stack in advance, and pass them
// to the constructor. (The vast majority of users probably
// do not need this feature. Unless you do, I encourage you
// to use the regular constructor instead.)
// n the size (ie. number of rows) of the (square) matrix.
// M optional preallocated n x n array
// max_idx_row optional preallocated array of size n
// note If either the "M" or "max_idx_row" arguments are specified,
// they both must be specified.
Jacobi(int n, Scalar **M, int *max_idx_row);
private:
bool is_preallocated;
private:
// (Descriptions of private functions can be found in their implementation.) // (Descriptions of private functions can be found in their implementation.)
void _Jacobi(int n, Scalar **M, int *max_idx_row);
void CalcRot(Scalar const *const *M, int i, int j); void CalcRot(Scalar const *const *M, int i, int j);
void ApplyRot(Scalar **M, int i, int j); void ApplyRot(Scalar **M, int i, int j);
void ApplyRotLeft(Matrix E, int i, int j); void ApplyRotLeft(Matrix E, int i, int j);
@ -214,134 +211,73 @@ private:
void Init(); void Init();
void Alloc(int n); void Alloc(int n);
void Dealloc(); void Dealloc();
public: public:
// C++ boilerplate: copy and move constructor, swap, and assignment operator // C++ boilerplate: copy and move constructor, swap, and assignment operator
Jacobi(const Jacobi<Scalar, Vector, Matrix, ConstMatrix>& source); Jacobi(const Jacobi<Scalar, Vector, Matrix, ConstMatrix>& source);
Jacobi(Jacobi<Scalar, Vector, Matrix, ConstMatrix>&& other); Jacobi(Jacobi<Scalar, Vector, Matrix, ConstMatrix>&& other);
void swap(Jacobi<Scalar, Vector, Matrix, ConstMatrix> &other); void swap(Jacobi<Scalar, Vector, Matrix, ConstMatrix> &other);
Jacobi<Scalar, Vector, Matrix, ConstMatrix>& operator = (Jacobi<Scalar, Vector, Matrix, ConstMatrix> source); Jacobi<Scalar, Vector, Matrix, ConstMatrix>& operator = (Jacobi<Scalar, Vector, Matrix, ConstMatrix> source);
}; // class Jacobi }; // class Jacobi
// ---- Eigendecomposition of large sparse (or dense) matrices ----
// The "LambdaLanczos" is a class useful for calculating eigenvalues
// and eigenvectors of large sparse matrices. Unfortunately, before the
// LambdaLanczos class can be declared, several additional expressions,
// classes and functions that it depends on must be declared first.
// Create random vectors used at the beginning of the Lanczos algorithm.
// note "Partially specialization of function" is not allowed, so
// ---- Eigendecomposition of large sparse (and dense) matrices ---- // it is mimicked by wrapping the "init" function with a class template.
template <typename T>
// The "LambdaLanczos" is a class useful for calculating eigenvalues struct VectorRandomInitializer {
// and eigenvectors of large sparse matrices. Unfortunately, before the public:
// LambdaLanczos class can be declared, several additional expressions,
// classes and functions that it depends on must be declared first.
// @brief Create random vectors used at the beginning of the Lanczos algorithm.
// @note "Partially specialization of function" is not allowed, so
// it is mimicked by wrapping the "init" function with a class template.
template <typename T>
struct VectorRandomInitializer {
public:
static void init(std::vector<T>&); static void init(std::vector<T>&);
}; };
template <typename T> template <typename T>
struct VectorRandomInitializer<std::complex<T>> { struct VectorRandomInitializer<std::complex<T>> {
public: public:
static void init(std::vector<std::complex<T>>&); static void init(std::vector<std::complex<T>>&);
}; };
/// @brief Return the number of significant decimal digits of type T. // Return the number of significant decimal digits of type T.
template <typename T> template <typename T>
inline constexpr int sig_decimal_digit() { inline constexpr int sig_decimal_digit() {
return (int)(std::numeric_limits<T>::digits * return (int)(std::numeric_limits<T>::digits *
std::log10(std::numeric_limits<T>::radix)); std::log10(std::numeric_limits<T>::radix));
} }
/// @brief Return 10^-n where n=number of significant decimal digits of type T. // Return 10^-n where n=number of significant decimal digits of type T.
template <typename T> template <typename T>
inline constexpr T minimum_effective_decimal() { inline constexpr T minimum_effective_decimal() {
return std::pow(10, -sig_decimal_digit<T>()); return std::pow(10, -sig_decimal_digit<T>());
} }
/// @brief The LambdaLanczos class provides a general way to calculate /// @class LambdaLanczos
/// the smallest or largest eigenvalue and the corresponding eigenvector /// @brief The LambdaLanczos class provides a general way to calculate
/// of a symmetric (Hermitian) matrix using the Lanczos algorithm. /// the smallest or largest eigenvalue and the corresponding eigenvector
/// The characteristic feature of LambdaLanczos is that the matrix-vector /// of a Hermitian matrix using the Lanczos algorithm.
/// multiplication routine used in the Lanczos algorithm is adaptable. /// The characteristic feature of LambdaLanczos is that the matrix-vector
/// @details /// multiplication routine used in the Lanczos algorithm is adaptable.
/// @code /// This code (along with automatic unit tests) is also distributed
/// /// under the MIT license at https://github.com/mrcdr/lambda-lanczos
/// //Example: ///
/// const int n = 3; /// @note
/// double M[n][n] = { {-1.0, -1.0, 1.0}, /// If the matrices you want to analyze are ordinary square matrices, (as in
/// {-1.0, 1.0, 1.0}, /// the example) it might be easier to use "PEigenDense" instead. (It is a
/// { 1.0, 1.0, 1.0} }; /// wrapper which takes care of all of the LambdaLanczos details for you.)
/// // (Its eigenvalues are {-2, 1, 2}) ///
/// /// @note
/// // Specify the matrix-vector multiplication function /// IMPORTANT:
/// auto mv_mul = [&](const vector<double>& in, vector<double>& out) { /// Unless the matrix you are solving is positive or negative definite, you
/// for(int i = 0;i < n;i++) { /// MUST set the "eigenvalue_offset" parameter. See the "pg_developer" docs.
/// for(int j = 0;j < n;j++) {
/// out[i] += M[i][j]*in[j];
/// }
/// }
/// };
///
/// LambdaLanczos<double> engine(mv_mul, n, true);
/// // ("true" means to calculate the largest eigenvalue.)
/// engine.eigenvalue_offset = 3.0 # = max_i{Σ_j|Mij|} (see below)
/// double eigenvalue;
/// vector<double> eigenvector(n);
/// int itern = engine.run(eigenvalue, eigenvector);
///
/// cout << "Iteration count: " << itern << endl;
/// cout << "Eigen value: " << setprecision(16) << eigenvalue << endl;
/// cout << "Eigen vector:";
/// for(int i = 0; i < n; i++) {
/// cout << eigenvector[i] << " ";
/// }
/// cout << endl;
///
/// @endcode
/// This feature allows you to use a matrix whose elements are partially given,
/// e.g. a sparse matrix whose non-zero elements are stored as a list of
/// {row-index, column-index, value} tuples. You can also easily combine
/// LambdaLanczos with existing matrix libraries (e.g. Eigen)
///
/// @note
/// If the matrices you want to analyze are ordinary square matrices, (as in
/// the example) it might be easier to use "PEigenDense" instead. (It is a
/// wrapper which takes care of all of the LambdaLanczos details for you.)
///
/// @note
/// IMPORTANT:
/// The Lanczos algorithm finds the largest magnitude eigenvalue, so you
/// MUST ensure that the eigenvalue you are seeking has the largest magnitude
/// (regardless of whether it is the maximum or minimum eigenvalue).
/// To insure that this is so, you can add or subtract a number to all
/// of the eigenvalues of the matrix by specifying the "eigenvalue_offset".
/// This number should exceed the largest magnitude eigenvalue of the matrix.
/// According to the Gershgorin theorem, you can estimate this number using
/// r = max_i{Σ_j|Mij|} = max_j{Σ_i|Mij|}
/// (where Mij are the elements of the matrix and Σ_j denotes the sum over j).
/// If find_maximum == true (if you are seeking the maximum eigenvalue), then
/// eigenvalue_offset = +r
/// If find_maximum == false, then
/// eigenvalue_offset = -r
/// The eigenvalue_offset MUST be specified by the user. LambdaLanczos does
/// not have an efficient and general way to access the elements of the matrix.
///
/// (You can omit this step if you are seeking the maximum eigenvalue,
/// and the matrix is positive definite, or if you are seeking the minimum
/// eigenvalue and the matrix is negative definite.)
///
/// @note
/// LambdaLanczos is available under the MIT license and downloadable at:
/// https://github.com/mrcdr/lambda-lanczos
template <typename T> template <typename T>
class LambdaLanczos { class LambdaLanczos {
public: public:
LambdaLanczos(); LambdaLanczos();
LambdaLanczos(std::function<void(const std::vector<T>&, std::vector<T>&)> mv_mul, int matrix_size, bool find_maximum); LambdaLanczos(std::function<void(const std::vector<T>&, std::vector<T>&)> mv_mul, int matrix_size, bool find_maximum);
LambdaLanczos(std::function<void(const std::vector<T>&, std::vector<T>&)> mv_mul, int matrix_size) : LambdaLanczos(mv_mul, matrix_size, true) {} LambdaLanczos(std::function<void(const std::vector<T>&, std::vector<T>&)> mv_mul, int matrix_size) : LambdaLanczos(mv_mul, matrix_size, true) {}
@ -370,11 +306,10 @@ public:
/// iteration (ie. during LambdaLanczos::run()). The goal is to insure /// iteration (ie. during LambdaLanczos::run()). The goal is to insure
/// that the correct eigenvalue is selected (the one with the maximum /// that the correct eigenvalue is selected (the one with the maximum
/// magnitude). /// magnitude).
/// @note The eigevalue returned by LambdaLanczos::run() is not effected /// @note Unless your matrix is positive definite or negative definite, you
/// because after the iteration is finished, it will subtract this /// MUST specify eigenvalue_offset. See comment above for details.
/// @note After LambdaLanczos::run() has finished, it will subtract this
/// number from the eigenvalue before it is returned to the caller. /// number from the eigenvalue before it is returned to the caller.
/// @note Unless your matrix is positive definite or negative definite,
/// you MUST specify eigenvalue_offset. See comment above for details.
real_t<T> eigenvalue_offset = 0.0; real_t<T> eigenvalue_offset = 0.0;
/// @brief This function sets "eigenvalue_offset" automatically. /// @brief This function sets "eigenvalue_offset" automatically.
@ -390,7 +325,7 @@ public:
std::function<void(std::vector<T>&)> init_vector = std::function<void(std::vector<T>&)> init_vector =
VectorRandomInitializer<T>::init; VectorRandomInitializer<T>::init;
// (for those who prefer "Set" functions...) // (for those who prefer using "Set" functions...)
int SetSize(int matrix_size); int SetSize(int matrix_size);
void SetMul(std::function<void(const std::vector<T>&, void SetMul(std::function<void(const std::vector<T>&,
std::vector<T>&)> mv_mul); std::vector<T>&)> mv_mul);
@ -400,7 +335,7 @@ public:
void SetEpsilon(T eps); void SetEpsilon(T eps);
void SetTriEpsRatio(T tridiag_eps_ratio); void SetTriEpsRatio(T tridiag_eps_ratio);
private: private:
static void schmidt_orth(std::vector<T>&, const std::vector<std::vector<T>>&); static void schmidt_orth(std::vector<T>&, const std::vector<std::vector<T>>&);
real_t<T> find_minimum_eigenvalue(const std::vector<real_t<T>>&, real_t<T> find_minimum_eigenvalue(const std::vector<real_t<T>>&,
const std::vector<real_t<T>>&) const; const std::vector<real_t<T>>&) const;
@ -412,47 +347,42 @@ private:
const std::vector<real_t<T>>&, const std::vector<real_t<T>>&,
const std::vector<real_t<T>>&); const std::vector<real_t<T>>&);
real_t<T> UpperBoundEvals() const; real_t<T> UpperBoundEvals() const;
}; };
/// @brief /// @class PEigenDense
/// PEigenDense is a class containing only one useful member function: /// @brief
/// PrincipalEigen(). This function calculates the principal (largest /// PEigenDense is a class containing only one useful member function:
/// or smallest) eigenvalue and corresponding eigenvector of a square /// PrincipalEigen(). This function calculates the principal (largest
/// n x n matrix. This can be faster than diagionalizing the entire matrix. /// or smallest) eigenvalue and corresponding eigenvector of a square
/// (For example by using the Lanczos algorithm or something similar.) /// n x n matrix. This can be faster than diagonalizing the entire matrix.
/// @note /// @note
/// This code is a wrapper. Internally, it uses the "LambdaLanczos" class. /// This code is a wrapper. Internally, it uses the "LambdaLanczos" class.
/// @note /// @note
/// For matrices larger than 13x13, PEigenDense::PrincipleEigen() /// For dense matrices smaller than 13x13, Jacobi::Diagonalize(),
/// is usually faster than Jacobi::Diagonalize().) /// is usually faster than PEigenDense::PrincipleEigen().
template<typename Scalar, typename Vector, typename ConstMatrix> template<typename Scalar, typename Vector, typename ConstMatrix>
class PEigenDense class PEigenDense
{ {
size_t n; // the size of the matrix size_t n; // the size of the matrix
std::vector<Scalar> evec; // preallocated vector std::vector<Scalar> evec; // preallocated vector
public: public:
void SetSize(int matrix_size) { PEigenDense(int matrix_size=0);
n = matrix_size;
evec.resize(n);
}
PEigenDense(int matrix_size=0):evec(matrix_size) {
SetSize(matrix_size);
}
/// @brief Calculate the principal eigenvalue and eigenvector of a matrix. /// @brief Calculate the principal eigenvalue and eigenvector of a matrix.
/// @return Return the principal eigenvalue of the matrix. /// @return Return the principal eigenvalue of the matrix.
/// If you want the eigenvector, pass a non-null "evector" argument. /// If you want the eigenvector, pass a non-null "evector" argument.
Scalar real_t<Scalar>
PrincipalEigen(ConstMatrix matrix, //!< the input patrix PrincipalEigen(ConstMatrix matrix, //!< the input matrix
Vector evector, //!< the eigenvector is stored here Vector evector, //!< the eigenvector is stored here
bool find_max=false); //!< want the max or min eigenvalue? bool find_max=false); //!< want the max or min eigenvalue?
}; // class PEigenDense void SetSize(int matrix_size); //change matrix size after instantiation
}; // class PEigenDense
@ -460,16 +390,13 @@ public:
// ----------- IMPLEMENTATION ----------- // ----------- IMPLEMENTATION -----------
// -------------------------------------- // --------------------------------------
// --- Implementation: Memory allocation for matrices --- // --- Implementation: Memory allocation for matrices ---
template<typename Entry> template<typename Entry>
void Alloc2D(size_t nrows, // size of the array (number of rows) void Alloc2D(size_t nrows, // size of the array (number of rows)
size_t ncols, // size of the array (number of columns) size_t ncols, // size of the array (number of columns)
Entry ***paaX) // pointer to a 2D C-style array Entry ***paaX) // pointer to a 2D C-style array
{ {
assert(paaX); //assert(paaX);
*paaX = new Entry* [nrows]; //conventional 2D C array (pointer-to-pointer) *paaX = new Entry* [nrows]; //conventional 2D C array (pointer-to-pointer)
(*paaX)[0] = new Entry [nrows * ncols]; // 1D C array (contiguous memor) (*paaX)[0] = new Entry [nrows * ncols]; // 1D C array (contiguous memor)
for(size_t iy=0; iy<nrows; iy++) for(size_t iy=0; iy<nrows; iy++)
@ -535,7 +462,6 @@ inline void normalize(std::vector<T>& vec) {
scalar_mul(1.0/l2_norm(vec), vec); scalar_mul(1.0/l2_norm(vec), vec);
} }
template <typename T> template <typename T>
inline real_t<T> l1_norm(const std::vector<T>& vec) { inline real_t<T> l1_norm(const std::vector<T>& vec) {
real_t<T> norm = real_t<T>(); // Zero initialization real_t<T> norm = real_t<T>(); // Zero initialization
@ -549,6 +475,52 @@ inline real_t<T> l1_norm(const std::vector<T>& vec) {
// --- Implementation: Eigendecomposition of small dense matrices --- // --- Implementation: Eigendecomposition of small dense matrices ---
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Jacobi(int n) {
_Jacobi(n, nullptr, nullptr);
}
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Jacobi(int n, Scalar **M, int *max_idx_row) {
_Jacobi(n, M, max_idx_row);
}
// _Jacobi() is a function which is invoked by the two constructors and it
// does all of the work. (Splitting the constructor into multiple functions
// was technically unnecessary, but it makes documenting the code easier.)
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
void
Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
_Jacobi(int n, Scalar **M, int *max_idx_row) {
Init();
if (M) { // if caller supplies their own "M" array, don't allocate M
is_preallocated = true;
this->n = n;
this->M = M;
this->max_idx_row = max_idx_row;
//assert(this->max_idx_row);
}
else {
is_preallocated = false;
SetSize(n); // allocate the "M" and "max_int_row" arrays
}
}
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
~Jacobi() {
if (! is_preallocated)
Dealloc();
}
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix> template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
int Jacobi<Scalar, Vector, Matrix, ConstMatrix>:: int Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Diagonalize(ConstMatrix mat, // the matrix you wish to diagonalize (size n) Diagonalize(ConstMatrix mat, // the matrix you wish to diagonalize (size n)
@ -602,7 +574,7 @@ Diagonalize(ConstMatrix mat, // the matrix you wish to diagonalize (size n)
// Optional: Sort results by eigenvalue. // Optional: Sort results by eigenvalue.
SortRows(eval, evec, n, sort_criteria); SortRows(eval, evec, n, sort_criteria);
return n_iters / (n*(n-1)/2); //returns the number of "sweeps" (converged?) return (n_iters == max_num_iters);
} }
@ -634,7 +606,7 @@ CalcRot(Scalar const *const *M, //!< matrix
t = -t; t = -t;
} }
} }
assert(std::abs(t) <= 1.0); //assert(std::abs(t) <= 1.0);
c = 1.0 / std::sqrt(1 + t*t); c = 1.0 / std::sqrt(1 + t*t);
s = c*t; s = c*t;
} }
@ -699,7 +671,7 @@ ApplyRot(Scalar **M, // matrix
M[j][j] += t * M[i][j]; M[j][j] += t * M[i][j];
//Update the off-diagonal elements of M which will change (above the diagonal) //Update the off-diagonal elements of M which will change (above the diagonal)
assert(i < j); //assert(i < j);
M[i][j] = 0.0; M[i][j] = 0.0;
//compute M[w][i] and M[i][w] for all w!=i,considering above-diagonal elements //compute M[w][i] and M[i][w] for all w!=i,considering above-diagonal elements
@ -849,6 +821,7 @@ Init() {
n = 0; n = 0;
M = nullptr; M = nullptr;
max_idx_row = nullptr; max_idx_row = nullptr;
is_preallocated = false;
} }
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix> template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
@ -863,6 +836,7 @@ SetSize(int n) {
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix> template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
void Jacobi<Scalar, Vector, Matrix, ConstMatrix>:: void Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Alloc(int n) { Alloc(int n) {
//assert(! is_preallocated);
this->n = n; this->n = n;
if (n > 0) { if (n > 0) {
max_idx_row = new int[n]; max_idx_row = new int[n];
@ -873,8 +847,7 @@ Alloc(int n) {
template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix> template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
void Jacobi<Scalar, Vector, Matrix, ConstMatrix>:: void Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Dealloc() { Dealloc() {
if (max_idx_row) //assert(! is_preallocated);
delete [] max_idx_row;
Dealloc2D(&M); Dealloc2D(&M);
Init(); Init();
} }
@ -887,7 +860,8 @@ Jacobi(const Jacobi<Scalar, Vector, Matrix, ConstMatrix>& source)
{ {
Init(); Init();
SetSize(source.n); SetSize(source.n);
assert(n == source.n);
//assert(n == source.n);
// The following lines aren't really necessary, because the contents // The following lines aren't really necessary, because the contents
// of source.M and source.max_idx_row are not needed (since they are // of source.M and source.max_idx_row are not needed (since they are
// overwritten every time Jacobi::Diagonalize() is invoked). // overwritten every time Jacobi::Diagonalize() is invoked).
@ -904,6 +878,7 @@ template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
void Jacobi<Scalar, Vector, Matrix, ConstMatrix>:: void Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
swap(Jacobi<Scalar, Vector, Matrix, ConstMatrix> &other) { swap(Jacobi<Scalar, Vector, Matrix, ConstMatrix> &other) {
std::swap(n, other.n); std::swap(n, other.n);
std::swap(is_preallocated, other.is_preallocated);
std::swap(max_idx_row, other.max_idx_row); std::swap(max_idx_row, other.max_idx_row);
std::swap(M, other.M); std::swap(M, other.M);
} }
@ -913,7 +888,7 @@ template<typename Scalar,typename Vector,typename Matrix,typename ConstMatrix>
Jacobi<Scalar, Vector, Matrix, ConstMatrix>:: Jacobi<Scalar, Vector, Matrix, ConstMatrix>::
Jacobi(Jacobi<Scalar, Vector, Matrix, ConstMatrix>&& other) { Jacobi(Jacobi<Scalar, Vector, Matrix, ConstMatrix>&& other) {
Init(); Init();
swap(*this, other); this->swap(other);
} }
// Using the "copy-swap" idiom for the assignment operator // Using the "copy-swap" idiom for the assignment operator
@ -933,7 +908,7 @@ template <typename T>
inline LambdaLanczos<T>::LambdaLanczos() { inline LambdaLanczos<T>::LambdaLanczos() {
this->matrix_size = 0; this->matrix_size = 0;
this->max_iteration = 0; this->max_iteration = 0;
this->find_maximum = 0; this->find_maximum = false;
} }
@ -955,8 +930,8 @@ template <typename T>
inline int LambdaLanczos<T>:: inline int LambdaLanczos<T>::
run(real_t<T>& eigvalue, std::vector<T>& eigvec) const run(real_t<T>& eigvalue, std::vector<T>& eigvec) const
{ {
assert(matrix_size > 0); //assert(matrix_size > 0);
assert(0 < this->tridiag_eps_ratio && this->tridiag_eps_ratio < 1); //assert(0 < this->tridiag_eps_ratio && this->tridiag_eps_ratio < 1);
std::vector<std::vector<T>> u; // Lanczos vectors std::vector<std::vector<T>> u; // Lanczos vectors
std::vector<real_t<T>> alpha; // Diagonal elements of an approximated tridiagonal matrix std::vector<real_t<T>> alpha; // Diagonal elements of an approximated tridiagonal matrix
@ -1322,12 +1297,25 @@ init(std::vector<std::complex<T>>& v)
// --- Implementation of PEigenDense // --- Implementation of PEigenDense
template<typename Scalar, typename Vector, typename ConstMatrix> template<typename Scalar, typename Vector, typename ConstMatrix>
Scalar PEigenDense<Scalar, Vector, ConstMatrix>:: void PEigenDense<Scalar, Vector, ConstMatrix>::
SetSize(int matrix_size) {
n = matrix_size;
evec.resize(n);
}
template<typename Scalar, typename Vector, typename ConstMatrix>
PEigenDense<Scalar, Vector, ConstMatrix>::
PEigenDense(int matrix_size):evec(matrix_size) {
SetSize(matrix_size);
}
template<typename Scalar, typename Vector, typename ConstMatrix>
real_t<Scalar> PEigenDense<Scalar, Vector, ConstMatrix>::
PrincipalEigen(ConstMatrix matrix, PrincipalEigen(ConstMatrix matrix,
Vector eigenvector, Vector eigenvector,
bool find_max) bool find_max)
{ {
assert(n > 0); //assert(n > 0);
auto matmul = [&](const std::vector<Scalar>& in, std::vector<Scalar>& out) { auto matmul = [&](const std::vector<Scalar>& in, std::vector<Scalar>& out) {
for(int i = 0; i < n; i++) { for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) { for(int j = 0; j < n; j++) {
@ -1373,8 +1361,12 @@ PrincipalEigen(ConstMatrix matrix,
return eval; return eval;
} }
} //namespace MathEigen } //namespace MathEigen
#endif //#ifndef _MATH_EIGEN_H
#endif //#ifndef LMP_MATH_EIGEN_IMPL_H

View File

@ -19,8 +19,6 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#define MAXJACOBI 50
namespace MathExtra { namespace MathExtra {
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -92,88 +90,6 @@ int mldivide3(const double m[3][3], const double *v, double *ans)
return 0; return 0;
} }
/* ----------------------------------------------------------------------
compute evalues and evectors of 3x3 real symmetric matrix
based on Jacobi rotations
adapted from Numerical Recipes jacobi() function
------------------------------------------------------------------------- */
int jacobi(double matrix[3][3], double *evalues, double evectors[3][3])
{
int i,j,k;
double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3];
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) evectors[i][j] = 0.0;
evectors[i][i] = 1.0;
}
for (i = 0; i < 3; i++) {
b[i] = evalues[i] = matrix[i][i];
z[i] = 0.0;
}
for (int iter = 1; iter <= MAXJACOBI; iter++) {
sm = 0.0;
for (i = 0; i < 2; i++)
for (j = i+1; j < 3; j++)
sm += fabs(matrix[i][j]);
if (sm == 0.0) return 0;
if (iter < 4) tresh = 0.2*sm/(3*3);
else tresh = 0.0;
for (i = 0; i < 2; i++) {
for (j = i+1; j < 3; j++) {
g = 100.0*fabs(matrix[i][j]);
if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
&& fabs(evalues[j])+g == fabs(evalues[j]))
matrix[i][j] = 0.0;
else if (fabs(matrix[i][j]) > tresh) {
h = evalues[j]-evalues[i];
if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
else {
theta = 0.5*h/(matrix[i][j]);
t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
if (theta < 0.0) t = -t;
}
c = 1.0/sqrt(1.0+t*t);
s = t*c;
tau = s/(1.0+c);
h = t*matrix[i][j];
z[i] -= h;
z[j] += h;
evalues[i] -= h;
evalues[j] += h;
matrix[i][j] = 0.0;
for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
}
}
}
for (i = 0; i < 3; i++) {
evalues[i] = b[i] += z[i];
z[i] = 0.0;
}
}
return 1;
}
/* ----------------------------------------------------------------------
perform a single Jacobi rotation
------------------------------------------------------------------------- */
void rotate(double matrix[3][3], int i, int j, int k, int l,
double s, double tau)
{
double g = matrix[i][j];
double h = matrix[k][l];
matrix[i][j] = g-s*(h+g*tau);
matrix[k][l] = h+s*(g-h*tau);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Richardson iteration to update quaternion from angular momentum Richardson iteration to update quaternion from angular momentum
return new normalized quaternion q return new normalized quaternion q

View File

@ -85,7 +85,6 @@ namespace MathExtra {
void write3(const double mat[3][3]); void write3(const double mat[3][3]);
int mldivide3(const double mat[3][3], const double *vec, double *ans); int mldivide3(const double mat[3][3], const double *vec, double *ans);
int jacobi(double matrix[3][3], double *evalues, double evectors[3][3]);
void rotate(double matrix[3][3], int i, int j, int k, int l, void rotate(double matrix[3][3], int i, int j, int k, int l,
double s, double tau); double s, double tau);
void richardson(double *q, double *m, double *w, double *moments, double dtq); void richardson(double *q, double *m, double *w, double *moments, double dtq);

View File

@ -21,6 +21,7 @@
#include "error.h" #include "error.h"
#include "force.h" #include "force.h"
#include "math_extra.h" #include "math_extra.h"
#include "math_eigen.h"
#include "memory.h" #include "memory.h"
#include "tokenizer.h" #include "tokenizer.h"
@ -349,7 +350,7 @@ void Molecule::compute_inertia()
tensor[0][2] = tensor[2][0] = itensor[4]; tensor[0][2] = tensor[2][0] = itensor[4];
tensor[0][1] = tensor[1][0] = itensor[5]; tensor[0][1] = tensor[1][0] = itensor[5];
if (MathExtra::jacobi(tensor,inertia,evectors)) if (MathEigen::jacobi3(tensor,inertia,evectors))
error->all(FLERR,"Insufficient Jacobi rotations for rigid molecule"); error->all(FLERR,"Insufficient Jacobi rotations for rigid molecule");
ex[0] = evectors[0][0]; ex[0] = evectors[0][0];

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:53 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid fix rigid
@ -13,65 +13,65 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.4245356937318927e+03 -1.4496493315649675e+03 -3.6144360984224963e+03 8.4840626828643849e+02 2.0318336761611764e+02 -6.0622397707969685e+02 -1.4245356937318884e+03 -1.4496493315649705e+03 -3.6144360984225009e+03 8.4840626828644258e+02 2.0318336761611707e+02 -6.0622397707970117e+02
global_scalar: 15.7115214231781 global_scalar: 15.7115214231781
run_pos: ! |2 run_pos: ! |2
1 -2.7899546863891622e-01 2.4731857340328216e+00 -1.7290667740241872e-01 1 -2.7899546863891489e-01 2.4731857340328216e+00 -1.7290667740242327e-01
2 3.0296221610264007e-01 2.9517129916957545e+00 -8.5798904387772823e-01 2 3.0296221610264151e-01 2.9517129916957532e+00 -8.5798904387773267e-01
3 -6.9368802364134852e-01 1.2445115421754183e+00 -6.2281111198650230e-01 3 -6.9368802364134807e-01 1.2445115421754180e+00 -6.2281111198650496e-01
4 -1.5764879647103172e+00 1.4919714415841274e+00 -1.2492069414674600e+00 4 -1.5764879647103154e+00 1.4919714415841261e+00 -1.2492069414674631e+00
5 -8.9434512967430013e-01 9.3651699743510730e-01 4.0191726558261431e-01 5 -8.9434512967430058e-01 9.3651699743510919e-01 4.0191726558261187e-01
6 2.9454439634451690e-01 2.2724545792544065e-01 -1.2845195053960263e+00 6 2.9454439634451712e-01 2.2724545792543988e-01 -1.2845195053960272e+00
7 3.4049112903270062e-01 -9.4655678322440595e-03 -2.4634480020857059e+00 7 3.4049112903270107e-01 -9.4655678322462800e-03 -2.4634480020857055e+00
8 1.1644354555804877e+00 -4.8367776650961369e-01 -6.7663643940735896e-01 8 1.1644354555804874e+00 -4.8367776650961330e-01 -6.7663643940735863e-01
9 1.3781717822696469e+00 -2.5332509530010827e-01 2.6864954436590061e-01 9 1.3781717822696467e+00 -2.5332509530010694e-01 2.6864954436590061e-01
10 2.0186368606041905e+00 -1.4285861423625792e+00 -9.6712491252780297e-01 10 2.0186368606041896e+00 -1.4285861423625787e+00 -9.6712491252780097e-01
11 1.7929137227577470e+00 -1.9875455388407410e+00 -1.8836565352266557e+00 11 1.7929137227577463e+00 -1.9875455388407417e+00 -1.8836565352266530e+00
12 3.0032775230399604e+00 -4.8983022415173838e-01 -1.6190248017343647e+00 12 3.0032775230399609e+00 -4.8983022415173938e-01 -1.6190248017343634e+00
13 4.0448964162125947e+00 -9.0213155122390720e-01 -1.6385398399479572e+00 13 4.0448964162125947e+00 -9.0213155122390887e-01 -1.6385398399479545e+00
14 2.6035151245015831e+00 -4.0874995493218902e-01 -2.6555999074786611e+00 14 2.6035151245015831e+00 -4.0874995493219152e-01 -2.6555999074786603e+00
15 2.9761196776172314e+00 5.6287237454108840e-01 -1.2442626196083382e+00 15 2.9761196776172318e+00 5.6287237454108718e-01 -1.2442626196083382e+00
16 2.6517373021566191e+00 -2.3957035508393720e+00 3.3389262100689376e-02 16 2.6517373021566177e+00 -2.3957035508393694e+00 3.3389262100692485e-02
17 2.2311114924744988e+00 -2.1018393228798540e+00 1.1496088522377521e+00 17 2.2311114924744970e+00 -2.1018393228798504e+00 1.1496088522377548e+00
18 2.1390642573201788e+00 3.0164773560693772e+00 -3.5143984803853874e+00 18 2.1390642573201784e+00 3.0164773560693781e+00 -3.5143984803853878e+00
19 1.5353246655146275e+00 2.6305911186316124e+00 -4.2455871034737074e+00 19 1.5353246655146278e+00 2.6305911186316133e+00 -4.2455871034737074e+00
20 2.7649421538938386e+00 3.6818603528430827e+00 -3.9364115785985558e+00 20 2.7649421538938390e+00 3.6818603528430849e+00 -3.9364115785985550e+00
21 4.9043112657298868e+00 -4.0774268210397873e+00 -3.6200836396129810e+00 21 4.9043112657298877e+00 -4.0774268210397882e+00 -3.6200836396129836e+00
22 4.3665322424283302e+00 -4.2075138112953594e+00 -4.4636587264885854e+00 22 4.3665322424283310e+00 -4.2075138112953594e+00 -4.4636587264885881e+00
23 5.7355405581985170e+00 -3.5789558641908905e+00 -3.8805763324089964e+00 23 5.7355405581985188e+00 -3.5789558641908918e+00 -3.8805763324089981e+00
24 2.0692780332810123e+00 3.1504920436416004e+00 3.1571131300668775e+00 24 2.0692780332810115e+00 3.1504920436416004e+00 3.1571131300668789e+00
25 1.3007297593169085e+00 3.2745259354179486e+00 2.5110163874103657e+00 25 1.3007297593169076e+00 3.2745259354179481e+00 2.5110163874103675e+00
26 2.5819416446099748e+00 4.0104903120756585e+00 3.2150249624526013e+00 26 2.5819416446099739e+00 4.0104903120756576e+00 3.2150249624526035e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
run_vel: ! |2 run_vel: ! |2
1 4.7093289825842518e-04 2.6351122778447999e-04 -4.4905093064114991e-04 1 4.7093289825842486e-04 2.6351122778447826e-04 -4.4905093064114855e-04
2 4.9594625316470484e-04 9.4561370489631939e-05 -5.4581359894047949e-04 2 4.9594625316470495e-04 9.4561370489630651e-05 -5.4581359894047721e-04
3 3.3306085115756087e-04 2.3224943880673381e-04 -2.3659455671746045e-04 3 3.3306085115756092e-04 2.3224943880673270e-04 -2.3659455671746018e-04
4 3.3692327392261114e-04 2.1926810694051279e-04 -2.4716631558862527e-04 4 3.3692327392261152e-04 2.1926810694051195e-04 -2.4716631558862522e-04
5 3.3642542694186013e-04 4.1797578013265895e-04 -1.8011341766657651e-04 5 3.3642542694185980e-04 4.1797578013265732e-04 -1.8011341766657692e-04
6 2.0926869754934733e-04 2.6449308951578761e-05 -1.0508938983871863e-04 6 2.0926869754934785e-04 2.6449308951578490e-05 -1.0508938983871839e-04
7 1.4629043007907862e-04 -1.6873376665350138e-04 -6.8354048774351599e-05 7 1.4629043007907975e-04 -1.6873376665350062e-04 -6.8354048774351260e-05
8 1.5844101624224864e-04 3.7728761274000492e-05 -1.9162715667091517e-05 8 1.5844101624224894e-04 3.7728761274000044e-05 -1.9162715667091402e-05
9 2.1299362072601976e-04 1.6917140529157604e-04 -6.3528165037846039e-05 9 2.1299362072601955e-04 1.6917140529157490e-04 -6.3528165037845781e-05
10 5.4261629412254251e-05 -9.4655528376811197e-05 1.0511362869146629e-04 10 5.4261629412254793e-05 -9.4655528376811116e-05 1.0511362869146627e-04
11 -3.2194160796503320e-05 -2.2025095264758748e-04 2.0300202946212385e-04 11 -3.2194160796502263e-05 -2.2025095264758662e-04 2.0300202946212347e-04
12 1.2640586304750342e-04 -2.9851080445665075e-04 -7.9476371818247547e-05 12 1.2640586304750418e-04 -2.9851080445665042e-04 -7.9476371818246096e-05
13 8.4523575162142323e-05 -4.0583135407330540e-04 -4.7551111331702706e-05 13 8.4523575162143095e-05 -4.0583135407330485e-04 -4.7551111331700809e-05
14 9.9954050381270240e-05 -4.2610816481298321e-04 -7.9255633594381333e-05 14 9.9954050381271487e-05 -4.2610816481298213e-04 -7.9255633594379828e-05
15 2.4417481119789840e-04 -2.3521002264677917e-04 -2.4875318161049140e-04 15 2.4417481119789889e-04 -2.3521002264677933e-04 -2.4875318161048917e-04
16 -9.0958138549664179e-06 3.7774817121227626e-06 2.4035199548835075e-04 16 -9.0958138549662281e-06 3.7774817121223831e-06 2.4035199548835009e-04
17 5.7507224523612718e-05 2.2629217444843883e-04 2.0686920072684827e-04 17 5.7507224523612284e-05 2.2629217444843761e-04 2.0686920072684746e-04
18 2.9220264989359676e-04 -6.2478376436796309e-04 8.4222594596602344e-04 18 2.9220264989359801e-04 -6.2478376436796276e-04 8.4222594596602355e-04
19 2.0572616567799036e-04 -5.0334424271726705e-04 8.4953929443210658e-04 19 2.0572616567799155e-04 -5.0334424271726661e-04 8.4953929443210658e-04
20 4.1224811789512805e-04 -7.4115205416011576e-04 8.3678612337507888e-04 20 4.1224811789512974e-04 -7.4115205416011565e-04 8.3678612337507910e-04
21 -1.0671858777656380e-03 -1.1531171045499509e-03 7.3720674900162192e-04 21 -1.0671858777656390e-03 -1.1531171045499513e-03 7.3720674900162170e-04
22 -1.1066511338291703e-03 -1.0433933757600456e-03 7.4544544325708616e-04 22 -1.1066511338291712e-03 -1.0433933757600460e-03 7.4544544325708584e-04
23 -9.7629260480941438e-04 -1.3100872491594094e-03 7.2687284219704804e-04 23 -9.7629260480941536e-04 -1.3100872491594103e-03 7.2687284219704793e-04
24 4.3308126651259334e-04 -6.6527658087322747e-04 8.4451298670663595e-04 24 4.3308126651259350e-04 -6.6527658087322768e-04 8.4451298670663606e-04
25 4.4565811905442911e-04 -5.1298436273584274e-04 8.5878867884521559e-04 25 4.4565811905442927e-04 -5.1298436273584263e-04 8.5878867884521559e-04
26 5.9865972692022798e-04 -7.6385263287080316e-04 8.4259943226842134e-04 26 5.9865972692022809e-04 -7.6385263287080348e-04 8.4259943226842155e-04
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:54 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid fix rigid
@ -13,7 +13,7 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-4.9200116134790363e+01 -2.6907707565987732e+01 -6.0080860422282560e+00 -2.5620423972101747e+01 -1.3450224059984075e+01 -1.4947288487004844e+00 -4.9200116134789894e+01 -2.6907707565987600e+01 -6.0080860422279923e+00 -2.5620423972101459e+01 -1.3450224059984031e+01 -1.4947288487004347e+00
global_scalar: 18.3405601674144 global_scalar: 18.3405601674144
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01
@ -33,15 +33,15 @@ run_pos: ! |2
15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00
16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1392027588271301e+00 3.0171068018412783e+00 -3.5144628518856349e+00 18 2.1392027588271301e+00 3.0171068018412779e+00 -3.5144628518856349e+00
19 1.5366124997074573e+00 2.6286809834111744e+00 -4.2452547844370221e+00 19 1.5366124997074571e+00 2.6286809834111748e+00 -4.2452547844370221e+00
20 2.7628161763455852e+00 3.6842251687634779e+00 -3.9370881219352558e+00 20 2.7628161763455852e+00 3.6842251687634775e+00 -3.9370881219352554e+00
21 4.9036621347791245e+00 -4.0757648442838548e+00 -3.6192617654515908e+00 21 4.9036621347791245e+00 -4.0757648442838548e+00 -3.6192617654515904e+00
22 4.3655322291888483e+00 -4.2084949965552561e+00 -4.4622011117402334e+00 22 4.3655322291888483e+00 -4.2084949965552561e+00 -4.4622011117402334e+00
23 5.7380414793463101e+00 -3.5841969195032672e+00 -3.8827839830470219e+00 23 5.7380414793463101e+00 -3.5841969195032672e+00 -3.8827839830470219e+00
24 2.0701314765323930e+00 3.1499370533342330e+00 3.1565324852522938e+00 24 2.0701314765323930e+00 3.1499370533342330e+00 3.1565324852522938e+00
25 1.3030170721374783e+00 3.2711173927682244e+00 2.5081940917429759e+00 25 1.3030170721374779e+00 3.2711173927682249e+00 2.5081940917429768e+00
26 2.5776230782480041e+00 4.0127347068243884e+00 3.2182355138709284e+00 26 2.5776230782480045e+00 4.0127347068243875e+00 3.2182355138709275e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.6149625095704870e-04 -3.1032459262908302e-04 8.1043030117346052e-04 18 3.6149625095704908e-04 -3.1032459262908286e-04 8.1043030117346042e-04
19 8.5103884665345441e-04 -1.4572280596788099e-03 1.0163621287634116e-03 19 8.5103884665345452e-04 -1.4572280596788108e-03 1.0163621287634116e-03
20 -6.5204659278590758e-04 4.3989037444289831e-04 4.9909839028507966e-04 20 -6.5204659278590683e-04 4.3989037444289853e-04 4.9909839028507890e-04
21 -1.3888125881903919e-03 -3.1978049143082570e-04 1.1455681499836646e-03 21 -1.3888125881903923e-03 -3.1978049143082407e-04 1.1455681499836646e-03
22 -1.6084223477729497e-03 -1.5355394240821158e-03 1.4772010826232373e-03 22 -1.6084223477729508e-03 -1.5355394240821113e-03 1.4772010826232373e-03
23 2.6392672378804886e-04 -3.9375414431174760e-03 -3.6991583139728127e-04 23 2.6392672378805081e-04 -3.9375414431174812e-03 -3.6991583139728051e-04
24 8.6062827067890290e-04 -9.4179873474469259e-04 5.5396395550012367e-04 24 8.6062827067890236e-04 -9.4179873474469237e-04 5.5396395550012442e-04
25 1.5933645477487557e-03 -2.2139156625681682e-03 -5.5078029695647412e-04 25 1.5933645477487542e-03 -2.2139156625681699e-03 -5.5078029695647488e-04
26 -1.5679561743998888e-03 3.5146224354725948e-04 2.4446924193334482e-03 26 -1.5679561743998840e-03 3.5146224354726122e-04 2.4446924193334474e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,6 +1,6 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:54 202
epsilon: 5e-12 epsilon: 5e-12
prerequisites: ! | prerequisites: ! |
atom full atom full
@ -14,7 +14,7 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-4.9200116134791799e+01 -2.6907707565986644e+01 -6.0080860422294684e+00 -2.5620423972101577e+01 -1.3450224059984462e+01 -1.4947288487000847e+00 -4.9200116134789241e+01 -2.6907707565985238e+01 -6.0080860422273377e+00 -2.5620423972099417e+01 -1.3450224059984127e+01 -1.4947288486998911e+00
global_scalar: 18.3405601674143 global_scalar: 18.3405601674143
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226854e-01 2.4726588069312836e+00 -1.7200860244148508e-01 1 -2.7993683669226854e-01 2.4726588069312836e+00 -1.7200860244148508e-01
@ -35,14 +35,14 @@ run_pos: ! |2
16 2.6517554244980301e+00 -2.3957110424978438e+00 3.2908335999177751e-02 16 2.6517554244980301e+00 -2.3957110424978438e+00 3.2908335999177751e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1392027588271310e+00 3.0171068018412779e+00 -3.5144628518856349e+00 18 2.1392027588271310e+00 3.0171068018412779e+00 -3.5144628518856349e+00
19 1.5366124997074584e+00 2.6286809834111740e+00 -4.2452547844370230e+00 19 1.5366124997074566e+00 2.6286809834111740e+00 -4.2452547844370239e+00
20 2.7628161763455852e+00 3.6842251687634775e+00 -3.9370881219352558e+00 20 2.7628161763455852e+00 3.6842251687634775e+00 -3.9370881219352558e+00
21 4.9036621347791245e+00 -4.0757648442838557e+00 -3.6192617654515917e+00 21 4.9036621347791245e+00 -4.0757648442838557e+00 -3.6192617654515900e+00
22 4.3655322291888483e+00 -4.2084949965552569e+00 -4.4622011117402334e+00 22 4.3655322291888483e+00 -4.2084949965552569e+00 -4.4622011117402334e+00
23 5.7380414793463084e+00 -3.5841969195032686e+00 -3.8827839830470223e+00 23 5.7380414793463101e+00 -3.5841969195032686e+00 -3.8827839830470232e+00
24 2.0701314765323913e+00 3.1499370533342308e+00 3.1565324852522920e+00 24 2.0701314765323913e+00 3.1499370533342308e+00 3.1565324852522920e+00
25 1.3030170721374779e+00 3.2711173927682236e+00 2.5081940917429755e+00 25 1.3030170721374779e+00 3.2711173927682236e+00 2.5081940917429755e+00
26 2.5776230782480036e+00 4.0127347068243875e+00 3.2182355138709280e+00 26 2.5776230782480054e+00 4.0127347068243875e+00 3.2182355138709262e+00
27 -1.9613581876744357e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744357e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678509e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678509e+00
29 -1.3108232656499084e+00 -3.5992986322410765e+00 2.2680459788743512e+00 29 -1.3108232656499084e+00 -3.5992986322410765e+00 2.2680459788743512e+00
@ -64,15 +64,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.6149625095704496e-04 -3.1032459262907451e-04 8.1043030117346150e-04 18 3.6149625095704480e-04 -3.1032459262907435e-04 8.1043030117346128e-04
19 8.5103884665346059e-04 -1.4572280596788069e-03 1.0163621287634041e-03 19 8.5103884665346124e-04 -1.4572280596788089e-03 1.0163621287634045e-03
20 -6.5204659278589056e-04 4.3989037444288725e-04 4.9909839028508367e-04 20 -6.5204659278589121e-04 4.3989037444288817e-04 4.9909839028508280e-04
21 -1.3888125881903861e-03 -3.1978049143082461e-04 1.1455681499836603e-03 21 -1.3888125881903863e-03 -3.1978049143082245e-04 1.1455681499836596e-03
22 -1.6084223477729506e-03 -1.5355394240821054e-03 1.4772010826232355e-03 22 -1.6084223477729515e-03 -1.5355394240820991e-03 1.4772010826232349e-03
23 2.6392672378804235e-04 -3.9375414431174561e-03 -3.6991583139728127e-04 23 2.6392672378804170e-04 -3.9375414431174621e-03 -3.6991583139727824e-04
24 8.6062827067889531e-04 -9.4179873474469281e-04 5.5396395550012681e-04 24 8.6062827067889477e-04 -9.4179873474469237e-04 5.5396395550012714e-04
25 1.5933645477487551e-03 -2.2139156625681582e-03 -5.5078029695647629e-04 25 1.5933645477487534e-03 -2.2139156625681600e-03 -5.5078029695647803e-04
26 -1.5679561743998853e-03 3.5146224354725482e-04 2.4446924193334521e-03 26 -1.5679561743998831e-03 3.5146224354725699e-04 2.4446924193334539e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:55 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nph fix rigid/nph
@ -13,38 +13,38 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |2- run_stress: ! |2-
4.3578059170174832e+01 1.7275105168494740e+01 6.7372361278298868e+01 5.1985075051780690e+01 -2.0990677390560389e+01 -7.5321398094463152e+00 4.3578059172167876e+01 1.7275105166465064e+01 6.7372361276630770e+01 5.1985075049901859e+01 -2.0990677389800858e+01 -7.5321398101845993e+00
global_scalar: 29.0236364415722 global_scalar: 29.023636440848
run_pos: ! |2 run_pos: ! |2
1 -6.3472039825537774e-01 3.0113983126285238e+00 -8.8148450172184312e-02 1 -6.3472039825517168e-01 3.0113983126282058e+00 -8.8148450172235826e-02
2 6.4798884173359994e-02 3.5870486860061543e+00 -9.1146271255437306e-01 2 6.4798884173500326e-02 3.5870486860057795e+00 -9.1146271255434463e-01
3 -1.1328967478842920e+00 1.5344674077764360e+00 -6.2949567786978733e-01 3 -1.1328967478840362e+00 1.5344674077762583e+00 -6.2949567786977667e-01
4 -2.1941320441844692e+00 1.8319737599532431e+00 -1.3824693495475060e+00 4 -2.1941320441841130e+00 1.8319737599530370e+00 -1.3824693495474225e+00
5 -1.3741175247363460e+00 1.1637763350571220e+00 6.0220861483097998e-01 5 -1.3741175247360697e+00 1.1637763350569887e+00 6.0220861483086097e-01
6 5.5368589242019262e-02 3.1209253712249385e-01 -1.4252606627468101e+00 6 5.5368589242158706e-02 3.1209253712244411e-01 -1.4252606627467266e+00
7 1.1075313780256746e-01 2.8008314824816694e-02 -2.8425552056440306e+00 7 1.1075313780270069e-01 2.8008314824797154e-02 -2.8425552056438050e+00
8 1.1011987966103707e+00 -5.4254536577072088e-01 -6.9472264392662098e-01 8 1.1011987966104080e+00 -5.4254536577068713e-01 -6.9472264392660854e-01
9 1.3580030945400914e+00 -2.6595138115347083e-01 4.4172536708307497e-01 9 1.3580030945401020e+00 -2.6595138115345840e-01 4.4172536708297194e-01
10 2.1282964643832063e+00 -1.6781145595678426e+00 -1.0442216631471748e+00 10 2.1282964643831388e+00 -1.6781145595676907e+00 -1.0442216631471304e+00
11 1.8571593172391960e+00 -2.3497452731073585e+00 -2.1462323657666937e+00 11 1.8571593172391605e+00 -2.3497452731071471e+00 -2.1462323657665392e+00
12 3.3117732698471869e+00 -5.4913311816194721e-01 -1.8274356036323782e+00 12 3.3117732698469986e+00 -5.4913311816190635e-01 -1.8274356036322548e+00
13 4.5640183918456163e+00 -1.0445083545908478e+00 -1.8509716390299458e+00 13 4.5640183918453143e+00 -1.0445083545907554e+00 -1.8509716390298214e+00
14 2.8312769330519441e+00 -4.5135848464346751e-01 -3.0735173792334480e+00 14 2.8312769330518019e+00 -4.5135848464344086e-01 -3.0735173792331993e+00
15 3.2788434490966072e+00 7.1618295543704136e-01 -1.3765217601453035e+00 15 3.2788434490964296e+00 7.1618295543695254e-01 -1.3765217601452289e+00
16 2.8895075000233614e+00 -2.8409365554013073e+00 1.5818504152562340e-01 16 2.8895075000232158e+00 -2.8409365554010479e+00 1.5818504152554702e-01
17 2.3837073405560201e+00 -2.4882133308171541e+00 1.5000885103551340e+00 17 2.3837073405559277e+00 -2.4882133308169232e+00 1.5000885103549333e+00
18 2.2738793194347995e+00 3.6743407122546436e+00 -4.1408965121169743e+00 18 2.2738793194357232e+00 3.6743407122553755e+00 -4.1408965121163197e+00
19 1.6572750518209620e+00 3.2770314238218798e+00 -4.8886441786647481e+00 19 1.6572750518209336e+00 3.2770314238152451e+00 -4.8886441786593569e+00
20 2.9120476452842148e+00 4.3568412675017782e+00 -4.5732834167711358e+00 20 2.9120476452800226e+00 4.3568412675031851e+00 -4.5732834167769187e+00
21 5.6058485050574518e+00 -4.8495065176199610e+00 -4.2655497599977545e+00 21 5.6058485050774536e+00 -4.8495065176300871e+00 -4.2655497599953458e+00
22 5.0552709233227606e+00 -4.9851876751499695e+00 -5.1280564953937073e+00 22 5.0552709232982114e+00 -4.9851876752032496e+00 -5.1280564953560424e+00
23 6.4593933586526457e+00 -4.3461765106386885e+00 -4.5350231455787116e+00 23 6.4593933585948218e+00 -4.3461765105422652e+00 -4.5350231456236889e+00
24 2.1823354618683499e+00 3.8552931130562804e+00 3.8953804330779338e+00 24 2.1823354619125279e+00 3.8552931130470363e+00 3.8953804330431208e+00
25 1.3973696115700314e+00 3.9794119229081808e+00 3.2321313265763383e+00 25 1.3973696115403698e+00 3.9794119228484153e+00 3.2321313266194949e+00
26 2.7018361229436447e+00 4.7379517630363708e+00 3.9583193477160581e+00 26 2.7018361227965517e+00 4.7379517631305443e+00 3.9583193478092706e+00
27 -2.6559803075362280e+00 -5.1969823689083769e+00 2.6552621488558881e+00 27 -2.6559803075358257e+00 -5.1969823689078796e+00 2.6552621488555683e+00
28 -3.5927802460212037e+00 -4.7943885088606857e+00 2.0214142204097989e+00 28 -3.5927802460207046e+00 -4.7943885088602283e+00 2.0214142204095413e+00
29 -1.8739632618342412e+00 -4.2877858778717988e+00 2.8450749793922530e+00 29 -1.8739632618339108e+00 -4.2877858778713946e+00 2.8450749793919066e+00
run_vel: ! |2 run_vel: ! |2
1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04 1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04
2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.0094600491857170e-04 -2.4312792028099414e-04 6.5542049134060274e-04 18 3.0094600491564739e-04 -2.4312792027781274e-04 6.5542049134062323e-04
19 7.4731683461619846e-04 -1.2894119671259621e-03 8.4327024053358754e-04 19 7.4731683462770054e-04 -1.2894119671278408e-03 8.4327024053533386e-04
20 -6.2333686370008492e-04 4.4115361642793068e-04 3.7135656431973134e-04 20 -6.2333686369976584e-04 4.4115361641690066e-04 3.7135656431834237e-04
21 -1.1457423792961207e-03 -1.7337748147951398e-04 9.4510018428184666e-04 21 -1.1457423793218525e-03 -1.7337748161437973e-04 9.4510018429417686e-04
22 -1.3457150580799371e-03 -1.2816797359999673e-03 1.2470992249788205e-03 22 -1.3457150581639319e-03 -1.2816797357047460e-03 1.2470992250388101e-03
23 3.6277645396700405e-04 -3.4719859050652826e-03 -4.3796817842582582e-04 23 3.6277645415306540e-04 -3.4719859048227848e-03 -4.3796817853449140e-04
24 7.2410992459670976e-04 -7.6012809759400297e-04 4.3327155120506525e-04 24 7.2410992462873655e-04 -7.6012809744767037e-04 4.3327155128124932e-04
25 1.3921349891892296e-03 -1.9207002802470775e-03 -5.7453335098664004e-04 25 1.3921349892629666e-03 -1.9207002802664867e-03 -5.7453335109528100e-04
26 -1.4901465945625163e-03 4.2012923513626613e-04 2.1578545406129362e-03 26 -1.4901465947638008e-03 4.2012923457099966e-04 2.1578545404178414e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:55 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nph/small fix rigid/nph/small
@ -13,38 +13,38 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |2- run_stress: ! |2-
2.7340318969496678e+01 4.7963870140135469e+00 6.8884396850629400e+01 2.9853310008504316e+01 -1.0857139901179401e+01 -5.1889756547613537e+00 2.7340318973870428e+01 4.7963870091858531e+00 6.8884396847592484e+01 2.9853310007358978e+01 -1.0857139901347637e+01 -5.1889756561453346e+00
global_scalar: 9.77678786322453 global_scalar: 9.77678786310451
run_pos: ! |2 run_pos: ! |2
1 -5.1121862036607624e-01 2.8134872171085981e+00 -4.8993015395440764e-02 1 -5.1121862036604515e-01 2.8134872171079977e+00 -4.8993015395518924e-02
2 1.4735952488044823e-01 3.3535825972284670e+00 -9.3694001270740124e-01 2 1.4735952488047133e-01 3.3535825972277546e+00 -9.3694001270735150e-01
3 -9.8023793775382462e-01 1.4277788160413873e+00 -6.3283768722999412e-01 3 -9.8023793775378820e-01 1.4277788160410712e+00 -6.3283768722999234e-01
4 -1.9793617512974810e+00 1.7069097152783730e+00 -1.4449221382956789e+00 4 -1.9793617512974304e+00 1.7069097152779946e+00 -1.4449221382955635e+00
5 -1.2073406578712493e+00 1.0799834439083895e+00 6.9555923026710076e-01 5 -1.2073406578712120e+00 1.0799834439081337e+00 6.9555923026692668e-01
6 1.3848116183740711e-01 2.8090381873862391e-01 -1.4910727029129127e+00 6 1.3848116183742931e-01 2.8090381873852976e-01 -1.4910727029127884e+00
7 1.9062418946015125e-01 1.4366032742495705e-02 -3.0196292835202954e+00 7 1.9062418946016990e-01 1.4366032742456625e-02 -3.0196292835199614e+00
8 1.1231015082845470e+00 -5.2094745136408704e-01 -7.0318517336044728e-01 8 1.1231015082845541e+00 -5.2094745136401599e-01 -7.0318517336042774e-01
9 1.3648756844511940e+00 -2.6143726919536014e-01 5.2247754752749742e-01 9 1.3648756844511976e+00 -2.6143726919534771e-01 5.2247754752734465e-01
10 2.0900856844466613e+00 -1.5863783165915786e+00 -1.0801209545801669e+00 10 2.0900856844466578e+00 -1.5863783165912952e+00 -1.0801209545800976e+00
11 1.8348175253566694e+00 -2.2165258198423707e+00 -2.2686429310674399e+00 11 1.8348175253566659e+00 -2.2165258198419622e+00 -2.2686429310672072e+00
12 3.2042965133156294e+00 -5.2712831182456732e-01 -1.9248196297791935e+00 12 3.2042965133156098e+00 -5.2712831182449804e-01 -1.9248196297790088e+00
13 4.3832508188729644e+00 -9.9190674157035730e-01 -1.9502033172904838e+00 13 4.3832508188729271e+00 -9.9190674157019298e-01 -1.9502033172902991e+00
14 2.7519224412447869e+00 -4.3539271970396598e-01 -3.2687227073824996e+00 14 2.7519224412447691e+00 -4.3539271970391624e-01 -3.2687227073821310e+00
15 3.1732939937025613e+00 6.6003562890635337e-01 -1.4385076445935461e+00 15 3.1732939937025400e+00 6.6003562890618639e-01 -1.4385076445934288e+00
16 2.8067449168448011e+00 -2.6773787170020160e+00 2.1667842294155371e-01 16 2.8067449168447887e+00 -2.6773787170015133e+00 2.1667842294144180e-01
17 2.3305479923928605e+00 -2.3464414104888620e+00 1.6639254952588054e+00 17 2.3305479923928516e+00 -2.3464414104884277e+00 1.6639254952584981e+00
18 2.2269920241221968e+00 3.4328783208250648e+00 -4.4342132514643442e+00 18 2.2269920241232128e+00 3.4328783208254681e+00 -4.4342132514635013e+00
19 1.6145347679280437e+00 3.0386658278250263e+00 -5.1868156516302486e+00 19 1.6145347679280793e+00 3.0386658278179439e+00 -5.1868156516245785e+00
20 2.8608613711069921e+00 4.1100452338277211e+00 -4.8694049549850762e+00 20 2.8608613711028656e+00 4.1100452338287408e+00 -4.8694049549907970e+00
21 5.3613621396753839e+00 -4.5653056926381028e+00 -4.5681019697332310e+00 21 5.3613621396958795e+00 -4.5653056926475841e+00 -4.5681019697305372e+00
22 4.8144754755163870e+00 -4.6999404673940806e+00 -5.4362066556515076e+00 22 4.8144754754921184e+00 -4.6999404674483083e+00 -5.4362066556130868e+00
23 6.2091840279374200e+00 -4.0659479263393665e+00 -4.8393130641406774e+00 23 6.2091840278795729e+00 -4.0659479262420684e+00 -4.8393130641864568e+00
24 2.1433208912156090e+00 3.5960988832244993e+00 4.2399236066761858e+00 24 2.1433208912603074e+00 3.5960988832146015e+00 4.2399236066404100e+00
25 1.3636453973791856e+00 3.7192408266937900e+00 3.5723762826039014e+00 25 1.3636453973491918e+00 3.7192408266342980e+00 3.5723762826473990e+00
26 2.6593036731430075e+00 4.4718649489299125e+00 4.3032623332451116e+00 26 2.6593036729945752e+00 4.4718649490241678e+00 4.3032623333405660e+00
27 -2.4141791756399114e+00 -4.8879035738861889e+00 2.9097838637423070e+00 27 -2.4141791756398536e+00 -4.8879035738852403e+00 2.9097838637418292e+00
28 -3.2961505257539727e+00 -4.5101758871992912e+00 2.2261768979311878e+00 28 -3.2961505257539048e+00 -4.5101758871984199e+00 2.2261768979308005e+00
29 -1.6779316575994772e+00 -4.0348635219032660e+00 3.1144975929061580e+00 29 -1.6779316575994301e+00 -4.0348635219024889e+00 3.1144975929056571e+00
run_vel: ! |2 run_vel: ! |2
1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04 1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04
2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.1638284997374886e-04 -2.6313163919391785e-04 6.1054395248654240e-04 18 3.1638284997073288e-04 -2.6313163919070400e-04 6.1054395248656961e-04
19 7.6494647251130164e-04 -1.3190724749194743e-03 7.9947132612800302e-04 19 7.6494647252307629e-04 -1.3190724749214317e-03 7.9947132612985744e-04
20 -6.1620104632544958e-04 4.2577138775425278e-04 3.2526261653689488e-04 20 -6.1620104632513885e-04 4.2577138774295257e-04 3.2526261653548683e-04
21 -1.2063428871264968e-03 -2.2879409865288636e-04 8.9132836537584854e-04 21 -1.2063428871524097e-03 -2.2879409878999576e-04 8.9132836538734455e-04
22 -1.4151473871025083e-03 -1.3502255396192354e-03 1.1972773108803675e-03 22 -1.4151473871894464e-03 -1.3502255393198256e-03 1.1972773109437851e-03
23 3.1280366090588076e-04 -3.5563936895860802e-03 -4.9548546521909192e-04 23 3.1280366109607172e-04 -3.5563936893394407e-03 -4.9548546532774947e-04
24 7.5594375538132891e-04 -8.1321044009404451e-04 3.9340911288127442e-04 24 7.5594375541558048e-04 -8.1321043994394464e-04 3.9340911295780760e-04
25 1.4373446730971094e-03 -1.9778020567293888e-03 -6.1842201907464972e-04 25 1.4373446731689036e-03 -1.9778020567486213e-03 -6.1842201918304457e-04
26 -1.4806168648241629e-03 3.7766934332214119e-04 2.1280924227254782e-03 26 -1.4806168650325995e-03 3.7766934274110835e-04 2.1280924225288347e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:56 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/npt fix rigid/npt
@ -12,65 +12,65 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.6326314448657713e+03 -1.4727331978534244e+03 -3.8557370515929333e+03 5.5052891601613476e+02 4.7346742977275369e+02 -6.2035591882215908e+02 -1.6326314448663304e+03 -1.4727331978532306e+03 -3.8557370515932275e+03 5.5052891601644728e+02 4.7346742977310510e+02 -6.2035591882122242e+02
global_scalar: 106.866830724743 global_scalar: 106.866830724741
run_pos: ! |2 run_pos: ! |2
1 -2.6314711410821801e-01 2.4664715027249615e+00 -1.7093568570971751e-01 1 -2.6314711410922875e-01 2.4664715027241684e+00 -1.7093568570875561e-01
2 3.1632911016085430e-01 2.9434731493855670e+00 -8.5432214735894441e-01 2 3.1632911015968190e-01 2.9434731493852482e+00 -8.5432214735778889e-01
3 -6.7623447816539795e-01 1.2410822625702851e+00 -6.1935152269952987e-01 3 -6.7623447816593885e-01 1.2410822625695044e+00 -6.1935152269903870e-01
4 -1.5552134736900181e+00 1.4878541801000127e+00 -1.2440909745472499e+00 4 -1.5552134736906362e+00 1.4878541800991378e+00 -1.2440909745466859e+00
5 -8.7601967096356681e-01 9.3417436540695586e-01 4.0272031680403497e-01 5 -8.7601967096402067e-01 9.3417436540572218e-01 4.0272031680440712e-01
6 3.0755837780652939e-01 2.2629147986257614e-01 -1.2791162680675363e+00 6 3.0755837780638462e-01 2.2629147986241449e-01 -1.2791162680673960e+00
7 3.5322094628055822e-01 -1.0043890952604606e-02 -2.4548503163676925e+00 7 3.5322094628053069e-01 -1.0043890952307954e-02 -2.4548503163676365e+00
8 1.1736205127906949e+00 -4.8269091330534497e-01 -6.7273784266497216e-01 8 1.1736205127907979e+00 -4.8269091330540537e-01 -6.7273784266507608e-01
9 1.3865071239751776e+00 -2.5278331076587346e-01 2.6996653369767554e-01 9 1.3865071239751696e+00 -2.5278331076620741e-01 2.6996653369766221e-01
10 2.0239883243188919e+00 -1.4252201368166180e+00 -9.6228264545848585e-01 10 2.0239883243193546e+00 -1.4252201368162511e+00 -9.6228264545891751e-01
11 1.7991233925762300e+00 -1.9828365722523360e+00 -1.8762366544349351e+00 11 1.7991233925769246e+00 -1.9828365722517098e+00 -1.8762366544355809e+00
12 3.0044710092991540e+00 -4.8928363303993549e-01 -1.6126944183950824e+00 12 3.0044710092992837e+00 -4.8928363303895761e-01 -1.6126944183951402e+00
13 4.0415308387389697e+00 -9.0061411582067930e-01 -1.6321139880361839e+00 13 4.0415308387392486e+00 -9.0061411581930262e-01 -1.6321139880363669e+00
14 2.6064005411337394e+00 -4.0859653026992238e-01 -2.6465043951812257e+00 14 2.6064005411338655e+00 -4.0859653026870735e-01 -2.6465043951812621e+00
15 2.9775904824776660e+00 5.6065407887794816e-01 -1.2391617757507083e+00 15 2.9775904824773907e+00 5.6065407887877150e-01 -1.2391617757503752e+00
16 2.6542663248050005e+00 -2.3895844048758690e+00 3.5746598094905657e-02 16 2.6542663248057963e+00 -2.3895844048756363e+00 3.5746598094128501e-02
17 2.2355490747039930e+00 -2.0962135127176689e+00 1.1489434027787402e+00 17 2.2355490747046538e+00 -2.0962135127180099e+00 1.1489434027780590e+00
18 2.0921160979688356e+00 2.9872159674132197e+00 -3.4902339097021988e+00 18 2.0921160979727347e+00 2.9872159674143273e+00 -3.4902339097026891e+00
19 1.4908686219050935e+00 2.6025398330890352e+00 -4.2194623779111327e+00 19 1.4908686219092431e+00 2.6025398330908249e+00 -4.2194623779121834e+00
20 2.7154518806596677e+00 3.6506388357590405e+00 -3.9111287168646642e+00 20 2.7154518806645740e+00 3.6506388357595867e+00 -3.9111287168645399e+00
21 4.8435638296059782e+00 -4.0881941921713345e+00 -3.5957796498843582e+00 21 4.8435638296030810e+00 -4.0881941921728835e+00 -3.5957796498833634e+00
22 4.3080557005390165e+00 -4.2177797604315348e+00 -4.4370935526129456e+00 22 4.3080557005367073e+00 -4.2177797604324549e+00 -4.4370935526124242e+00
23 5.6713237924952811e+00 -3.5912865024270464e+00 -3.8555915013200188e+00 23 5.6713237924930837e+00 -3.5912865024293716e+00 -3.8555915013182531e+00
24 2.0228224543362074e+00 3.1208125399078126e+00 3.1634860992081633e+00 24 2.0228224543345528e+00 3.1208125399081723e+00 3.1634860992076259e+00
25 1.2576132296064850e+00 3.2447174749282715e+00 2.5191319958263714e+00 25 1.2576132296055036e+00 3.2447174749294536e+00 2.5191319958251963e+00
26 2.5334951322496941e+00 3.9783477827943221e+00 3.2212409164234250e+00 26 2.5334951322488237e+00 3.9783477827941720e+00 3.2212409164234312e+00
27 -1.8488304998563310e+00 -4.2601261704683537e+00 2.0568476369354167e+00 27 -1.8488304998563332e+00 -4.2601261704683342e+00 2.0568476369354265e+00
28 -2.6026086128772414e+00 -3.9329047688996477e+00 1.5399898445636326e+00 28 -2.6026086128772454e+00 -3.9329047688996304e+00 1.5399898445636406e+00
29 -1.2195954744860948e+00 -3.5211468177700955e+00 2.2116264666073553e+00 29 -1.2195954744860957e+00 -3.5211468177700818e+00 2.2116264666073615e+00
run_vel: ! |2 run_vel: ! |2
1 1.2393084479632990e-03 7.0215195817088653e-04 -1.1910956210641626e-03 1 1.2393084479630032e-03 7.0215195817154908e-04 -1.1910956210640377e-03
2 1.3060936199990425e-03 2.5041119719272501e-04 -1.4496302699049824e-03 2 1.3060936199988530e-03 2.5041119719347138e-04 -1.4496302699051106e-03
3 8.7069732478185780e-04 6.1866591813723552e-04 -6.2317312592577423e-04 3 8.7069732478159932e-04 6.1866591813748793e-04 -6.2317312592554438e-04
4 8.8100215742054977e-04 5.8380213791498826e-04 -6.5145037264871986e-04 4 8.8100215742025042e-04 5.8380213791515870e-04 -6.5145037264846355e-04
5 8.7979303398027825e-04 1.1152950208759250e-03 -4.7231382224803808e-04 5 8.7979303397991721e-04 1.1152950208762108e-03 -4.7231382224758082e-04
6 5.3965146863318037e-04 6.8643008418777597e-05 -2.7149223435852534e-04 6 5.3965146863311749e-04 6.8643008418756997e-05 -2.7149223435848598e-04
7 3.7117679682175872e-04 -4.5322194777188925e-04 -1.7317402888836805e-04 7 3.7117679682181569e-04 -4.5322194777211666e-04 -1.7317402888850959e-04
8 4.0378854177636902e-04 9.9015358993729126e-05 -4.1783685861320472e-05 8 4.0378854177636355e-04 9.9015358993666161e-05 -4.1783685861269487e-05
9 5.4970639315548295e-04 4.5048022318715903e-04 -1.6045108899934789e-04 9 5.4970639315540587e-04 4.5048022318729201e-04 -1.6045108899919846e-04
10 1.2521448037932167e-04 -2.5472783650505810e-04 2.9052485920883609e-04 10 1.2521448037946088e-04 -2.5472783650533852e-04 2.9052485920877543e-04
11 -1.0599027352509822e-04 -5.9051612835328310e-04 5.5226010155811516e-04 11 -1.0599027352488030e-04 -5.9051612835384288e-04 5.5226010155799091e-04
12 3.1798607399596227e-04 -7.9980833669007897e-04 -2.0274707260252713e-04 12 3.1798607399623077e-04 -7.9980833669012060e-04 -2.0274707260294395e-04
13 2.0597404142647623e-04 -1.0865778699534437e-03 -1.1731137935602721e-04 13 2.0597404142686724e-04 -1.0865778699535142e-03 -1.1731137935659032e-04
14 2.4719215573317237e-04 -1.1410575874167027e-03 -2.0209037936245712e-04 14 2.4719215573349167e-04 -1.1410575874168849e-03 -2.0209037936298269e-04
15 6.3286464043707177e-04 -6.3068988069316188e-04 -6.5527927471316393e-04 15 6.3286464043726856e-04 -6.3068988069288280e-04 -6.5527927471360488e-04
16 -4.4100406049097274e-05 8.6869240447760984e-06 6.5198761255915241e-04 16 -4.4100406048952316e-05 8.6869240444182845e-06 6.5198761255923058e-04
17 1.3407421346951786e-04 6.0357565278281160e-04 5.6233596575944243e-04 17 1.3407421346950843e-04 6.0357565278263792e-04 5.6233596575975002e-04
18 7.9277804690583290e-04 -1.5618239874403777e-03 2.1367192719678641e-03 18 7.9277804690569055e-04 -1.5618239874425177e-03 2.1367192719678593e-03
19 5.6167660797931120e-04 -1.2371794194899347e-03 2.1562222137423708e-03 19 5.6167660797942721e-04 -1.2371794194922850e-03 2.1562222137424718e-03
20 1.1137406410129261e-03 -1.8729421751404616e-03 2.1222207985342511e-03 20 1.1137406410123482e-03 -1.8729421751430327e-03 2.1222207985340819e-03
21 -2.8426953558134279e-03 -2.9730185469798933e-03 1.8564402246260027e-03 21 -2.8426953558137735e-03 -2.9730185469781377e-03 1.8564402246257746e-03
22 -2.9480844379788478e-03 -2.6797216173783146e-03 1.8784164631756271e-03 22 -2.9480844379790160e-03 -2.6797216173769355e-03 1.8784164631754769e-03
23 -2.5997293519666649e-03 -3.3926375081648440e-03 1.8288830284145640e-03 23 -2.5997293519674954e-03 -3.3926375081633348e-03 1.8288830284141457e-03
24 1.1689404599038080e-03 -1.6701257754522614e-03 2.1428138286392188e-03 24 1.1689404599043950e-03 -1.6701257754515664e-03 2.1428138286394673e-03
25 1.2027302640324651e-03 -1.2630861421198962e-03 2.1808987508666854e-03 25 1.2027302640333160e-03 -1.2630861421196525e-03 2.1808987508670514e-03
26 1.6116362268904522e-03 -1.9337182438142464e-03 2.1377249582866698e-03 26 1.6116362268906777e-03 -1.9337182438138849e-03 2.1377249582867847e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:41 202 date_generated: Tue Sep 15 22:36:56 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/npt/small fix rigid/npt/small
@ -12,38 +12,38 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-8.7531774792845880e+01 5.5811525713967427e+00 -5.5468297751741936e+01 -1.5316306340330462e+02 1.4641268099032845e+02 1.7263710124990443e+01 -8.7531774769722233e+01 5.5811525017967618e+00 -5.5468297744356789e+01 -1.5316306343483367e+02 1.4641268097314369e+02 1.7263710089631282e+01
global_scalar: 77.7898343033466 global_scalar: 77.7898343029329
run_pos: ! |2 run_pos: ! |2
1 -4.6333219629017464e-01 2.7511450055072171e+00 -1.2865946102804671e-01 1 -4.6333219629007161e-01 2.7511450055070625e+00 -1.2865946102806269e-01
2 1.7937148390197599e-01 3.2800405238541188e+00 -8.8510337855740406e-01 2 1.7937148390204793e-01 3.2800405238539234e+00 -8.8510337855738808e-01
3 -9.2104620265683845e-01 1.3941717929286863e+00 -6.2603796687146485e-01 3 -9.2104620265671233e-01 1.3941717929286011e+00 -6.2603796687145774e-01
4 -1.8960869879713140e+00 1.6675144043870791e+00 -1.3178544214441361e+00 4 -1.8960869879711328e+00 1.6675144043869761e+00 -1.3178544214440926e+00
5 -1.1426748052070774e+00 1.0535885915280208e+00 5.0562616550060646e-01 5 -1.1426748052069362e+00 1.0535885915279550e+00 5.0562616550054784e-01
6 1.7070712623534234e-01 2.7107933832759024e-01 -1.3571701846607818e+00 6 1.7070712623541162e-01 2.7107933832755826e-01 -1.3571701846607374e+00
7 2.2159329060533217e-01 1.0068698962056644e-02 -2.6593507556861287e+00 7 2.2159329060539701e-01 1.0068698962042433e-02 -2.6593507556860114e+00
8 1.1315940381700900e+00 -5.1414408469810713e-01 -6.8596713849764512e-01 8 1.1315940381701060e+00 -5.1414408469809381e-01 -6.8596713849763802e-01
9 1.3675404538221958e+00 -2.6001531899017039e-01 3.5817751536668574e-01 9 1.3675404538221994e+00 -2.6001531899016506e-01 3.5817751536664133e-01
10 2.0752698846777538e+00 -1.5574812996955973e+00 -1.0070795245589732e+00 10 2.0752698846777218e+00 -1.5574812996955254e+00 -1.0070795245589492e+00
11 1.8261547470632262e+00 -2.1745615463232557e+00 -2.0195839000289277e+00 11 1.8261547470632067e+00 -2.1745615463231482e+00 -2.0195839000288469e+00
12 3.1626236108721919e+00 -5.2019677375527529e-01 -1.7266801053748662e+00 12 3.1626236108721066e+00 -5.2019677375525752e-01 -1.7266801053747978e+00
13 4.3131602274136434e+00 -9.7533717592330937e-01 -1.7483045222381550e+00 13 4.3131602274134853e+00 -9.7533717592326674e-01 -1.7483045222380902e+00
14 2.7211536303665351e+00 -4.3036348628164767e-01 -2.8715539682061753e+00 14 2.7211536303664605e+00 -4.3036348628163701e-01 -2.8715539682060491e+00
15 3.1323683805789226e+00 6.4234915962461692e-01 -1.3123899007467301e+00 15 3.1323683805788374e+00 6.4234915962457073e-01 -1.3123899007466848e+00
16 2.7746546569033050e+00 -2.6258578189757298e+00 9.7666596945760631e-02 16 2.7746546569032322e+00 -2.6258578189755974e+00 9.7666596945726880e-02
17 2.3099360535750968e+00 -2.3017831004885014e+00 1.3305794265748698e+00 17 2.3099360535750506e+00 -2.3017831004883886e+00 1.3305794265747686e+00
18 2.2091748314050417e+00 3.3564440703049438e+00 -3.8370878209013126e+00 18 2.2091748314094701e+00 3.3564440703097080e+00 -3.8370878208998480e+00
19 1.5986312961637505e+00 2.9614993054696921e+00 -4.5778944294659887e+00 19 1.5986312961639815e+00 2.9614993054417287e+00 -4.5778944294436021e+00
20 2.8405364052349338e+00 4.0335971973396720e+00 -4.2659151034058365e+00 20 2.8405364052167421e+00 4.0335971973474170e+00 -4.2659151034329339e+00
21 5.2651527409770740e+00 -4.4761614286051783e+00 -3.9518304737729775e+00 21 5.2651527410670678e+00 -4.4761614286515128e+00 -3.9518304737634447e+00
22 4.7192922285199597e+00 -4.6119045763260864e+00 -4.8062296932313151e+00 22 4.7192922284117014e+00 -4.6119045765637390e+00 -4.8062296930647124e+00
23 6.1127575785040520e+00 -3.9811721112979788e+00 -4.2204729622207884e+00 23 6.1127575782518644e+00 -3.9811721108739997e+00 -4.2204729624242692e+00
24 2.1290800759969954e+00 3.5132841007979358e+00 3.5392070210911051e+00 24 2.1290800761933255e+00 3.5132841007593623e+00 3.5392070209389175e+00
25 1.3519459805791634e+00 3.6349473856919570e+00 2.8807586651537935e+00 25 1.3519459804490630e+00 3.6349473854278020e+00 2.8807586653452137e+00
26 2.6413474240254864e+00 4.3893648731783070e+00 3.6035699963144729e+00 26 2.6413474233716503e+00 4.3893648735951771e+00 3.6035699967293215e+00
27 -2.3204235087830414e+00 -4.7905434153253355e+00 2.3919287951693260e+00 27 -2.3204235087828389e+00 -4.7905434153250859e+00 2.3919287951691697e+00
28 -3.1811356909799748e+00 -4.4206486004504146e+00 1.8095625809313809e+00 28 -3.1811356909797261e+00 -4.4206486004501846e+00 1.8095625809312565e+00
29 -1.6019226098505461e+00 -3.9551927030788505e+00 2.5663248522870763e+00 29 -1.6019226098503827e+00 -3.9551927030786480e+00 2.5663248522869146e+00
run_vel: ! |2 run_vel: ! |2
1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04 1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04
2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03
@ -62,15 +62,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 7.2384391134040955e-04 -6.0015829216475349e-04 1.5957533238985767e-03 18 7.2384391131466962e-04 -6.0015829212802744e-04 1.5957533238990557e-03
19 1.7583138221050250e-03 -3.0158245947715639e-03 2.0310435057846504e-03 19 1.7583138222551382e-03 -3.0158245948490800e-03 2.0310435058142466e-03
20 -1.4153552731881595e-03 9.7835305937683196e-04 9.3881222519315256e-04 20 -1.4153552732353322e-03 9.7835305930749246e-04 9.3881222516217452e-04
21 -2.7591188769548157e-03 -5.1180650667742274e-04 2.2758295070616427e-03 21 -2.7591188772323472e-03 -5.1180650802276303e-04 2.2758295071994400e-03
22 -3.2319732392443201e-03 -3.0809796458321497e-03 2.9861065761939520e-03 22 -3.2319732401280494e-03 -3.0809796427949646e-03 2.9861065768383484e-03
23 6.9767442924221611e-04 -8.1543313165593767e-03 -8.9929522622873284e-04 23 6.9767443123301817e-04 -8.1543313142268207e-03 -8.9929522742256325e-04
24 1.7345816996370428e-03 -1.8508160077952193e-03 1.0723416139295039e-03 24 1.7345816999787503e-03 -1.8508160062822960e-03 1.0723416147087285e-03
25 3.2855417747190488e-03 -4.5284294759700113e-03 -1.2529298996019375e-03 25 3.2855417755407170e-03 -4.5284294762327620e-03 -1.2529299007822620e-03
26 -3.4004728773874863e-03 8.5952141315486798e-04 5.0505027866838918e-03 26 -3.4004728795728927e-03 8.5952140737749570e-04 5.0505027847540657e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:57 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nve fix rigid/nve
@ -13,65 +13,65 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.4245356938010630e+03 -1.4496493316651863e+03 -3.6144360982531375e+03 8.4840626794791422e+02 2.0318336802435149e+02 -6.0622397695991776e+02 -1.4245356938011612e+03 -1.4496493316650422e+03 -3.6144360982532016e+03 8.4840626794792297e+02 2.0318336802442892e+02 -6.0622397695978816e+02
global_scalar: 15.7115214231781 global_scalar: 15.7115214231781
run_pos: ! |2 run_pos: ! |2
1 -2.7899546863889757e-01 2.4731857340328407e+00 -1.7290667740246246e-01 1 -2.7899546863905123e-01 2.4731857340327181e+00 -1.7290667740231969e-01
2 3.0296221610270047e-01 2.9517129916957696e+00 -8.5798904387773733e-01 2 3.0296221610252227e-01 2.9517129916957194e+00 -8.5798904387756503e-01
3 -6.9368802364133009e-01 1.2445115421754502e+00 -6.2281111198657968e-01 3 -6.9368802364141247e-01 1.2445115421753310e+00 -6.2281111198650718e-01
4 -1.5764879647102630e+00 1.4919714415841832e+00 -1.2492069414675773e+00 4 -1.5764879647103560e+00 1.4919714415840475e+00 -1.2492069414674947e+00
5 -8.9434512967433699e-01 9.3651699743513128e-01 4.0191726558252272e-01 5 -8.9434512967440649e-01 9.3651699743494377e-01 4.0191726558257690e-01
6 2.9454439634454876e-01 2.2724545792546230e-01 -1.2845195053960661e+00 6 2.9454439634452678e-01 2.2724545792543693e-01 -1.2845195053960459e+00
7 3.4049112903278611e-01 -9.4655678322095593e-03 -2.4634480020857445e+00 7 3.4049112903278234e-01 -9.4655678321664549e-03 -2.4634480020857370e+00
8 1.1644354555804766e+00 -4.8367776650961408e-01 -6.7663643940736429e-01 8 1.1644354555804921e+00 -4.8367776650962330e-01 -6.7663643940738027e-01
9 1.3781717822695931e+00 -2.5332509530012332e-01 2.6864954436590760e-01 9 1.3781717822695918e+00 -2.5332509530017322e-01 2.6864954436590494e-01
10 2.0186368606041754e+00 -1.4285861423625910e+00 -9.6712491252777666e-01 10 2.0186368606042460e+00 -1.4285861423625348e+00 -9.6712491252784183e-01
11 1.7929137227577672e+00 -1.9875455388407388e+00 -1.8836565352266459e+00 11 1.7929137227578726e+00 -1.9875455388406436e+00 -1.8836565352267429e+00
12 3.0032775230399946e+00 -4.8983022415176181e-01 -1.6190248017342788e+00 12 3.0032775230400142e+00 -4.8983022415161337e-01 -1.6190248017342870e+00
13 4.0448964162126213e+00 -9.0213155122394928e-01 -1.6385398399478248e+00 13 4.0448964162126639e+00 -9.0213155122374034e-01 -1.6385398399478515e+00
14 2.6035151245016692e+00 -4.0874995493219357e-01 -2.6555999074785932e+00 14 2.6035151245016883e+00 -4.0874995493201027e-01 -2.6555999074785985e+00
15 2.9761196776172660e+00 5.6287237454106087e-01 -1.2442626196082420e+00 15 2.9761196776172243e+00 5.6287237454118566e-01 -1.2442626196081918e+00
16 2.6517373021565369e+00 -2.3957035508394062e+00 3.3389262100735007e-02 16 2.6517373021566577e+00 -2.3957035508393689e+00 3.3389262100618433e-02
17 2.2311114924743678e+00 -2.1018393228798926e+00 1.1496088522377799e+00 17 2.2311114924744668e+00 -2.1018393228799419e+00 1.1496088522376777e+00
18 2.1390642573193248e+00 3.0164773560690969e+00 -3.5143984803853079e+00 18 2.1390642573199212e+00 3.0164773560692755e+00 -3.5143984803853900e+00
19 1.5353246655137389e+00 2.6305911186311701e+00 -4.2455871034735111e+00 19 1.5353246655143720e+00 2.6305911186314508e+00 -4.2455871034736816e+00
20 2.7649421538927594e+00 3.6818603528429303e+00 -3.9364115785986051e+00 20 2.7649421538935122e+00 3.6818603528430254e+00 -3.9364115785985936e+00
21 4.9043112657306356e+00 -4.0774268210394267e+00 -3.6200836396131266e+00 21 4.9043112657301942e+00 -4.0774268210396798e+00 -3.6200836396129796e+00
22 4.3665322424289670e+00 -4.2075138112951516e+00 -4.4636587264886334e+00 22 4.3665322424286144e+00 -4.2075138112953070e+00 -4.4636587264885614e+00
23 5.7355405581991068e+00 -3.5789558641903501e+00 -3.8805763324092997e+00 23 5.7355405581987764e+00 -3.5789558641907195e+00 -3.8805763324090350e+00
24 2.0692780332812601e+00 3.1504920436415342e+00 3.1571131300669530e+00 24 2.0692780332810026e+00 3.1504920436416008e+00 3.1571131300668833e+00
25 1.3007297593170202e+00 3.2745259354176830e+00 2.5110163874105687e+00 25 1.3007297593168636e+00 3.2745259354178766e+00 2.5110163874103986e+00
26 2.5819416446100352e+00 4.0104903120757118e+00 3.2150249624525613e+00 26 2.5819416446099002e+00 4.0104903120757012e+00 3.2150249624525742e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
run_vel: ! |2 run_vel: ! |2
1 4.7093289825842822e-04 2.6351122778447077e-04 -4.4905093064114498e-04 1 4.7093289825841293e-04 2.6351122778450878e-04 -4.4905093064113820e-04
2 4.9594625316470929e-04 9.4561370489625745e-05 -5.4581359894047363e-04 2 4.9594625316469953e-04 9.4561370489667690e-05 -5.4581359894048231e-04
3 3.3306085115756277e-04 2.3224943880672107e-04 -2.3659455671746167e-04 3 3.3306085115754900e-04 2.3224943880673573e-04 -2.3659455671744771e-04
4 3.3692327392261439e-04 2.1926810694049314e-04 -2.4716631558863080e-04 4 3.3692327392259743e-04 2.1926810694050262e-04 -2.4716631558861427e-04
5 3.3642542694186029e-04 4.1797578013264637e-04 -1.8011341766657562e-04 5 3.3642542694184180e-04 4.1797578013266394e-04 -1.8011341766654835e-04
6 2.0926869754934836e-04 2.6449308951571896e-05 -1.0508938983872182e-04 6 2.0926869754934465e-04 2.6449308951570318e-05 -1.0508938983871884e-04
7 1.4629043007908084e-04 -1.6873376665350970e-04 -6.8354048774359419e-05 7 1.4629043007908249e-04 -1.6873376665352393e-04 -6.8354048774366371e-05
8 1.5844101624224778e-04 3.7728761274000532e-05 -1.9162715667091917e-05 8 1.5844101624224789e-04 3.7728761273996988e-05 -1.9162715667088746e-05
9 2.1299362072601795e-04 1.6917140529157899e-04 -6.3528165037841878e-05 9 2.1299362072601516e-04 1.6917140529158729e-04 -6.3528165037833679e-05
10 5.4261629412252272e-05 -9.4655528376805682e-05 1.0511362869146485e-04 10 5.4261629412260051e-05 -9.4655528376821931e-05 1.0511362869146147e-04
11 -3.2194160796505001e-05 -2.2025095264758494e-04 2.0300202946211710e-04 11 -3.2194160796493915e-05 -2.2025095264761762e-04 2.0300202946211090e-04
12 1.2640586304750337e-04 -2.9851080445663953e-04 -7.9476371818245541e-05 12 1.2640586304751801e-04 -2.9851080445664316e-04 -7.9476371818270898e-05
13 8.4523575162141496e-05 -4.0583135407328702e-04 -4.7551111331698668e-05 13 8.4523575162162963e-05 -4.0583135407329249e-04 -4.7551111331733104e-05
14 9.9954050381271663e-05 -4.2610816481297622e-04 -7.9255633594383908e-05 14 9.9954050381287994e-05 -4.2610816481298853e-04 -7.9255633594414862e-05
15 2.4417481119789943e-04 -2.3521002264676751e-04 -2.4875318161048533e-04 15 2.4417481119791065e-04 -2.3521002264675271e-04 -2.4875318161051281e-04
16 -9.0958138549712697e-06 3.7774817121341365e-06 2.4035199548835218e-04 16 -9.0958138549621353e-06 3.7774817121143600e-06 2.4035199548835649e-04
17 5.7507224523607053e-05 2.2629217444844902e-04 2.0686920072685291e-04 17 5.7507224523608761e-05 2.2629217444844084e-04 2.0686920072687044e-04
18 2.9220264989358690e-04 -6.2478376436779113e-04 8.4222594596602713e-04 18 2.9220264989358500e-04 -6.2478376436791039e-04 8.4222594596602756e-04
19 2.0572616567795615e-04 -5.0334424271708381e-04 8.4953929443210246e-04 19 2.0572616567796797e-04 -5.0334424271721316e-04 8.4953929443210886e-04
20 4.1224811789515093e-04 -7.4115205415990477e-04 8.3678612337509482e-04 20 4.1224811789512605e-04 -7.4115205416005038e-04 8.3678612337508614e-04
21 -1.0671858777655896e-03 -1.1531171045501079e-03 7.3720674900162972e-04 21 -1.0671858777656232e-03 -1.1531171045500114e-03 7.3720674900161617e-04
22 -1.1066511338291411e-03 -1.0433933757601768e-03 7.4544544325708855e-04 22 -1.1066511338291647e-03 -1.0433933757601002e-03 7.4544544325707944e-04
23 -9.7629260480932688e-04 -1.3100872491595415e-03 7.2687284219706961e-04 23 -9.7629260480938673e-04 -1.3100872491594617e-03 7.2687284219704544e-04
24 4.3308126651255062e-04 -6.6527658087326986e-04 8.4451298670662164e-04 24 4.3308126651259079e-04 -6.6527658087322801e-04 8.4451298670663660e-04
25 4.4565811905435875e-04 -5.1298436273585293e-04 8.5878867884519347e-04 25 4.4565811905441442e-04 -5.1298436273583461e-04 8.5878867884521515e-04
26 5.9865972692021269e-04 -7.6385263287081313e-04 8.4259943226841743e-04 26 5.9865972692023438e-04 -7.6385263287079188e-04 8.4259943226842502e-04
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:57 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nve fix rigid/nve
@ -13,8 +13,8 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-4.9200114783104425e+01 -2.6907707681632978e+01 -6.0080872466970643e+00 -2.5620425754068116e+01 -1.3450222537284642e+01 -1.4947348675137455e+00 -4.9200114774917928e+01 -2.6907707694141234e+01 -6.0080872444876876e+00 -2.5620425756344922e+01 -1.3450222538011758e+01 -1.4947348732783965e+00
global_scalar: 18.3405601681427 global_scalar: 18.3405601673644
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01
2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01 2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01
@ -33,15 +33,15 @@ run_pos: ! |2
15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00
16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1392027588259426e+00 3.0171068018410385e+00 -3.5144628518857144e+00 18 2.1392027588270928e+00 3.0171068018423082e+00 -3.5144628518853867e+00
19 1.5366124996933792e+00 2.6286809834308120e+00 -4.2452547844370390e+00 19 1.5366124996934336e+00 2.6286809834236959e+00 -4.2452547844313493e+00
20 2.7628161763644057e+00 3.6842251687447973e+00 -3.9370881219349219e+00 20 2.7628161763597592e+00 3.6842251687468450e+00 -3.9370881219419189e+00
21 4.9036621348239384e+00 -4.0757648444484591e+00 -3.6192617654929755e+00 21 4.9036621348471368e+00 -4.0757648444604762e+00 -3.6192617654906609e+00
22 4.3655322292403929e+00 -4.2084949963658875e+00 -4.4622011118416509e+00 22 4.3655322292129357e+00 -4.2084949964269480e+00 -4.4622011117992786e+00
23 5.7380414791158731e+00 -3.5841969190355476e+00 -3.8827839827804009e+00 23 5.7380414790507261e+00 -3.5841969189265162e+00 -3.8827839828320116e+00
24 2.0701314764430689e+00 3.1499370533656190e+00 3.1565324853444698e+00 24 2.0701314764933532e+00 3.1499370533556008e+00 3.1565324853054118e+00
25 1.3030170721374641e+00 3.2711173928413317e+00 2.5081940917372791e+00 25 1.3030170721038390e+00 3.2711173927738786e+00 2.5081940917867680e+00
26 2.5776230786045939e+00 4.0127347066259897e+00 3.2182355135086644e+00 26 2.5776230784374867e+00 4.0127347067334345e+00 3.2182355136150917e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.6149625095274778e-04 -3.1032459262586538e-04 8.1043030117478813e-04 18 3.6149625094898083e-04 -3.1032459262177046e-04 8.1043030117471950e-04
19 8.5103884663454885e-04 -1.4572280597095664e-03 1.0163621287550262e-03 19 8.5103884664914189e-04 -1.4572280597118458e-03 1.0163621287571445e-03
20 -6.5204659274983282e-04 4.3989037446081253e-04 4.9909839028816031e-04 20 -6.5204659274939046e-04 4.3989037444674766e-04 4.9909839028631543e-04
21 -1.3888125887768562e-03 -3.1978049174111308e-04 1.1455681505473695e-03 21 -1.3888125888095134e-03 -3.1978049191290828e-04 1.1455681505629727e-03
22 -1.6084223472408303e-03 -1.5355394238968283e-03 1.4772010818589064e-03 22 -1.6084223473476298e-03 -1.5355394235202365e-03 1.4772010819351848e-03
23 2.6392672559722471e-04 -3.9375414420642855e-03 -3.6991583288341215e-04 23 2.6392672583440695e-04 -3.9375414417551127e-03 -3.6991583302200246e-04
24 8.6062827042478272e-04 -9.4179873506334698e-04 5.5396395546095079e-04 24 8.6062827046548757e-04 -9.4179873487668705e-04 5.5396395555797225e-04
25 1.5933645477524169e-03 -2.2139156628045906e-03 -5.5078029709943800e-04 25 1.5933645478462869e-03 -2.2139156628290971e-03 -5.5078029723781006e-04
26 -1.5679561733890394e-03 3.5146224505577979e-04 2.4446924196328459e-03 26 -1.5679561736454228e-03 3.5146224433513598e-04 2.4446924193838983e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:58 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nve fix rigid/nve
@ -13,26 +13,26 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.3754817467882001e+03 -1.4228425246443051e+03 -3.6087196200592211e+03 8.7407043142561224e+02 2.1665316510417915e+02 -6.0480791467760923e+02 -1.3754817467882772e+03 -1.4228425246441275e+03 -3.6087196200592480e+03 8.7407043142559348e+02 2.1665316510426322e+02 -6.0480791467747576e+02
global_scalar: 4.53142303857025 global_scalar: 4.53142303857033
run_pos: ! |2 run_pos: ! |2
1 -2.7899546859691271e-01 2.4731857340428940e+00 -1.7290667720880570e-01 1 -2.7899546859706881e-01 2.4731857340427750e+00 -1.7290667720866193e-01
2 3.0296221616799635e-01 2.9517129917211671e+00 -8.5798904365355999e-01 2 3.0296221616781649e-01 2.9517129917211218e+00 -8.5798904365338713e-01
3 -6.9368802362164272e-01 1.2445115422150048e+00 -6.2281111185293192e-01 3 -6.9368802362172777e-01 1.2445115422148878e+00 -6.2281111185285920e-01
4 -1.5764879646738923e+00 1.4919714416722523e+00 -1.2492069413382727e+00 4 -1.5764879646739900e+00 1.4919714416721197e+00 -1.2492069413381908e+00
5 -8.9434512967957924e-01 9.3651699743540839e-01 4.0191726569948305e-01 5 -8.9434512967965252e-01 9.3651699743522254e-01 4.0191726569953845e-01
6 2.9454439635069130e-01 2.2724545796945167e-01 -1.2845195052894625e+00 6 2.9454439635066831e-01 2.2724545796942719e-01 -1.2845195052894431e+00
7 3.4049112905320356e-01 -9.4655677385257209e-03 -2.4634480019885614e+00 7 3.4049112905319934e-01 -9.4655677384814507e-03 -2.4634480019885556e+00
8 1.1644354555589551e+00 -4.8367776651302752e-01 -6.7663643931661333e-01 8 1.1644354555589707e+00 -4.8367776651303718e-01 -6.7663643931662931e-01
9 1.3781717822376145e+00 -2.5332509534949033e-01 2.6864954447022071e-01 9 1.3781717822376129e+00 -2.5332509534954067e-01 2.6864954447021949e-01
10 2.0186368605645622e+00 -1.4285861423743027e+00 -9.6712491246322974e-01 10 2.0186368605646337e+00 -1.4285861423742481e+00 -9.6712491246329535e-01
11 1.7929137227201126e+00 -1.9875455388074434e+00 -1.8836565351900285e+00 11 1.7929137227202196e+00 -1.9875455388073511e+00 -1.8836565351901273e+00
12 3.0032775230343445e+00 -4.8983022415937488e-01 -1.6190248016125284e+00 12 3.0032775230343667e+00 -4.8983022415922672e-01 -1.6190248016125368e+00
13 4.0448964161972523e+00 -9.0213155125610900e-01 -1.6385398398261353e+00 13 4.0448964161972993e+00 -9.0213155125590028e-01 -1.6385398398261621e+00
14 2.6035151245156194e+00 -4.0874995488538468e-01 -2.6555999073601440e+00 14 2.6035151245156412e+00 -4.0874995488520105e-01 -2.6555999073601511e+00
15 2.9761196776309022e+00 5.6287237451795524e-01 -1.2442626194415798e+00 15 2.9761196776308623e+00 5.6287237451808192e-01 -1.2442626194415292e+00
16 2.6517373020763406e+00 -2.3957035509096727e+00 3.3389262134360442e-02 16 2.6517373020764632e+00 -2.3957035509096389e+00 3.3389262134244646e-02
17 2.2311114923823547e+00 -2.1018393229880195e+00 1.1496088522769190e+00 17 2.2311114923824555e+00 -2.1018393229880719e+00 1.1496088522768189e+00
18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00
19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00
20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00
@ -46,23 +46,23 @@ run_pos: ! |2
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
run_vel: ! |2 run_vel: ! |2
1 4.7093296226166030e-04 2.6351124312056276e-04 -4.4905063547614088e-04 1 4.7093296226164512e-04 2.6351124312060207e-04 -4.4905063547613525e-04
2 4.9594635271877621e-04 9.4561409237131533e-05 -5.4581325723052814e-04 2 4.9594635271876732e-04 9.4561409237174874e-05 -5.4581325723053746e-04
3 3.3306088119083302e-04 2.3224949911014063e-04 -2.3659435306900835e-04 3 3.3306088119081914e-04 2.3224949911015690e-04 -2.3659435306899615e-04
4 3.3692332940286982e-04 2.1926824120527540e-04 -2.4716611858556823e-04 4 3.3692332940285356e-04 2.1926824120528714e-04 -2.4716611858555419e-04
5 3.3642541894624174e-04 4.1797578053942325e-04 -1.8011323945928826e-04 5 3.3642541894622217e-04 4.1797578053944228e-04 -1.8011323945926297e-04
6 2.0926870695908416e-04 2.6449376032433866e-05 -1.0508922741401649e-04 6 2.0926870695908053e-04 2.6449376032433595e-05 -1.0508922741401471e-04
7 1.4629046128363069e-04 -1.6873362379724041e-04 -6.8353900724078427e-05 7 1.4629046128363337e-04 -1.6873362379725315e-04 -6.8353900724086707e-05
8 1.5844098346817965e-04 3.7728756087618508e-05 -1.9162577392849601e-05 8 1.5844098346817900e-04 3.7728756087615784e-05 -1.9162577392846985e-05
9 2.1299357198252983e-04 1.6917133003967010e-04 -6.3528006071196204e-05 9 2.1299357198252555e-04 1.6917133003967901e-04 -6.3528006071188276e-05
10 5.4261569071245287e-05 -9.4655546204693502e-05 1.0511372702289562e-04 10 5.4261569071252172e-05 -9.4655546204709209e-05 1.0511372702289220e-04
11 -3.2194218121523810e-05 -2.2025090185602106e-04 2.0300208519292106e-04 11 -3.2194218121513158e-05 -2.2025090185605299e-04 2.0300208519291455e-04
12 1.2640585449263605e-04 -2.9851081600945606e-04 -7.9476186245574772e-05 12 1.2640585449265077e-04 -2.9851081600945932e-04 -7.9476186245599193e-05
13 8.4523551795102371e-05 -4.0583140303606291e-04 -4.7550925831929232e-05 13 8.4523551795123811e-05 -4.0583140303606844e-04 -4.7550925831962043e-05
14 9.9954071734164831e-05 -4.2610809338913152e-04 -7.9255453072665335e-05 14 9.9954071734182138e-05 -4.2610809338914323e-04 -7.9255453072695788e-05
15 2.4417483202630110e-04 -2.3521005781667857e-04 -2.4875292755151528e-04 15 2.4417483202631259e-04 -2.3521005781666340e-04 -2.4875292755154174e-04
16 -9.0959360838858137e-06 3.7773746063309333e-06 2.4035204669042528e-04 16 -9.0959360838789561e-06 3.7773746063112143e-06 2.4035204669043016e-04
17 5.7507084250805080e-05 2.2629200960630369e-04 2.0686926033794975e-04 17 5.7507084250803752e-05 2.2629200960629542e-04 2.0686926033796743e-04
18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04
19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03
20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:58 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nve/small fix rigid/nve/small
@ -13,8 +13,8 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-4.9200114783104425e+01 -2.6907707681632978e+01 -6.0080872466970643e+00 -2.5620425754068116e+01 -1.3450222537284642e+01 -1.4947348675137455e+00 -4.9200114774917928e+01 -2.6907707694141234e+01 -6.0080872444876876e+00 -2.5620425756344922e+01 -1.3450222538011758e+01 -1.4947348732783965e+00
global_scalar: 0.500731871980239 global_scalar: 0.50073187196632
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01
2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01 2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01
@ -33,15 +33,15 @@ run_pos: ! |2
15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00
16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1392027588259426e+00 3.0171068018410385e+00 -3.5144628518857144e+00 18 2.1392027588270928e+00 3.0171068018423082e+00 -3.5144628518853867e+00
19 1.5366124996933792e+00 2.6286809834308120e+00 -4.2452547844370390e+00 19 1.5366124996934336e+00 2.6286809834236959e+00 -4.2452547844313493e+00
20 2.7628161763644057e+00 3.6842251687447973e+00 -3.9370881219349219e+00 20 2.7628161763597592e+00 3.6842251687468450e+00 -3.9370881219419189e+00
21 4.9036621348239384e+00 -4.0757648444484591e+00 -3.6192617654929755e+00 21 4.9036621348471368e+00 -4.0757648444604762e+00 -3.6192617654906609e+00
22 4.3655322292403929e+00 -4.2084949963658875e+00 -4.4622011118416509e+00 22 4.3655322292129357e+00 -4.2084949964269480e+00 -4.4622011117992786e+00
23 5.7380414791158731e+00 -3.5841969190355476e+00 -3.8827839827804009e+00 23 5.7380414790507261e+00 -3.5841969189265162e+00 -3.8827839828320116e+00
24 2.0701314764430689e+00 3.1499370533656190e+00 3.1565324853444698e+00 24 2.0701314764933532e+00 3.1499370533556008e+00 3.1565324853054118e+00
25 1.3030170721374641e+00 3.2711173928413317e+00 2.5081940917372791e+00 25 1.3030170721038390e+00 3.2711173927738786e+00 2.5081940917867680e+00
26 2.5776230786045939e+00 4.0127347066259897e+00 3.2182355135086644e+00 26 2.5776230784374867e+00 4.0127347067334345e+00 3.2182355136150917e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.6149625095274778e-04 -3.1032459262586538e-04 8.1043030117478813e-04 18 3.6149625094898083e-04 -3.1032459262177046e-04 8.1043030117471950e-04
19 8.5103884663454885e-04 -1.4572280597095664e-03 1.0163621287550262e-03 19 8.5103884664914189e-04 -1.4572280597118458e-03 1.0163621287571445e-03
20 -6.5204659274983282e-04 4.3989037446081253e-04 4.9909839028816031e-04 20 -6.5204659274939046e-04 4.3989037444674766e-04 4.9909839028631543e-04
21 -1.3888125887768562e-03 -3.1978049174111308e-04 1.1455681505473695e-03 21 -1.3888125888095134e-03 -3.1978049191290828e-04 1.1455681505629727e-03
22 -1.6084223472408303e-03 -1.5355394238968283e-03 1.4772010818589064e-03 22 -1.6084223473476298e-03 -1.5355394235202365e-03 1.4772010819351848e-03
23 2.6392672559722471e-04 -3.9375414420642855e-03 -3.6991583288341215e-04 23 2.6392672583440695e-04 -3.9375414417551127e-03 -3.6991583302200246e-04
24 8.6062827042478272e-04 -9.4179873506334698e-04 5.5396395546095079e-04 24 8.6062827046548757e-04 -9.4179873487668705e-04 5.5396395555797225e-04
25 1.5933645477524169e-03 -2.2139156628045906e-03 -5.5078029709943800e-04 25 1.5933645478462869e-03 -2.2139156628290971e-03 -5.5078029723781006e-04
26 -1.5679561733890394e-03 3.5146224505577979e-04 2.4446924196328459e-03 26 -1.5679561736454228e-03 3.5146224433513598e-04 2.4446924193838983e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,6 +1,6 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:59 202
epsilon: 5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
@ -12,26 +12,26 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.3123962047751329e+03 -1.3675423591737690e+03 -3.5468492999580276e+03 7.8271738572462300e+02 2.6480486115425720e+02 -7.6950536863901277e+02 -1.3123962047757550e+03 -1.3675423591710455e+03 -3.5468492999583855e+03 7.8271738572396384e+02 2.6480486115495091e+02 -7.6950536863736306e+02
global_scalar: 68.0865964742217 global_scalar: 68.0865964742317
run_pos: ! |2 run_pos: ! |2
1 -2.7802951913770868e-01 2.4737132264328308e+00 -1.7381271738810056e-01 1 -2.7802951913990959e-01 2.4737132264311215e+00 -1.7381271738602289e-01
2 3.0397800832728550e-01 2.9519031941438283e+00 -8.5908822750516822e-01 2 3.0397800832473609e-01 2.9519031941431444e+00 -8.5908822750267100e-01
3 -6.9299720296286593e-01 1.2449766685883559e+00 -6.2329294828441417e-01 3 -6.9299720296404743e-01 1.2449766685866726e+00 -6.2329294828335358e-01
4 -1.5757894675962001e+00 1.4924105480993224e+00 -1.2497098747252475e+00 4 -1.5757894675975461e+00 1.4924105480974301e+00 -1.2497098747240374e+00
5 -8.9364750934319548e-01 9.3735293261268249e-01 4.0154813851909255e-01 5 -8.9364750934418624e-01 9.3735293261000852e-01 4.0154813851989335e-01
6 2.9498813449207129e-01 2.2729986883011363e-01 -1.2847387164263608e+00 6 2.9498813449175199e-01 2.2729986882976547e-01 -1.2847387164260673e+00
7 3.4080910885033866e-01 -9.8008218366116284e-03 -2.4635938021180581e+00 7 3.4080910885027837e-01 -9.8008218359699473e-03 -2.4635938021179546e+00
8 1.1647778042703230e+00 -4.8360070140693001e-01 -6.7668409924195017e-01 8 1.1647778042705452e+00 -4.8360070140706557e-01 -6.7668409924218165e-01
9 1.3786230528159205e+00 -2.5298559880078242e-01 2.6851325883864419e-01 9 1.3786230528159027e+00 -2.5298559880150862e-01 2.6851325883861188e-01
10 2.0187712935455902e+00 -1.4287732348430000e+00 -9.6692440387054135e-01 10 2.0187712935465942e+00 -1.4287732348422091e+00 -9.6692440387148870e-01
11 1.7928755785816499e+00 -1.9879833661326805e+00 -1.8832605388676149e+00 11 1.7928755785831587e+00 -1.9879833661313322e+00 -1.8832605388690278e+00
12 3.0035558347416837e+00 -4.9042429038483137e-01 -1.6191927838344911e+00 12 3.0035558347419657e+00 -4.9042429038271507e-01 -1.6191927838346238e+00
13 4.0450911337524778e+00 -9.0293975523458492e-01 -1.6386440514131717e+00 13 4.0450911337530959e+00 -9.0293975523160919e-01 -1.6386440514135796e+00
14 2.6037405819191823e+00 -4.0959881564364919e-01 -2.6557674031620193e+00 14 2.6037405819194577e+00 -4.0959881564101863e-01 -2.6557674031621108e+00
15 2.9766330093341349e+00 5.6240461100592032e-01 -1.2447686007440930e+00 15 2.9766330093335447e+00 5.6240461100771322e-01 -1.2447686007433758e+00
16 2.6517453810130034e+00 -2.3956939898031364e+00 3.3859750044474057e-02 16 2.6517453810147344e+00 -2.3956939898026426e+00 3.3859750042781744e-02
17 2.2312525656134730e+00 -2.1013855689257279e+00 1.1500124166849996e+00 17 2.2312525656149020e+00 -2.1013855689264771e+00 1.1500124166835219e+00
18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00
19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00
20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00
@ -45,23 +45,23 @@ run_pos: ! |2
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
run_vel: ! |2 run_vel: ! |2
1 1.8443993556510503e-03 1.0121779579994334e-03 -1.7361326034903994e-03 1 1.8443993556501194e-03 1.0121779580014880e-03 -1.7361326034900004e-03
2 1.9401022924564379e-03 3.6428754787360968e-04 -2.1069540627800783e-03 2 1.9401022924558353e-03 3.6428754787592717e-04 -2.1069540627804630e-03
3 1.3158623602991188e-03 8.9265747656383358e-04 -9.2144725682236322e-04 3 1.3158623602983117e-03 8.9265747656461518e-04 -9.2144725682164765e-04
4 1.3306255280105470e-03 8.4281508655937773e-04 -9.6194026572644226e-04 4 1.3306255280096098e-03 8.4281508655990065e-04 -9.6194026572564277e-04
5 1.3289682243421974e-03 1.6048237018825233e-03 -7.0511232123213988e-04 5 1.3289682243410694e-03 1.6048237018834058e-03 -7.0511232123071578e-04
6 8.4113718611853719e-04 1.0389683283150482e-04 -4.1697370456886506e-04 6 8.4113718611833759e-04 1.0389683283144291e-04 -4.1697370456874000e-04
7 5.9950574545609200e-04 -6.4437674895145240e-04 -2.7586696717539212e-04 7 5.9950574545626460e-04 -6.4437674895215539e-04 -2.7586696717582770e-04
8 6.4634547270653927e-04 1.4734228826541389e-04 -8.7540766366893413e-05 8 6.4634547270651889e-04 1.4734228826522393e-04 -8.7540766366731677e-05
9 8.5561404484529586e-04 6.5123532540296175e-04 -2.5782947158571319e-04 9 8.5561404484505246e-04 6.5123532540337949e-04 -2.5782947158524541e-04
10 2.4688038968437656e-04 -3.5995975343979376e-04 3.8912416843293868e-04 10 2.4688038968480883e-04 -3.5995975344065598e-04 3.8912416843275036e-04
11 -8.4672359473885383e-05 -8.4134349031467540e-04 7.6463157764253384e-04 11 -8.4672359473207540e-05 -8.4134349031640384e-04 7.6463157764214765e-04
12 5.2321633256236573e-04 -1.1418047427479729e-03 -3.1842516233433678e-04 12 5.2321633256319677e-04 -1.1418047427480885e-03 -3.1842516233562650e-04
13 3.6258187754787622e-04 -1.5531581259492578e-03 -1.9590476903839454e-04 13 3.6258187754908706e-04 -1.5531581259494627e-03 -1.9590476904013686e-04
14 4.2166181631225470e-04 -1.6310415916625015e-03 -3.1740232809197801e-04 14 4.2166181631324295e-04 -1.6310415916630534e-03 -3.1740232809360442e-04
15 9.7471807923322747e-04 -8.9939841791080669e-04 -9.6757308853273301e-04 15 9.7471807923383419e-04 -8.9939841790992849e-04 -9.6757308853409715e-04
16 4.1534888644708355e-06 1.7705740203958010e-05 9.0753010117789151e-04 16 4.1534888649229478e-06 1.7705740202855492e-05 9.0753010117813307e-04
17 2.5969943716028801e-04 8.7075266710323401e-04 7.7887058799549764e-04 17 2.5969943716026037e-04 8.7075266710270329e-04 7.7887058799645153e-04
18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04
19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03
20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:36:59 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/nvt/small fix rigid/nvt/small
@ -12,8 +12,8 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.4827261120559041e+02 -1.8411194247813761e+01 -1.0752762861073667e+02 -2.1814511473385389e+02 1.7027764309482512e+02 2.1058942295369583e+01 -1.4827261116680450e+02 -1.8411194349753366e+01 -1.0752762859308652e+02 -2.1814511477016262e+02 1.7027764307147635e+02 2.1058942244057143e+01
global_scalar: 0.953260955609303 global_scalar: 0.953260955473961
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01
2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01 2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01
@ -32,15 +32,15 @@ run_pos: ! |2
15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00
16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1395635672932589e+00 3.0168023048438113e+00 -3.5136606977881328e+00 18 2.1395635672981443e+00 3.0168023048492310e+00 -3.5136606977867388e+00
19 1.5374727853250358e+00 2.6272080573122807e+00 -4.2442423140709664e+00 19 1.5374727853253387e+00 2.6272080572819609e+00 -4.2442423140467360e+00
20 2.7621434608188427e+00 3.6846842324656390e+00 -3.9366036440732435e+00 20 2.7621434607990372e+00 3.6846842324743214e+00 -3.9366036441030396e+00
21 4.9022821624140818e+00 -4.0760572703872384e+00 -3.6181235131011493e+00 21 4.9022821625125470e+00 -4.0760572704380627e+00 -3.6181235130909242e+00
22 4.3639257460005378e+00 -4.2100277322528781e+00 -4.4607219431898768e+00 22 4.3639257458824501e+00 -4.2100277325126187e+00 -4.4607219430080747e+00
23 5.7383384136101201e+00 -3.5881799321988401e+00 -3.8831848686362500e+00 23 5.7383384133351401e+00 -3.5881799317362106e+00 -3.8831848688588710e+00
24 2.0709922900187094e+00 3.1490053461587988e+00 3.1570777021928111e+00 24 2.0709922902331592e+00 3.1490053461169678e+00 3.1570777020268803e+00
25 1.3046262535950155e+00 3.2688902578411003e+00 2.5076144139609760e+00 25 1.3046262534530633e+00 3.2688902575528282e+00 2.5076144141701078e+00
26 2.5760050692221945e+00 4.0131166908052700e+00 3.2207051908682689e+00 26 2.5760050685080813e+00 4.0131166912605272e+00 3.2207051913215210e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
@ -62,15 +62,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 7.8522439442960720e-04 -6.6826115066907776e-04 1.7528441282148588e-03 18 7.8522439440007548e-04 -6.6826115062653757e-04 1.7528441282153480e-03
19 1.8628941717468176e-03 -3.1840047050999288e-03 2.2062694139862180e-03 19 1.8628941719211860e-03 -3.1840047051916367e-03 2.2062694140207390e-03
20 -1.4430972530733339e-03 9.7564145849438695e-04 1.0686492192934641e-03 20 -1.4430972531298200e-03 9.7564145841628493e-04 1.0686492192569896e-03
21 -3.0047717243369713e-03 -6.6139343733813178e-04 2.4784169375747654e-03 21 -3.0047717246574372e-03 -6.6139343888744952e-04 2.4784169377340712e-03
22 -3.4980341561451885e-03 -3.3380963360956396e-03 3.2191613971836179e-03 22 -3.4980341571643780e-03 -3.3380963325930985e-03 3.2191613979274045e-03
23 5.9333930339444674e-04 -8.6231086246656499e-03 -8.2692040217646409e-04 23 5.9333930569297963e-04 -8.6231086219834985e-03 -8.2692040355627789e-04
24 1.8727912307154753e-03 -2.0349136837723969e-03 1.1951471744036815e-03 24 1.8727912311097637e-03 -2.0349136820274911e-03 1.1951471753018509e-03
25 3.4887365949246578e-03 -4.8232966886339428e-03 -1.2263764476660806e-03 25 3.4887365958745937e-03 -4.8232966889391275e-03 -1.2263764490291341e-03
26 -3.4770257985509852e-03 7.8662050889240958e-04 5.3381090683576344e-03 26 -3.4770258010749858e-03 7.8662050223200905e-04 5.3381090661352281e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:37:00 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid fix rigid
@ -13,26 +13,26 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-1.3754817466835852e+03 -1.4228425246165939e+03 -3.6087196201913630e+03 8.7407043149698166e+02 2.1665316519768876e+02 -6.0480791462031175e+02 -1.3754817466835989e+03 -1.4228425246166139e+03 -3.6087196201914344e+03 8.7407043149698939e+02 2.1665316519769868e+02 -6.0480791462033017e+02
global_scalar: 4.53142303857031 global_scalar: 4.53142303857029
run_pos: ! |2 run_pos: ! |2
1 -2.7899546859693181e-01 2.4731857340428789e+00 -1.7290667720876129e-01 1 -2.7899546859693136e-01 2.4731857340428784e+00 -1.7290667720876285e-01
2 3.0296221616793595e-01 2.9517129917211555e+00 -8.5798904365355089e-01 2 3.0296221616793728e-01 2.9517129917211546e+00 -8.5798904365355155e-01
3 -6.9368802362166315e-01 1.2445115422149753e+00 -6.2281111185285432e-01 3 -6.9368802362166204e-01 1.2445115422149751e+00 -6.2281111185285498e-01
4 -1.5764879646739509e+00 1.4919714416722003e+00 -1.2492069413381559e+00 4 -1.5764879646739487e+00 1.4919714416722010e+00 -1.2492069413381564e+00
5 -8.9434512967954460e-01 9.3651699743538708e-01 4.0191726569957620e-01 5 -8.9434512967954416e-01 9.3651699743538730e-01 4.0191726569957442e-01
6 2.9454439635065854e-01 2.2724545796943085e-01 -1.2845195052894232e+00 6 2.9454439635065910e-01 2.2724545796943096e-01 -1.2845195052894232e+00
7 3.4049112905311674e-01 -9.4655677385591108e-03 -2.4634480019885245e+00 7 3.4049112905311751e-01 -9.4655677385591108e-03 -2.4634480019885228e+00
8 1.1644354555589662e+00 -4.8367776651302741e-01 -6.7663643931660777e-01 8 1.1644354555589662e+00 -4.8367776651302724e-01 -6.7663643931660777e-01
9 1.3781717822376685e+00 -2.5332509534947545e-01 2.6864954447021527e-01 9 1.3781717822376680e+00 -2.5332509534947545e-01 2.6864954447021416e-01
10 2.0186368605645773e+00 -1.4285861423742925e+00 -9.6712491246325638e-01 10 2.0186368605645764e+00 -1.4285861423742918e+00 -9.6712491246325605e-01
11 1.7929137227200924e+00 -1.9875455388074488e+00 -1.8836565351900403e+00 11 1.7929137227200918e+00 -1.9875455388074483e+00 -1.8836565351900385e+00
12 3.0032775230343129e+00 -4.8983022415935262e-01 -1.6190248016126150e+00 12 3.0032775230343125e+00 -4.8983022415935312e-01 -1.6190248016126132e+00
13 4.0448964161972292e+00 -9.0213155125606903e-01 -1.6385398398262687e+00 13 4.0448964161972283e+00 -9.0213155125606947e-01 -1.6385398398262669e+00
14 2.6035151245155346e+00 -4.0874995488538102e-01 -2.6555999073602141e+00 14 2.6035151245155355e+00 -4.0874995488538129e-01 -2.6555999073602123e+00
15 2.9761196776308703e+00 5.6287237451798355e-01 -1.2442626194416762e+00 15 2.9761196776308694e+00 5.6287237451798222e-01 -1.2442626194416753e+00
16 2.6517373020764223e+00 -2.3957035509096416e+00 3.3389262134315478e-02 16 2.6517373020764219e+00 -2.3957035509096407e+00 3.3389262134315700e-02
17 2.2311114923824862e+00 -2.1018393229879826e+00 1.1496088522768946e+00 17 2.2311114923824857e+00 -2.1018393229879817e+00 1.1496088522768926e+00
18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00
19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00
20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00
@ -46,23 +46,23 @@ run_pos: ! |2
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
run_vel: ! |2 run_vel: ! |2
1 4.7093296226165759e-04 2.6351124312057328e-04 -4.4905063547614815e-04 1 4.7093296226165726e-04 2.6351124312057247e-04 -4.4905063547614652e-04
2 4.9594635271877263e-04 9.4561409237138648e-05 -5.4581325723053584e-04 2 4.9594635271877252e-04 9.4561409237138173e-05 -5.4581325723053399e-04
3 3.3306088119083106e-04 2.3224949911015489e-04 -2.3659435306900921e-04 3 3.3306088119083085e-04 2.3224949911015443e-04 -2.3659435306900835e-04
4 3.3692332940286711e-04 2.1926824120529708e-04 -2.4716611858556546e-04 4 3.3692332940286711e-04 2.1926824120529689e-04 -2.4716611858556487e-04
5 3.3642541894624088e-04 4.1797578053943778e-04 -1.8011323945929135e-04 5 3.3642541894624033e-04 4.1797578053943675e-04 -1.8011323945929070e-04
6 2.0926870695908297e-04 2.6449376032441632e-05 -1.0508922741401441e-04 6 2.0926870695908275e-04 2.6449376032441517e-05 -1.0508922741401380e-04
7 1.4629046128362895e-04 -1.6873362379723160e-04 -6.8353900724071678e-05 7 1.4629046128362901e-04 -1.6873362379723092e-04 -6.8353900724071163e-05
8 1.5844098346817962e-04 3.7728756087619151e-05 -1.9162577392849499e-05 8 1.5844098346817922e-04 3.7728756087618725e-05 -1.9162577392849018e-05
9 2.1299357198253027e-04 1.6917133003966806e-04 -6.3528006071200595e-05 9 2.1299357198252964e-04 1.6917133003966706e-04 -6.3528006071199931e-05
10 5.4261569071246100e-05 -9.4655546204698788e-05 1.0511372702289762e-04 10 5.4261569071245721e-05 -9.4655546204699004e-05 1.0511372702289778e-04
11 -3.2194218121523160e-05 -2.2025090185602363e-04 2.0300208519292848e-04 11 -3.2194218121523377e-05 -2.2025090185602322e-04 2.0300208519292837e-04
12 1.2640585449263567e-04 -2.9851081600946788e-04 -7.9476186245575856e-05 12 1.2640585449263546e-04 -2.9851081600946783e-04 -7.9476186245574907e-05
13 8.4523551795102534e-05 -4.0583140303608248e-04 -4.7550925831931509e-05 13 8.4523551795102276e-05 -4.0583140303608237e-04 -4.7550925831930506e-05
14 9.9954071734163638e-05 -4.2610809338913916e-04 -7.9255453072662124e-05 14 9.9954071734163652e-05 -4.2610809338913862e-04 -7.9255453072661283e-05
15 2.4417483202630001e-04 -2.3521005781669064e-04 -2.4875292755152092e-04 15 2.4417483202629974e-04 -2.3521005781669077e-04 -2.4875292755151935e-04
16 -9.0959360838833471e-06 3.7773746063198897e-06 2.4035204669042528e-04 16 -9.0959360838839976e-06 3.7773746063190714e-06 2.4035204669042517e-04
17 5.7507084250808007e-05 2.2629200960629450e-04 2.0686926033794596e-04 17 5.7507084250807059e-05 2.2629200960629290e-04 2.0686926033794590e-04
18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04
19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03
20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03

View File

@ -1,7 +1,7 @@
--- ---
lammps_version: 24 Aug 2020 lammps_version: 24 Aug 2020
date_generated: Tue Sep 15 09:44:42 202 date_generated: Tue Sep 15 22:37:00 202
epsilon: 2.5e-13 epsilon: 5e-13
prerequisites: ! | prerequisites: ! |
atom full atom full
fix rigid/small fix rigid/small
@ -13,7 +13,7 @@ post_commands: ! |
input_file: in.fourmol input_file: in.fourmol
natoms: 29 natoms: 29
run_stress: ! |- run_stress: ! |-
-4.9200116134790363e+01 -2.6907707565987732e+01 -6.0080860422282560e+00 -2.5620423972101747e+01 -1.3450224059984075e+01 -1.4947288487004844e+00 -4.9200116134789894e+01 -2.6907707565987600e+01 -6.0080860422279923e+00 -2.5620423972101459e+01 -1.3450224059984031e+01 -1.4947288487004347e+00
global_scalar: 18.3405601674144 global_scalar: 18.3405601674144
run_pos: ! |2 run_pos: ! |2
1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01
@ -33,15 +33,15 @@ run_pos: ! |2
15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00
16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02
17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00
18 2.1392027588271301e+00 3.0171068018412783e+00 -3.5144628518856349e+00 18 2.1392027588271301e+00 3.0171068018412779e+00 -3.5144628518856349e+00
19 1.5366124997074573e+00 2.6286809834111744e+00 -4.2452547844370221e+00 19 1.5366124997074571e+00 2.6286809834111748e+00 -4.2452547844370221e+00
20 2.7628161763455852e+00 3.6842251687634779e+00 -3.9370881219352558e+00 20 2.7628161763455852e+00 3.6842251687634775e+00 -3.9370881219352554e+00
21 4.9036621347791245e+00 -4.0757648442838548e+00 -3.6192617654515908e+00 21 4.9036621347791245e+00 -4.0757648442838548e+00 -3.6192617654515904e+00
22 4.3655322291888483e+00 -4.2084949965552561e+00 -4.4622011117402334e+00 22 4.3655322291888483e+00 -4.2084949965552561e+00 -4.4622011117402334e+00
23 5.7380414793463101e+00 -3.5841969195032672e+00 -3.8827839830470219e+00 23 5.7380414793463101e+00 -3.5841969195032672e+00 -3.8827839830470219e+00
24 2.0701314765323930e+00 3.1499370533342330e+00 3.1565324852522938e+00 24 2.0701314765323930e+00 3.1499370533342330e+00 3.1565324852522938e+00
25 1.3030170721374783e+00 3.2711173927682244e+00 2.5081940917429759e+00 25 1.3030170721374779e+00 3.2711173927682249e+00 2.5081940917429768e+00
26 2.5776230782480041e+00 4.0127347068243884e+00 3.2182355138709284e+00 26 2.5776230782480045e+00 4.0127347068243875e+00 3.2182355138709275e+00
27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00
28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00
29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00
@ -63,15 +63,15 @@ run_vel: ! |2
15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03
16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03
17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04
18 3.6149625095704870e-04 -3.1032459262908302e-04 8.1043030117346052e-04 18 3.6149625095704908e-04 -3.1032459262908286e-04 8.1043030117346042e-04
19 8.5103884665345441e-04 -1.4572280596788099e-03 1.0163621287634116e-03 19 8.5103884665345452e-04 -1.4572280596788108e-03 1.0163621287634116e-03
20 -6.5204659278590758e-04 4.3989037444289831e-04 4.9909839028507966e-04 20 -6.5204659278590683e-04 4.3989037444289853e-04 4.9909839028507890e-04
21 -1.3888125881903919e-03 -3.1978049143082570e-04 1.1455681499836646e-03 21 -1.3888125881903923e-03 -3.1978049143082407e-04 1.1455681499836646e-03
22 -1.6084223477729497e-03 -1.5355394240821158e-03 1.4772010826232373e-03 22 -1.6084223477729508e-03 -1.5355394240821113e-03 1.4772010826232373e-03
23 2.6392672378804886e-04 -3.9375414431174760e-03 -3.6991583139728127e-04 23 2.6392672378805081e-04 -3.9375414431174812e-03 -3.6991583139728051e-04
24 8.6062827067890290e-04 -9.4179873474469259e-04 5.5396395550012367e-04 24 8.6062827067890236e-04 -9.4179873474469237e-04 5.5396395550012442e-04
25 1.5933645477487557e-03 -2.2139156625681682e-03 -5.5078029695647412e-04 25 1.5933645477487542e-03 -2.2139156625681699e-03 -5.5078029695647488e-04
26 -1.5679561743998888e-03 3.5146224354725948e-04 2.4446924193334482e-03 26 -1.5679561743998840e-03 3.5146224354726122e-04 2.4446924193334474e-03
27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04
28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03
29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03

View File

@ -62,6 +62,7 @@ if (PKG_COMPRESS)
set_tests_properties(DumpLocalGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") set_tests_properties(DumpLocalGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}")
set_tests_properties(DumpLocalGZ PROPERTIES ENVIRONMENT "GZIP_BINARY=${GZIP_BINARY}") set_tests_properties(DumpLocalGZ PROPERTIES ENVIRONMENT "GZIP_BINARY=${GZIP_BINARY}")
if(Zstd_FOUND)
find_program(ZSTD_BINARY NAMES zstd) find_program(ZSTD_BINARY NAMES zstd)
if (ZSTD_BINARY) if (ZSTD_BINARY)
@ -95,6 +96,7 @@ if (PKG_COMPRESS)
set_tests_properties(DumpLocalZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") set_tests_properties(DumpLocalZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}")
set_tests_properties(DumpLocalZstd PROPERTIES ENVIRONMENT "ZSTD_BINARY=${ZSTD_BINARY}") set_tests_properties(DumpLocalZstd PROPERTIES ENVIRONMENT "ZSTD_BINARY=${ZSTD_BINARY}")
endif() endif()
endif()
endif() endif()
add_executable(test_dump_custom test_dump_custom.cpp) add_executable(test_dump_custom test_dump_custom.cpp)

File diff suppressed because it is too large Load Diff

View File

@ -14,3 +14,7 @@ set_tests_properties(Utils PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_PO
add_executable(test_fmtlib test_fmtlib.cpp) add_executable(test_fmtlib test_fmtlib.cpp)
target_link_libraries(test_fmtlib PRIVATE lammps GTest::GMockMain GTest::GMock GTest::GTest) target_link_libraries(test_fmtlib PRIVATE lammps GTest::GMockMain GTest::GMock GTest::GTest)
add_test(FmtLib test_fmtlib) add_test(FmtLib test_fmtlib)
add_executable(test_math_eigen_impl test_math_eigen_impl.cpp)
target_include_directories(test_math_eigen_impl PRIVATE ${LAMMPS_SOURCE_DIR})
add_test(MathEigen test_math_eigen_impl 10 5)

View File

@ -0,0 +1,766 @@
// THIS FILE USED TO BE EASY TO READ until I added "#if defined" statements.
// (They were added to test for many different kinds of array formats.)
#include <iostream>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <chrono>
#include <random>
#include <algorithm>
#include <vector>
#include <array>
#include "math_eigen_impl.h"
using std::cout;
using std::cerr;
using std::endl;
using std::setprecision;
using std::vector;
using std::array;
using namespace MathEigen;
// This code works with various types of C++ matrices (for example,
// double **, vector<vector<double>> array<array<double,5>,5>).
// I use "#if defined" statements to test different matrix types.
// For some of these (eg. array<array<double,5>,5>), the size of the matrix
// must be known at compile time. I specify that size now.
#if defined USE_ARRAY_OF_ARRAYS
const int NF=5; //(the array size must be known at compile time)
#elif defined USE_C_FIXED_SIZE_ARRAYS
const int NF=5; //(the array size must be known at compile time)
#endif
// @brief Are two numbers "similar"?
template<typename Scalar>
inline static bool Similar(Scalar a, Scalar b,
Scalar eps=1.0e-06,
Scalar ratio=1.0e-06,
Scalar ratio_denom=1.0)
{
return ((std::abs(a-b)<=std::abs(eps))
||
(std::abs(ratio_denom)*std::abs(a-b)
<=
std::abs(ratio)*0.5*(std::abs(a)+std::abs(b))));
}
/// @brief Are two vectors (containing n numbers) similar?
template<typename Scalar, typename Vector>
inline static bool SimilarVec(Vector a, Vector b, int n,
Scalar eps=1.0e-06,
Scalar ratio=1.0e-06,
Scalar ratio_denom=1.0)
{
for (int i = 0; i < n; i++)
if (not Similar(a[i], b[i], eps, ratio, ratio_denom))
return false;
return true;
}
/// @brief Are two vectors (or their reflections) similar?
template<typename Scalar, typename Vector>
inline static bool SimilarVecUnsigned(Vector a, Vector b, int n,
Scalar eps=1.0e-06,
Scalar ratio=1.0e-06,
Scalar ratio_denom=1.0)
{
if (SimilarVec(a, b, n, eps))
return true;
else {
for (int i = 0; i < n; i++)
if (not Similar(a[i], -b[i], eps, ratio, ratio_denom))
return false;
return true;
}
}
/// @brief Multiply two matrices A and B, store the result in C. (C = AB).
template<typename Matrix, typename ConstMatrix>
void mmult(ConstMatrix A, //<! input array
ConstMatrix B, //<! input array
Matrix C, //<! store result here
int m, //<! number of rows of A
int n=0, //<! optional: number of columns of B (=m by default)
int K=0 //<! optional: number of columns of A = num rows of B (=m by default)
)
{
if (n == 0) n = m; // if not specified, then assume the matrices are square
if (K == 0) K = m; // if not specified, then assume the matrices are square
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
C[i][j] = 0.0;
// perform matrix multiplication
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
for (int k = 0; k < K; k++)
C[i][j] += A[i][k] * B[k][j];
}
/// @brief
///Sort the rows of a matrix "evec" by the numbers contained in "eval"
///(This is a simple O(n^2) sorting method, but O(n^2) is a lower bound anyway.)
///This is the same as the Jacobi::SortRows(), but that function is private.
template<typename Scalar, typename Vector, typename Matrix>
void
SortRows(Vector eval,
Matrix evec,
int n,
bool sort_decreasing=true,
bool sort_abs=false)
{
for (int i = 0; i < n-1; i++) {
int i_max = i;
for (int j = i+1; j < n; j++) {
if (sort_decreasing) {
if (sort_abs) { //sort by absolute value?
if (std::abs(eval[j]) > std::abs(eval[i_max]))
i_max = j;
}
else if (eval[j] > eval[i_max])
i_max = j;
}
else {
if (sort_abs) { //sort by absolute value?
if (std::abs(eval[j]) < std::abs(eval[i_max]))
i_max = j;
}
else if (eval[j] < eval[i_max])
i_max = j;
}
}
std::swap(eval[i], eval[i_max]); // sort "eval"
for (int k = 0; k < n; k++)
std::swap(evec[i][k], evec[i_max][k]); // sort "evec"
}
}
/// @brief Generate a random orthonormal n x n matrix
template<typename Scalar, typename Matrix>
void GenRandOrth(Matrix R,
int n,
std::default_random_engine &rand_generator)
{
std::normal_distribution<Scalar> gaussian_distribution(0,1);
std::vector<Scalar> v(n);
for (int i = 0; i < n; i++) {
// Generate a vector, "v", in a random direction subject to the constraint
// that it is orthogonal to the first i-1 rows-vectors of the R matrix.
Scalar rsq = 0.0;
while (rsq == 0.0) {
// Generate a vector in a random direction
// (This works because we are using a normal (Gaussian) distribution)
for (int j = 0; j < n; j++)
v[j] = gaussian_distribution(rand_generator);
//Now subtract from v, the projection of v onto the first i-1 rows of R.
//This will produce a vector which is orthogonal to these i-1 row-vectors.
//(They are already normalized and orthogonal to each other.)
for (int k = 0; k < i; k++) {
Scalar v_dot_Rk = 0.0;
for (int j = 0; j < n; j++)
v_dot_Rk += v[j] * R[k][j];
for (int j = 0; j < n; j++)
v[j] -= v_dot_Rk * R[k][j];
}
// check if it is linearly independent of the other vectors and non-zero
rsq = 0.0;
for (int j = 0; j < n; j++)
rsq += v[j]*v[j];
}
// Now normalize the vector
Scalar r_inv = 1.0 / std::sqrt(rsq);
for (int j = 0; j < n; j++)
v[j] *= r_inv;
// Now copy this vector to the i'th row of R
for (int j = 0; j < n; j++)
R[i][j] = v[j];
} //for (int i = 0; i < n; i++)
} //void GenRandOrth()
/// @brief Generate a random symmetric n x n matrix, M.
/// This function generates random numbers for the eigenvalues ("evals_known")
/// as well as the eigenvectors ("evecs_known"), and uses them to generate M.
/// The "eval_magnitude_range" argument specifies the the base-10 logarithm
/// of the range of eigenvalues desired. The "n_degeneracy" argument specifies
/// the number of repeated eigenvalues desired (if any).
/// @returns This function does not return a value. However after it is
/// invoked, the M matrix will be filled with random numbers.
/// Additionally, the "evals" and "evecs" arguments will contain
/// the eigenvalues and eigenvectors (one eigenvector per row)
/// of the matrix. Later, they can be compared with the eigenvalues
/// and eigenvectors calculated by Jacobi::Diagonalize()
template <typename Scalar, typename Vector, typename Matrix>
void GenRandSymm(Matrix M, //<! store the matrix here
int n, //<! matrix size
Vector evals, //<! store the eigenvalues of here
Matrix evecs, //<! store the eigenvectors here
std::default_random_engine &rand_generator,//<! makes random numbers
Scalar min_eval_size=0.1, //<! minimum possible eigenvalue size
Scalar max_eval_size=10.0,//<! maximum possible eigenvalue size
int n_degeneracy=1//<!number of repeated eigevalues(1disables)
)
{
assert(n_degeneracy <= n);
std::uniform_real_distribution<Scalar> random_real01;
std::normal_distribution<Scalar> gaussian_distribution(0, max_eval_size);
bool use_log_uniform_distribution = false;
if (min_eval_size > 0.0)
use_log_uniform_distribution = true;
#if defined USE_VECTOR_OF_VECTORS
vector<vector<Scalar> > D(n, vector<Scalar>(n));
vector<vector<Scalar> > tmp(n, vector<Scalar>(n));
#elif defined USE_ARRAY_OF_ARRAYS
array<array<Scalar, NF>, NF> D;
array<array<Scalar, NF>, NF> tmp;
#elif defined USE_C_FIXED_SIZE_ARRAYS
Scalar D[NF][NF], tmp[NF][NF];
#else
#define USE_C_POINTER_TO_POINTERS
Scalar **D, **tmp;
Alloc2D(n, n, &D);
Alloc2D(n, n, &tmp);
#endif
// Randomly generate the eigenvalues
for (int i = 0; i < n; i++) {
if (use_log_uniform_distribution) {
// Use a "log-uniform distribution" (a.k.a. "reciprocal distribution")
// (This is a way to specify numbers with a precise range of magnitudes.)
assert((min_eval_size > 0.0) && (max_eval_size > 0.0));
Scalar log_min = std::log(std::abs(min_eval_size));
Scalar log_max = std::log(std::abs(max_eval_size));
Scalar log_eval = (log_min + random_real01(rand_generator)*(log_max-log_min));
evals[i] = std::exp(log_eval);
// also consider both positive and negative eigenvalues:
if (random_real01(rand_generator) < 0.5)
evals[i] = -evals[i];
}
else {
evals[i] = gaussian_distribution(rand_generator);
}
}
// Does the user want us to force some of the eigenvalues to be the same?
if (n_degeneracy > 1) {
int *permutation = new int[n]; //a random permutation from 0...n-1
for (int i = 0; i < n; i++)
permutation[i] = i;
std::shuffle(permutation, permutation+n, rand_generator);
for (int i = 1; i < n_degeneracy; i++) //set the first n_degeneracy to same
evals[permutation[i]] = evals[permutation[0]];
delete [] permutation;
}
// D is a diagonal matrix whose diagonal elements are the eigenvalues
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
D[i][j] = ((i == j) ? evals[i] : 0.0);
// Now randomly generate the (transpose of) the "evecs" matrix
GenRandOrth<Scalar, Matrix>(evecs, n, rand_generator); //(will transpose it later)
// Construct the test matrix, M, where M = Rt * D * R
// Original code:
//mmult(evecs, D, tmp, n); // <--> tmp = Rt * D
// Unfortunately, C++ guesses the types incorrectly. Must manually specify:
// #ifdefs making the code ugly again:
#if defined USE_VECTOR_OF_VECTORS
mmult<vector<vector<Scalar> >&, const vector<vector<Scalar> >&>
#elif defined USE_ARRAY_OF_ARRAYS
mmult<array<array<Scalar,NF>,NF>&, const array<array<Scalar,NF>,NF>&>
#elif defined USE_C_FIXED_SIZE_ARRAYS
mmult<Scalar (*)[NF], Scalar (*)[NF]>
#else
mmult<Scalar**, Scalar const *const *>
#endif
(evecs, D, tmp, n);
for (int i = 0; i < n-1; i++)
for (int j = i+1; j < n; j++)
std::swap(evecs[i][j], evecs[j][i]); //transpose "evecs"
// Original code:
//mmult(tmp, evecs, M, n);
// Unfortunately, C++ guesses the types incorrectly. Must manually specify:
// #ifdefs making the code ugly again:
#if defined USE_VECTOR_OF_VECTORS
mmult<vector<vector<Scalar> >&, const vector<vector<Scalar> >&>
#elif defined USE_ARRAY_OF_ARRAYS
mmult<array<array<Scalar,NF>,NF>&, const array<array<Scalar,NF>,NF>&>
#elif defined USE_C_FIXED_SIZE_ARRAYS
mmult<Scalar (*)[NF], Scalar (*)[NF]>
#else
mmult<Scalar**, Scalar const *const *>
#endif
(tmp, evecs, M, n);
//at this point M = Rt*D*R (where "R"="evecs")
#if defined USE_C_POINTER_TO_POINTERS
Dealloc2D(&D);
Dealloc2D(&tmp);
#endif
} // GenRandSymm()
template <typename Scalar>
void TestJacobi(int n, //<! matrix size
int n_matrices=100, //<! number of matrices to test
Scalar min_eval_size=0.1, //<! minimum possible eigenvalue sizw
Scalar max_eval_size=10.0, //<! maximum possible eigenvalue size
int n_tests_per_matrix=1, //<! repeat test for benchmarking?
int n_degeneracy=1, //<! repeated eigenvalues?
unsigned seed=0, //<! random seed (if 0 then use the clock)
Scalar eps=1.0e-06
)
{
bool test_code_coverage = false;
if (n_tests_per_matrix < 1) {
cout << "-- Testing code-coverage --" << endl;
test_code_coverage = true;
n_tests_per_matrix = 1;
}
cout << endl << "-- Diagonalization test (real symmetric) --" << endl;
// construct a random generator engine using a time-based seed:
if (seed == 0) // if the caller did not specify a seed, use the system clock
seed = std::chrono::system_clock::now().time_since_epoch().count();
std::default_random_engine rand_generator(seed);
// Create an instance of the Jacobi diagonalizer, and allocate the matrix
// we will test it on, as well as the arrays that will store the resulting
// eigenvalues and eigenvectors.
// The way we do this depends on what version of the code we are using.
// This is controlled by "#if defined" statements.
#if defined USE_VECTOR_OF_VECTORS
Jacobi<Scalar,
vector<Scalar>&,
vector<vector<Scalar> >&,
const vector<vector<Scalar> >& > ecalc(n);
// allocate the matrix, eigenvalues, eigenvectors
vector<vector<Scalar> > M(n, vector<Scalar>(n));
vector<vector<Scalar> > evecs(n, vector<Scalar>(n));
vector<vector<Scalar> > evecs_known(n, vector<Scalar>(n));
vector<Scalar> evals(n);
vector<Scalar> evals_known(n);
vector<Scalar> test_evec(n);
#elif defined USE_ARRAY_OF_ARRAYS
n = NF;
cout << "Testing std::array (fixed size).\n"
"(Ignoring first argument, and setting matrix size to " << n << ")" << endl;
Jacobi<Scalar,
array<Scalar, NF>&,
array<array<Scalar, NF>, NF>&,
const array<array<Scalar, NF>, NF>&> ecalc(n);
// allocate the matrix, eigenvalues, eigenvectors
array<array<Scalar, NF>, NF> M;
array<array<Scalar, NF>, NF> evecs;
array<array<Scalar, NF>, NF> evecs_known;
array<Scalar, NF> evals;
array<Scalar, NF> evals_known;
array<Scalar, NF> test_evec;
#elif defined USE_C_FIXED_SIZE_ARRAYS
n = NF;
cout << "Testing C fixed size arrays.\n"
"(Ignoring first argument, and setting matrix size to " << n << ")" << endl;
Jacobi<Scalar,
Scalar*,
Scalar (*)[NF],
Scalar const (*)[NF]> ecalc(n);
// allocate the matrix, eigenvalues, eigenvectors
Scalar M[NF][NF];
Scalar evecs[NF][NF];
Scalar evecs_known[NF][NF];
Scalar evals[NF];
Scalar evals_known[NF];
Scalar test_evec[NF];
#else
#define USE_C_POINTER_TO_POINTERS
// Note: Normally, you would just use this to instantiate Jacobi:
// Jacobi<Scalar, Scalar*, Scalar**, Scalar const*const*> ecalc(n);
// -------------------------
// ..but since Jacobi manages its own memory using new and delete, I also want
// to test that the copy constructors, copy operators, and destructors work.
// The following lines do this:
Jacobi<Scalar, Scalar*, Scalar**, Scalar const*const*> ecalc_test_mem1(n);
Jacobi<Scalar, Scalar*, Scalar**, Scalar const*const*> ecalc_test_mem2(2);
// test the = operator
ecalc_test_mem2 = ecalc_test_mem1;
// test the copy constructor
Jacobi<Scalar, Scalar*, Scalar**, Scalar const*const*> ecalc(ecalc_test_mem2);
// allocate the matrix, eigenvalues, eigenvectors
Scalar **M, **evecs, **evecs_known;
Alloc2D(n, n, &M);
Alloc2D(n, n, &evecs);
Alloc2D(n, n, &evecs_known);
Scalar *evals = new Scalar[n];
Scalar *evals_known = new Scalar[n];
Scalar *test_evec = new Scalar[n];
#endif
// --------------------------------------------------------------------
// Now, generate random matrices and test Jacobi::Diagonalize() on them.
// --------------------------------------------------------------------
for(int imat = 0; imat < n_matrices; imat++) {
// Create a randomly generated symmetric matrix.
//This function generates random numbers for the eigenvalues ("evals_known")
//as well as the eigenvectors ("evecs_known"), and uses them to generate M.
#if defined USE_VECTOR_OF_VECTORS
GenRandSymm<Scalar, vector<Scalar>&, vector<vector<Scalar> >&>
#elif defined USE_ARRAY_OF_ARRAYS
GenRandSymm<Scalar, array<Scalar,NF>&, array<array<Scalar,NF>,NF>&>
#elif defined USE_C_FIXED_SIZE_ARRAYS
GenRandSymm<Scalar, Scalar*, Scalar (*)[NF]>
#else
GenRandSymm<Scalar, Scalar*, Scalar**>
#endif
(M,
n,
evals_known,
evecs_known,
rand_generator,
min_eval_size,
max_eval_size,
n_degeneracy);
// Sort the matrix evals and eigenvector rows:
// Original code:
//SortRows<Scalar>(evals_known, evecs_known, n);
// Unfortunately, C++ guesses the types incorrectly. Must use #ifdefs again:
#if defined USE_VECTOR_OF_VECTORS
SortRows<Scalar, vector<Scalar>&, vector<vector<Scalar> >&>
#elif defined USE_ARRAY_OF_ARRAYS
SortRows<Scalar, array<Scalar,NF>&, array<array<Scalar,NF>,NF>&>
#elif defined USE_C_FIXED_SIZE_ARRAYS
SortRows<Scalar, Scalar*, Scalar (*)[NF]>
#else
SortRows<Scalar, Scalar*, Scalar**>
#endif
(evals_known, evecs_known, n);
if (n_matrices == 1) {
cout << "Eigenvalues (after sorting):\n";
for (int i = 0; i < n; i++)
cout << evals_known[i] << " ";
cout << "\n";
cout << "Eigenvectors (rows) which are known in advance:\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
cout << evecs_known[i][j] << " ";
cout << "\n";
}
cout << " (The eigenvectors calculated by Jacobi::Diagonalize() should match these.)\n";
}
for (int i_test = 0; i_test < n_tests_per_matrix; i_test++) {
if (test_code_coverage) {
// test SORT_INCREASING_ABS_EVALS:
#if defined USE_VECTOR_OF_VECTORS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
vector<Scalar>&,
vector<vector<Scalar> >&,
const vector<vector<Scalar> >& >::SORT_INCREASING_ABS_EVALS);
#elif defined USE_ARRAY_OF_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
array<Scalar,NF>&,
array<array<Scalar,NF>,NF>&,
const array<array<Scalar,NF>,NF>&>::SORT_INCREASING_ABS_EVALS);
#elif defined USE_C_FIXED_SIZE_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar (*)[NF],
Scalar const (*)[NF]>::SORT_INCREASING_ABS_EVALS);
#else
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar**,
Scalar const*const*>::SORT_INCREASING_ABS_EVALS);
#endif
for (int i = 1; i < n; i++)
assert(std::abs(evals[i-1])<=std::abs(evals[i]));
// test SORT_DECREASING_ABS_EVALS:
#if defined USE_VECTOR_OF_VECTORS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
vector<Scalar>&,
vector<vector<Scalar> >&,
const vector<vector<Scalar> >& >::SORT_DECREASING_ABS_EVALS);
#elif defined USE_ARRAY_OF_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
array<Scalar,NF>&,
array<array<Scalar,NF>,NF>&,
const array<array<Scalar,NF>,NF>&>::SORT_DECREASING_ABS_EVALS);
#elif defined USE_C_FIXED_SIZE_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar (*)[NF],
Scalar const (*)[NF]>::SORT_DECREASING_ABS_EVALS);
#else
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar**,
Scalar const*const*>::SORT_DECREASING_ABS_EVALS);
#endif
for (int i = 1; i < n; i++)
assert(std::abs(evals[i-1])>=std::abs(evals[i]));
// test SORT_INCREASING_EVALS:
#if defined USE_VECTOR_OF_VECTORS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
vector<Scalar>&,
vector<vector<Scalar> >&,
const vector<vector<Scalar> >& >::SORT_INCREASING_EVALS);
#elif defined USE_ARRAY_OF_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
array<Scalar,NF>&,
array<array<Scalar,NF>,NF>&,
const array<array<Scalar,NF>,NF>&>::SORT_INCREASING_EVALS);
#elif defined USE_C_FIXED_SIZE_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar (*)[NF],
Scalar const (*)[NF]>::SORT_INCREASING_EVALS);
#else
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar**,
Scalar const*const*>::SORT_INCREASING_EVALS);
#endif
for (int i = 1; i < n; i++)
assert(evals[i-1] <= evals[i]);
// test DO_NOT_SORT
#if defined USE_VECTOR_OF_VECTORS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
vector<Scalar>&,
vector<vector<Scalar> >&,
const vector<vector<Scalar> >& >::DO_NOT_SORT);
#elif defined USE_ARRAY_OF_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
array<Scalar,NF>&,
array<array<Scalar,NF>,NF>&,
const array<array<Scalar,NF>,NF>&>::DO_NOT_SORT);
#elif defined USE_C_FIXED_SIZE_ARRAYS
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar (*)[NF],
Scalar const (*)[NF]>::DO_NOT_SORT);
#else
ecalc.Diagonalize(M,
evals,
evecs,
Jacobi<Scalar,
Scalar*,
Scalar**,
Scalar const*const*>::DO_NOT_SORT);
#endif
} //if (test_code_coverage)
// Now (finally) calculate the eigenvalues and eigenvectors
int n_sweeps = ecalc.Diagonalize(M, evals, evecs);
if ((n_matrices == 1) && (i_test == 0)) {
cout <<"Jacobi::Diagonalize() ran for "<<n_sweeps<<" iters (sweeps).\n";
cout << "Eigenvalues calculated by Jacobi::Diagonalize()\n";
for (int i = 0; i < n; i++)
cout << evals[i] << " ";
cout << "\n";
cout << "Eigenvectors (rows) calculated by Jacobi::Diagonalize()\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
cout << evecs[i][j] << " ";
cout << "\n";
}
}
assert(SimilarVec(evals, evals_known, n, eps*max_eval_size, eps));
//Check that each eigenvector satisfies Mv = λv
// <--> Σ_b M[a][b]*evecs[i][b] = evals[i]*evecs[i][b] (for all a)
for (int i = 0; i < n; i++) {
for (int a = 0; a < n; a++) {
test_evec[a] = 0.0;
for (int b = 0; b < n; b++)
test_evec[a] += M[a][b] * evecs[i][b];
assert(Similar(test_evec[a],
evals[i] * evecs[i][a],
eps, // tolerance (absolute difference)
eps*max_eval_size, // tolerance ratio (numerator)
evals_known[i] // tolerance ration (denominator)
));
}
}
} //for (int i_test = 0; i_test < n_tests_per_matrix; i++)
} //for(int imat = 0; imat < n_matrices; imat++) {
#if defined USE_C_POINTER_TO_POINTERS
Dealloc2D(&M);
Dealloc2D(&evecs);
Dealloc2D(&evecs_known);
delete [] evals;
delete [] evals_known;
delete [] test_evec;
#endif
} //TestJacobi()
int main(int argc, char **argv) {
int n_size = 2;
int n_matr = 1;
double emin = 0.0;
double emax = 1.0;
int n_tests = 1;
int n_degeneracy = 1;
unsigned seed = 0;
if (argc <= 1) {
cerr <<
"Error: This program requires at least 1 argument.\n"
"\n"
"Description: Run Jacobi::Diagonalize() on randomly generated matrices.\n"
"\n"
"Arguments: n_size [n_matr emin emax n_degeneracy n_tests seed eps]\n"
" n_size = the size of the matrices\n"
" (NOTE: The remaining arguments are optional.)\n"
" n_matr = the number of randomly generated matrices to test\n"
" emin = the smallest possible eigenvalue magnitude (eg. 1e-05)\n"
" emax = the largest possible eigenvalue magnitude (>0 eg. 1e+05)\n"
" (NOTE: If emin=0, a normal distribution is used centered at 0.\n"
" Otherwise a log-uniform distribution is used from emin to emax.)\n"
" n_degeneracy = the number of repeated eigenvalues (1 disables, default)\n"
" n_tests = the number of times the eigenvalues and eigenvectors\n"
" are calculated for EACH matrix. By default this is 1.\n"
" (Increase this to at least 20 if you plan to use this\n"
" program for benchmarking (speed testing), because the time\n"
" needed for generating a random matrix is not negligible.)\n"
" (IF THIS NUMBER IS 0, it will test CODE-COVERAGE instead.)\n"
" seed = the seed used by the random number \"rand_generator\".\n"
" (If this number is 0, which is the default, the system\n"
" clock is used to choose a random seed.)\n"
" eps = the tolerance. The difference between eigenvalues and their\n"
" true value, cannot exceed this (multiplied by the eigenvalue\n"
" of maximum magnitude). Similarly, the difference between\n"
" the eigenvectors after multiplication by the matrix and by\n"
" and after multiplication by the eigenvalue, cannot exceed\n"
" eps*maximum_eigenvalue/eigenvalue. The default value is\n"
" 1.0e-06 (which works well for double precision numbers).\n"
<< endl;
return 1;
}
n_size = std::stoi(argv[1]);
if (argc > 2)
n_matr = std::stoi(argv[2]);
if (argc > 3)
emin = std::stof(argv[3]);
if (argc > 4)
emax = std::stof(argv[4]);
if (argc > 5)
n_degeneracy = std::stoi(argv[5]);
if (argc > 6)
n_tests = std::stoi(argv[6]);
if (argc > 7)
seed = std::stoi(argv[7]);
double eps = 1.0e-06;
if (argc > 8)
eps = std::stof(argv[8]);
TestJacobi(n_size, n_matr, emin, emax, n_tests, n_degeneracy, seed, eps);
cout << "test passed\n" << endl;
return EXIT_SUCCESS;
}