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

Ferrite.nfields should be called differently #444

Closed
kimauth opened this issue Apr 9, 2022 · 1 comment · Fixed by #653
Closed

Ferrite.nfields should be called differently #444

kimauth opened this issue Apr 9, 2022 · 1 comment · Fixed by #653

Comments

@kimauth
Copy link
Member

kimauth commented Apr 9, 2022

grid = generate_grid(Quadrilateral, (1,1))
dh = DofHandler(grid)
push!(dh, :u, 2)
close!(dh)
julia> nfields(dh)
9

julia> Ferrite.nfields(dh)
1

The first one calls Julias nfields.

@termi-official
Copy link
Member

Addressed in #486 because it has been an issue several times.

fredrikekre pushed a commit that referenced this issue Apr 1, 2023
This patch deprecates the internal function `nfields(dh)` in favor of
`length(getfieldnames(dh))`. The reason is twofold: `nfields` where
barely used, not even internally, and `nfields` was easy to confuse with
the existing `Base.nfields` function that would still work, but behave
quite differently.

Closes #444.
fredrikekre pushed a commit that referenced this issue Apr 1, 2023
This patch deprecates the internal function `nfields(dh)` in favor of
`length(getfieldnames(dh))`. The reason is twofold: `nfields` where
barely used, not even internally, and `nfields` was easy to confuse with
the existing `Base.nfields` function that would still work, but behave
quite differently.

Closes #444.
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 a pull request may close this issue.

2 participants