change zero-size shrink box to original box
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
:link(lws,http://lammps.sandia.gov)
|
:link(lws,http://lammps.sandia.gov)
|
||||||
:link(ld,Manual.html)
|
:link(ld,Manual.html)
|
||||||
:link(lc,Section_commands.html#comm)
|
:link(lc,Commands_all.html)
|
||||||
|
|
||||||
:line
|
:line
|
||||||
|
|
||||||
@ -48,10 +48,10 @@ compute 1 all property/local atype aatom2 :pre
|
|||||||
|
|
||||||
Define a computation that stores the specified attributes as local
|
Define a computation that stores the specified attributes as local
|
||||||
data so it can be accessed by other "output
|
data so it can be accessed by other "output
|
||||||
commands"_Section_howto.html#howto_15. If the input attributes refer
|
commands"_Howto_output.html. If the input attributes refer to bond
|
||||||
to bond information, then the number of datums generated, aggregated
|
information, then the number of datums generated, aggregated across
|
||||||
across all processors, equals the number of bonds in the system.
|
all processors, equals the number of bonds in the system. Ditto for
|
||||||
Ditto for pairs, angles, etc.
|
pairs, angles, etc.
|
||||||
|
|
||||||
If multiple attributes are specified then they must all generate the
|
If multiple attributes are specified then they must all generate the
|
||||||
same amount of information, so that the resulting local array has the
|
same amount of information, so that the resulting local array has the
|
||||||
@ -140,8 +140,8 @@ the array is the number of bonds, angles, etc. If a single input is
|
|||||||
specified, a local vector is produced. If two or more inputs are
|
specified, a local vector is produced. If two or more inputs are
|
||||||
specified, a local array is produced where the number of columns = the
|
specified, a local array is produced where the number of columns = the
|
||||||
number of inputs. The vector or array can be accessed by any command
|
number of inputs. The vector or array can be accessed by any command
|
||||||
that uses local values from a compute as input. See "this
|
that uses local values from a compute as input. See the "Howto
|
||||||
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
|
output"_Howto_output.html doc page for an overview of LAMMPS output
|
||||||
options.
|
options.
|
||||||
|
|
||||||
The vector or array values will be integers that correspond to the
|
The vector or array values will be integers that correspond to the
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
#include "rcb.h"
|
#include "rcb.h"
|
||||||
#include "irregular.h"
|
#include "irregular.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "neighbor.h"
|
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
@ -351,13 +350,13 @@ void Balance::command(int narg, char **arg)
|
|||||||
domain->set_local_box();
|
domain->set_local_box();
|
||||||
|
|
||||||
// move particles to new processors via irregular()
|
// move particles to new processors via irregular()
|
||||||
|
// set disable = 0, so weights migrate with atoms for imbfinal calculation
|
||||||
|
|
||||||
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||||
Irregular *irregular = new Irregular(lmp);
|
Irregular *irregular = new Irregular(lmp);
|
||||||
if (wtflag) fixstore->disable = 0;
|
if (wtflag) fixstore->disable = 0;
|
||||||
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
|
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
|
||||||
else irregular->migrate_atoms(1);
|
else irregular->migrate_atoms(1);
|
||||||
if (wtflag) fixstore->disable = 1;
|
|
||||||
delete irregular;
|
delete irregular;
|
||||||
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
||||||
|
|
||||||
@ -378,9 +377,11 @@ void Balance::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// imbfinal = final imbalance
|
// imbfinal = final imbalance
|
||||||
|
// set disable = 1, so weights no longer migrate with atoms
|
||||||
|
|
||||||
double maxfinal;
|
double maxfinal;
|
||||||
double imbfinal = imbalance_factor(maxfinal);
|
double imbfinal = imbalance_factor(maxfinal);
|
||||||
|
if (wtflag) fixstore->disable = 1;
|
||||||
|
|
||||||
// stats output
|
// stats output
|
||||||
|
|
||||||
@ -541,6 +542,8 @@ void Balance::weight_storage(char *prefix)
|
|||||||
fixstore = (FixStore *) modify->fix[modify->nfix-1];
|
fixstore = (FixStore *) modify->fix[modify->nfix-1];
|
||||||
} else fixstore = (FixStore *) modify->fix[ifix];
|
} else fixstore = (FixStore *) modify->fix[ifix];
|
||||||
|
|
||||||
|
// do not carry weights with atoms during normal atom migration
|
||||||
|
|
||||||
fixstore->disable = 1;
|
fixstore->disable = 1;
|
||||||
|
|
||||||
if (prefix) delete [] fixargs[0];
|
if (prefix) delete [] fixargs[0];
|
||||||
@ -644,17 +647,19 @@ int *Balance::bisection(int sortflag)
|
|||||||
double *shrinklo = &shrinkall[0];
|
double *shrinklo = &shrinkall[0];
|
||||||
double *shrinkhi = &shrinkall[3];
|
double *shrinkhi = &shrinkall[3];
|
||||||
|
|
||||||
// ensure that that the box has at least some extent.
|
// if shrink size in any dim is zero, use box size in that dim
|
||||||
const double nproc_rt = domain->dimension == 3 ?
|
|
||||||
cbrt(static_cast<double>(comm->nprocs)) :
|
if (shrinklo[0] == shrinkhi[0]) {
|
||||||
sqrt(static_cast<double>(comm->nprocs));
|
shrinklo[0] = boxlo[0];
|
||||||
const double min_extent = ceil(nproc_rt)*neighbor->skin;
|
shrinkhi[0] = boxhi[0];
|
||||||
for (int i = 0; i < domain->dimension; i++) {
|
}
|
||||||
if (shrinkall[3+i]-shrinkall[i] < min_extent) {
|
if (shrinklo[1] == shrinkhi[1]) {
|
||||||
const double mid = 0.5*(shrinkall[3+i]+shrinkall[i]);
|
shrinklo[1] = boxlo[1];
|
||||||
shrinkall[3+i] = std::min(mid + min_extent*0.5, boxhi[i]);
|
shrinkhi[1] = boxhi[1];
|
||||||
shrinkall[i] = std::max(mid - min_extent*0.5, boxlo[i]);
|
}
|
||||||
}
|
if (shrinklo[2] == shrinkhi[2]) {
|
||||||
|
shrinklo[2] = boxlo[2];
|
||||||
|
shrinkhi[2] = boxhi[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// invoke RCB
|
// invoke RCB
|
||||||
|
|||||||
@ -241,6 +241,8 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||||||
// dim_select = selected cut dimension
|
// dim_select = selected cut dimension
|
||||||
// valuehalf_select = valuehalf in that dimension
|
// valuehalf_select = valuehalf in that dimension
|
||||||
// dotmark_select = dot markings in that dimension
|
// dotmark_select = dot markings in that dimension
|
||||||
|
// initialize largest = -1.0 to insure a cut in some dim is accepted
|
||||||
|
// e.g. if current recursed box is size 0 in all dims
|
||||||
|
|
||||||
int dim_select = -1;
|
int dim_select = -1;
|
||||||
double largest = -1.0;
|
double largest = -1.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user