better documention and error checking for 2d general triclinic

This commit is contained in:
Steve Plimpton
2024-04-08 10:43:20 -06:00
parent 1a019889f2
commit c2b91ccc8a
10 changed files with 170 additions and 95 deletions

View File

@ -119,6 +119,10 @@ void CreateBox::command(int narg, char **arg)
double chi = utils::numeric(FLERR, arg[iarg + 5], false, lmp);
iarg += 6;
if (domain->dimension == 2)
if (clo != -0.5 || chi != 0.5)
error->all(FLERR,"Create_box for general triclinic requires clo = -0.5 and chi = 0.5");
// use lattice2box() to generate origin and ABC vectors
// origin = abc lo
// ABC vectors = hi in one dim - origin
@ -150,12 +154,6 @@ void CreateBox::command(int narg, char **arg)
cvec[1] = py - origin[1];
cvec[2] = pz - origin[2];
if (domain->dimension == 2) {
if (cvec[0] != 0.0 || cvec[1] != 0.0 || cvec[2] != 1.0 || origin[2] != -0.5)
error->all(FLERR,"Create_box C edge vector and/or origin is invalid "
"for 2d simulation with general triclinic box");
}
// define general triclinic box within Domain class
domain->define_general_triclinic(avec,bvec,cvec,origin);