git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8226 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
@ -56,7 +56,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
|
||||
list_initial_integrate_respa = list_post_integrate_respa = NULL;
|
||||
list_pre_force_respa = list_post_force_respa = NULL;
|
||||
list_final_integrate_respa = NULL;
|
||||
list_min_pre_exchange = list_min_pre_force =
|
||||
list_min_pre_exchange = list_min_pre_force =
|
||||
list_min_post_force = list_min_energy = NULL;
|
||||
|
||||
end_of_step_every = NULL;
|
||||
@ -139,15 +139,15 @@ void Modify::init()
|
||||
list_init_thermo_energy(THERMO_ENERGY,n_thermo_energy,list_thermo_energy);
|
||||
|
||||
list_init(INITIAL_INTEGRATE_RESPA,
|
||||
n_initial_integrate_respa,list_initial_integrate_respa);
|
||||
n_initial_integrate_respa,list_initial_integrate_respa);
|
||||
list_init(POST_INTEGRATE_RESPA,
|
||||
n_post_integrate_respa,list_post_integrate_respa);
|
||||
n_post_integrate_respa,list_post_integrate_respa);
|
||||
list_init(POST_FORCE_RESPA,
|
||||
n_post_force_respa,list_post_force_respa);
|
||||
n_post_force_respa,list_post_force_respa);
|
||||
list_init(PRE_FORCE_RESPA,
|
||||
n_pre_force_respa,list_pre_force_respa);
|
||||
n_pre_force_respa,list_pre_force_respa);
|
||||
list_init(FINAL_INTEGRATE_RESPA,
|
||||
n_final_integrate_respa,list_final_integrate_respa);
|
||||
n_final_integrate_respa,list_final_integrate_respa);
|
||||
|
||||
list_init(MIN_PRE_EXCHANGE,n_min_pre_exchange,list_min_pre_exchange);
|
||||
list_init(MIN_PRE_FORCE,n_min_pre_force,list_min_pre_force);
|
||||
@ -214,7 +214,7 @@ void Modify::init()
|
||||
MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
|
||||
if (comm->me == 0 && checkall)
|
||||
error->warning(FLERR,
|
||||
"One or more atoms are time integrated more than once");
|
||||
"One or more atoms are time integrated more than once");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -669,13 +669,13 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
|
||||
|
||||
for (int i = 0; i < nfix_restart_global; i++)
|
||||
if (strcmp(id_restart_global[i],fix[ifix]->id) == 0 &&
|
||||
strcmp(style_restart_global[i],fix[ifix]->style) == 0) {
|
||||
strcmp(style_restart_global[i],fix[ifix]->style) == 0) {
|
||||
fix[ifix]->restart(state_restart_global[i]);
|
||||
if (comm->me == 0) {
|
||||
char *str = (char *) ("Resetting global state of Fix %s Style %s "
|
||||
"from restart file info\n");
|
||||
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
|
||||
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
|
||||
char *str = (char *) ("Resetting global state of Fix %s Style %s "
|
||||
"from restart file info\n");
|
||||
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
|
||||
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
|
||||
}
|
||||
}
|
||||
|
||||
@ -684,14 +684,14 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
|
||||
|
||||
for (int i = 0; i < nfix_restart_peratom; i++)
|
||||
if (strcmp(id_restart_peratom[i],fix[ifix]->id) == 0 &&
|
||||
strcmp(style_restart_peratom[i],fix[ifix]->style) == 0) {
|
||||
strcmp(style_restart_peratom[i],fix[ifix]->style) == 0) {
|
||||
for (int j = 0; j < atom->nlocal; j++)
|
||||
fix[ifix]->unpack_restart(j,index_restart_peratom[i]);
|
||||
fix[ifix]->unpack_restart(j,index_restart_peratom[i]);
|
||||
if (comm->me == 0) {
|
||||
char *str = (char *) ("Resetting per-atom state of Fix %s Style %s "
|
||||
"from restart file info\n");
|
||||
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
|
||||
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
|
||||
char *str = (char *) ("Resetting per-atom state of Fix %s Style %s "
|
||||
"from restart file info\n");
|
||||
if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
|
||||
if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -710,7 +710,7 @@ void Modify::modify_fix(int narg, char **arg)
|
||||
for (ifix = 0; ifix < nfix; ifix++)
|
||||
if (strcmp(arg[0],fix[ifix]->id) == 0) break;
|
||||
if (ifix == nfix) error->all(FLERR,"Could not find fix_modify ID");
|
||||
|
||||
|
||||
fix[ifix]->modify_params(narg-1,&arg[1]);
|
||||
}
|
||||
|
||||
@ -822,7 +822,7 @@ void Modify::modify_compute(int narg, char **arg)
|
||||
for (icompute = 0; icompute < ncompute; icompute++)
|
||||
if (strcmp(arg[0],compute[icompute]->id) == 0) break;
|
||||
if (icompute == ncompute) error->all(FLERR,"Could not find compute_modify ID");
|
||||
|
||||
|
||||
compute[icompute]->modify_params(narg-1,&arg[1]);
|
||||
}
|
||||
|
||||
@ -906,7 +906,7 @@ void Modify::write_restart(FILE *fp)
|
||||
int me = comm->me;
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < nfix; i++)
|
||||
for (int i = 0; i < nfix; i++)
|
||||
if (fix[i]->restart_global) count++;
|
||||
|
||||
if (me == 0) fwrite(&count,sizeof(int),1,fp);
|
||||
@ -915,18 +915,18 @@ void Modify::write_restart(FILE *fp)
|
||||
for (int i = 0; i < nfix; i++)
|
||||
if (fix[i]->restart_global) {
|
||||
if (me == 0) {
|
||||
n = strlen(fix[i]->id) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->id,sizeof(char),n,fp);
|
||||
n = strlen(fix[i]->style) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->style,sizeof(char),n,fp);
|
||||
n = strlen(fix[i]->id) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->id,sizeof(char),n,fp);
|
||||
n = strlen(fix[i]->style) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->style,sizeof(char),n,fp);
|
||||
}
|
||||
fix[i]->write_restart(fp);
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (int i = 0; i < nfix; i++)
|
||||
for (int i = 0; i < nfix; i++)
|
||||
if (fix[i]->restart_peratom) count++;
|
||||
|
||||
if (me == 0) fwrite(&count,sizeof(int),1,fp);
|
||||
@ -934,14 +934,14 @@ void Modify::write_restart(FILE *fp)
|
||||
for (int i = 0; i < nfix; i++)
|
||||
if (fix[i]->restart_peratom) {
|
||||
if (me == 0) {
|
||||
n = strlen(fix[i]->id) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->id,sizeof(char),n,fp);
|
||||
n = strlen(fix[i]->style) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->style,sizeof(char),n,fp);
|
||||
n = fix[i]->maxsize_restart();
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
n = strlen(fix[i]->id) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->id,sizeof(char),n,fp);
|
||||
n = strlen(fix[i]->style) + 1;
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
fwrite(fix[i]->style,sizeof(char),n,fp);
|
||||
n = fix[i]->maxsize_restart();
|
||||
fwrite(&n,sizeof(int),1,fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1149,9 +1149,9 @@ void Modify::list_init_compute()
|
||||
bigint Modify::memory_usage()
|
||||
{
|
||||
bigint bytes = 0;
|
||||
for (int i = 0; i < nfix; i++)
|
||||
for (int i = 0; i < nfix; i++)
|
||||
bytes += static_cast<bigint> (fix[i]->memory_usage());
|
||||
for (int i = 0; i < ncompute; i++)
|
||||
for (int i = 0; i < ncompute; i++)
|
||||
bytes += static_cast<bigint> (compute[i]->memory_usage());
|
||||
return bytes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user