ParMooN
 All Classes Functions Variables Friends Pages
BF_N_Q_BDM1_2D.h
1 // ***********************************************************************
2 // P1 BDM vector element, nonconforming , 2D
3 // History: 17.09.2013 implementation (Markus Wolff)
4 // ***********************************************************************
5 
6 // base function values
7 // vector function, orthogonal to edges,
8 // functions 1 and 2 are orthogonal to edge 1
9 // functions 3 and 4 are orthogonal to edge 2
10 // functions 5 and 6 are orthogonal to edge 3
11 // functions 7 and 8 are orthogonal to edge 4
12 
13 
14 // coefficient matrix for different choices of the degrees of freedom
15 // There seems to be no difference in using integral or point evaluation for
16 // inner dofs.
17 // The dofs on the edges determine the boundary conditions as well. Using
18 // Tschebyscheff-points might improve the boundary approximation.
19 
20 // NOTE: If you want to use other evaluation points for degress of freedom on
21 // the edges of a cell, you also have to change the evaluation points in NF_N_Q_BDM1_2D.h
22 
23 /*
24 // using equidistant points on edges
25 static double N_Q_BDM1_2D_CM[64] = {
26 -0.1875,0.1875,0.125,0.125,0.1875,-0.1875,-0.125,-0.125,
27 -0.125,-0.125,-0.1875,0.1875,0.125,0.125,0.1875,-0.1875,
28 -0,0,0.125,0.125,0,0,0.125,0.125,
29 0.375,-0.375,0,0,0.375,-0.375,0,0,
30 -0,0,-0.375,0.375,0,0,-0.375,0.375,
31 0.125,0.125,0,0,0.125,0.125,0,0,
32 0.1875,-0.1875,0,0,-0.1875,0.1875,0,0,
33 0,0,-0.1875,0.1875,0,0,0.1875,-0.1875
34 };*/
35 
36 /*
37 // using Gauss-Points on edges
38 static double N_Q_BDM1_2D_CM[64] = {
39 -0.10825318,0.10825318,0.125,0.125,0.10825318,-0.10825318,-0.125,-0.125,
40 -0.125,-0.125,-0.10825318,0.10825318,0.125,0.125,0.10825318,-0.10825318,
41 -0,0,0.125,0.125,0,0,0.125,0.125,
42 0.21650635,-0.21650635,0,0,0.21650635,-0.21650635,0,0,
43 -0,0,-0.21650635,0.21650635,0,0,-0.21650635,0.21650635,
44 0.125,0.125,0,0,0.125,0.125,0,0,
45 0.10825318,-0.10825318,0,0,-0.10825318,0.10825318,0,0,
46 0,0,-0.10825318,0.10825318,0,0,0.10825318,-0.10825318
47 };*/
48 
49 // using Tschebyscheff-points on edges
50 static double N_Q_BDM1_2D_CM[64] = {
51 -0.088388348,0.088388348,0.125,0.125,0.088388348,-0.088388348,-0.125,-0.125,
52 -0.125,-0.125,-0.088388348,0.088388348,0.125,0.125,0.088388348,-0.088388348,
53 -0,0,0.125,0.125,0,0,0.125,0.125,
54 0.1767767,-0.1767767,0,0,0.1767767,-0.1767767,0,0,
55 -0,0,-0.1767767,0.1767767,0,0,-0.1767767,0.1767767,
56 0.125,0.125,0,0,0.125,0.125,0,0,
57 0.088388348,-0.088388348,0,0,-0.088388348,0.088388348,0,0,
58 0,0,-0.088388348,0.088388348,0,0,0.088388348,-0.088388348
59 };
60 
61 static void N_Q_BDM1_2D_Funct(double xi, double eta, double *values)
62 {
63  int nBF = 8; // number of basis functions
64  // monomials x-component and y-component
65  double mon_x[]={1,0,xi,0 , eta, 0 , xi*xi , 2*xi*eta};
66  double mon_y[]={0,1,0 ,xi, 0 , eta, -2*xi*eta, -eta*eta};
67 
68  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
69  for(int i=0; i<nBF; i++)
70  {
71  for(int j=0; j<nBF; j++)
72  {
73  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
74  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
75  }
76  }
77 }
78 
79 // values of the derivatives in xi direction
80 static void N_Q_BDM1_2D_DeriveXi(double xi, double eta, double *values)
81 {
82  int nBF = 8; // number of basis functions
83  // xi-derivative of monomials x-component and y-component
84  double mon_x[]={0,0,1,0,0,0, 2*xi , 2*eta};
85  double mon_y[]={0,0,0,1,0,0,-2*eta, 0 };
86 
87  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
88  for(int i=0; i<nBF; i++)
89  {
90  for(int j=0; j<nBF; j++)
91  {
92  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
93  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
94  }
95  }
96 }
97 
98 // values of the derivatives in eta direction
99 static void N_Q_BDM1_2D_DeriveEta(double xi, double eta, double *values)
100 {
101  int nBF = 8; // number of basis functions
102  // eta-derivative of monomials x-component and y-component
103  double mon_x[]={0,0,0,0,1,0, 0 ,2*xi };
104  double mon_y[]={0,0,0,0,0,1,-2*xi ,-2*eta};
105 
106  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
107  for(int i=0; i<nBF; i++)
108  {
109  for(int j=0; j<nBF; j++)
110  {
111  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
112  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
113  }
114  }
115 }
116 
117 // values of derivatives in xi-xi direction
118 static void N_Q_BDM1_2D_DeriveXiXi(double xi, double eta, double *values)
119 {
120  int nBF = 8; // number of basis functions
121  // xi-derivative of monomials x-component and y-component
122  double mon_x[]={0,0,0,0,0,0,2,0};
123  double mon_y[]={0,0,0,0,0,0,0,0};
124 
125  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
126  for(int i=0; i<nBF; i++)
127  {
128  for(int j=0; j<nBF; j++)
129  {
130  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
131  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
132  }
133  }
134 }
135 
136 // values of derivatives in eta-eta direction
137 static void N_Q_BDM1_2D_DeriveEtaEta(double xi, double eta, double *values)
138 {
139  int nBF = 8; // number of basis functions
140  // eta-derivative of monomials x-component and y-component
141  double mon_x[]={0,0,0,0,0,0,0, 0};
142  double mon_y[]={0,0,0,0,0,0,0,-2};
143 
144  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
145  for(int i=0; i<nBF; i++)
146  {
147  for(int j=0; j<nBF; j++)
148  {
149  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
150  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
151  }
152  }
153 }
154 
155 // values of derivatives in xi-eta direction
156 static void N_Q_BDM1_2D_DeriveXiEta(double xi, double eta, double *values)
157 {
158  int nBF = 8; // number of basis functions
159  // eta-derivative of monomials x-component and y-component
160  double mon_x[]={0,0,0,0,0,0,0,2};
161  double mon_y[]={0,0,0,0,0,0,-2,0};
162 
163  memset(values, 0.0, 2*nBF*SizeOfDouble); // 2 is the space dimension
164  for(int i=0; i<nBF; i++)
165  {
166  for(int j=0; j<nBF; j++)
167  {
168  values[i ] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_x[j];
169  values[i+nBF] += N_Q_BDM1_2D_CM[i+j*nBF]*mon_y[j];
170  }
171  }
172 }
173 
174 // ***********************************************************************
175 
176 TBaseFunct2D *BF_N_Q_BDM1_2D_Obj = new TBaseFunct2D
177  (8, BF_N_Q_BDM1_2D, BFUnitSquare,
178  N_Q_BDM1_2D_Funct, N_Q_BDM1_2D_DeriveXi,
179  N_Q_BDM1_2D_DeriveEta, N_Q_BDM1_2D_DeriveXiXi,
180  N_Q_BDM1_2D_DeriveXiEta, N_Q_BDM1_2D_DeriveEtaEta, 6, 2,
181  0, NULL, 2);
Definition: BaseFunct2D.h:27