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

This commit is contained in:
sjplimp
2013-01-18 20:55:26 +00:00
parent 746deead15
commit 35769609d9
5 changed files with 61 additions and 7 deletions

View File

@ -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();
}