Files
JuliaFEM.jl/src/basis/lagrange_pyramids.jl
T
Jukka Aho 7b6fcfdaf5 feat: Copy FEMBasis.jl files to src/basis/ (Phase 1 start)
- Create src/basis/ directory structure
- Copy all FEMBasis.jl source files verbatim:
  - abstract.jl: AbstractBasis type definition and interface
  - create_basis.jl: Metaprogramming for basis generation
  - lagrange_*.jl: All Lagrange element bases (Seg, Quad, Tri, Tet, Hex, Wedge, Pyr)
  - nurbs*.jl: NURBS basis functions
  - math.jl: jacobian, grad, interpolate functions
  - subs.jl, vandermonde.jl: Symbolic/mathematical utilities

Strategy: Copy first, integrate later (safest approach)
Next: Integrate into src/JuliaFEM.jl module
2025-11-08 09:02:40 +02:00

43 lines
1.2 KiB
Julia

# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/FEMBasis.jl/blob/master/LICENSE
# Kaltenbacher, Manfred. Numerical simulation of mechatronic sensors and actuators: finite elements for computational multiphysics. Springer, 2015.
code = create_basis_and_eval(
:Pyr5A,
"5 node linear pyramid element",
[
( 1.0, 1.0, 0.0), # N1
( 1.0, -1.0, 0.0), # N2
(-1.0, -1.0, 0.0), # N3
(-1.0, 1.0, 0.0), # N4
( 0.0, 0.0, 1.0), # N5
],
[
:(1/4*( (1+u)*(1+v) - w + u*v*w/(1-w) )),
:(1/4*( (1+u)*(1-v) - w + u*v*w/(1-w) )),
:(1/4*( (1-u)*(1-v) - w + u*v*w/(1-w) )),
:(1/4*( (1-u)*(1+v) - w + u*v*w/(1-w) )),
:(1.0*w),
],
)
# source: Code Aster documentation?
code = create_basis_and_eval(
:Pyr5,
"5 node linear pyramid element",
[
(-1.0, -1.0, -1.0), # N1
( 1.0, -1.0, -1.0), # N2
( 1.0, 1.0, -1.0), # N3
(-1.0, 1.0, -1.0), # N4
( 0.0, 0.0, 1.0), # N5
],
[
:(1/8 * (1-u) * (1-v) * (1-w)),
:(1/8 * (1+u) * (1-v) * (1-w)),
:(1/8 * (1+u) * (1+v) * (1-w)),
:(1/8 * (1-u) * (1+v) * (1-w)),
:(1/2 * (1+w)),
],
)