ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_RT0_3D.h
1 // ***********************************************************************
2 // Raviart-Thomas element of zero-th order on tetrahedra, 3D
3 // ***********************************************************************
4 
5 /* for all functionals */
6 static double NF_N_T_RT0_3D_Xi[] = { 0.33333333333333333333,
7  0.33333333333333333333,
8  0.33333333333333333333,
9  0 };
10 static double NF_N_T_RT0_3D_Eta[] = { 0.33333333333333333333,
11  0,
12  0.33333333333333333333,
13  0.33333333333333333333 };
14 static double NF_N_T_RT0_3D_Zeta[]= { 0,
15  0.33333333333333333333,
16  0.33333333333333333333,
17  0.33333333333333333333 };
18 
19 /* face 0 0 */
20 static double NF_N_T_RT0_3D_F0_Xi[] = { 0.33333333333333333333 };
21 static double NF_N_T_RT0_3D_F0_Eta[] = { 0.33333333333333333333 };
22 static double NF_N_T_RT0_3D_F0_Zeta[] = { 0 };
23 
24 /* face 1 1 */
25 static double NF_N_T_RT0_3D_F1_Xi[] = { 0.33333333333333333333 };
26 static double NF_N_T_RT0_3D_F1_Eta[] = { 0 };
27 static double NF_N_T_RT0_3D_F1_Zeta[] = { 0.33333333333333333333 };
28 
29 /* face 2 2 */
30 static double NF_N_T_RT0_3D_F2_Xi[] = { 0.33333333333333333333 };
31 static double NF_N_T_RT0_3D_F2_Eta[] = { 0.33333333333333333333 };
32 static double NF_N_T_RT0_3D_F2_Zeta[] = { 0.33333333333333333333 };
33 
34 /* face 3 3 */
35 static double NF_N_T_RT0_3D_F3_Xi[] = { 0 };
36 static double NF_N_T_RT0_3D_F3_Eta[] = { 0.33333333333333333333 };
37 static double NF_N_T_RT0_3D_F3_Zeta[] = { 0.33333333333333333333 };
38 
39 static double *NF_N_T_RT0_3D_XiArray[4] = {
40  NF_N_T_RT0_3D_F0_Xi,
41  NF_N_T_RT0_3D_F1_Xi,
42  NF_N_T_RT0_3D_F2_Xi,
43  NF_N_T_RT0_3D_F3_Xi };
44 
45 static double *NF_N_T_RT0_3D_EtaArray[4] = {
46  NF_N_T_RT0_3D_F0_Eta,
47  NF_N_T_RT0_3D_F1_Eta,
48  NF_N_T_RT0_3D_F2_Eta,
49  NF_N_T_RT0_3D_F3_Eta };
50 
51 static double *NF_N_T_RT0_3D_ZetaArray[4] = {
52  NF_N_T_RT0_3D_F0_Zeta,
53  NF_N_T_RT0_3D_F1_Zeta,
54  NF_N_T_RT0_3D_F2_Zeta,
55  NF_N_T_RT0_3D_F3_Zeta };
56 
57 static double NF_N_T_RT0_3D_T[1] = {0.33333333333333333333};// ???
58 static double NF_N_T_RT0_3D_S[1] = {0.33333333333333333333};// ???
59 
60 void NF_N_T_RT0_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
61  double *PointValues, double *Functionals)
62 {
63  // PointValues[4*i + j] means i-th component (i=0 for x, i=1 for y, i=2 for z)
64  // at j-th evaluation point (see NF_N_T_RT0_3D_Xi, ...Eta, ...Zeta)
65  Functionals[0] = -PointValues[8];
66  Functionals[1] = -PointValues[5];
67  Functionals[2] = (PointValues[2] + PointValues[6] + PointValues[10]);
68  Functionals[3] = -PointValues[3];
69 }
70 
71 void NF_N_T_RT0_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
72  double *PointValues, double *Functionals)
73 {
74  double s; // size of face
75  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
76  #ifdef __3D__
77  // find vertices of this face, then their coordinates
78  const int *faceVertex, *length;
79  int MaxLen;
80  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
81  // now MaxLen == 3, length == {3,3,3,3}
82  Cell->GetVertex(faceVertex[3*face ])->GetCoords(x0,y0,z0);
83  Cell->GetVertex(faceVertex[3*face + 1])->GetCoords(x1,y1,z1);
84  Cell->GetVertex(faceVertex[3*face + 2])->GetCoords(x2,y2,z2);
85  #endif
86  // compute measure of this face times 2 because functional is 2 times Int_F q.n
87  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
88  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
89  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
90  //OutPut("face: " << face << " s: " << s << endl);
91  Functionals[0] = PointValues[0]*s;
92 }
93 
94 
95 static int NF_N_T_RT0_3D_N_AllFunctionals = 4;
96 static int NF_N_T_RT0_3D_N_PointsAll = 4;
97 static int NF_N_T_RT0_3D_N_FaceFunctionals[] = { 1, 1, 1, 1 };
98 static int NF_N_T_RT0_3D_N_PointsFace[] = { 1, 1, 1, 1 };
99 
100 TNodalFunctional3D *NF_N_T_RT0_3D_Obj = new TNodalFunctional3D
101  (NF_N_T_RT0_3D, NF_N_T_RT0_3D_N_AllFunctionals,
102  NF_N_T_RT0_3D_N_FaceFunctionals, NF_N_T_RT0_3D_N_PointsAll,
103  NF_N_T_RT0_3D_N_PointsFace,
104  NF_N_T_RT0_3D_Xi, NF_N_T_RT0_3D_Eta, NF_N_T_RT0_3D_Zeta,
105  NF_N_T_RT0_3D_XiArray, NF_N_T_RT0_3D_EtaArray,
106  NF_N_T_RT0_3D_ZetaArray,
107  NF_N_T_RT0_3D_T, NF_N_T_RT0_3D_S,
108  NF_N_T_RT0_3D_EvalAll, NF_N_T_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