ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_RT2_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of second order on hexahedra, 3D
3 // ***********************************************************************
4 
5 /* for all functionals */
6 static double NF_N_T_RT2_3D_Xi[] = {
7  0.2, 0.4, 0.6, 0.2, 0.4, 0.2,
8  0.2, 0.2, 0.2, 0.4, 0.4, 0.6,
9  0.2, 0.4, 0.6, 0.2, 0.4, 0.2,
10  0,0,0,0,0,0,
11  //inner dof
12  0.333333333333333333333333333333333,
13  0.333333333333333333333333333333333,
14  0,
15  0.333333333333333333333333333333333,
16  0.25,
17  0.909090909090909090909090909090909e-1,
18  0.909090909090909090909090909090909e-1,
19  0.727272727272727272727272727272727,
20  0.909090909090909090909090909090909e-1,
21  0.665501535736642982398804642263025e-1,
22  0.433449846426335701760119535773697,
23  0.433449846426335701760119535773697,
24  0.665501535736642982398804642263025e-1,
25  0.665501535736642982398804642263025e-1,
26  0.433449846426335701760119535773697
27 };
28 static double NF_N_T_RT2_3D_Eta[] = {
29  0.2, 0.2, 0.2, 0.4, 0.4, 0.6,
30  0,0,0,0,0,0,
31  0.6, 0.4, 0.2, 0.4, 0.2, 0.2,
32  0.2, 0.4, 0.6, 0.2, 0.4, 0.2,
33  //inner dof
34  0.333333333333333333333333333333333,
35  0,
36  0.333333333333333333333333333333333,
37  0.333333333333333333333333333333333,
38  0.25,
39  0.909090909090909090909090909090909e-1,
40  0.727272727272727272727272727272727,
41  0.909090909090909090909090909090909e-1,
42  0.909090909090909090909090909090909e-1,
43  0.433449846426335701760119535773697,
44  0.665501535736642982398804642263025e-1,
45  0.433449846426335701760119535773697,
46  0.665501535736642982398804642263025e-1,
47  0.433449846426335701760119535773697,
48  0.665501535736642982398804642263025e-1
49 };
50 static double NF_N_T_RT2_3D_Zeta[]= {
51  0,0,0,0,0,0,
52  0.2, 0.4, 0.6, 0.2, 0.4, 0.2,
53  0.2, 0.2, 0.2, 0.4, 0.4, 0.6,
54  0.2, 0.2, 0.2, 0.4, 0.4, 0.6,
55  //inner dof
56  0,
57  0.333333333333333333333333333333333,
58  0.333333333333333333333333333333333,
59  0.333333333333333333333333333333333,
60  0.25,
61  0.727272727272727272727272727272727,
62  0.90909090909090909090909090909091e-1,
63  0.909090909090909090909090909090911e-1,
64  0.909090909090909090909090909090911e-1,
65  0.433449846426335701760119535773699,
66  0.433449846426335701760119535773699,
67  0.66550153573664298239880464226304e-1,
68  0.433449846426335701760119535773699,
69  0.66550153573664298239880464226304e-1,
70  0.665501535736642982398804642263035e-1
71 };
72 
73 static double NF_N_T_RT2_3D_Weights[]= {
74  0.602678571428571428571428571428571e-2,
75  0.602678571428571428571428571428571e-2,
76  0.602678571428571428571428571428571e-2,
77  0.602678571428571428571428571428571e-2,
78  0.302836780970891758063769725577305e-1,
79  0.116452490860289694108936091443380e-1,
80  0.116452490860289694108936091443380e-1,
81  0.116452490860289694108936091443380e-1,
82  0.116452490860289694108936091443380e-1,
83  0.109491415613864593456430191124068e-1,
84  0.109491415613864593456430191124068e-1,
85  0.109491415613864593456430191124068e-1,
86  0.109491415613864593456430191124068e-1,
87  0.109491415613864593456430191124068e-1,
88  0.109491415613864593456430191124068e-1};
89 
90 /* face 0 0 */
91 static double NF_N_T_RT2_3D_F0_Xi[] = {0.2, 0.4, 0.6, 0.2, 0.4, 0.2};
92 static double NF_N_T_RT2_3D_F0_Eta[] = {0.2, 0.2, 0.2, 0.4, 0.4, 0.6};
93 static double NF_N_T_RT2_3D_F0_Zeta[] = { 0,0,0,0,0,0 };
94 
95 /* face 1 1 */
96 static double NF_N_T_RT2_3D_F1_Xi[] = {0.2, 0.2, 0.2, 0.4, 0.4, 0.6};
97 static double NF_N_T_RT2_3D_F1_Eta[] = { 0,0,0,0,0,0 };
98 static double NF_N_T_RT2_3D_F1_Zeta[] = {0.2, 0.4, 0.6, 0.2, 0.4, 0.2};
99 
100 /* face 2 2 */
101 static double NF_N_T_RT2_3D_F2_Xi[] = {0.2, 0.4, 0.6, 0.2, 0.4, 0.2};
102 static double NF_N_T_RT2_3D_F2_Eta[] = {0.6, 0.4, 0.2, 0.4, 0.2, 0.2};
103 static double NF_N_T_RT2_3D_F2_Zeta[] = {0.2, 0.2, 0.2, 0.4, 0.4, 0.6};
104 
105 /* face 3 3 */
106 static double NF_N_T_RT2_3D_F3_Xi[] = { 0,0,0,0,0,0 };
107 static double NF_N_T_RT2_3D_F3_Eta[] = {0.2, 0.4, 0.6, 0.2, 0.4, 0.2};
108 static double NF_N_T_RT2_3D_F3_Zeta[] = {0.2, 0.2, 0.2, 0.4, 0.4, 0.6};
109 
110 static double *NF_N_T_RT2_3D_XiArray[4] = {
111  NF_N_T_RT2_3D_F0_Xi,
112  NF_N_T_RT2_3D_F1_Xi,
113  NF_N_T_RT2_3D_F2_Xi,
114  NF_N_T_RT2_3D_F3_Xi };
115 
116 static double *NF_N_T_RT2_3D_EtaArray[4] = {
117  NF_N_T_RT2_3D_F0_Eta,
118  NF_N_T_RT2_3D_F1_Eta,
119  NF_N_T_RT2_3D_F2_Eta,
120  NF_N_T_RT2_3D_F3_Eta };
121 
122 static double *NF_N_T_RT2_3D_ZetaArray[4] = {
123  NF_N_T_RT2_3D_F0_Zeta,
124  NF_N_T_RT2_3D_F1_Zeta,
125  NF_N_T_RT2_3D_F2_Zeta,
126  NF_N_T_RT2_3D_F3_Zeta };
127 
128 static double NF_N_T_RT2_3D_T[1] = {};// ???
129 static double NF_N_T_RT2_3D_S[1] = {};// ???
130 
131 void NF_N_T_RT2_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
132  double *PointValues, double *Functionals)
133 {
134  // PointValues[4*i + j] means i-th component (i=0 for x, i=1 for y, i=2 for z)
135  // at j-th evaluation point (see NF_N_T_RT2_3D_Xi, ...Eta, ...Zeta)
136  //face 0
137  Functionals[0] = -PointValues[78];
138  Functionals[1] = -PointValues[79];
139  Functionals[2] = -PointValues[80];
140  Functionals[3] = -PointValues[81];
141  Functionals[4] = -PointValues[82];
142  Functionals[5] = -PointValues[83];
143  //face 1
144  Functionals[6] = -PointValues[45];
145  Functionals[7] = -PointValues[46];
146  Functionals[8] = -PointValues[47];
147  Functionals[9] = -PointValues[48];
148  Functionals[10] = -PointValues[49];
149  Functionals[11] = -PointValues[50];
150  //face 2
151  Functionals[12] = PointValues[12]+PointValues[51]+PointValues[90];
152  Functionals[13] = PointValues[13]+PointValues[52]+PointValues[91];
153  Functionals[14] = PointValues[14]+PointValues[53]+PointValues[92];
154  Functionals[15] = PointValues[15]+PointValues[54]+PointValues[93];
155  Functionals[16] = PointValues[16]+PointValues[55]+PointValues[94];
156  Functionals[17] = PointValues[17]+PointValues[56]+PointValues[95];
157  //face 3
158  Functionals[18] = -PointValues[18];
159  Functionals[19] = -PointValues[19];
160  Functionals[20] = -PointValues[20];
161  Functionals[21] = -PointValues[21];
162  Functionals[22] = -PointValues[22];
163  Functionals[23] = -PointValues[23];
164 
165  //inner dofs
166  int i;
167  double s;
168 
169  //x-component
170  s = 0;
171  for(i=0;i<15;i++)
172  s += PointValues[i+24] * NF_N_T_RT2_3D_Weights[i];
173  Functionals[24] = s;
174  s = 0;
175  for(i=0;i<15;i++)
176  s += PointValues[i+24] * NF_N_T_RT2_3D_Xi[i+24] * NF_N_T_RT2_3D_Weights[i];
177  Functionals[25] = s;
178  s = 0;
179  for(i=0;i<15;i++)
180  s += PointValues[i+24] * NF_N_T_RT2_3D_Eta[i+24] * NF_N_T_RT2_3D_Weights[i];
181  Functionals[26] = s;
182  s = 0;
183  for(i=0;i<15;i++)
184  s += PointValues[i+24] * NF_N_T_RT2_3D_Zeta[i+24] * NF_N_T_RT2_3D_Weights[i];
185  Functionals[27] = s;
186 
187  //y-component
188  s = 0;
189  for(i=0;i<15;i++)
190  s += PointValues[i+63] * NF_N_T_RT2_3D_Weights[i];
191  Functionals[28] = s;
192  s = 0;
193  for(i=0;i<15;i++)
194  s += PointValues[i+63] * NF_N_T_RT2_3D_Xi[i+24] * NF_N_T_RT2_3D_Weights[i];
195  Functionals[29] = s;
196  s = 0;
197  for(i=0;i<15;i++)
198  s += PointValues[i+63] * NF_N_T_RT2_3D_Eta[i+24] * NF_N_T_RT2_3D_Weights[i];
199  Functionals[30] = s;
200  s = 0;
201  for(i=0;i<15;i++)
202  s += PointValues[i+63] * NF_N_T_RT2_3D_Zeta[i+24] * NF_N_T_RT2_3D_Weights[i];
203  Functionals[31] = s;
204 
205  //z-component
206  s = 0;
207  for(i=0;i<15;i++)
208  s += PointValues[i+102] * NF_N_T_RT2_3D_Weights[i];
209  Functionals[32] = s;
210  s = 0;
211  for(i=0;i<15;i++)
212  s += PointValues[i+102] * NF_N_T_RT2_3D_Xi[i+24] * NF_N_T_RT2_3D_Weights[i];
213  Functionals[33] = s;
214  s = 0;
215  for(i=0;i<15;i++)
216  s += PointValues[i+102] * NF_N_T_RT2_3D_Eta[i+24] * NF_N_T_RT2_3D_Weights[i];
217  Functionals[34] = s;
218  s = 0;
219  for(i=0;i<15;i++)
220  s += PointValues[i+102] * NF_N_T_RT2_3D_Zeta[i+24] * NF_N_T_RT2_3D_Weights[i];
221  Functionals[35] = s;
222 }
223 
224 void NF_N_T_RT2_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
225  double *PointValues, double *Functionals)
226 {
227  double s; // size of face
228  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
229  #ifdef __3D__
230  // find vertices of this face, then their coordinates
231  const int *faceVertex, *length;
232  int MaxLen;
233  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
234  // now MaxLen == 3, length == {3,3,3,3}
235  Cell->GetVertex(faceVertex[3*face ])->GetCoords(x0,y0,z0);
236  Cell->GetVertex(faceVertex[3*face + 1])->GetCoords(x1,y1,z1);
237  Cell->GetVertex(faceVertex[3*face + 2])->GetCoords(x2,y2,z2);
238  #endif
239  // compute measure of this face
240  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
241  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
242  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
243  for(int i=0; i<6; i++)
244  Functionals[i] = PointValues[i]*s;
245 }
246 
247 static int NF_N_T_RT2_3D_N_AllFunctionals = 36;
248 static int NF_N_T_RT2_3D_N_PointsAll = 39;
249 static int NF_N_T_RT2_3D_N_FaceFunctionals[] = { 6, 6, 6, 6 };
250 static int NF_N_T_RT2_3D_N_PointsFace[] = { 6, 6, 6, 6 };
251 
252 TNodalFunctional3D *NF_N_T_RT2_3D_Obj = new TNodalFunctional3D
253  (NF_N_T_RT2_3D, NF_N_T_RT2_3D_N_AllFunctionals,
254  NF_N_T_RT2_3D_N_FaceFunctionals, NF_N_T_RT2_3D_N_PointsAll,
255  NF_N_T_RT2_3D_N_PointsFace,
256  NF_N_T_RT2_3D_Xi, NF_N_T_RT2_3D_Eta, NF_N_T_RT2_3D_Zeta,
257  NF_N_T_RT2_3D_XiArray, NF_N_T_RT2_3D_EtaArray,
258  NF_N_T_RT2_3D_ZetaArray,
259  NF_N_T_RT2_3D_T, NF_N_T_RT2_3D_S,
260  NF_N_T_RT2_3D_EvalAll, NF_N_T_RT2_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