Files
JuliaFEM.jl/examples/generate_stiffness_matrices.jl
T
Jukka Aho 07adb1c588 Improve documentation (#199)
Let's use Literate.jl to automatically generate usage examples.

* Automatically generate documentation from other packages (first try to include each package's docs/src/index.md, but if that fails, then use README.md to introduce the package).
* Add example how to calculate local element matrices.
* Add example how to perform 2d contact analysis.
2018-05-30 11:52:01 +03:00

20 lines
663 B
Julia

# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
# # Generating local matrices for problems
using JuliaFEM
# Plane stress Quad4 element with linear material model:
X = Dict(1 => [0.0, 0.0], 2 => [2.0, 0.0], 3 => [2.0, 2.0], 4 => [0.0, 2.0])
element = Element(Quad4, [1, 2, 3, 4])
update!(element, "geometry", X)
update!(element, "youngs modulus", 288.0)
update!(element, "poissons ratio", 1/3)
problem = Problem(Elasticity, "test problem", 2)
problem.properties.formulation = :plane_stress
add_elements!(problem, [element])
assemble!(problem, 0.0)
K = round.(full(problem.assembly.K), 5)