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

This commit is contained in:
sjplimp
2012-01-11 21:27:57 +00:00
parent 07fe74af72
commit e4d07ec55c
3 changed files with 14 additions and 16 deletions

View File

@ -49,9 +49,6 @@ using namespace std;
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
using namespace DIHEDRAL_TABLE_NS; using namespace DIHEDRAL_TABLE_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
DihedralTable::DihedralTable(LAMMPS *lmp) : Dihedral(lmp) DihedralTable::DihedralTable(LAMMPS *lmp) : Dihedral(lmp)

View File

@ -73,9 +73,16 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[6],"element") == 0) adiam = ELEMENT; else if (strcmp(arg[6],"element") == 0) adiam = ELEMENT;
// create Image class // create Image class
// change defaults for 2d
image = new Image(lmp); image = new Image(lmp);
if (domain->dimension == 2) {
image->theta = 0.0;
image->phi = 0.0;
image->up[0] = 0.0; image->up[1] = 1.0; image->up[2] = 0.0;
}
// set defaults for optional args // set defaults for optional args
atomflag = YES; atomflag = YES;
@ -92,12 +99,6 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
cx = cy = cz = 0.5; cx = cy = cz = 0.5;
cxstr = cystr = czstr = NULL; cxstr = cystr = czstr = NULL;
if (domain->dimension == 3) {
image->up[0] = 0.0; image->up[1] = 0.0; image->up[2] = 1.0;
} else {
image->up[0] = 0.0; image->up[1] = 1.0; image->up[2] = 0.0;
}
upxstr = upystr = upzstr = NULL; upxstr = upystr = upzstr = NULL;
zoomstr = NULL; zoomstr = NULL;
perspstr = NULL; perspstr = NULL;
@ -343,6 +344,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (thetastr || phistr || cflag == DYNAMIC || if (thetastr || phistr || cflag == DYNAMIC ||
upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC; upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC;
box_bounds();
if (cflag == STATIC) box_center(); if (cflag == STATIC) box_center();
if (viewflag == STATIC) view_params(); if (viewflag == STATIC) view_params();
@ -478,6 +480,7 @@ void DumpImage::write()
// reset box center and view parameters if dynamic // reset box center and view parameters if dynamic
box_bounds();
if (cflag == DYNAMIC) box_center(); if (cflag == DYNAMIC) box_center();
if (viewflag == DYNAMIC) view_params(); if (viewflag == DYNAMIC) view_params();
@ -546,8 +549,6 @@ void DumpImage::box_bounds()
void DumpImage::box_center() void DumpImage::box_center()
{ {
box_bounds();
if (cxstr) cx = input->variable->compute_equal(cxvar); if (cxstr) cx = input->variable->compute_equal(cxvar);
if (cystr) cy = input->variable->compute_equal(cyvar); if (cystr) cy = input->variable->compute_equal(cyvar);
if (czstr) cz = input->variable->compute_equal(czvar); if (czstr) cz = input->variable->compute_equal(czvar);
@ -594,10 +595,6 @@ void DumpImage::view_params()
if (perspstr) image->persp = input->variable->compute_equal(perspvar); if (perspstr) image->persp = input->variable->compute_equal(perspvar);
if (image->persp < 0.0) error->all(FLERR,"Invalid dump image persp value"); if (image->persp < 0.0) error->all(FLERR,"Invalid dump image persp value");
// current simulation box bounds
box_bounds();
// remainder of view setup is internal to Image class // remainder of view setup is internal to Image class
image->view_params(boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); image->view_params(boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi);

View File

@ -51,7 +51,7 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp)
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs); MPI_Comm_size(world,&nprocs);
// defaults // defaults for 3d viz
width = height = 512; width = height = 512;
theta = 60.0 * MY_PI/180.0; theta = 60.0 * MY_PI/180.0;
@ -61,6 +61,10 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp)
shiny = 1.0; shiny = 1.0;
ssao = NO; ssao = NO;
up[0] = 0.0;
up[1] = 0.0;
up[2] = 1.0;
// colors // colors
ncolors = 0; ncolors = 0;