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

Raise a TypeError if a container is used in a region #939

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Feb 15, 2025

This closes #938. Hopefully useful for things like #936.

Example

>>> import felupe as fem
>>> 
>>> mesh_container = fem.MeshContainer([fem.Rectangle()])
>>> element = fem.Quad()
>>> quadrature = fem.GaussLegendre(order=1, dim=2)
>>> region = fem.Region(mesh_container, element, quadrature)
TypeError: A mesh container is not supported by a region, use a mesh instead.

Hopefully this is clear enough to change it to:

>>> import felupe as fem
>>> 
>>> mesh_container = fem.MeshContainer([fem.Rectangle()])
>>> mesh = mesh_container[0]
>>> element = fem.Quad()
>>> quadrature = fem.GaussLegendre(order=1, dim=2)
>>> region = fem.Region(mesh, element, quadrature)

@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.19%. Comparing base (0b3a637) to head (2efe19a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #939   +/-   ##
=======================================
  Coverage   97.18%   97.19%           
=======================================
  Files         181      181           
  Lines        6510     6524   +14     
=======================================
+ Hits         6327     6341   +14     
  Misses        183      183           

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

@adtzlr adtzlr merged commit 46b5093 into main Feb 15, 2025
5 checks passed
@adtzlr adtzlr deleted the throw-error-region-container branch February 15, 2025 22:08
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.

Throw error if one wants to create a region on a container.
1 participant