-
Notifications
You must be signed in to change notification settings - Fork 56
1d elements dev #205
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
1d elements dev #205
Conversation
|
This looks really cool @termi-official. If you clean it up we will be interested in merging it. -Tzanio |
|
Okay this is more problematic than anticipated. I am currently working on modifying the mesh to support mixed dimensional elements (while also making at least 1d branching meshes possible, because they are required from time to time in mechanics and electrophysiology). One major issue I ran into is that the elements keep disconnecting (I assume because for branched meshes the connectivity tables are broken) - this is "fixed" by simply providing different visualization modes for now. Some features are missing in 1d vis which I probably cannot address by myself. I am aware that the following does not work (see above for bullet points). |
5d20fa5 to
1488a99
Compare
|
Turns out many of the issues I encountered has been fixed with recent MFEM patches and the ongoing restructuring of the GLVis codebase. Scalar field visualization is basically working now. Some minor things remain to be resolved for scalar fields. However, vector-valued fields are still open, which are important in some areas of mechanics. |
|
Okay 3d vector visualization is also okayish now. The visualization is not very pretty, because modifying the renderer to include dynamic line thickness information seems a big out of scope for now. I also noticed a crazy amount of code duplication between scalar and vector field visualizer classes. Maybe a good future PR is to merge the duplicate code (and hence features). |
|
Bump @tzanio @publixsubfan . I think #232 is not being worked on anymore? Can we merge this PR then and leave the open TODOs for a follow up PR which addresses line rendering? |
Yes, lets do that. Sorry for the long delay @termi-official ! |
|
Absolutely no problem! :) I will merge master and fi the remaining errors tomorrow. |
tzanio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more items:
-
Can you please update
CHANGELOG -
Should we add some of the 1D example meshes/results in MFEM and/or https://github.com/GLVis/data?
Thanks again for the contribution, @termi-official!
Tzanio
| double line_width = GetLineWidth(); | ||
| double ms_line_width = GetLineWidthMS(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these make any difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your question is regarding the change itself, then this change just introduces a call to the internal API to keep the defaults consistent. If your question is regarding whether multisampling makes a difference, then it depends on the system. Not all systems support the respective OpenGL calls for multisampling of lines, which is part of the reason why I wanted to merge the line rendering PR before this. However, this PR is also functional without the line rendering PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example pressing A on my workstation during interactive visualization removes stair-casing though antialiasing.
| // if (vals(j) >= 0.0) | ||
| // vals(j) = sqrt(vals(j)); | ||
| // else | ||
| // vals(j) = -sqrt(-vals(j)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we can remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a comment on master, so it does not have any functional consequences - should I leave it anyway?
| if (v_normals && dim > 1) | ||
| { | ||
| PrepareWithNormals(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding this change here I am not super confident. This change will need intervention further intervention for the line rendering PR to setup the normals of the flat representation correctly.
|
Sure, we can think about adding some of the 1D network mesh stuff to MFEM, but we might need to think a bit how to do this one properly. My heart simulation framework is heavy patchwork (subclasses of mesh to patch the connectivity tables) to work around the assumption that we have the scenario of more than 2 element sharing a face. I do not have a good solution to make this properly work for now, because this assumption seems to be quite deeply rooted into the MFEM core. Happy to discuss further. Edit: I should note that the "solution" for the visualization in the PR description is hand-constructed and not part of any simulation. I can make a PR into the data repository for smoke tests. |
|
Thanks for making the changes, @termi-official ! |


I work coupled 1D-3D problems so for me it is sometimes helpful to visualize the solutions side by side while MFEM is computing the solution to track down issues.
The draft is not very clean yet and might come with some level of memory corruption (could not test everything in detail yet). This is basically my late try on fixing #68 .
To test the PR I currently just utilize two very simple meshes which I feed into MFEM example 0.
3D mesh
3D vector test field
2D mesh
2d vector test field
scalar test field
GlVis output (left 2D, right 3D)

TODOs
Visualizing boundary attributes(possible future work)Visualizing the element endpoints correctly(possible future work)