source: trunk/examples/berrada/MFLBC_RD_perfomanceMeasurement/resp.h @ 409

Last change on this file since 409 was 385, checked in by lnalod, 14 years ago

Add of the Berrada applications MFLBC and MFLBC_RD. The second is also useful for the test of the parallelization algorithm.

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1
2/***************************************************************************
3                 module classe res.h  -  description
4  rappel :
5  .YSi   correspond ? la i?me sortie
6  .YJiIn correspond ? la d?riv?e de la i?me sortie par rapport ni?me entr?e
7 ***************************************************************************/
8
9  //===========================================================================
10  //                          methodes forward
11  forward (YREAL xpsi1r,YREAL xpsi1c, YREAL xpsi2r,YREAL xpsi2c,YREAL xpsi3r, YREAL xpsi3c,YREAL xdiabr,YREAL xdiabc,YREAL xgamar,YREAL xgamac)
12  {
13        complex<double>         xpsi1 (xpsi1r,xpsi1c);  // 1
14        complex<double>         xpsi2 (xpsi2r,xpsi2c);  // 2
15        complex<double>         xpsi3 (xpsi3r,xpsi3c);  // 3
16        complex<double>         xdiab (xdiabr,xdiabc);  // 4
17        complex<double>         xgama (xgamar,xgamac);  // 5
18
19
20
21        complex<double> var1(0.,0.);
22
23//
24        if(Yi != 0){
25                if(Yj == 0) var1= 0.0;
26                else if(Yj == 1) var1=xdiab*xpsi2-zig*xpsi3;
27                else if(Yj == NZ-1) var1 = -xzig*xpsi1+(xdiab-xzig*exp(-dz*I*xgama))*xpsi2;
28                else var1 = -zig*xpsi1+xdiab*xpsi2-zig*xpsi3;
29                }
30        YS1 = real(var1);
31        YS2 = imag(var1);
32  }
33
34  //===========================================================================
35  //                         methodes  backward
36  backward (YREAL xpsi1r,YREAL xpsi1c, YREAL xpsi2r,YREAL xpsi2c,YREAL xpsi3r, YREAL xpsi3c,YREAL xdiabr,YREAL xdiabc,YREAL xgamar,YREAL xgamac)
37  {
38        complex<double>         xpsi1 (xpsi1r,xpsi1c);  // 1
39        complex<double>         xpsi2 (xpsi2r,xpsi2c);  // 2
40        complex<double>         xpsi3 (xpsi3r,xpsi3c);  // 3
41        complex<double>         xdiab (xdiabr,xdiabc);  // 4
42        complex<double>         xgama (xgamar,xgamac);  // 5
43
44
45        if(Yi != 0){
46                if(Yj == 0){
47                        Ycx_jac( 0.*I, 1, 1);
48                        Ycx_jac( 0.*I, 1, 2);
49                        Ycx_jac( 0.*I, 1, 3);
50                        Ycx_jac( 0.*I, 1, 4);
51                        Ycx_jac( 0.*I, 1, 5);
52                        }
53                else if(Yj == 1){
54                        Ycx_jac( 0.0*I, 1, 1);
55                        Ycx_jac( xdiab, 1, 2);
56                        Ycx_jac( -zig*J, 1, 3);
57                        Ycx_jac( xpsi2, 1, 4);
58                        Ycx_jac( 0.0*I, 1, 5);
59                        }
60                else if(Yj == NZ-1){
61                        Ycx_jac( -zig*J, 1, 1);
62                        Ycx_jac( xdiab-xzig*exp(-dz*I*xgama), 1, 2);
63                        Ycx_jac( 0.0*I, 1, 3);
64                        Ycx_jac( xpsi2, 1, 4);
65                        Ycx_jac( xzig*dz*I*exp(-dz*I*xgama)*xpsi2, 1, 5);
66                        }
67                else{
68                        Ycx_jac( -zig*J, 1, 1);
69                        Ycx_jac( xdiab, 1, 2);
70                        Ycx_jac( -zig*J, 1, 3);
71                        Ycx_jac( xpsi2, 1, 4);
72                        Ycx_jac( 0.0*I, 1, 5);
73                        }
74                }
75//
76   }
77
78  //===========================================================================
79//************************** FIN DU MODULE res ********************************
80
81
82
83
84
85
86
87
88
89
90
Note: See TracBrowser for help on using the repository browser.