Mesh2Dual in Fortran

Hi,
I want to use ParMETIS_Mesh2Dual from a FORTRAN90 code.
For some reasons this seems to be the only method which
uses double referenced values (**xadj and **adjncy) as return
values. My research on the net did not reveal any solutions
how to access this data.

Has anybody succeeded accessing this function? I would be also
willing to use a wrapper to convert the ** values to * values.

Any help is greatly appreciated.

Thank you for providing this great software to the community!

Best regards
Dieke

BTW: For a mesh consisting only of hexahedra, is there a simple way to
relate the edges of the graph to the faces of the hexahedra?

RE: Mesh2Dual Fortran workaround

Hi,

thank you for your quick reply. I found a workaround for my problem and wrote a patch routine
to be called by FORTRAN, you will find it at the end of my post, maybe it is of use to sombody else.
I had a closer look at the C-code PartMeshKway and went on from there.

The only drawback was that CrtlType is not declared in parmetis.h
Therefore I had to build an includefile with lines from
defs.h, rename.h, proto.h and struct.h.

I have still some questions:

- The routine SetUpCtrl seems to do an important part of allocating and computing.
Is there a need to clean up afterwards? And how do I do it?
- Is the argument npart needed for SetupCrtl? It does not seem to be needed for Mesh2Dual
- I want to destinguish between different types of connections is there a simple way
to find the number of common nodes for each connection?

Best regards,
Dieke


void parmetis_patch_mesh2dual_(idxtype *elmdist, idxtype *eptr, idxtype *eind,
int *numflag, int *ncommonnodes, int *nparts, idxtype *fxadj,
idxtype *fadjncy, MPI_Comm *commF)
{
MPI_Comm comm_world = MPI_Comm_f2c((MPI_Fint)*commF);
MPI_Comm *comm = &comm_world;
CtrlType ctrl;
idxtype *xadj;
idxtype *adjncy;
SetUpCtrl(&ctrl,*nparts,0,*comm);
int mype = ctrl.mype;
int nvtxs = elmdist[mype+1] - elmdist[mype];
ParMETIS_V3_Mesh2Dual(elmdist,eptr,eind,
numflag, ncommonnodes, &xadj,
&adjncy, comm);
int i;
for (i=0;i<=nvtxs;i++) {fxadj[i] = *&xadj[i];}
int nedges = xadj[nvtxs] ;
for (i=0;i

RE: Great question. I do not know

Great question. I do not know the answer. Anybody else?