Changeset 24393
- Timestamp:
- 11/25/19 11:49:45 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
r13056 r24393 13 13 METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, index, petype, pnumflag, pnum_procs, pedgecut, epart, npart); 14 14 #elif _METIS_VERSION_ == 5 15 15 16 /*This interface is heavily changed. More options, different ways of meshing, etc ...: */ 16 int i;17 17 18 /*Create options*/ 18 19 idx_t options[METIS_NOPTIONS]; 19 idx_t objval;20 idx_t* eptr=NULL;21 idx_t k=0;22 real_t* tpwgts=NULL;23 24 /*setup options: */25 20 METIS_SetDefaultOptions(options); 26 21 27 options[METIS_OPTION_PTYPE] = 1;28 options[METIS_OPTION_OBJTYPE] = 0;29 options[METIS_OPTION_CTYPE] = 1;30 options[METIS_OPTION_IPTYPE] = 4;31 options[METIS_OPTION_RTYPE] = 1;32 options[METIS_OPTION_DBGLVL] = 0; 33 options[METIS_OPTION_UFACTOR] = 30; 34 options[METIS_OPTION_MINCONN] = 0; 35 options[METIS_OPTION_CONTIG] = 0; 36 options[METIS_OPTION_SEED] = -1; 37 options[METIS_OPTION_NITER] = 10; 38 options[METIS_OPTION_NCUTS] = 1; 22 options[METIS_OPTION_PTYPE] = METIS_PTYPE_KWAY; /* partitioning method */ 23 options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_VOL; /* type of objective */ 24 options[METIS_OPTION_CTYPE] = METIS_CTYPE_SHEM; /* matching scheme to be used during coarsening.*/ 25 options[METIS_OPTION_IPTYPE] = METIS_IPTYPE_METISRB; /* algorithm used during initial partitioning*/ 26 options[METIS_OPTION_RTYPE] = METIS_RTYPE_GREEDY; /* algorithm used for refinement*/ 27 options[METIS_OPTION_DBGLVL] = 0; /* amount of progress/debugging information will be printed */ 28 options[METIS_OPTION_UFACTOR] = 30; /* maximum allowed load imbalance among the partitions*/ 29 options[METIS_OPTION_MINCONN] = 0; /* explicitly minimize the maximum connectivity ?*/ 30 options[METIS_OPTION_CONTIG] = 0; /* force contiguous partitions?*/ 31 options[METIS_OPTION_SEED] = -1; /* seed for the random number generator*/ 32 options[METIS_OPTION_NITER] = 10; /* number of iterations for the refinement algorithms*/ 33 options[METIS_OPTION_NCUTS] = 1; /* number of different partitionings that it will compute*/ 39 34 40 35 /*create eptr: */ 41 eptr=xNew<idx_t>((*pnumberofelements+1)); 36 idx_t k=0; 37 idx_t* eptr=xNew<idx_t>((*pnumberofelements+1)); 42 38 eptr[0]=0; 43 for(i =0;i<*pnumberofelements;i++){39 for(int i=0;i<*pnumberofelements;i++){ 44 40 k+=3; 45 41 eptr[i+1]=k; … … 47 43 48 44 /*create tpwgts: */ 49 tpwgts=xNew<real_t>(*pnum_procs);50 for(i =0;i<*pnum_procs;i++){45 real_t* tpwgts=xNew<real_t>(*pnum_procs); 46 for(int i=0;i<*pnum_procs;i++){ 51 47 tpwgts[i]=1.0/(*pnum_procs); 52 48 } 53 49 50 /*Call METIS*/ 51 idx_t objval; 54 52 METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, eptr, index, 55 53 NULL, NULL, pnum_procs, tpwgts, options, &objval,epart, npart);
Note:
See TracChangeset
for help on using the changeset viewer.