Skip to content
Marc & Structures
Index

Save your progress

Enter your email and we will send a secure sign-in link. There is no password and the first link creates your account.

Demonstration ~10 min · ~42 min remaining

Invoke and separate responsibilities

Invoke with valid ARG values and separate build, solve, and extract into submacros.

Step 1 — Invoke with an explicit contract

/CLEAR,START
*USE,08_macro_debug.mac,0.10,-1000,0.05,1

*USE loads the macro and assigns ARG1ARG4. The driver translates those arguments into named parameters and rejects invalid values before building anything:

beam_h=ARG1
tip_force=ARG2
mesh_h=ARG3
case_id=ARG4

*IF,beam_h,LE,0,THEN
  /COM,ERROR: ARG1 beam_h must be positive
  /STATUS,PARM
  /EOF
*ENDIF

Do not run /CLEAR inside the driver. It would clear the database and macro stack. Clean the session before calling *USE.

Step 2 — Separate construction, solution, and extraction

/INPUT,08_build,mac,,,,1
/INPUT,08_solve,mac,,,,1
/INPUT,08_extract,mac,,,,1

Each phase assumes and checks preconditions. 08_build.mac creates geometry, mesh, and components; 08_solve.mac applies D/F and solves; 08_extract.mac activates the set, validates against theory, and writes the CSV.

Mesh divisions are calculated with NINT(dim/mesh_h). Thus mesh_h is a real contract argument, not a hardcoded value in the monolith. Construction sets KEYOPT(2)=3 on SOLID185: with KEYOPT(2)=0, bending stress is artificially low (~22%) on this mesh.