-
Notifications
You must be signed in to change notification settings - Fork 86
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!(::ConstraintHandler, ::Dirichlet) for nonconcrete celltypes #427
Conversation
Codecov ReportBase: 92.92% // Head: 92.87% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #427 +/- ##
==========================================
- Coverage 92.92% 92.87% -0.05%
==========================================
Files 27 27
Lines 4111 4127 +16
==========================================
+ Hits 3820 3833 +13
- Misses 291 294 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Add new warning if there is no overlap, but the warning for only partial overlap is silenced
Could you review @kimauth? |
The current version doesn't support the strategy from #459 (comment). |
@@ -43,6 +43,7 @@ SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" | |||
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" | |||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | |||
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" | |||
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test_logs
comes from Test
so I don't think this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, must have missed that when testing (probably tried without using Test
) :)
Will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: It seems actually to be required for min_level=Logging.Warn
src/Dofs/ConstraintHandler.jl
Outdated
if overlaps(fh, dbc) | ||
# If dbc have dofs not in fh, then these will be removed from dbc, hence deepcopy | ||
# In this case, add! will warn, unless warn_check_cellset=false | ||
add!(ch, fh, deepcopy(dbc), warn_check_cellset=false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I asked @kimauth this some time -- but why is there a need to copy at all? See also
Ferrite.jl/src/Dofs/ConstraintHandler.jl
Line 43 in 70f69dd
return Dirichlet(f, copy(faces), field_name, __to_components(components), Int[], Int[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deepcopy is required due to
Ferrite.jl/src/Dofs/ConstraintHandler.jl
Line 318 in 70f69dd
delete!(dbc.faces, Index(cellidx, faceidx)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But perhaps it would be better to rather recreate the entire Dirichlet like in your link, but perhaps here:
Ferrite.jl/src/Dofs/ConstraintHandler.jl
Line 313 in 70f69dd
# loop over all the faces in the set and add the global dofs to `constrained_dofs` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I don't really understand why this doesn't just skip.
I recently ran to the issue which this PR resolves (I wanted to add a constraint on a surface/faceset which had cells in different fieldhandlers). Looks good to me :) |
This patch cleans up the code under ``` add!(::ConstraintHandler, ::Dirichlet) ``` a bit after the DofHandler merge. In particular, it deprecates the method ``` add!(::ConstraintHandler, ::FieldHandler, ::Dirichlet) ``` in favor of just ``` add!(::ConstraintHandler, ::Dirichlet) ``` which was added in #427. There is no need to be able to specify the constrained set by both the set passed to `Dirichlet` and by the set given to the `FieldHandler`. Looking at the tests modified in this patch, it seems this was never the intention anyway. This patch also removes the copy of the set in the `Dirichlet` constructor in favor of explicit partitioning of the set over the `FieldHandler`s.
This patch cleans up the code for adding `Dirichlet` constraints to the `ConstraintHandler` a bit after the DofHandler merge. In particular, it deprecates the method ``` add!(::ConstraintHandler, ::FieldHandler, ::Dirichlet) ``` in favor of just ``` add!(::ConstraintHandler, ::Dirichlet) ``` which was added in #427. There is no need to be able to specify the constrained set by both the set passed to `Dirichlet` and by the set given to the `FieldHandler`. Looking at the tests modified in this patch, it seems this was never the intention anyway. This patch also removes the copy of the set in the `Dirichlet` constructor in favor of explicit partitioning of the set over the `FieldHandler`s.
This patch cleans up the code for adding `Dirichlet` constraints to the `ConstraintHandler` a bit after the DofHandler merge. In particular, it deprecates the method ``` add!(::ConstraintHandler, ::FieldHandler, ::Dirichlet) ``` in favor of just ``` add!(::ConstraintHandler, ::Dirichlet) ``` which was added in #427. There is no need to be able to specify the constrained set by both the set passed to `Dirichlet` and by the set given to the `FieldHandler`. Looking at the tests modified in this patch, it seems this was never the intention anyway. This patch also removes the copy of the set in the `Dirichlet` constructor in favor of explicit partitioning of the set over the `FieldHandler`s.
This patch cleans up the code for adding `Dirichlet` constraints to the `ConstraintHandler` a bit after the DofHandler merge. In particular, it deprecates the method ``` add!(::ConstraintHandler, ::FieldHandler, ::Dirichlet) ``` in favor of just ``` add!(::ConstraintHandler, ::Dirichlet) ``` which was added in #427. There is no need to be able to specify the constrained set by both the set passed to `Dirichlet` and by the set given to the `FieldHandler`. Looking at the tests modified in this patch, it seems this was never the intention anyway. This patch also removes the copy of the set in the `Dirichlet` constructor in favor of explicit partitioning of the set over the `FieldHandler`s.
Allow the following syntax also for a Dirichlet condition covering nonconcrete celltypes
add!(ch, dbc)
Before, this had to be done for each fieldhandler in
ch::ConstraintHandler
with a uniquedbc::Dirichlet
for each fieldhandler.