clang-format apip package.
This commit is contained in:
@ -25,8 +25,8 @@ AtomVecApip::AtomVecApip(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
mass_type = PER_TYPE;
|
mass_type = PER_TYPE;
|
||||||
forceclearflag = 1;
|
forceclearflag = 1;
|
||||||
|
|
||||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_input_ta, *apip_lambda_const, *apip_e_fast, *apip_e_precise,
|
double *apip_lambda, *apip_lambda_input, *apip_lambda_input_ta, *apip_lambda_const, *apip_e_fast,
|
||||||
**apip_f_const_lambda, **apip_f_dyn_lambda;
|
*apip_e_precise, **apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||||
int *apip_lambda_required;
|
int *apip_lambda_required;
|
||||||
atom->apip_lambda_flag = 1;
|
atom->apip_lambda_flag = 1;
|
||||||
atom->apip_lambda_input_flag = 1;
|
atom->apip_lambda_input_flag = 1;
|
||||||
@ -44,17 +44,23 @@ AtomVecApip::AtomVecApip(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
// except: fields_data_atom & fields_data_vel must match data file
|
// except: fields_data_atom & fields_data_vel must match data file
|
||||||
|
|
||||||
// The full list of fields is in atom_vec.cpp
|
// The full list of fields is in atom_vec.cpp
|
||||||
fields_copy = {"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta", "apip_lambda_const"};
|
fields_copy = {"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta",
|
||||||
fields_comm = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta", "apip_lambda_const"};
|
"apip_lambda_const"};
|
||||||
|
fields_comm = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta",
|
||||||
|
"apip_lambda_const"};
|
||||||
fields_comm_vel = {};
|
fields_comm_vel = {};
|
||||||
fields_border = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta", "apip_lambda_const"};
|
fields_border = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta",
|
||||||
|
"apip_lambda_const"};
|
||||||
fields_border_vel = {};
|
fields_border_vel = {};
|
||||||
fields_exchange = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta", "apip_lambda_const"};
|
fields_exchange = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta",
|
||||||
fields_restart = {"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta", "apip_lambda_const"};
|
"apip_lambda_const"};
|
||||||
|
fields_restart = {"apip_lambda", "apip_lambda_required", "apip_lambda_input",
|
||||||
|
"apip_lambda_input_ta", "apip_lambda_const"};
|
||||||
fields_create = {};
|
fields_create = {};
|
||||||
fields_grow = {
|
fields_grow = {
|
||||||
"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta", "apip_lambda_const",
|
"apip_lambda", "apip_lambda_required", "apip_lambda_input",
|
||||||
"apip_e_fast", "apip_e_precise", "apip_f_const_lambda", "apip_f_dyn_lambda"}; // allocates memory
|
"apip_lambda_input_ta", "apip_lambda_const", "apip_e_fast",
|
||||||
|
"apip_e_precise", "apip_f_const_lambda", "apip_f_dyn_lambda"}; // allocates memory
|
||||||
fields_reverse = {"apip_f_const_lambda",
|
fields_reverse = {"apip_f_const_lambda",
|
||||||
"apip_f_dyn_lambda"}; // communication of force after calculation
|
"apip_f_dyn_lambda"}; // communication of force after calculation
|
||||||
fields_data_atom = {"id", "type", "x"};
|
fields_data_atom = {"id", "type", "x"};
|
||||||
|
|||||||
@ -34,8 +34,8 @@ class AtomVecApip : public AtomVec {
|
|||||||
void data_atom_post(int) override;
|
void data_atom_post(int) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_const, *apip_lambda_input_ta, *apip_e_fast, *apip_e_precise,
|
double *apip_lambda, *apip_lambda_input, *apip_lambda_const, *apip_lambda_input_ta, *apip_e_fast,
|
||||||
**apip_f_const_lambda, **apip_f_dyn_lambda;
|
*apip_e_precise, **apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||||
int *apip_lambda_required;
|
int *apip_lambda_required;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -154,7 +154,9 @@ FixLambdaAPIP::FixLambdaAPIP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (!atom->apip_lambda_const_flag) {
|
if (!atom->apip_lambda_const_flag) {
|
||||||
error->all(FLERR, "fix lambda requires atomic style with lambda_const.");
|
error->all(FLERR, "fix lambda requires atomic style with lambda_const.");
|
||||||
}
|
}
|
||||||
if (!atom->apip_lambda_flag) { error->all(FLERR, "fix lambda requires atomic style with lambda."); }
|
if (!atom->apip_lambda_flag) {
|
||||||
|
error->all(FLERR, "fix lambda requires atomic style with lambda.");
|
||||||
|
}
|
||||||
if (!atom->apip_lambda_input_flag) {
|
if (!atom->apip_lambda_input_flag) {
|
||||||
error->all(FLERR, "fix lambda requires atomic style with lambda_input.");
|
error->all(FLERR, "fix lambda requires atomic style with lambda_input.");
|
||||||
}
|
}
|
||||||
@ -243,9 +245,9 @@ void FixLambdaAPIP::init()
|
|||||||
|
|
||||||
// warn if there is no fix lambda_thermostat/apip
|
// warn if there is no fix lambda_thermostat/apip
|
||||||
if (comm->me == 0 && modify->get_fix_by_style("lambda_thermostat/apip").size() == 0)
|
if (comm->me == 0 && modify->get_fix_by_style("lambda_thermostat/apip").size() == 0)
|
||||||
error->warning(
|
error->warning(FLERR,
|
||||||
FLERR,
|
"The energy is not conserved when lambda changes as fix lambda_thermostat/apip "
|
||||||
"The energy is not conserved when lambda changes as fix lambda_thermostat/apip is not used.");
|
"is not used.");
|
||||||
|
|
||||||
Pair *pair_tmp;
|
Pair *pair_tmp;
|
||||||
// lambda_input
|
// lambda_input
|
||||||
|
|||||||
@ -60,7 +60,8 @@ FixLambdaThermostatAPIP::FixLambdaThermostatAPIP(LAMMPS *lmp, int narg, char **a
|
|||||||
for (int iarg = 3; iarg < narg; iarg++) {
|
for (int iarg = 3; iarg < narg; iarg++) {
|
||||||
|
|
||||||
if (strcmp(arg[iarg], "seed") == 0) {
|
if (strcmp(arg[iarg], "seed") == 0) {
|
||||||
if (iarg + 1 >= narg) error->all(FLERR, "fix lambda_thermostat/apip: seed requires one argument");
|
if (iarg + 1 >= narg)
|
||||||
|
error->all(FLERR, "fix lambda_thermostat/apip: seed requires one argument");
|
||||||
seed = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
seed = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
if (seed <= 0) { error->all(FLERR, "fix lambda_thermostat/apip seed <= 0"); }
|
if (seed <= 0) { error->all(FLERR, "fix lambda_thermostat/apip seed <= 0"); }
|
||||||
iarg++;
|
iarg++;
|
||||||
@ -124,7 +125,8 @@ FixLambdaThermostatAPIP::FixLambdaThermostatAPIP(LAMMPS *lmp, int narg, char **a
|
|||||||
// zero the array since a variable may access it before first run
|
// zero the array since a variable may access it before first run
|
||||||
|
|
||||||
nmax_stats = atom->nmax;
|
nmax_stats = atom->nmax;
|
||||||
memory->create(peratom_stats, nmax_stats, size_peratom_cols, "lambda_thermostat/apip:peratom_stats");
|
memory->create(peratom_stats, nmax_stats, size_peratom_cols,
|
||||||
|
"lambda_thermostat/apip:peratom_stats");
|
||||||
array_atom = peratom_stats;
|
array_atom = peratom_stats;
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
@ -173,7 +175,8 @@ void FixLambdaThermostatAPIP::init()
|
|||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (int i = 0; i < modify->nfix; i++)
|
for (int i = 0; i < modify->nfix; i++)
|
||||||
if (strcmp(modify->fix[i]->style, "lambda_thermostat/apip") == 0) counter++;
|
if (strcmp(modify->fix[i]->style, "lambda_thermostat/apip") == 0) counter++;
|
||||||
if (counter > 1) error->all(FLERR, "fix lambda_thermostat/apip: more than one fix lambda_thermostat/apip");
|
if (counter > 1)
|
||||||
|
error->all(FLERR, "fix lambda_thermostat/apip: more than one fix lambda_thermostat/apip");
|
||||||
|
|
||||||
// local neighbor list
|
// local neighbor list
|
||||||
// create pages if first time or if neighbor pgsize/oneatom has changed
|
// create pages if first time or if neighbor pgsize/oneatom has changed
|
||||||
@ -308,7 +311,8 @@ void FixLambdaThermostatAPIP::init_peratom_stats()
|
|||||||
if (atom->nmax > nmax_stats) {
|
if (atom->nmax > nmax_stats) {
|
||||||
memory->destroy(peratom_stats);
|
memory->destroy(peratom_stats);
|
||||||
nmax_stats = atom->nmax;
|
nmax_stats = atom->nmax;
|
||||||
memory->create(peratom_stats, nmax_stats, size_peratom_cols, "lambda_thermostat/apip:peratom_stats");
|
memory->create(peratom_stats, nmax_stats, size_peratom_cols,
|
||||||
|
"lambda_thermostat/apip:peratom_stats");
|
||||||
array_atom = peratom_stats;
|
array_atom = peratom_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +476,8 @@ void FixLambdaThermostatAPIP::apply_thermostat()
|
|||||||
// rescale velocities relative to centre of mass velocity
|
// rescale velocities relative to centre of mass velocity
|
||||||
const int n_ngh = MIN(rescaling_N_neighbours, jnum);
|
const int n_ngh = MIN(rescaling_N_neighbours, jnum);
|
||||||
if (n_ngh < 2)
|
if (n_ngh < 2)
|
||||||
error->one(FLERR, "fix lambda_thermostat/apip: rescaling not possible for local ngh list size {}",
|
error->one(FLERR,
|
||||||
|
"fix lambda_thermostat/apip: rescaling not possible for local ngh list size {}",
|
||||||
jnum);
|
jnum);
|
||||||
// 1. calculate centre of mass velocity
|
// 1. calculate centre of mass velocity
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user