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

This commit is contained in:
sjplimp
2014-12-20 00:02:43 +00:00
parent 3140b3f6ce
commit 6c1be9686a
5 changed files with 36 additions and 36 deletions

View File

@ -29,6 +29,7 @@ class Region : protected Pointers {
double extent_zlo,extent_zhi;
int bboxflag; // 1 if bounding box is computable
int varshape; // 1 if region shape changes over time
int dynamic; // 1 if position/orient changes over time
// contact = particle near region surface
@ -42,7 +43,7 @@ class Region : protected Pointers {
Region(class LAMMPS *, int, char **);
virtual ~Region();
virtual void init();
virtual int dynamic_check();
int dynamic_check();
// called by other classes to check point versus region
@ -56,21 +57,20 @@ class Region : protected Pointers {
virtual int surface_interior(double *, double) = 0;
virtual int surface_exterior(double *, double) = 0;
virtual void shape_update() {}
virtual void pretransform();
protected:
void add_contact(int, double *, double, double, double);
void options(int, char **);
private:
int dynamic; // 1 if region position/orientation changes over time
int moveflag,rotateflag; // 1 if position/orientation changes
int moveflag,rotateflag; // 1 if position/orientation changes
double point[3],axis[3],runit[3];
char *xstr,*ystr,*zstr,*tstr;
int xvar,yvar,zvar,tvar;
double dx,dy,dz,theta;
void pretransform();
void forward_transform(double &, double &, double &);
void inverse_transform(double &, double &, double &);
void rotate(double &, double &, double &, double);

View File

@ -48,11 +48,13 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
list[nregion++] = iregion;
}
// this region is variable shape if any of sub-regions are
// this region is variable shape or dynamic if any of sub-regions are
Region **regions = domain->regions;
for (int ilist = 0; ilist < nregion; ilist++)
for (int ilist = 0; ilist < nregion; ilist++) {
if (regions[list[ilist]]->varshape) varshape = 1;
if (regions[list[ilist]]->dynamic) dynamic = 1;
}
// extent of intersection of regions
// has bounding box if interior and any sub-region has bounding box
@ -127,19 +129,6 @@ void RegIntersect::init()
regions[list[ilist]]->init();
}
/* ----------------------------------------------------------------------
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
else inside = 0
@ -253,3 +242,14 @@ void RegIntersect::shape_update()
for (int ilist = 0; ilist < nregion; ilist++)
regions[list[ilist]]->shape_update();
}
/* ----------------------------------------------------------------------
move/rotate all sub-regions
------------------------------------------------------------------------- */
void RegIntersect::pretransform()
{
Region **regions = domain->regions;
for (int ilist = 0; ilist < nregion; ilist++)
regions[list[ilist]]->pretransform();
}

View File

@ -29,11 +29,11 @@ class RegIntersect : public Region {
RegIntersect(class LAMMPS *, int, char **);
~RegIntersect();
void init();
int dynamic_check();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
void shape_update();
void pretransform();
private:
int nregion;

View File

@ -49,11 +49,13 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
list[nregion++] = iregion;
}
// this region is variable shape if any of sub-regions are
// this region is variable shape or dynamic if any of sub-regions are
Region **regions = domain->regions;
for (int ilist = 0; ilist < nregion; ilist++)
for (int ilist = 0; ilist < nregion; ilist++) {
if (regions[list[ilist]]->varshape) varshape = 1;
if (regions[list[ilist]]->dynamic) dynamic = 1;
}
// extent of union of regions
// has bounding box if interior and all sub-regions have bounding box
@ -119,19 +121,6 @@ void RegUnion::init()
regions[list[ilist]]->init();
}
/* ----------------------------------------------------------------------
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
else inside = 0
@ -245,3 +234,14 @@ void RegUnion::shape_update()
for (int ilist = 0; ilist < nregion; ilist++)
regions[list[ilist]]->shape_update();
}
/* ----------------------------------------------------------------------
move/rotate all sub-regions
------------------------------------------------------------------------- */
void RegUnion::pretransform()
{
Region **regions = domain->regions;
for (int ilist = 0; ilist < nregion; ilist++)
regions[list[ilist]]->pretransform();
}

View File

@ -29,11 +29,11 @@ class RegUnion : public Region {
RegUnion(class LAMMPS *, int, char **);
~RegUnion();
void init();
int dynamic_check();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
void shape_update();
void pretransform();
private:
int nregion;