Actual source code: partQuery.c

  1: #ifdef PETSC_RCS_HEADER
  2: static char vcid[] = "$Id: partQuery.c,v 1.6 2000/01/31 17:37:32 knepley Exp $";
  3: #endif

  5: /*
  6:      Defines the interface to the partition query functions
  7: */

 9:  #include src/mesh/meshimpl.h

 11: /*-------------------------------------------- Partition Query Functions ---------------------------------------------*/
 12: #undef  __FUNCT__
 14: /*@
 15:   PartitionGetDimension - This function returns the dimension of the Partition.

 17:   Not collective

 19:   Input Parameter:
 20: . part - The partition

 22:   Output Parameter:
 23: . dim  - The partition dimension

 25:   Level: intermediate

 27: .keywords: Partition, dimension
 28: .seealso: MeshGetDimension()
 29: @*/
 30: int PartitionGetDimension(Partition part, int *dim)
 31: {
 32:   Mesh mesh;

 38:   PartitionGetMesh(part, &mesh);
 39:   MeshGetDimension(mesh, dim);
 40:   return(0);
 41: }

 43: #undef  __FUNCT__
 45: /*@
 46:   PartitionGetMesh - Returns the Mesh object for this Partition.

 48:   Not collective

 50:   Input Parameter:
 51: . part - The partition

 53:   Output Parameter:
 54: . mesh - The mesh

 56:   Level: intermediate

 58: .keywords: Mesh, Partition, get
 59: .seealso: MeshGetPartition()
 60: @*/
 61: int PartitionGetMesh(Partition part, Mesh *mesh)
 62: {
 66:   *mesh = part->mesh;
 67:   return(0);
 68: }

 70: /*--------------------------------------------- Element Query Functions ----------------------------------------------*/
 71: #undef  __FUNCT__
 73: /*@
 74:   PartitionGetTotalElements - Gets the number of elements in the mesh.

 76:   Not collective

 78:   Input Parameter:
 79: . part - The partition

 81:   Output Parameter:
 82: . size - The number of elements in the mesh

 84:   Level: intermediate

 86: .keywords: partition, element
 87: .seealso: PartitionGetStartElement(), PartitionGetEndElement()
 88: @*/
 89: int PartitionGetTotalElements(Partition part, int *size)
 90: {
 94:   *size = part->numElements;
 95:   return(0);
 96: }

 98: #undef  __FUNCT__
100: /*@
101:   PartitionGetStartElement - Gets the first element in this domain.

103:   Not collective

105:   Input Parameter:
106: . part - The partition

108:   Output Parameter:
109: . elem - The first element in this domain

111:   Level: intermediate

113: .keywords: partition, element
114: .seealso: PartitionGetEndElement(), PartitionGetNumElements()
115: @*/
116: int PartitionGetStartElement(Partition part, int *elem)
117: {
121:   *elem = part->firstElement[part->rank];
122:   return(0);
123: }

125: #undef  __FUNCT__
127: /*@
128:   PartitionGetEndElement - Gets the first element in the next domain.

130:   Not collective

132:   Input Parameter:
133: . part - The partition

135:   Output Parameter:
136: . elem - The first element in the next domain

138:   Level: intermediate

140: .keywords: partition, element
141: .seealso: PartitionGetStartElement(), PartitionGetNumElements()
142: @*/
143: int PartitionGetEndElement(Partition part, int *elem)
144: {
148:   *elem = part->firstElement[part->rank+1];
149:   return(0);
150: }

152: #undef  __FUNCT__
154: /*@
155:   PartitionGetNumElements - Gets the number of elements in this domain.

157:   Not collective

159:   Input Parameter:
160: . part - The partition

162:   Output Parameter:
163: . size - The number of elements in this domain

165:   Level: intermediate

167: .keywords: partition, element
168: .seealso: PartitionGetStartElement(), PartitionGetEndElement()
169: @*/
170: int PartitionGetNumElements(Partition part, int *size)
171: {
175:   *size = part->firstElement[part->rank+1] - part->firstElement[part->rank];
176:   return(0);
177: }

