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

Increase visibility on mismatch between dof ordering and node ordering #875

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

termi-official
Copy link
Member

Title checks out.

@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e806ed9) 93.27% compared to head (ee4cb84) 93.27%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #875   +/-   ##
=======================================
  Coverage   93.27%   93.27%           
=======================================
  Files          36       36           
  Lines        5235     5235           
=======================================
  Hits         4883     4883           
  Misses        352      352           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Maximilian Köhler <maximilian.koehler@ruhr-uni-bochum.de>
@termi-official termi-official added the awaiting review PR is finished from the authors POV, waiting for feedback label Jan 15, 2024
Copy link
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
Some suggestions.

An alternative (or additional) solution if we have more of these questions could be to have a FAQ page that we can refer to.

docs/src/literate-howto/postprocessing.jl Show resolved Hide resolved
docs/src/literate-tutorials/heat_equation.jl Outdated Show resolved Hide resolved
@KnutAM KnutAM self-requested a review June 3, 2024 13:19
Copy link
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a second look at this, I think it makes sense to give a brief overview of the visualization options at the beginning of this how-to, before covering the details.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for the beginning of this file

# # [Post processing and visualization](@id howto-postprocessing)
# After running a simulation, we usually want to visualize the results in different ways.
# Ferrite.jl provides several tools to facilitate such tasks, and direct visualization of 
# solutions, cell data, and more by using the builtin vtk export or 
# our `Makie.jl`-based visualization tool `FerriteViz.jl`. 
# Note that if these tools don't suit your needs, and you want to create your own 
# visualization, the node numbers do not match the degrees of freedom numbering.
# You can use [`evaluate_at_grid_nodes`](@ref) to get the solution at the nodes. 
# 
# This how-to demonstrates
# * The basic vtk export functionality
# * The `L2Projector` for projecting quadrature point data to the FE interpolations 
# * The `PointEvalHandler` to evaluate this projection at user-defined points in the grid. 
# 
# The results from the heat equation tutorial are used as a basis for this demonstration.

And then skip the two first sentences after introduction.

Also update the vtk block to the new syntax, and I think we should add the primary solution as well to the output.

Comment on lines +132 to +137
#md # ## What next?
#md # For more complicated visualization workflows we recommend either using our visualization tool [FerriteViz.jl](https://github.com/Ferrite-FEM/FerriteViz.jl)
#md # or users should export the solution into vtk files and use e.g. [ParaView](https://www.paraview.org/), [Mayavi](https://docs.enthought.com/mayavi/mayavi/), ... .
#md # It should be noted that the ordering of the DofHandler and the numbering of the nodes does not match, hence we cannot directly use solution
#md # vectors to assign colors to discretizations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion at top replaces this in my opinion.

Suggested change
#md # ## What next?
#md # For more complicated visualization workflows we recommend either using our visualization tool [FerriteViz.jl](https://github.com/Ferrite-FEM/FerriteViz.jl)
#md # or users should export the solution into vtk files and use e.g. [ParaView](https://www.paraview.org/), [Mayavi](https://docs.enthought.com/mayavi/mayavi/), ... .
#md # It should be noted that the ordering of the DofHandler and the numbering of the nodes does not match, hence we cannot directly use solution
#md # vectors to assign colors to discretizations.

@@ -127,6 +127,9 @@ add!(dh, :u, ip_u)
add!(dh, :p, ip_p)
close!(dh)
```

!!! note
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!!! note
!!! note "Dof numbering"

(Or DoF numbering, but we are a bit inconsistent here...)

@KristofferC
Copy link
Collaborator

Regarding a FAQ, I remember reading https://gds.blog.gov.uk/2013/07/25/faqs-why-we-dont-have-them/

@KnutAM KnutAM mentioned this pull request Aug 4, 2024
@KnutAM
Copy link
Member

KnutAM commented Oct 1, 2024

After seeing the latest issues with this, I've thought that it would probably be most clear for new users if we note this when you obtain the solution to the heat equation problem, not when distributing the dofs. I.e. adding a !!! note after u = K\f here.

@termi-official
Copy link
Member Author

I assume we do not have any analytics to confirm that users actually visit (and read) the heat equation tutorial?

@KnutAM
Copy link
Member

KnutAM commented Oct 2, 2024

I assume we do not have any analytics to confirm that users actually visit (and read) the heat equation tutorial?

No. Just guess-work that pointing it out there would be more obvious, hence the question on Slack.

@KnutAM
Copy link
Member

KnutAM commented Oct 2, 2024

What if we add it as a small code comment instead (to heat eq. and linear elasticity)?
This way, anyone copying one of these basic examples will also get it even if the online tutorial isn't read. I'm quite sure most new users will start by running one of these tutorials.

@utk11
Copy link

utk11 commented Oct 22, 2024

Hello, a example or note on how to get the dof number from a node number could be helpful so that getting the solution at that particular node from the global solution vector would be easy.

Also how to get the dof number from a node number?😅😅

@termi-official
Copy link
Member Author

Also how to get the dof number from a node number?😅😅

In general this assumption does not work, so we do not have utils for this. I will try to take a look into better infrastructure for isoparametric elements, but there are short term more important things to do on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review PR is finished from the authors POV, waiting for feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants