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

Difference in using float or Function(FunctionSpace(mesh, "R", 0))? #150

Open
ddundo opened this issue Sep 17, 2024 · 8 comments
Open

Difference in using float or Function(FunctionSpace(mesh, "R", 0))? #150

ddundo opened this issue Sep 17, 2024 · 8 comments
Labels
question Further information is requested

Comments

@ddundo
Copy link
Member

ddundo commented Sep 17, 2024

In the newly-added bubble shear demo, I noticed that we get different solutions if I set variables dt and theta to be floats, rather than Function(FunctionSpace(mesh, "R", 0)). That is, the uniform resolution results don't appear to change, but the adapted ones do (both classical and metric advection). Any idea why this is the case?

@ddundo ddundo added the question Further information is requested label Sep 17, 2024
@jwallwork23
Copy link
Member

Thanks for reporting this, @ddundo. Putting it for discussion at the next meeting.

@ddundo
Copy link
Member Author

ddundo commented Oct 18, 2024

This commit bfed2c2 also changed the non-uniform solutions, where time t was changed from being a float to Function(R)

@ddundo
Copy link
Member Author

ddundo commented Oct 19, 2024

Very interesting... Even logging affects adaptive results:

(firedrake) firedrake@0241f81993fe:~/firedrake/src/animate/demos$ python bubble_shear.py
Relative L2 error on the coarse mesh: 56.52%
Relative L2 error on the fine mesh: 32.29%.
Classical mesh adaptation.
   Avg. number of vertices: 2299.5
   Relative L2 error: 30.43%
Metric advection mesh adaptation.
   Avg. number of vertices: 2008.3
   Relative L2 error: 30.58%
   
   
(firedrake) firedrake@0241f81993fe:~/firedrake/src/animate/demos$ python bubble_shear.py -log_view :foo.txt:ascii_flamegraph
Relative L2 error on the coarse mesh: 56.52%
Relative L2 error on the fine mesh: 32.29%.
Classical mesh adaptation.
   Avg. number of vertices: 2308.1
   Relative L2 error: 30.32%
Metric advection mesh adaptation.
   Avg. number of vertices: 2014.3
   Relative L2 error: 30.79%

@jwallwork23
Copy link
Member

Very interesting... Even logging affects adaptive results:

Is this with float or R-space?

@ddundo
Copy link
Member Author

ddundo commented Oct 20, 2024

Very interesting... Even logging affects adaptive results:

Is this with float or R-space?

This is on the 153_improve_bubble branch, so with R-space.

@jwallwork23
Copy link
Member

Hm, are there any other floats that might be causing an issue?

@ddundo
Copy link
Member Author

ddundo commented Oct 20, 2024

Not sure, but I'll try to make minimal examples for each of these before the next meeting so we can discuss :)

@ddundo
Copy link
Member Author

ddundo commented Nov 8, 2024

Classical adaptation results without and with logging:

(firedrake) firedrake@0241f81993fe:~/firedrake/src/animate/demos$ python bubble_shear.py
Adapted mesh 0 with 1905 vertices.
Adapted mesh 1 with 2062 vertices.
Adapted mesh 2 with 2127 vertices.
Adapted mesh 3 with 2312 vertices.
Adapted mesh 4 with 2343 vertices.
Adapted mesh 5 with 2446 vertices.
Adapted mesh 6 with 2493 vertices.
Adapted mesh 7 with 2539 vertices.
Adapted mesh 8 with 2542 vertices.
Adapted mesh 9 with 2525 vertices.
Adapted mesh 10 with 2431 vertices.
Adapted mesh 11 with 2370 vertices.
Adapted mesh 12 with 2224 vertices.
Adapted mesh 13 with 2103 vertices.
Adapted mesh 14 with 2070 vertices.

(firedrake) firedrake@0241f81993fe:~/firedrake/src/animate/demos$ python bubble_shear.py -log_view :foo.txt:ascii_flamegraph
Relative L2 error on the coarse mesh: 56.52%
Relative L2 error on the fine mesh: 32.29%.
Adapted mesh 0 with 1905 vertices.
Adapted mesh 1 with 2062 vertices.
Adapted mesh 2 with 2127 vertices.
Adapted mesh 3 with 2312 vertices.
Adapted mesh 4 with 2343 vertices.
Adapted mesh 5 with 2453 vertices.
Adapted mesh 6 with 2498 vertices.
Adapted mesh 7 with 2540 vertices.
Adapted mesh 8 with 2539 vertices.
Adapted mesh 9 with 2530 vertices.
Adapted mesh 10 with 2436 vertices.
Adapted mesh 11 with 2322 vertices.
Adapted mesh 12 with 2262 vertices.
Adapted mesh 13 with 2159 vertices.
Adapted mesh 14 with 2134 vertices.

when I compare different variables and how they change in time (e.g. mean of concentration c before and after projecting, velocity u), they all change very very slowly at the beginning, like 12th decimal point at start. So I guess this accumulates over time. I wasn't able to find the very first thing that is different and that might cause everything else to change (or maybe they all change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

2 participants