15 #define OV_GET_LOCAL_ARRAY(TYPE,UU) TYPE ## SerialArray UU ## Local; getLocalArrayWithGhostBoundaries(UU,UU ## Local);
16 #define OV_GET_LOCAL_ARRAY_CONST(TYPE,UU) TYPE ## SerialArray UU ## Local; getLocalArrayWithGhostBoundaries(UU,UU ## Local);
17 #define OV_GET_LOCAL_ARRAY_FROM(TYPE,UU,FROM) TYPE ## SerialArray UU ## Local; getLocalArrayWithGhostBoundaries(FROM,UU ## Local);
18 #define OV_GET_LOCAL_ARRAY_CONDITIONAL(TYPE,UU,boolExp,isTrue, isFalse) TYPE ## SerialArray UU ## Local; \
19 if ( boolExp ) { isTrue; } \
20 else { getLocalArrayWithGhostBoundaries( isFalse, UU ## Local ); }
24 #define OV_GET_LOCAL_ARRAY(TYPE,UU) TYPE ## SerialArray & UU ## Local = UU;
25 #define OV_GET_LOCAL_ARRAY_CONST(TYPE,UU) const TYPE ## SerialArray & UU ## Local = UU;
26 #define OV_GET_LOCAL_ARRAY_FROM(TYPE,UU,FROM) TYPE ## SerialArray & UU ## Local = FROM;
27 #define OV_GET_LOCAL_ARRAY_CONDITIONAL(TYPE,UU,boolExp,isTrue, isFalse) TYPE ## SerialArray & UU ## Local = ( boolExp ) ? isTrue : isFalse;
32 #define OV_APP_TO_PTR_3D(TYPE,ARRAY, PNAME) TYPE *PNAME = ARRAY.Array_Descriptor.Array_View_Pointer2; \
33 const int PNAME ## _d0 = ARRAY.getRawDataSize(0); \
34 const int PNAME ## _d1 = ARRAY.getRawDataSize(1);
36 #define A_3D(PNAME,i0,i1,i2) PNAME[i0+(PNAME ## _d0)*(i1+(PNAME ## _d1)*(i2))]
38 #define OV_APP_TO_PTR_4D(TYPE,ARRAY, PNAME) TYPE *PNAME = ARRAY.Array_Descriptor.Array_View_Pointer3; \
39 const int PNAME ## _d0 = ARRAY.getRawDataSize(0); \
40 const int PNAME ## _d1 = ARRAY.getRawDataSize(1); \
41 const int PNAME ## _d2 = ARRAY.getRawDataSize(2);
43 #define A_4D(PNAME,i0,i1,i2,i3) PNAME[i0+(PNAME ## _d0)*(i1+(PNAME ## _d1)*(i2+(PNAME ## _d2)*(i3)))]
45 #define OV_APP_TO_PTR_5D(TYPE,ARRAY, PNAME) TYPE *PNAME = ARRAY.Array_Descriptor.Array_View_Pointer4; \
46 const int PNAME ## _d0 = ARRAY.getRawDataSize(0); \
47 const int PNAME ## _d1 = ARRAY.getRawDataSize(1); \
48 const int PNAME ## _d2 = ARRAY.getRawDataSize(2); \
49 const int PNAME ## _d3 = ARRAY.getRawDataSize(3);
51 #define A_5D(PNAME,i0,i1,i2,i3,i4) PNAME[i0+(PNAME ## _d0)*(i1+(PNAME ## _d1)*(i2+(PNAME ## _d2)*(i3+(PNAME ## _d3)*(i4))))]
53 #define OV_RGF_TO_PTR_5D(TYPE,ARRAY, PNAME, ND) TYPE *PNAME = ARRAY.Array_Descriptor.Array_View_Pointer3; \
54 const int PNAME ## _d0 = ARRAY.getRawDataSize(0); \
55 const int PNAME ## _d1 = ARRAY.getRawDataSize(1); \
56 const int PNAME ## _d2 = ARRAY.getRawDataSize(2); \
57 const int PNAME ## _d3 = ND;
63 const ArraySimpleFixed<real,3,3,1,1> &A,
64 const ArraySimpleFixed<real,3,1,1,1> &
f,
65 ArraySimpleFixed<real,3,1,1,1> &
u)
70 ( A(0,0)*(A(1,1)*A(2,2)-A(1,2)*A(2,1)) -
71 A(0,1)*(A(1,0)*A(2,2)-A(1,2)*A(2,0)) +
72 A(0,2)*(A(1,0)*A(2,1)-A(2,0)*A(1,2)) ) :
73 ( A(0,0)*A(1,1) - A(0,1)*A(1,0) );
75 assert(fabs(det)>10*REAL_EPSILON);
81 u[0] = ( A(1,1)*f[0] - A(0,1)*f[1])*deti;
82 u[1] = (-A(1,0)*f[0] + A(0,0)*f[1])*deti;
87 u[0] = ( (A(1,1)*A(2,2)-A(1,2)*A(2,1))*
f(0) -
88 (A(0,1)*A(2,2)-A(0,2)*A(2,1))*
f(1) +
89 (A(0,1)*A(1,2)-A(0,2)*A(1,1))*
f(2) )*deti;
91 u[1] = (-(A(1,0)*A(2,2)-A(1,2)*A(2,0))*
f(0)+
92 (A(0,0)*A(2,2)-A(2,0)*A(0,2))*
f(1)-
93 (A(0,0)*A(1,2)-A(0,2)*A(1,0))*
f(2) )*deti;
95 u[2] = ( (A(1,0)*A(2,1)-A(1,1)*A(2,0))*
f(0) -
96 (A(0,0)*A(2,1)-A(0,1)*A(2,0))*
f(1) +
97 (A(0,0)*A(1,1)-A(0,1)*A(1,0))*
f(2) )*deti;