behavior of basis.get_dofs() without arguments #785
Replies: 2 comments
-
Moving to discussions. Personally I use get_dofs most of the time without arguments so the default behavior is very important in my daily work. |
Beta Was this translation helpful? Give feedback.
-
Once upon a time there was no way to easily find degrees-of-freedom indices without looking at Basis.{nodal,facet,edge,interior}_dofs. To simplify things, we invented get_dofs which returned DOFs given some facet indices. The most common use case for the DOF indices was setting boundary conditions. Moreover, the most common boundary condition for testing and setting things up was to constrain all boundary DOFs. Hence, get_dofs returns all boundary DOFs when no arguments are given. I see the existence of get_dofs as a convenience. Everything it does is fairly trivial and can be done by directly accessing Basis.*_dofs. (Except facet->edge expansion for 3D meshes which was later moved to Mesh.) However, it definitely saves some key presses and increasingly so after the recent improvements. |
Beta Was this translation helpful? Give feedback.
-
Current behavior of
basis.get_dofs()
seems to return the boundary of the mesh. But now that we've added thefacets
andelements
keywords it seems counter-intuitive... like, either it should return nothing or everything or maybe raise an exception. Is there a good argument for a default filter?We've ad hoc added some functionality to
get_dofs()
and I think its going a good direction but it also seems like an important enough function that continuing this organic growth might be a bad idea.Beta Was this translation helpful? Give feedback.
All reactions