1
// This code conforms with the UFC specification version 1.4
2
// and was automatically generated by FFC version 0.9.0.
12
/// This class defines the interface for a finite element.
14
class subdomains_finite_element_0: public ufc::finite_element
19
subdomains_finite_element_0() : ufc::finite_element()
25
virtual ~subdomains_finite_element_0()
30
/// Return a string identifying the finite element
31
virtual const char* signature() const
33
return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
36
/// Return the cell shape
37
virtual ufc::shape cell_shape() const
39
return ufc::tetrahedron;
42
/// Return the dimension of the finite element function space
43
virtual unsigned int space_dimension() const
48
/// Return the rank of the value space
49
virtual unsigned int value_rank() const
54
/// Return the dimension of the value space for axis i
55
virtual unsigned int value_dimension(unsigned int i) const
60
/// Evaluate basis function i at given point in cell
61
virtual void evaluate_basis(unsigned int i,
63
const double* coordinates,
64
const ufc::cell& c) const
66
// Extract vertex coordinates
67
const double * const * x = c.coordinates;
69
// Compute Jacobian of affine map from reference cell
70
const double J_00 = x[1][0] - x[0][0];
71
const double J_01 = x[2][0] - x[0][0];
72
const double J_02 = x[3][0] - x[0][0];
73
const double J_10 = x[1][1] - x[0][1];
74
const double J_11 = x[2][1] - x[0][1];
75
const double J_12 = x[3][1] - x[0][1];
76
const double J_20 = x[1][2] - x[0][2];
77
const double J_21 = x[2][2] - x[0][2];
78
const double J_22 = x[3][2] - x[0][2];
80
// Compute sub determinants
81
const double d_00 = J_11*J_22 - J_12*J_21;
82
const double d_01 = J_12*J_20 - J_10*J_22;
83
const double d_02 = J_10*J_21 - J_11*J_20;
84
const double d_10 = J_02*J_21 - J_01*J_22;
85
const double d_11 = J_00*J_22 - J_02*J_20;
86
const double d_12 = J_01*J_20 - J_00*J_21;
87
const double d_20 = J_01*J_12 - J_02*J_11;
88
const double d_21 = J_02*J_10 - J_00*J_12;
89
const double d_22 = J_00*J_11 - J_01*J_10;
91
// Compute determinant of Jacobian
92
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
94
// Compute inverse of Jacobian
97
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
98
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
99
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
101
// Get coordinates and map to the reference (FIAT) element
102
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
103
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
104
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
108
*values = 0.00000000;
110
// Map degree of freedom to element degree of freedom
111
const unsigned int dof = i;
113
// Array of basisvalues
114
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
116
// Declare helper variables
119
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
121
// Compute basisvalues
122
basisvalues[0] = 1.00000000;
123
basisvalues[1] = tmp0;
124
for (unsigned int r = 0; r < 1; r++)
126
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
127
ss = r*(r + 1)*(r + 2)/6;
128
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
129
}// end loop over 'r'
130
for (unsigned int r = 0; r < 1; r++)
132
for (unsigned int s = 0; s < 1 - r; s++)
134
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
135
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
136
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
137
}// end loop over 's'
138
}// end loop over 'r'
139
for (unsigned int r = 0; r < 2; r++)
141
for (unsigned int s = 0; s < 2 - r; s++)
143
for (unsigned int t = 0; t < 2 - r - s; t++)
145
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
146
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
147
}// end loop over 't'
148
}// end loop over 's'
149
}// end loop over 'r'
151
// Table(s) of coefficients
152
static const double coefficients0[4][4] = \
153
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
154
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
155
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
156
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
159
for (unsigned int r = 0; r < 4; r++)
161
*values += coefficients0[dof][r]*basisvalues[r];
162
}// end loop over 'r'
165
/// Evaluate all basis functions at given point in cell
166
virtual void evaluate_basis_all(double* values,
167
const double* coordinates,
168
const ufc::cell& c) const
170
// Helper variable to hold values of a single dof.
171
double dof_values = 0.00000000;
173
// Loop dofs and call evaluate_basis.
174
for (unsigned int r = 0; r < 4; r++)
176
evaluate_basis(r, &dof_values, coordinates, c);
177
values[r] = dof_values;
178
}// end loop over 'r'
181
/// Evaluate order n derivatives of basis function i at given point in cell
182
virtual void evaluate_basis_derivatives(unsigned int i,
185
const double* coordinates,
186
const ufc::cell& c) const
188
// Extract vertex coordinates
189
const double * const * x = c.coordinates;
191
// Compute Jacobian of affine map from reference cell
192
const double J_00 = x[1][0] - x[0][0];
193
const double J_01 = x[2][0] - x[0][0];
194
const double J_02 = x[3][0] - x[0][0];
195
const double J_10 = x[1][1] - x[0][1];
196
const double J_11 = x[2][1] - x[0][1];
197
const double J_12 = x[3][1] - x[0][1];
198
const double J_20 = x[1][2] - x[0][2];
199
const double J_21 = x[2][2] - x[0][2];
200
const double J_22 = x[3][2] - x[0][2];
202
// Compute sub determinants
203
const double d_00 = J_11*J_22 - J_12*J_21;
204
const double d_01 = J_12*J_20 - J_10*J_22;
205
const double d_02 = J_10*J_21 - J_11*J_20;
206
const double d_10 = J_02*J_21 - J_01*J_22;
207
const double d_11 = J_00*J_22 - J_02*J_20;
208
const double d_12 = J_01*J_20 - J_00*J_21;
209
const double d_20 = J_01*J_12 - J_02*J_11;
210
const double d_21 = J_02*J_10 - J_00*J_12;
211
const double d_22 = J_00*J_11 - J_01*J_10;
213
// Compute determinant of Jacobian
214
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
216
// Compute inverse of Jacobian
217
const double K_00 = d_00 / detJ;
218
const double K_01 = d_10 / detJ;
219
const double K_02 = d_20 / detJ;
220
const double K_10 = d_01 / detJ;
221
const double K_11 = d_11 / detJ;
222
const double K_12 = d_21 / detJ;
223
const double K_20 = d_02 / detJ;
224
const double K_21 = d_12 / detJ;
225
const double K_22 = d_22 / detJ;
228
const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
229
const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
230
const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
232
// Get coordinates and map to the reference (FIAT) element
233
double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
234
double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
235
double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
238
// Compute number of derivatives.
239
unsigned int num_derivatives = 1;
241
for (unsigned int r = 0; r < n; r++)
243
num_derivatives *= 3;
244
}// end loop over 'r'
246
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
247
unsigned int **combinations = new unsigned int *[num_derivatives];
248
for (unsigned int row = 0; row < num_derivatives; row++)
250
combinations[row] = new unsigned int [n];
251
for (unsigned int col = 0; col < n; col++)
252
combinations[row][col] = 0;
255
// Generate combinations of derivatives
256
for (unsigned int row = 1; row < num_derivatives; row++)
258
for (unsigned int num = 0; num < row; num++)
260
for (unsigned int col = n-1; col+1 > 0; col--)
262
if (combinations[row][col] + 1 > 2)
263
combinations[row][col] = 0;
266
combinations[row][col] += 1;
273
// Compute inverse of Jacobian
274
const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
276
// Declare transformation matrix
277
// Declare pointer to two dimensional array and initialise
278
double **transform = new double *[num_derivatives];
280
for (unsigned int j = 0; j < num_derivatives; j++)
282
transform[j] = new double [num_derivatives];
283
for (unsigned int k = 0; k < num_derivatives; k++)
287
// Construct transformation matrix
288
for (unsigned int row = 0; row < num_derivatives; row++)
290
for (unsigned int col = 0; col < num_derivatives; col++)
292
for (unsigned int k = 0; k < n; k++)
293
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
297
// Reset values. Assuming that values is always an array.
298
for (unsigned int r = 0; r < num_derivatives; r++)
300
values[r] = 0.00000000;
301
}// end loop over 'r'
303
// Map degree of freedom to element degree of freedom
304
const unsigned int dof = i;
306
// Array of basisvalues
307
double basisvalues[4] = {0.00000000, 0.00000000, 0.00000000, 0.00000000};
309
// Declare helper variables
312
double tmp0 = 0.50000000*(2.00000000 + Y + Z + 2.00000000*X);
314
// Compute basisvalues
315
basisvalues[0] = 1.00000000;
316
basisvalues[1] = tmp0;
317
for (unsigned int r = 0; r < 1; r++)
319
rr = (r + 1)*(r + 1 + 1)*(r + 1 + 2)/6 + 1*(1 + 1)/2;
320
ss = r*(r + 1)*(r + 2)/6;
321
basisvalues[rr] = basisvalues[ss]*(r*(1.00000000 + Y) + (2.00000000 + Z + 3.00000000*Y)/2.00000000);
322
}// end loop over 'r'
323
for (unsigned int r = 0; r < 1; r++)
325
for (unsigned int s = 0; s < 1 - r; s++)
327
rr = (r + s + 1)*(r + s + 1 + 1)*(r + s + 1 + 2)/6 + (s + 1)*(s + 1 + 1)/2 + 1;
328
ss = (r + s)*(r + s + 1)*(r + s + 2)/6 + s*(s + 1)/2;
329
basisvalues[rr] = basisvalues[ss]*(1.00000000 + r + s + Z*(2.00000000 + r + s));
330
}// end loop over 's'
331
}// end loop over 'r'
332
for (unsigned int r = 0; r < 2; r++)
334
for (unsigned int s = 0; s < 2 - r; s++)
336
for (unsigned int t = 0; t < 2 - r - s; t++)
338
rr = (r + s + t)*(r + s + t + 1)*(r + s + t + 2)/6 + (s + t)*(s + t + 1)/2 + t;
339
basisvalues[rr] *= std::sqrt((0.50000000 + r)*(1.00000000 + r + s)*(1.50000000 + r + s + t));
340
}// end loop over 't'
341
}// end loop over 's'
342
}// end loop over 'r'
344
// Table(s) of coefficients
345
static const double coefficients0[4][4] = \
346
{{0.28867513, -0.18257419, -0.10540926, -0.07453560},
347
{0.28867513, 0.18257419, -0.10540926, -0.07453560},
348
{0.28867513, 0.00000000, 0.21081851, -0.07453560},
349
{0.28867513, 0.00000000, 0.00000000, 0.22360680}};
351
// Tables of derivatives of the polynomial base (transpose).
352
static const double dmats0[4][4] = \
353
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
354
{6.32455532, 0.00000000, 0.00000000, 0.00000000},
355
{0.00000000, 0.00000000, 0.00000000, 0.00000000},
356
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
358
static const double dmats1[4][4] = \
359
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
360
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
361
{5.47722558, 0.00000000, 0.00000000, 0.00000000},
362
{0.00000000, 0.00000000, 0.00000000, 0.00000000}};
364
static const double dmats2[4][4] = \
365
{{0.00000000, 0.00000000, 0.00000000, 0.00000000},
366
{3.16227766, 0.00000000, 0.00000000, 0.00000000},
367
{1.82574186, 0.00000000, 0.00000000, 0.00000000},
368
{5.16397779, 0.00000000, 0.00000000, 0.00000000}};
370
// Compute reference derivatives
371
// Declare pointer to array of derivatives on FIAT element
372
double *derivatives = new double [num_derivatives];
373
for (unsigned int r = 0; r < num_derivatives; r++)
375
derivatives[r] = 0.00000000;
376
}// end loop over 'r'
378
// Declare derivative matrix (of polynomial basis).
379
double dmats[4][4] = \
380
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
381
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
382
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
383
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
385
// Declare (auxiliary) derivative matrix (of polynomial basis).
386
double dmats_old[4][4] = \
387
{{1.00000000, 0.00000000, 0.00000000, 0.00000000},
388
{0.00000000, 1.00000000, 0.00000000, 0.00000000},
389
{0.00000000, 0.00000000, 1.00000000, 0.00000000},
390
{0.00000000, 0.00000000, 0.00000000, 1.00000000}};
392
// Loop possible derivatives.
393
for (unsigned int r = 0; r < num_derivatives; r++)
395
// Resetting dmats values to compute next derivative.
396
for (unsigned int t = 0; t < 4; t++)
398
for (unsigned int u = 0; u < 4; u++)
400
dmats[t][u] = 0.00000000;
403
dmats[t][u] = 1.00000000;
406
}// end loop over 'u'
407
}// end loop over 't'
409
// Looping derivative order to generate dmats.
410
for (unsigned int s = 0; s < n; s++)
412
// Updating dmats_old with new values and resetting dmats.
413
for (unsigned int t = 0; t < 4; t++)
415
for (unsigned int u = 0; u < 4; u++)
417
dmats_old[t][u] = dmats[t][u];
418
dmats[t][u] = 0.00000000;
419
}// end loop over 'u'
420
}// end loop over 't'
422
// Update dmats using an inner product.
423
if (combinations[r][s] == 0)
425
for (unsigned int t = 0; t < 4; t++)
427
for (unsigned int u = 0; u < 4; u++)
429
for (unsigned int tu = 0; tu < 4; tu++)
431
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
432
}// end loop over 'tu'
433
}// end loop over 'u'
434
}// end loop over 't'
437
if (combinations[r][s] == 1)
439
for (unsigned int t = 0; t < 4; t++)
441
for (unsigned int u = 0; u < 4; u++)
443
for (unsigned int tu = 0; tu < 4; tu++)
445
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
446
}// end loop over 'tu'
447
}// end loop over 'u'
448
}// end loop over 't'
451
if (combinations[r][s] == 2)
453
for (unsigned int t = 0; t < 4; t++)
455
for (unsigned int u = 0; u < 4; u++)
457
for (unsigned int tu = 0; tu < 4; tu++)
459
dmats[t][u] += dmats2[t][tu]*dmats_old[tu][u];
460
}// end loop over 'tu'
461
}// end loop over 'u'
462
}// end loop over 't'
465
}// end loop over 's'
466
for (unsigned int s = 0; s < 4; s++)
468
for (unsigned int t = 0; t < 4; t++)
470
derivatives[r] += coefficients0[dof][s]*dmats[s][t]*basisvalues[t];
471
}// end loop over 't'
472
}// end loop over 's'
473
}// end loop over 'r'
475
// Transform derivatives back to physical element
476
for (unsigned int row = 0; row < num_derivatives; row++)
478
for (unsigned int col = 0; col < num_derivatives; col++)
480
values[row] += transform[row][col]*derivatives[col];
484
// Delete pointer to array of derivatives on FIAT element
485
delete [] derivatives;
487
// Delete pointer to array of combinations of derivatives and transform
488
for (unsigned int r = 0; r < num_derivatives; r++)
490
delete [] combinations[r];
491
delete [] transform[r];
492
}// end loop over 'r'
493
delete [] combinations;
497
/// Evaluate order n derivatives of all basis functions at given point in cell
498
virtual void evaluate_basis_derivatives_all(unsigned int n,
500
const double* coordinates,
501
const ufc::cell& c) const
503
// Compute number of derivatives.
504
unsigned int num_derivatives = 1;
506
for (unsigned int r = 0; r < n; r++)
508
num_derivatives *= 3;
509
}// end loop over 'r'
511
// Helper variable to hold values of a single dof.
512
double *dof_values = new double [num_derivatives];
513
for (unsigned int r = 0; r < num_derivatives; r++)
515
dof_values[r] = 0.00000000;
516
}// end loop over 'r'
518
// Loop dofs and call evaluate_basis_derivatives.
519
for (unsigned int r = 0; r < 4; r++)
521
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
522
for (unsigned int s = 0; s < num_derivatives; s++)
524
values[r*num_derivatives + s] = dof_values[s];
525
}// end loop over 's'
526
}// end loop over 'r'
529
delete [] dof_values;
532
/// Evaluate linear functional for dof i on the function f
533
virtual double evaluate_dof(unsigned int i,
534
const ufc::function& f,
535
const ufc::cell& c) const
537
// Declare variables for result of evaluation
540
// Declare variable for physical coordinates
543
const double * const * x = c.coordinates;
551
f.evaluate(vals, y, c);
560
f.evaluate(vals, y, c);
569
f.evaluate(vals, y, c);
578
f.evaluate(vals, y, c);
587
/// Evaluate linear functionals for all dofs on the function f
588
virtual void evaluate_dofs(double* values,
589
const ufc::function& f,
590
const ufc::cell& c) const
592
// Declare variables for result of evaluation
595
// Declare variable for physical coordinates
598
const double * const * x = c.coordinates;
602
f.evaluate(vals, y, c);
607
f.evaluate(vals, y, c);
612
f.evaluate(vals, y, c);
617
f.evaluate(vals, y, c);
621
/// Interpolate vertex values from dof values
622
virtual void interpolate_vertex_values(double* vertex_values,
623
const double* dof_values,
624
const ufc::cell& c) const
626
// Evaluate function and change variables
627
vertex_values[0] = dof_values[0];
628
vertex_values[1] = dof_values[1];
629
vertex_values[2] = dof_values[2];
630
vertex_values[3] = dof_values[3];
633
/// Return the number of sub elements (for a mixed element)
634
virtual unsigned int num_sub_elements() const
639
/// Create a new finite element for sub element i (for a mixed element)
640
virtual ufc::finite_element* create_sub_element(unsigned int i) const
647
/// This class defines the interface for a local-to-global mapping of
648
/// degrees of freedom (dofs).
650
class subdomains_dof_map_0: public ufc::dof_map
654
unsigned int _global_dimension;
659
subdomains_dof_map_0() : ufc::dof_map()
661
_global_dimension = 0;
665
virtual ~subdomains_dof_map_0()
670
/// Return a string identifying the dof map
671
virtual const char* signature() const
673
return "FFC dofmap for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1)";
676
/// Return true iff mesh entities of topological dimension d are needed
677
virtual bool needs_mesh_entities(unsigned int d) const
706
/// Initialize dof map for mesh (return true iff init_cell() is needed)
707
virtual bool init_mesh(const ufc::mesh& m)
709
_global_dimension = m.num_entities[0];
713
/// Initialize dof map for given cell
714
virtual void init_cell(const ufc::mesh& m,
720
/// Finish initialization of dof map for cells
721
virtual void init_cell_finalize()
726
/// Return the dimension of the global finite element function space
727
virtual unsigned int global_dimension() const
729
return _global_dimension;
732
/// Return the dimension of the local finite element function space for a cell
733
virtual unsigned int local_dimension(const ufc::cell& c) const
738
/// Return the maximum dimension of the local finite element function space
739
virtual unsigned int max_local_dimension() const
744
// Return the geometric dimension of the coordinates this dof map provides
745
virtual unsigned int geometric_dimension() const
750
/// Return the number of dofs on each cell facet
751
virtual unsigned int num_facet_dofs() const
756
/// Return the number of dofs associated with each cell entity of dimension d
757
virtual unsigned int num_entity_dofs(unsigned int d) const
786
/// Tabulate the local-to-global mapping of dofs on a cell
787
virtual void tabulate_dofs(unsigned int* dofs,
789
const ufc::cell& c) const
791
dofs[0] = c.entity_indices[0][0];
792
dofs[1] = c.entity_indices[0][1];
793
dofs[2] = c.entity_indices[0][2];
794
dofs[3] = c.entity_indices[0][3];
797
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
798
virtual void tabulate_facet_dofs(unsigned int* dofs,
799
unsigned int facet) const
835
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
836
virtual void tabulate_entity_dofs(unsigned int* dofs,
837
unsigned int d, unsigned int i) const
841
std::cerr << "*** FFC warning: " << "d is larger than dimension (3)" << std::endl;
850
std::cerr << "*** FFC warning: " << "i is larger than number of entities (3)" << std::endl;
898
/// Tabulate the coordinates of all dofs on a cell
899
virtual void tabulate_coordinates(double** coordinates,
900
const ufc::cell& c) const
902
const double * const * x = c.coordinates;
904
coordinates[0][0] = x[0][0];
905
coordinates[0][1] = x[0][1];
906
coordinates[0][2] = x[0][2];
907
coordinates[1][0] = x[1][0];
908
coordinates[1][1] = x[1][1];
909
coordinates[1][2] = x[1][2];
910
coordinates[2][0] = x[2][0];
911
coordinates[2][1] = x[2][1];
912
coordinates[2][2] = x[2][2];
913
coordinates[3][0] = x[3][0];
914
coordinates[3][1] = x[3][1];
915
coordinates[3][2] = x[3][2];
918
/// Return the number of sub dof maps (for a mixed element)
919
virtual unsigned int num_sub_dof_maps() const
924
/// Create a new dof_map for sub dof map i (for a mixed element)
925
virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
932
/// This class defines the interface for the tabulation of the cell
933
/// tensor corresponding to the local contribution to a form from
934
/// the integral over a cell.
936
class subdomains_cell_integral_0_0: public ufc::cell_integral
941
subdomains_cell_integral_0_0() : ufc::cell_integral()
947
virtual ~subdomains_cell_integral_0_0()
952
/// Tabulate the tensor for the contribution from a local cell
953
virtual void tabulate_tensor(double* A,
954
const double * const * w,
955
const ufc::cell& c) const
957
// Number of operations (multiply-add pairs) for Jacobian data: 32
958
// Number of operations (multiply-add pairs) for geometry tensor: 0
959
// Number of operations (multiply-add pairs) for tensor contraction: 8
960
// Total number of operations (multiply-add pairs): 40
962
// Extract vertex coordinates
963
const double * const * x = c.coordinates;
965
// Compute Jacobian of affine map from reference cell
966
const double J_00 = x[1][0] - x[0][0];
967
const double J_01 = x[2][0] - x[0][0];
968
const double J_02 = x[3][0] - x[0][0];
969
const double J_10 = x[1][1] - x[0][1];
970
const double J_11 = x[2][1] - x[0][1];
971
const double J_12 = x[3][1] - x[0][1];
972
const double J_20 = x[1][2] - x[0][2];
973
const double J_21 = x[2][2] - x[0][2];
974
const double J_22 = x[3][2] - x[0][2];
976
// Compute sub determinants
977
const double d_00 = J_11*J_22 - J_12*J_21;
978
const double d_10 = J_02*J_21 - J_01*J_22;
979
const double d_20 = J_01*J_12 - J_02*J_11;
981
// Compute determinant of Jacobian
982
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
984
// Compute inverse of Jacobian
987
const double det = std::abs(detJ);
989
// Compute geometry tensor
990
const double G0_ = det;
992
// Compute element tensor
993
A[0] = 0.01666667*G0_;
994
A[1] = 0.00833333*G0_;
995
A[2] = 0.00833333*G0_;
996
A[3] = 0.00833333*G0_;
997
A[4] = 0.00833333*G0_;
998
A[5] = 0.01666667*G0_;
999
A[6] = 0.00833333*G0_;
1000
A[7] = 0.00833333*G0_;
1001
A[8] = 0.00833333*G0_;
1002
A[9] = 0.00833333*G0_;
1003
A[10] = 0.01666667*G0_;
1004
A[11] = 0.00833333*G0_;
1005
A[12] = 0.00833333*G0_;
1006
A[13] = 0.00833333*G0_;
1007
A[14] = 0.00833333*G0_;
1008
A[15] = 0.01666667*G0_;
1013
/// This class defines the interface for the tabulation of the cell
1014
/// tensor corresponding to the local contribution to a form from
1015
/// the integral over a cell.
1017
class subdomains_cell_integral_0_1: public ufc::cell_integral
1022
subdomains_cell_integral_0_1() : ufc::cell_integral()
1028
virtual ~subdomains_cell_integral_0_1()
1033
/// Tabulate the tensor for the contribution from a local cell
1034
virtual void tabulate_tensor(double* A,
1035
const double * const * w,
1036
const ufc::cell& c) const
1038
// Number of operations (multiply-add pairs) for Jacobian data: 32
1039
// Number of operations (multiply-add pairs) for geometry tensor: 0
1040
// Number of operations (multiply-add pairs) for tensor contraction: 8
1041
// Total number of operations (multiply-add pairs): 40
1043
// Extract vertex coordinates
1044
const double * const * x = c.coordinates;
1046
// Compute Jacobian of affine map from reference cell
1047
const double J_00 = x[1][0] - x[0][0];
1048
const double J_01 = x[2][0] - x[0][0];
1049
const double J_02 = x[3][0] - x[0][0];
1050
const double J_10 = x[1][1] - x[0][1];
1051
const double J_11 = x[2][1] - x[0][1];
1052
const double J_12 = x[3][1] - x[0][1];
1053
const double J_20 = x[1][2] - x[0][2];
1054
const double J_21 = x[2][2] - x[0][2];
1055
const double J_22 = x[3][2] - x[0][2];
1057
// Compute sub determinants
1058
const double d_00 = J_11*J_22 - J_12*J_21;
1059
const double d_10 = J_02*J_21 - J_01*J_22;
1060
const double d_20 = J_01*J_12 - J_02*J_11;
1062
// Compute determinant of Jacobian
1063
double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
1065
// Compute inverse of Jacobian
1068
const double det = std::abs(detJ);
1070
// Compute geometry tensor
1071
const double G0_ = det;
1073
// Compute element tensor
1074
A[0] = 0.16666667*G0_;
1075
A[1] = 0.08333333*G0_;
1076
A[2] = 0.08333333*G0_;
1077
A[3] = 0.08333333*G0_;
1078
A[4] = 0.08333333*G0_;
1079
A[5] = 0.16666667*G0_;
1080
A[6] = 0.08333333*G0_;
1081
A[7] = 0.08333333*G0_;
1082
A[8] = 0.08333333*G0_;
1083
A[9] = 0.08333333*G0_;
1084
A[10] = 0.16666667*G0_;
1085
A[11] = 0.08333333*G0_;
1086
A[12] = 0.08333333*G0_;
1087
A[13] = 0.08333333*G0_;
1088
A[14] = 0.08333333*G0_;
1089
A[15] = 0.16666667*G0_;
1094
/// This class defines the interface for the tabulation of the
1095
/// exterior facet tensor corresponding to the local contribution to
1096
/// a form from the integral over an exterior facet.
1098
class subdomains_exterior_facet_integral_0_0: public ufc::exterior_facet_integral
1103
subdomains_exterior_facet_integral_0_0() : ufc::exterior_facet_integral()
1109
virtual ~subdomains_exterior_facet_integral_0_0()
1114
/// Tabulate the tensor for the contribution from a local exterior facet
1115
virtual void tabulate_tensor(double* A,
1116
const double * const * w,
1118
unsigned int facet) const
1120
// Number of operations (multiply-add pairs) for Jacobian data: 52
1121
// Number of operations (multiply-add pairs) for geometry tensor: 0
1122
// Number of operations (multiply-add pairs) for tensor contraction: 18
1123
// Total number of operations (multiply-add pairs): 70
1125
// Extract vertex coordinates
1126
const double * const * x = c.coordinates;
1128
// Compute Jacobian of affine map from reference cell
1130
// Compute sub determinants
1132
// Compute determinant of Jacobian
1134
// Compute inverse of Jacobian
1136
// Get vertices on face
1137
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
1138
const unsigned int v0 = face_vertices[facet][0];
1139
const unsigned int v1 = face_vertices[facet][1];
1140
const unsigned int v2 = face_vertices[facet][2];
1142
// Compute scale factor (area of face scaled by area of reference triangle)
1143
const double a0 = (x[v0][1]*x[v1][2]
1145
+ x[v1][1]*x[v2][2])
1146
- (x[v2][1]*x[v1][2]
1148
+ x[v1][1]*x[v0][2]);
1150
const double a1 = (x[v0][2]*x[v1][0]
1152
+ x[v1][2]*x[v2][0])
1153
- (x[v2][2]*x[v1][0]
1155
+ x[v1][2]*x[v0][0]);
1157
const double a2 = (x[v0][0]*x[v1][1]
1159
+ x[v1][0]*x[v2][1])
1160
- (x[v2][0]*x[v1][1]
1162
+ x[v1][0]*x[v0][1]);
1164
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
1166
// Compute geometry tensor
1167
const double G0_ = det;
1169
// Compute element tensor
1179
A[5] = 0.08333333*G0_;
1180
A[6] = 0.04166667*G0_;
1181
A[7] = 0.04166667*G0_;
1183
A[9] = 0.04166667*G0_;
1184
A[10] = 0.08333333*G0_;
1185
A[11] = 0.04166667*G0_;
1187
A[13] = 0.04166667*G0_;
1188
A[14] = 0.04166667*G0_;
1189
A[15] = 0.08333333*G0_;
1194
A[0] = 0.08333333*G0_;
1196
A[2] = 0.04166667*G0_;
1197
A[3] = 0.04166667*G0_;
1202
A[8] = 0.04166667*G0_;
1204
A[10] = 0.08333333*G0_;
1205
A[11] = 0.04166667*G0_;
1206
A[12] = 0.04166667*G0_;
1208
A[14] = 0.04166667*G0_;
1209
A[15] = 0.08333333*G0_;
1214
A[0] = 0.08333333*G0_;
1215
A[1] = 0.04166667*G0_;
1217
A[3] = 0.04166667*G0_;
1218
A[4] = 0.04166667*G0_;
1219
A[5] = 0.08333333*G0_;
1221
A[7] = 0.04166667*G0_;
1226
A[12] = 0.04166667*G0_;
1227
A[13] = 0.04166667*G0_;
1229
A[15] = 0.08333333*G0_;
1234
A[0] = 0.08333333*G0_;
1235
A[1] = 0.04166667*G0_;
1236
A[2] = 0.04166667*G0_;
1238
A[4] = 0.04166667*G0_;
1239
A[5] = 0.08333333*G0_;
1240
A[6] = 0.04166667*G0_;
1242
A[8] = 0.04166667*G0_;
1243
A[9] = 0.04166667*G0_;
1244
A[10] = 0.08333333*G0_;
1258
/// This class defines the interface for the tabulation of the
1259
/// exterior facet tensor corresponding to the local contribution to
1260
/// a form from the integral over an exterior facet.
1262
class subdomains_exterior_facet_integral_0_1: public ufc::exterior_facet_integral
1267
subdomains_exterior_facet_integral_0_1() : ufc::exterior_facet_integral()
1273
virtual ~subdomains_exterior_facet_integral_0_1()
1278
/// Tabulate the tensor for the contribution from a local exterior facet
1279
virtual void tabulate_tensor(double* A,
1280
const double * const * w,
1282
unsigned int facet) const
1284
// Number of operations (multiply-add pairs) for Jacobian data: 52
1285
// Number of operations (multiply-add pairs) for geometry tensor: 0
1286
// Number of operations (multiply-add pairs) for tensor contraction: 18
1287
// Total number of operations (multiply-add pairs): 70
1289
// Extract vertex coordinates
1290
const double * const * x = c.coordinates;
1292
// Compute Jacobian of affine map from reference cell
1294
// Compute sub determinants
1296
// Compute determinant of Jacobian
1298
// Compute inverse of Jacobian
1300
// Get vertices on face
1301
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
1302
const unsigned int v0 = face_vertices[facet][0];
1303
const unsigned int v1 = face_vertices[facet][1];
1304
const unsigned int v2 = face_vertices[facet][2];
1306
// Compute scale factor (area of face scaled by area of reference triangle)
1307
const double a0 = (x[v0][1]*x[v1][2]
1309
+ x[v1][1]*x[v2][2])
1310
- (x[v2][1]*x[v1][2]
1312
+ x[v1][1]*x[v0][2]);
1314
const double a1 = (x[v0][2]*x[v1][0]
1316
+ x[v1][2]*x[v2][0])
1317
- (x[v2][2]*x[v1][0]
1319
+ x[v1][2]*x[v0][0]);
1321
const double a2 = (x[v0][0]*x[v1][1]
1323
+ x[v1][0]*x[v2][1])
1324
- (x[v2][0]*x[v1][1]
1326
+ x[v1][0]*x[v0][1]);
1328
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
1330
// Compute geometry tensor
1331
const double G0_ = det;
1333
// Compute element tensor
1343
A[5] = 0.16666667*G0_;
1344
A[6] = 0.08333333*G0_;
1345
A[7] = 0.08333333*G0_;
1347
A[9] = 0.08333333*G0_;
1348
A[10] = 0.16666667*G0_;
1349
A[11] = 0.08333333*G0_;
1351
A[13] = 0.08333333*G0_;
1352
A[14] = 0.08333333*G0_;
1353
A[15] = 0.16666667*G0_;
1358
A[0] = 0.16666667*G0_;
1360
A[2] = 0.08333333*G0_;
1361
A[3] = 0.08333333*G0_;
1366
A[8] = 0.08333333*G0_;
1368
A[10] = 0.16666667*G0_;
1369
A[11] = 0.08333333*G0_;
1370
A[12] = 0.08333333*G0_;
1372
A[14] = 0.08333333*G0_;
1373
A[15] = 0.16666667*G0_;
1378
A[0] = 0.16666667*G0_;
1379
A[1] = 0.08333333*G0_;
1381
A[3] = 0.08333333*G0_;
1382
A[4] = 0.08333333*G0_;
1383
A[5] = 0.16666667*G0_;
1385
A[7] = 0.08333333*G0_;
1390
A[12] = 0.08333333*G0_;
1391
A[13] = 0.08333333*G0_;
1393
A[15] = 0.16666667*G0_;
1398
A[0] = 0.16666667*G0_;
1399
A[1] = 0.08333333*G0_;
1400
A[2] = 0.08333333*G0_;
1402
A[4] = 0.08333333*G0_;
1403
A[5] = 0.16666667*G0_;
1404
A[6] = 0.08333333*G0_;
1406
A[8] = 0.08333333*G0_;
1407
A[9] = 0.08333333*G0_;
1408
A[10] = 0.16666667*G0_;
1422
/// This class defines the interface for the tabulation of the
1423
/// interior facet tensor corresponding to the local contribution to
1424
/// a form from the integral over an interior facet.
1426
class subdomains_interior_facet_integral_0_0: public ufc::interior_facet_integral
1431
subdomains_interior_facet_integral_0_0() : ufc::interior_facet_integral()
1437
virtual ~subdomains_interior_facet_integral_0_0()
1442
/// Tabulate the tensor for the contribution from a local interior facet
1443
virtual void tabulate_tensor(double* A,
1444
const double * const * w,
1445
const ufc::cell& c0,
1446
const ufc::cell& c1,
1447
unsigned int facet0,
1448
unsigned int facet1) const
1450
// Number of operations (multiply-add pairs) for Jacobian data: 83
1451
// Number of operations (multiply-add pairs) for geometry tensor: 0
1452
// Number of operations (multiply-add pairs) for tensor contraction: 72
1453
// Total number of operations (multiply-add pairs): 155
1455
// Extract vertex coordinates
1456
const double * const * x0 = c0.coordinates;
1458
// Compute Jacobian of affine map from reference cell
1460
// Compute sub determinants
1462
// Compute determinant of Jacobian
1464
// Compute inverse of Jacobian
1466
// Compute Jacobian of affine map from reference cell
1468
// Compute sub determinants
1470
// Compute determinant of Jacobian
1472
// Compute inverse of Jacobian
1474
// Get vertices on face
1475
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
1476
const unsigned int v0 = face_vertices[facet0][0];
1477
const unsigned int v1 = face_vertices[facet0][1];
1478
const unsigned int v2 = face_vertices[facet0][2];
1480
// Compute scale factor (area of face scaled by area of reference triangle)
1481
const double a0 = (x0[v0][1]*x0[v1][2]
1482
+ x0[v0][2]*x0[v2][1]
1483
+ x0[v1][1]*x0[v2][2])
1484
- (x0[v2][1]*x0[v1][2]
1485
+ x0[v2][2]*x0[v0][1]
1486
+ x0[v1][1]*x0[v0][2]);
1488
const double a1 = (x0[v0][2]*x0[v1][0]
1489
+ x0[v0][0]*x0[v2][2]
1490
+ x0[v1][2]*x0[v2][0])
1491
- (x0[v2][2]*x0[v1][0]
1492
+ x0[v2][0]*x0[v0][2]
1493
+ x0[v1][2]*x0[v0][0]);
1495
const double a2 = (x0[v0][0]*x0[v1][1]
1496
+ x0[v0][1]*x0[v2][0]
1497
+ x0[v1][0]*x0[v2][1])
1498
- (x0[v2][0]*x0[v1][1]
1499
+ x0[v2][1]*x0[v0][0]
1500
+ x0[v1][0]*x0[v0][1]);
1502
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
1504
// Compute geometry tensor
1505
const double G0_ = det;
1507
// Compute element tensor
1525
A[9] = 0.08333333*G0_;
1526
A[10] = 0.04166667*G0_;
1527
A[11] = 0.04166667*G0_;
1533
A[17] = 0.04166667*G0_;
1534
A[18] = 0.08333333*G0_;
1535
A[19] = 0.04166667*G0_;
1541
A[25] = 0.04166667*G0_;
1542
A[26] = 0.04166667*G0_;
1543
A[27] = 0.08333333*G0_;
1593
A[9] = 0.08333333*G0_;
1594
A[10] = 0.04166667*G0_;
1595
A[11] = 0.04166667*G0_;
1601
A[17] = 0.04166667*G0_;
1602
A[18] = 0.08333333*G0_;
1603
A[19] = 0.04166667*G0_;
1609
A[25] = 0.04166667*G0_;
1610
A[26] = 0.04166667*G0_;
1611
A[27] = 0.08333333*G0_;
1661
A[9] = 0.08333333*G0_;
1662
A[10] = 0.04166667*G0_;
1663
A[11] = 0.04166667*G0_;
1669
A[17] = 0.04166667*G0_;
1670
A[18] = 0.08333333*G0_;
1671
A[19] = 0.04166667*G0_;
1677
A[25] = 0.04166667*G0_;
1678
A[26] = 0.04166667*G0_;
1679
A[27] = 0.08333333*G0_;
1729
A[9] = 0.08333333*G0_;
1730
A[10] = 0.04166667*G0_;
1731
A[11] = 0.04166667*G0_;
1737
A[17] = 0.04166667*G0_;
1738
A[18] = 0.08333333*G0_;
1739
A[19] = 0.04166667*G0_;
1745
A[25] = 0.04166667*G0_;
1746
A[26] = 0.04166667*G0_;
1747
A[27] = 0.08333333*G0_;
1796
A[0] = 0.08333333*G0_;
1798
A[2] = 0.04166667*G0_;
1799
A[3] = 0.04166667*G0_;
1812
A[16] = 0.04166667*G0_;
1814
A[18] = 0.08333333*G0_;
1815
A[19] = 0.04166667*G0_;
1820
A[24] = 0.04166667*G0_;
1822
A[26] = 0.04166667*G0_;
1823
A[27] = 0.08333333*G0_;
1864
A[0] = 0.08333333*G0_;
1866
A[2] = 0.04166667*G0_;
1867
A[3] = 0.04166667*G0_;
1880
A[16] = 0.04166667*G0_;
1882
A[18] = 0.08333333*G0_;
1883
A[19] = 0.04166667*G0_;
1888
A[24] = 0.04166667*G0_;
1890
A[26] = 0.04166667*G0_;
1891
A[27] = 0.08333333*G0_;
1932
A[0] = 0.08333333*G0_;
1934
A[2] = 0.04166667*G0_;
1935
A[3] = 0.04166667*G0_;
1948
A[16] = 0.04166667*G0_;
1950
A[18] = 0.08333333*G0_;
1951
A[19] = 0.04166667*G0_;
1956
A[24] = 0.04166667*G0_;
1958
A[26] = 0.04166667*G0_;
1959
A[27] = 0.08333333*G0_;
2000
A[0] = 0.08333333*G0_;
2002
A[2] = 0.04166667*G0_;
2003
A[3] = 0.04166667*G0_;
2016
A[16] = 0.04166667*G0_;
2018
A[18] = 0.08333333*G0_;
2019
A[19] = 0.04166667*G0_;
2024
A[24] = 0.04166667*G0_;
2026
A[26] = 0.04166667*G0_;
2027
A[27] = 0.08333333*G0_;
2076
A[0] = 0.08333333*G0_;
2077
A[1] = 0.04166667*G0_;
2079
A[3] = 0.04166667*G0_;
2084
A[8] = 0.04166667*G0_;
2085
A[9] = 0.08333333*G0_;
2087
A[11] = 0.04166667*G0_;
2100
A[24] = 0.04166667*G0_;
2101
A[25] = 0.04166667*G0_;
2103
A[27] = 0.08333333*G0_;
2144
A[0] = 0.08333333*G0_;
2145
A[1] = 0.04166667*G0_;
2147
A[3] = 0.04166667*G0_;
2152
A[8] = 0.04166667*G0_;
2153
A[9] = 0.08333333*G0_;
2155
A[11] = 0.04166667*G0_;
2168
A[24] = 0.04166667*G0_;
2169
A[25] = 0.04166667*G0_;
2171
A[27] = 0.08333333*G0_;
2212
A[0] = 0.08333333*G0_;
2213
A[1] = 0.04166667*G0_;
2215
A[3] = 0.04166667*G0_;
2220
A[8] = 0.04166667*G0_;
2221
A[9] = 0.08333333*G0_;
2223
A[11] = 0.04166667*G0_;
2236
A[24] = 0.04166667*G0_;
2237
A[25] = 0.04166667*G0_;
2239
A[27] = 0.08333333*G0_;
2280
A[0] = 0.08333333*G0_;
2281
A[1] = 0.04166667*G0_;
2283
A[3] = 0.04166667*G0_;
2288
A[8] = 0.04166667*G0_;
2289
A[9] = 0.08333333*G0_;
2291
A[11] = 0.04166667*G0_;
2304
A[24] = 0.04166667*G0_;
2305
A[25] = 0.04166667*G0_;
2307
A[27] = 0.08333333*G0_;
2356
A[0] = 0.08333333*G0_;
2357
A[1] = 0.04166667*G0_;
2358
A[2] = 0.04166667*G0_;
2364
A[8] = 0.04166667*G0_;
2365
A[9] = 0.08333333*G0_;
2366
A[10] = 0.04166667*G0_;
2372
A[16] = 0.04166667*G0_;
2373
A[17] = 0.04166667*G0_;
2374
A[18] = 0.08333333*G0_;
2424
A[0] = 0.08333333*G0_;
2425
A[1] = 0.04166667*G0_;
2426
A[2] = 0.04166667*G0_;
2432
A[8] = 0.04166667*G0_;
2433
A[9] = 0.08333333*G0_;
2434
A[10] = 0.04166667*G0_;
2440
A[16] = 0.04166667*G0_;
2441
A[17] = 0.04166667*G0_;
2442
A[18] = 0.08333333*G0_;
2492
A[0] = 0.08333333*G0_;
2493
A[1] = 0.04166667*G0_;
2494
A[2] = 0.04166667*G0_;
2500
A[8] = 0.04166667*G0_;
2501
A[9] = 0.08333333*G0_;
2502
A[10] = 0.04166667*G0_;
2508
A[16] = 0.04166667*G0_;
2509
A[17] = 0.04166667*G0_;
2510
A[18] = 0.08333333*G0_;
2560
A[0] = 0.08333333*G0_;
2561
A[1] = 0.04166667*G0_;
2562
A[2] = 0.04166667*G0_;
2568
A[8] = 0.04166667*G0_;
2569
A[9] = 0.08333333*G0_;
2570
A[10] = 0.04166667*G0_;
2576
A[16] = 0.04166667*G0_;
2577
A[17] = 0.04166667*G0_;
2578
A[18] = 0.08333333*G0_;
2636
/// This class defines the interface for the tabulation of the
2637
/// interior facet tensor corresponding to the local contribution to
2638
/// a form from the integral over an interior facet.
2640
class subdomains_interior_facet_integral_0_1: public ufc::interior_facet_integral
2645
subdomains_interior_facet_integral_0_1() : ufc::interior_facet_integral()
2651
virtual ~subdomains_interior_facet_integral_0_1()
2656
/// Tabulate the tensor for the contribution from a local interior facet
2657
virtual void tabulate_tensor(double* A,
2658
const double * const * w,
2659
const ufc::cell& c0,
2660
const ufc::cell& c1,
2661
unsigned int facet0,
2662
unsigned int facet1) const
2664
// Number of operations (multiply-add pairs) for Jacobian data: 83
2665
// Number of operations (multiply-add pairs) for geometry tensor: 0
2666
// Number of operations (multiply-add pairs) for tensor contraction: 72
2667
// Total number of operations (multiply-add pairs): 155
2669
// Extract vertex coordinates
2670
const double * const * x0 = c0.coordinates;
2672
// Compute Jacobian of affine map from reference cell
2674
// Compute sub determinants
2676
// Compute determinant of Jacobian
2678
// Compute inverse of Jacobian
2680
// Compute Jacobian of affine map from reference cell
2682
// Compute sub determinants
2684
// Compute determinant of Jacobian
2686
// Compute inverse of Jacobian
2688
// Get vertices on face
2689
static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
2690
const unsigned int v0 = face_vertices[facet0][0];
2691
const unsigned int v1 = face_vertices[facet0][1];
2692
const unsigned int v2 = face_vertices[facet0][2];
2694
// Compute scale factor (area of face scaled by area of reference triangle)
2695
const double a0 = (x0[v0][1]*x0[v1][2]
2696
+ x0[v0][2]*x0[v2][1]
2697
+ x0[v1][1]*x0[v2][2])
2698
- (x0[v2][1]*x0[v1][2]
2699
+ x0[v2][2]*x0[v0][1]
2700
+ x0[v1][1]*x0[v0][2]);
2702
const double a1 = (x0[v0][2]*x0[v1][0]
2703
+ x0[v0][0]*x0[v2][2]
2704
+ x0[v1][2]*x0[v2][0])
2705
- (x0[v2][2]*x0[v1][0]
2706
+ x0[v2][0]*x0[v0][2]
2707
+ x0[v1][2]*x0[v0][0]);
2709
const double a2 = (x0[v0][0]*x0[v1][1]
2710
+ x0[v0][1]*x0[v2][0]
2711
+ x0[v1][0]*x0[v2][1])
2712
- (x0[v2][0]*x0[v1][1]
2713
+ x0[v2][1]*x0[v0][0]
2714
+ x0[v1][0]*x0[v0][1]);
2716
const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
2718
// Compute geometry tensor
2719
const double G0_ = det;
2721
// Compute element tensor
2739
A[9] = 0.35833333*G0_;
2740
A[10] = 0.17916667*G0_;
2741
A[11] = 0.17916667*G0_;
2747
A[17] = 0.17916667*G0_;
2748
A[18] = 0.35833333*G0_;
2749
A[19] = 0.17916667*G0_;
2755
A[25] = 0.17916667*G0_;
2756
A[26] = 0.17916667*G0_;
2757
A[27] = 0.35833333*G0_;
2807
A[9] = 0.35833333*G0_;
2808
A[10] = 0.17916667*G0_;
2809
A[11] = 0.17916667*G0_;
2815
A[17] = 0.17916667*G0_;
2816
A[18] = 0.35833333*G0_;
2817
A[19] = 0.17916667*G0_;
2823
A[25] = 0.17916667*G0_;
2824
A[26] = 0.17916667*G0_;
2825
A[27] = 0.35833333*G0_;
2875
A[9] = 0.35833333*G0_;
2876
A[10] = 0.17916667*G0_;
2877
A[11] = 0.17916667*G0_;
2883
A[17] = 0.17916667*G0_;
2884
A[18] = 0.35833333*G0_;
2885
A[19] = 0.17916667*G0_;
2891
A[25] = 0.17916667*G0_;
2892
A[26] = 0.17916667*G0_;
2893
A[27] = 0.35833333*G0_;
2943
A[9] = 0.35833333*G0_;
2944
A[10] = 0.17916667*G0_;
2945
A[11] = 0.17916667*G0_;
2951
A[17] = 0.17916667*G0_;
2952
A[18] = 0.35833333*G0_;
2953
A[19] = 0.17916667*G0_;
2959
A[25] = 0.17916667*G0_;
2960
A[26] = 0.17916667*G0_;
2961
A[27] = 0.35833333*G0_;
3010
A[0] = 0.35833333*G0_;
3012
A[2] = 0.17916667*G0_;
3013
A[3] = 0.17916667*G0_;
3026
A[16] = 0.17916667*G0_;
3028
A[18] = 0.35833333*G0_;
3029
A[19] = 0.17916667*G0_;
3034
A[24] = 0.17916667*G0_;
3036
A[26] = 0.17916667*G0_;
3037
A[27] = 0.35833333*G0_;
3078
A[0] = 0.35833333*G0_;
3080
A[2] = 0.17916667*G0_;
3081
A[3] = 0.17916667*G0_;
3094
A[16] = 0.17916667*G0_;
3096
A[18] = 0.35833333*G0_;
3097
A[19] = 0.17916667*G0_;
3102
A[24] = 0.17916667*G0_;
3104
A[26] = 0.17916667*G0_;
3105
A[27] = 0.35833333*G0_;
3146
A[0] = 0.35833333*G0_;
3148
A[2] = 0.17916667*G0_;
3149
A[3] = 0.17916667*G0_;
3162
A[16] = 0.17916667*G0_;
3164
A[18] = 0.35833333*G0_;
3165
A[19] = 0.17916667*G0_;
3170
A[24] = 0.17916667*G0_;
3172
A[26] = 0.17916667*G0_;
3173
A[27] = 0.35833333*G0_;
3214
A[0] = 0.35833333*G0_;
3216
A[2] = 0.17916667*G0_;
3217
A[3] = 0.17916667*G0_;
3230
A[16] = 0.17916667*G0_;
3232
A[18] = 0.35833333*G0_;
3233
A[19] = 0.17916667*G0_;
3238
A[24] = 0.17916667*G0_;
3240
A[26] = 0.17916667*G0_;
3241
A[27] = 0.35833333*G0_;
3290
A[0] = 0.35833333*G0_;
3291
A[1] = 0.17916667*G0_;
3293
A[3] = 0.17916667*G0_;
3298
A[8] = 0.17916667*G0_;
3299
A[9] = 0.35833333*G0_;
3301
A[11] = 0.17916667*G0_;
3314
A[24] = 0.17916667*G0_;
3315
A[25] = 0.17916667*G0_;
3317
A[27] = 0.35833333*G0_;
3358
A[0] = 0.35833333*G0_;
3359
A[1] = 0.17916667*G0_;
3361
A[3] = 0.17916667*G0_;
3366
A[8] = 0.17916667*G0_;
3367
A[9] = 0.35833333*G0_;
3369
A[11] = 0.17916667*G0_;
3382
A[24] = 0.17916667*G0_;
3383
A[25] = 0.17916667*G0_;
3385
A[27] = 0.35833333*G0_;
3426
A[0] = 0.35833333*G0_;
3427
A[1] = 0.17916667*G0_;
3429
A[3] = 0.17916667*G0_;
3434
A[8] = 0.17916667*G0_;
3435
A[9] = 0.35833333*G0_;
3437
A[11] = 0.17916667*G0_;
3450
A[24] = 0.17916667*G0_;
3451
A[25] = 0.17916667*G0_;
3453
A[27] = 0.35833333*G0_;
3494
A[0] = 0.35833333*G0_;
3495
A[1] = 0.17916667*G0_;
3497
A[3] = 0.17916667*G0_;
3502
A[8] = 0.17916667*G0_;
3503
A[9] = 0.35833333*G0_;
3505
A[11] = 0.17916667*G0_;
3518
A[24] = 0.17916667*G0_;
3519
A[25] = 0.17916667*G0_;
3521
A[27] = 0.35833333*G0_;
3570
A[0] = 0.35833333*G0_;
3571
A[1] = 0.17916667*G0_;
3572
A[2] = 0.17916667*G0_;
3578
A[8] = 0.17916667*G0_;
3579
A[9] = 0.35833333*G0_;
3580
A[10] = 0.17916667*G0_;
3586
A[16] = 0.17916667*G0_;
3587
A[17] = 0.17916667*G0_;
3588
A[18] = 0.35833333*G0_;
3638
A[0] = 0.35833333*G0_;
3639
A[1] = 0.17916667*G0_;
3640
A[2] = 0.17916667*G0_;
3646
A[8] = 0.17916667*G0_;
3647
A[9] = 0.35833333*G0_;
3648
A[10] = 0.17916667*G0_;
3654
A[16] = 0.17916667*G0_;
3655
A[17] = 0.17916667*G0_;
3656
A[18] = 0.35833333*G0_;
3706
A[0] = 0.35833333*G0_;
3707
A[1] = 0.17916667*G0_;
3708
A[2] = 0.17916667*G0_;
3714
A[8] = 0.17916667*G0_;
3715
A[9] = 0.35833333*G0_;
3716
A[10] = 0.17916667*G0_;
3722
A[16] = 0.17916667*G0_;
3723
A[17] = 0.17916667*G0_;
3724
A[18] = 0.35833333*G0_;
3774
A[0] = 0.35833333*G0_;
3775
A[1] = 0.17916667*G0_;
3776
A[2] = 0.17916667*G0_;
3782
A[8] = 0.17916667*G0_;
3783
A[9] = 0.35833333*G0_;
3784
A[10] = 0.17916667*G0_;
3790
A[16] = 0.17916667*G0_;
3791
A[17] = 0.17916667*G0_;
3792
A[18] = 0.35833333*G0_;
3850
/// This class defines the interface for the assembly of the global
3851
/// tensor corresponding to a form with r + n arguments, that is, a
3854
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
3856
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
3857
/// global tensor A is defined by
3859
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
3861
/// where each argument Vj represents the application to the
3862
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
3863
/// fixed functions (coefficients).
3865
class subdomains_form_0: public ufc::form
3870
subdomains_form_0() : ufc::form()
3876
virtual ~subdomains_form_0()
3881
/// Return a string identifying the form
3882
virtual const char* signature() const
3884
return "Form([Integral(Product(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0), Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Measure('cell', 0, None)), Integral(Product(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1), Product(FloatValue(10.0, (), (), {}), Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0))), Measure('cell', 1, None)), Integral(Product(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0), Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Measure('exterior_facet', 0, None)), Integral(Product(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1), Product(FloatValue(2.0, (), (), {}), Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0))), Measure('exterior_facet', 1, None)), Integral(Product(PositiveRestricted(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0)), PositiveRestricted(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1))), Measure('interior_facet', 0, None)), Integral(Product(PositiveRestricted(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 1)), Product(FloatValue(4.2999999999999998, (), (), {}), PositiveRestricted(Argument(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 1), 0)))), Measure('interior_facet', 1, None))])";
3887
/// Return the rank of the global tensor (r)
3888
virtual unsigned int rank() const
3893
/// Return the number of coefficients (n)
3894
virtual unsigned int num_coefficients() const
3899
/// Return the number of cell integrals
3900
virtual unsigned int num_cell_integrals() const
3905
/// Return the number of exterior facet integrals
3906
virtual unsigned int num_exterior_facet_integrals() const
3911
/// Return the number of interior facet integrals
3912
virtual unsigned int num_interior_facet_integrals() const
3917
/// Create a new finite element for argument function i
3918
virtual ufc::finite_element* create_finite_element(unsigned int i) const
3924
return new subdomains_finite_element_0();
3929
return new subdomains_finite_element_0();
3937
/// Create a new dof map for argument function i
3938
virtual ufc::dof_map* create_dof_map(unsigned int i) const
3944
return new subdomains_dof_map_0();
3949
return new subdomains_dof_map_0();
3957
/// Create a new cell integral on sub domain i
3958
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
3964
return new subdomains_cell_integral_0_0();
3969
return new subdomains_cell_integral_0_1();
3977
/// Create a new exterior facet integral on sub domain i
3978
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
3984
return new subdomains_exterior_facet_integral_0_0();
3989
return new subdomains_exterior_facet_integral_0_1();
3997
/// Create a new interior facet integral on sub domain i
3998
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
4004
return new subdomains_interior_facet_integral_0_0();
4009
return new subdomains_interior_facet_integral_0_1();