Results at any location

Hello everybody,

I try to get the results at a location within a domain where no nodes exist. Or simply meaning, I’m looking for a function like:

location = [xl,yl,zl]
result_at_location = interpolate(R,location)

Here, R is a function representing the result field. If an MWE is needed or helpful, I could construct them. But I hope that somewhat ‘generic’ question is as distinctive as I think.

Best,
Mario

You can use R.eval as shown in: Implementation — FEniCSx tutorial

Looks promising! Is this functionality coupled with a specific version of dolfinx?

No, dolfinx.den.Function.eval has been in DOLFINx since prior to the v0.1.0 release

Ah, I see. Could it be that

colliding_cells = geometry.compute_colliding_cells(domain, cell_candidates, points.T)

given in your tutorial, was introduced in a recent version of dolfinx? I found no entry in the changelog. And, is:

colliding_cells.links(i)

restricted to meshes created via gmshio? Loading of xdmf-meshes leads to the error that ‘links’ doesn’t exist.

Thanks for your help!

In version 0.3.0 this function was called dolfinx.geometry.select_colliding_cells, see: https://github.com/jorgensd/dolfinx-tutorial/blob/v0.3.0/chapter1/membrane_code.ipynb
This was changed in the 0.4.0 release:
https://github.com/jorgensd/dolfinx-tutorial/blob/v0.4.0/chapter1/membrane_code.ipynb

As you are using an older version of DOLFINx, you need to follow the tutorial for the relevant version (i’ve posted the equivalent code for 0.3.0 and 0.4.0 above

Great, I got it! Thanks a lot @dokken