Skip to content

support for quad mesh in .inp files#116

Open
marinlauber wants to merge 2 commits intoJuliaIO:masterfrom
marinlauber:inp_mesh
Open

support for quad mesh in .inp files#116
marinlauber wants to merge 2 commits intoJuliaIO:masterfrom
marinlauber:inp_mesh

Conversation

@marinlauber
Copy link
Copy Markdown
Contributor

This PR adds the capability to load .inp meshes defined using quadrilateral elements.

This is achieved by replacing the hardcoded GLTriangleFace with an NgonFace that generates the correct face dimension.

The code still works for the classical triangular .inp mesh.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.25%. Comparing base (202463d) to head (f306e91).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #116   +/-   ##
=======================================
  Coverage   79.25%   79.25%           
=======================================
  Files          11       11           
  Lines         829      829           
=======================================
  Hits          657      657           
  Misses        172      172           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/io/inp.jl Outdated
nodes = parse.(Int,split(line,",")[2:end])
push!(faces, TriangleFace{Int}(facetype([findfirst(==(node),node_idx) for node in nodes])...)) # parse the face
face_nodes = [findfirst(==(node),node_idx) for node in nodes]
push!(faces, NgonFace{length(face_nodes),Int}(face_nodes...)) # parse the face
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this means faces is now not concretely typed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ahh true! Actually, I can use

push!(faces, facetype([findfirst(==(node),node_idx) for node in nodes]...)) # parse the face

with facetype = GLTriangleFace or facetype = Quads{Int} when required and it works.

@SimonDanisch
Copy link
Copy Markdown
Member

I think it would be nice to default to the face type the file gives, but maybe that should be a larger refactor where we do it for all types, and leave it like this for now?

@marinlauber
Copy link
Copy Markdown
Contributor Author

@SimonDanisch

Thanks for the feedback. It shouldn't be too hard to do, I'll think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants