ParMooN
 All Classes Functions Variables Friends Pages
NF_N_H_RT0_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of zero-th order on hexahedra, 3D
3 // ***********************************************************************
4 
5 /* for all functionals */
6 static double NF_N_H_RT0_3D_Xi[] = { 0, 0, 1, 0,-1, 0 };
7 static double NF_N_H_RT0_3D_Eta[] = { 0,-1, 0, 1, 0, 0 };
8 static double NF_N_H_RT0_3D_Zeta[] = {-1, 0, 0, 0, 0, 1 };
9 
10 /* face 0 0 */
11 static double NF_N_H_RT0_3D_F0_Xi[] = { 0 };
12 static double NF_N_H_RT0_3D_F0_Eta[] = { 0 };
13 static double NF_N_H_RT0_3D_F0_Zeta[] = {-1 };
14 
15 /* face 1 1 */
16 static double NF_N_H_RT0_3D_F1_Xi[] = { 0 };
17 static double NF_N_H_RT0_3D_F1_Eta[] = {-1 };
18 static double NF_N_H_RT0_3D_F1_Zeta[] = { 0 };
19 
20 /* face 2 2 */
21 static double NF_N_H_RT0_3D_F2_Xi[] = { 1 };
22 static double NF_N_H_RT0_3D_F2_Eta[] = { 0 };
23 static double NF_N_H_RT0_3D_F2_Zeta[] = { 0 };
24 
25 /* face 3 3 */
26 static double NF_N_H_RT0_3D_F3_Xi[] = { 0 };
27 static double NF_N_H_RT0_3D_F3_Eta[] = { 1 };
28 static double NF_N_H_RT0_3D_F3_Zeta[] = { 0 };
29 
30 /* face 4 4 */
31 static double NF_N_H_RT0_3D_F4_Xi[] = {-1 };
32 static double NF_N_H_RT0_3D_F4_Eta[] = { 0 };
33 static double NF_N_H_RT0_3D_F4_Zeta[] = { 0 };
34 
35 /* face 5 5 */
36 static double NF_N_H_RT0_3D_F5_Xi[] = { 0 };
37 static double NF_N_H_RT0_3D_F5_Eta[] = { 0 };
38 static double NF_N_H_RT0_3D_F5_Zeta[] = { 1 };
39 
40 static double *NF_N_H_RT0_3D_XiArray[6] = {
41  NF_N_H_RT0_3D_F0_Xi,
42  NF_N_H_RT0_3D_F1_Xi,
43  NF_N_H_RT0_3D_F2_Xi,
44  NF_N_H_RT0_3D_F3_Xi,
45  NF_N_H_RT0_3D_F4_Xi,
46  NF_N_H_RT0_3D_F5_Xi };
47 
48 static double *NF_N_H_RT0_3D_EtaArray[6] = {
49  NF_N_H_RT0_3D_F0_Eta,
50  NF_N_H_RT0_3D_F1_Eta,
51  NF_N_H_RT0_3D_F2_Eta,
52  NF_N_H_RT0_3D_F3_Eta,
53  NF_N_H_RT0_3D_F4_Eta,
54  NF_N_H_RT0_3D_F5_Eta };
55 
56 static double *NF_N_H_RT0_3D_ZetaArray[6] = {
57  NF_N_H_RT0_3D_F0_Zeta,
58  NF_N_H_RT0_3D_F1_Zeta,
59  NF_N_H_RT0_3D_F2_Zeta,
60  NF_N_H_RT0_3D_F3_Zeta,
61  NF_N_H_RT0_3D_F4_Zeta,
62  NF_N_H_RT0_3D_F5_Zeta };
63 
64 static double NF_N_H_RT0_3D_T[1] = {0};// ???
65 static double NF_N_H_RT0_3D_S[1] = {0};// ???
66 
67 void NF_N_H_RT0_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
68  double *PointValues, double *Functionals)
69 {
70  Functionals[0] = -PointValues[12] * 4.0;
71  Functionals[1] = -PointValues[7] * 4.0;
72  Functionals[2] = PointValues[2] * 4.0;
73  Functionals[3] = PointValues[9] * 4.0;
74  Functionals[4] = -PointValues[4] * 4.0;
75  Functionals[5] = PointValues[17] * 4.0;
76 }
77 
78 void NF_N_H_RT0_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
79  double *PointValues, double *Functionals)
80 {
81  double s; // size of face
82  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
83  #ifdef __3D__
84  // find vertices of this face, then their coordinates
85  const int *faceVertex, *length;
86  int MaxLen;
87  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
88  // now MaxLen == 4, length == {4,4,4,4}
89  Cell->GetVertex(faceVertex[4*face ])->GetCoords(x0,y0,z0);
90  Cell->GetVertex(faceVertex[4*face + 1])->GetCoords(x1,y1,z1);
91  Cell->GetVertex(faceVertex[4*face + 2])->GetCoords(x2,y2,z2);
92  #endif
93  // compute measure of this face
94  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
95  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
96  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
97  Functionals[0] = PointValues[0]*s;
98 }
99 
100 static int NF_N_H_RT0_3D_N_AllFunctionals = 6;
101 static int NF_N_H_RT0_3D_N_PointsAll = 6;
102 static int NF_N_H_RT0_3D_N_FaceFunctionals[] = { 1, 1, 1, 1, 1, 1 };
103 static int NF_N_H_RT0_3D_N_PointsFace[] = { 1, 1, 1, 1, 1, 1 };
104 
105 TNodalFunctional3D *NF_N_H_RT0_3D_Obj = new TNodalFunctional3D
106  (NF_N_H_RT0_3D, NF_N_H_RT0_3D_N_AllFunctionals,
107  NF_N_H_RT0_3D_N_FaceFunctionals, NF_N_H_RT0_3D_N_PointsAll,
108  NF_N_H_RT0_3D_N_PointsFace,
109  NF_N_H_RT0_3D_Xi, NF_N_H_RT0_3D_Eta, NF_N_H_RT0_3D_Zeta,
110  NF_N_H_RT0_3D_XiArray, NF_N_H_RT0_3D_EtaArray,
111  NF_N_H_RT0_3D_ZetaArray,
112  NF_N_H_RT0_3D_T, NF_N_H_RT0_3D_S,
113  NF_N_H_RT0_3D_EvalAll, NF_N_H_RT0_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