Ferrite-FEM / Ferrite-FEM/Ferrite.jl
Nodal reordering of dofs
- Dominant language
- Julia
- Stars
- 453
- Forks
- 115
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 11
Description
Users often seem to want to have the ability that the node numbering and dof numbering coincides. We might want to consider providing a helper routine for this.
Prototype:
```julia
function reorder_nodal!(dh::DofHandler)
@assert length(dh.field_names) == 1 "Just single field possible."
grid = Ferrite.get_grid(dh)
for sdh in dh.subdofhandlers
firstcellidx = first(sdh.cellset)
celltype = typeof(getcells(grid,firstcellidx))
@assert sdh.field_interpolations[1] == Ferrite.default_interpolation(celltype)
for i ∈ 1:getncells(grid)
dh.cell_dofs[dh.cell_dofs_offset[i]:(dh.cell_dofs_offset[i]+Ferrite.ndofs_per_cell(dh, i)-1)] .= getcells(grid,i).nodes
end
end
end
```
Contributor guide
Assessment
This issue has not been assessed yet.