Actual source code: daimpl.h

  1: /* $Id: daimpl.h,v 1.40 2001/04/10 19:37:22 bsmith Exp bsmith $ */

  3: /*
  4:    Distributed arrays - communication tools for parallel, rectangular grids.
  5: */

  7: #if !defined(_DAIMPL_H)
  8: #define _DAIMPL_H
 9:  #include petscda.h

 11: /*
 12:    The DM interface is shared by DA, VecPack, and any other object that may 
 13:   be used with the DMMG class. If you change this MAKE SURE you change
 14:   struct _DAOps and struct _VecPackOps!
 15: */
 16: typedef struct _DMOps *DMOps;
 17: struct _DMOps {
 18:   int  (*view)(DM,PetscViewer);
 19:   int  (*createglobalvector)(DM,Vec*);
 20:   int  (*getcoloring)(DM,ISColoringType,MatType,ISColoring*,Mat*);
 21:   int  (*getinterpolation)(DM,DM,Mat*,Vec*);
 22:   int  (*refine)(DM,MPI_Comm,DM*);
 23: };

 25: struct _p_DM {
 26:   PETSCHEADER(struct _DMOps)
 27: };

 29: typedef struct _DAOps *DAOps;
 30: struct _DAOps {
 31:   int  (*view)(DA,PetscViewer);
 32:   int  (*createglobalvector)(DA,Vec*);
 33:   int  (*getcoloring)(DA,ISColoringType,MatType,ISColoring*,Mat*);
 34:   int  (*getinterpolation)(DA,DA,Mat*,Vec*);
 35:   int  (*refine)(DA,MPI_Comm,DA*);
 36: };

 38: struct _p_DA {
 39:   PETSCHEADER(struct _DAOps)
 40:   int            M,N,P;                 /* array dimensions */
 41:   int            m,n,p;                 /* processor layout */
 42:   int            w;                     /* degrees of freedom per node */
 43:   int            s;                     /* stencil width */
 44:   int            xs,xe,ys,ye,zs,ze;     /* range of local values */
 45:   int            Xs,Xe,Ys,Ye,Zs,Ze;     /* range including ghost values */
 46:                                         /* values above already scaled by w */
 47:   int            *idx,Nl;               /* local to global map */
 48:   int            base;                  /* global number of 1st local node */
 49:   DAPeriodicType wrap;                  /* indicates type of periodic boundaries */
 50:   VecScatter     gtol,ltog,ltol;        /* scatters, see below for details */
 51:   Vec            global,local;          /* vectors that are discrete functions */
 52:   DAStencilType  stencil_type;          /* stencil, either box or star */
 53:   int            dim;                   /* DA dimension (1,2, or 3) */
 54:   int            *gtog1;                /* mapping from global ordering to
 55:                                             ordering that would be used for 1
 56:                                             proc; intended for internal use only */
 57:   AO             ao;                    /* application ordering context */

 59:   ISLocalToGlobalMapping ltogmap,ltogmapb;   /* local to global mapping for associated vectors */
 60:   Vec                    coordinates;        /* coordinates (x,y,x) of local nodes, not including ghosts*/
 61:   char                   **fieldname;        /* names of individual components in vectors */

 63:   int                    *lx,*ly,*lz;        /* number of nodes in each partition block along 3 axis */
 64:   Vec                    natural;            /* global vector for storing items in natural order */
 65:   VecScatter             gton;               /* vector scatter from global to natural */
 66:   Vec                    localin[10],localout[10];   /* work vectors available to users */
 67:   Vec                    globalin[10],globalout[10]; /* work vectors available to users */

 69:   int                    refine_x,refine_y,refine_z; /* ratio used in refining */
 70: };

 72: /*
 73:   Vectors:
 74:      Global has on each processor the interior degrees of freedom and
 75:          no ghost points. This vector is what the solvers usually see.
 76:      Local has on each processor the ghost points as well. This is 
 77:           what code to calculate Jacobians, etc. usually sees.
 78:   Vector scatters:
 79:      gtol - Global representation to local
 80:      ltog - Local representation to global (involves no communication)
 81:      ltol - Local representation to local representation, updates the
 82:             ghostpoint values in the second vector from (correct) interior
 83:             values in the first vector.  This is good for explicit
 84:             nearest neighbor timestepping.
 85: */

 87: EXTERN int DAView_Binary(DA,PetscViewer);
 88: EXTERN_C_BEGIN
 89: EXTERN int VecView_MPI_DA(Vec,PetscViewer);
 90: EXTERN int VecLoadIntoVector_Binary_DA(PetscViewer,Vec);
 91: EXTERN_C_END

 93: EXTERN int DAGetGlobalToGlobal1_Private(DA,int**);

 95: #endif