12eac72dbSBarry Smith /* 237f753daSBarry Smith Defines the vector component of PETSc. Vectors generally represent 337f753daSBarry Smith degrees of freedom for finite element/finite difference functions 484cb2905SBarry Smith on a grid. They have more mathematical structure then simple arrays. 52eac72dbSBarry Smith */ 62eac72dbSBarry Smith 70a835dfdSSatish Balay #ifndef __PETSCVEC_H 80a835dfdSSatish Balay #define __PETSCVEC_H 90a835dfdSSatish Balay #include "petscis.h" 100a835dfdSSatish Balay #include "petscsys.h" 11e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 122eac72dbSBarry Smith 1309321671SBarry Smith /*S 1409321671SBarry Smith Vec - Abstract PETSc vector object 1509321671SBarry Smith 1609321671SBarry Smith Level: beginner 1709321671SBarry Smith 1809321671SBarry Smith Concepts: field variables, unknowns, arrays 1909321671SBarry Smith 2009321671SBarry Smith .seealso: VecCreate(), VecType, VecSetType() 2109321671SBarry Smith S*/ 22f09e8eb9SSatish Balay typedef struct _p_Vec* Vec; 2309321671SBarry Smith 2409321671SBarry Smith /*S 2509321671SBarry Smith VecScatter - Object used to manage communication of data 2609321671SBarry Smith between vectors in parallel. Manages both scatters and gathers 2709321671SBarry Smith 2809321671SBarry Smith Level: beginner 2909321671SBarry Smith 3009321671SBarry Smith Concepts: scatter 3109321671SBarry Smith 3209321671SBarry Smith .seealso: VecScatterCreate(), VecScatterBegin(), VecScatterEnd() 3309321671SBarry Smith S*/ 34f09e8eb9SSatish Balay typedef struct _p_VecScatter* VecScatter; 3509321671SBarry Smith 3609321671SBarry Smith /*E 3709321671SBarry Smith VecType - String with the name of a PETSc vector or the creation function 3809321671SBarry Smith with an optional dynamic library name, for example 3909321671SBarry Smith http://www.mcs.anl.gov/petsc/lib.a:myveccreate() 4009321671SBarry Smith 4109321671SBarry Smith Level: beginner 4209321671SBarry Smith 4309321671SBarry Smith .seealso: VecSetType(), Vec 4409321671SBarry Smith E*/ 45e5a9bf91SBarry Smith #define VecType const char* 460676abe4SMatthew Knepley #define VECSEQ "seq" 470676abe4SMatthew Knepley #define VECMPI "mpi" 480676abe4SMatthew Knepley #define VECFETI "feti" 490676abe4SMatthew Knepley #define VECSHARED "shared" 50765467adSMatthew Knepley #define VECSIEVE "sieve" 512eac72dbSBarry Smith 52fd487807SMatthew Knepley /* Logging support */ 53552e946dSBarry Smith #define VEC_FILE_COOKIE 1211214 540c735eedSKris Buschelman extern PETSCVEC_DLLEXPORT PetscCookie VEC_COOKIE; 550c735eedSKris Buschelman extern PETSCVEC_DLLEXPORT PetscCookie VEC_SCATTER_COOKIE; 568ba1e511SMatthew Knepley 57e5bd5246SBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecInitializePackage(const char[]); 58fd487807SMatthew Knepley 590c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreate(MPI_Comm,Vec*); 60045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecCreate,(Vec *x),(PETSC_COMM_SELF,x)) 610c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateSeq(MPI_Comm,PetscInt,Vec*); 62045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecCreateSeq,(PetscInt n,Vec *x),(PETSC_COMM_SELF,n,x)) 630c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateMPI(MPI_Comm,PetscInt,PetscInt,Vec*); 64045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecCreateMPI,(PetscInt n,PetscInt N,Vec *x),(PETSC_COMM_WORLD,n,N,x)) 650c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateSeqWithArray(MPI_Comm,PetscInt,const PetscScalar[],Vec*); 66045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecCreateSeqWithArray,(PetscInt n,PetscScalar s[],Vec *x),(PETSC_COMM_SELF,n,s,x)) 670c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateMPIWithArray(MPI_Comm,PetscInt,PetscInt,const PetscScalar[],Vec*); 68045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecCreateMPIWithArray,(PetscInt n,PetscInt N,PetscScalar s[],Vec *x),(PETSC_COMM_WORLD,n,N,s,x)) 690c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateShared(MPI_Comm,PetscInt,PetscInt,Vec*); 700c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetFromOptions(Vec); 71f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetUp(Vec); 720c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDestroy(Vec); 73f1e08e49SBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecZeroEntries(Vec); 74f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetOptionsPrefix(Vec,const char[]); 75f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAppendOptionsPrefix(Vec,const char[]); 76f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetOptionsPrefix(Vec,const char*[]); 77f69a0ea3SMatthew Knepley 780c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetSizes(Vec,PetscInt,PetscInt); 79fd487807SMatthew Knepley 803c5daeb9SBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDotNorm2(Vec,Vec,PetscScalar*,PetscScalar*); 810c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDot(Vec,Vec,PetscScalar*); 82fcd5dd21SSatish Balay PetscPolymorphicFunction(VecDot,(Vec x,Vec y),(x,y,&s),PetscScalar,s) 830c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecTDot(Vec,Vec,PetscScalar*); 84fcd5dd21SSatish Balay PetscPolymorphicFunction(VecTDot,(Vec x,Vec y),(x,y,&s),PetscScalar,s) 858dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMDot(Vec,PetscInt,const Vec[],PetscScalar*); 868dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMTDot(Vec,PetscInt,const Vec[],PetscScalar*); 87cddf8d76SBarry Smith 8809321671SBarry Smith /*E 8909321671SBarry Smith NormType - determines what type of norm to compute 9009321671SBarry Smith 9109321671SBarry Smith Level: beginner 9209321671SBarry Smith 9309321671SBarry Smith .seealso: VecNorm(), VecNormBegin(), VecNormEnd(), MatNorm() 9409321671SBarry Smith E*/ 959dcbbd2bSBarry Smith typedef enum {NORM_1=0,NORM_2=1,NORM_FROBENIUS=2,NORM_INFINITY=3,NORM_1_AND_2=4} NormType; 969dcbbd2bSBarry Smith extern const char *NormTypes[]; 97cddf8d76SBarry Smith #define NORM_MAX NORM_INFINITY 9809321671SBarry Smith 999b250c83SBarry Smith /*MC 1009b250c83SBarry Smith NORM_1 - the one norm, ||v|| = sum_i | v_i |. ||A|| = max_j || v_*j ||, maximum column sum 1019b250c83SBarry Smith 1029b250c83SBarry Smith Level: beginner 1039b250c83SBarry Smith 1049b250c83SBarry Smith .seealso: NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_2, NORM_FROBENIUS, 1059b250c83SBarry Smith NORM_INFINITY, NORM_1_AND_2 1069b250c83SBarry Smith 1079b250c83SBarry Smith M*/ 1089b250c83SBarry Smith 1099b250c83SBarry Smith /*MC 1109b250c83SBarry Smith NORM_2 - the two norm, ||v|| = sqrt(sum_i (v_i)^2) (vectors only) 1119b250c83SBarry Smith 1129b250c83SBarry Smith Level: beginner 1139b250c83SBarry Smith 1149b250c83SBarry Smith .seealso: NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_FROBENIUS, 1159b250c83SBarry Smith NORM_INFINITY, NORM_1_AND_2 1169b250c83SBarry Smith 1179b250c83SBarry Smith M*/ 1189b250c83SBarry Smith 1199b250c83SBarry Smith /*MC 1209b250c83SBarry Smith NORM_FROBENIUS - ||A|| = sqrt(sum_ij (A_ij)^2), same as NORM_2 for vectors 1219b250c83SBarry Smith 1229b250c83SBarry Smith Level: beginner 1239b250c83SBarry Smith 1249b250c83SBarry Smith .seealso: NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2, 1259b250c83SBarry Smith NORM_INFINITY, NORM_1_AND_2 1269b250c83SBarry Smith 1279b250c83SBarry Smith M*/ 1289b250c83SBarry Smith 1299b250c83SBarry Smith /*MC 1309b250c83SBarry Smith NORM_INFINITY - ||v|| = max_i |v_i|. ||A|| = max_i || v_i* ||, maximum row sum 1319b250c83SBarry Smith 1329b250c83SBarry Smith Level: beginner 1339b250c83SBarry Smith 1349b250c83SBarry Smith .seealso: NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2, 1359b250c83SBarry Smith NORM_FROBINIUS, NORM_1_AND_2 1369b250c83SBarry Smith 1379b250c83SBarry Smith M*/ 1389b250c83SBarry Smith 1399b250c83SBarry Smith /*MC 1409b250c83SBarry Smith NORM_1_AND_2 - computes both the 1 and 2 norm of a vector 1419b250c83SBarry Smith 1429b250c83SBarry Smith Level: beginner 1439b250c83SBarry Smith 1449b250c83SBarry Smith .seealso: NormType, MatNorm(), VecNorm(), VecNormBegin(), VecNormEnd(), NORM_1, NORM_2, 1459b250c83SBarry Smith NORM_FROBINIUS, NORM_INFINITY 1469b250c83SBarry Smith 1479b250c83SBarry Smith M*/ 1489b250c83SBarry Smith 1499b250c83SBarry Smith /*MC 1509b250c83SBarry Smith NORM_MAX - see NORM_INFINITY 1519b250c83SBarry Smith 152d41222bbSBarry Smith Level: beginner 153d41222bbSBarry Smith 1549b250c83SBarry Smith M*/ 1559b250c83SBarry Smith 1560c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecNorm(Vec,NormType,PetscReal *); 157045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecNorm,(Vec x,PetscReal *r),(x,NORM_2,r)) 158c714d2d0SBarry Smith PetscPolymorphicFunction(VecNorm,(Vec x,NormType t),(x,t,&r),PetscReal,r) 159c714d2d0SBarry Smith PetscPolymorphicFunction(VecNorm,(Vec x),(x,NORM_2,&r),PetscReal,r) 1600c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecNormalize(Vec,PetscReal *); 1610c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSum(Vec,PetscScalar*); 1620c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMax(Vec,PetscInt*,PetscReal *); 163045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecMax,(Vec x,PetscReal *r),(x,PETSC_NULL,r)) 1640c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMin(Vec,PetscInt*,PetscReal *); 165045ff3e0SBarry Smith PetscPolymorphicSubroutine(VecMin,(Vec x,PetscReal *r),(x,PETSC_NULL,r)) 1669a05e725SBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScale(Vec,PetscScalar); 1670c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCopy(Vec,Vec); 168abb0e124SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetRandom(Vec,PetscRandom); 1692dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSet(Vec,PetscScalar); 1700c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSwap(Vec,Vec); 1712dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAXPY(Vec,PetscScalar,Vec); 1722dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAXPBY(Vec,PetscScalar,PetscScalar,Vec); 1732dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMAXPY(Vec,PetscInt,const PetscScalar[],Vec*); 1742dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAYPX(Vec,PetscScalar,Vec); 1752dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecWAXPY(Vec,PetscScalar,Vec,Vec); 1760c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPointwiseMax(Vec,Vec,Vec); 1770190745aSSatish Balay PetscPolymorphicSubroutine(VecPointwiseMax,(Vec x,Vec y),(x,y,y)) 1780c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPointwiseMaxAbs(Vec,Vec,Vec); 1790190745aSSatish Balay PetscPolymorphicSubroutine(VecPointwiseMaxAbs,(Vec x,Vec y),(x,y,y)) 1800c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPointwiseMin(Vec,Vec,Vec); 1810190745aSSatish Balay PetscPolymorphicSubroutine(VecPointwiseMin,(Vec x,Vec y),(x,y,y)) 1820c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPointwiseMult(Vec,Vec,Vec); 1830190745aSSatish Balay PetscPolymorphicSubroutine(VecPointwiseMult,(Vec x,Vec y),(x,y,y)) 1840c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPointwiseDivide(Vec,Vec,Vec); 1850190745aSSatish Balay PetscPolymorphicSubroutine(VecPointwiseDivide,(Vec x,Vec y),(x,y,y)) 1860c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMaxPointwiseDivide(Vec,Vec,PetscReal*); 1872dcb1b2aSMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecShift(Vec,PetscScalar); 1880c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecReciprocal(Vec); 1890c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPermute(Vec, IS, PetscTruth); 1900c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSqrt(Vec); 1910c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAbs(Vec); 1920c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDuplicate(Vec,Vec*); 1930c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDuplicateVecs(Vec,PetscInt,Vec*[]); 1940c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDestroyVecs(Vec[],PetscInt); 1950c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideNormAll(Vec,NormType,PetscReal*); 1960c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideMaxAll(Vec,PetscInt *,PetscReal *); 1970c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideMinAll(Vec,PetscInt *,PetscReal *); 1980c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideScaleAll(Vec,PetscScalar*); 1994a560884SBarry Smith 2000c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideNorm(Vec,PetscInt,NormType,PetscReal*); 201fcd5dd21SSatish Balay PetscPolymorphicFunction(VecStrideNorm,(Vec x,PetscInt i),(x,i,NORM_2,&r),PetscReal,r) 202fcd5dd21SSatish Balay PetscPolymorphicFunction(VecStrideNorm,(Vec x,PetscInt i,NormType t),(x,i,t,&r),PetscReal,r) 2030c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideMax(Vec,PetscInt,PetscInt *,PetscReal *); 204fcd5dd21SSatish Balay PetscPolymorphicFunction(VecStrideMax,(Vec x,PetscInt i),(x,i,PETSC_NULL,&r),PetscReal,r) 2050c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideMin(Vec,PetscInt,PetscInt *,PetscReal *); 206fcd5dd21SSatish Balay PetscPolymorphicFunction(VecStrideMin,(Vec x,PetscInt i),(x,i,PETSC_NULL,&r),PetscReal,r) 207f31393a2Sdalcinl EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideScale(Vec,PetscInt,PetscScalar); 208954b3ec6SBarry Smith 209954b3ec6SBarry Smith 2100c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideGather(Vec,PetscInt,Vec,InsertMode); 2110c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideScatter(Vec,PetscInt,Vec,InsertMode); 2120c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideGatherAll(Vec,Vec*,InsertMode); 2130c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStrideScatterAll(Vec*,Vec,InsertMode); 214d2655a18SBarry Smith 2150c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetValues(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode); 2160c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetValues(Vec,PetscInt,const PetscInt[],PetscScalar[]); 2170c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAssemblyBegin(Vec); 2180c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecAssemblyEnd(Vec); 2190c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStashSetInitialSize(Vec,PetscInt,PetscInt); 2200c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStashView(Vec,PetscViewer); 2210c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecStashGetInfo(Vec,PetscInt*,PetscInt*,PetscInt*,PetscInt*); 22262dc5420SSatish Balay 22330de9b25SBarry Smith /*MC 22430de9b25SBarry Smith VecSetValue - Set a single entry into a vector. 22530de9b25SBarry Smith 22630de9b25SBarry Smith Synopsis: 227d360dc6fSBarry Smith PetscErrorCode VecSetValue(Vec v,int row,PetscScalar value, InsertMode mode); 22830de9b25SBarry Smith 22930de9b25SBarry Smith Not Collective 23030de9b25SBarry Smith 23130de9b25SBarry Smith Input Parameters: 23230de9b25SBarry Smith + v - the vector 23330de9b25SBarry Smith . row - the row location of the entry 23430de9b25SBarry Smith . value - the value to insert 23530de9b25SBarry Smith - mode - either INSERT_VALUES or ADD_VALUES 23630de9b25SBarry Smith 23730de9b25SBarry Smith Notes: 23830de9b25SBarry Smith For efficiency one should use VecSetValues() and set several or 23930de9b25SBarry Smith many values simultaneously if possible. 24030de9b25SBarry Smith 2411d73ed98SBarry Smith These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd() 2421d73ed98SBarry Smith MUST be called after all calls to VecSetValues() have been completed. 2431d73ed98SBarry Smith 2441d73ed98SBarry Smith VecSetValues() uses 0-based indices in Fortran as well as in C. 2451d73ed98SBarry Smith 2461d73ed98SBarry Smith Level: beginner 2471d73ed98SBarry Smith 2481d73ed98SBarry Smith .seealso: VecSetValues(), VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValueLocal() 2491d73ed98SBarry Smith M*/ 25050755921SBarry Smith PETSC_STATIC_INLINE PetscErrorCode VecSetValue(Vec v,PetscInt i,PetscScalar va,InsertMode mode) {return VecSetValues(v,1,&i,&va,mode);} 2511d73ed98SBarry Smith 25230de9b25SBarry Smith 2530c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetBlockSize(Vec,PetscInt); 2540c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetBlockSize(Vec,PetscInt*); 255fcd5dd21SSatish Balay PetscPolymorphicFunction(VecGetBlockSize,(Vec x),(x,&i),PetscInt,i) 2560c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetValuesBlocked(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode); 2578ed539a5SBarry Smith 258fd487807SMatthew Knepley /* Dynamic creation and loading functions */ 259fd487807SMatthew Knepley extern PetscFList VecList; 260d772e1d7SMatthew Knepley extern PetscTruth VecRegisterAllCalled; 261f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetType(Vec, VecType); 2620c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetType(Vec, VecType *); 2630c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRegister(const char[],const char[],const char[],PetscErrorCode (*)(Vec)); 2640c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRegisterAll(const char []); 2650c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRegisterDestroy(void); 26630de9b25SBarry Smith 26730de9b25SBarry Smith /*MC 26830de9b25SBarry Smith VecRegisterDynamic - Adds a new vector component implementation 26930de9b25SBarry Smith 27030de9b25SBarry Smith Synopsis: 271d360dc6fSBarry Smith PetscErrorCode VecRegisterDynamic(char *name, char *path, char *func_name, PetscErrorCode (*create_func)(Vec)) 27230de9b25SBarry Smith 27330de9b25SBarry Smith Not Collective 27430de9b25SBarry Smith 27530de9b25SBarry Smith Input Parameters: 27630de9b25SBarry Smith + name - The name of a new user-defined creation routine 27730de9b25SBarry Smith . path - The path (either absolute or relative) of the library containing this routine 27830de9b25SBarry Smith . func_name - The name of routine to create method context 27930de9b25SBarry Smith - create_func - The creation routine itself 28030de9b25SBarry Smith 28130de9b25SBarry Smith Notes: 28230de9b25SBarry Smith VecRegisterDynamic() may be called multiple times to add several user-defined vectors 28330de9b25SBarry Smith 28430de9b25SBarry Smith If dynamic libraries are used, then the fourth input argument (routine_create) is ignored. 28530de9b25SBarry Smith 28630de9b25SBarry Smith Sample usage: 28730de9b25SBarry Smith .vb 28830de9b25SBarry Smith VecRegisterDynamic("my_vec","/home/username/my_lib/lib/libO/solaris/libmy.a", "MyVectorCreate", MyVectorCreate); 28930de9b25SBarry Smith .ve 29030de9b25SBarry Smith 29130de9b25SBarry Smith Then, your vector type can be chosen with the procedural interface via 29230de9b25SBarry Smith .vb 29330de9b25SBarry Smith VecCreate(MPI_Comm, Vec *); 29430de9b25SBarry Smith VecSetType(Vec,"my_vector_name"); 29530de9b25SBarry Smith .ve 29630de9b25SBarry Smith or at runtime via the option 29730de9b25SBarry Smith .vb 29830de9b25SBarry Smith -vec_type my_vector_name 29930de9b25SBarry Smith .ve 30030de9b25SBarry Smith 301ab901514SBarry Smith Notes: $PETSC_ARCH occuring in pathname will be replaced with appropriate values. 30230de9b25SBarry Smith If your function is not being put into a shared library then use VecRegister() instead 30330de9b25SBarry Smith 30430de9b25SBarry Smith Level: advanced 30530de9b25SBarry Smith 30630de9b25SBarry Smith .keywords: Vec, register 30730de9b25SBarry Smith .seealso: VecRegisterAll(), VecRegisterDestroy(), VecRegister() 30830de9b25SBarry Smith M*/ 309aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 310f1af5d2fSBarry Smith #define VecRegisterDynamic(a,b,c,d) VecRegister(a,b,c,0) 31188d459dfSBarry Smith #else 312f1af5d2fSBarry Smith #define VecRegisterDynamic(a,b,c,d) VecRegister(a,b,c,d) 31388d459dfSBarry Smith #endif 31488d459dfSBarry Smith 31509321671SBarry Smith 3160c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreate(Vec,IS,Vec,IS,VecScatter *); 317fcd5dd21SSatish Balay PetscPolymorphicFunction(VecScatterCreate,(Vec x,IS is1,Vec y,IS is2),(x,is1,y,is2,&s),VecScatter,s) 3180190745aSSatish Balay PetscPolymorphicSubroutine(VecScatterCreate,(Vec x,IS is,Vec y,VecScatter *s),(x,is,y,PETSC_NULL,s)) 319fcd5dd21SSatish Balay PetscPolymorphicFunction(VecScatterCreate,(Vec x,IS is,Vec y),(x,is,y,PETSC_NULL,&s),VecScatter,s) 3200190745aSSatish Balay PetscPolymorphicSubroutine(VecScatterCreate,(Vec x,Vec y,IS is,VecScatter *s),(x,PETSC_NULL,y,is,s)) 321fcd5dd21SSatish Balay PetscPolymorphicFunction(VecScatterCreate,(Vec x,Vec y,IS is),(x,PETSC_NULL,y,is,&s),VecScatter,s) 322450faa77SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreateEmpty(MPI_Comm,VecScatter *); 323*fbb399caSBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreateLocal(VecScatter,PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],PetscInt); 324ca9f406cSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterBegin(VecScatter,Vec,Vec,InsertMode,ScatterMode); 325ca9f406cSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterEnd(VecScatter,Vec,Vec,InsertMode,ScatterMode); 3260c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterDestroy(VecScatter); 3270c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCopy(VecScatter,VecScatter *); 3280c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterView(VecScatter,PetscViewer); 3290c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterRemap(VecScatter,PetscInt *,PetscInt*); 3300c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterGetMerged(VecScatter,PetscTruth*); 3312195c698SBarry Smith 3320c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray_Private(Vec,PetscScalar*[]); 3330c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArray_Private(Vec,PetscScalar*[]); 3340c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray4d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]); 3350c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArray4d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar****[]); 3360c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray3d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]); 3370c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArray3d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar***[]); 3380c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray2d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]); 3390c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArray2d(Vec,PetscInt,PetscInt,PetscInt,PetscInt,PetscScalar**[]); 3400c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray1d(Vec,PetscInt,PetscInt,PetscScalar *[]); 3410c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArray1d(Vec,PetscInt,PetscInt,PetscScalar *[]); 342ab360428SBarry Smith 3430c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecPlaceArray(Vec,const PetscScalar[]); 3440c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecResetArray(Vec); 3450c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecReplaceArray(Vec,const PetscScalar[]); 3460c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetArrays(const Vec[],PetscInt,PetscScalar**[]); 3470c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecRestoreArrays(const Vec[],PetscInt,PetscScalar**[]); 34884cb2905SBarry Smith 3490c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecValid(Vec,PetscTruth*); 3500c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecView(Vec,PetscViewer); 3514e2ffeddSBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecViewFromOptions(Vec, const char *); 3520c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecEqual(Vec,Vec,PetscTruth*); 353fcd5dd21SSatish Balay PetscPolymorphicFunction(VecEqual,(Vec x,Vec y),(x,y,&s),PetscTruth,s) 354f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecLoad(PetscViewer,VecType,Vec*); 3550c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecLoadIntoVector(PetscViewer,Vec); 3568ed539a5SBarry Smith 3570c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetSize(Vec,PetscInt*); 358fcd5dd21SSatish Balay PetscPolymorphicFunction(VecGetSize,(Vec x),(x,&s),PetscInt,s) 3590c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetLocalSize(Vec,PetscInt*); 360fcd5dd21SSatish Balay PetscPolymorphicFunction(VecGetLocalSize,(Vec x),(x,&s),PetscInt,s) 3610c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGetOwnershipRange(Vec,PetscInt*,PetscInt*); 3628ed539a5SBarry Smith 3630c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetLocalToGlobalMapping(Vec,ISLocalToGlobalMapping); 3640c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetValuesLocal(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode); 36588b03592SBarry Smith 36688b03592SBarry Smith /*MC 36788b03592SBarry Smith VecSetValueLocal - Set a single entry into a vector using the local numbering 36888b03592SBarry Smith 36988b03592SBarry Smith Synopsis: 37088b03592SBarry Smith PetscErrorCode VecSetValueLocal(Vec v,int row,PetscScalar value, InsertMode mode); 37188b03592SBarry Smith 37288b03592SBarry Smith Not Collective 37388b03592SBarry Smith 37488b03592SBarry Smith Input Parameters: 37588b03592SBarry Smith + v - the vector 37688b03592SBarry Smith . row - the row location of the entry 37788b03592SBarry Smith . value - the value to insert 37888b03592SBarry Smith - mode - either INSERT_VALUES or ADD_VALUES 37988b03592SBarry Smith 38088b03592SBarry Smith Notes: 38188b03592SBarry Smith For efficiency one should use VecSetValues() and set several or 38288b03592SBarry Smith many values simultaneously if possible. 38388b03592SBarry Smith 38488b03592SBarry Smith These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd() 38588b03592SBarry Smith MUST be called after all calls to VecSetValues() have been completed. 38688b03592SBarry Smith 38788b03592SBarry Smith VecSetValues() uses 0-based indices in Fortran as well as in C. 38888b03592SBarry Smith 38988b03592SBarry Smith Level: beginner 39088b03592SBarry Smith 39188b03592SBarry Smith .seealso: VecSetValues(), VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValue() 39288b03592SBarry Smith M*/ 39388b03592SBarry Smith PETSC_STATIC_INLINE PetscErrorCode VecSetValueLocal(Vec v,PetscInt i,PetscScalar va,InsertMode mode) {return VecSetValuesLocal(v,1,&i,&va,mode);} 39488b03592SBarry Smith 3950c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetLocalToGlobalMappingBlock(Vec,ISLocalToGlobalMapping); 3960c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetValuesBlockedLocal(Vec,PetscInt,const PetscInt[],const PetscScalar[],InsertMode); 39790f02eecSBarry Smith 3980c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDotBegin(Vec,Vec,PetscScalar *); 399ba966639SSatish Balay PetscPolymorphicSubroutine(VecDotBegin,(Vec x,Vec y),(x,y,PETSC_NULL)) 4000c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecDotEnd(Vec,Vec,PetscScalar *); 401fcd5dd21SSatish Balay PetscPolymorphicFunction(VecDotEnd,(Vec x,Vec y),(x,y,&s),PetscScalar,s) 4020c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecTDotBegin(Vec,Vec,PetscScalar *); 403ba966639SSatish Balay PetscPolymorphicSubroutine(VecTDotBegin,(Vec x,Vec y),(x,y,PETSC_NULL)) 4040c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecTDotEnd(Vec,Vec,PetscScalar *); 405fcd5dd21SSatish Balay PetscPolymorphicFunction(VecTDotEnd,(Vec x,Vec y),(x,y,&s),PetscScalar,s) 4060c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecNormBegin(Vec,NormType,PetscReal *); 407ba966639SSatish Balay PetscPolymorphicSubroutine(VecNormBegin,(Vec x,NormType t),(x,t,PETSC_NULL)) 408ba966639SSatish Balay PetscPolymorphicSubroutine(VecNormBegin,(Vec x),(x,NORM_2,PETSC_NULL)) 4090c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecNormEnd(Vec,NormType,PetscReal *); 410fcd5dd21SSatish Balay PetscPolymorphicFunction(VecNormEnd,(Vec x,NormType t),(x,t,&s),PetscReal,s) 411fcd5dd21SSatish Balay PetscPolymorphicFunction(VecNormEnd,(Vec x),(x,NORM_2,&s),PetscReal,s) 412d3c178dbSBarry Smith 4138dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMDotBegin(Vec,PetscInt,const Vec[],PetscScalar *); 4148dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMDotEnd(Vec,PetscInt,const Vec[],PetscScalar *); 4158dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMTDotBegin(Vec,PetscInt,const Vec[],PetscScalar *); 4168dbd3d1dSSatish Balay EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecMTDotEnd(Vec,PetscInt,const Vec[],PetscScalar *); 417a751f32aSSatish Balay 418a751f32aSSatish Balay 4199533e83fSBarry Smith typedef enum {VEC_IGNORE_OFF_PROC_ENTRIES,VEC_IGNORE_NEGATIVE_INDICES} VecOption; 4209533e83fSBarry Smith EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetOption(Vec,VecOption,PetscTruth); 42190f02eecSBarry Smith 422ebe3b25bSBarry Smith /* 423ebe3b25bSBarry Smith Expose VecGetArray()/VecRestoreArray() to users. Allows this to work without any function 424ebe3b25bSBarry Smith call overhead on any 'native' Vecs. 425ebe3b25bSBarry Smith */ 426e1fa1e0fSSatish Balay 4271d8d5f9aSSatish Balay #include "private/vecimpl.h" 428ebe3b25bSBarry Smith 4290c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecContourScale(Vec,PetscReal,PetscReal); 430522c5e43SBarry Smith 43115091d37SBarry Smith /* 43215091d37SBarry Smith These numbers need to match the entries in 4333c94ec11SBarry Smith the function table in vecimpl.h 43415091d37SBarry Smith */ 435499d51b4SSatish Balay typedef enum { VECOP_VIEW = 32, VECOP_LOADINTOVECTOR = 40} VecOperation; 4360c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecSetOperation(Vec,VecOperation,void(*)(void)); 437b19c1e4cSBarry Smith 438e182c471SBarry Smith /* 439e182c471SBarry Smith Routines for dealing with ghosted vectors: 440e182c471SBarry Smith vectors with ghost elements at the end of the array. 441e182c471SBarry Smith */ 4420c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateGhost(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscInt[],Vec*); 4430c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateGhostWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscScalar[],Vec*); 4440c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateGhostBlock(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],Vec*); 4450c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecCreateGhostBlockWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscScalar[],Vec*); 4460c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGhostGetLocalForm(Vec,Vec*); 447ba966639SSatish Balay PetscPolymorphicFunction(VecGhostGetLocalForm,(Vec x),(x,&s),Vec,s) 4480c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGhostRestoreLocalForm(Vec,Vec*); 4490c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGhostUpdateBegin(Vec,InsertMode,ScatterMode); 4500c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecGhostUpdateEnd(Vec,InsertMode,ScatterMode); 451e182c471SBarry Smith 4520c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecConjugate(Vec); 45334233285SBarry Smith 4540c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreateToAll(Vec,VecScatter*,Vec*); 4550c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreateToZero(Vec,VecScatter*,Vec*); 456bba1ac68SSatish Balay 4570c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscViewerMathematicaGetVector(PetscViewer, Vec); 4580c735eedSKris Buschelman EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscViewerMathematicaPutVector(PetscViewer, Vec); 4597dbadf16SMatthew Knepley 460d59c15a7SBarry Smith /*S 461d59c15a7SBarry Smith Vecs - Collection of vectors where the data for the vectors is stored in 462759e7b9cSHong Zhang one contiguous memory 463d59c15a7SBarry Smith 464d59c15a7SBarry Smith Level: advanced 465d59c15a7SBarry Smith 466d59c15a7SBarry Smith Notes: 467d59c15a7SBarry Smith Temporary construct for handling multiply right hand side solves 468d59c15a7SBarry Smith 469d59c15a7SBarry Smith This is faked by storing a single vector that has enough array space for 470d59c15a7SBarry Smith n vectors 471d59c15a7SBarry Smith 472d59c15a7SBarry Smith Concepts: parallel decomposition 473d59c15a7SBarry Smith 474d59c15a7SBarry Smith S*/ 47595fbd943SSatish Balay struct _n_Vecs {PetscInt n; Vec v;}; 47695fbd943SSatish Balay typedef struct _n_Vecs* Vecs; 477d59c15a7SBarry Smith #define VecsDestroy(x) (VecDestroy((x)->v) || PetscFree(x)) 47895fbd943SSatish Balay #define VecsCreateSeq(comm,p,m,x) (PetscNew(struct _n_Vecs,x) || VecCreateSeq(comm,p*m,&(*(x))->v) || (-1 == ((*(x))->n = (m)))) 47995fbd943SSatish Balay #define VecsCreateSeqWithArray(comm,p,m,a,x) (PetscNew(struct _n_Vecs,x) || VecCreateSeqWithArray(comm,p*m,a,&(*(x))->v) || (-1 == ((*(x))->n = (m)))) 48095fbd943SSatish Balay #define VecsDuplicate(x,y) (PetscNew(struct _n_Vecs,y) || VecDuplicate(x->v,&(*(y))->v) || (-1 == ((*(y))->n = (x)->n))) 481e9fa29b7SSatish Balay 482e9fa29b7SSatish Balay 483e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 4842eac72dbSBarry Smith #endif 485