~ubuntu-branches/ubuntu/utopic/ffc/utopic

« back to all changes in this revision

Viewing changes to test/regression/references/r_quadrature_O/EnergyNorm.h

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2013-06-26 14:48:32 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20130626144832-1xd8htax4s3utybz
Tags: 1.2.0-1
* New upstream release.
* debian/control:
  - Bump required version for python-ufc, python-fiat, python-instant
    and python-ufl in Depends field.
  - Bump Standards-Version to 3.9.4.
  - Remove DM-Upload-Allowed field.
  - Bump required debhelper version in Build-Depends.
  - Remove cdbs from Build-Depends.
  - Use canonical URIs for Vcs-* fields.
* debian/compat: Bump to compatibility level 9.
* debian/rules: Rewrite for debhelper (drop cdbs).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// This code conforms with the UFC specification version 2.0.5
2
 
// and was automatically generated by FFC version 1.0.0.
 
1
// This code conforms with the UFC specification version 2.2.0
 
2
// and was automatically generated by FFC version 1.2.0.
3
3
// 
4
4
// This code was generated with the following parameters:
5
5
// 
52
52
  /// Return a string identifying the finite element
53
53
  virtual const char* signature() const
54
54
  {
55
 
    return "FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)";
 
55
    return "FiniteElement('Lagrange', Domain(Cell('tetrahedron', 3), 'tetrahedron_multiverse', 3, 3), 1, None)";
56
56
  }
57
57
 
58
58
  /// Return the cell shape
62
62
  }
63
63
 
64
64
  /// Return the topological dimension of the cell shape
65
 
  virtual unsigned int topological_dimension() const
 
65
  virtual std::size_t topological_dimension() const
66
66
  {
67
67
    return 3;
68
68
  }
69
69
 
70
70
  /// Return the geometric dimension of the cell shape
71
 
  virtual unsigned int geometric_dimension() const
 
71
  virtual std::size_t geometric_dimension() const
72
72
  {
73
73
    return 3;
74
74
  }
75
75
 
76
76
  /// Return the dimension of the finite element function space
77
 
  virtual unsigned int space_dimension() const
 
77
  virtual std::size_t space_dimension() const
78
78
  {
79
79
    return 4;
80
80
  }
81
81
 
82
82
  /// Return the rank of the value space
83
 
  virtual unsigned int value_rank() const
 
83
  virtual std::size_t value_rank() const
84
84
  {
85
85
    return 0;
86
86
  }
87
87
 
88
88
  /// Return the dimension of the value space for axis i
89
 
  virtual unsigned int value_dimension(unsigned int i) const
 
89
  virtual std::size_t value_dimension(std::size_t i) const
90
90
  {
91
91
    return 1;
92
92
  }
93
93
 
94
 
  /// Evaluate basis function i at given point in cell
95
 
  virtual void evaluate_basis(unsigned int i,
 
94
  /// Evaluate basis function i at given point x in cell
 
95
  virtual void evaluate_basis(std::size_t i,
96
96
                              double* values,
97
 
                              const double* coordinates,
98
 
                              const ufc::cell& c) const
 
97
                              const double* x,
 
98
                              const double* vertex_coordinates,
 
99
                              int cell_orientation) const
