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

Add MeshContainer.as_vertex_mesh() and Field.from_mesh_container() #940

Merged
merged 12 commits into from
Feb 16, 2025

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Feb 15, 2025

This PR adds a method to merge a mesh container into a vertex mesh. This can be used as a top-level mesh when dealing with multiple solid bodies with different element types. This is only useful if the mesh-container has been created with merge=True.

closes #937

import felupe as fem

container = fem.MeshContainer([fem.Rectangle()], merge=True)
mesh = container.as_vertex_mesh()
region = fem.RegionVertex(mesh)
field = fem.Field(region, dim=2).as_container()  # this is the top-level field

A more high-level approach is also available.

import felupe as fem

container = fem.MeshContainer([fem.Rectangle()], merge=True)
field = fem.Field.from_mesh_container(container).as_container()  # this is the top-level field

Further work for mixed-field solid-bodies is required. No, this works by adding the additional fields to the field container.

@adtzlr adtzlr added the enhancement New feature or request label Feb 15, 2025
@adtzlr adtzlr self-assigned this Feb 15, 2025
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.20%. Comparing base (46b5093) to head (f223443).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #940      +/-   ##
==========================================
+ Coverage   97.19%   97.20%   +0.01%     
==========================================
  Files         181      182       +1     
  Lines        6524     6553      +29     
==========================================
+ Hits         6341     6370      +29     
  Misses        183      183              

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

@adtzlr adtzlr changed the title Add MeshContainer.as_vertex_mesh() Add MeshContainer.as_vertex_mesh() and Field.from_mesh_container() Feb 16, 2025
@adtzlr adtzlr merged commit f061729 into main Feb 16, 2025
5 checks passed
@adtzlr adtzlr deleted the add-container-as-vertex-mesh branch February 16, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top-level Field for multiple solid bodies
1 participant