git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8916 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2012-10-08 14:52:40 +00:00
parent f14f768f71
commit c22237f395
1 changed files with 35 additions and 35 deletions

View File

@ -209,72 +209,72 @@ void ChangeBox::command(int narg, char **arg)
if (domain->triclinic) domain->lamda2x(atom->nlocal);
save_box_state();
for (int i = 0; i < nops; i++) {
if (ops[i].style == XYZ) {
for (int m = 0; m < nops; m++) {
if (ops[m].style == XYZ) {
double volume;
if (domain->dimension == 2) volume = domain->xprd * domain->yprd;
else volume = domain->xprd * domain->yprd * domain->zprd;
if (ops[i].flavor == FINAL) {
domain->boxlo[ops[i].dim] = scale[ops[i].dim]*ops[i].flo;
domain->boxhi[ops[i].dim] = scale[ops[i].dim]*ops[i].fhi;
if (ops[i].vdim1 >= 0)
volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
if (ops[m].flavor == FINAL) {
domain->boxlo[ops[m].dim] = scale[ops[m].dim]*ops[m].flo;
domain->boxhi[ops[m].dim] = scale[ops[m].dim]*ops[m].fhi;
if (ops[m].vdim1 >= 0)
volume_preserve(ops[m].vdim1,ops[m].vdim2,volume);
domain->set_initial_box();
domain->set_global_box();
domain->set_local_box();
domain->print_box(" ");
} else if (ops[i].flavor == DELTA) {
domain->boxlo[ops[i].dim] += scale[ops[i].dim]*ops[i].dlo;
domain->boxhi[ops[i].dim] += scale[ops[i].dim]*ops[i].dhi;
if (ops[i].vdim1 >= 0)
volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
} else if (ops[m].flavor == DELTA) {
domain->boxlo[ops[m].dim] += scale[ops[m].dim]*ops[m].dlo;
domain->boxhi[ops[m].dim] += scale[ops[m].dim]*ops[m].dhi;
if (ops[m].vdim1 >= 0)
volume_preserve(ops[m].vdim1,ops[m].vdim2,volume);
domain->set_initial_box();
domain->set_global_box();
domain->set_local_box();
domain->print_box(" ");
} else if (ops[i].flavor == SCALE) {
} else if (ops[m].flavor == SCALE) {
double mid = 0.5 *
(domain->boxlo[ops[i].dim] + domain->boxhi[ops[i].dim]);
double delta = domain->boxlo[ops[i].dim] - mid;
domain->boxlo[ops[i].dim] = mid + ops[i].scale*delta;
delta = domain->boxhi[ops[i].dim] - mid;
domain->boxhi[ops[i].dim] = mid + ops[i].scale*delta;
if (ops[i].vdim1 >= 0)
volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
(domain->boxlo[ops[m].dim] + domain->boxhi[ops[m].dim]);
double delta = domain->boxlo[ops[m].dim] - mid;
domain->boxlo[ops[m].dim] = mid + ops[m].scale*delta;
delta = domain->boxhi[ops[m].dim] - mid;
domain->boxhi[ops[m].dim] = mid + ops[m].scale*delta;
if (ops[m].vdim1 >= 0)
volume_preserve(ops[m].vdim1,ops[m].vdim2,volume);
domain->set_initial_box();
domain->set_global_box();
domain->set_local_box();
domain->print_box(" ");
}
} else if (ops[i].style == TILT) {
} else if (ops[m].style == TILT) {
if (domain->triclinic == 0)
error->all(FLERR,"Cannot change box tilt factors for orthogonal box");
if (ops[i].flavor == FINAL) {
if (ops[i].dim == XY) domain->xy = scale[X]*ops[i].ftilt;
else if (ops[i].dim == XZ) domain->xz = scale[X]*ops[i].ftilt;
else if (ops[i].dim == YZ) domain->yz = scale[Y]*ops[i].ftilt;
if (ops[m].flavor == FINAL) {
if (ops[m].dim == XY) domain->xy = scale[X]*ops[m].ftilt;
else if (ops[m].dim == XZ) domain->xz = scale[X]*ops[m].ftilt;
else if (ops[m].dim == YZ) domain->yz = scale[Y]*ops[m].ftilt;
domain->set_initial_box();
domain->set_global_box();
domain->set_local_box();
domain->print_box(" ");
} else if (ops[i].flavor == DELTA) {
if (ops[i].dim == XY) domain->xy += scale[X]*ops[i].dtilt;
else if (ops[i].dim == XZ) domain->xz += scale[X]*ops[i].dtilt;
else if (ops[i].dim == YZ) domain->yz += scale[Y]*ops[i].dtilt;
} else if (ops[m].flavor == DELTA) {
if (ops[m].dim == XY) domain->xy += scale[X]*ops[m].dtilt;
else if (ops[m].dim == XZ) domain->xz += scale[X]*ops[m].dtilt;
else if (ops[m].dim == YZ) domain->yz += scale[Y]*ops[m].dtilt;
domain->set_initial_box();
domain->set_global_box();
domain->set_local_box();
domain->print_box(" ");
}
} else if (ops[i].style == BOUNDARY) {
domain->set_boundary(3,&arg[ops[i].boundindex],1);
} else if (ops[m].style == BOUNDARY) {
domain->set_boundary(3,&arg[ops[m].boundindex],1);
if (domain->dimension == 2 && domain->zperiodic == 0)
error->all(FLERR,
"Cannot change box z boundary to "
@ -283,7 +283,7 @@ void ChangeBox::command(int narg, char **arg)
domain->set_global_box();
domain->set_local_box();
} else if (ops[i].style == ORTHO) {
} else if (ops[m].style == ORTHO) {
if (domain->xy != 0.0 || domain->yz != 0.0 || domain->xz != 0.0)
error->all(FLERR,
"Cannot change box to orthogonal when tilt is non-zero");
@ -301,7 +301,7 @@ void ChangeBox::command(int narg, char **arg)
domain->set_local_box();
domain->print_box(" ");
} else if (ops[i].style == TRICLINIC) {
} else if (ops[m].style == TRICLINIC) {
if (output->ndump)
error->all(FLERR,
"Cannot change box ortho/triclinic with dumps defined");
@ -317,10 +317,10 @@ void ChangeBox::command(int narg, char **arg)
domain->set_local_box();
domain->print_box(" ");
} else if (ops[i].style == SET) {
} else if (ops[m].style == SET) {
save_box_state();
} else if (ops[i].style == REMAP) {
} else if (ops[m].style == REMAP) {
// convert atoms to lamda coords, using last box state
// convert atoms back to box coords, using current box state