ParMooN
 All Classes Functions Variables Friends Pages
NF_N_Q_Q2_2D.h
1 static double NF_N_Q_Q2_2D_Xi[21] =
2  { -0.77459666924148337703585307995647992, 0,
3  0.77459666924148337703585307995647992,
4  1, 1, 1,
5  0.77459666924148337703585307995647992, 0,
6  -0.77459666924148337703585307995647992,
7  -1, -1, -1,
8  -0.77459666924148337703585307995647992, 0,
9  0.77459666924148337703585307995647992,
10  -0.77459666924148337703585307995647992, 0,
11  0.77459666924148337703585307995647992,
12  -0.77459666924148337703585307995647992, 0,
13  0.77459666924148337703585307995647992
14  };
15 
16 static double NF_N_Q_Q2_2D_Eta[21] =
17  { -1, -1, -1,
18  -0.77459666924148337703585307995647992, 0,
19  0.77459666924148337703585307995647992,
20  1, 1, 1,
21  0.77459666924148337703585307995647992, 0,
22  -0.77459666924148337703585307995647992,
23 
24  -0.77459666924148337703585307995647992,
25  -0.77459666924148337703585307995647992,
26  -0.77459666924148337703585307995647992,
27  0, 0, 0,
28  0.77459666924148337703585307995647992,
29  0.77459666924148337703585307995647992,
30  0.77459666924148337703585307995647992
31  };
32 
33 static double NF_N_Q_Q2_2D_T[3] =
34  { -0.77459666924148337703585307995647992, 0,
35  0.77459666924148337703585307995647992 };
36 
37 static double NF_N_Q_Q2_2D_EdgeWeight0[3] =
38  { 0.277777777777777777777777777778,
39  0.444444444444444444444444444444,
40  0.277777777777777777777777777778 };
41 
42 static double NF_N_Q_Q2_2D_EdgeWeight1[3] =
43  { -0.64549722436790281419654423329706660,
44  0.0,
45  0.64549722436790281419654423329706660 };
46 
47 static double NF_N_Q_Q2_2D_CellWeight0[9] = {
48  0.07716049382716049382716049, 0.1234567901234567901234568,
49  0.07716049382716049382716049, 0.1234567901234567901234568,
50  0.1975308641975308641975309, 0.1234567901234567901234568,
51  0.07716049382716049382716049, 0.1234567901234567901234568,
52  0.07716049382716049382716049 };
53 
54 void NF_N_Q_Q2_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
55  double *Functionals)
56 {
57  int OwnNum, NeighNum;
58  TBaseCell *neigh;
59 
60  Functionals[0] = ( NF_N_Q_Q2_2D_EdgeWeight0[0]*PointValues[ 0]
61  +NF_N_Q_Q2_2D_EdgeWeight0[1]*PointValues[ 1]
62  +NF_N_Q_Q2_2D_EdgeWeight0[2]*PointValues[ 2]);
63  Functionals[1] = ( NF_N_Q_Q2_2D_EdgeWeight0[0]*PointValues[ 3]
64  +NF_N_Q_Q2_2D_EdgeWeight0[1]*PointValues[ 4]
65  +NF_N_Q_Q2_2D_EdgeWeight0[2]*PointValues[ 5]);
66  Functionals[2] = ( NF_N_Q_Q2_2D_EdgeWeight0[0]*PointValues[ 6]
67  +NF_N_Q_Q2_2D_EdgeWeight0[1]*PointValues[ 7]
68  +NF_N_Q_Q2_2D_EdgeWeight0[2]*PointValues[ 8]);
69  Functionals[3] = ( NF_N_Q_Q2_2D_EdgeWeight0[0]*PointValues[ 9]
70  +NF_N_Q_Q2_2D_EdgeWeight0[1]*PointValues[10]
71  +NF_N_Q_Q2_2D_EdgeWeight0[2]*PointValues[11]);
72 
73  Functionals[4] = ( NF_N_Q_Q2_2D_EdgeWeight1[0]*PointValues[ 0]
74  +NF_N_Q_Q2_2D_EdgeWeight1[1]*PointValues[ 1]
75  +NF_N_Q_Q2_2D_EdgeWeight1[2]*PointValues[ 2]);
76  Functionals[5] = ( NF_N_Q_Q2_2D_EdgeWeight1[0]*PointValues[ 3]
77  +NF_N_Q_Q2_2D_EdgeWeight1[1]*PointValues[ 4]
78  +NF_N_Q_Q2_2D_EdgeWeight1[2]*PointValues[ 5]);
79  Functionals[6] = ( NF_N_Q_Q2_2D_EdgeWeight1[0]*PointValues[ 6]
80  +NF_N_Q_Q2_2D_EdgeWeight1[1]*PointValues[ 7]
81  +NF_N_Q_Q2_2D_EdgeWeight1[2]*PointValues[ 8]);
82  Functionals[7] = ( NF_N_Q_Q2_2D_EdgeWeight1[0]*PointValues[ 9]
83  +NF_N_Q_Q2_2D_EdgeWeight1[1]*PointValues[10]
84  +NF_N_Q_Q2_2D_EdgeWeight1[2]*PointValues[11]);
85 
86  Functionals[8] = ( NF_N_Q_Q2_2D_CellWeight0[0]*PointValues[12]
87  +NF_N_Q_Q2_2D_CellWeight0[1]*PointValues[13]
88  +NF_N_Q_Q2_2D_CellWeight0[2]*PointValues[14]
89  +NF_N_Q_Q2_2D_CellWeight0[3]*PointValues[15]
90  +NF_N_Q_Q2_2D_CellWeight0[4]*PointValues[16]
91  +NF_N_Q_Q2_2D_CellWeight0[5]*PointValues[17]
92  +NF_N_Q_Q2_2D_CellWeight0[6]*PointValues[18]
93  +NF_N_Q_Q2_2D_CellWeight0[7]*PointValues[19]
94  +NF_N_Q_Q2_2D_CellWeight0[8]*PointValues[20]);
95 
96  /*
97  if(Cell)
98  {
99  if(Cell->GetVertex(0) > Cell->GetVertex(1))
100  Functionals[4] = -Functionals[4];
101  if(Cell->GetVertex(1) > Cell->GetVertex(2))
102  Functionals[5] = -Functionals[5];
103  if(Cell->GetVertex(2) > Cell->GetVertex(3))
104  Functionals[6] = -Functionals[6];
105  if(Cell->GetVertex(3) > Cell->GetVertex(0))
106  Functionals[7] = -Functionals[7];
107  }
108  */
109 
110  if(Cell)
111  {
112  OwnNum = Coll->GetIndex(Cell);
113 
114  neigh = Cell->GetJoint(0)->GetNeighbour(Cell);
115  if(neigh)
116  {
117  NeighNum = Coll->GetIndex(neigh);
118  if(NeighNum < OwnNum)
119  Functionals[ 4] = -Functionals[ 4];
120  } // endif neigh
121 
122  neigh = Cell->GetJoint(1)->GetNeighbour(Cell);
123  if(neigh)
124  {
125  NeighNum = Coll->GetIndex(neigh);
126  if(NeighNum < OwnNum)
127  Functionals[ 5] = -Functionals[ 5];
128  } // endif neigh
129 
130  neigh = Cell->GetJoint(2)->GetNeighbour(Cell);
131  if(neigh)
132  {
133  NeighNum = Coll->GetIndex(neigh);
134  if(NeighNum < OwnNum)
135  Functionals[ 6] = -Functionals[ 6];
136  } // endif neigh
137 
138  neigh = Cell->GetJoint(3)->GetNeighbour(Cell);
139  if(neigh)
140  {
141  NeighNum = Coll->GetIndex(neigh);
142  if(NeighNum < OwnNum)
143  Functionals[ 7] = -Functionals[ 7];
144  } // endif neigh
145  } // endif Cell
146 }
147 
148 void NF_N_Q_Q2_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint,
149  double *PointValues, double *Functionals)
150 {
151  int OwnNum, NeighNum;
152  TBaseCell *neigh;
153 
154  Functionals[0] = ( NF_N_Q_Q2_2D_EdgeWeight0[0]*PointValues[0]
155  +NF_N_Q_Q2_2D_EdgeWeight0[1]*PointValues[1]
156  +NF_N_Q_Q2_2D_EdgeWeight0[2]*PointValues[2]);
157  Functionals[1] = ( NF_N_Q_Q2_2D_EdgeWeight1[0]*PointValues[0]
158  +NF_N_Q_Q2_2D_EdgeWeight1[1]*PointValues[1]
159  +NF_N_Q_Q2_2D_EdgeWeight1[2]*PointValues[2]);
160 
161  if(Joint != -1)
162  {
163  // if(Cell->GetVertex(Joint) > Cell->GetVertex((Joint+1)%4))
164  // Functionals[1] = -Functionals[1];
165  // /*
166  neigh = Cell->GetJoint(Joint)->GetNeighbour(Cell);
167  if(neigh)
168  {
169  OwnNum = Coll->GetIndex(Cell);
170  NeighNum = Coll->GetIndex(neigh);
171  if(NeighNum < OwnNum)
172  Functionals[1] = -Functionals[1];
173  } // endif neigh
174  // */
175  }
176 }
177 
178 /*
179  TNodalFunctional2D(NodalFunctional2D id,
180  int n_allfunctionals, int n_edgefunctionals,
181  int n_pointsall, int n_pointsedge,
182  double *xi, double *eta, double *t,
183  DoubleFunctVect *evalall,
184  DoubleFunctVect *evaledge);
185 */
186 
187 TNodalFunctional2D *NF_N_Q_Q2_2D_Obj = new TNodalFunctional2D
188  (NF_N_Q_Q2_2D, 9, 2, 21, 3, NF_N_Q_Q2_2D_Xi, NF_N_Q_Q2_2D_Eta,
189  NF_N_Q_Q2_2D_T, NF_N_Q_Q2_2D_EvalAll, NF_N_Q_Q2_2D_EvalEdge);
store cells in an array, used by cell iterators
Definition: Collection.h:18
Definition: NodalFunctional2D.h:20
int GetIndex(TBaseCell *cell)
return Index of cell in Cells-array
Definition: Collection.C:115
TJoint * GetJoint(int J_i)
return the pointer to face with number i
Definition: BaseCell.h:175
TBaseCell * GetNeighbour(TBaseCell *Me) const
Definition: Joint.C:57
information for finite element data structure
Definition: BaseCell.h:25