ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_RT3_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  used function names in this file must be unique in the entire program.
9  -> use the identifier as prefix
10 */
11 
12 static double NF_N_T_RT3_2D_Xi[] = {0};
13 static double NF_N_T_RT3_2D_Eta[] = {0};
14 // NOTE: If you want to use other evaluation points for degress of freedom on
15 // the edges of a cell, you also have to change basis functions in
16 // BF_N_T_RT3_2D.h
17 static double NF_N_T_RT3_2D_T[] = {-0.923879532511287, -0.382683432365090, 0.382683432365090, 0.923879532511287};//Tschebyscheff-points
18 
19 void NF_N_T_RT3_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 << "Raviart-Thomas elements of order 3 on triangles: "
38  << "Nodal functionals are not implemented properly!" << endl;
39  for(int i=0; i<16; i++)
40  Functionals[i] = PointValues[0];
41 
42 }
43 
44 void NF_N_T_RT3_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint,
45  double *PointValues, double *Functionals)
46 {
47 // this is needed for setting boundary conditions
48  /* the functionals
49  * int_Joint v.n q_1 and int_Joint v.n q_2 and int_Joint v.n q_3
50  * (q_1, q2 and q_3 are three linearly independent polynomials of degree 2)
51  * will be multiplied by the length of the Joint (edge). Otherwise one would
52  * ensure int_Joint v.n=PointValues[0].
53  * Example: If you would like to have u.n=1, then without multiplying by
54  * the edge length l would result in having int_Joint u.n=1 on each
55  * boundary edge. This would mean one gets u.n=1/l on that
56  * boundary. To avoid this, we introduce the factor l here.
57  * However I am not sure if this causes trouble elsewhere later.
58  * Be carefull!
59  * Ulrich Wilbrandt, 11.05.2012
60  */
61  double l; // length of joint
62  double x0,x1,y0,y1;
63  #ifdef __2D__
64  Cell->GetVertex(Joint)->GetCoords(x0,y0);
65  Cell->GetVertex((Joint+1)%3)->GetCoords(x1,y1);// 3=number of edges
66  #endif
67  l = sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
68  Functionals[0] = PointValues[0]*l;
69  Functionals[1] = PointValues[1]*l;
70  Functionals[2] = PointValues[2]*l;
71  Functionals[3] = PointValues[3]*l;
72 }
73 
74 TNodalFunctional2D *NF_N_T_RT3_2D_Obj = new TNodalFunctional2D
75  (NF_N_T_RT3_2D, 24, 4, 1, 4, NF_N_T_RT3_2D_Xi, NF_N_T_RT3_2D_Eta,
76  NF_N_T_RT3_2D_T, NF_N_T_RT3_2D_EvalAll, NF_N_T_RT3_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