179: #undef  __FUNCT__
181: /*@
182:   PartitionGetNumOverlapElements - Gets the number of elements and ghost elements for this domain.

184:   Not collective

186:   Input Parameter:
187: . part - The partition

189:   Output Parameter:
190: . size - The number of elements and ghost element for this domain

192:   Level: intermediate

194: .keywords: partition, element
195: .seealso: PartitionGetStartElement(), PartitionGetEndElement()
196: @*/
197: int PartitionGetNumOverlapElements(Partition part, int *size)
198: {
202:   *size = part->numOverlapElements;
203:   return(0);
204: }

206: #undef  __FUNCT__
208: static int PartitionGhostElementIndex_Private(Partition p, int elem, int *gElem)
209: {
210:   int low, high, mid;

213:   /* Use bisection since the array is assumed to be sorted */
214:   low  = 0;
215:   high = p->numOverlapElements - (p->firstElement[p->rank+1] - p->firstElement[p->rank]) - 1;
216:   while (low <= high) {
217:     mid = (low + high)/2;
218:     if (elem == p->ghostElements[mid]) {
219:       *gElem = mid;
220:       return(0);
221:     } else if (elem < p->ghostElements[mid]) {
222:       high = mid - 1;
223:     } else {
224:       low  = mid + 1;
225:     }
226:   }
227:   /* We indicate elements which are not local and also not ghost by -2 */
228:   *gElem = -2;
229:   return(0);
230: }

232: #undef  __FUNCT__
234: /*@
235:   PartitionGlobalToLocalElementIndex - Returns the local element number
236:   corresponding to the global element number.

238:   Not collective

240:   Input Parameters:
241: + part    - The partition
242: - elem    - The canonical global element number

244:   Output Parameter:
245: . locElem - The local element number

247:   Level: intermediate

249: .keywords: partition, local, global
250: .seealso PartitionLocalToGlobalElementIndex()
251: @*/
252: int PartitionGlobalToLocalElementIndex(Partition part, int elem, int *locElem)
253: {
254:   int numLocElements;
255:   int gElem; /* The local ghost element number */

261:   numLocElements = part->firstElement[part->rank+1] - part->firstElement[part->rank];
262:   if (elem < 0) {
263:     *locElem = elem;
264:     return(0);
265:   }
266:   /* Check for ghost element */
267:   if ((elem < part->firstElement[part->rank]) || (elem >= part->firstElement[part->rank+1])) {
268:     /* Search for canonical number */
269:     PartitionGhostElementIndex_Private(part, elem, &gElem);
270:     if (gElem < 0) {
271:       *locElem = gElem;
272:     } else {
273:       *locElem = numLocElements + gElem;
274:     }
275:   } else {
276:     *locElem = elem - part->firstElement[part->rank];
277:   }
278:   return(0);
279: }

281: #undef  __FUNCT__
283: /*@
284:   PartitionLocalToGlobalElementIndex - Returns the global element number
285:   corresponding to the local element number.

287:   Not collective

289:   Input Parameters:
290: + part    - The partition
291: - locElem - The canonical local element number

293:   Output Parameter:
294: . elem    - The global element number

296:   Level: intermediate

298: .keywords: partition, local, global
299: .seealso: PartitionGlobalToLocalElementIndex()
300: @*/
301: int PartitionLocalToGlobalElementIndex(Partition part, int locElem, int *elem)
302: {
303:   int numLocElements;

308:   numLocElements = part->firstElement[part->rank+1] - part->firstElement[part->rank];
309:   if (locElem < 0) {
310:     *elem = locElem;
311:     return(0);
312:   } else if (locElem < numLocElements) {
313:     *elem = locElem + part->firstElement[part->rank];
314:   } else if (locElem < part->numOverlapElements) {
315:     *elem = part->ghostElements[locElem - numLocElements];
316:   } else {
317:     SETERRQ(PETSC_ERR_ARG_WRONG, "Invalid local element index (too large)");
318:   }
319:   return(0);
320: }

