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

"Zigzagging" side sets in ExodusII 2.5D mesh output #24631

Closed
lindsayad opened this issue Jun 8, 2023 Discussed in #24630 · 5 comments · Fixed by #25370
Closed

"Zigzagging" side sets in ExodusII 2.5D mesh output #24631

lindsayad opened this issue Jun 8, 2023 Discussed in #24630 · 5 comments · Fixed by #25370
Labels
C: libMesh C: Meshing MeshGenerator system, mesh loading

Comments

@lindsayad
Copy link
Member

Discussed in #24630

Originally posted by ln53 June 8, 2023
I've been generating disjoint 2D meshes in 3D space using Gmsh. After the mesh has been processed by MOOSE (and opened in ParaView), the side sets (which should be straight along the edges) are in the pictured "zigzag" or "stitched" pattern.

  • This happens using Gmsh physical groups to specify sidesets, as well as ParsedGenerateSideset, SideSetsFromNormalsGenerator, and various other side set generators.
  • It only seems to happen when there are multiple disjoint meshes in 3D - individual 2D meshes or disjoint & coplanar 2D meshes both behave as expected.
  • MWE image and code under dropdowns below.
image
Mesh generation with Gmsh Python API
import gmsh
occ = gmsh.model.occ
gmsh.initialize()

occ.addRectangle(0, 0, 0, 1, 1)
occ.addRectangle(0, 0, 0.5, 1, 1)
occ.synchronize()

gmsh.model.addPhysicalGroup(1, [1], name="MWE_Sideset")
gmsh.option.setNumber("Mesh.MeshSizeMax", 0.1)
gmsh.option.setNumber("Mesh.SaveAll", 1)
gmsh.model.mesh.generate()
gmsh.write("MWE.msh")
MOOSE input file mesh block
[Mesh]
  [mesh]
    type = FileMeshGenerator
    file = 'MWE.msh'
  []
  #   [sideset2]
  #     type = SideSetsFromNormalsGenerator
  #     input = mesh
  #     normals = '1 0 0'
  #     new_boundary = 'MWE_Sideset2'
  #   []
  #   [sideset3]
  #     type = ParsedGenerateSideset
  #     input = mesh
  #     combinatorial_geometry = 'x = 0 & z = 0'
  #     new_sideset_name = 'MWE_Sideset3'
  #   []
[]
@lindsayad
Copy link
Member Author

I wish I could transfer this issue to another organization 😦

@GiudGiud GiudGiud added C: libMesh C: Meshing MeshGenerator system, mesh loading labels Jun 10, 2023
@roystgnr
Copy link
Contributor

I can reproduce this, and with a pure libMesh code; the problem's got to be at that level. The get_boundary_info().add_side code in gmsh_io.C looks utterly straight-forward, but I'll get in there in gdb and see if I can figure out what's going on.

@roystgnr
Copy link
Contributor

I'm horribly confused by this. When I ncdump the output exodus file, I see that all the sideset entries are on side 3. When I look at the corresponding triangles, they're numbered counter-clockwise with "lower right node", "upper node", "lower left node" ordering. When I look at the ExodusII docs, they agree with libMesh convention (except for the 1-based vs 0-based counting), so side 3 should be between those lower nodes. So the file looks perfectly correct. But Paraview is showing me the same jaggies it's showing you.

@roystgnr
Copy link
Contributor

Yeah, this looks like a paraview bug to me. I took the upper layer out of the python script, to output a MWE_flat.e. I did ncdump MWE_flat.e > MWE_flat.ncdump; cp MWE_flat.ncdump MWE_flat_moved.ncdump. I edited num_dim = 3 and added coordz to the latter (setting it equal to coord y, so the output would still be planar but no longer XY). I did ncgen -o MWE_flat_moved.e < MWE_flat_moved.ncdump ... and whereas paraview MWE_flat.e has the sidesets perfectly correct, paraview MWE_flat_moved.e has the jaggies.

I wish I could transfer this issue to another organization

After your third wish can I have the lamp?

@roystgnr
Copy link
Contributor

Linking #24630 (reply in thread) so it doesn't get missed from this side of things.

We don't have a problem with gmsh 2.5D input; we have a problem with ExodusII 2.5D output. "The same mesh visualizes differently in Paraview when you just change num_dim from 2 to 3" would be pretty damning ... except that the definition of ExodusII triangle data changes when you just change num_dim from 2 to 3 ( https://sandialabs.github.io/seacas-docs/html/element_types.html#tri ), and we need to change our definitions accordingly.

