Real constants and sections#

Some elements need geometric data the mesh doesn’t carry — a shell thickness, a truss cross-section area, a beam inertia tensor, a point mass. femorph-solver stamps that data on the model via Model.assign(..., real=...), which writes a 1-D array under a real_id that the element kernel later indexes.

Native API#

import femorph_solver as fs

model = fs.Model.from_grid(grid)
model.assign(
    fs.ELEMENTS.QUAD4_SHELL,
    {"EX": 2.1e11, "PRXY": 0.30, "DENS": 7850.0},
    real=[0.005],   # 5 mm shell thickness, written under real_id=1
)

The element kernel reads the array as a flat positional buffer and extracts the named slots via the table below.

Per-element-type layouts#

Element

Positional layout

Notes

TRUSS2

r = [AREA, ADDMAS, ISTRN]

Only AREA is mandatory. ADDMAS and ISTRN are parsed but not yet used.

SPRING

r = [K, CV1, CV2, IL]

K is the spring constant (mandatory). CV1 / CV2 damping and IL initial length are parsed but not used in the current \(K_e\) path.

POINT_MASS

r = [MASSX, MASSY, MASSZ]

MASSX is mandatory; MASSY / MASSZ default to MASSX when omitted.

BEAM2

r = [AREA, IZZ, IYY, J]

AREA cross-sectional area; IZZ / IYY the two bending inertias about the element’s local axes; J the Saint-Venant torsion constant.

QUAD4_PLANE

r = [THK]

Out-of-plane thickness; default 1.0.

QUAD4_SHELL

r = [THICKNESS]

Through-thickness dimension. Mandatory.

HEX8 / HEX20 / TET10 / WEDGE15 / PYR13

(none)

Solid elements carry no real constants; geometry is fully determined by the nodes.

Foreign-deck readers (CDB / BDF / INP / FEM) round-trip the positional layout exactly — an element carrying REAL,2 in the input deck ends up with model.real_constants[2] populated in the correct order.

Introspection#

model.real_constants
# {1: array([0.005])}              # QUAD4_SHELL thickness
# {2: array([1.0e-4, 8.3e-9, 8.3e-9, 1.7e-8])}   # BEAM2 section

# Which real id does an element use?
model.grid.cell_data["ansys_real_constant"]

Sections (future)#

Beam cross-section description blocks (e.g. MAPDL’s SECTYPE / SECDATA, NASTRAN’s PBARL / PBEAML, Abaqus’s *BEAM SECTION) are not yet consumed by femorph-solver. A foreign deck with only the equivalent of R data works today; a deck describing a beam through a cross-section catalogue does not yet translate into the equivalent BEAM2 real constants. All three formats will eventually share a common intermediate representation.

See also#

  • Materials — material properties (EX, PRXY, DENS etc.).

  • Element library — per-element documentation including the exact real-constant layout.