322: #undef  __FUNCT__
324: /*@
325:   PartitionGetElementOrdering - This function gets the AO which was used to reorder the mesh elements
326:   during partitioning.

328:   Not collective

330:   Input Parameter:
331: . part  - The partition

333:   Output Parameter:
334: . order - The element ordering, or PETSC_NULL if none exists

336:   Level: intermediate

338: .keywords: Partition, element, ordering, AO
339: .seealso: MeshGetNodeOrdering()
340: @*/
341: int PartitionGetElementOrdering(Partition part, AO *order)
342: {
346:   *order = part->ordering;
347:   return(0);
348: }

350: /*----------------------------------------------- Node Query Functions -----------------------------------------------*/
351: #undef  __FUNCT__
353: /*@
354:   PartitionGetTotalNodes - Gets the number of nodes in the mesh.

356:   Not collective

358:   Input Parameter:
359: . part - The partition

361:   Output Parameter:
362: . size - The number of nodes in the mesh

364:   Level: intermediate

366: .keywords: partition, node
367: .seealso: PartitionGetStartNode(), PartitionGetEndNode(), PartitionGetTotalElements()
368: @*/
369: int PartitionGetTotalNodes(Partition part, int *size)
370: {

376:   if (part->ops->gettotalnodes == PETSC_NULL) {
377:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
378:   }
379:   (*part->ops->gettotalnodes)(part, size);
380:   return(0);
381: }

383: #undef  __FUNCT__
385: /*@
386:   PartitionGetStartNode - Gets the first node in this domain.

388:   Not collective

390:   Input Parameter:
391: . part - The partition

393:   Output Parameter:
394: . node - The first node in this domain

396:   Level: intermediate

398: .keywords: partition, node
399: .seealso: PartitionGetEndNode(), PartitionGetNumNodes(), PartitionGetStartElement()
400: @*/
401: int PartitionGetStartNode(Partition part, int *node)
402: {

408:   if (part->ops->getstartnode == PETSC_NULL) {
409:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
410:   }
411:   (*part->ops->getstartnode)(part, node);
412:   return(0);
413: }

415: #undef  __FUNCT__
417: /*@
418:   PartitionGetEndNode - Gets the first node in the next domain.

420:   Not collective

422:   Input Parameter:
423: . part - The partition

425:   Output Parameter:
426: . node - The first node in the next domain

428:   Level: intermediate

430: .keywords: partition, node
431: .seealso: PartitionGetStartNode(), PartitionGetNumNodes(), PartitionGetEndElement()
432: @*/
433: int PartitionGetEndNode(Partition part, int *node)
434: {

440:   if (part->ops->getendnode == PETSC_NULL) {
441:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
442:   }
443:   (*part->ops->getendnode)(part, node);
444:   return(0);
445: }

447: #undef  __FUNCT__
449: /*@
450:   PartitionGetNumNodes - Gets the number of nodes in this domain.

452:   Not collective

454:   Input Parameter:
455: . part - The partition

457:   Output Parameter:
458: . size - The number of nodes in this domain

460:   Level: intermediate

462: .keywords: partition, node
463: .seealso: PartitionGetStartNode(), PartitionGetEndNode(), PartitionGetNumElements()
464: @*/
465: int PartitionGetNumNodes(Partition part, int *size)
466: {

472:   if (part->ops->getnumnodes == PETSC_NULL) {
473:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
474:   }
475:   (*part->ops->getnumnodes)(part, size);
476:   return(0);
477: }

