Shrirang Abhyankar avatar Shrirang Abhyankar committed b6ab14c

Changed type of the second input argument for DMCircuitSetEdgeList.

Changed type from PetscInt* to int[] since DMPlexCreateFromCellList() takes an int.
Using PetscInt breaks 64-bit int build.

Comments (0)

Files changed (4)

include/petsc-private/dmcircuitimpl.h

   PetscInt                          NNodes; /* Number of global nodes */
   PetscInt                          nEdges; /* Number of local edges */
   PetscInt                          nNodes; /* Number of local nodes */
-  PetscInt                          *edges; /* Edge list */
+  int                               *edges; /* Edge list */
   PetscInt                          pStart,pEnd; /* Start and end indices for topological points */
   PetscInt                          vStart,vEnd; /* Start and end indices for vertices */
   PetscInt                          eStart,eEnd; /* Start and end indices for edges */

include/petscdmcircuit.h

 
 PETSC_EXTERN PetscErrorCode DMCircuitCreate(MPI_Comm, DM*);
 PETSC_EXTERN PetscErrorCode DMCircuitSetSizes(DM, PetscInt, PetscInt, PetscInt, PetscInt);
-PETSC_EXTERN PetscErrorCode DMCircuitSetEdgeList(DM, PetscInt*);
+PETSC_EXTERN PetscErrorCode DMCircuitSetEdgeList(DM, int[]);
 PETSC_EXTERN PetscErrorCode DMCircuitLayoutSetUp(DM);
 PETSC_EXTERN PetscErrorCode DMCircuitRegisterComponent(DM, const char*, PetscInt, PetscInt*);
 PETSC_EXTERN PetscErrorCode DMCircuitGetVertexRange(DM, PetscInt*, PetscInt*);

src/dm/impls/circuit/circuit.c

 
 .seealso: DMCircuitCreate, DMCircuitSetSizes
 @*/
-PetscErrorCode DMCircuitSetEdgeList(DM dm, PetscInt *edgelist)
+PetscErrorCode DMCircuitSetEdgeList(DM dm, int edgelist[])
 {
   DM_Circuit *circuit = (DM_Circuit*) dm->data;
   

src/snes/examples/tutorials/circuit/pflow/pf.c

 
 #undef __FUNCT__
 #define __FUNCT__ "GetListofEdges"
-PetscErrorCode GetListofEdges(PetscInt nbranches, EDGEDATA branch,PetscInt *edges)
+PetscErrorCode GetListofEdges(PetscInt nbranches, EDGEDATA branch,int edges[])
 {
   PetscInt       i, fbus,tbus;
 
   char                 pfdata_file[PETSC_MAX_PATH_LEN]="datafiles/case9.m";
   PFDATA               pfdata;
   PetscInt             numEdges=0,numVertices=0;
-  PetscInt             *edges = NULL;
+  int                  *edges = NULL;
   PetscInt             i;  
   DM                   circuitdm;
   PetscInt             componentkey[4];
     numEdges = pfdata.nbranch;
     numVertices = pfdata.nbus;
 
-    ierr = PetscMalloc(2*numEdges*sizeof(PetscInt),&edges);CHKERRQ(ierr);
+    ierr = PetscMalloc(2*numEdges*sizeof(int),&edges);CHKERRQ(ierr);
     ierr = GetListofEdges(pfdata.nbranch,pfdata.branch,edges);CHKERRQ(ierr);
   }
   PetscLogStagePop();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.