Commit d9310d7e authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3645 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 8c8691f5
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -114,14 +114,13 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
    } else error->all("Illegal fix pour command");
  }

  // error check that a valid region was specified
  // error checks on region and its extent being inside simulation box

  if (iregion == -1) error->all("Must specify a region in fix pour");

  // error checks on region

  if (domain->regions[iregion]->interior == 0)
    error->all("Must use region with side = in with fix pour");
  if (domain->regions[iregion]->bboxflag == 0)
    error->all("Fix pour region does not support a bounding box");
  if (domain->regions[iregion]->dynamic_check())
    error->all("Fix pour region cannot be dynamic");

  if (strcmp(domain->regions[iregion]->style,"block") == 0) {
    region_style = 1;
+6 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "update.h"
#include "atom.h"
#include "domain.h"
#include "region.h"
#include "comm.h"
#include "velocity.h"
#include "integrate.h"
@@ -221,12 +222,16 @@ void PRD::command(int narg, char **arg)

  update->minimize->init();

  // cannot use PRD with time-dependent fixes
  // cannot use PRD with time-dependent fixes or regions

  for (int i = 0; i < modify->nfix; i++)
    if (modify->fix[i]->time_depend)
      error->all("Cannot use PRD with a time-dependent fix defined");

  for (int i = 0; i < modify->nfix; i++)
    if (domain->regions[i]->dynamic)
      error->all("Cannot use PRD with a time-dependent region defined");

  // perform PRD simulation

  if (me_universe == 0 && universe->uscreen) 
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
  if (iregion == -1) error->all("Must specify a region in fix deposit");
  if (domain->regions[iregion]->bboxflag == 0)
    error->all("Fix deposit region does not support a bounding box");
  if (domain->regions[iregion]->dynamic_check())
    error->all("Fix deposit region cannot be dynamic");

  xlo = domain->regions[iregion]->extent_xlo;
  xhi = domain->regions[iregion]->extent_xhi;
+0 −3
Original line number Diff line number Diff line
@@ -62,9 +62,6 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :

  eflag = 0;
  ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;

  // set this when regions have time dependence
  // time_depend = 1;
}

/* ---------------------------------------------------------------------- */
+17 −6
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

using namespace LAMMPS_NS;

enum{NONE,LINEAR,WIGGLE,ROTATE,VARIABLE};
enum{NONE,VELOCITY,WIGGLE,ROTATE,VARIABLE};

/* ---------------------------------------------------------------------- */

@@ -82,12 +82,12 @@ void Region::options(int narg, char **arg)
      else if (strcmp(arg[iarg+1],"out") == 0) interior = 0;
      else error->all("Illegal region command");
      iarg += 2;
    } else if (strcmp(arg[iarg],"linear") == 0) {
    } else if (strcmp(arg[iarg],"vel") == 0) {
      if (iarg+4 > narg) error->all("Illegal region command");
      vx = atof(arg[iarg+1]);
      vy = atof(arg[iarg+2]);
      vz = atof(arg[iarg+3]);
      dynamic = LINEAR;
      dynamic = VELOCITY;
      iarg += 4;
    } else if (strcmp(arg[iarg],"wiggle") == 0) {
      if (iarg+5 > narg) error->all("Illegal region command");
@@ -129,7 +129,7 @@ void Region::options(int narg, char **arg)
  }
  else xscale = yscale = zscale = 1.0;

  if (dynamic == LINEAR) {
  if (dynamic == VELOCITY) {
    vx *= xscale;
    vy *= yscale;
    vz *= zscale;
@@ -160,6 +160,17 @@ void Region::options(int narg, char **arg)
  }
}

/* ----------------------------------------------------------------------
   return 1 if region is dynamic, 0 if static
   only primitive regions define it here
   union/intersect regions have their own dynamic_check()
------------------------------------------------------------------------- */

int Region::dynamic_check()
{
  return dynamic;
}

/* ----------------------------------------------------------------------
   determine if point x,y,z is a match to region volume
   XOR computes 0 if 2 args are the same, 1 if different
@@ -174,7 +185,7 @@ int Region::match(double x, double y, double z)

  if (dynamic) {
    double delta = (update->ntimestep - time_origin) * dt;
    if (dynamic == LINEAR) {
    if (dynamic == VELOCITY) {
      x -= vx*delta;
      y -= vy*delta;
      z -= vz*delta;
@@ -207,7 +218,7 @@ int Region::surface(double x, double y, double z, double cutoff)

  if (dynamic) {
    double delta = (update->ntimestep - time_origin) * dt;
    if (dynamic == LINEAR) {
    if (dynamic == VELOCITY) {
      x -= vx*delta;
      y -= vy*delta;
      z -= vz*delta;
Loading