479: #undef  __FUNCT__
481: /*@
482:   PartitionGetNumOverlapNodes - Gets the number of nodes and ghost nodes for this domain.

484:   Not collective

486:   Input Parameter:
487: . part - The partition

489:   Output Parameter:
490: . size - The number of nodes and ghost nodes this domain

492:   Level: intermediate

494: .keywords: partition, node
495: .seealso: PartitionGetStartNode(), PartitionGetEndNode(), PartitionGetNumOverlapElements()
496: @*/
497: int PartitionGetNumOverlapNodes(Partition part, int *size)
498: {

504:   if (part->ops->getnumoverlapnodes == PETSC_NULL) {
505:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
506:   }
507:   (*part->ops->getnumoverlapnodes)(part, size);
508:   return(0);
509: }

511: #undef  __FUNCT__
513: /*@
514:   PartitionGlobalToLocalNodeIndex - Returns the local node number
515:   corresponding to the global node number.

517:   Not collective

519:   Input Parameters:
520: + part    - The partition
521: - node    - The canonical global node number

523:   Output Parameter:
524: . locNode - The local node number

526:   Level: intermediate

528: .keywords: partition, local, global
529: .seealso: PartitionLocalToGlobalNodeIndex(), PartitionGlobalToLocalElementIndex()
530: @*/
531: int PartitionGlobalToLocalNodeIndex(Partition part, int node, int *locNode)
532: {

538:   if (part->ops->globaltolocalnodeindex == PETSC_NULL) {
539:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
540:   }
541:   (*part->ops->globaltolocalnodeindex)(part, node, locNode);
542:   return(0);
543: }

545: #undef  __FUNCT__
547: /*@
548:   PartitionLocalToGlobalNodeIndex - Returns the global node number
549:   corresponding to the local node number.

551:   Not collective

553:   Input Parameters:
554: + part    - The partition
555: - locNode - The canonical local node number

557:   Output Parameter:
558: . node    - The global node number

560:   Level: intermediate

562: .keywords: partition, local, global
563: .seealso: PartitionGlobalToLocalNodeIndex(), PartitionLocalToGlobalElementIndex()
564: @*/
565: int PartitionLocalToGlobalNodeIndex(Partition part, int locNode, int *node)
566: {

572:   if (part->ops->localtoglobalnodeindex == PETSC_NULL) {
573:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
574:   }
575:   (*part->ops->localtoglobalnodeindex)(part, locNode, node);
576:   return(0);
577: }

579: #undef  __FUNCT__
581: /*@
582:   PartitionGlobalToGhostNodeIndex - Returns the ghost node number
583:   corresponding to the global node number.

585:   Not collective

587:   Input Parameters:
588: + part      - The partition
589: - node      - The canonical global node number

591:   Output Parameters:
592: + ghostNode - The ghost node number (0..numGhosts)
593: - ghostProc - The processor on which the node resides

595:   Level: intermediate

597: .keywords: partition, ghost, global
598: .seealso: PartitionGhostToGlobalNodeIndex(), PartitionGlobalToLocalElementIndex()
599: @*/
600: int PartitionGlobalToGhostNodeIndex(Partition part, int node, int *ghostNode, int *ghostProc)
601: {

607:   if (part->ops->globaltoghostnodeindex == PETSC_NULL) {
608:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
609:   }
610:   (*part->ops->globaltoghostnodeindex)(part, node, ghostNode, ghostProc);
611:   return(0);
612: }

614: #undef  __FUNCT__
616: /*@
617:   PartitionGhostToGlobalNodeIndex - Returns the global node number
618:   corresponding to the ghost node number.

620:   Not collective

622:   Input Parameters:
623: + part      - The partition
624: - ghostNode - The canonical ghost node number (0..numGhosts)

626:   Output Parameters:
627: + node      - The global node number
628: - ghostProc - The processor on which the node resides

630:   Level: intermediate

632: .keywords: partition, ghost, global
633: .seealso: PartitionGlobalToGhostNodeIndex(), PartitionLocalToGlobalElementIndex()
634: @*/
635: int PartitionGhostToGlobalNodeIndex(Partition part, int ghostNode, int *node, int *ghostProc)
636: {

642:   if (part->ops->ghosttoglobalnodeindex == PETSC_NULL) {
643:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
644:   }
645:   (*part->ops->ghosttoglobalnodeindex)(part, ghostNode, node, ghostProc);
646:   return(0);
647: }

649: #undef  __FUNCT__
651: /*@
652:   PartitionGetNodeOrdering - This function gets the AO which was used to reorder the mesh nodes
653:   during partitioning.

655:   Not collective

657:   Input Parameter:
658: . part  - The partition

660:   Output Parameter:
661: . order - The node ordering, or PETSC_NULL if none exists

663:   Level: intermediate

665: .keywords: Partition, node, ordering, AO
666: .seealso: MeshGetNodeOrdering()
667: @*/
668: int PartitionGetNodeOrdering(Partition part, AO *order)
669: {

675:   (*part->ops->getnodeordering)(part, order);
676:   return(0);
677: }

679: /*----------------------------------------------- Face Query Functions -----------------------------------------------*/
680: #undef  __FUNCT__
682: /*@
683:   PartitionGetTotalFaces - Gets the number of faces in the mesh.

685:   Not collective

687:   Input Parameter:
688: . part - The partition

690:   Output Parameter:
691: . size - The number of faces in the mesh

693:   Level: intermediate

695: .keywords: partition, face
696: .seealso: PartitionGetStartFace(), PartitionGetEndFace(), PartitionGetTotalElements()
697: @*/
698: int PartitionGetTotalFaces(Partition part, int *size)
699: {

705:   if (part->ops->gettotalfaces == PETSC_NULL) {
706:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
707:   }
708:   (*part->ops->gettotalfaces)(part, size);
709:   return(0);
710: }

712: #undef  __FUNCT__
714: /*@
715:   PartitionGetStartFace - Gets the first face in this domain.

717:   Not collective

719:   Input Parameter:
720: . part - The partition

722:   Output Parameter:
723: . face - The first face in this domain

725:   Level: intermediate

727: .keywords: partition, face
728: .seealso: PartitionGetEndFace(), PartitionGetNumFaces(), PartitionGetStartElement()
729: @*/
730: int PartitionGetStartFace(Partition part, int *face)
731: {

737:   if (part->ops->getstartface == PETSC_NULL) {
738:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
739:   }
740:   (*part->ops->getstartface)(part, face);
741:   return(0);
742: }

744: #undef  __FUNCT__
746: /*@
747:   PartitionGetEndFace - Gets the first face in the next domain.

749:   Not collective

751:   Input Parameter:
752: . part - The partition

754:   Output Parameter:
755: . face - The first face in the next domain

757:   Level: intermediate

759: .keywords: partition, face
760: .seealso: PartitionGetStartFace(), PartitionGetNumFaces(), PartitionGetEndElement()
761: @*/
762: int PartitionGetEndFace(Partition part, int *face)
763: {

769:   if (part->ops->getendface == PETSC_NULL) {
770:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
771:   }
772:   (*part->ops->getendface)(part, face);
773:   return(0);
774: }

776: #undef  __FUNCT__
778: /*@
779:   PartitionGetNumFaces - Gets the number of faces in this domain.

781:   Not collective

783:   Input Parameter:
784: . part - The partition

786:   Output Parameter:
787: . size - The number of faces in this domain

789:   Level: intermediate

791: .keywords: partition, face
792: .seealso: PartitionGetStartFace(), PartitionGetEndFace(), PartitionGetNumElements()
793: @*/
794: int PartitionGetNumFaces(Partition part, int *size)
795: {

801:   if (part->ops->getnumfaces == PETSC_NULL) {
802:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
803:   }
804:   (*part->ops->getnumfaces)(part, size);
805:   return(0);
806: }

808: #undef  __FUNCT__
810: /*@
811:   PartitionGetNumOverlapFaces - Gets the number of faces and ghost faces this domain.

813:   Not collective

815:   Input Parameter:
816: . part - The partition

818:   Output Parameter:
819: . size - The number of faces and ghost faces this domain

821:   Level: intermediate

823: .keywords: partition, face
824: .seealso: PartitionGetStartFace(), PartitionGetEndFace(), PartitionGetNumOverlapElements()
825: @*/
826: int PartitionGetNumOverlapFaces(Partition part, int *size)
827: {

833:   if (part->ops->getnumoverlapfaces == PETSC_NULL) {
834:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
835:   }
836:   (*part->ops->getnumoverlapfaces)(part, size);
837:   return(0);
838: }

840: #undef  __FUNCT__
842: /*@
843:   PartitionGlobalToLocalFaceIndex - Returns the local face number
844:   corresponding to the global face number.

846:   Not collective

848:   Input Parameters:
849: + part    - The partition
850: - face    - The canonical global face number

852:   Output Parameter:
853: . locFace - The local face number

855:   Level: intermediate

857: .keywords: partition, local, global
858: .seealso: PartitionLocalToGlobalFaceIndex(), PartitionGlobalToLocalElementIndex()
859: @*/
860: int PartitionGlobalToLocalFaceIndex(Partition part, int face, int *locFace)
861: {

867:   if (part->ops->globaltolocalfaceindex == PETSC_NULL) {
868:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
869:   }
870:   (*part->ops->globaltolocalfaceindex)(part, face, locFace);
871:   return(0);
872: }

874: #undef  __FUNCT__
876: /*@
877:   PartitionLocalToGlobalFaceIndex - Returns the global face number
878:   corresponding to the local face number.

880:   Not collective

882:   Input Parameters:
883: + part    - The partition
884: - locFace - The canonical local face number

886:   Output Parameter:
887: . face    - The global face number

889:   Level: intermediate

891: .keywords: partition, local, global
892: .seealso: PartitionGlobalToLocalNodeIndex(), PartitionLocalToGlobalElementIndex()
893: @*/
894: int PartitionLocalToGlobalFaceIndex(Partition part, int locFace, int *face)
895: {

901:   if (part->ops->localtoglobalfaceindex == PETSC_NULL) {
902:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
903:   }
904:   (*part->ops->localtoglobalfaceindex)(part, locFace, face);
905:   return(0);
906: }

908: #undef  __FUNCT__
910: /*@
911:   PartitionGetFaceOrdering - This function gets the AO which was used to reorder the mesh faces
912:   during partitioning.

914:   Not collective

916:   Input Parameter:
917: . part  - The partition

919:   Output Parameter:
920: . order - The face ordering, or PETSC_NULL if none exists

922:   Level: intermediate

924: .keywords: Partition, face, ordering, AO
925: .seealso: MeshGetNodeOrdering()
926: @*/
927: int PartitionGetFaceOrdering(Partition part, AO *order)
928: {

934:   (*part->ops->getfaceordering)(part, order);
935:   return(0);
936: }

938: /*----------------------------------------------- Edge Query Functions -----------------------------------------------*/
939: #undef  __FUNCT__
941: /*@
942:   PartitionGetTotalEdges - Gets the number of edges in the mesh.

944:   Not collective

946:   Input Parameter:
947: . part - The partition

949:   Output Parameter:
950: . size - The number of edges in the mesh

952:   Level: intermediate

954: .keywords: partition, edge
955: .seealso: PartitionGetStartEdge(), PartitionGetEndEdge(), PartitionGetTotalElements()
956: @*/
957: int PartitionGetTotalEdges(Partition part, int *size)
958: {

964:   if (part->ops->gettotaledges == PETSC_NULL) {
965:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
966:   }
967:   (*part->ops->gettotaledges)(part, size);
968:   return(0);
969: }

