forked from lijiext/lammps
undo obsoleted changes to group command by iain bethune
This commit is contained in:
parent
40fd97bd4c
commit
243137d552
|
@ -15,7 +15,7 @@ group ID style args :pre
|
||||||
ID = user-defined name of the group :ulb,l
|
ID = user-defined name of the group :ulb,l
|
||||||
style = {delete} or {region} or {type} or {id} or {molecule} or {variable} or \
|
style = {delete} or {region} or {type} or {id} or {molecule} or {variable} or \
|
||||||
{include} or {subtract} or {union} or {intersect} or \
|
{include} or {subtract} or {union} or {intersect} or \
|
||||||
{dynamic} or {static} or {load_factor} :l
|
{dynamic} or {static} :l
|
||||||
{delete} = no args
|
{delete} = no args
|
||||||
{clear} = no args
|
{clear} = no args
|
||||||
{region} args = region-ID
|
{region} args = region-ID
|
||||||
|
@ -42,8 +42,7 @@ style = {delete} or {region} or {type} or {id} or {molecule} or {variable} or \
|
||||||
{region} value = region-ID
|
{region} value = region-ID
|
||||||
{var} value = name of variable
|
{var} value = name of variable
|
||||||
{every} value = N = update group every this many timesteps
|
{every} value = N = update group every this many timesteps
|
||||||
{static} = no args
|
{static} = no args :pre
|
||||||
{load_factor} value = weighting to apply to particles in the group for load balancing :pre
|
|
||||||
:ule
|
:ule
|
||||||
|
|
||||||
[Examples:]
|
[Examples:]
|
||||||
|
@ -61,8 +60,7 @@ group boundary subtract all a2 a3
|
||||||
group boundary union lower upper
|
group boundary union lower upper
|
||||||
group boundary intersect upper flow
|
group boundary intersect upper flow
|
||||||
group boundary delete
|
group boundary delete
|
||||||
group mine dynamic all region myRegion every 100
|
group mine dynamic all region myRegion every 100 :pre
|
||||||
group mine load_factor 2.0 :pre
|
|
||||||
|
|
||||||
|
|
||||||
[Description:]
|
[Description:]
|
||||||
|
@ -267,12 +265,6 @@ The {static} style removes the setting for a dynamic group, converting
|
||||||
it to a static group (the default). The atoms in the static group are
|
it to a static group (the default). The atoms in the static group are
|
||||||
those currently in the dynamic group.
|
those currently in the dynamic group.
|
||||||
|
|
||||||
The {load_factor} style applies a weight to all atoms in the group. When
|
|
||||||
load balancing is applied (by "balance"_balance.html or
|
|
||||||
"fix balance"_fix_balance.html) the count of atoms per processor is
|
|
||||||
weighted by the produce of the load factors of the groups which each
|
|
||||||
atom is a member of.
|
|
||||||
|
|
||||||
:line
|
:line
|
||||||
|
|
||||||
[Restrictions:]
|
[Restrictions:]
|
||||||
|
@ -284,8 +276,7 @@ The parent group of a dynamic group cannot itself be a dynamic group.
|
||||||
|
|
||||||
[Related commands:]
|
[Related commands:]
|
||||||
|
|
||||||
"balance"_balance.html, "dump"_dump.html, "fix"_fix.html,
|
"dump"_dump.html, "fix"_fix.html, "region"_region.html,
|
||||||
"fix balance"_fix_balance.html, "region"_region.html,
|
|
||||||
"velocity"_velocity.html
|
"velocity"_velocity.html
|
||||||
|
|
||||||
[Default:]
|
[Default:]
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
#define MAX_GROUP 32
|
||||||
|
|
||||||
enum{TYPE,MOLECULE,ID};
|
enum{TYPE,MOLECULE,ID};
|
||||||
enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN};
|
enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN};
|
||||||
|
|
||||||
|
@ -57,13 +59,11 @@ Group::Group(LAMMPS *lmp) : Pointers(lmp)
|
||||||
bitmask = new int[MAX_GROUP];
|
bitmask = new int[MAX_GROUP];
|
||||||
inversemask = new int[MAX_GROUP];
|
inversemask = new int[MAX_GROUP];
|
||||||
dynamic = new int[MAX_GROUP];
|
dynamic = new int[MAX_GROUP];
|
||||||
load_factor = new double[MAX_GROUP];
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL;
|
for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL;
|
||||||
for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i;
|
for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i;
|
||||||
for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0;
|
for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0;
|
||||||
for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0;
|
for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0;
|
||||||
for (int i = 0; i < MAX_GROUP; i++) load_factor[i] = 1.0;
|
|
||||||
|
|
||||||
// create "all" group
|
// create "all" group
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ Group::~Group()
|
||||||
delete [] bitmask;
|
delete [] bitmask;
|
||||||
delete [] inversemask;
|
delete [] inversemask;
|
||||||
delete [] dynamic;
|
delete [] dynamic;
|
||||||
delete [] load_factor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
@ -136,7 +135,6 @@ void Group::assign(int narg, char **arg)
|
||||||
delete [] names[igroup];
|
delete [] names[igroup];
|
||||||
names[igroup] = NULL;
|
names[igroup] = NULL;
|
||||||
dynamic[igroup] = 0;
|
dynamic[igroup] = 0;
|
||||||
load_factor[igroup] = 1.0;
|
|
||||||
ngroup--;
|
ngroup--;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -520,17 +518,9 @@ void Group::assign(int narg, char **arg)
|
||||||
|
|
||||||
dynamic[igroup] = 0;
|
dynamic[igroup] = 0;
|
||||||
|
|
||||||
} else if (strcmp(arg[1],"load_factor") == 0) {
|
// not a valid group style
|
||||||
|
|
||||||
if (narg != 3) error->all(FLERR,"Illegal group command");
|
} else error->all(FLERR,"Illegal group command");
|
||||||
|
|
||||||
load_factor[igroup] = force->numeric(FLERR, arg[2]);
|
|
||||||
|
|
||||||
// not a valid group style
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else error->all(FLERR,"Illegal group command");
|
|
||||||
|
|
||||||
// print stats for changed group
|
// print stats for changed group
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#define MAX_GROUP 32
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Group : protected Pointers {
|
class Group : protected Pointers {
|
||||||
|
@ -29,7 +27,6 @@ class Group : protected Pointers {
|
||||||
int *bitmask; // one-bit mask for each group
|
int *bitmask; // one-bit mask for each group
|
||||||
int *inversemask; // inverse mask for each group
|
int *inversemask; // inverse mask for each group
|
||||||
int *dynamic; // 1 if dynamic, 0 if not
|
int *dynamic; // 1 if dynamic, 0 if not
|
||||||
double *load_factor; // weight factor for atoms in group, for load balancing
|
|
||||||
|
|
||||||
Group(class LAMMPS *);
|
Group(class LAMMPS *);
|
||||||
~Group();
|
~Group();
|
||||||
|
|
Loading…
Reference in New Issue