U1 beam element: nodal forces have wrong signs (axial at node 1, shear at node 2), so RF does not balance the loads

Summary

The internal nodal forces of the user element U1 (the 2-node Timoshenko beam) have the wrong sign for the axial force at the element’s first node and for the shear forces at its second node. As a result RF at U1 nodes does not balance the applied loads, and a step that ccx iterates does not converge.

Version

ccx 2.23 (conda-forge build pl5321h484372f_2, macOS arm64). The code involved (src/resultsmech_u1.f) is the same on master (checked 2026-10-17).

Minimal input (u1_rf.inp)

** One U1 cantilever element, clamped at node 1, tip load (10, 1, 2) at node 2.
** RF = external force: the reaction at node 1, the applied load at node 2.
** k = 1.e4 only makes the shear deformation negligible, so that the
** displacements are the Euler-Bernoulli ones; the signs of RF are the
** same with k = 5/6.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 10., 0., 0.
*USER ELEMENT, TYPE=U1, INTEGRATION POINTS=2, MAXDOF=6, NODES=2
*ELEMENT, TYPE=U1, ELSET=EBEAM
1, 1, 2
*MATERIAL, NAME=STEEL
*ELASTIC
1.e7, 0.3
*BEAM SECTION, ELSET=EBEAM, MATERIAL=STEEL, SECTION=GENERAL
0.01, 8.333333e-6, 0., 8.333333e-6, 1.e4
0., 1., 0.
*BOUNDARY
1, 1, 6
*STEP
*STATIC
*CLOAD
2, 1, 10.
2, 2, 1.
2, 3, 2.
*NODE PRINT, NSET=NALL
U
*NODE PRINT, NSET=NALL, TOTALS=YES
RF
*EL PRINT, ELSET=EBEAM
S
*END STEP

How to run

ccx u1_rf

Expected

The manual (*NODE PRINT) defines RF as the external force: the reaction plus any *CLOAD at the node. So:

node RF expected
1 (clamped) reaction (−10, −1, −2)
2 (free, loaded) the *CLOAD (10, 1, 2)
total (0, 0, 0)

The displacements ccx prints are correct: u = FL/EA = 1.0e-3, v = PL³/3EI = 4.0, w = 8.0, θy = −1.2, θz = 0.6. Only the forces are wrong.

Actual

 forces (fx,fy,fz) for set NALL and time  0.1000000E+01

         1  1.000000E+01 -9.999999E-01 -2.000000E+00
         2  1.000000E+01 -1.000000E+00 -2.000000E+00

 total force (fx,fy,fz) for set NALL and time  0.1000000E+01

        2.000000E+01 -2.000000E+00 -4.000000E+00

 stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EBEAM and time  0.1000000E+01

         1   1  1.000000E+01 -1.000000E+01 -2.000000E+01 -9.999999E-01 -2.000000E+00  0.000000E+00
         1   2  1.000000E+01 -2.600000E-07 -5.200000E-07 -1.000000E+00 -2.000000E+00  0.000000E+00

fx has the wrong sign at node 1, and fy and fz have the wrong sign at node 2. With k = 5/6 the signs are the same.

Iterated steps put these forces into the residual. Two C3D8 cubes in node-to-surface contact converge in 3 iterations on their own. Add this cantilever to the same deck, unconnected to the cubes, and the step diverges: “largest increment of disp” goes 4, 8, 16, 32, then come the cutbacks and *ERROR: too many cutbacks. A moment on either U1 node, or a torque, has the same effect.

Where it goes wrong

src/resultsmech_u1.f, lines 616–621, in the loop over jj = 1, 2. Here ξ = 0 at node 1 and ξ = 1 at node 2, and stre(1..6) = N, M2, M1, Q1, Q2, T at that end. The local axes are e1 along the element, e2 = n1 (the second data line) and e3 = e1 × e2:

            fn(j,node)=fn(j,node)+tm(1,j)*stre(1)
     &           +tm(2,j)*stre(4)
     &           +tm(3,j)*stre(5)
            fn(j+3,node)=fn(j+3,node)+tm(1,j)*stre(6)
     &           +tm(2,j)*stre(2)
     &           +tm(3,j)*stre(3)
  • The end section forces are added with the same sign at both nodes. A 2-node element needs −stre at node 1 and +stre at node 2, which is why fx is wrong at node 1. The shear force comes out right at node 1 only because stre(4) and stre(5) have the wrong sign themselves. For this load the exact v′ − θ3 and w′ + θ2 are positive, yet S prints the shear forces as −1 and −2 (sxy, sxz). That is the U1 shear-term problem, reported separately.
  • The bending moments go on the wrong axes:
    • stre(2) = E·I11·(−θ3′) is a moment about e3, but it is added to the rotation about e2 (n1).
    • stre(3) = E·I22·θ2′ is a moment about e2, but it is added to the rotation about e3.
  • stre(6) = xk·G·(I11+I22)·θ1′ (line 507) includes the shear coefficient k. The torsional stiffness s(4,4)=um*(xi11+xi22)/dl in e_c3d_u1.f does not. So the torque in S and in fn is k times the real torque: a tip torque of 1 with k = 0.5 prints 0.5.

I tested the following fix in a Python re-implementation of both routines:

  • −stre at node 1 and +stre at node 2;
  • stre(3) as the moment about e2 and −stre(2) as the moment about e3;
  • the torque without k;
  • the shear term corrected (separate issue).

With all four changes, the assembled forces equal K_e·u_e from e_c3d_u1.f to round-off for arbitrary u_e. Computing fn directly as Tᵀ·K′·T·u_e would also work. Neither fix has been built and tested in ccx itself.

Workaround

Support the U1 node through stiff SPRING2 elements, one per translational DOF, to a fixed node, and read RF at the fixed node. That gives (−10, −1, −2) for this deck. No workaround found for iterated steps.

A related issue:

Summary

Under a uniform temperature change, a free bar of U1 elements clamped at its first node lengthens by n·α·ΔT·L when it is meshed with n elements. A single element clamped at its second node shortens by α·ΔT·L instead of lengthening. No error or warning is printed. The free bars also come out with a non-zero axial force and non-zero reactions.

Version

ccx 2.23 (conda-forge build pl5321h484372f_2, macOS arm64). The code involved (src/resultsmech_u1.f, src/linstatic.c) is the same on master (checked 2026-10-17).

Already reported or fixed?

Not reported: there is no matching GitHub issue (open or closed) or open pull request in Dhondtguido/CalculiX, and no calculix.discourse.group topic (searched 17 Oct 2026). Not fixed: the routine involved is unchanged on master, and conda-forge’s latest 2.23 build (pl5321hd17ca8b_8, which carries about 40 extra patches) gives the same output. Same root cause as the U1 nodal-force issue; the two can be filed together.

Minimal input (u1_thermal.inp)

** Four free bars of length 10 along x, heated uniformly 0 -> 100,
** alpha = 1.e-5. Bars A, B, C have 1, 2 and 4 U1 elements and are clamped
** at x = 0; bar D is one U1 element clamped at x = 10 (its second node).
** Each bar should lengthen by alpha*dT*L = 0.01, with no axial force
** and no reaction.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 10., 0., 0.
11, 0., 5., 0.
12, 5., 5., 0.
13, 10., 5., 0.
21, 0., 10., 0.
22, 2.5, 10., 0.
23, 5., 10., 0.
24, 7.5, 10., 0.
25, 10., 10., 0.
31, 0., 15., 0.
32, 10., 15., 0.
*NSET, NSET=NFREE
2, 13, 25, 31
*NSET, NSET=NFIX
1, 11, 21, 32
*USER ELEMENT, TYPE=U1, INTEGRATION POINTS=2, MAXDOF=6, NODES=2
*ELEMENT, TYPE=U1, ELSET=EALL
1, 1, 2
11, 11, 12
12, 12, 13
21, 21, 22
22, 22, 23
23, 23, 24
24, 24, 25
31, 31, 32
*MATERIAL, NAME=STEEL
*ELASTIC
2.e5, 0.3
*EXPANSION, ZERO=0.
1.e-5
*BEAM SECTION, ELSET=EALL, MATERIAL=STEEL, SECTION=GENERAL
100., 833.3333, 0., 833.3333, 0.8333333
0., 1., 0.
*BOUNDARY
NFIX, 1, 6
*INITIAL CONDITIONS, TYPE=TEMPERATURE
NALL, 0.
*STEP
*STATIC
*TEMPERATURE
NALL, 100.
*NODE PRINT, NSET=NFREE
U
*NODE PRINT, NSET=NFIX
RF
*EL PRINT, ELSET=EALL
S
*END STEP

How to run

ccx u1_thermal

Expected

Each bar is held at one end only, so it is free to expand by α·ΔT·L = 1e-5 · 100 · 10 = 0.01:

bar free node expected u_x
A, B, C 2, 13, 25 +0.01
D 31 −0.01

In every element the axial force (the first S component) should be 0, and RF should be 0 at every clamped node.

Actual

 displacements (v(i),i=1..ndof) for set NFREE and time  0.1000000E+01

         2  1.000000E-02  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
        13  2.000000E-02  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
        25  4.000000E-02  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
        31  1.000000E-02  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00

 forces (fx,fy,fz) for set NFIX and time  0.1000000E+01

         1  0.000000E+00  0.000000E+00  0.000000E+00
        11  4.000000E+04  0.000000E+00  0.000000E+00
        21  1.200000E+05  0.000000E+00  0.000000E+00
        32 -4.000000E+04  0.000000E+00  0.000000E+00
  • Bars A, B and C (1, 2 and 4 elements) move 0.01, 0.02 and 0.04.
  • Bar D contracts by 0.01.
  • The axial force printed in S is non-zero:
bar elements N per element
B 11, 12 4.0e4, 0
C 21–24 1.2e5, 8.0e4, 4.0e4, 0
D 31 −4.0e4

Here E·A·α·ΔT = 2e4.

Where it goes wrong

e_c3d_u1.f adds no thermal load of its own. In a linear static step the thermal load comes from linstatic.c: results() is first called with zero displacements, and its internal force vector f enters the right-hand side (lines 482–485):

  NNEW(b,double,*neq);
  for(k=0;k<*neq;++k){
    b[k]=fext[k]-f[k];
  }

For U1, results() calls resultsmech_u1.f. At zero displacement it gives N0 = −E·A·α·ΔT in every element and adds it to fn with the same sign at both of the element’s nodes (lines 616–621; see the separate issue on U1 nodal forces):

            fn(j,node)=fn(j,node)+tm(1,j)*stre(1)
     &           +tm(2,j)*stre(4)
     &           +tm(3,j)*stre(5)

The thermal load of an element should be −E·A·α·ΔT at its first node and +E·A·α·ΔT at its second, along the element axis. Instead both nodes get +E·A·α·ΔT. A node shared by two elements gets 2·E·A·α·ΔT instead of 0, and an element’s free first node is pushed the wrong way.

The fix for the nodal forces, −stre at node 1 and +stre at node 2, removes this as well. That fix has not been built and tested in ccx.

Workaround

None found.

And another related issue:

Summary

U1 is documented as a 3D Timoshenko beam (manual §6.2.46). The code cites Luo (2008) for its consistent shape functions. With such shape functions, one element should give the exact Timoshenko deflection of a cantilever under an end load.

Instead, the shear parameter φ = 12EI/(kGAL²) enters U1’s shape functions and stiffness with the wrong sign:

one-element tip deflection
ccx 2.23 PL³/(3EI) · (φ² + φ + 4) / (4(1 + φ))
Timoshenko PL³/(3EI) · (1 + φ/4)

So for φ < 3 the element is stiffer than Euler–Bernoulli, and at φ = 1 its stiffness matrix is singular.

Already reported or fixed?

Not reported: there is no matching GitHub issue (open or closed) or open pull request in Dhondtguido/CalculiX, and no calculix.discourse.group topic (searched 17 Oct 2026). Not fixed: the routine involved is unchanged on master, and conda-forge’s latest 2.23 build (pl5321hd17ca8b_8, which carries about 40 extra patches) gives the same output. Related: forum topic 600 (2021–2023) found another sign error taken from the same paper’s Appendix A, fixed in 2.21.

Minimal input (u1_shear.inp)

** Deep cantilever, one U1 element: L = 5, square section 1 x 1
** (A = 1, I = 1/12), E = 1000, nu = 0.25 (G = 400), k = 5/6,
** tip load P = 1 along n1.
** Timoshenko: v = P L^3/(3 E I) + P L/(k G A) = 0.5 + 0.015 = 0.515
*NODE, NSET=NALL
1, 0., 0., 0.
2, 5., 0., 0.
*USER ELEMENT, TYPE=U1, INTEGRATION POINTS=2, MAXDOF=6, NODES=2
*ELEMENT, TYPE=U1, ELSET=EBEAM
1, 1, 2
*MATERIAL, NAME=MAT
*ELASTIC
1000., 0.25
*BEAM SECTION, ELSET=EBEAM, MATERIAL=MAT, SECTION=GENERAL
1., 0.083333333, 0., 0.083333333, 0.83333333
0., 1., 0.
*BOUNDARY
1, 1, 6
*STEP
*STATIC
*CLOAD
2, 2, 1.
*NODE PRINT, NSET=NALL
U
*EL PRINT, ELSET=EBEAM
S
*END STEP

How to run

ccx u1_shear

Expected

Timoshenko beam theory (φ = 0.12):

  • tip deflection v = PL³/(3EI) + PL/(kGA) = 0.5 + 0.015 = 0.515, compared with Euler–Bernoulli 0.5;
  • tip rotation θz = PL²/(2EI) = 0.15;
  • section forces: shear force sxy = k·G·A·(v′ − θz) = +1 along the whole element; bending moment magnitude 5 at the root and 0 at the tip.

