ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_P1MOD_2D.h
1 static double NF_N_T_P1MOD_2D_Xi[] =
2  { 0.11270166537925831149, 0.5,
3  0.88729833462074168851,
4  0.88729833462074168851, 0.5,
5  0.11270166537925831149,
6  0, 0, 0 };
7 
8 static double NF_N_T_P1MOD_2D_Eta[] =
9  { 0, 0, 0,
10  0.11270166537925831149, 0.5,
11  0.88729833462074168851,
12  0.88729833462074168851, 0.5,
13  0.11270166537925831149 };
14 
15 static double NF_N_T_P1MOD_2D_T[] =
16  { -0.77459666924148337703585307995647992, 0,
17  0.77459666924148337703585307995647992 };
18 
19 void NF_N_T_P1MOD_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
20  double *Functionals)
21 {
22  int OwnNum, NeighNum;
23  TBaseCell *neigh;
24 
25  static double weights[]={ 0.27777777777777777777777777778,
26  0.44444444444444444444444444444,
27  0.27777777777777777777777777778 };
28 
29  Functionals[0] = weights[0]*PointValues[0]
30  +weights[1]*PointValues[1]
31  +weights[2]*PointValues[2];
32  Functionals[2] = weights[0]*PointValues[3]
33  +weights[1]*PointValues[4]
34  +weights[2]*PointValues[5];
35  Functionals[4] = weights[0]*PointValues[6]
36  +weights[1]*PointValues[7]
37  +weights[2]*PointValues[8];
38 
39  Functionals[1] = 60*( weights[0]*(NF_N_T_P1MOD_2D_Xi[0]-0.5)*PointValues[0]
40  +weights[1]*(NF_N_T_P1MOD_2D_Xi[1]-0.5)*PointValues[1]
41  +weights[2]*(NF_N_T_P1MOD_2D_Xi[2]-0.5)*PointValues[2]);
42  Functionals[3] = 60*( weights[0]*(NF_N_T_P1MOD_2D_Eta[3]-0.5)*PointValues[3]
43  +weights[1]*(NF_N_T_P1MOD_2D_Eta[4]-0.5)*PointValues[4]
44  +weights[2]*(NF_N_T_P1MOD_2D_Eta[5]-0.5)*PointValues[5]);
45  Functionals[5] = 60*( weights[0]*(0.5-NF_N_T_P1MOD_2D_Eta[6])*PointValues[6]
46  +weights[1]*(0.5-NF_N_T_P1MOD_2D_Eta[7])*PointValues[7]
47  +weights[2]*(0.5-NF_N_T_P1MOD_2D_Eta[8])*PointValues[8]);
48  /*
49  if(Cell)
50  {
51  if(Cell->GetVertex(0) > Cell->GetVertex(1))
52  Functionals[1] = -Functionals[1];
53  if(Cell->GetVertex(1) > Cell->GetVertex(2))
54  Functionals[3] = -Functionals[3];
55  if(Cell->GetVertex(2) > Cell->GetVertex(0))
56  Functionals[5] = -Functionals[5];
57  }
58  */
59 
60  if(Cell)
61  {
62  OwnNum = Coll->GetIndex(Cell);
63 
64  neigh = Cell->GetJoint(0)->GetNeighbour(Cell);
65  if(neigh)
66  {
67  NeighNum = Coll->GetIndex(neigh);
68  if(NeighNum < OwnNum)
69  Functionals[1] = -Functionals[1];
70  } // endif neigh
71 
72  neigh = Cell->GetJoint(1)->GetNeighbour(Cell);
73  if(neigh)
74  {
75  NeighNum = Coll->GetIndex(neigh);
76  if(NeighNum < OwnNum)
77  Functionals[3] = -Functionals[3];
78  } // endif neigh
79 
80  neigh = Cell->GetJoint(2)->GetNeighbour(Cell);
81  if(neigh)
82  {
83  NeighNum = Coll->GetIndex(neigh);
84  if(NeighNum < OwnNum)
85  Functionals[ 5] = -Functionals[ 5];
86  } // endif neigh
87  } // endif Cell
88 }
89 
90 void NF_N_T_P1MOD_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint,
91  double *PointValues, double *Functionals)
92 {
93  int OwnNum, NeighNum;
94  TBaseCell *neigh;
95 
96  static double weights[3]={ 0.27777777777777777777777777778,
97  0.44444444444444444444444444444,
98  0.27777777777777777777777777778 };
99 
100  Functionals[0] = weights[0]*PointValues[0]
101  +weights[1]*PointValues[1]
102  +weights[2]*PointValues[2];
103 
104  Functionals[1] = 60*( weights[0]*NF_N_T_P1MOD_2D_T[0]*PointValues[0]
105  +weights[1]*NF_N_T_P1MOD_2D_T[1]*PointValues[1]
106  +weights[2]*NF_N_T_P1MOD_2D_T[2]*PointValues[2])*0.5;
107 
108  if(Joint != -1)
109  {
110  // if(Cell->GetVertex(Joint) > Cell->GetVertex((Joint+1)%3))
111  // Functionals[1] = -Functionals[1];
112  // /*
113  neigh = Cell->GetJoint(Joint)->GetNeighbour(Cell);
114  if(neigh)
115  {
116  OwnNum = Coll->GetIndex(Cell);
117  NeighNum = Coll->GetIndex(neigh);
118  if(NeighNum < OwnNum)
119  Functionals[1] = -Functionals[1];
120  } // endif neigh
121  // */
122  }
123 }
124 
125 /*
126  TNodalFunctional2D(NodalFunctional2D id,
127  int n_allfunctionals, int n_edgefunctionals,
128  int B_T_Pointsall, int B_T_Pointsedge,
129  double *xi, double *eta, double *t,
130  DoubleFunctVect *evalall,
131  DoubleFunctVect *evaledge);
132 */
133 
134 TNodalFunctional2D *NF_N_T_P1MOD_2D_Obj = new TNodalFunctional2D
135  (NF_N_T_P1MOD_2D, 6, 2, 9, 3, NF_N_T_P1MOD_2D_Xi, NF_N_T_P1MOD_2D_Eta,
136  NF_N_T_P1MOD_2D_T, NF_N_T_P1MOD_2D_EvalAll, NF_N_T_P1MOD_2D_EvalEdge);
137 
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