@roystgnr roystgnr changed the title "Zigzagging" side sets in gmsh 2.5D meshes "Zigzagging" side sets in ExodusII 2.5D mesh output Jun 29, 2023
roystgnr added a commit to roystgnr/moose that referenced this issue Aug 23, 2023
The fix for idaholab#24631 is in libMesh/libmesh#3601, but that also introduces
a fix to our Nemesis output that exodiff recognizes as a difference from
the gold files.  Let's disable the affected tests, then we can get a
libMesh submodule update once the fix is merge and reenable the tests.
roystgnr added a commit to roystgnr/moose that referenced this issue Aug 24, 2023
The fix for idaholab#24631 is in libMesh/libmesh#3601, but that also introduces
a fix to our Nemesis output that exodiff recognizes as a difference from
the gold files.  Let's disable the affected tests, then we can get a
libMesh submodule update once the fix is merge and reenable the tests.
roystgnr added a commit to roystgnr/moose that referenced this issue Aug 29, 2023
I got the framework tests in idaholab#25290, but missed the modules tests.

Refs idaholab#24631 and libMesh/libmesh#3601
roystgnr added a commit to roystgnr/moose that referenced this issue Sep 6, 2023
- NetCDF upgrade to 4.9.2, now incorporating NetCDF via a git submodule
- p-refinement can now be selectively disabled and reenabled on a
  per-variable-group basis
- New error indicator for Empirical Interpolation Method (EIM)
  reduced-basis approximations
- `Elem::quality(ASPECT_RATIO)` is now defined for all element types
- Added option to use absolute instead of relative tolerances in
  linear solvers
- Added the capability to "upgrade" a vector's ghosting and/or
  projection settings in subsequent `System::add_vector()` calls
- Added `MeshRefinement::allow_unrefined_patches()` option
- Refactored iterator declarations and added more range methods in
  `MeshBase`: every filtered iterator that could be previously
  accessed with a `...begin()` and `...end()` method now also has a
  `...range()` method suitable for range-based for loops
- Better PETSc versioning macros for use with pre-release PETSc
  commits
- Build system now sets `CFLAGS_OPT`, etc. environment variables, not
  just `CXXFLAGS` and `CPPFLAGS` versions
- Many more unit tests for ExodusII I/O and for element refinement
  APIs
- Assorted fixes
  - Fixed Exodus I/O of side sets on 2D triangles embedded in 3D
    space
  - Fixed Nemesis dimension variable output
  - Fixed Nedelec one `FE` compatibility with `Tri7` and `Tet14`
    geometric elements
  - Fixed multiple issues with mesh refinement on meshes with certain
    types of infinite elements
  - Fixed no-parameters case and improved print statements in EIM code
  - Fixed typos in code comments
  - Minor fixes in vector FE example programs
- Assorted optimizations
  - an unnecessary pointer-indirection layer has been removed from
    `DiffContext`
  - local matrix allocation in `DiffContext` objects is now optional
  - minor optimizations have been made to Hilbert-curve global
    indexing calculations

Refs #0

Refs idaholab#25290 - we'll want to reenable those tests with new golds after
this is safely in.

Fixes idaholab#24631

Fixes idaholab#25007 in my tests
roystgnr added a commit to milljm/moose that referenced this issue Sep 6, 2023
- NetCDF upgrade to 4.9.2, now incorporating NetCDF via a git
  submodule
- p-refinement can now be selectively disabled and reenabled on a
  per-variable-group basis
- New error indicator for Empirical Interpolation Method (EIM)
  reduced-basis approximations
- `Elem::quality(ASPECT_RATIO)` is now defined for all element types
- Added option to use absolute instead of relative tolerances in
  linear solvers
- Added the capability to "upgrade" a vector's ghosting and/or
  projection settings in subsequent `System::add_vector()` calls
- Added `MeshRefinement::allow_unrefined_patches()` option
- Refactored iterator declarations and added more range methods in
  `MeshBase`: every filtered iterator that could be previously
  accessed with a `...begin()` and `...end()` method now also has a
  `...range()` method suitable for range-based for loops
- Better PETSc versioning macros for use with pre-release PETSc
  commits
- Build system now sets `CFLAGS_OPT`, etc. environment variables,
  not just `CXXFLAGS` and `CPPFLAGS` versions
- Many more unit tests for ExodusII I/O and for element refinement
  APIs
- Assorted fixes
  - Fixed Exodus I/O of side sets on 2D triangles embedded in 3D
    space
  - Fixed Nemesis dimension variable output
  - Fixed Nedelec one `FE` compatibility with `Tri7` and `Tet14`
    geometric elements
  - Fixed multiple issues with mesh refinement on meshes with
    certain types of infinite elements
  - Fixed no-parameters case and improved print statements in EIM
    code
  - Fixed typos in code comments
  - Minor fixes in vector FE example programs
- Assorted optimizations
  - An unnecessary pointer-indirection layer has been removed from
    `DiffContext`
  - Local matrix allocation in `DiffContext` objects is now optional
  - Minor optimizations have been made to Hilbert-curve global
    indexing calculations

Refs #0

Refs idaholab#25290 - we'll want to reenable those tests with new golds after
this is safely in.

This fixes idaholab#24631

