Access from fix to Voronoi neighbors

I’m developing a fix in the source code of LAMMPS to do some calculations over atoms, looking at its nearest neighbors. It works fine for the usual metric neighbour list based on distances and for a given cutoff.

Now, I would like to somehow call “compute voronoi” from my fix to try to look just at the Voronoi neighbor list or at least have access from that fix to the total number of neighbor (faces of the voronoi cell) that is mention in the manual, and then I can find that number of nearest neighbors in the metric neighbor list (not very efficient, but could work for my purpose). Is there a way to communicate that information between compute and fix in the source code?

Thanks

You can launch the voroni/atom compute from within your fix using e.g. Compute *voroni = modify->add_compute(). Since add_compute() function returns a pointer to the compute instance. You can then call voronoi->compute_peratom() and find the per-atom array with the data from the compute in voronoi->array_atom.

Thanks Axel for answer so fast

I have included in my fix this code:

char *newarg = new char[3];
newarg[0] = (char *) “voronoi”;
newarg[1] = (char *) “all”;
newarg[2] = (char *) “voronoi/atom”;

Compute *voronoi=modify->add_compute(3,newarg);
voronoi->compute_peratom();
double **voro = voronoi->array_atom;
delete[] newarg;

but I get the following error:

error: void value not ignored as it should be
Compute *voronoi=modify->add_compute(3,newarg);
^
I don’t know right now what is wrong, because looking at other fix that use this commands looks really similar. I will really appreciate any idea about how to solve this error.

In case that it can be useful:

The version of lammps that I’m using is: 31Mar17

This are the libraries that I have included in my new fix:
#include
#include <math.h>
#include “stdio.h”
#include “string.h”
#include “fix_new.h”
#include “atom.h”
#include “force.h”
#include “neighbor.h”
#include “neigh_list.h”
#include “neigh_request.h”
#include “update.h”
#include “respa.h”
#include “error.h”
#include “modify.h”
#include “compute.h”
#include “fix.h”
#include “random_mars.h”
#include “comm.h”
#include “error.h”
#include “domain.h”
#include “memory.h”

It is a very, VERY bad idea to do development with a 6 year old LAMMPS version. What I suggested only works with a recent version of LAMMPS.