Build Order & Dependencies
The desktop AI reads from the same knowledge base — this page is its English edition. When the AI cites 📖 guide · model-build-order in a conversation, it refers to this entry.
In One Sentence
First materials → then sections → then geometry → then elements → then boundaries → then loads → analysis steps last.
Why
This is not a matter of style; it is dictated by the data model. Every object holds references to upstream objects. Creating in reverse order can only yield a reference pointing at nothing—either an immediate error, or something worse: a silently built model that “looks right and computes entirely wrong.”
The concrete dependency chain:
Materials ──┐ ├─→ Sections ──→ Elements ──→ Loads (element loads depend on elements)Geometry ───┘ │ ├─→ Boundary conditions (nodes depend on geometry) └─→ Analysis steps (steps depend on elements and constraints)The Three Most Common Pitfalls
Pitfall 1: Building geometry first, changing materials later
The user says “change these beams to Q355,” but what actually happened is that 20 beams were created with Q235 first, then revisited. Changing the material itself is fine, but the stiffness matrices cached on the elements do not automatically invalidate. Kavvo marks affected elements as dirty in the edit action and recomputes before the next solve. If you bypass Kavvo’s edit channel with your own TCL script, you must trigger the recompute manually, or you’ll be computing with stale stiffness.
Pitfall 2: Creating the analysis step before the constraints
OpenSees’ analyze reads the model’s constraint state as it stands. If the analysis step is created before the constraints, the step’s DOF numbering is frozen at creation time—constraints added later point to obsolete numbering, manifesting as “the support was added but the displacement is still free.”
That’s why Kavvo lists “creating the analysis step first” as a non-standard action requiring explicit confirmation: it’s only correct in one situation—all incremental behavior has already been built.
Pitfall 3: Loads before elements
Nodal loads are fine (they depend only on nodes). Element loads (distributed loads, temperature gradients) require the elements to exist. Creating an element load before the elements makes Kavvo refuse with “target element not found,” but if you call eleLoad directly from a script, OpenSees won’t complain—it will silently drop that load at solve time. Results run small, with no warning whatsoever.
The Correct Order (Just Follow It)
| Step | Action | Checkpoint |
|---|---|---|
| 1 | Define materials (name, E, ν, ρ, fy) | Units consistent with the project |
| 2 | Define sections (referencing materials) | Section properties computable (A, I, Z) |
| 3 | Build geometry (points → lines → faces) | No duplicate points, no dangling points |
| 4 | Mesh elements (referencing sections) | Element count and total DOFs |
| 5 | Add boundary conditions (referencing nodes) | Constraints make the structure geometrically stable |
| 6 | Add loads (nodal / element loads) | Total load matches hand calculation |
| 7 | Create analysis steps | By this point, the model must already be self-consistent |
Step 7 comes last because the analysis step is the only object that “reads the entire model.” Any change in the earlier steps requires it to be rebuilt.
The Only Legitimate Form of Backtracking
Users often need to “go back and change things.” The legitimate path is editing via edit actions, not deleting and rebuilding:
- Change a material parameter → every section referencing it invalidates → every element referencing those sections invalidates → recomputed before solving
- Change a section dimension → same chain
- Change geometry coordinates → element lengths change → self-weight and mass update automatically
Do not delete and rebuild an entire substructure to change one parameter. That throws away every manually added load and boundary condition, and the user has no way to see what was lost.
Relationship to the AI
When asked to “build me a three-story frame,” the model calls execute_script in the order of the table above: one script covering steps 1–4, a second script covering steps 5–7. Never finish all seven steps in one script—if something goes wrong midway, there’s no way to pinpoint which step failed, and the user sees no intermediate results, so the direction can’t be corrected early.