Commits

Shrirang Abhyankar committed a6fa1fb

DMCircuit: DMCircuitDistribute() should also take in the partitioner and overlap.

Comments (0)

Files changed (3)

include/petscdmcircuit.h

 PETSC_EXTERN PetscErrorCode DMCircuitAddNumVariables(DM, PetscInt, PetscInt);
 PETSC_EXTERN PetscErrorCode DMCircuitSetNumVariables(DM, PetscInt, PetscInt);
 PETSC_EXTERN PetscErrorCode DMCircuitGetComponentDataArray(DM, DMCircuitComponentGenericDataType**);
-PETSC_EXTERN PetscErrorCode DMCircuitDistribute(DM, DM*);
+PETSC_EXTERN PetscErrorCode DMCircuitDistribute(DM, const char[], PetscInt,DM*);
 PETSC_EXTERN PetscErrorCode DMCircuitGetSupportingEdges(DM, PetscInt, PetscInt*, const PetscInt*[]);
 PETSC_EXTERN PetscErrorCode DMCircuitGetConnectedNodes(DM, PetscInt, const PetscInt*[]);
 PETSC_EXTERN PetscErrorCode DMCircuitIsGhostVertex(DM, PetscInt, PetscBool*);

src/dm/impls/circuit/circuit.c

   Collective
 
   Input Parameter:
-. oldDM - the original DMCircuit object
++ oldDM - the original DMCircuit object
+. partitioner - The partitioning package, or NULL for the default
+- overlap - The overlap of partitions, 0 is the default
 
   Output Parameter:
 . distDM - the distributed DMCircuit object
 
 .seealso: DMCircuitCreate
 @*/
-PetscErrorCode DMCircuitDistribute(DM oldDM,DM *distDM)
+PetscErrorCode DMCircuitDistribute(DM oldDM, const char partitioner[], PetscInt overlap,DM *distDM)
 {
   PetscErrorCode ierr;
   DM_Circuit     *oldDMcircuit = (DM_Circuit*)oldDM->data;
-  const char*    partitioner="chaco";
   PetscSF        pointsf;
   DM             newDM;
   DM_Circuit     *newDMcircuit;
   newDMcircuit = (DM_Circuit*)newDM->data;
   newDMcircuit->dataheadersize = sizeof(struct _p_DMCircuitComponentHeader)/sizeof(DMCircuitComponentGenericDataType);
   /* Distribute plex dm and dof section */
-  ierr = DMPlexDistribute(oldDMcircuit->plex,partitioner,0,&pointsf,&newDMcircuit->plex);CHKERRQ(ierr);
+  ierr = DMPlexDistribute(oldDMcircuit->plex,partitioner,overlap,&pointsf,&newDMcircuit->plex);CHKERRQ(ierr);
   /* Distribute dof section */
   ierr = PetscSectionCreate(PetscObjectComm((PetscObject)oldDM),&newDMcircuit->DofSection);CHKERRQ(ierr);
   ierr = PetscSFDistributeSection(pointsf,oldDMcircuit->DofSection,NULL,newDMcircuit->DofSection);CHKERRQ(ierr);

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

   if (size > 1) {
     DM distcircuitdm;
     /* Circuit partitioning and distribution of data */
-    ierr = DMCircuitDistribute(circuitdm,&distcircuitdm);CHKERRQ(ierr);
+    ierr = DMCircuitDistribute(circuitdm,"chaco",0,&distcircuitdm);CHKERRQ(ierr);
     ierr = DMDestroy(&circuitdm);CHKERRQ(ierr);
     circuitdm = distcircuitdm;
   }