On 03/09/2015 10:54, Chris Richardson wrote:
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.
4. I forgot to mention, dolfin::Extrapolation::extrapolate() also needs
to work in parallel.
The name is a bit confusing, and I think it needs better
documentation. As I understand it,
it is really interpolation with a broader basis, i.e. using
surrounding cells. There can be confusion
with 'allow_extrapolation' as applied to interpolation, which
extrapolates outside the domain. Does that make sense?
Chris
_______________________________________________
fenics mailing list
fenics@fenicsproject.org
http://fenicsproject.org/mailman/listinfo/fenics