971: #undef  __FUNCT__
973: /*@
974:   PartitionGetStartEdge - Gets the first edge in this domain.

976:   Not collective

978:   Input Parameter:
979: . part - The partition

981:   Output Parameter:
982: . edge - The first edge in this domain

984:   Level: intermediate

986: .keywords: partition, edge
987: .seealso: PartitionGetEndEdge(), PartitionGetNumEdges(), PartitionGetStartElement()
988: @*/
989: int PartitionGetStartEdge(Partition part, int *edge)
990: {

996:   if (part->ops->getstartedge == PETSC_NULL) {
997:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
998:   }
999:   (*part->ops->getstartedge)(part, edge);
1000:   return(0);
1001: }

1003: #undef  __FUNCT__
1005: /*@
1006:   PartitionGetEndEdge - Gets the first edge in the next domain.

1008:   Not collective

1010:   Input Parameter:
1011: . part - The partition

1013:   Output Parameter:
1014: . edge - The first edge in the next domain

1016:   Level: intermediate

1018: .keywords: partition, edge
1019: .seealso: PartitionGetStartEdge(), PartitionGetNumEdges(), PartitionGetEndElement()
1020: @*/
1021: int PartitionGetEndEdge(Partition part, int *edge)
1022: {

1028:   if (part->ops->getendedge == PETSC_NULL) {
1029:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
1030:   }
1031:   (*part->ops->getendedge)(part, edge);
1032:   return(0);
1033: }

1035: #undef  __FUNCT__
1037: /*@
1038:   PartitionGetNumEdges - Gets the number of edges in this domain.

1040:   Not collective

1042:   Input Parameter:
1043: . part - The partition

1045:   Output Parameter:
1046: . size - The number of edges in this domain

1048:   Level: intermediate

1050: .keywords: partition, edge
1051: .seealso: PartitionGetStartEdge(), PartitionGetEndEdge(), PartitionGetNumElements()
1052: @*/
1053: int PartitionGetNumEdges(Partition part, int *size)
1054: {

1060:   if (part->ops->getnumedges == PETSC_NULL) {
1061:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
1062:   }
1063:   (*part->ops->getnumedges)(part, size);
1064:   return(0);
1065: }

1067: #undef  __FUNCT__
1069: /*@
1070:   PartitionGetNumOverlapEdges - Gets the number of edges and ghost edges this domain.

1072:   Not collective

1074:   Input Parameter:
1075: . part - The partition

1077:   Output Parameter:
1078: . size - The number of edges and ghost edges this domain

1080:   Level: intermediate

1082: .keywords: partition, edge
1083: .seealso: PartitionGetStartEdge(), PartitionGetEndEdge(), PartitionGetNumOverlapElements()
1084: @*/
1085: int PartitionGetNumOverlapEdges(Partition part, int *size)
1086: {

1092:   if (part->ops->getnumoverlapedges == PETSC_NULL) {
1093:     SETERRQ(PETSC_ERR_SUP, "Not implemented for this partition type");
1094:   }
1095:   (*part->ops->getnumoverlapedges)(part, size);
1096:   return(0);
1097: }

1099: #undef  __FUNCT__
1101: /*@
1102:   PartitionGetEdgeOrdering - This function gets the AO which was used to reorder the mesh edges
1103:   during partitioning.

1105:   Not collective

1107:   Input Parameter:
1108: . part  - The partition

1110:   Output Parameter:
1111: . order - The edge ordering, or PETSC_NULL if none exists

1113:   Level: intermediate

1115: .keywords: Partition, edge, ordering, AO
1116: .seealso: MeshGetNodeOrdering()
1117: @*/
1118: int PartitionGetEdgeOrdering(Partition part, AO *order)
1119: {

1125:   (*part->ops->getedgeordering)(part, order);
1126:   return(0);
1127: }