Summary
A data line of *DLOAD, *DSLOAD, *DFLUX or *FILM names an element, an element set or a facial surface. For *DFLUX and *FILM the 2.23 manual says so explicitly (section 7.40 (*DFLUX) and section 7.59 (*FILM): “the element set label underneath may be replaced by a surface name”). Section 7.45 (*DSLOAD) takes a surface name for a pressure, and section 7.44 (*DLOAD) lists element numbers and element sets. Both cards are read by the same routine, dloads.f, which accepts either on every line of both cards (its error message reads “element set or facial surface … has not yet been defined”).
When one card has a facial-surface line followed by an element-set line, ccx reads the element-set line as if its set were a surface. Each member n that the set lists one by one is taken as element n/10, face n mod 10:
- A member numbered 1 to 9 becomes element 0, which does not exist. Its load is stored for element 0 and never applied, and on the way
dloads.freadslakon(0), before the start of the array. - A member numbered 10 or higher is moved to element n/10. Member 12 loads face 2 of element 1.
Members inside a generated range (*ELSET, GENERATE) are not decoded, but they get the face number of the last decoded member. With the set generated as 2 to 4 (three cubes), cubes 2 and 4 carry nothing, and cube 3 is loaded on its side face 4 instead of its top face.
ccx exits with 0 and prints no message. The same two lines in two cards, or with the element-set line first, give the right answer.
Example: two separate cubes, each with pressure 1 on its top face, cube A through a surface and cube B through an element set. In one *DLOAD card cube B carries nothing (U3 = 0, reaction 0). With cube B numbered 12 instead of 2, its load goes to cube A, which then carries 2 and moves twice as far. *DSLOAD, *DFLUX and *FILM behave the same.
Version
ccx 2.23 (macOS arm64). Source: master 9ba5d76 (16 Oct 2026). A build of master 9ba5d76 gives the same numbers for every deck below.
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 22 Oct 2026). Not fixed: the surface flag in dloads.f, dfluxs.f, films.f, radiates.f, massflows.f and boundaryfs.f is unchanged on master (9ba5d76).
Related:
- dloads.f: pressure without face number on membranes in the first step by sandervdbroek · Pull Request #241 · Dhondtguido/CalculiX · GitHub (open) resets the sibling flag
edgeloadindloads.ffor every line (an EDNOR line made the later pressure lines of the same card be divided by the shell thickness). It leavessurfaceas it is. - Fix malformed input parsing by oursland · Pull Request #190 · Dhondtguido/CalculiX · GitHub (open) adds a check for an empty element set or facial surface just before the same first-member read in
dloads.f. Different defect. - Fix malformed input materials by oursland · Pull Request #195 · Dhondtguido/CalculiX · GitHub (open) rejects element numbers below 1 on
*DLOAD,*FILMand*RADIATElines, which also readlakonbefore the start of the array. Different trigger.
Minimal input
dl_onecard.inp:
** Two separate unit C3D8 cubes, each held at its bottom face, each with
** pressure 1. on its top face (face 2). Cube A (element 1) is loaded
** through the facial surface STOPA, cube B (element 2) through the
** element set EB. Both lines are in one *DLOAD card.
** Expected for both cubes: U3 = -4.333333E-06 at the top corner
** (nodes 7 and 17) and a reaction of 1. at the bottom.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 1., 1., 0.
4, 0., 1., 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
11, 3., 0., 0.
12, 4., 0., 0.
13, 4., 1., 0.
14, 3., 1., 0.
15, 3., 0., 1.
16, 4., 0., 1.
17, 4., 1., 1.
18, 3., 1., 1.
*ELEMENT, TYPE=C3D8, ELSET=EALL
1, 1, 2, 3, 4, 5, 6, 7, 8
2, 11, 12, 13, 14, 15, 16, 17, 18
*ELSET, ELSET=EA
1
*ELSET, ELSET=EB
2
*NSET, NSET=BOTA
1, 2, 3, 4
*NSET, NSET=BOTB
11, 12, 13, 14
*NSET, NSET=CORNERS
7, 17
*SURFACE, NAME=STOPA
EA, S2
*MATERIAL, NAME=STEEL
*ELASTIC
210000., 0.3
*SOLID SECTION, ELSET=EALL, MATERIAL=STEEL
*BOUNDARY
BOTA, 1, 3
BOTB, 1, 3
*STEP
*STATIC
*DLOAD
STOPA, P, 1.
EB, P2, 1.
*NODE PRINT, NSET=CORNERS
U
*NODE PRINT, NSET=BOTA, TOTALS=ONLY
RF
*NODE PRINT, NSET=BOTB, TOTALS=ONLY
RF
*END STEP
Variants of dl_onecard.inp (only the changed lines are listed):
-
dl_twocards.inp: a second card for the element-set line.*DLOAD STOPA, P, 1. *DLOAD EB, P2, 1. -
dl_reversed.inp: the two lines swapped, one card.*DLOAD EB, P2, 1. STOPA, P, 1. -
dl_cube12.inp: cube B numbered 12 instead of 2, in its element line and in set EB.12, 11, 12, 13, 14, 15, 16, 17, 18 ... *ELSET, ELSET=EB 12 -
dl_generate.inp: two more cubes, elements 3 and 4 (nodes 1-8 shifted to x = 6 and x = 9), and EB generated as 2 to 4. Add the nodes after node 18 and the elements after element 2, and replace the sets EB, BOTB and CORNERS:31, 6., 0., 0. 32, 7., 0., 0. 33, 7., 1., 0. 34, 6., 1., 0. 35, 6., 0., 1. 36, 7., 0., 1. 37, 7., 1., 1. 38, 6., 1., 1. 41, 9., 0., 0. 42, 10., 0., 0. 43, 10., 1., 0. 44, 9., 1., 0. 45, 9., 0., 1. 46, 10., 0., 1. 47, 10., 1., 1. 48, 9., 1., 1. ... 3, 31, 32, 33, 34, 35, 36, 37, 38 4, 41, 42, 43, 44, 45, 46, 47, 48 ... *ELSET, ELSET=EB, GENERATE 2, 4, 1 ... *NSET, NSET=BOTB 11, 12, 13, 14, 31, 32, 33, 34, 41, 42, 43, 44 *NSET, NSET=CORNERS 7, 17, 37, 47 -
dl_generate_twocards.inp:dl_generate.inpwith the two*DLOADcards ofdl_twocards.inp. -
ds_onecard.inp:*DSLOADinstead of*DLOAD.
df_onecard.inp (the same with *DFLUX) and its variants
** Heat transfer: two separate unit DC3D8 cubes, conductivity 1., bottom
** held at temperature 0., heat flux 1. into the top face (face 2) of each.
** Cube A (element 1) through the facial surface STOPA, cube B (element 2)
** through the element set EB. Both lines are in one *DFLUX card.
** Expected: NT = 1. at nodes 7 and 17.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 1., 1., 0.
4, 0., 1., 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
11, 3., 0., 0.
12, 4., 0., 0.
13, 4., 1., 0.
14, 3., 1., 0.
15, 3., 0., 1.
16, 4., 0., 1.
17, 4., 1., 1.
18, 3., 1., 1.
*ELEMENT, TYPE=DC3D8, ELSET=EALL
1, 1, 2, 3, 4, 5, 6, 7, 8
2, 11, 12, 13, 14, 15, 16, 17, 18
*ELSET, ELSET=EA
1
*ELSET, ELSET=EB
2
*NSET, NSET=BOT
1, 2, 3, 4, 11, 12, 13, 14
*NSET, NSET=CORNERS
7, 17
*SURFACE, NAME=STOPA
EA, S2
*MATERIAL, NAME=M
*CONDUCTIVITY
1.
*SOLID SECTION, ELSET=EALL, MATERIAL=M
*BOUNDARY
BOT, 11, 11, 0.
*STEP
*HEAT TRANSFER, STEADY STATE
1., 1.
*DFLUX
STOPA, S, 1.
EB, S2, 1.
*NODE PRINT, NSET=CORNERS
NT
*END STEP
-
df_twocards.inp: a second card for the element-set line.*DFLUX STOPA, S, 1. *DFLUX EB, S2, 1. -
fi_onecard.inp: a film condition instead of the flux (sink temperature 20., film coefficient 1.; expected NT = 10. at nodes 7 and 17).films.faccepts only the labels F0 to F6, also on a surface line, where section 7.59 asks for a bare F (reported separately); the digit is replaced by the face of the surface.*FILM STOPA, F2, 20., 1. EB, F2, 20., 1. -
fi_twocards.inp: asfi_onecard.inp, with a second*FILMcard before theEBline.
How to run
ccx dl_onecard
ccx dl_twocards
ccx dl_reversed
ccx dl_cube12
ccx dl_generate
ccx dl_generate_twocards
ccx ds_onecard
ccx df_onecard
ccx df_twocards
ccx fi_onecard
ccx fi_twocards
Expected
Each cube gets its own load, however the lines are spread over cards: U3 = -4.333333E-06 at nodes 7 and 17 and a reaction of 1 per cube; NT = 1 (flux) or 10 (film) at nodes 7 and 17.
Actual
All runs exit with 0 and print no warning.
| deck | U3, node 7 (cube A) | U3, node 17 (cube B) | reaction in z, cube A | reaction in z, cube B |
|---|---|---|---|---|
dl_onecard |
-4.333333E-06 | 0.000000E+00 | 1.000000E+00 | 0.000000E+00 |
dl_twocards |
-4.333333E-06 | -4.333333E-06 | 1.000000E+00 | 1.000000E+00 |
dl_reversed |
-4.333333E-06 | -4.333333E-06 | 1.000000E+00 | 1.000000E+00 |
dl_cube12 |
-8.666667E-06 | 0.000000E+00 | 2.000000E+00 | 0.000000E+00 |
ds_onecard |
-4.333333E-06 | 0.000000E+00 | 1.000000E+00 | 0.000000E+00 |
dl_generate: node 7 has U3 = -4.333333E-06, nodes 17 and 47 (cubes 2 and 4) do not move, and node 37 (cube 3) moves sideways: U1 = -1.224461E-05, U3 = +4.945011E-06. That is the pressure on face 4 (x = 7) of cube 3. dl_generate_twocards: U3 = -4.333333E-06 at nodes 7, 17, 37 and 47.
| deck | NT, node 7 (cube A) | NT, node 17 (cube B) |
|---|---|---|
df_onecard |
1.000000E+00 | 0.000000E+00 |
df_twocards |
1.000000E+00 | 1.000000E+00 |
fi_onecard |
1.000000E+01 | 0.000000E+00 |
fi_twocards |
1.000000E+01 | 1.000000E+01 |
Where it goes wrong
src/dloads.f sets the flag once per card, before the loop over the data lines (line 60):
surface=.false.
A line whose name is not an element set is looked up as a facial surface, and the flag is set (lines 444-449):
if(i.gt.nset) then
!
! check for facial surface
!
surface=.true.
elset(ipos:ipos)='T'
Nothing resets it for the next line. For every later element-set line of the card, the first member (lines 473-477, used to convert the label) and every member in the loop (lines 519-525) are decoded as a surface entry, element*10 + face:
l=ialset(istartset(i))
if(surface) then
write(label(2:2),'(i1)') l-10*(l/10)
l=l/10
endif
So element 2 becomes element 0 with label P2 (lakon(0) is then read at lines 478-496, and loadadd stores the load for element 0), and element 12 becomes element 1 with label P2, which loadadd adds to the load that STOPA already put on that face.
For a generated range the loop takes the other branch (lines 557-594), which has no if(surface). In dl_generate the set is stored as 2, 4, -1. Members 2 and 4 are decoded as element 0 with labels P2 and P4. The interior member 3 keeps its number, but gets the label P4 that member 4 left behind.
The other readers of element sets and facial surfaces have the same pattern (flag cleared once, set for a surface line, never reset):
| routine (card) | cleared | set | decoded |
|---|---|---|---|
dfluxs.f (*DFLUX) |
51 | 235 | 259, 290 |
films.f (*FILM) |
51 | 328 | 352, 379 |
radiates.f (*RADIATE) |
55 | 339 | 360, 387 |
massflows.f (*MASS FLOW) |
46 | 133 | 157, 176 |
boundaryfs.f (*BOUNDARYF) |
61 | 221 | 251 |
I ran *DFLUX and *FILM (above). *RADIATE, *MASS FLOW and *BOUNDARYF I only read.
Fix
Possible fix (not built or tested): clear the flag for every data line, right after getnewline in the line loop (dloads.f line 235, dfluxs.f 146, films.f 218, radiates.f 228, massflows.f 66, boundaryfs.f 143), and drop the assignment before the loop. PR #241 does the same for edgeload in dloads.f:
do
call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
& ipoinp,inp,ipoinpc)
if((istat.lt.0).or.(key.eq.1)) return
!
! a facial surface only applies to its own line
!
surface=.false.
Workaround: give each facial-surface line its own card, or put the element-set lines before the surface lines.