1
// This code conforms with the UFC specification version 1.4
2
// and was automatically generated by FFC version 0.9.0.
4
#ifndef __VECTORLAPLACEGRADCURL_H
5
#define __VECTORLAPLACEGRADCURL_H
12
/// This class defines the interface for a finite element.
14
class vectorlaplacegradcurl_finite_element_0: public ufc::finite_element
19
vectorlaplacegradcurl_finite_element_0() : ufc::finite_element()
25
virtual ~vectorlaplacegradcurl_finite_element_0()
30
/// Return a string identifying the finite element
31
virtual const char* signature() const
33
return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
36
/// Return the cell shape
37
virtual ufc::shape cell_shape() const
39
return ufc::tetrahedron;
42
/// Return the dimension of the finite element function space
43
virtual unsigned int space_dimension() const
48
/// Return the rank of the value space
49
virtual unsigned int value_rank() const
54
/// Return the dimension of the value space for axis i
55
virtual unsigned int value_dimension(unsigned int i) const
60
/// Evaluate basis function i at given point in cell
61
virtual void evaluate_basis(unsigned int i,
63
const double* coordinates,
64
const ufc::cell& c) const
66
// Extract vertex coordinates
67
const double * const * x = c.coordinates;
69
// Compute Jacobian of affine map from reference cell
70
const double J_00 = x[1][0] - x[0][0];
71
const double J_01 = x[2][0] - x[0][0];
72
const double J_02 = x[3][0] - x[0][0];
73
const double J_10 = x[1][1] - x[0][1];
74
const double J_11 = x[2][1] - x[0][1];
75
const double J_12 = x[3][1] - x[0][1];
76
const double J_20 = x[1][2] - x[0][2];
77
const double J_21 = x[2][2] - x[0][2];
78
const double J_22 = x[3][2] - x[0][2];
80
// Compute sub determinants
81
const double d_00 = J_11*J_22 - J_12*J_21;
82
const double d_01 = J_12*J_20 - J_10*J_22;
83
const double d_02 = J_10*J_21 - J_11*J_20;
84
const double d_10 = J_02*J_21 - J_01*J_22;
85
const double d_11 = J_00*J_22 - J_02*J_20;
86
const double d_12 = J_01*J_20 - J_00*J_21;
87
const double d_20 = J_01*J_12 - J_02*J_11;
88
const double d_21 = J_02*J_10 - J_00*J_12;
89
const double d_22 = J_00*J_11 - J_01*J_10;
91
// Compute determinant of Jacobian
92
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
94
// Compute inverse of Jacobian
97
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
98
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
99
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
101
// Get coordinates and map to the reference (FIAT) element
102
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
103
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
104
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
108
*values = 0.00000000;
110
// Map degree of freedom to element degree of freedom
111
const unsigned int dof = i;
113
// Array of basisvalues
114
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
116
// Declare helper variables
120
double tmp5 = 0.00000000;
121
double tmp6 = 0.00000000;
122
double tmp7 = 0.00000000;
123
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
124
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
125
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
126
double tmp3 = 0.50000000*(1.00000000 - Z);
127
double tmp4 = tmp3*tmp3;
129
// Compute basisvalues
130
basisvalues[0] = 1.00000000;
131
basisvalues[1] = tmp0;
132
for (unsigned int r = 1; r < 2; r++)
134
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
135
ss = r*(r + 1)*(r + 2)/6;
136
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
137
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
138
}// end loop over 'r'
139
for (unsigned int r = 0; r < 2; r++)
141
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
142
ss = r*(r + 1)*(r + 2)/6;
143
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
144
}// end loop over 'r'
145
for (unsigned int r = 0; r < 1; r++)
147
for (unsigned int s = 1; s < 2 - r; s++)
149
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
150
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
151
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
152
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
153
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
154
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
155
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
156
}// end loop over 's'
157
}// end loop over 'r'
158
for (unsigned int r = 0; r < 2; r++)
160
for (unsigned int s = 0; s < 2 - r; s++)
162
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
163
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
164
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
165
}// end loop over 's'
166
}// end loop over 'r'
167
for (unsigned int r = 0; r < 1; r++)
169
for (unsigned int s = 0; s < 1 - r; s++)
171
for (unsigned int t = 1; t < 2 - r - s; t++)
173
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
174
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
175
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
176
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
177
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
178
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
179
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
180
}// end loop over 't'
181
}// end loop over 's'
182
}// end loop over 'r'
183
for (unsigned int r = 0; r < 3; r++)
185
for (unsigned int s = 0; s < 3 - r; s++)
187
for (unsigned int t = 0; t < 3 - r - s; t++)
189
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
190
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
191
}// end loop over 't'
192
}// end loop over 's'
193
}// end loop over 'r'
195
// Table(s) of coefficients
196
static const double coefficients0[10][10] = \
197
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
198
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
199
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
200
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
201
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
202
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
203
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
204
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
205
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
206
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
209
for (unsigned int r = 0; r < 10; r++)
211
*values += coefficients0[dof][r]*basisvalues[r];
212
}// end loop over 'r'
215
/// Evaluate all basis functions at given point in cell
216
virtual void evaluate_basis_all(double* values,
217
const double* coordinates,
218
const ufc::cell& c) const
220
// Helper variable to hold values of a single dof.
221
double dof_values = 0.00000000;
223
// Loop dofs and call evaluate_basis.
224
for (unsigned int r = 0; r < 10; r++)
226
evaluate_basis(r, &dof_values, coordinates, c);
227
values[r] = dof_values;
228
}// end loop over 'r'
231
/// Evaluate order n derivatives of basis function i at given point in cell
232
virtual void evaluate_basis_derivatives(unsigned int i,
235
const double* coordinates,
236
const ufc::cell& c) const
238
// Extract vertex coordinates
239
const double * const * x = c.coordinates;
241
// Compute Jacobian of affine map from reference cell
242
const double J_00 = x[1][0] - x[0][0];
243
const double J_01 = x[2][0] - x[0][0];
244
const double J_02 = x[3][0] - x[0][0];
245
const double J_10 = x[1][1] - x[0][1];
246
const double J_11 = x[2][1] - x[0][1];
247
const double J_12 = x[3][1] - x[0][1];
248
const double J_20 = x[1][2] - x[0][2];
249
const double J_21 = x[2][2] - x[0][2];
250
const double J_22 = x[3][2] - x[0][2];
252
// Compute sub determinants
253
const double d_00 = J_11*J_22 - J_12*J_21;
254
const double d_01 = J_12*J_20 - J_10*J_22;
255
const double d_02 = J_10*J_21 - J_11*J_20;
256
const double d_10 = J_02*J_21 - J_01*J_22;
257
const double d_11 = J_00*J_22 - J_02*J_20;
258
const double d_12 = J_01*J_20 - J_00*J_21;
259
const double d_20 = J_01*J_12 - J_02*J_11;
260
const double d_21 = J_02*J_10 - J_00*J_12;
261
const double d_22 = J_00*J_11 - J_01*J_10;
263
// Compute determinant of Jacobian
264
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
266
// Compute inverse of Jacobian
267
const double K_00 = d_00 / detJ;
268
const double K_01 = d_10 / detJ;
269
const double K_02 = d_20 / detJ;
270
const double K_10 = d_01 / detJ;
271
const double K_11 = d_11 / detJ;
272
const double K_12 = d_21 / detJ;
273
const double K_20 = d_02 / detJ;
274
const double K_21 = d_12 / detJ;
275
const double K_22 = d_22 / detJ;
278
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
279
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
280
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
282
// Get coordinates and map to the reference (FIAT) element
283
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
284
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
285
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
288
// Compute number of derivatives.
289
unsigned int num_derivatives = 1;
291
for (unsigned int r = 0; r < n; r++)
293
num_derivatives *= 3;
294
}// end loop over 'r'
296
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
297
unsigned int **combinations = new unsigned int *[num_derivatives];
298
for (unsigned int row = 0; row < num_derivatives; row++)
300
combinations[row] = new unsigned int [n];
301
for (unsigned int col = 0; col < n; col++)
302
combinations[row][col] = 0;
305
// Generate combinations of derivatives
306
for (unsigned int row = 1; row < num_derivatives; row++)
308
for (unsigned int num = 0; num < row; num++)
310
for (unsigned int col = n-1; col+1 > 0; col--)
312
if (combinations[row][col] + 1 > 2)
313
combinations[row][col] = 0;
316
combinations[row][col] += 1;
323
// Compute inverse of Jacobian
324
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
326
// Declare transformation matrix
327
// Declare pointer to two dimensional array and initialise
328
double **transform = new double *[num_derivatives];
330
for (unsigned int j = 0; j < num_derivatives; j++)
332
transform[j] = new double [num_derivatives];
333
for (unsigned int k = 0; k < num_derivatives; k++)
337
// Construct transformation matrix
338
for (unsigned int row = 0; row < num_derivatives; row++)
340
for (unsigned int col = 0; col < num_derivatives; col++)
342
for (unsigned int k = 0; k < n; k++)
343
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
347
// Reset values. Assuming that values is always an array.
348
for (unsigned int r = 0; r < num_derivatives; r++)
350
values[r] = 0.00000000;
351
}// end loop over 'r'
353
// Map degree of freedom to element degree of freedom
354
const unsigned int dof = i;
356
// Array of basisvalues
357
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
359
// Declare helper variables
363
double tmp5 = 0.00000000;
364
double tmp6 = 0.00000000;
365
double tmp7 = 0.00000000;
366
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
367
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
368
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
369
double tmp3 = 0.50000000*(1.00000000 - Z);
370
double tmp4 = tmp3*tmp3;
372
// Compute basisvalues
373
basisvalues[0] = 1.00000000;
374
basisvalues[1] = tmp0;
375
for (unsigned int r = 1; r < 2; r++)
377
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
378
ss = r*(r + 1)*(r + 2)/6;
379
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
380
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
381
}// end loop over 'r'
382
for (unsigned int r = 0; r < 2; r++)
384
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
385
ss = r*(r + 1)*(r + 2)/6;
386
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
387
}// end loop over 'r'
388
for (unsigned int r = 0; r < 1; r++)
390
for (unsigned int s = 1; s < 2 - r; s++)
392
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
393
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
394
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
395
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
396
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
397
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
398
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
399
}// end loop over 's'
400
}// end loop over 'r'
401
for (unsigned int r = 0; r < 2; r++)
403
for (unsigned int s = 0; s < 2 - r; s++)
405
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
406
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
407
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
408
}// end loop over 's'
409
}// end loop over 'r'
410
for (unsigned int r = 0; r < 1; r++)
412
for (unsigned int s = 0; s < 1 - r; s++)
414
for (unsigned int t = 1; t < 2 - r - s; t++)
416
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
417
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
418
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
419
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
420
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
421
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
422
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
423
}// end loop over 't'
424
}// end loop over 's'
425
}// end loop over 'r'
426
for (unsigned int r = 0; r < 3; r++)
428
for (unsigned int s = 0; s < 3 - r; s++)
430
for (unsigned int t = 0; t < 3 - r - s; t++)
432
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
433
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
434
}// end loop over 't'
435
}// end loop over 's'
436
}// end loop over 'r'
438
// Table(s) of coefficients
439
static const double coefficients0[10][10] = \
440
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
441
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
442
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
443
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
444
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
445
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
446
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
447
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
448
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
449
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
451
// Tables of derivatives of the polynomial base (transpose).
452
static const double dmats0[10][10] = \
453
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
454
{6.32455532, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
455
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
456
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
457
{0.00000000, 11.22497216, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
458
{4.58257569, 0.00000000, 8.36660027, -1.18321596, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
459
{3.74165739, 0.00000000, 0.00000000, 8.69482605, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
460
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
461
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
462
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
464
static const double dmats1[10][10] = \
465
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
466
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
467
{5.47722558, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
468
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
469
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
470
{2.29128785, 7.24568837, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
471
{1.87082869, 0.00000000, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
472
{-2.64575131, 0.00000000, 9.66091783, 0.68313005, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
473
{3.24037035, 0.00000000, 0.00000000, 7.52994024, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
474
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
476
static const double dmats2[10][10] = \
477
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
478
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
479
{1.82574186, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
480
{5.16397779, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
481
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
482
{2.29128785, 1.44913767, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
483
{1.87082869, 7.09929574, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
484
{1.32287566, 0.00000000, 3.86436713, -0.34156503, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
485
{1.08012345, 0.00000000, 7.09929574, 2.50998008, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
486
{-3.81881308, 0.00000000, 0.00000000, 8.87411967, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
488
// Compute reference derivatives
489
// Declare pointer to array of derivatives on FIAT element
490
double *derivatives = new double [num_derivatives];
491
for (unsigned int r = 0; r < num_derivatives; r++)
493
derivatives[r] = 0.00000000;
494
}// end loop over 'r'
496
// Declare derivative matrix (of polynomial basis).
497
double dmats[10][10] = \
498
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
499
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
500
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
501
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
502
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
503
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
504
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
505
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
506
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
507
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
509
// Declare (auxiliary) derivative matrix (of polynomial basis).
510
double dmats_old[10][10] = \
511
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
512
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
513
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
514
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
515
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
516
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
517
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
518
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
519
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
520
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
522
// Loop possible derivatives.
523
for (unsigned int r = 0; r < num_derivatives; r++)
525
// Resetting dmats values to compute next derivative.
526
for (unsigned int t = 0; t < 10; t++)
528
for (unsigned int u = 0; u < 10; u++)
530
dmats[t][u] = 0.00000000;
533
dmats[t][u] = 1.00000000;
536
}// end loop over 'u'
537
}// end loop over 't'
539
// Looping derivative order to generate dmats.
540
for (unsigned int s = 0; s < n; s++)
542
// Updating dmats_old with new values and resetting dmats.
543
for (unsigned int t = 0; t < 10; t++)
545
for (unsigned int u = 0; u < 10; u++)
547
dmats_old[t][u] = dmats[t][u];
548
dmats[t][u] = 0.00000000;
549
}// end loop over 'u'
550
}// end loop over 't'
552
// Update dmats using an inner product.
553
if (combinations[r][s] == 0)
555
for (unsigned int t = 0; t < 10; t++)
557
for (unsigned int u = 0; u < 10; u++)
559
for (unsigned int tu = 0; tu < 10; tu++)
561
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
562
}// end loop over 'tu'
563
}// end loop over 'u'
564
}// end loop over 't'
567
if (combinations[r][s] == 1)
569
for (unsigned int t = 0; t < 10; t++)
571
for (unsigned int u = 0; u < 10; u++)
573
for (unsigned int tu = 0; tu < 10; tu++)
575
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
576
}// end loop over 'tu'
577
}// end loop over 'u'
578
}// end loop over 't'
581
if (combinations[r][s] == 2)
583
for (unsigned int t = 0; t < 10; t++)
585
for (unsigned int u = 0; u < 10; u++)
587
for (unsigned int tu = 0; tu < 10; tu++)
589
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
590
}// end loop over 'tu'
591
}// end loop over 'u'
592
}// end loop over 't'
595
}// end loop over 's'
596
for (unsigned int s = 0; s < 10; s++)
598
for (unsigned int t = 0; t < 10; t++)
600
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
601
}// end loop over 't'
602
}// end loop over 's'
603
}// end loop over 'r'
605
// Transform derivatives back to physical element
606
for (unsigned int row = 0; row < num_derivatives; row++)
608
for (unsigned int col = 0; col < num_derivatives; col++)
610
values[row] += transform[row][col]*derivatives[col];
614
// Delete pointer to array of derivatives on FIAT element
615
delete [] derivatives;
617
// Delete pointer to array of combinations of derivatives and transform
618
for (unsigned int r = 0; r < num_derivatives; r++)
620
delete [] combinations[r];
621
delete [] transform[r];
622
}// end loop over 'r'
623
delete [] combinations;
627
/// Evaluate order n derivatives of all basis functions at given point in cell
628
virtual void evaluate_basis_derivatives_all(unsigned int n,
630
const double* coordinates,
631
const ufc::cell& c) const
633
// Compute number of derivatives.
634
unsigned int num_derivatives = 1;
636
for (unsigned int r = 0; r < n; r++)
638
num_derivatives *= 3;
639
}// end loop over 'r'
641
// Helper variable to hold values of a single dof.
642
double *dof_values = new double [num_derivatives];
643
for (unsigned int r = 0; r < num_derivatives; r++)
645
dof_values[r] = 0.00000000;
646
}// end loop over 'r'
648
// Loop dofs and call evaluate_basis_derivatives.
649
for (unsigned int r = 0; r < 10; r++)
651
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
652
for (unsigned int s = 0; s < num_derivatives; s++)
654
values[r*num_derivatives + s] = dof_values[s];
655
}// end loop over 's'
656
}// end loop over 'r'
659
delete [] dof_values;
662
/// Evaluate linear functional for dof i on the function f
663
virtual double evaluate_dof(unsigned int i,
664
const ufc::function& f,
665
const ufc::cell& c) const
667
// Declare variables for result of evaluation
670
// Declare variable for physical coordinates
673
const double * const * x = c.coordinates;
681
f.evaluate(vals, y, c);
690
f.evaluate(vals, y, c);
699
f.evaluate(vals, y, c);
708
f.evaluate(vals, y, c);
714
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
715
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
716
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
717
f.evaluate(vals, y, c);
723
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
724
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
725
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
726
f.evaluate(vals, y, c);
732
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
733
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
734
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
735
f.evaluate(vals, y, c);
741
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
742
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
743
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
744
f.evaluate(vals, y, c);
750
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
751
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
752
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
753
f.evaluate(vals, y, c);
759
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
760
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
761
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
762
f.evaluate(vals, y, c);
771
/// Evaluate linear functionals for all dofs on the function f
772
virtual void evaluate_dofs(double* values,
773
const ufc::function& f,
774
const ufc::cell& c) const
776
// Declare variables for result of evaluation
779
// Declare variable for physical coordinates
782
const double * const * x = c.coordinates;
786
f.evaluate(vals, y, c);
791
f.evaluate(vals, y, c);
796
f.evaluate(vals, y, c);
801
f.evaluate(vals, y, c);
803
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
804
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
805
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
806
f.evaluate(vals, y, c);
808
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
809
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
810
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
811
f.evaluate(vals, y, c);
813
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
814
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
815
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
816
f.evaluate(vals, y, c);
818
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
819
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
820
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
821
f.evaluate(vals, y, c);
823
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
824
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
825
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
826
f.evaluate(vals, y, c);
828
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
829
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
830
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
831
f.evaluate(vals, y, c);
835
/// Interpolate vertex values from dof values
836
virtual void interpolate_vertex_values(double* vertex_values,
837
const double* dof_values,
838
const ufc::cell& c) const
840
// Evaluate function and change variables
841
vertex_values[0] = dof_values[0];
842
vertex_values[1] = dof_values[1];
843
vertex_values[2] = dof_values[2];
844
vertex_values[3] = dof_values[3];
847
/// Return the number of sub elements (for a mixed element)
848
virtual unsigned int num_sub_elements() const
853
/// Create a new finite element for sub element i (for a mixed element)
854
virtual ufc::finite_element* create_sub_element(unsigned int i) const
861
/// This class defines the interface for a finite element.
863
class vectorlaplacegradcurl_finite_element_1: public ufc::finite_element
868
vectorlaplacegradcurl_finite_element_1() : ufc::finite_element()
874
virtual ~vectorlaplacegradcurl_finite_element_1()
879
/// Return a string identifying the finite element
880
virtual const char* signature() const
882
return "VectorElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2, 3)";
885
/// Return the cell shape
886
virtual ufc::shape cell_shape() const
888
return ufc::tetrahedron;
891
/// Return the dimension of the finite element function space
892
virtual unsigned int space_dimension() const
897
/// Return the rank of the value space
898
virtual unsigned int value_rank() const
903
/// Return the dimension of the value space for axis i
904
virtual unsigned int value_dimension(unsigned int i) const
918
/// Evaluate basis function i at given point in cell
919
virtual void evaluate_basis(unsigned int i,
921
const double* coordinates,
922
const ufc::cell& c) const
924
// Extract vertex coordinates
925
const double * const * x = c.coordinates;
927
// Compute Jacobian of affine map from reference cell
928
const double J_00 = x[1][0] - x[0][0];
929
const double J_01 = x[2][0] - x[0][0];
930
const double J_02 = x[3][0] - x[0][0];
931
const double J_10 = x[1][1] - x[0][1];
932
const double J_11 = x[2][1] - x[0][1];
933
const double J_12 = x[3][1] - x[0][1];
934
const double J_20 = x[1][2] - x[0][2];
935
const double J_21 = x[2][2] - x[0][2];
936
const double J_22 = x[3][2] - x[0][2];
938
// Compute sub determinants
939
const double d_00 = J_11*J_22 - J_12*J_21;
940
const double d_01 = J_12*J_20 - J_10*J_22;
941
const double d_02 = J_10*J_21 - J_11*J_20;
942
const double d_10 = J_02*J_21 - J_01*J_22;
943
const double d_11 = J_00*J_22 - J_02*J_20;
944
const double d_12 = J_01*J_20 - J_00*J_21;
945
const double d_20 = J_01*J_12 - J_02*J_11;
946
const double d_21 = J_02*J_10 - J_00*J_12;
947
const double d_22 = J_00*J_11 - J_01*J_10;
949
// Compute determinant of Jacobian
950
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
952
// Compute inverse of Jacobian
955
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
956
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
957
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
959
// Get coordinates and map to the reference (FIAT) element
960
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
961
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
962
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
966
values[0] = 0.00000000;
967
values[1] = 0.00000000;
968
values[2] = 0.00000000;
969
if (0 <= i && i <= 9)
971
// Map degree of freedom to element degree of freedom
972
const unsigned int dof = i;
974
// Array of basisvalues
975
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
977
// Declare helper variables
981
double tmp5 = 0.00000000;
982
double tmp6 = 0.00000000;
983
double tmp7 = 0.00000000;
984
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
985
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
986
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
987
double tmp3 = 0.50000000*(1.00000000 - Z);
988
double tmp4 = tmp3*tmp3;
990
// Compute basisvalues
991
basisvalues[0] = 1.00000000;
992
basisvalues[1] = tmp0;
993
for (unsigned int r = 1; r < 2; r++)
995
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
996
ss = r*(r + 1)*(r + 2)/6;
997
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
998
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
999
}// end loop over 'r'
1000
for (unsigned int r = 0; r < 2; r++)
1002
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
1003
ss = r*(r + 1)*(r + 2)/6;
1004
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
1005
}// end loop over 'r'
1006
for (unsigned int r = 0; r < 1; r++)
1008
for (unsigned int s = 1; s < 2 - r; s++)
1010
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
1011
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1012
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
1013
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1014
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1015
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1016
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
1017
}// end loop over 's'
1018
}// end loop over 'r'
1019
for (unsigned int r = 0; r < 2; r++)
1021
for (unsigned int s = 0; s < 2 - r; s++)
1023
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
1024
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1025
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
1026
}// end loop over 's'
1027
}// end loop over 'r'
1028
for (unsigned int r = 0; r < 1; r++)
1030
for (unsigned int s = 0; s < 1 - r; s++)
1032
for (unsigned int t = 1; t < 2 - r - s; t++)
1034
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
1035
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1036
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
1037
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1038
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1039
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1040
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
1041
}// end loop over 't'
1042
}// end loop over 's'
1043
}// end loop over 'r'
1044
for (unsigned int r = 0; r < 3; r++)
1046
for (unsigned int s = 0; s < 3 - r; s++)
1048
for (unsigned int t = 0; t < 3 - r - s; t++)
1050
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1051
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
1052
}// end loop over 't'
1053
}// end loop over 's'
1054
}// end loop over 'r'
1056
// Table(s) of coefficients
1057
static const double coefficients0[10][10] = \
1058
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
1059
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
1060
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
1061
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
1062
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
1063
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
1064
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
1065
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
1066
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
1067
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
1069
// Compute value(s).
1070
for (unsigned int r = 0; r < 10; r++)
1072
values[0] += coefficients0[dof][r]*basisvalues[r];
1073
}// end loop over 'r'
1076
if (10 <= i && i <= 19)
1078
// Map degree of freedom to element degree of freedom
1079
const unsigned int dof = i - 10;
1081
// Array of basisvalues
1082
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
1084
// Declare helper variables
1085
unsigned int rr = 0;
1086
unsigned int ss = 0;
1087
unsigned int tt = 0;
1088
double tmp5 = 0.00000000;
1089
double tmp6 = 0.00000000;
1090
double tmp7 = 0.00000000;
1091
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
1092
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
1093
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
1094
double tmp3 = 0.50000000*(1.00000000 - Z);
1095
double tmp4 = tmp3*tmp3;
1097
// Compute basisvalues
1098
basisvalues[0] = 1.00000000;
1099
basisvalues[1] = tmp0;
1100
for (unsigned int r = 1; r < 2; r++)
1102
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
1103
ss = r*(r + 1)*(r + 2)/6;
1104
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
1105
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
1106
}// end loop over 'r'
1107
for (unsigned int r = 0; r < 2; r++)
1109
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
1110
ss = r*(r + 1)*(r + 2)/6;
1111
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
1112
}// end loop over 'r'
1113
for (unsigned int r = 0; r < 1; r++)
1115
for (unsigned int s = 1; s < 2 - r; s++)
1117
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
1118
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1119
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
1120
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1121
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1122
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1123
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
1124
}// end loop over 's'
1125
}// end loop over 'r'
1126
for (unsigned int r = 0; r < 2; r++)
1128
for (unsigned int s = 0; s < 2 - r; s++)
1130
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
1131
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1132
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
1133
}// end loop over 's'
1134
}// end loop over 'r'
1135
for (unsigned int r = 0; r < 1; r++)
1137
for (unsigned int s = 0; s < 1 - r; s++)
1139
for (unsigned int t = 1; t < 2 - r - s; t++)
1141
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
1142
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1143
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
1144
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1145
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1146
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1147
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
1148
}// end loop over 't'
1149
}// end loop over 's'
1150
}// end loop over 'r'
1151
for (unsigned int r = 0; r < 3; r++)
1153
for (unsigned int s = 0; s < 3 - r; s++)
1155
for (unsigned int t = 0; t < 3 - r - s; t++)
1157
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1158
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
1159
}// end loop over 't'
1160
}// end loop over 's'
1161
}// end loop over 'r'
1163
// Table(s) of coefficients
1164
static const double coefficients0[10][10] = \
1165
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
1166
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
1167
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
1168
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
1169
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
1170
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
1171
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
1172
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
1173
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
1174
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
1176
// Compute value(s).
1177
for (unsigned int r = 0; r < 10; r++)
1179
values[1] += coefficients0[dof][r]*basisvalues[r];
1180
}// end loop over 'r'
1183
if (20 <= i && i <= 29)
1185
// Map degree of freedom to element degree of freedom
1186
const unsigned int dof = i - 20;
1188
// Array of basisvalues
1189
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
1191
// Declare helper variables
1192
unsigned int rr = 0;
1193
unsigned int ss = 0;
1194
unsigned int tt = 0;
1195
double tmp5 = 0.00000000;
1196
double tmp6 = 0.00000000;
1197
double tmp7 = 0.00000000;
1198
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
1199
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
1200
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
1201
double tmp3 = 0.50000000*(1.00000000 - Z);
1202
double tmp4 = tmp3*tmp3;
1204
// Compute basisvalues
1205
basisvalues[0] = 1.00000000;
1206
basisvalues[1] = tmp0;
1207
for (unsigned int r = 1; r < 2; r++)
1209
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
1210
ss = r*(r + 1)*(r + 2)/6;
1211
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
1212
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
1213
}// end loop over 'r'
1214
for (unsigned int r = 0; r < 2; r++)
1216
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
1217
ss = r*(r + 1)*(r + 2)/6;
1218
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
1219
}// end loop over 'r'
1220
for (unsigned int r = 0; r < 1; r++)
1222
for (unsigned int s = 1; s < 2 - r; s++)
1224
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
1225
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1226
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
1227
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1228
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1229
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1230
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
1231
}// end loop over 's'
1232
}// end loop over 'r'
1233
for (unsigned int r = 0; r < 2; r++)
1235
for (unsigned int s = 0; s < 2 - r; s++)
1237
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
1238
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1239
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
1240
}// end loop over 's'
1241
}// end loop over 'r'
1242
for (unsigned int r = 0; r < 1; r++)
1244
for (unsigned int s = 0; s < 1 - r; s++)
1246
for (unsigned int t = 1; t < 2 - r - s; t++)
1248
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
1249
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1250
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
1251
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1252
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1253
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1254
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
1255
}// end loop over 't'
1256
}// end loop over 's'
1257
}// end loop over 'r'
1258
for (unsigned int r = 0; r < 3; r++)
1260
for (unsigned int s = 0; s < 3 - r; s++)
1262
for (unsigned int t = 0; t < 3 - r - s; t++)
1264
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1265
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
1266
}// end loop over 't'
1267
}// end loop over 's'
1268
}// end loop over 'r'
1270
// Table(s) of coefficients
1271
static const double coefficients0[10][10] = \
1272
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
1273
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
1274
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
1275
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
1276
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
1277
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
1278
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
1279
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
1280
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
1281
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
1283
// Compute value(s).
1284
for (unsigned int r = 0; r < 10; r++)
1286
values[2] += coefficients0[dof][r]*basisvalues[r];
1287
}// end loop over 'r'
1292
/// Evaluate all basis functions at given point in cell
1293
virtual void evaluate_basis_all(double* values,
1294
const double* coordinates,
1295
const ufc::cell& c) const
1297
// Helper variable to hold values of a single dof.
1298
double dof_values[3] = {0.00000000, 0.00000000, 0.00000000};
1300
// Loop dofs and call evaluate_basis.
1301
for (unsigned int r = 0; r < 30; r++)
1303
evaluate_basis(r, dof_values, coordinates, c);
1304
for (unsigned int s = 0; s < 3; s++)
1306
values[r*3 + s] = dof_values[s];
1307
}// end loop over 's'
1308
}// end loop over 'r'
1311
/// Evaluate order n derivatives of basis function i at given point in cell
1312
virtual void evaluate_basis_derivatives(unsigned int i,
1315
const double* coordinates,
1316
const ufc::cell& c) const
1318
// Extract vertex coordinates
1319
const double * const * x = c.coordinates;
1321
// Compute Jacobian of affine map from reference cell
1322
const double J_00 = x[1][0] - x[0][0];
1323
const double J_01 = x[2][0] - x[0][0];
1324
const double J_02 = x[3][0] - x[0][0];
1325
const double J_10 = x[1][1] - x[0][1];
1326
const double J_11 = x[2][1] - x[0][1];
1327
const double J_12 = x[3][1] - x[0][1];
1328
const double J_20 = x[1][2] - x[0][2];
1329
const double J_21 = x[2][2] - x[0][2];
1330
const double J_22 = x[3][2] - x[0][2];
1332
// Compute sub determinants
1333
const double d_00 = J_11*J_22 - J_12*J_21;
1334
const double d_01 = J_12*J_20 - J_10*J_22;
1335
const double d_02 = J_10*J_21 - J_11*J_20;
1336
const double d_10 = J_02*J_21 - J_01*J_22;
1337
const double d_11 = J_00*J_22 - J_02*J_20;
1338
const double d_12 = J_01*J_20 - J_00*J_21;
1339
const double d_20 = J_01*J_12 - J_02*J_11;
1340
const double d_21 = J_02*J_10 - J_00*J_12;
1341
const double d_22 = J_00*J_11 - J_01*J_10;
1343
// Compute determinant of Jacobian
1344
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
1346
// Compute inverse of Jacobian
1347
const double K_00 = d_00 / detJ;
1348
const double K_01 = d_10 / detJ;
1349
const double K_02 = d_20 / detJ;
1350
const double K_10 = d_01 / detJ;
1351
const double K_11 = d_11 / detJ;
1352
const double K_12 = d_21 / detJ;
1353
const double K_20 = d_02 / detJ;
1354
const double K_21 = d_12 / detJ;
1355
const double K_22 = d_22 / detJ;
1357
// Compute constants
1358
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
1359
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
1360
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
1362
// Get coordinates and map to the reference (FIAT) element
1363
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
1364
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
1365
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
1368
// Compute number of derivatives.
1369
unsigned int num_derivatives = 1;
1371
for (unsigned int r = 0; r < n; r++)
1373
num_derivatives *= 3;
1374
}// end loop over 'r'
1376
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
1377
unsigned int **combinations = new unsigned int *[num_derivatives];
1378
for (unsigned int row = 0; row < num_derivatives; row++)
1380
combinations[row] = new unsigned int [n];
1381
for (unsigned int col = 0; col < n; col++)
1382
combinations[row][col] = 0;
1385
// Generate combinations of derivatives
1386
for (unsigned int row = 1; row < num_derivatives; row++)
1388
for (unsigned int num = 0; num < row; num++)
1390
for (unsigned int col = n-1; col+1 > 0; col--)
1392
if (combinations[row][col] + 1 > 2)
1393
combinations[row][col] = 0;
1396
combinations[row][col] += 1;
1403
// Compute inverse of Jacobian
1404
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
1406
// Declare transformation matrix
1407
// Declare pointer to two dimensional array and initialise
1408
double **transform = new double *[num_derivatives];
1410
for (unsigned int j = 0; j < num_derivatives; j++)
1412
transform[j] = new double [num_derivatives];
1413
for (unsigned int k = 0; k < num_derivatives; k++)
1414
transform[j][k] = 1;
1417
// Construct transformation matrix
1418
for (unsigned int row = 0; row < num_derivatives; row++)
1420
for (unsigned int col = 0; col < num_derivatives; col++)
1422
for (unsigned int k = 0; k < n; k++)
1423
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
1427
// Reset values. Assuming that values is always an array.
1428
for (unsigned int r = 0; r < 3*num_derivatives; r++)
1430
values[r] = 0.00000000;
1431
}// end loop over 'r'
1433
if (0 <= i && i <= 9)
1435
// Map degree of freedom to element degree of freedom
1436
const unsigned int dof = i;
1438
// Array of basisvalues
1439
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
1441
// Declare helper variables
1442
unsigned int rr = 0;
1443
unsigned int ss = 0;
1444
unsigned int tt = 0;
1445
double tmp5 = 0.00000000;
1446
double tmp6 = 0.00000000;
1447
double tmp7 = 0.00000000;
1448
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
1449
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
1450
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
1451
double tmp3 = 0.50000000*(1.00000000 - Z);
1452
double tmp4 = tmp3*tmp3;
1454
// Compute basisvalues
1455
basisvalues[0] = 1.00000000;
1456
basisvalues[1] = tmp0;
1457
for (unsigned int r = 1; r < 2; r++)
1459
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
1460
ss = r*(r + 1)*(r + 2)/6;
1461
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
1462
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
1463
}// end loop over 'r'
1464
for (unsigned int r = 0; r < 2; r++)
1466
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
1467
ss = r*(r + 1)*(r + 2)/6;
1468
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
1469
}// end loop over 'r'
1470
for (unsigned int r = 0; r < 1; r++)
1472
for (unsigned int s = 1; s < 2 - r; s++)
1474
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
1475
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1476
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
1477
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1478
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1479
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1480
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
1481
}// end loop over 's'
1482
}// end loop over 'r'
1483
for (unsigned int r = 0; r < 2; r++)
1485
for (unsigned int s = 0; s < 2 - r; s++)
1487
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
1488
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1489
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
1490
}// end loop over 's'
1491
}// end loop over 'r'
1492
for (unsigned int r = 0; r < 1; r++)
1494
for (unsigned int s = 0; s < 1 - r; s++)
1496
for (unsigned int t = 1; t < 2 - r - s; t++)
1498
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
1499
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1500
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
1501
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1502
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1503
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1504
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
1505
}// end loop over 't'
1506
}// end loop over 's'
1507
}// end loop over 'r'
1508
for (unsigned int r = 0; r < 3; r++)
1510
for (unsigned int s = 0; s < 3 - r; s++)
1512
for (unsigned int t = 0; t < 3 - r - s; t++)
1514
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1515
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
1516
}// end loop over 't'
1517
}// end loop over 's'
1518
}// end loop over 'r'
1520
// Table(s) of coefficients
1521
static const double coefficients0[10][10] = \
1522
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
1523
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
1524
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
1525
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
1526
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
1527
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
1528
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
1529
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
1530
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
1531
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
1533
// Tables of derivatives of the polynomial base (transpose).
1534
static const double dmats0[10][10] = \
1535
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1536
{6.32455532, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1537
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1538
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1539
{0.00000000, 11.22497216, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1540
{4.58257569, 0.00000000, 8.36660027, -1.18321596, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1541
{3.74165739, 0.00000000, 0.00000000, 8.69482605, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1542
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1543
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1544
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1546
static const double dmats1[10][10] = \
1547
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1548
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1549
{5.47722558, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1550
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1551
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1552
{2.29128785, 7.24568837, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1553
{1.87082869, 0.00000000, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1554
{-2.64575131, 0.00000000, 9.66091783, 0.68313005, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1555
{3.24037035, 0.00000000, 0.00000000, 7.52994024, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1556
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1558
static const double dmats2[10][10] = \
1559
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1560
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1561
{1.82574186, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1562
{5.16397779, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1563
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1564
{2.29128785, 1.44913767, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1565
{1.87082869, 7.09929574, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1566
{1.32287566, 0.00000000, 3.86436713, -0.34156503, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1567
{1.08012345, 0.00000000, 7.09929574, 2.50998008, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1568
{-3.81881308, 0.00000000, 0.00000000, 8.87411967, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1570
// Compute reference derivatives
1571
// Declare pointer to array of derivatives on FIAT element
1572
double *derivatives = new double [num_derivatives];
1573
for (unsigned int r = 0; r < num_derivatives; r++)
1575
derivatives[r] = 0.00000000;
1576
}// end loop over 'r'
1578
// Declare derivative matrix (of polynomial basis).
1579
double dmats[10][10] = \
1580
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1581
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1582
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1583
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1584
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1585
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1586
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
1587
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
1588
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
1589
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
1591
// Declare (auxiliary) derivative matrix (of polynomial basis).
1592
double dmats_old[10][10] = \
1593
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1594
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1595
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1596
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1597
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1598
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1599
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
1600
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
1601
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
1602
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
1604
// Loop possible derivatives.
1605
for (unsigned int r = 0; r < num_derivatives; r++)
1607
// Resetting dmats values to compute next derivative.
1608
for (unsigned int t = 0; t < 10; t++)
1610
for (unsigned int u = 0; u < 10; u++)
1612
dmats[t][u] = 0.00000000;
1615
dmats[t][u] = 1.00000000;
1618
}// end loop over 'u'
1619
}// end loop over 't'
1621
// Looping derivative order to generate dmats.
1622
for (unsigned int s = 0; s < n; s++)
1624
// Updating dmats_old with new values and resetting dmats.
1625
for (unsigned int t = 0; t < 10; t++)
1627
for (unsigned int u = 0; u < 10; u++)
1629
dmats_old[t][u] = dmats[t][u];
1630
dmats[t][u] = 0.00000000;
1631
}// end loop over 'u'
1632
}// end loop over 't'
1634
// Update dmats using an inner product.
1635
if (combinations[r][s] == 0)
1637
for (unsigned int t = 0; t < 10; t++)
1639
for (unsigned int u = 0; u < 10; u++)
1641
for (unsigned int tu = 0; tu < 10; tu++)
1643
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1644
}// end loop over 'tu'
1645
}// end loop over 'u'
1646
}// end loop over 't'
1649
if (combinations[r][s] == 1)
1651
for (unsigned int t = 0; t < 10; t++)
1653
for (unsigned int u = 0; u < 10; u++)
1655
for (unsigned int tu = 0; tu < 10; tu++)
1657
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1658
}// end loop over 'tu'
1659
}// end loop over 'u'
1660
}// end loop over 't'
1663
if (combinations[r][s] == 2)
1665
for (unsigned int t = 0; t < 10; t++)
1667
for (unsigned int u = 0; u < 10; u++)
1669
for (unsigned int tu = 0; tu < 10; tu++)
1671
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
1672
}// end loop over 'tu'
1673
}// end loop over 'u'
1674
}// end loop over 't'
1677
}// end loop over 's'
1678
for (unsigned int s = 0; s < 10; s++)
1680
for (unsigned int t = 0; t < 10; t++)
1682
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
1683
}// end loop over 't'
1684
}// end loop over 's'
1685
}// end loop over 'r'
1687
// Transform derivatives back to physical element
1688
for (unsigned int row = 0; row < num_derivatives; row++)
1690
for (unsigned int col = 0; col < num_derivatives; col++)
1692
values[row] += transform[row][col]*derivatives[col];
1696
// Delete pointer to array of derivatives on FIAT element
1697
delete [] derivatives;
1699
// Delete pointer to array of combinations of derivatives and transform
1700
for (unsigned int r = 0; r < num_derivatives; r++)
1702
delete [] combinations[r];
1703
delete [] transform[r];
1704
}// end loop over 'r'
1705
delete [] combinations;
1706
delete [] transform;
1709
if (10 <= i && i <= 19)
1711
// Map degree of freedom to element degree of freedom
1712
const unsigned int dof = i - 10;
1714
// Array of basisvalues
1715
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
1717
// Declare helper variables
1718
unsigned int rr = 0;
1719
unsigned int ss = 0;
1720
unsigned int tt = 0;
1721
double tmp5 = 0.00000000;
1722
double tmp6 = 0.00000000;
1723
double tmp7 = 0.00000000;
1724
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
1725
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
1726
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
1727
double tmp3 = 0.50000000*(1.00000000 - Z);
1728
double tmp4 = tmp3*tmp3;
1730
// Compute basisvalues
1731
basisvalues[0] = 1.00000000;
1732
basisvalues[1] = tmp0;
1733
for (unsigned int r = 1; r < 2; r++)
1735
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
1736
ss = r*(r + 1)*(r + 2)/6;
1737
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
1738
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
1739
}// end loop over 'r'
1740
for (unsigned int r = 0; r < 2; r++)
1742
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
1743
ss = r*(r + 1)*(r + 2)/6;
1744
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
1745
}// end loop over 'r'
1746
for (unsigned int r = 0; r < 1; r++)
1748
for (unsigned int s = 1; s < 2 - r; s++)
1750
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
1751
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1752
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
1753
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1754
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1755
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
1756
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
1757
}// end loop over 's'
1758
}// end loop over 'r'
1759
for (unsigned int r = 0; r < 2; r++)
1761
for (unsigned int s = 0; s < 2 - r; s++)
1763
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
1764
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
1765
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
1766
}// end loop over 's'
1767
}// end loop over 'r'
1768
for (unsigned int r = 0; r < 1; r++)
1770
for (unsigned int s = 0; s < 1 - r; s++)
1772
for (unsigned int t = 1; t < 2 - r - s; t++)
1774
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
1775
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1776
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
1777
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1778
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1779
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
1780
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
1781
}// end loop over 't'
1782
}// end loop over 's'
1783
}// end loop over 'r'
1784
for (unsigned int r = 0; r < 3; r++)
1786
for (unsigned int s = 0; s < 3 - r; s++)
1788
for (unsigned int t = 0; t < 3 - r - s; t++)
1790
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
1791
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
1792
}// end loop over 't'
1793
}// end loop over 's'
1794
}// end loop over 'r'
1796
// Table(s) of coefficients
1797
static const double coefficients0[10][10] = \
1798
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
1799
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
1800
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
1801
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
1802
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
1803
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
1804
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
1805
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
1806
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
1807
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
1809
// Tables of derivatives of the polynomial base (transpose).
1810
static const double dmats0[10][10] = \
1811
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1812
{6.32455532, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1813
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1814
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1815
{0.00000000, 11.22497216, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1816
{4.58257569, 0.00000000, 8.36660027, -1.18321596, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1817
{3.74165739, 0.00000000, 0.00000000, 8.69482605, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1818
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1819
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1820
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1822
static const double dmats1[10][10] = \
1823
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1824
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1825
{5.47722558, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1826
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1827
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1828
{2.29128785, 7.24568837, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1829
{1.87082869, 0.00000000, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1830
{-2.64575131, 0.00000000, 9.66091783, 0.68313005, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1831
{3.24037035, 0.00000000, 0.00000000, 7.52994024, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1832
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1834
static const double dmats2[10][10] = \
1835
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1836
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1837
{1.82574186, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1838
{5.16397779, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1839
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1840
{2.29128785, 1.44913767, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1841
{1.87082869, 7.09929574, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1842
{1.32287566, 0.00000000, 3.86436713, -0.34156503, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1843
{1.08012345, 0.00000000, 7.09929574, 2.50998008, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1844
{-3.81881308, 0.00000000, 0.00000000, 8.87411967, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
1846
// Compute reference derivatives
1847
// Declare pointer to array of derivatives on FIAT element
1848
double *derivatives = new double [num_derivatives];
1849
for (unsigned int r = 0; r < num_derivatives; r++)
1851
derivatives[r] = 0.00000000;
1852
}// end loop over 'r'
1854
// Declare derivative matrix (of polynomial basis).
1855
double dmats[10][10] = \
1856
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1857
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1858
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1859
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1860
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1861
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1862
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
1863
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
1864
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
1865
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
1867
// Declare (auxiliary) derivative matrix (of polynomial basis).
1868
double dmats_old[10][10] = \
1869
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1870
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1871
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1872
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1873
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1874
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
1875
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
1876
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
1877
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
1878
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
1880
// Loop possible derivatives.
1881
for (unsigned int r = 0; r < num_derivatives; r++)
1883
// Resetting dmats values to compute next derivative.
1884
for (unsigned int t = 0; t < 10; t++)
1886
for (unsigned int u = 0; u < 10; u++)
1888
dmats[t][u] = 0.00000000;
1891
dmats[t][u] = 1.00000000;
1894
}// end loop over 'u'
1895
}// end loop over 't'
1897
// Looping derivative order to generate dmats.
1898
for (unsigned int s = 0; s < n; s++)
1900
// Updating dmats_old with new values and resetting dmats.
1901
for (unsigned int t = 0; t < 10; t++)
1903
for (unsigned int u = 0; u < 10; u++)
1905
dmats_old[t][u] = dmats[t][u];
1906
dmats[t][u] = 0.00000000;
1907
}// end loop over 'u'
1908
}// end loop over 't'
1910
// Update dmats using an inner product.
1911
if (combinations[r][s] == 0)
1913
for (unsigned int t = 0; t < 10; t++)
1915
for (unsigned int u = 0; u < 10; u++)
1917
for (unsigned int tu = 0; tu < 10; tu++)
1919
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1920
}// end loop over 'tu'
1921
}// end loop over 'u'
1922
}// end loop over 't'
1925
if (combinations[r][s] == 1)
1927
for (unsigned int t = 0; t < 10; t++)
1929
for (unsigned int u = 0; u < 10; u++)
1931
for (unsigned int tu = 0; tu < 10; tu++)
1933
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1934
}// end loop over 'tu'
1935
}// end loop over 'u'
1936
}// end loop over 't'
1939
if (combinations[r][s] == 2)
1941
for (unsigned int t = 0; t < 10; t++)
1943
for (unsigned int u = 0; u < 10; u++)
1945
for (unsigned int tu = 0; tu < 10; tu++)
1947
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
1948
}// end loop over 'tu'
1949
}// end loop over 'u'
1950
}// end loop over 't'
1953
}// end loop over 's'
1954
for (unsigned int s = 0; s < 10; s++)
1956
for (unsigned int t = 0; t < 10; t++)
1958
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
1959
}// end loop over 't'
1960
}// end loop over 's'
1961
}// end loop over 'r'
1963
// Transform derivatives back to physical element
1964
for (unsigned int row = 0; row < num_derivatives; row++)
1966
for (unsigned int col = 0; col < num_derivatives; col++)
1968
values[num_derivatives + row] += transform[row][col]*derivatives[col];
1972
// Delete pointer to array of derivatives on FIAT element
1973
delete [] derivatives;
1975
// Delete pointer to array of combinations of derivatives and transform
1976
for (unsigned int r = 0; r < num_derivatives; r++)
1978
delete [] combinations[r];
1979
delete [] transform[r];
1980
}// end loop over 'r'
1981
delete [] combinations;
1982
delete [] transform;
1985
if (20 <= i && i <= 29)
1987
// Map degree of freedom to element degree of freedom
1988
const unsigned int dof = i - 20;
1990
// Array of basisvalues
1991
double basisvalues[10] = {0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000};
1993
// Declare helper variables
1994
unsigned int rr = 0;
1995
unsigned int ss = 0;
1996
unsigned int tt = 0;
1997
double tmp5 = 0.00000000;
1998
double tmp6 = 0.00000000;
1999
double tmp7 = 0.00000000;
2000
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
2001
double tmp1 = 0.25000000*(Y + Z)*(Y + Z);
2002
double tmp2 = 0.50000000*(1.00000000 + Z + 2.00000000*Y);
2003
double tmp3 = 0.50000000*(1.00000000 - Z);
2004
double tmp4 = tmp3*tmp3;
2006
// Compute basisvalues
2007
basisvalues[0] = 1.00000000;
2008
basisvalues[1] = tmp0;
2009
for (unsigned int r = 1; r < 2; r++)
2011
rr = (r + 1)*((r + 1) + 1)*((r + 1) + 2)/6;
2012
ss = r*(r + 1)*(r + 2)/6;
2013
tt = (r - 1)*((r - 1) + 1)*((r - 1) + 2)/6;
2014
basisvalues[rr] = (basisvalues[ss]*tmp0*(1.00000000 + 2.00000000*r)/(1.00000000 + r) - basisvalues[tt]*tmp1*r/(1.00000000 + r));
2015
}// end loop over 'r'
2016
for (unsigned int r = 0; r < 2; r++)
2018
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
2019
ss = r*(r + 1)*(r + 2)/6;
2020
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
2021
}// end loop over 'r'
2022
for (unsigned int r = 0; r < 1; r++)
2024
for (unsigned int s = 1; s < 2 - r; s++)
2026
rr = (r + (s + 1))*(r + (s + 1) + 1)*(r + (s + 1) + 2)/6 + (s + 1)*((s + 1) + 1)/2;
2027
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
2028
tt = (r + (s - 1))*(r + (s - 1) + 1)*(r + (s - 1) + 2)/6 + (s - 1)*((s - 1) + 1)/2;
2029
tmp5 = (2.00000000 + 2.00000000*r + 2.00000000*s)*(3.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
2030
tmp6 = (1.00000000 + 4.00000000*r*r + 4.00000000*r)*(2.00000000 + 2.00000000*r + 2.00000000*s)/(2.00000000*(1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
2031
tmp7 = (1.00000000 + s + 2.00000000*r)*(3.00000000 + 2.00000000*r + 2.00000000*s)*s/((1.00000000 + 2.00000000*r + 2.00000000*s)*(1.00000000 + s)*(2.00000000 + s + 2.00000000*r));
2032
basisvalues[rr] = (basisvalues[ss]*(tmp2*tmp5 + tmp3*tmp6) - basisvalues[tt]*tmp4*tmp7);
2033
}// end loop over 's'
2034
}// end loop over 'r'
2035
for (unsigned int r = 0; r < 2; r++)
2037
for (unsigned int s = 0; s < 2 - r; s++)
2039
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
2040
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
2041
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
2042
}// end loop over 's'
2043
}// end loop over 'r'
2044
for (unsigned int r = 0; r < 1; r++)
2046
for (unsigned int s = 0; s < 1 - r; s++)
2048
for (unsigned int t = 1; t < 2 - r - s; t++)
2050
rr = (r + s + t + 1)*(r + s + t + 1 + 1)*(r + s + t + 1 + 2)/6 + (s + t + 1)*(s + t + 1 + 1)/2 + t + 1;
2051
ss = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
2052
tt = (r + s + t - 1)*(r + s + t - 1 + 1)*(r + s + t - 1 + 2)/6 + (s + t - 1)*(s + t - 1 + 1)/2 + t - 1;
2053
tmp5 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)/(2.00000000*(1.00000000 + t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
2054
tmp6 = (3.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(4.00000000 + 4.00000000*r*r + 4.00000000*s*s + 8.00000000*r*s + 8.00000000*r + 8.00000000*s)/(2.00000000*(1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
2055
tmp7 = (2.00000000 + t + 2.00000000*r + 2.00000000*s)*(4.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*t/((1.00000000 + t)*(2.00000000 + 2.00000000*r + 2.00000000*s + 2.00000000*t)*(3.00000000 + t + 2.00000000*r + 2.00000000*s));
2056
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Z*tmp5) - basisvalues[tt]*tmp7);
2057
}// end loop over 't'
2058
}// end loop over 's'
2059
}// end loop over 'r'
2060
for (unsigned int r = 0; r < 3; r++)
2062
for (unsigned int s = 0; s < 3 - r; s++)
2064
for (unsigned int t = 0; t < 3 - r - s; t++)
2066
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
2067
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
2068
}// end loop over 't'
2069
}// end loop over 's'
2070
}// end loop over 'r'
2072
// Table(s) of coefficients
2073
static const double coefficients0[10][10] = \
2074
{{-0.05773503, -0.06085806, -0.03513642, -0.02484520, 0.06506000, 0.05039526, 0.04114756, 0.02909572, 0.02375655, 0.01679842},
2075
{-0.05773503, 0.06085806, -0.03513642, -0.02484520, 0.06506000, -0.05039526, -0.04114756, 0.02909572, 0.02375655, 0.01679842},
2076
{-0.05773503, 0.00000000, 0.07027284, -0.02484520, 0.00000000, 0.00000000, 0.00000000, 0.08728716, -0.04751311, 0.01679842},
2077
{-0.05773503, 0.00000000, 0.00000000, 0.07453560, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.10079053},
2078
{0.23094011, 0.00000000, 0.14054567, 0.09938080, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.11878277, -0.06719368},
2079
{0.23094011, 0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, 0.10286890, 0.00000000, -0.05939139, -0.06719368},
2080
{0.23094011, 0.12171612, 0.07027284, -0.09938080, 0.00000000, 0.10079053, -0.02057378, -0.08728716, -0.01187828, 0.01679842},
2081
{0.23094011, -0.12171612, -0.07027284, 0.09938080, 0.00000000, 0.00000000, -0.10286890, 0.00000000, -0.05939139, -0.06719368},
2082
{0.23094011, -0.12171612, 0.07027284, -0.09938080, 0.00000000, -0.10079053, 0.02057378, -0.08728716, -0.01187828, 0.01679842},
2083
{0.23094011, 0.00000000, -0.14054567, -0.09938080, -0.13012001, 0.00000000, 0.00000000, 0.02909572, 0.02375655, 0.01679842}};
2085
// Tables of derivatives of the polynomial base (transpose).
2086
static const double dmats0[10][10] = \
2087
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2088
{6.32455532, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2089
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2090
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2091
{0.00000000, 11.22497216, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2092
{4.58257569, 0.00000000, 8.36660027, -1.18321596, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2093
{3.74165739, 0.00000000, 0.00000000, 8.69482605, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2094
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2095
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2096
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
2098
static const double dmats1[10][10] = \
2099
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2100
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2101
{5.47722558, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2102
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2103
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2104
{2.29128785, 7.24568837, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2105
{1.87082869, 0.00000000, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2106
{-2.64575131, 0.00000000, 9.66091783, 0.68313005, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2107
{3.24037035, 0.00000000, 0.00000000, 7.52994024, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2108
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
2110
static const double dmats2[10][10] = \
2111
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2112
{3.16227766, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2113
{1.82574186, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2114
{5.16397779, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2115
{2.95803989, 5.61248608, -1.08012345, -0.76376262, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2116
{2.29128785, 1.44913767, 4.18330013, -0.59160798, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2117
{1.87082869, 7.09929574, 0.00000000, 4.34741302, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2118
{1.32287566, 0.00000000, 3.86436713, -0.34156503, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2119
{1.08012345, 0.00000000, 7.09929574, 2.50998008, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2120
{-3.81881308, 0.00000000, 0.00000000, 8.87411967, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
2122
// Compute reference derivatives
2123
// Declare pointer to array of derivatives on FIAT element
2124
double *derivatives = new double [num_derivatives];
2125
for (unsigned int r = 0; r < num_derivatives; r++)
2127
derivatives[r] = 0.00000000;
2128
}// end loop over 'r'
2130
// Declare derivative matrix (of polynomial basis).
2131
double dmats[10][10] = \
2132
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2133
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2134
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2135
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2136
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2137
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2138
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
2139
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
2140
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
2141
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
2143
// Declare (auxiliary) derivative matrix (of polynomial basis).
2144
double dmats_old[10][10] = \
2145
{{1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2146
{0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2147
{0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2148
{0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2149
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2150
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
2151
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000},
2152
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000},
2153
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000},
2154
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000}};
2156
// Loop possible derivatives.
2157
for (unsigned int r = 0; r < num_derivatives; r++)
2159
// Resetting dmats values to compute next derivative.
2160
for (unsigned int t = 0; t < 10; t++)
2162
for (unsigned int u = 0; u < 10; u++)
2164
dmats[t][u] = 0.00000000;
2167
dmats[t][u] = 1.00000000;
2170
}// end loop over 'u'
2171
}// end loop over 't'
2173
// Looping derivative order to generate dmats.
2174
for (unsigned int s = 0; s < n; s++)
2176
// Updating dmats_old with new values and resetting dmats.
2177
for (unsigned int t = 0; t < 10; t++)
2179
for (unsigned int u = 0; u < 10; u++)
2181
dmats_old[t][u] = dmats[t][u];
2182
dmats[t][u] = 0.00000000;
2183
}// end loop over 'u'
2184
}// end loop over 't'
2186
// Update dmats using an inner product.
2187
if (combinations[r][s] == 0)
2189
for (unsigned int t = 0; t < 10; t++)
2191
for (unsigned int u = 0; u < 10; u++)
2193
for (unsigned int tu = 0; tu < 10; tu++)
2195
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
2196
}// end loop over 'tu'
2197
}// end loop over 'u'
2198
}// end loop over 't'
2201
if (combinations[r][s] == 1)
2203
for (unsigned int t = 0; t < 10; t++)
2205
for (unsigned int u = 0; u < 10; u++)
2207
for (unsigned int tu = 0; tu < 10; tu++)
2209
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
2210
}// end loop over 'tu'
2211
}// end loop over 'u'
2212
}// end loop over 't'
2215
if (combinations[r][s] == 2)
2217
for (unsigned int t = 0; t < 10; t++)
2219
for (unsigned int u = 0; u < 10; u++)
2221
for (unsigned int tu = 0; tu < 10; tu++)
2223
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
2224
}// end loop over 'tu'
2225
}// end loop over 'u'
2226
}// end loop over 't'
2229
}// end loop over 's'
2230
for (unsigned int s = 0; s < 10; s++)
2232
for (unsigned int t = 0; t < 10; t++)
2234
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
2235
}// end loop over 't'
2236
}// end loop over 's'
2237
}// end loop over 'r'
2239
// Transform derivatives back to physical element
2240
for (unsigned int row = 0; row < num_derivatives; row++)
2242
for (unsigned int col = 0; col < num_derivatives; col++)
2244
values[2*num_derivatives + row] += transform[row][col]*derivatives[col];
2248
// Delete pointer to array of derivatives on FIAT element
2249
delete [] derivatives;
2251
// Delete pointer to array of combinations of derivatives and transform
2252
for (unsigned int r = 0; r < num_derivatives; r++)
2254
delete [] combinations[r];
2255
delete [] transform[r];
2256
}// end loop over 'r'
2257
delete [] combinations;
2258
delete [] transform;
2263
/// Evaluate order n derivatives of all basis functions at given point in cell
2264
virtual void evaluate_basis_derivatives_all(unsigned int n,
2266
const double* coordinates,
2267
const ufc::cell& c) const
2269
// Compute number of derivatives.
2270
unsigned int num_derivatives = 1;
2272
for (unsigned int r = 0; r < n; r++)
2274
num_derivatives *= 3;
2275
}// end loop over 'r'
2277
// Helper variable to hold values of a single dof.
2278
double *dof_values = new double [3*num_derivatives];
2279
for (unsigned int r = 0; r < 3*num_derivatives; r++)
2281
dof_values[r] = 0.00000000;
2282
}// end loop over 'r'
2284
// Loop dofs and call evaluate_basis_derivatives.
2285
for (unsigned int r = 0; r < 30; r++)
2287
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
2288
for (unsigned int s = 0; s < 3*num_derivatives; s++)
2290
values[r*3*num_derivatives + s] = dof_values[s];
2291
}// end loop over 's'
2292
}// end loop over 'r'
2295
delete [] dof_values;
2298
/// Evaluate linear functional for dof i on the function f
2299
virtual double evaluate_dof(unsigned int i,
2300
const ufc::function& f,
2301
const ufc::cell& c) const
2303
// Declare variables for result of evaluation
2306
// Declare variable for physical coordinates
2309
const double * const * x = c.coordinates;
2317
f.evaluate(vals, y, c);
2326
f.evaluate(vals, y, c);
2335
f.evaluate(vals, y, c);
2344
f.evaluate(vals, y, c);
2350
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2351
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2352
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2353
f.evaluate(vals, y, c);
2359
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2360
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2361
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2362
f.evaluate(vals, y, c);
2368
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2369
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2370
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2371
f.evaluate(vals, y, c);
2377
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2378
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2379
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2380
f.evaluate(vals, y, c);
2386
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2387
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2388
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2389
f.evaluate(vals, y, c);
2395
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2396
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2397
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2398
f.evaluate(vals, y, c);
2407
f.evaluate(vals, y, c);
2416
f.evaluate(vals, y, c);
2425
f.evaluate(vals, y, c);
2434
f.evaluate(vals, y, c);
2440
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2441
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2442
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2443
f.evaluate(vals, y, c);
2449
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2450
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2451
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2452
f.evaluate(vals, y, c);
2458
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2459
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2460
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2461
f.evaluate(vals, y, c);
2467
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2468
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2469
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2470
f.evaluate(vals, y, c);
2476
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2477
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2478
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2479
f.evaluate(vals, y, c);
2485
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2486
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2487
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2488
f.evaluate(vals, y, c);
2497
f.evaluate(vals, y, c);
2506
f.evaluate(vals, y, c);
2515
f.evaluate(vals, y, c);
2524
f.evaluate(vals, y, c);
2530
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2531
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2532
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2533
f.evaluate(vals, y, c);
2539
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2540
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2541
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2542
f.evaluate(vals, y, c);
2548
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2549
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2550
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2551
f.evaluate(vals, y, c);
2557
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2558
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2559
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2560
f.evaluate(vals, y, c);
2566
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2567
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2568
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2569
f.evaluate(vals, y, c);
2575
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2576
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2577
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2578
f.evaluate(vals, y, c);
2587
/// Evaluate linear functionals for all dofs on the function f
2588
virtual void evaluate_dofs(double* values,
2589
const ufc::function& f,
2590
const ufc::cell& c) const
2592
// Declare variables for result of evaluation
2595
// Declare variable for physical coordinates
2598
const double * const * x = c.coordinates;
2602
f.evaluate(vals, y, c);
2603
values[0] = vals[0];
2607
f.evaluate(vals, y, c);
2608
values[1] = vals[0];
2612
f.evaluate(vals, y, c);
2613
values[2] = vals[0];
2617
f.evaluate(vals, y, c);
2618
values[3] = vals[0];
2619
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2620
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2621
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2622
f.evaluate(vals, y, c);
2623
values[4] = vals[0];
2624
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2625
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2626
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2627
f.evaluate(vals, y, c);
2628
values[5] = vals[0];
2629
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2630
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2631
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2632
f.evaluate(vals, y, c);
2633
values[6] = vals[0];
2634
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2635
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2636
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2637
f.evaluate(vals, y, c);
2638
values[7] = vals[0];
2639
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2640
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2641
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2642
f.evaluate(vals, y, c);
2643
values[8] = vals[0];
2644
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2645
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2646
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2647
f.evaluate(vals, y, c);
2648
values[9] = vals[0];
2652
f.evaluate(vals, y, c);
2653
values[10] = vals[1];
2657
f.evaluate(vals, y, c);
2658
values[11] = vals[1];
2662
f.evaluate(vals, y, c);
2663
values[12] = vals[1];
2667
f.evaluate(vals, y, c);
2668
values[13] = vals[1];
2669
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2670
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2671
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2672
f.evaluate(vals, y, c);
2673
values[14] = vals[1];
2674
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2675
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2676
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2677
f.evaluate(vals, y, c);
2678
values[15] = vals[1];
2679
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2680
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2681
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2682
f.evaluate(vals, y, c);
2683
values[16] = vals[1];
2684
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2685
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2686
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2687
f.evaluate(vals, y, c);
2688
values[17] = vals[1];
2689
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2690
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2691
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2692
f.evaluate(vals, y, c);
2693
values[18] = vals[1];
2694
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2695
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2696
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2697
f.evaluate(vals, y, c);
2698
values[19] = vals[1];
2702
f.evaluate(vals, y, c);
2703
values[20] = vals[2];
2707
f.evaluate(vals, y, c);
2708
values[21] = vals[2];
2712
f.evaluate(vals, y, c);
2713
values[22] = vals[2];
2717
f.evaluate(vals, y, c);
2718
values[23] = vals[2];
2719
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
2720
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
2721
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
2722
f.evaluate(vals, y, c);
2723
values[24] = vals[2];
2724
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
2725
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
2726
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
2727
f.evaluate(vals, y, c);
2728
values[25] = vals[2];
2729
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
2730
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
2731
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
2732
f.evaluate(vals, y, c);
2733
values[26] = vals[2];
2734
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
2735
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
2736
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
2737
f.evaluate(vals, y, c);
2738
values[27] = vals[2];
2739
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
2740
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
2741
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
2742
f.evaluate(vals, y, c);
2743
values[28] = vals[2];
2744
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
2745
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
2746
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
2747
f.evaluate(vals, y, c);
2748
values[29] = vals[2];
2751
/// Interpolate vertex values from dof values
2752
virtual void interpolate_vertex_values(double* vertex_values,
2753
const double* dof_values,
2754
const ufc::cell& c) const
2756
// Evaluate function and change variables
2757
vertex_values[0] = dof_values[0];
2758
vertex_values[3] = dof_values[1];
2759
vertex_values[6] = dof_values[2];
2760
vertex_values[9] = dof_values[3];
2761
// Evaluate function and change variables
2762
vertex_values[1] = dof_values[10];
2763
vertex_values[4] = dof_values[11];
2764
vertex_values[7] = dof_values[12];
2765
vertex_values[10] = dof_values[13];
2766
// Evaluate function and change variables
2767
vertex_values[2] = dof_values[20];
2768
vertex_values[5] = dof_values[21];
2769
vertex_values[8] = dof_values[22];
2770
vertex_values[11] = dof_values[23];
2773
/// Return the number of sub elements (for a mixed element)
2774
virtual unsigned int num_sub_elements() const
2779
/// Create a new finite element for sub element i (for a mixed element)
2780
virtual ufc::finite_element* create_sub_element(unsigned int i) const
2786
return new vectorlaplacegradcurl_finite_element_0();
2791
return new vectorlaplacegradcurl_finite_element_0();
2796
return new vectorlaplacegradcurl_finite_element_0();
2806
/// This class defines the interface for a finite element.
2808
class vectorlaplacegradcurl_finite_element_2: public ufc::finite_element
2813
vectorlaplacegradcurl_finite_element_2() : ufc::finite_element()
2819
virtual ~vectorlaplacegradcurl_finite_element_2()
2824
/// Return a string identifying the finite element
2825
virtual const char* signature() const
2827
return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
2830
/// Return the cell shape
2831
virtual ufc::shape cell_shape() const
2833
return ufc::tetrahedron;
2836
/// Return the dimension of the finite element function space
2837
virtual unsigned int space_dimension() const
2842
/// Return the rank of the value space
2843
virtual unsigned int value_rank() const
2848
/// Return the dimension of the value space for axis i
2849
virtual unsigned int value_dimension(unsigned int i) const
2854
/// Evaluate basis function i at given point in cell
2855
virtual void evaluate_basis(unsigned int i,
2857
const double* coordinates,
2858
const ufc::cell& c) const
2860
// Extract vertex coordinates
2861
const double * const * x = c.coordinates;
2863
// Compute Jacobian of affine map from reference cell
2864
const double J_00 = x[1][0] - x[0][0];
2865
const double J_01 = x[2][0] - x[0][0];
2866
const double J_02 = x[3][0] - x[0][0];
2867
const double J_10 = x[1][1] - x[0][1];
2868
const double J_11 = x[2][1] - x[0][1];
2869
const double J_12 = x[3][1] - x[0][1];
2870
const double J_20 = x[1][2] - x[0][2];
2871
const double J_21 = x[2][2] - x[0][2];
2872
const double J_22 = x[3][2] - x[0][2];
2874
// Compute sub determinants
2875
const double d_00 = J_11*J_22 - J_12*J_21;
2876
const double d_01 = J_12*J_20 - J_10*J_22;
2877
const double d_02 = J_10*J_21 - J_11*J_20;
2878
const double d_10 = J_02*J_21 - J_01*J_22;
2879
const double d_11 = J_00*J_22 - J_02*J_20;
2880
const double d_12 = J_01*J_20 - J_00*J_21;
2881
const double d_20 = J_01*J_12 - J_02*J_11;
2882
const double d_21 = J_02*J_10 - J_00*J_12;
2883
const double d_22 = J_00*J_11 - J_01*J_10;
2885
// Compute determinant of Jacobian
2886
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
2888
// Compute inverse of Jacobian
2890
// Compute constants
2891
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
2892
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
2893
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
2895
// Get coordinates and map to the reference (FIAT) element
2896
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
2897
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
2898
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
2902
*values = 0.00000000;
2904
// Map degree of freedom to element degree of freedom
2905
const unsigned int dof = i;
2907
// Array of basisvalues
2908
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
2910
// Declare helper variables
2911
unsigned int rr = 0;
2912
unsigned int ss = 0;
2913
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
2915
// Compute basisvalues
2916
basisvalues[0] = 1.00000000;
2917
basisvalues[1] = tmp0;
2918
for (unsigned int r = 0; r < 1; r++)
2920
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
2921
ss = r*(r + 1)*(r + 2)/6;
2922
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
2923
}// end loop over 'r'
2924
for (unsigned int r = 0; r < 1; r++)
2926
for (unsigned int s = 0; s < 1 - r; s++)
2928
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
2929
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
2930
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
2931
}// end loop over 's'
2932
}// end loop over 'r'
2933
for (unsigned int r = 0; r < 2; r++)
2935
for (unsigned int s = 0; s < 2 - r; s++)
2937
for (unsigned int t = 0; t < 2 - r - s; t++)
2939
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
2940
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
2941
}// end loop over 't'
2942
}// end loop over 's'
2943
}// end loop over 'r'
2945
// Table(s) of coefficients
2946
static const double coefficients0[4][4] = \
2947
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
2948
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
2949
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
2950
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
2952
// Compute value(s).
2953
for (unsigned int r = 0; r < 4; r++)
2955
*values += coefficients0[dof][r]*basisvalues[r];
2956
}// end loop over 'r'
2959
/// Evaluate all basis functions at given point in cell
2960
virtual void evaluate_basis_all(double* values,
2961
const double* coordinates,
2962
const ufc::cell& c) const
2964
// Helper variable to hold values of a single dof.
2965
double dof_values = 0.00000000;
2967
// Loop dofs and call evaluate_basis.
2968
for (unsigned int r = 0; r < 4; r++)
2970
evaluate_basis(r, &dof_values, coordinates, c);
2971
values[r] = dof_values;
2972
}// end loop over 'r'
2975
/// Evaluate order n derivatives of basis function i at given point in cell
2976
virtual void evaluate_basis_derivatives(unsigned int i,
2979
const double* coordinates,
2980
const ufc::cell& c) const
2982
// Extract vertex coordinates
2983
const double * const * x = c.coordinates;
2985
// Compute Jacobian of affine map from reference cell
2986
const double J_00 = x[1][0] - x[0][0];
2987
const double J_01 = x[2][0] - x[0][0];
2988
const double J_02 = x[3][0] - x[0][0];
2989
const double J_10 = x[1][1] - x[0][1];
2990
const double J_11 = x[2][1] - x[0][1];
2991
const double J_12 = x[3][1] - x[0][1];
2992
const double J_20 = x[1][2] - x[0][2];
2993
const double J_21 = x[2][2] - x[0][2];
2994
const double J_22 = x[3][2] - x[0][2];
2996
// Compute sub determinants
2997
const double d_00 = J_11*J_22 - J_12*J_21;
2998
const double d_01 = J_12*J_20 - J_10*J_22;
2999
const double d_02 = J_10*J_21 - J_11*J_20;
3000
const double d_10 = J_02*J_21 - J_01*J_22;
3001
const double d_11 = J_00*J_22 - J_02*J_20;
3002
const double d_12 = J_01*J_20 - J_00*J_21;
3003
const double d_20 = J_01*J_12 - J_02*J_11;
3004
const double d_21 = J_02*J_10 - J_00*J_12;
3005
const double d_22 = J_00*J_11 - J_01*J_10;
3007
// Compute determinant of Jacobian
3008
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
3010
// Compute inverse of Jacobian
3011
const double K_00 = d_00 / detJ;
3012
const double K_01 = d_10 / detJ;
3013
const double K_02 = d_20 / detJ;
3014
const double K_10 = d_01 / detJ;
3015
const double K_11 = d_11 / detJ;
3016
const double K_12 = d_21 / detJ;
3017
const double K_20 = d_02 / detJ;
3018
const double K_21 = d_12 / detJ;
3019
const double K_22 = d_22 / detJ;
3021
// Compute constants
3022
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
3023
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
3024
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
3026
// Get coordinates and map to the reference (FIAT) element
3027
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
3028
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
3029
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
3032
// Compute number of derivatives.
3033
unsigned int num_derivatives = 1;
3035
for (unsigned int r = 0; r < n; r++)
3037
num_derivatives *= 3;
3038
}// end loop over 'r'
3040
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
3041
unsigned int **combinations = new unsigned int *[num_derivatives];
3042
for (unsigned int row = 0; row < num_derivatives; row++)
3044
combinations[row] = new unsigned int [n];
3045
for (unsigned int col = 0; col < n; col++)
3046
combinations[row][col] = 0;
3049
// Generate combinations of derivatives
3050
for (unsigned int row = 1; row < num_derivatives; row++)
3052
for (unsigned int num = 0; num < row; num++)
3054
for (unsigned int col = n-1; col+1 > 0; col--)
3056
if (combinations[row][col] + 1 > 2)
3057
combinations[row][col] = 0;
3060
combinations[row][col] += 1;
3067
// Compute inverse of Jacobian
3068
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
3070
// Declare transformation matrix
3071
// Declare pointer to two dimensional array and initialise
3072
double **transform = new double *[num_derivatives];
3074
for (unsigned int j = 0; j < num_derivatives; j++)
3076
transform[j] = new double [num_derivatives];
3077
for (unsigned int k = 0; k < num_derivatives; k++)
3078
transform[j][k] = 1;
3081
// Construct transformation matrix
3082
for (unsigned int row = 0; row < num_derivatives; row++)
3084
for (unsigned int col = 0; col < num_derivatives; col++)
3086
for (unsigned int k = 0; k < n; k++)
3087
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
3091
// Reset values. Assuming that values is always an array.
3092
for (unsigned int r = 0; r < num_derivatives; r++)
3094
values[r] = 0.00000000;
3095
}// end loop over 'r'
3097
// Map degree of freedom to element degree of freedom
3098
const unsigned int dof = i;
3100
// Array of basisvalues
3101
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
3103
// Declare helper variables
3104
unsigned int rr = 0;
3105
unsigned int ss = 0;
3106
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
3108
// Compute basisvalues
3109
basisvalues[0] = 1.00000000;
3110
basisvalues[1] = tmp0;
3111
for (unsigned int r = 0; r < 1; r++)
3113
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
3114
ss = r*(r + 1)*(r + 2)/6;
3115
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
3116
}// end loop over 'r'
3117
for (unsigned int r = 0; r < 1; r++)
3119
for (unsigned int s = 0; s < 1 - r; s++)
3121
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
3122
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
3123
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
3124
}// end loop over 's'
3125
}// end loop over 'r'
3126
for (unsigned int r = 0; r < 2; r++)
3128
for (unsigned int s = 0; s < 2 - r; s++)
3130
for (unsigned int t = 0; t < 2 - r - s; t++)
3132
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
3133
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
3134
}// end loop over 't'
3135
}// end loop over 's'
3136
}// end loop over 'r'
3138
// Table(s) of coefficients
3139
static const double coefficients0[4][4] = \
3140
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
3141
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
3142
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3143
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
3145
// Tables of derivatives of the polynomial base (transpose).
3146
static const double dmats0[4][4] = \
3147
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3148
{6.32455532, 0.00000000, 0.00000000, 0.00000000},
3149
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3150
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
3152
static const double dmats1[4][4] = \
3153
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3154
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
3155
{5.47722558, 0.00000000, 0.00000000, 0.00000000},
3156
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
3158
static const double dmats2[4][4] = \
3159
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3160
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
3161
{1.82574186, 0.00000000, 0.00000000, 0.00000000},
3162
{5.16397779, 0.00000000, 0.00000000, 0.00000000}};
3164
// Compute reference derivatives
3165
// Declare pointer to array of derivatives on FIAT element
3166
double *derivatives = new double [num_derivatives];
3167
for (unsigned int r = 0; r < num_derivatives; r++)
3169
derivatives[r] = 0.00000000;
3170
}// end loop over 'r'
3172
// Declare derivative matrix (of polynomial basis).
3173
double dmats[4][4] = \
3174
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
3175
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
3176
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
3177
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
3179
// Declare (auxiliary) derivative matrix (of polynomial basis).
3180
double dmats_old[4][4] = \
3181
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
3182
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
3183
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
3184
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
3186
// Loop possible derivatives.
3187
for (unsigned int r = 0; r < num_derivatives; r++)
3189
// Resetting dmats values to compute next derivative.
3190
for (unsigned int t = 0; t < 4; t++)
3192
for (unsigned int u = 0; u < 4; u++)
3194
dmats[t][u] = 0.00000000;
3197
dmats[t][u] = 1.00000000;
3200
}// end loop over 'u'
3201
}// end loop over 't'
3203
// Looping derivative order to generate dmats.
3204
for (unsigned int s = 0; s < n; s++)
3206
// Updating dmats_old with new values and resetting dmats.
3207
for (unsigned int t = 0; t < 4; t++)
3209
for (unsigned int u = 0; u < 4; u++)
3211
dmats_old[t][u] = dmats[t][u];
3212
dmats[t][u] = 0.00000000;
3213
}// end loop over 'u'
3214
}// end loop over 't'
3216
// Update dmats using an inner product.
3217
if (combinations[r][s] == 0)
3219
for (unsigned int t = 0; t < 4; t++)
3221
for (unsigned int u = 0; u < 4; u++)
3223
for (unsigned int tu = 0; tu < 4; tu++)
3225
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3226
}// end loop over 'tu'
3227
}// end loop over 'u'
3228
}// end loop over 't'
3231
if (combinations[r][s] == 1)
3233
for (unsigned int t = 0; t < 4; t++)
3235
for (unsigned int u = 0; u < 4; u++)
3237
for (unsigned int tu = 0; tu < 4; tu++)
3239
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3240
}// end loop over 'tu'
3241
}// end loop over 'u'
3242
}// end loop over 't'
3245
if (combinations[r][s] == 2)
3247
for (unsigned int t = 0; t < 4; t++)
3249
for (unsigned int u = 0; u < 4; u++)
3251
for (unsigned int tu = 0; tu < 4; tu++)
3253
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
3254
}// end loop over 'tu'
3255
}// end loop over 'u'
3256
}// end loop over 't'
3259
}// end loop over 's'
3260
for (unsigned int s = 0; s < 4; s++)
3262
for (unsigned int t = 0; t < 4; t++)
3264
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
3265
}// end loop over 't'
3266
}// end loop over 's'
3267
}// end loop over 'r'
3269
// Transform derivatives back to physical element
3270
for (unsigned int row = 0; row < num_derivatives; row++)
3272
for (unsigned int col = 0; col < num_derivatives; col++)
3274
values[row] += transform[row][col]*derivatives[col];
3278
// Delete pointer to array of derivatives on FIAT element
3279
delete [] derivatives;
3281
// Delete pointer to array of combinations of derivatives and transform
3282
for (unsigned int r = 0; r < num_derivatives; r++)
3284
delete [] combinations[r];
3285
delete [] transform[r];
3286
}// end loop over 'r'
3287
delete [] combinations;
3288
delete [] transform;
3291
/// Evaluate order n derivatives of all basis functions at given point in cell
3292
virtual void evaluate_basis_derivatives_all(unsigned int n,
3294
const double* coordinates,
3295
const ufc::cell& c) const
3297
// Compute number of derivatives.
3298
unsigned int num_derivatives = 1;
3300
for (unsigned int r = 0; r < n; r++)
3302
num_derivatives *= 3;
3303
}// end loop over 'r'
3305
// Helper variable to hold values of a single dof.
3306
double *dof_values = new double [num_derivatives];
3307
for (unsigned int r = 0; r < num_derivatives; r++)
3309
dof_values[r] = 0.00000000;
3310
}// end loop over 'r'
3312
// Loop dofs and call evaluate_basis_derivatives.
3313
for (unsigned int r = 0; r < 4; r++)
3315
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
3316
for (unsigned int s = 0; s < num_derivatives; s++)
3318
values[r*num_derivatives + s] = dof_values[s];
3319
}// end loop over 's'
3320
}// end loop over 'r'
3323
delete [] dof_values;
3326
/// Evaluate linear functional for dof i on the function f
3327
virtual double evaluate_dof(unsigned int i,
3328
const ufc::function& f,
3329
const ufc::cell& c) const
3331
// Declare variables for result of evaluation
3334
// Declare variable for physical coordinates
3337
const double * const * x = c.coordinates;
3345
f.evaluate(vals, y, c);
3354
f.evaluate(vals, y, c);
3363
f.evaluate(vals, y, c);
3372
f.evaluate(vals, y, c);
3381
/// Evaluate linear functionals for all dofs on the function f
3382
virtual void evaluate_dofs(double* values,
3383
const ufc::function& f,
3384
const ufc::cell& c) const
3386
// Declare variables for result of evaluation
3389
// Declare variable for physical coordinates
3392
const double * const * x = c.coordinates;
3396
f.evaluate(vals, y, c);
3397
values[0] = vals[0];
3401
f.evaluate(vals, y, c);
3402
values[1] = vals[0];
3406
f.evaluate(vals, y, c);
3407
values[2] = vals[0];
3411
f.evaluate(vals, y, c);
3412
values[3] = vals[0];
3415
/// Interpolate vertex values from dof values
3416
virtual void interpolate_vertex_values(double* vertex_values,
3417
const double* dof_values,
3418
const ufc::cell& c) const
3420
// Evaluate function and change variables
3421
vertex_values[0] = dof_values[0];
3422
vertex_values[1] = dof_values[1];
3423
vertex_values[2] = dof_values[2];
3424
vertex_values[3] = dof_values[3];
3427
/// Return the number of sub elements (for a mixed element)
3428
virtual unsigned int num_sub_elements() const
3433
/// Create a new finite element for sub element i (for a mixed element)
3434
virtual ufc::finite_element* create_sub_element(unsigned int i) const
3441
/// This class defines the interface for a finite element.
3443
class vectorlaplacegradcurl_finite_element_3: public ufc::finite_element
3448
vectorlaplacegradcurl_finite_element_3() : ufc::finite_element()
3454
virtual ~vectorlaplacegradcurl_finite_element_3()
3459
/// Return a string identifying the finite element
3460
virtual const char* signature() const
3462
return "FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)";
3465
/// Return the cell shape
3466
virtual ufc::shape cell_shape() const
3468
return ufc::tetrahedron;
3471
/// Return the dimension of the finite element function space
3472
virtual unsigned int space_dimension() const
3477
/// Return the rank of the value space
3478
virtual unsigned int value_rank() const
3483
/// Return the dimension of the value space for axis i
3484
virtual unsigned int value_dimension(unsigned int i) const
3498
/// Evaluate basis function i at given point in cell
3499
virtual void evaluate_basis(unsigned int i,
3501
const double* coordinates,
3502
const ufc::cell& c) const
3504
// Extract vertex coordinates
3505
const double * const * x = c.coordinates;
3507
// Compute Jacobian of affine map from reference cell
3508
const double J_00 = x[1][0] - x[0][0];
3509
const double J_01 = x[2][0] - x[0][0];
3510
const double J_02 = x[3][0] - x[0][0];
3511
const double J_10 = x[1][1] - x[0][1];
3512
const double J_11 = x[2][1] - x[0][1];
3513
const double J_12 = x[3][1] - x[0][1];
3514
const double J_20 = x[1][2] - x[0][2];
3515
const double J_21 = x[2][2] - x[0][2];
3516
const double J_22 = x[3][2] - x[0][2];
3518
// Compute sub determinants
3519
const double d_00 = J_11*J_22 - J_12*J_21;
3520
const double d_01 = J_12*J_20 - J_10*J_22;
3521
const double d_02 = J_10*J_21 - J_11*J_20;
3522
const double d_10 = J_02*J_21 - J_01*J_22;
3523
const double d_11 = J_00*J_22 - J_02*J_20;
3524
const double d_12 = J_01*J_20 - J_00*J_21;
3525
const double d_20 = J_01*J_12 - J_02*J_11;
3526
const double d_21 = J_02*J_10 - J_00*J_12;
3527
const double d_22 = J_00*J_11 - J_01*J_10;
3529
// Compute determinant of Jacobian
3530
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
3532
// Compute inverse of Jacobian
3533
const double K_00 = d_00 / detJ;
3534
const double K_01 = d_10 / detJ;
3535
const double K_02 = d_20 / detJ;
3536
const double K_10 = d_01 / detJ;
3537
const double K_11 = d_11 / detJ;
3538
const double K_12 = d_21 / detJ;
3539
const double K_20 = d_02 / detJ;
3540
const double K_21 = d_12 / detJ;
3541
const double K_22 = d_22 / detJ;
3543
// Compute constants
3544
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
3545
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
3546
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
3548
// Get coordinates and map to the reference (FIAT) element
3549
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
3550
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
3551
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
3555
values[0] = 0.00000000;
3556
values[1] = 0.00000000;
3557
values[2] = 0.00000000;
3559
// Map degree of freedom to element degree of freedom
3560
const unsigned int dof = i;
3562
// Array of basisvalues
3563
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
3565
// Declare helper variables
3566
unsigned int rr = 0;
3567
unsigned int ss = 0;
3568
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
3570
// Compute basisvalues
3571
basisvalues[0] = 1.00000000;
3572
basisvalues[1] = tmp0;
3573
for (unsigned int r = 0; r < 1; r++)
3575
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
3576
ss = r*(r + 1)*(r + 2)/6;
3577
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
3578
}// end loop over 'r'
3579
for (unsigned int r = 0; r < 1; r++)
3581
for (unsigned int s = 0; s < 1 - r; s++)
3583
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
3584
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
3585
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
3586
}// end loop over 's'
3587
}// end loop over 'r'
3588
for (unsigned int r = 0; r < 2; r++)
3590
for (unsigned int s = 0; s < 2 - r; s++)
3592
for (unsigned int t = 0; t < 2 - r - s; t++)
3594
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
3595
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
3596
}// end loop over 't'
3597
}// end loop over 's'
3598
}// end loop over 'r'
3600
// Table(s) of coefficients
3601
static const double coefficients0[6][4] = \
3602
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3603
{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
3604
{-0.28867513, 0.00000000, -0.21081851, 0.07453560},
3605
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
3606
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3607
{0.57735027, 0.00000000, -0.21081851, -0.14907120}};
3609
static const double coefficients1[6][4] = \
3610
{{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
3611
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3612
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
3613
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
3614
{0.57735027, -0.18257419, 0.10540926, -0.14907120},
3615
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
3617
static const double coefficients2[6][4] = \
3618
{{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3619
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
3620
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3621
{0.57735027, -0.18257419, -0.10540926, 0.14907120},
3622
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3623
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
3625
// Compute value(s).
3626
for (unsigned int r = 0; r < 4; r++)
3628
values[0] += coefficients0[dof][r]*basisvalues[r];
3629
values[1] += coefficients1[dof][r]*basisvalues[r];
3630
values[2] += coefficients2[dof][r]*basisvalues[r];
3631
}// end loop over 'r'
3633
// Using covariant Piola transform to map values back to the physical element
3634
const double tmp_ref0 = values[0];
3635
const double tmp_ref1 = values[1];
3636
const double tmp_ref2 = values[2];
3637
values[0] = (K_00*tmp_ref0 + K_10*tmp_ref1 + K_20*tmp_ref2);
3638
values[1] = (K_01*tmp_ref0 + K_11*tmp_ref1 + K_21*tmp_ref2);
3639
values[2] = (K_02*tmp_ref0 + K_12*tmp_ref1 + K_22*tmp_ref2);
3642
/// Evaluate all basis functions at given point in cell
3643
virtual void evaluate_basis_all(double* values,
3644
const double* coordinates,
3645
const ufc::cell& c) const
3647
// Helper variable to hold values of a single dof.
3648
double dof_values[3] = {0.00000000, 0.00000000, 0.00000000};
3650
// Loop dofs and call evaluate_basis.
3651
for (unsigned int r = 0; r < 6; r++)
3653
evaluate_basis(r, dof_values, coordinates, c);
3654
for (unsigned int s = 0; s < 3; s++)
3656
values[r*3 + s] = dof_values[s];
3657
}// end loop over 's'
3658
}// end loop over 'r'
3661
/// Evaluate order n derivatives of basis function i at given point in cell
3662
virtual void evaluate_basis_derivatives(unsigned int i,
3665
const double* coordinates,
3666
const ufc::cell& c) const
3668
// Extract vertex coordinates
3669
const double * const * x = c.coordinates;
3671
// Compute Jacobian of affine map from reference cell
3672
const double J_00 = x[1][0] - x[0][0];
3673
const double J_01 = x[2][0] - x[0][0];
3674
const double J_02 = x[3][0] - x[0][0];
3675
const double J_10 = x[1][1] - x[0][1];
3676
const double J_11 = x[2][1] - x[0][1];
3677
const double J_12 = x[3][1] - x[0][1];
3678
const double J_20 = x[1][2] - x[0][2];
3679
const double J_21 = x[2][2] - x[0][2];
3680
const double J_22 = x[3][2] - x[0][2];
3682
// Compute sub determinants
3683
const double d_00 = J_11*J_22 - J_12*J_21;
3684
const double d_01 = J_12*J_20 - J_10*J_22;
3685
const double d_02 = J_10*J_21 - J_11*J_20;
3686
const double d_10 = J_02*J_21 - J_01*J_22;
3687
const double d_11 = J_00*J_22 - J_02*J_20;
3688
const double d_12 = J_01*J_20 - J_00*J_21;
3689
const double d_20 = J_01*J_12 - J_02*J_11;
3690
const double d_21 = J_02*J_10 - J_00*J_12;
3691
const double d_22 = J_00*J_11 - J_01*J_10;
3693
// Compute determinant of Jacobian
3694
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
3696
// Compute inverse of Jacobian
3697
const double K_00 = d_00 / detJ;
3698
const double K_01 = d_10 / detJ;
3699
const double K_02 = d_20 / detJ;
3700
const double K_10 = d_01 / detJ;
3701
const double K_11 = d_11 / detJ;
3702
const double K_12 = d_21 / detJ;
3703
const double K_20 = d_02 / detJ;
3704
const double K_21 = d_12 / detJ;
3705
const double K_22 = d_22 / detJ;
3707
// Compute constants
3708
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
3709
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
3710
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
3712
// Get coordinates and map to the reference (FIAT) element
3713
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
3714
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
3715
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
3718
// Compute number of derivatives.
3719
unsigned int num_derivatives = 1;
3721
for (unsigned int r = 0; r < n; r++)
3723
num_derivatives *= 3;
3724
}// end loop over 'r'
3726
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
3727
unsigned int **combinations = new unsigned int *[num_derivatives];
3728
for (unsigned int row = 0; row < num_derivatives; row++)
3730
combinations[row] = new unsigned int [n];
3731
for (unsigned int col = 0; col < n; col++)
3732
combinations[row][col] = 0;
3735
// Generate combinations of derivatives
3736
for (unsigned int row = 1; row < num_derivatives; row++)
3738
for (unsigned int num = 0; num < row; num++)
3740
for (unsigned int col = n-1; col+1 > 0; col--)
3742
if (combinations[row][col] + 1 > 2)
3743
combinations[row][col] = 0;
3746
combinations[row][col] += 1;
3753
// Compute inverse of Jacobian
3754
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
3756
// Declare transformation matrix
3757
// Declare pointer to two dimensional array and initialise
3758
double **transform = new double *[num_derivatives];
3760
for (unsigned int j = 0; j < num_derivatives; j++)
3762
transform[j] = new double [num_derivatives];
3763
for (unsigned int k = 0; k < num_derivatives; k++)
3764
transform[j][k] = 1;
3767
// Construct transformation matrix
3768
for (unsigned int row = 0; row < num_derivatives; row++)
3770
for (unsigned int col = 0; col < num_derivatives; col++)
3772
for (unsigned int k = 0; k < n; k++)
3773
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
3777
// Reset values. Assuming that values is always an array.
3778
for (unsigned int r = 0; r < 3*num_derivatives; r++)
3780
values[r] = 0.00000000;
3781
}// end loop over 'r'
3783
// Map degree of freedom to element degree of freedom
3784
const unsigned int dof = i;
3786
// Array of basisvalues
3787
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
3789
// Declare helper variables
3790
unsigned int rr = 0;
3791
unsigned int ss = 0;
3792
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
3794
// Compute basisvalues
3795
basisvalues[0] = 1.00000000;
3796
basisvalues[1] = tmp0;
3797
for (unsigned int r = 0; r < 1; r++)
3799
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
3800
ss = r*(r + 1)*(r + 2)/6;
3801
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
3802
}// end loop over 'r'
3803
for (unsigned int r = 0; r < 1; r++)
3805
for (unsigned int s = 0; s < 1 - r; s++)
3807
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
3808
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
3809
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
3810
}// end loop over 's'
3811
}// end loop over 'r'
3812
for (unsigned int r = 0; r < 2; r++)
3814
for (unsigned int s = 0; s < 2 - r; s++)
3816
for (unsigned int t = 0; t < 2 - r - s; t++)
3818
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
3819
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
3820
}// end loop over 't'
3821
}// end loop over 's'
3822
}// end loop over 'r'
3824
// Table(s) of coefficients
3825
static const double coefficients0[6][4] = \
3826
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3827
{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
3828
{-0.28867513, 0.00000000, -0.21081851, 0.07453560},
3829
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
3830
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3831
{0.57735027, 0.00000000, -0.21081851, -0.14907120}};
3833
static const double coefficients1[6][4] = \
3834
{{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
3835
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3836
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
3837
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
3838
{0.57735027, -0.18257419, 0.10540926, -0.14907120},
3839
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
3841
static const double coefficients2[6][4] = \
3842
{{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3843
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
3844
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3845
{0.57735027, -0.18257419, -0.10540926, 0.14907120},
3846
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
3847
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
3849
// Tables of derivatives of the polynomial base (transpose).
3850
static const double dmats0[4][4] = \
3851
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3852
{6.32455532, 0.00000000, 0.00000000, 0.00000000},
3853
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3854
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
3856
static const double dmats1[4][4] = \
3857
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3858
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
3859
{5.47722558, 0.00000000, 0.00000000, 0.00000000},
3860
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
3862
static const double dmats2[4][4] = \
3863
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
3864
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
3865
{1.82574186, 0.00000000, 0.00000000, 0.00000000},
3866
{5.16397779, 0.00000000, 0.00000000, 0.00000000}};
3868
// Compute reference derivatives
3869
// Declare pointer to array of derivatives on FIAT element
3870
double *derivatives = new double [3*num_derivatives];
3871
for (unsigned int r = 0; r < 3*num_derivatives; r++)
3873
derivatives[r] = 0.00000000;
3874
}// end loop over 'r'
3876
// Declare derivative matrix (of polynomial basis).
3877
double dmats[4][4] = \
3878
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
3879
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
3880
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
3881
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
3883
// Declare (auxiliary) derivative matrix (of polynomial basis).
3884
double dmats_old[4][4] = \
3885
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
3886
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
3887
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
3888
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
3890
// Loop possible derivatives.
3891
for (unsigned int r = 0; r < num_derivatives; r++)
3893
// Resetting dmats values to compute next derivative.
3894
for (unsigned int t = 0; t < 4; t++)
3896
for (unsigned int u = 0; u < 4; u++)
3898
dmats[t][u] = 0.00000000;
3901
dmats[t][u] = 1.00000000;
3904
}// end loop over 'u'
3905
}// end loop over 't'
3907
// Looping derivative order to generate dmats.
3908
for (unsigned int s = 0; s < n; s++)
3910
// Updating dmats_old with new values and resetting dmats.
3911
for (unsigned int t = 0; t < 4; t++)
3913
for (unsigned int u = 0; u < 4; u++)
3915
dmats_old[t][u] = dmats[t][u];
3916
dmats[t][u] = 0.00000000;
3917
}// end loop over 'u'
3918
}// end loop over 't'
3920
// Update dmats using an inner product.
3921
if (combinations[r][s] == 0)
3923
for (unsigned int t = 0; t < 4; t++)
3925
for (unsigned int u = 0; u < 4; u++)
3927
for (unsigned int tu = 0; tu < 4; tu++)
3929
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3930
}// end loop over 'tu'
3931
}// end loop over 'u'
3932
}// end loop over 't'
3935
if (combinations[r][s] == 1)
3937
for (unsigned int t = 0; t < 4; t++)
3939
for (unsigned int u = 0; u < 4; u++)
3941
for (unsigned int tu = 0; tu < 4; tu++)
3943
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3944
}// end loop over 'tu'
3945
}// end loop over 'u'
3946
}// end loop over 't'
3949
if (combinations[r][s] == 2)
3951
for (unsigned int t = 0; t < 4; t++)
3953
for (unsigned int u = 0; u < 4; u++)
3955
for (unsigned int tu = 0; tu < 4; tu++)
3957
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
3958
}// end loop over 'tu'
3959
}// end loop over 'u'
3960
}// end loop over 't'
3963
}// end loop over 's'
3964
for (unsigned int s = 0; s < 4; s++)
3966
for (unsigned int t = 0; t < 4; t++)
3968
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
3969
derivatives[num_derivatives + r] += coefficients1[dof][s]*dmats[s][t]*basisvalues[t];
3970
derivatives[2*num_derivatives + r] += coefficients2[dof][s]*dmats[s][t]*basisvalues[t];
3971
}// end loop over 't'
3972
}// end loop over 's'
3974
// Using covariant Piola transform to map values back to the physical element
3975
const double tmp_ref0 = derivatives[r];
3976
const double tmp_ref1 = derivatives[num_derivatives + r];
3977
const double tmp_ref2 = derivatives[2*num_derivatives + r];
3978
derivatives[r] = (K_00*tmp_ref0 + K_10*tmp_ref1 + K_20*tmp_ref2);
3979
derivatives[num_derivatives + r] = (K_01*tmp_ref0 + K_11*tmp_ref1 + K_21*tmp_ref2);
3980
derivatives[2*num_derivatives + r] = (K_02*tmp_ref0 + K_12*tmp_ref1 + K_22*tmp_ref2);
3981
}// end loop over 'r'
3983
// Transform derivatives back to physical element
3984
for (unsigned int row = 0; row < num_derivatives; row++)
3986
for (unsigned int col = 0; col < num_derivatives; col++)
3988
values[row] += transform[row][col]*derivatives[col];
3989
values[num_derivatives + row] += transform[row][col]*derivatives[num_derivatives + col];
3990
values[2*num_derivatives + row] += transform[row][col]*derivatives[2*num_derivatives + col];
3994
// Delete pointer to array of derivatives on FIAT element
3995
delete [] derivatives;
3997
// Delete pointer to array of combinations of derivatives and transform
3998
for (unsigned int r = 0; r < num_derivatives; r++)
4000
delete [] combinations[r];
4001
delete [] transform[r];
4002
}// end loop over 'r'
4003
delete [] combinations;
4004
delete [] transform;
4007
/// Evaluate order n derivatives of all basis functions at given point in cell
4008
virtual void evaluate_basis_derivatives_all(unsigned int n,
4010
const double* coordinates,
4011
const ufc::cell& c) const
4013
// Compute number of derivatives.
4014
unsigned int num_derivatives = 1;
4016
for (unsigned int r = 0; r < n; r++)
4018
num_derivatives *= 3;
4019
}// end loop over 'r'
4021
// Helper variable to hold values of a single dof.
4022
double *dof_values = new double [3*num_derivatives];
4023
for (unsigned int r = 0; r < 3*num_derivatives; r++)
4025
dof_values[r] = 0.00000000;
4026
}// end loop over 'r'
4028
// Loop dofs and call evaluate_basis_derivatives.
4029
for (unsigned int r = 0; r < 6; r++)
4031
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
4032
for (unsigned int s = 0; s < 3*num_derivatives; s++)
4034
values[r*3*num_derivatives + s] = dof_values[s];
4035
}// end loop over 's'
4036
}// end loop over 'r'
4039
delete [] dof_values;
4042
/// Evaluate linear functional for dof i on the function f
4043
virtual double evaluate_dof(unsigned int i,
4044
const ufc::function& f,
4045
const ufc::cell& c) const
4047
// Declare variables for result of evaluation
4050
// Declare variable for physical coordinates
4055
// Extract vertex coordinates
4056
const double * const * x = c.coordinates;
4058
// Compute Jacobian of affine map from reference cell
4059
const double J_00 = x[1][0] - x[0][0];
4060
const double J_01 = x[2][0] - x[0][0];
4061
const double J_02 = x[3][0] - x[0][0];
4062
const double J_10 = x[1][1] - x[0][1];
4063
const double J_11 = x[2][1] - x[0][1];
4064
const double J_12 = x[3][1] - x[0][1];
4065
const double J_20 = x[1][2] - x[0][2];
4066
const double J_21 = x[2][2] - x[0][2];
4067
const double J_22 = x[3][2] - x[0][2];switch (i)
4071
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
4072
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
4073
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
4074
f.evaluate(vals, y, c);
4075
result = (-1.0)*(J_01*vals[0] + J_11*vals[1] + J_21*vals[2]) + (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4081
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
4082
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
4083
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
4084
f.evaluate(vals, y, c);
4085
result = (-1.0)*(J_00*vals[0] + J_10*vals[1] + J_20*vals[2]) + (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4091
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
4092
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
4093
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
4094
f.evaluate(vals, y, c);
4095
result = (-1.0)*(J_00*vals[0] + J_10*vals[1] + J_20*vals[2]) + (J_01*vals[0] + J_11*vals[1] + J_21*vals[2]);
4101
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
4102
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
4103
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
4104
f.evaluate(vals, y, c);
4105
result = (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4111
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
4112
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
4113
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
4114
f.evaluate(vals, y, c);
4115
result = (J_01*vals[0] + J_11*vals[1] + J_21*vals[2]);
4121
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
4122
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
4123
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
4124
f.evaluate(vals, y, c);
4125
result = (J_00*vals[0] + J_10*vals[1] + J_20*vals[2]);
4134
/// Evaluate linear functionals for all dofs on the function f
4135
virtual void evaluate_dofs(double* values,
4136
const ufc::function& f,
4137
const ufc::cell& c) const
4139
// Declare variables for result of evaluation
4142
// Declare variable for physical coordinates
4147
// Extract vertex coordinates
4148
const double * const * x = c.coordinates;
4150
// Compute Jacobian of affine map from reference cell
4151
const double J_00 = x[1][0] - x[0][0];
4152
const double J_01 = x[2][0] - x[0][0];
4153
const double J_02 = x[3][0] - x[0][0];
4154
const double J_10 = x[1][1] - x[0][1];
4155
const double J_11 = x[2][1] - x[0][1];
4156
const double J_12 = x[3][1] - x[0][1];
4157
const double J_20 = x[1][2] - x[0][2];
4158
const double J_21 = x[2][2] - x[0][2];
4159
const double J_22 = x[3][2] - x[0][2];y[0] = 0.5*x[2][0] + 0.5*x[3][0];
4160
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
4161
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
4162
f.evaluate(vals, y, c);
4163
result = (-1.0)*(J_01*vals[0] + J_11*vals[1] + J_21*vals[2]) + (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4165
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
4166
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
4167
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
4168
f.evaluate(vals, y, c);
4169
result = (-1.0)*(J_00*vals[0] + J_10*vals[1] + J_20*vals[2]) + (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4171
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
4172
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
4173
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
4174
f.evaluate(vals, y, c);
4175
result = (-1.0)*(J_00*vals[0] + J_10*vals[1] + J_20*vals[2]) + (J_01*vals[0] + J_11*vals[1] + J_21*vals[2]);
4177
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
4178
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
4179
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
4180
f.evaluate(vals, y, c);
4181
result = (J_02*vals[0] + J_12*vals[1] + J_22*vals[2]);
4183
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
4184
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
4185
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
4186
f.evaluate(vals, y, c);
4187
result = (J_01*vals[0] + J_11*vals[1] + J_21*vals[2]);
4189
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
4190
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
4191
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
4192
f.evaluate(vals, y, c);
4193
result = (J_00*vals[0] + J_10*vals[1] + J_20*vals[2]);
4197
/// Interpolate vertex values from dof values
4198
virtual void interpolate_vertex_values(double* vertex_values,
4199
const double* dof_values,
4200
const ufc::cell& c) const
4202
// Extract vertex coordinates
4203
const double * const * x = c.coordinates;
4205
// Compute Jacobian of affine map from reference cell
4206
const double J_00 = x[1][0] - x[0][0];
4207
const double J_01 = x[2][0] - x[0][0];
4208
const double J_02 = x[3][0] - x[0][0];
4209
const double J_10 = x[1][1] - x[0][1];
4210
const double J_11 = x[2][1] - x[0][1];
4211
const double J_12 = x[3][1] - x[0][1];
4212
const double J_20 = x[1][2] - x[0][2];
4213
const double J_21 = x[2][2] - x[0][2];
4214
const double J_22 = x[3][2] - x[0][2];
4216
// Compute sub determinants
4217
const double d_00 = J_11*J_22 - J_12*J_21;
4218
const double d_01 = J_12*J_20 - J_10*J_22;
4219
const double d_02 = J_10*J_21 - J_11*J_20;
4220
const double d_10 = J_02*J_21 - J_01*J_22;
4221
const double d_11 = J_00*J_22 - J_02*J_20;
4222
const double d_12 = J_01*J_20 - J_00*J_21;
4223
const double d_20 = J_01*J_12 - J_02*J_11;
4224
const double d_21 = J_02*J_10 - J_00*J_12;
4225
const double d_22 = J_00*J_11 - J_01*J_10;
4227
// Compute determinant of Jacobian
4228
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
4230
// Compute inverse of Jacobian
4231
const double K_00 = d_00 / detJ;
4232
const double K_01 = d_10 / detJ;
4233
const double K_02 = d_20 / detJ;
4234
const double K_10 = d_01 / detJ;
4235
const double K_11 = d_11 / detJ;
4236
const double K_12 = d_21 / detJ;
4237
const double K_20 = d_02 / detJ;
4238
const double K_21 = d_12 / detJ;
4239
const double K_22 = d_22 / detJ;
4240
// Evaluate function and change variables
4241
vertex_values[0] = dof_values[3]*K_20 + dof_values[4]*K_10 + dof_values[5]*K_00;
4242
vertex_values[3] = dof_values[1]*K_20 + dof_values[2]*K_10 + dof_values[5]*(K_00 + K_10 + K_20);
4243
vertex_values[6] = dof_values[0]*K_20 + dof_values[2]*(K_00*(-1.0)) + dof_values[4]*(K_00 + K_10 + K_20);
4244
vertex_values[9] = dof_values[0]*(K_10*(-1.0)) + dof_values[1]*(K_00*(-1.0)) + dof_values[3]*(K_00 + K_10 + K_20);
4245
vertex_values[1] = dof_values[3]*K_21 + dof_values[4]*K_11 + dof_values[5]*K_01;
4246
vertex_values[4] = dof_values[1]*K_21 + dof_values[2]*K_11 + dof_values[5]*(K_01 + K_11 + K_21);
4247
vertex_values[7] = dof_values[0]*K_21 + dof_values[2]*(K_01*(-1.0)) + dof_values[4]*(K_01 + K_11 + K_21);
4248
vertex_values[10] = dof_values[0]*(K_11*(-1.0)) + dof_values[1]*(K_01*(-1.0)) + dof_values[3]*(K_01 + K_11 + K_21);
4249
vertex_values[2] = dof_values[3]*K_22 + dof_values[4]*K_12 + dof_values[5]*K_02;
4250
vertex_values[5] = dof_values[1]*K_22 + dof_values[2]*K_12 + dof_values[5]*(K_02 + K_12 + K_22);
4251
vertex_values[8] = dof_values[0]*K_22 + dof_values[2]*(K_02*(-1.0)) + dof_values[4]*(K_02 + K_12 + K_22);
4252
vertex_values[11] = dof_values[0]*(K_12*(-1.0)) + dof_values[1]*(K_02*(-1.0)) + dof_values[3]*(K_02 + K_12 + K_22);
4255
/// Return the number of sub elements (for a mixed element)
4256
virtual unsigned int num_sub_elements() const
4261
/// Create a new finite element for sub element i (for a mixed element)
4262
virtual ufc::finite_element* create_sub_element(unsigned int i) const
4269
/// This class defines the interface for a finite element.
4271
class vectorlaplacegradcurl_finite_element_4: public ufc::finite_element
4276
vectorlaplacegradcurl_finite_element_4() : ufc::finite_element()
4282
virtual ~vectorlaplacegradcurl_finite_element_4()
4287
/// Return a string identifying the finite element
4288
virtual const char* signature() const
4290
return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) })";
4293
/// Return the cell shape
4294
virtual ufc::shape cell_shape() const
4296
return ufc::tetrahedron;
4299
/// Return the dimension of the finite element function space
4300
virtual unsigned int space_dimension() const
4305
/// Return the rank of the value space
4306
virtual unsigned int value_rank() const
4311
/// Return the dimension of the value space for axis i
4312
virtual unsigned int value_dimension(unsigned int i) const
4326
/// Evaluate basis function i at given point in cell
4327
virtual void evaluate_basis(unsigned int i,
4329
const double* coordinates,
4330
const ufc::cell& c) const
4332
// Extract vertex coordinates
4333
const double * const * x = c.coordinates;
4335
// Compute Jacobian of affine map from reference cell
4336
const double J_00 = x[1][0] - x[0][0];
4337
const double J_01 = x[2][0] - x[0][0];
4338
const double J_02 = x[3][0] - x[0][0];
4339
const double J_10 = x[1][1] - x[0][1];
4340
const double J_11 = x[2][1] - x[0][1];
4341
const double J_12 = x[3][1] - x[0][1];
4342
const double J_20 = x[1][2] - x[0][2];
4343
const double J_21 = x[2][2] - x[0][2];
4344
const double J_22 = x[3][2] - x[0][2];
4346
// Compute sub determinants
4347
const double d_00 = J_11*J_22 - J_12*J_21;
4348
const double d_01 = J_12*J_20 - J_10*J_22;
4349
const double d_02 = J_10*J_21 - J_11*J_20;
4350
const double d_10 = J_02*J_21 - J_01*J_22;
4351
const double d_11 = J_00*J_22 - J_02*J_20;
4352
const double d_12 = J_01*J_20 - J_00*J_21;
4353
const double d_20 = J_01*J_12 - J_02*J_11;
4354
const double d_21 = J_02*J_10 - J_00*J_12;
4355
const double d_22 = J_00*J_11 - J_01*J_10;
4357
// Compute determinant of Jacobian
4358
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
4360
// Compute inverse of Jacobian
4361
const double K_00 = d_00 / detJ;
4362
const double K_01 = d_10 / detJ;
4363
const double K_02 = d_20 / detJ;
4364
const double K_10 = d_01 / detJ;
4365
const double K_11 = d_11 / detJ;
4366
const double K_12 = d_21 / detJ;
4367
const double K_20 = d_02 / detJ;
4368
const double K_21 = d_12 / detJ;
4369
const double K_22 = d_22 / detJ;
4371
// Compute constants
4372
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
4373
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
4374
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
4376
// Get coordinates and map to the reference (FIAT) element
4377
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
4378
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
4379
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
4383
values[0] = 0.00000000;
4384
values[1] = 0.00000000;
4385
values[2] = 0.00000000;
4386
values[3] = 0.00000000;
4387
if (0 <= i && i <= 3)
4389
// Map degree of freedom to element degree of freedom
4390
const unsigned int dof = i;
4392
// Array of basisvalues
4393
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
4395
// Declare helper variables
4396
unsigned int rr = 0;
4397
unsigned int ss = 0;
4398
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
4400
// Compute basisvalues
4401
basisvalues[0] = 1.00000000;
4402
basisvalues[1] = tmp0;
4403
for (unsigned int r = 0; r < 1; r++)
4405
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
4406
ss = r*(r + 1)*(r + 2)/6;
4407
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
4408
}// end loop over 'r'
4409
for (unsigned int r = 0; r < 1; r++)
4411
for (unsigned int s = 0; s < 1 - r; s++)
4413
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
4414
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
4415
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
4416
}// end loop over 's'
4417
}// end loop over 'r'
4418
for (unsigned int r = 0; r < 2; r++)
4420
for (unsigned int s = 0; s < 2 - r; s++)
4422
for (unsigned int t = 0; t < 2 - r - s; t++)
4424
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
4425
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
4426
}// end loop over 't'
4427
}// end loop over 's'
4428
}// end loop over 'r'
4430
// Table(s) of coefficients
4431
static const double coefficients0[4][4] = \
4432
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
4433
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4434
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4435
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
4437
// Compute value(s).
4438
for (unsigned int r = 0; r < 4; r++)
4440
values[0] += coefficients0[dof][r]*basisvalues[r];
4441
}// end loop over 'r'
4444
if (4 <= i && i <= 9)
4446
// Map degree of freedom to element degree of freedom
4447
const unsigned int dof = i - 4;
4449
// Array of basisvalues
4450
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
4452
// Declare helper variables
4453
unsigned int rr = 0;
4454
unsigned int ss = 0;
4455
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
4457
// Compute basisvalues
4458
basisvalues[0] = 1.00000000;
4459
basisvalues[1] = tmp0;
4460
for (unsigned int r = 0; r < 1; r++)
4462
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
4463
ss = r*(r + 1)*(r + 2)/6;
4464
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
4465
}// end loop over 'r'
4466
for (unsigned int r = 0; r < 1; r++)
4468
for (unsigned int s = 0; s < 1 - r; s++)
4470
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
4471
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
4472
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
4473
}// end loop over 's'
4474
}// end loop over 'r'
4475
for (unsigned int r = 0; r < 2; r++)
4477
for (unsigned int s = 0; s < 2 - r; s++)
4479
for (unsigned int t = 0; t < 2 - r - s; t++)
4481
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
4482
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
4483
}// end loop over 't'
4484
}// end loop over 's'
4485
}// end loop over 'r'
4487
// Table(s) of coefficients
4488
static const double coefficients0[6][4] = \
4489
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4490
{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
4491
{-0.28867513, 0.00000000, -0.21081851, 0.07453560},
4492
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
4493
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4494
{0.57735027, 0.00000000, -0.21081851, -0.14907120}};
4496
static const double coefficients1[6][4] = \
4497
{{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
4498
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4499
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4500
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
4501
{0.57735027, -0.18257419, 0.10540926, -0.14907120},
4502
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
4504
static const double coefficients2[6][4] = \
4505
{{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4506
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4507
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4508
{0.57735027, -0.18257419, -0.10540926, 0.14907120},
4509
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4510
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
4512
// Compute value(s).
4513
for (unsigned int r = 0; r < 4; r++)
4515
values[1] += coefficients0[dof][r]*basisvalues[r];
4516
values[2] += coefficients1[dof][r]*basisvalues[r];
4517
values[3] += coefficients2[dof][r]*basisvalues[r];
4518
}// end loop over 'r'
4520
// Using covariant Piola transform to map values back to the physical element
4521
const double tmp_ref0 = values[1];
4522
const double tmp_ref1 = values[2];
4523
const double tmp_ref2 = values[3];
4524
values[1] = (K_00*tmp_ref0 + K_10*tmp_ref1 + K_20*tmp_ref2);
4525
values[2] = (K_01*tmp_ref0 + K_11*tmp_ref1 + K_21*tmp_ref2);
4526
values[3] = (K_02*tmp_ref0 + K_12*tmp_ref1 + K_22*tmp_ref2);
4531
/// Evaluate all basis functions at given point in cell
4532
virtual void evaluate_basis_all(double* values,
4533
const double* coordinates,
4534
const ufc::cell& c) const
4536
// Helper variable to hold values of a single dof.
4537
double dof_values[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
4539
// Loop dofs and call evaluate_basis.
4540
for (unsigned int r = 0; r < 10; r++)
4542
evaluate_basis(r, dof_values, coordinates, c);
4543
for (unsigned int s = 0; s < 4; s++)
4545
values[r*4 + s] = dof_values[s];
4546
}// end loop over 's'
4547
}// end loop over 'r'
4550
/// Evaluate order n derivatives of basis function i at given point in cell
4551
virtual void evaluate_basis_derivatives(unsigned int i,
4554
const double* coordinates,
4555
const ufc::cell& c) const
4557
// Extract vertex coordinates
4558
const double * const * x = c.coordinates;
4560
// Compute Jacobian of affine map from reference cell
4561
const double J_00 = x[1][0] - x[0][0];
4562
const double J_01 = x[2][0] - x[0][0];
4563
const double J_02 = x[3][0] - x[0][0];
4564
const double J_10 = x[1][1] - x[0][1];
4565
const double J_11 = x[2][1] - x[0][1];
4566
const double J_12 = x[3][1] - x[0][1];
4567
const double J_20 = x[1][2] - x[0][2];
4568
const double J_21 = x[2][2] - x[0][2];
4569
const double J_22 = x[3][2] - x[0][2];
4571
// Compute sub determinants
4572
const double d_00 = J_11*J_22 - J_12*J_21;
4573
const double d_01 = J_12*J_20 - J_10*J_22;
4574
const double d_02 = J_10*J_21 - J_11*J_20;
4575
const double d_10 = J_02*J_21 - J_01*J_22;
4576
const double d_11 = J_00*J_22 - J_02*J_20;
4577
const double d_12 = J_01*J_20 - J_00*J_21;
4578
const double d_20 = J_01*J_12 - J_02*J_11;
4579
const double d_21 = J_02*J_10 - J_00*J_12;
4580
const double d_22 = J_00*J_11 - J_01*J_10;
4582
// Compute determinant of Jacobian
4583
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
4585
// Compute inverse of Jacobian
4586
const double K_00 = d_00 / detJ;
4587
const double K_01 = d_10 / detJ;
4588
const double K_02 = d_20 / detJ;
4589
const double K_10 = d_01 / detJ;
4590
const double K_11 = d_11 / detJ;
4591
const double K_12 = d_21 / detJ;
4592
const double K_20 = d_02 / detJ;
4593
const double K_21 = d_12 / detJ;
4594
const double K_22 = d_22 / detJ;
4596
// Compute constants
4597
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
4598
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
4599
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
4601
// Get coordinates and map to the reference (FIAT) element
4602
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
4603
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
4604
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
4607
// Compute number of derivatives.
4608
unsigned int num_derivatives = 1;
4610
for (unsigned int r = 0; r < n; r++)
4612
num_derivatives *= 3;
4613
}// end loop over 'r'
4615
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
4616
unsigned int **combinations = new unsigned int *[num_derivatives];
4617
for (unsigned int row = 0; row < num_derivatives; row++)
4619
combinations[row] = new unsigned int [n];
4620
for (unsigned int col = 0; col < n; col++)
4621
combinations[row][col] = 0;
4624
// Generate combinations of derivatives
4625
for (unsigned int row = 1; row < num_derivatives; row++)
4627
for (unsigned int num = 0; num < row; num++)
4629
for (unsigned int col = n-1; col+1 > 0; col--)
4631
if (combinations[row][col] + 1 > 2)
4632
combinations[row][col] = 0;
4635
combinations[row][col] += 1;
4642
// Compute inverse of Jacobian
4643
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
4645
// Declare transformation matrix
4646
// Declare pointer to two dimensional array and initialise
4647
double **transform = new double *[num_derivatives];
4649
for (unsigned int j = 0; j < num_derivatives; j++)
4651
transform[j] = new double [num_derivatives];
4652
for (unsigned int k = 0; k < num_derivatives; k++)
4653
transform[j][k] = 1;
4656
// Construct transformation matrix
4657
for (unsigned int row = 0; row < num_derivatives; row++)
4659
for (unsigned int col = 0; col < num_derivatives; col++)
4661
for (unsigned int k = 0; k < n; k++)
4662
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
4666
// Reset values. Assuming that values is always an array.
4667
for (unsigned int r = 0; r < 4*num_derivatives; r++)
4669
values[r] = 0.00000000;
4670
}// end loop over 'r'
4672
if (0 <= i && i <= 3)
4674
// Map degree of freedom to element degree of freedom
4675
const unsigned int dof = i;
4677
// Array of basisvalues
4678
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
4680
// Declare helper variables
4681
unsigned int rr = 0;
4682
unsigned int ss = 0;
4683
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
4685
// Compute basisvalues
4686
basisvalues[0] = 1.00000000;
4687
basisvalues[1] = tmp0;
4688
for (unsigned int r = 0; r < 1; r++)
4690
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
4691
ss = r*(r + 1)*(r + 2)/6;
4692
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
4693
}// end loop over 'r'
4694
for (unsigned int r = 0; r < 1; r++)
4696
for (unsigned int s = 0; s < 1 - r; s++)
4698
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
4699
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
4700
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
4701
}// end loop over 's'
4702
}// end loop over 'r'
4703
for (unsigned int r = 0; r < 2; r++)
4705
for (unsigned int s = 0; s < 2 - r; s++)
4707
for (unsigned int t = 0; t < 2 - r - s; t++)
4709
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
4710
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
4711
}// end loop over 't'
4712
}// end loop over 's'
4713
}// end loop over 'r'
4715
// Table(s) of coefficients
4716
static const double coefficients0[4][4] = \
4717
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
4718
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4719
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4720
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
4722
// Tables of derivatives of the polynomial base (transpose).
4723
static const double dmats0[4][4] = \
4724
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4725
{6.32455532, 0.00000000, 0.00000000, 0.00000000},
4726
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4727
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
4729
static const double dmats1[4][4] = \
4730
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4731
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
4732
{5.47722558, 0.00000000, 0.00000000, 0.00000000},
4733
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
4735
static const double dmats2[4][4] = \
4736
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4737
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
4738
{1.82574186, 0.00000000, 0.00000000, 0.00000000},
4739
{5.16397779, 0.00000000, 0.00000000, 0.00000000}};
4741
// Compute reference derivatives
4742
// Declare pointer to array of derivatives on FIAT element
4743
double *derivatives = new double [num_derivatives];
4744
for (unsigned int r = 0; r < num_derivatives; r++)
4746
derivatives[r] = 0.00000000;
4747
}// end loop over 'r'
4749
// Declare derivative matrix (of polynomial basis).
4750
double dmats[4][4] = \
4751
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
4752
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
4753
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
4754
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
4756
// Declare (auxiliary) derivative matrix (of polynomial basis).
4757
double dmats_old[4][4] = \
4758
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
4759
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
4760
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
4761
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
4763
// Loop possible derivatives.
4764
for (unsigned int r = 0; r < num_derivatives; r++)
4766
// Resetting dmats values to compute next derivative.
4767
for (unsigned int t = 0; t < 4; t++)
4769
for (unsigned int u = 0; u < 4; u++)
4771
dmats[t][u] = 0.00000000;
4774
dmats[t][u] = 1.00000000;
4777
}// end loop over 'u'
4778
}// end loop over 't'
4780
// Looping derivative order to generate dmats.
4781
for (unsigned int s = 0; s < n; s++)
4783
// Updating dmats_old with new values and resetting dmats.
4784
for (unsigned int t = 0; t < 4; t++)
4786
for (unsigned int u = 0; u < 4; u++)
4788
dmats_old[t][u] = dmats[t][u];
4789
dmats[t][u] = 0.00000000;
4790
}// end loop over 'u'
4791
}// end loop over 't'
4793
// Update dmats using an inner product.
4794
if (combinations[r][s] == 0)
4796
for (unsigned int t = 0; t < 4; t++)
4798
for (unsigned int u = 0; u < 4; u++)
4800
for (unsigned int tu = 0; tu < 4; tu++)
4802
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
4803
}// end loop over 'tu'
4804
}// end loop over 'u'
4805
}// end loop over 't'
4808
if (combinations[r][s] == 1)
4810
for (unsigned int t = 0; t < 4; t++)
4812
for (unsigned int u = 0; u < 4; u++)
4814
for (unsigned int tu = 0; tu < 4; tu++)
4816
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
4817
}// end loop over 'tu'
4818
}// end loop over 'u'
4819
}// end loop over 't'
4822
if (combinations[r][s] == 2)
4824
for (unsigned int t = 0; t < 4; t++)
4826
for (unsigned int u = 0; u < 4; u++)
4828
for (unsigned int tu = 0; tu < 4; tu++)
4830
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
4831
}// end loop over 'tu'
4832
}// end loop over 'u'
4833
}// end loop over 't'
4836
}// end loop over 's'
4837
for (unsigned int s = 0; s < 4; s++)
4839
for (unsigned int t = 0; t < 4; t++)
4841
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
4842
}// end loop over 't'
4843
}// end loop over 's'
4844
}// end loop over 'r'
4846
// Transform derivatives back to physical element
4847
for (unsigned int row = 0; row < num_derivatives; row++)
4849
for (unsigned int col = 0; col < num_derivatives; col++)
4851
values[row] += transform[row][col]*derivatives[col];
4855
// Delete pointer to array of derivatives on FIAT element
4856
delete [] derivatives;
4858
// Delete pointer to array of combinations of derivatives and transform
4859
for (unsigned int r = 0; r < num_derivatives; r++)
4861
delete [] combinations[r];
4862
delete [] transform[r];
4863
}// end loop over 'r'
4864
delete [] combinations;
4865
delete [] transform;
4868
if (4 <= i && i <= 9)
4870
// Map degree of freedom to element degree of freedom
4871
const unsigned int dof = i - 4;
4873
// Array of basisvalues
4874
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
4876
// Declare helper variables
4877
unsigned int rr = 0;
4878
unsigned int ss = 0;
4879
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
4881
// Compute basisvalues
4882
basisvalues[0] = 1.00000000;
4883
basisvalues[1] = tmp0;
4884
for (unsigned int r = 0; r < 1; r++)
4886
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
4887
ss = r*(r + 1)*(r + 2)/6;
4888
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
4889
}// end loop over 'r'
4890
for (unsigned int r = 0; r < 1; r++)
4892
for (unsigned int s = 0; s < 1 - r; s++)
4894
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
4895
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
4896
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
4897
}// end loop over 's'
4898
}// end loop over 'r'
4899
for (unsigned int r = 0; r < 2; r++)
4901
for (unsigned int s = 0; s < 2 - r; s++)
4903
for (unsigned int t = 0; t < 2 - r - s; t++)
4905
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
4906
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
4907
}// end loop over 't'
4908
}// end loop over 's'
4909
}// end loop over 'r'
4911
// Table(s) of coefficients
4912
static const double coefficients0[6][4] = \
4913
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4914
{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
4915
{-0.28867513, 0.00000000, -0.21081851, 0.07453560},
4916
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
4917
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4918
{0.57735027, 0.00000000, -0.21081851, -0.14907120}};
4920
static const double coefficients1[6][4] = \
4921
{{-0.28867513, 0.00000000, 0.00000000, -0.22360680},
4922
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4923
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4924
{0.28867513, 0.00000000, 0.00000000, 0.22360680},
4925
{0.57735027, -0.18257419, 0.10540926, -0.14907120},
4926
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
4928
static const double coefficients2[6][4] = \
4929
{{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4930
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
4931
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4932
{0.57735027, -0.18257419, -0.10540926, 0.14907120},
4933
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
4934
{0.28867513, 0.18257419, -0.10540926, -0.07453560}};
4936
// Tables of derivatives of the polynomial base (transpose).
4937
static const double dmats0[4][4] = \
4938
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4939
{6.32455532, 0.00000000, 0.00000000, 0.00000000},
4940
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4941
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
4943
static const double dmats1[4][4] = \
4944
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4945
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
4946
{5.47722558, 0.00000000, 0.00000000, 0.00000000},
4947
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
4949
static const double dmats2[4][4] = \
4950
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
4951
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
4952
{1.82574186, 0.00000000, 0.00000000, 0.00000000},
4953
{5.16397779, 0.00000000, 0.00000000, 0.00000000}};
4955
// Compute reference derivatives
4956
// Declare pointer to array of derivatives on FIAT element
4957
double *derivatives = new double [3*num_derivatives];
4958
for (unsigned int r = 0; r < 3*num_derivatives; r++)
4960
derivatives[r] = 0.00000000;
4961
}// end loop over 'r'
4963
// Declare derivative matrix (of polynomial basis).
4964
double dmats[4][4] = \
4965
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
4966
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
4967
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
4968
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
4970
// Declare (auxiliary) derivative matrix (of polynomial basis).
4971
double dmats_old[4][4] = \
4972
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
4973
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
4974
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
4975
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
4977
// Loop possible derivatives.
4978
for (unsigned int r = 0; r < num_derivatives; r++)
4980
// Resetting dmats values to compute next derivative.
4981
for (unsigned int t = 0; t < 4; t++)
4983
for (unsigned int u = 0; u < 4; u++)
4985
dmats[t][u] = 0.00000000;
4988
dmats[t][u] = 1.00000000;
4991
}// end loop over 'u'
4992
}// end loop over 't'
4994
// Looping derivative order to generate dmats.
4995
for (unsigned int s = 0; s < n; s++)
4997
// Updating dmats_old with new values and resetting dmats.
4998
for (unsigned int t = 0; t < 4; t++)
5000
for (unsigned int u = 0; u < 4; u++)
5002
dmats_old[t][u] = dmats[t][u];
5003
dmats[t][u] = 0.00000000;
5004
}// end loop over 'u'
5005
}// end loop over 't'
5007
// Update dmats using an inner product.
5008
if (combinations[r][s] == 0)
5010
for (unsigned int t = 0; t < 4; t++)
5012
for (unsigned int u = 0; u < 4; u++)
5014
for (unsigned int tu = 0; tu < 4; tu++)
5016
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
5017
}// end loop over 'tu'
5018
}// end loop over 'u'
5019
}// end loop over 't'
5022
if (combinations[r][s] == 1)
5024
for (unsigned int t = 0; t < 4; t++)
5026
for (unsigned int u = 0; u < 4; u++)
5028
for (unsigned int tu = 0; tu < 4; tu++)
5030
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
5031
}// end loop over 'tu'
5032
}// end loop over 'u'
5033
}// end loop over 't'
5036
if (combinations[r][s] == 2)
5038
for (unsigned int t = 0; t < 4; t++)
5040
for (unsigned int u = 0; u < 4; u++)
5042
for (unsigned int tu = 0; tu < 4; tu++)
5044
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
5045
}// end loop over 'tu'
5046
}// end loop over 'u'
5047
}// end loop over 't'
5050
}// end loop over 's'
5051
for (unsigned int s = 0; s < 4; s++)
5053
for (unsigned int t = 0; t < 4; t++)
5055
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
5056
derivatives[num_derivatives + r] += coefficients1[dof][s]*dmats[s][t]*basisvalues[t];
5057
derivatives[2*num_derivatives + r] += coefficients2[dof][s]*dmats[s][t]*basisvalues[t];
5058
}// end loop over 't'
5059
}// end loop over 's'
5061
// Using covariant Piola transform to map values back to the physical element
5062
const double tmp_ref0 = derivatives[r];
5063
const double tmp_ref1 = derivatives[num_derivatives + r];
5064
const double tmp_ref2 = derivatives[2*num_derivatives + r];
5065
derivatives[r] = (K_00*tmp_ref0 + K_10*tmp_ref1 + K_20*tmp_ref2);
5066
derivatives[num_derivatives + r] = (K_01*tmp_ref0 + K_11*tmp_ref1 + K_21*tmp_ref2);
5067
derivatives[2*num_derivatives + r] = (K_02*tmp_ref0 + K_12*tmp_ref1 + K_22*tmp_ref2);
5068
}// end loop over 'r'
5070
// Transform derivatives back to physical element
5071
for (unsigned int row = 0; row < num_derivatives; row++)
5073
for (unsigned int col = 0; col < num_derivatives; col++)
5075
values[num_derivatives + row] += transform[row][col]*derivatives[col];
5076
values[2*num_derivatives + row] += transform[row][col]*derivatives[num_derivatives + col];
5077
values[3*num_derivatives + row] += transform[row][col]*derivatives[2*num_derivatives + col];
5081
// Delete pointer to array of derivatives on FIAT element
5082
delete [] derivatives;
5084
// Delete pointer to array of combinations of derivatives and transform
5085
for (unsigned int r = 0; r < num_derivatives; r++)
5087
delete [] combinations[r];
5088
delete [] transform[r];
5089
}// end loop over 'r'
5090
delete [] combinations;
5091
delete [] transform;
5096
/// Evaluate order n derivatives of all basis functions at given point in cell
5097
virtual void evaluate_basis_derivatives_all(unsigned int n,
5099
const double* coordinates,
5100
const ufc::cell& c) const
5102
// Compute number of derivatives.
5103
unsigned int num_derivatives = 1;
5105
for (unsigned int r = 0; r < n; r++)
5107
num_derivatives *= 3;
5108
}// end loop over 'r'
5110
// Helper variable to hold values of a single dof.
5111
double *dof_values = new double [4*num_derivatives];
5112
for (unsigned int r = 0; r < 4*num_derivatives; r++)
5114
dof_values[r] = 0.00000000;
5115
}// end loop over 'r'
5117
// Loop dofs and call evaluate_basis_derivatives.
5118
for (unsigned int r = 0; r < 10; r++)
5120
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
5121
for (unsigned int s = 0; s < 4*num_derivatives; s++)
5123
values[r*4*num_derivatives + s] = dof_values[s];
5124
}// end loop over 's'
5125
}// end loop over 'r'
5128
delete [] dof_values;
5131
/// Evaluate linear functional for dof i on the function f
5132
virtual double evaluate_dof(unsigned int i,
5133
const ufc::function& f,
5134
const ufc::cell& c) const
5136
// Declare variables for result of evaluation
5139
// Declare variable for physical coordinates
5144
// Extract vertex coordinates
5145
const double * const * x = c.coordinates;
5147
// Compute Jacobian of affine map from reference cell
5148
const double J_00 = x[1][0] - x[0][0];
5149
const double J_01 = x[2][0] - x[0][0];
5150
const double J_02 = x[3][0] - x[0][0];
5151
const double J_10 = x[1][1] - x[0][1];
5152
const double J_11 = x[2][1] - x[0][1];
5153
const double J_12 = x[3][1] - x[0][1];
5154
const double J_20 = x[1][2] - x[0][2];
5155
const double J_21 = x[2][2] - x[0][2];
5156
const double J_22 = x[3][2] - x[0][2];switch (i)
5163
f.evaluate(vals, y, c);
5172
f.evaluate(vals, y, c);
5181
f.evaluate(vals, y, c);
5190
f.evaluate(vals, y, c);
5196
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
5197
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
5198
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
5199
f.evaluate(vals, y, c);
5200
result = (-1.0)*(J_01*vals[1] + J_11*vals[2] + J_21*vals[3]) + (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5206
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
5207
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
5208
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
5209
f.evaluate(vals, y, c);
5210
result = (-1.0)*(J_00*vals[1] + J_10*vals[2] + J_20*vals[3]) + (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5216
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
5217
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
5218
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
5219
f.evaluate(vals, y, c);
5220
result = (-1.0)*(J_00*vals[1] + J_10*vals[2] + J_20*vals[3]) + (J_01*vals[1] + J_11*vals[2] + J_21*vals[3]);
5226
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
5227
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
5228
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
5229
f.evaluate(vals, y, c);
5230
result = (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5236
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
5237
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
5238
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
5239
f.evaluate(vals, y, c);
5240
result = (J_01*vals[1] + J_11*vals[2] + J_21*vals[3]);
5246
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
5247
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
5248
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
5249
f.evaluate(vals, y, c);
5250
result = (J_00*vals[1] + J_10*vals[2] + J_20*vals[3]);
5259
/// Evaluate linear functionals for all dofs on the function f
5260
virtual void evaluate_dofs(double* values,
5261
const ufc::function& f,
5262
const ufc::cell& c) const
5264
// Declare variables for result of evaluation
5267
// Declare variable for physical coordinates
5272
// Extract vertex coordinates
5273
const double * const * x = c.coordinates;
5275
// Compute Jacobian of affine map from reference cell
5276
const double J_00 = x[1][0] - x[0][0];
5277
const double J_01 = x[2][0] - x[0][0];
5278
const double J_02 = x[3][0] - x[0][0];
5279
const double J_10 = x[1][1] - x[0][1];
5280
const double J_11 = x[2][1] - x[0][1];
5281
const double J_12 = x[3][1] - x[0][1];
5282
const double J_20 = x[1][2] - x[0][2];
5283
const double J_21 = x[2][2] - x[0][2];
5284
const double J_22 = x[3][2] - x[0][2];y[0] = x[0][0];
5287
f.evaluate(vals, y, c);
5288
values[0] = vals[0];
5292
f.evaluate(vals, y, c);
5293
values[1] = vals[0];
5297
f.evaluate(vals, y, c);
5298
values[2] = vals[0];
5302
f.evaluate(vals, y, c);
5303
values[3] = vals[0];
5304
y[0] = 0.5*x[2][0] + 0.5*x[3][0];
5305
y[1] = 0.5*x[2][1] + 0.5*x[3][1];
5306
y[2] = 0.5*x[2][2] + 0.5*x[3][2];
5307
f.evaluate(vals, y, c);
5308
result = (-1.0)*(J_01*vals[1] + J_11*vals[2] + J_21*vals[3]) + (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5310
y[0] = 0.5*x[1][0] + 0.5*x[3][0];
5311
y[1] = 0.5*x[1][1] + 0.5*x[3][1];
5312
y[2] = 0.5*x[1][2] + 0.5*x[3][2];
5313
f.evaluate(vals, y, c);
5314
result = (-1.0)*(J_00*vals[1] + J_10*vals[2] + J_20*vals[3]) + (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5316
y[0] = 0.5*x[1][0] + 0.5*x[2][0];
5317
y[1] = 0.5*x[1][1] + 0.5*x[2][1];
5318
y[2] = 0.5*x[1][2] + 0.5*x[2][2];
5319
f.evaluate(vals, y, c);
5320
result = (-1.0)*(J_00*vals[1] + J_10*vals[2] + J_20*vals[3]) + (J_01*vals[1] + J_11*vals[2] + J_21*vals[3]);
5322
y[0] = 0.5*x[0][0] + 0.5*x[3][0];
5323
y[1] = 0.5*x[0][1] + 0.5*x[3][1];
5324
y[2] = 0.5*x[0][2] + 0.5*x[3][2];
5325
f.evaluate(vals, y, c);
5326
result = (J_02*vals[1] + J_12*vals[2] + J_22*vals[3]);
5328
y[0] = 0.5*x[0][0] + 0.5*x[2][0];
5329
y[1] = 0.5*x[0][1] + 0.5*x[2][1];
5330
y[2] = 0.5*x[0][2] + 0.5*x[2][2];
5331
f.evaluate(vals, y, c);
5332
result = (J_01*vals[1] + J_11*vals[2] + J_21*vals[3]);
5334
y[0] = 0.5*x[0][0] + 0.5*x[1][0];
5335
y[1] = 0.5*x[0][1] + 0.5*x[1][1];
5336
y[2] = 0.5*x[0][2] + 0.5*x[1][2];
5337
f.evaluate(vals, y, c);
5338
result = (J_00*vals[1] + J_10*vals[2] + J_20*vals[3]);
5342
/// Interpolate vertex values from dof values
5343
virtual void interpolate_vertex_values(double* vertex_values,
5344
const double* dof_values,
5345
const ufc::cell& c) const
5347
// Extract vertex coordinates
5348
const double * const * x = c.coordinates;
5350
// Compute Jacobian of affine map from reference cell
5351
const double J_00 = x[1][0] - x[0][0];
5352
const double J_01 = x[2][0] - x[0][0];
5353
const double J_02 = x[3][0] - x[0][0];
5354
const double J_10 = x[1][1] - x[0][1];
5355
const double J_11 = x[2][1] - x[0][1];
5356
const double J_12 = x[3][1] - x[0][1];
5357
const double J_20 = x[1][2] - x[0][2];
5358
const double J_21 = x[2][2] - x[0][2];
5359
const double J_22 = x[3][2] - x[0][2];
5361
// Compute sub determinants
5362
const double d_00 = J_11*J_22 - J_12*J_21;
5363
const double d_01 = J_12*J_20 - J_10*J_22;
5364
const double d_02 = J_10*J_21 - J_11*J_20;
5365
const double d_10 = J_02*J_21 - J_01*J_22;
5366
const double d_11 = J_00*J_22 - J_02*J_20;
5367
const double d_12 = J_01*J_20 - J_00*J_21;
5368
const double d_20 = J_01*J_12 - J_02*J_11;
5369
const double d_21 = J_02*J_10 - J_00*J_12;
5370
const double d_22 = J_00*J_11 - J_01*J_10;
5372
// Compute determinant of Jacobian
5373
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
5375
// Compute inverse of Jacobian
5376
const double K_00 = d_00 / detJ;
5377
const double K_01 = d_10 / detJ;
5378
const double K_02 = d_20 / detJ;
5379
const double K_10 = d_01 / detJ;
5380
const double K_11 = d_11 / detJ;
5381
const double K_12 = d_21 / detJ;
5382
const double K_20 = d_02 / detJ;
5383
const double K_21 = d_12 / detJ;
5384
const double K_22 = d_22 / detJ;
5385
// Evaluate function and change variables
5386
vertex_values[0] = dof_values[0];
5387
vertex_values[4] = dof_values[1];
5388
vertex_values[8] = dof_values[2];
5389
vertex_values[12] = dof_values[3];
5390
// Evaluate function and change variables
5391
vertex_values[1] = dof_values[7]*K_20 + dof_values[8]*K_10 + dof_values[9]*K_00;
5392
vertex_values[5] = dof_values[5]*K_20 + dof_values[6]*K_10 + dof_values[9]*(K_00 + K_10 + K_20);
5393
vertex_values[9] = dof_values[4]*K_20 + dof_values[6]*(K_00*(-1.0)) + dof_values[8]*(K_00 + K_10 + K_20);
5394
vertex_values[13] = dof_values[4]*(K_10*(-1.0)) + dof_values[5]*(K_00*(-1.0)) + dof_values[7]*(K_00 + K_10 + K_20);
5395
vertex_values[2] = dof_values[7]*K_21 + dof_values[8]*K_11 + dof_values[9]*K_01;
5396
vertex_values[6] = dof_values[5]*K_21 + dof_values[6]*K_11 + dof_values[9]*(K_01 + K_11 + K_21);
5397
vertex_values[10] = dof_values[4]*K_21 + dof_values[6]*(K_01*(-1.0)) + dof_values[8]*(K_01 + K_11 + K_21);
5398
vertex_values[14] = dof_values[4]*(K_11*(-1.0)) + dof_values[5]*(K_01*(-1.0)) + dof_values[7]*(K_01 + K_11 + K_21);
5399
vertex_values[3] = dof_values[7]*K_22 + dof_values[8]*K_12 + dof_values[9]*K_02;
5400
vertex_values[7] = dof_values[5]*K_22 + dof_values[6]*K_12 + dof_values[9]*(K_02 + K_12 + K_22);
5401
vertex_values[11] = dof_values[4]*K_22 + dof_values[6]*(K_02*(-1.0)) + dof_values[8]*(K_02 + K_12 + K_22);
5402
vertex_values[15] = dof_values[4]*(K_12*(-1.0)) + dof_values[5]*(K_02*(-1.0)) + dof_values[7]*(K_02 + K_12 + K_22);
5405
/// Return the number of sub elements (for a mixed element)
5406
virtual unsigned int num_sub_elements() const
5411
/// Create a new finite element for sub element i (for a mixed element)
5412
virtual ufc::finite_element* create_sub_element(unsigned int i) const
5418
return new vectorlaplacegradcurl_finite_element_2();
5423
return new vectorlaplacegradcurl_finite_element_3();
5433
/// This class defines the interface for a local-to-global mapping of
5434
/// degrees of freedom (dofs).
5436
class vectorlaplacegradcurl_dof_map_0: public ufc::dof_map
5440
unsigned int _global_dimension;
5445
vectorlaplacegradcurl_dof_map_0() : ufc::dof_map()
5447
_global_dimension = 0;
5451
virtual ~vectorlaplacegradcurl_dof_map_0()
5456
/// Return a string identifying the dof map
5457
virtual const char* signature() const
5459
return "FFC dofmap for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
5462
/// Return true iff mesh entities of topological dimension d are needed
5463
virtual bool needs_mesh_entities(unsigned int d) const
5492
/// Initialize dof map for mesh (return true iff init_cell() is needed)
5493
virtual bool init_mesh(const ufc::mesh& m)
5495
_global_dimension = m.num_entities[0] + m.num_entities[1];
5499
/// Initialize dof map for given cell
5500
virtual void init_cell(const ufc::mesh& m,
5506
/// Finish initialization of dof map for cells
5507
virtual void init_cell_finalize()
5512
/// Return the dimension of the global finite element function space
5513
virtual unsigned int global_dimension() const
5515
return _global_dimension;
5518
/// Return the dimension of the local finite element function space for a cell
5519
virtual unsigned int local_dimension(const ufc::cell& c) const
5524
/// Return the maximum dimension of the local finite element function space
5525
virtual unsigned int max_local_dimension() const
5530
// Return the geometric dimension of the coordinates this dof map provides
5531
virtual unsigned int geometric_dimension() const
5536
/// Return the number of dofs on each cell facet
5537
virtual unsigned int num_facet_dofs() const
5542
/// Return the number of dofs associated with each cell entity of dimension d
5543
virtual unsigned int num_entity_dofs(unsigned int d) const
5572
/// Tabulate the local-to-global mapping of dofs on a cell
5573
virtual void tabulate_dofs(unsigned int* dofs,
5575
const ufc::cell& c) const
5577
unsigned int offset = 0;
5579
dofs[0] = offset + c.entity_indices[0][0];
5580
dofs[1] = offset + c.entity_indices[0][1];
5581
dofs[2] = offset + c.entity_indices[0][2];
5582
dofs[3] = offset + c.entity_indices[0][3];
5583
offset += m.num_entities[0];
5584
dofs[4] = offset + c.entity_indices[1][0];
5585
dofs[5] = offset + c.entity_indices[1][1];
5586
dofs[6] = offset + c.entity_indices[1][2];
5587
dofs[7] = offset + c.entity_indices[1][3];
5588
dofs[8] = offset + c.entity_indices[1][4];
5589
dofs[9] = offset + c.entity_indices[1][5];
5590
offset += m.num_entities[1];
5593
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
5594
virtual void tabulate_facet_dofs(unsigned int* dofs,
5595
unsigned int facet) const
5643
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
5644
virtual void tabulate_entity_dofs(unsigned int* dofs,
5645
unsigned int d, unsigned int i) const
5649
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
5658
std::cerr << "*** FFC warning: " << "i is larger than number of entities (3)" << std::endl;
5691
std::cerr << "*** FFC warning: " << "i is larger than number of entities (5)" << std::endl;
5744
/// Tabulate the coordinates of all dofs on a cell
5745
virtual void tabulate_coordinates(double** coordinates,
5746
const ufc::cell& c) const
5748
const double * const * x = c.coordinates;
5750
coordinates[0][0] = x[0][0];
5751
coordinates[0][1] = x[0][1];
5752
coordinates[0][2] = x[0][2];
5753
coordinates[1][0] = x[1][0];
5754
coordinates[1][1] = x[1][1];
5755
coordinates[1][2] = x[1][2];
5756
coordinates[2][0] = x[2][0];
5757
coordinates[2][1] = x[2][1];
5758
coordinates[2][2] = x[2][2];
5759
coordinates[3][0] = x[3][0];
5760
coordinates[3][1] = x[3][1];
5761
coordinates[3][2] = x[3][2];
5762
coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
5763
coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
5764
coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
5765
coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
5766
coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
5767
coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
5768
coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
5769
coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
5770
coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
5771
coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
5772
coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
5773
coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
5774
coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
5775
coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
5776
coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
5777
coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
5778
coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
5779
coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
5782
/// Return the number of sub dof maps (for a mixed element)
5783
virtual unsigned int num_sub_dof_maps() const
5788
/// Create a new dof_map for sub dof map i (for a mixed element)
5789
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
5796
/// This class defines the interface for a local-to-global mapping of
5797
/// degrees of freedom (dofs).
5799
class vectorlaplacegradcurl_dof_map_1: public ufc::dof_map
5803
unsigned int _global_dimension;
5808
vectorlaplacegradcurl_dof_map_1() : ufc::dof_map()
5810
_global_dimension = 0;
5814
virtual ~vectorlaplacegradcurl_dof_map_1()
5819
/// Return a string identifying the dof map
5820
virtual const char* signature() const
5822
return "FFC dofmap for VectorElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2, 3)";
5825
/// Return true iff mesh entities of topological dimension d are needed
5826
virtual bool needs_mesh_entities(unsigned int d) const
5855
/// Initialize dof map for mesh (return true iff init_cell() is needed)
5856
virtual bool init_mesh(const ufc::mesh& m)
5858
_global_dimension = 3*m.num_entities[0] + 3*m.num_entities[1];
5862
/// Initialize dof map for given cell
5863
virtual void init_cell(const ufc::mesh& m,
5869
/// Finish initialization of dof map for cells
5870
virtual void init_cell_finalize()
5875
/// Return the dimension of the global finite element function space
5876
virtual unsigned int global_dimension() const
5878
return _global_dimension;
5881
/// Return the dimension of the local finite element function space for a cell
5882
virtual unsigned int local_dimension(const ufc::cell& c) const
5887
/// Return the maximum dimension of the local finite element function space
5888
virtual unsigned int max_local_dimension() const
5893
// Return the geometric dimension of the coordinates this dof map provides
5894
virtual unsigned int geometric_dimension() const
5899
/// Return the number of dofs on each cell facet
5900
virtual unsigned int num_facet_dofs() const
5905
/// Return the number of dofs associated with each cell entity of dimension d
5906
virtual unsigned int num_entity_dofs(unsigned int d) const
5935
/// Tabulate the local-to-global mapping of dofs on a cell
5936
virtual void tabulate_dofs(unsigned int* dofs,
5938
const ufc::cell& c) const
5940
unsigned int offset = 0;
5942
dofs[0] = offset + c.entity_indices[0][0];
5943
dofs[1] = offset + c.entity_indices[0][1];
5944
dofs[2] = offset + c.entity_indices[0][2];
5945
dofs[3] = offset + c.entity_indices[0][3];
5946
offset += m.num_entities[0];
5947
dofs[4] = offset + c.entity_indices[1][0];
5948
dofs[5] = offset + c.entity_indices[1][1];
5949
dofs[6] = offset + c.entity_indices[1][2];
5950
dofs[7] = offset + c.entity_indices[1][3];
5951
dofs[8] = offset + c.entity_indices[1][4];
5952
dofs[9] = offset + c.entity_indices[1][5];
5953
offset += m.num_entities[1];
5954
dofs[10] = offset + c.entity_indices[0][0];
5955
dofs[11] = offset + c.entity_indices[0][1];
5956
dofs[12] = offset + c.entity_indices[0][2];
5957
dofs[13] = offset + c.entity_indices[0][3];
5958
offset += m.num_entities[0];
5959
dofs[14] = offset + c.entity_indices[1][0];
5960
dofs[15] = offset + c.entity_indices[1][1];
5961
dofs[16] = offset + c.entity_indices[1][2];
5962
dofs[17] = offset + c.entity_indices[1][3];
5963
dofs[18] = offset + c.entity_indices[1][4];
5964
dofs[19] = offset + c.entity_indices[1][5];
5965
offset += m.num_entities[1];
5966
dofs[20] = offset + c.entity_indices[0][0];
5967
dofs[21] = offset + c.entity_indices[0][1];
5968
dofs[22] = offset + c.entity_indices[0][2];
5969
dofs[23] = offset + c.entity_indices[0][3];
5970
offset += m.num_entities[0];
5971
dofs[24] = offset + c.entity_indices[1][0];
5972
dofs[25] = offset + c.entity_indices[1][1];
5973
dofs[26] = offset + c.entity_indices[1][2];
5974
dofs[27] = offset + c.entity_indices[1][3];
5975
dofs[28] = offset + c.entity_indices[1][4];
5976
dofs[29] = offset + c.entity_indices[1][5];
5977
offset += m.num_entities[1];
5980
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
5981
virtual void tabulate_facet_dofs(unsigned int* dofs,
5982
unsigned int facet) const
6078
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
6079
virtual void tabulate_entity_dofs(unsigned int* dofs,
6080
unsigned int d, unsigned int i) const
6084
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
6093
std::cerr << "*** FFC warning: " << "i is larger than number of entities (3)" << std::endl;
6134
std::cerr << "*** FFC warning: " << "i is larger than number of entities (5)" << std::endl;
6199
/// Tabulate the coordinates of all dofs on a cell
6200
virtual void tabulate_coordinates(double** coordinates,
6201
const ufc::cell& c) const
6203
const double * const * x = c.coordinates;
6205
coordinates[0][0] = x[0][0];
6206
coordinates[0][1] = x[0][1];
6207
coordinates[0][2] = x[0][2];
6208
coordinates[1][0] = x[1][0];
6209
coordinates[1][1] = x[1][1];
6210
coordinates[1][2] = x[1][2];
6211
coordinates[2][0] = x[2][0];
6212
coordinates[2][1] = x[2][1];
6213
coordinates[2][2] = x[2][2];
6214
coordinates[3][0] = x[3][0];
6215
coordinates[3][1] = x[3][1];
6216
coordinates[3][2] = x[3][2];
6217
coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
6218
coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
6219
coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
6220
coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
6221
coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
6222
coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
6223
coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
6224
coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
6225
coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
6226
coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
6227
coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
6228
coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
6229
coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
6230
coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
6231
coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
6232
coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
6233
coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
6234
coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
6235
coordinates[10][0] = x[0][0];
6236
coordinates[10][1] = x[0][1];
6237
coordinates[10][2] = x[0][2];
6238
coordinates[11][0] = x[1][0];
6239
coordinates[11][1] = x[1][1];
6240
coordinates[11][2] = x[1][2];
6241
coordinates[12][0] = x[2][0];
6242
coordinates[12][1] = x[2][1];
6243
coordinates[12][2] = x[2][2];
6244
coordinates[13][0] = x[3][0];
6245
coordinates[13][1] = x[3][1];
6246
coordinates[13][2] = x[3][2];
6247
coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
6248
coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
6249
coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
6250
coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
6251
coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
6252
coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
6253
coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
6254
coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
6255
coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
6256
coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
6257
coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
6258
coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
6259
coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
6260
coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
6261
coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
6262
coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
6263
coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
6264
coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
6265
coordinates[20][0] = x[0][0];
6266
coordinates[20][1] = x[0][1];
6267
coordinates[20][2] = x[0][2];
6268
coordinates[21][0] = x[1][0];
6269
coordinates[21][1] = x[1][1];
6270
coordinates[21][2] = x[1][2];
6271
coordinates[22][0] = x[2][0];
6272
coordinates[22][1] = x[2][1];
6273
coordinates[22][2] = x[2][2];
6274
coordinates[23][0] = x[3][0];
6275
coordinates[23][1] = x[3][1];
6276
coordinates[23][2] = x[3][2];
6277
coordinates[24][0] = 0.5*x[2][0] + 0.5*x[3][0];
6278
coordinates[24][1] = 0.5*x[2][1] + 0.5*x[3][1];
6279
coordinates[24][2] = 0.5*x[2][2] + 0.5*x[3][2];
6280
coordinates[25][0] = 0.5*x[1][0] + 0.5*x[3][0];
6281
coordinates[25][1] = 0.5*x[1][1] + 0.5*x[3][1];
6282
coordinates[25][2] = 0.5*x[1][2] + 0.5*x[3][2];
6283
coordinates[26][0] = 0.5*x[1][0] + 0.5*x[2][0];
6284
coordinates[26][1] = 0.5*x[1][1] + 0.5*x[2][1];
6285
coordinates[26][2] = 0.5*x[1][2] + 0.5*x[2][2];
6286
coordinates[27][0] = 0.5*x[0][0] + 0.5*x[3][0];
6287
coordinates[27][1] = 0.5*x[0][1] + 0.5*x[3][1];
6288
coordinates[27][2] = 0.5*x[0][2] + 0.5*x[3][2];
6289
coordinates[28][0] = 0.5*x[0][0] + 0.5*x[2][0];
6290
coordinates[28][1] = 0.5*x[0][1] + 0.5*x[2][1];
6291
coordinates[28][2] = 0.5*x[0][2] + 0.5*x[2][2];
6292
coordinates[29][0] = 0.5*x[0][0] + 0.5*x[1][0];
6293
coordinates[29][1] = 0.5*x[0][1] + 0.5*x[1][1];
6294
coordinates[29][2] = 0.5*x[0][2] + 0.5*x[1][2];
6297
/// Return the number of sub dof maps (for a mixed element)
6298
virtual unsigned int num_sub_dof_maps() const
6303
/// Create a new dof_map for sub dof map i (for a mixed element)
6304
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
6310
return new vectorlaplacegradcurl_dof_map_0();
6315
return new vectorlaplacegradcurl_dof_map_0();
6320
return new vectorlaplacegradcurl_dof_map_0();
6330
/// This class defines the interface for a local-to-global mapping of
6331
/// degrees of freedom (dofs).
6333
class vectorlaplacegradcurl_dof_map_2: public ufc::dof_map
6337
unsigned int _global_dimension;
6342
vectorlaplacegradcurl_dof_map_2() : ufc::dof_map()
6344
_global_dimension = 0;
6348
virtual ~vectorlaplacegradcurl_dof_map_2()
6353
/// Return a string identifying the dof map
6354
virtual const char* signature() const
6356
return "FFC dofmap for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
6359
/// Return true iff mesh entities of topological dimension d are needed
6360
virtual bool needs_mesh_entities(unsigned int d) const
6389
/// Initialize dof map for mesh (return true iff init_cell() is needed)
6390
virtual bool init_mesh(const ufc::mesh& m)
6392
_global_dimension = m.num_entities[0];
6396
/// Initialize dof map for given cell
6397
virtual void init_cell(const ufc::mesh& m,
6403
/// Finish initialization of dof map for cells
6404
virtual void init_cell_finalize()
6409
/// Return the dimension of the global finite element function space
6410
virtual unsigned int global_dimension() const
6412
return _global_dimension;
6415
/// Return the dimension of the local finite element function space for a cell
6416
virtual unsigned int local_dimension(const ufc::cell& c) const
6421
/// Return the maximum dimension of the local finite element function space
6422
virtual unsigned int max_local_dimension() const
6427
// Return the geometric dimension of the coordinates this dof map provides
6428
virtual unsigned int geometric_dimension() const
6433
/// Return the number of dofs on each cell facet
6434
virtual unsigned int num_facet_dofs() const
6439
/// Return the number of dofs associated with each cell entity of dimension d
6440
virtual unsigned int num_entity_dofs(unsigned int d) const
6469
/// Tabulate the local-to-global mapping of dofs on a cell
6470
virtual void tabulate_dofs(unsigned int* dofs,
6472
const ufc::cell& c) const
6474
dofs[0] = c.entity_indices[0][0];
6475
dofs[1] = c.entity_indices[0][1];
6476
dofs[2] = c.entity_indices[0][2];
6477
dofs[3] = c.entity_indices[0][3];
6480
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
6481
virtual void tabulate_facet_dofs(unsigned int* dofs,
6482
unsigned int facet) const
6518
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
6519
virtual void tabulate_entity_dofs(unsigned int* dofs,
6520
unsigned int d, unsigned int i) const
6524
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
6533
std::cerr << "*** FFC warning: " << "i is larger than number of entities (3)" << std::endl;
6581
/// Tabulate the coordinates of all dofs on a cell
6582
virtual void tabulate_coordinates(double** coordinates,
6583
const ufc::cell& c) const
6585
const double * const * x = c.coordinates;
6587
coordinates[0][0] = x[0][0];
6588
coordinates[0][1] = x[0][1];
6589
coordinates[0][2] = x[0][2];
6590
coordinates[1][0] = x[1][0];
6591
coordinates[1][1] = x[1][1];
6592
coordinates[1][2] = x[1][2];
6593
coordinates[2][0] = x[2][0];
6594
coordinates[2][1] = x[2][1];
6595
coordinates[2][2] = x[2][2];
6596
coordinates[3][0] = x[3][0];
6597
coordinates[3][1] = x[3][1];
6598
coordinates[3][2] = x[3][2];
6601
/// Return the number of sub dof maps (for a mixed element)
6602
virtual unsigned int num_sub_dof_maps() const
6607
/// Create a new dof_map for sub dof map i (for a mixed element)
6608
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
6615
/// This class defines the interface for a local-to-global mapping of
6616
/// degrees of freedom (dofs).
6618
class vectorlaplacegradcurl_dof_map_3: public ufc::dof_map
6622
unsigned int _global_dimension;
6627
vectorlaplacegradcurl_dof_map_3() : ufc::dof_map()
6629
_global_dimension = 0;
6633
virtual ~vectorlaplacegradcurl_dof_map_3()
6638
/// Return a string identifying the dof map
6639
virtual const char* signature() const
6641
return "FFC dofmap for FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)";
6644
/// Return true iff mesh entities of topological dimension d are needed
6645
virtual bool needs_mesh_entities(unsigned int d) const
6674
/// Initialize dof map for mesh (return true iff init_cell() is needed)
6675
virtual bool init_mesh(const ufc::mesh& m)
6677
_global_dimension = m.num_entities[1];
6681
/// Initialize dof map for given cell
6682
virtual void init_cell(const ufc::mesh& m,
6688
/// Finish initialization of dof map for cells
6689
virtual void init_cell_finalize()
6694
/// Return the dimension of the global finite element function space
6695
virtual unsigned int global_dimension() const
6697
return _global_dimension;
6700
/// Return the dimension of the local finite element function space for a cell
6701
virtual unsigned int local_dimension(const ufc::cell& c) const
6706
/// Return the maximum dimension of the local finite element function space
6707
virtual unsigned int max_local_dimension() const
6712
// Return the geometric dimension of the coordinates this dof map provides
6713
virtual unsigned int geometric_dimension() const
6718
/// Return the number of dofs on each cell facet
6719
virtual unsigned int num_facet_dofs() const
6724
/// Return the number of dofs associated with each cell entity of dimension d
6725
virtual unsigned int num_entity_dofs(unsigned int d) const
6754
/// Tabulate the local-to-global mapping of dofs on a cell
6755
virtual void tabulate_dofs(unsigned int* dofs,
6757
const ufc::cell& c) const
6759
dofs[0] = c.entity_indices[1][0];
6760
dofs[1] = c.entity_indices[1][1];
6761
dofs[2] = c.entity_indices[1][2];
6762
dofs[3] = c.entity_indices[1][3];
6763
dofs[4] = c.entity_indices[1][4];
6764
dofs[5] = c.entity_indices[1][5];
6767
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
6768
virtual void tabulate_facet_dofs(unsigned int* dofs,
6769
unsigned int facet) const
6805
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
6806
virtual void tabulate_entity_dofs(unsigned int* dofs,
6807
unsigned int d, unsigned int i) const
6811
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
6825
std::cerr << "*** FFC warning: " << "i is larger than number of entities (5)" << std::endl;
6878
/// Tabulate the coordinates of all dofs on a cell
6879
virtual void tabulate_coordinates(double** coordinates,
6880
const ufc::cell& c) const
6882
const double * const * x = c.coordinates;
6884
coordinates[0][0] = 0.5*x[2][0] + 0.5*x[3][0];
6885
coordinates[0][1] = 0.5*x[2][1] + 0.5*x[3][1];
6886
coordinates[0][2] = 0.5*x[2][2] + 0.5*x[3][2];
6887
coordinates[1][0] = 0.5*x[1][0] + 0.5*x[3][0];
6888
coordinates[1][1] = 0.5*x[1][1] + 0.5*x[3][1];
6889
coordinates[1][2] = 0.5*x[1][2] + 0.5*x[3][2];
6890
coordinates[2][0] = 0.5*x[1][0] + 0.5*x[2][0];
6891
coordinates[2][1] = 0.5*x[1][1] + 0.5*x[2][1];
6892
coordinates[2][2] = 0.5*x[1][2] + 0.5*x[2][2];
6893
coordinates[3][0] = 0.5*x[0][0] + 0.5*x[3][0];
6894
coordinates[3][1] = 0.5*x[0][1] + 0.5*x[3][1];
6895
coordinates[3][2] = 0.5*x[0][2] + 0.5*x[3][2];
6896
coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
6897
coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
6898
coordinates[4][2] = 0.5*x[0][2] + 0.5*x[2][2];
6899
coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
6900
coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
6901
coordinates[5][2] = 0.5*x[0][2] + 0.5*x[1][2];
6904
/// Return the number of sub dof maps (for a mixed element)
6905
virtual unsigned int num_sub_dof_maps() const
6910
/// Create a new dof_map for sub dof map i (for a mixed element)
6911
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
6918
/// This class defines the interface for a local-to-global mapping of
6919
/// degrees of freedom (dofs).
6921
class vectorlaplacegradcurl_dof_map_4: public ufc::dof_map
6925
unsigned int _global_dimension;
6930
vectorlaplacegradcurl_dof_map_4() : ufc::dof_map()
6932
_global_dimension = 0;
6936
virtual ~vectorlaplacegradcurl_dof_map_4()
6941
/// Return a string identifying the dof map
6942
virtual const char* signature() const
6944
return "FFC dofmap for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) })";
6947
/// Return true iff mesh entities of topological dimension d are needed
6948
virtual bool needs_mesh_entities(unsigned int d) const
6977
/// Initialize dof map for mesh (return true iff init_cell() is needed)
6978
virtual bool init_mesh(const ufc::mesh& m)
6980
_global_dimension = m.num_entities[0] + m.num_entities[1];
6984
/// Initialize dof map for given cell
6985
virtual void init_cell(const ufc::mesh& m,
6991
/// Finish initialization of dof map for cells
6992
virtual void init_cell_finalize()
6997
/// Return the dimension of the global finite element function space
6998
virtual unsigned int global_dimension() const
7000
return _global_dimension;
7003
/// Return the dimension of the local finite element function space for a cell
7004
virtual unsigned int local_dimension(const ufc::cell& c) const
7009
/// Return the maximum dimension of the local finite element function space
7010
virtual unsigned int max_local_dimension() const
7015
// Return the geometric dimension of the coordinates this dof map provides
7016
virtual unsigned int geometric_dimension() const
7021
/// Return the number of dofs on each cell facet
7022
virtual unsigned int num_facet_dofs() const
7027
/// Return the number of dofs associated with each cell entity of dimension d
7028
virtual unsigned int num_entity_dofs(unsigned int d) const
7057
/// Tabulate the local-to-global mapping of dofs on a cell
7058
virtual void tabulate_dofs(unsigned int* dofs,
7060
const ufc::cell& c) const
7062
unsigned int offset = 0;
7064
dofs[0] = offset + c.entity_indices[0][0];
7065
dofs[1] = offset + c.entity_indices[0][1];
7066
dofs[2] = offset + c.entity_indices[0][2];
7067
dofs[3] = offset + c.entity_indices[0][3];
7068
offset += m.num_entities[0];
7069
dofs[4] = offset + c.entity_indices[1][0];
7070
dofs[5] = offset + c.entity_indices[1][1];
7071
dofs[6] = offset + c.entity_indices[1][2];
7072
dofs[7] = offset + c.entity_indices[1][3];
7073
dofs[8] = offset + c.entity_indices[1][4];
7074
dofs[9] = offset + c.entity_indices[1][5];
7075
offset += m.num_entities[1];
7078
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
7079
virtual void tabulate_facet_dofs(unsigned int* dofs,
7080
unsigned int facet) const
7128
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
7129
virtual void tabulate_entity_dofs(unsigned int* dofs,
7130
unsigned int d, unsigned int i) const
7134
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
7143
std::cerr << "*** FFC warning: " << "i is larger than number of entities (3)" << std::endl;
7176
std::cerr << "*** FFC warning: " << "i is larger than number of entities (5)" << std::endl;
7229
/// Tabulate the coordinates of all dofs on a cell
7230
virtual void tabulate_coordinates(double** coordinates,
7231
const ufc::cell& c) const
7233
const double * const * x = c.coordinates;
7235
coordinates[0][0] = x[0][0];
7236
coordinates[0][1] = x[0][1];
7237
coordinates[0][2] = x[0][2];
7238
coordinates[1][0] = x[1][0];
7239
coordinates[1][1] = x[1][1];
7240
coordinates[1][2] = x[1][2];
7241
coordinates[2][0] = x[2][0];
7242
coordinates[2][1] = x[2][1];
7243
coordinates[2][2] = x[2][2];
7244
coordinates[3][0] = x[3][0];
7245
coordinates[3][1] = x[3][1];
7246
coordinates[3][2] = x[3][2];
7247
coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
7248
coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
7249
coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
7250
coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
7251
coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
7252
coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
7253
coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
7254
coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
7255
coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
7256
coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
7257
coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
7258
coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
7259
coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
7260
coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
7261
coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
7262
coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
7263
coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
7264
coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
7267
/// Return the number of sub dof maps (for a mixed element)
7268
virtual unsigned int num_sub_dof_maps() const
7273
/// Create a new dof_map for sub dof map i (for a mixed element)
7274
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
7280
return new vectorlaplacegradcurl_dof_map_2();
7285
return new vectorlaplacegradcurl_dof_map_3();
7295
/// This class defines the interface for the tabulation of the cell
7296
/// tensor corresponding to the local contribution to a form from
7297
/// the integral over a cell.
7299
class vectorlaplacegradcurl_cell_integral_0_0: public ufc::cell_integral
7304
vectorlaplacegradcurl_cell_integral_0_0() : ufc::cell_integral()
7310
virtual ~vectorlaplacegradcurl_cell_integral_0_0()
7315
/// Tabulate the tensor for the contribution from a local cell
7316
virtual void tabulate_tensor(double* A,
7317
const double * const * w,
7318
const ufc::cell& c) const
7320
// Extract vertex coordinates
7321
const double * const * x = c.coordinates;
7323
// Compute Jacobian of affine map from reference cell
7324
const double J_00 = x[1][0] - x[0][0];
7325
const double J_01 = x[2][0] - x[0][0];
7326
const double J_02 = x[3][0] - x[0][0];
7327
const double J_10 = x[1][1] - x[0][1];
7328
const double J_11 = x[2][1] - x[0][1];
7329
const double J_12 = x[3][1] - x[0][1];
7330
const double J_20 = x[1][2] - x[0][2];
7331
const double J_21 = x[2][2] - x[0][2];
7332
const double J_22 = x[3][2] - x[0][2];
7334
// Compute sub determinants
7335
const double d_00 = J_11*J_22 - J_12*J_21;
7336
const double d_01 = J_12*J_20 - J_10*J_22;
7337
const double d_02 = J_10*J_21 - J_11*J_20;
7338
const double d_10 = J_02*J_21 - J_01*J_22;
7339
const double d_11 = J_00*J_22 - J_02*J_20;
7340
const double d_12 = J_01*J_20 - J_00*J_21;
7341
const double d_20 = J_01*J_12 - J_02*J_11;
7342
const double d_21 = J_02*J_10 - J_00*J_12;
7343
const double d_22 = J_00*J_11 - J_01*J_10;
7345
// Compute determinant of Jacobian
7346
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
7348
// Compute inverse of Jacobian
7349
const double K_00 = d_00 / detJ;
7350
const double K_01 = d_10 / detJ;
7351
const double K_02 = d_20 / detJ;
7352
const double K_10 = d_01 / detJ;
7353
const double K_11 = d_11 / detJ;
7354
const double K_12 = d_21 / detJ;
7355
const double K_20 = d_02 / detJ;
7356
const double K_21 = d_12 / detJ;
7357
const double K_22 = d_22 / detJ;
7360
const double det = std::abs(detJ);
7362
// Array of quadrature weights
7363
static const double W8[8] = {0.03697986, 0.01602704, 0.02115701, 0.00916943, 0.03697986, 0.01602704, 0.02115701, 0.00916943};
7364
// Quadrature points on the UFC reference element: (0.15668264, 0.13605498, 0.12251482), (0.08139567, 0.07067972, 0.54415184), (0.06583869, 0.56593317, 0.12251482), (0.03420279, 0.29399880, 0.54415184), (0.58474756, 0.13605498, 0.12251482), (0.30377276, 0.07067972, 0.54415184), (0.24571333, 0.56593317, 0.12251482), (0.12764656, 0.29399880, 0.54415184)
7366
// Value of basis functions at quadrature points.
7367
static const double FE0_C0[8][10] = \
7368
{{0.58474756, 0.15668264, 0.13605498, 0.12251482, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7369
{0.30377276, 0.08139567, 0.07067972, 0.54415184, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7370
{0.24571333, 0.06583869, 0.56593317, 0.12251482, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7371
{0.12764656, 0.03420279, 0.29399880, 0.54415184, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7372
{0.15668264, 0.58474756, 0.13605498, 0.12251482, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7373
{0.08139567, 0.30377276, 0.07067972, 0.54415184, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7374
{0.06583869, 0.24571333, 0.56593317, 0.12251482, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7375
{0.03420279, 0.12764656, 0.29399880, 0.54415184, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
7377
static const double FE0_C0_D001[8][10] = \
7378
{{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7379
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7380
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7381
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7382
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7383
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7384
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7385
{-1.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
7387
static const double FE0_C0_D010[8][10] = \
7388
{{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7389
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7390
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7391
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7392
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7393
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7394
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7395
{-1.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
7397
static const double FE0_C0_D100[8][10] = \
7398
{{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7399
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7400
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7401
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7402
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7403
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7404
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7405
{-1.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
7407
static const double FE0_C1[8][10] = \
7408
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, -0.13605498, 0.12251482, 0.13605498, 0.74143020},
7409
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, -0.07067972, 0.54415184, 0.07067972, 0.38516843},
7410
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, -0.56593317, 0.12251482, 0.56593317, 0.31155201},
7411
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, -0.29399880, 0.54415184, 0.29399880, 0.16184936},
7412
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, -0.13605498, 0.12251482, 0.13605498, 0.74143020},
7413
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, -0.07067972, 0.54415184, 0.07067972, 0.38516843},
7414
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, -0.56593317, 0.12251482, 0.56593317, 0.31155201},
7415
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, -0.29399880, 0.54415184, 0.29399880, 0.16184936}};
7417
static const double FE0_C1_D001[8][10] = \
7418
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7419
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7420
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7421
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7422
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7423
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7424
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000},
7425
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000}};
7427
static const double FE0_C1_D010[8][10] = \
7428
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7429
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7430
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7431
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7432
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7433
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7434
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000},
7435
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000, -1.00000000}};
7437
static const double FE0_C1_D100[8][10] = \
7438
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7439
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7440
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7441
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7442
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7443
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7444
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},
7445
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}};
7447
static const double FE0_C2[8][10] = \
7448
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, 0.00000000, 0.15668264, 0.12251482, 0.72080254, 0.15668264},
7449
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, 0.00000000, 0.08139567, 0.54415184, 0.37445249, 0.08139567},
7450
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, 0.00000000, 0.06583869, 0.12251482, 0.81164649, 0.06583869},
7451
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, 0.00000000, 0.03420279, 0.54415184, 0.42164536, 0.03420279},
7452
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, 0.00000000, 0.58474756, 0.12251482, 0.29273761, 0.58474756},
7453
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, 0.00000000, 0.30377276, 0.54415184, 0.15207539, 0.30377276},
7454
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.12251482, 0.00000000, 0.24571333, 0.12251482, 0.63177185, 0.24571333},
7455
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -0.54415184, 0.00000000, 0.12764656, 0.54415184, 0.32820159, 0.12764656}};
7457
static const double FE0_C2_D001[8][10] = \
7458
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7459
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7460
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7461
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7462
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7463
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7464
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000},
7465
{0.00000000, 0.00000000, 0.00000000, 0.00000000, -1.00000000, 0.00000000, 0.00000000, 1.00000000, -1.00000000, 0.00000000}};
7467
static const double FE0_C2_D100[8][10] = \
7468
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7469
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7470
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7471
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7472
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7473
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7474
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000},
7475
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 1.00000000}};
7477
static const double FE0_C3[8][10] = \
7478
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.13605498, 0.15668264, 0.00000000, 0.70726239, 0.13605498, 0.15668264},
7479
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.07067972, 0.08139567, 0.00000000, 0.84792461, 0.07067972, 0.08139567},
7480
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.56593317, 0.06583869, 0.00000000, 0.36822815, 0.56593317, 0.06583869},
7481
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.29399880, 0.03420279, 0.00000000, 0.67179841, 0.29399880, 0.03420279},
7482
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.13605498, 0.58474756, 0.00000000, 0.27919746, 0.13605498, 0.58474756},
7483
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.07067972, 0.30377276, 0.00000000, 0.62554751, 0.07067972, 0.30377276},
7484
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.56593317, 0.24571333, 0.00000000, 0.18835351, 0.56593317, 0.24571333},
7485
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.29399880, 0.12764656, 0.00000000, 0.57835464, 0.29399880, 0.12764656}};
7487
static const double FE0_C3_D010[8][10] = \
7488
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7489
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7490
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7491
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7492
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7493
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7494
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000},
7495
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, -1.00000000, 1.00000000, 0.00000000}};
7497
static const double FE0_C3_D100[8][10] = \
7498
{{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7499
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7500
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7501
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7502
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7503
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7504
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000},
7505
{0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, -1.00000000, 0.00000000, 1.00000000}};
7507
for (unsigned int r = 0; r < 100; r++)
7510
}// end loop over 'r'
7512
// Compute element tensor using UFL quadrature representation
7513
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
7515
// Loop quadrature points for integral
7516
// Number of operations to compute element tensor for following IP loop = 325600
7517
for (unsigned int ip = 0; ip < 8; ip++)
7520
// Number of operations for primary indices: 40700
7521
for (unsigned int j = 0; j < 10; j++)
7523
for (unsigned int k = 0; k < 10; k++)
7525
// Number of operations to compute entry: 407
7526
A[j*10 + k] += (((((((K_02*K_01*FE0_C1_D100[ip][j] + K_02*K_11*FE0_C2_D100[ip][j] + K_02*K_21*FE0_C3_D100[ip][j] + K_12*K_01*FE0_C1_D010[ip][j] + K_12*K_11*FE0_C1_D100[ip][j] + K_12*K_21*FE0_C3_D010[ip][j] + K_22*K_01*FE0_C1_D001[ip][j] + K_22*K_11*FE0_C2_D001[ip][j] + K_22*K_21*FE0_C1_D100[ip][j]))*(-1.00000000) + (K_01*K_02*FE0_C1_D100[ip][j] + K_01*K_12*FE0_C2_D100[ip][j] + K_01*K_22*FE0_C3_D100[ip][j] + K_11*K_02*FE0_C1_D010[ip][j] + K_11*K_12*FE0_C1_D100[ip][j] + K_11*K_22*FE0_C3_D010[ip][j] + K_21*K_02*FE0_C1_D001[ip][j] + K_21*K_12*FE0_C2_D001[ip][j] + K_21*K_22*FE0_C1_D100[ip][j])))*((((K_02*K_01*FE0_C1_D100[ip][k] + K_02*K_11*FE0_C2_D100[ip][k] + K_02*K_21*FE0_C3_D100[ip][k] + K_12*K_01*FE0_C1_D010[ip][k] + K_12*K_11*FE0_C1_D100[ip][k] + K_12*K_21*FE0_C3_D010[ip][k] + K_22*K_01*FE0_C1_D001[ip][k] + K_22*K_11*FE0_C2_D001[ip][k] + K_22*K_21*FE0_C1_D100[ip][k]))*(-1.00000000) + (K_01*K_02*FE0_C1_D100[ip][k] + K_01*K_12*FE0_C2_D100[ip][k] + K_01*K_22*FE0_C3_D100[ip][k] + K_11*K_02*FE0_C1_D010[ip][k] + K_11*K_12*FE0_C1_D100[ip][k] + K_11*K_22*FE0_C3_D010[ip][k] + K_21*K_02*FE0_C1_D001[ip][k] + K_21*K_12*FE0_C2_D001[ip][k] + K_21*K_22*FE0_C1_D100[ip][k]))) + (((K_00*K_01*FE0_C1_D100[ip][j] + K_00*K_11*FE0_C2_D100[ip][j] + K_00*K_21*FE0_C3_D100[ip][j] + K_10*K_01*FE0_C1_D010[ip][j] + K_10*K_11*FE0_C1_D100[ip][j] + K_10*K_21*FE0_C3_D010[ip][j] + K_20*K_01*FE0_C1_D001[ip][j] + K_20*K_11*FE0_C2_D001[ip][j] + K_20*K_21*FE0_C1_D100[ip][j]) + ((K_01*K_00*FE0_C1_D100[ip][j] + K_01*K_10*FE0_C2_D100[ip][j] + K_01*K_20*FE0_C3_D100[ip][j] + K_11*K_00*FE0_C1_D010[ip][j] + K_11*K_10*FE0_C1_D100[ip][j] + K_11*K_20*FE0_C3_D010[ip][j] + K_21*K_00*FE0_C1_D001[ip][j] + K_21*K_10*FE0_C2_D001[ip][j] + K_21*K_20*FE0_C1_D100[ip][j]))*(-1.00000000)))*(((K_00*K_01*FE0_C1_D100[ip][k] + K_00*K_11*FE0_C2_D100[ip][k] + K_00*K_21*FE0_C3_D100[ip][k] + K_10*K_01*FE0_C1_D010[ip][k] + K_10*K_11*FE0_C1_D100[ip][k] + K_10*K_21*FE0_C3_D010[ip][k] + K_20*K_01*FE0_C1_D001[ip][k] + K_20*K_11*FE0_C2_D001[ip][k] + K_20*K_21*FE0_C1_D100[ip][k]) + ((K_01*K_00*FE0_C1_D100[ip][k] + K_01*K_10*FE0_C2_D100[ip][k] + K_01*K_20*FE0_C3_D100[ip][k] + K_11*K_00*FE0_C1_D010[ip][k] + K_11*K_10*FE0_C1_D100[ip][k] + K_11*K_20*FE0_C3_D010[ip][k] + K_21*K_00*FE0_C1_D001[ip][k] + K_21*K_10*FE0_C2_D001[ip][k] + K_21*K_20*FE0_C1_D100[ip][k]))*(-1.00000000))) + (((K_02*K_00*FE0_C1_D100[ip][j] + K_02*K_10*FE0_C2_D100[ip][j] + K_02*K_20*FE0_C3_D100[ip][j] + K_12*K_00*FE0_C1_D010[ip][j] + K_12*K_10*FE0_C1_D100[ip][j] + K_12*K_20*FE0_C3_D010[ip][j] + K_22*K_00*FE0_C1_D001[ip][j] + K_22*K_10*FE0_C2_D001[ip][j] + K_22*K_20*FE0_C1_D100[ip][j]) + ((K_00*K_02*FE0_C1_D100[ip][j] + K_00*K_12*FE0_C2_D100[ip][j] + K_00*K_22*FE0_C3_D100[ip][j] + K_10*K_02*FE0_C1_D010[ip][j] + K_10*K_12*FE0_C1_D100[ip][j] + K_10*K_22*FE0_C3_D010[ip][j] + K_20*K_02*FE0_C1_D001[ip][j] + K_20*K_12*FE0_C2_D001[ip][j] + K_20*K_22*FE0_C1_D100[ip][j]))*(-1.00000000)))*(((K_02*K_00*FE0_C1_D100[ip][k] + K_02*K_10*FE0_C2_D100[ip][k] + K_02*K_20*FE0_C3_D100[ip][k] + K_12*K_00*FE0_C1_D010[ip][k] + K_12*K_10*FE0_C1_D100[ip][k] + K_12*K_20*FE0_C3_D010[ip][k] + K_22*K_00*FE0_C1_D001[ip][k] + K_22*K_10*FE0_C2_D001[ip][k] + K_22*K_20*FE0_C1_D100[ip][k]) + ((K_00*K_02*FE0_C1_D100[ip][k] + K_00*K_12*FE0_C2_D100[ip][k] + K_00*K_22*FE0_C3_D100[ip][k] + K_10*K_02*FE0_C1_D010[ip][k] + K_10*K_12*FE0_C1_D100[ip][k] + K_10*K_22*FE0_C3_D010[ip][k] + K_20*K_02*FE0_C1_D001[ip][k] + K_20*K_12*FE0_C2_D001[ip][k] + K_20*K_22*FE0_C1_D100[ip][k]))*(-1.00000000)))) + ((((K_00*FE0_C0_D100[ip][k] + K_10*FE0_C0_D010[ip][k] + K_20*FE0_C0_D001[ip][k]))*((K_00*FE0_C1[ip][j] + K_10*FE0_C2[ip][j] + K_20*FE0_C3[ip][j])) + ((K_01*FE0_C0_D100[ip][k] + K_11*FE0_C0_D010[ip][k] + K_21*FE0_C0_D001[ip][k]))*((K_01*FE0_C1[ip][j] + K_11*FE0_C2[ip][j] + K_21*FE0_C3[ip][j])) + ((K_02*FE0_C0_D100[ip][k] + K_12*FE0_C0_D010[ip][k] + K_22*FE0_C0_D001[ip][k]))*((K_02*FE0_C1[ip][j] + K_12*FE0_C2[ip][j] + K_22*FE0_C3[ip][j]))) + (((((K_00*FE0_C0_D100[ip][j] + K_10*FE0_C0_D010[ip][j] + K_20*FE0_C0_D001[ip][j]))*((K_00*FE0_C1[ip][k] + K_10*FE0_C2[ip][k] + K_20*FE0_C3[ip][k])) + ((K_01*FE0_C0_D100[ip][j] + K_11*FE0_C0_D010[ip][j] + K_21*FE0_C0_D001[ip][j]))*((K_01*FE0_C1[ip][k] + K_11*FE0_C2[ip][k] + K_21*FE0_C3[ip][k])) + ((K_02*FE0_C0_D100[ip][j] + K_12*FE0_C0_D010[ip][j] + K_22*FE0_C0_D001[ip][j]))*((K_02*FE0_C1[ip][k] + K_12*FE0_C2[ip][k] + K_22*FE0_C3[ip][k]))))*(-1.00000000) + FE0_C0[ip][j]*FE0_C0[ip][k]))))*W8[ip]*det;
7527
}// end loop over 'k'
7528
}// end loop over 'j'
7529
}// end loop over 'ip'
7534
/// This class defines the interface for the tabulation of the cell
7535
/// tensor corresponding to the local contribution to a form from
7536
/// the integral over a cell.
7538
class vectorlaplacegradcurl_cell_integral_1_0: public ufc::cell_integral
7543
vectorlaplacegradcurl_cell_integral_1_0() : ufc::cell_integral()
7549
virtual ~vectorlaplacegradcurl_cell_integral_1_0()
7554
/// Tabulate the tensor for the contribution from a local cell
7555
virtual void tabulate_tensor(double* A,
7556
const double * const * w,
7557
const ufc::cell& c) const
7559
// Number of operations (multiply-add pairs) for Jacobian data: 32
7560
// Number of operations (multiply-add pairs) for geometry tensor: 135
7561
// Number of operations (multiply-add pairs) for tensor contraction: 412
7562
// Total number of operations (multiply-add pairs): 579
7564
// Extract vertex coordinates
7565
const double * const * x = c.coordinates;
7567
// Compute Jacobian of affine map from reference cell
7568
const double J_00 = x[1][0] - x[0][0];
7569
const double J_01 = x[2][0] - x[0][0];
7570
const double J_02 = x[3][0] - x[0][0];
7571
const double J_10 = x[1][1] - x[0][1];
7572
const double J_11 = x[2][1] - x[0][1];
7573
const double J_12 = x[3][1] - x[0][1];
7574
const double J_20 = x[1][2] - x[0][2];
7575
const double J_21 = x[2][2] - x[0][2];
7576
const double J_22 = x[3][2] - x[0][2];
7578
// Compute sub determinants
7579
const double d_00 = J_11*J_22 - J_12*J_21;
7580
const double d_01 = J_12*J_20 - J_10*J_22;
7581
const double d_02 = J_10*J_21 - J_11*J_20;
7582
const double d_10 = J_02*J_21 - J_01*J_22;
7583
const double d_11 = J_00*J_22 - J_02*J_20;
7584
const double d_12 = J_01*J_20 - J_00*J_21;
7585
const double d_20 = J_01*J_12 - J_02*J_11;
7586
const double d_21 = J_02*J_10 - J_00*J_12;
7587
const double d_22 = J_00*J_11 - J_01*J_10;
7589
// Compute determinant of Jacobian
7590
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
7592
// Compute inverse of Jacobian
7593
const double K_00 = d_00 / detJ;
7594
const double K_01 = d_10 / detJ;
7595
const double K_02 = d_20 / detJ;
7596
const double K_10 = d_01 / detJ;
7597
const double K_11 = d_11 / detJ;
7598
const double K_12 = d_21 / detJ;
7599
const double K_20 = d_02 / detJ;
7600
const double K_21 = d_12 / detJ;
7601
const double K_22 = d_22 / detJ;
7604
const double det = std::abs(detJ);
7606
// Compute geometry tensor
7607
const double G0_0_20 = det*w[0][20]*K_02*(1.0);
7608
const double G0_0_21 = det*w[0][21]*K_02*(1.0);
7609
const double G0_0_22 = det*w[0][22]*K_02*(1.0);
7610
const double G0_0_23 = det*w[0][23]*K_02*(1.0);
7611
const double G0_0_24 = det*w[0][24]*K_02*(1.0);
7612
const double G0_0_25 = det*w[0][25]*K_02*(1.0);
7613
const double G0_0_26 = det*w[0][26]*K_02*(1.0);
7614
const double G0_0_27 = det*w[0][27]*K_02*(1.0);
7615
const double G0_0_28 = det*w[0][28]*K_02*(1.0);
7616
const double G0_0_29 = det*w[0][29]*K_02*(1.0);
7617
const double G0_1_20 = det*w[0][20]*K_12*(1.0);
7618
const double G0_1_21 = det*w[0][21]*K_12*(1.0);
7619
const double G0_1_22 = det*w[0][22]*K_12*(1.0);
7620
const double G0_1_23 = det*w[0][23]*K_12*(1.0);
7621
const double G0_1_24 = det*w[0][24]*K_12*(1.0);
7622
const double G0_1_25 = det*w[0][25]*K_12*(1.0);
7623
const double G0_1_26 = det*w[0][26]*K_12*(1.0);
7624
const double G0_1_27 = det*w[0][27]*K_12*(1.0);
7625
const double G0_1_28 = det*w[0][28]*K_12*(1.0);
7626
const double G0_1_29 = det*w[0][29]*K_12*(1.0);
7627
const double G0_2_20 = det*w[0][20]*K_22*(1.0);
7628
const double G0_2_21 = det*w[0][21]*K_22*(1.0);
7629
const double G0_2_22 = det*w[0][22]*K_22*(1.0);
7630
const double G0_2_23 = det*w[0][23]*K_22*(1.0);
7631
const double G0_2_24 = det*w[0][24]*K_22*(1.0);
7632
const double G0_2_25 = det*w[0][25]*K_22*(1.0);
7633
const double G0_2_26 = det*w[0][26]*K_22*(1.0);
7634
const double G0_2_27 = det*w[0][27]*K_22*(1.0);
7635
const double G0_2_28 = det*w[0][28]*K_22*(1.0);
7636
const double G0_2_29 = det*w[0][29]*K_22*(1.0);
7637
const double G1_0_0 = det*w[0][0]*K_00*(1.0);
7638
const double G1_0_1 = det*w[0][1]*K_00*(1.0);
7639
const double G1_0_2 = det*w[0][2]*K_00*(1.0);
7640
const double G1_0_3 = det*w[0][3]*K_00*(1.0);
7641
const double G1_0_4 = det*w[0][4]*K_00*(1.0);
7642
const double G1_0_5 = det*w[0][5]*K_00*(1.0);
7643
const double G1_0_6 = det*w[0][6]*K_00*(1.0);
7644
const double G1_0_7 = det*w[0][7]*K_00*(1.0);
7645
const double G1_0_8 = det*w[0][8]*K_00*(1.0);
7646
const double G1_0_9 = det*w[0][9]*K_00*(1.0);
7647
const double G1_1_0 = det*w[0][0]*K_10*(1.0);
7648
const double G1_1_1 = det*w[0][1]*K_10*(1.0);
7649
const double G1_1_2 = det*w[0][2]*K_10*(1.0);
7650
const double G1_1_3 = det*w[0][3]*K_10*(1.0);
7651
const double G1_1_4 = det*w[0][4]*K_10*(1.0);
7652
const double G1_1_5 = det*w[0][5]*K_10*(1.0);
7653
const double G1_1_6 = det*w[0][6]*K_10*(1.0);
7654
const double G1_1_7 = det*w[0][7]*K_10*(1.0);
7655
const double G1_1_8 = det*w[0][8]*K_10*(1.0);
7656
const double G1_1_9 = det*w[0][9]*K_10*(1.0);
7657
const double G1_2_0 = det*w[0][0]*K_20*(1.0);
7658
const double G1_2_1 = det*w[0][1]*K_20*(1.0);
7659
const double G1_2_2 = det*w[0][2]*K_20*(1.0);
7660
const double G1_2_3 = det*w[0][3]*K_20*(1.0);
7661
const double G1_2_4 = det*w[0][4]*K_20*(1.0);
7662
const double G1_2_5 = det*w[0][5]*K_20*(1.0);
7663
const double G1_2_6 = det*w[0][6]*K_20*(1.0);
7664
const double G1_2_7 = det*w[0][7]*K_20*(1.0);
7665
const double G1_2_8 = det*w[0][8]*K_20*(1.0);
7666
const double G1_2_9 = det*w[0][9]*K_20*(1.0);
7667
const double G2_0_10 = det*w[0][10]*K_01*(1.0);
7668
const double G2_0_11 = det*w[0][11]*K_01*(1.0);
7669
const double G2_0_12 = det*w[0][12]*K_01*(1.0);
7670
const double G2_0_13 = det*w[0][13]*K_01*(1.0);
7671
const double G2_0_14 = det*w[0][14]*K_01*(1.0);
7672
const double G2_0_15 = det*w[0][15]*K_01*(1.0);
7673
const double G2_0_16 = det*w[0][16]*K_01*(1.0);
7674
const double G2_0_17 = det*w[0][17]*K_01*(1.0);
7675
const double G2_0_18 = det*w[0][18]*K_01*(1.0);
7676
const double G2_0_19 = det*w[0][19]*K_01*(1.0);
7677
const double G2_1_10 = det*w[0][10]*K_11*(1.0);
7678
const double G2_1_11 = det*w[0][11]*K_11*(1.0);
7679
const double G2_1_12 = det*w[0][12]*K_11*(1.0);
7680
const double G2_1_13 = det*w[0][13]*K_11*(1.0);
7681
const double G2_1_14 = det*w[0][14]*K_11*(1.0);
7682
const double G2_1_15 = det*w[0][15]*K_11*(1.0);
7683
const double G2_1_16 = det*w[0][16]*K_11*(1.0);
7684
const double G2_1_17 = det*w[0][17]*K_11*(1.0);
7685
const double G2_1_18 = det*w[0][18]*K_11*(1.0);
7686
const double G2_1_19 = det*w[0][19]*K_11*(1.0);
7687
const double G2_2_10 = det*w[0][10]*K_21*(1.0);
7688
const double G2_2_11 = det*w[0][11]*K_21*(1.0);
7689
const double G2_2_12 = det*w[0][12]*K_21*(1.0);
7690
const double G2_2_13 = det*w[0][13]*K_21*(1.0);
7691
const double G2_2_14 = det*w[0][14]*K_21*(1.0);
7692
const double G2_2_15 = det*w[0][15]*K_21*(1.0);
7693
const double G2_2_16 = det*w[0][16]*K_21*(1.0);
7694
const double G2_2_17 = det*w[0][17]*K_21*(1.0);
7695
const double G2_2_18 = det*w[0][18]*K_21*(1.0);
7696
const double G2_2_19 = det*w[0][19]*K_21*(1.0);
7698
// Compute element tensor
7703
A[4] = 0.00277778*G0_1_20 + 0.00277778*G0_1_21 + 0.00277778*G0_1_22 - 0.01111111*G0_1_24 - 0.01111111*G0_1_25 - 0.00555556*G0_1_26 - 0.01111111*G0_1_27 - 0.00555556*G0_1_28 - 0.00555556*G0_1_29 - 0.00277778*G0_2_20 - 0.00277778*G0_2_21 - 0.00277778*G0_2_23 + 0.01111111*G0_2_24 + 0.00555556*G0_2_25 + 0.01111111*G0_2_26 + 0.00555556*G0_2_27 + 0.01111111*G0_2_28 + 0.00555556*G0_2_29 + 0.00277778*G1_1_0 + 0.00277778*G1_1_1 + 0.00277778*G1_1_2 - 0.01111111*G1_1_4 - 0.01111111*G1_1_5 - 0.00555556*G1_1_6 - 0.01111111*G1_1_7 - 0.00555556*G1_1_8 - 0.00555556*G1_1_9 - 0.00277778*G1_2_0 - 0.00277778*G1_2_1 - 0.00277778*G1_2_3 + 0.01111111*G1_2_4 + 0.00555556*G1_2_5 + 0.01111111*G1_2_6 + 0.00555556*G1_2_7 + 0.01111111*G1_2_8 + 0.00555556*G1_2_9 + 0.00277778*G2_1_10 + 0.00277778*G2_1_11 + 0.00277778*G2_1_12 - 0.01111111*G2_1_14 - 0.01111111*G2_1_15 - 0.00555556*G2_1_16 - 0.01111111*G2_1_17 - 0.00555556*G2_1_18 - 0.00555556*G2_1_19 - 0.00277778*G2_2_10 - 0.00277778*G2_2_11 - 0.00277778*G2_2_13 + 0.01111111*G2_2_14 + 0.00555556*G2_2_15 + 0.01111111*G2_2_16 + 0.00555556*G2_2_17 + 0.01111111*G2_2_18 + 0.00555556*G2_2_19;
7704
A[5] = 0.00277778*G0_0_20 + 0.00277778*G0_0_21 + 0.00277778*G0_0_22 - 0.01111111*G0_0_24 - 0.01111111*G0_0_25 - 0.00555556*G0_0_26 - 0.01111111*G0_0_27 - 0.00555556*G0_0_28 - 0.00555556*G0_0_29 - 0.00277778*G0_2_20 - 0.00277778*G0_2_22 - 0.00277778*G0_2_23 + 0.00555556*G0_2_24 + 0.01111111*G0_2_25 + 0.01111111*G0_2_26 + 0.00555556*G0_2_27 + 0.00555556*G0_2_28 + 0.01111111*G0_2_29 + 0.00277778*G1_0_0 + 0.00277778*G1_0_1 + 0.00277778*G1_0_2 - 0.01111111*G1_0_4 - 0.01111111*G1_0_5 - 0.00555556*G1_0_6 - 0.01111111*G1_0_7 - 0.00555556*G1_0_8 - 0.00555556*G1_0_9 - 0.00277778*G1_2_0 - 0.00277778*G1_2_2 - 0.00277778*G1_2_3 + 0.00555556*G1_2_4 + 0.01111111*G1_2_5 + 0.01111111*G1_2_6 + 0.00555556*G1_2_7 + 0.00555556*G1_2_8 + 0.01111111*G1_2_9 + 0.00277778*G2_0_10 + 0.00277778*G2_0_11 + 0.00277778*G2_0_12 - 0.01111111*G2_0_14 - 0.01111111*G2_0_15 - 0.00555556*G2_0_16 - 0.01111111*G2_0_17 - 0.00555556*G2_0_18 - 0.00555556*G2_0_19 - 0.00277778*G2_2_10 - 0.00277778*G2_2_12 - 0.00277778*G2_2_13 + 0.00555556*G2_2_14 + 0.01111111*G2_2_15 + 0.01111111*G2_2_16 + 0.00555556*G2_2_17 + 0.00555556*G2_2_18 + 0.01111111*G2_2_19;
7705
A[6] = 0.00277778*G0_0_20 + 0.00277778*G0_0_21 + 0.00277778*G0_0_23 - 0.01111111*G0_0_24 - 0.00555556*G0_0_25 - 0.01111111*G0_0_26 - 0.00555556*G0_0_27 - 0.01111111*G0_0_28 - 0.00555556*G0_0_29 - 0.00277778*G0_1_20 - 0.00277778*G0_1_22 - 0.00277778*G0_1_23 + 0.00555556*G0_1_24 + 0.01111111*G0_1_25 + 0.01111111*G0_1_26 + 0.00555556*G0_1_27 + 0.00555556*G0_1_28 + 0.01111111*G0_1_29 + 0.00277778*G1_0_0 + 0.00277778*G1_0_1 + 0.00277778*G1_0_3 - 0.01111111*G1_0_4 - 0.00555556*G1_0_5 - 0.01111111*G1_0_6 - 0.00555556*G1_0_7 - 0.01111111*G1_0_8 - 0.00555556*G1_0_9 - 0.00277778*G1_1_0 - 0.00277778*G1_1_2 - 0.00277778*G1_1_3 + 0.00555556*G1_1_4 + 0.01111111*G1_1_5 + 0.01111111*G1_1_6 + 0.00555556*G1_1_7 + 0.00555556*G1_1_8 + 0.01111111*G1_1_9 + 0.00277778*G2_0_10 + 0.00277778*G2_0_11 + 0.00277778*G2_0_13 - 0.01111111*G2_0_14 - 0.00555556*G2_0_15 - 0.01111111*G2_0_16 - 0.00555556*G2_0_17 - 0.01111111*G2_0_18 - 0.00555556*G2_0_19 - 0.00277778*G2_1_10 - 0.00277778*G2_1_12 - 0.00277778*G2_1_13 + 0.00555556*G2_1_14 + 0.01111111*G2_1_15 + 0.01111111*G2_1_16 + 0.00555556*G2_1_17 + 0.00555556*G2_1_18 + 0.01111111*G2_1_19;
7706
A[7] = (-0.00277778)*G0_0_20 - 0.00277778*G0_0_21 - 0.00277778*G0_0_22 + 0.01111111*G0_0_24 + 0.01111111*G0_0_25 + 0.00555556*G0_0_26 + 0.01111111*G0_0_27 + 0.00555556*G0_0_28 + 0.00555556*G0_0_29 - 0.00277778*G0_1_20 - 0.00277778*G0_1_21 - 0.00277778*G0_1_22 + 0.01111111*G0_1_24 + 0.01111111*G0_1_25 + 0.00555556*G0_1_26 + 0.01111111*G0_1_27 + 0.00555556*G0_1_28 + 0.00555556*G0_1_29 - 0.00277778*G0_2_20 - 0.00555556*G0_2_21 - 0.00555556*G0_2_22 - 0.00277778*G0_2_23 + 0.01666667*G0_2_24 + 0.01666667*G0_2_25 + 0.01111111*G0_2_26 + 0.02222222*G0_2_27 + 0.01666667*G0_2_28 + 0.01666667*G0_2_29 - 0.00277778*G1_0_0 - 0.00277778*G1_0_1 - 0.00277778*G1_0_2 + 0.01111111*G1_0_4 + 0.01111111*G1_0_5 + 0.00555556*G1_0_6 + 0.01111111*G1_0_7 + 0.00555556*G1_0_8 + 0.00555556*G1_0_9 - 0.00277778*G1_1_0 - 0.00277778*G1_1_1 - 0.00277778*G1_1_2 + 0.01111111*G1_1_4 + 0.01111111*G1_1_5 + 0.00555556*G1_1_6 + 0.01111111*G1_1_7 + 0.00555556*G1_1_8 + 0.00555556*G1_1_9 - 0.00277778*G1_2_0 - 0.00555556*G1_2_1 - 0.00555556*G1_2_2 - 0.00277778*G1_2_3 + 0.01666667*G1_2_4 + 0.01666667*G1_2_5 + 0.01111111*G1_2_6 + 0.02222222*G1_2_7 + 0.01666667*G1_2_8 + 0.01666667*G1_2_9 - 0.00277778*G2_0_10 - 0.00277778*G2_0_11 - 0.00277778*G2_0_12 + 0.01111111*G2_0_14 + 0.01111111*G2_0_15 + 0.00555556*G2_0_16 + 0.01111111*G2_0_17 + 0.00555556*G2_0_18 + 0.00555556*G2_0_19 - 0.00277778*G2_1_10 - 0.00277778*G2_1_11 - 0.00277778*G2_1_12 + 0.01111111*G2_1_14 + 0.01111111*G2_1_15 + 0.00555556*G2_1_16 + 0.01111111*G2_1_17 + 0.00555556*G2_1_18 + 0.00555556*G2_1_19 - 0.00277778*G2_2_10 - 0.00555556*G2_2_11 - 0.00555556*G2_2_12 - 0.00277778*G2_2_13 + 0.01666667*G2_2_14 + 0.01666667*G2_2_15 + 0.01111111*G2_2_16 + 0.02222222*G2_2_17 + 0.01666667*G2_2_18 + 0.01666667*G2_2_19;
7707
A[8] = (-0.00277778)*G0_0_20 - 0.00277778*G0_0_21 - 0.00277778*G0_0_23 + 0.01111111*G0_0_24 + 0.00555556*G0_0_25 + 0.01111111*G0_0_26 + 0.00555556*G0_0_27 + 0.01111111*G0_0_28 + 0.00555556*G0_0_29 - 0.00277778*G0_1_20 - 0.00555556*G0_1_21 - 0.00277778*G0_1_22 - 0.00555556*G0_1_23 + 0.01666667*G0_1_24 + 0.01111111*G0_1_25 + 0.01666667*G0_1_26 + 0.01666667*G0_1_27 + 0.02222222*G0_1_28 + 0.01666667*G0_1_29 - 0.00277778*G0_2_20 - 0.00277778*G0_2_21 - 0.00277778*G0_2_23 + 0.01111111*G0_2_24 + 0.00555556*G0_2_25 + 0.01111111*G0_2_26 + 0.00555556*G0_2_27 + 0.01111111*G0_2_28 + 0.00555556*G0_2_29 - 0.00277778*G1_0_0 - 0.00277778*G1_0_1 - 0.00277778*G1_0_3 + 0.01111111*G1_0_4 + 0.00555556*G1_0_5 + 0.01111111*G1_0_6 + 0.00555556*G1_0_7 + 0.01111111*G1_0_8 + 0.00555556*G1_0_9 - 0.00277778*G1_1_0 - 0.00555556*G1_1_1 - 0.00277778*G1_1_2 - 0.00555556*G1_1_3 + 0.01666667*G1_1_4 + 0.01111111*G1_1_5 + 0.01666667*G1_1_6 + 0.01666667*G1_1_7 + 0.02222222*G1_1_8 + 0.01666667*G1_1_9 - 0.00277778*G1_2_0 - 0.00277778*G1_2_1 - 0.00277778*G1_2_3 + 0.01111111*G1_2_4 + 0.00555556*G1_2_5 + 0.01111111*G1_2_6 + 0.00555556*G1_2_7 + 0.01111111*G1_2_8 + 0.00555556*G1_2_9 - 0.00277778*G2_0_10 - 0.00277778*G2_0_11 - 0.00277778*G2_0_13 + 0.01111111*G2_0_14 + 0.00555556*G2_0_15 + 0.01111111*G2_0_16 + 0.00555556*G2_0_17 + 0.01111111*G2_0_18 + 0.00555556*G2_0_19 - 0.00277778*G2_1_10 - 0.00555556*G2_1_11 - 0.00277778*G2_1_12 - 0.00555556*G2_1_13 + 0.01666667*G2_1_14 + 0.01111111*G2_1_15 + 0.01666667*G2_1_16 + 0.01666667*G2_1_17 + 0.02222222*G2_1_18 + 0.01666667*G2_1_19 - 0.00277778*G2_2_10 - 0.00277778*G2_2_11 - 0.00277778*G2_2_13 + 0.01111111*G2_2_14 + 0.00555556*G2_2_15 + 0.01111111*G2_2_16 + 0.00555556*G2_2_17 + 0.01111111*G2_2_18 + 0.00555556*G2_2_19;
7708
A[9] = (-0.00277778)*G0_0_20 - 0.00277778*G0_0_21 - 0.00555556*G0_0_22 - 0.00555556*G0_0_23 + 0.01111111*G0_0_24 + 0.01666667*G0_0_25 + 0.01666667*G0_0_26 + 0.01666667*G0_0_27 + 0.01666667*G0_0_28 + 0.02222222*G0_0_29 - 0.00277778*G0_1_20 - 0.00277778*G0_1_22 - 0.00277778*G0_1_23 + 0.00555556*G0_1_24 + 0.01111111*G0_1_25 + 0.01111111*G0_1_26 + 0.00555556*G0_1_27 + 0.00555556*G0_1_28 + 0.01111111*G0_1_29 - 0.00277778*G0_2_20 - 0.00277778*G0_2_22 - 0.00277778*G0_2_23 + 0.00555556*G0_2_24 + 0.01111111*G0_2_25 + 0.01111111*G0_2_26 + 0.00555556*G0_2_27 + 0.00555556*G0_2_28 + 0.01111111*G0_2_29 - 0.00277778*G1_0_0 - 0.00277778*G1_0_1 - 0.00555556*G1_0_2 - 0.00555556*G1_0_3 + 0.01111111*G1_0_4 + 0.01666667*G1_0_5 + 0.01666667*G1_0_6 + 0.01666667*G1_0_7 + 0.01666667*G1_0_8 + 0.02222222*G1_0_9 - 0.00277778*G1_1_0 - 0.00277778*G1_1_2 - 0.00277778*G1_1_3 + 0.00555556*G1_1_4 + 0.01111111*G1_1_5 + 0.01111111*G1_1_6 + 0.00555556*G1_1_7 + 0.00555556*G1_1_8 + 0.01111111*G1_1_9 - 0.00277778*G1_2_0 - 0.00277778*G1_2_2 - 0.00277778*G1_2_3 + 0.00555556*G1_2_4 + 0.01111111*G1_2_5 + 0.01111111*G1_2_6 + 0.00555556*G1_2_7 + 0.00555556*G1_2_8 + 0.01111111*G1_2_9 - 0.00277778*G2_0_10 - 0.00277778*G2_0_11 - 0.00555556*G2_0_12 - 0.00555556*G2_0_13 + 0.01111111*G2_0_14 + 0.01666667*G2_0_15 + 0.01666667*G2_0_16 + 0.01666667*G2_0_17 + 0.01666667*G2_0_18 + 0.02222222*G2_0_19 - 0.00277778*G2_1_10 - 0.00277778*G2_1_12 - 0.00277778*G2_1_13 + 0.00555556*G2_1_14 + 0.01111111*G2_1_15 + 0.01111111*G2_1_16 + 0.00555556*G2_1_17 + 0.00555556*G2_1_18 + 0.01111111*G2_1_19 - 0.00277778*G2_2_10 - 0.00277778*G2_2_12 - 0.00277778*G2_2_13 + 0.00555556*G2_2_14 + 0.01111111*G2_2_15 + 0.01111111*G2_2_16 + 0.00555556*G2_2_17 + 0.00555556*G2_2_18 + 0.01111111*G2_2_19;
7713
/// This class defines the interface for the assembly of the global
7714
/// tensor corresponding to a form with r + n arguments, that is, a
7717
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
7719
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
7720
/// global tensor A is defined by
7722
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
7724
/// where each argument Vj represents the application to the
7725
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
7726
/// fixed functions (coefficients).
7728
class vectorlaplacegradcurl_form_0: public ufc::form
7733
vectorlaplacegradcurl_form_0() : ufc::form()
7739
virtual ~vectorlaplacegradcurl_form_0()
7744
/// Return a string identifying the form
7745
virtual const char* signature() const
7747
return "Form([Integral(Sum(IndexSum(Product(Indexed(ListTensor(Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 3})), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})))), Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 3})), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4})))), Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 3})), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 3})), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4}))))), MultiIndex((Index(0),), {Index(0): 3})), Indexed(ListTensor(Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 3})), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})))), Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 3})), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4})))), Sum(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 3})), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})), Product(IntValue(-1, (), (), {}), Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 3})), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4}))))), MultiIndex((Index(0),), {Index(0): 3}))), MultiIndex((Index(0),), {Index(0): 3})), Sum(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((Index(1),), {Index(1): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(1),), {Index(1): 3})), MultiIndex((Index(2),), {Index(2): 3})), Indexed(ListTensor(Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4}))), MultiIndex((Index(2),), {Index(2): 3}))), MultiIndex((Index(2),), {Index(2): 3})), Sum(Product(Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 4}))), Product(IntValue(-1, (), (), {}), IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((Index(3),), {Index(3): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(3),), {Index(3): 3})), MultiIndex((Index(4),), {Index(4): 3})), Indexed(ListTensor(Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 1), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4}))), MultiIndex((Index(4),), {Index(4): 3}))), MultiIndex((Index(4),), {Index(4): 3})))))), Measure('cell', 0, None))])";
7750
/// Return the rank of the global tensor (r)
7751
virtual unsigned int rank() const
7756
/// Return the number of coefficients (n)
7757
virtual unsigned int num_coefficients() const
7762
/// Return the number of cell integrals
7763
virtual unsigned int num_cell_integrals() const
7768
/// Return the number of exterior facet integrals
7769
virtual unsigned int num_exterior_facet_integrals() const
7774
/// Return the number of interior facet integrals
7775
virtual unsigned int num_interior_facet_integrals() const
7780
/// Create a new finite element for argument function i
7781
virtual ufc::finite_element* create_finite_element(unsigned int i) const
7787
return new vectorlaplacegradcurl_finite_element_4();
7792
return new vectorlaplacegradcurl_finite_element_4();
7800
/// Create a new dof map for argument function i
7801
virtual ufc::dof_map* create_dof_map(unsigned int i) const
7807
return new vectorlaplacegradcurl_dof_map_4();
7812
return new vectorlaplacegradcurl_dof_map_4();
7820
/// Create a new cell integral on sub domain i
7821
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
7827
return new vectorlaplacegradcurl_cell_integral_0_0();
7835
/// Create a new exterior facet integral on sub domain i
7836
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
7841
/// Create a new interior facet integral on sub domain i
7842
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
7849
/// This class defines the interface for the assembly of the global
7850
/// tensor corresponding to a form with r + n arguments, that is, a
7853
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
7855
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
7856
/// global tensor A is defined by
7858
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
7860
/// where each argument Vj represents the application to the
7861
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
7862
/// fixed functions (coefficients).
7864
class vectorlaplacegradcurl_form_1: public ufc::form
7869
vectorlaplacegradcurl_form_1() : ufc::form()
7875
virtual ~vectorlaplacegradcurl_form_1()
7880
/// Return a string identifying the form
7881
virtual const char* signature() const
7883
return "Form([Integral(IndexSum(Product(Indexed(Coefficient(VectorElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2, 3), 0), MultiIndex((Index(0),), {Index(0): 3})), Indexed(ListTensor(Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 4})), Indexed(Argument(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), FiniteElement('Nedelec 1st kind H(curl)', Cell('tetrahedron', 1, Space(3)), 1)], **{'value_shape': (4,) }), 0), MultiIndex((FixedIndex(3),), {FixedIndex(3): 4}))), MultiIndex((Index(0),), {Index(0): 3}))), MultiIndex((Index(0),), {Index(0): 3})), Measure('cell', 0, None))])";
7886
/// Return the rank of the global tensor (r)
7887
virtual unsigned int rank() const
7892
/// Return the number of coefficients (n)
7893
virtual unsigned int num_coefficients() const
7898
/// Return the number of cell integrals
7899
virtual unsigned int num_cell_integrals() const
7904
/// Return the number of exterior facet integrals
7905
virtual unsigned int num_exterior_facet_integrals() const
7910
/// Return the number of interior facet integrals
7911
virtual unsigned int num_interior_facet_integrals() const
7916
/// Create a new finite element for argument function i
7917
virtual ufc::finite_element* create_finite_element(unsigned int i) const
7923
return new vectorlaplacegradcurl_finite_element_4();
7928
return new vectorlaplacegradcurl_finite_element_1();
7936
/// Create a new dof map for argument function i
7937
virtual ufc::dof_map* create_dof_map(unsigned int i) const
7943
return new vectorlaplacegradcurl_dof_map_4();
7948
return new vectorlaplacegradcurl_dof_map_1();
7956
/// Create a new cell integral on sub domain i
7957
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
7963
return new vectorlaplacegradcurl_cell_integral_1_0();
7971
/// Create a new exterior facet integral on sub domain i
7972
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
7977
/// Create a new interior facet integral on sub domain i
7978
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const