Actual source code: petscdmnetwork.h

petsc-master 2019-11-16
Report Typos and Errors
  1: /*
  2:   DMNetwork, for parallel unstructured network problems.
  3: */
  4: #if !defined(PETSCDMNETWORK_H)
  5: #define PETSCDMNETWORK_H

  7:  #include <petscdmplex.h>
  8:  #include <petscviewer.h>

 10: /*
 11:   DMNetworkComponentGenericDataType - This is the data type that PETSc uses for storing the component data.
 12:             For compatibility with PetscSF, which is used for data distribution, its declared as PetscInt.
 13:             To get the user-specific data type, one needs to cast it to the appropriate type.
 14: */
 15: typedef PetscInt DMNetworkComponentGenericDataType;

 17: PETSC_EXTERN PetscErrorCode DMNetworkCreate(MPI_Comm,DM*);
 18: PETSC_EXTERN PetscErrorCode DMNetworkSetSizes(DM,PetscInt,PetscInt[],PetscInt[],PetscInt,PetscInt[]);
 19: PETSC_EXTERN PetscErrorCode DMNetworkSetEdgeList(DM,PetscInt*[],PetscInt*[]);
 20: PETSC_EXTERN PetscErrorCode DMNetworkLayoutSetUp(DM);
 21: PETSC_EXTERN PetscErrorCode DMNetworkRegisterComponent(DM,const char*,size_t,PetscInt*);
 22: PETSC_EXTERN PetscErrorCode DMNetworkGetVertexRange(DM,PetscInt*,PetscInt*);
 23: PETSC_EXTERN PetscErrorCode DMNetworkGetEdgeRange(DM,PetscInt*,PetscInt*);
 24: PETSC_EXTERN PetscErrorCode DMNetworkAddComponent(DM,PetscInt,PetscInt,void*);
 25: PETSC_EXTERN PetscErrorCode DMNetworkGetComponent(DM,PetscInt,PetscInt,PetscInt*,void**);
 26: PETSC_EXTERN PetscErrorCode DMNetworkGetNumComponents(DM,PetscInt,PetscInt*);
 27: PETSC_EXTERN PetscErrorCode DMNetworkGetVariableOffset(DM,PetscInt,PetscInt*);
 28: PETSC_EXTERN PetscErrorCode DMNetworkGetVariableGlobalOffset(DM,PetscInt,PetscInt*);
 29: PETSC_EXTERN PetscErrorCode DMNetworkGetEdgeOffset(DM,PetscInt,PetscInt*);
 30: PETSC_EXTERN PetscErrorCode DMNetworkGetVertexOffset(DM,PetscInt,PetscInt*);
 31: PETSC_EXTERN PetscErrorCode DMNetworkAddNumVariables(DM,PetscInt,PetscInt);
 32: PETSC_EXTERN PetscErrorCode DMNetworkGetNumVariables(DM,PetscInt,PetscInt*);
 33: PETSC_EXTERN PetscErrorCode DMNetworkSetNumVariables(DM,PetscInt,PetscInt);
 34: PETSC_EXTERN PetscErrorCode DMNetworkAssembleGraphStructures(DM);
 35: PETSC_EXTERN PetscErrorCode DMNetworkSetVertexLocalToGlobalOrdering(DM);
 36: PETSC_EXTERN PetscErrorCode DMNetworkGetVertexLocalToGlobalOrdering(DM,PetscInt,PetscInt*);
 37: PETSC_EXTERN PetscErrorCode PetscSFGetSubSF(PetscSF,ISLocalToGlobalMapping,PetscSF*);
 38: PETSC_EXTERN PetscErrorCode DMNetworkDistribute(DM*,PetscInt);
 39: PETSC_EXTERN PetscErrorCode DMNetworkGetSupportingEdges(DM,PetscInt,PetscInt*,const PetscInt*[]);
 40: PETSC_EXTERN PetscErrorCode DMNetworkGetConnectedVertices(DM,PetscInt,const PetscInt*[]);
 41: PETSC_EXTERN PetscErrorCode DMNetworkIsGhostVertex(DM,PetscInt,PetscBool*);
 42: PETSC_EXTERN PetscErrorCode DMNetworkEdgeSetMatrix(DM,PetscInt,Mat[]);
 43: PETSC_EXTERN PetscErrorCode DMNetworkVertexSetMatrix(DM,PetscInt,Mat[]);
 44: PETSC_EXTERN PetscErrorCode DMNetworkHasJacobian(DM,PetscBool,PetscBool);
 45: PETSC_EXTERN PetscErrorCode DMNetworkGetPlex(DM,DM*);
 46: PETSC_EXTERN PetscErrorCode DMNetworkGetGlobalEdgeIndex(DM,PetscInt,PetscInt*);
 47: PETSC_EXTERN PetscErrorCode DMNetworkGetGlobalVertexIndex(DM,PetscInt,PetscInt*);

 49: PETSC_EXTERN PetscErrorCode DMNetworkGetSubnetworkInfo(DM,PetscInt,PetscInt*,PetscInt*,const PetscInt**,const PetscInt**);
 50: PETSC_EXTERN PetscErrorCode DMNetworkGetSubnetworkCoupleInfo(DM,PetscInt,PetscInt*,const PetscInt**);

 52: typedef struct _p_DMNetworkMonitorList *DMNetworkMonitorList;
 53: struct _p_DMNetworkMonitorList
 54: {
 55:   PetscViewer viewer;
 56:   Vec         v;
 57:   PetscInt    element;
 58:   PetscInt    nodes;
 59:   PetscInt    start;
 60:   PetscInt    blocksize;
 61:   DMNetworkMonitorList next;
 62: };

 64: typedef struct _p_DMNetworkMonitor *DMNetworkMonitor;
 65: struct _p_DMNetworkMonitor
 66: {
 67:   MPI_Comm             comm;
 68:   DM                   network;
 69:   DMNetworkMonitorList firstnode;
 70: };

 72: PETSC_EXTERN PetscErrorCode DMNetworkMonitorCreate(DM,DMNetworkMonitor*);
 73: PETSC_EXTERN PetscErrorCode DMNetworkMonitorDestroy(DMNetworkMonitor*);
 74: PETSC_EXTERN PetscErrorCode DMNetworkMonitorPop(DMNetworkMonitor);
 75: PETSC_EXTERN PetscErrorCode DMNetworkMonitorAdd(DMNetworkMonitor,const char*,PetscInt,PetscInt,PetscInt,PetscInt,PetscReal,PetscReal,PetscReal,PetscReal,PetscBool);
 76: PETSC_EXTERN PetscErrorCode DMNetworkMonitorView(DMNetworkMonitor,Vec);

 78: #endif