static char help[] = "Check if DMClone for DMNetwork Correctly Shallow Clones Topology Only \n\n"; #include /* CreateStarGraphEdgeList - Create a k-Star Graph Edgelist on current processor Not Collective Input Parameters: . k - order of the star graph (number of edges) . directin - if true direction of edges is towards the center vertex, otherwise they are directed out of the center vertex. Output Parameters: . ne - number of edges of this star graph . edgelist - list of edges for this star graph, this is a one dimensional array with pairs of entries being the two vertices (in global numbering of the vertices) of each edge, [first vertex of first edge, second vertex of first edge, first vertex of second edge, second vertex of second edge, etc]. User is responsible for deallocating this memory. */ PetscErrorCode CreateStarGraphEdgeList(PetscInt k,PetscBool directin, PetscInt *ne, PetscInt *edgelist[]) { PetscInt i; PetscFunctionBegin; *ne = k; PetscCall(PetscCalloc1(2*k,edgelist)); if (directin) { for (i=0; i