remove local copy of "me"
This commit is contained in:
@ -145,7 +145,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// set initial electron temperatures from user input file
|
||||
|
||||
if (me == 0) read_initial_electron_temperatures(arg[13]);
|
||||
if (comm->me == 0) read_initial_electron_temperatures(arg[13]);
|
||||
MPI_Bcast(&T_electron[0][0][0],total_nnodes,MPI_DOUBLE,0,world);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
FixTTM::~FixTTM()
|
||||
{
|
||||
if (nfileevery && me == 0) fclose(fp);
|
||||
if (fp) fclose(fp);
|
||||
|
||||
delete random;
|
||||
|
||||
@ -360,7 +360,7 @@ void FixTTM::read_initial_electron_temperatures(const char *filename)
|
||||
error->one(FLERR,"Fix ttm electron temperatures must be > 0.0");
|
||||
|
||||
T_electron[ixnode][iynode][iznode] = T_tmp;
|
||||
T_initial_set[ixnode][iynode][iznode] = 1;
|
||||
T_initial_set[ixnode][iynode][iznode] = 1.0;
|
||||
}
|
||||
|
||||
// check completeness of input data
|
||||
@ -475,7 +475,7 @@ void FixTTM::end_of_step()
|
||||
(T_electron_old[ixnode][iynode][right_znode] +
|
||||
T_electron_old[ixnode][iynode][left_znode] -
|
||||
2*T_electron_old[ixnode][iynode][iznode])/dz/dz) -
|
||||
(net_energy_transfer_all[ixnode][iynode][iznode])/del_vol);
|
||||
(net_energy_transfer_all[ixnode][iynode][iznode])/del_vol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -526,7 +526,7 @@ void FixTTM::end_of_step()
|
||||
MPI_Allreduce(&sum_mass_vsq[0][0][0],&sum_mass_vsq_all[0][0][0],
|
||||
total_nnodes,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
if (me == 0) {
|
||||
if (comm->me == 0) {
|
||||
fmt::print(fp,"{}",update->ntimestep);
|
||||
|
||||
double T_a;
|
||||
|
||||
@ -48,7 +48,6 @@ class FixTTM : public Fix {
|
||||
double compute_vector(int);
|
||||
|
||||
private:
|
||||
int me;
|
||||
int nfileevery;
|
||||
int nlevels_respa;
|
||||
int seed;
|
||||
|
||||
@ -66,7 +66,7 @@ static const char cite_fix_ttm_mod[] =
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
Fix(lmp, narg, arg), fp(NULL)
|
||||
{
|
||||
if (lmp->citeme) lmp->citeme->add(cite_fix_ttm_mod);
|
||||
|
||||
@ -96,8 +96,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
||||
nfileevery = force->inumeric(FLERR,arg[9]);
|
||||
if (nfileevery > 0) {
|
||||
if (narg != 11) error->all(FLERR,"Illegal fix ttm/mod command");
|
||||
MPI_Comm_rank(world,&me);
|
||||
if (me == 0) {
|
||||
if (comm->me == 0) {
|
||||
fp = fopen(arg[10],"w");
|
||||
if (fp == NULL) {
|
||||
char str[128];
|
||||
@ -159,7 +158,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
||||
atom->add_callback(0);
|
||||
atom->add_callback(1);
|
||||
// set initial electron temperatures from user input file
|
||||
if (me == 0) read_initial_electron_temperatures(arg[13]);
|
||||
if (comm->me == 0) read_initial_electron_temperatures(arg[13]);
|
||||
MPI_Bcast(&T_electron[0][0][0],total_nnodes,MPI_DOUBLE,0,world);
|
||||
}
|
||||
|
||||
@ -167,7 +166,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
FixTTMMod::~FixTTMMod()
|
||||
{
|
||||
if (nfileevery && me == 0) fclose(fp);
|
||||
if (fp) fclose(fp);
|
||||
delete random;
|
||||
delete [] gfactor1;
|
||||
delete [] gfactor2;
|
||||
@ -806,7 +805,7 @@ void FixTTMMod::end_of_step()
|
||||
total_nnodes,MPI_DOUBLE,MPI_SUM,world);
|
||||
MPI_Allreduce(&t_surface_l,&surface_l,
|
||||
1,MPI_INT,MPI_MIN,world);
|
||||
if (me == 0) {
|
||||
if (comm->me == 0) {
|
||||
fmt::print(fp,"{}",update->ntimestep);
|
||||
double T_a;
|
||||
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
||||
|
||||
@ -53,7 +53,6 @@ class FixTTMMod : public Fix {
|
||||
double compute_vector(int);
|
||||
|
||||
private:
|
||||
int me;
|
||||
int nfileevery;
|
||||
int nlevels_respa;
|
||||
int seed;
|
||||
|
||||
Reference in New Issue
Block a user