Overture  Version 25
rD.h
Go to the documentation of this file.
1 #ifndef R_D_H
2 #define R_D_H "rD.h"
3 
4 
5 //-----------------------------------------------------------------------------
6 // Define second order difference approximations:
7 // The include file cgux2a.h defines second order difference approximations
8 //
9 // Notes:
10 // For efficiency we define UR2, US2 and UT2 to be the arrays that we have precomputed
11 // the parametric derivatives in. (Otherwise the derivatives would get
12 // recomputed for all derivatives). UR2, US2 and UT2 are used in cgux2a.h
13 // to define UX2, UY2, UXX2, ...
14 //-----------------------------------------------------------------------------
15 #define U(I1,I2,I3,N) u(I1,I2,I3,N)
16 #define UR2(I1,I2,I3,KD) ( (U(I1+1,I2,I3,KD)-U(I1-1,I2,I3,KD))*d12(axis1) )
17 #define US2(I1,I2,I3,KD) ( (U(I1,I2+1,I3,KD)-U(I1,I2-1,I3,KD))*d12(axis2) )
18 #define UT2(I1,I2,I3,KD) ( (U(I1,I2,I3+1,KD)-U(I1,I2,I3-1,KD))*d12(axis3) )
19 #include "cgux2a.h" // define 2nd order difference approximations
20 
21 //-----------------------------------------------------------------------------
22 // Define fourth order difference approximations:
23 // The include file cgux4a.h defines fourth order difference approximations
24 //
25 // Notes : see above
26 //----------------------------------------------------------------------------
27 #define UR4(I1,I2,I3,KD) ( (8.*(U(I1+1,I2,I3,KD)-U(I1-1,I2,I3,KD)) \
28  -(U(I1+2,I2,I3,KD)-U(I1-2,I2,I3,KD)))*d14(axis1) )
29 #define US4(I1,I2,I3,KD) ( (8.*(U(I1,I2+1,I3,KD)-U(I1,I2-1,I3,KD)) \
30  -(U(I1,I2+2,I3,KD)-U(I1,I2-2,I3,KD)))*d14(axis2) )
31 #define UT4(I1,I2,I3,KD) ( (8.*(U(I1,I2,I3+1,KD)-U(I1,I2,I3-1,KD)) \
32  -(U(I1,I2,I3+2,KD)-U(I1,I2,I3-2,KD)))*d14(axis3) )
33 #include "cgux4a.h" // define 4th order difference approximations
34 
35 //------------------------------------------------------------------------------------
36 // This function defines derivatives for all derivative types
37 // derivativeType : which derivative to compute
38 // ux : array to put the results in
39 // 4: order of accuracy 2 or 4
40 // .nd : number of dimensions 2 or 3
41 // Notes:
42 // This macro calls one of the macros UX22, UX23, UX42, UX43 etc,
43 // (defined in the include file cgux2a.h or cgux4a.h) to compute a
44 // derivative to first or second order accuracy
45 //------------------------------------------------------------------------------------
46 
47 
48 #endif