git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13332 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-03-30 23:17:06 +00:00
parent 8d078d0602
commit bd37304ade
27 changed files with 135 additions and 39 deletions

View File

@ -64,6 +64,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
end_of_step_every = NULL;
list_dofflag = NULL;
list_timeflag = NULL;
nfix_restart_global = 0;
@ -135,6 +136,7 @@ Modify::~Modify()
delete [] list_min_energy;
delete [] end_of_step_every;
delete [] list_dofflag;
delete [] list_timeflag;
restart_deallocate();
@ -184,6 +186,8 @@ void Modify::init()
list_init(MIN_POST_FORCE,n_min_post_force,list_min_post_force);
list_init(MIN_ENERGY,n_min_energy,list_min_energy);
list_init_dofflag(n_dofflag,list_dofflag);
// init each fix
// not sure if now needs to come before compute init
// used to b/c temperature computes called fix->dof() in their init,
@ -898,6 +902,19 @@ int Modify::check_package(const char *package_fix_name)
return 1;
}
/* ----------------------------------------------------------------------
loop over fixes with dof() method
accumulate # of DOFs removed by fixes and return it
called by temperature computes
------------------------------------------------------------------------- */
int Modify::adjust_dof_fix(int igroup)
{
int n = 0;
for (int ifix = 0; ifix < n_dofflag; ifix++)
n += fix[list_dofflag[ifix]]->dof(igroup);
}
/* ----------------------------------------------------------------------
add a new compute
------------------------------------------------------------------------- */
@ -1282,6 +1299,27 @@ void Modify::list_init_thermo_energy(int mask, int &n, int *&list)
if (fmask[i] & mask && fix[i]->thermo_energy) list[n++] = i;
}
/* ----------------------------------------------------------------------
create list of fix indices for thermo energy fixes
only added to list if fix has THERMO_ENERGY mask
and its thermo_energy flag was set via fix_modify
------------------------------------------------------------------------- */
void Modify::list_init_dofflag(int &n, int *&list)
{
delete [] list;
n = 0;
for (int i = 0; i < nfix; i++)
if (fix[i]->dof_flag) n++;
list = new int[n];
n = 0;
for (int i = 0; i < nfix; i++)
if (fix[i]->dof_flag) list[n++] = i;
}
/* ----------------------------------------------------------------------
create list of compute indices for computes which store invocation times
------------------------------------------------------------------------- */