Using Awatif Buckling

JavaScript Guide and API Reference
Nonlinear Frames and Shells

Mohamed Adil, Awatif

1Scope

Awatif Buckling solves geometrically nonlinear 3D frames and triangular shells, including P–Δ effects and post-buckling deformation. Supply a mesh, supports, nodal loads and elastic properties; receive deformed positions and frame forces. See the theory and frame benchmarks or try the interactive demo.

The demo shows results precomputed with the solver; the solver itself is not published. For integration in your own application, request a licensed build.

2First solve

Use the solver with a JavaScript module bundler that supports TypeScript and WebAssembly assets, such as the repository’s Vite setup. The import below assumes your app entry sits beside getNlPositionsAndForces.ts; adjust it to your integration. Keep the supplied WebAssembly assets with the wrapper. Await initialization once, then call the synchronous solve function.

import {
  initNlPositionsAndForces,
  getNlPositionsAndForces,
} from "./getNlPositionsAndForces";

await initNlPositionsAndForces();

// A 3 m cantilever, divided into five frame elements. Units: kN, m.
const nodes = Array.from({ length: 6 }, (_, i) => [0, 0, i * 0.6]);
const elements = Array.from({ length: 5 }, (_, i) => [i, i + 1]);
const loads = new Map([[5, [10, 0, -2000, 0, 0, 0]]]);
const supports = new Map([
  [0, [true, true, true, true, true, true]],
]);
const section = {
  elasticity: 32_836_000, shearModulus: 13_681_666.666666666,
  area: 0.0625, momentInertiaY: 0.00032552,
  momentInertiaZ: 0.00032552, torsionalConstant: 0.000549128125,
};
const elementsProps = new Map(elements.map((_, i) => [i, section]));

try {
  const result = getNlPositionsAndForces(
    nodes, elements, loads, supports, elementsProps,
  );
  const tip = result.positions.slice(15, 18);
  console.log("Tip displacement:", tip.map((x, i) => x - nodes[5][i]));
  console.log("Base element forces:", result.internalForces.get(0));
} catch (error) {
  console.error(error.message);
}

3Inputs and conventions

Indices are zero-based. Use one consistent unit system: with kN and metres, elastic moduli are kN/m², areas m², inertias and torsional constants m⁴, thicknesses m, and moments kN·m. The caller supplies the mesh and converts distributed loads to equivalent nodal loads.

inputmeaning
nodesArray of original global coordinates [x, y, z].
elementsArray of node indices: [a, b] for a frame, [a, b, c] for a shell. Shell triangles must be non-degenerate and consistently oriented.
loadsMap from node index to global [Fx, Fy, Fz, Mx, My, Mz]. Moments require a node connected to a frame element.
supportsMap from node index to [ux, uy, uz, rx, ry, rz] booleans; true fixes that global degree of freedom. Shell-only nodes have translations only.
elementsPropsMap from every element index to its properties. Frames use elasticity, area, momentInertiaY, momentInertiaZ, shearModulus and torsionalConstant. Shells use elasticity, thickness and poissonRatio (default 0; −1 < ν < 0.5).

4Optional arguments

getNlPositionsAndForces(
  nodes, elements, loads, supports, elementsProps,
  releases, simSettings, options,
)

releases is an optional Map from frame element index to [My_start, Mz_start, My_end, Mz_end]; true releases that local bending moment. Omit it, or pass undefined, for rigid ends.

simSettings defaults to { tol: 1e-3, maximum_iter: 500 }. If supplying settings, provide both values. options defaults to {} and supports these shell-only features, without releases:

5Reading results

resultmeaning
positionsFlat array [x0, y0, z0, x1, …] in input node order. These are deformed coordinates; subtract the original coordinates for displacements.
internalForcesMap keyed by input frame element index. Each entry contains N, Vy, Vz, Mx, My, Mz, each a [start, end] pair in member-local axes. Empty for shell-only models.
iterationCountNumber of solver iterations used.

Invalid input, unsupported topology or failure to converge throws an Error; there is no result.ok flag or partial result. This is an equilibrium solve at the supplied load, not an eigenvalue buckling calculation. A perfectly symmetric model can remain on a symmetric equilibrium; use a suitable geometric imperfection or small lateral load to select a buckling branch, and check mesh convergence.

6Support

Book a call or email mohamed@awatif.co. For a bug report, include a minimal model, solver build and full error message. Results must be independently verified by a qualified engineer before use.