git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3645 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -114,14 +114,13 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
} else error->all("Illegal fix pour command");
|
} 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");
|
if (iregion == -1) error->all("Must specify a region in fix pour");
|
||||||
|
if (domain->regions[iregion]->bboxflag == 0)
|
||||||
// error checks on region
|
error->all("Fix pour region does not support a bounding box");
|
||||||
|
if (domain->regions[iregion]->dynamic_check())
|
||||||
if (domain->regions[iregion]->interior == 0)
|
error->all("Fix pour region cannot be dynamic");
|
||||||
error->all("Must use region with side = in with fix pour");
|
|
||||||
|
|
||||||
if (strcmp(domain->regions[iregion]->style,"block") == 0) {
|
if (strcmp(domain->regions[iregion]->style,"block") == 0) {
|
||||||
region_style = 1;
|
region_style = 1;
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "region.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "velocity.h"
|
#include "velocity.h"
|
||||||
#include "integrate.h"
|
#include "integrate.h"
|
||||||
@ -221,12 +222,16 @@ void PRD::command(int narg, char **arg)
|
|||||||
|
|
||||||
update->minimize->init();
|
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++)
|
for (int i = 0; i < modify->nfix; i++)
|
||||||
if (modify->fix[i]->time_depend)
|
if (modify->fix[i]->time_depend)
|
||||||
error->all("Cannot use PRD with a time-dependent fix defined");
|
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
|
// perform PRD simulation
|
||||||
|
|
||||||
if (me_universe == 0 && universe->uscreen)
|
if (me_universe == 0 && universe->uscreen)
|
||||||
|
|||||||
@ -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 (iregion == -1) error->all("Must specify a region in fix deposit");
|
||||||
if (domain->regions[iregion]->bboxflag == 0)
|
if (domain->regions[iregion]->bboxflag == 0)
|
||||||
error->all("Fix deposit region does not support a bounding box");
|
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;
|
xlo = domain->regions[iregion]->extent_xlo;
|
||||||
xhi = domain->regions[iregion]->extent_xhi;
|
xhi = domain->regions[iregion]->extent_xhi;
|
||||||
|
|||||||
@ -62,9 +62,6 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
eflag = 0;
|
eflag = 0;
|
||||||
ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;
|
ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;
|
||||||
|
|
||||||
// set this when regions have time dependence
|
|
||||||
// time_depend = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
using namespace LAMMPS_NS;
|
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 if (strcmp(arg[iarg+1],"out") == 0) interior = 0;
|
||||||
else error->all("Illegal region command");
|
else error->all("Illegal region command");
|
||||||
iarg += 2;
|
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");
|
if (iarg+4 > narg) error->all("Illegal region command");
|
||||||
vx = atof(arg[iarg+1]);
|
vx = atof(arg[iarg+1]);
|
||||||
vy = atof(arg[iarg+2]);
|
vy = atof(arg[iarg+2]);
|
||||||
vz = atof(arg[iarg+3]);
|
vz = atof(arg[iarg+3]);
|
||||||
dynamic = LINEAR;
|
dynamic = VELOCITY;
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else if (strcmp(arg[iarg],"wiggle") == 0) {
|
} else if (strcmp(arg[iarg],"wiggle") == 0) {
|
||||||
if (iarg+5 > narg) error->all("Illegal region command");
|
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;
|
else xscale = yscale = zscale = 1.0;
|
||||||
|
|
||||||
if (dynamic == LINEAR) {
|
if (dynamic == VELOCITY) {
|
||||||
vx *= xscale;
|
vx *= xscale;
|
||||||
vy *= yscale;
|
vy *= yscale;
|
||||||
vz *= zscale;
|
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
|
determine if point x,y,z is a match to region volume
|
||||||
XOR computes 0 if 2 args are the same, 1 if different
|
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) {
|
if (dynamic) {
|
||||||
double delta = (update->ntimestep - time_origin) * dt;
|
double delta = (update->ntimestep - time_origin) * dt;
|
||||||
if (dynamic == LINEAR) {
|
if (dynamic == VELOCITY) {
|
||||||
x -= vx*delta;
|
x -= vx*delta;
|
||||||
y -= vy*delta;
|
y -= vy*delta;
|
||||||
z -= vz*delta;
|
z -= vz*delta;
|
||||||
@ -207,7 +218,7 @@ int Region::surface(double x, double y, double z, double cutoff)
|
|||||||
|
|
||||||
if (dynamic) {
|
if (dynamic) {
|
||||||
double delta = (update->ntimestep - time_origin) * dt;
|
double delta = (update->ntimestep - time_origin) * dt;
|
||||||
if (dynamic == LINEAR) {
|
if (dynamic == VELOCITY) {
|
||||||
x -= vx*delta;
|
x -= vx*delta;
|
||||||
y -= vy*delta;
|
y -= vy*delta;
|
||||||
z -= vz*delta;
|
z -= vz*delta;
|
||||||
|
|||||||
@ -42,6 +42,7 @@ class Region : protected Pointers {
|
|||||||
Region(class LAMMPS *, int, char **);
|
Region(class LAMMPS *, int, char **);
|
||||||
virtual ~Region();
|
virtual ~Region();
|
||||||
void init();
|
void init();
|
||||||
|
virtual int dynamic_check();
|
||||||
int match(double, double, double);
|
int match(double, double, double);
|
||||||
int surface(double, double, double, double);
|
int surface(double, double, double, double);
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,19 @@ RegIntersect::~RegIntersect()
|
|||||||
delete [] contact;
|
delete [] contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
return 1 if region is dynamic, 0 if static
|
||||||
|
dynamic if any sub-region is dynamic, else static
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int RegIntersect::dynamic_check()
|
||||||
|
{
|
||||||
|
Region **regions = domain->regions;
|
||||||
|
for (int ilist = 0; ilist < nregion; ilist++)
|
||||||
|
if (regions[list[ilist]]->dynamic_check()) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
inside = 1 if x,y,z is match() with all sub-regions
|
inside = 1 if x,y,z is match() with all sub-regions
|
||||||
else inside = 0
|
else inside = 0
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class RegIntersect : public Region {
|
|||||||
public:
|
public:
|
||||||
RegIntersect(class LAMMPS *, int, char **);
|
RegIntersect(class LAMMPS *, int, char **);
|
||||||
~RegIntersect();
|
~RegIntersect();
|
||||||
|
int dynamic_check();
|
||||||
int inside(double, double, double);
|
int inside(double, double, double);
|
||||||
int surface_interior(double *, double);
|
int surface_interior(double *, double);
|
||||||
int surface_exterior(double *, double);
|
int surface_exterior(double *, double);
|
||||||
|
|||||||
@ -85,6 +85,19 @@ RegUnion::~RegUnion()
|
|||||||
delete [] contact;
|
delete [] contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
return 1 if region is dynamic, 0 if static
|
||||||
|
dynamic if any sub-region is dynamic, else static
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int RegUnion::dynamic_check()
|
||||||
|
{
|
||||||
|
Region **regions = domain->regions;
|
||||||
|
for (int ilist = 0; ilist < nregion; ilist++)
|
||||||
|
if (regions[list[ilist]]->dynamic_check()) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
inside = 1 if x,y,z is match() with any sub-region
|
inside = 1 if x,y,z is match() with any sub-region
|
||||||
else inside = 0
|
else inside = 0
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class RegUnion : public Region {
|
|||||||
public:
|
public:
|
||||||
RegUnion(class LAMMPS *, int, char **);
|
RegUnion(class LAMMPS *, int, char **);
|
||||||
~RegUnion();
|
~RegUnion();
|
||||||
|
int dynamic_check();
|
||||||
int inside(double, double, double);
|
int inside(double, double, double);
|
||||||
int surface_interior(double *, double);
|
int surface_interior(double *, double);
|
||||||
int surface_exterior(double *, double);
|
int surface_exterior(double *, double);
|
||||||
|
|||||||
Reference in New Issue
Block a user