Skip to content

perebalazs/LowLevelFEM.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

481 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov License: MIT

LowLevelFEM

LowLevelFEM is a Julia package for finite element analysis with an engineering-first workflow, designed to assemble finite element operators explicitly at matrix and field level.
It exposes each phase of the workflow as simple functions (mesh → matrices → loads/BCs → solve → postprocess → visualize), so you can customize, combine, or inspect any step at matrix and field level.
Typical tasks such as strain energy or resultants are one-liners (for example, U = q' * K * q / 2). The package is suitable not only for classical structural mechanics problems, but also for assembling general linear PDEs expressed in weak form.

Requirements

  • Julia 1.x
  • Gmsh C API is bundled via gmsh_jll and re-exported as gmsh from this package; no separate Gmsh.jl installation is required.

Capabilities

  • Geometry and meshing: integrates with gmsh for 2D/3D geometry, meshing, and physical groups.
  • Problem types: 3D solids, 2D plane stress/plane strain, axisymmetric; 3D/2D heat conduction and axisymmetric heat conduction.
  • Elements and order: standard line/triangle/quad/tetra/hex/pyramid/wedge with Lagrange order up to 10.
  • Materials: linear elastic (Hooke) and large deformation laws (St. Venant–Kirchhoff, compressible Neo-Hooke).
  • Matrices: stiffness K, mass M (lumped or consistent), proportional damping C (Rayleigh/Caughey), heat conduction/capacity, latent heat, convection matrices/vectors, and generic Poisson-type operators for scalar and vector fields.
  • Matrix- and field-oriented FEM workflow: global stiffness, mass, damping and coupling matrices, together with scalar, vector and tensor fields, are explicit and user-accessible objects, enabling direct implementation, inspection and modification of PDE operators (including Poisson-type operators) and constitutive laws at matrix and field level.
  • Loads and constraints: nodal and distributed loads on physical groups; function-based loads and temperature BCs; elastic supports; initial displacement/velocity/temperature.
  • Thermal–structural coupling: thermal expansion, thermal stresses, and heat generated by elastic deformation.
  • Solvers: static (direct and iterative solvers with arbitrary preconditioners) and transient dynamics (central difference and HHT-α from the Newmark family).
  • Eigenproblems: modal analysis (frequencies and mode shapes, optionally prestressed) and linear buckling (critical factors and modes).
  • Field operators and results: gradient/divergence/curl; stress/strain and heat flux as element or nodal fields; smoothing at nodes with field jumps; user-defined scalar/vector/tensor FE fields.
  • Visualization and plots: Gmsh-based views for displacements, stresses, strains, heat flux, with animation for dynamics; plot results along user-defined paths; show results on surfaces.
  • Coordinate systems: rotate nodal DOFs with constant or function-defined local coordinate systems (incl. curvilinear).
  • Truss structures (static, transient, modal analysis)
  • Nonlinear solid mechanics (Total Lagrangian formulation) Energy-based hyperelasticity with consistent stress and tangent operators, including geometric stiffness and follower loads for large-deformation problems.

Installation

using Pkg
Pkg.add("LowLevelFEM")

Quick Start

using LowLevelFEM

# `gmsh` is exported by LowLevelFEM
gmsh.initialize()
gmsh.open("your_model.geo")

mat = Material("body", E=2e5, ν=0.3)
prob = Problem([mat], type=:PlaneStress)  # :Solid, :PlaneStrain, :AxiSymmetric, :HeatConduction, ...

bc    = displacementConstraint("supp", ux=0, uy=0)
force = load("load", fy=-1)

u = solveDisplacement(prob, load=[force], support=[bc])
S = solveStress(u)

showDoFResults(u)
showDoFResults(u, :ux)
showStressResults(S)
showStressResults(S, :sxy, name="Shear stress")

openPostProcessor()
gmsh.finalize()

Note: physical group names in your geometry (created in Gmsh) must match the strings used above (e.g., "body", "supp", "load").

An alternative solution (instead of u = ..., S = ...)

K = stiffnessMatrix(prob)
f = loadVector(prob, [force])
u = solveDisplacement(K, f, support=[bc])

E = mat.E
ν = mat.ν

A = (u + u) / 2
I = TensorField(prob, "body", [1 0 0; 0 1 0; 0 0 1])
S = E / (1 + ν) * (A + ν / (1 - 2ν) * trace(A) * I)

More end-to-end examples are available under examples and in the documentation.

Documentation

Planned features

  • Beam, shell elements
  • Contact problems (penalty, Lagrange multiplier)
  • Multithreading (partially implemented)

Any suggestions are welcome. In case of any issue, please send a bug report.

License

This project is licensed under the MIT License — see LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages