1#define PETSCVEC_DLL 2#include <petscsys.h> 3 4#define NOTLIKELY -1.234567890123 5 6EXTERN_C_BEGIN 7int PETSC_VISIBILITY_PUBLIC PFApply_String(void *value,PetscInt n,PetscScalar *in,PetscScalar *out) 8{ 9 PetscInt i; 10 PetscScalar x,y,z,f = NOTLIKELY,x1 = 0,x2 = 0,x3 = 0,x4 = 0,x5 = 0; 11 PetscScalar f1 = NOTLIKELY, f2 = 0,f3 = 0,f4 = 0,f5 = 0; 12 13 (void)x; 14 (void)y; 15 (void)z; 16 (void)f; 17 (void)x1; 18 (void)x2; 19 (void)x3; 20 (void)x4; 21 (void)x5; 22 (void)f1; 23 (void)f2; 24 (void)f3; 25 (void)f4; 26 (void)f5; 27 for (i=0; i<n; i++) { 28 x1 = x = in[_NIN_*i]; 29#if (_NIN_ > 1) 30 x2 = y = in[_NIN_*i+1]; 31#endif 32#if (_NIN_ > 2) 33 x3 = z = in[_NIN_*i+2]; 34#endif 35#if (_NIN_ > 3) 36 x4 = in[_NIN_*i+3]; 37#endif 38#if (_NIN_ > 4) 39 x5 = in[_NIN_*i+4]; 40#endif 41 FUNCTION; 42 if (f == NOTLIKELY) { 43 out[_NOUT_*i] = f1; 44 } else { 45 out[_NOUT_*i] = f; 46 } 47#if (_NOUT_ > 1) 48 out[_NOUT_*i+1] = f2; 49#endif 50#if (_NOUT_ > 2) 51 out[_NOUT_*i+2] = f3; 52#endif 53#if (_NOUT_ > 3) 54 out[_NOUT_*i+3] = f4; 55#endif 56#if (_NOUT_ > 4) 57 out[_NOUT_*i+4] = f5; 58#endif 59 } 60 return(0); 61} 62EXTERN_C_END 63