kinnala / scikit-fem

Simple finite element assemblers
https://scikit-fem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
512 stars 81 forks source link

Add Dofs.get_element_dofs #427

Closed kinnala closed 4 years ago

kinnala commented 4 years ago

This was a feature request from @ahhuhtal . The use case would be to figure out what degrees-of-freedom correspond to a named subdomain.

gdmcbain commented 4 years ago

Like in the example of the insulated wire?

https://github.com/kinnala/scikit-fem/blob/9c485745018a915ae683295a011f910228741352/docs/examples/ex26.py#L38

kinnala commented 4 years ago

Yeah, I see your point: why have a separate function if it can be done in one line?

Well, in principle, get_element_dofs could work also with function handles and so on. But the real reason for introducing Dofs objects was to have a single place for different methods that fetch DOF's. So maybe instead of making new multitype methods, we simply add multiple methods to Dofs? Such as

and so on.