Merge branch 'develop' into fix-gcmc-with-latte
This commit is contained in:
@ -416,7 +416,7 @@ void PairAmoeba::read_keyfile(char *filename)
|
||||
|
||||
const auto words = Tokenizer(trimmed).as_vector();
|
||||
const int nwords = words.size();
|
||||
const auto keyword = words[0];
|
||||
const auto &keyword = words[0];
|
||||
|
||||
if (utils::strmatch(keyword, "^[^a-z]+")) {
|
||||
; // ignore keywords that do not start with text
|
||||
|
||||
@ -43,9 +43,9 @@ void ComputeERotateAsphere::init()
|
||||
{
|
||||
// error check
|
||||
|
||||
avec_ellipsoid = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec_line = dynamic_cast<AtomVecLine *>( atom->style_match("line"));
|
||||
avec_tri = dynamic_cast<AtomVecTri *>( atom->style_match("tri"));
|
||||
avec_ellipsoid = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
avec_line = dynamic_cast<AtomVecLine *>(atom->style_match("line"));
|
||||
avec_tri = dynamic_cast<AtomVecTri *>(atom->style_match("tri"));
|
||||
if (!avec_ellipsoid && !avec_line && !avec_tri)
|
||||
error->all(FLERR,"Compute erotate/asphere requires "
|
||||
"atom style ellipsoid or line or tri");
|
||||
|
||||
@ -94,7 +94,7 @@ void ComputeTempAsphere::init()
|
||||
{
|
||||
// error check
|
||||
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNHAsphere::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,
|
||||
"Compute nvt/nph/npt asphere requires atom style ellipsoid");
|
||||
|
||||
@ -37,7 +37,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNVEAsphere::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ void FixNVEAsphereNoforce::init()
|
||||
{
|
||||
// error check
|
||||
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!atom->ellipsoid_flag)
|
||||
error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid");
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ void FixNVELine::init()
|
||||
{
|
||||
// error checks
|
||||
|
||||
avec = dynamic_cast<AtomVecLine *>( atom->style_match("line"));
|
||||
avec = dynamic_cast<AtomVecLine *>(atom->style_match("line"));
|
||||
if (!avec) error->all(FLERR,"Fix nve/line requires atom style line");
|
||||
|
||||
if (domain->dimension != 2)
|
||||
|
||||
@ -50,7 +50,7 @@ void FixNVETri::init()
|
||||
{
|
||||
// error checks
|
||||
|
||||
avec = dynamic_cast<AtomVecTri *>( atom->style_match("tri"));
|
||||
avec = dynamic_cast<AtomVecTri *>(atom->style_match("tri"));
|
||||
if (!avec) error->all(FLERR,"Fix nve/tri requires atom style tri");
|
||||
|
||||
if (domain->dimension != 3)
|
||||
|
||||
@ -346,7 +346,7 @@ void PairGayBerne::coeff(int narg, char **arg)
|
||||
|
||||
void PairGayBerne::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
|
||||
|
||||
neighbor->add_request(this,NeighConst::REQ_DEFAULT);
|
||||
|
||||
@ -402,7 +402,7 @@ void PairLineLJ::coeff(int narg, char **arg)
|
||||
|
||||
void PairLineLJ::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecLine *>( atom->style_match("line"));
|
||||
avec = dynamic_cast<AtomVecLine *>(atom->style_match("line"));
|
||||
if (!avec) error->all(FLERR,"Pair line/lj requires atom style line");
|
||||
|
||||
neighbor->add_request(this,NeighConst::REQ_DEFAULT);
|
||||
|
||||
@ -467,7 +467,7 @@ void PairTriLJ::coeff(int narg, char **arg)
|
||||
|
||||
void PairTriLJ::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecTri *>( atom->style_match("tri"));
|
||||
avec = dynamic_cast<AtomVecTri *>(atom->style_match("tri"));
|
||||
if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri");
|
||||
|
||||
neighbor->add_request(this,NeighConst::REQ_DEFAULT);
|
||||
|
||||
@ -39,7 +39,7 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp)
|
||||
// order of fields in a string does not matter
|
||||
// except: fields_data_atom & fields_data_vel must match data file
|
||||
|
||||
fields_grow = {"q", "espin", "eradius", "ervel", "erforce",
|
||||
fields_grow = {"q", "espin", "eradius", "ervel", "erforce",
|
||||
"cs", "csforce", "vforce", "ervelforce", "etag"};
|
||||
fields_copy = {"q", "espin", "eradius", "ervel", "cs", "etag"};
|
||||
fields_comm = {"eradius"};
|
||||
@ -108,7 +108,7 @@ void AtomVecWavepacket::data_atom_post(int ilocal)
|
||||
int AtomVecWavepacket::property_atom(const std::string &name)
|
||||
{
|
||||
if (name == "espin") return 0;
|
||||
if (name == "spin") return 0; // backward compatibility
|
||||
if (name == "spin") return 0; // backward compatibility
|
||||
if (name == "eradius") return 1;
|
||||
if (name == "ervel") return 2;
|
||||
if (name == "erforce") return 3;
|
||||
|
||||
@ -61,7 +61,7 @@ void FixNVEAwpmd::init()
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
|
||||
awpmd_pair=dynamic_cast<PairAWPMDCut *>(force->pair);
|
||||
awpmd_pair->wpmd->norm_needed=1;
|
||||
|
||||
@ -491,7 +491,7 @@ void FixBocs::init()
|
||||
{
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
int *dimflag = (dynamic_cast<FixDeform *>( modify->fix[i]))->dimflag;
|
||||
int *dimflag = (dynamic_cast<FixDeform *>(modify->fix[i]))->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
|
||||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
|
||||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
|
||||
@ -591,8 +591,8 @@ void FixBocs::init()
|
||||
else kspace_flag = 0;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
dto = 0.5*step_respa[0];
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) :
|
||||
}
|
||||
}
|
||||
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec) error->all(FLERR,"Compute body/local requires atom style body");
|
||||
bptr = avec->bptr;
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ void ComputeTempBody::init()
|
||||
{
|
||||
// error check
|
||||
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute temp/body requires atom style body");
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ FixNHBody::FixNHBody(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNHBody::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec)
|
||||
error->all(FLERR,
|
||||
"Compute nvt/nph/npt body requires atom style body");
|
||||
|
||||
@ -30,7 +30,7 @@ FixNVEBody::FixNVEBody(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNVEBody::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec) error->all(FLERR,"Fix nve/body requires atom style body");
|
||||
|
||||
// check that all particles are bodies
|
||||
|
||||
@ -179,13 +179,13 @@ void FixWallBodyPolygon::init()
|
||||
{
|
||||
dt = update->dt;
|
||||
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Pair body/rounded/polygon requires atom style body");
|
||||
if (strcmp(avec->bptr->style,"rounded/polygon") != 0)
|
||||
error->all(FLERR,"Pair body/rounded/polygon requires "
|
||||
"body style rounded/polygon");
|
||||
bptr = dynamic_cast<BodyRoundedPolygon *>( avec->bptr);
|
||||
bptr = dynamic_cast<BodyRoundedPolygon *>(avec->bptr);
|
||||
|
||||
// set pairstyle from body/polygonular pair style
|
||||
|
||||
|
||||
@ -184,13 +184,13 @@ void FixWallBodyPolyhedron::init()
|
||||
{
|
||||
dt = update->dt;
|
||||
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Pair body/rounded/polyhedron requires atom style body");
|
||||
if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0)
|
||||
error->all(FLERR,"Pair body/rounded/polyhedron requires "
|
||||
"body style rounded/polyhedron");
|
||||
bptr = dynamic_cast<BodyRoundedPolyhedron *>( avec->bptr);
|
||||
bptr = dynamic_cast<BodyRoundedPolyhedron *>(avec->bptr);
|
||||
|
||||
// set pairstyle from body/polyhedronular pair style
|
||||
|
||||
|
||||
@ -416,11 +416,11 @@ void PairBodyNparticle::coeff(int narg, char **arg)
|
||||
|
||||
void PairBodyNparticle::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec) error->all(FLERR,"Pair body/nparticle requires atom style body");
|
||||
if (strcmp(avec->bptr->style,"nparticle") != 0)
|
||||
error->all(FLERR,"Pair body/nparticle requires body style nparticle");
|
||||
bptr = dynamic_cast<BodyNparticle *>( avec->bptr);
|
||||
bptr = dynamic_cast<BodyNparticle *>(avec->bptr);
|
||||
|
||||
neighbor->add_request(this);
|
||||
}
|
||||
|
||||
@ -411,13 +411,13 @@ void PairBodyRoundedPolygon::coeff(int narg, char **arg)
|
||||
|
||||
void PairBodyRoundedPolygon::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Pair body/rounded/polygon requires atom style body");
|
||||
if (strcmp(avec->bptr->style,"rounded/polygon") != 0)
|
||||
error->all(FLERR,"Pair body/rounded/polygon requires "
|
||||
"body style rounded/polygon");
|
||||
bptr = dynamic_cast<BodyRoundedPolygon *>( avec->bptr);
|
||||
bptr = dynamic_cast<BodyRoundedPolygon *>(avec->bptr);
|
||||
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style body/rounded/polygon requires "
|
||||
|
||||
@ -390,13 +390,13 @@ void PairBodyRoundedPolyhedron::coeff(int narg, char **arg)
|
||||
|
||||
void PairBodyRoundedPolyhedron::init_style()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecBody *>( atom->style_match("body"));
|
||||
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
|
||||
if (!avec) error->all(FLERR,"Pair body/rounded/polyhedron requires "
|
||||
"atom style body");
|
||||
if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0)
|
||||
error->all(FLERR,"Pair body/rounded/polyhedron requires "
|
||||
"body style rounded/polyhedron");
|
||||
bptr = dynamic_cast<BodyRoundedPolyhedron *>( avec->bptr);
|
||||
bptr = dynamic_cast<BodyRoundedPolyhedron *>(avec->bptr);
|
||||
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style body/rounded/polyhedron requires "
|
||||
|
||||
@ -84,9 +84,9 @@ void BondBPM::init_style()
|
||||
{
|
||||
if (id_fix_store_local) {
|
||||
auto ifix = modify->get_fix_by_id(id_fix_store_local);
|
||||
if (!ifix) error->all(FLERR, "Cannot find fix STORE/LOCAL id {}",id_fix_store_local);
|
||||
if (!ifix) error->all(FLERR, "Cannot find fix STORE/LOCAL id {}", id_fix_store_local);
|
||||
if (strcmp(ifix->style, "STORE/LOCAL") != 0)
|
||||
error->all(FLERR, "Incorrect fix style matched, not STORE/LOCAL: {}",ifix->style);
|
||||
error->all(FLERR, "Incorrect fix style matched, not STORE/LOCAL: {}", ifix->style);
|
||||
fix_store_local = dynamic_cast<FixStoreLocal *>(ifix);
|
||||
fix_store_local->nvalues = nvalues;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ void FixBrownian::initial_integrate(int /*vflag */)
|
||||
initial_integrate_templated<1, 0, 0>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -126,4 +126,4 @@ template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D> void FixBrownian::initial_int
|
||||
v[i][2] = dz / dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ void FixBrownianAsphere::initial_integrate(int /*vflag */)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -296,5 +296,4 @@ void FixBrownianAsphere::initial_integrate_templated()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ void FixBrownianSphere::initial_integrate(int /*vflag */)
|
||||
initial_integrate_templated<1, 0, 0, 0>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ FixNVEDot::FixNVEDot(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNVEDot::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute nve/dot requires atom style ellipsoid");
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ void FixNVEDotcLangevin::init()
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
|
||||
if (!avec)
|
||||
error->all(FLERR,"Fix nve/dotc/langevin requires atom style ellipsoid");
|
||||
|
||||
@ -139,7 +139,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag)
|
||||
int newton_pair = force->newton_pair;
|
||||
int *alist,*blist,*numneigh,**firstneigh;
|
||||
|
||||
auto avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
auto avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
|
||||
|
||||
@ -362,7 +362,7 @@ void PairBrownianPoly::init_style()
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with pair brownian");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ void PairLubricate::init_style()
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
shearing = flagdeform = 1;
|
||||
if ((dynamic_cast<FixDeform *>( modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using pair lubricate with inconsistent "
|
||||
"fix deform remap option");
|
||||
}
|
||||
@ -572,7 +572,7 @@ void PairLubricate::init_style()
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with pair lubricate");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
}
|
||||
|
||||
@ -1801,7 +1801,7 @@ void PairLubricateU::init_style()
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricateU");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
}
|
||||
|
||||
@ -1165,7 +1165,7 @@ void PairLubricateUPoly::init_style()
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricateU");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,7 +463,7 @@ void PairLubricatePoly::init_style()
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
shearing = flagdeform = 1;
|
||||
if ((dynamic_cast<FixDeform *>( modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using pair lubricate with inconsistent "
|
||||
"fix deform remap option");
|
||||
}
|
||||
@ -473,15 +473,15 @@ void PairLubricatePoly::init_style()
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricate/poly");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
flagwall = 1; // Walls exist
|
||||
if ((dynamic_cast<FixWall *>( modify->fix[i]))->xflag) {
|
||||
if ((dynamic_cast<FixWall *>(modify->fix[i]))->xflag) {
|
||||
flagwall = 2; // Moving walls exist
|
||||
wallfix = dynamic_cast<FixWall *>( modify->fix[i]);
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -539,7 +539,7 @@ void PairLubricatePoly::init_style()
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
shearing = 1;
|
||||
if ((dynamic_cast<FixDeform *>( modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using pair lubricate/poly with inconsistent "
|
||||
"fix deform remap option");
|
||||
}
|
||||
|
||||
@ -101,7 +101,8 @@ class colvarproxy_lammps : public colvarproxy {
|
||||
void log(std::string const &message) override;
|
||||
void error(std::string const &message) override;
|
||||
|
||||
cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const override;
|
||||
cvm::rvector position_distance(cvm::atom_pos const &pos1,
|
||||
cvm::atom_pos const &pos2) const override;
|
||||
|
||||
cvm::real rand_gaussian(void) override { return _random->gaussian(); };
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
GzFileWriter::GzFileWriter() : compression_level(Z_BEST_COMPRESSION), gzFp(nullptr) {}
|
||||
GzFileWriter::GzFileWriter() : compression_level(Z_BEST_COMPRESSION), gzFp(nullptr) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
ZstdFileWriter::ZstdFileWriter() :
|
||||
compression_level(0), checksum_flag(1), cctx(nullptr), fp(nullptr)
|
||||
compression_level(0), checksum_flag(1), cctx(nullptr), fp(nullptr)
|
||||
{
|
||||
out_buffer_size = ZSTD_CStreamOutSize();
|
||||
out_buffer = new char[out_buffer_size];
|
||||
|
||||
@ -15,6 +15,10 @@
|
||||
|
||||
#include "atom.h"
|
||||
#include "citeme.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "pair.h"
|
||||
#include "pair_hybrid.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -87,6 +91,43 @@ AtomVecDielectric::AtomVecDielectric(LAMMPS *_lmp) : AtomVec(_lmp)
|
||||
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecDielectric::init()
|
||||
{
|
||||
AtomVec::init();
|
||||
|
||||
// since atom style dielectric modifies the charge q, it will produce incorrect results
|
||||
// with pair styles using coulomb without dielectric support.
|
||||
|
||||
std::string pair_style(force->pair_style);
|
||||
if ((pair_style != "none") && (pair_style != "zero") &&
|
||||
!utils::strmatch(force->pair_style, "/dielectric")) {
|
||||
bool mismatch = false;
|
||||
if (utils::strmatch(force->pair_style, "^reaxff")) mismatch = true;
|
||||
if (utils::strmatch(force->pair_style, "^comb")) mismatch = true;
|
||||
if (utils::strmatch(force->pair_style, "coul")) mismatch = true;
|
||||
if (utils::strmatch(force->pair_style, "tip4p")) mismatch = true;
|
||||
if (utils::strmatch(force->pair_style, "dipole")) mismatch = true;
|
||||
|
||||
if (utils::strmatch(force->pair_style, "^hybrid")) {
|
||||
auto hybrid = dynamic_cast<PairHybrid *>(force->pair);
|
||||
if (hybrid) {
|
||||
for (int i = 0; i < hybrid->nstyles; i++) {
|
||||
if (utils::strmatch(hybrid->keywords[i], "^reaxff")) mismatch = true;
|
||||
if (utils::strmatch(hybrid->keywords[i], "^comb")) mismatch = true;
|
||||
if (utils::strmatch(hybrid->keywords[i], "coul")) mismatch = true;
|
||||
if (utils::strmatch(hybrid->keywords[i], "tip4p")) mismatch = true;
|
||||
if (utils::strmatch(hybrid->keywords[i], "dipole")) mismatch = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mismatch)
|
||||
error->all(FLERR, "Pair style {} is not compatible with atom style {}", pair_style,
|
||||
atom->get_style());
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set local copies of all grow ptrs used by this class, except defaults
|
||||
needed in replicate when 2 atom classes exist and it calls pack_restart()
|
||||
|
||||
@ -31,6 +31,7 @@ class AtomVecDielectric : public AtomVec {
|
||||
public:
|
||||
AtomVecDielectric(class LAMMPS *);
|
||||
|
||||
void init() override;
|
||||
void grow_pointers() override;
|
||||
void create_atom_post(int) override;
|
||||
void data_atom_post(int) override;
|
||||
|
||||
@ -58,7 +58,7 @@ void MSMDielectric::init()
|
||||
{
|
||||
MSM::init();
|
||||
|
||||
avec = dynamic_cast<AtomVecDielectric *>( atom->style_match("dielectric"));
|
||||
avec = dynamic_cast<AtomVecDielectric *>(atom->style_match("dielectric"));
|
||||
if (!avec) error->all(FLERR,"msm/dielectric requires atom style dielectric");
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ static constexpr double EPSILON = 1.0e-6;
|
||||
PairCoulCutDielectric::PairCoulCutDielectric(LAMMPS *_lmp) : PairCoulCut(_lmp), efield(nullptr)
|
||||
{
|
||||
nmax = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -36,11 +36,11 @@ using MathConst::MY_PIS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *_lmp) :
|
||||
PairCoulLong(_lmp), efield(nullptr)
|
||||
PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *_lmp) : PairCoulLong(_lmp), efield(nullptr)
|
||||
{
|
||||
nmax = 0;
|
||||
single_enable = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -176,7 +176,8 @@ void PairCoulLongDielectric::compute(int eflag, int vflag)
|
||||
ecoul = scale[itype][jtype] * qtmp * q[j] * 0.5 * (etmp + eps[j]) * table;
|
||||
}
|
||||
if (factor_coul < 1.0) ecoul -= (1.0 - factor_coul) * prefactor;
|
||||
} else ecoul = 0.0;
|
||||
} else
|
||||
ecoul = 0.0;
|
||||
|
||||
if (evflag) ev_tally_full(i, 0.0, ecoul, fpair_i, delx, dely, delz);
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ PairLJCutCoulCutDielectric::PairLJCutCoulCutDielectric(LAMMPS *_lmp) : PairLJCut
|
||||
efield = nullptr;
|
||||
epot = nullptr;
|
||||
nmax = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -93,15 +94,16 @@ void PairLJCutCoulCutDielectric::compute(int eflag, int vflag)
|
||||
for (ii = 0; ii < inum; ii++) {
|
||||
i = ilist[ii];
|
||||
qtmp = q[i];
|
||||
etmp = eps[i];
|
||||
xtmp = x[i][0];
|
||||
ytmp = x[i][1];
|
||||
ztmp = x[i][2];
|
||||
etmp = eps[i];
|
||||
itype = type[i];
|
||||
jlist = firstneigh[i];
|
||||
jnum = numneigh[i];
|
||||
|
||||
// self term Eq. (55) for I_{ii} and Eq. (52) and in Barros et al
|
||||
|
||||
double curvature_threshold = sqrt(area[i]);
|
||||
if (curvature[i] < curvature_threshold) {
|
||||
double sf = curvature[i] / (4.0 * MY_PIS * curvature_threshold) * area[i] * q[i];
|
||||
@ -157,7 +159,7 @@ void PairLJCutCoulCutDielectric::compute(int eflag, int vflag)
|
||||
|
||||
if (eflag) {
|
||||
if (rsq < cut_coulsq[itype][jtype]) {
|
||||
ecoul = factor_coul * qqrd2e * qtmp * q[j] * 0.5 * (etmp + eps[j]) *rinv;
|
||||
ecoul = factor_coul * qqrd2e * qtmp * q[j] * 0.5 * (etmp + eps[j]) * rinv;
|
||||
} else
|
||||
ecoul = 0.0;
|
||||
if (rsq < cut_ljsq[itype][jtype]) {
|
||||
|
||||
@ -40,6 +40,7 @@ PairLJCutCoulDebyeDielectric::PairLJCutCoulDebyeDielectric(LAMMPS *_lmp) : PairL
|
||||
efield = nullptr;
|
||||
epot = nullptr;
|
||||
nmax = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -45,6 +45,7 @@ PairLJCutCoulLongDielectric::PairLJCutCoulLongDielectric(LAMMPS *_lmp) : PairLJC
|
||||
efield = nullptr;
|
||||
epot = nullptr;
|
||||
nmax = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -47,6 +47,7 @@ PairLJCutCoulMSMDielectric::PairLJCutCoulMSMDielectric(LAMMPS *_lmp) : PairLJCut
|
||||
nmax = 0;
|
||||
ftmp = nullptr;
|
||||
efield = nullptr;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -45,6 +45,7 @@ PairLJLongCoulLongDielectric::PairLJLongCoulLongDielectric(LAMMPS *_lmp) : PairL
|
||||
efield = nullptr;
|
||||
epot = nullptr;
|
||||
nmax = 0;
|
||||
no_virial_fdotr_compute = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -61,7 +61,7 @@ PPPMDielectric::PPPMDielectric(LAMMPS *_lmp) : PPPM(_lmp)
|
||||
// no warnings about non-neutral systems from qsum_qsq()
|
||||
warn_nonneutral = 2;
|
||||
|
||||
avec = dynamic_cast<AtomVecDielectric *>( atom->style_match("dielectric"));
|
||||
avec = dynamic_cast<AtomVecDielectric *>(atom->style_match("dielectric"));
|
||||
if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric");
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ PPPMDispDielectric::PPPMDispDielectric(LAMMPS *_lmp) : PPPMDisp(_lmp)
|
||||
phi = nullptr;
|
||||
potflag = 0;
|
||||
|
||||
avec = dynamic_cast<AtomVecDielectric *>( atom->style_match("dielectric"));
|
||||
avec = dynamic_cast<AtomVecDielectric *>(atom->style_match("dielectric"));
|
||||
if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric");
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,"Compute ID for fix saed/vtk does not exist");
|
||||
|
||||
// Check that specified compute is for SAED
|
||||
compute_saed = dynamic_cast<ComputeSAED *>( modify->compute[icompute]);
|
||||
compute_saed = dynamic_cast<ComputeSAED *>(modify->compute[icompute]);
|
||||
if (strcmp(compute_saed->style,"saed") != 0)
|
||||
error->all(FLERR,"Fix saed/vtk has invalid compute assigned");
|
||||
|
||||
|
||||
@ -30,9 +30,9 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (narg != 3 ) error->all(FLERR,"Illegal fix dpd/energy command");
|
||||
|
||||
pairDPDE = nullptr;
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy",1));
|
||||
if (pairDPDE == nullptr)
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy/kk",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy/kk",1));
|
||||
|
||||
if (pairDPDE == nullptr)
|
||||
error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy");
|
||||
|
||||
@ -319,9 +319,9 @@ void FixRX::post_constructor()
|
||||
newcmd1 += " ghost yes";
|
||||
newcmd2 += " ghost yes";
|
||||
|
||||
fix_species = dynamic_cast<FixPropertyAtom *>( modify->add_fix(newcmd1));
|
||||
fix_species = dynamic_cast<FixPropertyAtom *>(modify->add_fix(newcmd1));
|
||||
restartFlag = fix_species->restart_reset;
|
||||
fix_species_old = dynamic_cast<FixPropertyAtom *>( modify->add_fix(newcmd2));
|
||||
fix_species_old = dynamic_cast<FixPropertyAtom *>(modify->add_fix(newcmd2));
|
||||
|
||||
if (nspecies==0) error->all(FLERR,"There are no rx species specified.");
|
||||
|
||||
@ -579,9 +579,9 @@ int FixRX::setmask()
|
||||
|
||||
void FixRX::init()
|
||||
{
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy",1));
|
||||
if (pairDPDE == nullptr)
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy/kk",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy/kk",1));
|
||||
|
||||
if (pairDPDE == nullptr)
|
||||
error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx");
|
||||
|
||||
@ -94,10 +94,10 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
pairDPD = nullptr;
|
||||
pairDPDE = nullptr;
|
||||
pairDPD = dynamic_cast<PairDPDfdt *>( force->pair_match("dpd/fdt",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy",1));
|
||||
pairDPD = dynamic_cast<PairDPDfdt *>(force->pair_match("dpd/fdt",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy",1));
|
||||
if (pairDPDE == nullptr)
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>( force->pair_match("dpd/fdt/energy/kk",1));
|
||||
pairDPDE = dynamic_cast<PairDPDfdtEnergy *>(force->pair_match("dpd/fdt/energy/kk",1));
|
||||
|
||||
maxRNG = 0;
|
||||
if (pairDPDE) {
|
||||
|
||||
@ -67,7 +67,7 @@ void ComputeTempDrude::init()
|
||||
for (ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
|
||||
if (ifix == modify->nfix) error->all(FLERR, "compute temp/drude requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
|
||||
if (!comm->ghost_velocity)
|
||||
error->all(FLERR,"compute temp/drude requires ghost velocities. Use comm_modify vel yes");
|
||||
|
||||
@ -148,7 +148,7 @@ void FixLangevinDrude::init()
|
||||
for (ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
|
||||
if (ifix == modify->nfix) error->all(FLERR, "fix langevin/drude requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -523,7 +523,7 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) :
|
||||
for (ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
|
||||
if (ifix == modify->nfix) error->all(FLERR, "fix tgnh/drude requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
|
||||
// make sure ghost atoms have velocity
|
||||
if (!comm->ghost_velocity)
|
||||
@ -595,7 +595,7 @@ void FixTGNHDrude::init()
|
||||
if (pstat_flag)
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
int *dimflag = (dynamic_cast<FixDeform *>( modify->fix[i]))->dimflag;
|
||||
int *dimflag = (dynamic_cast<FixDeform *>(modify->fix[i]))->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
|
||||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
|
||||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
|
||||
@ -664,8 +664,8 @@ void FixTGNHDrude::init()
|
||||
else kspace_flag = 0;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
dto = 0.5*step_respa[0];
|
||||
}
|
||||
|
||||
|
||||
@ -289,7 +289,7 @@ void PairCoulTT::init_style()
|
||||
for (ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (utils::strmatch(modify->fix[ifix]->style,"^drude")) break;
|
||||
if (ifix == modify->nfix) error->all(FLERR, "Pair coul/tt requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
|
||||
neighbor->add_request(this);
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ void PairLJCutTholeLong::init_style()
|
||||
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
|
||||
if (ifix == modify->nfix)
|
||||
error->all(FLERR, "Pair style lj/cut/thole/long requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
|
||||
neighbor->add_request(this);
|
||||
|
||||
|
||||
@ -258,7 +258,7 @@ void PairThole::init_style()
|
||||
for (ifix = 0; ifix < modify->nfix; ifix++)
|
||||
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
|
||||
if (ifix == modify->nfix) error->all(FLERR, "Pair thole requires fix drude");
|
||||
fix_drude = dynamic_cast<FixDrude *>( modify->fix[ifix]);
|
||||
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
|
||||
|
||||
neighbor->add_request(this);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ void AtomVecElectron::data_atom_post(int ilocal)
|
||||
int AtomVecElectron::property_atom(const std::string &name)
|
||||
{
|
||||
if (name == "espin") return 0;
|
||||
if (name == "spin") return 0; // backward compatibility
|
||||
if (name == "spin") return 0; // backward compatibility
|
||||
if (name == "eradius") return 1;
|
||||
if (name == "ervel") return 2;
|
||||
if (name == "erforce") return 3;
|
||||
|
||||
@ -74,7 +74,7 @@ void ComputeTempDeformEff::init()
|
||||
int i;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
if ((dynamic_cast<FixDeform *>( modify->fix[i]))->remapflag == Domain::X_REMAP &&
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag == Domain::X_REMAP &&
|
||||
comm->me == 0)
|
||||
error->warning(FLERR,"Using compute temp/deform/eff with inconsistent "
|
||||
"fix deform remap option");
|
||||
|
||||
@ -59,7 +59,7 @@ void FixNVEEff::init()
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -70,7 +70,7 @@ void FixNVTSllodEff::init()
|
||||
int i;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
|
||||
if ((dynamic_cast<FixDeform *>( modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
|
||||
"remap option");
|
||||
break;
|
||||
|
||||
@ -57,8 +57,9 @@ ElectrodeVector::~ElectrodeVector()
|
||||
utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total));
|
||||
utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total));
|
||||
utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total));
|
||||
utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total));
|
||||
} catch (std::exception &) {}
|
||||
utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total));
|
||||
} catch (std::exception &) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1058,7 +1058,8 @@ FixElectrodeConp::~FixElectrodeConp()
|
||||
try {
|
||||
utils::logmesg(lmp, fmt::format("Multiplication time: {:.4g} s\n", mult_time));
|
||||
utils::logmesg(lmp, fmt::format("Update time: {:.4g} s\n", update_time));
|
||||
} catch (std::exception &) {}
|
||||
} catch (std::exception &) {
|
||||
}
|
||||
}
|
||||
if (!modify->get_fix_by_id(id)) // avoid segfault if derived fixes' ctor throws err
|
||||
atom->delete_callback(id, Atom::GROW); // atomvec track local electrode atoms
|
||||
@ -1107,7 +1108,7 @@ void FixElectrodeConp::write_to_file(FILE *file, const std::vector<tagint> &tags
|
||||
|
||||
/*----------------------------------------------------------------------- */
|
||||
|
||||
void FixElectrodeConp::read_from_file(const std::string& input_file, double **array,
|
||||
void FixElectrodeConp::read_from_file(const std::string &input_file, double **array,
|
||||
const std::string &filetype)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
|
||||
@ -101,7 +101,7 @@ class FixElectrodeConp : public Fix {
|
||||
double potential_energy(int);
|
||||
double self_energy(int);
|
||||
void write_to_file(FILE *, const std::vector<tagint> &, const std::vector<std::vector<double>> &);
|
||||
void read_from_file(const std::string& input_file, double **, const std::string &);
|
||||
void read_from_file(const std::string &input_file, double **, const std::string &);
|
||||
void compute_sd_vectors();
|
||||
void compute_sd_vectors_ffield();
|
||||
std::vector<int> setvars_types, setvars_groups, setvars_vars;
|
||||
|
||||
@ -55,7 +55,7 @@ FixElectrodeThermo::FixElectrodeThermo(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
FixElectrodeThermo::~FixElectrodeThermo()
|
||||
{
|
||||
delete thermo_random;
|
||||
delete thermo_random;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
@ -130,7 +130,7 @@ void FixAddTorque::init()
|
||||
else varflag = CONSTANT;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
}
|
||||
@ -142,9 +142,9 @@ void FixAddTorque::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ int FixDrag::setmask()
|
||||
void FixDrag::init()
|
||||
{
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
}
|
||||
@ -83,9 +83,9 @@ void FixDrag::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -139,9 +139,9 @@ void FixElectronStoppingFit::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -158,8 +158,8 @@ void FixFFL::init() {
|
||||
}
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
init_ffl();
|
||||
@ -182,9 +182,9 @@ void FixFFL::setup(int vflag) {
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -279,7 +279,7 @@ void FixFilterCorotate::init()
|
||||
// set ptrs to rRESPA variables
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
}
|
||||
else error->all(FLERR,"Fix filter/corotate requires rRESPA!");
|
||||
|
||||
@ -656,9 +656,9 @@ void FixFilterCorotate::pre_neighbor()
|
||||
|
||||
void FixFilterCorotate::setup(int vflag)
|
||||
{
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
|
||||
void FixFilterCorotate::setup_pre_force_respa(int vflag,int ilevel) {
|
||||
|
||||
@ -123,7 +123,7 @@ void FixFlowGauss::init()
|
||||
//if respa level specified by fix_modify, then override default (outermost)
|
||||
//if specified level too high, set to max level
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0)
|
||||
ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
@ -146,9 +146,9 @@ void FixFlowGauss::setup(int vflag)
|
||||
error->all(FLERR,"Invalid group mass in fix flow/gauss");
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
else
|
||||
post_force(vflag);
|
||||
|
||||
@ -197,7 +197,7 @@ void FixGLD::init()
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -356,8 +356,8 @@ void FixGLE::init()
|
||||
}
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
init_gle();
|
||||
@ -443,9 +443,9 @@ void FixGLE::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ void FixMomentumChunk::init()
|
||||
int icompute = modify->find_compute(id_chunk);
|
||||
if (icompute < 0)
|
||||
error->all(FLERR,"Chunk/atom compute does not exist for fix momentum/chunk");
|
||||
cchunk = dynamic_cast<ComputeChunkAtom *>( modify->compute[icompute]);
|
||||
cchunk = dynamic_cast<ComputeChunkAtom *>(modify->compute[icompute]);
|
||||
if (strcmp(cchunk->style,"chunk/atom") != 0)
|
||||
error->all(FLERR,"Fix momentum/chunk does not use chunk/atom compute");
|
||||
|
||||
@ -122,7 +122,7 @@ void FixMomentumChunk::init()
|
||||
auto cmd = fmt::format("{} {} com/chunk {}",id_com,group->names[igroup],id_chunk);
|
||||
modify->add_compute(cmd);
|
||||
icompute = modify->find_compute(id_com);
|
||||
ccom = dynamic_cast<ComputeCOMChunk *>( modify->compute[icompute]);
|
||||
ccom = dynamic_cast<ComputeCOMChunk *>(modify->compute[icompute]);
|
||||
|
||||
id_vcm = id + id_chunk + "_vcm";
|
||||
icompute = modify->find_compute(id_vcm);
|
||||
|
||||
@ -680,7 +680,7 @@ void FixNPTCauchy::init()
|
||||
if (pstat_flag)
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
int *dimflag = (dynamic_cast<FixDeform *>( modify->fix[i]))->dimflag;
|
||||
int *dimflag = (dynamic_cast<FixDeform *>(modify->fix[i]))->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
|
||||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
|
||||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
|
||||
@ -753,8 +753,8 @@ void FixNPTCauchy::init()
|
||||
else kspace_flag = 0;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
dto = 0.5*step_respa[0];
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ void FixNVK::init()
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
error->all(FLERR,"Fix nvk not yet enabled for RESPA");
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
// compute initial kinetic energy
|
||||
|
||||
@ -178,8 +178,8 @@ void FixPAFI::init()
|
||||
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step; // nve
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step; // nve
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1);
|
||||
else ilevel_respa = nlevels_respa-1;
|
||||
}
|
||||
@ -192,9 +192,9 @@ void FixPAFI::setup(int vflag)
|
||||
post_force(vflag);
|
||||
else
|
||||
for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel);
|
||||
post_force_respa(vflag,ilevel,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ void FixRhok::init()
|
||||
{
|
||||
// RESPA boilerplate
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
mNLevelsRESPA = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
mNLevelsRESPA = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
|
||||
// Count the number of affected particles
|
||||
int nThisLocal = 0;
|
||||
@ -121,9 +121,9 @@ void FixRhok::setup( int inVFlag )
|
||||
post_force( inVFlag );
|
||||
else
|
||||
{
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f( mNLevelsRESPA - 1 );
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f( mNLevelsRESPA - 1 );
|
||||
post_force_respa( inVFlag, mNLevelsRESPA - 1,0 );
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel( mNLevelsRESPA - 1 );
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel( mNLevelsRESPA - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ void FixSMD::init()
|
||||
}
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
}
|
||||
@ -173,9 +173,9 @@ void FixSMD::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ void FixSMD::post_force(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
r_old += v_smd * update->dt;
|
||||
else
|
||||
r_old += v_smd * (dynamic_cast<Respa *>( update->integrate))->step[ilevel_respa];
|
||||
r_old += v_smd * (dynamic_cast<Respa *>(update->integrate))->step[ilevel_respa];
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ void FixSMD::smd_tether()
|
||||
|
||||
double dt = update->dt;
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
dt = (dynamic_cast<Respa *>( update->integrate))->step[ilevel_respa];
|
||||
dt = (dynamic_cast<Respa *>(update->integrate))->step[ilevel_respa];
|
||||
|
||||
// fx,fy,fz = components of k * (r-r0)
|
||||
|
||||
@ -313,7 +313,7 @@ void FixSMD::smd_couple()
|
||||
|
||||
double dt = update->dt;
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
dt = (dynamic_cast<Respa *>( update->integrate))->step[ilevel_respa];
|
||||
dt = (dynamic_cast<Respa *>(update->integrate))->step[ilevel_respa];
|
||||
|
||||
// renormalize direction of spring
|
||||
double dx,dy,dz,r,dr;
|
||||
|
||||
@ -79,7 +79,7 @@ void FixSpringRG::init()
|
||||
}
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
}
|
||||
@ -91,9 +91,9 @@ void FixSpringRG::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ int FixTISpring::setmask()
|
||||
void FixTISpring::init()
|
||||
{
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -153,9 +153,9 @@ void FixTISpring::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ void FixTMD::init()
|
||||
dtv = update->dt;
|
||||
dtf = update->dt * force->ftm2v;
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
step_respa = (dynamic_cast<Respa *>( update->integrate))->step;
|
||||
step_respa = (dynamic_cast<Respa *>(update->integrate))->step;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -241,7 +241,7 @@ void FixTTM::init()
|
||||
}
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -251,9 +251,9 @@ void FixTTM::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet")) {
|
||||
post_force_setup(vflag);
|
||||
} else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa_setup(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ void FixTTMMod::init()
|
||||
net_energy_transfer_all[ix][iy][iz] = 0;
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -281,9 +281,9 @@ void FixTTMMod::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet")) {
|
||||
post_force_setup(vflag);
|
||||
} else {
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa_setup(vflag,nlevels_respa-1,0);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ void FixWallEES::precompute(int m)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void FixWallEES::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Fix wall/ees requires atom style ellipsoid");
|
||||
|
||||
@ -85,7 +85,7 @@ void FixWallEES::wall_particle(int m, int which, double coord)
|
||||
double **f = atom->f;
|
||||
double **tor = atom->torque;
|
||||
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
int *mask = atom->mask;
|
||||
|
||||
40
src/EXTRA-MOLECULE/Install.sh
Normal file
40
src/EXTRA-MOLECULE/Install.sh
Normal file
@ -0,0 +1,40 @@
|
||||
# Install/unInstall package files in LAMMPS
|
||||
# mode = 0/1/2 for uninstall/install/update
|
||||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
elif (! cmp -s $1 ../$1) then
|
||||
if (test -z "$2" || test -e ../$2) then
|
||||
cp $1 ..
|
||||
if (test $mode = 2) then
|
||||
echo " updating src/$1"
|
||||
fi
|
||||
fi
|
||||
elif (test -n "$2") then
|
||||
if (test ! -e ../$2) then
|
||||
rm -f ../$1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# some styles in EXTRA-MOLECULE have base classes in MOLECULE
|
||||
|
||||
if (test $1 = 1) then
|
||||
if (test ! -e ../bond_fene.cpp) then
|
||||
echo "Must install MOLECULE package with EXTRA-MOLECULE package"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
for file in *.cpp *.h; do
|
||||
action ${file}
|
||||
done
|
||||
@ -487,7 +487,7 @@ void PairLJ96Cut::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -496,8 +496,8 @@ void PairLJ96Cut::init_style()
|
||||
// set rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
else cut_respa = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -688,7 +688,7 @@ void PairLJExpandCoulLong::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -699,8 +699,8 @@ void PairLJExpandCoulLong::init_style()
|
||||
// set rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
else cut_respa = nullptr;
|
||||
|
||||
// insure use of KSpace long-range solver, set g_ewald
|
||||
|
||||
@ -499,7 +499,7 @@ void PairMIECut::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -508,8 +508,8 @@ void PairMIECut::init_style()
|
||||
// set rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
else cut_respa = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ void FixAdaptFEP::init()
|
||||
|
||||
if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 ||
|
||||
strcmp(force->pair_style,"hybrid/overlay") == 0)) {
|
||||
auto pair = dynamic_cast<PairHybrid *>( force->pair);
|
||||
auto pair = dynamic_cast<PairHybrid *>(force->pair);
|
||||
for (i = ad->ilo; i <= ad->ihi; i++)
|
||||
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
|
||||
if (!pair->check_ijtype(i,j,ad->pstyle))
|
||||
|
||||
@ -692,7 +692,7 @@ void PairLJCharmmCoulLongSoft::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -714,8 +714,8 @@ void PairLJCharmmCoulLongSoft::init_style()
|
||||
// set & error check interior rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0) {
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0) {
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
if (MIN(cut_lj,cut_coul) < cut_respa[3])
|
||||
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
|
||||
if (cut_lj_inner < cut_respa[1])
|
||||
|
||||
@ -635,7 +635,7 @@ void PairLJCutCoulLongSoft::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -646,8 +646,8 @@ void PairLJCutCoulLongSoft::init_style()
|
||||
// set rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
else cut_respa = nullptr;
|
||||
|
||||
// insure use of KSpace long-range solver, set g_ewald
|
||||
|
||||
@ -513,7 +513,7 @@ void PairLJCutSoft::init_style()
|
||||
int list_style = NeighConst::REQ_DEFAULT;
|
||||
|
||||
if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) {
|
||||
auto respa = dynamic_cast<Respa *>( update->integrate);
|
||||
auto respa = dynamic_cast<Respa *>(update->integrate);
|
||||
if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT;
|
||||
if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL;
|
||||
}
|
||||
@ -522,8 +522,8 @@ void PairLJCutSoft::init_style()
|
||||
// set rRESPA cutoffs
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa") &&
|
||||
(dynamic_cast<Respa *>( update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>( update->integrate))->cutoff;
|
||||
(dynamic_cast<Respa *>(update->integrate))->level_inner >= 0)
|
||||
cut_respa = (dynamic_cast<Respa *>(update->integrate))->cutoff;
|
||||
else cut_respa = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ void FixGPU::init()
|
||||
// rRESPA support
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
_nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
|
||||
_nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -308,9 +308,9 @@ void FixGPU::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag);
|
||||
else {
|
||||
// In setup only, all forces calculated on GPU are put in the outer level
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(_nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_flevel_f(_nlevels_respa-1);
|
||||
post_force(vflag);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(_nlevels_respa-1);
|
||||
(dynamic_cast<Respa *>(update->integrate))->copy_f_flevel(_nlevels_respa-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ FixNVEAsphereGPU::FixNVEAsphereGPU(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
void FixNVEAsphereGPU::init()
|
||||
{
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>( atom->style_match("ellipsoid"));
|
||||
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ void PairLJCutTIP4PLongGPU::init_style()
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
double cut_coulplus = cut_coul + qdist + blen;
|
||||
double cut_coulsqplus = cut_coulplus*cut_coulplus;
|
||||
double cut_coulsqplus = cut_coulplus * cut_coulplus;
|
||||
if (maxcut < cut_coulsqplus) { cell_size = cut_coulplus + neighbor->skin; }
|
||||
if (comm->cutghostuser < cell_size) {
|
||||
if (comm->me == 0)
|
||||
|
||||
@ -42,23 +42,23 @@ using namespace LAMMPS_NS;
|
||||
// External functions from cuda library for atom decomposition
|
||||
|
||||
int spical_gpu_init(const int ntypes, double **cutsq, int **lj_type, double **host_lj1,
|
||||
double **host_lj2, double **host_lj3, double **host_lj4, double **offset,
|
||||
double *special_lj, const int nlocal, const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen,
|
||||
double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul,
|
||||
const double qqrd2e, const double g_ewald);
|
||||
double **host_lj2, double **host_lj3, double **host_lj4, double **offset,
|
||||
double *special_lj, const int nlocal, const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen,
|
||||
double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul,
|
||||
const double qqrd2e, const double g_ewald);
|
||||
void spical_gpu_clear();
|
||||
int **spical_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x,
|
||||
int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial,
|
||||
tagint **special, const bool eflag, const bool vflag, const bool eatom,
|
||||
const bool vatom, int &host_start, int **ilist, int **jnum,
|
||||
const double cpu_time, bool &success, double *host_q, double *boxlo,
|
||||
double *prd);
|
||||
int *host_type, double *sublo, double *subhi, tagint *tag,
|
||||
int **nspecial, tagint **special, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start, int **ilist,
|
||||
int **jnum, const double cpu_time, bool &success, double *host_q,
|
||||
double *boxlo, double *prd);
|
||||
void spical_gpu_compute(const int ago, const int inum, const int nall, double **host_x,
|
||||
int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag,
|
||||
const bool vflag, const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, double *host_q, const int nlocal,
|
||||
double *boxlo, double *prd);
|
||||
int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag,
|
||||
const bool vflag, const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, double *host_q, const int nlocal,
|
||||
double *boxlo, double *prd);
|
||||
double spical_gpu_bytes();
|
||||
|
||||
#include "lj_spica_common.h"
|
||||
@ -111,17 +111,17 @@ void PairLJSPICACoulLongGPU::compute(int eflag, int vflag)
|
||||
}
|
||||
inum = atom->nlocal;
|
||||
firstneigh = spical_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi,
|
||||
atom->tag, atom->nspecial, atom->special, eflag, vflag,
|
||||
eflag_atom, vflag_atom, host_start, &ilist, &numneigh, cpu_time,
|
||||
success, atom->q, domain->boxlo, domain->prd);
|
||||
atom->tag, atom->nspecial, atom->special, eflag, vflag,
|
||||
eflag_atom, vflag_atom, host_start, &ilist, &numneigh,
|
||||
cpu_time, success, atom->q, domain->boxlo, domain->prd);
|
||||
} else {
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
firstneigh = list->firstneigh;
|
||||
spical_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh,
|
||||
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success, atom->q,
|
||||
atom->nlocal, domain->boxlo, domain->prd);
|
||||
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success, atom->q,
|
||||
atom->nlocal, domain->boxlo, domain->prd);
|
||||
}
|
||||
if (!success) error->one(FLERR, "Insufficient memory on accelerator");
|
||||
|
||||
@ -144,7 +144,8 @@ void PairLJSPICACoulLongGPU::compute(int eflag, int vflag)
|
||||
|
||||
void PairLJSPICACoulLongGPU::init_style()
|
||||
{
|
||||
if (!atom->q_flag) error->all(FLERR, "Pair style lj/spica/coul/long/gpu requires atom attribute q");
|
||||
if (!atom->q_flag)
|
||||
error->all(FLERR, "Pair style lj/spica/coul/long/gpu requires atom attribute q");
|
||||
|
||||
// Repeat cutsq calculation because done after call to init_style
|
||||
double maxcut = -1.0;
|
||||
@ -176,10 +177,10 @@ void PairLJSPICACoulLongGPU::init_style()
|
||||
int maxspecial = 0;
|
||||
if (atom->molecular != Atom::ATOMIC) maxspecial = atom->maxspecial;
|
||||
int mnf = 5e-2 * neighbor->oneatom;
|
||||
int success =
|
||||
spical_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj,
|
||||
atom->nlocal, atom->nlocal + atom->nghost, mnf, maxspecial, cell_size, gpu_mode,
|
||||
screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald);
|
||||
int success = spical_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset,
|
||||
force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf,
|
||||
maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq,
|
||||
force->special_coul, force->qqrd2e, g_ewald);
|
||||
GPU_EXTRA::check_flag(success, error, world);
|
||||
|
||||
if (gpu_mode == GPU_FORCE) neighbor->add_request(this, NeighConst::REQ_FULL);
|
||||
@ -196,7 +197,7 @@ double PairLJSPICACoulLongGPU::memory_usage()
|
||||
/* ---------------------------------------------------------------------- */
|
||||
template <int EVFLAG, int EFLAG>
|
||||
void PairLJSPICACoulLongGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh,
|
||||
int **firstneigh)
|
||||
int **firstneigh)
|
||||
{
|
||||
int i, j, ii, jj;
|
||||
double qtmp, xtmp, ytmp, ztmp;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user