Actual

 displacements (v(i),i=1..ndof) for set NALL and time  0.1000000E+01

         1  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
         2  0.000000E+00  4.614286E-01  0.000000E+00  0.000000E+00  0.000000E+00  1.500000E-01

 stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EBEAM and time  0.1000000E+01

         1   1  0.000000E+00 -4.464286E+00  0.000000E+00 -7.857143E-01  0.000000E+00  0.000000E+00
         1   2  0.000000E+00 -5.357143E-01  0.000000E+00 -7.857143E-01  0.000000E+00  0.000000E+00
  • v = 0.4614, which is 10.4 % below Timoshenko and below the Euler–Bernoulli value 0.5.
  • The moments are 4.46 at the root and 0.54 at the tip, instead of 5 and 0.
  • The shear force is −0.786 instead of +1.
  • The rotation is right.

Refining the mesh converges only slowly to 0.515:

elements 1 2 4 8 16 128
tip v 0.4614286 0.4744595 0.4944521 0.5080876 0.5131085 0.5149695

The test suite shows the same effect. test/userbeam.dat.ref has a tip deflection of 1.022509E-01. Its own data give 1.024003E-01 for Euler–Bernoulli and 1.024502E-01 for Timoshenko (φ = 0.00195).

With 12EI = kGAL² (φ = 1), for example A = 3, I1 = 0.25, I2 = 2.25, k = 0.625, L = 2 with the material above, the run stops with exit code 255 right after “Factoring the system of equations using the symmetric spooles solver”. spooles.out says “matrix found to be singular”, and no error is printed.

Where it goes wrong

src/resultsmech_u1.f, lines 427–430, set up the shape-function derivatives (Luo’s Eqs. 19–20):

      aly=12.d0*e*xi11/(xk*um*a*dl*dl)
      alz=12.d0*e*xi22/(xk*um*a*dl*dl)
      bey=1.d0/(1.d0-aly)
      bez=1.d0/(1.d0-alz)

Together with the polynomials that use aly and alz, these are the standard exact Timoshenko shape functions with φ replaced by −φ. The exact functions have 1/(1 + φ) where these have 1/(1 − φ), and φ has the opposite sign in every polynomial.

The matrix in src/e_c3d_u1.f (lines 479–529) is exactly the strain energy of these shape functions; I checked this symbolically. For example, line 480:

            y2=(12.d0*e*xi11-xk*um*a*dl*dl)**2

This vanishes at φ = 1.

Flipping the sign of φ gives the standard Timoshenko matrix (12EI/((1 + φ)L³), (4 + φ)EI/((1 + φ)L), …). The changes are:

  1. In resultsmech_u1.f: aly=-12.d0*e*xi11/(xk*um*a*dl*dl), and alz likewise.
  2. In e_c3d_u1.f:
    • y2=(12.d0*e*xi11+xk*um*a*dl*dl)**2, and z2 likewise;
    • 15.d0 instead of 3.d0 in y3 and z3;
    • 6.d0 instead of 30.d0 in s(5,11) and s(6,12).

I re-implemented both routines in Python with these changes. The result is 0.515 for any number of elements, in both bending planes. Combined with the assembly fix from the separate U1 nodal-force issue, the nodal forces built from the section forces then equal K_e·u_e. The changes have not been built and tested in ccx itself.

Workaround

  • A large k makes the displacements those of an exact Euler–Bernoulli beam (k·A ≫ 12EI/(GL²) for every element). The S shear forces then have the right size but still the wrong sign.
  • For slender beams the error is small (−0.2 % in userbeam).
  • Otherwise, refine the mesh.

Confirmed (using official build of ccx 2.23 on Windows), needs a GitHub ticket.

 displacements (v(i),i=1..ndof) for set NALL and time  0.1000000E+01

         1  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
         2  0.000000E+00  4.614286E-01  0.000000E+00  0.000000E+00  0.000000E+00  1.500000E-01

 stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EBEAM and time  0.1000000E+01

         1   1  0.000000E+00 -4.464286E+00  0.000000E+00 -7.857143E-01  0.000000E+00  0.000000E+00
         1   2  0.000000E+00 -5.357143E-01  0.000000E+00 -7.857143E-01  0.000000E+00  0.000000E+00

Posted: U1 beam element: nodal forces have wrong signs (axial at node 1, shear at node 2), so RF does not balance the loads · Issue #214 · Dhondtguido/CalculiX · GitHub

1 Like