Merge pull request #3117 from akohlmey/collected-small-changes
Collected small changes
This commit is contained in:
6
.github/workflows/compile-msvc.yml
vendored
6
.github/workflows/compile-msvc.yml
vendored
@ -17,9 +17,15 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Select Python version
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install numpy
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-D PKG_PYTHON=on \
|
||||
-S cmake -B build \
|
||||
|
||||
@ -119,8 +119,8 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag)
|
||||
double rb_cs[3],rb_cst[3];
|
||||
|
||||
// Cartesian unit vectors in lab frame
|
||||
double ax[3],ay[3],az[3];
|
||||
double bx[3],by[3],bz[3];
|
||||
double ax[3],az[3];
|
||||
double bx[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
||||
@ -130,7 +130,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag)
|
||||
double rb_cs[3],rb_cst[3];
|
||||
// Cartesian unit vectors in lab frame
|
||||
double ax[3],ay[3],az[3];
|
||||
double bx[3],by[3],bz[3];
|
||||
double bx[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
||||
@ -143,7 +143,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag)
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
|
||||
int n,a,b,in,ia,ib,anum,bnum,atype,btype;
|
||||
int a,b,in,ia,ib,anum,bnum,atype,btype;
|
||||
|
||||
evdwl = 0.0;
|
||||
ev_init(eflag,vflag);
|
||||
|
||||
@ -149,8 +149,8 @@ void PairOxdnaHbond::compute(int eflag, int vflag)
|
||||
// vectors COM-h-bonding site in lab frame
|
||||
double ra_chb[3],rb_chb[3];
|
||||
// Cartesian unit vectors in lab frame
|
||||
double ax[3],ay[3],az[3];
|
||||
double bx[3],by[3],bz[3];
|
||||
double ax[3],az[3];
|
||||
double bx[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
||||
@ -126,8 +126,8 @@ void PairOxdnaXstk::compute(int eflag, int vflag)
|
||||
// vectors COM-h-bonding site in lab frame
|
||||
double ra_chb[3],rb_chb[3];
|
||||
// Cartesian unit vectors in lab frame
|
||||
double ax[3],ay[3],az[3];
|
||||
double bx[3],by[3],bz[3];
|
||||
double ax[3],az[3];
|
||||
double bx[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
||||
@ -121,8 +121,8 @@ void PairOxrna2Xstk::compute(int eflag, int vflag)
|
||||
double ra_chb[3],rb_chb[3];
|
||||
|
||||
// Cartesian unit vectors in lab frame
|
||||
double ax[3],ay[3],az[3];
|
||||
double bx[3],by[3],bz[3];
|
||||
double ax[3],az[3];
|
||||
double bx[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
||||
@ -41,7 +41,7 @@ using namespace FixConst;
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), temp_x(nullptr), temp_f(nullptr)
|
||||
Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), numdiff_forces(nullptr), temp_x(nullptr), temp_f(nullptr)
|
||||
{
|
||||
if (narg < 5) error->all(FLERR, "Illegal fix numdiff command");
|
||||
|
||||
@ -109,9 +109,8 @@ void FixNumDiff::init()
|
||||
|
||||
// check for PE compute
|
||||
|
||||
int icompute = modify->find_compute(id_pe);
|
||||
if (icompute < 0) error->all(FLERR, "Compute ID for fix numdiff does not exist");
|
||||
pe = modify->compute[icompute];
|
||||
pe = modify->get_compute_by_id(id_pe);
|
||||
if (!pe) error->all(FLERR, "PE compute ID for fix numdiff does not exist");
|
||||
|
||||
if (force->pair && force->pair->compute_flag)
|
||||
pair_compute_flag = 1;
|
||||
|
||||
@ -41,7 +41,7 @@ using namespace FixConst;
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNumDiffVirial::FixNumDiffVirial(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg), id_pe(nullptr), temp_x(nullptr), temp_f(nullptr)
|
||||
Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), temp_x(nullptr), temp_f(nullptr)
|
||||
{
|
||||
if (narg < 5) error->all(FLERR, "Illegal fix numdiff/virial command");
|
||||
if (igroup) error->all(FLERR, "Compute numdiff/virial must use group all");
|
||||
@ -121,9 +121,8 @@ void FixNumDiffVirial::init()
|
||||
{
|
||||
// check for PE compute
|
||||
|
||||
int icompute = modify->find_compute(id_pe);
|
||||
if (icompute < 0) error->all(FLERR, "Compute ID for fix numdiff does not exist");
|
||||
pe = modify->compute[icompute];
|
||||
pe = modify->get_compute_by_id(id_pe);
|
||||
if (!pe) error->all(FLERR, "PE compute ID for fix numdiff/virial does not exist");
|
||||
|
||||
if (force->pair && force->pair->compute_flag)
|
||||
pair_compute_flag = 1;
|
||||
@ -210,7 +209,6 @@ void FixNumDiffVirial::calculate_virial()
|
||||
// loop over 6 strain directions
|
||||
// compute a finite difference force in each dimension
|
||||
|
||||
int flag, allflag;
|
||||
double nktv2p = force->nktv2p;
|
||||
double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
|
||||
|
||||
|
||||
@ -282,10 +282,11 @@ void DynamicalMatrix::calculateMatrix()
|
||||
dynmat_clear(dynmat);
|
||||
|
||||
if (me == 0 && screen) {
|
||||
fprintf(screen,"Calculating Dynamical Matrix ...\n");
|
||||
fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms);
|
||||
fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount);
|
||||
fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlen*dynlen) );
|
||||
fputs("Calculating Dynamical Matrix ...\n", screen);
|
||||
fmt::print(screen," Total # of atoms = {}\n"
|
||||
" Atoms in group = {}\n"
|
||||
" Total dynamical matrix elements = {}\n",
|
||||
natoms, gcount, dynlen*dynlen);
|
||||
}
|
||||
|
||||
// emit dynlen rows of dimalpha*dynlen*dimbeta elements
|
||||
|
||||
@ -232,6 +232,7 @@ void ThirdOrder::options(int narg, char **arg)
|
||||
if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command");
|
||||
filename = arg[iarg + 1];
|
||||
file_flag = 1;
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"fold") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR, "Illegal Third Order command");
|
||||
if (strcmp(arg[iarg+1],"yes") == 0) {
|
||||
@ -300,11 +301,11 @@ void ThirdOrder::calculateMatrix()
|
||||
getNeighbortags();
|
||||
|
||||
if (comm->me == 0 && screen) {
|
||||
fprintf(screen, "Calculating Third Order ...\n");
|
||||
fprintf(screen, " Total # of atoms = " BIGINT_FORMAT "\n", natoms);
|
||||
fprintf(screen, " Atoms in group = " BIGINT_FORMAT "\n", gcount);
|
||||
fprintf(screen, " Total third order elements = "
|
||||
BIGINT_FORMAT "\n", (dynlen * dynlen * dynlen));
|
||||
fputs("Calculating Third Order ...\n", screen);
|
||||
fmt::print(screen," Total # of atoms = {}\n"
|
||||
" Atoms in group = {}\n"
|
||||
" Total third order elements = {}\n",
|
||||
natoms, gcount, dynlen*dynlen*dynlen);
|
||||
}
|
||||
|
||||
update->nsteps = 0;
|
||||
@ -436,31 +437,19 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b)
|
||||
clearerr(fp);
|
||||
if (folded){
|
||||
for (int k = 0; k < atom->natoms; k++){
|
||||
norm = square(dynmat[k*3])+
|
||||
square(dynmat[k*3+1])+
|
||||
square(dynmat[k*3+2]);
|
||||
norm = square(dynmat[k*3])+square(dynmat[k*3+1])+square(dynmat[k*3+2]);
|
||||
if (norm > 1.0e-16)
|
||||
fprintf(fp,
|
||||
BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT
|
||||
" %7.8f %7.8f %7.8f\n",
|
||||
i+1, a + 1, j+1, b + 1, k+1,
|
||||
dynmat[k*3] * conversion,
|
||||
dynmat[k*3+1] * conversion,
|
||||
dynmat[k*3+2] * conversion);
|
||||
fmt::print(fp, "{} {} {} {} {} {:17.8f} {:17.8f} {:17.8f}\n",
|
||||
i+1, a+1, j+1, b+1, k+1, dynmat[k*3] * conversion,
|
||||
dynmat[k*3+1] * conversion, dynmat[k*3+2] * conversion);
|
||||
}
|
||||
} else {
|
||||
for (int k = 0; k < gcount; k++){
|
||||
norm = square(dynmat[k*3])+
|
||||
square(dynmat[k*3+1])+
|
||||
square(dynmat[k*3+2]);
|
||||
norm = square(dynmat[k*3])+square(dynmat[k*3+1])+square(dynmat[k*3+2]);
|
||||
if (norm > 1.0e-16)
|
||||
fprintf(fp,
|
||||
BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT
|
||||
" %7.8f %7.8f %7.8f\n",
|
||||
i+1, a + 1, j+1, b + 1, groupmap[k]+1,
|
||||
dynmat[k*3] * conversion,
|
||||
dynmat[k*3+1] * conversion,
|
||||
dynmat[k*3+2] * conversion);
|
||||
fmt::print(fp, "{} {} {} {} {} {:17.8f} {:17.8f} {:17.8f}\n",
|
||||
i+1, a+1, j+1, b+1, groupmap[k]+1, dynmat[k*3] * conversion,
|
||||
dynmat[k*3+1] * conversion, dynmat[k*3+2] * conversion);
|
||||
}
|
||||
}
|
||||
} else if (binaryflag && fp) {
|
||||
@ -672,8 +661,7 @@ void ThirdOrder::create_groupmap()
|
||||
}
|
||||
|
||||
//combine subgroup maps into total temporary groupmap
|
||||
MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,
|
||||
temp_groupmap,recv,displs,MPI_LMP_BIGINT,world);
|
||||
MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world);
|
||||
std::sort(temp_groupmap,temp_groupmap+gcount);
|
||||
|
||||
//populate member groupmap based on temp groupmap
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
########################################
|
||||
# download and build googletest framework
|
||||
message(STATUS "Downloading and building googletest framework")
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.11.0.tar.gz" CACHE STRING "URL of googletest source")
|
||||
set(GTEST_MD5 "e8a8df240b6938bb6384155d4c37d937" CACHE STRING "MD5 sum for googletest source")
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/43efa0a4efd40c78b9210d15373112081899a97c.tar.gz" CACHE STRING "URL of googletest source")
|
||||
set(GTEST_MD5 "0259ff833c03cdbbedda4e5d02fbc6bd" CACHE STRING "MD5 sum for googletest source")
|
||||
mark_as_advanced(GTEST_URL)
|
||||
mark_as_advanced(GTEST_MD5)
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:08:49 2021
|
||||
epsilon: 1e-13
|
||||
epsilon: 5e-12
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
pair lj/cut/tip4p/long
|
||||
|
||||
Reference in New Issue
Block a user