ParMooN
 All Classes Functions Variables Friends Pages
BF_N_Q_RT2_2D.h
1 // ***********************************************************************
2 // Q2 Raviart-Thomas vector element, nonconforming , 2D
3 // History: 05.12.2011 implementation (Ulrich)
4 // ***********************************************************************
5 
6 // base function values
7 // vector function, orthonormal to edges,
8 // functions 1,2, and 3 are orthogonal to edge 1
9 // functions 4,5, and 6 are orthogonal to edge 2
10 // functions 7,8, and 9 are orthogonal to edge 3
11 // functions 10,11, and 12 are orthogonal to edge 4
12 // functions 13-24 correspond to inner degrees of freedom
13 
14 
15 // coefficient matrix for different choices of the degrees of freedom
16 // There seems to be no difference in using integral or point evaluation for
17 // inner dofs.
18 // The dofs on the edges determine the boundary conditions as well. Using
19 // Tschebyscheff-points might improve the boundary approximation.
20 
21 // using equidistant points on edges and integral evaluation for inner dofs
22 /*static double N_Q_RT2_2D_CM[576] = {
23 0,0,0,0,-0.125,0,0,0,0,0,0.125,0,0.84375,0,0,0,0,0,0,-1.40625,0,0,0,0,
24 0,0.125,0,0,0,0,0,-0.125,0,0,0,0,0,0.84375,0,0,0,0,-1.40625,0,0,0,0,0,
25 0,0,0,0,-0.375,0,0,0,0,0,-0.375,0,0,0,4.21875,0,0,0,0,0,0,0,0,-7.03125,
26 -0.125,0,0.125,0,0,0,-0.125,-0,0.125,0,0,0,0,0,0,1.125,0,-0,-0,0,0,0,0,0,
27 0,0,0,0.125,-0,-0.125,0,0,0,0.125,-0,-0.125,-0,0,0,0,1.125,0,0,0,0,0,0,-0,
28 -0,-0.375,-0,0,0,0,-0,-0.375,-0,0,0,0,0,-0,0,-0,0,4.21875,0,0,0,0,-7.03125,0,
29 0,0,0,0,0.375,-0,0,0,0,0,-0.375,0,-0.84375,0,-0,0,0,0,0,1.40625,0,0,0,0,
30 0.25,-0.5,0.25,0,0,0,-0.25,0.5,-0.25,0,0,0,0,-1.40625,0,0,0,0,4.21875,0,0,0,0,0,
31 0,0,0,-0.25,0.5,-0.25,0,0,0,0.25,-0.5,0.25,-1.40625,0,0,0,0,0,0,4.21875,0,0,0,0,
32 -0,-0.375,0,0,0,0,0,0.375,0,0,0,0,0,-0.84375,0,0,0,0,1.40625,0,0,0,0,0,
33 0,0,0,0.375,0,-0.375,0,0,0,-0.375,-0,0.375,-0,0,-0,0,0,0,0,0,5.625,0,0,-0,
34 0.375,0,-0.375,0,0,0,-0.375,0,0.375,0,0,0,0,-0,0,0,0,0,0,0,0,5.625,0,0,
35 0,0,0,-0,0.625,-0,0,0,0,-0,0.625,-0,0,0,-4.21875,0,-0,0,0,-0,-0,0,0,7.03125,
36 0,0.625,0,0,0,0,0,0.625,0,0,0,0,0,0,0,0,0,-4.21875,-0,0,0,0,7.03125,0,
37 0,0,0,-0.375,0,0.375,0,0,0,-0.375,0,0.375,0,0,-0,0,-1.125,0,0,-0,-0,0,0,0,
38 -0.75,1.5,-0.75,0,0,0,-0.75,1.5,-0.75,0,0,0,0,0,0,0,0,-7.03125,0,0,0,0,21.09375,0,
39 0,0,0,-0.75,1.5,-0.75,0,0,0,-0.75,1.5,-0.75,0,0,-7.03125,0,0,0,0,0,0,0,0,21.09375,
40 0.375,0,-0.375,0,0,0,0.375,0,-0.375,0,0,0,0,0,0,-1.125,0,0,0,0,0,0,0,0,
41 0,0,0,-0.625,-0,0.625,0,0,0,0.625,0,-0.625,0,0,0,0,-0,0,0,-0,-5.625,0,0,0,
42 -0.625,-0,0.625,0,0,0,0.625,-0,-0.625,0,0,0,0,-0,0,-0,0,-0,0,0,0,-5.625,-0,0,
43 0,0,0,0.75,-1.5,0.75,0,0,0,-0.75,1.5,-0.75,1.40625,0,0,0,0,0,0,-4.21875,0,0,0,0,
44 -0.75,1.5,-0.75,0,0,0,0.75,-1.5,0.75,0,0,0,0,1.40625,0,0,0,0,-4.21875,0,0,0,0,0,
45 0,0,0,1.25,-2.5,1.25,0,0,0,1.25,-2.5,1.25,0,0,7.03125,0,0,0,0,0,0,0,0,-21.09375,
46 1.25,-2.5,1.25,0,0,0,1.25,-2.5,1.25,0,0,0,0,0,0,0,0,7.03125,0,0,0,0,-21.09375,0
47 };*/
48 
49 // using Gauss-Points on edges and integral evaluation for inner dofs
50 /*static double N_Q_RT2_2D_CM[576] = {
51 0,0,0,0,-0.125,0,0,0,0,0,0.125,-0,0.84375,0,0,0,0,0,0,-1.40625,-0,0,0,0,
52 0,0.125,0,0,0,0,0,-0.125,0,0,0,0,0,0.84375,0,0,0,0,-1.40625,0,0,0,0,0,
53 0,0,0,0,-0.375,0,0,0,0,0,-0.375,0,-0,0,4.21875,0,0,0,0,0,0,0,0,-7.03125,
54 -0.08068715,0,0.08068715,0,0,0,-0.08068715,0,0.08068715,0,0,0,0,0,0,1.125,0,0,0,0,0,0,0,0,
55 0,0,0,0.08068715,0,-0.08068715,0,0,0,0.08068715,0,-0.08068715,0,0,0,0,1.125,0,0,0,0,0,0,0,
56 0,-0.375,0,0,0,0,0,-0.375,0,0,0,0,0,0,0,0,0,4.21875,0,0,0,0,-7.03125,0,
57 0,0,0,0,0.375,0,0,0,0,0,-0.375,0,-0.84375,0,0,0,0,0,0,1.40625,0,0,0,0,
58 0.10416667,-0.20833333,0.10416667,0,0,0,-0.10416667,0.20833333,-0.10416667,0,0,0,0,-1.40625,0,0,0,-0,4.21875,0,0,0,0,0,
59 0,0,0,-0.10416667,0.20833333,-0.10416667,0,0,0,0.10416667,-0.20833333,0.10416667,-1.40625,0,0,0,0,0,0,4.21875,0,0,0,0,
60 0,-0.375,0,0,0,0,0,0.375,0,0,0,0,0,-0.84375,0,0,0,0,1.40625,0,0,0,0,0,
61 0,0,0,0.24206146,0,-0.24206146,0,0,0,-0.24206146,0,0.24206146,0,0,0,0,0,0,0,0,5.625,0,0,0,
62 0.24206146,0,-0.24206146,0,0,0,-0.24206146,0,0.24206146,0,0,0,0,0,0,0,0,0,0,0,0,5.625,0,0,
63 0,0,0,-0,0.625,0,0,0,0,0,0.625,0,0,0,-4.21875,0,0,0,0,0,0,0,0,7.03125,
64 0,0.625,0,0,0,0,0,0.625,0,0,0,0,0,0,0,0,0,-4.21875,0,0,0,0,7.03125,0,
65 0,0,0,-0.24206146,0,0.24206146,0,0,0,-0.24206146,0,0.24206146,0,0,0,0,-1.125,0,0,0,0,0,0,0,
66 -0.3125,0.625,-0.3125,0,0,0,-0.3125,0.625,-0.3125,0,0,0,0,0,0,0,0,-7.03125,0,0,0,0,21.09375,0,
67 0,0,0,-0.3125,0.625,-0.3125,0,0,0,-0.3125,0.625,-0.3125,0,0,-7.03125,0,0,0,0,0,0,0,0,21.09375,
68 0.24206146,0,-0.24206146,0,0,0,0.24206146,0,-0.24206146,0,0,0,0,0,0,-1.125,0,0,0,0,0,0,0,0,
69 0,0,0,-0.40343577,-0,0.40343577,0,0,0,0.40343577,0,-0.40343577,0,0,0,0,0,0,0,0,-5.625,0,0,0,
70 -0.40343577,0,0.40343577,0,0,0,0.40343577,0,-0.40343577,0,0,0,0,0,0,0,0,0,0,0,0,-5.625,0,0,
71 0,0,0,0.3125,-0.625,0.3125,0,0,0,-0.3125,0.625,-0.3125,1.40625,0,0,0,0,0,0,-4.21875,0,0,0,0,
72 -0.3125,0.625,-0.3125,0,0,0,0.3125,-0.625,0.3125,0,0,0,0,1.40625,0,0,0,0,-4.21875,0,0,0,0,0,
73 0,0,0,0.52083333,-1.04166667,0.52083333,0,0,0,0.52083333,-1.04166667,0.52083333,0,0,7.03125,0,0,0,0,0,0,0,0,-21.09375,
74 0.52083333,-1.04166667,0.52083333,0,0,0,0.52083333,-1.04166667,0.52083333,0,0,0,0,0,0,0,0,7.03125,0,0,0,0,-21.09375,0
75 };*/
76 /*
77 // using Tschebyscheff-points on edges and integral evaluations for inner dofs
78 static double N_Q_RT2_2D_CM[576] = {
79 0,0,0,0,-0.125,0,0,0,0,-0,0.125,-0,0.84375,0,0,0,-0,0,0,-1.40625,-0,0,0,0,
80 -0,0.125,-0,0,0,0,0,-0.125,0,0,0,0,0,0.84375,0,-0,0,-0,-1.40625,0,0,-0,0,0,
81 0,0,0,0,-0.375,0,0,0,0,0,-0.375,0,-0,0,4.21875,0,0,0,0,0,0,0,0,-7.03125,
82 -0.07216878,0,0.07216878,0,0,0,-0.07216878,0,0.07216878,0,0,0,0,0,0,1.125,0,-0,-0,0,0,0,0,0,
83 0,0,0,0.07216878,-0,-0.07216878,0,0,0,0.07216878,-0,-0.07216878,-0,0,0,0,1.125,0,0,0,0,0,0,-0,
84 -0,-0.375,-0,0,0,0,-0,-0.375,-0,0,0,0,0,-0,0,0,0,4.21875,0,0,0,-0,-7.03125,0,
85 0,0,0,-0,0.375,-0,0,0,0,0,-0.375,0,-0.84375,0,-0,0,0,0,0,1.40625,0,0,0,0,
86 0.08333333,-0.16666667,0.08333333,0,0,0,-0.08333333,0.16666667,-0.08333333,0,0,0,0,-1.40625,0,-0,0,0,4.21875,0,0,0,-0,0,
87 0,0,0,-0.08333333,0.16666667,-0.08333333,0,0,0,0.08333333,-0.16666667,0.08333333,-1.40625,0,-0,0,0,0,0,4.21875,0,0,0,0,
88 -0,-0.375,-0,0,0,0,-0,0.375,0,0,0,0,0,-0.84375,0,0,0,0,1.40625,0,0,-0,-0,0,
89 0,0,0,0.21650635,0,-0.21650635,0,0,0,-0.21650635,-0,0.21650635,-0,0,-0,0,0,0,0,0,5.625,0,0,-0,
90 0.21650635,-0,-0.21650635,0,0,0,-0.21650635,0,0.21650635,0,0,0,0,-0,0,-0,0,0,0,0,0,5.625,0,0,
91 0,0,0,-0,0.625,0,0,0,0,-0,0.625,-0,0,0,-4.21875,0,-0,0,0,-0,-0,0,0,7.03125,
92 0,0.625,-0,0,0,0,0,0.625,0,0,0,0,0,0,0,-0,0,-4.21875,-0,0,0,0,7.03125,0,
93 0,0,0,-0.21650635,0,0.21650635,0,0,0,-0.21650635,0,0.21650635,0,0,-0,0,-1.125,0,0,-0,-0,0,0,0,
94 -0.25,0.5,-0.25,0,0,0,-0.25,0.5,-0.25,0,0,0,0,0,0,-0,0,-7.03125,-0,0,0,0,21.09375,0,
95 0,0,0,-0.25,0.5,-0.25,0,0,0,-0.25,0.5,-0.25,0,0,-7.03125,0,-0,0,0,-0,-0,0,0,21.09375,
96 0.21650635,-0,-0.21650635,0,0,0,0.21650635,-0,-0.21650635,0,0,0,0,-0,0,-1.125,0,0,0,0,0,-0,-0,0,
97 0,0,0,-0.36084392,-0,0.36084392,0,0,0,0.36084392,0,-0.36084392,0,0,0,0,-0,0,0,-0,-5.625,0,0,0,
98 -0.36084392,0,0.36084392,0,0,0,0.36084392,-0,-0.36084392,0,0,0,0,0,0,0,0,-0,-0,0,0,-5.625,-0,-0,
99 0,0,0,0.25,-0.5,0.25,0,0,0,-0.25,0.5,-0.25,1.40625,0,0,0,-0,0,0,-4.21875,-0,0,0,0,
100 -0.25,0.5,-0.25,0,0,0,0.25,-0.5,0.25,0,0,0,0,1.40625,0,0,0,-0,-4.21875,0,0,0,0,0,
101 0,0,0,0.41666667,-0.83333333,0.41666667,0,0,0,0.41666667,-0.83333333,0.41666667,-0,0,7.03125,0,0,0,0,0,0,0,-0,-21.09375,
102 0.41666667,-0.83333333,0.41666667,0,0,0,0.41666667,-0.83333333,0.41666667,0,0,0,0,-0,0,0,0,7.03125,0,0,0,-0,-21.09375,0
103 };
104 */
105 // using Tschebyscheff-points on edges and point evaluations for inner dofs
106 static double N_Q_RT2_2D_CM[576] = {
107 0,0,0,-0,-0.25,0,0,0,0,0,0.25,-0,0,0,0,0,-0,0,0,1,-0,-0,1,0,
108 0,0.25,-0,0,0,0,0,-0.25,-0,0,0,0,0,1,-0,0,1,0,0,-0,0,0,0,0,
109 0,0,0,0,-0.25,0,0,0,0,0,-0.25,0,0,0,0,0,-0,0,0,1.4142135624,-0,0,-1.4142135624,0,
110 -0.1443375673,0,0.1443375673,0,0,0,-0.1443375673,0,0.1443375673,0,0,0,-0.5773502692,0,0.5773502692,-0.5773502692,-0,0.5773502692,0,0,0,0,0,0,
111 0,0,0,0.1443375673,0,-0.1443375673,0,0,0,0.1443375673,0,-0.1443375673,0,0,0,0,-0,0,-0.5773502692,0,0.5773502692,-0.5773502692,0,0.5773502692,
112 0,-0.25,-0,0,0,0,-0,-0.25,-0,0,0,0,-0,-1.4142135624,-0,0,1.4142135624,0,0,0,0,0,0,0,
113 0,0,0,-0,0.5,0,0,0,0,-0,-0.5,0,0,0,0,0,-0,0,-0,-1,0,0,-1,-0,
114 0.1666666667,-0.3333333333,0.1666666667,0,0,0,-0.1666666667,0.3333333333,-0.1666666667,0,0,0,0.6666666667,-1.3333333333,0.6666666667,0.6666666667,-1.3333333333,0.6666666667,0,0,0,0,0,0,
115 0,0,0,-0.1666666667,0.3333333333,-0.1666666667,0,0,0,0.1666666667,-0.3333333333,0.1666666667,0,0,0,0,-0,0,0.6666666667,-1.3333333333,0.6666666667,0.6666666667,-1.3333333333,0.6666666667,
116 -0,-0.5,0,0,0,0,0,0.5,0,0,0,0,0,-1,0,-0,-1,0,0,0,0,0,0,0,
117 0,0,0,0.1443375673,0,-0.1443375673,0,0,0,-0.1443375673,0,0.1443375673,0,0,0,0,-0,0,-0.8164965809,0,0.8164965809,0.8164965809,0,-0.8164965809,
118 0.1443375673,-0,-0.1443375673,0,0,0,-0.1443375673,0,0.1443375673,0,0,0,0.8164965809,-0,-0.8164965809,-0.8164965809,-0,0.8164965809,0,0,0,0,0,0,
119 0,0,0,0,0.5,-0,0,0,0,-0,0.5,-0,0,0,0,0,-0,0,0,-1.4142135624,0,-0,1.4142135624,-0,
120 -0,0.5,0,0,0,0,0,0.5,0,0,0,0,0,1.4142135624,0,-0,-1.4142135624,-0,0,0,0,0,0,0,
121 0,0,0,-0.2886751346,0,0.2886751346,0,0,0,-0.2886751346,0,0.2886751346,0,0,0,0,-0,0,0.5773502692,0,-0.5773502692,0.5773502692,0,-0.5773502692,
122 -0.1666666667,0.3333333333,-0.1666666667,0,0,0,-0.1666666667,0.3333333333,-0.1666666667,0,0,0,-0.9428090416,1.8856180832,-0.9428090416,0.9428090416,-1.8856180832,0.9428090416,0,0,0,0,0,0,
123 0,0,0,-0.1666666667,0.3333333333,-0.1666666667,0,0,0,-0.1666666667,0.3333333333,-0.1666666667,0,0,0,0,-0,0,0.9428090416,-1.8856180832,0.9428090416,-0.9428090416,1.8856180832,-0.9428090416,
124 0.2886751346,-0,-0.2886751346,0,0,0,0.2886751346,-0,-0.2886751346,0,0,0,0.5773502692,-0,-0.5773502692,0.5773502692,0,-0.5773502692,0,0,0,0,0,0,
125 0,0,0,-0.2886751346,0,0.2886751346,0,0,0,0.2886751346,0,-0.2886751346,0,0,0,0,-0,0,0.8164965809,0,-0.8164965809,-0.8164965809,0,0.8164965809,
126 -0.2886751346,-0,0.2886751346,0,0,0,0.2886751346,-0,-0.2886751346,0,0,0,-0.8164965809,0,0.8164965809,0.8164965809,0,-0.8164965809,0,-0,0,0,0,0,
127 0,0,0,0.3333333333,-0.6666666667,0.3333333333,0,0,0,-0.3333333333,0.6666666667,-0.3333333333,0,0,0,0,-0,0,-0.6666666667,1.3333333333,-0.6666666667,-0.6666666667,1.3333333333,-0.6666666667,
128 -0.3333333333,0.6666666667,-0.3333333333,0,0,0,0.3333333333,-0.6666666667,0.3333333333,0,0,0,-0.6666666667,1.3333333333,-0.6666666667,-0.6666666667,1.3333333333,-0.6666666667,0,0,0,0,0,0,
129 0,0,0,0.3333333333,-0.6666666667,0.3333333333,0,0,0,0.3333333333,-0.6666666667,0.3333333333,0,0,0,0,0,0,-0.9428090416,1.8856180832,-0.9428090416,0.9428090416,-1.8856180832,0.9428090416,
130 0.3333333333,-0.6666666667,0.3333333333,0,0,0,0.3333333333,-0.6666666667,0.3333333333,0,0,0,0.9428090416,-1.8856180832,0.9428090416,-0.9428090416,1.8856180832,-0.9428090416,0,0,0,0,0,0
131 };
132 
133 
134 static void N_Q_RT2_2D_Funct(double xi, double eta, double *values)
135 {
136  int nBF = 24; // number of basis functions
137  // monomials x-component and y-component
138  double mon_x[24]={1,0,xi,0 ,eta,0 ,xi*xi,0, eta*eta, 0, xi*eta, 0, xi*xi*xi, 0, xi*xi*eta, 0, xi*eta*eta, 0, xi*xi*xi*eta, 0, xi*xi*eta*eta, 0, xi*xi*xi*eta*eta, 0};
139  double mon_y[24]={0, 1, 0, xi, 0, eta, 0, xi*xi, 0, eta*eta, 0, xi*eta, 0, eta*eta*eta, 0, xi*xi*eta, 0, xi*eta*eta, 0, xi*eta*eta*eta, 0, xi*xi*eta*eta, 0, xi*xi*eta*eta*eta};
140 
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_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
147  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
148  }
149  }
150 }
151 
152 // values of the derivatives in xi direction
153 static void N_Q_RT2_2D_DeriveXi(double xi, double eta, double *values)
154 {
155  int nBF = 24; // number of basis functions
156  // monomials x-component and y-component
157  double mon_x[24]={0,0,1,0,0,0,2*xi,0,0,0,eta,0,3*xi*xi,0,2*xi*eta,0,eta*eta, 0,3*xi*xi*eta,0,2*xi*eta*eta,0,3*xi*xi*eta*eta,0};
158  double mon_y[24]={0,0,0,1,0,0,0,2*xi,0,0,0,eta,0,0,0,2*xi*eta,0,eta*eta,0, eta*eta*eta,0,2*xi*eta*eta,0,2*xi*eta*eta*eta};
159 
160  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
161  for(int i=0; i<nBF; i++)
162  {
163  for(int j=0; j<nBF; j++)
164  {
165  values[i ] += N_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
166  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
167  }
168  }
169 }
170 
171 // values of the derivatives in eta direction
172 static void N_Q_RT2_2D_DeriveEta(double xi, double eta, double *values)
173 {
174  int nBF = 24; // number of basis functions
175  // monomials x-component and y-component
176  double mon_x[24]={0,0,0,0,1,0,0,0,2*eta,0,xi,0,0,0,xi*xi,0,2*xi*eta,0, xi*xi*xi,0,2*xi*xi*eta,0,2*xi*xi*xi*eta, 0};
177  double mon_y[24]={0,0,0,0,0,1,0,0,0,2*eta,0,xi,0,3*eta*eta,0,xi*xi,0, 2*xi*eta,0,3*xi*eta*eta,0,2*xi*xi*eta,0,3*xi*xi*eta*eta};
178 
179  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
180  for(int i=0; i<nBF; i++)
181  {
182  for(int j=0; j<nBF; j++)
183  {
184  values[i ] += N_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
185  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
186  }
187  }
188 }
189 
190 // values of derivatives in xi-xi direction
191 static void N_Q_RT2_2D_DeriveXiXi(double xi, double eta, double *values)
192 {
193  int nBF = 24; // number of basis functions
194  // monomials x-component and y-component
195  double mon_x[24]={0,0,0,0,0,0,2,0,0,0,0,0,6*xi,0,2*eta,0,0,0,6*xi*eta,0,2*eta*eta, 0,6*xi*eta*eta,0};
196  double mon_y[24]={0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2*eta,0,0,0,0,0,2*eta*eta,0, 2*eta*eta*eta};
197 
198  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
199  for(int i=0; i<nBF; i++)
200  {
201  for(int j=0; j<nBF; j++)
202  {
203  values[i ] += N_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
204  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
205  }
206  }
207 }
208 
209 // values of derivatives in eta-eta direction
210 static void N_Q_RT2_2D_DeriveEtaEta(double xi, double eta, double *values)
211 {
212  int nBF = 24; // number of basis functions
213  // monomials x-component and y-component
214  double mon_x[24]={0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2*xi,0,0,0,2*xi*xi,0, 2*xi*xi*xi, 0};
215  double mon_y[24]={0,0,0,0,0,0,0,0,0,2,0,0,0,6*eta,0,0,0,2*xi,0,6*xi*eta,0, 2*xi*xi,0,6*xi*xi*eta};
216 
217  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
218  for(int i=0; i<nBF; i++)
219  {
220  for(int j=0; j<nBF; j++)
221  {
222  values[i ] += N_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
223  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
224  }
225  }
226 }
227 
228 // values of derivatives in xi-eta direction
229 static void N_Q_RT2_2D_DeriveXiEta(double xi, double eta, double *values)
230 {
231  int nBF = 24; // number of basis functions
232  // monomials x-component and y-component
233  double mon_x[24]={0,0,0,0,0,0,0,0,0,0,1,0,0,0,2*xi,0,2*eta,0,3*xi*xi,0,4*xi*eta, 0,6*xi*xi*eta,0};
234  double mon_y[24]={0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2*xi,0,2*eta,0,3*eta*eta,0, 4*xi*eta,0,6*xi*eta*eta};
235 
236  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
237  for(int i=0; i<nBF; i++)
238  {
239  for(int j=0; j<nBF; j++)
240  {
241  values[i ] += N_Q_RT2_2D_CM[i+j*nBF]*mon_x[j];
242  values[i+nBF] += N_Q_RT2_2D_CM[i+j*nBF]*mon_y[j];
243  }
244  }
245 }
246 
247 
248 // ***********************************************************************
249 
250 TBaseFunct2D *BF_N_Q_RT2_2D_Obj = new TBaseFunct2D
251  (24, BF_N_Q_RT2_2D, BFUnitSquare,
252  N_Q_RT2_2D_Funct, N_Q_RT2_2D_DeriveXi,
253  N_Q_RT2_2D_DeriveEta, N_Q_RT2_2D_DeriveXiXi,
254  N_Q_RT2_2D_DeriveXiEta, N_Q_RT2_2D_DeriveEtaEta, 4, 3,
255  0, NULL, 2);
Definition: BaseFunct2D.h:27