Summary
In a static step, a moment (*CLOAD on DOF 4-6) on a beam or shell node that is not a knot becomes a mean-rotation MPC. A later *BUCKLE step removes all loads, but the MPC stays. When a step after the *BUCKLE applies a moment at the same node and DOF again, ccx creates a second mean-rotation MPC for the same node and axis. What follows depends on the numbers:
- endless loop:
cascadeprints “zero coefficient on the dependent side of an equation” without end, about 170 MB per second (buckle_loop.inp, one B31; B32R too); - moment lost, exit 0: tip displacement -7.8E-08 instead of 0.5 (
buckle_lost.inp); - wrong result, exit 0: tip displacement -0.2306 instead of -0.2222, 3.8 % off (
buckle_off.inp); - S4 shell, moment lost, exit 0: out-of-plane displacement 1.7E-14 instead of 0.1855 (
shell_lost.inp).
The same decks with the *BUCKLE step replaced by a *STATIC step with *CLOAD, OP=NEW give beam theory to 7 digits. *CLOAD, OP=NEW also removes the earlier loads, so the two inputs should give the same bending response in the third step (the bending is linear and does not depend on the axial load). Section 7.5 (*BUCKLE) of the 2.23 manual says: “All loads previous to a perturbation step are removed at the start of the step; only the load specified within the buckling step is scaled till buckling occurs.” Nothing there would change the bending in a later step. Different answers for equivalent inputs, and an endless loop where an *ERROR would be the way to stop, make this a bug.
A second, smaller deviation shows in the same runs: the axial load of the *BUCKLE step stays active in step 3. Section 6.9.4 (Buckling analysis) of the 2.23 manual says the buckling step’s loading “is reset to zero at the end of the buckling step”, so the tip should have u3 = 0 in step 3 of the *BUCKLE decks. ccx gives u3 = -1.666667E-02, the static response to that load. With *STEP, PERTURBATION on the *BUCKLE step the load is reset (u3 = 1.3E-08), but the moment is still wrong (see the table).
Version
ccx 2.23 (macOS arm64). Source: master 9ba5d76 (16 Oct 2026).
Already reported or fixed?
Not reported: I found no matching GitHub issue (open or closed) or pull request in Dhondtguido/CalculiX, and no calculix.discourse.group topic (searched 21 Oct 2026). Not fixed: buckles.f, the mean-rotation part of gen3dforc.f and cascade.c are unchanged on master (9ba5d76).
Related:
- Wrong results in a multistep analysis with shells and *BOUNDARY, OP=NEW · Issue #13 · Dhondtguido/CalculiX · GitHub (open): the same family with another trigger. There a
*BOUNDARY, OP=NEWin a later step gives wrong shell (and beam) results without a message; as traced in a comment on that issue, it deletes the generated type-‘B’ constraints of the mean-rotation MPCs but keeps the MPCs. Here the*BUCKLEstep drops the load entries that belong to the generated MPCs and keeps the MPCs. A fix for one may not cover the other. - Non-axis-aligned beam moment and constraint bugs again · Issue #124 · Dhondtguido/CalculiX · GitHub (and the closed *ERROR in cascade: zero coefficient... with *BOUNDARY on B31 · Issue #18 · Dhondtguido/CalculiX · GitHub, *ERROR in cascade for *BOUNDARY on rotated rectangular beam. · Issue #37 · Dhondtguido/CalculiX · GitHub, *ERROR in cascade for *BOUNDARY on rotated rectangular beam with 3 DOFs constrained. · Issue #40 · Dhondtguido/CalculiX · GitHub): mean-rotation MPCs on beams that are not aligned with the global axes give wrong results, and
cascadewarns instead of stopping. Those need one step and a turned beam. Here the beam lies along z, and the trigger is the*BUCKLEstep. - The same endless loop in
cascade.calso follows from another trigger, a*TIEwhose slave and master surface are the same (reported separately).
Minimal input
buckle_loop.inp: one B31 along z, clamped at node 1. Step 1 applies moments about x and y (0.1 and 0) at node 2. Step 2 is a *BUCKLE step with an axial load. Step 3 applies the moments again (0.2 and 0).
** One B31 cantilever along z: moments in a static step, a *BUCKLE step, moments again
*NODE, NSET=NALL
1, 0., 0., 0.
2, 0., 0., 1.
*ELEMENT, TYPE=B31, ELSET=B
1, 1, 2
*BEAM SECTION, ELSET=B, MATERIAL=M, SECTION=RECT
0.2, 0.3
1., 0., 0.
*MATERIAL, NAME=M
*ELASTIC
1000., 0.3
*BOUNDARY
1, 1, 6
*STEP
*STATIC
*CLOAD
2, 4, 0.1
2, 5, 0.
*END STEP
*STEP
*BUCKLE
2
*CLOAD
2, 3, -1.
*END STEP
*STEP
*STATIC
*CLOAD
2, 4, 0.2
2, 5, 0.
*NODE PRINT, NSET=NALL
U
*END STEP
Variants of this deck:
| deck | change | exit | tip (node 2) in step 3 | mean-rotation MPCs at node 2 (.12d) |
|---|---|---|---|---|
buckle_loop.inp |
(as above) | none (loops) | none | 4 |
buckle_b32r.inp |
one B32R: node 2 at (0, 0, 0.5), node 3 at (0, 0, 1), 1, 1, 2, 3, all loads on node 3 |
none (loops) | none | 4 (at node 3) |
buckle_lost.inp |
DOF 4 and 5 swapped in steps 1 and 3: 2, 5, 0.1 / 2, 4, 0. and 2, 5, 0.2 / 2, 4, 0. |
0 | u1 = -7.812338E-08 | 4 |
buckle_off.inp |
the two 2, 5, 0. lines removed |
0 | u2 = -2.305637E-01 | 2 |
static_loop.inp |
step 2 replaced by *STATIC / *CLOAD, OP=NEW / 2, 3, -1. |
0 | u2 = -2.222222E-01 | 2 |
static_lost.inp |
buckle_lost.inp with the same step 2 change |
0 | u1 = 5.000000E-01 | 2 |
static_off.inp |
buckle_off.inp with the same step 2 change |
0 | u2 = -2.222222E-01 | 1 |
In all finished runs the tip has u3 = -1.666667E-02 (-1.666665E-02 for buckle_off.inp): the axial load of step 2 is still active in step 3. That is right for the static variants; for the *BUCKLE decks section 6.9.4 asks for u3 = 0 (see the Summary).
With *STEP, PERTURBATION on the *BUCKLE step the buckling load is gone in step 3, as section 6.9.4 asks, but the moment is still wrong: buckle_off_pert.inp (buckle_off.inp with *STEP, PERTURBATION on step 2) gives u2 = -2.305637E-01 (3.8 % off) and u3 = 1.3E-08, and buckle_lost_pert.inp (the same change to buckle_lost.inp) gives a tip displacement of exactly 0 instead of u1 = 0.5 (moment lost). They have 2 and 4 mean-rotation MPCs at node 2, as without PERTURBATION.
shell_lost.inp and shell_static.inp: the same with one S4 plate (moment lost)
shell_lost.inp:
** One S4 plate, clamped edge x=0: moments in a static step, a *BUCKLE step, moments again
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 0., 1., 0.
4, 1., 1., 0.
*ELEMENT, TYPE=S4, ELSET=P
1, 1, 2, 4, 3
*SHELL SECTION, ELSET=P, MATERIAL=M
0.05
*MATERIAL, NAME=M
*ELASTIC
1000., 0.3
*BOUNDARY
1, 1, 6
3, 1, 6
*STEP
*STATIC
*CLOAD
4, 4, 0.1
4, 5, 0.
*END STEP
*STEP
*BUCKLE
2
*CLOAD
4, 1, -1.
*END STEP
*STEP
*STATIC
*CLOAD
4, 4, 0.2
4, 5, 0.
*NODE PRINT, NSET=NALL
U
*END STEP
shell_static.inp is the same with step 2 replaced by *STATIC / *CLOAD, OP=NEW / 4, 1, -1..
Step 3, node print (exit 0 for both):
shell_lost.inp:
2 4.045000E-02 5.550000E-02 1.577720E-14
4 -7.955000E-02 6.450000E-02 1.705932E-14
shell_static.inp:
2 4.045000E-02 5.550000E-02 -2.944794E-01
4 -7.955000E-02 6.450000E-02 1.855102E-01
The in-plane part comes from the load of step 2, which stays active in both decks (for shell_lost.inp that is the second deviation above). The bending from the moment is missing after the *BUCKLE. The .12d files show 4 mean-rotation MPCs at node 4 after the *BUCKLE and 2 in the static variant.
How to run
buckle_loop.inp writes output without end. Limit the file size and send the output to a file:
ulimit -f 204800
ccx buckle_loop > buckle_loop.txt
The other decks: ccx <name> and read the .dat file.
Expected
Step 3 as in the static variants, which agree with beam theory for a cantilever under a tip moment, u = M L^2 / (2 E I):
- moment about x (0.2): I = 0.2 * 0.3^3 / 12 = 4.5E-4, u2 = -0.2 / (2 * 1000 * 4.5E-4) = -0.22222 (
static_loop.inp: -2.222222E-01); - moment about y (0.2): I = 0.3 * 0.2^3 / 12 = 2.0E-4, u1 = 0.2 / (2 * 1000 * 2.0E-4) = 0.5 (
static_lost.inp: 5.000000E-01); - axial load -1 (static variants only): u3 = -1 / (1000 * 0.06) = -0.016667. In the
*BUCKLEdecks the axial load should be gone after step 2 (section 6.9.4), so u3 = 0.
Actual
buckle_loop.inp: after the buckling factors of step 2 (sigma=1.000000,d[0]=0.579291), stdout shows
Decascading the MPC's
*WARNING in cascade: zero coefficient on the
dependent side of an equation
dependent node: 13 direction: 3
new coefficient = 2.000000e-05
*WARNING in cascade: zero coefficient on the
dependent side of an equation
dependent node: 14 direction: 3
new coefficient = 5.000000e-06
followed by the same block with dependent node: 14 direction: 3 and new coefficient = 3.749993e-18, without end. 100 MB of output took 0.57 s, after which the file-size limit stopped ccx. Nodes 11-14 are the section nodes that ccx generates at node 2 (.12d file: element 1 “is expanded into a “C3D8I BR” element with topology: 3 11 12 4 6 14 13 5”).
buckle_lost.inp: exit 0, two such warnings, tip u1 = -7.812338E-08 instead of 0.5. The moment is lost.
buckle_off.inp: exit 0, one warning, tip u2 = -2.305637E-01 instead of -2.222222E-01 (3.8 % too large).
Where it goes wrong
-
Outside dynamic steps, a moment on a beam or shell node that is not a knot becomes a mean-rotation MPC (
gen3dforc.f:598). The MPC is created once per node and DOF. The guard is the load entry itself (gen3dforc.f:604-610):! if a mean rotation MPC has already been created ! for idof, ilforc(id) contains the index of the ! SPC created for the angle value idof=8*(node-1)+idir call nident(ikforc,idof,nforc,id) if(ilforc(id).ne.i) cyclegen3dforc.f:684-742creates the MPC (labelMEANROTBS, throughusermpc). It puts the moment on the angle DOF of an extra node (forcadd, line 732) and stores that load’s index inilforc(id)(line 741). In later steps,forcadd.f:68-94finds the entry for (node, DOF) throughikforc/ilforcand writes the new value straight into the angle load.*CLOAD, OP=NEWonly zeroes the values (cloads.f:70-73), so the link survives: 1 MPC per axis in the static variants. -
buckles.f:170-174drops the load entries:! removing the natural boundary conditions nforc=0 nload=0 nbody=0The MPCs (
nmpc) stay. In the next step the*CLOADon the same node and DOF is a new entry withilforc(id)=i, sogen3dforccreates a secondMEANROTBSMPC for the same node and axis. The .12d file shows “a MEAN ROTATION MPC was generated in node 2” four times forbuckle_loop.inp(two per axis) and twice forstatic_loop.inp. The angle DOF of the first MPC now carries no load. -
The two MPCs have the same section terms (the same 4 section nodes, 12 terms). The new one takes another dependent DOF (
usermpc.f:357-365skips DOFs that are already dependent), so it contains the first MPC’s dependent DOF as an independent term.cascade.csubstitutes the first MPC into it, the section terms cancel, and the dependent coefficient collects to zero. The warning atcascade.c:218-224(and 325-332) replaces it with1.e-5*coefminand goes on; theFORTRAN(stop,());after it is commented out (lines 225 and 333). The substitution loop ends only when a pass changes nothing (if(ichange==0) break;, line 349). With two such pairs (buckle_loop.inp) that never happens. Why one pair ends and two pairs cycle, and how the patched coefficient loses or changes the moment, I did not trace.
CalculiX.c:1751-1756 deletes the loads after a *BUCKLE step, but only with PERTURBATION (if((iperturb[0]==1)&&(nmethod==3)){ … nforc=0;). Without PERTURBATION nothing resets the buckling load, which is the u3 deviation above. With PERTURBATION this second nforc=0 drops the moment entries once more; the two _pert decks above show that the moment is then still wrong. steadystatedynamicss.f:218 also sets nforc=0; not tested.
Workaround / fix
Fix (not tested): in buckles.f, zero the load values instead of dropping the entries, as *CLOAD, OP=NEW does in cloads.f:71-73:
do j=1,nforc
xforc(j)=0.d0
enddo
Then a later *CLOAD finds its old entry, and the existing mean-rotation MPC is reused. The same applies to CalculiX.c:1754 and steadystatedynamicss.f:218. To follow section 6.9.4, the buckling step’s own load values would then be zeroed at the end of every *BUCKLE step, not only with PERTURBATION. Another option is for gen3dforc to look for an existing MEANROTBS MPC of the node and axis before it creates one. As a safety net, cascade.c could stop with an *ERROR that names the MPC when the dependent coefficient of an MPC vanishes again in a later pass, instead of looping.
Workaround: run the *BUCKLE step in a separate input deck.