Initial shell/beam temperature gradient, no *TEMPERATURE in step 1: outer expanded nodes get the "undefined" marker 1.2357 -/+ g·t/2 (spurious thermal strain)

Summary

*INITIAL CONDITIONS, TYPE=TEMPERATURE may give shell nodes a gradient through the thickness and beam nodes gradients across the section (section 7.77, *INITIAL CONDITIONS, of the 2.23 manual). If the first step then has no *TEMPERATURE card, the temperatures should stay at their initial values, and there should be no thermal load. Instead:

  • The outer (bottom and top) expanded nodes get 1.2357111319 -/+ g t/2, here -0.264 and 2.736. 1.2357111319 is the value ccx fills the temperature arrays with to mark “not defined” (CalculiX.c line 434). Only the middle expanded nodes are restored to the initial temperature 50.
  • A free S8R plate with the initial temperature 50 and gradient 30 shrinks by 0.0325 over a length of 2. That is a temperature drop of 16.25.
  • *NODE PRINT NT shows 1.235711 at the midside nodes. The deck never gives that value.

The same plate with the initial temperatures repeated in the step, or with an initial temperature without a gradient, does not move. B32 beams behave the same way. The run exits with status 0, without a warning.

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: gen3dtemp.f and checktemp.f are unchanged on master (9ba5d76).

Related:

Minimal input

ic_gradient.inp: a flat 2 x 1 S8R plate (thickness 0.1, E 1000, nu 0, alpha 1E-3), statically determinate supports, initial temperature 50 with a gradient of 30, and a step without loads or temperatures.

*NODE, NSET=NALL
1, 0, 0, 0.
2, 0.5, 0, 0.
3, 1, 0, 0.
4, 1.5, 0, 0.
5, 2, 0, 0.
6, 0, 0.5, 0.
7, 1, 0.5, 0.
8, 2, 0.5, 0.
9, 0, 1, 0.
10, 0.5, 1, 0.
11, 1, 1, 0.
12, 1.5, 1, 0.
13, 2, 1, 0.
*ELEMENT, TYPE=S8R, ELSET=EALL
1, 1, 3, 11, 9, 2, 7, 10, 6
2, 3, 5, 13, 11, 4, 8, 12, 7
*MATERIAL, NAME=M
*ELASTIC
1000., 0.
*EXPANSION
1.E-3
*SHELL SECTION, ELSET=EALL, MATERIAL=M
0.1
*BOUNDARY
1, 1, 3
3, 2, 3
9, 3, 3
*INITIAL CONDITIONS, TYPE=TEMPERATURE
NALL, 50., 30.
*STEP
*STATIC
*NODE PRINT, NSET=NALL
U, NT
*END STEP

Twins:

  • ic_repeated.inp: the step also has *TEMPERATURE / NALL, 50., 30.;
  • ic_no_gradient.inp: the initial condition line is NALL, 50..

ic_gradient_b32.inp: the same check on a B32 cantilever along z (length 1, two elements, RECT 0.1 x 0.1, n1 = x), clamped at z = 0, with the same material, the initial line NALL, 50., 30., 0. (gradient 30 in the 2-direction) and a step without loads or temperatures.

ic_gradient_b32.inp
*NODE, NSET=NALL
1, 0., 0., 0
2, 0., 0., 0.25
3, 0., 0., 0.5
4, 0., 0., 0.75
5, 0., 0., 1
*ELEMENT, TYPE=B32, ELSET=EALL
1, 1, 2, 3
2, 3, 4, 5
*MATERIAL, NAME=M
*ELASTIC
1000., 0.
*EXPANSION
1.E-3
*BEAM SECTION, ELSET=EALL, MATERIAL=M, SECTION=RECT
0.1, 0.1
1., 0., 0.
*BOUNDARY
1, 1, 6
*INITIAL CONDITIONS, TYPE=TEMPERATURE
NALL, 50., 30., 0.
*STEP
*STATIC
*NODE PRINT, NSET=NALL
U
*END STEP

How to run

ccx ic_gradient
ccx ic_repeated
ccx ic_no_gradient
ccx ic_gradient_b32

Expected

The temperatures do not change, so nothing moves: U = 0 everywhere, as both twins give (largest |U| 6E-17). NT at the nodes is 50.

Actual

ic_gradient.inp, exit 0, no warning:

 displacements (vx,vy,vz) for set NALL and time  0.1000000E+01
