LCOV - code coverage report
Current view: top level - var/lib/buildbot/slaves/linux-gnu-gcov/petsc/include - petscvec.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 6 6 100.0 %
Date: 2019-08-24 05:55:29 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :     Defines the vector component of PETSc. Vectors generally represent
       3             :   degrees of freedom for finite element/finite difference functions
       4             :   on a grid. They have more mathematical structure then simple arrays.
       5             : */
       6             : 
       7             : #ifndef PETSCVEC_H
       8             : #define PETSCVEC_H
       9             : #include <petscis.h>
      10             : #include <petscviewer.h>
      11             : 
      12             : /*S
      13             :      Vec - Abstract PETSc vector object
      14             : 
      15             :    Level: beginner
      16             : 
      17             : .seealso:  VecCreate(), VecType, VecSetType()
      18             : S*/
      19             : typedef struct _p_Vec*         Vec;
      20             : 
      21             : /*S
      22             :      VecScatter - Object used to manage communication of data
      23             :        between vectors in parallel. Manages both scatters and gathers
      24             : 
      25             :    Level: beginner
      26             : 
      27             : .seealso:  VecScatterCreate(), VecScatterBegin(), VecScatterEnd()
      28             : S*/
      29             : typedef struct _p_VecScatter*  VecScatter;
      30             : 
      31             : /*E
      32             :   ScatterMode - Determines the direction of a scatter
      33             : 
      34             :   Level: beginner
      35             : 
      36             : .seealso: VecScatter, VecScatterBegin(), VecScatterEnd()
      37             : E*/
      38             : typedef enum {SCATTER_FORWARD=0, SCATTER_REVERSE=1, SCATTER_FORWARD_LOCAL=2, SCATTER_REVERSE_LOCAL=3, SCATTER_LOCAL=2} ScatterMode;
      39             : 
      40             : /*MC
      41             :     SCATTER_FORWARD - Scatters the values as dictated by the VecScatterCreate() call
      42             : 
      43             :     Level: beginner
      44             : 
      45             : .seealso: VecScatter, ScatterMode, VecScatterCreate(), VecScatterBegin(), VecScatterEnd(), SCATTER_REVERSE, SCATTER_FORWARD_LOCAL,
      46             :           SCATTER_REVERSE_LOCAL
      47             : 
      48             : M*/
      49             : 
      50             : /*MC
      51             :     SCATTER_REVERSE - Moves the values in the opposite direction then the directions indicated in
      52             :          in the VecScatterCreate()
      53             : 
      54             :     Level: beginner
      55             : 
      56             : .seealso: VecScatter, ScatterMode, VecScatterCreate(), VecScatterBegin(), VecScatterEnd(), SCATTER_FORWARD, SCATTER_FORWARD_LOCAL,
      57             :           SCATTER_REVERSE_LOCAL
      58             : 
      59             : M*/
      60             : 
      61             : /*MC
      62             :     SCATTER_FORWARD_LOCAL - Scatters the values as dictated by the VecScatterCreate() call except NO parallel communication
      63             :        is done. Any variables that have be moved between processes are ignored
      64             : 
      65             :     Level: developer
      66             : 
      67             : .seealso: VecScatter, ScatterMode, VecScatterCreate(), VecScatterBegin(), VecScatterEnd(), SCATTER_REVERSE, SCATTER_FORWARD,
      68             :           SCATTER_REVERSE_LOCAL
      69             : 
      70             : M*/
      71             : 
      72             : /*MC
      73             :     SCATTER_REVERSE_LOCAL - Moves the values in the opposite direction then the directions indicated in
      74             :          in the VecScatterCreate()  except NO parallel communication
      75             :        is done. Any variables that have be moved between processes are ignored
      76             : 
      77             :     Level: developer
      78             : 
      79             : .seealso: VecScatter, ScatterMode, VecScatterCreate(), VecScatterBegin(), VecScatterEnd(), SCATTER_FORWARD, SCATTER_FORWARD_LOCAL,
      80             :           SCATTER_REVERSE
      81             : 
      82             : M*/
      83             : 
      84             : /*J
      85             :     VecType - String with the name of a PETSc vector
      86             : 
      87             :    Level: beginner
      88             : 
      89             : .seealso: VecSetType(), Vec, VecCreate(), VecDestroy()
      90             : J*/
      91             : typedef const char* VecType;
      92             : #define VECSEQ         "seq"
      93             : #define VECMPI         "mpi"
      94             : #define VECSTANDARD    "standard"   /* seq on one process and mpi on several */
      95             : #define VECSHARED      "shared"
      96             : #define VECSEQVIENNACL "seqviennacl"
      97             : #define VECMPIVIENNACL "mpiviennacl"
      98             : #define VECVIENNACL    "viennacl"   /* seqviennacl on one process and mpiviennacl on several */
      99             : #define VECSEQCUDA     "seqcuda"
     100             : #define VECMPICUDA     "mpicuda"
     101             : #define VECCUDA        "cuda"       /* seqcuda on one process and mpicuda on several */
     102             : #define VECNEST        "nest"
     103             : #define VECNODE        "node"       /* use on-node shared memory */
     104             : 
     105             : /*J
     106             :     VecScatterType - String with the name of a PETSc vector scatter type
     107             : 
     108             :    Level: beginner
     109             : 
     110             : .seealso: VecScatterSetType(), VecScatter, VecScatterCreate(), VecScatterDestroy()
     111             : J*/
     112             : typedef const char* VecScatterType;
     113             : #define VECSCATTERSEQ       "seq"
     114             : #define VECSCATTERMPI1      "mpi1"
     115             : #define VECSCATTERMPI3      "mpi3"     /* use MPI3 on-node shared memory */
     116             : #define VECSCATTERMPI3NODE  "mpi3node" /* use MPI3 on-node shared memory for vector type VECNODE */
     117             : #define VECSCATTERSF        "sf"       /* use StarForest */
     118             : 
     119             : /* Dynamic creation and loading functions */
     120             : PETSC_EXTERN PetscFunctionList VecScatterList;
     121             : PETSC_EXTERN PetscErrorCode VecScatterSetType(VecScatter, VecScatterType);
     122             : PETSC_EXTERN PetscErrorCode VecScatterGetType(VecScatter, VecScatterType *);
     123             : PETSC_EXTERN PetscErrorCode VecScatterSetFromOptions(VecScatter);
     124             : PETSC_EXTERN PetscErrorCode VecScatterRegister(const char[],PetscErrorCode (*)(VecScatter));
     125             : PETSC_EXTERN PetscErrorCode VecScatterCreate(Vec,IS,Vec,IS,VecScatter*);
     126             : PETSC_EXTERN PetscErrorCode VecScatterInitializePackage(void);
     127             : PETSC_EXTERN PetscErrorCode VecScatterFinalizePackage(void);
     128             : 
     129             : /* Logging support */
     130             : #define    REAL_FILE_CLASSID 1211213
     131             : #define    VEC_FILE_CLASSID 1211214
     132             : PETSC_EXTERN PetscClassId VEC_CLASSID;
     133             : PETSC_EXTERN PetscClassId VEC_SCATTER_CLASSID;
     134             : 
     135             : 
     136             : PETSC_EXTERN PetscErrorCode VecInitializePackage(void);
     137             : PETSC_EXTERN PetscErrorCode VecFinalizePackage(void);
     138             : 
     139             : PETSC_EXTERN PetscErrorCode VecCreate(MPI_Comm,Vec*);
     140             : PETSC_EXTERN PetscErrorCode VecCreateSeq(MPI_Comm,PetscInt,Vec*);
     141             : PETSC_EXTERN PetscErrorCode VecCreateMPI(MPI_Comm,PetscInt,PetscInt,Vec*);
     142             : PETSC_EXTERN PetscErrorCode VecCreateSeqWithArray(MPI_Comm,PetscInt,PetscInt,const PetscScalar[],Vec*);
     143             : PETSC_EXTERN PetscErrorCode VecCreateMPIWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscScalar[],Vec*);
     144             : PETSC_EXTERN PetscErrorCode VecCreateShared(MPI_Comm,PetscInt,PetscInt,Vec*);
     145             : PETSC_EXTERN PetscErrorCode VecCreateNode(MPI_Comm,PetscInt,PetscInt,Vec*);
     146             : 
     147             : PETSC_EXTERN PetscErrorCode VecSetFromOptions(Vec);
     148         156 : PETSC_STATIC_INLINE PetscErrorCode VecViewFromOptions(Vec A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);}
     149             : 
     150             : PETSC_EXTERN PetscErrorCode VecSetUp(Vec);
     151             : PETSC_EXTERN PetscErrorCode VecDestroy(Vec*);
     152             : PETSC_EXTERN PetscErrorCode VecZeroEntries(Vec);
     153             : PETSC_EXTERN PetscErrorCode VecSetOptionsPrefix(Vec,const char[]);
     154             : PETSC_EXTERN PetscErrorCode VecAppendOptionsPrefix(Vec,const char[]);
     155             : PETSC_EXTERN PetscErrorCode VecGetOptionsPrefix(Vec,const char*[]);
     156             : 
     157             : PETSC_EXTERN PetscErrorCode VecSetSizes(Vec,PetscInt,PetscInt);
     158             : 
     159             : PETSC_EXTERN PetscErrorCode VecDotNorm2(Vec,Vec,PetscScalar*,PetscReal*);
     160             : PETSC_EXTERN PetscErrorCode VecDot(Vec,Vec,PetscScalar*);
     161             : PETSC_EXTERN PetscErrorCode VecDotRealPart(Vec,Vec,PetscReal*);
     162             : PETSC_EXTERN PetscErrorCode VecTDot(Vec,Vec,PetscScalar*);
     163             : PETSC_EXTERN PetscErrorCode VecMDot(Vec,PetscInt,const Vec[],PetscScalar[]);
     164             : PETSC_EXTERN PetscErrorCode VecMTDot(Vec,PetscInt,const Vec[],PetscScalar[]);
     165             : PETSC_EXTERN PetscErrorCode VecGetSubVector(Vec,IS,Vec*);
     166             : PETSC_EXTERN PetscErrorCode VecRestoreSubVector(Vec,IS,Vec*);
     167             : 
     168             : /*E
     169             :     NormType - determines what type of norm to compute
     170             : 
     171             :     Level: beginner
     172             : 
     173             : .seealso: VecNorm(), VecNormBegin(), VecNormEnd(), MatNorm()
     174             : E*/
     175             : typedef enum {NORM_1=0,NORM_2=1,NORM_FROBENIUS=2,NORM_INFINITY=3,NORM_1_AND_2=4} NormType;
     176             : PETSC_EXTERN const char *const NormTypes[];
     177             : #define NORM_MAX NORM_INFINITY
     178             : 
     179             : /*MC
     180             :      NORM_1 - the one norm, ||v|| = sum_i | v_i |. ||A|| = max_j || v_*j ||, maximum column sum
     181             : 
     182             :    Level: beginner
     183             : 
     184             : .seealso:  NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_2, NORM_FROBENIUS,
     185             :            NORM_INFINITY, NORM_1_AND_2
     186             : 
     187             : M*/
     188             : 
     189             : /*MC
     190             :      NORM_2 - the two norm, ||v|| = sqrt(sum_i |v_i|^2) (vectors only)
     191             : 
     192             :    Level: beginner
     193             : 
     194             : .seealso:  NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_FROBENIUS,
     195             :            NORM_INFINITY, NORM_1_AND_2
     196             : 
     197             : M*/
     198             : 
     199             : /*MC
     200             :      NORM_FROBENIUS - ||A|| = sqrt(sum_ij |A_ij|^2), same as NORM_2 for vectors
     201             : 
     202             :    Level: beginner
     203             : 
     204             : .seealso:  NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2,
     205             :            NORM_INFINITY, NORM_1_AND_2
     206             : 
     207             : M*/
     208             : 
     209             : /*MC
     210             :      NORM_INFINITY - ||v|| = max_i |v_i|. ||A|| = max_i || v_i* ||, maximum row sum
     211             : 
     212             :    Level: beginner
     213             : 
     214             : .seealso:  NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2,
     215             :            NORM_FROBINIUS, NORM_1_AND_2
     216             : 
     217             : M*/
     218             : 
     219             : /*MC
     220             :      NORM_1_AND_2 - computes both the 1 and 2 norm of a vector
     221             : 
     222             :    Level: beginner
     223             : 
     224             : .seealso:  NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2,
     225             :            NORM_FROBINIUS, NORM_INFINITY
     226             : 
     227             : M*/
     228             : 
     229             : /*MC
     230             :      NORM_MAX - see NORM_INFINITY
     231             : 
     232             :    Level: beginner
     233             : 
     234             : M*/
     235             : 
     236             : PETSC_EXTERN PetscErrorCode VecNorm(Vec,NormType,PetscReal *);
     237             : PETSC_EXTERN PetscErrorCode VecNormAvailable(Vec,NormType,PetscBool *,PetscReal *);
     238             : PETSC_EXTERN PetscErrorCode VecNormalize(Vec,PetscReal *);
     239             : PETSC_EXTERN PetscErrorCode VecSum(Vec,PetscScalar*);
     240             : PETSC_EXTERN PetscErrorCode VecMax(Vec,PetscInt*,PetscReal *);
     241             : PETSC_EXTERN PetscErrorCode VecMin(Vec,PetscInt*,PetscReal *);
     242             : PETSC_EXTERN PetscErrorCode VecScale(Vec,PetscScalar);
     243             : PETSC_EXTERN PetscErrorCode VecCopy(Vec,Vec);
     244             : PETSC_EXTERN PetscErrorCode VecSetRandom(Vec,PetscRandom);
     245             : PETSC_EXTERN PetscErrorCode VecSet(Vec,PetscScalar);
     246             : PETSC_EXTERN PetscErrorCode VecSetInf(Vec);
     247             : PETSC_EXTERN PetscErrorCode VecSwap(Vec,Vec);
     248             : PETSC_EXTERN PetscErrorCode VecAXPY(Vec,PetscScalar,Vec);
     249             : PETSC_EXTERN PetscErrorCode VecAXPBY(Vec,PetscScalar,PetscScalar,Vec);
     250             : PETSC_EXTERN PetscErrorCode VecMAXPY(Vec,PetscInt,const PetscScalar[],Vec[]);
     251             : PETSC_EXTERN PetscErrorCode VecAYPX(Vec,PetscScalar,Vec);
     252             : PETSC_EXTERN PetscErrorCode VecWAXPY(Vec,PetscScalar,Vec,Vec);
     253             : PETSC_EXTERN PetscErrorCode VecAXPBYPCZ(Vec,PetscScalar,PetscScalar,PetscScalar,Vec,Vec);
     254             : PETSC_EXTERN PetscErrorCode VecPointwiseMax(Vec,Vec,Vec);
     255             : PETSC_EXTERN PetscErrorCode VecPointwiseMaxAbs(Vec,Vec,Vec);
     256             : PETSC_EXTERN PetscErrorCode VecPointwiseMin(Vec,Vec,Vec);
     257             : PETSC_EXTERN PetscErrorCode VecPointwiseMult(Vec,Vec,Vec);
     258             : PETSC_EXTERN PetscErrorCode VecPointwiseDivide(Vec,Vec,Vec);
     259             : PETSC_EXTERN PetscErrorCode VecMaxPointwiseDivide(Vec,Vec,PetscReal*);
     260             : PETSC_EXTERN PetscErrorCode VecShift(Vec,PetscScalar);
     261             : PETSC_EXTERN PetscErrorCode VecReciprocal(Vec);
     262             : PETSC_EXTERN PetscErrorCode VecPermute(Vec, IS, PetscBool );
     263             : PETSC_EXTERN PetscErrorCode VecSqrtAbs(Vec);
     264             : PETSC_EXTERN PetscErrorCode VecLog(Vec);
     265             : PETSC_EXTERN PetscErrorCode VecExp(Vec);
     266             : PETSC_EXTERN PetscErrorCode VecAbs(Vec);
     267             : PETSC_EXTERN PetscErrorCode VecDuplicate(Vec,Vec*);
     268             : PETSC_EXTERN PetscErrorCode VecDuplicateVecs(Vec,PetscInt,Vec*[]);
     269             : PETSC_EXTERN PetscErrorCode VecDestroyVecs(PetscInt, Vec*[]);
     270             : PETSC_EXTERN PetscErrorCode VecStrideNormAll(Vec,NormType,PetscReal[]);
     271             : PETSC_EXTERN PetscErrorCode VecStrideMaxAll(Vec,PetscInt [],PetscReal []);
     272             : PETSC_EXTERN PetscErrorCode VecStrideMinAll(Vec,PetscInt [],PetscReal []);
     273             : PETSC_EXTERN PetscErrorCode VecStrideScaleAll(Vec,const PetscScalar[]);
     274             : PETSC_EXTERN PetscErrorCode VecUniqueEntries(Vec,PetscInt*,PetscScalar**);
     275             : 
     276             : PETSC_EXTERN PetscErrorCode VecStrideNorm(Vec,PetscInt,NormType,PetscReal*);
     277             : PETSC_EXTERN PetscErrorCode VecStrideMax(Vec,PetscInt,PetscInt *,PetscReal *);
     278             : PETSC_EXTERN PetscErrorCode VecStrideMin(Vec,PetscInt,PetscInt *,PetscReal *);
     279             : PETSC_EXTERN PetscErrorCode VecStrideScale(Vec,PetscInt,PetscScalar);
     280             : PETSC_EXTERN PetscErrorCode VecStrideSet(Vec,PetscInt,PetscScalar);
     281             : 
     282             : 
     283             : PETSC_EXTERN PetscErrorCode VecStrideGather(Vec,PetscInt,Vec,InsertMode);
     284             : PETSC_EXTERN PetscErrorCode VecStrideScatter(Vec,PetscInt,Vec,InsertMode);
     285             : PETSC_EXTERN PetscErrorCode VecStrideGatherAll(Vec,Vec[],InsertMode);
     286             : PETSC_EXTERN PetscErrorCode VecStrideScatterAll(Vec[],Vec,InsertMode);
     287             : 
     288             : PETSC_EXTERN PetscErrorCode VecStrideSubSetScatter(Vec,PetscInt,const PetscInt[],const PetscInt[],Vec,InsertMode);
     289             : PETSC_EXTERN PetscErrorCode VecStrideSubSetGather(Vec,PetscInt,const PetscInt[],const PetscInt[],Vec,InsertMode);
     290             : 
     291             : PETSC_EXTERN PetscErrorCode VecSetValues(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode);
     292             : PETSC_EXTERN PetscErrorCode VecGetValues(Vec,PetscInt,const PetscInt[],PetscScalar[]);
     293             : PETSC_EXTERN PetscErrorCode VecAssemblyBegin(Vec);
     294             : PETSC_EXTERN PetscErrorCode VecAssemblyEnd(Vec);
     295             : PETSC_EXTERN PetscErrorCode VecStashSetInitialSize(Vec,PetscInt,PetscInt);
     296             : PETSC_EXTERN PetscErrorCode VecStashView(Vec,PetscViewer);
     297             : PETSC_EXTERN PetscErrorCode VecStashViewFromOptions(Vec,PetscObject,const char[]);
     298             : PETSC_EXTERN PetscErrorCode VecStashGetInfo(Vec,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
     299             : 
     300             : /*MC
     301             :    VecSetValue - Set a single entry into a vector.
     302             : 
     303             :    Synopsis:
     304             :    #include <petscvec.h>
     305             :    PetscErrorCode VecSetValue(Vec v,PetscInt row,PetscScalar value, InsertMode mode);
     306             : 
     307             :    Not Collective
     308             : 
     309             :    Input Parameters:
     310             : +  v - the vector
     311             : .  row - the row location of the entry
     312             : .  value - the value to insert
     313             : -  mode - either INSERT_VALUES or ADD_VALUES
     314             : 
     315             :    Notes:
     316             :    For efficiency one should use VecSetValues() and set several or
     317             :    many values simultaneously if possible.
     318             : 
     319             :    These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd()
     320             :    MUST be called after all calls to VecSetValue() have been completed.
     321             : 
     322             :    VecSetValue() uses 0-based indices in Fortran as well as in C.
     323             : 
     324             :    Level: beginner
     325             : 
     326             : .seealso: VecSetValues(), VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValueLocal()
     327             : M*/
     328             : PETSC_STATIC_INLINE PetscErrorCode VecSetValue(Vec v,PetscInt i,PetscScalar va,InsertMode mode) {return VecSetValues(v,1,&i,&va,mode);}
     329             : 
     330             : 
     331             : PETSC_EXTERN PetscErrorCode VecSetBlockSize(Vec,PetscInt);
     332             : PETSC_EXTERN PetscErrorCode VecGetBlockSize(Vec,PetscInt*);
     333             : PETSC_EXTERN PetscErrorCode VecSetValuesBlocked(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode);
     334             : 
     335             : /* Dynamic creation and loading functions */
     336             : PETSC_EXTERN PetscFunctionList VecList;
     337             : PETSC_EXTERN PetscErrorCode VecSetType(Vec, VecType);
     338             : PETSC_EXTERN PetscErrorCode VecGetType(Vec, VecType *);
     339             : PETSC_EXTERN PetscErrorCode VecRegister(const char[],PetscErrorCode (*)(Vec));
     340             : 
     341             : PETSC_EXTERN PetscErrorCode VecScatterBegin(VecScatter,Vec,Vec,InsertMode,ScatterMode);
     342             : PETSC_EXTERN PetscErrorCode VecScatterEnd(VecScatter,Vec,Vec,InsertMode,ScatterMode);
     343             : PETSC_EXTERN PetscErrorCode VecScatterDestroy(VecScatter*);
     344             : PETSC_EXTERN PetscErrorCode VecScatterSetUp(VecScatter);
     345             : PETSC_EXTERN PetscErrorCode VecScatterCopy(VecScatter,VecScatter *);
     346             : PETSC_EXTERN PetscErrorCode VecScatterView(VecScatter,PetscViewer);
     347             : PETSC_STATIC_INLINE PetscErrorCode VecScatterViewFromOptions(VecScatter A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
     348             : PETSC_EXTERN PetscErrorCode VecScatterRemap(VecScatter,PetscInt[],PetscInt[]);
     349             : PETSC_EXTERN PetscErrorCode VecScatterGetMerged(VecScatter,PetscBool *);
     350             : 
     351             : PETSC_EXTERN PetscErrorCode VecGetArray4d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     352             : PETSC_EXTERN PetscErrorCode VecRestoreArray4d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     353             : PETSC_EXTERN PetscErrorCode VecGetArray3d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     354             : PETSC_EXTERN PetscErrorCode VecRestoreArray3d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     355             : PETSC_EXTERN PetscErrorCode VecGetArray2d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     356             : PETSC_EXTERN PetscErrorCode VecRestoreArray2d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     357             : PETSC_EXTERN PetscErrorCode VecGetArray1d(Vec,PetscInt,PetscInt,PetscScalar *[]);
     358             : PETSC_EXTERN PetscErrorCode VecRestoreArray1d(Vec,PetscInt,PetscInt,PetscScalar *[]);
     359             : 
     360             : PETSC_EXTERN PetscErrorCode VecGetArray4dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     361             : PETSC_EXTERN PetscErrorCode VecGetArray4dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     362             : PETSC_EXTERN PetscErrorCode VecRestoreArray4dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     363             : PETSC_EXTERN PetscErrorCode VecGetArray3dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     364             : PETSC_EXTERN PetscErrorCode VecRestoreArray3dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     365             : PETSC_EXTERN PetscErrorCode VecGetArray2dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     366             : PETSC_EXTERN PetscErrorCode VecRestoreArray2dWrite(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     367             : PETSC_EXTERN PetscErrorCode VecGetArray1dWrite(Vec,PetscInt,PetscInt,PetscScalar *[]);
     368             : PETSC_EXTERN PetscErrorCode VecRestoreArray1dWrite(Vec,PetscInt,PetscInt,PetscScalar *[]);
     369             : 
     370             : PETSC_EXTERN PetscErrorCode VecGetArray4dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     371             : PETSC_EXTERN PetscErrorCode VecRestoreArray4dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]);
     372             : PETSC_EXTERN PetscErrorCode VecGetArray3dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     373             : PETSC_EXTERN PetscErrorCode VecRestoreArray3dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]);
     374             : PETSC_EXTERN PetscErrorCode VecGetArray2dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     375             : PETSC_EXTERN PetscErrorCode VecRestoreArray2dRead(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]);
     376             : PETSC_EXTERN PetscErrorCode VecGetArray1dRead(Vec,PetscInt,PetscInt,PetscScalar *[]);
     377             : PETSC_EXTERN PetscErrorCode VecRestoreArray1dRead(Vec,PetscInt,PetscInt,PetscScalar *[]);
     378             : 
     379             : PETSC_EXTERN PetscErrorCode VecPlaceArray(Vec,const PetscScalar[]);
     380             : PETSC_EXTERN PetscErrorCode VecResetArray(Vec);
     381             : PETSC_EXTERN PetscErrorCode VecReplaceArray(Vec,const PetscScalar[]);
     382             : PETSC_EXTERN PetscErrorCode VecGetArrays(const Vec[],PetscInt,PetscScalar**[]);
     383             : PETSC_EXTERN PetscErrorCode VecRestoreArrays(const Vec[],PetscInt,PetscScalar**[]);
     384             : 
     385             : PETSC_EXTERN PetscErrorCode VecView(Vec,PetscViewer);
     386             : PETSC_EXTERN PetscErrorCode VecEqual(Vec,Vec,PetscBool *);
     387             : PETSC_EXTERN PetscErrorCode VecLoad(Vec, PetscViewer);
     388             : 
     389             : PETSC_EXTERN PetscErrorCode VecGetSize(Vec,PetscInt*);
     390             : PETSC_EXTERN PetscErrorCode VecGetLocalSize(Vec,PetscInt*);
     391             : PETSC_EXTERN PetscErrorCode VecGetOwnershipRange(Vec,PetscInt*,PetscInt*);
     392             : PETSC_EXTERN PetscErrorCode VecGetOwnershipRanges(Vec,const PetscInt *[]);
     393             : 
     394             : PETSC_EXTERN PetscErrorCode VecSetLocalToGlobalMapping(Vec,ISLocalToGlobalMapping);
     395             : PETSC_EXTERN PetscErrorCode VecSetValuesLocal(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode);
     396             : 
     397             : /*MC
     398             :    VecSetValueLocal - Set a single entry into a vector using the local numbering
     399             : 
     400             :    Synopsis:
     401             :    #include <petscvec.h>
     402             :    PetscErrorCode VecSetValueLocal(Vec v,PetscInt row,PetscScalar value, InsertMode mode);
     403             : 
     404             :    Not Collective
     405             : 
     406             :    Input Parameters:
     407             : +  v - the vector
     408             : .  row - the row location of the entry
     409             : .  value - the value to insert
     410             : -  mode - either INSERT_VALUES or ADD_VALUES
     411             : 
     412             :    Notes:
     413             :    For efficiency one should use VecSetValues() and set several or
     414             :    many values simultaneously if possible.
     415             : 
     416             :    These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd()
     417             :    MUST be called after all calls to VecSetValues() have been completed.
     418             : 
     419             :    VecSetValues() uses 0-based indices in Fortran as well as in C.
     420             : 
     421             :    Level: beginner
     422             : 
     423             : .seealso: VecSetValues(), VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValue()
     424             : M*/
     425             : PETSC_STATIC_INLINE PetscErrorCode VecSetValueLocal(Vec v,PetscInt i,PetscScalar va,InsertMode mode) {return VecSetValuesLocal(v,1,&i,&va,mode);}
     426             : 
     427             : PETSC_EXTERN PetscErrorCode VecSetValuesBlockedLocal(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode);
     428             : PETSC_EXTERN PetscErrorCode VecGetLocalToGlobalMapping(Vec,ISLocalToGlobalMapping*);
     429             : 
     430             : PETSC_EXTERN PetscErrorCode VecDotBegin(Vec,Vec,PetscScalar *);
     431             : PETSC_EXTERN PetscErrorCode VecDotEnd(Vec,Vec,PetscScalar *);
     432             : PETSC_EXTERN PetscErrorCode VecTDotBegin(Vec,Vec,PetscScalar *);
     433             : PETSC_EXTERN PetscErrorCode VecTDotEnd(Vec,Vec,PetscScalar *);
     434             : PETSC_EXTERN PetscErrorCode VecNormBegin(Vec,NormType,PetscReal *);
     435             : PETSC_EXTERN PetscErrorCode VecNormEnd(Vec,NormType,PetscReal *);
     436             : 
     437             : PETSC_EXTERN PetscErrorCode VecMDotBegin(Vec,PetscInt,const Vec[],PetscScalar[]);
     438             : PETSC_EXTERN PetscErrorCode VecMDotEnd(Vec,PetscInt,const Vec[],PetscScalar[]);
     439             : PETSC_EXTERN PetscErrorCode VecMTDotBegin(Vec,PetscInt,const Vec[],PetscScalar[]);
     440             : PETSC_EXTERN PetscErrorCode VecMTDotEnd(Vec,PetscInt,const Vec[],PetscScalar[]);
     441             : PETSC_EXTERN PetscErrorCode PetscCommSplitReductionBegin(MPI_Comm);
     442             : 
     443             : PETSC_EXTERN PetscErrorCode VecPinToCPU(Vec,PetscBool);
     444             : 
     445             : typedef enum {VEC_IGNORE_OFF_PROC_ENTRIES,VEC_IGNORE_NEGATIVE_INDICES,VEC_SUBSET_OFF_PROC_ENTRIES} VecOption;
     446             : PETSC_EXTERN PetscErrorCode VecSetOption(Vec,VecOption,PetscBool );
     447             : 
     448             : PETSC_EXTERN PetscErrorCode VecGetArray(Vec,PetscScalar**);
     449             : PETSC_EXTERN PetscErrorCode VecGetArrayWrite(Vec,PetscScalar**);
     450             : PETSC_EXTERN PetscErrorCode VecGetArrayRead(Vec,const PetscScalar**);
     451             : PETSC_EXTERN PetscErrorCode VecRestoreArray(Vec,PetscScalar**);
     452             : PETSC_EXTERN PetscErrorCode VecRestoreArrayWrite(Vec,PetscScalar**);
     453             : PETSC_EXTERN PetscErrorCode VecRestoreArrayRead(Vec,const PetscScalar**);
     454             : PETSC_EXTERN PetscErrorCode VecGetLocalVector(Vec,Vec);
     455             : PETSC_EXTERN PetscErrorCode VecRestoreLocalVector(Vec,Vec);
     456             : PETSC_EXTERN PetscErrorCode VecGetLocalVectorRead(Vec,Vec);
     457             : PETSC_EXTERN PetscErrorCode VecRestoreLocalVectorRead(Vec,Vec);
     458             : 
     459             : /*@C
     460             :    VecGetArrayPair - Accesses a pair of pointers for two vectors that may be common. When not common the first is read only
     461             : 
     462             :    Logically Collective on x
     463             : 
     464             :    Input Parameters:
     465             : +  x - the vector
     466             : -  y - the second vector
     467             : 
     468             :    Output Parameters:
     469             : +  xv - location to put pointer to the first array
     470             : -  yv - location to put pointer to the second array
     471             : 
     472             :    Level: developer
     473             : 
     474             :    Not available from Fortran
     475             : 
     476             : .seealso: VecGetArray(), VecGetArrayRead(), VecRestoreArrayPair()
     477             : 
     478             : @*/
     479             : PETSC_STATIC_INLINE PetscErrorCode VecGetArrayPair(Vec x,Vec y,PetscScalar **xv,PetscScalar **yv)
     480             : {
     481             :   PetscErrorCode ierr;
     482             : 
     483             :   PetscFunctionBegin;
     484             :   ierr = VecGetArray(y,yv);CHKERRQ(ierr);
     485             :   if (x != y) {
     486             :     ierr = VecGetArrayRead(x,(const PetscScalar **)xv);CHKERRQ(ierr);
     487             :   } else {
     488             :     *xv = *yv;
     489             :   }
     490             :   PetscFunctionReturn(0);
     491             : }
     492             : 
     493             : /*@C
     494             :    VecRestoreArrayPair - Returns a pair of pointers for two vectors that may be common. When not common the first is read only
     495             : 
     496             :    Logically Collective on x
     497             : 
     498             :    Input Parameters:
     499             : +  x - the vector
     500             : -  y - the second vector
     501             : 
     502             :    Output Parameters:
     503             : +  xv - location to put pointer to the first array
     504             : -  yv - location to put pointer to the second array
     505             : 
     506             :    Level: developer
     507             : 
     508             :    Not available from Fortran
     509             : 
     510             : .seealso: VecGetArray(), VecGetArrayRead(), VecGetArrayPair()
     511             : 
     512             : @*/
     513             : PETSC_STATIC_INLINE PetscErrorCode VecRestoreArrayPair(Vec x,Vec y,PetscScalar **xv,PetscScalar **yv)
     514             : {
     515             :   PetscErrorCode ierr;
     516             : 
     517             :   PetscFunctionBegin;
     518             :   ierr = VecRestoreArray(y,yv);CHKERRQ(ierr);
     519             :   if (x != y) {
     520             :     ierr = VecRestoreArrayRead(x,(const PetscScalar **)xv);CHKERRQ(ierr);
     521             :   }
     522             :   PetscFunctionReturn(0);
     523             : }
     524             : 
     525             : #if defined(PETSC_USE_DEBUG)
     526             : PETSC_EXTERN PetscErrorCode VecLockReadPush(Vec);
     527             : PETSC_EXTERN PetscErrorCode VecLockReadPop(Vec);
     528             : /* We also have a non-public VecLockWriteSet_Private() in vecimpl.h */
     529             : PETSC_EXTERN PetscErrorCode VecLockGet(Vec,PetscInt*);
     530      252144 : PETSC_STATIC_INLINE PetscErrorCode VecSetErrorIfLocked(Vec x,PetscInt arg)
     531             : {
     532             :   PetscInt       state;
     533             :   PetscErrorCode ierr;
     534             : 
     535      252144 :   PetscFunctionBegin;
     536      252144 :   ierr = VecLockGet(x,&state);CHKERRQ(ierr);
     537      252144 :   if (state != 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE," Vec is already locked for read-only or read/write access, argument # %d",arg);
     538      252144 :   PetscFunctionReturn(0);
     539             : }
     540             : /* The three are deprecated */
     541             : PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use VecLockReadPush() (since version 3.11)") PetscErrorCode VecLockPush(Vec);
     542             : PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use VecLockReadPop() (since version 3.11)")  PetscErrorCode VecLockPop(Vec);
     543             : #define VecLocked(x,arg) VecSetErrorIfLocked(x,arg) PETSC_DEPRECATED_MACRO("GCC warning \"Use VecSetErrorIfLocked() (since version 3.11)\"")
     544             : #else
     545             : #define VecLockReadPush(x)           0
     546             : #define VecLockReadPop(x)            0
     547             : #define VecLockGet(x,s)              *(s) = 0
     548             : #define VecSetErrorIfLocked(x,arg)   0
     549             : /* The three are deprecated */
     550             : #define VecLockPush(x)               0
     551             : #define VecLockPop(x)                0
     552             : #define VecLocked(x,arg)             0
     553             : #endif
     554             : 
     555             : PETSC_EXTERN PetscErrorCode VecValidValues(Vec,PetscInt,PetscBool);
     556             : 
     557             : /*
     558             :     These numbers need to match the entries in
     559             :   the function table in vecimpl.h
     560             : */
     561             : typedef enum { VECOP_DUPLICATE = 0, VECOP_VIEW = 33, VECOP_LOAD = 41, VECOP_VIEWNATIVE = 68, VECOP_LOADNATIVE = 69 } VecOperation;
     562             : PETSC_EXTERN PetscErrorCode VecSetOperation(Vec,VecOperation,void(*)(void));
     563             : 
     564             : /*
     565             :      Routines for dealing with ghosted vectors:
     566             :   vectors with ghost elements at the end of the array.
     567             : */
     568             : PETSC_EXTERN PetscErrorCode VecMPISetGhost(Vec,PetscInt,const PetscInt[]);
     569             : PETSC_EXTERN PetscErrorCode VecCreateGhost(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscInt[],Vec*);
     570             : PETSC_EXTERN PetscErrorCode VecCreateGhostWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscScalar[],Vec*);
     571             : PETSC_EXTERN PetscErrorCode VecCreateGhostBlock(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],Vec*);
     572             : PETSC_EXTERN PetscErrorCode VecCreateGhostBlockWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscScalar[],Vec*);
     573             : PETSC_EXTERN PetscErrorCode VecGhostGetLocalForm(Vec,Vec*);
     574             : PETSC_EXTERN PetscErrorCode VecGhostRestoreLocalForm(Vec,Vec*);
     575             : PETSC_EXTERN PetscErrorCode VecGhostIsLocalForm(Vec,Vec,PetscBool*);
     576             : PETSC_EXTERN PetscErrorCode VecGhostUpdateBegin(Vec,InsertMode,ScatterMode);
     577             : PETSC_EXTERN PetscErrorCode VecGhostUpdateEnd(Vec,InsertMode,ScatterMode);
     578             : 
     579             : PETSC_EXTERN PetscErrorCode VecConjugate(Vec);
     580             : PETSC_EXTERN PetscErrorCode VecImaginaryPart(Vec);
     581             : PETSC_EXTERN PetscErrorCode VecRealPart(Vec);
     582             : 
     583             : PETSC_EXTERN PetscErrorCode VecScatterCreateToAll(Vec,VecScatter*,Vec*);
     584             : PETSC_EXTERN PetscErrorCode VecScatterCreateToZero(Vec,VecScatter*,Vec*);
     585             : 
     586             : PETSC_EXTERN PetscErrorCode ISComplementVec(IS,Vec,IS*);
     587             : PETSC_EXTERN PetscErrorCode VecPow(Vec, PetscScalar);
     588             : PETSC_EXTERN PetscErrorCode VecMedian(Vec, Vec, Vec, Vec);
     589             : PETSC_EXTERN PetscErrorCode VecWhichInactive(Vec, Vec, Vec, Vec, PetscBool, IS *);
     590             : PETSC_EXTERN PetscErrorCode VecWhichBetween(Vec, Vec, Vec, IS *);
     591             : PETSC_EXTERN PetscErrorCode VecWhichBetweenOrEqual(Vec, Vec, Vec, IS *);
     592             : PETSC_EXTERN PetscErrorCode VecWhichGreaterThan(Vec, Vec, IS * );
     593             : PETSC_EXTERN PetscErrorCode VecWhichLessThan(Vec, Vec, IS *);
     594             : PETSC_EXTERN PetscErrorCode VecWhichEqual(Vec, Vec, IS *);
     595             : PETSC_EXTERN PetscErrorCode VecISAXPY(Vec, IS, PetscScalar,Vec);
     596             : PETSC_EXTERN PetscErrorCode VecISCopy(Vec, IS, ScatterMode, Vec);
     597             : PETSC_EXTERN PetscErrorCode VecISSet(Vec,IS, PetscScalar);
     598             : PETSC_EXTERN PetscErrorCode VecBoundGradientProjection(Vec, Vec, Vec, Vec, Vec);
     599             : PETSC_EXTERN PetscErrorCode VecStepBoundInfo(Vec,Vec,Vec,Vec,PetscReal*, PetscReal*,PetscReal*);
     600             : PETSC_EXTERN PetscErrorCode VecStepMax(Vec, Vec, PetscReal *);
     601             : PETSC_EXTERN PetscErrorCode VecStepMaxBounded(Vec,Vec,Vec,Vec,PetscReal*);
     602             : 
     603             : PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetVector(PetscViewer, Vec);
     604             : PETSC_EXTERN PetscErrorCode PetscViewerMathematicaPutVector(PetscViewer, Vec);
     605             : 
     606             : /*S
     607             :      Vecs - Collection of vectors where the data for the vectors is stored in
     608             :             one contiguous memory
     609             : 
     610             :    Level: advanced
     611             : 
     612             :    Notes:
     613             :     Temporary construct for handling multiply right hand side solves
     614             : 
     615             :     This is faked by storing a single vector that has enough array space for
     616             :     n vectors
     617             : 
     618             : S*/
     619             :         struct _n_Vecs  {PetscInt n; Vec v;};
     620             : typedef struct _n_Vecs* Vecs;
     621             : PETSC_EXTERN PetscErrorCode VecsDestroy(Vecs);
     622             : PETSC_EXTERN PetscErrorCode VecsCreateSeq(MPI_Comm,PetscInt,PetscInt,Vecs*);
     623             : PETSC_EXTERN PetscErrorCode VecsCreateSeqWithArray(MPI_Comm,PetscInt,PetscInt,PetscScalar*,Vecs*);
     624             : PETSC_EXTERN PetscErrorCode VecsDuplicate(Vecs,Vecs*);
     625             : 
     626             : #if defined(PETSC_HAVE_VIENNACL)
     627             : typedef struct _p_PetscViennaCLIndices* PetscViennaCLIndices;
     628             : PETSC_EXTERN PetscErrorCode PetscViennaCLIndicesCreate(PetscInt, PetscInt*,PetscInt, PetscInt*,PetscViennaCLIndices*);
     629             : PETSC_EXTERN PetscErrorCode PetscViennaCLIndicesDestroy(PetscViennaCLIndices*);
     630             : PETSC_EXTERN PetscErrorCode VecViennaCLCopyToGPUSome_Public(Vec,PetscViennaCLIndices);
     631             : PETSC_EXTERN PetscErrorCode VecViennaCLCopyFromGPUSome_Public(Vec,PetscViennaCLIndices);
     632             : PETSC_EXTERN PetscErrorCode VecCreateSeqViennaCL(MPI_Comm,PetscInt,Vec*);
     633             : PETSC_EXTERN PetscErrorCode VecCreateMPIViennaCL(MPI_Comm,PetscInt,PetscInt,Vec*);
     634             : #endif
     635             : #if defined(PETSC_HAVE_CUDA)
     636             : typedef struct _p_PetscCUDAIndices* PetscCUDAIndices;
     637             : typedef struct _p_VecScatterCUDAIndices_StoS* VecScatterCUDAIndices_StoS;
     638             : typedef struct _p_VecScatterCUDAIndices_PtoP* VecScatterCUDAIndices_PtoP;
     639             : PETSC_EXTERN PetscErrorCode VecCUDACopyToGPUSome_Public(Vec,PetscCUDAIndices,ScatterMode);
     640             : PETSC_EXTERN PetscErrorCode VecCUDACopyFromGPUSome_Public(Vec,PetscCUDAIndices,ScatterMode);
     641             : PETSC_EXTERN PetscErrorCode VecScatterInitializeForGPU(VecScatter,Vec);
     642             : PETSC_EXTERN PetscErrorCode VecScatterFinalizeForGPU(VecScatter);
     643             : PETSC_EXTERN PetscErrorCode VecCreateSeqCUDA(MPI_Comm,PetscInt,Vec*);
     644             : PETSC_EXTERN PetscErrorCode VecCreateSeqCUDAWithArray(MPI_Comm,PetscInt,PetscInt,const PetscScalar*,Vec*);
     645             : PETSC_EXTERN PetscErrorCode VecCreateMPICUDA(MPI_Comm,PetscInt,PetscInt,Vec*);
     646             : PETSC_EXTERN PetscErrorCode VecCreateMPICUDAWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscScalar*,Vec*);
     647             : #endif
     648             : 
     649             : PETSC_EXTERN PetscErrorCode VecNestGetSubVecs(Vec,PetscInt*,Vec**);
     650             : PETSC_EXTERN PetscErrorCode VecNestGetSubVec(Vec,PetscInt,Vec*);
     651             : PETSC_EXTERN PetscErrorCode VecNestSetSubVecs(Vec,PetscInt,PetscInt*,Vec*);
     652             : PETSC_EXTERN PetscErrorCode VecNestSetSubVec(Vec,PetscInt,Vec);
     653             : PETSC_EXTERN PetscErrorCode VecCreateNest(MPI_Comm,PetscInt,IS*,Vec*,Vec*);
     654             : PETSC_EXTERN PetscErrorCode VecNestGetSize(Vec,PetscInt*);
     655             : 
     656             : PETSC_EXTERN PetscErrorCode PetscOptionsGetVec(PetscOptions,const char[],const char[],Vec,PetscBool*);
     657             : PETSC_EXTERN PetscErrorCode VecChop(Vec,PetscReal);
     658             : 
     659             : PETSC_EXTERN PetscErrorCode VecGetLayout(Vec,PetscLayout*);
     660             : PETSC_EXTERN PetscErrorCode VecSetLayout(Vec,PetscLayout);
     661             : 
     662             : PETSC_EXTERN PetscErrorCode PetscSectionVecView(PetscSection, Vec, PetscViewer);
     663             : PETSC_EXTERN PetscErrorCode VecGetValuesSection(Vec, PetscSection, PetscInt, PetscScalar **);
     664             : PETSC_EXTERN PetscErrorCode VecSetValuesSection(Vec, PetscSection, PetscInt, PetscScalar [], InsertMode);
     665             : PETSC_EXTERN PetscErrorCode PetscSectionVecNorm(PetscSection, PetscSection, Vec, NormType, PetscReal []);
     666             : 
     667             : /*S
     668             :   VecTagger - Object used to manage the tagging of a subset of indices based on the values of a vector.  The
     669             :               motivating application is the selection of cells for refinement or coarsening based on vector containing
     670             :               the values in an error indicator metric.
     671             : 
     672             :   Level: advanced
     673             : S*/
     674             : typedef struct _p_VecTagger *VecTagger;
     675             : 
     676             : /*J
     677             :   VecTaggerType - String with the name of a VecTagger type
     678             : 
     679             :   Level: advanced
     680             : J*/
     681             : typedef const char* VecTaggerType;
     682             : /* tag where the vector values are in a box of explicitly defined values */
     683             : #define VECTAGGERABSOLUTE   "absolute"
     684             : /* tag where the vector values are in a box of values relative to the set of all values in the vector */
     685             : #define VECTAGGERRELATIVE   "relative"
     686             : /* tag where the vector values are in a relative range of the *cumulative distribution* of values in the vector */
     687             : #define VECTAGGERCDF        "cdf"
     688             : /* tag a vector as the union of other tags */
     689             : #define VECTAGGEROR         "or"
     690             : /* tag a vector as the intersection of other tags */
     691             : #define VECTAGGERAND        "and"
     692             : 
     693             : PETSC_EXTERN PetscClassId VEC_TAGGER_CLASSID;
     694             : PETSC_EXTERN PetscFunctionList VecTaggerList;
     695             : PETSC_EXTERN PetscErrorCode VecTaggerRegister(const char[],PetscErrorCode (*) (VecTagger));
     696             : 
     697             : PETSC_EXTERN PetscErrorCode VecTaggerCreate(MPI_Comm,VecTagger *);
     698             : PETSC_EXTERN PetscErrorCode VecTaggerSetBlockSize(VecTagger,PetscInt);
     699             : PETSC_EXTERN PetscErrorCode VecTaggerGetBlockSize(VecTagger,PetscInt*);
     700             : PETSC_EXTERN PetscErrorCode VecTaggerSetType(VecTagger,VecTaggerType);
     701             : PETSC_EXTERN PetscErrorCode VecTaggerGetType(VecTagger,VecTaggerType *);
     702             : PETSC_EXTERN PetscErrorCode VecTaggerSetInvert(VecTagger,PetscBool);
     703             : PETSC_EXTERN PetscErrorCode VecTaggerGetInvert(VecTagger,PetscBool*);
     704             : PETSC_EXTERN PetscErrorCode VecTaggerSetFromOptions(VecTagger);
     705             : PETSC_EXTERN PetscErrorCode VecTaggerSetUp(VecTagger);
     706             : PETSC_EXTERN PetscErrorCode VecTaggerView(VecTagger,PetscViewer);
     707             : PETSC_EXTERN PetscErrorCode VecTaggerComputeIS(VecTagger,Vec,IS *);
     708             : PETSC_EXTERN PetscErrorCode VecTaggerDestroy(VecTagger *);
     709             : 
     710             : /*S
     711             :    VecTaggerBox - A box range used to tag values.  For real scalars, this is just a closed interval; for complex scalars, the box is the closed region in the complex plane
     712             :    such that real(min) <= real(z) <= real(max) and imag(min) <= imag(z) <= imag(max).  INF is an acceptable endpoint.
     713             : 
     714             :    Level: beginner
     715             : 
     716             : .seealso: VecTaggerComputeIntervals()
     717             : S*/
     718             : typedef struct {
     719             :   PetscScalar min;
     720             :   PetscScalar max;
     721             : } VecTaggerBox;
     722             : PETSC_EXTERN PetscErrorCode VecTaggerComputeBoxes(VecTagger,Vec,PetscInt *,VecTaggerBox **);
     723             : 
     724             : 
     725             : PETSC_EXTERN PetscErrorCode VecTaggerAbsoluteSetBox(VecTagger,VecTaggerBox *);
     726             : PETSC_EXTERN PetscErrorCode VecTaggerAbsoluteGetBox(VecTagger,const VecTaggerBox **);
     727             : 
     728             : PETSC_EXTERN PetscErrorCode VecTaggerRelativeSetBox(VecTagger,VecTaggerBox *);
     729             : PETSC_EXTERN PetscErrorCode VecTaggerRelativeGetBox(VecTagger,const VecTaggerBox **);
     730             : 
     731             : PETSC_EXTERN PetscErrorCode VecTaggerCDFSetBox(VecTagger,VecTaggerBox *);
     732             : PETSC_EXTERN PetscErrorCode VecTaggerCDFGetBox(VecTagger,const VecTaggerBox **);
     733             : 
     734             : /*E
     735             :   VecTaggerCDFMethod - Determines what method is used to compute absolute values from cumulative distribution values (e.g., what value is the preimage of .95 in the cdf).  Relevant only in parallel: in serial it is directly computed.
     736             : 
     737             :   Level: advanced
     738             : .seealso: VecTaggerCDFSetMethod(), VecTaggerCDFMethods
     739             : E*/
     740             : typedef enum {VECTAGGER_CDF_GATHER,VECTAGGER_CDF_ITERATIVE,VECTAGGER_CDF_NUM_METHODS} VecTaggerCDFMethod;
     741             : PETSC_EXTERN const char *const VecTaggerCDFMethods[];
     742             : 
     743             : PETSC_EXTERN PetscErrorCode VecTaggerCDFSetMethod(VecTagger,VecTaggerCDFMethod);
     744             : PETSC_EXTERN PetscErrorCode VecTaggerCDFGetMethod(VecTagger,VecTaggerCDFMethod*);
     745             : PETSC_EXTERN PetscErrorCode VecTaggerCDFIterativeSetTolerances(VecTagger,PetscInt,PetscReal,PetscReal);
     746             : PETSC_EXTERN PetscErrorCode VecTaggerCDFIterativeGetTolerances(VecTagger,PetscInt*,PetscReal*,PetscReal*);
     747             : 
     748             : PETSC_EXTERN PetscErrorCode VecTaggerOrSetSubs(VecTagger,PetscInt,VecTagger*,PetscCopyMode);
     749             : PETSC_EXTERN PetscErrorCode VecTaggerOrGetSubs(VecTagger,PetscInt*,VecTagger**);
     750             : 
     751             : PETSC_EXTERN PetscErrorCode VecTaggerAndSetSubs(VecTagger,PetscInt,VecTagger*,PetscCopyMode);
     752             : PETSC_EXTERN PetscErrorCode VecTaggerAndGetSubs(VecTagger,PetscInt*,VecTagger**);
     753             : 
     754             : PETSC_EXTERN PetscErrorCode VecTaggerInitializePackage(void);
     755             : PETSC_EXTERN PetscErrorCode VecTaggerFinalizePackage(void);
     756             : 
     757             : #endif

Generated by: LCOV version 1.13