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

getcellset(::SubDofHandler) #809

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

getcellset(::SubDofHandler) #809

wants to merge 1 commit into from

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Oct 3, 2023

Since we already have a function for getting the cellset from the grid,
I find it logical to also provide getcellset(::SubDofHandler), such that users
don't have to use direct field-access to obtain the SubDofHandler's cellset.

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (32fbd6b) 92.77% compared to head (d5d0952) 92.77%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #809   +/-   ##
=======================================
  Coverage   92.77%   92.77%           
=======================================
  Files          33       33           
  Lines        4952     4953    +1     
=======================================
+ Hits         4594     4595    +1     
  Misses        358      358           
Files Coverage Δ
ext/FerriteMetis.jl 100.00% <100.00%> (ø)
src/Dofs/ConstraintHandler.jl 95.98% <100.00%> (ø)
src/Dofs/DofHandler.jl 95.10% <100.00%> (+0.01%) ⬆️
src/Dofs/DofRenumbering.jl 91.30% <100.00%> (ø)
src/Dofs/apply_analytical.jl 100.00% <100.00%> (ø)
src/Dofs/sparsity_pattern.jl 100.00% <100.00%> (ø)
src/PointEval/PointEvalHandler.jl 92.81% <100.00%> (ø)
src/iterators.jl 94.69% <100.00%> (ø)

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

@kimauth
Copy link
Member

kimauth commented Oct 3, 2023

Any particular reason why you don't want to access the field itself? Since we don't have a "subdofhandler interface" I don't really see why this is problematic.
In case it's just because the field is technically internal, we could alternatively document that SubDofHandler has a cellset field, I don't think this is likely to change (similar to how the fields of CellCache are documented).

@KnutAM
Copy link
Member Author

KnutAM commented Oct 3, 2023

Documenting the field is also an option.

I find that an access function for use outside Ferrite.jl is more user-friendly, e.g. when writing an assembly loop for one subdofhandler. And since we already have that function, I find such a dispatch logical. But for sure this is just a matter of taste.

@termi-official
Copy link
Member

This is a thing I would really like to discuss at FerriteCon, because not having an interface here causes some trouble downstream.

@termi-official
Copy link
Member

The name suggests that a set is returned. Do we want to enforce this? I played a bit around with using ranges instead of sets in #625 which might be an efficient alternative for the case that subdofhandlers model physical subdomains.

@KnutAM
Copy link
Member Author

KnutAM commented Sep 27, 2024

@fredrikekre suggested on slack that we could potentially support both

  • getcells(::SubDofHandler) -> Vector{Int}
  • getcellset(::SubDofHandler) -> OrderedSet{Int}

Will be new feature, so to be done after 1.0

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.

4 participants