ParMooN
 All Classes Functions Variables Friends Pages
BF_N_T_RT1_2D.h
1 // ***********************************************************************
2 // P1 Raviart-Thomas vector element, nonconforming , 2D
3 // History: 17.10.2011 implementation (Ulrich)
4 // ***********************************************************************
5 
6 // base function values
7 // vector function, orthonormal to edges,
8 // functions 1 and 2 are orthogonal to edge 1
9 // functions 3 and 4 are orthogonal to edge 2
10 // functions 5 and 6 are orthogonal to edge 3
11 // functions 7 and 8 correspond to inner degrees of freedom
12 
13 // coefficient matrix
14 // using equidistant points on edges and integral evaluation for inner dofs
15 /*static double N_T_RT1_2D_CM[64] = {
16  0, 0, 0, 0, 1,-2, 0, 0,
17  -2, 1, 0, 0, 0, 0, 0, 0,
18  3,-2,-2,-1,-1, 6, 16, 8,
19  3,-3, 0, 0, 0, 0, 0, 0,
20  0, 0, 0, 0,-3, 3, 0, 0,
21  6,-1,-1,-2,-2, 3, 8, 16,
22  -4, 4, 4, 0, 0,-4,-16,-8,
23  -4, 0,-0, 4, 4,-4,-8, -16
24 };*/
25 /*
26 // using Gauss-Points on edges and integral evaluation for inner dofs
27 static double N_T_RT1_2D_CM[64] = { // using Gauss-Points
28 0,0,0,0,0.3660254,-1.3660254,0,0,
29 -1.3660254,0.3660254,0,0,0,0,0,0,
30 1.94337567,-0.94337567,-1.78867513,-1.21132487,0.47927406,4.52072594,16,8,
31 1.73205081,-1.73205081,0,0,0,0,0,0,
32 0,0,0,0,-1.73205081,1.73205081,0,0,
33 4.52072594,0.47927406,-1.21132487,-1.78867513,-0.94337567,1.94337567,8,16,
34 -2.30940108,2.30940108,3.15470054,0.84529946,-0.84529946,-3.15470054,-16,-8,
35 -3.15470054,-0.84529946,0.84529946,3.15470054,2.30940108,-2.30940108,-8,-16
36 };
37 */
38 /*
39 // using Tschebyscheff-points on edges and integral evaluation for inner dofs
40 static double N_T_RT1_2D_CM[64] = {
41 0,0,0,0,0.20710678,-1.20710678,0,0,
42 -1.20710678,0.20710678,-0,-0,-0,0,0,0,
43 1.6785113,-0.6785113,-1.73570226,-1.26429774,0.85008418,4.14991582,16,8,
44 1.41421356,-1.41421356,0,0,0,-0,-0,-0,
45 0,0,0,0,-1.41421356,1.41421356,0,0,
46 4.14991582,0.85008418,-1.26429774,-1.73570226,-0.6785113,1.6785113,8,16,
47 -1.88561808,1.88561808,2.94280904,1.05719096,-1.05719096,-2.94280904,-16,-8,
48 -2.94280904,-1.05719096,1.05719096,2.94280904,1.88561808,-1.88561808,-8,-16
49 };
50 */
51 // using Tschebyscheff-points on edges and point evaluation for inner dofs
52 static double N_T_RT1_2D_CM[64] = {
53 0,0,0,0,0.2071067812,-1.2071067812,0,0,
54 -1.2071067812,0.2071067812,0,0,0,0,0,0,
55 1.2071067812,-0.2071067812,-1,-1,0.5857864376,3.4142135624,6,3,
56 1.4142135624,-1.4142135624,0,0,0,0,0,0,
57 0,0,0,0,-1.4142135624,1.4142135624,0,0,
58 3.4142135624,0.5857864376,-1,-1,-0.2071067812,1.2071067812,3,6,
59 -1.4142135624,1.4142135624,2.2071067812,0.7928932188,-0.7928932188,-2.2071067812,-6,-3,
60 -2.2071067812,-0.7928932188,0.7928932188,2.2071067812,1.4142135624,-1.4142135624,-3,-6
61 };
62 static void N_T_RT1_2D_Funct(double xi, double eta, double *values)
63 {
64  int nBF = 8; // number of basis functions
65  // monomials x-component and y-component
66  double mon_x[]={1,0,xi,0 ,eta,0 ,xi*xi ,xi*eta };
67  double mon_y[]={0,1,0 ,xi,0 ,eta,xi*eta,eta*eta};
68 
69  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
70  for(int i=0; i<nBF; i++)
71  {
72  for(int j=0; j<nBF; j++)
73  {
74  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
75  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
76  }
77  }
78 }
79 
80 // values of the derivatives in xi direction
81 static void N_T_RT1_2D_DeriveXi(double xi, double eta, double *values)
82 {
83  int nBF = 8; // number of basis functions
84  // monomials x-component and y-component
85  double mon_x[]={0,0,1,0,0,0,2*xi,eta };
86  double mon_y[]={0,0,0,1,0,0,eta ,0};
87  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
88  for(int i=0; i<nBF; i++)
89  {
90  for(int j=0; j<nBF; j++)
91  {
92  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
93  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
94  }
95  }
96 }
97 
98 // values of the derivatives in eta direction
99 static void N_T_RT1_2D_DeriveEta(double xi, double eta, double *values)
100 {
101  int nBF = 8; // number of basis functions
102  // monomials x-component and y-component
103  double mon_x[]={0,0,0,0,1,0,0 ,xi };
104  double mon_y[]={0,0,0,0,0,1,xi,2*eta};
105  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
106  for(int i=0; i<nBF; i++)
107  {
108  for(int j=0; j<nBF; j++)
109  {
110  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
111  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
112  }
113  }
114 }
115 
116 // values of derivatives in xi-xi direction
117 static void N_T_RT1_2D_DeriveXiXi(double xi, double eta, double *values)
118 {
119  int nBF = 8; // number of basis functions
120  // monomials x-component and y-component
121  double mon_x[]={0,0,0,0,0,0,2,0};
122  double mon_y[]={0,0,0,0,0,0,0,0};
123  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
124  for(int i=0; i<nBF; i++)
125  {
126  for(int j=0; j<nBF; j++)
127  {
128  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
129  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
130  }
131  }
132 }
133 
134 // values of derivatives in eta-eta direction
135 static void N_T_RT1_2D_DeriveEtaEta(double xi, double eta, double *values)
136 {
137  int nBF = 8; // number of basis functions
138  // monomials x-component and y-component
139  double mon_x[]={0,0,0,0,0,0,0,0};
140  double mon_y[]={0,0,0,0,0,0,0,2};
141  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
142  for(int i=0; i<nBF; i++)
143  {
144  for(int j=0; j<nBF; j++)
145  {
146  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
147  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
148  }
149  }
150 }
151 
152 // values of derivatives in xi-eta direction
153 static void N_T_RT1_2D_DeriveXiEta(double xi, double eta, double *values)
154 {
155  int nBF = 8; // number of basis functions
156  // monomials x-component and y-component
157  double mon_x[]={0,0,0,0,0,0,0,1};
158  double mon_y[]={0,0,0,0,0,0,1,0};
159  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
160  for(int i=0; i<nBF; i++)
161  {
162  for(int j=0; j<nBF; j++)
163  {
164  values[i ] += N_T_RT1_2D_CM[i+j*nBF]*mon_x[j];
165  values[i+nBF] += N_T_RT1_2D_CM[i+j*nBF]*mon_y[j];
166  }
167  }
168 }
169 
170 // ***********************************************************************
171 
172 TBaseFunct2D *BF_N_T_RT1_2D_Obj = new TBaseFunct2D
173  (8, BF_N_T_RT1_2D, BFUnitTriangle,
174  N_T_RT1_2D_Funct, N_T_RT1_2D_DeriveXi,
175  N_T_RT1_2D_DeriveEta, N_T_RT1_2D_DeriveXiXi,
176  N_T_RT1_2D_DeriveXiEta, N_T_RT1_2D_DeriveEtaEta, 2, 1,
177  0, NULL, 2);
Definition: BaseFunct2D.h:27