This is a mailing list continuation of a bitbucket discussion:
https://bitbucket.org/fenics-project/dolfin/pull-requests/240/interpolation-improvements
I have been trying to clean up Function::interpolate() a bit.
The following issues have come up:
1. The chain of function calls is long and complex:
e.g. to interpolate in the general case from another Function v:
- this is just an illustrative sketch, with details removed:
Function::interpolate(GenericFunction& v)
FunctionSpace::interpolate(Vector& coeffs, const GenericFunction& v)
Iterate over cells {
v.restrict(cell_coeffs, element, cell, coords, ufc_cell)
Function::restrict(w, element, cell, coords, ufc_cell)
...
restrict_as_ufc_function(w, element, dolfin_cell, coords, ufc_cell)
element.evaluate_dofs()
ufc_element->evaluate_dofs()
ufc_function::evaluate(vals, coords, ufc_cell)
GenericFunction::evaluate(vals, coords, ufc_cell)
GenericFunction::eval(vals, x, ufc_cell)
GenericFunction::eval(vals, x)
Function::eval(vals, x)
{
id = mesh.bb_tree.compute_first_entity_collision(point)
Cell (mesh, id)
Function::eval(val, x, cell, ufc_cell)
restrict(coeffs, element, cell, coords, ufc_cell)
element.evaluate_basis()
values += coeffs * basis
}
2. Many calls use ufc_cell and dolfin_cell with the same data. This
looks bad, and is bad. Can we find a way to transition away from needing
both?
3. In parallel, this model totally breaks down, as it is only at the
very bottom that we realise the point is 'off process' and we need a
collective operation to get it.
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics