Date: 2016-07-24T16:58:50+00:00

Actual source code: dmnetworkimpl.h
petsc-3.7.3 2016-07-24
Report Typos and Errors

      1: #if !defined(_NETWORKIMPL_H)
      2: #define _NETWORKIMPL_H

      4: #include <petscmat.h>       /*I      "petscmat.h"          I*/
      5: #include <petscdmnetwork.h> /*I      "petscdmnetwork.h"    I*/
     6:  #include petsc/private/dmimpl.h

      8: #define MAX_DATA_AT_POINT 14

     10: typedef struct _p_DMNetworkComponentHeader *DMNetworkComponentHeader;
     11: struct _p_DMNetworkComponentHeader {
     12:   PetscInt ndata;
     13:   PetscInt size[MAX_DATA_AT_POINT];
     14:   PetscInt key[MAX_DATA_AT_POINT];
     15:   PetscInt offset[MAX_DATA_AT_POINT];
     16: } PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));

     18: typedef struct _p_DMNetworkComponentValue *DMNetworkComponentValue;
     19: struct _p_DMNetworkComponentValue {
     20:   void* data[MAX_DATA_AT_POINT];
     21: } PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));

     23: typedef struct {
     24:   char     name[32-sizeof(PetscInt)];
     25:   PetscInt size;
     26: } DMNetworkComponent PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));

     28: typedef struct {
     29:   PetscInt                          refct;  /* reference count */
     30:   PetscInt                          NEdges; /* Number of global edges */
     31:   PetscInt                          NNodes; /* Number of global nodes */
     32:   PetscInt                          nEdges; /* Number of local edges */
     33:   PetscInt                          nNodes; /* Number of local nodes */
     34:   int                               *edges; /* Edge list */
     35:   PetscInt                          pStart,pEnd; /* Start and end indices for topological points */
     36:   PetscInt                          vStart,vEnd; /* Start and end indices for vertices */
     37:   PetscInt                          eStart,eEnd; /* Start and end indices for edges */
     38:   DM                                plex;     /* DM created from Plex */
     39:   PetscSection                      DataSection; /* Section for managing parameter distribution */
     40:   PetscSection                      DofSection;  /* Section for managing data distribution */
     41:   PetscSection                      GlobalDofSection; /* Global Dof section */
     42:   PetscInt                          ncomponent; /* Number of components */
     43:   DMNetworkComponent                component[10]; /* List of components */
     44:   DMNetworkComponentHeader          header;
     45:   DMNetworkComponentValue           cvalue;
     46:   PetscInt                          dataheadersize;
     47:   DMNetworkComponentGenericDataType *componentdataarray; /* Array to hold the data */

     49:   PetscBool                         userEdgeJacobian,userVertexJacobian;  /* Global flag for using user's sub Jacobians */
     50:   Mat                               *Je;  /* Pointer array to hold local sub Jacobians for edges, 3 elements for an edge */
     51:   Mat                               *Jv;  /* Pointer array to hold local sub Jacobians for vertices, 1+2*nsupportedges for a vertex */
     52:   PetscInt                          *Jvptr;   /* index of Jv for v-th vertex
     53:                                               Jvpt[v-vStart]:    Jacobian(v,v)
     54:                                               Jvpt[v-vStart]+2i+1: Jacobian(v,e[i]),   e[i]: i-th supporting edge
     55:                                               Jvpt[v-vStart]+2i+2: Jacobian(v,vc[i]), vc[i]: i-th connected vertex
     56:                                               */
     57: } DM_Network;

     59: #endif /* _NETWORKIMPL_H */