1
// This code conforms with the UFC specification version 1.0
2
// and was automatically generated by FFC version 0.7.0.
11
/// This class defines the interface for a finite element.
13
class subdomains_0_finite_element_0: public ufc::finite_element
18
subdomains_0_finite_element_0() : ufc::finite_element()
24
virtual ~subdomains_0_finite_element_0()
29
/// Return a string identifying the finite element
30
virtual const char* signature() const
32
return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
35
/// Return the cell shape
36
virtual ufc::shape cell_shape() const
38
return ufc::tetrahedron;
41
/// Return the dimension of the finite element function space
42
virtual unsigned int space_dimension() const
47
/// Return the rank of the value space
48
virtual unsigned int value_rank() const
53
/// Return the dimension of the value space for axis i
54
virtual unsigned int value_dimension(unsigned int i) const
59
/// Evaluate basis function i at given point in cell
60
virtual void evaluate_basis(unsigned int i,
62
const double* coordinates,
63
const ufc::cell& c) const
65
// Extract vertex coordinates
66
const double * const * element_coordinates = c.coordinates;
68
// Compute Jacobian of affine map from reference cell
69
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
70
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
71
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
72
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
73
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
74
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
75
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
76
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
77
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
79
// Compute sub determinants
80
const double d00 = J_11*J_22 - J_12*J_21;
81
const double d01 = J_12*J_20 - J_10*J_22;
82
const double d02 = J_10*J_21 - J_11*J_20;
84
const double d10 = J_02*J_21 - J_01*J_22;
85
const double d11 = J_00*J_22 - J_02*J_20;
86
const double d12 = J_01*J_20 - J_00*J_21;
88
const double d20 = J_01*J_12 - J_02*J_11;
89
const double d21 = J_02*J_10 - J_00*J_12;
90
const double d22 = J_00*J_11 - J_01*J_10;
92
// Compute determinant of Jacobian
93
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
95
// Compute inverse of Jacobian
98
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
99
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
100
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
102
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
103
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
104
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
106
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
107
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
108
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
110
// Get coordinates and map to the UFC reference element
111
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
112
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
113
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
115
// Map coordinates to the reference cube
116
if (std::abs(y + z - 1.0) < 1e-08)
119
x = -2.0 * x/(y + z - 1.0) - 1.0;
120
if (std::abs(z - 1.0) < 1e-08)
123
y = 2.0 * y/(1.0 - z) - 1.0;
129
// Map degree of freedom to element degree of freedom
130
const unsigned int dof = i;
133
const double scalings_y_0 = 1;
134
const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
135
const double scalings_z_0 = 1;
136
const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
138
// Compute psitilde_a
139
const double psitilde_a_0 = 1;
140
const double psitilde_a_1 = x;
142
// Compute psitilde_bs
143
const double psitilde_bs_0_0 = 1;
144
const double psitilde_bs_0_1 = 1.5*y + 0.5;
145
const double psitilde_bs_1_0 = 1;
147
// Compute psitilde_cs
148
const double psitilde_cs_00_0 = 1;
149
const double psitilde_cs_00_1 = 2*z + 1;
150
const double psitilde_cs_01_0 = 1;
151
const double psitilde_cs_10_0 = 1;
153
// Compute basisvalues
154
const double basisvalue0 = 0.866025404*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
155
const double basisvalue1 = 2.73861279*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
156
const double basisvalue2 = 1.58113883*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
157
const double basisvalue3 = 1.11803399*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
159
// Table(s) of coefficients
160
static const double coefficients0[4][4] = \
161
{{0.288675135, -0.182574186, -0.105409255, -0.0745355992},
162
{0.288675135, 0.182574186, -0.105409255, -0.0745355992},
163
{0.288675135, 0, 0.210818511, -0.0745355992},
164
{0.288675135, 0, 0, 0.223606798}};
166
// Extract relevant coefficients
167
const double coeff0_0 = coefficients0[dof][0];
168
const double coeff0_1 = coefficients0[dof][1];
169
const double coeff0_2 = coefficients0[dof][2];
170
const double coeff0_3 = coefficients0[dof][3];
173
*values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3;
176
/// Evaluate all basis functions at given point in cell
177
virtual void evaluate_basis_all(double* values,
178
const double* coordinates,
179
const ufc::cell& c) const
181
throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
184
/// Evaluate order n derivatives of basis function i at given point in cell
185
virtual void evaluate_basis_derivatives(unsigned int i,
188
const double* coordinates,
189
const ufc::cell& c) const
191
// Extract vertex coordinates
192
const double * const * element_coordinates = c.coordinates;
194
// Compute Jacobian of affine map from reference cell
195
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
196
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
197
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
198
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
199
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
200
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
201
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
202
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
203
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
205
// Compute sub determinants
206
const double d00 = J_11*J_22 - J_12*J_21;
207
const double d01 = J_12*J_20 - J_10*J_22;
208
const double d02 = J_10*J_21 - J_11*J_20;
210
const double d10 = J_02*J_21 - J_01*J_22;
211
const double d11 = J_00*J_22 - J_02*J_20;
212
const double d12 = J_01*J_20 - J_00*J_21;
214
const double d20 = J_01*J_12 - J_02*J_11;
215
const double d21 = J_02*J_10 - J_00*J_12;
216
const double d22 = J_00*J_11 - J_01*J_10;
218
// Compute determinant of Jacobian
219
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
221
// Compute inverse of Jacobian
224
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
225
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
226
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
228
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
229
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
230
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
232
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
233
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
234
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
236
// Get coordinates and map to the UFC reference element
237
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
238
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
239
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
241
// Map coordinates to the reference cube
242
if (std::abs(y + z - 1.0) < 1e-08)
245
x = -2.0 * x/(y + z - 1.0) - 1.0;
246
if (std::abs(z - 1.0) < 1e-08)
249
y = 2.0 * y/(1.0 - z) - 1.0;
252
// Compute number of derivatives
253
unsigned int num_derivatives = 1;
255
for (unsigned int j = 0; j < n; j++)
256
num_derivatives *= 3;
259
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
260
unsigned int **combinations = new unsigned int *[num_derivatives];
262
for (unsigned int j = 0; j < num_derivatives; j++)
264
combinations[j] = new unsigned int [n];
265
for (unsigned int k = 0; k < n; k++)
266
combinations[j][k] = 0;
269
// Generate combinations of derivatives
270
for (unsigned int row = 1; row < num_derivatives; row++)
272
for (unsigned int num = 0; num < row; num++)
274
for (unsigned int col = n-1; col+1 > 0; col--)
276
if (combinations[row][col] + 1 > 2)
277
combinations[row][col] = 0;
280
combinations[row][col] += 1;
287
// Compute inverse of Jacobian
288
const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
290
// Declare transformation matrix
291
// Declare pointer to two dimensional array and initialise
292
double **transform = new double *[num_derivatives];
294
for (unsigned int j = 0; j < num_derivatives; j++)
296
transform[j] = new double [num_derivatives];
297
for (unsigned int k = 0; k < num_derivatives; k++)
301
// Construct transformation matrix
302
for (unsigned int row = 0; row < num_derivatives; row++)
304
for (unsigned int col = 0; col < num_derivatives; col++)
306
for (unsigned int k = 0; k < n; k++)
307
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
312
for (unsigned int j = 0; j < 1*num_derivatives; j++)
315
// Map degree of freedom to element degree of freedom
316
const unsigned int dof = i;
319
const double scalings_y_0 = 1;
320
const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
321
const double scalings_z_0 = 1;
322
const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
324
// Compute psitilde_a
325
const double psitilde_a_0 = 1;
326
const double psitilde_a_1 = x;
328
// Compute psitilde_bs
329
const double psitilde_bs_0_0 = 1;
330
const double psitilde_bs_0_1 = 1.5*y + 0.5;
331
const double psitilde_bs_1_0 = 1;
333
// Compute psitilde_cs
334
const double psitilde_cs_00_0 = 1;
335
const double psitilde_cs_00_1 = 2*z + 1;
336
const double psitilde_cs_01_0 = 1;
337
const double psitilde_cs_10_0 = 1;
339
// Compute basisvalues
340
const double basisvalue0 = 0.866025404*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
341
const double basisvalue1 = 2.73861279*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
342
const double basisvalue2 = 1.58113883*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
343
const double basisvalue3 = 1.11803399*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
345
// Table(s) of coefficients
346
static const double coefficients0[4][4] = \
347
{{0.288675135, -0.182574186, -0.105409255, -0.0745355992},
348
{0.288675135, 0.182574186, -0.105409255, -0.0745355992},
349
{0.288675135, 0, 0.210818511, -0.0745355992},
350
{0.288675135, 0, 0, 0.223606798}};
352
// Interesting (new) part
353
// Tables of derivatives of the polynomial base (transpose)
354
static const double dmats0[4][4] = \
356
{6.32455532, 0, 0, 0},
360
static const double dmats1[4][4] = \
362
{3.16227766, 0, 0, 0},
363
{5.47722558, 0, 0, 0},
366
static const double dmats2[4][4] = \
368
{3.16227766, 0, 0, 0},
369
{1.82574186, 0, 0, 0},
370
{5.16397779, 0, 0, 0}};
372
// Compute reference derivatives
373
// Declare pointer to array of derivatives on FIAT element
374
double *derivatives = new double [num_derivatives];
376
// Declare coefficients
382
// Declare new coefficients
383
double new_coeff0_0 = 0;
384
double new_coeff0_1 = 0;
385
double new_coeff0_2 = 0;
386
double new_coeff0_3 = 0;
388
// Loop possible derivatives
389
for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
391
// Get values from coefficients array
392
new_coeff0_0 = coefficients0[dof][0];
393
new_coeff0_1 = coefficients0[dof][1];
394
new_coeff0_2 = coefficients0[dof][2];
395
new_coeff0_3 = coefficients0[dof][3];
397
// Loop derivative order
398
for (unsigned int j = 0; j < n; j++)
400
// Update old coefficients
401
coeff0_0 = new_coeff0_0;
402
coeff0_1 = new_coeff0_1;
403
coeff0_2 = new_coeff0_2;
404
coeff0_3 = new_coeff0_3;
406
if(combinations[deriv_num][j] == 0)
408
new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0];
409
new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1];
410
new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2];
411
new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3];
413
if(combinations[deriv_num][j] == 1)
415
new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0];
416
new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1];
417
new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2];
418
new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3];
420
if(combinations[deriv_num][j] == 2)
422
new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0];
423
new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1];
424
new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2];
425
new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3];
429
// Compute derivatives on reference element as dot product of coefficients and basisvalues
430
derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3;
433
// Transform derivatives back to physical element
434
for (unsigned int row = 0; row < num_derivatives; row++)
436
for (unsigned int col = 0; col < num_derivatives; col++)
438
values[row] += transform[row][col]*derivatives[col];
441
// Delete pointer to array of derivatives on FIAT element
442
delete [] derivatives;
444
// Delete pointer to array of combinations of derivatives and transform
445
for (unsigned int row = 0; row < num_derivatives; row++)
447
delete [] combinations[row];
448
delete [] transform[row];
451
delete [] combinations;
455
/// Evaluate order n derivatives of all basis functions at given point in cell
456
virtual void evaluate_basis_derivatives_all(unsigned int n,
458
const double* coordinates,
459
const ufc::cell& c) const
461
throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
464
/// Evaluate linear functional for dof i on the function f
465
virtual double evaluate_dof(unsigned int i,
466
const ufc::function& f,
467
const ufc::cell& c) const
469
// The reference points, direction and weights:
470
static const double X[4][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}};
471
static const double W[4][1] = {{1}, {1}, {1}, {1}};
472
static const double D[4][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}};
474
const double * const * x = c.coordinates;
476
// Iterate over the points:
477
// Evaluate basis functions for affine mapping
478
const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
479
const double w1 = X[i][0][0];
480
const double w2 = X[i][0][1];
481
const double w3 = X[i][0][2];
483
// Compute affine mapping y = F(X)
485
y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
486
y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
487
y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
489
// Evaluate function at physical points
491
f.evaluate(values, y, c);
493
// Map function values using appropriate mapping
494
// Affine map: Do nothing
496
// Note that we do not map the weights (yet).
498
// Take directional components
499
for(int k = 0; k < 1; k++)
500
result += values[k]*D[i][0][k];
501
// Multiply by weights
507
/// Evaluate linear functionals for all dofs on the function f
508
virtual void evaluate_dofs(double* values,
509
const ufc::function& f,
510
const ufc::cell& c) const
512
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
515
/// Interpolate vertex values from dof values
516
virtual void interpolate_vertex_values(double* vertex_values,
517
const double* dof_values,
518
const ufc::cell& c) const
520
// Evaluate at vertices and use affine mapping
521
vertex_values[0] = dof_values[0];
522
vertex_values[1] = dof_values[1];
523
vertex_values[2] = dof_values[2];
524
vertex_values[3] = dof_values[3];
527
/// Return the number of sub elements (for a mixed element)
528
virtual unsigned int num_sub_elements() const
533
/// Create a new finite element for sub element i (for a mixed element)
534
virtual ufc::finite_element* create_sub_element(unsigned int i) const
536
return new subdomains_0_finite_element_0();
541
/// This class defines the interface for a finite element.
543
class subdomains_0_finite_element_1: public ufc::finite_element
548
subdomains_0_finite_element_1() : ufc::finite_element()
554
virtual ~subdomains_0_finite_element_1()
559
/// Return a string identifying the finite element
560
virtual const char* signature() const
562
return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
565
/// Return the cell shape
566
virtual ufc::shape cell_shape() const
568
return ufc::tetrahedron;
571
/// Return the dimension of the finite element function space
572
virtual unsigned int space_dimension() const
577
/// Return the rank of the value space
578
virtual unsigned int value_rank() const
583
/// Return the dimension of the value space for axis i
584
virtual unsigned int value_dimension(unsigned int i) const
589
/// Evaluate basis function i at given point in cell
590
virtual void evaluate_basis(unsigned int i,
592
const double* coordinates,
593
const ufc::cell& c) const
595
// Extract vertex coordinates
596
const double * const * element_coordinates = c.coordinates;
598
// Compute Jacobian of affine map from reference cell
599
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
600
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
601
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
602
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
603
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
604
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
605
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
606
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
607
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
609
// Compute sub determinants
610
const double d00 = J_11*J_22 - J_12*J_21;
611
const double d01 = J_12*J_20 - J_10*J_22;
612
const double d02 = J_10*J_21 - J_11*J_20;
614
const double d10 = J_02*J_21 - J_01*J_22;
615
const double d11 = J_00*J_22 - J_02*J_20;
616
const double d12 = J_01*J_20 - J_00*J_21;
618
const double d20 = J_01*J_12 - J_02*J_11;
619
const double d21 = J_02*J_10 - J_00*J_12;
620
const double d22 = J_00*J_11 - J_01*J_10;
622
// Compute determinant of Jacobian
623
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
625
// Compute inverse of Jacobian
628
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
629
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
630
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
632
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
633
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
634
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
636
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
637
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
638
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
640
// Get coordinates and map to the UFC reference element
641
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
642
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
643
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
645
// Map coordinates to the reference cube
646
if (std::abs(y + z - 1.0) < 1e-08)
649
x = -2.0 * x/(y + z - 1.0) - 1.0;
650
if (std::abs(z - 1.0) < 1e-08)
653
y = 2.0 * y/(1.0 - z) - 1.0;
659
// Map degree of freedom to element degree of freedom
660
const unsigned int dof = i;
663
const double scalings_y_0 = 1;
664
const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
665
const double scalings_z_0 = 1;
666
const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
668
// Compute psitilde_a
669
const double psitilde_a_0 = 1;
670
const double psitilde_a_1 = x;
672
// Compute psitilde_bs
673
const double psitilde_bs_0_0 = 1;
674
const double psitilde_bs_0_1 = 1.5*y + 0.5;
675
const double psitilde_bs_1_0 = 1;
677
// Compute psitilde_cs
678
const double psitilde_cs_00_0 = 1;
679
const double psitilde_cs_00_1 = 2*z + 1;
680
const double psitilde_cs_01_0 = 1;
681
const double psitilde_cs_10_0 = 1;
683
// Compute basisvalues
684
const double basisvalue0 = 0.866025404*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
685
const double basisvalue1 = 2.73861279*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
686
const double basisvalue2 = 1.58113883*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
687
const double basisvalue3 = 1.11803399*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
689
// Table(s) of coefficients
690
static const double coefficients0[4][4] = \
691
{{0.288675135, -0.182574186, -0.105409255, -0.0745355992},
692
{0.288675135, 0.182574186, -0.105409255, -0.0745355992},
693
{0.288675135, 0, 0.210818511, -0.0745355992},
694
{0.288675135, 0, 0, 0.223606798}};
696
// Extract relevant coefficients
697
const double coeff0_0 = coefficients0[dof][0];
698
const double coeff0_1 = coefficients0[dof][1];
699
const double coeff0_2 = coefficients0[dof][2];
700
const double coeff0_3 = coefficients0[dof][3];
703
*values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3;
706
/// Evaluate all basis functions at given point in cell
707
virtual void evaluate_basis_all(double* values,
708
const double* coordinates,
709
const ufc::cell& c) const
711
throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
714
/// Evaluate order n derivatives of basis function i at given point in cell
715
virtual void evaluate_basis_derivatives(unsigned int i,
718
const double* coordinates,
719
const ufc::cell& c) const
721
// Extract vertex coordinates
722
const double * const * element_coordinates = c.coordinates;
724
// Compute Jacobian of affine map from reference cell
725
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
726
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
727
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
728
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
729
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
730
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
731
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
732
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
733
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
735
// Compute sub determinants
736
const double d00 = J_11*J_22 - J_12*J_21;
737
const double d01 = J_12*J_20 - J_10*J_22;
738
const double d02 = J_10*J_21 - J_11*J_20;
740
const double d10 = J_02*J_21 - J_01*J_22;
741
const double d11 = J_00*J_22 - J_02*J_20;
742
const double d12 = J_01*J_20 - J_00*J_21;
744
const double d20 = J_01*J_12 - J_02*J_11;
745
const double d21 = J_02*J_10 - J_00*J_12;
746
const double d22 = J_00*J_11 - J_01*J_10;
748
// Compute determinant of Jacobian
749
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
751
// Compute inverse of Jacobian
754
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
755
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
756
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
758
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
759
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
760
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
762
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
763
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
764
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
766
// Get coordinates and map to the UFC reference element
767
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
768
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
769
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
771
// Map coordinates to the reference cube
772
if (std::abs(y + z - 1.0) < 1e-08)
775
x = -2.0 * x/(y + z - 1.0) - 1.0;
776
if (std::abs(z - 1.0) < 1e-08)
779
y = 2.0 * y/(1.0 - z) - 1.0;
782
// Compute number of derivatives
783
unsigned int num_derivatives = 1;
785
for (unsigned int j = 0; j < n; j++)
786
num_derivatives *= 3;
789
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
790
unsigned int **combinations = new unsigned int *[num_derivatives];
792
for (unsigned int j = 0; j < num_derivatives; j++)
794
combinations[j] = new unsigned int [n];
795
for (unsigned int k = 0; k < n; k++)
796
combinations[j][k] = 0;
799
// Generate combinations of derivatives
800
for (unsigned int row = 1; row < num_derivatives; row++)
802
for (unsigned int num = 0; num < row; num++)
804
for (unsigned int col = n-1; col+1 > 0; col--)
806
if (combinations[row][col] + 1 > 2)
807
combinations[row][col] = 0;
810
combinations[row][col] += 1;
817
// Compute inverse of Jacobian
818
const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
820
// Declare transformation matrix
821
// Declare pointer to two dimensional array and initialise
822
double **transform = new double *[num_derivatives];
824
for (unsigned int j = 0; j < num_derivatives; j++)
826
transform[j] = new double [num_derivatives];
827
for (unsigned int k = 0; k < num_derivatives; k++)
831
// Construct transformation matrix
832
for (unsigned int row = 0; row < num_derivatives; row++)
834
for (unsigned int col = 0; col < num_derivatives; col++)
836
for (unsigned int k = 0; k < n; k++)
837
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
842
for (unsigned int j = 0; j < 1*num_derivatives; j++)
845
// Map degree of freedom to element degree of freedom
846
const unsigned int dof = i;
849
const double scalings_y_0 = 1;
850
const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
851
const double scalings_z_0 = 1;
852
const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
854
// Compute psitilde_a
855
const double psitilde_a_0 = 1;
856
const double psitilde_a_1 = x;
858
// Compute psitilde_bs
859
const double psitilde_bs_0_0 = 1;
860
const double psitilde_bs_0_1 = 1.5*y + 0.5;
861
const double psitilde_bs_1_0 = 1;
863
// Compute psitilde_cs
864
const double psitilde_cs_00_0 = 1;
865
const double psitilde_cs_00_1 = 2*z + 1;
866
const double psitilde_cs_01_0 = 1;
867
const double psitilde_cs_10_0 = 1;
869
// Compute basisvalues
870
const double basisvalue0 = 0.866025404*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
871
const double basisvalue1 = 2.73861279*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
872
const double basisvalue2 = 1.58113883*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
873
const double basisvalue3 = 1.11803399*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
875
// Table(s) of coefficients
876
static const double coefficients0[4][4] = \
877
{{0.288675135, -0.182574186, -0.105409255, -0.0745355992},
878
{0.288675135, 0.182574186, -0.105409255, -0.0745355992},
879
{0.288675135, 0, 0.210818511, -0.0745355992},
880
{0.288675135, 0, 0, 0.223606798}};
882
// Interesting (new) part
883
// Tables of derivatives of the polynomial base (transpose)
884
static const double dmats0[4][4] = \
886
{6.32455532, 0, 0, 0},
890
static const double dmats1[4][4] = \
892
{3.16227766, 0, 0, 0},
893
{5.47722558, 0, 0, 0},
896
static const double dmats2[4][4] = \
898
{3.16227766, 0, 0, 0},
899
{1.82574186, 0, 0, 0},
900
{5.16397779, 0, 0, 0}};
902
// Compute reference derivatives
903
// Declare pointer to array of derivatives on FIAT element
904
double *derivatives = new double [num_derivatives];
906
// Declare coefficients
912
// Declare new coefficients
913
double new_coeff0_0 = 0;
914
double new_coeff0_1 = 0;
915
double new_coeff0_2 = 0;
916
double new_coeff0_3 = 0;
918
// Loop possible derivatives
919
for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
921
// Get values from coefficients array
922
new_coeff0_0 = coefficients0[dof][0];
923
new_coeff0_1 = coefficients0[dof][1];
924
new_coeff0_2 = coefficients0[dof][2];
925
new_coeff0_3 = coefficients0[dof][3];
927
// Loop derivative order
928
for (unsigned int j = 0; j < n; j++)
930
// Update old coefficients
931
coeff0_0 = new_coeff0_0;
932
coeff0_1 = new_coeff0_1;
933
coeff0_2 = new_coeff0_2;
934
coeff0_3 = new_coeff0_3;
936
if(combinations[deriv_num][j] == 0)
938
new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0];
939
new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1];
940
new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2];
941
new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3];
943
if(combinations[deriv_num][j] == 1)
945
new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0];
946
new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1];
947
new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2];
948
new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3];
950
if(combinations[deriv_num][j] == 2)
952
new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0];
953
new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1];
954
new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2];
955
new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3];
959
// Compute derivatives on reference element as dot product of coefficients and basisvalues
960
derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3;
963
// Transform derivatives back to physical element
964
for (unsigned int row = 0; row < num_derivatives; row++)
966
for (unsigned int col = 0; col < num_derivatives; col++)
968
values[row] += transform[row][col]*derivatives[col];
971
// Delete pointer to array of derivatives on FIAT element
972
delete [] derivatives;
974
// Delete pointer to array of combinations of derivatives and transform
975
for (unsigned int row = 0; row < num_derivatives; row++)
977
delete [] combinations[row];
978
delete [] transform[row];
981
delete [] combinations;
985
/// Evaluate order n derivatives of all basis functions at given point in cell
986
virtual void evaluate_basis_derivatives_all(unsigned int n,
988
const double* coordinates,
989
const ufc::cell& c) const
991
throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
994
/// Evaluate linear functional for dof i on the function f
995
virtual double evaluate_dof(unsigned int i,
996
const ufc::function& f,
997
const ufc::cell& c) const
999
// The reference points, direction and weights:
1000
static const double X[4][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}};
1001
static const double W[4][1] = {{1}, {1}, {1}, {1}};
1002
static const double D[4][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}};
1004
const double * const * x = c.coordinates;
1005
double result = 0.0;
1006
// Iterate over the points:
1007
// Evaluate basis functions for affine mapping
1008
const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
1009
const double w1 = X[i][0][0];
1010
const double w2 = X[i][0][1];
1011
const double w3 = X[i][0][2];
1013
// Compute affine mapping y = F(X)
1015
y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
1016
y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
1017
y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
1019
// Evaluate function at physical points
1021
f.evaluate(values, y, c);
1023
// Map function values using appropriate mapping
1024
// Affine map: Do nothing
1026
// Note that we do not map the weights (yet).
1028
// Take directional components
1029
for(int k = 0; k < 1; k++)
1030
result += values[k]*D[i][0][k];
1031
// Multiply by weights
1037
/// Evaluate linear functionals for all dofs on the function f
1038
virtual void evaluate_dofs(double* values,
1039
const ufc::function& f,
1040
const ufc::cell& c) const
1042
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
1045
/// Interpolate vertex values from dof values
1046
virtual void interpolate_vertex_values(double* vertex_values,
1047
const double* dof_values,
1048
const ufc::cell& c) const
1050
// Evaluate at vertices and use affine mapping
1051
vertex_values[0] = dof_values[0];
1052
vertex_values[1] = dof_values[1];
1053
vertex_values[2] = dof_values[2];
1054
vertex_values[3] = dof_values[3];
1057
/// Return the number of sub elements (for a mixed element)
1058
virtual unsigned int num_sub_elements() const
1063
/// Create a new finite element for sub element i (for a mixed element)
1064
virtual ufc::finite_element* create_sub_element(unsigned int i) const
1066
return new subdomains_0_finite_element_1();
1071
/// This class defines the interface for a local-to-global mapping of
1072
/// degrees of freedom (dofs).
1074
class subdomains_0_dof_map_0: public ufc::dof_map
1078
unsigned int __global_dimension;
1083
subdomains_0_dof_map_0() : ufc::dof_map()
1085
__global_dimension = 0;
1089
virtual ~subdomains_0_dof_map_0()
1094
/// Return a string identifying the dof map
1095
virtual const char* signature() const
1097
return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
1100
/// Return true iff mesh entities of topological dimension d are needed
1101
virtual bool needs_mesh_entities(unsigned int d) const
1121
/// Initialize dof map for mesh (return true iff init_cell() is needed)
1122
virtual bool init_mesh(const ufc::mesh& m)
1124
__global_dimension = m.num_entities[0];
1128
/// Initialize dof map for given cell
1129
virtual void init_cell(const ufc::mesh& m,
1135
/// Finish initialization of dof map for cells
1136
virtual void init_cell_finalize()
1141
/// Return the dimension of the global finite element function space
1142
virtual unsigned int global_dimension() const
1144
return __global_dimension;
1147
/// Return the dimension of the local finite element function space for a cell
1148
virtual unsigned int local_dimension(const ufc::cell& c) const
1153
/// Return the maximum dimension of the local finite element function space
1154
virtual unsigned int max_local_dimension() const
1159
// Return the geometric dimension of the coordinates this dof map provides
1160
virtual unsigned int geometric_dimension() const
1165
/// Return the number of dofs on each cell facet
1166
virtual unsigned int num_facet_dofs() const
1171
/// Return the number of dofs associated with each cell entity of dimension d
1172
virtual unsigned int num_entity_dofs(unsigned int d) const
1174
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
1177
/// Tabulate the local-to-global mapping of dofs on a cell
1178
virtual void tabulate_dofs(unsigned int* dofs,
1180
const ufc::cell& c) const
1182
dofs[0] = c.entity_indices[0][0];
1183
dofs[1] = c.entity_indices[0][1];
1184
dofs[2] = c.entity_indices[0][2];
1185
dofs[3] = c.entity_indices[0][3];
1188
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
1189
virtual void tabulate_facet_dofs(unsigned int* dofs,
1190
unsigned int facet) const
1217
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
1218
virtual void tabulate_entity_dofs(unsigned int* dofs,
1219
unsigned int d, unsigned int i) const
1221
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
1224
/// Tabulate the coordinates of all dofs on a cell
1225
virtual void tabulate_coordinates(double** coordinates,
1226
const ufc::cell& c) const
1228
const double * const * x = c.coordinates;
1229
coordinates[0][0] = x[0][0];
1230
coordinates[0][1] = x[0][1];
1231
coordinates[0][2] = x[0][2];
1232
coordinates[1][0] = x[1][0];
1233
coordinates[1][1] = x[1][1];
1234
coordinates[1][2] = x[1][2];
1235
coordinates[2][0] = x[2][0];
1236
coordinates[2][1] = x[2][1];
1237
coordinates[2][2] = x[2][2];
1238
coordinates[3][0] = x[3][0];
1239
coordinates[3][1] = x[3][1];
1240
coordinates[3][2] = x[3][2];
1243
/// Return the number of sub dof maps (for a mixed element)
1244
virtual unsigned int num_sub_dof_maps() const
1249
/// Create a new dof_map for sub dof map i (for a mixed element)
1250
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
1252
return new subdomains_0_dof_map_0();
1257
/// This class defines the interface for a local-to-global mapping of
1258
/// degrees of freedom (dofs).
1260
class subdomains_0_dof_map_1: public ufc::dof_map
1264
unsigned int __global_dimension;
1269
subdomains_0_dof_map_1() : ufc::dof_map()
1271
__global_dimension = 0;
1275
virtual ~subdomains_0_dof_map_1()
1280
/// Return a string identifying the dof map
1281
virtual const char* signature() const
1283
return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
1286
/// Return true iff mesh entities of topological dimension d are needed
1287
virtual bool needs_mesh_entities(unsigned int d) const
1307
/// Initialize dof map for mesh (return true iff init_cell() is needed)
1308
virtual bool init_mesh(const ufc::mesh& m)
1310
__global_dimension = m.num_entities[0];
1314
/// Initialize dof map for given cell
1315
virtual void init_cell(const ufc::mesh& m,
1321
/// Finish initialization of dof map for cells
1322
virtual void init_cell_finalize()
1327
/// Return the dimension of the global finite element function space
1328
virtual unsigned int global_dimension() const
1330
return __global_dimension;
1333
/// Return the dimension of the local finite element function space for a cell
1334
virtual unsigned int local_dimension(const ufc::cell& c) const
1339
/// Return the maximum dimension of the local finite element function space
1340
virtual unsigned int max_local_dimension() const
1345
// Return the geometric dimension of the coordinates this dof map provides
1346
virtual unsigned int geometric_dimension() const
1351
/// Return the number of dofs on each cell facet
1352
virtual unsigned int num_facet_dofs() const
1357
/// Return the number of dofs associated with each cell entity of dimension d
1358
virtual unsigned int num_entity_dofs(unsigned int d) const
1360
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
1363
/// Tabulate the local-to-global mapping of dofs on a cell
1364
virtual void tabulate_dofs(unsigned int* dofs,
1366
const ufc::cell& c) const
1368
dofs[0] = c.entity_indices[0][0];
1369
dofs[1] = c.entity_indices[0][1];
1370
dofs[2] = c.entity_indices[0][2];
1371
dofs[3] = c.entity_indices[0][3];
1374
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
1375
virtual void tabulate_facet_dofs(unsigned int* dofs,
1376
unsigned int facet) const
1403
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
1404
virtual void tabulate_entity_dofs(unsigned int* dofs,
1405
unsigned int d, unsigned int i) const
1407
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
1410
/// Tabulate the coordinates of all dofs on a cell
1411
virtual void tabulate_coordinates(double** coordinates,
1412
const ufc::cell& c) const
1414
const double * const * x = c.coordinates;
1415
coordinates[0][0] = x[0][0];
1416
coordinates[0][1] = x[0][1];
1417
coordinates[0][2] = x[0][2];
1418
coordinates[1][0] = x[1][0];
1419
coordinates[1][1] = x[1][1];
1420
coordinates[1][2] = x[1][2];
1421
coordinates[2][0] = x[2][0];
1422
coordinates[2][1] = x[2][1];
1423
coordinates[2][2] = x[2][2];
1424
coordinates[3][0] = x[3][0];
1425
coordinates[3][1] = x[3][1];
1426
coordinates[3][2] = x[3][2];
1429
/// Return the number of sub dof maps (for a mixed element)
1430
virtual unsigned int num_sub_dof_maps() const
1435
/// Create a new dof_map for sub dof map i (for a mixed element)
1436
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
1438
return new subdomains_0_dof_map_1();
1443
/// This class defines the interface for the tabulation of the cell
1444
/// tensor corresponding to the local contribution to a form from
1445
/// the integral over a cell.
1447
class subdomains_0_cell_integral_0_quadrature: public ufc::cell_integral
1452
subdomains_0_cell_integral_0_quadrature() : ufc::cell_integral()
1458
virtual ~subdomains_0_cell_integral_0_quadrature()
1463
/// Tabulate the tensor for the contribution from a local cell
1464
virtual void tabulate_tensor(double* A,
1465
const double * const * w,
1466
const ufc::cell& c) const
1468
// Extract vertex coordinates
1469
const double * const * x = c.coordinates;
1471
// Compute Jacobian of affine map from reference cell
1472
const double J_00 = x[1][0] - x[0][0];
1473
const double J_01 = x[2][0] - x[0][0];
1474
const double J_02 = x[3][0] - x[0][0];
1475
const double J_10 = x[1][1] - x[0][1];
1476
const double J_11 = x[2][1] - x[0][1];
1477
const double J_12 = x[3][1] - x[0][1];
1478
const double J_20 = x[1][2] - x[0][2];
1479
const double J_21 = x[2][2] - x[0][2];
1480
const double J_22 = x[3][2] - x[0][2];
1482
// Compute sub determinants
1483
const double d_00 = J_11*J_22 - J_12*J_21;
1485
const double d_10 = J_02*J_21 - J_01*J_22;
1487
const double d_20 = J_01*J_12 - J_02*J_11;
1489
// Compute determinant of Jacobian
1490
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
1492
// Compute inverse of Jacobian
1495
const double det = std::abs(detJ);
1498
// Array of quadrature weights
1499
static const double W8[8] = {0.0369798564, 0.0160270406, 0.0211570065, 0.00916942992, 0.0369798564, 0.0160270406, 0.0211570065, 0.00916942992};
1500
// Quadrature points on the UFC reference element: (0.156682637, 0.136054977, 0.122514823), (0.081395667, 0.0706797242, 0.544151844), (0.0658386871, 0.565933165, 0.122514823), (0.0342027932, 0.293998801, 0.544151844), (0.584747563, 0.136054977, 0.122514823), (0.303772765, 0.0706797242, 0.544151844), (0.245713325, 0.565933165, 0.122514823), (0.127646562, 0.293998801, 0.544151844)
1502
// Value of basis functions at quadrature points.
1503
static const double FE0[8][4] = \
1504
{{0.584747563, 0.156682637, 0.136054977, 0.122514823},
1505
{0.303772765, 0.081395667, 0.0706797242, 0.544151844},
1506
{0.245713325, 0.0658386871, 0.565933165, 0.122514823},
1507
{0.127646562, 0.0342027932, 0.293998801, 0.544151844},
1508
{0.156682637, 0.584747563, 0.136054977, 0.122514823},
1509
{0.081395667, 0.303772765, 0.0706797242, 0.544151844},
1510
{0.0658386871, 0.245713325, 0.565933165, 0.122514823},
1511
{0.0342027932, 0.127646562, 0.293998801, 0.544151844}};
1514
// Compute element tensor using UFL quadrature representation
1515
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
1516
// Total number of operations to compute element tensor: 512
1518
// Loop quadrature points for integral
1519
// Number of operations to compute element tensor for following IP loop = 512
1520
for (unsigned int ip = 0; ip < 8; ip++)
1523
// Number of operations for primary indices: 64
1524
for (unsigned int j = 0; j < 4; j++)
1526
for (unsigned int k = 0; k < 4; k++)
1528
// Number of operations to compute entry: 4
1529
A[j*4 + k] += FE0[ip][j]*FE0[ip][k]*W8[ip]*det;
1530
}// end loop over 'k'
1531
}// end loop over 'j'
1532
}// end loop over 'ip'
1537
/// This class defines the interface for the tabulation of the cell
1538
/// tensor corresponding to the local contribution to a form from
1539
/// the integral over a cell.
1541
class subdomains_0_cell_integral_0: public ufc::cell_integral
1545
subdomains_0_cell_integral_0_quadrature integral_0_quadrature;
1550
subdomains_0_cell_integral_0() : ufc::cell_integral()
1556
virtual ~subdomains_0_cell_integral_0()
1561
/// Tabulate the tensor for the contribution from a local cell
1562
virtual void tabulate_tensor(double* A,
1563
const double * const * w,
1564
const ufc::cell& c) const
1566
// Reset values of the element tensor block
1567
for (unsigned int j = 0; j < 16; j++)
1570
// Add all contributions to element tensor
1571
integral_0_quadrature.tabulate_tensor(A, w, c);
1576
/// This class defines the interface for the tabulation of the cell
1577
/// tensor corresponding to the local contribution to a form from
1578
/// the integral over a cell.
1580
class subdomains_0_cell_integral_1_quadrature: public ufc::cell_integral
1585
subdomains_0_cell_integral_1_quadrature() : ufc::cell_integral()
1591
virtual ~subdomains_0_cell_integral_1_quadrature()
1596
/// Tabulate the tensor for the contribution from a local cell
1597
virtual void tabulate_tensor(double* A,
1598
const double * const * w,
1599
const ufc::cell& c) const
1601
// Extract vertex coordinates
1602
const double * const * x = c.coordinates;
1604
// Compute Jacobian of affine map from reference cell
1605
const double J_00 = x[1][0] - x[0][0];
1606
const double J_01 = x[2][0] - x[0][0];
1607
const double J_02 = x[3][0] - x[0][0];
1608
const double J_10 = x[1][1] - x[0][1];
1609
const double J_11 = x[2][1] - x[0][1];
1610
const double J_12 = x[3][1] - x[0][1];
1611
const double J_20 = x[1][2] - x[0][2];
1612
const double J_21 = x[2][2] - x[0][2];
1613
const double J_22 = x[3][2] - x[0][2];
1615
// Compute sub determinants
1616
const double d_00 = J_11*J_22 - J_12*J_21;
1618
const double d_10 = J_02*J_21 - J_01*J_22;
1620
const double d_20 = J_01*J_12 - J_02*J_11;
1622
// Compute determinant of Jacobian
1623
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
1625
// Compute inverse of Jacobian
1628
const double det = std::abs(detJ);
1631
// Array of quadrature weights
1632
static const double W8[8] = {0.0369798564, 0.0160270406, 0.0211570065, 0.00916942992, 0.0369798564, 0.0160270406, 0.0211570065, 0.00916942992};
1633
// Quadrature points on the UFC reference element: (0.156682637, 0.136054977, 0.122514823), (0.081395667, 0.0706797242, 0.544151844), (0.0658386871, 0.565933165, 0.122514823), (0.0342027932, 0.293998801, 0.544151844), (0.584747563, 0.136054977, 0.122514823), (0.303772765, 0.0706797242, 0.544151844), (0.245713325, 0.565933165, 0.122514823), (0.127646562, 0.293998801, 0.544151844)
1635
// Value of basis functions at quadrature points.
1636
static const double FE0[8][4] = \
1637
{{0.584747563, 0.156682637, 0.136054977, 0.122514823},
1638
{0.303772765, 0.081395667, 0.0706797242, 0.544151844},
1639
{0.245713325, 0.0658386871, 0.565933165, 0.122514823},
1640
{0.127646562, 0.0342027932, 0.293998801, 0.544151844},
1641
{0.156682637, 0.584747563, 0.136054977, 0.122514823},
1642
{0.081395667, 0.303772765, 0.0706797242, 0.544151844},
1643
{0.0658386871, 0.245713325, 0.565933165, 0.122514823},
1644
{0.0342027932, 0.127646562, 0.293998801, 0.544151844}};
1647
// Compute element tensor using UFL quadrature representation
1648
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
1649
// Total number of operations to compute element tensor: 640
1651
// Loop quadrature points for integral
1652
// Number of operations to compute element tensor for following IP loop = 640
1653
for (unsigned int ip = 0; ip < 8; ip++)
1656
// Number of operations for primary indices: 80
1657
for (unsigned int j = 0; j < 4; j++)
1659
for (unsigned int k = 0; k < 4; k++)
1661
// Number of operations to compute entry: 5
1662
A[j*4 + k] += FE0[ip][k]*FE0[ip][j]*10*W8[ip]*det;
1663
}// end loop over 'k'
1664
}// end loop over 'j'
1665
}// end loop over 'ip'
1670
/// This class defines the interface for the tabulation of the cell
1671
/// tensor corresponding to the local contribution to a form from
1672
/// the integral over a cell.
1674
class subdomains_0_cell_integral_1: public ufc::cell_integral
1678
subdomains_0_cell_integral_1_quadrature integral_1_quadrature;
1683
subdomains_0_cell_integral_1() : ufc::cell_integral()
1689
virtual ~subdomains_0_cell_integral_1()
1694
/// Tabulate the tensor for the contribution from a local cell
1695
virtual void tabulate_tensor(double* A,
1696
const double * const * w,
1697
const ufc::cell& c) const
1699
// Reset values of the element tensor block
1700
for (unsigned int j = 0; j < 16; j++)
1703
// Add all contributions to element tensor
1704
integral_1_quadrature.tabulate_tensor(A, w, c);
1709
/// This class defines the interface for the tabulation of the
1710
/// exterior facet tensor corresponding to the local contribution to
1711
/// a form from the integral over an exterior facet.
1713
class subdomains_0_exterior_facet_integral_0_quadrature: public ufc::exterior_facet_integral
1718
subdomains_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
1724
virtual ~subdomains_0_exterior_facet_integral_0_quadrature()
1729
/// Tabulate the tensor for the contribution from a local exterior facet
1730
virtual void tabulate_tensor(double* A,
1731
const double * const * w,
1733
unsigned int facet) const
1735
// Extract vertex coordinates
1736
const double * const * x = c.coordinates;
1738
// Compute Jacobian of affine map from reference cell
1740
// Compute sub determinants
1744
// Compute determinant of Jacobian
1746
// Compute inverse of Jacobian
1748
// Vertices on faces
1749
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
1752
const unsigned int v0 = face_vertices[facet][0];
1753
const unsigned int v1 = face_vertices[facet][1];
1754
const unsigned int v2 = face_vertices[facet][2];
1756
// Compute scale factor (area of face scaled by area of reference triangle)
1757
const double a0 = (x[v0][1]*x[v1][2] + x[v0][2]*x[v2][1] + x[v1][1]*x[v2][2])
1758
- (x[v2][1]*x[v1][2] + x[v2][2]*x[v0][1] + x[v1][1]*x[v0][2]);
1759
const double a1 = (x[v0][2]*x[v1][0] + x[v0][0]*x[v2][2] + x[v1][2]*x[v2][0])
1760
- (x[v2][2]*x[v1][0] + x[v2][0]*x[v0][2] + x[v1][2]*x[v0][0]);
1761
const double a2 = (x[v0][0]*x[v1][1] + x[v0][1]*x[v2][0] + x[v1][0]*x[v2][1])
1762
- (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
1763
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
1765
// Compute facet normals from the facet scale factor constants
1768
// Array of quadrature weights
1769
static const double W4[4] = {0.159020691, 0.0909793091, 0.159020691, 0.0909793091};
1770
// Quadrature points on the UFC reference element: (0.178558728, 0.155051026), (0.0750311102, 0.644948974), (0.666390246, 0.155051026), (0.280019915, 0.644948974)
1772
// Value of basis functions at quadrature points.
1773
static const double FE0_f0[4][4] = \
1774
{{0, 0.666390246, 0.178558728, 0.155051026},
1775
{0, 0.280019915, 0.0750311102, 0.644948974},
1776
{0, 0.178558728, 0.666390246, 0.155051026},
1777
{0, 0.0750311102, 0.280019915, 0.644948974}};
1779
static const double FE0_f1[4][4] = \
1780
{{0.666390246, 0, 0.178558728, 0.155051026},
1781
{0.280019915, 0, 0.0750311102, 0.644948974},
1782
{0.178558728, 0, 0.666390246, 0.155051026},
1783
{0.0750311102, 0, 0.280019915, 0.644948974}};
1785
static const double FE0_f2[4][4] = \
1786
{{0.666390246, 0.178558728, 0, 0.155051026},
1787
{0.280019915, 0.0750311102, 0, 0.644948974},
1788
{0.178558728, 0.666390246, 0, 0.155051026},
1789
{0.0750311102, 0.280019915, 0, 0.644948974}};
1791
static const double FE0_f3[4][4] = \
1792
{{0.666390246, 0.178558728, 0.155051026, 0},
1793
{0.280019915, 0.0750311102, 0.644948974, 0},
1794
{0.178558728, 0.666390246, 0.155051026, 0},
1795
{0.0750311102, 0.280019915, 0.644948974, 0}};
1798
// Compute element tensor using UFL quadrature representation
1799
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
1804
// Total number of operations to compute element tensor (from this point): 256
1806
// Loop quadrature points for integral
1807
// Number of operations to compute element tensor for following IP loop = 256
1808
for (unsigned int ip = 0; ip < 4; ip++)
1811
// Number of operations for primary indices: 64
1812
for (unsigned int j = 0; j < 4; j++)
1814
for (unsigned int k = 0; k < 4; k++)
1816
// Number of operations to compute entry: 4
1817
A[j*4 + k] += FE0_f0[ip][j]*FE0_f0[ip][k]*W4[ip]*det;
1818
}// end loop over 'k'
1819
}// end loop over 'j'
1820
}// end loop over 'ip'
1825
// Total number of operations to compute element tensor (from this point): 256
1827
// Loop quadrature points for integral
1828
// Number of operations to compute element tensor for following IP loop = 256
1829
for (unsigned int ip = 0; ip < 4; ip++)
1832
// Number of operations for primary indices: 64
1833
for (unsigned int j = 0; j < 4; j++)
1835
for (unsigned int k = 0; k < 4; k++)
1837
// Number of operations to compute entry: 4
1838
A[j*4 + k] += FE0_f1[ip][j]*FE0_f1[ip][k]*W4[ip]*det;
1839
}// end loop over 'k'
1840
}// end loop over 'j'
1841
}// end loop over 'ip'
1846
// Total number of operations to compute element tensor (from this point): 256
1848
// Loop quadrature points for integral
1849
// Number of operations to compute element tensor for following IP loop = 256
1850
for (unsigned int ip = 0; ip < 4; ip++)
1853
// Number of operations for primary indices: 64
1854
for (unsigned int j = 0; j < 4; j++)
1856
for (unsigned int k = 0; k < 4; k++)
1858
// Number of operations to compute entry: 4
1859
A[j*4 + k] += FE0_f2[ip][j]*FE0_f2[ip][k]*W4[ip]*det;
1860
}// end loop over 'k'
1861
}// end loop over 'j'
1862
}// end loop over 'ip'
1867
// Total number of operations to compute element tensor (from this point): 256
1869
// Loop quadrature points for integral
1870
// Number of operations to compute element tensor for following IP loop = 256
1871
for (unsigned int ip = 0; ip < 4; ip++)
1874
// Number of operations for primary indices: 64
1875
for (unsigned int j = 0; j < 4; j++)
1877
for (unsigned int k = 0; k < 4; k++)
1879
// Number of operations to compute entry: 4
1880
A[j*4 + k] += FE0_f3[ip][j]*FE0_f3[ip][k]*W4[ip]*det;
1881
}// end loop over 'k'
1882
}// end loop over 'j'
1883
}// end loop over 'ip'
1891
/// This class defines the interface for the tabulation of the
1892
/// exterior facet tensor corresponding to the local contribution to
1893
/// a form from the integral over an exterior facet.
1895
class subdomains_0_exterior_facet_integral_0: public ufc::exterior_facet_integral
1899
subdomains_0_exterior_facet_integral_0_quadrature integral_0_quadrature;
1904
subdomains_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
1910
virtual ~subdomains_0_exterior_facet_integral_0()
1915
/// Tabulate the tensor for the contribution from a local exterior facet
1916
virtual void tabulate_tensor(double* A,
1917
const double * const * w,
1919
unsigned int facet) const
1921
// Reset values of the element tensor block
1922
for (unsigned int j = 0; j < 16; j++)
1925
// Add all contributions to element tensor
1926
integral_0_quadrature.tabulate_tensor(A, w, c, facet);
1931
/// This class defines the interface for the tabulation of the
1932
/// exterior facet tensor corresponding to the local contribution to
1933
/// a form from the integral over an exterior facet.
1935
class subdomains_0_exterior_facet_integral_1_quadrature: public ufc::exterior_facet_integral
1940
subdomains_0_exterior_facet_integral_1_quadrature() : ufc::exterior_facet_integral()
1946
virtual ~subdomains_0_exterior_facet_integral_1_quadrature()
1951
/// Tabulate the tensor for the contribution from a local exterior facet
1952
virtual void tabulate_tensor(double* A,
1953
const double * const * w,
1955
unsigned int facet) const
1957
// Extract vertex coordinates
1958
const double * const * x = c.coordinates;
1960
// Compute Jacobian of affine map from reference cell
1962
// Compute sub determinants
1966
// Compute determinant of Jacobian
1968
// Compute inverse of Jacobian
1970
// Vertices on faces
1971
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
1974
const unsigned int v0 = face_vertices[facet][0];
1975
const unsigned int v1 = face_vertices[facet][1];
1976
const unsigned int v2 = face_vertices[facet][2];
1978
// Compute scale factor (area of face scaled by area of reference triangle)
1979
const double a0 = (x[v0][1]*x[v1][2] + x[v0][2]*x[v2][1] + x[v1][1]*x[v2][2])
1980
- (x[v2][1]*x[v1][2] + x[v2][2]*x[v0][1] + x[v1][1]*x[v0][2]);
1981
const double a1 = (x[v0][2]*x[v1][0] + x[v0][0]*x[v2][2] + x[v1][2]*x[v2][0])
1982
- (x[v2][2]*x[v1][0] + x[v2][0]*x[v0][2] + x[v1][2]*x[v0][0]);
1983
const double a2 = (x[v0][0]*x[v1][1] + x[v0][1]*x[v2][0] + x[v1][0]*x[v2][1])
1984
- (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
1985
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
1987
// Compute facet normals from the facet scale factor constants
1990
// Array of quadrature weights
1991
static const double W4[4] = {0.159020691, 0.0909793091, 0.159020691, 0.0909793091};
1992
// Quadrature points on the UFC reference element: (0.178558728, 0.155051026), (0.0750311102, 0.644948974), (0.666390246, 0.155051026), (0.280019915, 0.644948974)
1994
// Value of basis functions at quadrature points.
1995
static const double FE0_f0[4][4] = \
1996
{{0, 0.666390246, 0.178558728, 0.155051026},
1997
{0, 0.280019915, 0.0750311102, 0.644948974},
1998
{0, 0.178558728, 0.666390246, 0.155051026},
1999
{0, 0.0750311102, 0.280019915, 0.644948974}};
2001
static const double FE0_f1[4][4] = \
2002
{{0.666390246, 0, 0.178558728, 0.155051026},
2003
{0.280019915, 0, 0.0750311102, 0.644948974},
2004
{0.178558728, 0, 0.666390246, 0.155051026},
2005
{0.0750311102, 0, 0.280019915, 0.644948974}};
2007
static const double FE0_f2[4][4] = \
2008
{{0.666390246, 0.178558728, 0, 0.155051026},
2009
{0.280019915, 0.0750311102, 0, 0.644948974},
2010
{0.178558728, 0.666390246, 0, 0.155051026},
2011
{0.0750311102, 0.280019915, 0, 0.644948974}};
2013
static const double FE0_f3[4][4] = \
2014
{{0.666390246, 0.178558728, 0.155051026, 0},
2015
{0.280019915, 0.0750311102, 0.644948974, 0},
2016
{0.178558728, 0.666390246, 0.155051026, 0},
2017
{0.0750311102, 0.280019915, 0.644948974, 0}};
2020
// Compute element tensor using UFL quadrature representation
2021
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
2026
// Total number of operations to compute element tensor (from this point): 320
2028
// Loop quadrature points for integral
2029
// Number of operations to compute element tensor for following IP loop = 320
2030
for (unsigned int ip = 0; ip < 4; ip++)
2033
// Number of operations for primary indices: 80
2034
for (unsigned int j = 0; j < 4; j++)
2036
for (unsigned int k = 0; k < 4; k++)
2038
// Number of operations to compute entry: 5
2039
A[j*4 + k] += FE0_f0[ip][k]*FE0_f0[ip][j]*2*W4[ip]*det;
2040
}// end loop over 'k'
2041
}// end loop over 'j'
2042
}// end loop over 'ip'
2047
// Total number of operations to compute element tensor (from this point): 320
2049
// Loop quadrature points for integral
2050
// Number of operations to compute element tensor for following IP loop = 320
2051
for (unsigned int ip = 0; ip < 4; ip++)
2054
// Number of operations for primary indices: 80
2055
for (unsigned int j = 0; j < 4; j++)
2057
for (unsigned int k = 0; k < 4; k++)
2059
// Number of operations to compute entry: 5
2060
A[j*4 + k] += FE0_f1[ip][k]*FE0_f1[ip][j]*2*W4[ip]*det;
2061
}// end loop over 'k'
2062
}// end loop over 'j'
2063
}// end loop over 'ip'
2068
// Total number of operations to compute element tensor (from this point): 320
2070
// Loop quadrature points for integral
2071
// Number of operations to compute element tensor for following IP loop = 320
2072
for (unsigned int ip = 0; ip < 4; ip++)
2075
// Number of operations for primary indices: 80
2076
for (unsigned int j = 0; j < 4; j++)
2078
for (unsigned int k = 0; k < 4; k++)
2080
// Number of operations to compute entry: 5
2081
A[j*4 + k] += FE0_f2[ip][k]*FE0_f2[ip][j]*2*W4[ip]*det;
2082
}// end loop over 'k'
2083
}// end loop over 'j'
2084
}// end loop over 'ip'
2089
// Total number of operations to compute element tensor (from this point): 320
2091
// Loop quadrature points for integral
2092
// Number of operations to compute element tensor for following IP loop = 320
2093
for (unsigned int ip = 0; ip < 4; ip++)
2096
// Number of operations for primary indices: 80
2097
for (unsigned int j = 0; j < 4; j++)
2099
for (unsigned int k = 0; k < 4; k++)
2101
// Number of operations to compute entry: 5
2102
A[j*4 + k] += FE0_f3[ip][k]*FE0_f3[ip][j]*2*W4[ip]*det;
2103
}// end loop over 'k'
2104
}// end loop over 'j'
2105
}// end loop over 'ip'
2113
/// This class defines the interface for the tabulation of the
2114
/// exterior facet tensor corresponding to the local contribution to
2115
/// a form from the integral over an exterior facet.
2117
class subdomains_0_exterior_facet_integral_1: public ufc::exterior_facet_integral
2121
subdomains_0_exterior_facet_integral_1_quadrature integral_1_quadrature;
2126
subdomains_0_exterior_facet_integral_1() : ufc::exterior_facet_integral()
2132
virtual ~subdomains_0_exterior_facet_integral_1()
2137
/// Tabulate the tensor for the contribution from a local exterior facet
2138
virtual void tabulate_tensor(double* A,
2139
const double * const * w,
2141
unsigned int facet) const
2143
// Reset values of the element tensor block
2144
for (unsigned int j = 0; j < 16; j++)
2147
// Add all contributions to element tensor
2148
integral_1_quadrature.tabulate_tensor(A, w, c, facet);
2153
/// This class defines the interface for the tabulation of the
2154
/// interior facet tensor corresponding to the local contribution to
2155
/// a form from the integral over an interior facet.
2157
class subdomains_0_interior_facet_integral_0_quadrature: public ufc::interior_facet_integral
2162
subdomains_0_interior_facet_integral_0_quadrature() : ufc::interior_facet_integral()
2168
virtual ~subdomains_0_interior_facet_integral_0_quadrature()
2173
/// Tabulate the tensor for the contribution from a local interior facet
2174
virtual void tabulate_tensor(double* A,
2175
const double * const * w,
2176
const ufc::cell& c0,
2177
const ufc::cell& c1,
2178
unsigned int facet0,
2179
unsigned int facet1) const
2181
// Extract vertex coordinates
2182
const double * const * x0 = c0.coordinates;
2184
// Compute Jacobian of affine map from reference cell
2186
// Compute sub determinants
2190
// Compute determinant of Jacobian
2192
// Compute inverse of Jacobian
2194
// Extract vertex coordinates
2196
// Compute Jacobian of affine map from reference cell
2198
// Compute sub determinants
2202
// Compute determinant of Jacobian
2204
// Compute inverse of Jacobian
2206
// Vertices on faces
2207
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
2210
const unsigned int v0 = face_vertices[facet0][0];
2211
const unsigned int v1 = face_vertices[facet0][1];
2212
const unsigned int v2 = face_vertices[facet0][2];
2214
// Compute scale factor (area of face scaled by area of reference triangle)
2215
const double a0 = (x0[v0][1]*x0[v1][2] + x0[v0][2]*x0[v2][1] + x0[v1][1]*x0[v2][2])
2216
- (x0[v2][1]*x0[v1][2] + x0[v2][2]*x0[v0][1] + x0[v1][1]*x0[v0][2]);
2217
const double a1 = (x0[v0][2]*x0[v1][0] + x0[v0][0]*x0[v2][2] + x0[v1][2]*x0[v2][0])
2218
- (x0[v2][2]*x0[v1][0] + x0[v2][0]*x0[v0][2] + x0[v1][2]*x0[v0][0]);
2219
const double a2 = (x0[v0][0]*x0[v1][1] + x0[v0][1]*x0[v2][0] + x0[v1][0]*x0[v2][1])
2220
- (x0[v2][0]*x0[v1][1] + x0[v2][1]*x0[v0][0] + x0[v1][0]*x0[v0][1]);
2221
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
2223
// Compute facet normals from the facet scale factor constants
2224
// Compute facet normals from the facet scale factor constants
2227
// Array of quadrature weights
2228
static const double W4[4] = {0.159020691, 0.0909793091, 0.159020691, 0.0909793091};
2229
// Quadrature points on the UFC reference element: (0.178558728, 0.155051026), (0.0750311102, 0.644948974), (0.666390246, 0.155051026), (0.280019915, 0.644948974)
2231
// Value of basis functions at quadrature points.
2232
static const double FE0_f0[4][4] = \
2233
{{0, 0.666390246, 0.178558728, 0.155051026},
2234
{0, 0.280019915, 0.0750311102, 0.644948974},
2235
{0, 0.178558728, 0.666390246, 0.155051026},
2236
{0, 0.0750311102, 0.280019915, 0.644948974}};
2238
static const double FE0_f1[4][4] = \
2239
{{0.666390246, 0, 0.178558728, 0.155051026},
2240
{0.280019915, 0, 0.0750311102, 0.644948974},
2241
{0.178558728, 0, 0.666390246, 0.155051026},
2242
{0.0750311102, 0, 0.280019915, 0.644948974}};
2244
static const double FE0_f2[4][4] = \
2245
{{0.666390246, 0.178558728, 0, 0.155051026},
2246
{0.280019915, 0.0750311102, 0, 0.644948974},
2247
{0.178558728, 0.666390246, 0, 0.155051026},
2248
{0.0750311102, 0.280019915, 0, 0.644948974}};
2250
static const double FE0_f3[4][4] = \
2251
{{0.666390246, 0.178558728, 0.155051026, 0},
2252
{0.280019915, 0.0750311102, 0.644948974, 0},
2253
{0.178558728, 0.666390246, 0.155051026, 0},
2254
{0.0750311102, 0.280019915, 0.644948974, 0}};
2257
// Compute element tensor using UFL quadrature representation
2258
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
2266
// Total number of operations to compute element tensor (from this point): 256
2268
// Loop quadrature points for integral
2269
// Number of operations to compute element tensor for following IP loop = 256
2270
for (unsigned int ip = 0; ip < 4; ip++)
2273
// Number of operations for primary indices: 64
2274
for (unsigned int j = 0; j < 4; j++)
2276
for (unsigned int k = 0; k < 4; k++)
2278
// Number of operations to compute entry: 4
2279
A[j*8 + k] += FE0_f0[ip][j]*FE0_f0[ip][k]*W4[ip]*det;
2280
}// end loop over 'k'
2281
}// end loop over 'j'
2282
}// end loop over 'ip'
2287
// Total number of operations to compute element tensor (from this point): 256
2289
// Loop quadrature points for integral
2290
// Number of operations to compute element tensor for following IP loop = 256
2291
for (unsigned int ip = 0; ip < 4; ip++)
2294
// Number of operations for primary indices: 64
2295
for (unsigned int j = 0; j < 4; j++)
2297
for (unsigned int k = 0; k < 4; k++)
2299
// Number of operations to compute entry: 4
2300
A[j*8 + k] += FE0_f0[ip][j]*FE0_f0[ip][k]*W4[ip]*det;
2301
}// end loop over 'k'
2302
}// end loop over 'j'
2303
}// end loop over 'ip'
2308
// Total number of operations to compute element tensor (from this point): 256
2310
// Loop quadrature points for integral
2311
// Number of operations to compute element tensor for following IP loop = 256
2312
for (unsigned int ip = 0; ip < 4; ip++)
2315
// Number of operations for primary indices: 64
2316
for (unsigned int j = 0; j < 4; j++)
2318
for (unsigned int k = 0; k < 4; k++)
2320
// Number of operations to compute entry: 4
2321
A[j*8 + k] += FE0_f0[ip][j]*FE0_f0[ip][k]*W4[ip]*det;
2322
}// end loop over 'k'
2323
}// end loop over 'j'
2324
}// end loop over 'ip'
2329
// Total number of operations to compute element tensor (from this point): 256
2331
// Loop quadrature points for integral
2332
// Number of operations to compute element tensor for following IP loop = 256
2333
for (unsigned int ip = 0; ip < 4; ip++)
2336
// Number of operations for primary indices: 64
2337
for (unsigned int j = 0; j < 4; j++)
2339
for (unsigned int k = 0; k < 4; k++)
2341
// Number of operations to compute entry: 4
2342
A[j*8 + k] += FE0_f0[ip][j]*FE0_f0[ip][k]*W4[ip]*det;
2343
}// end loop over 'k'
2344
}// end loop over 'j'
2345
}// end loop over 'ip'
2355
// Total number of operations to compute element tensor (from this point): 256
2357
// Loop quadrature points for integral
2358
// Number of operations to compute element tensor for following IP loop = 256
2359
for (unsigned int ip = 0; ip < 4; ip++)
2362
// Number of operations for primary indices: 64
2363
for (unsigned int j = 0; j < 4; j++)
2365
for (unsigned int k = 0; k < 4; k++)
2367
// Number of operations to compute entry: 4
2368
A[j*8 + k] += FE0_f1[ip][j]*FE0_f1[ip][k]*W4[ip]*det;
2369
}// end loop over 'k'
2370
}// end loop over 'j'
2371
}// end loop over 'ip'
2376
// Total number of operations to compute element tensor (from this point): 256
2378
// Loop quadrature points for integral
2379
// Number of operations to compute element tensor for following IP loop = 256
2380
for (unsigned int ip = 0; ip < 4; ip++)
2383
// Number of operations for primary indices: 64
2384
for (unsigned int j = 0; j < 4; j++)
2386
for (unsigned int k = 0; k < 4; k++)
2388
// Number of operations to compute entry: 4
2389
A[j*8 + k] += FE0_f1[ip][j]*FE0_f1[ip][k]*W4[ip]*det;
2390
}// end loop over 'k'
2391
}// end loop over 'j'
2392
}// end loop over 'ip'
2397
// Total number of operations to compute element tensor (from this point): 256
2399
// Loop quadrature points for integral
2400
// Number of operations to compute element tensor for following IP loop = 256
2401
for (unsigned int ip = 0; ip < 4; ip++)
2404
// Number of operations for primary indices: 64
2405
for (unsigned int j = 0; j < 4; j++)
2407
for (unsigned int k = 0; k < 4; k++)
2409
// Number of operations to compute entry: 4
2410
A[j*8 + k] += FE0_f1[ip][j]*FE0_f1[ip][k]*W4[ip]*det;
2411
}// end loop over 'k'
2412
}// end loop over 'j'
2413
}// end loop over 'ip'
2418
// Total number of operations to compute element tensor (from this point): 256
2420
// Loop quadrature points for integral
2421
// Number of operations to compute element tensor for following IP loop = 256
2422
for (unsigned int ip = 0; ip < 4; ip++)
2425
// Number of operations for primary indices: 64
2426
for (unsigned int j = 0; j < 4; j++)
2428
for (unsigned int k = 0; k < 4; k++)
2430
// Number of operations to compute entry: 4
2431
A[j*8 + k] += FE0_f1[ip][j]*FE0_f1[ip][k]*W4[ip]*det;
2432
}// end loop over 'k'
2433
}// end loop over 'j'
2434
}// end loop over 'ip'
2444
// Total number of operations to compute element tensor (from this point): 256
2446
// Loop quadrature points for integral
2447
// Number of operations to compute element tensor for following IP loop = 256
2448
for (unsigned int ip = 0; ip < 4; ip++)
2451
// Number of operations for primary indices: 64
2452
for (unsigned int j = 0; j < 4; j++)
2454
for (unsigned int k = 0; k < 4; k++)
2456
// Number of operations to compute entry: 4
2457
A[j*8 + k] += FE0_f2[ip][j]*FE0_f2[ip][k]*W4[ip]*det;
2458
}// end loop over 'k'
2459
}// end loop over 'j'
2460
}// end loop over 'ip'
2465
// Total number of operations to compute element tensor (from this point): 256
2467
// Loop quadrature points for integral
2468
// Number of operations to compute element tensor for following IP loop = 256
2469
for (unsigned int ip = 0; ip < 4; ip++)
2472
// Number of operations for primary indices: 64
2473
for (unsigned int j = 0; j < 4; j++)
2475
for (unsigned int k = 0; k < 4; k++)
2477
// Number of operations to compute entry: 4
2478
A[j*8 + k] += FE0_f2[ip][j]*FE0_f2[ip][k]*W4[ip]*det;
2479
}// end loop over 'k'
2480
}// end loop over 'j'
2481
}// end loop over 'ip'
2486
// Total number of operations to compute element tensor (from this point): 256
2488
// Loop quadrature points for integral
2489
// Number of operations to compute element tensor for following IP loop = 256
2490
for (unsigned int ip = 0; ip < 4; ip++)
2493
// Number of operations for primary indices: 64
2494
for (unsigned int j = 0; j < 4; j++)
2496
for (unsigned int k = 0; k < 4; k++)
2498
// Number of operations to compute entry: 4
2499
A[j*8 + k] += FE0_f2[ip][j]*FE0_f2[ip][k]*W4[ip]*det;
2500
}// end loop over 'k'
2501
}// end loop over 'j'
2502
}// end loop over 'ip'
2507
// Total number of operations to compute element tensor (from this point): 256
2509
// Loop quadrature points for integral
2510
// Number of operations to compute element tensor for following IP loop = 256
2511
for (unsigned int ip = 0; ip < 4; ip++)
2514
// Number of operations for primary indices: 64
2515
for (unsigned int j = 0; j < 4; j++)
2517
for (unsigned int k = 0; k < 4; k++)
2519
// Number of operations to compute entry: 4
2520
A[j*8 + k] += FE0_f2[ip][j]*FE0_f2[ip][k]*W4[ip]*det;
2521
}// end loop over 'k'
2522
}// end loop over 'j'
2523
}// end loop over 'ip'
2533
// Total number of operations to compute element tensor (from this point): 256
2535
// Loop quadrature points for integral
2536
// Number of operations to compute element tensor for following IP loop = 256
2537
for (unsigned int ip = 0; ip < 4; ip++)
2540
// Number of operations for primary indices: 64
2541
for (unsigned int j = 0; j < 4; j++)
2543
for (unsigned int k = 0; k < 4; k++)
2545
// Number of operations to compute entry: 4
2546
A[j*8 + k] += FE0_f3[ip][j]*FE0_f3[ip][k]*W4[ip]*det;
2547
}// end loop over 'k'
2548
}// end loop over 'j'
2549
}// end loop over 'ip'
2554
// Total number of operations to compute element tensor (from this point): 256
2556
// Loop quadrature points for integral
2557
// Number of operations to compute element tensor for following IP loop = 256
2558
for (unsigned int ip = 0; ip < 4; ip++)
2561
// Number of operations for primary indices: 64
2562
for (unsigned int j = 0; j < 4; j++)
2564
for (unsigned int k = 0; k < 4; k++)
2566
// Number of operations to compute entry: 4
2567
A[j*8 + k] += FE0_f3[ip][j]*FE0_f3[ip][k]*W4[ip]*det;
2568
}// end loop over 'k'
2569
}// end loop over 'j'
2570
}// end loop over 'ip'
2575
// Total number of operations to compute element tensor (from this point): 256
2577
// Loop quadrature points for integral
2578
// Number of operations to compute element tensor for following IP loop = 256
2579
for (unsigned int ip = 0; ip < 4; ip++)
2582
// Number of operations for primary indices: 64
2583
for (unsigned int j = 0; j < 4; j++)
2585
for (unsigned int k = 0; k < 4; k++)
2587
// Number of operations to compute entry: 4
2588
A[j*8 + k] += FE0_f3[ip][j]*FE0_f3[ip][k]*W4[ip]*det;
2589
}// end loop over 'k'
2590
}// end loop over 'j'
2591
}// end loop over 'ip'
2596
// Total number of operations to compute element tensor (from this point): 256
2598
// Loop quadrature points for integral
2599
// Number of operations to compute element tensor for following IP loop = 256
2600
for (unsigned int ip = 0; ip < 4; ip++)
2603
// Number of operations for primary indices: 64
2604
for (unsigned int j = 0; j < 4; j++)
2606
for (unsigned int k = 0; k < 4; k++)
2608
// Number of operations to compute entry: 4
2609
A[j*8 + k] += FE0_f3[ip][j]*FE0_f3[ip][k]*W4[ip]*det;
2610
}// end loop over 'k'
2611
}// end loop over 'j'
2612
}// end loop over 'ip'
2622
/// This class defines the interface for the tabulation of the
2623
/// interior facet tensor corresponding to the local contribution to
2624
/// a form from the integral over an interior facet.
2626
class subdomains_0_interior_facet_integral_0: public ufc::interior_facet_integral
2630
subdomains_0_interior_facet_integral_0_quadrature integral_0_quadrature;
2635
subdomains_0_interior_facet_integral_0() : ufc::interior_facet_integral()
2641
virtual ~subdomains_0_interior_facet_integral_0()
2646
/// Tabulate the tensor for the contribution from a local interior facet
2647
virtual void tabulate_tensor(double* A,
2648
const double * const * w,
2649
const ufc::cell& c0,
2650
const ufc::cell& c1,
2651
unsigned int facet0,
2652
unsigned int facet1) const
2654
// Reset values of the element tensor block
2655
for (unsigned int j = 0; j < 64; j++)
2658
// Add all contributions to element tensor
2659
integral_0_quadrature.tabulate_tensor(A, w, c0, c1, facet0, facet1);
2664
/// This class defines the interface for the tabulation of the
2665
/// interior facet tensor corresponding to the local contribution to
2666
/// a form from the integral over an interior facet.
2668
class subdomains_0_interior_facet_integral_1_quadrature: public ufc::interior_facet_integral
2673
subdomains_0_interior_facet_integral_1_quadrature() : ufc::interior_facet_integral()
2679
virtual ~subdomains_0_interior_facet_integral_1_quadrature()
2684
/// Tabulate the tensor for the contribution from a local interior facet
2685
virtual void tabulate_tensor(double* A,
2686
const double * const * w,
2687
const ufc::cell& c0,
2688
const ufc::cell& c1,
2689
unsigned int facet0,
2690
unsigned int facet1) const
2692
// Extract vertex coordinates
2693
const double * const * x0 = c0.coordinates;
2695
// Compute Jacobian of affine map from reference cell
2697
// Compute sub determinants
2701
// Compute determinant of Jacobian
2703
// Compute inverse of Jacobian
2705
// Extract vertex coordinates
2707
// Compute Jacobian of affine map from reference cell
2709
// Compute sub determinants
2713
// Compute determinant of Jacobian
2715
// Compute inverse of Jacobian
2717
// Vertices on faces
2718
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
2721
const unsigned int v0 = face_vertices[facet0][0];
2722
const unsigned int v1 = face_vertices[facet0][1];
2723
const unsigned int v2 = face_vertices[facet0][2];
2725
// Compute scale factor (area of face scaled by area of reference triangle)
2726
const double a0 = (x0[v0][1]*x0[v1][2] + x0[v0][2]*x0[v2][1] + x0[v1][1]*x0[v2][2])
2727
- (x0[v2][1]*x0[v1][2] + x0[v2][2]*x0[v0][1] + x0[v1][1]*x0[v0][2]);
2728
const double a1 = (x0[v0][2]*x0[v1][0] + x0[v0][0]*x0[v2][2] + x0[v1][2]*x0[v2][0])
2729
- (x0[v2][2]*x0[v1][0] + x0[v2][0]*x0[v0][2] + x0[v1][2]*x0[v0][0]);
2730
const double a2 = (x0[v0][0]*x0[v1][1] + x0[v0][1]*x0[v2][0] + x0[v1][0]*x0[v2][1])
2731
- (x0[v2][0]*x0[v1][1] + x0[v2][1]*x0[v0][0] + x0[v1][0]*x0[v0][1]);
2732
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
2734
// Compute facet normals from the facet scale factor constants
2735
// Compute facet normals from the facet scale factor constants
2738
// Array of quadrature weights
2739
static const double W4[4] = {0.159020691, 0.0909793091, 0.159020691, 0.0909793091};
2740
// Quadrature points on the UFC reference element: (0.178558728, 0.155051026), (0.0750311102, 0.644948974), (0.666390246, 0.155051026), (0.280019915, 0.644948974)
2742
// Value of basis functions at quadrature points.
2743
static const double FE0_f0[4][4] = \
2744
{{0, 0.666390246, 0.178558728, 0.155051026},
2745
{0, 0.280019915, 0.0750311102, 0.644948974},
2746
{0, 0.178558728, 0.666390246, 0.155051026},
2747
{0, 0.0750311102, 0.280019915, 0.644948974}};
2749
static const double FE0_f1[4][4] = \
2750
{{0.666390246, 0, 0.178558728, 0.155051026},
2751
{0.280019915, 0, 0.0750311102, 0.644948974},
2752
{0.178558728, 0, 0.666390246, 0.155051026},
2753
{0.0750311102, 0, 0.280019915, 0.644948974}};
2755
static const double FE0_f2[4][4] = \
2756
{{0.666390246, 0.178558728, 0, 0.155051026},
2757
{0.280019915, 0.0750311102, 0, 0.644948974},
2758
{0.178558728, 0.666390246, 0, 0.155051026},
2759
{0.0750311102, 0.280019915, 0, 0.644948974}};
2761
static const double FE0_f3[4][4] = \
2762
{{0.666390246, 0.178558728, 0.155051026, 0},
2763
{0.280019915, 0.0750311102, 0.644948974, 0},
2764
{0.178558728, 0.666390246, 0.155051026, 0},
2765
{0.0750311102, 0.280019915, 0.644948974, 0}};
2768
// Compute element tensor using UFL quadrature representation
2769
// Optimisations: ('simplify expressions', False), ('ignore zero tables', False), ('non zero columns', False), ('remove zero terms', False), ('ignore ones', False)
2777
// Total number of operations to compute element tensor (from this point): 320
2779
// Loop quadrature points for integral
2780
// Number of operations to compute element tensor for following IP loop = 320
2781
for (unsigned int ip = 0; ip < 4; ip++)
2784
// Number of operations for primary indices: 80
2785
for (unsigned int j = 0; j < 4; j++)
2787
for (unsigned int k = 0; k < 4; k++)
2789
// Number of operations to compute entry: 5
2790
A[j*8 + k] += FE0_f0[ip][k]*FE0_f0[ip][j]*4.3*W4[ip]*det;
2791
}// end loop over 'k'
2792
}// end loop over 'j'
2793
}// end loop over 'ip'
2798
// Total number of operations to compute element tensor (from this point): 320
2800
// Loop quadrature points for integral
2801
// Number of operations to compute element tensor for following IP loop = 320
2802
for (unsigned int ip = 0; ip < 4; ip++)
2805
// Number of operations for primary indices: 80
2806
for (unsigned int j = 0; j < 4; j++)
2808
for (unsigned int k = 0; k < 4; k++)
2810
// Number of operations to compute entry: 5
2811
A[j*8 + k] += FE0_f0[ip][k]*FE0_f0[ip][j]*4.3*W4[ip]*det;
2812
}// end loop over 'k'
2813
}// end loop over 'j'
2814
}// end loop over 'ip'
2819
// Total number of operations to compute element tensor (from this point): 320
2821
// Loop quadrature points for integral
2822
// Number of operations to compute element tensor for following IP loop = 320
2823
for (unsigned int ip = 0; ip < 4; ip++)
2826
// Number of operations for primary indices: 80
2827
for (unsigned int j = 0; j < 4; j++)
2829
for (unsigned int k = 0; k < 4; k++)
2831
// Number of operations to compute entry: 5
2832
A[j*8 + k] += FE0_f0[ip][k]*FE0_f0[ip][j]*4.3*W4[ip]*det;
2833
}// end loop over 'k'
2834
}// end loop over 'j'
2835
}// end loop over 'ip'
2840
// Total number of operations to compute element tensor (from this point): 320
2842
// Loop quadrature points for integral
2843
// Number of operations to compute element tensor for following IP loop = 320
2844
for (unsigned int ip = 0; ip < 4; ip++)
2847
// Number of operations for primary indices: 80
2848
for (unsigned int j = 0; j < 4; j++)
2850
for (unsigned int k = 0; k < 4; k++)
2852
// Number of operations to compute entry: 5
2853
A[j*8 + k] += FE0_f0[ip][k]*FE0_f0[ip][j]*4.3*W4[ip]*det;
2854
}// end loop over 'k'
2855
}// end loop over 'j'
2856
}// end loop over 'ip'
2866
// Total number of operations to compute element tensor (from this point): 320
2868
// Loop quadrature points for integral
2869
// Number of operations to compute element tensor for following IP loop = 320
2870
for (unsigned int ip = 0; ip < 4; ip++)
2873
// Number of operations for primary indices: 80
2874
for (unsigned int j = 0; j < 4; j++)
2876
for (unsigned int k = 0; k < 4; k++)
2878
// Number of operations to compute entry: 5
2879
A[j*8 + k] += FE0_f1[ip][k]*FE0_f1[ip][j]*4.3*W4[ip]*det;
2880
}// end loop over 'k'
2881
}// end loop over 'j'
2882
}// end loop over 'ip'
2887
// Total number of operations to compute element tensor (from this point): 320
2889
// Loop quadrature points for integral
2890
// Number of operations to compute element tensor for following IP loop = 320
2891
for (unsigned int ip = 0; ip < 4; ip++)
2894
// Number of operations for primary indices: 80
2895
for (unsigned int j = 0; j < 4; j++)
2897
for (unsigned int k = 0; k < 4; k++)
2899
// Number of operations to compute entry: 5
2900
A[j*8 + k] += FE0_f1[ip][k]*FE0_f1[ip][j]*4.3*W4[ip]*det;
2901
}// end loop over 'k'
2902
}// end loop over 'j'
2903
}// end loop over 'ip'
2908
// Total number of operations to compute element tensor (from this point): 320
2910
// Loop quadrature points for integral
2911
// Number of operations to compute element tensor for following IP loop = 320
2912
for (unsigned int ip = 0; ip < 4; ip++)
2915
// Number of operations for primary indices: 80
2916
for (unsigned int j = 0; j < 4; j++)
2918
for (unsigned int k = 0; k < 4; k++)
2920
// Number of operations to compute entry: 5
2921
A[j*8 + k] += FE0_f1[ip][k]*FE0_f1[ip][j]*4.3*W4[ip]*det;
2922
}// end loop over 'k'
2923
}// end loop over 'j'
2924
}// end loop over 'ip'
2929
// Total number of operations to compute element tensor (from this point): 320
2931
// Loop quadrature points for integral
2932
// Number of operations to compute element tensor for following IP loop = 320
2933
for (unsigned int ip = 0; ip < 4; ip++)
2936
// Number of operations for primary indices: 80
2937
for (unsigned int j = 0; j < 4; j++)
2939
for (unsigned int k = 0; k < 4; k++)
2941
// Number of operations to compute entry: 5
2942
A[j*8 + k] += FE0_f1[ip][k]*FE0_f1[ip][j]*4.3*W4[ip]*det;
2943
}// end loop over 'k'
2944
}// end loop over 'j'
2945
}// end loop over 'ip'
2955
// Total number of operations to compute element tensor (from this point): 320
2957
// Loop quadrature points for integral
2958
// Number of operations to compute element tensor for following IP loop = 320
2959
for (unsigned int ip = 0; ip < 4; ip++)
2962
// Number of operations for primary indices: 80
2963
for (unsigned int j = 0; j < 4; j++)
2965
for (unsigned int k = 0; k < 4; k++)
2967
// Number of operations to compute entry: 5
2968
A[j*8 + k] += FE0_f2[ip][k]*FE0_f2[ip][j]*4.3*W4[ip]*det;
2969
}// end loop over 'k'
2970
}// end loop over 'j'
2971
}// end loop over 'ip'
2976
// Total number of operations to compute element tensor (from this point): 320
2978
// Loop quadrature points for integral
2979
// Number of operations to compute element tensor for following IP loop = 320
2980
for (unsigned int ip = 0; ip < 4; ip++)
2983
// Number of operations for primary indices: 80
2984
for (unsigned int j = 0; j < 4; j++)
2986
for (unsigned int k = 0; k < 4; k++)
2988
// Number of operations to compute entry: 5
2989
A[j*8 + k] += FE0_f2[ip][k]*FE0_f2[ip][j]*4.3*W4[ip]*det;
2990
}// end loop over 'k'
2991
}// end loop over 'j'
2992
}// end loop over 'ip'
2997
// Total number of operations to compute element tensor (from this point): 320
2999
// Loop quadrature points for integral
3000
// Number of operations to compute element tensor for following IP loop = 320
3001
for (unsigned int ip = 0; ip < 4; ip++)
3004
// Number of operations for primary indices: 80
3005
for (unsigned int j = 0; j < 4; j++)
3007
for (unsigned int k = 0; k < 4; k++)
3009
// Number of operations to compute entry: 5
3010
A[j*8 + k] += FE0_f2[ip][k]*FE0_f2[ip][j]*4.3*W4[ip]*det;
3011
}// end loop over 'k'
3012
}// end loop over 'j'
3013
}// end loop over 'ip'
3018
// Total number of operations to compute element tensor (from this point): 320
3020
// Loop quadrature points for integral
3021
// Number of operations to compute element tensor for following IP loop = 320
3022
for (unsigned int ip = 0; ip < 4; ip++)
3025
// Number of operations for primary indices: 80
3026
for (unsigned int j = 0; j < 4; j++)
3028
for (unsigned int k = 0; k < 4; k++)
3030
// Number of operations to compute entry: 5
3031
A[j*8 + k] += FE0_f2[ip][k]*FE0_f2[ip][j]*4.3*W4[ip]*det;
3032
}// end loop over 'k'
3033
}// end loop over 'j'
3034
}// end loop over 'ip'
3044
// Total number of operations to compute element tensor (from this point): 320
3046
// Loop quadrature points for integral
3047
// Number of operations to compute element tensor for following IP loop = 320
3048
for (unsigned int ip = 0; ip < 4; ip++)
3051
// Number of operations for primary indices: 80
3052
for (unsigned int j = 0; j < 4; j++)
3054
for (unsigned int k = 0; k < 4; k++)
3056
// Number of operations to compute entry: 5
3057
A[j*8 + k] += FE0_f3[ip][k]*FE0_f3[ip][j]*4.3*W4[ip]*det;
3058
}// end loop over 'k'
3059
}// end loop over 'j'
3060
}// end loop over 'ip'
3065
// Total number of operations to compute element tensor (from this point): 320
3067
// Loop quadrature points for integral
3068
// Number of operations to compute element tensor for following IP loop = 320
3069
for (unsigned int ip = 0; ip < 4; ip++)
3072
// Number of operations for primary indices: 80
3073
for (unsigned int j = 0; j < 4; j++)
3075
for (unsigned int k = 0; k < 4; k++)
3077
// Number of operations to compute entry: 5
3078
A[j*8 + k] += FE0_f3[ip][k]*FE0_f3[ip][j]*4.3*W4[ip]*det;
3079
}// end loop over 'k'
3080
}// end loop over 'j'
3081
}// end loop over 'ip'
3086
// Total number of operations to compute element tensor (from this point): 320
3088
// Loop quadrature points for integral
3089
// Number of operations to compute element tensor for following IP loop = 320
3090
for (unsigned int ip = 0; ip < 4; ip++)
3093
// Number of operations for primary indices: 80
3094
for (unsigned int j = 0; j < 4; j++)
3096
for (unsigned int k = 0; k < 4; k++)
3098
// Number of operations to compute entry: 5
3099
A[j*8 + k] += FE0_f3[ip][k]*FE0_f3[ip][j]*4.3*W4[ip]*det;
3100
}// end loop over 'k'
3101
}// end loop over 'j'
3102
}// end loop over 'ip'
3107
// Total number of operations to compute element tensor (from this point): 320
3109
// Loop quadrature points for integral
3110
// Number of operations to compute element tensor for following IP loop = 320
3111
for (unsigned int ip = 0; ip < 4; ip++)
3114
// Number of operations for primary indices: 80
3115
for (unsigned int j = 0; j < 4; j++)
3117
for (unsigned int k = 0; k < 4; k++)
3119
// Number of operations to compute entry: 5
3120
A[j*8 + k] += FE0_f3[ip][k]*FE0_f3[ip][j]*4.3*W4[ip]*det;
3121
}// end loop over 'k'
3122
}// end loop over 'j'
3123
}// end loop over 'ip'
3133
/// This class defines the interface for the tabulation of the
3134
/// interior facet tensor corresponding to the local contribution to
3135
/// a form from the integral over an interior facet.
3137
class subdomains_0_interior_facet_integral_1: public ufc::interior_facet_integral
3141
subdomains_0_interior_facet_integral_1_quadrature integral_1_quadrature;
3146
subdomains_0_interior_facet_integral_1() : ufc::interior_facet_integral()
3152
virtual ~subdomains_0_interior_facet_integral_1()
3157
/// Tabulate the tensor for the contribution from a local interior facet
3158
virtual void tabulate_tensor(double* A,
3159
const double * const * w,
3160
const ufc::cell& c0,
3161
const ufc::cell& c1,
3162
unsigned int facet0,
3163
unsigned int facet1) const
3165
// Reset values of the element tensor block
3166
for (unsigned int j = 0; j < 64; j++)
3169
// Add all contributions to element tensor
3170
integral_1_quadrature.tabulate_tensor(A, w, c0, c1, facet0, facet1);
3175
/// This class defines the interface for the assembly of the global
3176
/// tensor corresponding to a form with r + n arguments, that is, a
3179
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
3181
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
3182
/// global tensor A is defined by
3184
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
3186
/// where each argument Vj represents the application to the
3187
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
3188
/// fixed functions (coefficients).
3190
class subdomains_form_0: public ufc::form
3195
subdomains_form_0() : ufc::form()
3201
virtual ~subdomains_form_0()
3206
/// Return a string identifying the form
3207
virtual const char* signature() const
3209
return "Form([Integral(Product(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Measure('cell', 0, None)), Integral(Product(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1), Product(FloatValue(10.0, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0))), Measure('cell', 1, None)), Integral(Product(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Measure('exterior_facet', 0, None)), Integral(Product(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1), Product(FloatValue(2.0, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0))), Measure('exterior_facet', 1, None)), Integral(Product(PositiveRestricted(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0)), PositiveRestricted(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1))), Measure('interior_facet', 0, None)), Integral(Product(PositiveRestricted(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Product(FloatValue(4.2999999999999998, (), (), {}), PositiveRestricted(BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0)))), Measure('interior_facet', 1, None))])";
3212
/// Return the rank of the global tensor (r)
3213
virtual unsigned int rank() const
3218
/// Return the number of coefficients (n)
3219
virtual unsigned int num_coefficients() const
3224
/// Return the number of cell integrals
3225
virtual unsigned int num_cell_integrals() const
3230
/// Return the number of exterior facet integrals
3231
virtual unsigned int num_exterior_facet_integrals() const
3236
/// Return the number of interior facet integrals
3237
virtual unsigned int num_interior_facet_integrals() const
3242
/// Create a new finite element for argument function i
3243
virtual ufc::finite_element* create_finite_element(unsigned int i) const
3248
return new subdomains_0_finite_element_0();
3251
return new subdomains_0_finite_element_1();
3257
/// Create a new dof map for argument function i
3258
virtual ufc::dof_map* create_dof_map(unsigned int i) const
3263
return new subdomains_0_dof_map_0();
3266
return new subdomains_0_dof_map_1();
3272
/// Create a new cell integral on sub domain i
3273
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
3278
return new subdomains_0_cell_integral_0();
3281
return new subdomains_0_cell_integral_1();
3287
/// Create a new exterior facet integral on sub domain i
3288
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
3293
return new subdomains_0_exterior_facet_integral_0();
3296
return new subdomains_0_exterior_facet_integral_1();
3302
/// Create a new interior facet integral on sub domain i
3303
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
3308
return new subdomains_0_interior_facet_integral_0();
3311
return new subdomains_0_interior_facet_integral_1();