Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using function.evaluate #163

Open
bknight1 opened this issue Feb 27, 2024 · 5 comments
Open

Issue using function.evaluate #163

bknight1 opened this issue Feb 27, 2024 · 5 comments

Comments

@bknight1
Copy link
Member

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.

Screenshot 2024-02-27 at 12 18 15
@julesghub
Copy link
Member

Not sure what Fe is? Maybe it's not available in the first case?
A basic example would be awesome thanks.

@lmoresi
Copy link
Member

lmoresi commented Feb 27, 2024

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 ?

@bknight1
Copy link
Member Author

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

@gthyagi
Copy link
Contributor

gthyagi commented Feb 28, 2024

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.

@lmoresi
Copy link
Member

lmoresi commented Apr 3, 2024

@bknight1 - can you check this is still broken in the current dev branch so we can investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants