ParMooN
 All Classes Functions Variables Friends Pages
NF_N_H_RT2_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of second order on tetrahedra, 3D
3 // ***********************************************************************
4 
5 /* for all functionals */
6 
7 //tschebyscheff point
8 static double tscheb_point_3 = 0.866025403784439;
9 
10 static double NF_N_H_RT2_3D_Xi[] = {
11  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3,
12  -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3,
13  1, 1, 1, 1, 1, 1, 1, 1, 1,
14  tscheb_point_3, tscheb_point_3, tscheb_point_3, 0, 0, 0, -tscheb_point_3, -tscheb_point_3, -tscheb_point_3,
15  -1, -1, -1, -1, -1, -1, -1, -1, -1,
16  -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3
17 };
18 static double NF_N_H_RT2_3D_Eta[] = {
19  -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3,
20  -1, -1, -1, -1, -1, -1, -1, -1, -1,
21  -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3,
22  1, 1, 1, 1, 1, 1, 1, 1, 1,
23  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3,
24  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3
25 };
26 static double NF_N_H_RT2_3D_Zeta[] = {
27  -1, -1, -1, -1, -1, -1, -1, -1, -1,
28  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3,
29  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3,
30  -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3,
31  -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3,
32  1, 1, 1, 1, 1, 1, 1, 1, 1
33 };
34 
35 // face 0
36 static double NF_N_H_RT2_3D_F0_Xi[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
37 static double NF_N_H_RT2_3D_F0_Eta[] = { -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3 };
38 static double NF_N_H_RT2_3D_F0_Zeta[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
39 
40 // face 1 1
41 static double NF_N_H_RT2_3D_F1_Xi[] = { -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3 };
42 static double NF_N_H_RT2_3D_F1_Eta[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
43 static double NF_N_H_RT2_3D_F1_Zeta[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
44 
45 // face 2 2
46 static double NF_N_H_RT2_3D_F2_Xi[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
47 static double NF_N_H_RT2_3D_F2_Eta[] = { -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3 };
48 static double NF_N_H_RT2_3D_F2_Zeta[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
49 
50  //face 3 3
51 static double NF_N_H_RT2_3D_F3_Xi[] = { tscheb_point_3, tscheb_point_3, tscheb_point_3, 0, 0, 0, -tscheb_point_3, -tscheb_point_3, -tscheb_point_3 };
52 static double NF_N_H_RT2_3D_F3_Eta[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
53 static double NF_N_H_RT2_3D_F3_Zeta[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
54 
55 // face 4 4
56 static double NF_N_H_RT2_3D_F4_Xi[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
57 static double NF_N_H_RT2_3D_F4_Eta[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
58 static double NF_N_H_RT2_3D_F4_Zeta[] = { -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3 };
59 
60 // face 5 5
61 static double NF_N_H_RT2_3D_F5_Xi[] = { -tscheb_point_3, -tscheb_point_3, -tscheb_point_3, 0, 0, 0, tscheb_point_3, tscheb_point_3, tscheb_point_3 };
62 static double NF_N_H_RT2_3D_F5_Eta[] = { -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3, -tscheb_point_3, 0, tscheb_point_3 };
63 static double NF_N_H_RT2_3D_F5_Zeta[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
64 
65 static double *NF_N_H_RT2_3D_XiArray[6] = {
66  NF_N_H_RT2_3D_F0_Xi,
67  NF_N_H_RT2_3D_F1_Xi,
68  NF_N_H_RT2_3D_F2_Xi,
69  NF_N_H_RT2_3D_F3_Xi,
70  NF_N_H_RT2_3D_F4_Xi,
71  NF_N_H_RT2_3D_F5_Xi };
72 
73 static double *NF_N_H_RT2_3D_EtaArray[6] = {
74  NF_N_H_RT2_3D_F0_Eta,
75  NF_N_H_RT2_3D_F1_Eta,
76  NF_N_H_RT2_3D_F2_Eta,
77  NF_N_H_RT2_3D_F3_Eta,
78  NF_N_H_RT2_3D_F4_Eta,
79  NF_N_H_RT2_3D_F5_Eta };
80 
81 static double *NF_N_H_RT2_3D_ZetaArray[6] = {
82  NF_N_H_RT2_3D_F0_Zeta,
83  NF_N_H_RT2_3D_F1_Zeta,
84  NF_N_H_RT2_3D_F2_Zeta,
85  NF_N_H_RT2_3D_F3_Zeta,
86  NF_N_H_RT2_3D_F4_Zeta,
87  NF_N_H_RT2_3D_F5_Zeta };
88 
89 static double NF_N_H_RT2_3D_T[] = {-100};//???
90 static double NF_N_H_RT2_3D_S[] = {-100};//???
91 
92 
93 
94 void NF_N_H_RT2_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
95  double *PointValues, double *Functionals)
96 {
97  cout << "Raviart-Thomas elements of order 2 on hexaeder: "
98  << "Nodal functionals are not fully implemented properly!" << endl;
99  for(int i=0; i<108; i++)
100  Functionals[i] = 0;
101 }
102 
103 void NF_N_H_RT2_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
104  double *PointValues, double *Functionals)
105 {
106  double s; // size of face
107  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
108  #ifdef __3D__
109  // find vertices of this face, then their coordinates
110  const int *faceVertex, *length;
111  int MaxLen;
112  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
113  // now MaxLen == 4, length == {4,4,4,4}
114  Cell->GetVertex(faceVertex[4*face ])->GetCoords(x0,y0,z0);
115  Cell->GetVertex(faceVertex[4*face + 1])->GetCoords(x1,y1,z1);
116  Cell->GetVertex(faceVertex[4*face + 2])->GetCoords(x2,y2,z2);
117  #endif
118  // compute measure of this face
119  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
120  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
121  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
122  Functionals[0] = PointValues[0]*s;
123  Functionals[1] = PointValues[1]*s;
124  Functionals[2] = PointValues[2]*s;
125  Functionals[3] = PointValues[3]*s;
126  Functionals[4] = PointValues[4]*s;
127  Functionals[5] = PointValues[5]*s;
128  Functionals[6] = PointValues[6]*s;
129  Functionals[7] = PointValues[7]*s;
130  Functionals[8] = PointValues[8]*s;
131 }
132 
133 static int NF_N_H_RT2_3D_N_AllFunctionals = 108;
134 static int NF_N_H_RT2_3D_N_PointsAll = 54;
135 static int NF_N_H_RT2_3D_N_FaceFunctionals[] = { 9, 9, 9, 9, 9, 9 };
136 static int NF_N_H_RT2_3D_N_PointsFace[] = { 9, 9, 9, 9, 9, 9 };
137 
138 TNodalFunctional3D *NF_N_H_RT2_3D_Obj = new TNodalFunctional3D
139  (NF_N_H_RT2_3D, NF_N_H_RT2_3D_N_AllFunctionals,
140  NF_N_H_RT2_3D_N_FaceFunctionals, NF_N_H_RT2_3D_N_PointsAll,
141  NF_N_H_RT2_3D_N_PointsFace,
142  NF_N_H_RT2_3D_Xi, NF_N_H_RT2_3D_Eta, NF_N_H_RT2_3D_Zeta,
143  NF_N_H_RT2_3D_XiArray, NF_N_H_RT2_3D_EtaArray,
144  NF_N_H_RT2_3D_ZetaArray,
145  NF_N_H_RT2_3D_T, NF_N_H_RT2_3D_S,
146  NF_N_H_RT2_3D_EvalAll, NF_N_H_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