Allow NULL for eta in fix electrode
This commit is contained in:
committed by
Robert Meißner
parent
37f3233040
commit
4bb71195aa
@ -38,7 +38,7 @@ Syntax
|
||||
*electrode/thermo* args = potential eta *temp* values
|
||||
potential = electrode potential
|
||||
charge = electrode charge
|
||||
eta = reciprocal width of electrode charge smearing
|
||||
eta = reciprocal width of electrode charge smearing (can be NULL if eta keyword is used)
|
||||
*temp* values = T_v tau_v rng_v
|
||||
T_v = temperature of thermo-potentiostat
|
||||
tau_v = time constant of thermo-potentiostat
|
||||
|
||||
@ -8,7 +8,7 @@ thermo_style custom step pe c_qbot c_qtop
|
||||
fix feta all property/atom d_eta ghost on
|
||||
set group bot d_eta 0.5
|
||||
set group top d_eta 3.0
|
||||
fix conp bot electrode/conp 0 2 couple top 1 symm on eta d_eta algo cg 1e-6
|
||||
fix conp bot electrode/conp 0 NULL couple top 1 symm on eta d_eta algo cg 1e-6
|
||||
|
||||
run 0
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ thermo_style custom step pe c_qbot c_qtop
|
||||
fix feta all property/atom d_eta ghost on
|
||||
set group bot d_eta 0.5
|
||||
set group top d_eta 3.0
|
||||
fix conp bot electrode/conp 0 2 couple top 1 symm on eta d_eta write_inv inv.csv write_vec vec.csv
|
||||
fix conp bot electrode/conp 0 NULL couple top 1 symm on eta d_eta write_inv inv.csv write_vec vec.csv
|
||||
|
||||
run 0
|
||||
|
||||
|
||||
@ -126,7 +126,8 @@ FixElectrodeConp::FixElectrodeConp(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else
|
||||
group_psi_const[0] = utils::numeric(FLERR, arg[3], false, lmp);
|
||||
char *eta_str = arg[4];
|
||||
eta = utils::numeric(FLERR, eta_str, false, lmp);
|
||||
bool etanull = (strcmp(eta_str, "NULL") == 0);
|
||||
if (!etanull) eta = utils::numeric(FLERR, eta_str, false, lmp);
|
||||
int iarg = 5;
|
||||
while (iarg < narg) {
|
||||
if ((strcmp(arg[iarg], "couple") == 0)) {
|
||||
@ -217,7 +218,7 @@ FixElectrodeConp::FixElectrodeConp(LAMMPS *lmp, int narg, char **arg) :
|
||||
qtotal_var_style = VarStyle::CONST;
|
||||
}
|
||||
} else if ((strcmp(arg[iarg], "eta") == 0)) {
|
||||
if (iarg + 2 > narg) error->all(FLERR, "Need two arguments after eta command");
|
||||
if (iarg + 2 > narg) error->all(FLERR, "Need one argument after eta command");
|
||||
etaflag = true;
|
||||
int is_double, cols, ghost;
|
||||
eta_index = atom->find_custom_ghost(arg[++iarg] + 2, is_double, cols, ghost);
|
||||
@ -243,6 +244,7 @@ FixElectrodeConp::FixElectrodeConp(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (qtotal_var_style != VarStyle::UNSET) {
|
||||
if (symm) error->all(FLERR, "{} cannot use qtotal keyword with symm on", this->style);
|
||||
}
|
||||
if (etanull && !etaflag) error->all(FLERR, "If eta is NULL the eta keyword must be used");
|
||||
|
||||
// computatonal potential
|
||||
group_psi = std::vector<double>(groups.size());
|
||||
@ -430,12 +432,11 @@ void FixElectrodeConp::init()
|
||||
}
|
||||
if (comm->me == 0)
|
||||
for (char *fix_id : integrate_ids)
|
||||
error->warning(
|
||||
FLERR,
|
||||
"Electrode atoms are integrated by fix {}, but fix electrode is using a matrix method. "
|
||||
"For "
|
||||
"mobile electrodes use the conjugate gradient algorithm without matrix ('algo cg').",
|
||||
fix_id);
|
||||
error->warning(FLERR,
|
||||
"Electrode atoms are integrated by fix {}, but fix electrode is using a "
|
||||
"matrix method. For mobile electrodes use the conjugate gradient algorithm "
|
||||
"without matrix ('algo cg').",
|
||||
fix_id);
|
||||
}
|
||||
|
||||
// check for package intel
|
||||
|
||||
Reference in New Issue
Block a user