Issue using function.evaluate
I'm having an issue evaluating on the swarm. I need to first do an evaluate on the mesh for the swarm evaluate to then work. No issues with the evalf function though.
Sorry for the poor screen shot to show the issue, I'll try to make a basic example later today.
Not sure what Fe is? Maybe it's not available in the first case?
A basic example would be awesome thanks.
I had this problem during a swarm setup - some points very close to (or maybe even slightly outside) the element boundary due to perturbation of the initial position. Evalf does not care, evaluate blows up horribly.
This seems to be a recent problem along with other interpolation difficulties we have had crop up.
Ben, did the swarm move ? Can you re-validate or rebuild the local element ownership and see if they are up to date before the interpolation operation ?
The swarm didn't move @lmoresi, so I'm not sure what's going on. If I evaluate on the mesh first it works.
I've attached a script showing the issue using the hot pipe basic example. Ex_diffusion_generic_solver.txt
Hi @bknight1 @lmoresi ,
I made a small change in the script, replaced swarm.data with swarm.data[1:] then it worked.
Note: evaluate work for all other np. array datasets except swarm.data
### what it looks like using evaluate, no change from pre-solve
with swarm.access():
print(swarm.data[1:])
T_data_ps = uw.function.evaluate(T.sym[0], swarm.data[1:])
plt.scatter(swarm.data[1:][:,0], swarm.data[1:][:,1], c=np.abs(T_data_ps), cmap="jet")
This led me nowhere in my quick debugging effort. May be for you it can lead somewhere.
@bknight1 - can you check this is still broken in the current dev branch so we can investigate
Re-run the example which is now producing the correct result.