Utility functions

FerriteShells.shell_gridFunction
shell_grid(grid::Grid{2,P,T}; map::Function) where {P<:Union{Triangle,Quadrilateral,QuadraticTriangle,QuadraticQuadrilateral},T}

Embed the 2D grid into 3D space by applying the mapping map to the nodes (default: flat z=0` plane).

For example, the hyperbolic paraboloid shell can be generated in two lines

# domain ω ∈ ]-1/2; 1/2[ and 3D grid
grid2D = generate_grid(Quadrilateral, (20, 20), Vec(-0.5, -0.5), Vec(0.5, 0.5))
grid3D = shell_grid(grid2D; map=(n)->(n.x[1], n.x[2], n.x[1]^2 - n.x[2]^2))
source
FerriteShells.shelldofsFunction
shelldofs(cell)

Reorder DOFs from a two-field DofHandler layout (:u as ip³, as ip²) to the interleaved 5-DOF-per-node layout expected by the RM assembly functions.

Input layout: $[u_{1x},u_{1y},u_{1z},\, u_{2x},\ldots,u_{nz} \mid \theta_{1,1},\theta_{1,2},\, \theta_{2,1},\ldots,\theta_{n,2}]$

Output layout: $[u_{1x},u_{1y},u_{1z},\theta_{1,1},\theta_{1,2},\; u_{2x},u_{2y},u_{2z},\theta_{2,1},\theta_{2,2},\ldots]$

source
FerriteShells.compute_volumeFunction
compute_volume(dh, scv, u; cellset, h, b)

Computes the volume of a shell in the configuration u. The default behavior is to use all the cellset attached to the DofHandler. By passing unions of cellsets, you can tailor the volume computation to specific regions of the shell.

The vectors $h$ and $b$ define the reference and base positions, respectively. These can be used for open shells to remove contribution to the volume. For example, an inflated membrane on the x-y plane with +z deformation would be measured as

vol = compute_volume(dh, scv, u; h=Vec((0.0,0.0,1.0)), b=Vec((0.0,0.0,0.0)))
source
FerriteShells.director_fieldFunction
director_field(dh, scv, u) -> (d, G3)

Compute per-node deformed director d and reference shell normal G3 from the displacement/rotation solution u. Both are returned as 3 × n_nodes matrices.

Each nodal value is the element-average of the QP-level frame vectors, accumulated and averaged over all elements sharing the node.

The director is computed from the Rodrigues rotation formula

\[d_I = \cos|\varphi|\, G_3 + \operatorname{sinc}|\varphi|\,(\varphi_1 T_1 + \varphi_2 T_2)\]

which preserves unit length exactly for any rotation magnitude. Requires a two-field DofHandler with :u (ip³) and (ip²).

Example

d, G3 = director_field(dh, scv, u)
VTKGridFile("output", dh) do vtk
    write_solution(vtk, dh, u)
    Ferrite.write_node_data(vtk, d,  "director")
    Ferrite.write_node_data(vtk, G3, "G3")
end
source
FerriteShells.shell_strainsFunction
shell_strains(scv, qp, u_e) -> (E, κ, γ)

Compute all three RM shell strain measures at quadrature point qp from a flat 5-DOF/node element vector u_e = [u₁,u₂,u₃,φ₁,φ₂, …].

Returns:

  • E :: SymmetricTensor{2,2} — membrane strain, Green–Lagrange: Eαβ = ½(aα·aβ − Aα·Aβ)
  • κ :: SymmetricTensor{2,2} — bending curvature change: καβ = ½(aα·d,β + aβ·d,α) − Bαβ
  • γ :: Vec{2} — transverse shear strain: γα = aα·d − Aα·G₃ (MITC-corrected if applicable)
source
FerriteShells.embed23Function
embed23(S) -> SymmetricTensor{2,3}

Embed a surface SymmetricTensor{2,2} into a 3D symmetric tensor by padding the out-of-plane rows/columns with zeros. Useful for writing shell strain or stress tensors to VTK (ParaView expects 6-component symmetric tensors).

source
FerriteShells.NodeFramesType
NodeFrames

Per-node area-weighted averaged director frames for a shell mesh. Eliminates the O(h/R) inter-element frame inconsistency that occurs when adjacent curved-shell elements each derive their own centroid frame.

Construct via NodeFrames(grid, ip_geo). Pass to reinit!(scv, x, nf, node_ids) instead of the plain reinit!(scv, x) to activate per-node frames.

For flat shells the result is identical to the centroid-frame approach.

source