clang-format apip package.
This commit is contained in:
@ -25,8 +25,8 @@ AtomVecApip::AtomVecApip(LAMMPS *lmp) : AtomVec(lmp)
|
||||
mass_type = PER_TYPE;
|
||||
forceclearflag = 1;
|
||||
|
||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_input_ta, *apip_lambda_const, *apip_e_fast, *apip_e_precise,
|
||||
**apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_input_ta, *apip_lambda_const, *apip_e_fast,
|
||||
*apip_e_precise, **apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||
int *apip_lambda_required;
|
||||
atom->apip_lambda_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
|
||||
|
||||
// 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_comm = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta", "apip_lambda_const"};
|
||||
fields_copy = {"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta",
|
||||
"apip_lambda_const"};
|
||||
fields_comm = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta",
|
||||
"apip_lambda_const"};
|
||||
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_exchange = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta", "apip_lambda_const"};
|
||||
fields_restart = {"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta", "apip_lambda_const"};
|
||||
fields_exchange = {"apip_lambda", "apip_lambda_required", "apip_lambda_input_ta",
|
||||
"apip_lambda_const"};
|
||||
fields_restart = {"apip_lambda", "apip_lambda_required", "apip_lambda_input",
|
||||
"apip_lambda_input_ta", "apip_lambda_const"};
|
||||
fields_create = {};
|
||||
fields_grow = {
|
||||
"apip_lambda", "apip_lambda_required", "apip_lambda_input", "apip_lambda_input_ta", "apip_lambda_const",
|
||||
"apip_e_fast", "apip_e_precise", "apip_f_const_lambda", "apip_f_dyn_lambda"}; // allocates memory
|
||||
"apip_lambda", "apip_lambda_required", "apip_lambda_input",
|
||||
"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",
|
||||
"apip_f_dyn_lambda"}; // communication of force after calculation
|
||||
fields_data_atom = {"id", "type", "x"};
|
||||
|
||||
@ -34,8 +34,8 @@ class AtomVecApip : public AtomVec {
|
||||
void data_atom_post(int) override;
|
||||
|
||||
protected:
|
||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_const, *apip_lambda_input_ta, *apip_e_fast, *apip_e_precise,
|
||||
**apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_const, *apip_lambda_input_ta, *apip_e_fast,
|
||||
*apip_e_precise, **apip_f_const_lambda, **apip_f_dyn_lambda;
|
||||
int *apip_lambda_required;
|
||||
};
|
||||
|
||||
|
||||
@ -154,7 +154,9 @@ FixLambdaAPIP::FixLambdaAPIP(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (!atom->apip_lambda_const_flag) {
|
||||
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) {
|
||||
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
|
||||
if (comm->me == 0 && modify->get_fix_by_style("lambda_thermostat/apip").size() == 0)
|
||||
error->warning(
|
||||
FLERR,
|
||||
"The energy is not conserved when lambda changes as fix lambda_thermostat/apip is not used.");
|
||||
error->warning(FLERR,
|
||||
"The energy is not conserved when lambda changes as fix lambda_thermostat/apip "
|
||||
"is not used.");
|
||||
|
||||
Pair *pair_tmp;
|
||||
// lambda_input
|
||||
|
||||
@ -60,7 +60,8 @@ FixLambdaThermostatAPIP::FixLambdaThermostatAPIP(LAMMPS *lmp, int narg, char **a
|
||||
for (int iarg = 3; iarg < narg; iarg++) {
|
||||
|
||||
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);
|
||||
if (seed <= 0) { error->all(FLERR, "fix lambda_thermostat/apip seed <= 0"); }
|
||||
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
|
||||
|
||||
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;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
@ -173,7 +175,8 @@ void FixLambdaThermostatAPIP::init()
|
||||
int counter = 0;
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
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
|
||||
// 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) {
|
||||
memory->destroy(peratom_stats);
|
||||
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;
|
||||
}
|
||||
|
||||
@ -472,7 +476,8 @@ void FixLambdaThermostatAPIP::apply_thermostat()
|
||||
// rescale velocities relative to centre of mass velocity
|
||||
const int n_ngh = MIN(rescaling_N_neighbours, jnum);
|
||||
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);
|
||||
// 1. calculate centre of mass velocity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user