ParMooN
 All Classes Functions Variables Friends Pages
NF_N_H_RT1_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of first order on hexahedra, 3D
3 // ***********************************************************************
4 
5 /* for all functionals */
6 
7 //tschebyscheff point
8 static double tscheb_point = 0.707106781186547;
9 
10 static double NF_N_H_RT1_3D_Xi[] = {
11  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
12  -tscheb_point, -tscheb_point, tscheb_point, tscheb_point,
13  1, 1, 1, 1,
14  tscheb_point, tscheb_point, -tscheb_point, -tscheb_point,
15  -1, -1, -1, -1,
16  -tscheb_point, -tscheb_point, tscheb_point, tscheb_point,
17  -0.8611363115940526, -0.3399810435848563,
18  0.3399810435848563, 0.8611363115940526,
19  -0.8611363115940526, -0.3399810435848563,
20  0.3399810435848563, 0.8611363115940526,
21  -0.8611363115940526, -0.3399810435848563,
22  0.3399810435848563, 0.8611363115940526,
23  -0.8611363115940526, -0.3399810435848563,
24  0.3399810435848563, 0.8611363115940526,
25  -0.8611363115940526, -0.3399810435848563,
26  0.3399810435848563, 0.8611363115940526,
27  -0.8611363115940526, -0.3399810435848563,
28  0.3399810435848563, 0.8611363115940526,
29  -0.8611363115940526, -0.3399810435848563,
30  0.3399810435848563, 0.8611363115940526,
31  -0.8611363115940526, -0.3399810435848563,
32  0.3399810435848563, 0.8611363115940526,
33  -0.8611363115940526, -0.3399810435848563,
34  0.3399810435848563, 0.8611363115940526,
35  -0.8611363115940526, -0.3399810435848563,
36  0.3399810435848563, 0.8611363115940526,
37  -0.8611363115940526, -0.3399810435848563,
38  0.3399810435848563, 0.8611363115940526,
39  -0.8611363115940526, -0.3399810435848563,
40  0.3399810435848563, 0.8611363115940526,
41  -0.8611363115940526, -0.3399810435848563,
42  0.3399810435848563, 0.8611363115940526,
43  -0.8611363115940526, -0.3399810435848563,
44  0.3399810435848563, 0.8611363115940526,
45  -0.8611363115940526, -0.3399810435848563,
46  0.3399810435848563, 0.8611363115940526,
47  -0.8611363115940526, -0.3399810435848563,
48  0.3399810435848563, 0.8611363115940526};
49 static double NF_N_H_RT1_3D_Eta[] = {
50  -tscheb_point, -tscheb_point, tscheb_point, tscheb_point,
51  -1, -1, -1, -1,
52  -tscheb_point, -tscheb_point, tscheb_point, tscheb_point,
53  1, 1, 1, 1,
54  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
55  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
56  -0.8611363115940526, -0.8611363115940526,
57  -0.8611363115940526, -0.8611363115940526,
58  -0.3399810435848563, -0.3399810435848563,
59  -0.3399810435848563, -0.3399810435848563,
60  0.3399810435848563, 0.3399810435848563,
61  0.3399810435848563, 0.3399810435848563,
62  0.8611363115940526, 0.8611363115940526,
63  0.8611363115940526, 0.8611363115940526,
64  -0.8611363115940526, -0.8611363115940526,
65  -0.8611363115940526, -0.8611363115940526,
66  -0.3399810435848563, -0.3399810435848563,
67  -0.3399810435848563, -0.3399810435848563,
68  0.3399810435848563, 0.3399810435848563,
69  0.3399810435848563, 0.3399810435848563,
70  0.8611363115940526, 0.8611363115940526,
71  0.8611363115940526, 0.8611363115940526,
72  -0.8611363115940526, -0.8611363115940526,
73  -0.8611363115940526, -0.8611363115940526,
74  -0.3399810435848563, -0.3399810435848563,
75  -0.3399810435848563, -0.3399810435848563,
76  0.3399810435848563, 0.3399810435848563,
77  0.3399810435848563, 0.3399810435848563,
78  0.8611363115940526, 0.8611363115940526,
79  0.8611363115940526, 0.8611363115940526,
80  -0.8611363115940526, -0.8611363115940526,
81  -0.8611363115940526, -0.8611363115940526,
82  -0.3399810435848563, -0.3399810435848563,
83  -0.3399810435848563, -0.3399810435848563,
84  0.3399810435848563, 0.3399810435848563,
85  0.3399810435848563, 0.3399810435848563,
86  0.8611363115940526, 0.8611363115940526,
87  0.8611363115940526, 0.8611363115940526};
88 static double NF_N_H_RT1_3D_Zeta[] = {
89  -1, -1, -1, -1,
90  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
91  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
92  -tscheb_point, tscheb_point, -tscheb_point, tscheb_point,
93  -tscheb_point, -tscheb_point, tscheb_point, tscheb_point,
94  1, 1, 1, 1,
95  -0.8611363115940526, -0.8611363115940526,
96  -0.8611363115940526, -0.8611363115940526,
97  -0.8611363115940526, -0.8611363115940526,
98  -0.8611363115940526, -0.8611363115940526,
99  -0.8611363115940526, -0.8611363115940526,
100  -0.8611363115940526, -0.8611363115940526,
101  -0.8611363115940526, -0.8611363115940526,
102  -0.8611363115940526, -0.8611363115940526,
103  -0.3399810435848563, -0.3399810435848563,
104  -0.3399810435848563, -0.3399810435848563,
105  -0.3399810435848563, -0.3399810435848563,
106  -0.3399810435848563, -0.3399810435848563,
107  -0.3399810435848563, -0.3399810435848563,
108  -0.3399810435848563, -0.3399810435848563,
109  -0.3399810435848563, -0.3399810435848563,
110  -0.3399810435848563, -0.3399810435848563,
111  0.3399810435848563, 0.3399810435848563,
112  0.3399810435848563, 0.3399810435848563,
113  0.3399810435848563, 0.3399810435848563,
114  0.3399810435848563, 0.3399810435848563,
115  0.3399810435848563, 0.3399810435848563,
116  0.3399810435848563, 0.3399810435848563,
117  0.3399810435848563, 0.3399810435848563,
118  0.3399810435848563, 0.3399810435848563,
119  0.8611363115940526, 0.8611363115940526,
120  0.8611363115940526, 0.8611363115940526,
121  0.8611363115940526, 0.8611363115940526,
122  0.8611363115940526, 0.8611363115940526,
123  0.8611363115940526, 0.8611363115940526,
124  0.8611363115940526, 0.8611363115940526,
125  0.8611363115940526, 0.8611363115940526,
126  0.8611363115940526, 0.8611363115940526};
127 
128 // face 0
129 static double NF_N_H_RT1_3D_F0_Xi[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
130 static double NF_N_H_RT1_3D_F0_Eta[] = { -tscheb_point, -tscheb_point, tscheb_point, tscheb_point };
131 static double NF_N_H_RT1_3D_F0_Zeta[] = {-1, -1, -1, -1 };
132 
133 // face 1 1
134 static double NF_N_H_RT1_3D_F1_Xi[] = { -tscheb_point, -tscheb_point, tscheb_point, tscheb_point };
135 static double NF_N_H_RT1_3D_F1_Eta[] = {-1, -1, -1, -1 };
136 static double NF_N_H_RT1_3D_F1_Zeta[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
137 
138 // face 2 2
139 static double NF_N_H_RT1_3D_F2_Xi[] = { 1, 1, 1, 1 };
140 static double NF_N_H_RT1_3D_F2_Eta[] = { -tscheb_point, -tscheb_point, tscheb_point, tscheb_point };
141 static double NF_N_H_RT1_3D_F2_Zeta[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
142 
143  //face 3 3
144 static double NF_N_H_RT1_3D_F3_Xi[] = { tscheb_point, tscheb_point, -tscheb_point, -tscheb_point };
145 static double NF_N_H_RT1_3D_F3_Eta[] = { 1, 1, 1, 1 };
146 static double NF_N_H_RT1_3D_F3_Zeta[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
147 
148 // face 4 4
149 static double NF_N_H_RT1_3D_F4_Xi[] = {-1, -1, -1, -1 };
150 static double NF_N_H_RT1_3D_F4_Eta[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
151 static double NF_N_H_RT1_3D_F4_Zeta[] = { -tscheb_point, -tscheb_point, tscheb_point, tscheb_point };
152 
153 // face 5 5
154 static double NF_N_H_RT1_3D_F5_Xi[] = { -tscheb_point, -tscheb_point, tscheb_point, tscheb_point };
155 static double NF_N_H_RT1_3D_F5_Eta[] = { -tscheb_point, tscheb_point, -tscheb_point, tscheb_point };
156 static double NF_N_H_RT1_3D_F5_Zeta[] = { 1, 1, 1, 1 };
157 
158 static double *NF_N_H_RT1_3D_XiArray[6] = {
159  NF_N_H_RT1_3D_F0_Xi,
160  NF_N_H_RT1_3D_F1_Xi,
161  NF_N_H_RT1_3D_F2_Xi,
162  NF_N_H_RT1_3D_F3_Xi,
163  NF_N_H_RT1_3D_F4_Xi,
164  NF_N_H_RT1_3D_F5_Xi };
165 
166 static double *NF_N_H_RT1_3D_EtaArray[6] = {
167  NF_N_H_RT1_3D_F0_Eta,
168  NF_N_H_RT1_3D_F1_Eta,
169  NF_N_H_RT1_3D_F2_Eta,
170  NF_N_H_RT1_3D_F3_Eta,
171  NF_N_H_RT1_3D_F4_Eta,
172  NF_N_H_RT1_3D_F5_Eta };
173 
174 static double *NF_N_H_RT1_3D_ZetaArray[6] = {
175  NF_N_H_RT1_3D_F0_Zeta,
176  NF_N_H_RT1_3D_F1_Zeta,
177  NF_N_H_RT1_3D_F2_Zeta,
178  NF_N_H_RT1_3D_F3_Zeta,
179  NF_N_H_RT1_3D_F4_Zeta,
180  NF_N_H_RT1_3D_F5_Zeta };
181 
182 static double NF_N_H_RT1_3D_T[] = {-100}; //??? initilize the correct value
183 static double NF_N_H_RT1_3D_S[] = {-100}; //???
184 
185 
186 
187 void NF_N_H_RT1_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
188  double *PointValues, double *Functionals)
189 {
190  //face 0
191  Functionals[0] = -PointValues[176] * 4.0;
192  Functionals[1] = -PointValues[177] * 4.0;
193  Functionals[2] = -PointValues[178] * 4.0;
194  Functionals[3] = -PointValues[179] * 4.0;
195  //face 1
196  Functionals[4] = -PointValues[92] * 4.0;
197  Functionals[5] = -PointValues[93] * 4.0;
198  Functionals[6] = -PointValues[94] * 4.0;
199  Functionals[7] = -PointValues[95] * 4.0;
200  //face 2
201  Functionals[8] = PointValues[8] * 4.0;
202  Functionals[9] = PointValues[9] * 4.0;
203  Functionals[10] = PointValues[10] * 4.0;
204  Functionals[11] = PointValues[11] * 4.0;
205  //face 3
206  Functionals[12] = PointValues[100] * 4.0;
207  Functionals[13] = PointValues[101] * 4.0;
208  Functionals[14] = PointValues[102] * 4.0;
209  Functionals[15] = PointValues[103] * 4.0;
210  //face 4
211  Functionals[16] = -PointValues[16] * 4.0;
212  Functionals[17] = -PointValues[17] * 4.0;
213  Functionals[18] = -PointValues[18] * 4.0;
214  Functionals[19] = -PointValues[19] * 4.0;
215  //face 5
216  Functionals[20] = PointValues[196] * 4.0;
217  Functionals[21] = PointValues[197] * 4.0;
218  Functionals[22] = PointValues[198] * 4.0;
219  Functionals[23] = PointValues[199] * 4.0;
220 
221  //inner DOF
222  int i;
223  double s;
224  //x-component
225  s = 0;
226  for(i=0;i<64;i++)
227  s += PointValues[i+24] * NF_D_H_P3_3D_Weights[i];
228  Functionals[24] = s;
229 
230  s = 0;
231  for(i=0;i<64;i++)
232  s += PointValues[i+24] * NF_D_H_P3_3D_Array3[i] * NF_D_H_P3_3D_Weights[i];
233  Functionals[25] = s;
234 
235  s = 0;
236  for(i=0;i<64;i++)
237  s += PointValues[i+24] * NF_D_H_P3_3D_Array4[i] * NF_D_H_P3_3D_Weights[i];
238  Functionals[26] = s;
239 
240  s = 0;
241  for(i=0;i<64;i++)
242  s += PointValues[i+24] * NF_D_H_P3_3D_Array9[i] * NF_D_H_P3_3D_Weights[i];
243  Functionals[27] = s;
244  //y-component
245  s = 0;
246  for(i=0;i<64;i++)
247  s += PointValues[i+112] * NF_D_H_P3_3D_Weights[i];
248  Functionals[28] = s;
249 
250  s = 0;
251  for(i=0;i<64;i++)
252  s += PointValues[i+112] * NF_D_H_P3_3D_Array2[i] * NF_D_H_P3_3D_Weights[i];
253  Functionals[29] = s;
254 
255  s = 0;
256  for(i=0;i<64;i++)
257  s += PointValues[i+112] * NF_D_H_P3_3D_Array4[i] * NF_D_H_P3_3D_Weights[i];
258  Functionals[30] = s ;
259 
260  s = 0;
261  for(i=0;i<64;i++)
262  s += PointValues[i+112] * NF_D_H_P3_3D_Array7[i] * NF_D_H_P3_3D_Weights[i];
263  Functionals[31] = s;
264  //z-component
265  s = 0;
266  for(i=0;i<64;i++)
267  s += PointValues[i+200] * NF_D_H_P3_3D_Weights[i];
268  Functionals[32] = s;
269 
270  s = 0;
271  for(i=0;i<64;i++)
272  s += PointValues[i+200] * NF_D_H_P3_3D_Array2[i] * NF_D_H_P3_3D_Weights[i];
273  Functionals[33] = s;
274 
275  s = 0;
276  for(i=0;i<64;i++)
277  s += PointValues[i+200] * NF_D_H_P3_3D_Array3[i] * NF_D_H_P3_3D_Weights[i];
278  Functionals[34] = s;
279 
280  s = 0;
281  for(i=0;i<64;i++)
282  s += PointValues[i+200] * NF_D_H_P3_3D_Array6[i] * NF_D_H_P3_3D_Weights[i];
283  Functionals[35] = s;
284 }
285 
286 void NF_N_H_RT1_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
287  double *PointValues, double *Functionals)
288 {
289  double s; // size of face
290  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
291  #ifdef __3D__
292  // find vertices of this face, then their coordinates
293  const int *faceVertex, *length;
294  int MaxLen;
295  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
296  // now MaxLen == 4, length == {4,4,4,4}
297  Cell->GetVertex(faceVertex[4*face ])->GetCoords(x0,y0,z0);
298  Cell->GetVertex(faceVertex[4*face + 1])->GetCoords(x1,y1,z1);
299  Cell->GetVertex(faceVertex[4*face + 2])->GetCoords(x2,y2,z2);
300  #endif
301  // compute measure of this face
302  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
303  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
304  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
305  Functionals[0] = PointValues[0]*s;
306  Functionals[1] = PointValues[1]*s;
307  Functionals[2] = PointValues[2]*s;
308  Functionals[3] = PointValues[3]*s;
309 }
310 
311 static int NF_N_H_RT1_3D_N_AllFunctionals = 36;
312 static int NF_N_H_RT1_3D_N_PointsAll = 88;
313 static int NF_N_H_RT1_3D_N_FaceFunctionals[] = { 4, 4, 4, 4, 4, 4 };
314 static int NF_N_H_RT1_3D_N_PointsFace[] = { 4, 4, 4, 4, 4, 4 };
315 
316 TNodalFunctional3D *NF_N_H_RT1_3D_Obj = new TNodalFunctional3D
317  (NF_N_H_RT1_3D, NF_N_H_RT1_3D_N_AllFunctionals,
318  NF_N_H_RT1_3D_N_FaceFunctionals, NF_N_H_RT1_3D_N_PointsAll,
319  NF_N_H_RT1_3D_N_PointsFace,
320  NF_N_H_RT1_3D_Xi, NF_N_H_RT1_3D_Eta, NF_N_H_RT1_3D_Zeta,
321  NF_N_H_RT1_3D_XiArray, NF_N_H_RT1_3D_EtaArray,
322  NF_N_H_RT1_3D_ZetaArray,
323  NF_N_H_RT1_3D_T, NF_N_H_RT1_3D_S,
324  NF_N_H_RT1_3D_EvalAll, NF_N_H_RT1_3D_EvalFace);
int GetFaceVertex(const int *&TmpFV, const int *&TmpLen, int &MaxLen)
Definition: ShapeDesc.h:124
TShapeDesc * GetShapeDesc() const
return shape descriptor of refinement descriptor
Definition: BaseCell.h:134
Definition: NodalFunctional3D.h:21
store cells in an array, used by cell iterators
Definition: Collection.h:18
virtual TVertex * GetVertex(int Vert_i)=0
return the pointer to vertex with number i
void GetCoords(double &x, double &y, double &z) const
Definition: Vertex.h:106
information for finite element data structure
Definition: BaseCell.h:25