1
// This code conforms with the UFC specification version 1.4.2
2
// and was automatically generated by FFC version 0.9.4+.
4
// This code was generated with the option '-l dolfin' and
5
// contains DOLFIN-specific wrappers that depend on DOLFIN.
7
// This code was generated with the following parameters:
10
// convert_exceptions_to_warnings: False
11
// cpp_optimize: False
12
// cpp_optimize_flags: '-O2'
14
// error_control: True
23
// quadrature_degree: 'auto'
24
// quadrature_rule: 'auto'
25
// representation: 'auto'
28
#ifndef __ADAPTIVEPOISSON_H
29
#define __ADAPTIVEPOISSON_H
36
/// This class defines the interface for a finite element.
38
class adaptivepoisson_finite_element_0: public ufc::finite_element
43
adaptivepoisson_finite_element_0() : ufc::finite_element()
49
virtual ~adaptivepoisson_finite_element_0()
54
/// Return a string identifying the finite element
55
virtual const char* signature() const
57
return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
60
/// Return the cell shape
61
virtual ufc::shape cell_shape() const
66
/// Return the topological dimension of the cell shape
67
virtual unsigned int topological_dimension() const
72
/// Return the geometric dimension of the cell shape
73
virtual unsigned int geometric_dimension() const
78
/// Return the dimension of the finite element function space
79
virtual unsigned int space_dimension() const
84
/// Return the rank of the value space
85
virtual unsigned int value_rank() const
90
/// Return the dimension of the value space for axis i
91
virtual unsigned int value_dimension(unsigned int i) const
96
/// Evaluate basis function i at given point in cell
97
virtual void evaluate_basis(unsigned int i,
99
const double* coordinates,
100
const ufc::cell& c) const
102
// Extract vertex coordinates
104
// Compute Jacobian of affine map from reference cell
106
// Compute determinant of Jacobian
108
// Compute inverse of Jacobian
112
// Get coordinates and map to the reference (FIAT) element
115
*values = 0.000000000000000;
117
// Array of basisvalues.
118
double basisvalues[1] = {0.000000000000000};
120
// Declare helper variables.
122
// Compute basisvalues.
123
basisvalues[0] = 1.000000000000000;
125
// Table(s) of coefficients.
126
static const double coefficients0[1] = \
130
for (unsigned int r = 0; r < 1; r++)
132
*values += coefficients0[r]*basisvalues[r];
133
}// end loop over 'r'
136
/// Evaluate all basis functions at given point in cell
137
virtual void evaluate_basis_all(double* values,
138
const double* coordinates,
139
const ufc::cell& c) const
141
// Element is constant, calling evaluate_basis.
142
evaluate_basis(0, values, coordinates, c);
145
/// Evaluate order n derivatives of basis function i at given point in cell
146
virtual void evaluate_basis_derivatives(unsigned int i,
149
const double* coordinates,
150
const ufc::cell& c) const
152
// Extract vertex coordinates
153
const double * const * x = c.coordinates;
155
// Compute Jacobian of affine map from reference cell
156
const double J_00 = x[1][0] - x[0][0];
157
const double J_01 = x[2][0] - x[0][0];
158
const double J_10 = x[1][1] - x[0][1];
159
const double J_11 = x[2][1] - x[0][1];
161
// Compute determinant of Jacobian
162
double detJ = J_00*J_11 - J_01*J_10;
164
// Compute inverse of Jacobian
165
const double K_00 = J_11 / detJ;
166
const double K_01 = -J_01 / detJ;
167
const double K_10 = -J_10 / detJ;
168
const double K_11 = J_00 / detJ;
172
// Get coordinates and map to the reference (FIAT) element
174
// Compute number of derivatives.
175
unsigned int num_derivatives = 1;
176
for (unsigned int r = 0; r < n; r++)
178
num_derivatives *= 2;
179
}// end loop over 'r'
181
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
182
unsigned int **combinations = new unsigned int *[num_derivatives];
183
for (unsigned int row = 0; row < num_derivatives; row++)
185
combinations[row] = new unsigned int [n];
186
for (unsigned int col = 0; col < n; col++)
187
combinations[row][col] = 0;
190
// Generate combinations of derivatives
191
for (unsigned int row = 1; row < num_derivatives; row++)
193
for (unsigned int num = 0; num < row; num++)
195
for (unsigned int col = n-1; col+1 > 0; col--)
197
if (combinations[row][col] + 1 > 1)
198
combinations[row][col] = 0;
201
combinations[row][col] += 1;
208
// Compute inverse of Jacobian
209
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
211
// Declare transformation matrix
212
// Declare pointer to two dimensional array and initialise
213
double **transform = new double *[num_derivatives];
215
for (unsigned int j = 0; j < num_derivatives; j++)
217
transform[j] = new double [num_derivatives];
218
for (unsigned int k = 0; k < num_derivatives; k++)
222
// Construct transformation matrix
223
for (unsigned int row = 0; row < num_derivatives; row++)
225
for (unsigned int col = 0; col < num_derivatives; col++)
227
for (unsigned int k = 0; k < n; k++)
228
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
232
// Reset values. Assuming that values is always an array.
233
for (unsigned int r = 0; r < num_derivatives; r++)
235
values[r] = 0.000000000000000;
236
}// end loop over 'r'
239
// Array of basisvalues.
240
double basisvalues[1] = {0.000000000000000};
242
// Declare helper variables.
244
// Compute basisvalues.
245
basisvalues[0] = 1.000000000000000;
247
// Table(s) of coefficients.
248
static const double coefficients0[1] = \
251
// Tables of derivatives of the polynomial base (transpose).
252
static const double dmats0[1][1] = \
253
{{0.000000000000000}};
255
static const double dmats1[1][1] = \
256
{{0.000000000000000}};
258
// Compute reference derivatives.
259
// Declare pointer to array of derivatives on FIAT element.
260
double *derivatives = new double[num_derivatives];
261
for (unsigned int r = 0; r < num_derivatives; r++)
263
derivatives[r] = 0.000000000000000;
264
}// end loop over 'r'
266
// Declare derivative matrix (of polynomial basis).
267
double dmats[1][1] = \
268
{{1.000000000000000}};
270
// Declare (auxiliary) derivative matrix (of polynomial basis).
271
double dmats_old[1][1] = \
272
{{1.000000000000000}};
274
// Loop possible derivatives.
275
for (unsigned int r = 0; r < num_derivatives; r++)
277
// Resetting dmats values to compute next derivative.
278
for (unsigned int t = 0; t < 1; t++)
280
for (unsigned int u = 0; u < 1; u++)
282
dmats[t][u] = 0.000000000000000;
285
dmats[t][u] = 1.000000000000000;
288
}// end loop over 'u'
289
}// end loop over 't'
291
// Looping derivative order to generate dmats.
292
for (unsigned int s = 0; s < n; s++)
294
// Updating dmats_old with new values and resetting dmats.
295
for (unsigned int t = 0; t < 1; t++)
297
for (unsigned int u = 0; u < 1; u++)
299
dmats_old[t][u] = dmats[t][u];
300
dmats[t][u] = 0.000000000000000;
301
}// end loop over 'u'
302
}// end loop over 't'
304
// Update dmats using an inner product.
305
if (combinations[r][s] == 0)
307
for (unsigned int t = 0; t < 1; t++)
309
for (unsigned int u = 0; u < 1; u++)
311
for (unsigned int tu = 0; tu < 1; tu++)
313
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
314
}// end loop over 'tu'
315
}// end loop over 'u'
316
}// end loop over 't'
319
if (combinations[r][s] == 1)
321
for (unsigned int t = 0; t < 1; t++)
323
for (unsigned int u = 0; u < 1; u++)
325
for (unsigned int tu = 0; tu < 1; tu++)
327
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
328
}// end loop over 'tu'
329
}// end loop over 'u'
330
}// end loop over 't'
333
}// end loop over 's'
334
for (unsigned int s = 0; s < 1; s++)
336
for (unsigned int t = 0; t < 1; t++)
338
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
339
}// end loop over 't'
340
}// end loop over 's'
341
}// end loop over 'r'
343
// Transform derivatives back to physical element
344
for (unsigned int r = 0; r < num_derivatives; r++)
346
for (unsigned int s = 0; s < num_derivatives; s++)
348
values[r] += transform[r][s]*derivatives[s];
349
}// end loop over 's'
350
}// end loop over 'r'
352
// Delete pointer to array of derivatives on FIAT element
353
delete [] derivatives;
355
// Delete pointer to array of combinations of derivatives and transform
356
for (unsigned int r = 0; r < num_derivatives; r++)
358
delete [] combinations[r];
359
}// end loop over 'r'
360
delete [] combinations;
361
for (unsigned int r = 0; r < num_derivatives; r++)
363
delete [] transform[r];
364
}// end loop over 'r'
368
/// Evaluate order n derivatives of all basis functions at given point in cell
369
virtual void evaluate_basis_derivatives_all(unsigned int n,
371
const double* coordinates,
372
const ufc::cell& c) const
374
// Element is constant, calling evaluate_basis_derivatives.
375
evaluate_basis_derivatives(0, n, values, coordinates, c);
378
/// Evaluate linear functional for dof i on the function f
379
virtual double evaluate_dof(unsigned int i,
380
const ufc::function& f,
381
const ufc::cell& c) const
383
// Declare variables for result of evaluation.
386
// Declare variable for physical coordinates.
388
const double * const * x = c.coordinates;
393
y[0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
394
y[1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
395
f.evaluate(vals, y, c);
401
return 0.000000000000000;
404
/// Evaluate linear functionals for all dofs on the function f
405
virtual void evaluate_dofs(double* values,
406
const ufc::function& f,
407
const ufc::cell& c) const
409
// Declare variables for result of evaluation.
412
// Declare variable for physical coordinates.
414
const double * const * x = c.coordinates;
415
y[0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
416
y[1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
417
f.evaluate(vals, y, c);
421
/// Interpolate vertex values from dof values
422
virtual void interpolate_vertex_values(double* vertex_values,
423
const double* dof_values,
424
const ufc::cell& c) const
426
// Evaluate function and change variables
427
vertex_values[0] = dof_values[0];
428
vertex_values[1] = dof_values[0];
429
vertex_values[2] = dof_values[0];
432
/// Map coordinate xhat from reference cell to coordinate x in cell
433
virtual void map_from_reference_cell(double* x,
437
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
440
/// Map from coordinate x in cell to coordinate xhat in reference cell
441
virtual void map_to_reference_cell(double* xhat,
445
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
448
/// Return the number of sub elements (for a mixed element)
449
virtual unsigned int num_sub_elements() const
454
/// Create a new finite element for sub element i (for a mixed element)
455
virtual ufc::finite_element* create_sub_element(unsigned int i) const
460
/// Create a new class instance
461
virtual ufc::finite_element* create() const
463
return new adaptivepoisson_finite_element_0();
468
/// This class defines the interface for a finite element.
470
class adaptivepoisson_finite_element_1: public ufc::finite_element
475
adaptivepoisson_finite_element_1() : ufc::finite_element()
481
virtual ~adaptivepoisson_finite_element_1()
486
/// Return a string identifying the finite element
487
virtual const char* signature() const
489
return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
492
/// Return the cell shape
493
virtual ufc::shape cell_shape() const
495
return ufc::triangle;
498
/// Return the topological dimension of the cell shape
499
virtual unsigned int topological_dimension() const
504
/// Return the geometric dimension of the cell shape
505
virtual unsigned int geometric_dimension() const
510
/// Return the dimension of the finite element function space
511
virtual unsigned int space_dimension() const
516
/// Return the rank of the value space
517
virtual unsigned int value_rank() const
522
/// Return the dimension of the value space for axis i
523
virtual unsigned int value_dimension(unsigned int i) const
528
/// Evaluate basis function i at given point in cell
529
virtual void evaluate_basis(unsigned int i,
531
const double* coordinates,
532
const ufc::cell& c) const
534
// Extract vertex coordinates
535
const double * const * x = c.coordinates;
537
// Compute Jacobian of affine map from reference cell
538
const double J_00 = x[1][0] - x[0][0];
539
const double J_01 = x[2][0] - x[0][0];
540
const double J_10 = x[1][1] - x[0][1];
541
const double J_11 = x[2][1] - x[0][1];
543
// Compute determinant of Jacobian
544
double detJ = J_00*J_11 - J_01*J_10;
546
// Compute inverse of Jacobian
549
const double C0 = x[1][0] + x[2][0];
550
const double C1 = x[1][1] + x[2][1];
552
// Get coordinates and map to the reference (FIAT) element
553
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
554
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
557
*values = 0.000000000000000;
563
// Array of basisvalues.
564
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
566
// Declare helper variables.
570
double tmp5 = 0.000000000000000;
571
double tmp6 = 0.000000000000000;
572
double tmp7 = 0.000000000000000;
573
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
574
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
575
double tmp2 = tmp1*tmp1;
577
// Compute basisvalues.
578
basisvalues[0] = 1.000000000000000;
579
basisvalues[1] = tmp0;
580
for (unsigned int r = 1; r < 2; r++)
582
rr = (r + 1)*((r + 1) + 1)/2;
584
tt = (r - 1)*((r - 1) + 1)/2;
585
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
586
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
587
}// end loop over 'r'
588
for (unsigned int r = 0; r < 2; r++)
590
rr = (r + 1)*(r + 1 + 1)/2 + 1;
592
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
593
}// end loop over 'r'
594
for (unsigned int r = 0; r < 1; r++)
596
for (unsigned int s = 1; s < 2 - r; s++)
598
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
599
ss = (r + s)*(r + s + 1)/2 + s;
600
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
601
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
602
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
603
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
604
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
605
}// end loop over 's'
606
}// end loop over 'r'
607
for (unsigned int r = 0; r < 3; r++)
609
for (unsigned int s = 0; s < 3 - r; s++)
611
rr = (r + s)*(r + s + 1)/2 + s;
612
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
613
}// end loop over 's'
614
}// end loop over 'r'
616
// Table(s) of coefficients.
617
static const double coefficients0[6] = \
618
{0.000000000000000, -0.173205080756888, -0.100000000000000, 0.121716123890037, 0.094280904158206, 0.054433105395182};
621
for (unsigned int r = 0; r < 6; r++)
623
*values += coefficients0[r]*basisvalues[r];
624
}// end loop over 'r'
630
// Array of basisvalues.
631
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
633
// Declare helper variables.
637
double tmp5 = 0.000000000000000;
638
double tmp6 = 0.000000000000000;
639
double tmp7 = 0.000000000000000;
640
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
641
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
642
double tmp2 = tmp1*tmp1;
644
// Compute basisvalues.
645
basisvalues[0] = 1.000000000000000;
646
basisvalues[1] = tmp0;
647
for (unsigned int r = 1; r < 2; r++)
649
rr = (r + 1)*((r + 1) + 1)/2;
651
tt = (r - 1)*((r - 1) + 1)/2;
652
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
653
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
654
}// end loop over 'r'
655
for (unsigned int r = 0; r < 2; r++)
657
rr = (r + 1)*(r + 1 + 1)/2 + 1;
659
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
660
}// end loop over 'r'
661
for (unsigned int r = 0; r < 1; r++)
663
for (unsigned int s = 1; s < 2 - r; s++)
665
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
666
ss = (r + s)*(r + s + 1)/2 + s;
667
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
668
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
669
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
670
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
671
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
672
}// end loop over 's'
673
}// end loop over 'r'
674
for (unsigned int r = 0; r < 3; r++)
676
for (unsigned int s = 0; s < 3 - r; s++)
678
rr = (r + s)*(r + s + 1)/2 + s;
679
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
680
}// end loop over 's'
681
}// end loop over 'r'
683
// Table(s) of coefficients.
684
static const double coefficients0[6] = \
685
{0.000000000000000, 0.173205080756888, -0.100000000000000, 0.121716123890037, -0.094280904158206, 0.054433105395182};
688
for (unsigned int r = 0; r < 6; r++)
690
*values += coefficients0[r]*basisvalues[r];
691
}// end loop over 'r'
697
// Array of basisvalues.
698
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
700
// Declare helper variables.
704
double tmp5 = 0.000000000000000;
705
double tmp6 = 0.000000000000000;
706
double tmp7 = 0.000000000000000;
707
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
708
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
709
double tmp2 = tmp1*tmp1;
711
// Compute basisvalues.
712
basisvalues[0] = 1.000000000000000;
713
basisvalues[1] = tmp0;
714
for (unsigned int r = 1; r < 2; r++)
716
rr = (r + 1)*((r + 1) + 1)/2;
718
tt = (r - 1)*((r - 1) + 1)/2;
719
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
720
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
721
}// end loop over 'r'
722
for (unsigned int r = 0; r < 2; r++)
724
rr = (r + 1)*(r + 1 + 1)/2 + 1;
726
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
727
}// end loop over 'r'
728
for (unsigned int r = 0; r < 1; r++)
730
for (unsigned int s = 1; s < 2 - r; s++)
732
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
733
ss = (r + s)*(r + s + 1)/2 + s;
734
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
735
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
736
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
737
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
738
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
739
}// end loop over 's'
740
}// end loop over 'r'
741
for (unsigned int r = 0; r < 3; r++)
743
for (unsigned int s = 0; s < 3 - r; s++)
745
rr = (r + s)*(r + s + 1)/2 + s;
746
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
747
}// end loop over 's'
748
}// end loop over 'r'
750
// Table(s) of coefficients.
751
static const double coefficients0[6] = \
752
{0.000000000000000, 0.000000000000000, 0.200000000000000, 0.000000000000000, 0.000000000000000, 0.163299316185545};
755
for (unsigned int r = 0; r < 6; r++)
757
*values += coefficients0[r]*basisvalues[r];
758
}// end loop over 'r'
764
// Array of basisvalues.
765
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
767
// Declare helper variables.
771
double tmp5 = 0.000000000000000;
772
double tmp6 = 0.000000000000000;
773
double tmp7 = 0.000000000000000;
774
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
775
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
776
double tmp2 = tmp1*tmp1;
778
// Compute basisvalues.
779
basisvalues[0] = 1.000000000000000;
780
basisvalues[1] = tmp0;
781
for (unsigned int r = 1; r < 2; r++)
783
rr = (r + 1)*((r + 1) + 1)/2;
785
tt = (r - 1)*((r - 1) + 1)/2;
786
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
787
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
788
}// end loop over 'r'
789
for (unsigned int r = 0; r < 2; r++)
791
rr = (r + 1)*(r + 1 + 1)/2 + 1;
793
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
794
}// end loop over 'r'
795
for (unsigned int r = 0; r < 1; r++)
797
for (unsigned int s = 1; s < 2 - r; s++)
799
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
800
ss = (r + s)*(r + s + 1)/2 + s;
801
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
802
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
803
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
804
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
805
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
806
}// end loop over 's'
807
}// end loop over 'r'
808
for (unsigned int r = 0; r < 3; r++)
810
for (unsigned int s = 0; s < 3 - r; s++)
812
rr = (r + s)*(r + s + 1)/2 + s;
813
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
814
}// end loop over 's'
815
}// end loop over 'r'
817
// Table(s) of coefficients.
818
static const double coefficients0[6] = \
819
{0.471404520791032, 0.230940107675850, 0.133333333333333, 0.000000000000000, 0.188561808316413, -0.163299316185545};
822
for (unsigned int r = 0; r < 6; r++)
824
*values += coefficients0[r]*basisvalues[r];
825
}// end loop over 'r'
831
// Array of basisvalues.
832
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
834
// Declare helper variables.
838
double tmp5 = 0.000000000000000;
839
double tmp6 = 0.000000000000000;
840
double tmp7 = 0.000000000000000;
841
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
842
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
843
double tmp2 = tmp1*tmp1;
845
// Compute basisvalues.
846
basisvalues[0] = 1.000000000000000;
847
basisvalues[1] = tmp0;
848
for (unsigned int r = 1; r < 2; r++)
850
rr = (r + 1)*((r + 1) + 1)/2;
852
tt = (r - 1)*((r - 1) + 1)/2;
853
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
854
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
855
}// end loop over 'r'
856
for (unsigned int r = 0; r < 2; r++)
858
rr = (r + 1)*(r + 1 + 1)/2 + 1;
860
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
861
}// end loop over 'r'
862
for (unsigned int r = 0; r < 1; r++)
864
for (unsigned int s = 1; s < 2 - r; s++)
866
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
867
ss = (r + s)*(r + s + 1)/2 + s;
868
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
869
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
870
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
871
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
872
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
873
}// end loop over 's'
874
}// end loop over 'r'
875
for (unsigned int r = 0; r < 3; r++)
877
for (unsigned int s = 0; s < 3 - r; s++)
879
rr = (r + s)*(r + s + 1)/2 + s;
880
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
881
}// end loop over 's'
882
}// end loop over 'r'
884
// Table(s) of coefficients.
885
static const double coefficients0[6] = \
886
{0.471404520791032, -0.230940107675850, 0.133333333333333, 0.000000000000000, -0.188561808316413, -0.163299316185545};
889
for (unsigned int r = 0; r < 6; r++)
891
*values += coefficients0[r]*basisvalues[r];
892
}// end loop over 'r'
898
// Array of basisvalues.
899
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
901
// Declare helper variables.
905
double tmp5 = 0.000000000000000;
906
double tmp6 = 0.000000000000000;
907
double tmp7 = 0.000000000000000;
908
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
909
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
910
double tmp2 = tmp1*tmp1;
912
// Compute basisvalues.
913
basisvalues[0] = 1.000000000000000;
914
basisvalues[1] = tmp0;
915
for (unsigned int r = 1; r < 2; r++)
917
rr = (r + 1)*((r + 1) + 1)/2;
919
tt = (r - 1)*((r - 1) + 1)/2;
920
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
921
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
922
}// end loop over 'r'
923
for (unsigned int r = 0; r < 2; r++)
925
rr = (r + 1)*(r + 1 + 1)/2 + 1;
927
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
928
}// end loop over 'r'
929
for (unsigned int r = 0; r < 1; r++)
931
for (unsigned int s = 1; s < 2 - r; s++)
933
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
934
ss = (r + s)*(r + s + 1)/2 + s;
935
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
936
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
937
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
938
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
939
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
940
}// end loop over 's'
941
}// end loop over 'r'
942
for (unsigned int r = 0; r < 3; r++)
944
for (unsigned int s = 0; s < 3 - r; s++)
946
rr = (r + s)*(r + s + 1)/2 + s;
947
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
948
}// end loop over 's'
949
}// end loop over 'r'
951
// Table(s) of coefficients.
952
static const double coefficients0[6] = \
953
{0.471404520791032, 0.000000000000000, -0.266666666666667, -0.243432247780074, 0.000000000000000, 0.054433105395182};
956
for (unsigned int r = 0; r < 6; r++)
958
*values += coefficients0[r]*basisvalues[r];
959
}// end loop over 'r'
966
/// Evaluate all basis functions at given point in cell
967
virtual void evaluate_basis_all(double* values,
968
const double* coordinates,
969
const ufc::cell& c) const
971
// Helper variable to hold values of a single dof.
972
double dof_values = 0.000000000000000;
974
// Loop dofs and call evaluate_basis.
975
for (unsigned int r = 0; r < 6; r++)
977
evaluate_basis(r, &dof_values, coordinates, c);
978
values[r] = dof_values;
979
}// end loop over 'r'
982
/// Evaluate order n derivatives of basis function i at given point in cell
983
virtual void evaluate_basis_derivatives(unsigned int i,
986
const double* coordinates,
987
const ufc::cell& c) const
989
// Extract vertex coordinates
990
const double * const * x = c.coordinates;
992
// Compute Jacobian of affine map from reference cell
993
const double J_00 = x[1][0] - x[0][0];
994
const double J_01 = x[2][0] - x[0][0];
995
const double J_10 = x[1][1] - x[0][1];
996
const double J_11 = x[2][1] - x[0][1];
998
// Compute determinant of Jacobian
999
double detJ = J_00*J_11 - J_01*J_10;
1001
// Compute inverse of Jacobian
1002
const double K_00 = J_11 / detJ;
1003
const double K_01 = -J_01 / detJ;
1004
const double K_10 = -J_10 / detJ;
1005
const double K_11 = J_00 / detJ;
1007
// Compute constants
1008
const double C0 = x[1][0] + x[2][0];
1009
const double C1 = x[1][1] + x[2][1];
1011
// Get coordinates and map to the reference (FIAT) element
1012
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
1013
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
1015
// Compute number of derivatives.
1016
unsigned int num_derivatives = 1;
1017
for (unsigned int r = 0; r < n; r++)
1019
num_derivatives *= 2;
1020
}// end loop over 'r'
1022
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
1023
unsigned int **combinations = new unsigned int *[num_derivatives];
1024
for (unsigned int row = 0; row < num_derivatives; row++)
1026
combinations[row] = new unsigned int [n];
1027
for (unsigned int col = 0; col < n; col++)
1028
combinations[row][col] = 0;
1031
// Generate combinations of derivatives
1032
for (unsigned int row = 1; row < num_derivatives; row++)
1034
for (unsigned int num = 0; num < row; num++)
1036
for (unsigned int col = n-1; col+1 > 0; col--)
1038
if (combinations[row][col] + 1 > 1)
1039
combinations[row][col] = 0;
1042
combinations[row][col] += 1;
1049
// Compute inverse of Jacobian
1050
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
1052
// Declare transformation matrix
1053
// Declare pointer to two dimensional array and initialise
1054
double **transform = new double *[num_derivatives];
1056
for (unsigned int j = 0; j < num_derivatives; j++)
1058
transform[j] = new double [num_derivatives];
1059
for (unsigned int k = 0; k < num_derivatives; k++)
1060
transform[j][k] = 1;
1063
// Construct transformation matrix
1064
for (unsigned int row = 0; row < num_derivatives; row++)
1066
for (unsigned int col = 0; col < num_derivatives; col++)
1068
for (unsigned int k = 0; k < n; k++)
1069
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
1073
// Reset values. Assuming that values is always an array.
1074
for (unsigned int r = 0; r < num_derivatives; r++)
1076
values[r] = 0.000000000000000;
1077
}// end loop over 'r'
1084
// Array of basisvalues.
1085
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
1087
// Declare helper variables.
1088
unsigned int rr = 0;
1089
unsigned int ss = 0;
1090
unsigned int tt = 0;
1091
double tmp5 = 0.000000000000000;
1092
double tmp6 = 0.000000000000000;
1093
double tmp7 = 0.000000000000000;
1094
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
1095
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
1096
double tmp2 = tmp1*tmp1;
1098
// Compute basisvalues.
1099
basisvalues[0] = 1.000000000000000;
1100
basisvalues[1] = tmp0;
1101
for (unsigned int r = 1; r < 2; r++)
1103
rr = (r + 1)*((r + 1) + 1)/2;
1105
tt = (r - 1)*((r - 1) + 1)/2;
1106
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
1107
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
1108
}// end loop over 'r'
1109
for (unsigned int r = 0; r < 2; r++)
1111
rr = (r + 1)*(r + 1 + 1)/2 + 1;
1113
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
1114
}// end loop over 'r'
1115
for (unsigned int r = 0; r < 1; r++)
1117
for (unsigned int s = 1; s < 2 - r; s++)
1119
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
1120
ss = (r + s)*(r + s + 1)/2 + s;
1121
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
1122
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1123
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1124
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1125
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
1126
}// end loop over 's'
1127
}// end loop over 'r'
1128
for (unsigned int r = 0; r < 3; r++)
1130
for (unsigned int s = 0; s < 3 - r; s++)
1132
rr = (r + s)*(r + s + 1)/2 + s;
1133
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
1134
}// end loop over 's'
1135
}// end loop over 'r'
1137
// Table(s) of coefficients.
1138
static const double coefficients0[6] = \
1139
{0.000000000000000, -0.173205080756888, -0.100000000000000, 0.121716123890037, 0.094280904158206, 0.054433105395182};
1141
// Tables of derivatives of the polynomial base (transpose).
1142
static const double dmats0[6][6] = \
1143
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1144
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1145
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1146
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1147
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1148
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1150
static const double dmats1[6][6] = \
1151
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1152
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1153
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1154
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1155
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1156
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1158
// Compute reference derivatives.
1159
// Declare pointer to array of derivatives on FIAT element.
1160
double *derivatives = new double[num_derivatives];
1161
for (unsigned int r = 0; r < num_derivatives; r++)
1163
derivatives[r] = 0.000000000000000;
1164
}// end loop over 'r'
1166
// Declare derivative matrix (of polynomial basis).
1167
double dmats[6][6] = \
1168
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1169
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1170
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1171
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1172
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1173
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1175
// Declare (auxiliary) derivative matrix (of polynomial basis).
1176
double dmats_old[6][6] = \
1177
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1178
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1179
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1180
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1181
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1182
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1184
// Loop possible derivatives.
1185
for (unsigned int r = 0; r < num_derivatives; r++)
1187
// Resetting dmats values to compute next derivative.
1188
for (unsigned int t = 0; t < 6; t++)
1190
for (unsigned int u = 0; u < 6; u++)
1192
dmats[t][u] = 0.000000000000000;
1195
dmats[t][u] = 1.000000000000000;
1198
}// end loop over 'u'
1199
}// end loop over 't'
1201
// Looping derivative order to generate dmats.
1202
for (unsigned int s = 0; s < n; s++)
1204
// Updating dmats_old with new values and resetting dmats.
1205
for (unsigned int t = 0; t < 6; t++)
1207
for (unsigned int u = 0; u < 6; u++)
1209
dmats_old[t][u] = dmats[t][u];
1210
dmats[t][u] = 0.000000000000000;
1211
}// end loop over 'u'
1212
}// end loop over 't'
1214
// Update dmats using an inner product.
1215
if (combinations[r][s] == 0)
1217
for (unsigned int t = 0; t < 6; t++)
1219
for (unsigned int u = 0; u < 6; u++)
1221
for (unsigned int tu = 0; tu < 6; tu++)
1223
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1224
}// end loop over 'tu'
1225
}// end loop over 'u'
1226
}// end loop over 't'
1229
if (combinations[r][s] == 1)
1231
for (unsigned int t = 0; t < 6; t++)
1233
for (unsigned int u = 0; u < 6; u++)
1235
for (unsigned int tu = 0; tu < 6; tu++)
1237
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1238
}// end loop over 'tu'
1239
}// end loop over 'u'
1240
}// end loop over 't'
1243
}// end loop over 's'
1244
for (unsigned int s = 0; s < 6; s++)
1246
for (unsigned int t = 0; t < 6; t++)
1248
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
1249
}// end loop over 't'
1250
}// end loop over 's'
1251
}// end loop over 'r'
1253
// Transform derivatives back to physical element
1254
for (unsigned int r = 0; r < num_derivatives; r++)
1256
for (unsigned int s = 0; s < num_derivatives; s++)
1258
values[r] += transform[r][s]*derivatives[s];
1259
}// end loop over 's'
1260
}// end loop over 'r'
1262
// Delete pointer to array of derivatives on FIAT element
1263
delete [] derivatives;
1265
// Delete pointer to array of combinations of derivatives and transform
1266
for (unsigned int r = 0; r < num_derivatives; r++)
1268
delete [] combinations[r];
1269
}// end loop over 'r'
1270
delete [] combinations;
1271
for (unsigned int r = 0; r < num_derivatives; r++)
1273
delete [] transform[r];
1274
}// end loop over 'r'
1275
delete [] transform;
1281
// Array of basisvalues.
1282
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
1284
// Declare helper variables.
1285
unsigned int rr = 0;
1286
unsigned int ss = 0;
1287
unsigned int tt = 0;
1288
double tmp5 = 0.000000000000000;
1289
double tmp6 = 0.000000000000000;
1290
double tmp7 = 0.000000000000000;
1291
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
1292
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
1293
double tmp2 = tmp1*tmp1;
1295
// Compute basisvalues.
1296
basisvalues[0] = 1.000000000000000;
1297
basisvalues[1] = tmp0;
1298
for (unsigned int r = 1; r < 2; r++)
1300
rr = (r + 1)*((r + 1) + 1)/2;
1302
tt = (r - 1)*((r - 1) + 1)/2;
1303
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
1304
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
1305
}// end loop over 'r'
1306
for (unsigned int r = 0; r < 2; r++)
1308
rr = (r + 1)*(r + 1 + 1)/2 + 1;
1310
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
1311
}// end loop over 'r'
1312
for (unsigned int r = 0; r < 1; r++)
1314
for (unsigned int s = 1; s < 2 - r; s++)
1316
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
1317
ss = (r + s)*(r + s + 1)/2 + s;
1318
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
1319
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1320
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1321
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1322
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
1323
}// end loop over 's'
1324
}// end loop over 'r'
1325
for (unsigned int r = 0; r < 3; r++)
1327
for (unsigned int s = 0; s < 3 - r; s++)
1329
rr = (r + s)*(r + s + 1)/2 + s;
1330
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
1331
}// end loop over 's'
1332
}// end loop over 'r'
1334
// Table(s) of coefficients.
1335
static const double coefficients0[6] = \
1336
{0.000000000000000, 0.173205080756888, -0.100000000000000, 0.121716123890037, -0.094280904158206, 0.054433105395182};
1338
// Tables of derivatives of the polynomial base (transpose).
1339
static const double dmats0[6][6] = \
1340
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1341
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1342
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1343
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1344
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1345
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1347
static const double dmats1[6][6] = \
1348
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1349
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1350
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1351
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1352
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1353
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1355
// Compute reference derivatives.
1356
// Declare pointer to array of derivatives on FIAT element.
1357
double *derivatives = new double[num_derivatives];
1358
for (unsigned int r = 0; r < num_derivatives; r++)
1360
derivatives[r] = 0.000000000000000;
1361
}// end loop over 'r'
1363
// Declare derivative matrix (of polynomial basis).
1364
double dmats[6][6] = \
1365
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1366
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1367
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1368
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1369
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1370
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1372
// Declare (auxiliary) derivative matrix (of polynomial basis).
1373
double dmats_old[6][6] = \
1374
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1375
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1376
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1377
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1378
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1379
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1381
// Loop possible derivatives.
1382
for (unsigned int r = 0; r < num_derivatives; r++)
1384
// Resetting dmats values to compute next derivative.
1385
for (unsigned int t = 0; t < 6; t++)
1387
for (unsigned int u = 0; u < 6; u++)
1389
dmats[t][u] = 0.000000000000000;
1392
dmats[t][u] = 1.000000000000000;
1395
}// end loop over 'u'
1396
}// end loop over 't'
1398
// Looping derivative order to generate dmats.
1399
for (unsigned int s = 0; s < n; s++)
1401
// Updating dmats_old with new values and resetting dmats.
1402
for (unsigned int t = 0; t < 6; t++)
1404
for (unsigned int u = 0; u < 6; u++)
1406
dmats_old[t][u] = dmats[t][u];
1407
dmats[t][u] = 0.000000000000000;
1408
}// end loop over 'u'
1409
}// end loop over 't'
1411
// Update dmats using an inner product.
1412
if (combinations[r][s] == 0)
1414
for (unsigned int t = 0; t < 6; t++)
1416
for (unsigned int u = 0; u < 6; u++)
1418
for (unsigned int tu = 0; tu < 6; tu++)
1420
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1421
}// end loop over 'tu'
1422
}// end loop over 'u'
1423
}// end loop over 't'
1426
if (combinations[r][s] == 1)
1428
for (unsigned int t = 0; t < 6; t++)
1430
for (unsigned int u = 0; u < 6; u++)
1432
for (unsigned int tu = 0; tu < 6; tu++)
1434
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1435
}// end loop over 'tu'
1436
}// end loop over 'u'
1437
}// end loop over 't'
1440
}// end loop over 's'
1441
for (unsigned int s = 0; s < 6; s++)
1443
for (unsigned int t = 0; t < 6; t++)
1445
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
1446
}// end loop over 't'
1447
}// end loop over 's'
1448
}// end loop over 'r'
1450
// Transform derivatives back to physical element
1451
for (unsigned int r = 0; r < num_derivatives; r++)
1453
for (unsigned int s = 0; s < num_derivatives; s++)
1455
values[r] += transform[r][s]*derivatives[s];
1456
}// end loop over 's'
1457
}// end loop over 'r'
1459
// Delete pointer to array of derivatives on FIAT element
1460
delete [] derivatives;
1462
// Delete pointer to array of combinations of derivatives and transform
1463
for (unsigned int r = 0; r < num_derivatives; r++)
1465
delete [] combinations[r];
1466
}// end loop over 'r'
1467
delete [] combinations;
1468
for (unsigned int r = 0; r < num_derivatives; r++)
1470
delete [] transform[r];
1471
}// end loop over 'r'
1472
delete [] transform;
1478
// Array of basisvalues.
1479
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
1481
// Declare helper variables.
1482
unsigned int rr = 0;
1483
unsigned int ss = 0;
1484
unsigned int tt = 0;
1485
double tmp5 = 0.000000000000000;
1486
double tmp6 = 0.000000000000000;
1487
double tmp7 = 0.000000000000000;
1488
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
1489
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
1490
double tmp2 = tmp1*tmp1;
1492
// Compute basisvalues.
1493
basisvalues[0] = 1.000000000000000;
1494
basisvalues[1] = tmp0;
1495
for (unsigned int r = 1; r < 2; r++)
1497
rr = (r + 1)*((r + 1) + 1)/2;
1499
tt = (r - 1)*((r - 1) + 1)/2;
1500
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
1501
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
1502
}// end loop over 'r'
1503
for (unsigned int r = 0; r < 2; r++)
1505
rr = (r + 1)*(r + 1 + 1)/2 + 1;
1507
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
1508
}// end loop over 'r'
1509
for (unsigned int r = 0; r < 1; r++)
1511
for (unsigned int s = 1; s < 2 - r; s++)
1513
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
1514
ss = (r + s)*(r + s + 1)/2 + s;
1515
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
1516
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1517
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1518
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1519
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
1520
}// end loop over 's'
1521
}// end loop over 'r'
1522
for (unsigned int r = 0; r < 3; r++)
1524
for (unsigned int s = 0; s < 3 - r; s++)
1526
rr = (r + s)*(r + s + 1)/2 + s;
1527
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
1528
}// end loop over 's'
1529
}// end loop over 'r'
1531
// Table(s) of coefficients.
1532
static const double coefficients0[6] = \
1533
{0.000000000000000, 0.000000000000000, 0.200000000000000, 0.000000000000000, 0.000000000000000, 0.163299316185545};
1535
// Tables of derivatives of the polynomial base (transpose).
1536
static const double dmats0[6][6] = \
1537
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1538
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1539
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1540
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1541
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1542
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1544
static const double dmats1[6][6] = \
1545
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1546
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1547
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1548
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1549
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1550
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1552
// Compute reference derivatives.
1553
// Declare pointer to array of derivatives on FIAT element.
1554
double *derivatives = new double[num_derivatives];
1555
for (unsigned int r = 0; r < num_derivatives; r++)
1557
derivatives[r] = 0.000000000000000;
1558
}// end loop over 'r'
1560
// Declare derivative matrix (of polynomial basis).
1561
double dmats[6][6] = \
1562
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1563
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1564
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1565
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1566
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1567
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1569
// Declare (auxiliary) derivative matrix (of polynomial basis).
1570
double dmats_old[6][6] = \
1571
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1572
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1573
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1574
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1575
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1576
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1578
// Loop possible derivatives.
1579
for (unsigned int r = 0; r < num_derivatives; r++)
1581
// Resetting dmats values to compute next derivative.
1582
for (unsigned int t = 0; t < 6; t++)
1584
for (unsigned int u = 0; u < 6; u++)
1586
dmats[t][u] = 0.000000000000000;
1589
dmats[t][u] = 1.000000000000000;
1592
}// end loop over 'u'
1593
}// end loop over 't'
1595
// Looping derivative order to generate dmats.
1596
for (unsigned int s = 0; s < n; s++)
1598
// Updating dmats_old with new values and resetting dmats.
1599
for (unsigned int t = 0; t < 6; t++)
1601
for (unsigned int u = 0; u < 6; u++)
1603
dmats_old[t][u] = dmats[t][u];
1604
dmats[t][u] = 0.000000000000000;
1605
}// end loop over 'u'
1606
}// end loop over 't'
1608
// Update dmats using an inner product.
1609
if (combinations[r][s] == 0)
1611
for (unsigned int t = 0; t < 6; t++)
1613
for (unsigned int u = 0; u < 6; u++)
1615
for (unsigned int tu = 0; tu < 6; tu++)
1617
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1618
}// end loop over 'tu'
1619
}// end loop over 'u'
1620
}// end loop over 't'
1623
if (combinations[r][s] == 1)
1625
for (unsigned int t = 0; t < 6; t++)
1627
for (unsigned int u = 0; u < 6; u++)
1629
for (unsigned int tu = 0; tu < 6; tu++)
1631
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1632
}// end loop over 'tu'
1633
}// end loop over 'u'
1634
}// end loop over 't'
1637
}// end loop over 's'
1638
for (unsigned int s = 0; s < 6; s++)
1640
for (unsigned int t = 0; t < 6; t++)
1642
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
1643
}// end loop over 't'
1644
}// end loop over 's'
1645
}// end loop over 'r'
1647
// Transform derivatives back to physical element
1648
for (unsigned int r = 0; r < num_derivatives; r++)
1650
for (unsigned int s = 0; s < num_derivatives; s++)
1652
values[r] += transform[r][s]*derivatives[s];
1653
}// end loop over 's'
1654
}// end loop over 'r'
1656
// Delete pointer to array of derivatives on FIAT element
1657
delete [] derivatives;
1659
// Delete pointer to array of combinations of derivatives and transform
1660
for (unsigned int r = 0; r < num_derivatives; r++)
1662
delete [] combinations[r];
1663
}// end loop over 'r'
1664
delete [] combinations;
1665
for (unsigned int r = 0; r < num_derivatives; r++)
1667
delete [] transform[r];
1668
}// end loop over 'r'
1669
delete [] transform;
1675
// Array of basisvalues.
1676
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
1678
// Declare helper variables.
1679
unsigned int rr = 0;
1680
unsigned int ss = 0;
1681
unsigned int tt = 0;
1682
double tmp5 = 0.000000000000000;
1683
double tmp6 = 0.000000000000000;
1684
double tmp7 = 0.000000000000000;
1685
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
1686
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
1687
double tmp2 = tmp1*tmp1;
1689
// Compute basisvalues.
1690
basisvalues[0] = 1.000000000000000;
1691
basisvalues[1] = tmp0;
1692
for (unsigned int r = 1; r < 2; r++)
1694
rr = (r + 1)*((r + 1) + 1)/2;
1696
tt = (r - 1)*((r - 1) + 1)/2;
1697
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
1698
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
1699
}// end loop over 'r'
1700
for (unsigned int r = 0; r < 2; r++)
1702
rr = (r + 1)*(r + 1 + 1)/2 + 1;
1704
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
1705
}// end loop over 'r'
1706
for (unsigned int r = 0; r < 1; r++)
1708
for (unsigned int s = 1; s < 2 - r; s++)
1710
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
1711
ss = (r + s)*(r + s + 1)/2 + s;
1712
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
1713
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1714
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1715
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1716
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
1717
}// end loop over 's'
1718
}// end loop over 'r'
1719
for (unsigned int r = 0; r < 3; r++)
1721
for (unsigned int s = 0; s < 3 - r; s++)
1723
rr = (r + s)*(r + s + 1)/2 + s;
1724
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
1725
}// end loop over 's'
1726
}// end loop over 'r'
1728
// Table(s) of coefficients.
1729
static const double coefficients0[6] = \
1730
{0.471404520791032, 0.230940107675850, 0.133333333333333, 0.000000000000000, 0.188561808316413, -0.163299316185545};
1732
// Tables of derivatives of the polynomial base (transpose).
1733
static const double dmats0[6][6] = \
1734
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1735
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1736
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1737
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1738
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1739
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1741
static const double dmats1[6][6] = \
1742
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1743
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1744
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1745
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1746
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1747
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1749
// Compute reference derivatives.
1750
// Declare pointer to array of derivatives on FIAT element.
1751
double *derivatives = new double[num_derivatives];
1752
for (unsigned int r = 0; r < num_derivatives; r++)
1754
derivatives[r] = 0.000000000000000;
1755
}// end loop over 'r'
1757
// Declare derivative matrix (of polynomial basis).
1758
double dmats[6][6] = \
1759
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1760
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1761
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1762
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1763
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1764
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1766
// Declare (auxiliary) derivative matrix (of polynomial basis).
1767
double dmats_old[6][6] = \
1768
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1769
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1770
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1771
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1772
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1773
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1775
// Loop possible derivatives.
1776
for (unsigned int r = 0; r < num_derivatives; r++)
1778
// Resetting dmats values to compute next derivative.
1779
for (unsigned int t = 0; t < 6; t++)
1781
for (unsigned int u = 0; u < 6; u++)
1783
dmats[t][u] = 0.000000000000000;
1786
dmats[t][u] = 1.000000000000000;
1789
}// end loop over 'u'
1790
}// end loop over 't'
1792
// Looping derivative order to generate dmats.
1793
for (unsigned int s = 0; s < n; s++)
1795
// Updating dmats_old with new values and resetting dmats.
1796
for (unsigned int t = 0; t < 6; t++)
1798
for (unsigned int u = 0; u < 6; u++)
1800
dmats_old[t][u] = dmats[t][u];
1801
dmats[t][u] = 0.000000000000000;
1802
}// end loop over 'u'
1803
}// end loop over 't'
1805
// Update dmats using an inner product.
1806
if (combinations[r][s] == 0)
1808
for (unsigned int t = 0; t < 6; t++)
1810
for (unsigned int u = 0; u < 6; u++)
1812
for (unsigned int tu = 0; tu < 6; tu++)
1814
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
1815
}// end loop over 'tu'
1816
}// end loop over 'u'
1817
}// end loop over 't'
1820
if (combinations[r][s] == 1)
1822
for (unsigned int t = 0; t < 6; t++)
1824
for (unsigned int u = 0; u < 6; u++)
1826
for (unsigned int tu = 0; tu < 6; tu++)
1828
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
1829
}// end loop over 'tu'
1830
}// end loop over 'u'
1831
}// end loop over 't'
1834
}// end loop over 's'
1835
for (unsigned int s = 0; s < 6; s++)
1837
for (unsigned int t = 0; t < 6; t++)
1839
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
1840
}// end loop over 't'
1841
}// end loop over 's'
1842
}// end loop over 'r'
1844
// Transform derivatives back to physical element
1845
for (unsigned int r = 0; r < num_derivatives; r++)
1847
for (unsigned int s = 0; s < num_derivatives; s++)
1849
values[r] += transform[r][s]*derivatives[s];
1850
}// end loop over 's'
1851
}// end loop over 'r'
1853
// Delete pointer to array of derivatives on FIAT element
1854
delete [] derivatives;
1856
// Delete pointer to array of combinations of derivatives and transform
1857
for (unsigned int r = 0; r < num_derivatives; r++)
1859
delete [] combinations[r];
1860
}// end loop over 'r'
1861
delete [] combinations;
1862
for (unsigned int r = 0; r < num_derivatives; r++)
1864
delete [] transform[r];
1865
}// end loop over 'r'
1866
delete [] transform;
1872
// Array of basisvalues.
1873
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
1875
// Declare helper variables.
1876
unsigned int rr = 0;
1877
unsigned int ss = 0;
1878
unsigned int tt = 0;
1879
double tmp5 = 0.000000000000000;
1880
double tmp6 = 0.000000000000000;
1881
double tmp7 = 0.000000000000000;
1882
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
1883
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
1884
double tmp2 = tmp1*tmp1;
1886
// Compute basisvalues.
1887
basisvalues[0] = 1.000000000000000;
1888
basisvalues[1] = tmp0;
1889
for (unsigned int r = 1; r < 2; r++)
1891
rr = (r + 1)*((r + 1) + 1)/2;
1893
tt = (r - 1)*((r - 1) + 1)/2;
1894
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
1895
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
1896
}// end loop over 'r'
1897
for (unsigned int r = 0; r < 2; r++)
1899
rr = (r + 1)*(r + 1 + 1)/2 + 1;
1901
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
1902
}// end loop over 'r'
1903
for (unsigned int r = 0; r < 1; r++)
1905
for (unsigned int s = 1; s < 2 - r; s++)
1907
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
1908
ss = (r + s)*(r + s + 1)/2 + s;
1909
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
1910
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1911
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1912
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
1913
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
1914
}// end loop over 's'
1915
}// end loop over 'r'
1916
for (unsigned int r = 0; r < 3; r++)
1918
for (unsigned int s = 0; s < 3 - r; s++)
1920
rr = (r + s)*(r + s + 1)/2 + s;
1921
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
1922
}// end loop over 's'
1923
}// end loop over 'r'
1925
// Table(s) of coefficients.
1926
static const double coefficients0[6] = \
1927
{0.471404520791032, -0.230940107675850, 0.133333333333333, 0.000000000000000, -0.188561808316413, -0.163299316185545};
1929
// Tables of derivatives of the polynomial base (transpose).
1930
static const double dmats0[6][6] = \
1931
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1932
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1933
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1934
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1935
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1936
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1938
static const double dmats1[6][6] = \
1939
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1940
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1941
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1942
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1943
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1944
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
1946
// Compute reference derivatives.
1947
// Declare pointer to array of derivatives on FIAT element.
1948
double *derivatives = new double[num_derivatives];
1949
for (unsigned int r = 0; r < num_derivatives; r++)
1951
derivatives[r] = 0.000000000000000;
1952
}// end loop over 'r'
1954
// Declare derivative matrix (of polynomial basis).
1955
double dmats[6][6] = \
1956
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1957
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1958
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1959
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1960
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1961
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1963
// Declare (auxiliary) derivative matrix (of polynomial basis).
1964
double dmats_old[6][6] = \
1965
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1966
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1967
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
1968
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
1969
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
1970
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
1972
// Loop possible derivatives.
1973
for (unsigned int r = 0; r < num_derivatives; r++)
1975
// Resetting dmats values to compute next derivative.
1976
for (unsigned int t = 0; t < 6; t++)
1978
for (unsigned int u = 0; u < 6; u++)
1980
dmats[t][u] = 0.000000000000000;
1983
dmats[t][u] = 1.000000000000000;
1986
}// end loop over 'u'
1987
}// end loop over 't'
1989
// Looping derivative order to generate dmats.
1990
for (unsigned int s = 0; s < n; s++)
1992
// Updating dmats_old with new values and resetting dmats.
1993
for (unsigned int t = 0; t < 6; t++)
1995
for (unsigned int u = 0; u < 6; u++)
1997
dmats_old[t][u] = dmats[t][u];
1998
dmats[t][u] = 0.000000000000000;
1999
}// end loop over 'u'
2000
}// end loop over 't'
2002
// Update dmats using an inner product.
2003
if (combinations[r][s] == 0)
2005
for (unsigned int t = 0; t < 6; t++)
2007
for (unsigned int u = 0; u < 6; u++)
2009
for (unsigned int tu = 0; tu < 6; tu++)
2011
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
2012
}// end loop over 'tu'
2013
}// end loop over 'u'
2014
}// end loop over 't'
2017
if (combinations[r][s] == 1)
2019
for (unsigned int t = 0; t < 6; t++)
2021
for (unsigned int u = 0; u < 6; u++)
2023
for (unsigned int tu = 0; tu < 6; tu++)
2025
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
2026
}// end loop over 'tu'
2027
}// end loop over 'u'
2028
}// end loop over 't'
2031
}// end loop over 's'
2032
for (unsigned int s = 0; s < 6; s++)
2034
for (unsigned int t = 0; t < 6; t++)
2036
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
2037
}// end loop over 't'
2038
}// end loop over 's'
2039
}// end loop over 'r'
2041
// Transform derivatives back to physical element
2042
for (unsigned int r = 0; r < num_derivatives; r++)
2044
for (unsigned int s = 0; s < num_derivatives; s++)
2046
values[r] += transform[r][s]*derivatives[s];
2047
}// end loop over 's'
2048
}// end loop over 'r'
2050
// Delete pointer to array of derivatives on FIAT element
2051
delete [] derivatives;
2053
// Delete pointer to array of combinations of derivatives and transform
2054
for (unsigned int r = 0; r < num_derivatives; r++)
2056
delete [] combinations[r];
2057
}// end loop over 'r'
2058
delete [] combinations;
2059
for (unsigned int r = 0; r < num_derivatives; r++)
2061
delete [] transform[r];
2062
}// end loop over 'r'
2063
delete [] transform;
2069
// Array of basisvalues.
2070
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2072
// Declare helper variables.
2073
unsigned int rr = 0;
2074
unsigned int ss = 0;
2075
unsigned int tt = 0;
2076
double tmp5 = 0.000000000000000;
2077
double tmp6 = 0.000000000000000;
2078
double tmp7 = 0.000000000000000;
2079
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2080
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2081
double tmp2 = tmp1*tmp1;
2083
// Compute basisvalues.
2084
basisvalues[0] = 1.000000000000000;
2085
basisvalues[1] = tmp0;
2086
for (unsigned int r = 1; r < 2; r++)
2088
rr = (r + 1)*((r + 1) + 1)/2;
2090
tt = (r - 1)*((r - 1) + 1)/2;
2091
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2092
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2093
}// end loop over 'r'
2094
for (unsigned int r = 0; r < 2; r++)
2096
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2098
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2099
}// end loop over 'r'
2100
for (unsigned int r = 0; r < 1; r++)
2102
for (unsigned int s = 1; s < 2 - r; s++)
2104
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2105
ss = (r + s)*(r + s + 1)/2 + s;
2106
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2107
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2108
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2109
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2110
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2111
}// end loop over 's'
2112
}// end loop over 'r'
2113
for (unsigned int r = 0; r < 3; r++)
2115
for (unsigned int s = 0; s < 3 - r; s++)
2117
rr = (r + s)*(r + s + 1)/2 + s;
2118
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2119
}// end loop over 's'
2120
}// end loop over 'r'
2122
// Table(s) of coefficients.
2123
static const double coefficients0[6] = \
2124
{0.471404520791032, 0.000000000000000, -0.266666666666667, -0.243432247780074, 0.000000000000000, 0.054433105395182};
2126
// Tables of derivatives of the polynomial base (transpose).
2127
static const double dmats0[6][6] = \
2128
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2129
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2130
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2131
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2132
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2133
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
2135
static const double dmats1[6][6] = \
2136
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2137
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2138
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2139
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2140
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2141
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
2143
// Compute reference derivatives.
2144
// Declare pointer to array of derivatives on FIAT element.
2145
double *derivatives = new double[num_derivatives];
2146
for (unsigned int r = 0; r < num_derivatives; r++)
2148
derivatives[r] = 0.000000000000000;
2149
}// end loop over 'r'
2151
// Declare derivative matrix (of polynomial basis).
2152
double dmats[6][6] = \
2153
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2154
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2155
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2156
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
2157
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
2158
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
2160
// Declare (auxiliary) derivative matrix (of polynomial basis).
2161
double dmats_old[6][6] = \
2162
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2163
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2164
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
2165
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
2166
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
2167
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
2169
// Loop possible derivatives.
2170
for (unsigned int r = 0; r < num_derivatives; r++)
2172
// Resetting dmats values to compute next derivative.
2173
for (unsigned int t = 0; t < 6; t++)
2175
for (unsigned int u = 0; u < 6; u++)
2177
dmats[t][u] = 0.000000000000000;
2180
dmats[t][u] = 1.000000000000000;
2183
}// end loop over 'u'
2184
}// end loop over 't'
2186
// Looping derivative order to generate dmats.
2187
for (unsigned int s = 0; s < n; s++)
2189
// Updating dmats_old with new values and resetting dmats.
2190
for (unsigned int t = 0; t < 6; t++)
2192
for (unsigned int u = 0; u < 6; u++)
2194
dmats_old[t][u] = dmats[t][u];
2195
dmats[t][u] = 0.000000000000000;
2196
}// end loop over 'u'
2197
}// end loop over 't'
2199
// Update dmats using an inner product.
2200
if (combinations[r][s] == 0)
2202
for (unsigned int t = 0; t < 6; t++)
2204
for (unsigned int u = 0; u < 6; u++)
2206
for (unsigned int tu = 0; tu < 6; tu++)
2208
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
2209
}// end loop over 'tu'
2210
}// end loop over 'u'
2211
}// end loop over 't'
2214
if (combinations[r][s] == 1)
2216
for (unsigned int t = 0; t < 6; t++)
2218
for (unsigned int u = 0; u < 6; u++)
2220
for (unsigned int tu = 0; tu < 6; tu++)
2222
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
2223
}// end loop over 'tu'
2224
}// end loop over 'u'
2225
}// end loop over 't'
2228
}// end loop over 's'
2229
for (unsigned int s = 0; s < 6; s++)
2231
for (unsigned int t = 0; t < 6; t++)
2233
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
2234
}// end loop over 't'
2235
}// end loop over 's'
2236
}// end loop over 'r'
2238
// Transform derivatives back to physical element
2239
for (unsigned int r = 0; r < num_derivatives; r++)
2241
for (unsigned int s = 0; s < num_derivatives; s++)
2243
values[r] += transform[r][s]*derivatives[s];
2244
}// end loop over 's'
2245
}// end loop over 'r'
2247
// Delete pointer to array of derivatives on FIAT element
2248
delete [] derivatives;
2250
// Delete pointer to array of combinations of derivatives and transform
2251
for (unsigned int r = 0; r < num_derivatives; r++)
2253
delete [] combinations[r];
2254
}// end loop over 'r'
2255
delete [] combinations;
2256
for (unsigned int r = 0; r < num_derivatives; r++)
2258
delete [] transform[r];
2259
}// end loop over 'r'
2260
delete [] transform;
2267
/// Evaluate order n derivatives of all basis functions at given point in cell
2268
virtual void evaluate_basis_derivatives_all(unsigned int n,
2270
const double* coordinates,
2271
const ufc::cell& c) const
2273
// Compute number of derivatives.
2274
unsigned int num_derivatives = 1;
2275
for (unsigned int r = 0; r < n; r++)
2277
num_derivatives *= 2;
2278
}// end loop over 'r'
2280
// Helper variable to hold values of a single dof.
2281
double *dof_values = new double[num_derivatives];
2282
for (unsigned int r = 0; r < num_derivatives; r++)
2284
dof_values[r] = 0.000000000000000;
2285
}// end loop over 'r'
2287
// Loop dofs and call evaluate_basis_derivatives.
2288
for (unsigned int r = 0; r < 6; r++)
2290
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
2291
for (unsigned int s = 0; s < num_derivatives; s++)
2293
values[r*num_derivatives + s] = dof_values[s];
2294
}// end loop over 's'
2295
}// end loop over 'r'
2298
delete [] dof_values;
2301
/// Evaluate linear functional for dof i on the function f
2302
virtual double evaluate_dof(unsigned int i,
2303
const ufc::function& f,
2304
const ufc::cell& c) const
2306
// Declare variables for result of evaluation.
2309
// Declare variable for physical coordinates.
2311
const double * const * x = c.coordinates;
2318
f.evaluate(vals, y, c);
2326
f.evaluate(vals, y, c);
2334
f.evaluate(vals, y, c);
2340
y[0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
2341
y[1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
2342
f.evaluate(vals, y, c);
2348
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
2349
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
2350
f.evaluate(vals, y, c);
2356
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
2357
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
2358
f.evaluate(vals, y, c);
2364
return 0.000000000000000;
2367
/// Evaluate linear functionals for all dofs on the function f
2368
virtual void evaluate_dofs(double* values,
2369
const ufc::function& f,
2370
const ufc::cell& c) const
2372
// Declare variables for result of evaluation.
2375
// Declare variable for physical coordinates.
2377
const double * const * x = c.coordinates;
2380
f.evaluate(vals, y, c);
2381
values[0] = vals[0];
2384
f.evaluate(vals, y, c);
2385
values[1] = vals[0];
2388
f.evaluate(vals, y, c);
2389
values[2] = vals[0];
2390
y[0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
2391
y[1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
2392
f.evaluate(vals, y, c);
2393
values[3] = vals[0];
2394
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
2395
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
2396
f.evaluate(vals, y, c);
2397
values[4] = vals[0];
2398
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
2399
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
2400
f.evaluate(vals, y, c);
2401
values[5] = vals[0];
2404
/// Interpolate vertex values from dof values
2405
virtual void interpolate_vertex_values(double* vertex_values,
2406
const double* dof_values,
2407
const ufc::cell& c) const
2409
// Evaluate function and change variables
2410
vertex_values[0] = dof_values[0];
2411
vertex_values[1] = dof_values[1];
2412
vertex_values[2] = dof_values[2];
2415
/// Map coordinate xhat from reference cell to coordinate x in cell
2416
virtual void map_from_reference_cell(double* x,
2420
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
2423
/// Map from coordinate x in cell to coordinate xhat in reference cell
2424
virtual void map_to_reference_cell(double* xhat,
2428
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
2431
/// Return the number of sub elements (for a mixed element)
2432
virtual unsigned int num_sub_elements() const
2437
/// Create a new finite element for sub element i (for a mixed element)
2438
virtual ufc::finite_element* create_sub_element(unsigned int i) const
2443
/// Create a new class instance
2444
virtual ufc::finite_element* create() const
2446
return new adaptivepoisson_finite_element_1();
2451
/// This class defines the interface for a finite element.
2453
class adaptivepoisson_finite_element_2: public ufc::finite_element
2458
adaptivepoisson_finite_element_2() : ufc::finite_element()
2464
virtual ~adaptivepoisson_finite_element_2()
2469
/// Return a string identifying the finite element
2470
virtual const char* signature() const
2472
return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2)";
2475
/// Return the cell shape
2476
virtual ufc::shape cell_shape() const
2478
return ufc::triangle;
2481
/// Return the topological dimension of the cell shape
2482
virtual unsigned int topological_dimension() const
2487
/// Return the geometric dimension of the cell shape
2488
virtual unsigned int geometric_dimension() const
2493
/// Return the dimension of the finite element function space
2494
virtual unsigned int space_dimension() const
2499
/// Return the rank of the value space
2500
virtual unsigned int value_rank() const
2505
/// Return the dimension of the value space for axis i
2506
virtual unsigned int value_dimension(unsigned int i) const
2511
/// Evaluate basis function i at given point in cell
2512
virtual void evaluate_basis(unsigned int i,
2514
const double* coordinates,
2515
const ufc::cell& c) const
2517
// Extract vertex coordinates
2518
const double * const * x = c.coordinates;
2520
// Compute Jacobian of affine map from reference cell
2521
const double J_00 = x[1][0] - x[0][0];
2522
const double J_01 = x[2][0] - x[0][0];
2523
const double J_10 = x[1][1] - x[0][1];
2524
const double J_11 = x[2][1] - x[0][1];
2526
// Compute determinant of Jacobian
2527
double detJ = J_00*J_11 - J_01*J_10;
2529
// Compute inverse of Jacobian
2531
// Compute constants
2532
const double C0 = x[1][0] + x[2][0];
2533
const double C1 = x[1][1] + x[2][1];
2535
// Get coordinates and map to the reference (FIAT) element
2536
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
2537
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
2540
*values = 0.000000000000000;
2546
// Array of basisvalues.
2547
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2549
// Declare helper variables.
2550
unsigned int rr = 0;
2551
unsigned int ss = 0;
2552
unsigned int tt = 0;
2553
double tmp5 = 0.000000000000000;
2554
double tmp6 = 0.000000000000000;
2555
double tmp7 = 0.000000000000000;
2556
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2557
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2558
double tmp2 = tmp1*tmp1;
2560
// Compute basisvalues.
2561
basisvalues[0] = 1.000000000000000;
2562
basisvalues[1] = tmp0;
2563
for (unsigned int r = 1; r < 2; r++)
2565
rr = (r + 1)*((r + 1) + 1)/2;
2567
tt = (r - 1)*((r - 1) + 1)/2;
2568
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2569
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2570
}// end loop over 'r'
2571
for (unsigned int r = 0; r < 2; r++)
2573
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2575
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2576
}// end loop over 'r'
2577
for (unsigned int r = 0; r < 1; r++)
2579
for (unsigned int s = 1; s < 2 - r; s++)
2581
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2582
ss = (r + s)*(r + s + 1)/2 + s;
2583
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2584
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2585
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2586
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2587
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2588
}// end loop over 's'
2589
}// end loop over 'r'
2590
for (unsigned int r = 0; r < 3; r++)
2592
for (unsigned int s = 0; s < 3 - r; s++)
2594
rr = (r + s)*(r + s + 1)/2 + s;
2595
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2596
}// end loop over 's'
2597
}// end loop over 'r'
2599
// Table(s) of coefficients.
2600
static const double coefficients0[6] = \
2601
{0.000000000000000, -0.173205080756888, -0.100000000000000, 0.121716123890037, 0.094280904158206, 0.054433105395182};
2603
// Compute value(s).
2604
for (unsigned int r = 0; r < 6; r++)
2606
*values += coefficients0[r]*basisvalues[r];
2607
}// end loop over 'r'
2613
// Array of basisvalues.
2614
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2616
// Declare helper variables.
2617
unsigned int rr = 0;
2618
unsigned int ss = 0;
2619
unsigned int tt = 0;
2620
double tmp5 = 0.000000000000000;
2621
double tmp6 = 0.000000000000000;
2622
double tmp7 = 0.000000000000000;
2623
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2624
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2625
double tmp2 = tmp1*tmp1;
2627
// Compute basisvalues.
2628
basisvalues[0] = 1.000000000000000;
2629
basisvalues[1] = tmp0;
2630
for (unsigned int r = 1; r < 2; r++)
2632
rr = (r + 1)*((r + 1) + 1)/2;
2634
tt = (r - 1)*((r - 1) + 1)/2;
2635
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2636
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2637
}// end loop over 'r'
2638
for (unsigned int r = 0; r < 2; r++)
2640
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2642
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2643
}// end loop over 'r'
2644
for (unsigned int r = 0; r < 1; r++)
2646
for (unsigned int s = 1; s < 2 - r; s++)
2648
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2649
ss = (r + s)*(r + s + 1)/2 + s;
2650
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2651
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2652
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2653
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2654
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2655
}// end loop over 's'
2656
}// end loop over 'r'
2657
for (unsigned int r = 0; r < 3; r++)
2659
for (unsigned int s = 0; s < 3 - r; s++)
2661
rr = (r + s)*(r + s + 1)/2 + s;
2662
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2663
}// end loop over 's'
2664
}// end loop over 'r'
2666
// Table(s) of coefficients.
2667
static const double coefficients0[6] = \
2668
{0.000000000000000, 0.173205080756888, -0.100000000000000, 0.121716123890037, -0.094280904158206, 0.054433105395182};
2670
// Compute value(s).
2671
for (unsigned int r = 0; r < 6; r++)
2673
*values += coefficients0[r]*basisvalues[r];
2674
}// end loop over 'r'
2680
// Array of basisvalues.
2681
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2683
// Declare helper variables.
2684
unsigned int rr = 0;
2685
unsigned int ss = 0;
2686
unsigned int tt = 0;
2687
double tmp5 = 0.000000000000000;
2688
double tmp6 = 0.000000000000000;
2689
double tmp7 = 0.000000000000000;
2690
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2691
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2692
double tmp2 = tmp1*tmp1;
2694
// Compute basisvalues.
2695
basisvalues[0] = 1.000000000000000;
2696
basisvalues[1] = tmp0;
2697
for (unsigned int r = 1; r < 2; r++)
2699
rr = (r + 1)*((r + 1) + 1)/2;
2701
tt = (r - 1)*((r - 1) + 1)/2;
2702
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2703
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2704
}// end loop over 'r'
2705
for (unsigned int r = 0; r < 2; r++)
2707
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2709
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2710
}// end loop over 'r'
2711
for (unsigned int r = 0; r < 1; r++)
2713
for (unsigned int s = 1; s < 2 - r; s++)
2715
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2716
ss = (r + s)*(r + s + 1)/2 + s;
2717
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2718
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2719
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2720
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2721
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2722
}// end loop over 's'
2723
}// end loop over 'r'
2724
for (unsigned int r = 0; r < 3; r++)
2726
for (unsigned int s = 0; s < 3 - r; s++)
2728
rr = (r + s)*(r + s + 1)/2 + s;
2729
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2730
}// end loop over 's'
2731
}// end loop over 'r'
2733
// Table(s) of coefficients.
2734
static const double coefficients0[6] = \
2735
{0.000000000000000, 0.000000000000000, 0.200000000000000, 0.000000000000000, 0.000000000000000, 0.163299316185545};
2737
// Compute value(s).
2738
for (unsigned int r = 0; r < 6; r++)
2740
*values += coefficients0[r]*basisvalues[r];
2741
}// end loop over 'r'
2747
// Array of basisvalues.
2748
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2750
// Declare helper variables.
2751
unsigned int rr = 0;
2752
unsigned int ss = 0;
2753
unsigned int tt = 0;
2754
double tmp5 = 0.000000000000000;
2755
double tmp6 = 0.000000000000000;
2756
double tmp7 = 0.000000000000000;
2757
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2758
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2759
double tmp2 = tmp1*tmp1;
2761
// Compute basisvalues.
2762
basisvalues[0] = 1.000000000000000;
2763
basisvalues[1] = tmp0;
2764
for (unsigned int r = 1; r < 2; r++)
2766
rr = (r + 1)*((r + 1) + 1)/2;
2768
tt = (r - 1)*((r - 1) + 1)/2;
2769
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2770
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2771
}// end loop over 'r'
2772
for (unsigned int r = 0; r < 2; r++)
2774
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2776
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2777
}// end loop over 'r'
2778
for (unsigned int r = 0; r < 1; r++)
2780
for (unsigned int s = 1; s < 2 - r; s++)
2782
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2783
ss = (r + s)*(r + s + 1)/2 + s;
2784
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2785
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2786
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2787
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2788
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2789
}// end loop over 's'
2790
}// end loop over 'r'
2791
for (unsigned int r = 0; r < 3; r++)
2793
for (unsigned int s = 0; s < 3 - r; s++)
2795
rr = (r + s)*(r + s + 1)/2 + s;
2796
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2797
}// end loop over 's'
2798
}// end loop over 'r'
2800
// Table(s) of coefficients.
2801
static const double coefficients0[6] = \
2802
{0.471404520791032, 0.230940107675850, 0.133333333333333, 0.000000000000000, 0.188561808316413, -0.163299316185545};
2804
// Compute value(s).
2805
for (unsigned int r = 0; r < 6; r++)
2807
*values += coefficients0[r]*basisvalues[r];
2808
}// end loop over 'r'
2814
// Array of basisvalues.
2815
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2817
// Declare helper variables.
2818
unsigned int rr = 0;
2819
unsigned int ss = 0;
2820
unsigned int tt = 0;
2821
double tmp5 = 0.000000000000000;
2822
double tmp6 = 0.000000000000000;
2823
double tmp7 = 0.000000000000000;
2824
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2825
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2826
double tmp2 = tmp1*tmp1;
2828
// Compute basisvalues.
2829
basisvalues[0] = 1.000000000000000;
2830
basisvalues[1] = tmp0;
2831
for (unsigned int r = 1; r < 2; r++)
2833
rr = (r + 1)*((r + 1) + 1)/2;
2835
tt = (r - 1)*((r - 1) + 1)/2;
2836
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2837
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2838
}// end loop over 'r'
2839
for (unsigned int r = 0; r < 2; r++)
2841
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2843
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2844
}// end loop over 'r'
2845
for (unsigned int r = 0; r < 1; r++)
2847
for (unsigned int s = 1; s < 2 - r; s++)
2849
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2850
ss = (r + s)*(r + s + 1)/2 + s;
2851
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2852
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2853
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2854
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2855
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2856
}// end loop over 's'
2857
}// end loop over 'r'
2858
for (unsigned int r = 0; r < 3; r++)
2860
for (unsigned int s = 0; s < 3 - r; s++)
2862
rr = (r + s)*(r + s + 1)/2 + s;
2863
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2864
}// end loop over 's'
2865
}// end loop over 'r'
2867
// Table(s) of coefficients.
2868
static const double coefficients0[6] = \
2869
{0.471404520791032, -0.230940107675850, 0.133333333333333, 0.000000000000000, -0.188561808316413, -0.163299316185545};
2871
// Compute value(s).
2872
for (unsigned int r = 0; r < 6; r++)
2874
*values += coefficients0[r]*basisvalues[r];
2875
}// end loop over 'r'
2881
// Array of basisvalues.
2882
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
2884
// Declare helper variables.
2885
unsigned int rr = 0;
2886
unsigned int ss = 0;
2887
unsigned int tt = 0;
2888
double tmp5 = 0.000000000000000;
2889
double tmp6 = 0.000000000000000;
2890
double tmp7 = 0.000000000000000;
2891
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
2892
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
2893
double tmp2 = tmp1*tmp1;
2895
// Compute basisvalues.
2896
basisvalues[0] = 1.000000000000000;
2897
basisvalues[1] = tmp0;
2898
for (unsigned int r = 1; r < 2; r++)
2900
rr = (r + 1)*((r + 1) + 1)/2;
2902
tt = (r - 1)*((r - 1) + 1)/2;
2903
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
2904
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
2905
}// end loop over 'r'
2906
for (unsigned int r = 0; r < 2; r++)
2908
rr = (r + 1)*(r + 1 + 1)/2 + 1;
2910
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
2911
}// end loop over 'r'
2912
for (unsigned int r = 0; r < 1; r++)
2914
for (unsigned int s = 1; s < 2 - r; s++)
2916
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
2917
ss = (r + s)*(r + s + 1)/2 + s;
2918
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
2919
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2920
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2921
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
2922
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
2923
}// end loop over 's'
2924
}// end loop over 'r'
2925
for (unsigned int r = 0; r < 3; r++)
2927
for (unsigned int s = 0; s < 3 - r; s++)
2929
rr = (r + s)*(r + s + 1)/2 + s;
2930
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
2931
}// end loop over 's'
2932
}// end loop over 'r'
2934
// Table(s) of coefficients.
2935
static const double coefficients0[6] = \
2936
{0.471404520791032, 0.000000000000000, -0.266666666666667, -0.243432247780074, 0.000000000000000, 0.054433105395182};
2938
// Compute value(s).
2939
for (unsigned int r = 0; r < 6; r++)
2941
*values += coefficients0[r]*basisvalues[r];
2942
}// end loop over 'r'
2949
/// Evaluate all basis functions at given point in cell
2950
virtual void evaluate_basis_all(double* values,
2951
const double* coordinates,
2952
const ufc::cell& c) const
2954
// Helper variable to hold values of a single dof.
2955
double dof_values = 0.000000000000000;
2957
// Loop dofs and call evaluate_basis.
2958
for (unsigned int r = 0; r < 6; r++)
2960
evaluate_basis(r, &dof_values, coordinates, c);
2961
values[r] = dof_values;
2962
}// end loop over 'r'
2965
/// Evaluate order n derivatives of basis function i at given point in cell
2966
virtual void evaluate_basis_derivatives(unsigned int i,
2969
const double* coordinates,
2970
const ufc::cell& c) const
2972
// Extract vertex coordinates
2973
const double * const * x = c.coordinates;
2975
// Compute Jacobian of affine map from reference cell
2976
const double J_00 = x[1][0] - x[0][0];
2977
const double J_01 = x[2][0] - x[0][0];
2978
const double J_10 = x[1][1] - x[0][1];
2979
const double J_11 = x[2][1] - x[0][1];
2981
// Compute determinant of Jacobian
2982
double detJ = J_00*J_11 - J_01*J_10;
2984
// Compute inverse of Jacobian
2985
const double K_00 = J_11 / detJ;
2986
const double K_01 = -J_01 / detJ;
2987
const double K_10 = -J_10 / detJ;
2988
const double K_11 = J_00 / detJ;
2990
// Compute constants
2991
const double C0 = x[1][0] + x[2][0];
2992
const double C1 = x[1][1] + x[2][1];
2994
// Get coordinates and map to the reference (FIAT) element
2995
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
2996
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
2998
// Compute number of derivatives.
2999
unsigned int num_derivatives = 1;
3000
for (unsigned int r = 0; r < n; r++)
3002
num_derivatives *= 2;
3003
}// end loop over 'r'
3005
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
3006
unsigned int **combinations = new unsigned int *[num_derivatives];
3007
for (unsigned int row = 0; row < num_derivatives; row++)
3009
combinations[row] = new unsigned int [n];
3010
for (unsigned int col = 0; col < n; col++)
3011
combinations[row][col] = 0;
3014
// Generate combinations of derivatives
3015
for (unsigned int row = 1; row < num_derivatives; row++)
3017
for (unsigned int num = 0; num < row; num++)
3019
for (unsigned int col = n-1; col+1 > 0; col--)
3021
if (combinations[row][col] + 1 > 1)
3022
combinations[row][col] = 0;
3025
combinations[row][col] += 1;
3032
// Compute inverse of Jacobian
3033
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
3035
// Declare transformation matrix
3036
// Declare pointer to two dimensional array and initialise
3037
double **transform = new double *[num_derivatives];
3039
for (unsigned int j = 0; j < num_derivatives; j++)
3041
transform[j] = new double [num_derivatives];
3042
for (unsigned int k = 0; k < num_derivatives; k++)
3043
transform[j][k] = 1;
3046
// Construct transformation matrix
3047
for (unsigned int row = 0; row < num_derivatives; row++)
3049
for (unsigned int col = 0; col < num_derivatives; col++)
3051
for (unsigned int k = 0; k < n; k++)
3052
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
3056
// Reset values. Assuming that values is always an array.
3057
for (unsigned int r = 0; r < num_derivatives; r++)
3059
values[r] = 0.000000000000000;
3060
}// end loop over 'r'
3067
// Array of basisvalues.
3068
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
3070
// Declare helper variables.
3071
unsigned int rr = 0;
3072
unsigned int ss = 0;
3073
unsigned int tt = 0;
3074
double tmp5 = 0.000000000000000;
3075
double tmp6 = 0.000000000000000;
3076
double tmp7 = 0.000000000000000;
3077
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
3078
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
3079
double tmp2 = tmp1*tmp1;
3081
// Compute basisvalues.
3082
basisvalues[0] = 1.000000000000000;
3083
basisvalues[1] = tmp0;
3084
for (unsigned int r = 1; r < 2; r++)
3086
rr = (r + 1)*((r + 1) + 1)/2;
3088
tt = (r - 1)*((r - 1) + 1)/2;
3089
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
3090
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
3091
}// end loop over 'r'
3092
for (unsigned int r = 0; r < 2; r++)
3094
rr = (r + 1)*(r + 1 + 1)/2 + 1;
3096
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
3097
}// end loop over 'r'
3098
for (unsigned int r = 0; r < 1; r++)
3100
for (unsigned int s = 1; s < 2 - r; s++)
3102
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
3103
ss = (r + s)*(r + s + 1)/2 + s;
3104
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
3105
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3106
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3107
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3108
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
3109
}// end loop over 's'
3110
}// end loop over 'r'
3111
for (unsigned int r = 0; r < 3; r++)
3113
for (unsigned int s = 0; s < 3 - r; s++)
3115
rr = (r + s)*(r + s + 1)/2 + s;
3116
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
3117
}// end loop over 's'
3118
}// end loop over 'r'
3120
// Table(s) of coefficients.
3121
static const double coefficients0[6] = \
3122
{0.000000000000000, -0.173205080756888, -0.100000000000000, 0.121716123890037, 0.094280904158206, 0.054433105395182};
3124
// Tables of derivatives of the polynomial base (transpose).
3125
static const double dmats0[6][6] = \
3126
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3127
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3128
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3129
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3130
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3131
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3133
static const double dmats1[6][6] = \
3134
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3135
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3136
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3137
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3138
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3139
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3141
// Compute reference derivatives.
3142
// Declare pointer to array of derivatives on FIAT element.
3143
double *derivatives = new double[num_derivatives];
3144
for (unsigned int r = 0; r < num_derivatives; r++)
3146
derivatives[r] = 0.000000000000000;
3147
}// end loop over 'r'
3149
// Declare derivative matrix (of polynomial basis).
3150
double dmats[6][6] = \
3151
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3152
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3153
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3154
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3155
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3156
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3158
// Declare (auxiliary) derivative matrix (of polynomial basis).
3159
double dmats_old[6][6] = \
3160
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3161
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3162
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3163
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3164
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3165
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3167
// Loop possible derivatives.
3168
for (unsigned int r = 0; r < num_derivatives; r++)
3170
// Resetting dmats values to compute next derivative.
3171
for (unsigned int t = 0; t < 6; t++)
3173
for (unsigned int u = 0; u < 6; u++)
3175
dmats[t][u] = 0.000000000000000;
3178
dmats[t][u] = 1.000000000000000;
3181
}// end loop over 'u'
3182
}// end loop over 't'
3184
// Looping derivative order to generate dmats.
3185
for (unsigned int s = 0; s < n; s++)
3187
// Updating dmats_old with new values and resetting dmats.
3188
for (unsigned int t = 0; t < 6; t++)
3190
for (unsigned int u = 0; u < 6; u++)
3192
dmats_old[t][u] = dmats[t][u];
3193
dmats[t][u] = 0.000000000000000;
3194
}// end loop over 'u'
3195
}// end loop over 't'
3197
// Update dmats using an inner product.
3198
if (combinations[r][s] == 0)
3200
for (unsigned int t = 0; t < 6; t++)
3202
for (unsigned int u = 0; u < 6; u++)
3204
for (unsigned int tu = 0; tu < 6; tu++)
3206
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3207
}// end loop over 'tu'
3208
}// end loop over 'u'
3209
}// end loop over 't'
3212
if (combinations[r][s] == 1)
3214
for (unsigned int t = 0; t < 6; t++)
3216
for (unsigned int u = 0; u < 6; u++)
3218
for (unsigned int tu = 0; tu < 6; tu++)
3220
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3221
}// end loop over 'tu'
3222
}// end loop over 'u'
3223
}// end loop over 't'
3226
}// end loop over 's'
3227
for (unsigned int s = 0; s < 6; s++)
3229
for (unsigned int t = 0; t < 6; t++)
3231
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
3232
}// end loop over 't'
3233
}// end loop over 's'
3234
}// end loop over 'r'
3236
// Transform derivatives back to physical element
3237
for (unsigned int r = 0; r < num_derivatives; r++)
3239
for (unsigned int s = 0; s < num_derivatives; s++)
3241
values[r] += transform[r][s]*derivatives[s];
3242
}// end loop over 's'
3243
}// end loop over 'r'
3245
// Delete pointer to array of derivatives on FIAT element
3246
delete [] derivatives;
3248
// Delete pointer to array of combinations of derivatives and transform
3249
for (unsigned int r = 0; r < num_derivatives; r++)
3251
delete [] combinations[r];
3252
}// end loop over 'r'
3253
delete [] combinations;
3254
for (unsigned int r = 0; r < num_derivatives; r++)
3256
delete [] transform[r];
3257
}// end loop over 'r'
3258
delete [] transform;
3264
// Array of basisvalues.
3265
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
3267
// Declare helper variables.
3268
unsigned int rr = 0;
3269
unsigned int ss = 0;
3270
unsigned int tt = 0;
3271
double tmp5 = 0.000000000000000;
3272
double tmp6 = 0.000000000000000;
3273
double tmp7 = 0.000000000000000;
3274
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
3275
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
3276
double tmp2 = tmp1*tmp1;
3278
// Compute basisvalues.
3279
basisvalues[0] = 1.000000000000000;
3280
basisvalues[1] = tmp0;
3281
for (unsigned int r = 1; r < 2; r++)
3283
rr = (r + 1)*((r + 1) + 1)/2;
3285
tt = (r - 1)*((r - 1) + 1)/2;
3286
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
3287
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
3288
}// end loop over 'r'
3289
for (unsigned int r = 0; r < 2; r++)
3291
rr = (r + 1)*(r + 1 + 1)/2 + 1;
3293
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
3294
}// end loop over 'r'
3295
for (unsigned int r = 0; r < 1; r++)
3297
for (unsigned int s = 1; s < 2 - r; s++)
3299
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
3300
ss = (r + s)*(r + s + 1)/2 + s;
3301
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
3302
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3303
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3304
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3305
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
3306
}// end loop over 's'
3307
}// end loop over 'r'
3308
for (unsigned int r = 0; r < 3; r++)
3310
for (unsigned int s = 0; s < 3 - r; s++)
3312
rr = (r + s)*(r + s + 1)/2 + s;
3313
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
3314
}// end loop over 's'
3315
}// end loop over 'r'
3317
// Table(s) of coefficients.
3318
static const double coefficients0[6] = \
3319
{0.000000000000000, 0.173205080756888, -0.100000000000000, 0.121716123890037, -0.094280904158206, 0.054433105395182};
3321
// Tables of derivatives of the polynomial base (transpose).
3322
static const double dmats0[6][6] = \
3323
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3324
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3325
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3326
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3327
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3328
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3330
static const double dmats1[6][6] = \
3331
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3332
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3333
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3334
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3335
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3336
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3338
// Compute reference derivatives.
3339
// Declare pointer to array of derivatives on FIAT element.
3340
double *derivatives = new double[num_derivatives];
3341
for (unsigned int r = 0; r < num_derivatives; r++)
3343
derivatives[r] = 0.000000000000000;
3344
}// end loop over 'r'
3346
// Declare derivative matrix (of polynomial basis).
3347
double dmats[6][6] = \
3348
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3349
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3350
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3351
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3352
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3353
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3355
// Declare (auxiliary) derivative matrix (of polynomial basis).
3356
double dmats_old[6][6] = \
3357
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3358
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3359
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3360
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3361
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3362
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3364
// Loop possible derivatives.
3365
for (unsigned int r = 0; r < num_derivatives; r++)
3367
// Resetting dmats values to compute next derivative.
3368
for (unsigned int t = 0; t < 6; t++)
3370
for (unsigned int u = 0; u < 6; u++)
3372
dmats[t][u] = 0.000000000000000;
3375
dmats[t][u] = 1.000000000000000;
3378
}// end loop over 'u'
3379
}// end loop over 't'
3381
// Looping derivative order to generate dmats.
3382
for (unsigned int s = 0; s < n; s++)
3384
// Updating dmats_old with new values and resetting dmats.
3385
for (unsigned int t = 0; t < 6; t++)
3387
for (unsigned int u = 0; u < 6; u++)
3389
dmats_old[t][u] = dmats[t][u];
3390
dmats[t][u] = 0.000000000000000;
3391
}// end loop over 'u'
3392
}// end loop over 't'
3394
// Update dmats using an inner product.
3395
if (combinations[r][s] == 0)
3397
for (unsigned int t = 0; t < 6; t++)
3399
for (unsigned int u = 0; u < 6; u++)
3401
for (unsigned int tu = 0; tu < 6; tu++)
3403
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3404
}// end loop over 'tu'
3405
}// end loop over 'u'
3406
}// end loop over 't'
3409
if (combinations[r][s] == 1)
3411
for (unsigned int t = 0; t < 6; t++)
3413
for (unsigned int u = 0; u < 6; u++)
3415
for (unsigned int tu = 0; tu < 6; tu++)
3417
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3418
}// end loop over 'tu'
3419
}// end loop over 'u'
3420
}// end loop over 't'
3423
}// end loop over 's'
3424
for (unsigned int s = 0; s < 6; s++)
3426
for (unsigned int t = 0; t < 6; t++)
3428
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
3429
}// end loop over 't'
3430
}// end loop over 's'
3431
}// end loop over 'r'
3433
// Transform derivatives back to physical element
3434
for (unsigned int r = 0; r < num_derivatives; r++)
3436
for (unsigned int s = 0; s < num_derivatives; s++)
3438
values[r] += transform[r][s]*derivatives[s];
3439
}// end loop over 's'
3440
}// end loop over 'r'
3442
// Delete pointer to array of derivatives on FIAT element
3443
delete [] derivatives;
3445
// Delete pointer to array of combinations of derivatives and transform
3446
for (unsigned int r = 0; r < num_derivatives; r++)
3448
delete [] combinations[r];
3449
}// end loop over 'r'
3450
delete [] combinations;
3451
for (unsigned int r = 0; r < num_derivatives; r++)
3453
delete [] transform[r];
3454
}// end loop over 'r'
3455
delete [] transform;
3461
// Array of basisvalues.
3462
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
3464
// Declare helper variables.
3465
unsigned int rr = 0;
3466
unsigned int ss = 0;
3467
unsigned int tt = 0;
3468
double tmp5 = 0.000000000000000;
3469
double tmp6 = 0.000000000000000;
3470
double tmp7 = 0.000000000000000;
3471
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
3472
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
3473
double tmp2 = tmp1*tmp1;
3475
// Compute basisvalues.
3476
basisvalues[0] = 1.000000000000000;
3477
basisvalues[1] = tmp0;
3478
for (unsigned int r = 1; r < 2; r++)
3480
rr = (r + 1)*((r + 1) + 1)/2;
3482
tt = (r - 1)*((r - 1) + 1)/2;
3483
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
3484
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
3485
}// end loop over 'r'
3486
for (unsigned int r = 0; r < 2; r++)
3488
rr = (r + 1)*(r + 1 + 1)/2 + 1;
3490
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
3491
}// end loop over 'r'
3492
for (unsigned int r = 0; r < 1; r++)
3494
for (unsigned int s = 1; s < 2 - r; s++)
3496
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
3497
ss = (r + s)*(r + s + 1)/2 + s;
3498
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
3499
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3500
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3501
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3502
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
3503
}// end loop over 's'
3504
}// end loop over 'r'
3505
for (unsigned int r = 0; r < 3; r++)
3507
for (unsigned int s = 0; s < 3 - r; s++)
3509
rr = (r + s)*(r + s + 1)/2 + s;
3510
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
3511
}// end loop over 's'
3512
}// end loop over 'r'
3514
// Table(s) of coefficients.
3515
static const double coefficients0[6] = \
3516
{0.000000000000000, 0.000000000000000, 0.200000000000000, 0.000000000000000, 0.000000000000000, 0.163299316185545};
3518
// Tables of derivatives of the polynomial base (transpose).
3519
static const double dmats0[6][6] = \
3520
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3521
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3522
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3523
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3524
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3525
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3527
static const double dmats1[6][6] = \
3528
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3529
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3530
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3531
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3532
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3533
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3535
// Compute reference derivatives.
3536
// Declare pointer to array of derivatives on FIAT element.
3537
double *derivatives = new double[num_derivatives];
3538
for (unsigned int r = 0; r < num_derivatives; r++)
3540
derivatives[r] = 0.000000000000000;
3541
}// end loop over 'r'
3543
// Declare derivative matrix (of polynomial basis).
3544
double dmats[6][6] = \
3545
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3546
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3547
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3548
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3549
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3550
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3552
// Declare (auxiliary) derivative matrix (of polynomial basis).
3553
double dmats_old[6][6] = \
3554
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3555
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3556
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3557
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3558
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3559
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3561
// Loop possible derivatives.
3562
for (unsigned int r = 0; r < num_derivatives; r++)
3564
// Resetting dmats values to compute next derivative.
3565
for (unsigned int t = 0; t < 6; t++)
3567
for (unsigned int u = 0; u < 6; u++)
3569
dmats[t][u] = 0.000000000000000;
3572
dmats[t][u] = 1.000000000000000;
3575
}// end loop over 'u'
3576
}// end loop over 't'
3578
// Looping derivative order to generate dmats.
3579
for (unsigned int s = 0; s < n; s++)
3581
// Updating dmats_old with new values and resetting dmats.
3582
for (unsigned int t = 0; t < 6; t++)
3584
for (unsigned int u = 0; u < 6; u++)
3586
dmats_old[t][u] = dmats[t][u];
3587
dmats[t][u] = 0.000000000000000;
3588
}// end loop over 'u'
3589
}// end loop over 't'
3591
// Update dmats using an inner product.
3592
if (combinations[r][s] == 0)
3594
for (unsigned int t = 0; t < 6; t++)
3596
for (unsigned int u = 0; u < 6; u++)
3598
for (unsigned int tu = 0; tu < 6; tu++)
3600
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3601
}// end loop over 'tu'
3602
}// end loop over 'u'
3603
}// end loop over 't'
3606
if (combinations[r][s] == 1)
3608
for (unsigned int t = 0; t < 6; t++)
3610
for (unsigned int u = 0; u < 6; u++)
3612
for (unsigned int tu = 0; tu < 6; tu++)
3614
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3615
}// end loop over 'tu'
3616
}// end loop over 'u'
3617
}// end loop over 't'
3620
}// end loop over 's'
3621
for (unsigned int s = 0; s < 6; s++)
3623
for (unsigned int t = 0; t < 6; t++)
3625
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
3626
}// end loop over 't'
3627
}// end loop over 's'
3628
}// end loop over 'r'
3630
// Transform derivatives back to physical element
3631
for (unsigned int r = 0; r < num_derivatives; r++)
3633
for (unsigned int s = 0; s < num_derivatives; s++)
3635
values[r] += transform[r][s]*derivatives[s];
3636
}// end loop over 's'
3637
}// end loop over 'r'
3639
// Delete pointer to array of derivatives on FIAT element
3640
delete [] derivatives;
3642
// Delete pointer to array of combinations of derivatives and transform
3643
for (unsigned int r = 0; r < num_derivatives; r++)
3645
delete [] combinations[r];
3646
}// end loop over 'r'
3647
delete [] combinations;
3648
for (unsigned int r = 0; r < num_derivatives; r++)
3650
delete [] transform[r];
3651
}// end loop over 'r'
3652
delete [] transform;
3658
// Array of basisvalues.
3659
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
3661
// Declare helper variables.
3662
unsigned int rr = 0;
3663
unsigned int ss = 0;
3664
unsigned int tt = 0;
3665
double tmp5 = 0.000000000000000;
3666
double tmp6 = 0.000000000000000;
3667
double tmp7 = 0.000000000000000;
3668
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
3669
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
3670
double tmp2 = tmp1*tmp1;
3672
// Compute basisvalues.
3673
basisvalues[0] = 1.000000000000000;
3674
basisvalues[1] = tmp0;
3675
for (unsigned int r = 1; r < 2; r++)
3677
rr = (r + 1)*((r + 1) + 1)/2;
3679
tt = (r - 1)*((r - 1) + 1)/2;
3680
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
3681
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
3682
}// end loop over 'r'
3683
for (unsigned int r = 0; r < 2; r++)
3685
rr = (r + 1)*(r + 1 + 1)/2 + 1;
3687
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
3688
}// end loop over 'r'
3689
for (unsigned int r = 0; r < 1; r++)
3691
for (unsigned int s = 1; s < 2 - r; s++)
3693
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
3694
ss = (r + s)*(r + s + 1)/2 + s;
3695
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
3696
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3697
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3698
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3699
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
3700
}// end loop over 's'
3701
}// end loop over 'r'
3702
for (unsigned int r = 0; r < 3; r++)
3704
for (unsigned int s = 0; s < 3 - r; s++)
3706
rr = (r + s)*(r + s + 1)/2 + s;
3707
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
3708
}// end loop over 's'
3709
}// end loop over 'r'
3711
// Table(s) of coefficients.
3712
static const double coefficients0[6] = \
3713
{0.471404520791032, 0.230940107675850, 0.133333333333333, 0.000000000000000, 0.188561808316413, -0.163299316185545};
3715
// Tables of derivatives of the polynomial base (transpose).
3716
static const double dmats0[6][6] = \
3717
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3718
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3719
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3720
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3721
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3722
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3724
static const double dmats1[6][6] = \
3725
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3726
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3727
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3728
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3729
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3730
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3732
// Compute reference derivatives.
3733
// Declare pointer to array of derivatives on FIAT element.
3734
double *derivatives = new double[num_derivatives];
3735
for (unsigned int r = 0; r < num_derivatives; r++)
3737
derivatives[r] = 0.000000000000000;
3738
}// end loop over 'r'
3740
// Declare derivative matrix (of polynomial basis).
3741
double dmats[6][6] = \
3742
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3743
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3744
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3745
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3746
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3747
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3749
// Declare (auxiliary) derivative matrix (of polynomial basis).
3750
double dmats_old[6][6] = \
3751
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3752
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3753
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3754
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3755
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3756
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3758
// Loop possible derivatives.
3759
for (unsigned int r = 0; r < num_derivatives; r++)
3761
// Resetting dmats values to compute next derivative.
3762
for (unsigned int t = 0; t < 6; t++)
3764
for (unsigned int u = 0; u < 6; u++)
3766
dmats[t][u] = 0.000000000000000;
3769
dmats[t][u] = 1.000000000000000;
3772
}// end loop over 'u'
3773
}// end loop over 't'
3775
// Looping derivative order to generate dmats.
3776
for (unsigned int s = 0; s < n; s++)
3778
// Updating dmats_old with new values and resetting dmats.
3779
for (unsigned int t = 0; t < 6; t++)
3781
for (unsigned int u = 0; u < 6; u++)
3783
dmats_old[t][u] = dmats[t][u];
3784
dmats[t][u] = 0.000000000000000;
3785
}// end loop over 'u'
3786
}// end loop over 't'
3788
// Update dmats using an inner product.
3789
if (combinations[r][s] == 0)
3791
for (unsigned int t = 0; t < 6; t++)
3793
for (unsigned int u = 0; u < 6; u++)
3795
for (unsigned int tu = 0; tu < 6; tu++)
3797
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3798
}// end loop over 'tu'
3799
}// end loop over 'u'
3800
}// end loop over 't'
3803
if (combinations[r][s] == 1)
3805
for (unsigned int t = 0; t < 6; t++)
3807
for (unsigned int u = 0; u < 6; u++)
3809
for (unsigned int tu = 0; tu < 6; tu++)
3811
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
3812
}// end loop over 'tu'
3813
}// end loop over 'u'
3814
}// end loop over 't'
3817
}// end loop over 's'
3818
for (unsigned int s = 0; s < 6; s++)
3820
for (unsigned int t = 0; t < 6; t++)
3822
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
3823
}// end loop over 't'
3824
}// end loop over 's'
3825
}// end loop over 'r'
3827
// Transform derivatives back to physical element
3828
for (unsigned int r = 0; r < num_derivatives; r++)
3830
for (unsigned int s = 0; s < num_derivatives; s++)
3832
values[r] += transform[r][s]*derivatives[s];
3833
}// end loop over 's'
3834
}// end loop over 'r'
3836
// Delete pointer to array of derivatives on FIAT element
3837
delete [] derivatives;
3839
// Delete pointer to array of combinations of derivatives and transform
3840
for (unsigned int r = 0; r < num_derivatives; r++)
3842
delete [] combinations[r];
3843
}// end loop over 'r'
3844
delete [] combinations;
3845
for (unsigned int r = 0; r < num_derivatives; r++)
3847
delete [] transform[r];
3848
}// end loop over 'r'
3849
delete [] transform;
3855
// Array of basisvalues.
3856
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
3858
// Declare helper variables.
3859
unsigned int rr = 0;
3860
unsigned int ss = 0;
3861
unsigned int tt = 0;
3862
double tmp5 = 0.000000000000000;
3863
double tmp6 = 0.000000000000000;
3864
double tmp7 = 0.000000000000000;
3865
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
3866
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
3867
double tmp2 = tmp1*tmp1;
3869
// Compute basisvalues.
3870
basisvalues[0] = 1.000000000000000;
3871
basisvalues[1] = tmp0;
3872
for (unsigned int r = 1; r < 2; r++)
3874
rr = (r + 1)*((r + 1) + 1)/2;
3876
tt = (r - 1)*((r - 1) + 1)/2;
3877
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
3878
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
3879
}// end loop over 'r'
3880
for (unsigned int r = 0; r < 2; r++)
3882
rr = (r + 1)*(r + 1 + 1)/2 + 1;
3884
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
3885
}// end loop over 'r'
3886
for (unsigned int r = 0; r < 1; r++)
3888
for (unsigned int s = 1; s < 2 - r; s++)
3890
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
3891
ss = (r + s)*(r + s + 1)/2 + s;
3892
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
3893
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3894
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3895
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
3896
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
3897
}// end loop over 's'
3898
}// end loop over 'r'
3899
for (unsigned int r = 0; r < 3; r++)
3901
for (unsigned int s = 0; s < 3 - r; s++)
3903
rr = (r + s)*(r + s + 1)/2 + s;
3904
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
3905
}// end loop over 's'
3906
}// end loop over 'r'
3908
// Table(s) of coefficients.
3909
static const double coefficients0[6] = \
3910
{0.471404520791032, -0.230940107675850, 0.133333333333333, 0.000000000000000, -0.188561808316413, -0.163299316185545};
3912
// Tables of derivatives of the polynomial base (transpose).
3913
static const double dmats0[6][6] = \
3914
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3915
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3916
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3917
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3918
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3919
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3921
static const double dmats1[6][6] = \
3922
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3923
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3924
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3925
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3926
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3927
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
3929
// Compute reference derivatives.
3930
// Declare pointer to array of derivatives on FIAT element.
3931
double *derivatives = new double[num_derivatives];
3932
for (unsigned int r = 0; r < num_derivatives; r++)
3934
derivatives[r] = 0.000000000000000;
3935
}// end loop over 'r'
3937
// Declare derivative matrix (of polynomial basis).
3938
double dmats[6][6] = \
3939
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3940
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3941
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3942
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3943
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3944
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3946
// Declare (auxiliary) derivative matrix (of polynomial basis).
3947
double dmats_old[6][6] = \
3948
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3949
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3950
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
3951
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
3952
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
3953
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
3955
// Loop possible derivatives.
3956
for (unsigned int r = 0; r < num_derivatives; r++)
3958
// Resetting dmats values to compute next derivative.
3959
for (unsigned int t = 0; t < 6; t++)
3961
for (unsigned int u = 0; u < 6; u++)
3963
dmats[t][u] = 0.000000000000000;
3966
dmats[t][u] = 1.000000000000000;
3969
}// end loop over 'u'
3970
}// end loop over 't'
3972
// Looping derivative order to generate dmats.
3973
for (unsigned int s = 0; s < n; s++)
3975
// Updating dmats_old with new values and resetting dmats.
3976
for (unsigned int t = 0; t < 6; t++)
3978
for (unsigned int u = 0; u < 6; u++)
3980
dmats_old[t][u] = dmats[t][u];
3981
dmats[t][u] = 0.000000000000000;
3982
}// end loop over 'u'
3983
}// end loop over 't'
3985
// Update dmats using an inner product.
3986
if (combinations[r][s] == 0)
3988
for (unsigned int t = 0; t < 6; t++)
3990
for (unsigned int u = 0; u < 6; u++)
3992
for (unsigned int tu = 0; tu < 6; tu++)
3994
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
3995
}// end loop over 'tu'
3996
}// end loop over 'u'
3997
}// end loop over 't'
4000
if (combinations[r][s] == 1)
4002
for (unsigned int t = 0; t < 6; t++)
4004
for (unsigned int u = 0; u < 6; u++)
4006
for (unsigned int tu = 0; tu < 6; tu++)
4008
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
4009
}// end loop over 'tu'
4010
}// end loop over 'u'
4011
}// end loop over 't'
4014
}// end loop over 's'
4015
for (unsigned int s = 0; s < 6; s++)
4017
for (unsigned int t = 0; t < 6; t++)
4019
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
4020
}// end loop over 't'
4021
}// end loop over 's'
4022
}// end loop over 'r'
4024
// Transform derivatives back to physical element
4025
for (unsigned int r = 0; r < num_derivatives; r++)
4027
for (unsigned int s = 0; s < num_derivatives; s++)
4029
values[r] += transform[r][s]*derivatives[s];
4030
}// end loop over 's'
4031
}// end loop over 'r'
4033
// Delete pointer to array of derivatives on FIAT element
4034
delete [] derivatives;
4036
// Delete pointer to array of combinations of derivatives and transform
4037
for (unsigned int r = 0; r < num_derivatives; r++)
4039
delete [] combinations[r];
4040
}// end loop over 'r'
4041
delete [] combinations;
4042
for (unsigned int r = 0; r < num_derivatives; r++)
4044
delete [] transform[r];
4045
}// end loop over 'r'
4046
delete [] transform;
4052
// Array of basisvalues.
4053
double basisvalues[6] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
4055
// Declare helper variables.
4056
unsigned int rr = 0;
4057
unsigned int ss = 0;
4058
unsigned int tt = 0;
4059
double tmp5 = 0.000000000000000;
4060
double tmp6 = 0.000000000000000;
4061
double tmp7 = 0.000000000000000;
4062
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
4063
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
4064
double tmp2 = tmp1*tmp1;
4066
// Compute basisvalues.
4067
basisvalues[0] = 1.000000000000000;
4068
basisvalues[1] = tmp0;
4069
for (unsigned int r = 1; r < 2; r++)
4071
rr = (r + 1)*((r + 1) + 1)/2;
4073
tt = (r - 1)*((r - 1) + 1)/2;
4074
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
4075
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
4076
}// end loop over 'r'
4077
for (unsigned int r = 0; r < 2; r++)
4079
rr = (r + 1)*(r + 1 + 1)/2 + 1;
4081
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
4082
}// end loop over 'r'
4083
for (unsigned int r = 0; r < 1; r++)
4085
for (unsigned int s = 1; s < 2 - r; s++)
4087
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
4088
ss = (r + s)*(r + s + 1)/2 + s;
4089
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
4090
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4091
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4092
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4093
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
4094
}// end loop over 's'
4095
}// end loop over 'r'
4096
for (unsigned int r = 0; r < 3; r++)
4098
for (unsigned int s = 0; s < 3 - r; s++)
4100
rr = (r + s)*(r + s + 1)/2 + s;
4101
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
4102
}// end loop over 's'
4103
}// end loop over 'r'
4105
// Table(s) of coefficients.
4106
static const double coefficients0[6] = \
4107
{0.471404520791032, 0.000000000000000, -0.266666666666667, -0.243432247780074, 0.000000000000000, 0.054433105395182};
4109
// Tables of derivatives of the polynomial base (transpose).
4110
static const double dmats0[6][6] = \
4111
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4112
{4.898979485566355, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4113
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4114
{0.000000000000000, 9.486832980505138, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4115
{3.999999999999999, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4116
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
4118
static const double dmats1[6][6] = \
4119
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4120
{2.449489742783177, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4121
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4122
{2.581988897471611, 4.743416490252570, -0.912870929175278, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4123
{1.999999999999999, 6.123724356957944, 3.535533905932737, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4124
{-2.309401076758502, 0.000000000000000, 8.164965809277259, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
4126
// Compute reference derivatives.
4127
// Declare pointer to array of derivatives on FIAT element.
4128
double *derivatives = new double[num_derivatives];
4129
for (unsigned int r = 0; r < num_derivatives; r++)
4131
derivatives[r] = 0.000000000000000;
4132
}// end loop over 'r'
4134
// Declare derivative matrix (of polynomial basis).
4135
double dmats[6][6] = \
4136
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4137
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4138
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4139
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
4140
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
4141
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
4143
// Declare (auxiliary) derivative matrix (of polynomial basis).
4144
double dmats_old[6][6] = \
4145
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4146
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4147
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4148
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
4149
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
4150
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
4152
// Loop possible derivatives.
4153
for (unsigned int r = 0; r < num_derivatives; r++)
4155
// Resetting dmats values to compute next derivative.
4156
for (unsigned int t = 0; t < 6; t++)
4158
for (unsigned int u = 0; u < 6; u++)
4160
dmats[t][u] = 0.000000000000000;
4163
dmats[t][u] = 1.000000000000000;
4166
}// end loop over 'u'
4167
}// end loop over 't'
4169
// Looping derivative order to generate dmats.
4170
for (unsigned int s = 0; s < n; s++)
4172
// Updating dmats_old with new values and resetting dmats.
4173
for (unsigned int t = 0; t < 6; t++)
4175
for (unsigned int u = 0; u < 6; u++)
4177
dmats_old[t][u] = dmats[t][u];
4178
dmats[t][u] = 0.000000000000000;
4179
}// end loop over 'u'
4180
}// end loop over 't'
4182
// Update dmats using an inner product.
4183
if (combinations[r][s] == 0)
4185
for (unsigned int t = 0; t < 6; t++)
4187
for (unsigned int u = 0; u < 6; u++)
4189
for (unsigned int tu = 0; tu < 6; tu++)
4191
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
4192
}// end loop over 'tu'
4193
}// end loop over 'u'
4194
}// end loop over 't'
4197
if (combinations[r][s] == 1)
4199
for (unsigned int t = 0; t < 6; t++)
4201
for (unsigned int u = 0; u < 6; u++)
4203
for (unsigned int tu = 0; tu < 6; tu++)
4205
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
4206
}// end loop over 'tu'
4207
}// end loop over 'u'
4208
}// end loop over 't'
4211
}// end loop over 's'
4212
for (unsigned int s = 0; s < 6; s++)
4214
for (unsigned int t = 0; t < 6; t++)
4216
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
4217
}// end loop over 't'
4218
}// end loop over 's'
4219
}// end loop over 'r'
4221
// Transform derivatives back to physical element
4222
for (unsigned int r = 0; r < num_derivatives; r++)
4224
for (unsigned int s = 0; s < num_derivatives; s++)
4226
values[r] += transform[r][s]*derivatives[s];
4227
}// end loop over 's'
4228
}// end loop over 'r'
4230
// Delete pointer to array of derivatives on FIAT element
4231
delete [] derivatives;
4233
// Delete pointer to array of combinations of derivatives and transform
4234
for (unsigned int r = 0; r < num_derivatives; r++)
4236
delete [] combinations[r];
4237
}// end loop over 'r'
4238
delete [] combinations;
4239
for (unsigned int r = 0; r < num_derivatives; r++)
4241
delete [] transform[r];
4242
}// end loop over 'r'
4243
delete [] transform;
4250
/// Evaluate order n derivatives of all basis functions at given point in cell
4251
virtual void evaluate_basis_derivatives_all(unsigned int n,
4253
const double* coordinates,
4254
const ufc::cell& c) const
4256
// Compute number of derivatives.
4257
unsigned int num_derivatives = 1;
4258
for (unsigned int r = 0; r < n; r++)
4260
num_derivatives *= 2;
4261
}// end loop over 'r'
4263
// Helper variable to hold values of a single dof.
4264
double *dof_values = new double[num_derivatives];
4265
for (unsigned int r = 0; r < num_derivatives; r++)
4267
dof_values[r] = 0.000000000000000;
4268
}// end loop over 'r'
4270
// Loop dofs and call evaluate_basis_derivatives.
4271
for (unsigned int r = 0; r < 6; r++)
4273
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
4274
for (unsigned int s = 0; s < num_derivatives; s++)
4276
values[r*num_derivatives + s] = dof_values[s];
4277
}// end loop over 's'
4278
}// end loop over 'r'
4281
delete [] dof_values;
4284
/// Evaluate linear functional for dof i on the function f
4285
virtual double evaluate_dof(unsigned int i,
4286
const ufc::function& f,
4287
const ufc::cell& c) const
4289
// Declare variables for result of evaluation.
4292
// Declare variable for physical coordinates.
4294
const double * const * x = c.coordinates;
4301
f.evaluate(vals, y, c);
4309
f.evaluate(vals, y, c);
4317
f.evaluate(vals, y, c);
4323
y[0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
4324
y[1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
4325
f.evaluate(vals, y, c);
4331
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
4332
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
4333
f.evaluate(vals, y, c);
4339
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
4340
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
4341
f.evaluate(vals, y, c);
4347
return 0.000000000000000;
4350
/// Evaluate linear functionals for all dofs on the function f
4351
virtual void evaluate_dofs(double* values,
4352
const ufc::function& f,
4353
const ufc::cell& c) const
4355
// Declare variables for result of evaluation.
4358
// Declare variable for physical coordinates.
4360
const double * const * x = c.coordinates;
4363
f.evaluate(vals, y, c);
4364
values[0] = vals[0];
4367
f.evaluate(vals, y, c);
4368
values[1] = vals[0];
4371
f.evaluate(vals, y, c);
4372
values[2] = vals[0];
4373
y[0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
4374
y[1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
4375
f.evaluate(vals, y, c);
4376
values[3] = vals[0];
4377
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
4378
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
4379
f.evaluate(vals, y, c);
4380
values[4] = vals[0];
4381
y[0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
4382
y[1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
4383
f.evaluate(vals, y, c);
4384
values[5] = vals[0];
4387
/// Interpolate vertex values from dof values
4388
virtual void interpolate_vertex_values(double* vertex_values,
4389
const double* dof_values,
4390
const ufc::cell& c) const
4392
// Evaluate function and change variables
4393
vertex_values[0] = dof_values[0];
4394
vertex_values[1] = dof_values[1];
4395
vertex_values[2] = dof_values[2];
4398
/// Map coordinate xhat from reference cell to coordinate x in cell
4399
virtual void map_from_reference_cell(double* x,
4403
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
4406
/// Map from coordinate x in cell to coordinate xhat in reference cell
4407
virtual void map_to_reference_cell(double* xhat,
4411
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
4414
/// Return the number of sub elements (for a mixed element)
4415
virtual unsigned int num_sub_elements() const
4420
/// Create a new finite element for sub element i (for a mixed element)
4421
virtual ufc::finite_element* create_sub_element(unsigned int i) const
4426
/// Create a new class instance
4427
virtual ufc::finite_element* create() const
4429
return new adaptivepoisson_finite_element_2();
4434
/// This class defines the interface for a finite element.
4436
class adaptivepoisson_finite_element_3: public ufc::finite_element
4441
adaptivepoisson_finite_element_3() : ufc::finite_element()
4447
virtual ~adaptivepoisson_finite_element_3()
4452
/// Return a string identifying the finite element
4453
virtual const char* signature() const
4455
return "FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3)";
4458
/// Return the cell shape
4459
virtual ufc::shape cell_shape() const
4461
return ufc::triangle;
4464
/// Return the topological dimension of the cell shape
4465
virtual unsigned int topological_dimension() const
4470
/// Return the geometric dimension of the cell shape
4471
virtual unsigned int geometric_dimension() const
4476
/// Return the dimension of the finite element function space
4477
virtual unsigned int space_dimension() const
4482
/// Return the rank of the value space
4483
virtual unsigned int value_rank() const
4488
/// Return the dimension of the value space for axis i
4489
virtual unsigned int value_dimension(unsigned int i) const
4494
/// Evaluate basis function i at given point in cell
4495
virtual void evaluate_basis(unsigned int i,
4497
const double* coordinates,
4498
const ufc::cell& c) const
4500
// Extract vertex coordinates
4501
const double * const * x = c.coordinates;
4503
// Compute Jacobian of affine map from reference cell
4504
const double J_00 = x[1][0] - x[0][0];
4505
const double J_01 = x[2][0] - x[0][0];
4506
const double J_10 = x[1][1] - x[0][1];
4507
const double J_11 = x[2][1] - x[0][1];
4509
// Compute determinant of Jacobian
4510
double detJ = J_00*J_11 - J_01*J_10;
4512
// Compute inverse of Jacobian
4514
// Compute constants
4515
const double C0 = x[1][0] + x[2][0];
4516
const double C1 = x[1][1] + x[2][1];
4518
// Get coordinates and map to the reference (FIAT) element
4519
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
4520
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
4523
*values = 0.000000000000000;
4525
// Array of basisvalues.
4526
double basisvalues[10] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
4528
// Declare helper variables.
4529
unsigned int rr = 0;
4530
unsigned int ss = 0;
4531
unsigned int tt = 0;
4532
double tmp5 = 0.000000000000000;
4533
double tmp6 = 0.000000000000000;
4534
double tmp7 = 0.000000000000000;
4535
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
4536
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
4537
double tmp2 = tmp1*tmp1;
4539
// Compute basisvalues.
4540
basisvalues[0] = 1.000000000000000;
4541
basisvalues[1] = tmp0;
4542
for (unsigned int r = 1; r < 3; r++)
4544
rr = (r + 1)*((r + 1) + 1)/2;
4546
tt = (r - 1)*((r - 1) + 1)/2;
4547
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
4548
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
4549
}// end loop over 'r'
4550
for (unsigned int r = 0; r < 3; r++)
4552
rr = (r + 1)*(r + 1 + 1)/2 + 1;
4554
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
4555
}// end loop over 'r'
4556
for (unsigned int r = 0; r < 2; r++)
4558
for (unsigned int s = 1; s < 3 - r; s++)
4560
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
4561
ss = (r + s)*(r + s + 1)/2 + s;
4562
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
4563
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4564
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4565
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4566
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
4567
}// end loop over 's'
4568
}// end loop over 'r'
4569
for (unsigned int r = 0; r < 4; r++)
4571
for (unsigned int s = 0; s < 4 - r; s++)
4573
rr = (r + s)*(r + s + 1)/2 + s;
4574
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
4575
}// end loop over 's'
4576
}// end loop over 'r'
4578
// Table(s) of coefficients.
4579
static const double coefficients0[10] = \
4580
{0.636396103067893, 0.000000000000000, 0.000000000000000, -0.234738238930786, 0.000000000000000, -0.262445329583912, 0.000000000000000, -0.203289278153682, 0.000000000000000, 0.090913729009699};
4582
// Compute value(s).
4583
for (unsigned int r = 0; r < 10; r++)
4585
*values += coefficients0[r]*basisvalues[r];
4586
}// end loop over 'r'
4589
/// Evaluate all basis functions at given point in cell
4590
virtual void evaluate_basis_all(double* values,
4591
const double* coordinates,
4592
const ufc::cell& c) const
4594
// Element is constant, calling evaluate_basis.
4595
evaluate_basis(0, values, coordinates, c);
4598
/// Evaluate order n derivatives of basis function i at given point in cell
4599
virtual void evaluate_basis_derivatives(unsigned int i,
4602
const double* coordinates,
4603
const ufc::cell& c) const
4605
// Extract vertex coordinates
4606
const double * const * x = c.coordinates;
4608
// Compute Jacobian of affine map from reference cell
4609
const double J_00 = x[1][0] - x[0][0];
4610
const double J_01 = x[2][0] - x[0][0];
4611
const double J_10 = x[1][1] - x[0][1];
4612
const double J_11 = x[2][1] - x[0][1];
4614
// Compute determinant of Jacobian
4615
double detJ = J_00*J_11 - J_01*J_10;
4617
// Compute inverse of Jacobian
4618
const double K_00 = J_11 / detJ;
4619
const double K_01 = -J_01 / detJ;
4620
const double K_10 = -J_10 / detJ;
4621
const double K_11 = J_00 / detJ;
4623
// Compute constants
4624
const double C0 = x[1][0] + x[2][0];
4625
const double C1 = x[1][1] + x[2][1];
4627
// Get coordinates and map to the reference (FIAT) element
4628
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
4629
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
4631
// Compute number of derivatives.
4632
unsigned int num_derivatives = 1;
4633
for (unsigned int r = 0; r < n; r++)
4635
num_derivatives *= 2;
4636
}// end loop over 'r'
4638
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
4639
unsigned int **combinations = new unsigned int *[num_derivatives];
4640
for (unsigned int row = 0; row < num_derivatives; row++)
4642
combinations[row] = new unsigned int [n];
4643
for (unsigned int col = 0; col < n; col++)
4644
combinations[row][col] = 0;
4647
// Generate combinations of derivatives
4648
for (unsigned int row = 1; row < num_derivatives; row++)
4650
for (unsigned int num = 0; num < row; num++)
4652
for (unsigned int col = n-1; col+1 > 0; col--)
4654
if (combinations[row][col] + 1 > 1)
4655
combinations[row][col] = 0;
4658
combinations[row][col] += 1;
4665
// Compute inverse of Jacobian
4666
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
4668
// Declare transformation matrix
4669
// Declare pointer to two dimensional array and initialise
4670
double **transform = new double *[num_derivatives];
4672
for (unsigned int j = 0; j < num_derivatives; j++)
4674
transform[j] = new double [num_derivatives];
4675
for (unsigned int k = 0; k < num_derivatives; k++)
4676
transform[j][k] = 1;
4679
// Construct transformation matrix
4680
for (unsigned int row = 0; row < num_derivatives; row++)
4682
for (unsigned int col = 0; col < num_derivatives; col++)
4684
for (unsigned int k = 0; k < n; k++)
4685
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
4689
// Reset values. Assuming that values is always an array.
4690
for (unsigned int r = 0; r < num_derivatives; r++)
4692
values[r] = 0.000000000000000;
4693
}// end loop over 'r'
4696
// Array of basisvalues.
4697
double basisvalues[10] = {0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000};
4699
// Declare helper variables.
4700
unsigned int rr = 0;
4701
unsigned int ss = 0;
4702
unsigned int tt = 0;
4703
double tmp5 = 0.000000000000000;
4704
double tmp6 = 0.000000000000000;
4705
double tmp7 = 0.000000000000000;
4706
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
4707
double tmp1 = (1.000000000000000 - Y)/2.000000000000000;
4708
double tmp2 = tmp1*tmp1;
4710
// Compute basisvalues.
4711
basisvalues[0] = 1.000000000000000;
4712
basisvalues[1] = tmp0;
4713
for (unsigned int r = 1; r < 3; r++)
4715
rr = (r + 1)*((r + 1) + 1)/2;
4717
tt = (r - 1)*((r - 1) + 1)/2;
4718
tmp5 = (1.000000000000000 + 2.000000000000000*r)/(1.000000000000000 + r);
4719
basisvalues[rr] = (basisvalues[ss]*tmp0*tmp5 - basisvalues[tt]*tmp2*r/(1.000000000000000 + r));
4720
}// end loop over 'r'
4721
for (unsigned int r = 0; r < 3; r++)
4723
rr = (r + 1)*(r + 1 + 1)/2 + 1;
4725
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
4726
}// end loop over 'r'
4727
for (unsigned int r = 0; r < 2; r++)
4729
for (unsigned int s = 1; s < 3 - r; s++)
4731
rr = (r + s + 1)*(r + s + 1 + 1)/2 + s + 1;
4732
ss = (r + s)*(r + s + 1)/2 + s;
4733
tt = (r + s - 1)*(r + s - 1 + 1)/2 + s - 1;
4734
tmp5 = (2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4735
tmp6 = (1.000000000000000 + 4.000000000000000*r*r + 4.000000000000000*r)*(2.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)/(2.000000000000000*(1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4736
tmp7 = (1.000000000000000 + s + 2.000000000000000*r)*(3.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*s/((1.000000000000000 + 2.000000000000000*r + 2.000000000000000*s)*(1.000000000000000 + s)*(2.000000000000000 + s + 2.000000000000000*r));
4737
basisvalues[rr] = (basisvalues[ss]*(tmp6 + Y*tmp5) - basisvalues[tt]*tmp7);
4738
}// end loop over 's'
4739
}// end loop over 'r'
4740
for (unsigned int r = 0; r < 4; r++)
4742
for (unsigned int s = 0; s < 4 - r; s++)
4744
rr = (r + s)*(r + s + 1)/2 + s;
4745
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
4746
}// end loop over 's'
4747
}// end loop over 'r'
4749
// Table(s) of coefficients.
4750
static const double coefficients0[10] = \
4751
{0.636396103067893, 0.000000000000000, 0.000000000000000, -0.234738238930786, 0.000000000000000, -0.262445329583912, 0.000000000000000, -0.203289278153682, 0.000000000000000, 0.090913729009699};
4753
// Tables of derivatives of the polynomial base (transpose).
4754
static const double dmats0[10][10] = \
4755
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4756
{4.898979485566356, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4757
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4758
{0.000000000000000, 9.486832980505140, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4759
{3.999999999999998, 0.000000000000000, 7.071067811865476, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4760
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4761
{5.291502622129178, 0.000000000000000, -2.993325909419151, 13.662601021279462, 0.000000000000000, 0.611010092660779, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4762
{0.000000000000000, 4.381780460041330, 0.000000000000000, 0.000000000000000, 12.521980673998824, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4763
{3.464101615137755, 0.000000000000000, 7.838367176906168, 0.000000000000000, 0.000000000000000, 8.400000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4764
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
4766
static const double dmats1[10][10] = \
4767
{{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4768
{2.449489742783178, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4769
{4.242640687119285, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4770
{2.581988897471611, 4.743416490252570, -0.912870929175277, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4771
{1.999999999999999, 6.123724356957946, 3.535533905932738, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4772
{-2.309401076758503, 0.000000000000000, 8.164965809277261, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4773
{2.645751311064590, 5.184592558726288, -1.496662954709576, 6.831300510639732, -1.058300524425836, 0.305505046330390, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4774
{2.236067977499788, 2.190890230020664, 2.529822128134706, 8.082903768654761, 6.260990336999411, -1.807392228230128, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4775
{1.732050807568876, -5.091168824543143, 3.919183588453085, 0.000000000000000, 9.699484522385713, 4.200000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4776
{5.000000000000002, 0.000000000000000, -2.828427124746193, 0.000000000000000, 0.000000000000000, 12.124355652982144, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000}};
4778
// Compute reference derivatives.
4779
// Declare pointer to array of derivatives on FIAT element.
4780
double *derivatives = new double[num_derivatives];
4781
for (unsigned int r = 0; r < num_derivatives; r++)
4783
derivatives[r] = 0.000000000000000;
4784
}// end loop over 'r'
4786
// Declare derivative matrix (of polynomial basis).
4787
double dmats[10][10] = \
4788
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4789
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4790
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4791
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4792
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4793
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4794
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4795
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
4796
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
4797
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
4799
// Declare (auxiliary) derivative matrix (of polynomial basis).
4800
double dmats_old[10][10] = \
4801
{{1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4802
{0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4803
{0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4804
{0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4805
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4806
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4807
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000},
4808
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000, 0.000000000000000},
4809
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000, 0.000000000000000},
4810
{0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000}};
4812
// Loop possible derivatives.
4813
for (unsigned int r = 0; r < num_derivatives; r++)
4815
// Resetting dmats values to compute next derivative.
4816
for (unsigned int t = 0; t < 10; t++)
4818
for (unsigned int u = 0; u < 10; u++)
4820
dmats[t][u] = 0.000000000000000;
4823
dmats[t][u] = 1.000000000000000;
4826
}// end loop over 'u'
4827
}// end loop over 't'
4829
// Looping derivative order to generate dmats.
4830
for (unsigned int s = 0; s < n; s++)
4832
// Updating dmats_old with new values and resetting dmats.
4833
for (unsigned int t = 0; t < 10; t++)
4835
for (unsigned int u = 0; u < 10; u++)
4837
dmats_old[t][u] = dmats[t][u];
4838
dmats[t][u] = 0.000000000000000;
4839
}// end loop over 'u'
4840
}// end loop over 't'
4842
// Update dmats using an inner product.
4843
if (combinations[r][s] == 0)
4845
for (unsigned int t = 0; t < 10; t++)
4847
for (unsigned int u = 0; u < 10; u++)
4849
for (unsigned int tu = 0; tu < 10; tu++)
4851
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
4852
}// end loop over 'tu'
4853
}// end loop over 'u'
4854
}// end loop over 't'
4857
if (combinations[r][s] == 1)
4859
for (unsigned int t = 0; t < 10; t++)
4861
for (unsigned int u = 0; u < 10; u++)
4863
for (unsigned int tu = 0; tu < 10; tu++)
4865
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
4866
}// end loop over 'tu'
4867
}// end loop over 'u'
4868
}// end loop over 't'
4871
}// end loop over 's'
4872
for (unsigned int s = 0; s < 10; s++)
4874
for (unsigned int t = 0; t < 10; t++)
4876
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
4877
}// end loop over 't'
4878
}// end loop over 's'
4879
}// end loop over 'r'
4881
// Transform derivatives back to physical element
4882
for (unsigned int r = 0; r < num_derivatives; r++)
4884
for (unsigned int s = 0; s < num_derivatives; s++)
4886
values[r] += transform[r][s]*derivatives[s];
4887
}// end loop over 's'
4888
}// end loop over 'r'
4890
// Delete pointer to array of derivatives on FIAT element
4891
delete [] derivatives;
4893
// Delete pointer to array of combinations of derivatives and transform
4894
for (unsigned int r = 0; r < num_derivatives; r++)
4896
delete [] combinations[r];
4897
}// end loop over 'r'
4898
delete [] combinations;
4899
for (unsigned int r = 0; r < num_derivatives; r++)
4901
delete [] transform[r];
4902
}// end loop over 'r'
4903
delete [] transform;
4906
/// Evaluate order n derivatives of all basis functions at given point in cell
4907
virtual void evaluate_basis_derivatives_all(unsigned int n,
4909
const double* coordinates,
4910
const ufc::cell& c) const
4912
// Element is constant, calling evaluate_basis_derivatives.
4913
evaluate_basis_derivatives(0, n, values, coordinates, c);
4916
/// Evaluate linear functional for dof i on the function f
4917
virtual double evaluate_dof(unsigned int i,
4918
const ufc::function& f,
4919
const ufc::cell& c) const
4921
// Declare variables for result of evaluation.
4924
// Declare variable for physical coordinates.
4926
const double * const * x = c.coordinates;
4931
y[0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
4932
y[1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
4933
f.evaluate(vals, y, c);
4939
return 0.000000000000000;
4942
/// Evaluate linear functionals for all dofs on the function f
4943
virtual void evaluate_dofs(double* values,
4944
const ufc::function& f,
4945
const ufc::cell& c) const
4947
// Declare variables for result of evaluation.
4950
// Declare variable for physical coordinates.
4952
const double * const * x = c.coordinates;
4953
y[0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
4954
y[1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
4955
f.evaluate(vals, y, c);
4956
values[0] = vals[0];
4959
/// Interpolate vertex values from dof values
4960
virtual void interpolate_vertex_values(double* vertex_values,
4961
const double* dof_values,
4962
const ufc::cell& c) const
4964
// Evaluate function and change variables
4965
vertex_values[0] = 0;
4966
vertex_values[1] = 0;
4967
vertex_values[2] = 0;
4970
/// Map coordinate xhat from reference cell to coordinate x in cell
4971
virtual void map_from_reference_cell(double* x,
4975
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
4978
/// Map from coordinate x in cell to coordinate xhat in reference cell
4979
virtual void map_to_reference_cell(double* xhat,
4983
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
4986
/// Return the number of sub elements (for a mixed element)
4987
virtual unsigned int num_sub_elements() const
4992
/// Create a new finite element for sub element i (for a mixed element)
4993
virtual ufc::finite_element* create_sub_element(unsigned int i) const
4998
/// Create a new class instance
4999
virtual ufc::finite_element* create() const
5001
return new adaptivepoisson_finite_element_3();
5006
/// This class defines the interface for a finite element.
5008
class adaptivepoisson_finite_element_4: public ufc::finite_element
5013
adaptivepoisson_finite_element_4() : ufc::finite_element()
5019
virtual ~adaptivepoisson_finite_element_4()
5024
/// Return a string identifying the finite element
5025
virtual const char* signature() const
5027
return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1)";
5030
/// Return the cell shape
5031
virtual ufc::shape cell_shape() const
5033
return ufc::triangle;
5036
/// Return the topological dimension of the cell shape
5037
virtual unsigned int topological_dimension() const
5042
/// Return the geometric dimension of the cell shape
5043
virtual unsigned int geometric_dimension() const
5048
/// Return the dimension of the finite element function space
5049
virtual unsigned int space_dimension() const
5054
/// Return the rank of the value space
5055
virtual unsigned int value_rank() const
5060
/// Return the dimension of the value space for axis i
5061
virtual unsigned int value_dimension(unsigned int i) const
5066
/// Evaluate basis function i at given point in cell
5067
virtual void evaluate_basis(unsigned int i,
5069
const double* coordinates,
5070
const ufc::cell& c) const
5072
// Extract vertex coordinates
5073
const double * const * x = c.coordinates;
5075
// Compute Jacobian of affine map from reference cell
5076
const double J_00 = x[1][0] - x[0][0];
5077
const double J_01 = x[2][0] - x[0][0];
5078
const double J_10 = x[1][1] - x[0][1];
5079
const double J_11 = x[2][1] - x[0][1];
5081
// Compute determinant of Jacobian
5082
double detJ = J_00*J_11 - J_01*J_10;
5084
// Compute inverse of Jacobian
5086
// Compute constants
5087
const double C0 = x[1][0] + x[2][0];
5088
const double C1 = x[1][1] + x[2][1];
5090
// Get coordinates and map to the reference (FIAT) element
5091
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
5092
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
5095
*values = 0.000000000000000;
5101
// Array of basisvalues.
5102
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5104
// Declare helper variables.
5105
unsigned int rr = 0;
5106
unsigned int ss = 0;
5107
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5109
// Compute basisvalues.
5110
basisvalues[0] = 1.000000000000000;
5111
basisvalues[1] = tmp0;
5112
for (unsigned int r = 0; r < 1; r++)
5114
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5116
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5117
}// end loop over 'r'
5118
for (unsigned int r = 0; r < 2; r++)
5120
for (unsigned int s = 0; s < 2 - r; s++)
5122
rr = (r + s)*(r + s + 1)/2 + s;
5123
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5124
}// end loop over 's'
5125
}// end loop over 'r'
5127
// Table(s) of coefficients.
5128
static const double coefficients0[3] = \
5129
{0.471404520791032, -0.288675134594813, -0.166666666666667};
5131
// Compute value(s).
5132
for (unsigned int r = 0; r < 3; r++)
5134
*values += coefficients0[r]*basisvalues[r];
5135
}// end loop over 'r'
5141
// Array of basisvalues.
5142
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5144
// Declare helper variables.
5145
unsigned int rr = 0;
5146
unsigned int ss = 0;
5147
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5149
// Compute basisvalues.
5150
basisvalues[0] = 1.000000000000000;
5151
basisvalues[1] = tmp0;
5152
for (unsigned int r = 0; r < 1; r++)
5154
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5156
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5157
}// end loop over 'r'
5158
for (unsigned int r = 0; r < 2; r++)
5160
for (unsigned int s = 0; s < 2 - r; s++)
5162
rr = (r + s)*(r + s + 1)/2 + s;
5163
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5164
}// end loop over 's'
5165
}// end loop over 'r'
5167
// Table(s) of coefficients.
5168
static const double coefficients0[3] = \
5169
{0.471404520791032, 0.288675134594813, -0.166666666666667};
5171
// Compute value(s).
5172
for (unsigned int r = 0; r < 3; r++)
5174
*values += coefficients0[r]*basisvalues[r];
5175
}// end loop over 'r'
5181
// Array of basisvalues.
5182
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5184
// Declare helper variables.
5185
unsigned int rr = 0;
5186
unsigned int ss = 0;
5187
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5189
// Compute basisvalues.
5190
basisvalues[0] = 1.000000000000000;
5191
basisvalues[1] = tmp0;
5192
for (unsigned int r = 0; r < 1; r++)
5194
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5196
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5197
}// end loop over 'r'
5198
for (unsigned int r = 0; r < 2; r++)
5200
for (unsigned int s = 0; s < 2 - r; s++)
5202
rr = (r + s)*(r + s + 1)/2 + s;
5203
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5204
}// end loop over 's'
5205
}// end loop over 'r'
5207
// Table(s) of coefficients.
5208
static const double coefficients0[3] = \
5209
{0.471404520791032, 0.000000000000000, 0.333333333333333};
5211
// Compute value(s).
5212
for (unsigned int r = 0; r < 3; r++)
5214
*values += coefficients0[r]*basisvalues[r];
5215
}// end loop over 'r'
5222
/// Evaluate all basis functions at given point in cell
5223
virtual void evaluate_basis_all(double* values,
5224
const double* coordinates,
5225
const ufc::cell& c) const
5227
// Helper variable to hold values of a single dof.
5228
double dof_values = 0.000000000000000;
5230
// Loop dofs and call evaluate_basis.
5231
for (unsigned int r = 0; r < 3; r++)
5233
evaluate_basis(r, &dof_values, coordinates, c);
5234
values[r] = dof_values;
5235
}// end loop over 'r'
5238
/// Evaluate order n derivatives of basis function i at given point in cell
5239
virtual void evaluate_basis_derivatives(unsigned int i,
5242
const double* coordinates,
5243
const ufc::cell& c) const
5245
// Extract vertex coordinates
5246
const double * const * x = c.coordinates;
5248
// Compute Jacobian of affine map from reference cell
5249
const double J_00 = x[1][0] - x[0][0];
5250
const double J_01 = x[2][0] - x[0][0];
5251
const double J_10 = x[1][1] - x[0][1];
5252
const double J_11 = x[2][1] - x[0][1];
5254
// Compute determinant of Jacobian
5255
double detJ = J_00*J_11 - J_01*J_10;
5257
// Compute inverse of Jacobian
5258
const double K_00 = J_11 / detJ;
5259
const double K_01 = -J_01 / detJ;
5260
const double K_10 = -J_10 / detJ;
5261
const double K_11 = J_00 / detJ;
5263
// Compute constants
5264
const double C0 = x[1][0] + x[2][0];
5265
const double C1 = x[1][1] + x[2][1];
5267
// Get coordinates and map to the reference (FIAT) element
5268
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
5269
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
5271
// Compute number of derivatives.
5272
unsigned int num_derivatives = 1;
5273
for (unsigned int r = 0; r < n; r++)
5275
num_derivatives *= 2;
5276
}// end loop over 'r'
5278
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
5279
unsigned int **combinations = new unsigned int *[num_derivatives];
5280
for (unsigned int row = 0; row < num_derivatives; row++)
5282
combinations[row] = new unsigned int [n];
5283
for (unsigned int col = 0; col < n; col++)
5284
combinations[row][col] = 0;
5287
// Generate combinations of derivatives
5288
for (unsigned int row = 1; row < num_derivatives; row++)
5290
for (unsigned int num = 0; num < row; num++)
5292
for (unsigned int col = n-1; col+1 > 0; col--)
5294
if (combinations[row][col] + 1 > 1)
5295
combinations[row][col] = 0;
5298
combinations[row][col] += 1;
5305
// Compute inverse of Jacobian
5306
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
5308
// Declare transformation matrix
5309
// Declare pointer to two dimensional array and initialise
5310
double **transform = new double *[num_derivatives];
5312
for (unsigned int j = 0; j < num_derivatives; j++)
5314
transform[j] = new double [num_derivatives];
5315
for (unsigned int k = 0; k < num_derivatives; k++)
5316
transform[j][k] = 1;
5319
// Construct transformation matrix
5320
for (unsigned int row = 0; row < num_derivatives; row++)
5322
for (unsigned int col = 0; col < num_derivatives; col++)
5324
for (unsigned int k = 0; k < n; k++)
5325
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
5329
// Reset values. Assuming that values is always an array.
5330
for (unsigned int r = 0; r < num_derivatives; r++)
5332
values[r] = 0.000000000000000;
5333
}// end loop over 'r'
5340
// Array of basisvalues.
5341
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5343
// Declare helper variables.
5344
unsigned int rr = 0;
5345
unsigned int ss = 0;
5346
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5348
// Compute basisvalues.
5349
basisvalues[0] = 1.000000000000000;
5350
basisvalues[1] = tmp0;
5351
for (unsigned int r = 0; r < 1; r++)
5353
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5355
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5356
}// end loop over 'r'
5357
for (unsigned int r = 0; r < 2; r++)
5359
for (unsigned int s = 0; s < 2 - r; s++)
5361
rr = (r + s)*(r + s + 1)/2 + s;
5362
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5363
}// end loop over 's'
5364
}// end loop over 'r'
5366
// Table(s) of coefficients.
5367
static const double coefficients0[3] = \
5368
{0.471404520791032, -0.288675134594813, -0.166666666666667};
5370
// Tables of derivatives of the polynomial base (transpose).
5371
static const double dmats0[3][3] = \
5372
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5373
{4.898979485566356, 0.000000000000000, 0.000000000000000},
5374
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
5376
static const double dmats1[3][3] = \
5377
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5378
{2.449489742783178, 0.000000000000000, 0.000000000000000},
5379
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
5381
// Compute reference derivatives.
5382
// Declare pointer to array of derivatives on FIAT element.
5383
double *derivatives = new double[num_derivatives];
5384
for (unsigned int r = 0; r < num_derivatives; r++)
5386
derivatives[r] = 0.000000000000000;
5387
}// end loop over 'r'
5389
// Declare derivative matrix (of polynomial basis).
5390
double dmats[3][3] = \
5391
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5392
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5393
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5395
// Declare (auxiliary) derivative matrix (of polynomial basis).
5396
double dmats_old[3][3] = \
5397
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5398
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5399
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5401
// Loop possible derivatives.
5402
for (unsigned int r = 0; r < num_derivatives; r++)
5404
// Resetting dmats values to compute next derivative.
5405
for (unsigned int t = 0; t < 3; t++)
5407
for (unsigned int u = 0; u < 3; u++)
5409
dmats[t][u] = 0.000000000000000;
5412
dmats[t][u] = 1.000000000000000;
5415
}// end loop over 'u'
5416
}// end loop over 't'
5418
// Looping derivative order to generate dmats.
5419
for (unsigned int s = 0; s < n; s++)
5421
// Updating dmats_old with new values and resetting dmats.
5422
for (unsigned int t = 0; t < 3; t++)
5424
for (unsigned int u = 0; u < 3; u++)
5426
dmats_old[t][u] = dmats[t][u];
5427
dmats[t][u] = 0.000000000000000;
5428
}// end loop over 'u'
5429
}// end loop over 't'
5431
// Update dmats using an inner product.
5432
if (combinations[r][s] == 0)
5434
for (unsigned int t = 0; t < 3; t++)
5436
for (unsigned int u = 0; u < 3; u++)
5438
for (unsigned int tu = 0; tu < 3; tu++)
5440
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
5441
}// end loop over 'tu'
5442
}// end loop over 'u'
5443
}// end loop over 't'
5446
if (combinations[r][s] == 1)
5448
for (unsigned int t = 0; t < 3; t++)
5450
for (unsigned int u = 0; u < 3; u++)
5452
for (unsigned int tu = 0; tu < 3; tu++)
5454
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
5455
}// end loop over 'tu'
5456
}// end loop over 'u'
5457
}// end loop over 't'
5460
}// end loop over 's'
5461
for (unsigned int s = 0; s < 3; s++)
5463
for (unsigned int t = 0; t < 3; t++)
5465
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
5466
}// end loop over 't'
5467
}// end loop over 's'
5468
}// end loop over 'r'
5470
// Transform derivatives back to physical element
5471
for (unsigned int r = 0; r < num_derivatives; r++)
5473
for (unsigned int s = 0; s < num_derivatives; s++)
5475
values[r] += transform[r][s]*derivatives[s];
5476
}// end loop over 's'
5477
}// end loop over 'r'
5479
// Delete pointer to array of derivatives on FIAT element
5480
delete [] derivatives;
5482
// Delete pointer to array of combinations of derivatives and transform
5483
for (unsigned int r = 0; r < num_derivatives; r++)
5485
delete [] combinations[r];
5486
}// end loop over 'r'
5487
delete [] combinations;
5488
for (unsigned int r = 0; r < num_derivatives; r++)
5490
delete [] transform[r];
5491
}// end loop over 'r'
5492
delete [] transform;
5498
// Array of basisvalues.
5499
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5501
// Declare helper variables.
5502
unsigned int rr = 0;
5503
unsigned int ss = 0;
5504
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5506
// Compute basisvalues.
5507
basisvalues[0] = 1.000000000000000;
5508
basisvalues[1] = tmp0;
5509
for (unsigned int r = 0; r < 1; r++)
5511
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5513
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5514
}// end loop over 'r'
5515
for (unsigned int r = 0; r < 2; r++)
5517
for (unsigned int s = 0; s < 2 - r; s++)
5519
rr = (r + s)*(r + s + 1)/2 + s;
5520
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5521
}// end loop over 's'
5522
}// end loop over 'r'
5524
// Table(s) of coefficients.
5525
static const double coefficients0[3] = \
5526
{0.471404520791032, 0.288675134594813, -0.166666666666667};
5528
// Tables of derivatives of the polynomial base (transpose).
5529
static const double dmats0[3][3] = \
5530
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5531
{4.898979485566356, 0.000000000000000, 0.000000000000000},
5532
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
5534
static const double dmats1[3][3] = \
5535
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5536
{2.449489742783178, 0.000000000000000, 0.000000000000000},
5537
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
5539
// Compute reference derivatives.
5540
// Declare pointer to array of derivatives on FIAT element.
5541
double *derivatives = new double[num_derivatives];
5542
for (unsigned int r = 0; r < num_derivatives; r++)
5544
derivatives[r] = 0.000000000000000;
5545
}// end loop over 'r'
5547
// Declare derivative matrix (of polynomial basis).
5548
double dmats[3][3] = \
5549
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5550
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5551
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5553
// Declare (auxiliary) derivative matrix (of polynomial basis).
5554
double dmats_old[3][3] = \
5555
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5556
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5557
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5559
// Loop possible derivatives.
5560
for (unsigned int r = 0; r < num_derivatives; r++)
5562
// Resetting dmats values to compute next derivative.
5563
for (unsigned int t = 0; t < 3; t++)
5565
for (unsigned int u = 0; u < 3; u++)
5567
dmats[t][u] = 0.000000000000000;
5570
dmats[t][u] = 1.000000000000000;
5573
}// end loop over 'u'
5574
}// end loop over 't'
5576
// Looping derivative order to generate dmats.
5577
for (unsigned int s = 0; s < n; s++)
5579
// Updating dmats_old with new values and resetting dmats.
5580
for (unsigned int t = 0; t < 3; t++)
5582
for (unsigned int u = 0; u < 3; u++)
5584
dmats_old[t][u] = dmats[t][u];
5585
dmats[t][u] = 0.000000000000000;
5586
}// end loop over 'u'
5587
}// end loop over 't'
5589
// Update dmats using an inner product.
5590
if (combinations[r][s] == 0)
5592
for (unsigned int t = 0; t < 3; t++)
5594
for (unsigned int u = 0; u < 3; u++)
5596
for (unsigned int tu = 0; tu < 3; tu++)
5598
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
5599
}// end loop over 'tu'
5600
}// end loop over 'u'
5601
}// end loop over 't'
5604
if (combinations[r][s] == 1)
5606
for (unsigned int t = 0; t < 3; t++)
5608
for (unsigned int u = 0; u < 3; u++)
5610
for (unsigned int tu = 0; tu < 3; tu++)
5612
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
5613
}// end loop over 'tu'
5614
}// end loop over 'u'
5615
}// end loop over 't'
5618
}// end loop over 's'
5619
for (unsigned int s = 0; s < 3; s++)
5621
for (unsigned int t = 0; t < 3; t++)
5623
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
5624
}// end loop over 't'
5625
}// end loop over 's'
5626
}// end loop over 'r'
5628
// Transform derivatives back to physical element
5629
for (unsigned int r = 0; r < num_derivatives; r++)
5631
for (unsigned int s = 0; s < num_derivatives; s++)
5633
values[r] += transform[r][s]*derivatives[s];
5634
}// end loop over 's'
5635
}// end loop over 'r'
5637
// Delete pointer to array of derivatives on FIAT element
5638
delete [] derivatives;
5640
// Delete pointer to array of combinations of derivatives and transform
5641
for (unsigned int r = 0; r < num_derivatives; r++)
5643
delete [] combinations[r];
5644
}// end loop over 'r'
5645
delete [] combinations;
5646
for (unsigned int r = 0; r < num_derivatives; r++)
5648
delete [] transform[r];
5649
}// end loop over 'r'
5650
delete [] transform;
5656
// Array of basisvalues.
5657
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
5659
// Declare helper variables.
5660
unsigned int rr = 0;
5661
unsigned int ss = 0;
5662
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
5664
// Compute basisvalues.
5665
basisvalues[0] = 1.000000000000000;
5666
basisvalues[1] = tmp0;
5667
for (unsigned int r = 0; r < 1; r++)
5669
rr = (r + 1)*(r + 1 + 1)/2 + 1;
5671
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
5672
}// end loop over 'r'
5673
for (unsigned int r = 0; r < 2; r++)
5675
for (unsigned int s = 0; s < 2 - r; s++)
5677
rr = (r + s)*(r + s + 1)/2 + s;
5678
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
5679
}// end loop over 's'
5680
}// end loop over 'r'
5682
// Table(s) of coefficients.
5683
static const double coefficients0[3] = \
5684
{0.471404520791032, 0.000000000000000, 0.333333333333333};
5686
// Tables of derivatives of the polynomial base (transpose).
5687
static const double dmats0[3][3] = \
5688
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5689
{4.898979485566356, 0.000000000000000, 0.000000000000000},
5690
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
5692
static const double dmats1[3][3] = \
5693
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
5694
{2.449489742783178, 0.000000000000000, 0.000000000000000},
5695
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
5697
// Compute reference derivatives.
5698
// Declare pointer to array of derivatives on FIAT element.
5699
double *derivatives = new double[num_derivatives];
5700
for (unsigned int r = 0; r < num_derivatives; r++)
5702
derivatives[r] = 0.000000000000000;
5703
}// end loop over 'r'
5705
// Declare derivative matrix (of polynomial basis).
5706
double dmats[3][3] = \
5707
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5708
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5709
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5711
// Declare (auxiliary) derivative matrix (of polynomial basis).
5712
double dmats_old[3][3] = \
5713
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
5714
{0.000000000000000, 1.000000000000000, 0.000000000000000},
5715
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
5717
// Loop possible derivatives.
5718
for (unsigned int r = 0; r < num_derivatives; r++)
5720
// Resetting dmats values to compute next derivative.
5721
for (unsigned int t = 0; t < 3; t++)
5723
for (unsigned int u = 0; u < 3; u++)
5725
dmats[t][u] = 0.000000000000000;
5728
dmats[t][u] = 1.000000000000000;
5731
}// end loop over 'u'
5732
}// end loop over 't'
5734
// Looping derivative order to generate dmats.
5735
for (unsigned int s = 0; s < n; s++)
5737
// Updating dmats_old with new values and resetting dmats.
5738
for (unsigned int t = 0; t < 3; t++)
5740
for (unsigned int u = 0; u < 3; u++)
5742
dmats_old[t][u] = dmats[t][u];
5743
dmats[t][u] = 0.000000000000000;
5744
}// end loop over 'u'
5745
}// end loop over 't'
5747
// Update dmats using an inner product.
5748
if (combinations[r][s] == 0)
5750
for (unsigned int t = 0; t < 3; t++)
5752
for (unsigned int u = 0; u < 3; u++)
5754
for (unsigned int tu = 0; tu < 3; tu++)
5756
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
5757
}// end loop over 'tu'
5758
}// end loop over 'u'
5759
}// end loop over 't'
5762
if (combinations[r][s] == 1)
5764
for (unsigned int t = 0; t < 3; t++)
5766
for (unsigned int u = 0; u < 3; u++)
5768
for (unsigned int tu = 0; tu < 3; tu++)
5770
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
5771
}// end loop over 'tu'
5772
}// end loop over 'u'
5773
}// end loop over 't'
5776
}// end loop over 's'
5777
for (unsigned int s = 0; s < 3; s++)
5779
for (unsigned int t = 0; t < 3; t++)
5781
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
5782
}// end loop over 't'
5783
}// end loop over 's'
5784
}// end loop over 'r'
5786
// Transform derivatives back to physical element
5787
for (unsigned int r = 0; r < num_derivatives; r++)
5789
for (unsigned int s = 0; s < num_derivatives; s++)
5791
values[r] += transform[r][s]*derivatives[s];
5792
}// end loop over 's'
5793
}// end loop over 'r'
5795
// Delete pointer to array of derivatives on FIAT element
5796
delete [] derivatives;
5798
// Delete pointer to array of combinations of derivatives and transform
5799
for (unsigned int r = 0; r < num_derivatives; r++)
5801
delete [] combinations[r];
5802
}// end loop over 'r'
5803
delete [] combinations;
5804
for (unsigned int r = 0; r < num_derivatives; r++)
5806
delete [] transform[r];
5807
}// end loop over 'r'
5808
delete [] transform;
5815
/// Evaluate order n derivatives of all basis functions at given point in cell
5816
virtual void evaluate_basis_derivatives_all(unsigned int n,
5818
const double* coordinates,
5819
const ufc::cell& c) const
5821
// Compute number of derivatives.
5822
unsigned int num_derivatives = 1;
5823
for (unsigned int r = 0; r < n; r++)
5825
num_derivatives *= 2;
5826
}// end loop over 'r'
5828
// Helper variable to hold values of a single dof.
5829
double *dof_values = new double[num_derivatives];
5830
for (unsigned int r = 0; r < num_derivatives; r++)
5832
dof_values[r] = 0.000000000000000;
5833
}// end loop over 'r'
5835
// Loop dofs and call evaluate_basis_derivatives.
5836
for (unsigned int r = 0; r < 3; r++)
5838
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
5839
for (unsigned int s = 0; s < num_derivatives; s++)
5841
values[r*num_derivatives + s] = dof_values[s];
5842
}// end loop over 's'
5843
}// end loop over 'r'
5846
delete [] dof_values;
5849
/// Evaluate linear functional for dof i on the function f
5850
virtual double evaluate_dof(unsigned int i,
5851
const ufc::function& f,
5852
const ufc::cell& c) const
5854
// Declare variables for result of evaluation.
5857
// Declare variable for physical coordinates.
5859
const double * const * x = c.coordinates;
5866
f.evaluate(vals, y, c);
5874
f.evaluate(vals, y, c);
5882
f.evaluate(vals, y, c);
5888
return 0.000000000000000;
5891
/// Evaluate linear functionals for all dofs on the function f
5892
virtual void evaluate_dofs(double* values,
5893
const ufc::function& f,
5894
const ufc::cell& c) const
5896
// Declare variables for result of evaluation.
5899
// Declare variable for physical coordinates.
5901
const double * const * x = c.coordinates;
5904
f.evaluate(vals, y, c);
5905
values[0] = vals[0];
5908
f.evaluate(vals, y, c);
5909
values[1] = vals[0];
5912
f.evaluate(vals, y, c);
5913
values[2] = vals[0];
5916
/// Interpolate vertex values from dof values
5917
virtual void interpolate_vertex_values(double* vertex_values,
5918
const double* dof_values,
5919
const ufc::cell& c) const
5921
// Evaluate function and change variables
5922
vertex_values[0] = dof_values[0];
5923
vertex_values[1] = dof_values[1];
5924
vertex_values[2] = dof_values[2];
5927
/// Map coordinate xhat from reference cell to coordinate x in cell
5928
virtual void map_from_reference_cell(double* x,
5932
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
5935
/// Map from coordinate x in cell to coordinate xhat in reference cell
5936
virtual void map_to_reference_cell(double* xhat,
5940
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
5943
/// Return the number of sub elements (for a mixed element)
5944
virtual unsigned int num_sub_elements() const
5949
/// Create a new finite element for sub element i (for a mixed element)
5950
virtual ufc::finite_element* create_sub_element(unsigned int i) const
5955
/// Create a new class instance
5956
virtual ufc::finite_element* create() const
5958
return new adaptivepoisson_finite_element_4();
5963
/// This class defines the interface for a finite element.
5965
class adaptivepoisson_finite_element_5: public ufc::finite_element
5970
adaptivepoisson_finite_element_5() : ufc::finite_element()
5976
virtual ~adaptivepoisson_finite_element_5()
5981
/// Return a string identifying the finite element
5982
virtual const char* signature() const
5984
return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
5987
/// Return the cell shape
5988
virtual ufc::shape cell_shape() const
5990
return ufc::triangle;
5993
/// Return the topological dimension of the cell shape
5994
virtual unsigned int topological_dimension() const
5999
/// Return the geometric dimension of the cell shape
6000
virtual unsigned int geometric_dimension() const
6005
/// Return the dimension of the finite element function space
6006
virtual unsigned int space_dimension() const
6011
/// Return the rank of the value space
6012
virtual unsigned int value_rank() const
6017
/// Return the dimension of the value space for axis i
6018
virtual unsigned int value_dimension(unsigned int i) const
6023
/// Evaluate basis function i at given point in cell
6024
virtual void evaluate_basis(unsigned int i,
6026
const double* coordinates,
6027
const ufc::cell& c) const
6029
// Extract vertex coordinates
6030
const double * const * x = c.coordinates;
6032
// Compute Jacobian of affine map from reference cell
6033
const double J_00 = x[1][0] - x[0][0];
6034
const double J_01 = x[2][0] - x[0][0];
6035
const double J_10 = x[1][1] - x[0][1];
6036
const double J_11 = x[2][1] - x[0][1];
6038
// Compute determinant of Jacobian
6039
double detJ = J_00*J_11 - J_01*J_10;
6041
// Compute inverse of Jacobian
6043
// Compute constants
6044
const double C0 = x[1][0] + x[2][0];
6045
const double C1 = x[1][1] + x[2][1];
6047
// Get coordinates and map to the reference (FIAT) element
6048
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
6049
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
6052
*values = 0.000000000000000;
6058
// Array of basisvalues.
6059
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6061
// Declare helper variables.
6062
unsigned int rr = 0;
6063
unsigned int ss = 0;
6064
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6066
// Compute basisvalues.
6067
basisvalues[0] = 1.000000000000000;
6068
basisvalues[1] = tmp0;
6069
for (unsigned int r = 0; r < 1; r++)
6071
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6073
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6074
}// end loop over 'r'
6075
for (unsigned int r = 0; r < 2; r++)
6077
for (unsigned int s = 0; s < 2 - r; s++)
6079
rr = (r + s)*(r + s + 1)/2 + s;
6080
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6081
}// end loop over 's'
6082
}// end loop over 'r'
6084
// Table(s) of coefficients.
6085
static const double coefficients0[3] = \
6086
{0.471404520791032, -0.288675134594813, -0.166666666666667};
6088
// Compute value(s).
6089
for (unsigned int r = 0; r < 3; r++)
6091
*values += coefficients0[r]*basisvalues[r];
6092
}// end loop over 'r'
6098
// Array of basisvalues.
6099
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6101
// Declare helper variables.
6102
unsigned int rr = 0;
6103
unsigned int ss = 0;
6104
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6106
// Compute basisvalues.
6107
basisvalues[0] = 1.000000000000000;
6108
basisvalues[1] = tmp0;
6109
for (unsigned int r = 0; r < 1; r++)
6111
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6113
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6114
}// end loop over 'r'
6115
for (unsigned int r = 0; r < 2; r++)
6117
for (unsigned int s = 0; s < 2 - r; s++)
6119
rr = (r + s)*(r + s + 1)/2 + s;
6120
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6121
}// end loop over 's'
6122
}// end loop over 'r'
6124
// Table(s) of coefficients.
6125
static const double coefficients0[3] = \
6126
{0.471404520791032, 0.288675134594813, -0.166666666666667};
6128
// Compute value(s).
6129
for (unsigned int r = 0; r < 3; r++)
6131
*values += coefficients0[r]*basisvalues[r];
6132
}// end loop over 'r'
6138
// Array of basisvalues.
6139
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6141
// Declare helper variables.
6142
unsigned int rr = 0;
6143
unsigned int ss = 0;
6144
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6146
// Compute basisvalues.
6147
basisvalues[0] = 1.000000000000000;
6148
basisvalues[1] = tmp0;
6149
for (unsigned int r = 0; r < 1; r++)
6151
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6153
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6154
}// end loop over 'r'
6155
for (unsigned int r = 0; r < 2; r++)
6157
for (unsigned int s = 0; s < 2 - r; s++)
6159
rr = (r + s)*(r + s + 1)/2 + s;
6160
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6161
}// end loop over 's'
6162
}// end loop over 'r'
6164
// Table(s) of coefficients.
6165
static const double coefficients0[3] = \
6166
{0.471404520791032, 0.000000000000000, 0.333333333333333};
6168
// Compute value(s).
6169
for (unsigned int r = 0; r < 3; r++)
6171
*values += coefficients0[r]*basisvalues[r];
6172
}// end loop over 'r'
6179
/// Evaluate all basis functions at given point in cell
6180
virtual void evaluate_basis_all(double* values,
6181
const double* coordinates,
6182
const ufc::cell& c) const
6184
// Helper variable to hold values of a single dof.
6185
double dof_values = 0.000000000000000;
6187
// Loop dofs and call evaluate_basis.
6188
for (unsigned int r = 0; r < 3; r++)
6190
evaluate_basis(r, &dof_values, coordinates, c);
6191
values[r] = dof_values;
6192
}// end loop over 'r'
6195
/// Evaluate order n derivatives of basis function i at given point in cell
6196
virtual void evaluate_basis_derivatives(unsigned int i,
6199
const double* coordinates,
6200
const ufc::cell& c) const
6202
// Extract vertex coordinates
6203
const double * const * x = c.coordinates;
6205
// Compute Jacobian of affine map from reference cell
6206
const double J_00 = x[1][0] - x[0][0];
6207
const double J_01 = x[2][0] - x[0][0];
6208
const double J_10 = x[1][1] - x[0][1];
6209
const double J_11 = x[2][1] - x[0][1];
6211
// Compute determinant of Jacobian
6212
double detJ = J_00*J_11 - J_01*J_10;
6214
// Compute inverse of Jacobian
6215
const double K_00 = J_11 / detJ;
6216
const double K_01 = -J_01 / detJ;
6217
const double K_10 = -J_10 / detJ;
6218
const double K_11 = J_00 / detJ;
6220
// Compute constants
6221
const double C0 = x[1][0] + x[2][0];
6222
const double C1 = x[1][1] + x[2][1];
6224
// Get coordinates and map to the reference (FIAT) element
6225
double X = (J_01*(C1 - 2.0*coordinates[1]) + J_11*(2.0*coordinates[0] - C0)) / detJ;
6226
double Y = (J_00*(2.0*coordinates[1] - C1) + J_10*(C0 - 2.0*coordinates[0])) / detJ;
6228
// Compute number of derivatives.
6229
unsigned int num_derivatives = 1;
6230
for (unsigned int r = 0; r < n; r++)
6232
num_derivatives *= 2;
6233
}// end loop over 'r'
6235
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
6236
unsigned int **combinations = new unsigned int *[num_derivatives];
6237
for (unsigned int row = 0; row < num_derivatives; row++)
6239
combinations[row] = new unsigned int [n];
6240
for (unsigned int col = 0; col < n; col++)
6241
combinations[row][col] = 0;
6244
// Generate combinations of derivatives
6245
for (unsigned int row = 1; row < num_derivatives; row++)
6247
for (unsigned int num = 0; num < row; num++)
6249
for (unsigned int col = n-1; col+1 > 0; col--)
6251
if (combinations[row][col] + 1 > 1)
6252
combinations[row][col] = 0;
6255
combinations[row][col] += 1;
6262
// Compute inverse of Jacobian
6263
const double Jinv[2][2] = {{K_00, K_01}, {K_10, K_11}};
6265
// Declare transformation matrix
6266
// Declare pointer to two dimensional array and initialise
6267
double **transform = new double *[num_derivatives];
6269
for (unsigned int j = 0; j < num_derivatives; j++)
6271
transform[j] = new double [num_derivatives];
6272
for (unsigned int k = 0; k < num_derivatives; k++)
6273
transform[j][k] = 1;
6276
// Construct transformation matrix
6277
for (unsigned int row = 0; row < num_derivatives; row++)
6279
for (unsigned int col = 0; col < num_derivatives; col++)
6281
for (unsigned int k = 0; k < n; k++)
6282
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
6286
// Reset values. Assuming that values is always an array.
6287
for (unsigned int r = 0; r < num_derivatives; r++)
6289
values[r] = 0.000000000000000;
6290
}// end loop over 'r'
6297
// Array of basisvalues.
6298
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6300
// Declare helper variables.
6301
unsigned int rr = 0;
6302
unsigned int ss = 0;
6303
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6305
// Compute basisvalues.
6306
basisvalues[0] = 1.000000000000000;
6307
basisvalues[1] = tmp0;
6308
for (unsigned int r = 0; r < 1; r++)
6310
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6312
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6313
}// end loop over 'r'
6314
for (unsigned int r = 0; r < 2; r++)
6316
for (unsigned int s = 0; s < 2 - r; s++)
6318
rr = (r + s)*(r + s + 1)/2 + s;
6319
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6320
}// end loop over 's'
6321
}// end loop over 'r'
6323
// Table(s) of coefficients.
6324
static const double coefficients0[3] = \
6325
{0.471404520791032, -0.288675134594813, -0.166666666666667};
6327
// Tables of derivatives of the polynomial base (transpose).
6328
static const double dmats0[3][3] = \
6329
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6330
{4.898979485566356, 0.000000000000000, 0.000000000000000},
6331
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
6333
static const double dmats1[3][3] = \
6334
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6335
{2.449489742783178, 0.000000000000000, 0.000000000000000},
6336
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
6338
// Compute reference derivatives.
6339
// Declare pointer to array of derivatives on FIAT element.
6340
double *derivatives = new double[num_derivatives];
6341
for (unsigned int r = 0; r < num_derivatives; r++)
6343
derivatives[r] = 0.000000000000000;
6344
}// end loop over 'r'
6346
// Declare derivative matrix (of polynomial basis).
6347
double dmats[3][3] = \
6348
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6349
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6350
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6352
// Declare (auxiliary) derivative matrix (of polynomial basis).
6353
double dmats_old[3][3] = \
6354
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6355
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6356
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6358
// Loop possible derivatives.
6359
for (unsigned int r = 0; r < num_derivatives; r++)
6361
// Resetting dmats values to compute next derivative.
6362
for (unsigned int t = 0; t < 3; t++)
6364
for (unsigned int u = 0; u < 3; u++)
6366
dmats[t][u] = 0.000000000000000;
6369
dmats[t][u] = 1.000000000000000;
6372
}// end loop over 'u'
6373
}// end loop over 't'
6375
// Looping derivative order to generate dmats.
6376
for (unsigned int s = 0; s < n; s++)
6378
// Updating dmats_old with new values and resetting dmats.
6379
for (unsigned int t = 0; t < 3; t++)
6381
for (unsigned int u = 0; u < 3; u++)
6383
dmats_old[t][u] = dmats[t][u];
6384
dmats[t][u] = 0.000000000000000;
6385
}// end loop over 'u'
6386
}// end loop over 't'
6388
// Update dmats using an inner product.
6389
if (combinations[r][s] == 0)
6391
for (unsigned int t = 0; t < 3; t++)
6393
for (unsigned int u = 0; u < 3; u++)
6395
for (unsigned int tu = 0; tu < 3; tu++)
6397
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
6398
}// end loop over 'tu'
6399
}// end loop over 'u'
6400
}// end loop over 't'
6403
if (combinations[r][s] == 1)
6405
for (unsigned int t = 0; t < 3; t++)
6407
for (unsigned int u = 0; u < 3; u++)
6409
for (unsigned int tu = 0; tu < 3; tu++)
6411
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
6412
}// end loop over 'tu'
6413
}// end loop over 'u'
6414
}// end loop over 't'
6417
}// end loop over 's'
6418
for (unsigned int s = 0; s < 3; s++)
6420
for (unsigned int t = 0; t < 3; t++)
6422
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
6423
}// end loop over 't'
6424
}// end loop over 's'
6425
}// end loop over 'r'
6427
// Transform derivatives back to physical element
6428
for (unsigned int r = 0; r < num_derivatives; r++)
6430
for (unsigned int s = 0; s < num_derivatives; s++)
6432
values[r] += transform[r][s]*derivatives[s];
6433
}// end loop over 's'
6434
}// end loop over 'r'
6436
// Delete pointer to array of derivatives on FIAT element
6437
delete [] derivatives;
6439
// Delete pointer to array of combinations of derivatives and transform
6440
for (unsigned int r = 0; r < num_derivatives; r++)
6442
delete [] combinations[r];
6443
}// end loop over 'r'
6444
delete [] combinations;
6445
for (unsigned int r = 0; r < num_derivatives; r++)
6447
delete [] transform[r];
6448
}// end loop over 'r'
6449
delete [] transform;
6455
// Array of basisvalues.
6456
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6458
// Declare helper variables.
6459
unsigned int rr = 0;
6460
unsigned int ss = 0;
6461
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6463
// Compute basisvalues.
6464
basisvalues[0] = 1.000000000000000;
6465
basisvalues[1] = tmp0;
6466
for (unsigned int r = 0; r < 1; r++)
6468
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6470
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6471
}// end loop over 'r'
6472
for (unsigned int r = 0; r < 2; r++)
6474
for (unsigned int s = 0; s < 2 - r; s++)
6476
rr = (r + s)*(r + s + 1)/2 + s;
6477
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6478
}// end loop over 's'
6479
}// end loop over 'r'
6481
// Table(s) of coefficients.
6482
static const double coefficients0[3] = \
6483
{0.471404520791032, 0.288675134594813, -0.166666666666667};
6485
// Tables of derivatives of the polynomial base (transpose).
6486
static const double dmats0[3][3] = \
6487
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6488
{4.898979485566356, 0.000000000000000, 0.000000000000000},
6489
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
6491
static const double dmats1[3][3] = \
6492
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6493
{2.449489742783178, 0.000000000000000, 0.000000000000000},
6494
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
6496
// Compute reference derivatives.
6497
// Declare pointer to array of derivatives on FIAT element.
6498
double *derivatives = new double[num_derivatives];
6499
for (unsigned int r = 0; r < num_derivatives; r++)
6501
derivatives[r] = 0.000000000000000;
6502
}// end loop over 'r'
6504
// Declare derivative matrix (of polynomial basis).
6505
double dmats[3][3] = \
6506
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6507
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6508
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6510
// Declare (auxiliary) derivative matrix (of polynomial basis).
6511
double dmats_old[3][3] = \
6512
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6513
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6514
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6516
// Loop possible derivatives.
6517
for (unsigned int r = 0; r < num_derivatives; r++)
6519
// Resetting dmats values to compute next derivative.
6520
for (unsigned int t = 0; t < 3; t++)
6522
for (unsigned int u = 0; u < 3; u++)
6524
dmats[t][u] = 0.000000000000000;
6527
dmats[t][u] = 1.000000000000000;
6530
}// end loop over 'u'
6531
}// end loop over 't'
6533
// Looping derivative order to generate dmats.
6534
for (unsigned int s = 0; s < n; s++)
6536
// Updating dmats_old with new values and resetting dmats.
6537
for (unsigned int t = 0; t < 3; t++)
6539
for (unsigned int u = 0; u < 3; u++)
6541
dmats_old[t][u] = dmats[t][u];
6542
dmats[t][u] = 0.000000000000000;
6543
}// end loop over 'u'
6544
}// end loop over 't'
6546
// Update dmats using an inner product.
6547
if (combinations[r][s] == 0)
6549
for (unsigned int t = 0; t < 3; t++)
6551
for (unsigned int u = 0; u < 3; u++)
6553
for (unsigned int tu = 0; tu < 3; tu++)
6555
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
6556
}// end loop over 'tu'
6557
}// end loop over 'u'
6558
}// end loop over 't'
6561
if (combinations[r][s] == 1)
6563
for (unsigned int t = 0; t < 3; t++)
6565
for (unsigned int u = 0; u < 3; u++)
6567
for (unsigned int tu = 0; tu < 3; tu++)
6569
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
6570
}// end loop over 'tu'
6571
}// end loop over 'u'
6572
}// end loop over 't'
6575
}// end loop over 's'
6576
for (unsigned int s = 0; s < 3; s++)
6578
for (unsigned int t = 0; t < 3; t++)
6580
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
6581
}// end loop over 't'
6582
}// end loop over 's'
6583
}// end loop over 'r'
6585
// Transform derivatives back to physical element
6586
for (unsigned int r = 0; r < num_derivatives; r++)
6588
for (unsigned int s = 0; s < num_derivatives; s++)
6590
values[r] += transform[r][s]*derivatives[s];
6591
}// end loop over 's'
6592
}// end loop over 'r'
6594
// Delete pointer to array of derivatives on FIAT element
6595
delete [] derivatives;
6597
// Delete pointer to array of combinations of derivatives and transform
6598
for (unsigned int r = 0; r < num_derivatives; r++)
6600
delete [] combinations[r];
6601
}// end loop over 'r'
6602
delete [] combinations;
6603
for (unsigned int r = 0; r < num_derivatives; r++)
6605
delete [] transform[r];
6606
}// end loop over 'r'
6607
delete [] transform;
6613
// Array of basisvalues.
6614
double basisvalues[3] = {0.000000000000000, 0.000000000000000, 0.000000000000000};
6616
// Declare helper variables.
6617
unsigned int rr = 0;
6618
unsigned int ss = 0;
6619
double tmp0 = (1.000000000000000 + Y + 2.000000000000000*X)/2.000000000000000;
6621
// Compute basisvalues.
6622
basisvalues[0] = 1.000000000000000;
6623
basisvalues[1] = tmp0;
6624
for (unsigned int r = 0; r < 1; r++)
6626
rr = (r + 1)*(r + 1 + 1)/2 + 1;
6628
basisvalues[rr] = basisvalues[ss]*(0.500000000000000 + r + Y*(1.500000000000000 + r));
6629
}// end loop over 'r'
6630
for (unsigned int r = 0; r < 2; r++)
6632
for (unsigned int s = 0; s < 2 - r; s++)
6634
rr = (r + s)*(r + s + 1)/2 + s;
6635
basisvalues[rr] *= std::sqrt((0.500000000000000 + r)*(1.000000000000000 + r + s));
6636
}// end loop over 's'
6637
}// end loop over 'r'
6639
// Table(s) of coefficients.
6640
static const double coefficients0[3] = \
6641
{0.471404520791032, 0.000000000000000, 0.333333333333333};
6643
// Tables of derivatives of the polynomial base (transpose).
6644
static const double dmats0[3][3] = \
6645
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6646
{4.898979485566356, 0.000000000000000, 0.000000000000000},
6647
{0.000000000000000, 0.000000000000000, 0.000000000000000}};
6649
static const double dmats1[3][3] = \
6650
{{0.000000000000000, 0.000000000000000, 0.000000000000000},
6651
{2.449489742783178, 0.000000000000000, 0.000000000000000},
6652
{4.242640687119285, 0.000000000000000, 0.000000000000000}};
6654
// Compute reference derivatives.
6655
// Declare pointer to array of derivatives on FIAT element.
6656
double *derivatives = new double[num_derivatives];
6657
for (unsigned int r = 0; r < num_derivatives; r++)
6659
derivatives[r] = 0.000000000000000;
6660
}// end loop over 'r'
6662
// Declare derivative matrix (of polynomial basis).
6663
double dmats[3][3] = \
6664
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6665
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6666
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6668
// Declare (auxiliary) derivative matrix (of polynomial basis).
6669
double dmats_old[3][3] = \
6670
{{1.000000000000000, 0.000000000000000, 0.000000000000000},
6671
{0.000000000000000, 1.000000000000000, 0.000000000000000},
6672
{0.000000000000000, 0.000000000000000, 1.000000000000000}};
6674
// Loop possible derivatives.
6675
for (unsigned int r = 0; r < num_derivatives; r++)
6677
// Resetting dmats values to compute next derivative.
6678
for (unsigned int t = 0; t < 3; t++)
6680
for (unsigned int u = 0; u < 3; u++)
6682
dmats[t][u] = 0.000000000000000;
6685
dmats[t][u] = 1.000000000000000;
6688
}// end loop over 'u'
6689
}// end loop over 't'
6691
// Looping derivative order to generate dmats.
6692
for (unsigned int s = 0; s < n; s++)
6694
// Updating dmats_old with new values and resetting dmats.
6695
for (unsigned int t = 0; t < 3; t++)
6697
for (unsigned int u = 0; u < 3; u++)
6699
dmats_old[t][u] = dmats[t][u];
6700
dmats[t][u] = 0.000000000000000;
6701
}// end loop over 'u'
6702
}// end loop over 't'
6704
// Update dmats using an inner product.
6705
if (combinations[r][s] == 0)
6707
for (unsigned int t = 0; t < 3; t++)
6709
for (unsigned int u = 0; u < 3; u++)
6711
for (unsigned int tu = 0; tu < 3; tu++)
6713
dmats[t][u] += dmats0[t][tu]*dmats_old[tu][u];
6714
}// end loop over 'tu'
6715
}// end loop over 'u'
6716
}// end loop over 't'
6719
if (combinations[r][s] == 1)
6721
for (unsigned int t = 0; t < 3; t++)
6723
for (unsigned int u = 0; u < 3; u++)
6725
for (unsigned int tu = 0; tu < 3; tu++)
6727
dmats[t][u] += dmats1[t][tu]*dmats_old[tu][u];
6728
}// end loop over 'tu'
6729
}// end loop over 'u'
6730
}// end loop over 't'
6733
}// end loop over 's'
6734
for (unsigned int s = 0; s < 3; s++)
6736
for (unsigned int t = 0; t < 3; t++)
6738
derivatives[r] += coefficients0[s]*dmats[s][t]*basisvalues[t];
6739
}// end loop over 't'
6740
}// end loop over 's'
6741
}// end loop over 'r'
6743
// Transform derivatives back to physical element
6744
for (unsigned int r = 0; r < num_derivatives; r++)
6746
for (unsigned int s = 0; s < num_derivatives; s++)
6748
values[r] += transform[r][s]*derivatives[s];
6749
}// end loop over 's'
6750
}// end loop over 'r'
6752
// Delete pointer to array of derivatives on FIAT element
6753
delete [] derivatives;
6755
// Delete pointer to array of combinations of derivatives and transform
6756
for (unsigned int r = 0; r < num_derivatives; r++)
6758
delete [] combinations[r];
6759
}// end loop over 'r'
6760
delete [] combinations;
6761
for (unsigned int r = 0; r < num_derivatives; r++)
6763
delete [] transform[r];
6764
}// end loop over 'r'
6765
delete [] transform;
6772
/// Evaluate order n derivatives of all basis functions at given point in cell
6773
virtual void evaluate_basis_derivatives_all(unsigned int n,
6775
const double* coordinates,
6776
const ufc::cell& c) const
6778
// Compute number of derivatives.
6779
unsigned int num_derivatives = 1;
6780
for (unsigned int r = 0; r < n; r++)
6782
num_derivatives *= 2;
6783
}// end loop over 'r'
6785
// Helper variable to hold values of a single dof.
6786
double *dof_values = new double[num_derivatives];
6787
for (unsigned int r = 0; r < num_derivatives; r++)
6789
dof_values[r] = 0.000000000000000;
6790
}// end loop over 'r'
6792
// Loop dofs and call evaluate_basis_derivatives.
6793
for (unsigned int r = 0; r < 3; r++)
6795
evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
6796
for (unsigned int s = 0; s < num_derivatives; s++)
6798
values[r*num_derivatives + s] = dof_values[s];
6799
}// end loop over 's'
6800
}// end loop over 'r'
6803
delete [] dof_values;
6806
/// Evaluate linear functional for dof i on the function f
6807
virtual double evaluate_dof(unsigned int i,
6808
const ufc::function& f,
6809
const ufc::cell& c) const
6811
// Declare variables for result of evaluation.
6814
// Declare variable for physical coordinates.
6816
const double * const * x = c.coordinates;
6823
f.evaluate(vals, y, c);
6831
f.evaluate(vals, y, c);
6839
f.evaluate(vals, y, c);
6845
return 0.000000000000000;
6848
/// Evaluate linear functionals for all dofs on the function f
6849
virtual void evaluate_dofs(double* values,
6850
const ufc::function& f,
6851
const ufc::cell& c) const
6853
// Declare variables for result of evaluation.
6856
// Declare variable for physical coordinates.
6858
const double * const * x = c.coordinates;
6861
f.evaluate(vals, y, c);
6862
values[0] = vals[0];
6865
f.evaluate(vals, y, c);
6866
values[1] = vals[0];
6869
f.evaluate(vals, y, c);
6870
values[2] = vals[0];
6873
/// Interpolate vertex values from dof values
6874
virtual void interpolate_vertex_values(double* vertex_values,
6875
const double* dof_values,
6876
const ufc::cell& c) const
6878
// Evaluate function and change variables
6879
vertex_values[0] = dof_values[0];
6880
vertex_values[1] = dof_values[1];
6881
vertex_values[2] = dof_values[2];
6884
/// Map coordinate xhat from reference cell to coordinate x in cell
6885
virtual void map_from_reference_cell(double* x,
6889
throw std::runtime_error("map_from_reference_cell not yet implemented (introduced in UFC 2.0).");
6892
/// Map from coordinate x in cell to coordinate xhat in reference cell
6893
virtual void map_to_reference_cell(double* xhat,
6897
throw std::runtime_error("map_to_reference_cell not yet implemented (introduced in UFC 2.0).");
6900
/// Return the number of sub elements (for a mixed element)
6901
virtual unsigned int num_sub_elements() const
6906
/// Create a new finite element for sub element i (for a mixed element)
6907
virtual ufc::finite_element* create_sub_element(unsigned int i) const
6912
/// Create a new class instance
6913
virtual ufc::finite_element* create() const
6915
return new adaptivepoisson_finite_element_5();
6920
/// This class defines the interface for a local-to-global mapping of
6921
/// degrees of freedom (dofs).
6923
class adaptivepoisson_dofmap_0: public ufc::dofmap
6927
unsigned int _global_dimension;
6931
adaptivepoisson_dofmap_0() : ufc::dofmap()
6933
_global_dimension = 0;
6937
virtual ~adaptivepoisson_dofmap_0()
6942
/// Return a string identifying the dofmap
6943
virtual const char* signature() const
6945
return "FFC dofmap for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
6948
/// Return true iff mesh entities of topological dimension d are needed
6949
virtual bool needs_mesh_entities(unsigned int d) const
6973
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
6974
virtual bool init_mesh(const ufc::mesh& m)
6976
_global_dimension = m.num_entities[2];
6980
/// Initialize dofmap for given cell
6981
virtual void init_cell(const ufc::mesh& m,
6987
/// Finish initialization of dofmap for cells
6988
virtual void init_cell_finalize()
6993
/// Return the topological dimension of the associated cell shape
6994
virtual unsigned int topological_dimension() const
6999
/// Return the geometric dimension of the associated cell shape
7000
virtual unsigned int geometric_dimension() const
7005
/// Return the dimension of the global finite element function space
7006
virtual unsigned int global_dimension() const
7008
return _global_dimension;
7011
/// Return the dimension of the local finite element function space for a cell
7012
virtual unsigned int local_dimension(const ufc::cell& c) const
7017
/// Return the maximum dimension of the local finite element function space
7018
virtual unsigned int max_local_dimension() const
7023
/// Return the number of dofs on each cell facet
7024
virtual unsigned int num_facet_dofs() const
7029
/// Return the number of dofs associated with each cell entity of dimension d
7030
virtual unsigned int num_entity_dofs(unsigned int d) const
7054
/// Tabulate the local-to-global mapping of dofs on a cell
7055
virtual void tabulate_dofs(unsigned int* dofs,
7057
const ufc::cell& c) const
7059
dofs[0] = c.entity_indices[2][0];
7062
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
7063
virtual void tabulate_facet_dofs(unsigned int* dofs,
7064
unsigned int facet) const
7087
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
7088
virtual void tabulate_entity_dofs(unsigned int* dofs,
7089
unsigned int d, unsigned int i) const
7093
throw std::runtime_error("d is larger than dimension (2)");
7112
throw std::runtime_error("i is larger than number of entities (0)");
7122
/// Tabulate the coordinates of all dofs on a cell
7123
virtual void tabulate_coordinates(double** coordinates,
7124
const ufc::cell& c) const
7126
const double * const * x = c.coordinates;
7128
coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
7129
coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
7132
/// Return the number of sub dofmaps (for a mixed element)
7133
virtual unsigned int num_sub_dofmaps() const
7138
/// Create a new dofmap for sub dofmap i (for a mixed element)
7139
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
7144
/// Create a new class instance
7145
virtual ufc::dofmap* create() const
7147
return new adaptivepoisson_dofmap_0();
7152
/// This class defines the interface for a local-to-global mapping of
7153
/// degrees of freedom (dofs).
7155
class adaptivepoisson_dofmap_1: public ufc::dofmap
7159
unsigned int _global_dimension;
7163
adaptivepoisson_dofmap_1() : ufc::dofmap()
7165
_global_dimension = 0;
7169
virtual ~adaptivepoisson_dofmap_1()
7174
/// Return a string identifying the dofmap
7175
virtual const char* signature() const
7177
return "FFC dofmap for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
7180
/// Return true iff mesh entities of topological dimension d are needed
7181
virtual bool needs_mesh_entities(unsigned int d) const
7205
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
7206
virtual bool init_mesh(const ufc::mesh& m)
7208
_global_dimension = m.num_entities[0] + m.num_entities[1];
7212
/// Initialize dofmap for given cell
7213
virtual void init_cell(const ufc::mesh& m,
7219
/// Finish initialization of dofmap for cells
7220
virtual void init_cell_finalize()
7225
/// Return the topological dimension of the associated cell shape
7226
virtual unsigned int topological_dimension() const
7231
/// Return the geometric dimension of the associated cell shape
7232
virtual unsigned int geometric_dimension() const
7237
/// Return the dimension of the global finite element function space
7238
virtual unsigned int global_dimension() const
7240
return _global_dimension;
7243
/// Return the dimension of the local finite element function space for a cell
7244
virtual unsigned int local_dimension(const ufc::cell& c) const
7249
/// Return the maximum dimension of the local finite element function space
7250
virtual unsigned int max_local_dimension() const
7255
/// Return the number of dofs on each cell facet
7256
virtual unsigned int num_facet_dofs() const
7261
/// Return the number of dofs associated with each cell entity of dimension d
7262
virtual unsigned int num_entity_dofs(unsigned int d) const
7286
/// Tabulate the local-to-global mapping of dofs on a cell
7287
virtual void tabulate_dofs(unsigned int* dofs,
7289
const ufc::cell& c) const
7291
unsigned int offset = 0;
7292
dofs[0] = offset + c.entity_indices[0][0];
7293
dofs[1] = offset + c.entity_indices[0][1];
7294
dofs[2] = offset + c.entity_indices[0][2];
7295
offset += m.num_entities[0];
7296
dofs[3] = offset + c.entity_indices[1][0];
7297
dofs[4] = offset + c.entity_indices[1][1];
7298
dofs[5] = offset + c.entity_indices[1][2];
7299
offset += m.num_entities[1];
7302
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
7303
virtual void tabulate_facet_dofs(unsigned int* dofs,
7304
unsigned int facet) const
7333
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
7334
virtual void tabulate_entity_dofs(unsigned int* dofs,
7335
unsigned int d, unsigned int i) const
7339
throw std::runtime_error("d is larger than dimension (2)");
7348
throw std::runtime_error("i is larger than number of entities (2)");
7376
throw std::runtime_error("i is larger than number of entities (2)");
7409
/// Tabulate the coordinates of all dofs on a cell
7410
virtual void tabulate_coordinates(double** coordinates,
7411
const ufc::cell& c) const
7413
const double * const * x = c.coordinates;
7415
coordinates[0][0] = x[0][0];
7416
coordinates[0][1] = x[0][1];
7417
coordinates[1][0] = x[1][0];
7418
coordinates[1][1] = x[1][1];
7419
coordinates[2][0] = x[2][0];
7420
coordinates[2][1] = x[2][1];
7421
coordinates[3][0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
7422
coordinates[3][1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
7423
coordinates[4][0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
7424
coordinates[4][1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
7425
coordinates[5][0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
7426
coordinates[5][1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
7429
/// Return the number of sub dofmaps (for a mixed element)
7430
virtual unsigned int num_sub_dofmaps() const
7435
/// Create a new dofmap for sub dofmap i (for a mixed element)
7436
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
7441
/// Create a new class instance
7442
virtual ufc::dofmap* create() const
7444
return new adaptivepoisson_dofmap_1();
7449
/// This class defines the interface for a local-to-global mapping of
7450
/// degrees of freedom (dofs).
7452
class adaptivepoisson_dofmap_2: public ufc::dofmap
7456
unsigned int _global_dimension;
7460
adaptivepoisson_dofmap_2() : ufc::dofmap()
7462
_global_dimension = 0;
7466
virtual ~adaptivepoisson_dofmap_2()
7471
/// Return a string identifying the dofmap
7472
virtual const char* signature() const
7474
return "FFC dofmap for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2)";
7477
/// Return true iff mesh entities of topological dimension d are needed
7478
virtual bool needs_mesh_entities(unsigned int d) const
7502
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
7503
virtual bool init_mesh(const ufc::mesh& m)
7505
_global_dimension = 6.000000000000000*m.num_entities[2];
7509
/// Initialize dofmap for given cell
7510
virtual void init_cell(const ufc::mesh& m,
7516
/// Finish initialization of dofmap for cells
7517
virtual void init_cell_finalize()
7522
/// Return the topological dimension of the associated cell shape
7523
virtual unsigned int topological_dimension() const
7528
/// Return the geometric dimension of the associated cell shape
7529
virtual unsigned int geometric_dimension() const
7534
/// Return the dimension of the global finite element function space
7535
virtual unsigned int global_dimension() const
7537
return _global_dimension;
7540
/// Return the dimension of the local finite element function space for a cell
7541
virtual unsigned int local_dimension(const ufc::cell& c) const
7546
/// Return the maximum dimension of the local finite element function space
7547
virtual unsigned int max_local_dimension() const
7552
/// Return the number of dofs on each cell facet
7553
virtual unsigned int num_facet_dofs() const
7558
/// Return the number of dofs associated with each cell entity of dimension d
7559
virtual unsigned int num_entity_dofs(unsigned int d) const
7583
/// Tabulate the local-to-global mapping of dofs on a cell
7584
virtual void tabulate_dofs(unsigned int* dofs,
7586
const ufc::cell& c) const
7588
dofs[0] = 6*c.entity_indices[2][0];
7589
dofs[1] = 6*c.entity_indices[2][0] + 1;
7590
dofs[2] = 6*c.entity_indices[2][0] + 2;
7591
dofs[3] = 6*c.entity_indices[2][0] + 3;
7592
dofs[4] = 6*c.entity_indices[2][0] + 4;
7593
dofs[5] = 6*c.entity_indices[2][0] + 5;
7596
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
7597
virtual void tabulate_facet_dofs(unsigned int* dofs,
7598
unsigned int facet) const
7621
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
7622
virtual void tabulate_entity_dofs(unsigned int* dofs,
7623
unsigned int d, unsigned int i) const
7627
throw std::runtime_error("d is larger than dimension (2)");
7646
throw std::runtime_error("i is larger than number of entities (0)");
7661
/// Tabulate the coordinates of all dofs on a cell
7662
virtual void tabulate_coordinates(double** coordinates,
7663
const ufc::cell& c) const
7665
const double * const * x = c.coordinates;
7667
coordinates[0][0] = x[0][0];
7668
coordinates[0][1] = x[0][1];
7669
coordinates[1][0] = x[1][0];
7670
coordinates[1][1] = x[1][1];
7671
coordinates[2][0] = x[2][0];
7672
coordinates[2][1] = x[2][1];
7673
coordinates[3][0] = 0.500000000000000*x[1][0] + 0.500000000000000*x[2][0];
7674
coordinates[3][1] = 0.500000000000000*x[1][1] + 0.500000000000000*x[2][1];
7675
coordinates[4][0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[2][0];
7676
coordinates[4][1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[2][1];
7677
coordinates[5][0] = 0.500000000000000*x[0][0] + 0.500000000000000*x[1][0];
7678
coordinates[5][1] = 0.500000000000000*x[0][1] + 0.500000000000000*x[1][1];
7681
/// Return the number of sub dofmaps (for a mixed element)
7682
virtual unsigned int num_sub_dofmaps() const
7687
/// Create a new dofmap for sub dofmap i (for a mixed element)
7688
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
7693
/// Create a new class instance
7694
virtual ufc::dofmap* create() const
7696
return new adaptivepoisson_dofmap_2();
7701
/// This class defines the interface for a local-to-global mapping of
7702
/// degrees of freedom (dofs).
7704
class adaptivepoisson_dofmap_3: public ufc::dofmap
7708
unsigned int _global_dimension;
7712
adaptivepoisson_dofmap_3() : ufc::dofmap()
7714
_global_dimension = 0;
7718
virtual ~adaptivepoisson_dofmap_3()
7723
/// Return a string identifying the dofmap
7724
virtual const char* signature() const
7726
return "FFC dofmap for FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3)";
7729
/// Return true iff mesh entities of topological dimension d are needed
7730
virtual bool needs_mesh_entities(unsigned int d) const
7754
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
7755
virtual bool init_mesh(const ufc::mesh& m)
7757
_global_dimension = m.num_entities[2];
7761
/// Initialize dofmap for given cell
7762
virtual void init_cell(const ufc::mesh& m,
7768
/// Finish initialization of dofmap for cells
7769
virtual void init_cell_finalize()
7774
/// Return the topological dimension of the associated cell shape
7775
virtual unsigned int topological_dimension() const
7780
/// Return the geometric dimension of the associated cell shape
7781
virtual unsigned int geometric_dimension() const
7786
/// Return the dimension of the global finite element function space
7787
virtual unsigned int global_dimension() const
7789
return _global_dimension;
7792
/// Return the dimension of the local finite element function space for a cell
7793
virtual unsigned int local_dimension(const ufc::cell& c) const
7798
/// Return the maximum dimension of the local finite element function space
7799
virtual unsigned int max_local_dimension() const
7804
/// Return the number of dofs on each cell facet
7805
virtual unsigned int num_facet_dofs() const
7810
/// Return the number of dofs associated with each cell entity of dimension d
7811
virtual unsigned int num_entity_dofs(unsigned int d) const
7835
/// Tabulate the local-to-global mapping of dofs on a cell
7836
virtual void tabulate_dofs(unsigned int* dofs,
7838
const ufc::cell& c) const
7840
dofs[0] = c.entity_indices[2][0];
7843
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
7844
virtual void tabulate_facet_dofs(unsigned int* dofs,
7845
unsigned int facet) const
7868
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
7869
virtual void tabulate_entity_dofs(unsigned int* dofs,
7870
unsigned int d, unsigned int i) const
7874
throw std::runtime_error("d is larger than dimension (2)");
7893
throw std::runtime_error("i is larger than number of entities (0)");
7903
/// Tabulate the coordinates of all dofs on a cell
7904
virtual void tabulate_coordinates(double** coordinates,
7905
const ufc::cell& c) const
7907
const double * const * x = c.coordinates;
7909
coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
7910
coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
7913
/// Return the number of sub dofmaps (for a mixed element)
7914
virtual unsigned int num_sub_dofmaps() const
7919
/// Create a new dofmap for sub dofmap i (for a mixed element)
7920
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
7925
/// Create a new class instance
7926
virtual ufc::dofmap* create() const
7928
return new adaptivepoisson_dofmap_3();
7933
/// This class defines the interface for a local-to-global mapping of
7934
/// degrees of freedom (dofs).
7936
class adaptivepoisson_dofmap_4: public ufc::dofmap
7940
unsigned int _global_dimension;
7944
adaptivepoisson_dofmap_4() : ufc::dofmap()
7946
_global_dimension = 0;
7950
virtual ~adaptivepoisson_dofmap_4()
7955
/// Return a string identifying the dofmap
7956
virtual const char* signature() const
7958
return "FFC dofmap for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1)";
7961
/// Return true iff mesh entities of topological dimension d are needed
7962
virtual bool needs_mesh_entities(unsigned int d) const
7986
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
7987
virtual bool init_mesh(const ufc::mesh& m)
7989
_global_dimension = 3.000000000000000*m.num_entities[2];
7993
/// Initialize dofmap for given cell
7994
virtual void init_cell(const ufc::mesh& m,
8000
/// Finish initialization of dofmap for cells
8001
virtual void init_cell_finalize()
8006
/// Return the topological dimension of the associated cell shape
8007
virtual unsigned int topological_dimension() const
8012
/// Return the geometric dimension of the associated cell shape
8013
virtual unsigned int geometric_dimension() const
8018
/// Return the dimension of the global finite element function space
8019
virtual unsigned int global_dimension() const
8021
return _global_dimension;
8024
/// Return the dimension of the local finite element function space for a cell
8025
virtual unsigned int local_dimension(const ufc::cell& c) const
8030
/// Return the maximum dimension of the local finite element function space
8031
virtual unsigned int max_local_dimension() const
8036
/// Return the number of dofs on each cell facet
8037
virtual unsigned int num_facet_dofs() const
8042
/// Return the number of dofs associated with each cell entity of dimension d
8043
virtual unsigned int num_entity_dofs(unsigned int d) const
8067
/// Tabulate the local-to-global mapping of dofs on a cell
8068
virtual void tabulate_dofs(unsigned int* dofs,
8070
const ufc::cell& c) const
8072
dofs[0] = 3*c.entity_indices[2][0];
8073
dofs[1] = 3*c.entity_indices[2][0] + 1;
8074
dofs[2] = 3*c.entity_indices[2][0] + 2;
8077
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
8078
virtual void tabulate_facet_dofs(unsigned int* dofs,
8079
unsigned int facet) const
8102
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
8103
virtual void tabulate_entity_dofs(unsigned int* dofs,
8104
unsigned int d, unsigned int i) const
8108
throw std::runtime_error("d is larger than dimension (2)");
8127
throw std::runtime_error("i is larger than number of entities (0)");
8139
/// Tabulate the coordinates of all dofs on a cell
8140
virtual void tabulate_coordinates(double** coordinates,
8141
const ufc::cell& c) const
8143
const double * const * x = c.coordinates;
8145
coordinates[0][0] = x[0][0];
8146
coordinates[0][1] = x[0][1];
8147
coordinates[1][0] = x[1][0];
8148
coordinates[1][1] = x[1][1];
8149
coordinates[2][0] = x[2][0];
8150
coordinates[2][1] = x[2][1];
8153
/// Return the number of sub dofmaps (for a mixed element)
8154
virtual unsigned int num_sub_dofmaps() const
8159
/// Create a new dofmap for sub dofmap i (for a mixed element)
8160
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
8165
/// Create a new class instance
8166
virtual ufc::dofmap* create() const
8168
return new adaptivepoisson_dofmap_4();
8173
/// This class defines the interface for a local-to-global mapping of
8174
/// degrees of freedom (dofs).
8176
class adaptivepoisson_dofmap_5: public ufc::dofmap
8180
unsigned int _global_dimension;
8184
adaptivepoisson_dofmap_5() : ufc::dofmap()
8186
_global_dimension = 0;
8190
virtual ~adaptivepoisson_dofmap_5()
8195
/// Return a string identifying the dofmap
8196
virtual const char* signature() const
8198
return "FFC dofmap for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
8201
/// Return true iff mesh entities of topological dimension d are needed
8202
virtual bool needs_mesh_entities(unsigned int d) const
8226
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
8227
virtual bool init_mesh(const ufc::mesh& m)
8229
_global_dimension = m.num_entities[0];
8233
/// Initialize dofmap for given cell
8234
virtual void init_cell(const ufc::mesh& m,
8240
/// Finish initialization of dofmap for cells
8241
virtual void init_cell_finalize()
8246
/// Return the topological dimension of the associated cell shape
8247
virtual unsigned int topological_dimension() const
8252
/// Return the geometric dimension of the associated cell shape
8253
virtual unsigned int geometric_dimension() const
8258
/// Return the dimension of the global finite element function space
8259
virtual unsigned int global_dimension() const
8261
return _global_dimension;
8264
/// Return the dimension of the local finite element function space for a cell
8265
virtual unsigned int local_dimension(const ufc::cell& c) const
8270
/// Return the maximum dimension of the local finite element function space
8271
virtual unsigned int max_local_dimension() const
8276
/// Return the number of dofs on each cell facet
8277
virtual unsigned int num_facet_dofs() const
8282
/// Return the number of dofs associated with each cell entity of dimension d
8283
virtual unsigned int num_entity_dofs(unsigned int d) const
8307
/// Tabulate the local-to-global mapping of dofs on a cell
8308
virtual void tabulate_dofs(unsigned int* dofs,
8310
const ufc::cell& c) const
8312
dofs[0] = c.entity_indices[0][0];
8313
dofs[1] = c.entity_indices[0][1];
8314
dofs[2] = c.entity_indices[0][2];
8317
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
8318
virtual void tabulate_facet_dofs(unsigned int* dofs,
8319
unsigned int facet) const
8345
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
8346
virtual void tabulate_entity_dofs(unsigned int* dofs,
8347
unsigned int d, unsigned int i) const
8351
throw std::runtime_error("d is larger than dimension (2)");
8360
throw std::runtime_error("i is larger than number of entities (2)");
8398
/// Tabulate the coordinates of all dofs on a cell
8399
virtual void tabulate_coordinates(double** coordinates,
8400
const ufc::cell& c) const
8402
const double * const * x = c.coordinates;
8404
coordinates[0][0] = x[0][0];
8405
coordinates[0][1] = x[0][1];
8406
coordinates[1][0] = x[1][0];
8407
coordinates[1][1] = x[1][1];
8408
coordinates[2][0] = x[2][0];
8409
coordinates[2][1] = x[2][1];
8412
/// Return the number of sub dofmaps (for a mixed element)
8413
virtual unsigned int num_sub_dofmaps() const
8418
/// Create a new dofmap for sub dofmap i (for a mixed element)
8419
virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
8424
/// Create a new class instance
8425
virtual ufc::dofmap* create() const
8427
return new adaptivepoisson_dofmap_5();
8432
/// This class defines the interface for the tabulation of the cell
8433
/// tensor corresponding to the local contribution to a form from
8434
/// the integral over a cell.
8436
class adaptivepoisson_cell_integral_0_0: public ufc::cell_integral
8441
adaptivepoisson_cell_integral_0_0() : ufc::cell_integral()
8447
virtual ~adaptivepoisson_cell_integral_0_0()
8452
/// Tabulate the tensor for the contribution from a local cell
8453
virtual void tabulate_tensor(double* A,
8454
const double * const * w,
8455
const ufc::cell& c) const
8457
// Number of operations (multiply-add pairs) for Jacobian data: 11
8458
// Number of operations (multiply-add pairs) for geometry tensor: 8
8459
// Number of operations (multiply-add pairs) for tensor contraction: 11
8460
// Total number of operations (multiply-add pairs): 30
8462
// Extract vertex coordinates
8463
const double * const * x = c.coordinates;
8465
// Compute Jacobian of affine map from reference cell
8466
const double J_00 = x[1][0] - x[0][0];
8467
const double J_01 = x[2][0] - x[0][0];
8468
const double J_10 = x[1][1] - x[0][1];
8469
const double J_11 = x[2][1] - x[0][1];
8471
// Compute determinant of Jacobian
8472
double detJ = J_00*J_11 - J_01*J_10;
8474
// Compute inverse of Jacobian
8475
const double K_00 = J_11 / detJ;
8476
const double K_01 = -J_01 / detJ;
8477
const double K_10 = -J_10 / detJ;
8478
const double K_11 = J_00 / detJ;
8481
const double det = std::abs(detJ);
8483
// Compute geometry tensor
8484
const double G0_0_0 = det*(K_00*K_00 + K_01*K_01);
8485
const double G0_0_1 = det*(K_00*K_10 + K_01*K_11);
8486
const double G0_1_0 = det*(K_10*K_00 + K_11*K_01);
8487
const double G0_1_1 = det*(K_10*K_10 + K_11*K_11);
8489
// Compute element tensor
8490
A[0] = 0.500000000000000*G0_0_0 + 0.500000000000000*G0_0_1 + 0.500000000000000*G0_1_0 + 0.500000000000000*G0_1_1;
8491
A[1] = -0.500000000000000*G0_0_0 - 0.500000000000000*G0_1_0;
8492
A[2] = -0.500000000000000*G0_0_1 - 0.500000000000000*G0_1_1;
8493
A[3] = -0.500000000000000*G0_0_0 - 0.500000000000000*G0_0_1;
8494
A[4] = 0.500000000000000*G0_0_0;
8495
A[5] = 0.500000000000000*G0_0_1;
8496
A[6] = -0.500000000000000*G0_1_0 - 0.500000000000000*G0_1_1;
8497
A[7] = 0.500000000000000*G0_1_0;
8498
A[8] = 0.500000000000000*G0_1_1;
8501
/// Tabulate the tensor for the contribution from a local cell
8502
/// using the specified reference cell quadrature points/weights
8503
virtual void tabulate_tensor(double* A,
8504
const double * const * w,
8506
unsigned int num_quadrature_points,
8507
const double * const * quadrature_points,
8508
const double* quadrature_weights) const
8510
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
8515
/// This class defines the interface for the tabulation of the cell
8516
/// tensor corresponding to the local contribution to a form from
8517
/// the integral over a cell.
8519
class adaptivepoisson_cell_integral_1_0: public ufc::cell_integral
8524
adaptivepoisson_cell_integral_1_0() : ufc::cell_integral()
8530
virtual ~adaptivepoisson_cell_integral_1_0()
8535
/// Tabulate the tensor for the contribution from a local cell
8536
virtual void tabulate_tensor(double* A,
8537
const double * const * w,
8538
const ufc::cell& c) const
8540
// Number of operations (multiply-add pairs) for Jacobian data: 9
8541
// Number of operations (multiply-add pairs) for geometry tensor: 0
8542
// Number of operations (multiply-add pairs) for tensor contraction: 1
8543
// Total number of operations (multiply-add pairs): 10
8545
// Extract vertex coordinates
8546
const double * const * x = c.coordinates;
8548
// Compute Jacobian of affine map from reference cell
8549
const double J_00 = x[1][0] - x[0][0];
8550
const double J_01 = x[2][0] - x[0][0];
8551
const double J_10 = x[1][1] - x[0][1];
8552
const double J_11 = x[2][1] - x[0][1];
8554
// Compute determinant of Jacobian
8555
double detJ = J_00*J_11 - J_01*J_10;
8557
// Compute inverse of Jacobian
8560
const double det = std::abs(detJ);
8562
// Compute geometry tensor
8563
const double G0_ = det;
8565
// Compute element tensor
8566
A[0] = 0.166666666666667*G0_;
8567
A[1] = 0.166666666666667*G0_;
8568
A[2] = 0.166666666666667*G0_;
8571
/// Tabulate the tensor for the contribution from a local cell
8572
/// using the specified reference cell quadrature points/weights
8573
virtual void tabulate_tensor(double* A,
8574
const double * const * w,
8576
unsigned int num_quadrature_points,
8577
const double * const * quadrature_points,
8578
const double* quadrature_weights) const
8580
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
8585
/// This class defines the interface for the tabulation of the cell
8586
/// tensor corresponding to the local contribution to a form from
8587
/// the integral over a cell.
8589
class adaptivepoisson_cell_integral_2_0: public ufc::cell_integral
8594
adaptivepoisson_cell_integral_2_0() : ufc::cell_integral()
8600
virtual ~adaptivepoisson_cell_integral_2_0()
8605
/// Tabulate the tensor for the contribution from a local cell
8606
virtual void tabulate_tensor(double* A,
8607
const double * const * w,
8608
const ufc::cell& c) const
8610
// Number of operations (multiply-add pairs) for Jacobian data: 9
8611
// Number of operations (multiply-add pairs) for geometry tensor: 1
8612
// Number of operations (multiply-add pairs) for tensor contraction: 4
8613
// Total number of operations (multiply-add pairs): 14
8615
// Extract vertex coordinates
8616
const double * const * x = c.coordinates;
8618
// Compute Jacobian of affine map from reference cell
8619
const double J_00 = x[1][0] - x[0][0];
8620
const double J_01 = x[2][0] - x[0][0];
8621
const double J_10 = x[1][1] - x[0][1];
8622
const double J_11 = x[2][1] - x[0][1];
8624
// Compute determinant of Jacobian
8625
double detJ = J_00*J_11 - J_01*J_10;
8627
// Compute inverse of Jacobian
8630
const double det = std::abs(detJ);
8632
// Compute geometry tensor
8633
const double G0_0 = det*w[0][0]*(1.0);
8635
// Compute element tensor
8636
A[0] = 0.032142857142857*G0_0;
8637
A[1] = 0.021428571428571*G0_0;
8638
A[2] = 0.021428571428571*G0_0;
8639
A[3] = 0.021428571428571*G0_0;
8640
A[4] = 0.032142857142857*G0_0;
8641
A[5] = 0.021428571428571*G0_0;
8642
A[6] = 0.021428571428571*G0_0;
8643
A[7] = 0.021428571428571*G0_0;
8644
A[8] = 0.032142857142857*G0_0;
8647
/// Tabulate the tensor for the contribution from a local cell
8648
/// using the specified reference cell quadrature points/weights
8649
virtual void tabulate_tensor(double* A,
8650
const double * const * w,
8652
unsigned int num_quadrature_points,
8653
const double * const * quadrature_points,
8654
const double* quadrature_weights) const
8656
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
8661
/// This class defines the interface for the tabulation of the cell
8662
/// tensor corresponding to the local contribution to a form from
8663
/// the integral over a cell.
8665
class adaptivepoisson_cell_integral_3_0: public ufc::cell_integral
8670
adaptivepoisson_cell_integral_3_0() : ufc::cell_integral()
8676
virtual ~adaptivepoisson_cell_integral_3_0()
8681
/// Tabulate the tensor for the contribution from a local cell
8682
virtual void tabulate_tensor(double* A,
8683
const double * const * w,
8684
const ufc::cell& c) const
8686
// Extract vertex coordinates
8687
const double * const * x = c.coordinates;
8689
// Compute Jacobian of affine map from reference cell
8690
const double J_00 = x[1][0] - x[0][0];
8691
const double J_01 = x[2][0] - x[0][0];
8692
const double J_10 = x[1][1] - x[0][1];
8693
const double J_11 = x[2][1] - x[0][1];
8695
// Compute determinant of Jacobian
8696
double detJ = J_00*J_11 - J_01*J_10;
8698
// Compute inverse of Jacobian
8699
const double K_00 = J_11 / detJ;
8700
const double K_01 = -J_01 / detJ;
8701
const double K_10 = -J_10 / detJ;
8702
const double K_11 = J_00 / detJ;
8705
const double det = std::abs(detJ);
8709
// Compute circumradius, assuming triangle is embedded in 2D.
8712
// Array of quadrature weights.
8713
static const double W9[9] = {0.055814420483044, 0.063678085099885, 0.019396383305959, 0.089303072772871, 0.101884936159816, 0.031034213289535, 0.055814420483044, 0.063678085099885, 0.019396383305959};
8714
// Quadrature points on the UFC reference element: (0.102717654809626, 0.088587959512704), (0.066554067839165, 0.409466864440735), (0.023931132287081, 0.787659461760847), (0.455706020243648, 0.088587959512704), (0.295266567779633, 0.409466864440735), (0.106170269119576, 0.787659461760847), (0.808694385677670, 0.088587959512704), (0.523979067720101, 0.409466864440735), (0.188409405952072, 0.787659461760847)
8716
// Value of basis functions at quadrature points.
8717
static const double FE0[9][1] = \
8718
{{0.198686329147682},
8719
{0.385541444206917},
8720
{0.095888844721203},
8721
{0.496715822869205},
8722
{0.963853610517293},
8723
{0.239722111803007},
8724
{0.198686329147682},
8725
{0.385541444206917},
8726
{0.095888844721203}};
8728
static const double FE0_D01[9][1] = \
8729
{{1.997126369343180},
8730
{0.205773829527613},
8731
{-0.387199773682209},
8732
{4.517043581212140},
8733
{-0.910427300132565},
8734
{-1.953555056589780},
8735
{0.308518341964844},
8736
{-4.851336441759750},
8737
{-3.885127223352865}};
8739
static const double FE0_D10[9][1] = \
8740
{{1.688608027378335},
8741
{5.057110271287362},
8742
{3.497927449670658},
8743
{0.000000000000000},
8744
{0.000000000000000},
8745
{0.000000000000000},
8746
{-1.688608027378333},
8747
{-5.057110271287364},
8748
{-3.497927449670658}};
8750
static const double FE1[9][3] = \
8751
{{0.808694385677670, 0.102717654809626, 0.088587959512704},
8752
{0.523979067720101, 0.066554067839165, 0.409466864440735},
8753
{0.188409405952072, 0.023931132287081, 0.787659461760847},
8754
{0.455706020243648, 0.455706020243648, 0.088587959512704},
8755
{0.295266567779633, 0.295266567779633, 0.409466864440735},
8756
{0.106170269119576, 0.106170269119577, 0.787659461760847},
8757
{0.102717654809626, 0.808694385677670, 0.088587959512704},
8758
{0.066554067839164, 0.523979067720101, 0.409466864440735},
8759
{0.023931132287081, 0.188409405952072, 0.787659461760847}};
8761
static const double FE1_D01[9][2] = \
8762
{{-1.000000000000000, 1.000000000000000},
8763
{-1.000000000000000, 1.000000000000000},
8764
{-1.000000000000000, 1.000000000000000},
8765
{-1.000000000000000, 1.000000000000000},
8766
{-1.000000000000000, 1.000000000000000},
8767
{-1.000000000000000, 1.000000000000000},
8768
{-1.000000000000000, 1.000000000000000},
8769
{-1.000000000000000, 1.000000000000000},
8770
{-1.000000000000000, 1.000000000000000}};
8772
// Array of non-zero columns
8773
static const unsigned int nzc0[2] = {0, 2};
8775
// Array of non-zero columns
8776
static const unsigned int nzc1[2] = {0, 1};
8778
// Reset values in the element tensor.
8779
for (unsigned int r = 0; r < 3; r++)
8781
A[r] = 0.000000000000000;
8782
}// end loop over 'r'
8783
// Number of operations to compute geometry constants: 12.
8785
G[0] = - det*(K_00*K_00 + K_01*K_01);
8786
G[1] = - det*(K_00*K_10 + K_01*K_11);
8787
G[2] = - det*(K_10*K_10 + K_11*K_11);
8789
// Compute element tensor using UFL quadrature representation
8790
// Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
8792
// Loop quadrature points for integral.
8793
// Number of operations to compute element tensor for following IP loop = 513
8794
for (unsigned int ip = 0; ip < 9; ip++)
8797
// Coefficient declarations.
8798
double F0 = 0.000000000000000;
8799
double F1 = 0.000000000000000;
8800
double F2 = 0.000000000000000;
8801
double F3 = 0.000000000000000;
8802
double F4 = 0.000000000000000;
8803
double F5 = 0.000000000000000;
8805
// Total number of operations to compute function values = 6
8806
for (unsigned int r = 0; r < 1; r++)
8808
F1 += FE0[ip][r]*w[3][r];
8809
F4 += FE0_D10[ip][r]*w[3][r];
8810
F5 += FE0_D01[ip][r]*w[3][r];
8811
}// end loop over 'r'
8813
// Total number of operations to compute function values = 8
8814
for (unsigned int r = 0; r < 2; r++)
8816
F2 += FE1_D01[ip][r]*w[2][nzc1[r]];
8817
F3 += FE1_D01[ip][r]*w[2][nzc0[r]];
8818
}// end loop over 'r'
8820
// Total number of operations to compute function values = 6
8821
for (unsigned int r = 0; r < 3; r++)
8823
F0 += FE1[ip][r]*w[0][r];
8824
}// end loop over 'r'
8826
// Number of operations to compute ip constants: 23
8828
// Number of operations: 13
8829
I[0] = W9[ip]*(F0*F1*det + F2*(F4*G[0] + F5*G[1]) + F3*(F4*G[1] + F5*G[2]));
8831
// Number of operations: 5
8832
I[1] = F1*W9[ip]*(F2*G[0] + F3*G[1]);
8834
// Number of operations: 5
8835
I[2] = F1*W9[ip]*(F2*G[1] + F3*G[2]);
8838
// Number of operations for primary indices: 6
8839
for (unsigned int j = 0; j < 3; j++)
8841
// Number of operations to compute entry: 2
8842
A[j] += FE1[ip][j]*I[0];
8843
}// end loop over 'j'
8845
// Number of operations for primary indices: 8
8846
for (unsigned int j = 0; j < 2; j++)
8848
// Number of operations to compute entry: 2
8849
A[nzc1[j]] += FE1_D01[ip][j]*I[1];
8850
// Number of operations to compute entry: 2
8851
A[nzc0[j]] += FE1_D01[ip][j]*I[2];
8852
}// end loop over 'j'
8853
}// end loop over 'ip'
8856
/// Tabulate the tensor for the contribution from a local cell
8857
/// using the specified reference cell quadrature points/weights
8858
virtual void tabulate_tensor(double* A,
8859
const double * const * w,
8861
unsigned int num_quadrature_points,
8862
const double * const * quadrature_points,
8863
const double* quadrature_weights) const
8865
throw std::runtime_error("Quadrature version of tabulate_tensor not yet implemented (introduced in UFC 2.0).");
8870
/// This class defines the interface for the tabulation of the
8871
/// exterior facet tensor corresponding to the local contribution to
8872
/// a form from the integral over an exterior facet.
8874
class adaptivepoisson_exterior_facet_integral_3_0: public ufc::exterior_facet_integral
8879
adaptivepoisson_exterior_facet_integral_3_0() : ufc::exterior_facet_integral()
8885
virtual ~adaptivepoisson_exterior_facet_integral_3_0()
8890
/// Tabulate the tensor for the contribution from a local exterior facet
8891
virtual void tabulate_tensor(double* A,
8892
const double * const * w,
8894
unsigned int facet) const
8896
// Number of operations (multiply-add pairs) for Jacobian data: 6
8897
// Number of operations (multiply-add pairs) for geometry tensor: 0
8898
// Number of operations (multiply-add pairs) for tensor contraction: 0
8899
// Total number of operations (multiply-add pairs): 6
8901
// Extract vertex coordinates
8903
// Compute Jacobian of affine map from reference cell
8905
// Compute determinant of Jacobian
8907
// Compute inverse of Jacobian
8909
// Get vertices on edge
8911
// Compute scale factor (length of edge scaled by length of reference interval)
8913
// Compute geometry tensor
8916
// Compute element tensor
8921
A[0] = 0.000000000000000;
8922
A[1] = 0.000000000000000;
8923
A[2] = 0.000000000000000;
8928
A[0] = 0.000000000000000;
8929
A[1] = 0.000000000000000;
8930
A[2] = 0.000000000000000;
8935
A[0] = 0.000000000000000;
8936
A[1] = 0.000000000000000;
8937
A[2] = 0.000000000000000;
8944
/// Tabulate the tensor for the contribution from a local exterior facet
8945
/// using the specified reference cell quadrature points/weights
8946
virtual void tabulate_tensor(double* A,
8947
const double * const * w,
8949
unsigned int num_quadrature_points,
8950
const double * const * quadrature_points,
8951
const double* quadrature_weights) const
8953
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
8958
/// This class defines the interface for the tabulation of the
8959
/// exterior facet tensor corresponding to the local contribution to
8960
/// a form from the integral over an exterior facet.
8962
class adaptivepoisson_exterior_facet_integral_4_0: public ufc::exterior_facet_integral
8967
adaptivepoisson_exterior_facet_integral_4_0() : ufc::exterior_facet_integral()
8973
virtual ~adaptivepoisson_exterior_facet_integral_4_0()
8978
/// Tabulate the tensor for the contribution from a local exterior facet
8979
virtual void tabulate_tensor(double* A,
8980
const double * const * w,
8982
unsigned int facet) const
8984
// Number of operations (multiply-add pairs) for Jacobian data: 9
8985
// Number of operations (multiply-add pairs) for geometry tensor: 6
8986
// Number of operations (multiply-add pairs) for tensor contraction: 30
8987
// Total number of operations (multiply-add pairs): 45
8989
// Extract vertex coordinates
8990
const double * const * x = c.coordinates;
8992
// Compute Jacobian of affine map from reference cell
8994
// Compute determinant of Jacobian
8996
// Compute inverse of Jacobian
8998
// Get vertices on edge
8999
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
9000
const unsigned int v0 = edge_vertices[facet][0];
9001
const unsigned int v1 = edge_vertices[facet][1];
9003
// Compute scale factor (length of edge scaled by length of reference interval)
9004
const double dx0 = x[v1][0] - x[v0][0];
9005
const double dx1 = x[v1][1] - x[v0][1];
9006
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
9008
// Compute geometry tensor
9009
const double G0_0 = det*w[0][0]*(1.0);
9010
const double G0_1 = det*w[0][1]*(1.0);
9011
const double G0_2 = det*w[0][2]*(1.0);
9012
const double G0_3 = det*w[0][3]*(1.0);
9013
const double G0_4 = det*w[0][4]*(1.0);
9014
const double G0_5 = det*w[0][5]*(1.0);
9016
// Compute element tensor
9021
A[0] = 0.000000000000000;
9022
A[1] = 0.000000000000000;
9023
A[2] = 0.000000000000000;
9024
A[3] = 0.000000000000000;
9025
A[4] = 0.150000000000000*G0_1 - 0.016666666666667*G0_2 + 0.200000000000000*G0_3;
9026
A[5] = 0.016666666666667*G0_1 + 0.016666666666667*G0_2 + 0.133333333333333*G0_3;
9027
A[6] = 0.000000000000000;
9028
A[7] = 0.016666666666667*G0_1 + 0.016666666666667*G0_2 + 0.133333333333333*G0_3;
9029
A[8] = -0.016666666666667*G0_1 + 0.150000000000000*G0_2 + 0.200000000000000*G0_3;
9034
A[0] = 0.150000000000000*G0_0 - 0.016666666666667*G0_2 + 0.200000000000000*G0_4;
9035
A[1] = 0.000000000000000;
9036
A[2] = 0.016666666666667*G0_0 + 0.016666666666667*G0_2 + 0.133333333333333*G0_4;
9037
A[3] = 0.000000000000000;
9038
A[4] = 0.000000000000000;
9039
A[5] = 0.000000000000000;
9040
A[6] = 0.016666666666667*G0_0 + 0.016666666666667*G0_2 + 0.133333333333333*G0_4;
9041
A[7] = 0.000000000000000;
9042
A[8] = -0.016666666666667*G0_0 + 0.150000000000000*G0_2 + 0.200000000000000*G0_4;
9047
A[0] = 0.150000000000000*G0_0 - 0.016666666666667*G0_1 + 0.200000000000000*G0_5;
9048
A[1] = 0.016666666666667*G0_0 + 0.016666666666667*G0_1 + 0.133333333333333*G0_5;
9049
A[2] = 0.000000000000000;
9050
A[3] = 0.016666666666667*G0_0 + 0.016666666666667*G0_1 + 0.133333333333333*G0_5;
9051
A[4] = -0.016666666666667*G0_0 + 0.150000000000000*G0_1 + 0.200000000000000*G0_5;
9052
A[5] = 0.000000000000000;
9053
A[6] = 0.000000000000000;
9054
A[7] = 0.000000000000000;
9055
A[8] = 0.000000000000000;
9062
/// Tabulate the tensor for the contribution from a local exterior facet
9063
/// using the specified reference cell quadrature points/weights
9064
virtual void tabulate_tensor(double* A,
9065
const double * const * w,
9067
unsigned int num_quadrature_points,
9068
const double * const * quadrature_points,
9069
const double* quadrature_weights) const
9071
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
9076
/// This class defines the interface for the tabulation of the
9077
/// interior facet tensor corresponding to the local contribution to
9078
/// a form from the integral over an interior facet.
9080
class adaptivepoisson_interior_facet_integral_4_0: public ufc::interior_facet_integral
9085
adaptivepoisson_interior_facet_integral_4_0() : ufc::interior_facet_integral()
9091
virtual ~adaptivepoisson_interior_facet_integral_4_0()
9096
/// Tabulate the tensor for the contribution from a local interior facet
9097
virtual void tabulate_tensor(double* A,
9098
const double * const * w,
9099
const ufc::cell& c0,
9100
const ufc::cell& c1,
9101
unsigned int facet0,
9102
unsigned int facet1) const
9104
// Number of operations (multiply-add pairs) for Jacobian data: 12
9105
// Number of operations (multiply-add pairs) for geometry tensor: 12
9106
// Number of operations (multiply-add pairs) for tensor contraction: 180
9107
// Total number of operations (multiply-add pairs): 204
9109
// Extract vertex coordinates
9110
const double * const * x0 = c0.coordinates;
9112
// Compute Jacobian of affine map from reference cell
9114
// Compute determinant of Jacobian
9116
// Compute inverse of Jacobian
9118
// Compute Jacobian of affine map from reference cell
9120
// Compute determinant of Jacobian
9122
// Compute inverse of Jacobian
9124
// Get vertices on edge
9125
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
9126
const unsigned int v0 = edge_vertices[facet0][0];
9127
const unsigned int v1 = edge_vertices[facet0][1];
9129
// Compute scale factor (length of edge scaled by length of reference interval)
9130
const double dx0 = x0[v1][0] - x0[v0][0];
9131
const double dx1 = x0[v1][1] - x0[v0][1];
9132
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
9134
// Compute geometry tensor
9135
const double G0_6 = det*w[0][6]*(1.0);
9136
const double G0_7 = det*w[0][7]*(1.0);
9137
const double G0_8 = det*w[0][8]*(1.0);
9138
const double G0_9 = det*w[0][9]*(1.0);
9139
const double G0_10 = det*w[0][10]*(1.0);
9140
const double G0_11 = det*w[0][11]*(1.0);
9141
const double G1_0 = det*w[0][0]*(1.0);
9142
const double G1_1 = det*w[0][1]*(1.0);
9143
const double G1_2 = det*w[0][2]*(1.0);
9144
const double G1_3 = det*w[0][3]*(1.0);
9145
const double G1_4 = det*w[0][4]*(1.0);
9146
const double G1_5 = det*w[0][5]*(1.0);
9148
// Compute element tensor
9157
A[0] = 0.000000000000000;
9158
A[1] = 0.000000000000000;
9159
A[2] = 0.000000000000000;
9160
A[3] = 0.000000000000000;
9161
A[4] = 0.000000000000000;
9162
A[5] = 0.000000000000000;
9163
A[6] = 0.000000000000000;
9164
A[7] = 0.150000000000000*G1_1 - 0.016666666666667*G1_2 + 0.200000000000000*G1_3;
9165
A[8] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9166
A[9] = 0.000000000000000;
9167
A[10] = 0.000000000000000;
9168
A[11] = 0.000000000000000;
9169
A[12] = 0.000000000000000;
9170
A[13] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9171
A[14] = -0.016666666666667*G1_1 + 0.150000000000000*G1_2 + 0.200000000000000*G1_3;
9172
A[15] = 0.000000000000000;
9173
A[16] = 0.000000000000000;
9174
A[17] = 0.000000000000000;
9175
A[18] = 0.000000000000000;
9176
A[19] = 0.000000000000000;
9177
A[20] = 0.000000000000000;
9178
A[21] = 0.000000000000000;
9179
A[22] = 0.000000000000000;
9180
A[23] = 0.000000000000000;
9181
A[24] = 0.000000000000000;
9182
A[25] = 0.000000000000000;
9183
A[26] = 0.000000000000000;
9184
A[27] = 0.000000000000000;
9185
A[28] = 0.150000000000000*G0_7 - 0.016666666666667*G0_8 + 0.200000000000000*G0_9;
9186
A[29] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9187
A[30] = 0.000000000000000;
9188
A[31] = 0.000000000000000;
9189
A[32] = 0.000000000000000;
9190
A[33] = 0.000000000000000;
9191
A[34] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9192
A[35] = -0.016666666666667*G0_7 + 0.150000000000000*G0_8 + 0.200000000000000*G0_9;
9197
A[0] = 0.000000000000000;
9198
A[1] = 0.000000000000000;
9199
A[2] = 0.000000000000000;
9200
A[3] = 0.000000000000000;
9201
A[4] = 0.000000000000000;
9202
A[5] = 0.000000000000000;
9203
A[6] = 0.000000000000000;
9204
A[7] = 0.150000000000000*G1_1 - 0.016666666666667*G1_2 + 0.200000000000000*G1_3;
9205
A[8] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9206
A[9] = 0.000000000000000;
9207
A[10] = 0.000000000000000;
9208
A[11] = 0.000000000000000;
9209
A[12] = 0.000000000000000;
9210
A[13] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9211
A[14] = -0.016666666666667*G1_1 + 0.150000000000000*G1_2 + 0.200000000000000*G1_3;
9212
A[15] = 0.000000000000000;
9213
A[16] = 0.000000000000000;
9214
A[17] = 0.000000000000000;
9215
A[18] = 0.000000000000000;
9216
A[19] = 0.000000000000000;
9217
A[20] = 0.000000000000000;
9218
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_8 + 0.200000000000000*G0_10;
9219
A[22] = 0.000000000000000;
9220
A[23] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9221
A[24] = 0.000000000000000;
9222
A[25] = 0.000000000000000;
9223
A[26] = 0.000000000000000;
9224
A[27] = 0.000000000000000;
9225
A[28] = 0.000000000000000;
9226
A[29] = 0.000000000000000;
9227
A[30] = 0.000000000000000;
9228
A[31] = 0.000000000000000;
9229
A[32] = 0.000000000000000;
9230
A[33] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9231
A[34] = 0.000000000000000;
9232
A[35] = -0.016666666666667*G0_6 + 0.150000000000000*G0_8 + 0.200000000000000*G0_10;
9237
A[0] = 0.000000000000000;
9238
A[1] = 0.000000000000000;
9239
A[2] = 0.000000000000000;
9240
A[3] = 0.000000000000000;
9241
A[4] = 0.000000000000000;
9242
A[5] = 0.000000000000000;
9243
A[6] = 0.000000000000000;
9244
A[7] = 0.150000000000000*G1_1 - 0.016666666666667*G1_2 + 0.200000000000000*G1_3;
9245
A[8] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9246
A[9] = 0.000000000000000;
9247
A[10] = 0.000000000000000;
9248
A[11] = 0.000000000000000;
9249
A[12] = 0.000000000000000;
9250
A[13] = 0.016666666666667*G1_1 + 0.016666666666667*G1_2 + 0.133333333333333*G1_3;
9251
A[14] = -0.016666666666667*G1_1 + 0.150000000000000*G1_2 + 0.200000000000000*G1_3;
9252
A[15] = 0.000000000000000;
9253
A[16] = 0.000000000000000;
9254
A[17] = 0.000000000000000;
9255
A[18] = 0.000000000000000;
9256
A[19] = 0.000000000000000;
9257
A[20] = 0.000000000000000;
9258
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_7 + 0.200000000000000*G0_11;
9259
A[22] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9260
A[23] = 0.000000000000000;
9261
A[24] = 0.000000000000000;
9262
A[25] = 0.000000000000000;
9263
A[26] = 0.000000000000000;
9264
A[27] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9265
A[28] = -0.016666666666667*G0_6 + 0.150000000000000*G0_7 + 0.200000000000000*G0_11;
9266
A[29] = 0.000000000000000;
9267
A[30] = 0.000000000000000;
9268
A[31] = 0.000000000000000;
9269
A[32] = 0.000000000000000;
9270
A[33] = 0.000000000000000;
9271
A[34] = 0.000000000000000;
9272
A[35] = 0.000000000000000;
9285
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_2 + 0.200000000000000*G1_4;
9286
A[1] = 0.000000000000000;
9287
A[2] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9288
A[3] = 0.000000000000000;
9289
A[4] = 0.000000000000000;
9290
A[5] = 0.000000000000000;
9291
A[6] = 0.000000000000000;
9292
A[7] = 0.000000000000000;
9293
A[8] = 0.000000000000000;
9294
A[9] = 0.000000000000000;
9295
A[10] = 0.000000000000000;
9296
A[11] = 0.000000000000000;
9297
A[12] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9298
A[13] = 0.000000000000000;
9299
A[14] = -0.016666666666667*G1_0 + 0.150000000000000*G1_2 + 0.200000000000000*G1_4;
9300
A[15] = 0.000000000000000;
9301
A[16] = 0.000000000000000;
9302
A[17] = 0.000000000000000;
9303
A[18] = 0.000000000000000;
9304
A[19] = 0.000000000000000;
9305
A[20] = 0.000000000000000;
9306
A[21] = 0.000000000000000;
9307
A[22] = 0.000000000000000;
9308
A[23] = 0.000000000000000;
9309
A[24] = 0.000000000000000;
9310
A[25] = 0.000000000000000;
9311
A[26] = 0.000000000000000;
9312
A[27] = 0.000000000000000;
9313
A[28] = 0.150000000000000*G0_7 - 0.016666666666667*G0_8 + 0.200000000000000*G0_9;
9314
A[29] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9315
A[30] = 0.000000000000000;
9316
A[31] = 0.000000000000000;
9317
A[32] = 0.000000000000000;
9318
A[33] = 0.000000000000000;
9319
A[34] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9320
A[35] = -0.016666666666667*G0_7 + 0.150000000000000*G0_8 + 0.200000000000000*G0_9;
9325
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_2 + 0.200000000000000*G1_4;
9326
A[1] = 0.000000000000000;
9327
A[2] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9328
A[3] = 0.000000000000000;
9329
A[4] = 0.000000000000000;
9330
A[5] = 0.000000000000000;
9331
A[6] = 0.000000000000000;
9332
A[7] = 0.000000000000000;
9333
A[8] = 0.000000000000000;
9334
A[9] = 0.000000000000000;
9335
A[10] = 0.000000000000000;
9336
A[11] = 0.000000000000000;
9337
A[12] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9338
A[13] = 0.000000000000000;
9339
A[14] = -0.016666666666667*G1_0 + 0.150000000000000*G1_2 + 0.200000000000000*G1_4;
9340
A[15] = 0.000000000000000;
9341
A[16] = 0.000000000000000;
9342
A[17] = 0.000000000000000;
9343
A[18] = 0.000000000000000;
9344
A[19] = 0.000000000000000;
9345
A[20] = 0.000000000000000;
9346
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_8 + 0.200000000000000*G0_10;
9347
A[22] = 0.000000000000000;
9348
A[23] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9349
A[24] = 0.000000000000000;
9350
A[25] = 0.000000000000000;
9351
A[26] = 0.000000000000000;
9352
A[27] = 0.000000000000000;
9353
A[28] = 0.000000000000000;
9354
A[29] = 0.000000000000000;
9355
A[30] = 0.000000000000000;
9356
A[31] = 0.000000000000000;
9357
A[32] = 0.000000000000000;
9358
A[33] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9359
A[34] = 0.000000000000000;
9360
A[35] = -0.016666666666667*G0_6 + 0.150000000000000*G0_8 + 0.200000000000000*G0_10;
9365
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_2 + 0.200000000000000*G1_4;
9366
A[1] = 0.000000000000000;
9367
A[2] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9368
A[3] = 0.000000000000000;
9369
A[4] = 0.000000000000000;
9370
A[5] = 0.000000000000000;
9371
A[6] = 0.000000000000000;
9372
A[7] = 0.000000000000000;
9373
A[8] = 0.000000000000000;
9374
A[9] = 0.000000000000000;
9375
A[10] = 0.000000000000000;
9376
A[11] = 0.000000000000000;
9377
A[12] = 0.016666666666667*G1_0 + 0.016666666666667*G1_2 + 0.133333333333333*G1_4;
9378
A[13] = 0.000000000000000;
9379
A[14] = -0.016666666666667*G1_0 + 0.150000000000000*G1_2 + 0.200000000000000*G1_4;
9380
A[15] = 0.000000000000000;
9381
A[16] = 0.000000000000000;
9382
A[17] = 0.000000000000000;
9383
A[18] = 0.000000000000000;
9384
A[19] = 0.000000000000000;
9385
A[20] = 0.000000000000000;
9386
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_7 + 0.200000000000000*G0_11;
9387
A[22] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9388
A[23] = 0.000000000000000;
9389
A[24] = 0.000000000000000;
9390
A[25] = 0.000000000000000;
9391
A[26] = 0.000000000000000;
9392
A[27] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9393
A[28] = -0.016666666666667*G0_6 + 0.150000000000000*G0_7 + 0.200000000000000*G0_11;
9394
A[29] = 0.000000000000000;
9395
A[30] = 0.000000000000000;
9396
A[31] = 0.000000000000000;
9397
A[32] = 0.000000000000000;
9398
A[33] = 0.000000000000000;
9399
A[34] = 0.000000000000000;
9400
A[35] = 0.000000000000000;
9413
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_1 + 0.200000000000000*G1_5;
9414
A[1] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9415
A[2] = 0.000000000000000;
9416
A[3] = 0.000000000000000;
9417
A[4] = 0.000000000000000;
9418
A[5] = 0.000000000000000;
9419
A[6] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9420
A[7] = -0.016666666666667*G1_0 + 0.150000000000000*G1_1 + 0.200000000000000*G1_5;
9421
A[8] = 0.000000000000000;
9422
A[9] = 0.000000000000000;
9423
A[10] = 0.000000000000000;
9424
A[11] = 0.000000000000000;
9425
A[12] = 0.000000000000000;
9426
A[13] = 0.000000000000000;
9427
A[14] = 0.000000000000000;
9428
A[15] = 0.000000000000000;
9429
A[16] = 0.000000000000000;
9430
A[17] = 0.000000000000000;
9431
A[18] = 0.000000000000000;
9432
A[19] = 0.000000000000000;
9433
A[20] = 0.000000000000000;
9434
A[21] = 0.000000000000000;
9435
A[22] = 0.000000000000000;
9436
A[23] = 0.000000000000000;
9437
A[24] = 0.000000000000000;
9438
A[25] = 0.000000000000000;
9439
A[26] = 0.000000000000000;
9440
A[27] = 0.000000000000000;
9441
A[28] = 0.150000000000000*G0_7 - 0.016666666666667*G0_8 + 0.200000000000000*G0_9;
9442
A[29] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9443
A[30] = 0.000000000000000;
9444
A[31] = 0.000000000000000;
9445
A[32] = 0.000000000000000;
9446
A[33] = 0.000000000000000;
9447
A[34] = 0.016666666666667*G0_7 + 0.016666666666667*G0_8 + 0.133333333333333*G0_9;
9448
A[35] = -0.016666666666667*G0_7 + 0.150000000000000*G0_8 + 0.200000000000000*G0_9;
9453
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_1 + 0.200000000000000*G1_5;
9454
A[1] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9455
A[2] = 0.000000000000000;
9456
A[3] = 0.000000000000000;
9457
A[4] = 0.000000000000000;
9458
A[5] = 0.000000000000000;
9459
A[6] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9460
A[7] = -0.016666666666667*G1_0 + 0.150000000000000*G1_1 + 0.200000000000000*G1_5;
9461
A[8] = 0.000000000000000;
9462
A[9] = 0.000000000000000;
9463
A[10] = 0.000000000000000;
9464
A[11] = 0.000000000000000;
9465
A[12] = 0.000000000000000;
9466
A[13] = 0.000000000000000;
9467
A[14] = 0.000000000000000;
9468
A[15] = 0.000000000000000;
9469
A[16] = 0.000000000000000;
9470
A[17] = 0.000000000000000;
9471
A[18] = 0.000000000000000;
9472
A[19] = 0.000000000000000;
9473
A[20] = 0.000000000000000;
9474
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_8 + 0.200000000000000*G0_10;
9475
A[22] = 0.000000000000000;
9476
A[23] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9477
A[24] = 0.000000000000000;
9478
A[25] = 0.000000000000000;
9479
A[26] = 0.000000000000000;
9480
A[27] = 0.000000000000000;
9481
A[28] = 0.000000000000000;
9482
A[29] = 0.000000000000000;
9483
A[30] = 0.000000000000000;
9484
A[31] = 0.000000000000000;
9485
A[32] = 0.000000000000000;
9486
A[33] = 0.016666666666667*G0_6 + 0.016666666666667*G0_8 + 0.133333333333333*G0_10;
9487
A[34] = 0.000000000000000;
9488
A[35] = -0.016666666666667*G0_6 + 0.150000000000000*G0_8 + 0.200000000000000*G0_10;
9493
A[0] = 0.150000000000000*G1_0 - 0.016666666666667*G1_1 + 0.200000000000000*G1_5;
9494
A[1] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9495
A[2] = 0.000000000000000;
9496
A[3] = 0.000000000000000;
9497
A[4] = 0.000000000000000;
9498
A[5] = 0.000000000000000;
9499
A[6] = 0.016666666666667*G1_0 + 0.016666666666667*G1_1 + 0.133333333333333*G1_5;
9500
A[7] = -0.016666666666667*G1_0 + 0.150000000000000*G1_1 + 0.200000000000000*G1_5;
9501
A[8] = 0.000000000000000;
9502
A[9] = 0.000000000000000;
9503
A[10] = 0.000000000000000;
9504
A[11] = 0.000000000000000;
9505
A[12] = 0.000000000000000;
9506
A[13] = 0.000000000000000;
9507
A[14] = 0.000000000000000;
9508
A[15] = 0.000000000000000;
9509
A[16] = 0.000000000000000;
9510
A[17] = 0.000000000000000;
9511
A[18] = 0.000000000000000;
9512
A[19] = 0.000000000000000;
9513
A[20] = 0.000000000000000;
9514
A[21] = 0.150000000000000*G0_6 - 0.016666666666667*G0_7 + 0.200000000000000*G0_11;
9515
A[22] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9516
A[23] = 0.000000000000000;
9517
A[24] = 0.000000000000000;
9518
A[25] = 0.000000000000000;
9519
A[26] = 0.000000000000000;
9520
A[27] = 0.016666666666667*G0_6 + 0.016666666666667*G0_7 + 0.133333333333333*G0_11;
9521
A[28] = -0.016666666666667*G0_6 + 0.150000000000000*G0_7 + 0.200000000000000*G0_11;
9522
A[29] = 0.000000000000000;
9523
A[30] = 0.000000000000000;
9524
A[31] = 0.000000000000000;
9525
A[32] = 0.000000000000000;
9526
A[33] = 0.000000000000000;
9527
A[34] = 0.000000000000000;
9528
A[35] = 0.000000000000000;
9539
/// Tabulate the tensor for the contribution from a local interior facet
9540
/// using the specified reference cell quadrature points/weights
9541
virtual void tabulate_tensor(double* A,
9542
const double * const * w,
9544
unsigned int num_quadrature_points,
9545
const double * const * quadrature_points,
9546
const double* quadrature_weights) const
9548
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
9553
/// This class defines the interface for the tabulation of the cell
9554
/// tensor corresponding to the local contribution to a form from
9555
/// the integral over a cell.
9557
class adaptivepoisson_cell_integral_5_0: public ufc::cell_integral
9562
adaptivepoisson_cell_integral_5_0() : ufc::cell_integral()
9568
virtual ~adaptivepoisson_cell_integral_5_0()
9573
/// Tabulate the tensor for the contribution from a local cell
9574
virtual void tabulate_tensor(double* A,
9575
const double * const * w,
9576
const ufc::cell& c) const
9578
// Extract vertex coordinates
9579
const double * const * x = c.coordinates;
9581
// Compute Jacobian of affine map from reference cell
9582
const double J_00 = x[1][0] - x[0][0];
9583
const double J_01 = x[2][0] - x[0][0];
9584
const double J_10 = x[1][1] - x[0][1];
9585
const double J_11 = x[2][1] - x[0][1];
9587
// Compute determinant of Jacobian
9588
double detJ = J_00*J_11 - J_01*J_10;
9590
// Compute inverse of Jacobian
9591
const double K_00 = J_11 / detJ;
9592
const double K_01 = -J_01 / detJ;
9593
const double K_10 = -J_10 / detJ;
9594
const double K_11 = J_00 / detJ;
9597
const double det = std::abs(detJ);
9601
// Compute circumradius, assuming triangle is embedded in 2D.
9604
// Array of quadrature weights.
9605
static const double W9[9] = {0.055814420483044, 0.063678085099885, 0.019396383305959, 0.089303072772871, 0.101884936159816, 0.031034213289535, 0.055814420483044, 0.063678085099885, 0.019396383305959};
9606
// Quadrature points on the UFC reference element: (0.102717654809626, 0.088587959512704), (0.066554067839165, 0.409466864440735), (0.023931132287081, 0.787659461760847), (0.455706020243648, 0.088587959512704), (0.295266567779633, 0.409466864440735), (0.106170269119576, 0.787659461760847), (0.808694385677670, 0.088587959512704), (0.523979067720101, 0.409466864440735), (0.188409405952072, 0.787659461760847)
9608
// Value of basis functions at quadrature points.
9609
static const double FE0[9][3] = \
9610
{{0.808694385677670, 0.102717654809626, 0.088587959512704},
9611
{0.523979067720101, 0.066554067839165, 0.409466864440735},
9612
{0.188409405952072, 0.023931132287081, 0.787659461760847},
9613
{0.455706020243648, 0.455706020243648, 0.088587959512704},
9614
{0.295266567779633, 0.295266567779633, 0.409466864440735},
9615
{0.106170269119576, 0.106170269119577, 0.787659461760847},
9616
{0.102717654809626, 0.808694385677670, 0.088587959512704},
9617
{0.066554067839164, 0.523979067720101, 0.409466864440735},
9618
{0.023931132287081, 0.188409405952072, 0.787659461760847}};
9620
static const double FE0_D01[9][2] = \
9621
{{-1.000000000000000, 1.000000000000000},
9622
{-1.000000000000000, 1.000000000000000},
9623
{-1.000000000000000, 1.000000000000000},
9624
{-1.000000000000000, 1.000000000000000},
9625
{-1.000000000000000, 1.000000000000000},
9626
{-1.000000000000000, 1.000000000000000},
9627
{-1.000000000000000, 1.000000000000000},
9628
{-1.000000000000000, 1.000000000000000},
9629
{-1.000000000000000, 1.000000000000000}};
9631
// Array of non-zero columns
9632
static const unsigned int nzc1[2] = {0, 1};
9634
// Array of non-zero columns
9635
static const unsigned int nzc0[2] = {0, 2};
9637
static const double FE2[9][6] = \
9638
{{0.499278833175498, -0.081615821590447, -0.072892306371455, 0.036398189782060, 0.286562341986258, 0.332268763018087},
9639
{0.025129059097551, -0.057695179947284, -0.074140638290881, 0.109006741895515, 0.858208263567716, 0.139491753677383},
9640
{-0.117413197449647, -0.022785734101997, 0.453155393641927, 0.075398331106278, 0.593609805131561, 0.018035401671877},
9641
{-0.040370066471040, -0.040370066471040, -0.072892306371455, 0.161480265884159, 0.161480265884159, 0.830671907545217},
9642
{-0.120901875682904, -0.120901875682904, -0.074140638290881, 0.483607502731615, 0.483607502731615, 0.348729384193458},
9643
{-0.083626017029730, -0.083626017029730, 0.453155393641927, 0.334504068118920, 0.334504068118920, 0.045088504179693},
9644
{-0.081615821590447, 0.499278833175498, -0.072892306371455, 0.286562341986258, 0.036398189782060, 0.332268763018087},
9645
{-0.057695179947284, 0.025129059097551, -0.074140638290881, 0.858208263567716, 0.109006741895515, 0.139491753677383},
9646
{-0.022785734101997, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.075398331106278, 0.018035401671877}};
9648
static const double FE2_D01[9][5] = \
9649
{{-2.234777542710679, -0.645648161949184, 0.410870619238505, 2.880425704659863, -0.410870619238505},
9650
{-1.095916270880403, 0.637867457762939, 0.266216271356658, 0.458048813117464, -0.266216271356658},
9651
{0.246362376191710, 2.150637847043388, 0.095724529148321, -2.397000223235098, -0.095724529148322},
9652
{-0.822824080974592, -0.645648161949184, 1.822824080974592, 1.468472242923776, -1.822824080974592},
9653
{-0.181066271118530, 0.637867457762939, 1.181066271118531, -0.456801186644409, -1.181066271118531},
9654
{0.575318923521694, 2.150637847043388, 0.424681076478305, -2.725956770565081, -0.424681076478306},
9655
{0.589129380761495, -0.645648161949184, 3.234777542710678, 0.056518781187689, -3.234777542710679},
9656
{0.733783728643342, 0.637867457762939, 2.095916270880403, -1.371651186406281, -2.095916270880403},
9657
{0.904275470851677, 2.150637847043388, 0.753637623808288, -3.054913317895065, -0.753637623808289}};
9659
// Array of non-zero columns
9660
static const unsigned int nzc2[5] = {0, 2, 3, 4, 5};
9662
static const double FE2_D10[9][5] = \
9663
{{-2.234777542710679, -0.589129380761495, 0.354351838050815, -0.354351838050816, 2.823906923472175},
9664
{-1.095916270880403, -0.733783728643342, 1.637867457762939, -1.637867457762940, 1.829699999523745},
9665
{0.246362376191711, -0.904275470851678, 3.150637847043387, -3.150637847043388, 0.657913094659968},
9666
{-0.822824080974592, 0.822824080974592, 0.354351838050816, -0.354351838050816, 0.000000000000000},
9667
{-0.181066271118530, 0.181066271118531, 1.637867457762939, -1.637867457762940, 0.000000000000000},
9668
{0.575318923521694, -0.575318923521695, 3.150637847043387, -3.150637847043388, 0.000000000000000},
9669
{0.589129380761495, 2.234777542710679, 0.354351838050815, -0.354351838050816, -2.823906923472174},
9670
{0.733783728643342, 1.095916270880403, 1.637867457762939, -1.637867457762940, -1.829699999523746},
9671
{0.904275470851678, -0.246362376191711, 3.150637847043387, -3.150637847043388, -0.657913094659966}};
9673
// Array of non-zero columns
9674
static const unsigned int nzc3[5] = {0, 1, 3, 4, 5};
9676
// Reset values in the element tensor.
9677
for (unsigned int r = 0; r < 3; r++)
9679
A[r] = 0.000000000000000;
9680
}// end loop over 'r'
9681
// Number of operations to compute geometry constants: 12.
9683
G[0] = - det*(K_00*K_00 + K_01*K_01);
9684
G[1] = - det*(K_00*K_10 + K_01*K_11);
9685
G[2] = - det*(K_10*K_10 + K_11*K_11);
9687
// Compute element tensor using UFL quadrature representation
9688
// Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
9690
// Loop quadrature points for integral.
9691
// Number of operations to compute element tensor for following IP loop = 810
9692
for (unsigned int ip = 0; ip < 9; ip++)
9695
// Coefficient declarations.
9696
double F0 = 0.000000000000000;
9697
double F1 = 0.000000000000000;
9698
double F2 = 0.000000000000000;
9699
double F3 = 0.000000000000000;
9700
double F4 = 0.000000000000000;
9701
double F5 = 0.000000000000000;
9702
double F6 = 0.000000000000000;
9704
// Total number of operations to compute function values = 8
9705
for (unsigned int r = 0; r < 2; r++)
9707
F3 += FE0_D01[ip][r]*w[2][nzc1[r]];
9708
F4 += FE0_D01[ip][r]*w[2][nzc0[r]];
9709
}// end loop over 'r'
9711
// Total number of operations to compute function values = 12
9712
for (unsigned int r = 0; r < 3; r++)
9714
F0 += FE0[ip][r]*w[3][r];
9715
F2 += FE0[ip][r]*w[0][r];
9716
}// end loop over 'r'
9718
// Total number of operations to compute function values = 20
9719
for (unsigned int r = 0; r < 5; r++)
9721
F5 += FE2_D10[ip][r]*w[4][nzc3[r]];
9722
F6 += FE2_D01[ip][r]*w[4][nzc2[r]];
9723
}// end loop over 'r'
9725
// Total number of operations to compute function values = 12
9726
for (unsigned int r = 0; r < 6; r++)
9728
F1 += FE2[ip][r]*w[4][r];
9729
}// end loop over 'r'
9731
// Number of operations to compute ip constants: 24
9733
// Number of operations: 14
9734
I[0] = W9[ip]*(F1*det*(F2 - F0) + F5*(F3*G[0] + F4*G[1]) + F6*(F3*G[1] + F4*G[2]));
9736
// Number of operations: 5
9737
I[1] = F1*W9[ip]*(F3*G[0] + F4*G[1]);
9739
// Number of operations: 5
9740
I[2] = F1*W9[ip]*(F3*G[1] + F4*G[2]);
9743
// Number of operations for primary indices: 6
9744
for (unsigned int j = 0; j < 3; j++)
9746
// Number of operations to compute entry: 2
9747
A[j] += FE0[ip][j]*I[0];
9748
}// end loop over 'j'
9750
// Number of operations for primary indices: 8
9751
for (unsigned int j = 0; j < 2; j++)
9753
// Number of operations to compute entry: 2
9754
A[nzc1[j]] += FE0_D01[ip][j]*I[1];
9755
// Number of operations to compute entry: 2
9756
A[nzc0[j]] += FE0_D01[ip][j]*I[2];
9757
}// end loop over 'j'
9758
}// end loop over 'ip'
9761
/// Tabulate the tensor for the contribution from a local cell
9762
/// using the specified reference cell quadrature points/weights
9763
virtual void tabulate_tensor(double* A,
9764
const double * const * w,
9766
unsigned int num_quadrature_points,
9767
const double * const * quadrature_points,
9768
const double* quadrature_weights) const
9770
throw std::runtime_error("Quadrature version of tabulate_tensor not yet implemented (introduced in UFC 2.0).");
9775
/// This class defines the interface for the tabulation of the
9776
/// exterior facet tensor corresponding to the local contribution to
9777
/// a form from the integral over an exterior facet.
9779
class adaptivepoisson_exterior_facet_integral_5_0: public ufc::exterior_facet_integral
9784
adaptivepoisson_exterior_facet_integral_5_0() : ufc::exterior_facet_integral()
9790
virtual ~adaptivepoisson_exterior_facet_integral_5_0()
9795
/// Tabulate the tensor for the contribution from a local exterior facet
9796
virtual void tabulate_tensor(double* A,
9797
const double * const * w,
9799
unsigned int facet) const
9801
// Number of operations (multiply-add pairs) for Jacobian data: 9
9802
// Number of operations (multiply-add pairs) for geometry tensor: 22
9803
// Number of operations (multiply-add pairs) for tensor contraction: 33
9804
// Total number of operations (multiply-add pairs): 64
9806
// Extract vertex coordinates
9807
const double * const * x = c.coordinates;
9809
// Compute Jacobian of affine map from reference cell
9811
// Compute determinant of Jacobian
9813
// Compute inverse of Jacobian
9815
// Get vertices on edge
9816
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
9817
const unsigned int v0 = edge_vertices[facet][0];
9818
const unsigned int v1 = edge_vertices[facet][1];
9820
// Compute scale factor (length of edge scaled by length of reference interval)
9821
const double dx0 = x[v1][0] - x[v0][0];
9822
const double dx1 = x[v1][1] - x[v0][1];
9823
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
9825
// Compute geometry tensor
9826
const double G0_0_0 = det*w[1][0]*w[4][0]*(1.0);
9827
const double G0_0_1 = det*w[1][0]*w[4][1]*(1.0);
9828
const double G0_0_2 = det*w[1][0]*w[4][2]*(1.0);
9829
const double G0_0_4 = det*w[1][0]*w[4][4]*(1.0);
9830
const double G0_0_5 = det*w[1][0]*w[4][5]*(1.0);
9831
const double G0_1_0 = det*w[1][1]*w[4][0]*(1.0);
9832
const double G0_1_1 = det*w[1][1]*w[4][1]*(1.0);
9833
const double G0_1_2 = det*w[1][1]*w[4][2]*(1.0);
9834
const double G0_1_3 = det*w[1][1]*w[4][3]*(1.0);
9835
const double G0_1_5 = det*w[1][1]*w[4][5]*(1.0);
9836
const double G0_2_0 = det*w[1][2]*w[4][0]*(1.0);
9837
const double G0_2_1 = det*w[1][2]*w[4][1]*(1.0);
9838
const double G0_2_2 = det*w[1][2]*w[4][2]*(1.0);
9839
const double G0_2_3 = det*w[1][2]*w[4][3]*(1.0);
9840
const double G0_2_4 = det*w[1][2]*w[4][4]*(1.0);
9842
// Compute element tensor
9847
A[0] = 0.000000000000000;
9848
A[1] = 0.150000000000000*G0_1_1 - 0.016666666666667*G0_1_2 + 0.200000000000000*G0_1_3 + 0.016666666666667*G0_2_1 + 0.016666666666667*G0_2_2 + 0.133333333333333*G0_2_3;
9849
A[2] = 0.016666666666667*G0_1_1 + 0.016666666666667*G0_1_2 + 0.133333333333333*G0_1_3 - 0.016666666666667*G0_2_1 + 0.150000000000000*G0_2_2 + 0.200000000000000*G0_2_3;
9854
A[0] = 0.150000000000000*G0_0_0 - 0.016666666666667*G0_0_2 + 0.200000000000000*G0_0_4 + 0.016666666666667*G0_2_0 + 0.016666666666667*G0_2_2 + 0.133333333333333*G0_2_4;
9855
A[1] = 0.000000000000000;
9856
A[2] = 0.016666666666667*G0_0_0 + 0.016666666666667*G0_0_2 + 0.133333333333333*G0_0_4 - 0.016666666666667*G0_2_0 + 0.150000000000000*G0_2_2 + 0.200000000000000*G0_2_4;
9861
A[0] = 0.150000000000000*G0_0_0 - 0.016666666666667*G0_0_1 + 0.200000000000000*G0_0_5 + 0.016666666666667*G0_1_0 + 0.016666666666667*G0_1_1 + 0.133333333333333*G0_1_5;
9862
A[1] = 0.016666666666667*G0_0_0 + 0.016666666666667*G0_0_1 + 0.133333333333333*G0_0_5 - 0.016666666666667*G0_1_0 + 0.150000000000000*G0_1_1 + 0.200000000000000*G0_1_5;
9863
A[2] = 0.000000000000000;
9870
/// Tabulate the tensor for the contribution from a local exterior facet
9871
/// using the specified reference cell quadrature points/weights
9872
virtual void tabulate_tensor(double* A,
9873
const double * const * w,
9875
unsigned int num_quadrature_points,
9876
const double * const * quadrature_points,
9877
const double* quadrature_weights) const
9879
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
9884
/// This class defines the interface for the tabulation of the cell
9885
/// tensor corresponding to the local contribution to a form from
9886
/// the integral over a cell.
9888
class adaptivepoisson_cell_integral_6_0: public ufc::cell_integral
9893
adaptivepoisson_cell_integral_6_0() : ufc::cell_integral()
9899
virtual ~adaptivepoisson_cell_integral_6_0()
9904
/// Tabulate the tensor for the contribution from a local cell
9905
virtual void tabulate_tensor(double* A,
9906
const double * const * w,
9907
const ufc::cell& c) const
9909
// Extract vertex coordinates
9910
const double * const * x = c.coordinates;
9912
// Compute Jacobian of affine map from reference cell
9913
const double J_00 = x[1][0] - x[0][0];
9914
const double J_01 = x[2][0] - x[0][0];
9915
const double J_10 = x[1][1] - x[0][1];
9916
const double J_11 = x[2][1] - x[0][1];
9918
// Compute determinant of Jacobian
9919
double detJ = J_00*J_11 - J_01*J_10;
9921
// Compute inverse of Jacobian
9922
const double K_00 = J_11 / detJ;
9923
const double K_01 = -J_01 / detJ;
9924
const double K_10 = -J_10 / detJ;
9925
const double K_11 = J_00 / detJ;
9928
const double det = std::abs(detJ);
9932
// Compute circumradius, assuming triangle is embedded in 2D.
9935
// Array of quadrature weights.
9936
static const double W4[4] = {0.159020690871988, 0.090979309128011, 0.159020690871988, 0.090979309128011};
9937
// Quadrature points on the UFC reference element: (0.178558728263616, 0.155051025721682), (0.075031110222608, 0.644948974278318), (0.666390246014701, 0.155051025721682), (0.280019915499074, 0.644948974278318)
9939
// Value of basis functions at quadrature points.
9940
static const double FE0[4][3] = \
9941
{{0.666390246014701, 0.178558728263616, 0.155051025721682},
9942
{0.280019915499074, 0.075031110222608, 0.644948974278318},
9943
{0.178558728263616, 0.666390246014701, 0.155051025721682},
9944
{0.075031110222608, 0.280019915499074, 0.644948974278318}};
9946
static const double FE0_D01[4][2] = \
9947
{{-1.000000000000000, 1.000000000000000},
9948
{-1.000000000000000, 1.000000000000000},
9949
{-1.000000000000000, 1.000000000000000},
9950
{-1.000000000000000, 1.000000000000000}};
9952
// Array of non-zero columns
9953
static const unsigned int nzc1[2] = {0, 1};
9955
// Array of non-zero columns
9956
static const unsigned int nzc0[2] = {0, 2};
9958
static const double FE1[4][6] = \
9959
{{0.221761673952367, -0.114792289385376, -0.106969384566991, 0.110742855875331, 0.413297964702014, 0.475959179422654},
9960
{-0.123197609346857, -0.063771775220134, 0.186969384566991, 0.193564950308138, 0.722394229114516, 0.084040820577346},
9961
{-0.114792289385376, 0.221761673952367, -0.106969384566991, 0.413297964702014, 0.110742855875331, 0.475959179422654},
9962
{-0.063771775220134, -0.123197609346857, 0.186969384566991, 0.722394229114516, 0.193564950308138, 0.084040820577346}};
9964
static const double FE1_D01[4][5] = \
9965
{{-1.665560984058806, -0.379795897113271, 0.714234913054465, 2.045356881172077, -0.714234913054465},
9966
{-0.120079661996297, 1.579795897113271, 0.300124440890432, -1.459716235116974, -0.300124440890432},
9967
{0.285765086945535, -0.379795897113271, 2.665560984058804, 0.094030810167737, -2.665560984058805},
9968
{0.699875559109568, 1.579795897113271, 1.120079661996296, -2.279671456222839, -1.120079661996296}};
9970
// Array of non-zero columns
9971
static const unsigned int nzc2[5] = {0, 2, 3, 4, 5};
9973
static const double FE1_D10[4][5] = \
9974
{{-1.665560984058806, -0.285765086945535, 0.620204102886728, -0.620204102886729, 1.951326071004340},
9975
{-0.120079661996296, -0.699875559109568, 2.579795897113270, -2.579795897113271, 0.819955221105864},
9976
{0.285765086945534, 1.665560984058805, 0.620204102886728, -0.620204102886729, -1.951326071004339},
9977
{0.699875559109568, 0.120079661996296, 2.579795897113271, -2.579795897113272, -0.819955221105864}};
9979
// Array of non-zero columns
9980
static const unsigned int nzc3[5] = {0, 1, 3, 4, 5};
9982
// Reset values in the element tensor.
9983
A[0] = 0.000000000000000;
9984
// Number of operations to compute geometry constants: 12.
9986
G[0] = - det*(K_00*K_00 + K_01*K_01);
9987
G[1] = - det*(K_00*K_10 + K_01*K_11);
9988
G[2] = - det*(K_10*K_10 + K_11*K_11);
9990
// Compute element tensor using UFL quadrature representation
9991
// Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
9993
// Loop quadrature points for integral.
9994
// Number of operations to compute element tensor for following IP loop = 240
9995
for (unsigned int ip = 0; ip < 4; ip++)
9998
// Coefficient declarations.
9999
double F0 = 0.000000000000000;
10000
double F1 = 0.000000000000000;
10001
double F2 = 0.000000000000000;
10002
double F3 = 0.000000000000000;
10003
double F4 = 0.000000000000000;
10004
double F5 = 0.000000000000000;
10006
// Total number of operations to compute function values = 8
10007
for (unsigned int r = 0; r < 2; r++)
10009
F2 += FE0_D01[ip][r]*w[2][nzc1[r]];
10010
F3 += FE0_D01[ip][r]*w[2][nzc0[r]];
10011
}// end loop over 'r'
10013
// Total number of operations to compute function values = 6
10014
for (unsigned int r = 0; r < 3; r++)
10016
F0 += FE0[ip][r]*w[0][r];
10017
}// end loop over 'r'
10019
// Total number of operations to compute function values = 20
10020
for (unsigned int r = 0; r < 5; r++)
10022
F4 += FE1_D10[ip][r]*w[3][nzc3[r]];
10023
F5 += FE1_D01[ip][r]*w[3][nzc2[r]];
10024
}// end loop over 'r'
10026
// Total number of operations to compute function values = 12
10027
for (unsigned int r = 0; r < 6; r++)
10029
F1 += FE1[ip][r]*w[3][r];
10030
}// end loop over 'r'
10032
// Number of operations to compute ip constants: 13
10034
// Number of operations: 13
10035
I[0] = W4[ip]*(F0*F1*det + F2*(F4*G[0] + F5*G[1]) + F3*(F4*G[1] + F5*G[2]));
10038
// Number of operations for primary indices: 1
10039
// Number of operations to compute entry: 1
10041
}// end loop over 'ip'
10044
/// Tabulate the tensor for the contribution from a local cell
10045
/// using the specified reference cell quadrature points/weights
10046
virtual void tabulate_tensor(double* A,
10047
const double * const * w,
10048
const ufc::cell& c,
10049
unsigned int num_quadrature_points,
10050
const double * const * quadrature_points,
10051
const double* quadrature_weights) const
10053
throw std::runtime_error("Quadrature version of tabulate_tensor not yet implemented (introduced in UFC 2.0).");
10058
/// This class defines the interface for the tabulation of the
10059
/// exterior facet tensor corresponding to the local contribution to
10060
/// a form from the integral over an exterior facet.
10062
class adaptivepoisson_exterior_facet_integral_6_0: public ufc::exterior_facet_integral
10067
adaptivepoisson_exterior_facet_integral_6_0() : ufc::exterior_facet_integral()
10073
virtual ~adaptivepoisson_exterior_facet_integral_6_0()
10078
/// Tabulate the tensor for the contribution from a local exterior facet
10079
virtual void tabulate_tensor(double* A,
10080
const double * const * w,
10081
const ufc::cell& c,
10082
unsigned int facet) const
10084
// Number of operations (multiply-add pairs) for Jacobian data: 9
10085
// Number of operations (multiply-add pairs) for geometry tensor: 13
10086
// Number of operations (multiply-add pairs) for tensor contraction: 10
10087
// Total number of operations (multiply-add pairs): 32
10089
// Extract vertex coordinates
10090
const double * const * x = c.coordinates;
10092
// Compute Jacobian of affine map from reference cell
10094
// Compute determinant of Jacobian
10096
// Compute inverse of Jacobian
10098
// Get vertices on edge
10099
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
10100
const unsigned int v0 = edge_vertices[facet][0];
10101
const unsigned int v1 = edge_vertices[facet][1];
10103
// Compute scale factor (length of edge scaled by length of reference interval)
10104
const double dx0 = x[v1][0] - x[v0][0];
10105
const double dx1 = x[v1][1] - x[v0][1];
10106
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
10108
// Compute geometry tensor
10109
const double G0_0_0 = det*w[1][0]*w[3][0]*(1.0);
10110
const double G0_0_4 = det*w[1][0]*w[3][4]*(1.0);
10111
const double G0_0_5 = det*w[1][0]*w[3][5]*(1.0);
10112
const double G0_1_1 = det*w[1][1]*w[3][1]*(1.0);
10113
const double G0_1_3 = det*w[1][1]*w[3][3]*(1.0);
10114
const double G0_1_5 = det*w[1][1]*w[3][5]*(1.0);
10115
const double G0_2_2 = det*w[1][2]*w[3][2]*(1.0);
10116
const double G0_2_3 = det*w[1][2]*w[3][3]*(1.0);
10117
const double G0_2_4 = det*w[1][2]*w[3][4]*(1.0);
10119
// Compute element tensor
10124
A[0] = 0.166666666666666*G0_1_1 + 0.333333333333333*G0_1_3 + 0.166666666666666*G0_2_2 + 0.333333333333333*G0_2_3;
10129
A[0] = 0.166666666666667*G0_0_0 + 0.333333333333333*G0_0_4 + 0.166666666666666*G0_2_2 + 0.333333333333333*G0_2_4;
10134
A[0] = 0.166666666666666*G0_0_0 + 0.333333333333333*G0_0_5 + 0.166666666666667*G0_1_1 + 0.333333333333333*G0_1_5;
10141
/// Tabulate the tensor for the contribution from a local exterior facet
10142
/// using the specified reference cell quadrature points/weights
10143
virtual void tabulate_tensor(double* A,
10144
const double * const * w,
10145
const ufc::cell& c,
10146
unsigned int num_quadrature_points,
10147
const double * const * quadrature_points,
10148
const double* quadrature_weights) const
10150
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10155
/// This class defines the interface for the tabulation of the cell
10156
/// tensor corresponding to the local contribution to a form from
10157
/// the integral over a cell.
10159
class adaptivepoisson_cell_integral_7_0: public ufc::cell_integral
10164
adaptivepoisson_cell_integral_7_0() : ufc::cell_integral()
10170
virtual ~adaptivepoisson_cell_integral_7_0()
10175
/// Tabulate the tensor for the contribution from a local cell
10176
virtual void tabulate_tensor(double* A,
10177
const double * const * w,
10178
const ufc::cell& c) const
10180
// Number of operations (multiply-add pairs) for Jacobian data: 9
10181
// Number of operations (multiply-add pairs) for geometry tensor: 40
10182
// Number of operations (multiply-add pairs) for tensor contraction: 26
10183
// Total number of operations (multiply-add pairs): 75
10185
// Extract vertex coordinates
10186
const double * const * x = c.coordinates;
10188
// Compute Jacobian of affine map from reference cell
10189
const double J_00 = x[1][0] - x[0][0];
10190
const double J_01 = x[2][0] - x[0][0];
10191
const double J_10 = x[1][1] - x[0][1];
10192
const double J_11 = x[2][1] - x[0][1];
10194
// Compute determinant of Jacobian
10195
double detJ = J_00*J_11 - J_01*J_10;
10197
// Compute inverse of Jacobian
10199
// Set scale factor
10200
const double det = std::abs(detJ);
10202
// Compute geometry tensor
10203
const double G0_0_0 = det*w[1][0]*w[0][0]*(1.0);
10204
const double G0_0_1 = det*w[1][0]*w[0][1]*(1.0);
10205
const double G0_0_2 = det*w[1][0]*w[0][2]*(1.0);
10206
const double G0_0_3 = det*w[1][0]*w[0][3]*(1.0);
10207
const double G0_0_4 = det*w[1][0]*w[0][4]*(1.0);
10208
const double G0_0_5 = det*w[1][0]*w[0][5]*(1.0);
10209
const double G0_1_0 = det*w[1][1]*w[0][0]*(1.0);
10210
const double G0_1_1 = det*w[1][1]*w[0][1]*(1.0);
10211
const double G0_1_2 = det*w[1][1]*w[0][2]*(1.0);
10212
const double G0_1_3 = det*w[1][1]*w[0][3]*(1.0);
10213
const double G0_1_4 = det*w[1][1]*w[0][4]*(1.0);
10214
const double G0_1_5 = det*w[1][1]*w[0][5]*(1.0);
10215
const double G0_2_0 = det*w[1][2]*w[0][0]*(1.0);
10216
const double G0_2_1 = det*w[1][2]*w[0][1]*(1.0);
10217
const double G0_2_2 = det*w[1][2]*w[0][2]*(1.0);
10218
const double G0_2_3 = det*w[1][2]*w[0][3]*(1.0);
10219
const double G0_2_4 = det*w[1][2]*w[0][4]*(1.0);
10220
const double G0_2_5 = det*w[1][2]*w[0][5]*(1.0);
10221
const double G1_0_0 = det*w[1][0]*w[3][0]*(1.0);
10222
const double G1_0_1 = det*w[1][0]*w[3][1]*(1.0);
10223
const double G1_0_2 = det*w[1][0]*w[3][2]*(1.0);
10224
const double G1_1_0 = det*w[1][1]*w[3][0]*(1.0);
10225
const double G1_1_1 = det*w[1][1]*w[3][1]*(1.0);
10226
const double G1_1_2 = det*w[1][1]*w[3][2]*(1.0);
10227
const double G1_2_0 = det*w[1][2]*w[3][0]*(1.0);
10228
const double G1_2_1 = det*w[1][2]*w[3][1]*(1.0);
10229
const double G1_2_2 = det*w[1][2]*w[3][2]*(1.0);
10231
// Compute element tensor
10232
A[0] = 0.016666666666667*G0_0_0 - 0.008333333333333*G0_0_1 - 0.008333333333333*G0_0_2 + 0.033333333333333*G0_0_3 + 0.066666666666667*G0_0_4 + 0.066666666666666*G0_0_5 - 0.008333333333333*G0_1_0 + 0.016666666666667*G0_1_1 - 0.008333333333333*G0_1_2 + 0.066666666666667*G0_1_3 + 0.033333333333333*G0_1_4 + 0.066666666666666*G0_1_5 - 0.008333333333333*G0_2_0 - 0.008333333333333*G0_2_1 + 0.016666666666667*G0_2_2 + 0.066666666666667*G0_2_3 + 0.066666666666667*G0_2_4 + 0.033333333333333*G0_2_5 - 0.083333333333333*G1_0_0 - 0.041666666666667*G1_0_1 - 0.041666666666667*G1_0_2 - 0.041666666666667*G1_1_0 - 0.083333333333333*G1_1_1 - 0.041666666666667*G1_1_2 - 0.041666666666667*G1_2_0 - 0.041666666666667*G1_2_1 - 0.083333333333333*G1_2_2;
10235
/// Tabulate the tensor for the contribution from a local cell
10236
/// using the specified reference cell quadrature points/weights
10237
virtual void tabulate_tensor(double* A,
10238
const double * const * w,
10239
const ufc::cell& c,
10240
unsigned int num_quadrature_points,
10241
const double * const * quadrature_points,
10242
const double* quadrature_weights) const
10244
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10249
/// This class defines the interface for the tabulation of the
10250
/// exterior facet tensor corresponding to the local contribution to
10251
/// a form from the integral over an exterior facet.
10253
class adaptivepoisson_exterior_facet_integral_7_0: public ufc::exterior_facet_integral
10258
adaptivepoisson_exterior_facet_integral_7_0() : ufc::exterior_facet_integral()
10264
virtual ~adaptivepoisson_exterior_facet_integral_7_0()
10269
/// Tabulate the tensor for the contribution from a local exterior facet
10270
virtual void tabulate_tensor(double* A,
10271
const double * const * w,
10272
const ufc::cell& c,
10273
unsigned int facet) const
10275
// Number of operations (multiply-add pairs) for Jacobian data: 9
10276
// Number of operations (multiply-add pairs) for geometry tensor: 27
10277
// Number of operations (multiply-add pairs) for tensor contraction: 22
10278
// Total number of operations (multiply-add pairs): 58
10280
// Extract vertex coordinates
10281
const double * const * x = c.coordinates;
10283
// Compute Jacobian of affine map from reference cell
10285
// Compute determinant of Jacobian
10287
// Compute inverse of Jacobian
10289
// Get vertices on edge
10290
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
10291
const unsigned int v0 = edge_vertices[facet][0];
10292
const unsigned int v1 = edge_vertices[facet][1];
10294
// Compute scale factor (length of edge scaled by length of reference interval)
10295
const double dx0 = x[v1][0] - x[v0][0];
10296
const double dx1 = x[v1][1] - x[v0][1];
10297
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
10299
// Compute geometry tensor
10300
const double G0_0_0 = det*w[2][0]*w[0][0]*(1.0);
10301
const double G0_0_4 = det*w[2][0]*w[0][4]*(1.0);
10302
const double G0_0_5 = det*w[2][0]*w[0][5]*(1.0);
10303
const double G0_1_1 = det*w[2][1]*w[0][1]*(1.0);
10304
const double G0_1_3 = det*w[2][1]*w[0][3]*(1.0);
10305
const double G0_1_5 = det*w[2][1]*w[0][5]*(1.0);
10306
const double G0_2_2 = det*w[2][2]*w[0][2]*(1.0);
10307
const double G0_2_3 = det*w[2][2]*w[0][3]*(1.0);
10308
const double G0_2_4 = det*w[2][2]*w[0][4]*(1.0);
10309
const double G1_0_0 = det*w[2][0]*w[3][0]*(1.0);
10310
const double G1_0_1 = det*w[2][0]*w[3][1]*(1.0);
10311
const double G1_0_2 = det*w[2][0]*w[3][2]*(1.0);
10312
const double G1_1_0 = det*w[2][1]*w[3][0]*(1.0);
10313
const double G1_1_1 = det*w[2][1]*w[3][1]*(1.0);
10314
const double G1_1_2 = det*w[2][1]*w[3][2]*(1.0);
10315
const double G1_2_0 = det*w[2][2]*w[3][0]*(1.0);
10316
const double G1_2_1 = det*w[2][2]*w[3][1]*(1.0);
10317
const double G1_2_2 = det*w[2][2]*w[3][2]*(1.0);
10319
// Compute element tensor
10324
A[0] = 0.166666666666666*G0_1_1 + 0.333333333333333*G0_1_3 + 0.166666666666666*G0_2_2 + 0.333333333333333*G0_2_3 - 0.333333333333333*G1_1_1 - 0.166666666666667*G1_1_2 - 0.166666666666667*G1_2_1 - 0.333333333333333*G1_2_2;
10329
A[0] = 0.166666666666667*G0_0_0 + 0.333333333333333*G0_0_4 + 0.166666666666666*G0_2_2 + 0.333333333333333*G0_2_4 - 0.333333333333333*G1_0_0 - 0.166666666666667*G1_0_2 - 0.166666666666667*G1_2_0 - 0.333333333333333*G1_2_2;
10334
A[0] = 0.166666666666666*G0_0_0 + 0.333333333333333*G0_0_5 + 0.166666666666667*G0_1_1 + 0.333333333333333*G0_1_5 - 0.333333333333333*G1_0_0 - 0.166666666666667*G1_0_1 - 0.166666666666667*G1_1_0 - 0.333333333333333*G1_1_1;
10341
/// Tabulate the tensor for the contribution from a local exterior facet
10342
/// using the specified reference cell quadrature points/weights
10343
virtual void tabulate_tensor(double* A,
10344
const double * const * w,
10345
const ufc::cell& c,
10346
unsigned int num_quadrature_points,
10347
const double * const * quadrature_points,
10348
const double* quadrature_weights) const
10350
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10355
/// This class defines the interface for the tabulation of the
10356
/// interior facet tensor corresponding to the local contribution to
10357
/// a form from the integral over an interior facet.
10359
class adaptivepoisson_interior_facet_integral_7_0: public ufc::interior_facet_integral
10364
adaptivepoisson_interior_facet_integral_7_0() : ufc::interior_facet_integral()
10370
virtual ~adaptivepoisson_interior_facet_integral_7_0()
10375
/// Tabulate the tensor for the contribution from a local interior facet
10376
virtual void tabulate_tensor(double* A,
10377
const double * const * w,
10378
const ufc::cell& c0,
10379
const ufc::cell& c1,
10380
unsigned int facet0,
10381
unsigned int facet1) const
10383
// Number of operations (multiply-add pairs) for Jacobian data: 12
10384
// Number of operations (multiply-add pairs) for geometry tensor: 108
10385
// Number of operations (multiply-add pairs) for tensor contraction: 279
10386
// Total number of operations (multiply-add pairs): 399
10388
// Extract vertex coordinates
10389
const double * const * x0 = c0.coordinates;
10391
// Compute Jacobian of affine map from reference cell
10393
// Compute determinant of Jacobian
10395
// Compute inverse of Jacobian
10397
// Compute Jacobian of affine map from reference cell
10399
// Compute determinant of Jacobian
10401
// Compute inverse of Jacobian
10403
// Get vertices on edge
10404
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
10405
const unsigned int v0 = edge_vertices[facet0][0];
10406
const unsigned int v1 = edge_vertices[facet0][1];
10408
// Compute scale factor (length of edge scaled by length of reference interval)
10409
const double dx0 = x0[v1][0] - x0[v0][0];
10410
const double dx1 = x0[v1][1] - x0[v0][1];
10411
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
10413
// Compute geometry tensor
10414
const double G0_3_6 = det*w[2][3]*w[0][6]*(1.0);
10415
const double G0_3_10 = det*w[2][3]*w[0][10]*(1.0);
10416
const double G0_3_11 = det*w[2][3]*w[0][11]*(1.0);
10417
const double G0_4_7 = det*w[2][4]*w[0][7]*(1.0);
10418
const double G0_4_9 = det*w[2][4]*w[0][9]*(1.0);
10419
const double G0_4_11 = det*w[2][4]*w[0][11]*(1.0);
10420
const double G0_5_8 = det*w[2][5]*w[0][8]*(1.0);
10421
const double G0_5_9 = det*w[2][5]*w[0][9]*(1.0);
10422
const double G0_5_10 = det*w[2][5]*w[0][10]*(1.0);
10423
const double G1_3_3 = det*w[2][3]*w[3][3]*(1.0);
10424
const double G1_3_4 = det*w[2][3]*w[3][4]*(1.0);
10425
const double G1_3_5 = det*w[2][3]*w[3][5]*(1.0);
10426
const double G1_4_3 = det*w[2][4]*w[3][3]*(1.0);
10427
const double G1_4_4 = det*w[2][4]*w[3][4]*(1.0);
10428
const double G1_4_5 = det*w[2][4]*w[3][5]*(1.0);
10429
const double G1_5_3 = det*w[2][5]*w[3][3]*(1.0);
10430
const double G1_5_4 = det*w[2][5]*w[3][4]*(1.0);
10431
const double G1_5_5 = det*w[2][5]*w[3][5]*(1.0);
10432
const double G2_0_0 = det*w[2][0]*w[0][0]*(1.0);
10433
const double G2_0_4 = det*w[2][0]*w[0][4]*(1.0);
10434
const double G2_0_5 = det*w[2][0]*w[0][5]*(1.0);
10435
const double G2_1_1 = det*w[2][1]*w[0][1]*(1.0);
10436
const double G2_1_3 = det*w[2][1]*w[0][3]*(1.0);
10437
const double G2_1_5 = det*w[2][1]*w[0][5]*(1.0);
10438
const double G2_2_2 = det*w[2][2]*w[0][2]*(1.0);
10439
const double G2_2_3 = det*w[2][2]*w[0][3]*(1.0);
10440
const double G2_2_4 = det*w[2][2]*w[0][4]*(1.0);
10441
const double G3_0_0 = det*w[2][0]*w[3][0]*(1.0);
10442
const double G3_0_1 = det*w[2][0]*w[3][1]*(1.0);
10443
const double G3_0_2 = det*w[2][0]*w[3][2]*(1.0);
10444
const double G3_1_0 = det*w[2][1]*w[3][0]*(1.0);
10445
const double G3_1_1 = det*w[2][1]*w[3][1]*(1.0);
10446
const double G3_1_2 = det*w[2][1]*w[3][2]*(1.0);
10447
const double G3_2_0 = det*w[2][2]*w[3][0]*(1.0);
10448
const double G3_2_1 = det*w[2][2]*w[3][1]*(1.0);
10449
const double G3_2_2 = det*w[2][2]*w[3][2]*(1.0);
10450
const double G4_3_6 = det*w[2][3]*w[0][6]*(1.0);
10451
const double G4_3_10 = det*w[2][3]*w[0][10]*(1.0);
10452
const double G4_3_11 = det*w[2][3]*w[0][11]*(1.0);
10453
const double G4_4_7 = det*w[2][4]*w[0][7]*(1.0);
10454
const double G4_4_9 = det*w[2][4]*w[0][9]*(1.0);
10455
const double G4_4_11 = det*w[2][4]*w[0][11]*(1.0);
10456
const double G4_5_8 = det*w[2][5]*w[0][8]*(1.0);
10457
const double G4_5_9 = det*w[2][5]*w[0][9]*(1.0);
10458
const double G4_5_10 = det*w[2][5]*w[0][10]*(1.0);
10459
const double G5_3_3 = det*w[2][3]*w[3][3]*(1.0);
10460
const double G5_3_4 = det*w[2][3]*w[3][4]*(1.0);
10461
const double G5_3_5 = det*w[2][3]*w[3][5]*(1.0);
10462
const double G5_4_3 = det*w[2][4]*w[3][3]*(1.0);
10463
const double G5_4_4 = det*w[2][4]*w[3][4]*(1.0);
10464
const double G5_4_5 = det*w[2][4]*w[3][5]*(1.0);
10465
const double G5_5_3 = det*w[2][5]*w[3][3]*(1.0);
10466
const double G5_5_4 = det*w[2][5]*w[3][4]*(1.0);
10467
const double G5_5_5 = det*w[2][5]*w[3][5]*(1.0);
10468
const double G6_0_0 = det*w[2][0]*w[0][0]*(1.0);
10469
const double G6_0_4 = det*w[2][0]*w[0][4]*(1.0);
10470
const double G6_0_5 = det*w[2][0]*w[0][5]*(1.0);
10471
const double G6_1_1 = det*w[2][1]*w[0][1]*(1.0);
10472
const double G6_1_3 = det*w[2][1]*w[0][3]*(1.0);
10473
const double G6_1_5 = det*w[2][1]*w[0][5]*(1.0);
10474
const double G6_2_2 = det*w[2][2]*w[0][2]*(1.0);
10475
const double G6_2_3 = det*w[2][2]*w[0][3]*(1.0);
10476
const double G6_2_4 = det*w[2][2]*w[0][4]*(1.0);
10477
const double G7_0_0 = det*w[2][0]*w[3][0]*(1.0);
10478
const double G7_0_1 = det*w[2][0]*w[3][1]*(1.0);
10479
const double G7_0_2 = det*w[2][0]*w[3][2]*(1.0);
10480
const double G7_1_0 = det*w[2][1]*w[3][0]*(1.0);
10481
const double G7_1_1 = det*w[2][1]*w[3][1]*(1.0);
10482
const double G7_1_2 = det*w[2][1]*w[3][2]*(1.0);
10483
const double G7_2_0 = det*w[2][2]*w[3][0]*(1.0);
10484
const double G7_2_1 = det*w[2][2]*w[3][1]*(1.0);
10485
const double G7_2_2 = det*w[2][2]*w[3][2]*(1.0);
10487
// Compute element tensor
10496
A[0] = 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_9 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_9 - 0.166666666666667*G5_4_4 - 0.083333333333333*G5_4_5 - 0.083333333333333*G5_5_4 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_3 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_3 - 0.166666666666667*G7_1_1 - 0.083333333333333*G7_1_2 - 0.083333333333333*G7_2_1 - 0.166666666666667*G7_2_2;
10497
A[1] = 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_9 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_9 - 0.166666666666667*G1_4_4 - 0.083333333333333*G1_4_5 - 0.083333333333333*G1_5_4 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_3 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_3 - 0.166666666666667*G3_1_1 - 0.083333333333333*G3_1_2 - 0.083333333333333*G3_2_1 - 0.166666666666667*G3_2_2;
10502
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_10 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_10 - 0.166666666666667*G5_3_3 - 0.083333333333333*G5_3_5 - 0.083333333333333*G5_5_3 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_3 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_3 - 0.166666666666667*G7_1_1 - 0.083333333333333*G7_1_2 - 0.083333333333333*G7_2_1 - 0.166666666666667*G7_2_2;
10503
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_10 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_10 - 0.166666666666667*G1_3_3 - 0.083333333333333*G1_3_5 - 0.083333333333333*G1_5_3 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_3 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_3 - 0.166666666666667*G3_1_1 - 0.083333333333333*G3_1_2 - 0.083333333333333*G3_2_1 - 0.166666666666667*G3_2_2;
10508
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_11 + 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_11 - 0.166666666666666*G5_3_3 - 0.083333333333333*G5_3_4 - 0.083333333333333*G5_4_3 - 0.166666666666667*G5_4_4 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_3 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_3 - 0.166666666666667*G7_1_1 - 0.083333333333333*G7_1_2 - 0.083333333333333*G7_2_1 - 0.166666666666667*G7_2_2;
10509
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_11 + 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_11 - 0.166666666666666*G1_3_3 - 0.083333333333333*G1_3_4 - 0.083333333333333*G1_4_3 - 0.166666666666667*G1_4_4 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_3 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_3 - 0.166666666666667*G3_1_1 - 0.083333333333333*G3_1_2 - 0.083333333333333*G3_2_1 - 0.166666666666667*G3_2_2;
10522
A[0] = 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_9 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_9 - 0.166666666666667*G5_4_4 - 0.083333333333333*G5_4_5 - 0.083333333333333*G5_5_4 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_4 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_4 - 0.166666666666667*G7_0_0 - 0.083333333333333*G7_0_2 - 0.083333333333333*G7_2_0 - 0.166666666666667*G7_2_2;
10523
A[1] = 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_9 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_9 - 0.166666666666667*G1_4_4 - 0.083333333333333*G1_4_5 - 0.083333333333333*G1_5_4 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_4 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_4 - 0.166666666666667*G3_0_0 - 0.083333333333333*G3_0_2 - 0.083333333333333*G3_2_0 - 0.166666666666667*G3_2_2;
10528
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_10 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_10 - 0.166666666666667*G5_3_3 - 0.083333333333333*G5_3_5 - 0.083333333333333*G5_5_3 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_4 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_4 - 0.166666666666667*G7_0_0 - 0.083333333333333*G7_0_2 - 0.083333333333333*G7_2_0 - 0.166666666666667*G7_2_2;
10529
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_10 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_10 - 0.166666666666667*G1_3_3 - 0.083333333333333*G1_3_5 - 0.083333333333333*G1_5_3 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_4 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_4 - 0.166666666666667*G3_0_0 - 0.083333333333333*G3_0_2 - 0.083333333333333*G3_2_0 - 0.166666666666667*G3_2_2;
10534
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_11 + 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_11 - 0.166666666666666*G5_3_3 - 0.083333333333333*G5_3_4 - 0.083333333333333*G5_4_3 - 0.166666666666667*G5_4_4 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_4 + 0.083333333333333*G6_2_2 + 0.166666666666667*G6_2_4 - 0.166666666666667*G7_0_0 - 0.083333333333333*G7_0_2 - 0.083333333333333*G7_2_0 - 0.166666666666667*G7_2_2;
10535
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_11 + 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_11 - 0.166666666666666*G1_3_3 - 0.083333333333333*G1_3_4 - 0.083333333333333*G1_4_3 - 0.166666666666667*G1_4_4 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_4 + 0.083333333333333*G2_2_2 + 0.166666666666667*G2_2_4 - 0.166666666666667*G3_0_0 - 0.083333333333333*G3_0_2 - 0.083333333333333*G3_2_0 - 0.166666666666667*G3_2_2;
10548
A[0] = 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_9 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_9 - 0.166666666666667*G5_4_4 - 0.083333333333333*G5_4_5 - 0.083333333333333*G5_5_4 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_5 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_5 - 0.166666666666666*G7_0_0 - 0.083333333333333*G7_0_1 - 0.083333333333333*G7_1_0 - 0.166666666666667*G7_1_1;
10549
A[1] = 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_9 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_9 - 0.166666666666667*G1_4_4 - 0.083333333333333*G1_4_5 - 0.083333333333333*G1_5_4 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_5 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_5 - 0.166666666666666*G3_0_0 - 0.083333333333333*G3_0_1 - 0.083333333333333*G3_1_0 - 0.166666666666667*G3_1_1;
10554
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_10 + 0.083333333333333*G4_5_8 + 0.166666666666667*G4_5_10 - 0.166666666666667*G5_3_3 - 0.083333333333333*G5_3_5 - 0.083333333333333*G5_5_3 - 0.166666666666667*G5_5_5 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_5 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_5 - 0.166666666666666*G7_0_0 - 0.083333333333333*G7_0_1 - 0.083333333333333*G7_1_0 - 0.166666666666667*G7_1_1;
10555
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_10 + 0.083333333333333*G0_5_8 + 0.166666666666667*G0_5_10 - 0.166666666666667*G1_3_3 - 0.083333333333333*G1_3_5 - 0.083333333333333*G1_5_3 - 0.166666666666667*G1_5_5 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_5 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_5 - 0.166666666666666*G3_0_0 - 0.083333333333333*G3_0_1 - 0.083333333333333*G3_1_0 - 0.166666666666667*G3_1_1;
10560
A[0] = 0.083333333333333*G4_3_6 + 0.166666666666667*G4_3_11 + 0.083333333333333*G4_4_7 + 0.166666666666667*G4_4_11 - 0.166666666666666*G5_3_3 - 0.083333333333333*G5_3_4 - 0.083333333333333*G5_4_3 - 0.166666666666667*G5_4_4 + 0.083333333333333*G6_0_0 + 0.166666666666667*G6_0_5 + 0.083333333333333*G6_1_1 + 0.166666666666667*G6_1_5 - 0.166666666666666*G7_0_0 - 0.083333333333333*G7_0_1 - 0.083333333333333*G7_1_0 - 0.166666666666667*G7_1_1;
10561
A[1] = 0.083333333333333*G0_3_6 + 0.166666666666667*G0_3_11 + 0.083333333333333*G0_4_7 + 0.166666666666667*G0_4_11 - 0.166666666666666*G1_3_3 - 0.083333333333333*G1_3_4 - 0.083333333333333*G1_4_3 - 0.166666666666667*G1_4_4 + 0.083333333333333*G2_0_0 + 0.166666666666667*G2_0_5 + 0.083333333333333*G2_1_1 + 0.166666666666667*G2_1_5 - 0.166666666666666*G3_0_0 - 0.083333333333333*G3_0_1 - 0.083333333333333*G3_1_0 - 0.166666666666667*G3_1_1;
10572
/// Tabulate the tensor for the contribution from a local interior facet
10573
/// using the specified reference cell quadrature points/weights
10574
virtual void tabulate_tensor(double* A,
10575
const double * const * w,
10576
const ufc::cell& c,
10577
unsigned int num_quadrature_points,
10578
const double * const * quadrature_points,
10579
const double* quadrature_weights) const
10581
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10586
/// This class defines the interface for the tabulation of the cell
10587
/// tensor corresponding to the local contribution to a form from
10588
/// the integral over a cell.
10590
class adaptivepoisson_cell_integral_8_0: public ufc::cell_integral
10595
adaptivepoisson_cell_integral_8_0() : ufc::cell_integral()
10601
virtual ~adaptivepoisson_cell_integral_8_0()
10606
/// Tabulate the tensor for the contribution from a local cell
10607
virtual void tabulate_tensor(double* A,
10608
const double * const * w,
10609
const ufc::cell& c) const
10611
// Number of operations (multiply-add pairs) for Jacobian data: 11
10612
// Number of operations (multiply-add pairs) for geometry tensor: 8
10613
// Number of operations (multiply-add pairs) for tensor contraction: 11
10614
// Total number of operations (multiply-add pairs): 30
10616
// Extract vertex coordinates
10617
const double * const * x = c.coordinates;
10619
// Compute Jacobian of affine map from reference cell
10620
const double J_00 = x[1][0] - x[0][0];
10621
const double J_01 = x[2][0] - x[0][0];
10622
const double J_10 = x[1][1] - x[0][1];
10623
const double J_11 = x[2][1] - x[0][1];
10625
// Compute determinant of Jacobian
10626
double detJ = J_00*J_11 - J_01*J_10;
10628
// Compute inverse of Jacobian
10629
const double K_00 = J_11 / detJ;
10630
const double K_01 = -J_01 / detJ;
10631
const double K_10 = -J_10 / detJ;
10632
const double K_11 = J_00 / detJ;
10634
// Set scale factor
10635
const double det = std::abs(detJ);
10637
// Compute geometry tensor
10638
const double G0_0_0 = det*(K_00*K_00 + K_01*K_01);
10639
const double G0_0_1 = det*(K_00*K_10 + K_01*K_11);
10640
const double G0_1_0 = det*(K_10*K_00 + K_11*K_01);
10641
const double G0_1_1 = det*(K_10*K_10 + K_11*K_11);
10643
// Compute element tensor
10644
A[0] = 0.500000000000000*G0_0_0 + 0.500000000000000*G0_0_1 + 0.500000000000000*G0_1_0 + 0.500000000000000*G0_1_1;
10645
A[1] = -0.500000000000000*G0_0_0 - 0.500000000000000*G0_1_0;
10646
A[2] = -0.500000000000000*G0_0_1 - 0.500000000000000*G0_1_1;
10647
A[3] = -0.500000000000000*G0_0_0 - 0.500000000000000*G0_0_1;
10648
A[4] = 0.500000000000000*G0_0_0;
10649
A[5] = 0.500000000000000*G0_0_1;
10650
A[6] = -0.500000000000000*G0_1_0 - 0.500000000000000*G0_1_1;
10651
A[7] = 0.500000000000000*G0_1_0;
10652
A[8] = 0.500000000000000*G0_1_1;
10655
/// Tabulate the tensor for the contribution from a local cell
10656
/// using the specified reference cell quadrature points/weights
10657
virtual void tabulate_tensor(double* A,
10658
const double * const * w,
10659
const ufc::cell& c,
10660
unsigned int num_quadrature_points,
10661
const double * const * quadrature_points,
10662
const double* quadrature_weights) const
10664
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10669
/// This class defines the interface for the tabulation of the cell
10670
/// tensor corresponding to the local contribution to a form from
10671
/// the integral over a cell.
10673
class adaptivepoisson_cell_integral_9_0: public ufc::cell_integral
10678
adaptivepoisson_cell_integral_9_0() : ufc::cell_integral()
10684
virtual ~adaptivepoisson_cell_integral_9_0()
10689
/// Tabulate the tensor for the contribution from a local cell
10690
virtual void tabulate_tensor(double* A,
10691
const double * const * w,
10692
const ufc::cell& c) const
10694
// Number of operations (multiply-add pairs) for Jacobian data: 9
10695
// Number of operations (multiply-add pairs) for geometry tensor: 3
10696
// Number of operations (multiply-add pairs) for tensor contraction: 7
10697
// Total number of operations (multiply-add pairs): 19
10699
// Extract vertex coordinates
10700
const double * const * x = c.coordinates;
10702
// Compute Jacobian of affine map from reference cell
10703
const double J_00 = x[1][0] - x[0][0];
10704
const double J_01 = x[2][0] - x[0][0];
10705
const double J_10 = x[1][1] - x[0][1];
10706
const double J_11 = x[2][1] - x[0][1];
10708
// Compute determinant of Jacobian
10709
double detJ = J_00*J_11 - J_01*J_10;
10711
// Compute inverse of Jacobian
10713
// Set scale factor
10714
const double det = std::abs(detJ);
10716
// Compute geometry tensor
10717
const double G0_0 = det*w[0][0]*(1.0);
10718
const double G0_1 = det*w[0][1]*(1.0);
10719
const double G0_2 = det*w[0][2]*(1.0);
10721
// Compute element tensor
10722
A[0] = 0.083333333333333*G0_0 + 0.041666666666667*G0_1 + 0.041666666666667*G0_2;
10723
A[1] = 0.041666666666667*G0_0 + 0.083333333333333*G0_1 + 0.041666666666667*G0_2;
10724
A[2] = 0.041666666666667*G0_0 + 0.041666666666667*G0_1 + 0.083333333333333*G0_2;
10727
/// Tabulate the tensor for the contribution from a local cell
10728
/// using the specified reference cell quadrature points/weights
10729
virtual void tabulate_tensor(double* A,
10730
const double * const * w,
10731
const ufc::cell& c,
10732
unsigned int num_quadrature_points,
10733
const double * const * quadrature_points,
10734
const double* quadrature_weights) const
10736
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10741
/// This class defines the interface for the tabulation of the
10742
/// exterior facet tensor corresponding to the local contribution to
10743
/// a form from the integral over an exterior facet.
10745
class adaptivepoisson_exterior_facet_integral_9_0: public ufc::exterior_facet_integral
10750
adaptivepoisson_exterior_facet_integral_9_0() : ufc::exterior_facet_integral()
10756
virtual ~adaptivepoisson_exterior_facet_integral_9_0()
10761
/// Tabulate the tensor for the contribution from a local exterior facet
10762
virtual void tabulate_tensor(double* A,
10763
const double * const * w,
10764
const ufc::cell& c,
10765
unsigned int facet) const
10767
// Number of operations (multiply-add pairs) for Jacobian data: 9
10768
// Number of operations (multiply-add pairs) for geometry tensor: 3
10769
// Number of operations (multiply-add pairs) for tensor contraction: 9
10770
// Total number of operations (multiply-add pairs): 21
10772
// Extract vertex coordinates
10773
const double * const * x = c.coordinates;
10775
// Compute Jacobian of affine map from reference cell
10777
// Compute determinant of Jacobian
10779
// Compute inverse of Jacobian
10781
// Get vertices on edge
10782
static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
10783
const unsigned int v0 = edge_vertices[facet][0];
10784
const unsigned int v1 = edge_vertices[facet][1];
10786
// Compute scale factor (length of edge scaled by length of reference interval)
10787
const double dx0 = x[v1][0] - x[v0][0];
10788
const double dx1 = x[v1][1] - x[v0][1];
10789
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
10791
// Compute geometry tensor
10792
const double G0_0 = det*w[1][0]*(1.0);
10793
const double G0_1 = det*w[1][1]*(1.0);
10794
const double G0_2 = det*w[1][2]*(1.0);
10796
// Compute element tensor
10801
A[0] = 0.000000000000000;
10802
A[1] = 0.333333333333333*G0_1 + 0.166666666666667*G0_2;
10803
A[2] = 0.166666666666667*G0_1 + 0.333333333333333*G0_2;
10808
A[0] = 0.333333333333333*G0_0 + 0.166666666666667*G0_2;
10809
A[1] = 0.000000000000000;
10810
A[2] = 0.166666666666667*G0_0 + 0.333333333333333*G0_2;
10815
A[0] = 0.333333333333333*G0_0 + 0.166666666666667*G0_1;
10816
A[1] = 0.166666666666667*G0_0 + 0.333333333333333*G0_1;
10817
A[2] = 0.000000000000000;
10824
/// Tabulate the tensor for the contribution from a local exterior facet
10825
/// using the specified reference cell quadrature points/weights
10826
virtual void tabulate_tensor(double* A,
10827
const double * const * w,
10828
const ufc::cell& c,
10829
unsigned int num_quadrature_points,
10830
const double * const * quadrature_points,
10831
const double* quadrature_weights) const
10833
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10838
/// This class defines the interface for the tabulation of the cell
10839
/// tensor corresponding to the local contribution to a form from
10840
/// the integral over a cell.
10842
class adaptivepoisson_cell_integral_10_0: public ufc::cell_integral
10847
adaptivepoisson_cell_integral_10_0() : ufc::cell_integral()
10853
virtual ~adaptivepoisson_cell_integral_10_0()
10858
/// Tabulate the tensor for the contribution from a local cell
10859
virtual void tabulate_tensor(double* A,
10860
const double * const * w,
10861
const ufc::cell& c) const
10863
// Number of operations (multiply-add pairs) for Jacobian data: 9
10864
// Number of operations (multiply-add pairs) for geometry tensor: 3
10865
// Number of operations (multiply-add pairs) for tensor contraction: 2
10866
// Total number of operations (multiply-add pairs): 14
10868
// Extract vertex coordinates
10869
const double * const * x = c.coordinates;
10871
// Compute Jacobian of affine map from reference cell
10872
const double J_00 = x[1][0] - x[0][0];
10873
const double J_01 = x[2][0] - x[0][0];
10874
const double J_10 = x[1][1] - x[0][1];
10875
const double J_11 = x[2][1] - x[0][1];
10877
// Compute determinant of Jacobian
10878
double detJ = J_00*J_11 - J_01*J_10;
10880
// Compute inverse of Jacobian
10882
// Set scale factor
10883
const double det = std::abs(detJ);
10885
// Compute geometry tensor
10886
const double G0_0 = det*w[0][0]*(1.0);
10887
const double G0_1 = det*w[0][1]*(1.0);
10888
const double G0_2 = det*w[0][2]*(1.0);
10890
// Compute element tensor
10891
A[0] = 0.166666666666667*G0_0 + 0.166666666666667*G0_1 + 0.166666666666667*G0_2;
10894
/// Tabulate the tensor for the contribution from a local cell
10895
/// using the specified reference cell quadrature points/weights
10896
virtual void tabulate_tensor(double* A,
10897
const double * const * w,
10898
const ufc::cell& c,
10899
unsigned int num_quadrature_points,
10900
const double * const * quadrature_points,
10901
const double* quadrature_weights) const
10903
throw std::runtime_error("Quadrature version of tabulate_tensor not available when using the FFC tensor representation.");
10908
/// This class defines the interface for the assembly of the global
10909
/// tensor corresponding to a form with r + n arguments, that is, a
10912
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
10914
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
10915
/// global tensor A is defined by
10917
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
10919
/// where each argument Vj represents the application to the
10920
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
10921
/// fixed functions (coefficients).
10923
class adaptivepoisson_form_0: public ufc::form
10928
adaptivepoisson_form_0() : ufc::form()
10934
virtual ~adaptivepoisson_form_0()
10939
/// Return a string identifying the form
10940
virtual const char* signature() const
10942
return "Form([Integral(IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(SpatialDerivative(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Measure('cell', 0, None))])";
10945
/// Return the rank of the global tensor (r)
10946
virtual unsigned int rank() const
10951
/// Return the number of coefficients (n)
10952
virtual unsigned int num_coefficients() const
10957
/// Return the number of cell domains
10958
virtual unsigned int num_cell_domains() const
10963
/// Return the number of exterior facet domains
10964
virtual unsigned int num_exterior_facet_domains() const
10969
/// Return the number of interior facet domains
10970
virtual unsigned int num_interior_facet_domains() const
10975
/// Create a new finite element for argument function i
10976
virtual ufc::finite_element* create_finite_element(unsigned int i) const
10982
return new adaptivepoisson_finite_element_5();
10987
return new adaptivepoisson_finite_element_5();
10995
/// Create a new dofmap for argument function i
10996
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11002
return new adaptivepoisson_dofmap_5();
11007
return new adaptivepoisson_dofmap_5();
11015
/// Create a new cell integral on sub domain i
11016
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11022
return new adaptivepoisson_cell_integral_0_0();
11030
/// Create a new exterior facet integral on sub domain i
11031
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11036
/// Create a new interior facet integral on sub domain i
11037
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11044
/// This class defines the interface for the assembly of the global
11045
/// tensor corresponding to a form with r + n arguments, that is, a
11048
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11050
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11051
/// global tensor A is defined by
11053
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11055
/// where each argument Vj represents the application to the
11056
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11057
/// fixed functions (coefficients).
11059
class adaptivepoisson_form_1: public ufc::form
11064
adaptivepoisson_form_1() : ufc::form()
11070
virtual ~adaptivepoisson_form_1()
11075
/// Return a string identifying the form
11076
virtual const char* signature() const
11078
return "Form([Integral(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Measure('cell', 0, None))])";
11081
/// Return the rank of the global tensor (r)
11082
virtual unsigned int rank() const
11087
/// Return the number of coefficients (n)
11088
virtual unsigned int num_coefficients() const
11093
/// Return the number of cell domains
11094
virtual unsigned int num_cell_domains() const
11099
/// Return the number of exterior facet domains
11100
virtual unsigned int num_exterior_facet_domains() const
11105
/// Return the number of interior facet domains
11106
virtual unsigned int num_interior_facet_domains() const
11111
/// Create a new finite element for argument function i
11112
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11118
return new adaptivepoisson_finite_element_5();
11126
/// Create a new dofmap for argument function i
11127
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11133
return new adaptivepoisson_dofmap_5();
11141
/// Create a new cell integral on sub domain i
11142
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11148
return new adaptivepoisson_cell_integral_1_0();
11156
/// Create a new exterior facet integral on sub domain i
11157
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11162
/// Create a new interior facet integral on sub domain i
11163
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11170
/// This class defines the interface for the assembly of the global
11171
/// tensor corresponding to a form with r + n arguments, that is, a
11174
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11176
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11177
/// global tensor A is defined by
11179
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11181
/// where each argument Vj represents the application to the
11182
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11183
/// fixed functions (coefficients).
11185
class adaptivepoisson_form_2: public ufc::form
11190
adaptivepoisson_form_2() : ufc::form()
11196
virtual ~adaptivepoisson_form_2()
11201
/// Return a string identifying the form
11202
virtual const char* signature() const
11204
return "Form([Integral(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3), 0))), Measure('cell', 0, None))])";
11207
/// Return the rank of the global tensor (r)
11208
virtual unsigned int rank() const
11213
/// Return the number of coefficients (n)
11214
virtual unsigned int num_coefficients() const
11219
/// Return the number of cell domains
11220
virtual unsigned int num_cell_domains() const
11225
/// Return the number of exterior facet domains
11226
virtual unsigned int num_exterior_facet_domains() const
11231
/// Return the number of interior facet domains
11232
virtual unsigned int num_interior_facet_domains() const
11237
/// Create a new finite element for argument function i
11238
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11244
return new adaptivepoisson_finite_element_4();
11249
return new adaptivepoisson_finite_element_4();
11254
return new adaptivepoisson_finite_element_3();
11262
/// Create a new dofmap for argument function i
11263
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11269
return new adaptivepoisson_dofmap_4();
11274
return new adaptivepoisson_dofmap_4();
11279
return new adaptivepoisson_dofmap_3();
11287
/// Create a new cell integral on sub domain i
11288
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11294
return new adaptivepoisson_cell_integral_2_0();
11302
/// Create a new exterior facet integral on sub domain i
11303
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11308
/// Create a new interior facet integral on sub domain i
11309
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11316
/// This class defines the interface for the assembly of the global
11317
/// tensor corresponding to a form with r + n arguments, that is, a
11320
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11322
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11323
/// global tensor A is defined by
11325
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11327
/// where each argument Vj represents the application to the
11328
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11329
/// fixed functions (coefficients).
11331
class adaptivepoisson_form_3: public ufc::form
11336
adaptivepoisson_form_3() : ufc::form()
11342
virtual ~adaptivepoisson_form_3()
11347
/// Return a string identifying the form
11348
virtual const char* signature() const
11350
return "Form([Integral(Sum(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3), 3))), Product(IntValue(-1, (), (), {}), IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 2), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Sum(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), SpatialDerivative(Coefficient(FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3), 3), MultiIndex((Index(2),), {Index(2): 2}))), Product(Coefficient(FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3), 3), SpatialDerivative(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), MultiIndex((Index(2),), {Index(2): 2})))), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})))), Measure('cell', 0, None)), Integral(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Bubble', Cell('triangle', 1, Space(2)), 3), 3))), Measure('exterior_facet', 0, None))])";
11353
/// Return the rank of the global tensor (r)
11354
virtual unsigned int rank() const
11359
/// Return the number of coefficients (n)
11360
virtual unsigned int num_coefficients() const
11365
/// Return the number of cell domains
11366
virtual unsigned int num_cell_domains() const
11371
/// Return the number of exterior facet domains
11372
virtual unsigned int num_exterior_facet_domains() const
11377
/// Return the number of interior facet domains
11378
virtual unsigned int num_interior_facet_domains() const
11383
/// Create a new finite element for argument function i
11384
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11390
return new adaptivepoisson_finite_element_4();
11395
return new adaptivepoisson_finite_element_5();
11400
return new adaptivepoisson_finite_element_5();
11405
return new adaptivepoisson_finite_element_5();
11410
return new adaptivepoisson_finite_element_3();
11418
/// Create a new dofmap for argument function i
11419
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11425
return new adaptivepoisson_dofmap_4();
11430
return new adaptivepoisson_dofmap_5();
11435
return new adaptivepoisson_dofmap_5();
11440
return new adaptivepoisson_dofmap_5();
11445
return new adaptivepoisson_dofmap_3();
11453
/// Create a new cell integral on sub domain i
11454
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11460
return new adaptivepoisson_cell_integral_3_0();
11468
/// Create a new exterior facet integral on sub domain i
11469
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11475
return new adaptivepoisson_exterior_facet_integral_3_0();
11483
/// Create a new interior facet integral on sub domain i
11484
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11491
/// This class defines the interface for the assembly of the global
11492
/// tensor corresponding to a form with r + n arguments, that is, a
11495
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11497
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11498
/// global tensor A is defined by
11500
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11502
/// where each argument Vj represents the application to the
11503
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11504
/// fixed functions (coefficients).
11506
class adaptivepoisson_form_4: public ufc::form
11511
adaptivepoisson_form_4() : ufc::form()
11517
virtual ~adaptivepoisson_form_4()
11522
/// Return a string identifying the form
11523
virtual const char* signature() const
11525
return "Form([Integral(Sum(Product(NegativeRestricted(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 1)), NegativeRestricted(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 0)))), Product(PositiveRestricted(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 1)), PositiveRestricted(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 0))))), Measure('interior_facet', 0, None)), Integral(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 0))), Measure('exterior_facet', 0, None))])";
11528
/// Return the rank of the global tensor (r)
11529
virtual unsigned int rank() const
11534
/// Return the number of coefficients (n)
11535
virtual unsigned int num_coefficients() const
11540
/// Return the number of cell domains
11541
virtual unsigned int num_cell_domains() const
11546
/// Return the number of exterior facet domains
11547
virtual unsigned int num_exterior_facet_domains() const
11552
/// Return the number of interior facet domains
11553
virtual unsigned int num_interior_facet_domains() const
11558
/// Create a new finite element for argument function i
11559
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11565
return new adaptivepoisson_finite_element_4();
11570
return new adaptivepoisson_finite_element_4();
11575
return new adaptivepoisson_finite_element_2();
11583
/// Create a new dofmap for argument function i
11584
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11590
return new adaptivepoisson_dofmap_4();
11595
return new adaptivepoisson_dofmap_4();
11600
return new adaptivepoisson_dofmap_2();
11608
/// Create a new cell integral on sub domain i
11609
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11614
/// Create a new exterior facet integral on sub domain i
11615
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11621
return new adaptivepoisson_exterior_facet_integral_4_0();
11629
/// Create a new interior facet integral on sub domain i
11630
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11636
return new adaptivepoisson_interior_facet_integral_4_0();
11646
/// This class defines the interface for the assembly of the global
11647
/// tensor corresponding to a form with r + n arguments, that is, a
11650
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11652
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11653
/// global tensor A is defined by
11655
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11657
/// where each argument Vj represents the application to the
11658
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11659
/// fixed functions (coefficients).
11661
class adaptivepoisson_form_5: public ufc::form
11666
adaptivepoisson_form_5() : ufc::form()
11672
virtual ~adaptivepoisson_form_5()
11677
/// Return a string identifying the form
11678
virtual const char* signature() const
11680
return "Form([Integral(Sum(Product(IntValue(-1, (), (), {}), Product(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 3), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 4)))), Sum(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 4))), Product(IntValue(-1, (), (), {}), IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 2), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Sum(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), SpatialDerivative(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 4), MultiIndex((Index(2),), {Index(2): 2}))), Product(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 4), SpatialDerivative(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), MultiIndex((Index(2),), {Index(2): 2})))), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2}))))), Measure('cell', 0, None)), Integral(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 2), 4))), Measure('exterior_facet', 0, None))])";
11683
/// Return the rank of the global tensor (r)
11684
virtual unsigned int rank() const
11689
/// Return the number of coefficients (n)
11690
virtual unsigned int num_coefficients() const
11695
/// Return the number of cell domains
11696
virtual unsigned int num_cell_domains() const
11701
/// Return the number of exterior facet domains
11702
virtual unsigned int num_exterior_facet_domains() const
11707
/// Return the number of interior facet domains
11708
virtual unsigned int num_interior_facet_domains() const
11713
/// Create a new finite element for argument function i
11714
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11720
return new adaptivepoisson_finite_element_4();
11725
return new adaptivepoisson_finite_element_5();
11730
return new adaptivepoisson_finite_element_5();
11735
return new adaptivepoisson_finite_element_5();
11740
return new adaptivepoisson_finite_element_4();
11745
return new adaptivepoisson_finite_element_2();
11753
/// Create a new dofmap for argument function i
11754
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11760
return new adaptivepoisson_dofmap_4();
11765
return new adaptivepoisson_dofmap_5();
11770
return new adaptivepoisson_dofmap_5();
11775
return new adaptivepoisson_dofmap_5();
11780
return new adaptivepoisson_dofmap_4();
11785
return new adaptivepoisson_dofmap_2();
11793
/// Create a new cell integral on sub domain i
11794
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11800
return new adaptivepoisson_cell_integral_5_0();
11808
/// Create a new exterior facet integral on sub domain i
11809
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11815
return new adaptivepoisson_exterior_facet_integral_5_0();
11823
/// Create a new interior facet integral on sub domain i
11824
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11831
/// This class defines the interface for the assembly of the global
11832
/// tensor corresponding to a form with r + n arguments, that is, a
11835
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
11837
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
11838
/// global tensor A is defined by
11840
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
11842
/// where each argument Vj represents the application to the
11843
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
11844
/// fixed functions (coefficients).
11846
class adaptivepoisson_form_6: public ufc::form
11851
adaptivepoisson_form_6() : ufc::form()
11857
virtual ~adaptivepoisson_form_6()
11862
/// Return a string identifying the form
11863
virtual const char* signature() const
11865
return "Form([Integral(Sum(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 3)), Product(IntValue(-1, (), (), {}), IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 2), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 3), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})))), Measure('cell', 0, None)), Integral(Product(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 3)), Measure('exterior_facet', 0, None))])";
11868
/// Return the rank of the global tensor (r)
11869
virtual unsigned int rank() const
11874
/// Return the number of coefficients (n)
11875
virtual unsigned int num_coefficients() const
11880
/// Return the number of cell domains
11881
virtual unsigned int num_cell_domains() const
11886
/// Return the number of exterior facet domains
11887
virtual unsigned int num_exterior_facet_domains() const
11892
/// Return the number of interior facet domains
11893
virtual unsigned int num_interior_facet_domains() const
11898
/// Create a new finite element for argument function i
11899
virtual ufc::finite_element* create_finite_element(unsigned int i) const
11905
return new adaptivepoisson_finite_element_5();
11910
return new adaptivepoisson_finite_element_5();
11915
return new adaptivepoisson_finite_element_5();
11920
return new adaptivepoisson_finite_element_1();
11928
/// Create a new dofmap for argument function i
11929
virtual ufc::dofmap* create_dofmap(unsigned int i) const
11935
return new adaptivepoisson_dofmap_5();
11940
return new adaptivepoisson_dofmap_5();
11945
return new adaptivepoisson_dofmap_5();
11950
return new adaptivepoisson_dofmap_1();
11958
/// Create a new cell integral on sub domain i
11959
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
11965
return new adaptivepoisson_cell_integral_6_0();
11973
/// Create a new exterior facet integral on sub domain i
11974
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
11980
return new adaptivepoisson_exterior_facet_integral_6_0();
11988
/// Create a new interior facet integral on sub domain i
11989
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
11996
/// This class defines the interface for the assembly of the global
11997
/// tensor corresponding to a form with r + n arguments, that is, a
12000
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
12002
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
12003
/// global tensor A is defined by
12005
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
12007
/// where each argument Vj represents the application to the
12008
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
12009
/// fixed functions (coefficients).
12011
class adaptivepoisson_form_7: public ufc::form
12016
adaptivepoisson_form_7() : ufc::form()
12022
virtual ~adaptivepoisson_form_7()
12027
/// Return a string identifying the form
12028
virtual const char* signature() const
12030
return "Form([Integral(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0), 0), Product(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 1), Sum(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 0), Product(IntValue(-1, (), (), {}), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 3))))), Measure('cell', 0, None)), Integral(Product(Product(FloatValue(0.5, (), (), {}), Sum(NegativeRestricted(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0), 0)), PositiveRestricted(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0), 0)))), Sum(Product(NegativeRestricted(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 2)), NegativeRestricted(Sum(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 0), Product(IntValue(-1, (), (), {}), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 3))))), Product(PositiveRestricted(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 2)), PositiveRestricted(Sum(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 0), Product(IntValue(-1, (), (), {}), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 3))))))), Measure('interior_facet', 0, None)), Integral(Product(Argument(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0), 0), Product(Coefficient(FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 1), 2), Sum(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 0), Product(IntValue(-1, (), (), {}), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 3))))), Measure('exterior_facet', 0, None))])";
12033
/// Return the rank of the global tensor (r)
12034
virtual unsigned int rank() const
12039
/// Return the number of coefficients (n)
12040
virtual unsigned int num_coefficients() const
12045
/// Return the number of cell domains
12046
virtual unsigned int num_cell_domains() const
12051
/// Return the number of exterior facet domains
12052
virtual unsigned int num_exterior_facet_domains() const
12057
/// Return the number of interior facet domains
12058
virtual unsigned int num_interior_facet_domains() const
12063
/// Create a new finite element for argument function i
12064
virtual ufc::finite_element* create_finite_element(unsigned int i) const
12070
return new adaptivepoisson_finite_element_0();
12075
return new adaptivepoisson_finite_element_1();
12080
return new adaptivepoisson_finite_element_4();
12085
return new adaptivepoisson_finite_element_4();
12090
return new adaptivepoisson_finite_element_5();
12098
/// Create a new dofmap for argument function i
12099
virtual ufc::dofmap* create_dofmap(unsigned int i) const
12105
return new adaptivepoisson_dofmap_0();
12110
return new adaptivepoisson_dofmap_1();
12115
return new adaptivepoisson_dofmap_4();
12120
return new adaptivepoisson_dofmap_4();
12125
return new adaptivepoisson_dofmap_5();
12133
/// Create a new cell integral on sub domain i
12134
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
12140
return new adaptivepoisson_cell_integral_7_0();
12148
/// Create a new exterior facet integral on sub domain i
12149
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
12155
return new adaptivepoisson_exterior_facet_integral_7_0();
12163
/// Create a new interior facet integral on sub domain i
12164
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
12170
return new adaptivepoisson_interior_facet_integral_7_0();
12180
/// This class defines the interface for the assembly of the global
12181
/// tensor corresponding to a form with r + n arguments, that is, a
12184
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
12186
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
12187
/// global tensor A is defined by
12189
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
12191
/// where each argument Vj represents the application to the
12192
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
12193
/// fixed functions (coefficients).
12195
class adaptivepoisson_form_8: public ufc::form
12200
adaptivepoisson_form_8() : ufc::form()
12206
virtual ~adaptivepoisson_form_8()
12211
/// Return a string identifying the form
12212
virtual const char* signature() const
12214
return "Form([Integral(IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(SpatialDerivative(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Measure('cell', 0, None))])";
12217
/// Return the rank of the global tensor (r)
12218
virtual unsigned int rank() const
12223
/// Return the number of coefficients (n)
12224
virtual unsigned int num_coefficients() const
12229
/// Return the number of cell domains
12230
virtual unsigned int num_cell_domains() const
12235
/// Return the number of exterior facet domains
12236
virtual unsigned int num_exterior_facet_domains() const
12241
/// Return the number of interior facet domains
12242
virtual unsigned int num_interior_facet_domains() const
12247
/// Create a new finite element for argument function i
12248
virtual ufc::finite_element* create_finite_element(unsigned int i) const
12254
return new adaptivepoisson_finite_element_5();
12259
return new adaptivepoisson_finite_element_5();
12267
/// Create a new dofmap for argument function i
12268
virtual ufc::dofmap* create_dofmap(unsigned int i) const
12274
return new adaptivepoisson_dofmap_5();
12279
return new adaptivepoisson_dofmap_5();
12287
/// Create a new cell integral on sub domain i
12288
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
12294
return new adaptivepoisson_cell_integral_8_0();
12302
/// Create a new exterior facet integral on sub domain i
12303
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
12308
/// Create a new interior facet integral on sub domain i
12309
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
12316
/// This class defines the interface for the assembly of the global
12317
/// tensor corresponding to a form with r + n arguments, that is, a
12320
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
12322
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
12323
/// global tensor A is defined by
12325
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
12327
/// where each argument Vj represents the application to the
12328
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
12329
/// fixed functions (coefficients).
12331
class adaptivepoisson_form_9: public ufc::form
12336
adaptivepoisson_form_9() : ufc::form()
12342
virtual ~adaptivepoisson_form_9()
12347
/// Return a string identifying the form
12348
virtual const char* signature() const
12350
return "Form([Integral(Product(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0)), Measure('cell', 0, None)), Integral(Product(Argument(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 1)), Measure('exterior_facet', 0, None))])";
12353
/// Return the rank of the global tensor (r)
12354
virtual unsigned int rank() const
12359
/// Return the number of coefficients (n)
12360
virtual unsigned int num_coefficients() const
12365
/// Return the number of cell domains
12366
virtual unsigned int num_cell_domains() const
12371
/// Return the number of exterior facet domains
12372
virtual unsigned int num_exterior_facet_domains() const
12377
/// Return the number of interior facet domains
12378
virtual unsigned int num_interior_facet_domains() const
12383
/// Create a new finite element for argument function i
12384
virtual ufc::finite_element* create_finite_element(unsigned int i) const
12390
return new adaptivepoisson_finite_element_5();
12395
return new adaptivepoisson_finite_element_5();
12400
return new adaptivepoisson_finite_element_5();
12408
/// Create a new dofmap for argument function i
12409
virtual ufc::dofmap* create_dofmap(unsigned int i) const
12415
return new adaptivepoisson_dofmap_5();
12420
return new adaptivepoisson_dofmap_5();
12425
return new adaptivepoisson_dofmap_5();
12433
/// Create a new cell integral on sub domain i
12434
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
12440
return new adaptivepoisson_cell_integral_9_0();
12448
/// Create a new exterior facet integral on sub domain i
12449
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
12455
return new adaptivepoisson_exterior_facet_integral_9_0();
12463
/// Create a new interior facet integral on sub domain i
12464
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
12471
/// This class defines the interface for the assembly of the global
12472
/// tensor corresponding to a form with r + n arguments, that is, a
12475
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
12477
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
12478
/// global tensor A is defined by
12480
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
12482
/// where each argument Vj represents the application to the
12483
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
12484
/// fixed functions (coefficients).
12486
class adaptivepoisson_form_10: public ufc::form
12491
adaptivepoisson_form_10() : ufc::form()
12497
virtual ~adaptivepoisson_form_10()
12502
/// Return a string identifying the form
12503
virtual const char* signature() const
12505
return "Form([Integral(Coefficient(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1), 0), Measure('cell', 0, None))])";
12508
/// Return the rank of the global tensor (r)
12509
virtual unsigned int rank() const
12514
/// Return the number of coefficients (n)
12515
virtual unsigned int num_coefficients() const
12520
/// Return the number of cell domains
12521
virtual unsigned int num_cell_domains() const
12526
/// Return the number of exterior facet domains
12527
virtual unsigned int num_exterior_facet_domains() const
12532
/// Return the number of interior facet domains
12533
virtual unsigned int num_interior_facet_domains() const
12538
/// Create a new finite element for argument function i
12539
virtual ufc::finite_element* create_finite_element(unsigned int i) const
12545
return new adaptivepoisson_finite_element_5();
12553
/// Create a new dofmap for argument function i
12554
virtual ufc::dofmap* create_dofmap(unsigned int i) const
12560
return new adaptivepoisson_dofmap_5();
12568
/// Create a new cell integral on sub domain i
12569
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
12575
return new adaptivepoisson_cell_integral_10_0();
12583
/// Create a new exterior facet integral on sub domain i
12584
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
12589
/// Create a new interior facet integral on sub domain i
12590
virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
12599
// Standard library includes
12603
#include <dolfin/common/NoDeleter.h>
12604
#include <dolfin/fem/FiniteElement.h>
12605
#include <dolfin/fem/DofMap.h>
12606
#include <dolfin/fem/Form.h>
12607
#include <dolfin/function/FunctionSpace.h>
12608
#include <dolfin/function/GenericFunction.h>
12609
#include <dolfin/function/CoefficientAssigner.h>
12610
#include <dolfin/adaptivity/ErrorControl.h>
12611
#include <dolfin/adaptivity/GoalFunctional.h>
12613
namespace AdaptivePoisson
12616
class CoefficientSpace___cell_bubble: public dolfin::FunctionSpace
12620
CoefficientSpace___cell_bubble(const dolfin::Mesh& mesh):
12621
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12622
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_3()))),
12623
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_3()), mesh)))
12628
CoefficientSpace___cell_bubble(dolfin::Mesh& mesh):
12629
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12630
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_3()))),
12631
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_3()), mesh)))
12636
CoefficientSpace___cell_bubble(boost::shared_ptr<dolfin::Mesh> mesh):
12637
dolfin::FunctionSpace(mesh,
12638
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_3()))),
12639
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_3()), *mesh)))
12644
CoefficientSpace___cell_bubble(boost::shared_ptr<const dolfin::Mesh> mesh):
12645
dolfin::FunctionSpace(mesh,
12646
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_3()))),
12647
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_3()), *mesh)))
12652
~CoefficientSpace___cell_bubble()
12658
class CoefficientSpace___cell_cone: public dolfin::FunctionSpace
12662
CoefficientSpace___cell_cone(const dolfin::Mesh& mesh):
12663
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12664
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_2()))),
12665
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_2()), mesh)))
12670
CoefficientSpace___cell_cone(dolfin::Mesh& mesh):
12671
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12672
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_2()))),
12673
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_2()), mesh)))
12678
CoefficientSpace___cell_cone(boost::shared_ptr<dolfin::Mesh> mesh):
12679
dolfin::FunctionSpace(mesh,
12680
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_2()))),
12681
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_2()), *mesh)))
12686
CoefficientSpace___cell_cone(boost::shared_ptr<const dolfin::Mesh> mesh):
12687
dolfin::FunctionSpace(mesh,
12688
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_2()))),
12689
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_2()), *mesh)))
12694
~CoefficientSpace___cell_cone()
12700
class CoefficientSpace___cell_residual: public dolfin::FunctionSpace
12704
CoefficientSpace___cell_residual(const dolfin::Mesh& mesh):
12705
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12706
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12707
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
12712
CoefficientSpace___cell_residual(dolfin::Mesh& mesh):
12713
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12714
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12715
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
12720
CoefficientSpace___cell_residual(boost::shared_ptr<dolfin::Mesh> mesh):
12721
dolfin::FunctionSpace(mesh,
12722
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12723
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
12728
CoefficientSpace___cell_residual(boost::shared_ptr<const dolfin::Mesh> mesh):
12729
dolfin::FunctionSpace(mesh,
12730
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12731
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
12736
~CoefficientSpace___cell_residual()
12742
class CoefficientSpace___discrete_dual_solution: public dolfin::FunctionSpace
12746
CoefficientSpace___discrete_dual_solution(const dolfin::Mesh& mesh):
12747
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12748
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12749
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12754
CoefficientSpace___discrete_dual_solution(dolfin::Mesh& mesh):
12755
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12756
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12757
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12762
CoefficientSpace___discrete_dual_solution(boost::shared_ptr<dolfin::Mesh> mesh):
12763
dolfin::FunctionSpace(mesh,
12764
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12765
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12770
CoefficientSpace___discrete_dual_solution(boost::shared_ptr<const dolfin::Mesh> mesh):
12771
dolfin::FunctionSpace(mesh,
12772
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12773
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12778
~CoefficientSpace___discrete_dual_solution()
12784
class CoefficientSpace___discrete_primal_solution: public dolfin::FunctionSpace
12788
CoefficientSpace___discrete_primal_solution(const dolfin::Mesh& mesh):
12789
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12790
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12791
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12796
CoefficientSpace___discrete_primal_solution(dolfin::Mesh& mesh):
12797
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12798
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12799
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12804
CoefficientSpace___discrete_primal_solution(boost::shared_ptr<dolfin::Mesh> mesh):
12805
dolfin::FunctionSpace(mesh,
12806
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12807
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12812
CoefficientSpace___discrete_primal_solution(boost::shared_ptr<const dolfin::Mesh> mesh):
12813
dolfin::FunctionSpace(mesh,
12814
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12815
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12820
~CoefficientSpace___discrete_primal_solution()
12826
class CoefficientSpace___facet_residual: public dolfin::FunctionSpace
12830
CoefficientSpace___facet_residual(const dolfin::Mesh& mesh):
12831
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12832
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12833
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
12838
CoefficientSpace___facet_residual(dolfin::Mesh& mesh):
12839
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12840
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12841
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
12846
CoefficientSpace___facet_residual(boost::shared_ptr<dolfin::Mesh> mesh):
12847
dolfin::FunctionSpace(mesh,
12848
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12849
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
12854
CoefficientSpace___facet_residual(boost::shared_ptr<const dolfin::Mesh> mesh):
12855
dolfin::FunctionSpace(mesh,
12856
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
12857
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
12862
~CoefficientSpace___facet_residual()
12868
class CoefficientSpace___improved_dual: public dolfin::FunctionSpace
12872
CoefficientSpace___improved_dual(const dolfin::Mesh& mesh):
12873
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12874
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_1()))),
12875
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_1()), mesh)))
12880
CoefficientSpace___improved_dual(dolfin::Mesh& mesh):
12881
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12882
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_1()))),
12883
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_1()), mesh)))
12888
CoefficientSpace___improved_dual(boost::shared_ptr<dolfin::Mesh> mesh):
12889
dolfin::FunctionSpace(mesh,
12890
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_1()))),
12891
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_1()), *mesh)))
12896
CoefficientSpace___improved_dual(boost::shared_ptr<const dolfin::Mesh> mesh):
12897
dolfin::FunctionSpace(mesh,
12898
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_1()))),
12899
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_1()), *mesh)))
12904
~CoefficientSpace___improved_dual()
12910
class CoefficientSpace_f: public dolfin::FunctionSpace
12914
CoefficientSpace_f(const dolfin::Mesh& mesh):
12915
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12916
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12917
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12922
CoefficientSpace_f(dolfin::Mesh& mesh):
12923
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12924
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12925
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12930
CoefficientSpace_f(boost::shared_ptr<dolfin::Mesh> mesh):
12931
dolfin::FunctionSpace(mesh,
12932
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12933
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12938
CoefficientSpace_f(boost::shared_ptr<const dolfin::Mesh> mesh):
12939
dolfin::FunctionSpace(mesh,
12940
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12941
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12946
~CoefficientSpace_f()
12952
class CoefficientSpace_g: public dolfin::FunctionSpace
12956
CoefficientSpace_g(const dolfin::Mesh& mesh):
12957
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12958
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12959
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12964
CoefficientSpace_g(dolfin::Mesh& mesh):
12965
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
12966
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12967
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
12972
CoefficientSpace_g(boost::shared_ptr<dolfin::Mesh> mesh):
12973
dolfin::FunctionSpace(mesh,
12974
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12975
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12980
CoefficientSpace_g(boost::shared_ptr<const dolfin::Mesh> mesh):
12981
dolfin::FunctionSpace(mesh,
12982
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
12983
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
12988
~CoefficientSpace_g()
12994
class Form_0_FunctionSpace_0: public dolfin::FunctionSpace
12998
Form_0_FunctionSpace_0(const dolfin::Mesh& mesh):
12999
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13000
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13001
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13006
Form_0_FunctionSpace_0(dolfin::Mesh& mesh):
13007
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13008
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13009
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13014
Form_0_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13015
dolfin::FunctionSpace(mesh,
13016
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13017
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13022
Form_0_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13023
dolfin::FunctionSpace(mesh,
13024
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13025
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13030
~Form_0_FunctionSpace_0()
13036
class Form_0_FunctionSpace_1: public dolfin::FunctionSpace
13040
Form_0_FunctionSpace_1(const dolfin::Mesh& mesh):
13041
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13042
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13043
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13048
Form_0_FunctionSpace_1(dolfin::Mesh& mesh):
13049
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13050
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13051
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13056
Form_0_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
13057
dolfin::FunctionSpace(mesh,
13058
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13059
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13064
Form_0_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
13065
dolfin::FunctionSpace(mesh,
13066
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13067
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13072
~Form_0_FunctionSpace_1()
13078
class Form_0: public dolfin::Form
13083
Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
13086
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13087
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13089
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_0());
13093
Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
13096
_function_spaces[0] = V0;
13097
_function_spaces[1] = V1;
13099
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_0());
13106
/// Return the number of the coefficient with this name
13107
virtual dolfin::uint coefficient_number(const std::string& name) const
13110
dolfin::error("No coefficients.");
13114
/// Return the name of the coefficient with this number
13115
virtual std::string coefficient_name(dolfin::uint i) const
13118
dolfin::error("No coefficients.");
13123
typedef Form_0_FunctionSpace_0 TestSpace;
13124
typedef Form_0_FunctionSpace_1 TrialSpace;
13129
class Form_1_FunctionSpace_0: public dolfin::FunctionSpace
13133
Form_1_FunctionSpace_0(const dolfin::Mesh& mesh):
13134
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13135
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13136
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13141
Form_1_FunctionSpace_0(dolfin::Mesh& mesh):
13142
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13143
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13144
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
13149
Form_1_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13150
dolfin::FunctionSpace(mesh,
13151
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13152
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13157
Form_1_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13158
dolfin::FunctionSpace(mesh,
13159
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
13160
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
13165
~Form_1_FunctionSpace_0()
13171
class Form_1: public dolfin::Form
13176
Form_1(const dolfin::FunctionSpace& V0):
13179
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13181
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_1());
13185
Form_1(boost::shared_ptr<const dolfin::FunctionSpace> V0):
13188
_function_spaces[0] = V0;
13190
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_1());
13197
/// Return the number of the coefficient with this name
13198
virtual dolfin::uint coefficient_number(const std::string& name) const
13201
dolfin::error("No coefficients.");
13205
/// Return the name of the coefficient with this number
13206
virtual std::string coefficient_name(dolfin::uint i) const
13209
dolfin::error("No coefficients.");
13214
typedef Form_1_FunctionSpace_0 TestSpace;
13219
class Form_2_FunctionSpace_0: public dolfin::FunctionSpace
13223
Form_2_FunctionSpace_0(const dolfin::Mesh& mesh):
13224
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13225
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13226
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13231
Form_2_FunctionSpace_0(dolfin::Mesh& mesh):
13232
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13233
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13234
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13239
Form_2_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13240
dolfin::FunctionSpace(mesh,
13241
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13242
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13247
Form_2_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13248
dolfin::FunctionSpace(mesh,
13249
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13250
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13255
~Form_2_FunctionSpace_0()
13261
class Form_2_FunctionSpace_1: public dolfin::FunctionSpace
13265
Form_2_FunctionSpace_1(const dolfin::Mesh& mesh):
13266
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13267
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13268
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13273
Form_2_FunctionSpace_1(dolfin::Mesh& mesh):
13274
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13275
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13276
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13281
Form_2_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
13282
dolfin::FunctionSpace(mesh,
13283
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13284
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13289
Form_2_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
13290
dolfin::FunctionSpace(mesh,
13291
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13292
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13297
~Form_2_FunctionSpace_1()
13303
typedef CoefficientSpace___cell_bubble Form_2_FunctionSpace_2;
13305
class Form_2: public dolfin::Form
13310
Form_2(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
13311
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13313
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13314
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13316
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13320
Form_2(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, const dolfin::GenericFunction& __cell_bubble):
13321
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13323
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13324
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13326
this->__cell_bubble = __cell_bubble;
13328
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13332
Form_2(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, boost::shared_ptr<const dolfin::GenericFunction> __cell_bubble):
13333
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13335
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13336
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13338
this->__cell_bubble = *__cell_bubble;
13340
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13344
Form_2(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
13345
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13347
_function_spaces[0] = V0;
13348
_function_spaces[1] = V1;
13350
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13354
Form_2(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, const dolfin::GenericFunction& __cell_bubble):
13355
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13357
_function_spaces[0] = V0;
13358
_function_spaces[1] = V1;
13360
this->__cell_bubble = __cell_bubble;
13362
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13366
Form_2(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, boost::shared_ptr<const dolfin::GenericFunction> __cell_bubble):
13367
dolfin::Form(2, 1), __cell_bubble(*this, 0)
13369
_function_spaces[0] = V0;
13370
_function_spaces[1] = V1;
13372
this->__cell_bubble = *__cell_bubble;
13374
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_2());
13381
/// Return the number of the coefficient with this name
13382
virtual dolfin::uint coefficient_number(const std::string& name) const
13384
if (name == "__cell_bubble")
13387
dolfin::error("Invalid coefficient.");
13391
/// Return the name of the coefficient with this number
13392
virtual std::string coefficient_name(dolfin::uint i) const
13397
return "__cell_bubble";
13400
dolfin::error("Invalid coefficient.");
13405
typedef Form_2_FunctionSpace_0 TestSpace;
13406
typedef Form_2_FunctionSpace_1 TrialSpace;
13407
typedef Form_2_FunctionSpace_2 CoefficientSpace___cell_bubble;
13410
dolfin::CoefficientAssigner __cell_bubble;
13413
class Form_3_FunctionSpace_0: public dolfin::FunctionSpace
13417
Form_3_FunctionSpace_0(const dolfin::Mesh& mesh):
13418
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13419
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13420
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13425
Form_3_FunctionSpace_0(dolfin::Mesh& mesh):
13426
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13427
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13428
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13433
Form_3_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13434
dolfin::FunctionSpace(mesh,
13435
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13436
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13441
Form_3_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13442
dolfin::FunctionSpace(mesh,
13443
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13444
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13449
~Form_3_FunctionSpace_0()
13455
typedef CoefficientSpace_f Form_3_FunctionSpace_1;
13457
typedef CoefficientSpace_g Form_3_FunctionSpace_2;
13459
typedef CoefficientSpace___discrete_primal_solution Form_3_FunctionSpace_3;
13461
typedef CoefficientSpace___cell_bubble Form_3_FunctionSpace_4;
13463
class Form_3: public dolfin::Form
13468
Form_3(const dolfin::FunctionSpace& V0):
13469
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13471
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13473
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13477
Form_3(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __cell_bubble):
13478
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13480
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13484
this->__discrete_primal_solution = __discrete_primal_solution;
13485
this->__cell_bubble = __cell_bubble;
13487
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13491
Form_3(const dolfin::FunctionSpace& V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __cell_bubble):
13492
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13494
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13498
this->__discrete_primal_solution = *__discrete_primal_solution;
13499
this->__cell_bubble = *__cell_bubble;
13501
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13505
Form_3(boost::shared_ptr<const dolfin::FunctionSpace> V0):
13506
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13508
_function_spaces[0] = V0;
13510
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13514
Form_3(boost::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __cell_bubble):
13515
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13517
_function_spaces[0] = V0;
13521
this->__discrete_primal_solution = __discrete_primal_solution;
13522
this->__cell_bubble = __cell_bubble;
13524
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13528
Form_3(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __cell_bubble):
13529
dolfin::Form(1, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_bubble(*this, 3)
13531
_function_spaces[0] = V0;
13535
this->__discrete_primal_solution = *__discrete_primal_solution;
13536
this->__cell_bubble = *__cell_bubble;
13538
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_3());
13545
/// Return the number of the coefficient with this name
13546
virtual dolfin::uint coefficient_number(const std::string& name) const
13550
else if (name == "g")
13552
else if (name == "__discrete_primal_solution")
13554
else if (name == "__cell_bubble")
13557
dolfin::error("Invalid coefficient.");
13561
/// Return the name of the coefficient with this number
13562
virtual std::string coefficient_name(dolfin::uint i) const
13571
return "__discrete_primal_solution";
13573
return "__cell_bubble";
13576
dolfin::error("Invalid coefficient.");
13581
typedef Form_3_FunctionSpace_0 TestSpace;
13582
typedef Form_3_FunctionSpace_1 CoefficientSpace_f;
13583
typedef Form_3_FunctionSpace_2 CoefficientSpace_g;
13584
typedef Form_3_FunctionSpace_3 CoefficientSpace___discrete_primal_solution;
13585
typedef Form_3_FunctionSpace_4 CoefficientSpace___cell_bubble;
13588
dolfin::CoefficientAssigner f;
13589
dolfin::CoefficientAssigner g;
13590
dolfin::CoefficientAssigner __discrete_primal_solution;
13591
dolfin::CoefficientAssigner __cell_bubble;
13594
class Form_4_FunctionSpace_0: public dolfin::FunctionSpace
13598
Form_4_FunctionSpace_0(const dolfin::Mesh& mesh):
13599
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13600
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13601
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13606
Form_4_FunctionSpace_0(dolfin::Mesh& mesh):
13607
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13608
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13609
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13614
Form_4_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13615
dolfin::FunctionSpace(mesh,
13616
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13617
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13622
Form_4_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13623
dolfin::FunctionSpace(mesh,
13624
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13625
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13630
~Form_4_FunctionSpace_0()
13636
class Form_4_FunctionSpace_1: public dolfin::FunctionSpace
13640
Form_4_FunctionSpace_1(const dolfin::Mesh& mesh):
13641
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13642
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13643
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13648
Form_4_FunctionSpace_1(dolfin::Mesh& mesh):
13649
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13650
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13651
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13656
Form_4_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
13657
dolfin::FunctionSpace(mesh,
13658
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13659
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13664
Form_4_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
13665
dolfin::FunctionSpace(mesh,
13666
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13667
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13672
~Form_4_FunctionSpace_1()
13678
typedef CoefficientSpace___cell_cone Form_4_FunctionSpace_2;
13680
class Form_4: public dolfin::Form
13685
Form_4(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
13686
dolfin::Form(2, 1), __cell_cone(*this, 0)
13688
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13689
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13691
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13695
Form_4(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, const dolfin::GenericFunction& __cell_cone):
13696
dolfin::Form(2, 1), __cell_cone(*this, 0)
13698
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13699
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13701
this->__cell_cone = __cell_cone;
13703
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13707
Form_4(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, boost::shared_ptr<const dolfin::GenericFunction> __cell_cone):
13708
dolfin::Form(2, 1), __cell_cone(*this, 0)
13710
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13711
_function_spaces[1] = reference_to_no_delete_pointer(V1);
13713
this->__cell_cone = *__cell_cone;
13715
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13719
Form_4(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
13720
dolfin::Form(2, 1), __cell_cone(*this, 0)
13722
_function_spaces[0] = V0;
13723
_function_spaces[1] = V1;
13725
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13729
Form_4(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, const dolfin::GenericFunction& __cell_cone):
13730
dolfin::Form(2, 1), __cell_cone(*this, 0)
13732
_function_spaces[0] = V0;
13733
_function_spaces[1] = V1;
13735
this->__cell_cone = __cell_cone;
13737
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13741
Form_4(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, boost::shared_ptr<const dolfin::GenericFunction> __cell_cone):
13742
dolfin::Form(2, 1), __cell_cone(*this, 0)
13744
_function_spaces[0] = V0;
13745
_function_spaces[1] = V1;
13747
this->__cell_cone = *__cell_cone;
13749
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_4());
13756
/// Return the number of the coefficient with this name
13757
virtual dolfin::uint coefficient_number(const std::string& name) const
13759
if (name == "__cell_cone")
13762
dolfin::error("Invalid coefficient.");
13766
/// Return the name of the coefficient with this number
13767
virtual std::string coefficient_name(dolfin::uint i) const
13772
return "__cell_cone";
13775
dolfin::error("Invalid coefficient.");
13780
typedef Form_4_FunctionSpace_0 TestSpace;
13781
typedef Form_4_FunctionSpace_1 TrialSpace;
13782
typedef Form_4_FunctionSpace_2 CoefficientSpace___cell_cone;
13785
dolfin::CoefficientAssigner __cell_cone;
13788
class Form_5_FunctionSpace_0: public dolfin::FunctionSpace
13792
Form_5_FunctionSpace_0(const dolfin::Mesh& mesh):
13793
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13794
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13795
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13800
Form_5_FunctionSpace_0(dolfin::Mesh& mesh):
13801
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
13802
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13803
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), mesh)))
13808
Form_5_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
13809
dolfin::FunctionSpace(mesh,
13810
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13811
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13816
Form_5_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
13817
dolfin::FunctionSpace(mesh,
13818
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_4()))),
13819
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_4()), *mesh)))
13824
~Form_5_FunctionSpace_0()
13830
typedef CoefficientSpace_f Form_5_FunctionSpace_1;
13832
typedef CoefficientSpace_g Form_5_FunctionSpace_2;
13834
typedef CoefficientSpace___discrete_primal_solution Form_5_FunctionSpace_3;
13836
typedef CoefficientSpace___cell_residual Form_5_FunctionSpace_4;
13838
typedef CoefficientSpace___cell_cone Form_5_FunctionSpace_5;
13840
class Form_5: public dolfin::Form
13845
Form_5(const dolfin::FunctionSpace& V0):
13846
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13848
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13850
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13854
Form_5(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __cell_residual, const dolfin::GenericFunction& __cell_cone):
13855
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13857
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13861
this->__discrete_primal_solution = __discrete_primal_solution;
13862
this->__cell_residual = __cell_residual;
13863
this->__cell_cone = __cell_cone;
13865
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13869
Form_5(const dolfin::FunctionSpace& V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __cell_residual, boost::shared_ptr<const dolfin::GenericFunction> __cell_cone):
13870
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13872
_function_spaces[0] = reference_to_no_delete_pointer(V0);
13876
this->__discrete_primal_solution = *__discrete_primal_solution;
13877
this->__cell_residual = *__cell_residual;
13878
this->__cell_cone = *__cell_cone;
13880
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13884
Form_5(boost::shared_ptr<const dolfin::FunctionSpace> V0):
13885
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13887
_function_spaces[0] = V0;
13889
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13893
Form_5(boost::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __cell_residual, const dolfin::GenericFunction& __cell_cone):
13894
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13896
_function_spaces[0] = V0;
13900
this->__discrete_primal_solution = __discrete_primal_solution;
13901
this->__cell_residual = __cell_residual;
13902
this->__cell_cone = __cell_cone;
13904
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13908
Form_5(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __cell_residual, boost::shared_ptr<const dolfin::GenericFunction> __cell_cone):
13909
dolfin::Form(1, 5), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __cell_residual(*this, 3), __cell_cone(*this, 4)
13911
_function_spaces[0] = V0;
13915
this->__discrete_primal_solution = *__discrete_primal_solution;
13916
this->__cell_residual = *__cell_residual;
13917
this->__cell_cone = *__cell_cone;
13919
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_5());
13926
/// Return the number of the coefficient with this name
13927
virtual dolfin::uint coefficient_number(const std::string& name) const
13931
else if (name == "g")
13933
else if (name == "__discrete_primal_solution")
13935
else if (name == "__cell_residual")
13937
else if (name == "__cell_cone")
13940
dolfin::error("Invalid coefficient.");
13944
/// Return the name of the coefficient with this number
13945
virtual std::string coefficient_name(dolfin::uint i) const
13954
return "__discrete_primal_solution";
13956
return "__cell_residual";
13958
return "__cell_cone";
13961
dolfin::error("Invalid coefficient.");
13966
typedef Form_5_FunctionSpace_0 TestSpace;
13967
typedef Form_5_FunctionSpace_1 CoefficientSpace_f;
13968
typedef Form_5_FunctionSpace_2 CoefficientSpace_g;
13969
typedef Form_5_FunctionSpace_3 CoefficientSpace___discrete_primal_solution;
13970
typedef Form_5_FunctionSpace_4 CoefficientSpace___cell_residual;
13971
typedef Form_5_FunctionSpace_5 CoefficientSpace___cell_cone;
13974
dolfin::CoefficientAssigner f;
13975
dolfin::CoefficientAssigner g;
13976
dolfin::CoefficientAssigner __discrete_primal_solution;
13977
dolfin::CoefficientAssigner __cell_residual;
13978
dolfin::CoefficientAssigner __cell_cone;
13981
typedef CoefficientSpace_f Form_6_FunctionSpace_0;
13983
typedef CoefficientSpace_g Form_6_FunctionSpace_1;
13985
typedef CoefficientSpace___discrete_primal_solution Form_6_FunctionSpace_2;
13987
typedef CoefficientSpace___improved_dual Form_6_FunctionSpace_3;
13989
class Form_6: public dolfin::Form
13994
Form_6(const dolfin::Mesh& mesh):
13995
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
13997
_mesh = reference_to_no_delete_pointer(mesh);
13998
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14002
Form_6(const dolfin::Mesh& mesh, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __improved_dual):
14003
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
14005
_mesh = reference_to_no_delete_pointer(mesh);
14008
this->__discrete_primal_solution = __discrete_primal_solution;
14009
this->__improved_dual = __improved_dual;
14011
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14015
Form_6(const dolfin::Mesh& mesh, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __improved_dual):
14016
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
14018
_mesh = reference_to_no_delete_pointer(mesh);
14021
this->__discrete_primal_solution = *__discrete_primal_solution;
14022
this->__improved_dual = *__improved_dual;
14024
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14028
Form_6(boost::shared_ptr<const dolfin::Mesh> mesh):
14029
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
14032
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14036
Form_6(boost::shared_ptr<const dolfin::Mesh> mesh, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g, const dolfin::GenericFunction& __discrete_primal_solution, const dolfin::GenericFunction& __improved_dual):
14037
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
14042
this->__discrete_primal_solution = __discrete_primal_solution;
14043
this->__improved_dual = __improved_dual;
14045
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14049
Form_6(boost::shared_ptr<const dolfin::Mesh> mesh, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution, boost::shared_ptr<const dolfin::GenericFunction> __improved_dual):
14050
dolfin::Form(0, 4), f(*this, 0), g(*this, 1), __discrete_primal_solution(*this, 2), __improved_dual(*this, 3)
14055
this->__discrete_primal_solution = *__discrete_primal_solution;
14056
this->__improved_dual = *__improved_dual;
14058
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_6());
14065
/// Return the number of the coefficient with this name
14066
virtual dolfin::uint coefficient_number(const std::string& name) const
14070
else if (name == "g")
14072
else if (name == "__discrete_primal_solution")
14074
else if (name == "__improved_dual")
14077
dolfin::error("Invalid coefficient.");
14081
/// Return the name of the coefficient with this number
14082
virtual std::string coefficient_name(dolfin::uint i) const
14091
return "__discrete_primal_solution";
14093
return "__improved_dual";
14096
dolfin::error("Invalid coefficient.");
14101
typedef Form_6_FunctionSpace_0 CoefficientSpace_f;
14102
typedef Form_6_FunctionSpace_1 CoefficientSpace_g;
14103
typedef Form_6_FunctionSpace_2 CoefficientSpace___discrete_primal_solution;
14104
typedef Form_6_FunctionSpace_3 CoefficientSpace___improved_dual;
14107
dolfin::CoefficientAssigner f;
14108
dolfin::CoefficientAssigner g;
14109
dolfin::CoefficientAssigner __discrete_primal_solution;
14110
dolfin::CoefficientAssigner __improved_dual;
14113
class Form_7_FunctionSpace_0: public dolfin::FunctionSpace
14117
Form_7_FunctionSpace_0(const dolfin::Mesh& mesh):
14118
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14119
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_0()))),
14120
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_0()), mesh)))
14125
Form_7_FunctionSpace_0(dolfin::Mesh& mesh):
14126
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14127
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_0()))),
14128
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_0()), mesh)))
14133
Form_7_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
14134
dolfin::FunctionSpace(mesh,
14135
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_0()))),
14136
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_0()), *mesh)))
14141
Form_7_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
14142
dolfin::FunctionSpace(mesh,
14143
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_0()))),
14144
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_0()), *mesh)))
14149
~Form_7_FunctionSpace_0()
14155
typedef CoefficientSpace___improved_dual Form_7_FunctionSpace_1;
14157
typedef CoefficientSpace___cell_residual Form_7_FunctionSpace_2;
14159
typedef CoefficientSpace___facet_residual Form_7_FunctionSpace_3;
14161
typedef CoefficientSpace___discrete_dual_solution Form_7_FunctionSpace_4;
14163
class Form_7: public dolfin::Form
14168
Form_7(const dolfin::FunctionSpace& V0):
14169
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14171
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14173
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14177
Form_7(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& __improved_dual, const dolfin::GenericFunction& __cell_residual, const dolfin::GenericFunction& __facet_residual, const dolfin::GenericFunction& __discrete_dual_solution):
14178
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14180
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14182
this->__improved_dual = __improved_dual;
14183
this->__cell_residual = __cell_residual;
14184
this->__facet_residual = __facet_residual;
14185
this->__discrete_dual_solution = __discrete_dual_solution;
14187
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14191
Form_7(const dolfin::FunctionSpace& V0, boost::shared_ptr<const dolfin::GenericFunction> __improved_dual, boost::shared_ptr<const dolfin::GenericFunction> __cell_residual, boost::shared_ptr<const dolfin::GenericFunction> __facet_residual, boost::shared_ptr<const dolfin::GenericFunction> __discrete_dual_solution):
14192
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14194
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14196
this->__improved_dual = *__improved_dual;
14197
this->__cell_residual = *__cell_residual;
14198
this->__facet_residual = *__facet_residual;
14199
this->__discrete_dual_solution = *__discrete_dual_solution;
14201
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14205
Form_7(boost::shared_ptr<const dolfin::FunctionSpace> V0):
14206
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14208
_function_spaces[0] = V0;
14210
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14214
Form_7(boost::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& __improved_dual, const dolfin::GenericFunction& __cell_residual, const dolfin::GenericFunction& __facet_residual, const dolfin::GenericFunction& __discrete_dual_solution):
14215
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14217
_function_spaces[0] = V0;
14219
this->__improved_dual = __improved_dual;
14220
this->__cell_residual = __cell_residual;
14221
this->__facet_residual = __facet_residual;
14222
this->__discrete_dual_solution = __discrete_dual_solution;
14224
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14228
Form_7(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::GenericFunction> __improved_dual, boost::shared_ptr<const dolfin::GenericFunction> __cell_residual, boost::shared_ptr<const dolfin::GenericFunction> __facet_residual, boost::shared_ptr<const dolfin::GenericFunction> __discrete_dual_solution):
14229
dolfin::Form(1, 4), __improved_dual(*this, 0), __cell_residual(*this, 1), __facet_residual(*this, 2), __discrete_dual_solution(*this, 3)
14231
_function_spaces[0] = V0;
14233
this->__improved_dual = *__improved_dual;
14234
this->__cell_residual = *__cell_residual;
14235
this->__facet_residual = *__facet_residual;
14236
this->__discrete_dual_solution = *__discrete_dual_solution;
14238
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_7());
14245
/// Return the number of the coefficient with this name
14246
virtual dolfin::uint coefficient_number(const std::string& name) const
14248
if (name == "__improved_dual")
14250
else if (name == "__cell_residual")
14252
else if (name == "__facet_residual")
14254
else if (name == "__discrete_dual_solution")
14257
dolfin::error("Invalid coefficient.");
14261
/// Return the name of the coefficient with this number
14262
virtual std::string coefficient_name(dolfin::uint i) const
14267
return "__improved_dual";
14269
return "__cell_residual";
14271
return "__facet_residual";
14273
return "__discrete_dual_solution";
14276
dolfin::error("Invalid coefficient.");
14281
typedef Form_7_FunctionSpace_0 TestSpace;
14282
typedef Form_7_FunctionSpace_1 CoefficientSpace___improved_dual;
14283
typedef Form_7_FunctionSpace_2 CoefficientSpace___cell_residual;
14284
typedef Form_7_FunctionSpace_3 CoefficientSpace___facet_residual;
14285
typedef Form_7_FunctionSpace_4 CoefficientSpace___discrete_dual_solution;
14288
dolfin::CoefficientAssigner __improved_dual;
14289
dolfin::CoefficientAssigner __cell_residual;
14290
dolfin::CoefficientAssigner __facet_residual;
14291
dolfin::CoefficientAssigner __discrete_dual_solution;
14294
class Form_8_FunctionSpace_0: public dolfin::FunctionSpace
14298
Form_8_FunctionSpace_0(const dolfin::Mesh& mesh):
14299
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14300
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14301
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14306
Form_8_FunctionSpace_0(dolfin::Mesh& mesh):
14307
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14308
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14309
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14314
Form_8_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
14315
dolfin::FunctionSpace(mesh,
14316
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14317
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14322
Form_8_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
14323
dolfin::FunctionSpace(mesh,
14324
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14325
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14330
~Form_8_FunctionSpace_0()
14336
class Form_8_FunctionSpace_1: public dolfin::FunctionSpace
14340
Form_8_FunctionSpace_1(const dolfin::Mesh& mesh):
14341
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14342
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14343
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14348
Form_8_FunctionSpace_1(dolfin::Mesh& mesh):
14349
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14350
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14351
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14356
Form_8_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
14357
dolfin::FunctionSpace(mesh,
14358
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14359
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14364
Form_8_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
14365
dolfin::FunctionSpace(mesh,
14366
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14367
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14372
~Form_8_FunctionSpace_1()
14378
class Form_8: public dolfin::Form
14383
Form_8(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
14386
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14387
_function_spaces[1] = reference_to_no_delete_pointer(V1);
14389
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_8());
14393
Form_8(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
14396
_function_spaces[0] = V0;
14397
_function_spaces[1] = V1;
14399
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_8());
14406
/// Return the number of the coefficient with this name
14407
virtual dolfin::uint coefficient_number(const std::string& name) const
14410
dolfin::error("No coefficients.");
14414
/// Return the name of the coefficient with this number
14415
virtual std::string coefficient_name(dolfin::uint i) const
14418
dolfin::error("No coefficients.");
14423
typedef Form_8_FunctionSpace_0 TestSpace;
14424
typedef Form_8_FunctionSpace_1 TrialSpace;
14429
class Form_9_FunctionSpace_0: public dolfin::FunctionSpace
14433
Form_9_FunctionSpace_0(const dolfin::Mesh& mesh):
14434
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14435
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14436
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14441
Form_9_FunctionSpace_0(dolfin::Mesh& mesh):
14442
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
14443
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14444
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), mesh)))
14449
Form_9_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
14450
dolfin::FunctionSpace(mesh,
14451
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14452
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14457
Form_9_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
14458
dolfin::FunctionSpace(mesh,
14459
boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new adaptivepoisson_finite_element_5()))),
14460
boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dofmap>(new adaptivepoisson_dofmap_5()), *mesh)))
14465
~Form_9_FunctionSpace_0()
14471
typedef CoefficientSpace_f Form_9_FunctionSpace_1;
14473
typedef CoefficientSpace_g Form_9_FunctionSpace_2;
14475
class Form_9: public dolfin::Form
14480
Form_9(const dolfin::FunctionSpace& V0):
14481
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14483
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14485
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14489
Form_9(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g):
14490
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14492
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14497
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14501
Form_9(const dolfin::FunctionSpace& V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g):
14502
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14504
_function_spaces[0] = reference_to_no_delete_pointer(V0);
14509
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14513
Form_9(boost::shared_ptr<const dolfin::FunctionSpace> V0):
14514
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14516
_function_spaces[0] = V0;
14518
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14522
Form_9(boost::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& f, const dolfin::GenericFunction& g):
14523
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14525
_function_spaces[0] = V0;
14530
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14534
Form_9(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::GenericFunction> f, boost::shared_ptr<const dolfin::GenericFunction> g):
14535
dolfin::Form(1, 2), f(*this, 0), g(*this, 1)
14537
_function_spaces[0] = V0;
14542
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_9());
14549
/// Return the number of the coefficient with this name
14550
virtual dolfin::uint coefficient_number(const std::string& name) const
14554
else if (name == "g")
14557
dolfin::error("Invalid coefficient.");
14561
/// Return the name of the coefficient with this number
14562
virtual std::string coefficient_name(dolfin::uint i) const
14572
dolfin::error("Invalid coefficient.");
14577
typedef Form_9_FunctionSpace_0 TestSpace;
14578
typedef Form_9_FunctionSpace_1 CoefficientSpace_f;
14579
typedef Form_9_FunctionSpace_2 CoefficientSpace_g;
14582
dolfin::CoefficientAssigner f;
14583
dolfin::CoefficientAssigner g;
14586
typedef CoefficientSpace___discrete_primal_solution Form_10_FunctionSpace_0;
14588
class Form_10: public dolfin::GoalFunctional
14593
Form_10(const dolfin::Mesh& mesh):
14594
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14596
_mesh = reference_to_no_delete_pointer(mesh);
14597
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14601
Form_10(const dolfin::Mesh& mesh, const dolfin::GenericFunction& __discrete_primal_solution):
14602
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14604
_mesh = reference_to_no_delete_pointer(mesh);
14605
this->__discrete_primal_solution = __discrete_primal_solution;
14607
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14611
Form_10(const dolfin::Mesh& mesh, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution):
14612
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14614
_mesh = reference_to_no_delete_pointer(mesh);
14615
this->__discrete_primal_solution = *__discrete_primal_solution;
14617
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14621
Form_10(boost::shared_ptr<const dolfin::Mesh> mesh):
14622
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14625
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14629
Form_10(boost::shared_ptr<const dolfin::Mesh> mesh, const dolfin::GenericFunction& __discrete_primal_solution):
14630
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14633
this->__discrete_primal_solution = __discrete_primal_solution;
14635
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14639
Form_10(boost::shared_ptr<const dolfin::Mesh> mesh, boost::shared_ptr<const dolfin::GenericFunction> __discrete_primal_solution):
14640
dolfin::GoalFunctional(0, 1), __discrete_primal_solution(*this, 0)
14643
this->__discrete_primal_solution = *__discrete_primal_solution;
14645
_ufc_form = boost::shared_ptr<const ufc::form>(new adaptivepoisson_form_10());
14652
/// Return the number of the coefficient with this name
14653
virtual dolfin::uint coefficient_number(const std::string& name) const
14655
if (name == "__discrete_primal_solution")
14658
dolfin::error("Invalid coefficient.");
14662
/// Return the name of the coefficient with this number
14663
virtual std::string coefficient_name(dolfin::uint i) const
14668
return "__discrete_primal_solution";
14671
dolfin::error("Invalid coefficient.");
14676
typedef Form_10_FunctionSpace_0 CoefficientSpace___discrete_primal_solution;
14679
dolfin::CoefficientAssigner __discrete_primal_solution;
14681
/// Initialize all error control forms, attach coefficients and
14682
/// (re-)set error control
14683
virtual void update_ec(const dolfin::Form& a, const dolfin::Form& L)
14685
// This stuff is created here and shipped elsewhere
14686
boost::shared_ptr<dolfin::Form> a_star; // Dual lhs
14687
boost::shared_ptr<dolfin::Form> L_star; // Dual rhs
14688
boost::shared_ptr<dolfin::FunctionSpace> V_Ez_h; // Extrapolation space
14689
boost::shared_ptr<dolfin::Function> Ez_h; // Extrapolated dual
14690
boost::shared_ptr<dolfin::Form> residual; // Residual (as functional)
14691
boost::shared_ptr<dolfin::FunctionSpace> V_R_T; // Trial space for cell residual
14692
boost::shared_ptr<dolfin::Form> a_R_T; // Cell residual lhs
14693
boost::shared_ptr<dolfin::Form> L_R_T; // Cell residual rhs
14694
boost::shared_ptr<dolfin::FunctionSpace> V_b_T; // Function space for cell bubble
14695
boost::shared_ptr<dolfin::Function> b_T; // Cell bubble
14696
boost::shared_ptr<dolfin::FunctionSpace> V_R_dT; // Trial space for facet residual
14697
boost::shared_ptr<dolfin::Form> a_R_dT; // Facet residual lhs
14698
boost::shared_ptr<dolfin::Form> L_R_dT; // Facet residual rhs
14699
boost::shared_ptr<dolfin::FunctionSpace> V_b_e; // Function space for cell cone
14700
boost::shared_ptr<dolfin::Function> b_e; // Cell cone
14701
boost::shared_ptr<dolfin::FunctionSpace> V_eta_T; // Function space for indicators
14702
boost::shared_ptr<dolfin::Form> eta_T; // Indicator form
14704
// Some handy views
14705
const dolfin::FunctionSpace& Vhat(*(a.function_space(0))); // Primal test
14706
const dolfin::FunctionSpace& V(*(a.function_space(1))); // Primal trial
14707
const dolfin::Mesh& mesh(V.mesh());
14710
// Initialize dual forms
14711
a_star.reset(new Form_0(V, Vhat));
14712
L_star.reset(new Form_1(V));
14714
// Attach coefficients from a to a_star and from M to L_star
14715
dolfin::uint coefficient_number = 0;
14717
for (dolfin::uint i = 0; i < a.num_coefficients(); i++)
14719
name = a.coefficient_name(i);
14720
// Don't attach discrete primal solution here (not computed.)
14721
if (name == "__discrete_primal_solution")
14725
coefficient_number = a_star->coefficient_number(name);
14727
std::cout << "Attaching coefficient named: " << name << " to a_star";
14728
std::cout << " failed! But this might be expected." << std::endl;
14731
a_star->set_coefficient(name, a.coefficient(i));
14735
for (dolfin::uint i = 0; i < (*this).num_coefficients(); i++)
14737
name = (*this).coefficient_name(i);
14738
// Don't attach discrete primal solution here (not computed.)
14739
if (name == "__discrete_primal_solution")
14743
coefficient_number = L_star->coefficient_number(name);
14745
std::cout << "Attaching coefficient named: " << name << " to L_star";
14746
std::cout << " failed! But this might be expected." << std::endl;
14749
L_star->set_coefficient(name, (*this).coefficient(i));
14753
// Initialize residual
14754
residual.reset(new Form_6(mesh));
14756
// Attach coefficients (from a and L) in residual
14758
for (dolfin::uint i = 0; i < a.num_coefficients(); i++)
14760
name = a.coefficient_name(i);
14761
// Don't attach discrete primal solution here (not computed.)
14762
if (name == "__discrete_primal_solution")
14766
coefficient_number = residual->coefficient_number(name);
14768
std::cout << "Attaching coefficient named: " << name << " to residual";
14769
std::cout << " failed! But this might be expected." << std::endl;
14772
residual->set_coefficient(name, a.coefficient(i));
14776
for (dolfin::uint i = 0; i < L.num_coefficients(); i++)
14778
name = L.coefficient_name(i);
14779
// Don't attach discrete primal solution here (not computed.)
14780
if (name == "__discrete_primal_solution")
14784
coefficient_number = residual->coefficient_number(name);
14786
std::cout << "Attaching coefficient named: " << name << " to residual";
14787
std::cout << " failed! But this might be expected." << std::endl;
14790
residual->set_coefficient(name, L.coefficient(i));
14794
// Initialize extrapolation space and (fake) extrapolation
14795
V_Ez_h.reset(new CoefficientSpace___improved_dual(mesh));
14796
Ez_h.reset(new dolfin::Function(V_Ez_h));
14797
residual->set_coefficient("__improved_dual", Ez_h);
14799
// Create bilinear and linear form for computing cell residual R_T
14800
V_R_T.reset(new Form_3::TestSpace(mesh));
14801
a_R_T.reset(new Form_2(V_R_T, V_R_T));
14802
L_R_T.reset(new Form_3(V_R_T));
14804
// Initialize bubble and attach to a_R_T and L_R_T
14805
V_b_T.reset(new CoefficientSpace___cell_bubble(mesh));
14806
b_T.reset(new dolfin::Function(V_b_T));
14807
b_T->vector() = 1.0;
14809
// Attach coefficients (from a and L) to L_R_T
14811
for (dolfin::uint i = 0; i < a.num_coefficients(); i++)
14813
name = a.coefficient_name(i);
14814
// Don't attach discrete primal solution here (not computed.)
14815
if (name == "__discrete_primal_solution")
14819
coefficient_number = L_R_T->coefficient_number(name);
14821
std::cout << "Attaching coefficient named: " << name << " to L_R_T";
14822
std::cout << " failed! But this might be expected." << std::endl;
14825
L_R_T->set_coefficient(name, a.coefficient(i));
14829
for (dolfin::uint i = 0; i < L.num_coefficients(); i++)
14831
name = L.coefficient_name(i);
14832
// Don't attach discrete primal solution here (not computed.)
14833
if (name == "__discrete_primal_solution")
14837
coefficient_number = L_R_T->coefficient_number(name);
14839
std::cout << "Attaching coefficient named: " << name << " to L_R_T";
14840
std::cout << " failed! But this might be expected." << std::endl;
14843
L_R_T->set_coefficient(name, L.coefficient(i));
14847
// Attach bubble function to _a_R_T and _L_R_T
14848
a_R_T->set_coefficient("__cell_bubble", b_T);
14849
L_R_T->set_coefficient("__cell_bubble", b_T);
14851
// Create bilinear and linear form for computing facet residual R_dT
14852
V_R_dT.reset(new Form_5::TestSpace(mesh));
14853
a_R_dT.reset(new Form_4(V_R_dT, V_R_dT));
14854
L_R_dT.reset(new Form_5(V_R_dT));
14856
// Attach coefficients (from a and L) to L_R_dT
14858
for (dolfin::uint i = 0; i < a.num_coefficients(); i++)
14860
name = a.coefficient_name(i);
14861
// Don't attach discrete primal solution here (not computed.)
14862
if (name == "__discrete_primal_solution")
14866
coefficient_number = L_R_dT->coefficient_number(name);
14868
std::cout << "Attaching coefficient named: " << name << " to L_R_dT";
14869
std::cout << " failed! But this might be expected." << std::endl;
14872
L_R_dT->set_coefficient(name, a.coefficient(i));
14876
for (dolfin::uint i = 0; i < L.num_coefficients(); i++)
14878
name = L.coefficient_name(i);
14879
// Don't attach discrete primal solution here (not computed.)
14880
if (name == "__discrete_primal_solution")
14884
coefficient_number = L_R_dT->coefficient_number(name);
14886
std::cout << "Attaching coefficient named: " << name << " to L_R_dT";
14887
std::cout << " failed! But this might be expected." << std::endl;
14890
L_R_dT->set_coefficient(name, L.coefficient(i));
14894
// Initialize (fake) cone and attach to a_R_dT and L_R_dT
14895
V_b_e.reset(new CoefficientSpace___cell_cone(mesh));
14896
b_e.reset(new dolfin::Function(V_b_e));
14897
a_R_dT->set_coefficient("__cell_cone", b_e);
14898
L_R_dT->set_coefficient("__cell_cone", b_e);
14900
// Create error indicator form
14901
V_eta_T.reset(new Form_7::TestSpace(mesh));
14902
eta_T.reset(new Form_7(V_eta_T));
14904
// Update error control
14905
_ec.reset(new dolfin::ErrorControl(a_star, L_star, residual,
14906
a_R_T, L_R_T, a_R_dT, L_R_dT, eta_T,