forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9301 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
746deead15
commit
35769609d9
|
@ -28,6 +28,7 @@ class Region : protected Pointers {
|
|||
double extent_ylo,extent_yhi;
|
||||
double extent_zlo,extent_zhi;
|
||||
int bboxflag; // 1 if bounding box is computable
|
||||
int varshape; // 1 if region shape changes over time
|
||||
|
||||
// contact = particle near region surface
|
||||
|
||||
|
@ -56,8 +57,6 @@ class Region : protected Pointers {
|
|||
virtual void shape_update() {}
|
||||
|
||||
protected:
|
||||
int varshape; // 1 if region shape changes over time
|
||||
|
||||
void add_contact(int, double *, double, double, double);
|
||||
void options(int, char **);
|
||||
|
||||
|
|
|
@ -42,10 +42,14 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
|
|||
list[nregion++] = iregion;
|
||||
}
|
||||
|
||||
// extent of intersection of regions
|
||||
// has bounding box if interior and any sub-region has bounding box
|
||||
// this region is variable shape if any of sub-regions are
|
||||
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
if (regions[list[ilist]]->varshape) varshape = 1;
|
||||
|
||||
// extent of intersection of regions
|
||||
// has bounding box if interior and any sub-region has bounding box
|
||||
|
||||
bboxflag = 0;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
|
@ -91,6 +95,16 @@ RegIntersect::~RegIntersect()
|
|||
delete [] contact;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void RegIntersect::init()
|
||||
{
|
||||
Region::init();
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
regions[list[ilist]]->init();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
return 1 if region is dynamic, 0 if static
|
||||
dynamic if any sub-region is dynamic, else static
|
||||
|
@ -206,3 +220,14 @@ int RegIntersect::surface_exterior(double *x, double cutoff)
|
|||
|
||||
return n;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
change region shape of all sub-regions
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void RegIntersect::shape_update()
|
||||
{
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
regions[list[ilist]]->shape_update();
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@ class RegIntersect : public Region {
|
|||
public:
|
||||
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();
|
||||
|
||||
private:
|
||||
int nregion;
|
||||
|
|
|
@ -38,14 +38,19 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
|||
int iregion;
|
||||
for (int iarg = 0; iarg < n; iarg++) {
|
||||
iregion = domain->find_region(arg[iarg+3]);
|
||||
if (iregion == -1) error->all(FLERR,"Region union region ID does not exist");
|
||||
if (iregion == -1)
|
||||
error->all(FLERR,"Region union region ID does not exist");
|
||||
list[nregion++] = iregion;
|
||||
}
|
||||
|
||||
// extent of union of regions
|
||||
// has bounding box if interior and all sub-regions have bounding box
|
||||
// this region is variable shape if any of sub-regions are
|
||||
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
if (regions[list[ilist]]->varshape) varshape = 1;
|
||||
|
||||
// extent of union of regions
|
||||
// has bounding box if interior and all sub-regions have bounding box
|
||||
|
||||
bboxflag = 1;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
|
@ -82,6 +87,16 @@ RegUnion::~RegUnion()
|
|||
delete [] contact;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void RegUnion::init()
|
||||
{
|
||||
Region::init();
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
regions[list[ilist]]->init();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
return 1 if region is dynamic, 0 if static
|
||||
dynamic if any sub-region is dynamic, else static
|
||||
|
@ -197,3 +212,14 @@ int RegUnion::surface_exterior(double *x, double cutoff)
|
|||
|
||||
return n;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
change region shape of all sub-regions
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void RegUnion::shape_update()
|
||||
{
|
||||
Region **regions = domain->regions;
|
||||
for (int ilist = 0; ilist < nregion; ilist++)
|
||||
regions[list[ilist]]->shape_update();
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@ class RegUnion : public Region {
|
|||
public:
|
||||
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();
|
||||
|
||||
private:
|
||||
int nregion;
|
||||
|
|
Loading…
Reference in New Issue