Skip to content

[WIP] Implement new type for more flexible mapping of degrees of freedom #25

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
initial implementation of dofmap type
  • Loading branch information
ahojukka5 committed Jun 20, 2018
commit c229eab41b29c1a4a09878faca646dea8f3deac9
2 changes: 2 additions & 0 deletions src/FEMBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ include("integrate.jl")
include("problems.jl")
export set_gdofs!, get_gdofs, get_formulation_type

include("dofmap.jl")

include("assembly.jl")
export assemble_prehook!, assemble_posthook!, assemble_elements!

Expand Down
24 changes: 24 additions & 0 deletions src/dofmap.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/FEMBase.jl/blob/master/LICENSE

"""
DOFMap

This type makes conversions between node id/dof pair and global dofs of freedom.

In the simplest case, each node has same number of degrees of freedom and nodes
starts from 1. For example, given continuum mechanics model having three
displacement degrees of freedom per dof, we have (u_11, u_12, u_13, u_21, u_22,
u_23, ..., u_N1, u_N2, u_N3), where in general u_ij maps to row 3*(i-1)+j in
matrix assembly level. `DOFMap` also supports variable number of degrees of
freedom per node, so some nodes can have, for instance, temperature dofs or
rotation dofs.
"""
type DOFMap
map :: Dict{Int64, Dict{Symbol, Int64}}
local_dof_indices :: Dict{Symbol, Int64}
end

function DOFMap()
return DOFMap(Dict(), Dict())
end