Actual source code: petscdmnetwork.h
petsc-3.7.3 2016-08-01
1: /*
2: DMNetwork, for parallel unstructured network problems.
3: */
7: #include <petscdm.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);
19: PETSC_EXTERN PetscErrorCode DMNetworkSetEdgeList(DM,int[]);
20: PETSC_EXTERN PetscErrorCode DMNetworkLayoutSetUp(DM);
21: PETSC_EXTERN PetscErrorCode DMNetworkRegisterComponent(DM,const char*,PetscInt,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 DMNetworkGetNumComponents(DM,PetscInt,PetscInt*);
26: PETSC_EXTERN PetscErrorCode DMNetworkGetComponentTypeOffset(DM,PetscInt,PetscInt,PetscInt*,PetscInt*);
27: PETSC_EXTERN PetscErrorCode DMNetworkGetVariableOffset(DM,PetscInt,PetscInt*);
28: PETSC_EXTERN PetscErrorCode DMNetworkGetVariableGlobalOffset(DM,PetscInt,PetscInt*);
29: PETSC_EXTERN PetscErrorCode DMNetworkAddNumVariables(DM,PetscInt,PetscInt);
30: PETSC_EXTERN PetscErrorCode DMNetworkGetNumVariables(DM,PetscInt,PetscInt*);
31: PETSC_EXTERN PetscErrorCode DMNetworkSetNumVariables(DM,PetscInt,PetscInt);
32: PETSC_EXTERN PetscErrorCode DMNetworkGetComponentDataArray(DM,DMNetworkComponentGenericDataType**);
33: PETSC_EXTERN PetscErrorCode DMNetworkDistribute(DM,PetscInt,DM*);
34: PETSC_EXTERN PetscErrorCode DMNetworkGetSupportingEdges(DM,PetscInt,PetscInt*,const PetscInt*[]);
35: PETSC_EXTERN PetscErrorCode DMNetworkGetConnectedNodes(DM,PetscInt,const PetscInt*[]);
36: PETSC_EXTERN PetscErrorCode DMNetworkIsGhostVertex(DM,PetscInt,PetscBool*);
37: PETSC_EXTERN PetscErrorCode DMNetworkEdgeSetMatrix(DM,PetscInt,Mat[]);
38: PETSC_EXTERN PetscErrorCode DMNetworkVertexSetMatrix(DM,PetscInt,Mat[]);
39: PETSC_EXTERN PetscErrorCode DMNetworkHasJacobian(DM,PetscBool,PetscBool);
41: typedef struct _p_DMNetworkMonitorList *DMNetworkMonitorList;
42: struct _p_DMNetworkMonitorList
43: {
44: PetscViewer viewer;
45: Vec v;
46: PetscInt element;
47: PetscInt nodes;
48: PetscInt start;
49: PetscInt blocksize;
50: DMNetworkMonitorList next;
51: };
53: typedef struct _p_DMNetworkMonitor *DMNetworkMonitor;
54: struct _p_DMNetworkMonitor
55: {
56: MPI_Comm comm;
57: DM network;
58: DMNetworkMonitorList firstnode;
59: };
61: PETSC_EXTERN PetscErrorCode DMNetworkMonitorCreate(DM,DMNetworkMonitor*);
62: PETSC_EXTERN PetscErrorCode DMNetworkMonitorDestroy(DMNetworkMonitor*);
63: PETSC_EXTERN PetscErrorCode DMNetworkMonitorPop(DMNetworkMonitor);
64: PETSC_EXTERN PetscErrorCode DMNetworkMonitorAdd(DMNetworkMonitor,const char*,PetscInt,PetscInt,PetscInt,PetscInt,PetscReal,PetscReal,PetscBool);
65: PETSC_EXTERN PetscErrorCode DMNetworkMonitorView(DMNetworkMonitor,Vec);
67: #endif