new library functions
This commit is contained in:
@ -359,30 +359,9 @@ void CreateAtoms::command(int narg, char **arg)
|
||||
else if (style == RANDOM) add_random();
|
||||
else add_lattice();
|
||||
|
||||
// invoke set_arrays() for fixes/computes/variables
|
||||
// that need initialization of attributes of new atoms
|
||||
// don't use modify->create_attributes() since would be inefficient
|
||||
// for large number of atoms
|
||||
// note that for typical early use of create_atoms,
|
||||
// no fixes/computes/variables exist yet
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
for (int m = 0; m < modify->nfix; m++) {
|
||||
Fix *fix = modify->fix[m];
|
||||
if (fix->create_attribute)
|
||||
for (int i = nlocal_previous; i < nlocal; i++)
|
||||
fix->set_arrays(i);
|
||||
}
|
||||
|
||||
for (int m = 0; m < modify->ncompute; m++) {
|
||||
Compute *compute = modify->compute[m];
|
||||
if (compute->create_attribute)
|
||||
for (int i = nlocal_previous; i < nlocal; i++)
|
||||
compute->set_arrays(i);
|
||||
}
|
||||
|
||||
for (int i = nlocal_previous; i < nlocal; i++)
|
||||
input->variable->set_arrays(i);
|
||||
// init per-atom fix/compute/variable values for created atoms
|
||||
|
||||
atom->data_fix_compute_variable(nlocal_previous,atom->nlocal);
|
||||
|
||||
// set new total # of atoms and error check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user