Ferrite.jl icon indicating copy to clipboard operation
Ferrite.jl copied to clipboard

Add example for plotting with plots.jl

Open TheFibonacciEffect opened this issue 9 months ago • 6 comments
trafficstars

Show how the PointEvalHandler can be used to evaluate the solution for plotting using Plots.jl in the case of the heat uquation.

TheFibonacciEffect avatar Jan 23 '25 10:01 TheFibonacciEffect

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 0.00%. Comparing base (43db37c) to head (b9e67df).

:exclamation: There is a different number of reports uploaded between BASE (43db37c) and HEAD (b9e67df). Click for more details.

HEAD has 5 uploads less than BASE
Flag BASE (43db37c) HEAD (b9e67df)
6 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #1134       +/-   ##
==========================================
- Coverage   93.59%   0.00%   -93.60%     
==========================================
  Files          39      39               
  Lines        6087    6009       -78     
==========================================
- Hits         5697       0     -5697     
- Misses        390    6009     +5619     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 23 '25 10:01 codecov[bot]

Thank you for the suggestion. However, in my opinion, this is not a recommended way to plot an FE solution in Ferrite, so we shouldn't recommend that in the docs.

FerriteViz.jl aims to make such plots easy (but currently unfortunately requires using a development branch).

KnutAM avatar Feb 03 '25 20:02 KnutAM

I think maybe we can still add this to the how-to section and elaborate in detail why this should not be used in general.

I will try to update FerriteViz in the meantime.

termi-official avatar Feb 04 '25 08:02 termi-official

I think it shouldnt be used generally, because you would have to find a way to sample from the more complex geometries and display it with plots.jl, which is what FerriteViz should be used for instead.

However I think it would be nice to add it, because it shows how to sample from a solution, which is important for solving optimization problems involving FEM. I couldnt find an example for that in the docs yet.

Explaining in more detail on why it shouldnt be used and pointing to the relevant branch FerriteViz, would be nice, but I am new to Ferrite, so I dont have the knowledge to write a section like that. So someone else would need to do that. To me however it seems evident why this shouldnt be used in general, more complex cases in which either FerriteViz (once its updated) or Paraview would be better used (especially 3D).

TheFibonacciEffect avatar Feb 09 '25 16:02 TheFibonacciEffect

Thanks for elaborating. It was not ment to offload writing up this section to you, no worries.

However I think it would be nice to add it, because it shows how to sample from a solution, which is important for solving optimization problems involving FEM. I couldnt find an example for that in the docs yet.

Sorry, I think I do not understand. Is there something missing in https://ferrite-fem.github.io/Ferrite.jl/stable/howto/postprocessing/ (which should be visible from https://ferrite-fem.github.io/Ferrite.jl/stable/howto/) or do you have something different in mind? If you want to solve optimization stuff with FEM (or PDEs in general), then I would highly recommend you to take a look into adjoint methods, as this might, without further knowledge about your specific form, make you optimization problem easier to handle.

termi-official avatar Feb 10 '25 08:02 termi-official

Yes, true, youre right its definetly there.

TheFibonacciEffect avatar Feb 11 '25 13:02 TheFibonacciEffect