99
100
  {
100
 
    // Extract vertex coordinates
101
 
    const double * const * x = c.coordinates;
102
 
    
103
 
    // Compute Jacobian of affine map from reference cell
104
 
    const double J_00 = x[1][0] - x[0][0];
105
 
    const double J_01 = x[2][0] - x[0][0];
106
 
    const double J_02 = x[3][0] - x[0][0];
107
 
    const double J_10 = x[1][1] - x[0][1];
108
 
    const double J_11 = x[2][1] - x[0][1];
109
 
    const double J_12 = x[3][1] - x[0][1];
110
 
    const double J_20 = x[1][2] - x[0][2];
111
 
    const double J_21 = x[2][2] - x[0][2];
112
 
    const double J_22 = x[3][2] - x[0][2];
113
 
    
114
 
    // Compute sub determinants
115
 
    const double d_00 = J_11*J_22 - J_12*J_21;
116
 
    const double d_01 = J_12*J_20 - J_10*J_22;
117
 
    const double d_02 = J_10*J_21 - J_11*J_20;
118
 
    const double d_10 = J_02*J_21 - J_01*J_22;
119
 
    const double d_11 = J_00*J_22 - J_02*J_20;
120
 
    const double d_12 = J_01*J_20 - J_00*J_21;
121
 
    const double d_20 = J_01*J_12 - J_02*J_11;
122
 
    const double d_21 = J_02*J_10 - J_00*J_12;
123
 
    const double d_22 = J_00*J_11 - J_01*J_10;
124
 
    
125
 
    // Compute determinant of Jacobian
126
 
    double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
127
 
    
128
 
    // Compute inverse of Jacobian
 
101
    // Compute Jacobian
 
102
    double J[9];
 
103
    compute_jacobian_tetrahedron_3d(J, vertex_coordinates);
 
104
    
 
105
    // Compute Jacobian inverse and determinant
 
106
    double K[9];
 
107
    double detJ;
 
108
    compute_jacobian_inverse_tetrahedron_3d(K, detJ, J);
 
109
    
129
110
    
130
111
    // Compute constants
131
 
    const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
132
 
    const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
133
 
    const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
 
112
    const double C0 = vertex_coordinates[9]  + vertex_coordinates[6] + vertex_coordinates[3]  - vertex_coordinates[0];
 
113
    const double C1 = vertex_coordinates[10] + vertex_coordinates[7] + vertex_coordinates[4]  - vertex_coordinates[1];
 
114
    const double C2 = vertex_coordinates[11] + vertex_coordinates[8] + vertex_coordinates[5]  - vertex_coordinates[2];
 
115
    
 
116
    // Compute subdeterminants
 
117
    const double d_00 = J[4]*J[8] - J[5]*J[7];
 
118
    const double d_01 = J[5]*J[6] - J[3]*J[8];
 
119
    const double d_02 = J[3]*J[7] - J[4]*J[6];
 
120
    const double d_10 = J[2]*J[7] - J[1]*J[8];
 
121
    const double d_11 = J[0]*J[8] - J[2]*J[6];
 
122
    const double d_12 = J[1]*J[6] - J[0]*J[7];
 
123
    const double d_20 = J[1]*J[5] - J[2]*J[4];
 
124
    const double d_21 = J[2]*J[3] - J[0]*J[5];
 
125
    const double d_22 = J[0]*J[4] - J[1]*J[3];
134
126
    
135
127
    // Get coordinates and map to the reference (FIAT) element
136
 
    double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
137
 
    double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
138
 
    double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
139
 
    
140
 
    
141
 
    // Reset values.
 
128
    double X = (d_00*(2.0*x[0] - C0) + d_10*(2.0*x[1] - C1) + d_20*(2.0*x[2] - C2)) / detJ;
 
129
    double Y = (d_01*(2.0*x[0] - C0) + d_11*(2.0*x[1] - C1) + d_21*(2.0*x[2] - C2)) / detJ;
 
130
    double Z = (d_02*(2.0*x[0] - C0) + d_12*(2.0*x[1] - C1) + d_22*(2.0*x[2] - C2)) / detJ;
 
131
    
 
132
    
 
133
    // Reset values
142
134
    *values = 0.0;
143
135
    switch (i)
144
136
    {
145
137
    case 0:
146
138
      {
147
139
        
148
 
      // Array of basisvalues.
 
140
      // Array of basisvalues
149
141
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
150
142
      
151
 
      // Declare helper variables.
 
143
      // Declare helper variables
152
144
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
153
145
      
154
 
      // Compute basisvalues.
 
146
      // Compute basisvalues
155
147
      basisvalues[0] = 1.0;
156
148
      basisvalues[1] = tmp0;
157
149
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
161
153
      basisvalues[2] *= std::sqrt(2.5);
162
154
      basisvalues[1] *= std::sqrt(7.5);
163
155
      
164
 
      // Table(s) of coefficients.
 
156
      // Table(s) of coefficients
165
157
      static const double coefficients0[4] = \
166
158
      {0.28867513, -0.18257419, -0.10540926, -0.074535599};
167
159
      
168
 
      // Compute value(s).
 
160
      // Compute value(s)
169
161
      for (unsigned int r = 0; r < 4; r++)
170
162
      {
171
163
        *values += coefficients0[r]*basisvalues[r];
175
167
    case 1:
176
168
      {
177
169
        
178
 
      // Array of basisvalues.
 
170
      // Array of basisvalues
179
171
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
180
172
      
181
 
      // Declare helper variables.
 
173
      // Declare helper variables
182
174
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
183
175
      
184
 
      // Compute basisvalues.
 
176
      // Compute basisvalues
185
177
      basisvalues[0] = 1.0;
186
178
      basisvalues[1] = tmp0;
187
179
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
191
183
      basisvalues[2] *= std::sqrt(2.5);
192
184
      basisvalues[1] *= std::sqrt(7.5);
193
185
      
194
 
      // Table(s) of coefficients.
 
186
      // Table(s) of coefficients
195
187
      static const double coefficients0[4] = \
196
188
      {0.28867513, 0.18257419, -0.10540926, -0.074535599};
197
189
      
198
 
      // Compute value(s).
 
190
      // Compute value(s)
199
191
      for (unsigned int r = 0; r < 4; r++)
200
192
      {
201
193
        *values += coefficients0[r]*basisvalues[r];
205
197
    case 2:
206
198
      {
207
199
        
208
 
      // Array of basisvalues.
 
200
      // Array of basisvalues
209
201
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
210
202
      
211
 
      // Declare helper variables.
 
203
      // Declare helper variables
212
204
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
213
205
      
214
 
      // Compute basisvalues.
 
206
      // Compute basisvalues
215
207
      basisvalues[0] = 1.0;
216
208
      basisvalues[1] = tmp0;
217
209
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
221
213
      basisvalues[2] *= std::sqrt(2.5);
222
214
      basisvalues[1] *= std::sqrt(7.5);
223
215
      
224
 
      // Table(s) of coefficients.
 
216
      // Table(s) of coefficients
225
217
      static const double coefficients0[4] = \
226
218
      {0.28867513, 0.0, 0.21081851, -0.074535599};
227
219
      
228
 
      // Compute value(s).
 
220
      // Compute value(s)
229
221
      for (unsigned int r = 0; r < 4; r++)
230
222
      {
231
223
        *values += coefficients0[r]*basisvalues[r];
235
227
    case 3:
236
228
      {
237
229
        
238
 
      // Array of basisvalues.
 
230
      // Array of basisvalues
239
231
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
240
232
      
241
 
      // Declare helper variables.
 
233
      // Declare helper variables
242
234
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
243
235
      
244
 
      // Compute basisvalues.
 
236
      // Compute basisvalues
245
237
      basisvalues[0] = 1.0;
246
238
      basisvalues[1] = tmp0;
247
239
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
251
243
      basisvalues[2] *= std::sqrt(2.5);
252
244
      basisvalues[1] *= std::sqrt(7.5);
253
245
      
254
 
      // Table(s) of coefficients.
 
246
      // Table(s) of coefficients
255
247
      static const double coefficients0[4] = \
256
248
      {0.28867513, 0.0, 0.0, 0.2236068};
257
249
      
258
 
      // Compute value(s).
 
250
      // Compute value(s)
259
251
      for (unsigned int r = 0; r < 4; r++)
260
252
      {
261
253
        *values += coefficients0[r]*basisvalues[r];
266
258
    
267
259
  }
268
260
 
269
 
  /// Evaluate all basis functions at given point in cell
 
261
  /// Evaluate all basis functions at given point x in cell
270
262
  virtual void evaluate_basis_all(double* values,
271
 
                                  const double* coordinates,
272
 
                                  const ufc::cell& c) const
 
263
                                  const double* x,
 
264
                                  const double* vertex_coordinates,
 
265
                                  int cell_orientation) const
273
266
  {
274
267
    // Helper variable to hold values of a single dof.
275
268
    double dof_values = 0.0;
276
269
    
277
 
    // Loop dofs and call evaluate_basis.
 
270
    // Loop dofs and call evaluate_basis
278
271
    for (unsigned int r = 0; r < 4; r++)
279
272
    {
280
 
      evaluate_basis(r, &dof_values, coordinates, c);
 
273
      evaluate_basis(r, &dof_values, x, vertex_coordinates, cell_orientation);
281
274
      values[r] = dof_values;
282
275
    }// end loop over 'r'
283
276
  }
284
277
 
285
 
  /// Evaluate order n derivatives of basis function i at given point in cell
286
 
  virtual void evaluate_basis_derivatives(unsigned int i,
287
 
                                          unsigned int n,
 
278
  /// Evaluate order n derivatives of basis function i at given point x in cell
 
279
  virtual void evaluate_basis_derivatives(std::size_t i,
 
280
                                          std::size_t n,
288
281
                                          double* values,
289
 
                                          const double* coordinates,
290
 
                                          const ufc::cell& c) const
 
282
                                          const double* x,
 
283
                                          const double* vertex_coordinates,
 
284
                                          int cell_orientation) const
291
285
  {
292
 
    // Extract vertex coordinates
293
 
    const double * const * x = c.coordinates;
294
 
    
295
 
    // Compute Jacobian of affine map from reference cell
296
 
    const double J_00 = x[1][0] - x[0][0];
297
 
    const double J_01 = x[2][0] - x[0][0];
298
 
    const double J_02 = x[3][0] - x[0][0];
299
 
    const double J_10 = x[1][1] - x[0][1];
300
 
    const double J_11 = x[2][1] - x[0][1];
301
 
    const double J_12 = x[3][1] - x[0][1];
302
 
    const double J_20 = x[1][2] - x[0][2];
303
 
    const double J_21 = x[2][2] - x[0][2];
304
 
    const double J_22 = x[3][2] - x[0][2];
305
 
    
306
 
    // Compute sub determinants
307
 
    const double d_00 = J_11*J_22 - J_12*J_21;
308
 
    const double d_01 = J_12*J_20 - J_10*J_22;
309
 
    const double d_02 = J_10*J_21 - J_11*J_20;
310
 
    const double d_10 = J_02*J_21 - J_01*J_22;
311
 
    const double d_11 = J_00*J_22 - J_02*J_20;
312
 
    const double d_12 = J_01*J_20 - J_00*J_21;
313
 
    const double d_20 = J_01*J_12 - J_02*J_11;
314
 
    const double d_21 = J_02*J_10 - J_00*J_12;
315
 
    const double d_22 = J_00*J_11 - J_01*J_10;
316
 
    
317
 
    // Compute determinant of Jacobian
318
 
    double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
319
 
    
320
 
    // Compute inverse of Jacobian
321
 
    const double K_00 = d_00 / detJ;
322
 
    const double K_01 = d_10 / detJ;
323
 
    const double K_02 = d_20 / detJ;
324
 
    const double K_10 = d_01 / detJ;
325
 
    const double K_11 = d_11 / detJ;
326
 
    const double K_12 = d_21 / detJ;
327
 
    const double K_20 = d_02 / detJ;
328
 
    const double K_21 = d_12 / detJ;
329
 
    const double K_22 = d_22 / detJ;
 
286
    // Compute Jacobian
 
287
    double J[9];
 
288
    compute_jacobian_tetrahedron_3d(J, vertex_coordinates);
 
289
    
 
290
    // Compute Jacobian inverse and determinant
 
291
    double K[9];
 
292
    double detJ;
 
293
    compute_jacobian_inverse_tetrahedron_3d(K, detJ, J);
 
294
    
330
295
    
331
296
    // Compute constants
332
 
    const double C0 = x[3][0] + x[2][0] + x[1][0] - x[0][0];
333
 
    const double C1 = x[3][1] + x[2][1] + x[1][1] - x[0][1];
334
 
    const double C2 = x[3][2] + x[2][2] + x[1][2] - x[0][2];
 
297
    const double C0 = vertex_coordinates[9]  + vertex_coordinates[6] + vertex_coordinates[3]  - vertex_coordinates[0];
 
298
    const double C1 = vertex_coordinates[10] + vertex_coordinates[7] + vertex_coordinates[4]  - vertex_coordinates[1];
 
299
    const double C2 = vertex_coordinates[11] + vertex_coordinates[8] + vertex_coordinates[5]  - vertex_coordinates[2];
 
300
    
 
301
    // Compute subdeterminants
 
302
    const double d_00 = J[4]*J[8] - J[5]*J[7];
 
303
    const double d_01 = J[5]*J[6] - J[3]*J[8];
 
304
    const double d_02 = J[3]*J[7] - J[4]*J[6];
 
305
    const double d_10 = J[2]*J[7] - J[1]*J[8];
 
306
    const double d_11 = J[0]*J[8] - J[2]*J[6];
 
307
    const double d_12 = J[1]*J[6] - J[0]*J[7];
 
308
    const double d_20 = J[1]*J[5] - J[2]*J[4];
 
309
    const double d_21 = J[2]*J[3] - J[0]*J[5];
 
310
    const double d_22 = J[0]*J[4] - J[1]*J[3];
335
311
    
336
312
    // Get coordinates and map to the reference (FIAT) element
337
 
    double X = (d_00*(2.0*coordinates[0] - C0) + d_10*(2.0*coordinates[1] - C1) + d_20*(2.0*coordinates[2] - C2)) / detJ;
338
 
    double Y = (d_01*(2.0*coordinates[0] - C0) + d_11*(2.0*coordinates[1] - C1) + d_21*(2.0*coordinates[2] - C2)) / detJ;
339
 
    double Z = (d_02*(2.0*coordinates[0] - C0) + d_12*(2.0*coordinates[1] - C1) + d_22*(2.0*coordinates[2] - C2)) / detJ;
 
313
    double X = (d_00*(2.0*x[0] - C0) + d_10*(2.0*x[1] - C1) + d_20*(2.0*x[2] - C2)) / detJ;
 
314
    double Y = (d_01*(2.0*x[0] - C0) + d_11*(2.0*x[1] - C1) + d_21*(2.0*x[2] - C2)) / detJ;
 
315
    double Z = (d_02*(2.0*x[0] - C0) + d_12*(2.0*x[1] - C1) + d_22*(2.0*x[2] - C2)) / detJ;
340
316
    
341
317
    
342
318
    // Compute number of derivatives.
374
350
    }
375
351
    
376
352
    // Compute inverse of Jacobian
377
 
    const double Jinv[3][3] = {{K_00, K_01, K_02}, {K_10, K_11, K_12}, {K_20, K_21, K_22}};
 
353
    const double Jinv[3][3] = {{K[0], K[1], K[2]}, {K[3], K[4], K[5]}, {K[6], K[7], K[8]}};
378
354
    
379
355
    // Declare transformation matrix
380
356
    // Declare pointer to two dimensional array and initialise
408
384
    case 0:
409
385
      {
410
386
        
411
 
      // Array of basisvalues.
 
387
      // Array of basisvalues
412
388
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
413
389
      
414
 
      // Declare helper variables.
 
390
      // Declare helper variables
415
391
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
416
392
      
417
 
      // Compute basisvalues.
 
393
      // Compute basisvalues
418
394
      basisvalues[0] = 1.0;
419
395
      basisvalues[1] = tmp0;
420
396
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
424
400
      basisvalues[2] *= std::sqrt(2.5);
425
401
      basisvalues[1] *= std::sqrt(7.5);
426
402
      
427
 
      // Table(s) of coefficients.
 
403
      // Table(s) of coefficients
428
404
      static const double coefficients0[4] = \
429
405
      {0.28867513, -0.18257419, -0.10540926, -0.074535599};
430
406
      
580
556
    case 1:
581
557
      {
582
558
        
583
 
      // Array of basisvalues.
 
559
      // Array of basisvalues
584
560
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
585
561
      
586
 
      // Declare helper variables.
 
562
      // Declare helper variables
587
563
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
588
564
      
589
 
      // Compute basisvalues.
 
565
      // Compute basisvalues
590
566
      basisvalues[0] = 1.0;
591
567
      basisvalues[1] = tmp0;
592
568
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
596
572
      basisvalues[2] *= std::sqrt(2.5);
597
573
      basisvalues[1] *= std::sqrt(7.5);
598
574
      
599
 
      // Table(s) of coefficients.
 
575
      // Table(s) of coefficients
600
576
      static const double coefficients0[4] = \
601
577
      {0.28867513, 0.18257419, -0.10540926, -0.074535599};
602
578
      
752
728
    case 2:
753
729
      {
754
730
        
755
 
      // Array of basisvalues.
 
731
      // Array of basisvalues
756
732
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
757
733
      
758
 
      // Declare helper variables.
 
734
      // Declare helper variables
759
735
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
760
736
      
761
 
      // Compute basisvalues.
 
737
      // Compute basisvalues
762
738
      basisvalues[0] = 1.0;
763
739
      basisvalues[1] = tmp0;
764
740
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
768
744
      basisvalues[2] *= std::sqrt(2.5);
769
745
      basisvalues[1] *= std::sqrt(7.5);
770
746
      
771
 
      // Table(s) of coefficients.
 
747
      // Table(s) of coefficients
772
748
      static const double coefficients0[4] = \
773
749
      {0.28867513, 0.0, 0.21081851, -0.074535599};
774
750
      
924
900
    case 3:
925
901
      {
926
902
        
927
 
      // Array of basisvalues.
 
903
      // Array of basisvalues
928
904
      double basisvalues[4] = {0.0, 0.0, 0.0, 0.0};
929
905
      
930
 
      // Declare helper variables.
 
906
      // Declare helper variables
931
907
      double tmp0 = 0.5*(2.0 + Y + Z + 2.0*X);
932
908
      
933
 
      // Compute basisvalues.
 
909
      // Compute basisvalues
934
910
      basisvalues[0] = 1.0;
935
911
      basisvalues[1] = tmp0;
936
912
      basisvalues[2] = 0.5*(2.0 + 3.0*Y + Z)*basisvalues[0];
940
916
      basisvalues[2] *= std::sqrt(2.5);
941
917
      basisvalues[1] *= std::sqrt(7.5);
942
918
      
943
 
      // Table(s) of coefficients.
 
919
      // Table(s) of coefficients
944
920
      static const double coefficients0[4] = \
945
921
      {0.28867513, 0.0, 0.0, 0.2236068};
946
922
      
1097
1073
    
1098
1074
  }
1099
1075
 
1100
 
  /// Evaluate order n derivatives of all basis functions at given point in cell
1101
 
  virtual void evaluate_basis_derivatives_all(unsigned int n,
 
1076
  /// Evaluate order n derivatives of all basis functions at given point x in cell
 
1077
  virtual void evaluate_basis_derivatives_all(std::size_t n,
1102
1078
                                              double* values,
1103
 
                                              const double* coordinates,
1104
 
                                              const ufc::cell& c) const
 
1079
                                              const double* x,
 
1080
                                              const double* vertex_coordinates,
 
1081
                                              int cell_orientation) const
1105
1082
  {
1106
1083
    // Compute number of derivatives.
1107
1084
    unsigned int num_derivatives = 1;
1120
1097
    // Loop dofs and call evaluate_basis_derivatives.
1121
1098
    for (unsigned int r = 0; r < 4; r++)
1122
1099
    {
1123
 
      evaluate_basis_derivatives(r, n, dof_values, coordinates, c);
 
1100
      evaluate_basis_derivatives(r, n, dof_values, x, vertex_coordinates, cell_orientation);
1124
1101
      for (unsigned int s = 0; s < num_derivatives; s++)
1125
1102
      {
1126
1103
        values[r*num_derivatives + s] = dof_values[s];
1132
1109
  }
1133
1110
 
1134
1111
  /// Evaluate linear functional for dof i on the function f
1135
 
  virtual double evaluate_dof(unsigned int i,
 
1112
  virtual double evaluate_dof(std::size_t i,
1136
1113
                              const ufc::function& f,
 
1114
                              const double* vertex_coordinates,
 
1115
                              int cell_orientation,
1137
1116
                              const ufc::cell& c) const
1138
1117
  {
1139
 
    // Declare variables for result of evaluation.
 
1118
    // Declare variables for result of evaluation
1140
1119
    double vals[1];
1141
1120
    
1142
 
    // Declare variable for physical coordinates.
 
1121
    // Declare variable for physical coordinates
1143
1122
    double y[3];
1144
 
    const double * const * x = c.coordinates;
1145
1123
    switch (i)
1146
1124
    {
1147
1125
    case 0:
1148
1126
      {
1149
 
        y[0] = x[0][0];
1150
 
      y[1] = x[0][1];
1151
 
      y[2] = x[0][2];
 
1127
        y[0] = vertex_coordinates[0];
 
1128
      y[1] = vertex_coordinates[1];
 
1129
      y[2] = vertex_coordinates[2];
1152
1130
      f.evaluate(vals, y, c);
1153
1131
      return vals[0];
1154
1132
        break;
1155
1133
      }
1156
1134
    case 1:
1157
1135
      {
1158
 
        y[0] = x[1][0];
1159
 
      y[1] = x[1][1];
1160
 
      y[2] = x[1][2];
 
1136
        y[0] = vertex_coordinates[3];
 
1137
      y[1] = vertex_coordinates[4];
 
1138
      y[2] = vertex_coordinates[5];
1161
1139
      f.evaluate(vals, y, c);
1162
1140
      return vals[0];
1163
1141
        break;
1164
1142
      }
1165
1143
    case 2:
1166
1144
      {
1167
 
        y[0] = x[2][0];
1168
 
      y[1] = x[2][1];
1169
 
      y[2] = x[2][2];
 
1145
        y[0] = vertex_coordinates[6];
 
1146
      y[1] = vertex_coordinates[7];
 
1147
      y[2] = vertex_coordinates[8];
1170
1148
      f.evaluate(vals, y, c);
1171
1149
      return vals[0];
1172
1150
        break;
1173
1151
      }
1174
1152
    case 3:
1175
1153
      {
1176
 
        y[0] = x[3][0];
1177
 
      y[1] = x[3][1];
1178
 
      y[2] = x[3][2];
 
1154
        y[0] = vertex_coordinates[9];
 
1155
      y[1] = vertex_coordinates[10];
 
1156
      y[2] = vertex_coordinates[11];
1179
1157
      f.evaluate(vals, y, c);
1180
1158
      return vals[0];
1181
1159
        break;
1188
1166
  /// Evaluate linear functionals for all dofs on the function f
1189
1167
  virtual void evaluate_dofs(double* values,
1190
1168
                             const ufc::function& f,
 
1169
                             const double* vertex_coordinates,
 
1170
                             int cell_orientation,
1191
1171
                             const ufc::cell& c) const
1192
1172
  {
1193
 
    // Declare variables for result of evaluation.
 
1173
    // Declare variables for result of evaluation
1194
1174
    double vals[1];
1195
1175
    
1196
 
    // Declare variable for physical coordinates.
 
1176
    // Declare variable for physical coordinates
1197
1177
    double y[3];
1198
 
    const double * const * x = c.coordinates;
1199
 
    y[0] = x[0][0];
1200
 
    y[1] = x[0][1];
1201
 
    y[2] = x[0][2];
 
1178
    y[0] = vertex_coordinates[0];
 
1179
    y[1] = vertex_coordinates[1];
 
1180
    y[2] = vertex_coordinates[2];
1202
1181
    f.evaluate(vals, y, c);
1203
1182
    values[0] = vals[0];
1204
 
    y[0] = x[1][0];
1205
 
    y[1] = x[1][1];
1206
 
    y[2] = x[1][2];
 
1183
    y[0] = vertex_coordinates[3];
 
1184
    y[1] = vertex_coordinates[4];
 
1185
    y[2] = vertex_coordinates[5];
1207
1186
    f.evaluate(vals, y, c);
1208
1187
    values[1] = vals[0];
1209
 
    y[0] = x[2][0];
1210
 
    y[1] = x[2][1];
1211
 
    y[2] = x[2][2];
 
1188
    y[0] = vertex_coordinates[6];
 
1189
    y[1] = vertex_coordinates[7];
 
1190
    y[2] = vertex_coordinates[8];
1212
1191
    f.evaluate(vals, y, c);
1213
1192
    values[2] = vals[0];
1214
 
    y[0] = x[3][0];
1215
 
    y[1] = x[3][1];
1216
 
    y[2] = x[3][2];
 
1193
    y[0] = vertex_coordinates[9];
 
1194
    y[1] = vertex_coordinates[10];
 
1195
    y[2] = vertex_coordinates[11];
1217
1196
    f.evaluate(vals, y, c);
1218
1197
    values[3] = vals[0];
1219
1198
  }
1221
1200
  /// Interpolate vertex values from dof values
1222
1201
  virtual void interpolate_vertex_values(double* vertex_values,
1223
1202
                                         const double* dof_values,
 
1203
                                         const double* vertex_coordinates,
 
1204
                                         int cell_orientation,
1224
1205
                                         const ufc::cell& c) const
1225
1206
  {
1226
1207
    // Evaluate function and change variables
1235
1216
                                       const double* xhat,
1236
1217
                                       const ufc::cell& c) const
1237
1218
  {
1238
 
    std::cerr << "*** FFC warning: " << "map_from_reference_cell not yet implemented (introduced in UFC 2.0)." << std::endl;
 
1219
    std::cerr << "*** FFC warning: " << "map_from_reference_cell not yet implemented." << std::endl;
1239
1220
  }
1240
1221
 
1241
1222
  /// Map from coordinate x in cell to coordinate xhat in reference cell
1243
1224
                                     const double* x,
1244
1225
                                     const ufc::cell& c) const
1245
1226
  {
1246
 
    std::cerr << "*** FFC warning: " << "map_to_reference_cell not yet implemented (introduced in UFC 2.0)." << std::endl;
 
1227
    std::cerr << "*** FFC warning: " << "map_to_reference_cell not yet implemented." << std::endl;
1247
1228
  }
1248
1229
 
1249
1230
  /// Return the number of sub elements (for a mixed element)
1250
 
  virtual unsigned int num_sub_elements() const
 
1231
  virtual std::size_t num_sub_elements() const
1251
1232
  {
1252
1233
    return 0;
1253
1234
  }
1254
1235
 
1255
1236
  /// Create a new finite element for sub element i (for a mixed element)
1256
 
  virtual ufc::finite_element* create_sub_element(unsigned int i) const
 
1237
  virtual ufc::finite_element* create_sub_element(std::size_t i) const
1257
1238
  {
1258
1239
    return 0;
1259
1240
  }
1271
1252
 
1272
1253
class energynorm_dofmap_0: public ufc::dofmap
1273
1254
{
1274
 
private:
1275
 
 
1276
 
  unsigned int _global_dimension;
1277
1255
public:
1278
1256
 
1279
1257
  /// Constructor
1280
1258
  energynorm_dofmap_0() : ufc::dofmap()
1281
1259
  {
1282
 
    _global_dimension = 0;
 
1260
    // Do nothing
1283
1261
  }
1284
1262
 
1285
1263
  /// Destructor
1291
1269
  /// Return a string identifying the dofmap
1292
1270
  virtual const char* signature() const
1293
1271
  {
1294
 
    return "FFC dofmap for FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)";
 
1272
    return "FFC dofmap for FiniteElement('Lagrange', Domain(Cell('tetrahedron', 3), 'tetrahedron_multiverse', 3, 3), 1, None)";
1295
1273
  }
1296
1274
 
1297
1275
  /// Return true iff mesh entities of topological dimension d are needed
1298
 
  virtual bool needs_mesh_entities(unsigned int d) const
 
1276
  virtual bool needs_mesh_entities(std::size_t d) const
1299
1277
  {
1300
1278
    switch (d)
1301
1279
    {
1324
1302
    return false;
1325
1303
  }
1326
1304
 
1327
 
  /// Initialize dofmap for mesh (return true iff init_cell() is needed)
1328
 
  virtual bool init_mesh(const ufc::mesh& m)
1329
 
  {
1330
 
    _global_dimension = m.num_entities[0];
1331
 
    return false;
1332
 
  }
1333
 
 
1334
 
  /// Initialize dofmap for given cell
1335
 
  virtual void init_cell(const ufc::mesh& m,
1336
 
                         const ufc::cell& c)
1337
 
  {
1338
 
    // Do nothing
1339
 
  }
1340
 
 
1341
 
  /// Finish initialization of dofmap for cells
1342
 
  virtual void init_cell_finalize()
1343
 
  {
1344
 
    // Do nothing
1345
 
  }
1346
 
 
1347
1305
  /// Return the topological dimension of the associated cell shape
1348
 
  virtual unsigned int topological_dimension() const
 
1306
  virtual std::size_t topological_dimension() const
1349
1307
  {
1350
1308
    return 3;
1351
1309
  }
1352
1310
 
1353
1311
  /// Return the geometric dimension of the associated cell shape
1354
 
  virtual unsigned int geometric_dimension() const
 
1312
  virtual std::size_t geometric_dimension() const
1355
1313
  {
1356
1314
    return 3;
1357
1315
  }
1358
1316
 
1359
1317
  /// Return the dimension of the global finite element function space
1360
 
  virtual unsigned int global_dimension() const
 
1318
  virtual std::size_t global_dimension(const std::vector<std::size_t>&
 
1319
                                       num_global_entities) const
1361
1320
  {
1362
 
    return _global_dimension;
 
1321
    return num_global_entities[0];
1363
1322
  }
1364
1323
 
1365
1324
  /// Return the dimension of the local finite element function space for a cell
1366
 
  virtual unsigned int local_dimension(const ufc::cell& c) const
 
1325
  virtual std::size_t local_dimension(const ufc::cell& c) const
1367
1326
  {
1368
1327
    return 4;
1369
1328
  }
1370
1329
 
1371
1330
  /// Return the maximum dimension of the local finite element function space
1372
 
  virtual unsigned int max_local_dimension() const
 
1331
  virtual std::size_t max_local_dimension() const
1373
1332
  {
1374
1333
    return 4;
1375
1334
  }
1376
1335
 
1377
1336
  /// Return the number of dofs on each cell facet
1378
 
  virtual unsigned int num_facet_dofs() const
 
1337
  virtual std::size_t num_facet_dofs() const
1379
1338
  {
1380
1339
    return 3;
1381
1340
  }
1382
1341
 
1383
1342
  /// Return the number of dofs associated with each cell entity of dimension d
1384
 
  virtual unsigned int num_entity_dofs(unsigned int d) const
 
1343
  virtual std::size_t num_entity_dofs(std::size_t d) const
1385
1344
  {
1386
1345
    switch (d)
1387
1346
    {
1411
1370
  }
1412
1371
 
1413
1372
  /// Tabulate the local-to-global mapping of dofs on a cell
1414
 
  virtual void tabulate_dofs(unsigned int* dofs,
1415
 
                             const ufc::mesh& m,
 
1373
  virtual void tabulate_dofs(std::size_t* dofs,
 
1374
                             const std::vector<std::size_t>& num_global_entities,
1416
1375
                             const ufc::cell& c) const
1417
1376
  {
1418
1377
    dofs[0] = c.entity_indices[0][0];
1422
1381
  }
1423
1382
 
1424
1383
  /// Tabulate the local-to-local mapping from facet dofs to cell dofs
1425
 
  virtual void tabulate_facet_dofs(unsigned int* dofs,
1426
 
                                   unsigned int facet) const
 
1384
  virtual void tabulate_facet_dofs(std::size_t* dofs,
 
1385
                                   std::size_t facet) const
1427
1386
  {
1428
1387
    switch (facet)
1429
1388
    {
1460
1419
  }
1461
1420
 
1462
1421
  /// Tabulate the local-to-local mapping of dofs on entity (d, i)
1463
 
  virtual void tabulate_entity_dofs(unsigned int* dofs,
1464
 
                                    unsigned int d, unsigned int i) const
 
1422
  virtual void tabulate_entity_dofs(std::size_t* dofs,
 
1423
                                    std::size_t d, std::size_t i) const
1465
1424
  {
1466
1425
    if (d > 3)
1467
1426
    {
1523
1482
  }
1524
1483
 
1525
1484
  /// Tabulate the coordinates of all dofs on a cell
1526
 
  virtual void tabulate_coordinates(double** coordinates,
1527
 
                                    const ufc::cell& c) const
 
1485
  virtual void tabulate_coordinates(double** dof_coordinates,
 
1486
                                    const double* vertex_coordinates) const
1528
1487
  {
1529
 
    const double * const * x = c.coordinates;
1530
 
    
1531
 
    coordinates[0][0] = x[0][0];
1532
 
    coordinates[0][1] = x[0][1];
1533
 
    coordinates[0][2] = x[0][2];
1534
 
    coordinates[1][0] = x[1][0];
1535
 
    coordinates[1][1] = x[1][1];
1536
 
    coordinates[1][2] = x[1][2];
1537
 
    coordinates[2][0] = x[2][0];
1538
 
    coordinates[2][1] = x[2][1];
1539
 
    coordinates[2][2] = x[2][2];
1540
 
    coordinates[3][0] = x[3][0];
1541
 
    coordinates[3][1] = x[3][1];
1542
 
    coordinates[3][2] = x[3][2];
 
1488
    dof_coordinates[0][0] = vertex_coordinates[0];
 
1489
    dof_coordinates[0][1] = vertex_coordinates[1];
 
1490
    dof_coordinates[0][2] = vertex_coordinates[2];
 
1491
    dof_coordinates[1][0] = vertex_coordinates[3];
 
1492
    dof_coordinates[1][1] = vertex_coordinates[4];
 
1493
    dof_coordinates[1][2] = vertex_coordinates[5];
 
1494
    dof_coordinates[2][0] = vertex_coordinates[6];
 
1495
    dof_coordinates[2][1] = vertex_coordinates[7];
 
1496
    dof_coordinates[2][2] = vertex_coordinates[8];
 
1497
    dof_coordinates[3][0] = vertex_coordinates[9];
 
1498
    dof_coordinates[3][1] = vertex_coordinates[10];
 
1499
    dof_coordinates[3][2] = vertex_coordinates[11];
1543
1500
  }
1544
1501
 
1545
1502
  /// Return the number of sub dofmaps (for a mixed element)
1546
 
  virtual unsigned int num_sub_dofmaps() const
 
1503
  virtual std::size_t num_sub_dofmaps() const
1547
1504
  {
1548
1505
    return 0;
1549
1506
  }
1550
1507
 
1551
1508
  /// Create a new dofmap for sub dofmap i (for a mixed element)
1552
 
  virtual ufc::dofmap* create_sub_dofmap(unsigned int i) const
 
1509
  virtual ufc::dofmap* create_sub_dofmap(std::size_t i) const
1553
1510
  {
1554
1511
    return 0;
1555
1512
  }
1566
1523
/// tensor corresponding to the local contribution to a form from
1567
1524
/// the integral over a cell.
1568
1525
 
1569
 
class energynorm_cell_integral_0_0: public ufc::cell_integral
 
1526
class energynorm_cell_integral_0_otherwise: public ufc::cell_integral
1570
1527
{
1571
1528
public:
1572
1529
 
1573
1530
  /// Constructor
1574
 
  energynorm_cell_integral_0_0() : ufc::cell_integral()
 
1531
  energynorm_cell_integral_0_otherwise() : ufc::cell_integral()
1575
1532
  {
1576
1533
    // Do nothing
1577
1534
  }
1578
1535
 
1579
1536
  /// Destructor
1580
 
  virtual ~energynorm_cell_integral_0_0()
 
1537
  virtual ~energynorm_cell_integral_0_otherwise()
1581
1538
  {
1582
1539
    // Do nothing
1583
1540
  }
1585
1542
  /// Tabulate the tensor for the contribution from a local cell
1586
1543
  virtual void tabulate_tensor(double* A,
1587
1544
                               const double * const * w,
1588
 
                               const ufc::cell& c) const
 
1545
                               const double* vertex_coordinates,
 
1546
                               int cell_orientation) const
1589
1547
  {
1590
 
    // Extract vertex coordinates
1591
 
    const double * const * x = c.coordinates;
1592
 
    
1593
 
    // Compute Jacobian of affine map from reference cell
1594
 
    const double J_00 = x[1][0] - x[0][0];
1595
 
    const double J_01 = x[2][0] - x[0][0];
1596
 
    const double J_02 = x[3][0] - x[0][0];
1597
 
    const double J_10 = x[1][1] - x[0][1];
1598
 
    const double J_11 = x[2][1] - x[0][1];
1599
 
    const double J_12 = x[3][1] - x[0][1];
1600
 
    const double J_20 = x[1][2] - x[0][2];
1601
 
    const double J_21 = x[2][2] - x[0][2];
1602
 
    const double J_22 = x[3][2] - x[0][2];
1603
 
    
1604
 
    // Compute sub determinants
1605
 
    const double d_00 = J_11*J_22 - J_12*J_21;
1606
 
    const double d_01 = J_12*J_20 - J_10*J_22;
1607
 
    const double d_02 = J_10*J_21 - J_11*J_20;
1608
 
    const double d_10 = J_02*J_21 - J_01*J_22;
1609
 
    const double d_11 = J_00*J_22 - J_02*J_20;
1610
 
    const double d_12 = J_01*J_20 - J_00*J_21;
1611
 
    const double d_20 = J_01*J_12 - J_02*J_11;
1612
 
    const double d_21 = J_02*J_10 - J_00*J_12;
1613
 
    const double d_22 = J_00*J_11 - J_01*J_10;
1614
 
    
1615
 
    // Compute determinant of Jacobian
1616
 
    double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
1617
 
    
1618
 
    // Compute inverse of Jacobian
1619
 
    const double K_00 = d_00 / detJ;
1620
 
    const double K_01 = d_10 / detJ;
1621
 
    const double K_02 = d_20 / detJ;
1622
 
    const double K_10 = d_01 / detJ;
1623
 
    const double K_11 = d_11 / detJ;
1624
 
    const double K_12 = d_21 / detJ;
1625
 
    const double K_20 = d_02 / detJ;
1626
 
    const double K_21 = d_12 / detJ;
1627
 
    const double K_22 = d_22 / detJ;
 
1548
    // Compute Jacobian
 
1549
    double J[9];
 
1550
    compute_jacobian_tetrahedron_3d(J, vertex_coordinates);
 
1551
    
 
1552
    // Compute Jacobian inverse and determinant
 
1553
    double K[9];
 
1554
    double detJ;
 
1555
    compute_jacobian_inverse_tetrahedron_3d(K, detJ, J);
1628
1556
    
1629
1557
    // Set scale factor
1630
1558
    const double det = std::abs(detJ);
1631
1559
    
1632
 
    // Cell Volume.
1633
 
    
1634
 
    // Compute circumradius.
1635
 
    
1636
 
    
1637
 
    // Facet Area (divide by two because 'det' is scaled by area of reference triangle).
 
1560
    // Cell volume
 
1561
    
 
1562
    // Compute circumradius
 
1563
    
 
1564
    
 
1565
    // Facet area (divide by two because 'det' is scaled by area of reference triangle)
1638
1566
    
1639
1567
    // Array of quadrature weights.
1640
1568
    static const double W4[4] = {0.041666667, 0.041666667, 0.041666667, 0.041666667};
1666
1594
    A[0] = 0.0;
1667
1595
    // Number of operations to compute geometry constants: 39.
1668
1596
    double G[6];
1669
 
    G[0] = det*(K_00*K_00 + K_01*K_01 + K_02*K_02);
1670
 
    G[1] = 2.0*det*(K_00*K_10 + K_01*K_11 + K_02*K_12);
1671
 
    G[2] = 2.0*det*(K_00*K_20 + K_01*K_21 + K_02*K_22);
1672
 
    G[3] = det*(K_10*K_10 + K_11*K_11 + K_12*K_12);
1673
 
    G[4] = 2.0*det*(K_10*K_20 + K_11*K_21 + K_12*K_22);
1674
 
    G[5] = det*(K_20*K_20 + K_21*K_21 + K_22*K_22);
 
1597
    G[0] = det*(K[0]*K[0] + K[1]*K[1] + K[2]*K[2]);
 
1598
    G[1] = 2.0*det*(K[0]*K[3] + K[1]*K[4] + K[2]*K[5]);
 
1599
    G[2] = 2.0*det*(K[0]*K[6] + K[1]*K[7] + K[2]*K[8]);
 
1600
    G[3] = det*(K[3]*K[3] + K[4]*K[4] + K[5]*K[5]);
 
1601
    G[4] = 2.0*det*(K[3]*K[6] + K[4]*K[7] + K[5]*K[8]);
 
1602
    G[5] = det*(K[6]*K[6] + K[7]*K[7] + K[8]*K[8]);
1675
1603
    
1676
1604
    // Compute element tensor using UFL quadrature representation
1677
1605
    // Optimisations: ('eliminate zeros', True), ('ignore ones', True), ('ignore zero tables', True), ('optimisation', 'simplify_expressions'), ('remove zero terms', True)
1713
1641
    }// end loop over 'ip'
1714
1642
  }
1715
1643
 
1716
 
  /// Tabulate the tensor for the contribution from a local cell
1717
 
  /// using the specified reference cell quadrature points/weights
1718
 
  virtual void tabulate_tensor(double* A,
1719
 
                               const double * const * w,
1720
 
                               const ufc::cell& c,
1721
 
                               unsigned int num_quadrature_points,
1722
 
                               const double * const * quadrature_points,
1723
 
                               const double* quadrature_weights) const
1724
 
  {
1725
 
    std::cerr << "*** FFC warning: " << "Quadrature version of tabulate_tensor not yet implemented (introduced in UFC 2.0)." << std::endl;
1726
 
  }
1727
 
 
1728
1644
};
1729
1645
 
1730
1646
/// This class defines the interface for the assembly of the global
1761
1677
  /// Return a string identifying the form
1762
1678
  virtual const char* signature() const
1763
1679
  {
1764
 
    return "Form([Integral(Sum(IndexSum(Product(Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(SpatialDerivative(Coefficient(FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None), 0), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Power(Coefficient(FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None), 0), IntValue(2, (), (), {}))), Measure('cell', 0, None))])";
 
1680
    return "7abe8460e09620e5044bfb708b4424fe7f9dfe92cf8243a0bfb38e99b309f97dcce2d1420f2115612931a31f4dd52073821e8ffd99cab68d0f4e14d9d5f3e207";
1765
1681
  }
1766
1682
 
1767
1683
  /// Return the rank of the global tensor (r)
1768
 
  virtual unsigned int rank() const
 
1684
  virtual std::size_t rank() const
1769
1685
  {
1770
1686
    return 0;
1771
1687
  }
1772
1688
 
1773
1689
  /// Return the number of coefficients (n)
1774
 
  virtual unsigned int num_coefficients() const
 
1690
  virtual std::size_t num_coefficients() const
1775
1691
  {
1776
1692
    return 1;
1777
1693
  }
1778
1694
 
1779
1695
  /// Return the number of cell domains
1780
 
  virtual unsigned int num_cell_domains() const
 
1696
  virtual std::size_t num_cell_domains() const
1781
1697
  {
1782
 
    return 1;
 
1698
    return 0;
1783
1699
  }
1784
1700
 
1785
1701
  /// Return the number of exterior facet domains
1786
 
  virtual unsigned int num_exterior_facet_domains() const
 
1702
  virtual std::size_t num_exterior_facet_domains() const
1787
1703
  {
1788
1704
    return 0;
1789
1705
  }
1790
1706
 
1791
1707
  /// Return the number of interior facet domains
1792
 
  virtual unsigned int num_interior_facet_domains() const
1793
 
  {
1794
 
    return 0;
 
1708
  virtual std::size_t num_interior_facet_domains() const
 
1709
  {
 
1710
    return 0;
 
1711
  }
 
1712
 
 
1713
  /// Return the number of point domains
 
1714
  virtual std::size_t num_point_domains() const
 
1715
  {
 
1716
    return 0;
 
1717
  }
 
1718
 
 
1719
  /// Return whether the form has any cell integrals
 
1720
  virtual bool has_cell_integrals() const
 
1721
  {
 
1722
    return true;
 
1723
  }
 
1724
 
 
1725
  /// Return whether the form has any exterior facet integrals
 
1726
  virtual bool has_exterior_facet_integrals() const
 
1727
  {
 
1728
    return false;
 
1729
  }
 
1730
 
 
1731
  /// Return whether the form has any interior facet integrals
 
1732
  virtual bool has_interior_facet_integrals() const
 
1733
  {
 
1734
    return false;
 
1735
  }
 
1736
 
 
1737
  /// Return whether the form has any point integrals
 
1738
  virtual bool has_point_integrals() const
 
1739
  {
 
1740
    return false;
1795
1741
  }
1796
1742
 
1797
1743
  /// Create a new finite element for argument function i
1798
 
  virtual ufc::finite_element* create_finite_element(unsigned int i) const
 
1744
  virtual ufc::finite_element* create_finite_element(std::size_t i) const
1799
1745
  {
1800
1746
    switch (i)
1801
1747
    {
1810
1756
  }
1811
1757
 
1812
1758
  /// Create a new dofmap for argument function i
1813
 
  virtual ufc::dofmap* create_dofmap(unsigned int i) const
 
1759
  virtual ufc::dofmap* create_dofmap(std::size_t i) const
1814
1760
  {
1815
1761
    switch (i)
1816
1762
    {
1825
1771
  }
1826
1772
 
1827
1773
  /// Create a new cell integral on sub domain i
1828
 
  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
 
1774
  virtual ufc::cell_integral* create_cell_integral(std::size_t i) const
1829
1775
  {
1830
 
    switch (i)
1831
 
    {
1832
 
    case 0:
1833
 
      {
1834
 
        return new energynorm_cell_integral_0_0();
1835
 
        break;
1836
 
      }
1837
 
    }
1838
 
    
1839
1776
    return 0;
1840
1777
  }
1841
1778
 
1842
1779
  /// Create a new exterior facet integral on sub domain i
1843
 
  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
 
1780
  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(std::size_t i) const
1844
1781
  {
1845
1782
    return 0;
1846
1783
  }
1847
1784
 
1848
1785
  /// Create a new interior facet integral on sub domain i
1849
 
  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
 
1786
  virtual ufc::interior_facet_integral* create_interior_facet_integral(std::size_t i) const
 
1787
  {
 
1788
    return 0;
 
1789
  }
 
1790
 
 
1791
  /// Create a new point integral on sub domain i
 
1792
  virtual ufc::point_integral* create_point_integral(std::size_t i) const
 
1793
  {
 
1794
    return 0;
 
1795
  }
 
1796
 
 
1797
  /// Create a new cell integral on everywhere else
 
1798
  virtual ufc::cell_integral* create_default_cell_integral() const
 
1799
  {
 
1800
    return new energynorm_cell_integral_0_otherwise();
 
1801
  }
 
1802
 
 
1803
  /// Create a new exterior facet integral on everywhere else
 
1804
  virtual ufc::exterior_facet_integral* create_default_exterior_facet_integral() const
 
1805
  {
 
1806
    return 0;
 
1807
  }
 
1808
 
 
1809
  /// Create a new interior facet integral on everywhere else
 
1810
  virtual ufc::interior_facet_integral* create_default_interior_facet_integral() const
 
1811
  {
 
1812
    return 0;
 
1813
  }
 
1814
 
 
1815
  /// Create a new point integral on everywhere else
 
1816
  virtual ufc::point_integral* create_default_point_integral() const
1850
1817
  {
1851
1818
    return 0;
1852
1819
  }