This fixes idaholab#25007 in my tests
oanaoana pushed a commit to oanaoana/moose that referenced this issue Oct 19, 2023
The fix for idaholab#24631 is in libMesh/libmesh#3601, but that also introduces
a fix to our Nemesis output that exodiff recognizes as a difference from
the gold files.  Let's disable the affected tests, then we can get a
libMesh submodule update once the fix is merge and reenable the tests.
oanaoana pushed a commit to oanaoana/moose that referenced this issue Oct 19, 2023
I got the framework tests in idaholab#25290, but missed the modules tests.

Refs idaholab#24631 and libMesh/libmesh#3601
oanaoana pushed a commit to oanaoana/moose that referenced this issue Oct 19, 2023
- NetCDF upgrade to 4.9.2, now incorporating NetCDF via a git
  submodule
- p-refinement can now be selectively disabled and reenabled on a
  per-variable-group basis
- New error indicator for Empirical Interpolation Method (EIM)
  reduced-basis approximations
- `Elem::quality(ASPECT_RATIO)` is now defined for all element types
- Added option to use absolute instead of relative tolerances in
  linear solvers
- Added the capability to "upgrade" a vector's ghosting and/or
  projection settings in subsequent `System::add_vector()` calls
- Added `MeshRefinement::allow_unrefined_patches()` option
- Refactored iterator declarations and added more range methods in
  `MeshBase`: every filtered iterator that could be previously
  accessed with a `...begin()` and `...end()` method now also has a
  `...range()` method suitable for range-based for loops
- Better PETSc versioning macros for use with pre-release PETSc
  commits
- Build system now sets `CFLAGS_OPT`, etc. environment variables,
  not just `CXXFLAGS` and `CPPFLAGS` versions
- Many more unit tests for ExodusII I/O and for element refinement
  APIs
- Assorted fixes
  - Fixed Exodus I/O of side sets on 2D triangles embedded in 3D
    space
  - Fixed Nemesis dimension variable output
  - Fixed Nedelec one `FE` compatibility with `Tri7` and `Tet14`
    geometric elements
  - Fixed multiple issues with mesh refinement on meshes with
    certain types of infinite elements
  - Fixed no-parameters case and improved print statements in EIM
    code
  - Fixed typos in code comments
  - Minor fixes in vector FE example programs
- Assorted optimizations
  - An unnecessary pointer-indirection layer has been removed from
    `DiffContext`
  - Local matrix allocation in `DiffContext` objects is now optional
  - Minor optimizations have been made to Hilbert-curve global
    indexing calculations

Refs #0

Refs idaholab#25290 - we'll want to reenable those tests with new golds after
this is safely in.

This fixes idaholab#24631

This fixes idaholab#25007 in my tests
oanaoana pushed a commit to oanaoana/moose that referenced this issue Nov 7, 2023
- NetCDF upgrade to 4.9.2, now incorporating NetCDF via a git
  submodule
- p-refinement can now be selectively disabled and reenabled on a
  per-variable-group basis
- New error indicator for Empirical Interpolation Method (EIM)
  reduced-basis approximations
- `Elem::quality(ASPECT_RATIO)` is now defined for all element types
- Added option to use absolute instead of relative tolerances in
  linear solvers
- Added the capability to "upgrade" a vector's ghosting and/or
  projection settings in subsequent `System::add_vector()` calls
- Added `MeshRefinement::allow_unrefined_patches()` option
- Refactored iterator declarations and added more range methods in
  `MeshBase`: every filtered iterator that could be previously
  accessed with a `...begin()` and `...end()` method now also has a
  `...range()` method suitable for range-based for loops
- Better PETSc versioning macros for use with pre-release PETSc
  commits
- Build system now sets `CFLAGS_OPT`, etc. environment variables,
  not just `CXXFLAGS` and `CPPFLAGS` versions
- Many more unit tests for ExodusII I/O and for element refinement
  APIs
- Assorted fixes
  - Fixed Exodus I/O of side sets on 2D triangles embedded in 3D
    space
  - Fixed Nemesis dimension variable output
  - Fixed Nedelec one `FE` compatibility with `Tri7` and `Tet14`
    geometric elements
  - Fixed multiple issues with mesh refinement on meshes with
    certain types of infinite elements
  - Fixed no-parameters case and improved print statements in EIM
    code
  - Fixed typos in code comments
  - Minor fixes in vector FE example programs
- Assorted optimizations
  - An unnecessary pointer-indirection layer has been removed from
    `DiffContext`
  - Local matrix allocation in `DiffContext` objects is now optional
  - Minor optimizations have been made to Hilbert-curve global
    indexing calculations

Refs #0

Refs idaholab#25290 - we'll want to reenable those tests with new golds after
this is safely in.

This fixes idaholab#24631

This fixes idaholab#25007 in my tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: libMesh C: Meshing MeshGenerator system, mesh loading
Projects
None yet
3 participants