-
Notifications
You must be signed in to change notification settings - Fork 89
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
FaceCache and FaceIterator #495
Conversation
Some questions on this.
|
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #495 +/- ##
==========================================
+ Coverage 91.63% 92.74% +1.11%
==========================================
Files 32 28 -4
Lines 4650 4232 -418
==========================================
- Hits 4261 3925 -336
+ Misses 389 307 -82
☔ View full report in Codecov by Sentry. |
This iterator iterates over a given
Yes, wrt. each
I think this just follows from what a
I think the iterator would work fine, but I think we would have a problem with the facevalues then, |
Thanks for the quick reply Knut!
As a note here, this approach will just work if we have conforming elements with the constraint that faces match 1:1.
I also think so. I think we should still handle this case in the tests, either by checking that this errors out of it it handles the "faces of embedded elements" correctly.
I tried to implement such elements several times and always hit a dead end. I think it makes sense to merge the dof handlers first and then introduce such elements. Still, we should make the error message clear for future reference. |
Maybe this is also a good PR in which we can explore possibilities to define actual faces. |
To have the possibility of defining a face as a separate entity, not connected to one specific cell for each face, would indeed be very nice. However, I would say that should be a separate PR, as that requires something completely different. This PR basically makes the following code a bit easier (and a bit more general, including resizing thanks to #546) c_coords = getcoordinates(grid, 1)
c_dofs = celldofs(dh, 1)
c_nodes = collect(getcells(grid, 1).nodes)
for face in getfaceset(grid, "right")
getcoordinates!(c_coords, grid, face[1])
celldofs!(c_dofs, dh, face[1])
Ferrite.cellnodes!(c_nodes, grid, face[1])
reinit!(facevalues, c_coords, face[2])
end |
Do you have a specific case in mind? When you mean embedded elements, you mean elements of different geometric dimensionality right? In that case, the error will arise if trying to
I'm not sure how to do that without introducing extra features, e.g. a trait for the celltype if the faces are mixed. Seems like that should be considered when such an element is added? |
I understand the PR and like the design. I think it is really a big improvement over the design of the previous PR and closer to the how Ferrite is designed in general. I am just a bit concerned about adding features which may change drastically in the near future. But I agree, that defining faces is a related, but separate issue.
Sorry, I forgot reinit fails already (which should not, because the mapping is well-defined). |
Thanks for the feedback!
Yes, sorry, didn't mean to overexplain! That's a fair point, but I think that changing the definition of a
OK, then I'll remove that todo for now and see what Fredrik says for the overall details first. |
This patch implements `FaceCache` and `FaceIterator`, which, analoguous to `CellCache` and `CellIterator`, simplifies iteration over a face set for e.g. boundary integral evaluation. Co-authored-by: Fredrik Ekre <[email protected]> Co-authored-by: Knut Andreas Meyer <[email protected]>
258eaec
to
b0e2400
Compare
Ref #468
Edit after discussion with @fredrikekre :