ParMooN
 All Classes Functions Variables Friends Pages
NF_N_Q_RT1_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_RT1_2D_Xi[] = {-1/3, 1/3,1 ,1 ,1/3,-1/3,-1 ,-1 ,-1/3,1/3,1/3,-1/3 };
11 static double NF_N_Q_RT1_2D_Eta[] = {-1 ,-1 ,-1/3,1/3,1 , 1 , 1/3,-1/3, -1/3,-1/3,1/3,1/3 };
12 // NOTE: If you want to use other evaluation points for degress of freedom on
13 // the edges of a cell, you also have to change basis functions in
14 // BF_N_Q_RT1_2D.h
15 //static double NF_N_Q_RT1_2D_T[] = {-0.333333333333,0.3333333333333};// equidistant points
16 //static double NF_N_Q_RT1_2D_T[] = {-0.577350269189626,0.577350269189626};//Gauss-points
17 static double NF_N_Q_RT1_2D_T[] = {-0.707106781186547,0.707106781186547};//Tschebyscheff-points
18 
19 void NF_N_Q_RT1_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
20  double *Functionals)
21 {
22 // static double weights[3] = { 0.5555555555555555555555555555555556,
23 // 0.88888888888888888888888888888888889,
24 // 0.5555555555555555555555555555555556 };
25 // Functionals[0] = ( weights[0]*PointValues[0]
26 // +weights[1]*PointValues[1]
27 // +weights[2]*PointValues[2]) * 0.5;
28 // Functionals[1] = ( weights[0]*PointValues[3]
29 // +weights[1]*PointValues[4]
30 // +weights[2]*PointValues[5]) * 0.5;
31 // Functionals[2] = ( weights[0]*PointValues[6]
32 // +weights[1]*PointValues[7]
33 // +weights[2]*PointValues[8]) * 0.5;
34 // Functionals[3] = ( weights[0]*PointValues[9]
35 // +weights[1]*PointValues[10]
36 // +weights[2]*PointValues[11]) * 0.5;
37 cout << "Nodal functionals for first order Raviart-Thomas elements on "
38  << "rectangles are not yet corrctly implemented!" << endl;
39  Functionals[0] = PointValues[0];
40  Functionals[1] = PointValues[1];
41  Functionals[2] = PointValues[2];
42  Functionals[3] = PointValues[3];
43  Functionals[4] = PointValues[4];
44  Functionals[5] = PointValues[5];
45  Functionals[6] = PointValues[6];
46  Functionals[7] = PointValues[7];
47  Functionals[8] = PointValues[8];
48  Functionals[9] = PointValues[9];
49  Functionals[10]= PointValues[10];
50  Functionals[11]= PointValues[11];
51 
52 }
53 
54 void NF_N_Q_RT1_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint, double *PointValues,double *Functionals)
55 {
56  // this is needed for setting boundary conditions.
57  /* the functionals
58  * int_Joint v.n q_1 and int_Joint v.n q_2
59  * (q_1 and q_2 are two linearly independent polynomials of degree 1)
60  * will be multiplied by the length of the Joint (edge). Otherwise one would
61  * ensure int_Joint v.n=PointValues[0].
62  * Example: If you would like to have u.n=1, then without multiplying by
63  * the edge length l would result in having int_Joint u.n=1 on each
64  * boundary edge. This would mean one gets u.n=1/l on that
65  * boundary. To avoid this, we introduce the factor l here.
66  * However I am not sure if this causes trouble elsewhere later.
67  * Be carefull!
68  * Ulrich Wilbrandt, 11.05.2012
69  */
70  double l; // length of joint
71  double x0,x1,y0,y1;
72  #ifdef __2D__
73  Cell->GetVertex(Joint)->GetCoords(x0,y0);
74  Cell->GetVertex((Joint+1)%4)->GetCoords(x1,y1);// 4=number of edges
75  #endif
76  l = sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
77  Functionals[0] = PointValues[0]*l;
78  Functionals[1] = PointValues[1]*l;
79 }
80 
81 TNodalFunctional2D *NF_N_Q_RT1_2D_Obj = new TNodalFunctional2D
82  (NF_N_Q_RT1_2D, 12, 2, 12, 2, NF_N_Q_RT1_2D_Xi, NF_N_Q_RT1_2D_Eta,
83  NF_N_Q_RT1_2D_T, NF_N_Q_RT1_2D_EvalAll, NF_N_Q_RT1_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