ParMooN
 All Classes Functions Variables Friends Pages
NF_N_Q_RT0_2D.h
1 /*
2  TNodalFunctional2D(NodalFunctional2D id,
3  int n_allfunctionals, int n_edgefunctionals,
4  int n_pointsall, int n_pointsedge,
5  double *xi, double *eta, double *t,
6  DoubleFunctVect *evalall,
7  DoubleFunctVect *evaledge);
8 */
9 
10 static double NF_N_Q_RT0_2D_Xi[4] = { 0, 1, 0, -1 };
11 static double NF_N_Q_RT0_2D_Eta[4] = {-1, 0, 1, 0 };
12 static double NF_N_Q_RT0_2D_T[2] = {0};
13 
14 void NF_N_Q_RT0_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
15  double *Functionals)
16 {
17 // static double weights[3] = { 0.5555555555555555555555555555555556,
18 // 0.88888888888888888888888888888888889,
19 // 0.5555555555555555555555555555555556 };
20 // Functionals[0] = ( weights[0]*PointValues[0]
21 // +weights[1]*PointValues[1]
22 // +weights[2]*PointValues[2]) * 0.5;
23 // Functionals[1] = ( weights[0]*PointValues[3]
24 // +weights[1]*PointValues[4]
25 // +weights[2]*PointValues[5]) * 0.5;
26 // Functionals[2] = ( weights[0]*PointValues[6]
27 // +weights[1]*PointValues[7]
28 // +weights[2]*PointValues[8]) * 0.5;
29 // Functionals[3] = ( weights[0]*PointValues[9]
30 // +weights[1]*PointValues[10]
31 // +weights[2]*PointValues[11]) * 0.5;
32 cout << "NF_N_Q_RT0_2D_EvalAll " << endl;
33  Functionals[0] = PointValues[0];
34  Functionals[1] = PointValues[1];
35  Functionals[2] = PointValues[2];
36  Functionals[3] = PointValues[3];
37 }
38 
39 void NF_N_Q_RT0_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint, double *PointValues,
40  double *Functionals)
41 {
42  // this is needed for setting boundary conditions
43  /* the functional
44  * int_Joint v.n
45  * will be multiplied by the length of the Joint (edge). Otherwise one would
46  * ensure int_Joint v.n=PointValues[0].
47  * Example: If you would like to have u.n=1, then without multiplying by
48  * the edge length l would result in having int_Joint u.n=1 on each
49  * boundary edge. This would mean one gets u.n=1/l on that
50  * boundary. To avoid this, we introduce the factor l here.
51  * However I am not sure if this causes trouble elsewhere later.
52  * Be carefull!
53  * Ulrich Wilbrandt, 11.05.2012
54  */
55  double l; // length of joint
56  double x0,x1,y0,y1;
57  #ifdef __2D__
58  Cell->GetVertex(Joint)->GetCoords(x0,y0);
59  Cell->GetVertex((Joint+1)%4)->GetCoords(x1,y1);// 4=number of edges
60  #endif
61  l = sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
62  Functionals[0] = PointValues[0]*l;
63 }
64 
65 TNodalFunctional2D *NF_N_Q_RT0_2D_Obj = new TNodalFunctional2D
66  (NF_N_Q_RT0_2D, 4, 1, 4, 1, NF_N_Q_RT0_2D_Xi, NF_N_Q_RT0_2D_Eta,
67  NF_N_Q_RT0_2D_T, NF_N_Q_RT0_2D_EvalAll, NF_N_Q_RT0_2D_EvalEdge);
store cells in an array, used by cell iterators
Definition: Collection.h:18
Definition: NodalFunctional2D.h:20
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