-
Notifications
You must be signed in to change notification settings - Fork 33
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
Visualization for 3D Heater Julia Example #121
base: main
Are you sure you want to change the base?
Conversation
Looks great! Would be amazing to also have the animation online, let's see how long the docs need to build like this :) Any idea where those little dots in the Potential-plot are coming from? |
Ah, and besides that, could you use pre-commit? pip install pre-commit
pre-commit install
pre-commit run --all should format everything :) |
Thanks! Yep, in my next commit I'll make sure to fix the formatting with pre commit. I'm working on getting interactive to work. I've updated (locally) the dependencies for GridapMakie and found no issues with the recipes. I'm working to get the main repo (GridapMakie) updated. Using this, plotting is indeed much faster. In addition, with the updated Makie related packages, I can get WGLMakie to serve my figures in the examples interactively. Once updated and interactive, several of the strange artifacts in my plots above seem to disappear (including the dots). When testing the compiled docs, I can serve simple WGLMakie plots, but it seems to struggle for some of my plots in the example. I'm working to settle these issues and then I'll push the changes with hopefully the GridapMakie updates as well. |
Wow, that sounds amazing! Might it make sense to have them as individual plots and not 4 in one? Or would they roatate all the same if you have them in one? |
You can interact with each subplot in the figure individually. So you rotate each plot on its own. But I can also separate them without any trouble if we prefer. I have discovered there is an issue keeping the interactivity in offline mode for user defined Axis3 objects. It just builds a static axis. User provided LScenes also seem to have problems. However, some returned axis types from various plot routines (like the one in the tutorial, see the 3D surface plot below) seem to work out of the box, so I'm just figuring out what's missing. |
Ok, then I'm also fine with having them in one plot, might also look better then all in a row :) However you like it more :) |
I've managed to get the interactive plots working...with a few caveats.
Personally, I think it looks okay as is, but if we want we can either remove the axis itself or find a way to get the axis to move with the camera.
In addition, I'm currently working to get GridapMakie updated before we can allow this PR. |
Yay, amazing progress! 🥳 Should we maybe make an issue on Makie.jl about the axis not rotating? Could we separate the javascript-related code in a second file? I.e. having in the example a How large are the files right now? Would it lead to long loading times if it the files need to be downloaded? I'm wondering if there is a way to have optional/docs-only dependencies - having femwell depend on libraries which are for web-development sounds a bit too much (?) |
The commit I just made separates the javascript code into a separate file (js.jl). In addition, I created a way to dispatch display so the user can change the backend activated in the script, and then it will swap between interactive and non interactive accordingly.
There seems to be some progress in allowing the user to specify different dependencies for parts of the repo (such as docs) which require dependencies not used in the main package. Julia already supports this for testing, but there doesn't seem to be a way to generalize this for other areas such as docs yet. I agree it doesn't make much sense to introduce a bunch of front end packages to the whole repo. One alternative could be an additional Manifest that lives in the docs and is either loaded by just the js.jl module or the docs builder?
The javascript files are a bit large (mostly just in the data that is exported from the FEM cells). The entire js folder which gets build is around 750MB. They build really fast, but they are quite large which is why the browser has trouble rendering the HTML code if the javascript is not kept separate. Luckily, I found out safari only doesn't render it when I don't disable local file restrictions and cross-origin restrictions. If I disable these two, then it is able to render the data. Thus, there just seems to be some extra restrictions when debugging the scripts I am serving locally. I believe once this is hosted by the docs, since the page is secure, these restrictions will no longer matter for Safari. In other words, there doesn't seem to be any problem with the size of the data, as long as the javascript code is kept outside of the HTML file.
The WGLMakie developers are aware of the Axis3 limitations and are planning on implementing the missing features at some point. |
Hi all. This PR contains my implementation for visualization of the 3D heater. I am using GridapMakie with some extra work around it to make it more readable and allow subplots.
So far, I've added a visualization for the mesh, and plots for the potential, current, temperature, and heat flux. I have also included animations for the transient simulation, but it takes awhile to compute so we may want to keep that part commented out.
Ideally, one would be able to interact with the plot since 3D visuals are nicer when interactive. However, I don't think this is possible in the docs export via Makie without binder or some other way to run a Julia environment live, but happy to be proven wrong here.