Actual source code: dmmbimpl.h

petsc-3.7.7 2017-09-25
Report Typos and Errors
  1: #if !defined(_DMMBIMPL_H)
  2: #define _DMMBIMPL_H

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

  7: /* This is an integer map, in addition it is also a container class
  8:    Design points:
  9:      - Low storage is the most important design point
 10:      - We want flexible insertion and deletion
 11:      - We can live with O(log) query, but we need O(1) iteration over strata
 12: */
 13: typedef struct {
 14:   moab::Interface    *mbiface;
 15:   moab::ParallelComm *pcomm;
 16:   moab::Range        *tag_range; /* entities to which this tag applies */
 17:   moab::Tag           tag;
 18:   PetscInt            tag_size;
 19:   PetscBool           new_tag;
 20:   PetscBool           is_global_vec;
 21:   PetscBool           is_native_vec;
 22:   Vec                 local;
 23: } Vec_MOAB;


 26: typedef struct {
 27:   PetscInt                dim;                            /* Current topological dimension handled by DMMoab */
 28:   PetscInt                n,nloc,nghost;                  /* Number of global, local only and shared vertices for current partition */
 29:   PetscInt                nele,neleloc,neleghost;         /* Number of global, local only and shared elements for current partition */
 30:   PetscInt                bs;                             /* Block size that controls the strided vs interlaced configuration in discrete systems -
 31:                                                              This affects the layout and hence the degree-of-freedom of the different fields (components) */
 32:   PetscInt                *gsindices;                     /* Global ID for all local+ghosted vertices */
 33:   PetscInt                *gidmap,*lidmap,*llmap,*lgmap;  /* Global ID indices, Local ID indices, field-based local map, field-based global map */
 34:   PetscInt                vstart,vend;                    /* Global start and end index for distributed Vec */

 36:   /* MOAB objects cached internally in DMMoab */
 37:   moab::Interface         *mbiface;                       /* MOAB Interface/Core reference */
 38:   moab::ParallelComm      *pcomm;                         /* MOAB ParallelComm reference */
 39:   moab::Tag               ltog_tag;                       /* MOAB supports "global id" tags */
 40:   moab::Tag               material_tag;                   /* MOAB supports "material_set" tags */
 41:   moab::Range             *vowned, *vghost, *vlocal;      /* Vertex entities: strictly owned, strictly ghosted, owned+ghosted */
 42:   moab::Range             *elocal, *eghost;               /* Topological dimensional entities: strictly owned, strictly ghosted */
 43:   moab::Range             *bndyvtx,*bndyfaces,*bndyelems; /* Boundary entities: skin vertices, skin faces and elements on the outer skin */
 44:   moab::EntityHandle      fileset;                        /* The Global set to which all local entities belong */

 46:   PetscInt               *dfill, *ofill;

 48:   /* store the mapping information */
 49:   ISLocalToGlobalMapping  ltog_map;
 50:   VecScatter              ltog_sendrecv;

 52:   /* store options to customize DMMoab */
 53:   PetscInt                rw_dbglevel;
 54:   PetscBool               partition_by_rank;
 55:   char                    extra_read_options[PETSC_MAX_PATH_LEN];
 56:   char                    extra_write_options[PETSC_MAX_PATH_LEN];
 57:   MoabReadMode            read_mode;
 58:   MoabWriteMode           write_mode;

 60:   PetscInt                numFields;
 61:   const char              **fieldNames;
 62:   PetscBool               icreatedinstance;               /* true if DM created moab instance internally, will destroy instance in DMDestroy */
 63: } DM_Moab;


 66: PETSC_EXTERN PetscErrorCode DMCreateGlobalVector_Moab(DM,Vec *);
 67: PETSC_EXTERN PetscErrorCode DMCreateLocalVector_Moab(DM,Vec *);
 68: PETSC_EXTERN PetscErrorCode DMCreateMatrix_Moab(DM dm,Mat *J);
 69: PETSC_EXTERN PetscErrorCode DMGlobalToLocalBegin_Moab(DM,Vec,InsertMode,Vec);
 70: PETSC_EXTERN PetscErrorCode DMGlobalToLocalEnd_Moab(DM,Vec,InsertMode,Vec);
 71: PETSC_EXTERN PetscErrorCode DMLocalToGlobalBegin_Moab(DM,Vec,InsertMode,Vec);
 72: PETSC_EXTERN PetscErrorCode DMLocalToGlobalEnd_Moab(DM,Vec,InsertMode,Vec);

 74: #endif /* _DMMBIMPL_H */