...
         5 -3.250953E-02  1.030950E-15  1.831147E-14
...
        13 -3.250953E-02 -1.625476E-02  2.407836E-14
 temperatures for set NALL and time  0.1000000E+01

         1  3.374524E+01
         2  1.235711E+00
         3  3.374524E+01
...

The plate shrinks uniformly (strain -0.01625, a temperature drop of 16.25), without bending. Varying the initial values: (0, 30) and (0, 100) both give U1 = +8.24E-04 at node 5, (50, 100) gives -0.0325, (100, 30) gives -0.0658. The error depends on the initial temperature, not on the gradient, and it vanishes when the gradient is 0. The same with S8. The B32 cantilever (ic_gradient_b32.inp), with the initial line NALL, 50., 30., 0. and no step temperature, stretches by -0.01625 per unit length.

With *NODE FILE, OUTPUT=3D and NT, the final temperatures of the expanded nodes are -0.264289 (bottom), 50 (middle) and 2.73571 (top), instead of 48.5, 50 and 51.5.

Where it goes wrong

  • CalculiX.c lines 429-436 fill t0 and t1 with 1.2357111319 (“a generic nonzero initialization”) to mark nodes without a temperature.
  • initialconditionss.f sets t0, t0g and t1g, but not t1 (line 114: c t1(l)=temperature). Without a *TEMPERATURE card, t1 of the shell nodes keeps the marker.
  • gen3dtemp.f lines 214-225 compute the expanded nodes’ t1 from the shell node’s t1 and the gradient t1g: t1(node)=t1(i)-t1g(1,i)*thicke(1,indexe+j)*(0.5d0+offset(1,ielem)) (bottom), t1(i) (middle), t1(i)+... (top). Here that gives 1.2357111319 -/+ 1.5. The beam branch (lines 226-262) works the same way.
  • checktemp.f lines 63-64 replace a final temperature that still equals the marker by the initial one: elseif(dabs(t1(node)-1.2357111319d0).lt.1.d-10) then / t1(node)=t0(node). The middle nodes still hold the marker and are set to 50. The outer nodes no longer match it, so they keep -0.26 and 2.74.

Fix

In gen3dtemp.f (lines 214-262), skip a shell or beam node whose t1 still holds the marker, i.e. leave its expanded nodes’ t1 at the marker as well, so that checktemp.f replaces all of them by their initial temperatures (t0, which gen3dtemp.f already sets from t0 and t0g in lines 42-189). Setting t1 in initialconditionss.f is not proposed: line 114 (c t1(l)=temperature) is commented out on purpose.

Workaround: repeat the initial temperatures and gradients in a *TEMPERATURE card of the first step.

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

ic_gradient.dat:

                        S T E P       1


                                INCREMENT     1


 displacements (vx,vy,vz) for set NALL and time  0.1000000E+01

         1  0.000000E+00  0.000000E+00  0.000000E+00
         2 -8.127381E-03  3.114193E-14  2.513997E-12
         3 -1.625476E-02  0.000000E+00  0.000000E+00
         4 -2.438214E-02  1.428451E-04 -1.326318E-11
         5 -3.250953E-02 -3.848959E-13 -3.152809E-11
         6 -2.205017E-15 -8.127381E-03  1.585412E-12
         7 -1.625476E-02 -8.127381E-03 -8.057586E-12
         8 -3.250953E-02 -8.127381E-03 -3.360571E-11
         9  5.834627E-14 -1.625476E-02  0.000000E+00
        10 -8.127381E-03 -1.625476E-02 -5.600034E-12
        11 -1.625476E-02 -1.625476E-02 -1.278758E-11
        12 -2.438214E-02 -1.639761E-02 -2.480328E-11
        13 -3.250953E-02 -1.625476E-02 -3.864514E-11

 temperatures for set NALL and time  0.1000000E+01

         1  3.374524E+01
         2  1.235711E+00
         3  3.374524E+01
         4  1.235711E+00
         5  3.374524E+01
         6  1.235711E+00
         7  1.235711E+00
         8  1.235711E+00
         9  3.374524E+01
        10  1.235711E+00
        11  3.374524E+01
        12  1.235711E+00
        13  3.374524E+01
1 Like

Posted! Initial shell/beam temperature gradient, no *TEMPERATURE in step 1: outer expanded nodes get the "undefined" marker 1.2357 -/+ g·t/2 (spurious thermal strain) · Issue #251 · Dhondtguido/CalculiX · GitHub

1 Like