ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_P2_2D.h
1 static double NF_N_T_P2_2D_Xi[16] =
2  {
3  0.112701665379258311482073460022, 0.5,
4  0.887298334620741688517926539978,
5  0.887298334620741688517926539978, 0.5,
6  0.112701665379258311482073460022,
7  0, 0, 0,
8  0.333333333333333333333333333333,
9  0.5, 0.5, 0.0,
10  0.0, 1.0, 0.0
11  };
12 
13 static double NF_N_T_P2_2D_Eta[16] =
14  {
15  0, 0, 0,
16  0.112701665379258311482073460022, 0.5,
17  0.887298334620741688517926539978,
18  0.887298334620741688517926539978, 0.5,
19  0.112701665379258311482073460022,
20  0.333333333333333333333333333333,
21  0.0, 0.5, 0.5,
22  0.0, 0.0, 1.0
23  };
24 
25 static double NF_N_T_P2_2D_T[3] =
26  { -0.77459666924148337703585307995647992, 0,
27  0.77459666924148337703585307995647992 };
28 
29 static double NF_N_T_P2_2D_EdgeWeight0[3] =
30  { 0.277777777777777777777777777778,
31  0.444444444444444444444444444444,
32  0.277777777777777777777777777778 };
33 
34 static double NF_N_T_P2_2D_EdgeWeight1[3] =
35  { -0.64549722436790281419654423329706660,
36  0.0,
37  0.64549722436790281419654423329706660 };
38 
39 static double NF_N_T_P2_2D_CellWeight0[7] =
40  { 0.45,
41  0.1333333333333333333333333333333333,
42  0.1333333333333333333333333333333333,
43  0.1333333333333333333333333333333333,
44  0.05, 0.05, 0.05 };
45 
46 void NF_N_T_P2_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
47  double *Functionals)
48 {
49  int OwnNum, NeighNum;
50  TBaseCell *neigh;
51 
52  Functionals[0] = ( NF_N_T_P2_2D_EdgeWeight0[0]*PointValues[0]
53  +NF_N_T_P2_2D_EdgeWeight0[1]*PointValues[1]
54  +NF_N_T_P2_2D_EdgeWeight0[2]*PointValues[2]);
55  Functionals[1] = ( NF_N_T_P2_2D_EdgeWeight0[0]*PointValues[3]
56  +NF_N_T_P2_2D_EdgeWeight0[1]*PointValues[4]
57  +NF_N_T_P2_2D_EdgeWeight0[2]*PointValues[5]);
58  Functionals[2] = ( NF_N_T_P2_2D_EdgeWeight0[0]*PointValues[6]
59  +NF_N_T_P2_2D_EdgeWeight0[1]*PointValues[7]
60  +NF_N_T_P2_2D_EdgeWeight0[2]*PointValues[8]);
61 
62  Functionals[3] = ( NF_N_T_P2_2D_EdgeWeight1[0]*PointValues[0]
63  +NF_N_T_P2_2D_EdgeWeight1[1]*PointValues[1]
64  +NF_N_T_P2_2D_EdgeWeight1[2]*PointValues[2]);
65  Functionals[4] = ( NF_N_T_P2_2D_EdgeWeight1[0]*PointValues[3]
66  +NF_N_T_P2_2D_EdgeWeight1[1]*PointValues[4]
67  +NF_N_T_P2_2D_EdgeWeight1[2]*PointValues[5]);
68  Functionals[5] = ( NF_N_T_P2_2D_EdgeWeight1[0]*PointValues[6]
69  +NF_N_T_P2_2D_EdgeWeight1[1]*PointValues[7]
70  +NF_N_T_P2_2D_EdgeWeight1[2]*PointValues[8]);
71 
72  Functionals[6] =( NF_N_T_P2_2D_CellWeight0[0]*PointValues[ 9]
73  +NF_N_T_P2_2D_CellWeight0[1]*PointValues[10]
74  +NF_N_T_P2_2D_CellWeight0[2]*PointValues[11]
75  +NF_N_T_P2_2D_CellWeight0[3]*PointValues[12]
76  +NF_N_T_P2_2D_CellWeight0[4]*PointValues[13]
77  +NF_N_T_P2_2D_CellWeight0[5]*PointValues[14]
78  +NF_N_T_P2_2D_CellWeight0[6]*PointValues[15] );
79 
80  /*
81  if(Cell)
82  {
83  if(Cell->GetVertex(0) > Cell->GetVertex(1))
84  Functionals[3] = -Functionals[3];
85  if(Cell->GetVertex(1) > Cell->GetVertex(2))
86  Functionals[4] = -Functionals[4];
87  if(Cell->GetVertex(2) > Cell->GetVertex(0))
88  Functionals[5] = -Functionals[5];
89  }
90  */
91 
92  if(Cell)
93  {
94  OwnNum = Coll->GetIndex(Cell);
95 
96  neigh = Cell->GetJoint(0)->GetNeighbour(Cell);
97  if(neigh)
98  {
99  NeighNum = Coll->GetIndex(neigh);
100  if(NeighNum < OwnNum)
101  Functionals[3] = -Functionals[3];
102  } // endif neigh
103 
104  neigh = Cell->GetJoint(1)->GetNeighbour(Cell);
105  if(neigh)
106  {
107  NeighNum = Coll->GetIndex(neigh);
108  if(NeighNum < OwnNum)
109  Functionals[ 4] = -Functionals[ 4];
110  } // endif neigh
111 
112  neigh = Cell->GetJoint(2)->GetNeighbour(Cell);
113  if(neigh)
114  {
115  NeighNum = Coll->GetIndex(neigh);
116  if(NeighNum < OwnNum)
117  Functionals[ 5] = -Functionals[ 5];
118  } // endif neigh
119  } // endif Cell
120 }
121 
122 void NF_N_T_P2_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint,
123  double *PointValues, double *Functionals)
124 {
125  int OwnNum, NeighNum;
126  TBaseCell *neigh;
127 
128  Functionals[0] = ( NF_N_T_P2_2D_EdgeWeight0[0]*PointValues[0]
129  +NF_N_T_P2_2D_EdgeWeight0[1]*PointValues[1]
130  +NF_N_T_P2_2D_EdgeWeight0[2]*PointValues[2]);
131 
132  Functionals[1] = ( NF_N_T_P2_2D_EdgeWeight1[0]*PointValues[0]
133  +NF_N_T_P2_2D_EdgeWeight1[1]*PointValues[1]
134  +NF_N_T_P2_2D_EdgeWeight1[2]*PointValues[2]);
135 
136  if(Joint != -1)
137  {
138  // if(Cell->GetVertex(Joint) > Cell->GetVertex((Joint+1)%3))
139  // Functionals[1] = -Functionals[1];
140  // /*
141  neigh = Cell->GetJoint(Joint)->GetNeighbour(Cell);
142  if(neigh)
143  {
144  OwnNum = Coll->GetIndex(Cell);
145  NeighNum = Coll->GetIndex(neigh);
146  if(NeighNum < OwnNum)
147  Functionals[1] = -Functionals[1];
148  } // endif neigh
149  // */
150  }
151 }
152 
153 /*
154  TNodalFunctional2D(NodalFunctional2D id,
155  int n_allfunctionals, int n_edgefunctionals,
156  int n_pointsall, int n_pointsedge,
157  double *xi, double *eta, double *t,
158  DoubleFunctVect *evalall,
159  DoubleFunctVect *evaledge);
160 */
161 
162 TNodalFunctional2D *NF_N_T_P2_2D_Obj = new TNodalFunctional2D
163  (NF_N_T_P2_2D, 7, 2, 16, 3, NF_N_T_P2_2D_Xi, NF_N_T_P2_2D_Eta,
164  NF_N_T_P2_2D_T, NF_N_T_P2_2D_EvalAll, NF_N_T_P2_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