ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_BDDF1_3D.h
1 // ***********************************************************************
2 // Brezzi-Douglas-Duran-Fortin element of first order on tetrahedra, 3D
3 // ***********************************************************************
4 
5 //point
6 static double BDDF1T_tp = 0.166666666666667;
7 
8 static double NF_N_T_BDDF1_3D_Xi[] = {
9  BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp, //face 0
10  BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp, //face 1
11  BDDF1T_tp, 1-2*BDDF1T_tp, BDDF1T_tp, //face 2
12  0,0,0 //face 3
13 };
14 static double NF_N_T_BDDF1_3D_Eta[] = {
15  BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp, //face 0
16  0,0,0, //face 1
17  1-2*BDDF1T_tp, BDDF1T_tp, BDDF1T_tp, //face 2
18  BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp //face 3
19 };
20 static double NF_N_T_BDDF1_3D_Zeta[]= {
21  0,0,0, //face 0
22  BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp, //face 1
23  BDDF1T_tp, BDDF1T_tp, 1-2*BDDF1T_tp, //face 2
24  BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp //face 3
25 };
26 
27 /* face 0 0 */
28 static double NF_N_T_BDDF1_3D_F0_Xi[] = { BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp };
29 static double NF_N_T_BDDF1_3D_F0_Eta[] = { BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp };
30 static double NF_N_T_BDDF1_3D_F0_Zeta[] = { 0,0,0 };
31 
32 /* face 1 1 */
33 static double NF_N_T_BDDF1_3D_F1_Xi[] = { BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp };
34 static double NF_N_T_BDDF1_3D_F1_Eta[] = { 0,0,0 };
35 static double NF_N_T_BDDF1_3D_F1_Zeta[] = { BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp };
36 
37 /* face 2 2 */
38 static double NF_N_T_BDDF1_3D_F2_Xi[] = { BDDF1T_tp, 1-2*BDDF1T_tp, BDDF1T_tp };
39 static double NF_N_T_BDDF1_3D_F2_Eta[] = { 1-2*BDDF1T_tp, BDDF1T_tp, BDDF1T_tp };
40 static double NF_N_T_BDDF1_3D_F2_Zeta[] = { BDDF1T_tp, BDDF1T_tp, 1-2*BDDF1T_tp };
41 
42 
43 /* face 3 3 */
44 static double NF_N_T_BDDF1_3D_F3_Xi[] = { 0,0,0 };
45 static double NF_N_T_BDDF1_3D_F3_Eta[] = { BDDF1T_tp, 0.5+BDDF1T_tp, BDDF1T_tp };
46 static double NF_N_T_BDDF1_3D_F3_Zeta[] = { BDDF1T_tp, BDDF1T_tp, 0.5+BDDF1T_tp };
47 
48 static double *NF_N_T_BDDF1_3D_XiArray[4] = {
49  NF_N_T_BDDF1_3D_F0_Xi,
50  NF_N_T_BDDF1_3D_F1_Xi,
51  NF_N_T_BDDF1_3D_F2_Xi,
52  NF_N_T_BDDF1_3D_F3_Xi };
53 
54 static double *NF_N_T_BDDF1_3D_EtaArray[4] = {
55  NF_N_T_BDDF1_3D_F0_Eta,
56  NF_N_T_BDDF1_3D_F1_Eta,
57  NF_N_T_BDDF1_3D_F2_Eta,
58  NF_N_T_BDDF1_3D_F3_Eta };
59 
60 static double *NF_N_T_BDDF1_3D_ZetaArray[4] = {
61  NF_N_T_BDDF1_3D_F0_Zeta,
62  NF_N_T_BDDF1_3D_F1_Zeta,
63  NF_N_T_BDDF1_3D_F2_Zeta,
64  NF_N_T_BDDF1_3D_F3_Zeta };
65 
66 static double NF_N_T_BDDF1_3D_T[] = {-100};// ???
67 static double NF_N_T_BDDF1_3D_S[] = {-100};// ???
68 
69 void NF_N_T_BDDF1_3D_EvalAll(TCollection *Coll, TBaseCell *Cell,
70  double *PointValues, double *Functionals)
71 {
72  //face 0
73  Functionals[0] = -PointValues[24];
74  Functionals[1] = -PointValues[25];
75  Functionals[2] = -PointValues[26];
76  //face 1
77  Functionals[3] = -PointValues[15];
78  Functionals[4] = -PointValues[16];
79  Functionals[5] = -PointValues[17];
80  //face 2
81  Functionals[6] = PointValues[6]+PointValues[18]+PointValues[30];
82  Functionals[7] = PointValues[7]+PointValues[19]+PointValues[31];
83  Functionals[8] = PointValues[8]+PointValues[20]+PointValues[32];
84  //face 3
85  Functionals[9] = -PointValues[9];
86  Functionals[10] = -PointValues[10];
87  Functionals[11] = -PointValues[11];
88 }
89 
90 void NF_N_T_BDDF1_3D_EvalFace(TCollection *Coll, TBaseCell *Cell, int face,
91  double *PointValues, double *Functionals)
92 {
93  double s; // size of face
94  double x0,x1,x2,y0,y1,y2,z0,z1,z2;
95  #ifdef __3D__
96  // find vertices of this face, then their coordinates
97  const int *faceVertex, *length;
98  int MaxLen;
99  Cell->GetShapeDesc()->GetFaceVertex(faceVertex, length, MaxLen);
100  // now MaxLen == 3, length == {3,3,3,3}
101  Cell->GetVertex(faceVertex[3*face ])->GetCoords(x0,y0,z0);
102  Cell->GetVertex(faceVertex[3*face + 1])->GetCoords(x1,y1,z1);
103  Cell->GetVertex(faceVertex[3*face + 2])->GetCoords(x2,y2,z2);
104  #endif
105  // compute measure of this face
106  s = sqrt( POW((y1-y0)*(z2-z0) - (z1-z0)*(y2-y0),2)
107  + POW((z1-z0)*(x2-x0) - (x1-x0)*(z2-z0),2)
108  + POW((x1-x0)*(y2-y0) - (x2-x0)*(y1-y0),2) );
109  Functionals[0] = PointValues[0]*s;
110  Functionals[1] = PointValues[1]*s;
111  Functionals[2] = PointValues[2]*s;
112 }
113 
114 static int NF_N_T_BDDF1_3D_N_AllFunctionals = 12;
115 static int NF_N_T_BDDF1_3D_N_PointsAll = 12;
116 static int NF_N_T_BDDF1_3D_N_FaceFunctionals[] = { 3, 3, 3, 3 };
117 static int NF_N_T_BDDF1_3D_N_PointsFace[] = { 3, 3, 3, 3 };
118 
119 TNodalFunctional3D *NF_N_T_BDDF1_3D_Obj = new TNodalFunctional3D
120  (NF_N_T_BDDF1_3D, NF_N_T_BDDF1_3D_N_AllFunctionals,
121  NF_N_T_BDDF1_3D_N_FaceFunctionals, NF_N_T_BDDF1_3D_N_PointsAll,
122  NF_N_T_BDDF1_3D_N_PointsFace,
123  NF_N_T_BDDF1_3D_Xi, NF_N_T_BDDF1_3D_Eta, NF_N_T_BDDF1_3D_Zeta,
124  NF_N_T_BDDF1_3D_XiArray, NF_N_T_BDDF1_3D_EtaArray,
125  NF_N_T_BDDF1_3D_ZetaArray,
126  NF_N_T_BDDF1_3D_T, NF_N_T_BDDF1_3D_S,
127  NF_N_T_BDDF1_3D_EvalAll, NF_N_T_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