HetaoZ / LEFEM.jl

Linear elastic FEM library, easy to learn and use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LEFEM

Stable Dev Build Status Coverage

An easy-to-learn package for linear elastic dynamic FEM.

Install

] add https://github.com/HetaoZ/LEFEM.jl.git

Usage

This is an example:

# read model
s = read_model("Tri3", "pstrain", "in/rect2d.msh", "in/test_mat.para")

# constrain
cons_dof!(s, [1,3,5,7], [0.2,-0.2,-0.1,0.1])

# review the model info
review(s)

# set solution parameters
maxtime  = 1
maxframe = 1
cutframe = 1

t = 0
frame = 0

println(frame, "      ",t)
save_to_vtk(s, ["mydisp"], [:d], "out/disp_"*string(frame))

# run the solver
while frame <= maxframe && t <= maxtime
    dt = 0.1
    advance!(s, dt, "explicit")

    global t += dt
    global frame += 1

    if frame%cutframe == 0
        println(frame, "      ",t)
        save_to_vtk(s, ["mydisp"], [:d], "out/disp_"*string(frame))
    end
end

About

Linear elastic FEM library, easy to learn and use

License:Mozilla Public License 2.0


Languages

Language:Julia 97.2%Language:GLSL 2.8%