diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 7209faecf0..64f8a5f743 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -49,9 +49,6 @@ using namespace std; using namespace LAMMPS_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) diff --git a/src/dump_image.cpp b/src/dump_image.cpp index e4b51c627b..7a463711ec 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -73,9 +73,16 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[6],"element") == 0) adiam = ELEMENT; // create Image class + // change defaults for 2d 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 atomflag = YES; @@ -92,12 +99,6 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : cx = cy = cz = 0.5; 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; zoomstr = NULL; perspstr = NULL; @@ -343,6 +344,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (thetastr || phistr || cflag == DYNAMIC || upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC; + box_bounds(); if (cflag == STATIC) box_center(); if (viewflag == STATIC) view_params(); @@ -478,6 +480,7 @@ void DumpImage::write() // reset box center and view parameters if dynamic + box_bounds(); if (cflag == DYNAMIC) box_center(); if (viewflag == DYNAMIC) view_params(); @@ -546,8 +549,6 @@ void DumpImage::box_bounds() void DumpImage::box_center() { - box_bounds(); - if (cxstr) cx = input->variable->compute_equal(cxvar); if (cystr) cy = input->variable->compute_equal(cyvar); 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 (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 image->view_params(boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); diff --git a/src/image.cpp b/src/image.cpp index 9fa87eae93..0792e70d5a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -51,7 +51,7 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - // defaults + // defaults for 3d viz width = height = 512; theta = 60.0 * MY_PI/180.0; @@ -61,6 +61,10 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp) shiny = 1.0; ssao = NO; + up[0] = 0.0; + up[1] = 0.0; + up[2] = 1.0; + // colors ncolors = 0;