ParMooN
 All Classes Functions Variables Friends Pages
NF_N_T_BDM1_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_BDM1_2D_Xi[] = { 1./3.,2./3.,2./3.,1./3.,0 , 0};
13 static double NF_N_T_BDM1_2D_Eta[] = { 0 ,0 ,1./3.,2./3.,2./3.,1./3.};
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_BDM1_2D.h
17 //static double NF_N_T_BDM1_2D_T[] = {-0.333333333333,0.3333333333333};// equidistant points
18 //static double NF_N_T_BDM1_2D_T[] = {-0.577350269189626,0.577350269189626};//Gauss-points
19 static double NF_N_T_BDM1_2D_T[] = {-0.707106781186547,0.707106781186547};//Tschebyscheff-points
20 
21 void NF_N_T_BDM1_2D_EvalAll(TCollection *Coll, TBaseCell *Cell, double *PointValues,
22  double *Functionals)
23 {
24 // static double weights[3] = { 0.5555555555555555555555555555555556,
25 // 0.88888888888888888888888888888888889,
26 // 0.5555555555555555555555555555555556 };
27 // Functionals[0] = ( weights[0]*PointValues[0]
28 // +weights[1]*PointValues[1]
29 // +weights[2]*PointValues[2]) * 0.5;
30 // Functionals[1] = ( weights[0]*PointValues[3]
31 // +weights[1]*PointValues[4]
32 // +weights[2]*PointValues[5]) * 0.5;
33 // Functionals[2] = ( weights[0]*PointValues[6]
34 // +weights[1]*PointValues[7]
35 // +weights[2]*PointValues[8]) * 0.5;
36 // Functionals[3] = ( weights[0]*PointValues[9]
37 // +weights[1]*PointValues[10]
38 // +weights[2]*PointValues[11]) * 0.5;
39 
40  Functionals[0] = PointValues[0];
41  Functionals[1] = PointValues[1];
42  Functionals[2] = PointValues[2];
43  Functionals[3] = PointValues[3];
44  Functionals[4] = PointValues[4];
45  Functionals[5] = PointValues[5];
46 
47 }
48 
49 void NF_N_T_BDM1_2D_EvalEdge(TCollection *Coll, TBaseCell *Cell, int Joint, double *PointValues,
50  double *Functionals)
51 {
52 // this is needed for setting boundary conditions
53  /* the functional
54  * int_Joint v.n
55  * will be multiplied by the length of the Joint (edge). Otherwise one would
56  * ensure int_Joint v.n=PointValues[0].
57  * Example: If you would like to have u.n=1, then without multiplying by
58  * the edge length l would result in having int_Joint u.n=1 on each
59  * boundary edge. This would mean one gets u.n=1/l on that
60  * boundary. To avoid this, we introduce the factor l here.
61  * However I am not sure if this causes trouble elsewhere later.
62  * Be carefull!
63  * Ulrich Wilbrandt, 11.05.2012
64  */
65  double l; // length of joint
66  double x0,x1,y0,y1;
67  #ifdef __2D__
68  Cell->GetVertex(Joint)->GetCoords(x0,y0);
69  Cell->GetVertex((Joint+1)%3)->GetCoords(x1,y1);// 3=number of edges
70  #endif
71  l = sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
72 
73  Functionals[0] = PointValues[0]*l;
74  Functionals[1] = PointValues[1]*l;
75 }
76 
77 TNodalFunctional2D *NF_N_T_BDM1_2D_Obj = new TNodalFunctional2D
78  (NF_N_T_BDM1_2D, 6, 2, 6, 2, NF_N_T_BDM1_2D_Xi, NF_N_T_BDM1_2D_Eta,
79  NF_N_T_BDM1_2D_T, NF_N_T_BDM1_2D_EvalAll, NF_N_T_BDM1_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