ParMooN
 All Classes Functions Variables Friends Pages
NF_N_H_BDDF1_3D.h
1 // ***********************************************************************
2 // Brezzi-Douglas-Duran-Fortin element of first order on hexahedra, 3D
3 // ***********************************************************************
4 
5 //tschebyscheff point
6 static double BDDF1_tp = 0.707106781186547;
7 
8 static double NF_N_H_BDDF1_3D_Xi[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp, -BDDF1_tp, -BDDF1_tp, BDDF1_tp, 1,1,1,
9  -BDDF1_tp, -BDDF1_tp, BDDF1_tp, -1,-1,-1, -BDDF1_tp, -BDDF1_tp, BDDF1_tp};
10 static double NF_N_H_BDDF1_3D_Eta[] = { -BDDF1_tp, -BDDF1_tp, BDDF1_tp, -1,-1,-1, -BDDF1_tp, -BDDF1_tp, BDDF1_tp,
11  1,1,1, -BDDF1_tp, BDDF1_tp, -BDDF1_tp, -BDDF1_tp, BDDF1_tp, -BDDF1_tp};
12 static double NF_N_H_BDDF1_3D_Zeta[] = {-1,-1,-1, -BDDF1_tp, BDDF1_tp, -BDDF1_tp, -BDDF1_tp, BDDF1_tp, -BDDF1_tp,
13  -BDDF1_tp, BDDF1_tp, -BDDF1_tp, -BDDF1_tp, -BDDF1_tp, BDDF1_tp, 1,1,1};
14 
15 // face 0
16 static double NF_N_H_BDDF1_3D_F0_Xi[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
17 static double NF_N_H_BDDF1_3D_F0_Eta[] = {-BDDF1_tp, -BDDF1_tp, BDDF1_tp};
18 static double NF_N_H_BDDF1_3D_F0_Zeta[] = { -1, -1, -1};
19 
20 // face 1 1
21 static double NF_N_H_BDDF1_3D_F1_Xi[] = {-BDDF1_tp, -BDDF1_tp, BDDF1_tp};
22 static double NF_N_H_BDDF1_3D_F1_Eta[] = { -1, -1, -1};
23 static double NF_N_H_BDDF1_3D_F1_Zeta[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
24 
25 // face 2 2
26 static double NF_N_H_BDDF1_3D_F2_Xi[] = { 1,1,1 };
27 static double NF_N_H_BDDF1_3D_F2_Eta[] = {-BDDF1_tp, -BDDF1_tp, BDDF1_tp };
28 static double NF_N_H_BDDF1_3D_F2_Zeta[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
29 
30  //face 3 3
31 static double NF_N_H_BDDF1_3D_F3_Xi[] = { -BDDF1_tp, -BDDF1_tp, BDDF1_tp };
32 static double NF_N_H_BDDF1_3D_F3_Eta[] = { 1,1,1 };
33 static double NF_N_H_BDDF1_3D_F3_Zeta[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
34 
35 // face 4 4
36 static double NF_N_H_BDDF1_3D_F4_Xi[] = { -1, -1, -1};
37 static double NF_N_H_BDDF1_3D_F4_Eta[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
38 static double NF_N_H_BDDF1_3D_F4_Zeta[] = {-BDDF1_tp, -BDDF1_tp, BDDF1_tp };
39 
40 // face 5 5
41 static double NF_N_H_BDDF1_3D_F5_Xi[] = {-BDDF1_tp, -BDDF1_tp, BDDF1_tp};
42 static double NF_N_H_BDDF1_3D_F5_Eta[] = {-BDDF1_tp, BDDF1_tp, -BDDF1_tp};
43 static double NF_N_H_BDDF1_3D_F5_Zeta[] = { 1,1,1 };
44 
45 static double *NF_N_H_BDDF1_3D_XiArray[6] = {
46  NF_N_H_BDDF1_3D_F0_Xi,
47  NF_N_H_BDDF1_3D_F1_Xi,
48  NF_N_H_BDDF1_3D_F2_Xi,
49  NF_N_H_BDDF1_3D_F3_Xi,
50  NF_N_H_BDDF1_3D_F4_Xi,
51  NF_N_H_BDDF1_3D_F5_Xi };
52 
53 static double *NF_N_H_BDDF1_3D_EtaArray[6] = {
54  NF_N_H_BDDF1_3D_F0_Eta,
55  NF_N_H_BDDF1_3D_F1_Eta,
56  NF_N_H_BDDF1_3D_F2_Eta,
57  NF_N_H_BDDF1_3D_F3_Eta,
58  NF_N_H_BDDF1_3D_F4_Eta,
59  NF_N_H_BDDF1_3D_F5_Eta };
60 
61 static double *NF_N_H_BDDF1_3D_ZetaArray[6] = {
62  NF_N_H_BDDF1_3D_F0_Zeta,
63  NF_N_H_BDDF1_3D_F1_Zeta,
64  NF_N_H_BDDF1_3D_F2_Zeta,
65  NF_N_H_BDDF1_3D_F3_Zeta,
66  NF_N_H_BDDF1_3D_F4_Zeta,
67  NF_N_H_BDDF1_3D_F5_Zeta };
68 
69 static double NF_N_H_BDDF1_3D_T[] = {-100};//???
70 static double NF_N_H_BDDF1_3D_S[] = {-100};//???
71 
72 
73 
74 void NF_N_H_BDDF1_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
75  double *PointValues, double *Functionals)
76 {
77  //face 0
78  Functionals[0] = -PointValues[36] * 4.0;
79  Functionals[1] = -PointValues[37] * 4.0;
80  Functionals[2] = -PointValues[38] * 4.0;
81  //face 1
82  Functionals[3] = -PointValues[21] * 4.0;
83  Functionals[4] = -PointValues[22] * 4.0;
84  Functionals[5] = -PointValues[23] * 4.0;
85  //face 2
86  Functionals[6] = PointValues[6] * 4.0;
87  Functionals[7] = PointValues[7] * 4.0;
88  Functionals[8] = PointValues[8] * 4.0;
89  //face 3
90  Functionals[9] = PointValues[27] * 4.0;
91  Functionals[10] = PointValues[28] * 4.0;
92  Functionals[11] = PointValues[29] * 4.0;
93  //face 4
94  Functionals[12] = -PointValues[12] * 4.0;
95  Functionals[13] = -PointValues[13] * 4.0;
96  Functionals[14] = -PointValues[14] * 4.0;
97  //face 5
98  Functionals[15] = PointValues[51] * 4.0;
99  Functionals[16] = PointValues[52] * 4.0;
100  Functionals[17] = PointValues[53] * 4.0;
101 }
102 
103 void NF_N_H_BDDF1_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 }
126 
127 static int NF_N_H_BDDF1_3D_N_AllFunctionals = 18;
128 static int NF_N_H_BDDF1_3D_N_PointsAll = 18;
129 static int NF_N_H_BDDF1_3D_N_FaceFunctionals[] = { 3, 3, 3, 3, 3, 3 };
130 static int NF_N_H_BDDF1_3D_N_PointsFace[] = { 3, 3, 3, 3, 3, 3 };
131 
132 TNodalFunctional3D *NF_N_H_BDDF1_3D_Obj = new TNodalFunctional3D
133  (NF_N_H_BDDF1_3D, NF_N_H_BDDF1_3D_N_AllFunctionals,
134  NF_N_H_BDDF1_3D_N_FaceFunctionals, NF_N_H_BDDF1_3D_N_PointsAll,
135  NF_N_H_BDDF1_3D_N_PointsFace,
136  NF_N_H_BDDF1_3D_Xi, NF_N_H_BDDF1_3D_Eta, NF_N_H_BDDF1_3D_Zeta,
137  NF_N_H_BDDF1_3D_XiArray, NF_N_H_BDDF1_3D_EtaArray,
138  NF_N_H_BDDF1_3D_ZetaArray,
139  NF_N_H_BDDF1_3D_T, NF_N_H_BDDF1_3D_S,
140  NF_N_H_BDDF1_3D_EvalAll, NF_N_H_BDDF1_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