Actual source code: taois_petsc.h

  1: #ifndef TAOPETSCIS_H
  2: #define TAOPETSCIS_H

 4:  #include taois.h
  5: #include "petscmat.h"

 7:  #include ../include/taopetsc.h

  9: class TaoIndexSetPetsc: public TaoIndexSet{

 11: protected:

 13:   IS isp;             /* The underlying IS repesentation of the IndexSet                */
 14:   Vec VSpace;         /* Instance of a vector from the full space that the IS describes */
 15:   int nlocal;         /* Local size of VSpace        */
 16:   int *iptr;          /* Work array of length nlocal */

 18:   IS ispComplement;   /* Complement of isp              */

 20:   IS isp2;                     /* Parallel redistribution of isp                                 */
 21:   TaoPetscISType reducedtype;  /* Mask full space or use reduced data structures                 */
 22:   IS ISGathered;               /* All of isp collected onto each matrix                          */
 23:   VecScatter scatter;          /* Scatter from full space to reduced space                       */

 25:   PetscViewer ispviewer;       /* View the IS  */

 27:   int SetUp(Vec, IS);
 28:   int clearit();

 30: public:

 32:   TaoIndexSetPetsc(Vec, IS SS);
 33:   TaoIndexSetPetsc(Vec);

 35:   ~TaoIndexSetPetsc();

 37:   /* Special to TaoIndexSetPetsc */
 38:   int SetIS(IS);
 39:   inline IS GetIS(){return isp;}

 41:   int GetReducedType(TaoPetscISType *);
 42:   int GetWholeIS(IS*);
 43:   int RedistributeIS(IS*);
 44:   int GetReducedVecScatter(Vec,Vec,VecScatter*);

 46:   int GetMask(Vec *);
 47:   int GetComplementIS(IS*);

 49:   /* These virtual methods of the TaoIndexSet are defined */
 50:   int UnionOf(TaoIndexSet *, TaoIndexSet*);
 51:   int IntersectionOf(TaoIndexSet*, TaoIndexSet*);
 52:   int ComplementOf(TaoIndexSet*);

 54:   int Duplicate(TaoIndexSet**);

 56:   int IsSame(TaoIndexSet*, TaoTruth*);

 58:   int WhichEqual(TaoVec*,TaoVec*);

 60:   int WhichLessThan(TaoVec*,TaoVec*);

 62:   int WhichGreaterThan(TaoVec*,TaoVec*);

 64:   int WhichBetween(TaoVec*,TaoVec*,TaoVec*);

 66:   int WhichBetweenOrEqual(TaoVec *, TaoVec *, TaoVec *);

 68:   int GetSize(int *);

 70:   int View();

 72: };

 74: int ISCreateComplement(IS, Vec, IS *);
 75: int MatCreateSubMatrixFree(Mat,IS,IS,Mat *);
 76: int VecISSetToConstant(IS, PetscScalar, Vec);

 78: #endif