ParMooN
 All Classes Functions Variables Friends Pages
NF_N_H_BDDF2_3D.h
1 // ***********************************************************************
2 // Brezzi-Douglas-Duran-Fortin element of second order on hexahedra, 3D
3 // ***********************************************************************
4 
5 //tschebyscheff point
6 static double BDDF2_tp = 0.866025403784439;
7 
8 static double NF_N_H_BDDF2_3D_Xi[] = {-BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
9  -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
10  1,1,1,1,1,1,
11  -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
12  -1, -1, -1, -1, -1, -1,
13  -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
14  // innere dofs
15  -0.8611363115940526, -0.3399810435848563,
16  0.3399810435848563, 0.8611363115940526,
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 };
48 static double NF_N_H_BDDF2_3D_Eta[] = {-BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
49  -1, -1, -1, -1, -1, -1,
50  -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
51  1,1,1,1,1,1,
52  -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
53  -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
54  //innere dofs
55  -0.8611363115940526, -0.8611363115940526,
56  -0.8611363115940526, -0.8611363115940526,
57  -0.3399810435848563, -0.3399810435848563,
58  -0.3399810435848563, -0.3399810435848563,
59  0.3399810435848563, 0.3399810435848563,
60  0.3399810435848563, 0.3399810435848563,
61  0.8611363115940526, 0.8611363115940526,
62  0.8611363115940526, 0.8611363115940526,
63  -0.8611363115940526, -0.8611363115940526,
64  -0.8611363115940526, -0.8611363115940526,
65  -0.3399810435848563, -0.3399810435848563,
66  -0.3399810435848563, -0.3399810435848563,
67  0.3399810435848563, 0.3399810435848563,
68  0.3399810435848563, 0.3399810435848563,
69  0.8611363115940526, 0.8611363115940526,
70  0.8611363115940526, 0.8611363115940526,
71  -0.8611363115940526, -0.8611363115940526,
72  -0.8611363115940526, -0.8611363115940526,
73  -0.3399810435848563, -0.3399810435848563,
74  -0.3399810435848563, -0.3399810435848563,
75  0.3399810435848563, 0.3399810435848563,
76  0.3399810435848563, 0.3399810435848563,
77  0.8611363115940526, 0.8611363115940526,
78  0.8611363115940526, 0.8611363115940526,
79  -0.8611363115940526, -0.8611363115940526,
80  -0.8611363115940526, -0.8611363115940526,
81  -0.3399810435848563, -0.3399810435848563,
82  -0.3399810435848563, -0.3399810435848563,
83  0.3399810435848563, 0.3399810435848563,
84  0.3399810435848563, 0.3399810435848563,
85  0.8611363115940526, 0.8611363115940526,
86  0.8611363115940526, 0.8611363115940526
87 };
88 static double NF_N_H_BDDF2_3D_Zeta[] = {-1, -1, -1, -1, -1, -1,
89  -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
90  -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
91  -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp,
92  -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp,
93  1,1,1,1,1,1,
94  //innere dofs
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 
129 // face 0
130 static double NF_N_H_BDDF2_3D_F0_Xi[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
131 static double NF_N_H_BDDF2_3D_F0_Eta[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
132 static double NF_N_H_BDDF2_3D_F0_Zeta[] = { -1, -1, -1, -1, -1, -1};
133 
134 // face 1 1
135 static double NF_N_H_BDDF2_3D_F1_Xi[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
136 static double NF_N_H_BDDF2_3D_F1_Eta[] = { -1, -1, -1, -1, -1, -1};
137 static double NF_N_H_BDDF2_3D_F1_Zeta[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
138 
139 // face 2 2
140 static double NF_N_H_BDDF2_3D_F2_Xi[] = { 1,1,1,1,1,1 };
141 static double NF_N_H_BDDF2_3D_F2_Eta[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
142 static double NF_N_H_BDDF2_3D_F2_Zeta[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
143 
144  //face 3 3
145 static double NF_N_H_BDDF2_3D_F3_Xi[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
146 static double NF_N_H_BDDF2_3D_F3_Eta[] = { 1,1,1,1,1,1 };
147 static double NF_N_H_BDDF2_3D_F3_Zeta[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
148 
149 // face 4 4
150 static double NF_N_H_BDDF2_3D_F4_Xi[] = { -1, -1, -1, -1, -1, -1};
151 static double NF_N_H_BDDF2_3D_F4_Eta[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
152 static double NF_N_H_BDDF2_3D_F4_Zeta[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
153 
154 // face 5 5
155 static double NF_N_H_BDDF2_3D_F5_Xi[] = { -BDDF2_tp,-BDDF2_tp,0,-BDDF2_tp,0,BDDF2_tp };
156 static double NF_N_H_BDDF2_3D_F5_Eta[] = { -BDDF2_tp,0,-BDDF2_tp,BDDF2_tp,0,-BDDF2_tp };
157 static double NF_N_H_BDDF2_3D_F5_Zeta[] = { 1,1,1,1,1,1 };
158 
159 static double *NF_N_H_BDDF2_3D_XiArray[6] = {
160  NF_N_H_BDDF2_3D_F0_Xi,
161  NF_N_H_BDDF2_3D_F1_Xi,
162  NF_N_H_BDDF2_3D_F2_Xi,
163  NF_N_H_BDDF2_3D_F3_Xi,
164  NF_N_H_BDDF2_3D_F4_Xi,
165  NF_N_H_BDDF2_3D_F5_Xi };
166 
167 static double *NF_N_H_BDDF2_3D_EtaArray[6] = {
168  NF_N_H_BDDF2_3D_F0_Eta,
169  NF_N_H_BDDF2_3D_F1_Eta,
170  NF_N_H_BDDF2_3D_F2_Eta,
171  NF_N_H_BDDF2_3D_F3_Eta,
172  NF_N_H_BDDF2_3D_F4_Eta,
173  NF_N_H_BDDF2_3D_F5_Eta };
174 
175 static double *NF_N_H_BDDF2_3D_ZetaArray[6] = {
176  NF_N_H_BDDF2_3D_F0_Zeta,
177  NF_N_H_BDDF2_3D_F1_Zeta,
178  NF_N_H_BDDF2_3D_F2_Zeta,
179  NF_N_H_BDDF2_3D_F3_Zeta,
180  NF_N_H_BDDF2_3D_F4_Zeta,
181  NF_N_H_BDDF2_3D_F5_Zeta };
182 
183 static double NF_N_H_BDDF2_3D_T[] = {-100};//???
184 static double NF_N_H_BDDF2_3D_S[] = {-100};//???
185 
186 
187 
188 void NF_N_H_BDDF2_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
189  double *PointValues, double *Functionals)
190 {
191  //face 0
192  Functionals[0] = -PointValues[200] * 4.0;
193  Functionals[1] = -PointValues[201] * 4.0;
194  Functionals[2] = -PointValues[202] * 4.0;
195  Functionals[3] = -PointValues[203] * 4.0;
196  Functionals[4] = -PointValues[204] * 4.0;
197  Functionals[5] = -PointValues[205] * 4.0;
198  //face 1
199  Functionals[6] = -PointValues[106] * 4.0;
200  Functionals[7] = -PointValues[107] * 4.0;
201  Functionals[8] = -PointValues[108] * 4.0;
202  Functionals[9] = -PointValues[109] * 4.0;
203  Functionals[10] = -PointValues[110] * 4.0;
204  Functionals[11] = -PointValues[111] * 4.0;
205  //face 2
206  Functionals[12] = PointValues[12] * 4.0;
207  Functionals[13] = PointValues[13] * 4.0;
208  Functionals[14] = PointValues[14] * 4.0;
209  Functionals[15] = PointValues[15] * 4.0;
210  Functionals[16] = PointValues[16] * 4.0;
211  Functionals[17] = PointValues[17] * 4.0;
212  //face 3
213  Functionals[18] = PointValues[118] * 4.0;
214  Functionals[19] = PointValues[119] * 4.0;
215  Functionals[20] = PointValues[120] * 4.0;
216  Functionals[21] = PointValues[121] * 4.0;
217  Functionals[22] = PointValues[122] * 4.0;
218  Functionals[23] = PointValues[123] * 4.0;
219  //face 4
220  Functionals[24] = -PointValues[24] * 4.0;
221  Functionals[25] = -PointValues[25] * 4.0;
222  Functionals[26] = -PointValues[26] * 4.0;
223  Functionals[27] = -PointValues[27] * 4.0;
224  Functionals[28] = -PointValues[28] * 4.0;
225  Functionals[29] = -PointValues[29] * 4.0;
226  //face 5
227  Functionals[30] = PointValues[230] * 4.0;
228  Functionals[31] = PointValues[231] * 4.0;
229  Functionals[32] = PointValues[232] * 4.0;
230  Functionals[33] = PointValues[233] * 4.0;
231  Functionals[34] = PointValues[234] * 4.0;
232  Functionals[35] = PointValues[235] * 4.0;
233  //inner dofs
234  int i;
235  double s;
236 
237  //x-component
238  s = 0;
239  for(i=0;i<64;i++)
240  s += PointValues[i+36] * NF_D_H_P3_3D_Weights[i];
241  Functionals[36] = s;
242 
243  //y-component
244  s = 0;
245  for(i=0;i<64;i++)
246  s += PointValues[i+136] * NF_D_H_P3_3D_Weights[i];
247  Functionals[37] = s;
248 
249  //z-component
250  s = 0;
251  for(i=0;i<64;i++)
252  s += PointValues[i+236] * NF_D_H_P3_3D_Weights[i];
253  Functionals[38] = s;
254 }
255 
256 void NF_N_H_BDDF2_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
257  double *PointValues, double *Functionals)
258 {
259  double s; // size of face
260  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
261  #ifdef __3D__
262  // find vertices of this face, then their coordinates
263  const int *faceVertex, *length;
264  int MaxLen;
265  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
266  // now MaxLen == 4, length == {4,4,4,4}
267  Cell->GetVertex(faceVertex[4*face ])->GetCoords(x0,y0,z0);
268  Cell->GetVertex(faceVertex[4*face + 1])->GetCoords(x1,y1,z1);
269  Cell->GetVertex(faceVertex[4*face + 2])->GetCoords(x2,y2,z2);
270  #endif
271  // compute measure of this face
272  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
273  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
274  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
275  Functionals[0] = PointValues[0]*s;
276  Functionals[1] = PointValues[1]*s;
277  Functionals[2] = PointValues[2]*s;
278  Functionals[3] = PointValues[3]*s;
279  Functionals[4] = PointValues[4]*s;
280  Functionals[5] = PointValues[5]*s;
281 }
282 
283 static int NF_N_H_BDDF2_3D_N_AllFunctionals = 39;
284 static int NF_N_H_BDDF2_3D_N_PointsAll = 100;
285 static int NF_N_H_BDDF2_3D_N_FaceFunctionals[] = { 6, 6, 6, 6, 6, 6 };
286 static int NF_N_H_BDDF2_3D_N_PointsFace[] = { 6, 6, 6, 6, 6, 6 };
287 
288 TNodalFunctional3D *NF_N_H_BDDF2_3D_Obj = new TNodalFunctional3D
289  (NF_N_H_BDDF2_3D, NF_N_H_BDDF2_3D_N_AllFunctionals,
290  NF_N_H_BDDF2_3D_N_FaceFunctionals, NF_N_H_BDDF2_3D_N_PointsAll,
291  NF_N_H_BDDF2_3D_N_PointsFace,
292  NF_N_H_BDDF2_3D_Xi, NF_N_H_BDDF2_3D_Eta, NF_N_H_BDDF2_3D_Zeta,
293  NF_N_H_BDDF2_3D_XiArray, NF_N_H_BDDF2_3D_EtaArray,
294  NF_N_H_BDDF2_3D_ZetaArray,
295  NF_N_H_BDDF2_3D_T, NF_N_H_BDDF2_3D_S,
296  NF_N_H_BDDF2_3D_EvalAll, NF_N_H_BDDF2_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