diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a04b0d77..0194b6c320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Internal changes - `Ferrite.ndim(dh, fieldname)` has been removed, use `Ferrite.getfielddim(dh, fieldname)` instead. ([#658][github-658]) + - `getfielddims(::FieldHandler)` and `getfieldinterpolations(::FieldHandler)` removed ([#647][github-647]) (Note that `getfieldnames(::FieldHandler)` was re-introduced in [#659][github-659]) ## [0.3.13] - 2023-03-23 ### Added @@ -385,6 +386,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [github-645]: https://github.com/Ferrite-FEM/Ferrite.jl/pull/645 [github-650]: https://github.com/Ferrite-FEM/Ferrite.jl/pull/650 [github-658]: https://github.com/Ferrite-FEM/Ferrite.jl/pull/658 +[github-647]: https://github.com/Ferrite-FEM/Ferrite.jl/pull/647 +[github-659]: https://github.com/Ferrite-FEM/Ferrite.jl/pull/659 [Unreleased]: https://github.com/Ferrite-FEM/Ferrite.jl/compare/v0.3.13...HEAD [0.3.13]: https://github.com/Ferrite-FEM/Ferrite.jl/compare/v0.3.12...v0.3.13 diff --git a/src/Dofs/MixedDofHandler.jl b/src/Dofs/MixedDofHandler.jl index 50387a79fc..0d0d2b760a 100644 --- a/src/Dofs/MixedDofHandler.jl +++ b/src/Dofs/MixedDofHandler.jl @@ -134,11 +134,13 @@ end """ getfieldnames(dh::MixedDofHandler) + getfieldnames(fh::FieldHandler) Return a vector with the names of all fields. Can be used as an iterable over all the fields in the problem. """ getfieldnames(dh::MixedDofHandler) = dh.field_names +getfieldnames(fh::FieldHandler) = [field.name for field in fh.fields] getfielddim(fh::FieldHandler, field_idx::Int) = fh.fields[field_idx].dim getfielddim(fh::FieldHandler, field_name::Symbol) = getfielddim(fh, find_field(fh, field_name)) diff --git a/test/test_mixeddofhandler.jl b/test/test_mixeddofhandler.jl index 20c3f69b46..7b20e60a23 100644 --- a/test/test_mixeddofhandler.jl +++ b/test/test_mixeddofhandler.jl @@ -114,6 +114,8 @@ function test_2d_mixed_1_el() @test ndofs(dh) == 12 @test ndofs_per_cell(dh, 1) == 12 @test celldofs(dh, 1) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + + @test Set(Ferrite.getfieldnames(dh)) == Set(Ferrite.getfieldnames(dh.fieldhandlers[1])) end function test_2d_mixed_2_el()