remove need for static class member variables in Dump and Irregular

The dump and irregular classes were using qsort() from the C-library
for sorting lists through custom comparison functions, which required
access to additional data, which was passed via static class variables,
i.e. globals. This collides with having multiple LAMMPS instances in
the same address space.

the calls to qsort() are replaced with a custom merge sort, which passes
a void pointer to the comparison functions, which can contain any kind
of desired information, e.g. a class handle or a list
This commit is contained in:
Axel Kohlmeyer
2017-06-14 23:10:53 -04:00
parent 286d4f2743
commit 1f17e8ebbb
4 changed files with 45 additions and 70 deletions

View File

@ -21,10 +21,6 @@ namespace LAMMPS_NS {
class Irregular : protected Pointers {
public:
// static variable across all Irregular objects, for qsort callback
static int *proc_recv_copy;
Irregular(class LAMMPS *);
~Irregular();
void migrate_atoms(int sortflag = 0, int preassign = 0,