1
// Licensed under the GNU LGPL Version 2.1.
6
using namespace dolfin;
8
int main(int argc, char* argv[])
12
editor.open(meshA, "triangle", 2, 2);
13
editor.initVertices(4);
14
editor.addVertex(0, 0.0, 0.0);
15
editor.addVertex(1, 1.0, 0.0);
16
editor.addVertex(2, 1.0, 1.0);
17
editor.addVertex(3, 0.0, 1.0);
19
editor.addCell(0, 0, 1, 3);
20
editor.addCell(1, 1, 2, 3);
26
Form* M = new SimpleFunctional(fA);
28
fA.init(meshA, xA, *M, 0);
30
int NA = meshA.numVertices();
32
// Generate some values for fA
33
real* arr = new real[NA];
34
for (VertexIterator v(meshA); !v.end(); ++v)
39
arr[0 * NA + id] = 2.0 * (p[1] - 0.5) * pow(p[0] - 0.0, 2);
45
File file_fA("fA.pvd");
48
UnitSquare meshB(11, 11);
52
ufc::finite_element* element = M->form().create_finite_element(0);
54
projectL2NonMatching(meshB, fA, fB, *element);
56
File file_fB("fB.pvd");