23
24
class BilinearForm : public dolfin::BilinearForm
27
class TestElement : public dolfin::FiniteElement
31
TestElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
33
// Element is scalar, don't need to initialize tensordims
35
// Element is simple, don't need to initialize subelements
40
if ( tensordims ) delete [] tensordims;
43
for (unsigned int i = 0; i < elementdim(); i++)
44
delete subelements[i];
45
delete [] subelements;
49
inline unsigned int spacedim() const
54
inline unsigned int shapedim() const
59
inline unsigned int tensordim(unsigned int i) const
61
dolfin_error("Element is scalar.");
65
inline unsigned int elementdim() const
70
inline unsigned int rank() const
75
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
77
nodes[0] = cell.vertexID(0);
78
nodes[1] = cell.vertexID(1);
79
nodes[2] = cell.vertexID(2);
80
nodes[3] = cell.vertexID(3);
83
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
85
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
86
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
87
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
88
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
95
void vertexeval(real values[], unsigned int vertex, const real x[], const Mesh& mesh) const
97
// FIXME: Temporary fix for Lagrange elements
98
values[0] = x[vertex];
101
const FiniteElement& operator[] (unsigned int i) const
106
FiniteElement& operator[] (unsigned int i)
111
FiniteElementSpec spec() const
113
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
119
unsigned int* tensordims;
120
FiniteElement** subelements;
124
class TrialElement : public dolfin::FiniteElement
128
TrialElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
130
// Element is scalar, don't need to initialize tensordims
132
// Element is simple, don't need to initialize subelements
137
if ( tensordims ) delete [] tensordims;
140
for (unsigned int i = 0; i < elementdim(); i++)
141
delete subelements[i];
142
delete [] subelements;
146
inline unsigned int spacedim() const
151
inline unsigned int shapedim() const
156
inline unsigned int tensordim(unsigned int i) const
158
dolfin_error("Element is scalar.");
162
inline unsigned int elementdim() const
167
inline unsigned int rank() const
172
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
174
nodes[0] = cell.vertexID(0);
175
nodes[1] = cell.vertexID(1);
176
nodes[2] = cell.vertexID(2);
177
nodes[3] = cell.vertexID(3);
180
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
182
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
183
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
184
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
185
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
192
void vertexeval(real values[], unsigned int vertex, const real x[], const Mesh& mesh) const
194
// FIXME: Temporary fix for Lagrange elements
195
values[0] = x[vertex];
198
const FiniteElement& operator[] (unsigned int i) const
203
FiniteElement& operator[] (unsigned int i)
208
FiniteElementSpec spec() const
210
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
216
unsigned int* tensordims;
217
FiniteElement** subelements;
221
BilinearForm() : dolfin::BilinearForm(0)
223
// Create finite element for test space
224
_test = new TestElement();
226
// Create finite element for trial space
227
_trial = new TrialElement();
230
void eval(real block[], const AffineMap& map) const
232
// Compute geometry tensors
233
const real G0_0_0 = map.det*map.g00*map.g00 + map.det*map.g01*map.g01 + map.det*map.g02*map.g02;
234
const real G0_0_1 = map.det*map.g00*map.g10 + map.det*map.g01*map.g11 + map.det*map.g02*map.g12;
235
const real G0_0_2 = map.det*map.g00*map.g20 + map.det*map.g01*map.g21 + map.det*map.g02*map.g22;
236
const real G0_1_0 = map.det*map.g10*map.g00 + map.det*map.g11*map.g01 + map.det*map.g12*map.g02;
237
const real G0_1_1 = map.det*map.g10*map.g10 + map.det*map.g11*map.g11 + map.det*map.g12*map.g12;
238
const real G0_1_2 = map.det*map.g10*map.g20 + map.det*map.g11*map.g21 + map.det*map.g12*map.g22;
239
const real G0_2_0 = map.det*map.g20*map.g00 + map.det*map.g21*map.g01 + map.det*map.g22*map.g02;
240
const real G0_2_1 = map.det*map.g20*map.g10 + map.det*map.g21*map.g11 + map.det*map.g22*map.g12;
241
const real G0_2_2 = map.det*map.g20*map.g20 + map.det*map.g21*map.g21 + map.det*map.g22*map.g22;
243
// Compute element tensor
244
block[0] = 1.666666666666664e-01*G0_0_0 + 1.666666666666664e-01*G0_0_1 + 1.666666666666664e-01*G0_0_2 + 1.666666666666664e-01*G0_1_0 + 1.666666666666665e-01*G0_1_1 + 1.666666666666665e-01*G0_1_2 + 1.666666666666664e-01*G0_2_0 + 1.666666666666665e-01*G0_2_1 + 1.666666666666665e-01*G0_2_2;
245
block[1] = -1.666666666666664e-01*G0_0_0 - 1.666666666666664e-01*G0_0_1 - 1.666666666666664e-01*G0_0_2;
246
block[2] = -1.666666666666664e-01*G0_1_0 - 1.666666666666665e-01*G0_1_1 - 1.666666666666665e-01*G0_1_2;
247
block[3] = -1.666666666666664e-01*G0_2_0 - 1.666666666666665e-01*G0_2_1 - 1.666666666666665e-01*G0_2_2;
248
block[4] = -1.666666666666664e-01*G0_0_0 - 1.666666666666664e-01*G0_1_0 - 1.666666666666664e-01*G0_2_0;
249
block[5] = 1.666666666666664e-01*G0_0_0;
250
block[6] = 1.666666666666664e-01*G0_1_0;
251
block[7] = 1.666666666666664e-01*G0_2_0;
252
block[8] = -1.666666666666664e-01*G0_0_1 - 1.666666666666665e-01*G0_1_1 - 1.666666666666665e-01*G0_2_1;
253
block[9] = 1.666666666666664e-01*G0_0_1;
254
block[10] = 1.666666666666665e-01*G0_1_1;
255
block[11] = 1.666666666666665e-01*G0_2_1;
256
block[12] = -1.666666666666664e-01*G0_0_2 - 1.666666666666665e-01*G0_1_2 - 1.666666666666665e-01*G0_2_2;
257
block[13] = 1.666666666666664e-01*G0_0_2;
258
block[14] = 1.666666666666665e-01*G0_1_2;
259
block[15] = 1.666666666666665e-01*G0_2_2;
35
bool interior_contribution() const;
37
void eval(real block[], const AffineMap& map, real det) const;
39
bool boundary_contribution() const;
41
void eval(real block[], const AffineMap& map, real det, unsigned int facet) const;
43
bool interior_boundary_contribution() const;
45
void eval(real block[], const AffineMap& map0, const AffineMap& map1, real det, unsigned int facet0, unsigned int facet1, unsigned int alignment) const;
49
class BilinearForm::TestElement : public dolfin::FiniteElement
53
TestElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
55
// Element is scalar, don't need to initialize tensordims
57
// Element is simple, don't need to initialize subelements
62
if ( tensordims ) delete [] tensordims;
65
for (unsigned int i = 0; i < elementdim(); i++)
66
delete subelements[i];
67
delete [] subelements;
71
inline unsigned int spacedim() const
76
inline unsigned int shapedim() const
81
inline unsigned int tensordim(unsigned int i) const
83
dolfin_error("Element is scalar.");
87
inline unsigned int elementdim() const
92
inline unsigned int rank() const
97
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
99
nodes[0] = cell.entities(0)[0];
100
nodes[1] = cell.entities(0)[1];
101
nodes[2] = cell.entities(0)[2];
102
nodes[3] = cell.entities(0)[3];
105
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
107
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
108
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
109
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
110
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
117
void vertexeval(uint vertex_nodes[], unsigned int vertex, const Mesh& mesh) const
119
// FIXME: Temporary fix for Lagrange elements
120
vertex_nodes[0] = vertex;
123
const FiniteElement& operator[] (unsigned int i) const
128
FiniteElement& operator[] (unsigned int i)
133
FiniteElementSpec spec() const
135
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
141
unsigned int* tensordims;
142
FiniteElement** subelements;
146
class BilinearForm::TrialElement : public dolfin::FiniteElement
150
TrialElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
152
// Element is scalar, don't need to initialize tensordims
154
// Element is simple, don't need to initialize subelements
159
if ( tensordims ) delete [] tensordims;
162
for (unsigned int i = 0; i < elementdim(); i++)
163
delete subelements[i];
164
delete [] subelements;
168
inline unsigned int spacedim() const
173
inline unsigned int shapedim() const
178
inline unsigned int tensordim(unsigned int i) const
180
dolfin_error("Element is scalar.");
184
inline unsigned int elementdim() const
189
inline unsigned int rank() const
194
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
196
nodes[0] = cell.entities(0)[0];
197
nodes[1] = cell.entities(0)[1];
198
nodes[2] = cell.entities(0)[2];
199
nodes[3] = cell.entities(0)[3];
202
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
204
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
205
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
206
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
207
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
214
void vertexeval(uint vertex_nodes[], unsigned int vertex, const Mesh& mesh) const
216
// FIXME: Temporary fix for Lagrange elements
217
vertex_nodes[0] = vertex;
220
const FiniteElement& operator[] (unsigned int i) const
225
FiniteElement& operator[] (unsigned int i)
230
FiniteElementSpec spec() const
232
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
238
unsigned int* tensordims;
239
FiniteElement** subelements;
243
BilinearForm::BilinearForm() : dolfin::BilinearForm(0)
245
// Create finite element for test space
246
_test = new TestElement();
248
// Create finite element for trial space
249
_trial = new TrialElement();
252
// Contribution from the interior
253
bool BilinearForm::interior_contribution() const { return true; }
255
void BilinearForm::eval(real block[], const AffineMap& map, real det) const
257
// Compute geometry tensors
258
const real G0_0_0 = det*map.g00*map.g00 + det*map.g01*map.g01 + det*map.g02*map.g02;
259
const real G0_0_1 = det*map.g00*map.g10 + det*map.g01*map.g11 + det*map.g02*map.g12;
260
const real G0_0_2 = det*map.g00*map.g20 + det*map.g01*map.g21 + det*map.g02*map.g22;
261
const real G0_1_0 = det*map.g10*map.g00 + det*map.g11*map.g01 + det*map.g12*map.g02;
262
const real G0_1_1 = det*map.g10*map.g10 + det*map.g11*map.g11 + det*map.g12*map.g12;
263
const real G0_1_2 = det*map.g10*map.g20 + det*map.g11*map.g21 + det*map.g12*map.g22;
264
const real G0_2_0 = det*map.g20*map.g00 + det*map.g21*map.g01 + det*map.g22*map.g02;
265
const real G0_2_1 = det*map.g20*map.g10 + det*map.g21*map.g11 + det*map.g22*map.g12;
266
const real G0_2_2 = det*map.g20*map.g20 + det*map.g21*map.g21 + det*map.g22*map.g22;
268
// Compute element tensor
269
block[0] = 1.666666666666664e-01*G0_0_0 + 1.666666666666664e-01*G0_0_1 + 1.666666666666664e-01*G0_0_2 + 1.666666666666664e-01*G0_1_0 + 1.666666666666665e-01*G0_1_1 + 1.666666666666665e-01*G0_1_2 + 1.666666666666664e-01*G0_2_0 + 1.666666666666665e-01*G0_2_1 + 1.666666666666665e-01*G0_2_2;
270
block[1] = -1.666666666666664e-01*G0_0_0 - 1.666666666666664e-01*G0_1_0 - 1.666666666666664e-01*G0_2_0;
271
block[2] = -1.666666666666664e-01*G0_0_1 - 1.666666666666665e-01*G0_1_1 - 1.666666666666665e-01*G0_2_1;
272
block[3] = -1.666666666666664e-01*G0_0_2 - 1.666666666666665e-01*G0_1_2 - 1.666666666666665e-01*G0_2_2;
273
block[4] = -1.666666666666664e-01*G0_0_0 - 1.666666666666664e-01*G0_0_1 - 1.666666666666664e-01*G0_0_2;
274
block[5] = 1.666666666666664e-01*G0_0_0;
275
block[6] = 1.666666666666664e-01*G0_0_1;
276
block[7] = 1.666666666666664e-01*G0_0_2;
277
block[8] = -1.666666666666664e-01*G0_1_0 - 1.666666666666665e-01*G0_1_1 - 1.666666666666665e-01*G0_1_2;
278
block[9] = 1.666666666666664e-01*G0_1_0;
279
block[10] = 1.666666666666665e-01*G0_1_1;
280
block[11] = 1.666666666666665e-01*G0_1_2;
281
block[12] = -1.666666666666664e-01*G0_2_0 - 1.666666666666665e-01*G0_2_1 - 1.666666666666665e-01*G0_2_2;
282
block[13] = 1.666666666666664e-01*G0_2_0;
283
block[14] = 1.666666666666665e-01*G0_2_1;
284
block[15] = 1.666666666666665e-01*G0_2_2;
287
// No contribution from the boundary
288
bool BilinearForm::boundary_contribution() const { return false; }
290
void BilinearForm::eval(real block[], const AffineMap& map, real det, unsigned int facet) const {}
292
// No contribution from interior boundaries
293
bool BilinearForm::interior_boundary_contribution() const { return false; }
295
void BilinearForm::eval(real block[], const AffineMap& map0, const AffineMap& map1, real det, unsigned int facet0, unsigned int facet1, unsigned int alignment) const {}
264
297
/// This class contains the form to be evaluated, including
265
298
/// contributions from the interior and boundary of the domain.
267
300
class LinearForm : public dolfin::LinearForm
271
class TestElement : public dolfin::FiniteElement
275
TestElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
277
// Element is scalar, don't need to initialize tensordims
279
// Element is simple, don't need to initialize subelements
284
if ( tensordims ) delete [] tensordims;
287
for (unsigned int i = 0; i < elementdim(); i++)
288
delete subelements[i];
289
delete [] subelements;
293
inline unsigned int spacedim() const
298
inline unsigned int shapedim() const
303
inline unsigned int tensordim(unsigned int i) const
305
dolfin_error("Element is scalar.");
309
inline unsigned int elementdim() const
314
inline unsigned int rank() const
319
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
321
nodes[0] = cell.vertexID(0);
322
nodes[1] = cell.vertexID(1);
323
nodes[2] = cell.vertexID(2);
324
nodes[3] = cell.vertexID(3);
327
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
329
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
330
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
331
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
332
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
339
void vertexeval(real values[], unsigned int vertex, const real x[], const Mesh& mesh) const
341
// FIXME: Temporary fix for Lagrange elements
342
values[0] = x[vertex];
345
const FiniteElement& operator[] (unsigned int i) const
350
FiniteElement& operator[] (unsigned int i)
355
FiniteElementSpec spec() const
357
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
363
unsigned int* tensordims;
364
FiniteElement** subelements;
368
class FunctionElement_0 : public dolfin::FiniteElement
372
FunctionElement_0() : dolfin::FiniteElement(), tensordims(0), subelements(0)
374
// Element is scalar, don't need to initialize tensordims
376
// Element is simple, don't need to initialize subelements
381
if ( tensordims ) delete [] tensordims;
384
for (unsigned int i = 0; i < elementdim(); i++)
385
delete subelements[i];
386
delete [] subelements;
390
inline unsigned int spacedim() const
395
inline unsigned int shapedim() const
400
inline unsigned int tensordim(unsigned int i) const
402
dolfin_error("Element is scalar.");
406
inline unsigned int elementdim() const
411
inline unsigned int rank() const
416
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
418
nodes[0] = cell.vertexID(0);
419
nodes[1] = cell.vertexID(1);
420
nodes[2] = cell.vertexID(2);
421
nodes[3] = cell.vertexID(3);
424
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
426
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
427
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
428
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
429
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
436
void vertexeval(real values[], unsigned int vertex, const real x[], const Mesh& mesh) const
438
// FIXME: Temporary fix for Lagrange elements
439
values[0] = x[vertex];
442
const FiniteElement& operator[] (unsigned int i) const
447
FiniteElement& operator[] (unsigned int i)
452
FiniteElementSpec spec() const
454
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
460
unsigned int* tensordims;
461
FiniteElement** subelements;
465
LinearForm(Function& w0) : dolfin::LinearForm(1)
467
// Create finite element for test space
468
_test = new TestElement();
471
add(w0, new FunctionElement_0());
474
void eval(real block[], const AffineMap& map) const
476
// Compute coefficients
477
const real c0_0 = c[0][0];
478
const real c0_1 = c[0][1];
479
const real c0_2 = c[0][2];
480
const real c0_3 = c[0][3];
482
// Compute geometry tensors
483
const real G0_0 = map.det*c0_0;
484
const real G0_1 = map.det*c0_1;
485
const real G0_2 = map.det*c0_2;
486
const real G0_3 = map.det*c0_3;
488
// Compute element tensor
489
block[0] = 1.666666666666662e-02*G0_0 + 8.333333333333309e-03*G0_1 + 8.333333333333307e-03*G0_2 + 8.333333333333312e-03*G0_3;
490
block[1] = 8.333333333333309e-03*G0_0 + 1.666666666666662e-02*G0_1 + 8.333333333333311e-03*G0_2 + 8.333333333333312e-03*G0_3;
491
block[2] = 8.333333333333307e-03*G0_0 + 8.333333333333311e-03*G0_1 + 1.666666666666662e-02*G0_2 + 8.333333333333311e-03*G0_3;
492
block[3] = 8.333333333333312e-03*G0_0 + 8.333333333333312e-03*G0_1 + 8.333333333333312e-03*G0_2 + 1.666666666666662e-02*G0_3;
306
class FunctionElement_0;
308
LinearForm(Function& w0);
311
bool interior_contribution() const;
313
void eval(real block[], const AffineMap& map, real det) const;
315
bool boundary_contribution() const;
317
void eval(real block[], const AffineMap& map, real det, unsigned int facet) const;
319
bool interior_boundary_contribution() const;
321
void eval(real block[], const AffineMap& map0, const AffineMap& map1, real det, unsigned int facet0, unsigned int facet1, unsigned int alignment) const;
325
class LinearForm::TestElement : public dolfin::FiniteElement
329
TestElement() : dolfin::FiniteElement(), tensordims(0), subelements(0)
331
// Element is scalar, don't need to initialize tensordims
333
// Element is simple, don't need to initialize subelements
338
if ( tensordims ) delete [] tensordims;
341
for (unsigned int i = 0; i < elementdim(); i++)
342
delete subelements[i];
343
delete [] subelements;
347
inline unsigned int spacedim() const
352
inline unsigned int shapedim() const
357
inline unsigned int tensordim(unsigned int i) const
359
dolfin_error("Element is scalar.");
363
inline unsigned int elementdim() const
368
inline unsigned int rank() const
373
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
375
nodes[0] = cell.entities(0)[0];
376
nodes[1] = cell.entities(0)[1];
377
nodes[2] = cell.entities(0)[2];
378
nodes[3] = cell.entities(0)[3];
381
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
383
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
384
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
385
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
386
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
393
void vertexeval(uint vertex_nodes[], unsigned int vertex, const Mesh& mesh) const
395
// FIXME: Temporary fix for Lagrange elements
396
vertex_nodes[0] = vertex;
399
const FiniteElement& operator[] (unsigned int i) const
404
FiniteElement& operator[] (unsigned int i)
409
FiniteElementSpec spec() const
411
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
417
unsigned int* tensordims;
418
FiniteElement** subelements;
422
class LinearForm::FunctionElement_0 : public dolfin::FiniteElement
426
FunctionElement_0() : dolfin::FiniteElement(), tensordims(0), subelements(0)
428
// Element is scalar, don't need to initialize tensordims
430
// Element is simple, don't need to initialize subelements
435
if ( tensordims ) delete [] tensordims;
438
for (unsigned int i = 0; i < elementdim(); i++)
439
delete subelements[i];
440
delete [] subelements;
444
inline unsigned int spacedim() const
449
inline unsigned int shapedim() const
454
inline unsigned int tensordim(unsigned int i) const
456
dolfin_error("Element is scalar.");
460
inline unsigned int elementdim() const
465
inline unsigned int rank() const
470
void nodemap(int nodes[], const Cell& cell, const Mesh& mesh) const
472
nodes[0] = cell.entities(0)[0];
473
nodes[1] = cell.entities(0)[1];
474
nodes[2] = cell.entities(0)[2];
475
nodes[3] = cell.entities(0)[3];
478
void pointmap(Point points[], unsigned int components[], const AffineMap& map) const
480
points[0] = map(0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
481
points[1] = map(1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00);
482
points[2] = map(0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00);
483
points[3] = map(0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00);
490
void vertexeval(uint vertex_nodes[], unsigned int vertex, const Mesh& mesh) const
492
// FIXME: Temporary fix for Lagrange elements
493
vertex_nodes[0] = vertex;
496
const FiniteElement& operator[] (unsigned int i) const
501
FiniteElement& operator[] (unsigned int i)
506
FiniteElementSpec spec() const
508
FiniteElementSpec s("Lagrange", "tetrahedron", 1);
514
unsigned int* tensordims;
515
FiniteElement** subelements;
519
LinearForm::LinearForm(Function& w0) : dolfin::LinearForm(1)
521
// Create finite element for test space
522
_test = new TestElement();
525
initFunction(0, w0, new FunctionElement_0());
528
// Contribution from the interior
529
bool LinearForm::interior_contribution() const { return true; }
531
void LinearForm::eval(real block[], const AffineMap& map, real det) const
533
// Compute coefficients
534
const real c0_0 = c[0][0];
535
const real c0_1 = c[0][1];
536
const real c0_2 = c[0][2];
537
const real c0_3 = c[0][3];
539
// Compute geometry tensors
540
const real G0_0 = det*c0_0;
541
const real G0_1 = det*c0_1;
542
const real G0_2 = det*c0_2;
543
const real G0_3 = det*c0_3;
545
// Compute element tensor
546
block[0] = 1.666666666666662e-02*G0_0 + 8.333333333333309e-03*G0_1 + 8.333333333333307e-03*G0_2 + 8.333333333333312e-03*G0_3;
547
block[1] = 8.333333333333309e-03*G0_0 + 1.666666666666662e-02*G0_1 + 8.333333333333311e-03*G0_2 + 8.333333333333312e-03*G0_3;
548
block[2] = 8.333333333333307e-03*G0_0 + 8.333333333333311e-03*G0_1 + 1.666666666666662e-02*G0_2 + 8.333333333333312e-03*G0_3;
549
block[3] = 8.333333333333312e-03*G0_0 + 8.333333333333312e-03*G0_1 + 8.333333333333311e-03*G0_2 + 1.666666666666662e-02*G0_3;
552
// No contribution from the boundary
553
bool LinearForm::boundary_contribution() const { return false; }
555
void LinearForm::eval(real block[], const AffineMap& map, real det, unsigned int facet) const {}
557
// No contribution from interior boundaries
558
bool LinearForm::interior_boundary_contribution() const { return false; }
560
void LinearForm::eval(real block[], const AffineMap& map0, const AffineMap& map1, real det, unsigned int facet0, unsigned int facet1, unsigned int alignment) const {}