Hello,
I am interested in performing parallel tempering calculations using a custom pair_style that incorporates a temperature-dependent dielectric. Is it possible to access the current temperature of a replica from within the pair_style?
Thank you,
Dan
Hello,
I am interested in performing parallel tempering calculations using a custom
pair_style that incorporates a temperature-dependent dielectric. Is it
possible to access the current temperature of a replica from within the
pair_style?
to get the instantaneous temperature, you'd just have the pair_style
create a compute and query it. but for parallel tempering it would be
more effective to obtain the thermostat target temperature. this can
be done with code like this (taken from fix_colvars). you'd have to
pass the thermostat fix id to the pair style flags, of course.
double t_target = 0.0;
if (tmp_name) {
if (strcmp(tmp_name,"NULL") == 0)
tstat_id = -1;
else {
tstat_id = modify->find_fix(tmp_name);
if (tstat_id < 0) error->one(FLERR,"Could not find tstat fix ID");
double *tt = (double*)modify->fix[tstat_id]->extract("t_target",tmp);
if (tt) t_target = *tt;
}
}
For a compute, you simply invoke the compute and then
access the scalar value it produces. You can see how fixes
do this, like fix ave/time. You can also check to see if the
compute has been evaluated already on the current timestep.
Steve