ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_RT1_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of first order on tetrahedra, 3D
3 // ***********************************************************************
4 
5 //point
6 static double RT1T_tp = 0.166666666666667;
7 
8 /* for all functionals */
9 static double NF_N_T_RT1_3D_Xi[] = {RT1T_tp, 0.5+RT1T_tp, RT1T_tp, //face 0
10  RT1T_tp, RT1T_tp, 0.5+RT1T_tp, //face 1
11  RT1T_tp, 1-2*RT1T_tp, RT1T_tp, //face 2
12  0,0,0, //face 3
13  //innere dofs
14  0.138196601125010515179541316563,
15  0.138196601125010515179541316563,
16  0.138196601125010515179541316563,
17  0.585410196624968454461376050311
18 
19 };
20 static double NF_N_T_RT1_3D_Eta[] = {RT1T_tp, RT1T_tp, 0.5+RT1T_tp, //face 0
21  0,0,0, //face 1
22  1-2*RT1T_tp, RT1T_tp, RT1T_tp, //face 2
23  RT1T_tp, 0.5+RT1T_tp, RT1T_tp, //face 3
24  //innere dofs
25  0.138196601125010515179541316563,
26  0.138196601125010515179541316563,
27  0.585410196624968454461376050311,
28  0.138196601125010515179541316563
29 };
30 static double NF_N_T_RT1_3D_Zeta[]= {0,0,0, //face 0
31  RT1T_tp, 0.5+RT1T_tp, RT1T_tp, //face 1
32  RT1T_tp, RT1T_tp, 1-2*RT1T_tp, //face 2
33  RT1T_tp, RT1T_tp, 0.5+RT1T_tp, //face 3
34  //inner dofs
35  0.138196601125010515179541316563,
36  0.585410196624968454461376050311,
37  0.138196601125010515179541316563,
38  0.138196601125010515179541316563
39 };
40 
41 static double NF_N_T_RT1_3D_Weights[]= {
42  0.04166666666666666666666667, 0.04166666666666666666666667,
43  0.04166666666666666666666667, 0.04166666666666666666666667
44 };
45 
46 /* face 0 0 */
47 static double NF_N_T_RT1_3D_F0_Xi[] = { RT1T_tp, 0.5+RT1T_tp, RT1T_tp };
48 static double NF_N_T_RT1_3D_F0_Eta[] = { RT1T_tp, RT1T_tp, 0.5+RT1T_tp };
49 static double NF_N_T_RT1_3D_F0_Zeta[] = { 0,0,0 };
50 
51 /* face 1 1 */
52 static double NF_N_T_RT1_3D_F1_Xi[] = { RT1T_tp, RT1T_tp, 0.5+RT1T_tp };
53 static double NF_N_T_RT1_3D_F1_Eta[] = { 0,0,0 };
54 static double NF_N_T_RT1_3D_F1_Zeta[] = { RT1T_tp, 0.5+RT1T_tp, RT1T_tp };
55 
56 /* face 2 2 */
57 static double NF_N_T_RT1_3D_F2_Xi[] = { RT1T_tp, 1-2*RT1T_tp, RT1T_tp };
58 static double NF_N_T_RT1_3D_F2_Eta[] = { 1-2*RT1T_tp, RT1T_tp, RT1T_tp };
59 static double NF_N_T_RT1_3D_F2_Zeta[] = { RT1T_tp, RT1T_tp, 1-2*RT1T_tp };
60 
61 
62 /* face 3 3 */
63 static double NF_N_T_RT1_3D_F3_Xi[] = { 0,0,0 };
64 static double NF_N_T_RT1_3D_F3_Eta[] = { RT1T_tp, 0.5+RT1T_tp, RT1T_tp };
65 static double NF_N_T_RT1_3D_F3_Zeta[] = { RT1T_tp, RT1T_tp, 0.5+RT1T_tp };
66 
67 static double *NF_N_T_RT1_3D_XiArray[4] = {
68  NF_N_T_RT1_3D_F0_Xi,
69  NF_N_T_RT1_3D_F1_Xi,
70  NF_N_T_RT1_3D_F2_Xi,
71  NF_N_T_RT1_3D_F3_Xi };
72 
73 static double *NF_N_T_RT1_3D_EtaArray[4] = {
74  NF_N_T_RT1_3D_F0_Eta,
75  NF_N_T_RT1_3D_F1_Eta,
76  NF_N_T_RT1_3D_F2_Eta,
77  NF_N_T_RT1_3D_F3_Eta };
78 
79 static double *NF_N_T_RT1_3D_ZetaArray[4] = {
80  NF_N_T_RT1_3D_F0_Zeta,
81  NF_N_T_RT1_3D_F1_Zeta,
82  NF_N_T_RT1_3D_F2_Zeta,
83  NF_N_T_RT1_3D_F3_Zeta };
84 
85 static double NF_N_T_RT1_3D_T[1] = {};// ???
86 static double NF_N_T_RT1_3D_S[1] = {};// ???
87 
88 void NF_N_T_RT1_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
89  double *PointValues, double *Functionals)
90 {
91  // PointValues[4*i + j] means i-th component (i=0 for x, i=1 for y, i=2 for z)
92  // at j-th evaluation point (see NF_N_T_RT1_3D_Xi, ...Eta, ...Zeta)
93  //face 0
94  Functionals[0] = -PointValues[32];
95  Functionals[1] = -PointValues[33];
96  Functionals[2] = -PointValues[34];
97  //face 1
98  Functionals[3] = -PointValues[19];
99  Functionals[4] = -PointValues[20];
100  Functionals[5] = -PointValues[21];
101  //face 2
102  Functionals[6] = PointValues[6]+PointValues[22]+PointValues[38];
103  Functionals[7] = PointValues[7]+PointValues[23]+PointValues[39];
104  Functionals[8] = PointValues[8]+PointValues[24]+PointValues[40];
105  //face 3
106  Functionals[9] = -PointValues[9];
107  Functionals[10] = -PointValues[10];
108  Functionals[11] = -PointValues[11];
109 
110  //inner dofs
111  int i;
112  double s;
113 
114  //x-component
115  s = 0;
116  for(i=0;i<4;i++)
117  s += PointValues[i+12] * NF_N_T_RT1_3D_Weights[i];
118  Functionals[12] = s;
119 
120  //y-component
121  s = 0;
122  for(i=0;i<4;i++)
123  s += PointValues[i+28] * NF_N_T_RT1_3D_Weights[i];
124  Functionals[13] = s;
125 
126  //z-component
127  s = 0;
128  for(i=0;i<4;i++)
129  s += PointValues[i+44] * NF_N_T_RT1_3D_Weights[i];
130  Functionals[14] = s;
131 }
132 
133 void NF_N_T_RT1_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
134  double *PointValues, double *Functionals)
135 {
136  double s; // size of face
137  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
138  #ifdef __3D__
139  // find vertices of this face, then their coordinates
140  const int *faceVertex, *length;
141  int MaxLen;
142  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
143  // now MaxLen == 3, length == {3,3,3,3}
144  Cell->GetVertex(faceVertex[3*face ])->GetCoords(x0,y0,z0);
145  Cell->GetVertex(faceVertex[3*face + 1])->GetCoords(x1,y1,z1);
146  Cell->GetVertex(faceVertex[3*face + 2])->GetCoords(x2,y2,z2);
147  #endif
148  // compute measure of this face
149  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
150  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
151  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
152  Functionals[0] = PointValues[0]*s;
153  Functionals[1] = PointValues[1]*s;
154  Functionals[2] = PointValues[2]*s;
155 }
156 
157 static int NF_N_T_RT1_3D_N_AllFunctionals = 15;
158 static int NF_N_T_RT1_3D_N_PointsAll = 16;
159 static int NF_N_T_RT1_3D_N_FaceFunctionals[] = { 3, 3, 3, 3 };
160 static int NF_N_T_RT1_3D_N_PointsFace[] = { 3, 3, 3, 3 };
161 
162 TNodalFunctional3D *NF_N_T_RT1_3D_Obj = new TNodalFunctional3D
163  (NF_N_T_RT1_3D, NF_N_T_RT1_3D_N_AllFunctionals,
164  NF_N_T_RT1_3D_N_FaceFunctionals, NF_N_T_RT1_3D_N_PointsAll,
165  NF_N_T_RT1_3D_N_PointsFace,
166  NF_N_T_RT1_3D_Xi, NF_N_T_RT1_3D_Eta, NF_N_T_RT1_3D_Zeta,
167  NF_N_T_RT1_3D_XiArray, NF_N_T_RT1_3D_EtaArray,
168  NF_N_T_RT1_3D_ZetaArray,
169  NF_N_T_RT1_3D_T, NF_N_T_RT1_3D_S,
170  NF_N_T_RT1_3D_EvalAll, NF_N_T_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