*MPC silently ignores an undefined node set, so a second PLANE/STRAIGHT line in one card joins the first MPC

Summary

According to the manual (*MPC), one *MPC card defines one MPC. The second line holds the MPC name and nodes, and any following lines hold more nodes. A non-numeric entry on those lines is read as a node set. If that set does not exist, mpcs.f is meant to stop with “node set … has not been defined yet”. That check can never fire, so an undefined set name is skipped without any message.

The consequence shows up when a card holds several MPCs, one per line, as Abaqus allows. The type word on the second line is skipped as an unknown set, and that line’s nodes silently become further nodes of the first MPC. With PLANE or STRAIGHT, they are pulled onto the first plane or line. With two BEAM lines, ccx stops with the misleading message *ERROR in beammpc: increase nk_.

Version

ccx 2.23 (conda-forge build pl5321h484372f_2, macOS arm64). mpcs.f on master (9ba5d76, 2026-10-16) still has the same check; I have not run master. The open PR #190 adds a node-number check to mpcs.f but leaves the set lookup as it is.

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.

Minimal input

mpc_oneCard.inp:

** the same two PLANE MPCs written as two lines of one *MPC card
** plane 1: nodes 1,2,3 at z=0, node 4 stays in it; plane 2: nodes 5,6,7 at z=1, node 8 stays in it
** nodes 1,2,3,5,6,7 sit on z-springs (k=100); plane 1 is pushed up by 1 per node, plane 2 by 2
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 0., 1., 0.
4, 0.3, 0.3, 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 0., 1., 1.
8, 0.3, 0.3, 1.
*ELEMENT, TYPE=SPRING1, ELSET=EK
1, 1
2, 2
3, 3
5, 5
6, 6
7, 7
*SPRING, ELSET=EK
3
100.
*BOUNDARY
NALL, 1, 2
*MPC
PLANE, 1, 2, 3, 4
PLANE, 5, 6, 7, 8
*STEP
*STATIC
1., 1., 1.e-5, 1.
*CLOAD
1, 3, 1.
2, 3, 1.
3, 3, 1.
5, 3, 2.
6, 3, 2.
7, 3, 2.
*NODE PRINT, NSET=NALL
U
*END STEP

mpc_ref.inp is the same deck with each MPC in its own card:

*MPC
PLANE, 1, 2, 3, 4
*MPC
PLANE, 5, 6, 7, 8

How to run

ccx mpc_ref
ccx mpc_oneCard

Expected

There are two ways to read mpc_oneCard:

  • By the manual’s syntax, “PLANE” on the second line is neither a node number nor a defined node set, so ccx should stop with an error.
  • Read as two MPCs, each plane translates rigidly: u3 = 1/100 = 1.0E-02 for nodes 1–4 and u3 = 2/100 = 2.0E-02 for nodes 5–8. mpc_ref gives exactly this.

Actual

mpc_oneCard finishes with “Job finished”, no warning and no error:

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

         1  0.000000E+00  0.000000E+00  5.150000E-01
         2  0.000000E+00  0.000000E+00  5.150000E-01
         3  0.000000E+00  0.000000E+00  5.150000E-01
         4  0.000000E+00  0.000000E+00  5.150000E-01
         5  0.000000E+00  0.000000E+00 -4.850000E-01
         6  0.000000E+00  0.000000E+00 -4.850000E-01
         7  0.000000E+00  0.000000E+00 -4.850000E-01
         8  0.000000E+00  0.000000E+00 -4.850000E-01

Nodes 5–8 end at z = 0.515, the height of plane 1. They were made to stay in the plane of nodes 1, 2 and 3.

Related observations:

  • A STRAIGHT version of this model, with two lines in one card, gives the same pattern: the second line’s nodes are moved onto the first line.
  • PLANE, 1, 2, 3, 4, NOSUCHSET (or AAA) in a single card runs without any message.
  • Two BEAM lines in one card stop with *ERROR in beammpc: increase nk_.

Where it goes wrong

mpcs.f, lines 80–85 and 94–137 on master. Every line after the first is read as nodes (istart=1), and a non-numeric entry is looked up as a node set:

               call cident81(set,noset,nset,j)
               if(j.gt.0) then
                 if(noset.eq.set(j)) then
                   ... (loop over the set's nodes)
                 endif
               endif
               if(j.gt.nset) then
                  noset(ipos:ipos)=' '
                  write(*,*) '*ERROR in nosets: node set ',
     &                 noset
                  write(*,*) '       has not been defined yet'

cident81 returns 0 ≤ j ≤ nset, so j.gt.nset is never true. The check was written for the earlier linear search (do j=1,nset ... enddo, which left j = nset+1 when nothing matched). That loop was commented out and later removed in 9054589f, but the test was never adapted. boundarys.f and equations.f use the correct pattern:

            call cident81(set,noset,nset,id)
            i=nset+1
            if(id.gt.0) then
              if(noset.eq.set(id)) then
                i=id
              endif
            endif
            if(i.gt.nset) then   ! error

After the skipped token, inode keeps counting, so planempc/straightmpc treat the second line’s nodes as further nodes of the first plane or line (here the 5th to 8th node of the first plane). beammpc makes an MPC (and an extra node) for every node after the second, while allocation.f reserves one extra node per card, hence “increase nk_”.

The fix is to use the boundarys.f pattern in mpcs.f. A check that a BEAM MPC has exactly two nodes would also replace the “increase nk_” message.

Workaround

Put each MPC in its own *MPC card, and check node set names in *MPC cards by hand.

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

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

         1  0.000000E+00  0.000000E+00  5.150000E-01
         2  0.000000E+00  0.000000E+00  5.150000E-01
         3  0.000000E+00  0.000000E+00  5.150000E-01
         4  0.000000E+00  0.000000E+00  5.150000E-01
         5  0.000000E+00  0.000000E+00 -4.850000E-01
         6  0.000000E+00  0.000000E+00 -4.850000E-01
         7  0.000000E+00  0.000000E+00 -4.850000E-01
         8  0.000000E+00  0.000000E+00 -4.850000E-01

Posted: *MPC silently ignores an undefined node set, so a second PLANE/STRAIGHT line in one card joins the first MPC · Issue #213 · Dhondtguido/CalculiX · GitHub

1 Like