47 int sigrval=0, renumber=0;
66 *r_xadj = *r_adjncy =
NULL;
80 if (*r_adjncy !=
NULL)
82 *r_xadj = *r_adjncy =
NULL;
117 int sigrval=0, renumber=0;
136 *r_xadj = *r_adjncy =
NULL;
150 if (*r_adjncy !=
NULL)
152 *r_xadj = *r_adjncy =
NULL;
168 idx_t *marker, *nbrs;
171 printf(
" Increased ncommon to 1, as it was initially %"PRIDX"\n", ncommon);
176 nptr =
ismalloc(nn+1, 0,
"CreateGraphDual: nptr");
177 nind =
imalloc(eptr[ne],
"CreateGraphDual: nind");
179 for (i=0; i<ne; i++) {
180 for (j=eptr[i]; j<eptr[i+1]; j++)
185 for (i=0; i<ne; i++) {
186 for (j=eptr[i]; j<eptr[i+1]; j++)
187 nind[nptr[eind[j]]++] = i;
201 marker =
ismalloc(ne, 0,
"CreateGraphDual: marker");
202 nbrs =
imalloc(ne,
"CreateGraphDual: nbrs");
204 for (i=0; i<ne; i++) {
206 nind, eptr, ncommon, marker, nbrs);
220 for (i=0; i<ne; i++) {
222 nind, eptr, ncommon, marker, nbrs);
223 for (j=0; j<nnbrs; j++)
224 adjncy[xadj[i]++] = nbrs[j];
243 for (k=0, i=0; i<elen; i++) {
245 for (ii=nptr[j]; ii<nptr[j+1]; ii++) {
256 if (marker[qid] == 0)
261 for (j=0, i=0; i<k; i++) {
262 overlap = marker[l = nbrs[
i]];
263 if (overlap >= ncommon ||
265 overlap >= eptr[l+1]-eptr[l]-1)
283 idx_t *marker, *nbrs;
287 nptr =
ismalloc(nn+1, 0,
"CreateGraphNodal: nptr");
288 nind =
imalloc(eptr[ne],
"CreateGraphNodal: nind");
290 for (i=0; i<ne; i++) {
291 for (j=eptr[i]; j<eptr[i+1]; j++)
296 for (i=0; i<ne; i++) {
297 for (j=eptr[i]; j<eptr[i+1]; j++)
298 nind[nptr[eind[j]]++] = i;
312 marker =
ismalloc(nn, 0,
"CreateGraphNodal: marker");
313 nbrs =
imalloc(nn,
"CreateGraphNodal: nbrs");
315 for (i=0; i<
nn; i++) {
331 for (i=0; i<
nn; i++) {
334 for (j=0; j<nnbrs; j++)
335 adjncy[xadj[i]++] = nbrs[j];
355 for (k=0, i=0; i<nelmnts; i++) {
357 for (ii=eptr[j]; ii<eptr[j+1]; ii++) {
359 if (marker[jj] == 0) {
368 for (i=0; i<k; i++) {
397 memset((
void *)mesh, 0,
sizeof(
mesh_t));
idx_t idx_t idx_t idx_t * ncommon
idx_t FindCommonElements(idx_t qid, idx_t elen, idx_t *eind, idx_t *nptr, idx_t *nind, idx_t *eptr, idx_t ncommon, idx_t *marker, idx_t *nbrs)
void gk_errexit(int signum, char *f_str,...)
void FreeMesh(mesh_t **r_mesh)
static const Line3 l(Rot3(), 1, 1)
idx_t idx_t idx_t idx_t idx_t idx_t ** r_xadj
void CreateGraphNodal(idx_t ne, idx_t nn, idx_t *eptr, idx_t *eind, idx_t **r_xadj, idx_t **r_adjncy)
void gk_malloc_cleanup(int showstats)
idx_t idx_t idx_t idx_t idx_t * numflag
int METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t ** r_adjncy
#define SHIFTCSR(i, n, a)
void CreateGraphDual(idx_t ne, idx_t nn, idx_t *eptr, idx_t *eind, idx_t ncommon, idx_t **r_xadj, idx_t **r_adjncy)
void * gk_malloc(size_t nbytes, char *msg)
void gk_free(void **ptr1,...)
idx_t idx_t idx_t * adjncy
#define ChangeMesh2FNumbering
mesh_t * CreateMesh(void)
idx_t FindCommonNodes(idx_t qid, idx_t nelmnts, idx_t *elmntids, idx_t *eptr, idx_t *eind, idx_t *marker, idx_t *nbrs)
int METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
#define ChangeMesh2CNumbering
void InitMesh(mesh_t *mesh)