# Quadratic membranes (M3D6, M3D8, M3D8R) fail the uniaxial patch test, and two M3D8R elements form a mechanism

**URL:** <https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188>\
**Category:** Analysis issues\
**Created:** [October 19, 2026, 7:24am UTC](https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188 "2026-10-19T07:24:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandervdb](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sandervdb](https://calculix.discourse.group/u/Sandervdb)\
**Post date:** [October 19, 2026, 7:24am UTC](https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188/1 "2026-10-19T07:24:31Z")

</div>

## Summary

Quadratic membrane elements give wrong in-plane displacements under plain uniaxial tension with consistent nodal forces:

- Two M3D8R elements form a mechanism. Displacements reach 1e11 where 0.12 is exact, and ccx gives no warning.
- Two M3D6 elements are 3.65 times too soft. The error does not shrink with the thickness.
- Two M3D8 elements are 1.3 % too soft at t = 0.1 and 2.83 times too soft at t = 1.

The same meshes are exact with S8R and S6 shells, and the linear membranes M3D4, M3D4R and M3D3 are exact on the same strip. The manual (6.2.17, 6.2.18) describes M3D6, M3D8 and M3D8R as S6, S8 and S8R with hinges, so their in-plane response should match those shells.

## Version

ccx 2.23 (conda-forge build pl5321h484372f\_2, macOS arm64). The routines involved, gen3dmembrane.f and the membrane parts of gen3dnor.f, are the same on master.

## Minimal input

`membrane_quad.inp`: a 2 x 1 strip of two M3D8R elements.

```auto
** Uniaxial tension of a 2 x 1 strip of two 8-node membranes, thickness 0.1.
** E = 1000, nu = 0; total force F = 6 on the edge x = 2, split 1:4:1.
** Exact: sigma = F/(t W) = 60, u_x(x = 2) = sigma L / E = 0.12, u_y = 0.
*NODE, NSET=NALL
1, 0.0, 0.0, 0.0
2, 1.0, 0.0, 0.0
3, 2.0, 0.0, 0.0
4, 0.0, 1.0, 0.0
5, 1.0, 1.0, 0.0
6, 2.0, 1.0, 0.0
7, 0.5, 0.0, 0.0
8, 1.5, 0.0, 0.0
9, 0.5, 1.0, 0.0
10, 1.5, 1.0, 0.0
11, 0.0, 0.5, 0.0
12, 1.0, 0.5, 0.0
13, 2.0, 0.5, 0.0
*ELEMENT, TYPE=M3D8R, ELSET=EALL
1, 1, 2, 5, 4, 7, 12, 9, 11
2, 2, 3, 6, 5, 8, 13, 10, 12
*MATERIAL, NAME=MAT
*ELASTIC
1000.0, 0.0
*MEMBRANE SECTION, ELSET=EALL, MATERIAL=MAT
0.1
*BOUNDARY
1, 1, 2
4, 1, 1
11, 1, 1
NALL, 3, 3
*STEP
*STATIC
*CLOAD
3, 1, 1.0
13, 1, 4.0
6, 1, 1.0
*NODE PRINT, NSET=NALL
U
*END STEP

```

`membrane_tri.inp`: a unit square of two M3D6 elements.

```auto
** Uniaxial tension of a unit square of two 6-node membranes, thickness 0.1.
** E = 1000, nu = 0; total force F = 6 on the edge x = 1, split 1:4:1.
** Exact: sigma = F/(t W) = 60, u_x(x = 1) = sigma L / E = 0.06, u_y = 0.
*NODE, NSET=NALL
1, 0.0, 0.0, 0.0
2, 1.0, 0.0, 0.0
3, 1.0, 1.0, 0.0
4, 0.0, 1.0, 0.0
5, 0.5, 0.0, 0.0
6, 1.0, 0.5, 0.0
7, 0.5, 0.5, 0.0
8, 0.5, 1.0, 0.0
9, 0.0, 0.5, 0.0
*ELEMENT, TYPE=M3D6, ELSET=EALL
1, 1, 2, 3, 5, 6, 7
2, 1, 3, 4, 7, 8, 9
*MATERIAL, NAME=MAT
*ELASTIC
1000.0, 0.0
*MEMBRANE SECTION, ELSET=EALL, MATERIAL=MAT
0.1
*BOUNDARY
1, 1, 2
4, 1, 1
9, 1, 1
NALL, 3, 3
*STEP
*STATIC
*CLOAD
2, 1, 1.0
6, 1, 4.0
3, 1, 1.0
*NODE PRINT, NSET=NALL
U
*END STEP

```

## How to run

```auto
ccx membrane_quad
ccx membrane_tri

```

For the comparisons, change only the element type: M3D8R to M3D8, or M3D8R to S8R and M3D6 to S6 (the shells with `*SHELL SECTION` in place of `*MEMBRANE SECTION`).

## Expected

Uniaxial stress, σ = F/(t·W) = 6/(0.1·1) = 60:

- `membrane_quad`: u\_x = σL/E = 60·2/1000 = **0.12** at nodes 3, 6 and 13, and u\_y = 0.
- `membrane_tri`: u\_x = 60·1/1000 = **0.06** at nodes 2, 3 and 6, and u\_y = 0.

## Actual

Both runs end with “Job finished” and exit code 0, with no warning. SPOOLES does not report a singular matrix either.

`membrane_quad` with M3D8R, `.dat`:

```auto
         3 1.137162E+11 1.402544E+11 8.080501E-06
         6 1.495488E+11 -1.760870E+11 1.318492E-05
        13 1.316325E+11 -1.791629E+10 0.000000E+00

```

`membrane_tri` with M3D6, `.dat`. Node 1 is fixed in x and y but is reported with u\_x = 0.118:

```auto
         1 1.182222E-01 9.630397E-04 7.345822E-17
         2 3.423924E-01 2.019036E-01 -4.740099E-18
         3 8.711579E-02 1.850464E-01 -2.898568E-17
         6 2.190309E-01 1.953883E-01 0.000000E+00

```

Edge displacement u\_x for each element type:

| deck, thickness t | element | u\_x | exact |
| --- | --- | --- | --- |
| quad, 0.1 | M3D8R | 1.316325E+11 | 0.12 |
| quad, 0.1 | M3D8 | 1.215276E-01 (+1.3 %) | 0.12 |
| quad, 1.0 | M3D8 | 3.396809E-02 (2.83 x) | 0.012 |
| quad, 0.1 and 1.0 | S8R | exact | 0.12, 0.012 |
| tri, 0.1 | M3D6 | 2.190309E-01 (3.65 x) | 0.06 |
| tri, 0.01 | M3D6 | 2.184323E+00 (3.64 x) | 0.6 |
| tri, 0.1 | S6 | 6.000000E-02 | 0.06 |
| 2 x 1 strip, 0.1 | M3D4, M3D4R, M3D3 | exact | 0.12 |

A single unit-square element under the same load is also off. M3D8R is 0.67 % too soft and M3D8 0.50 % at t = 0.1; at t = 1 they are 2.0 and 1.74 times too soft.

## Where it goes wrong

Each membrane element gets its own three expanded nodes per node: bottom n\_1, middle n\_2 and top n\_3. gen3dnor.f merges normals only when neither element is a membrane:

```fortran
     & (lakon(iel(j))(1:1).ne.'M').and.
     & (lakon(iel(jact))(1:1).ne.'M').and.

```

Those expanded nodes are connected to the membrane node n only by the hinge that gen3dmembrane.f generates:

```fortran
! generating a hinge at a node of a membrane element
!
! u(n_1)+u(n_3)=2*u(n)

```

At a corner node of a quadratic membrane, n\_2 is a node of the expanded element: nodes 13 to 15 of the C3D15, nodes 17 to 20 of the C3D20(R). The hinge does not contain it. Only gen3dboun.f ties it, with `u(n_2)=u(n)`, and only in directions that carry an SPC at a node that belongs to a single element. So n\_2 is an unloaded node internal to each element:

- With n\_2 free, each corner of the expanded element can bulge through the thickness, so the element itself is too soft; this is not only a question of how a corner force is split. With the edge displacement prescribed instead of a force (no loads at all), the edge reactions of the two-element M3D8 strip sum to 3.44 instead of 6 at t = 1 and to 5.97 at t = 0.1. For M3D8R they sum to 5.96, and the model is not singular in this case. The reactions are still split 1:4:1. For M3D8 the error grows with (t/L)²; for M3D6 it stays near 3.6 times at any thickness.
- For C3D20R, the free nodes 17 to 20 add an hourglass mode. Each element has its own nodes, so no neighbour suppresses it.

To check this, I rebuilt both decks by hand from C3D20R, C3D20 and C3D15 elements, each element with nodes of its own, tied by `*EQUATION`s. With exactly the constraints listed above, the hand-built models reproduce every M3D6 and M3D8 number in the table to all printed digits; for M3D8R they are singular as well.

Adding u(n\_2) = u(n) at every corner node of every element gives exactly 0.12 and 0.06 in these patch tests, for M3D8R too. For M3D6 and M3D8, generating that equation in gen3dmembrane for the corner nodes is the fix. For M3D8R it is not enough on its own.

- Each C3D20R still has a zero-energy mode that lives only in its own through-thickness nodes: u = ζ·(a ξ(η² − 1/3), −b η(ξ² − 1/3), 0), with a and b the half-sides. It has zero strain at all 2×2×2 integration points, and it satisfies both the hinge and the mid-node tie.
- The patch tests don’t excite it. A self-balanced pair of forces on one corner’s expanded nodes gives |u| = 1.7e12 with no warning; the C3D20 version of the same model gives 0.0053.
- Uniform tension on 80 × 80 and 100 × 100 M3D8R strips is up to 4e-4 off with the mid-node tie alone.

Suppressing that mode as well makes M3D8R stable and exact, for example with one more equation per element against it. It leaves a flat element’s stiffness unchanged to 1e-12.

## Workaround

Use the linear membranes M3D4, M3D4R or M3D3, which are exact in these tests. S6, S8 or S8R shells are also exact in-plane, if their bending stiffness is acceptable.

---

<div class="post-metadata">

**Author:** ![Sandervdb](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sandervdb](https://calculix.discourse.group/u/Sandervdb)\
**Post date:** [October 19, 2026, 7:26am UTC](https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188/2 "2026-10-19T07:26:00Z")

</div>

Related issue:

Forum topic:

### Summary

In the first step ccx does not handle a \*DLOAD pressure on membrane elements the way it handles one on shells. With label P (no face number, which the manual allows for shells, and membranes follow the shell rules):

- M3D4, M3D4R, M3D8 and M3D8R make ccx segfault during matrix assembly;
- M3D3 and M3D6 lose the load without any message (the solution is exactly zero).

In the first step, P2 also pushes the opposite way to P1. From the second step on, the same cards behave as they do on shells: P, P1 and P2 all act like P1.

The same unchecked label also crashes ccx on solid and plane elements. \*DLOAD with P and no face number on C3D8 or CPS4 gives a segfault in the same place. The manual requires a face number for these elements, so ccx should stop with an \*ERROR.

### Version

ccx 2.23 (conda-forge build pl5321h484372f\_2, macOS arm64). The code involved (see below) is unchanged on master (9ba5d76c).

### 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 code involved is unchanged on master. conda-forge’s latest 2.23 build (pl5321hd17ca8b\_8) no longer segfaults on the M3D4 deck above, but loses the pressure without a message instead (ridge U3 = 0 instead of 1.633406E-04). M3D8 and M3D8R still crash there (bus error), and M3D3 still loses the load.

### Minimal input

`job.inp`: two M3D4 elements forming a gable roof, with the eaves pinned:

```auto
** Two M3D4 membrane elements forming a gable roof. The four eave nodes
** are pinned; the ridge nodes 3 and 4 are free. Pressure 1 with label P.
*NODE
1,0.,0.,0.
2,1.,0.,0.
3,1.,0.5,0.5
4,0.,0.5,0.5
5,1.,1.,0.
6,0.,1.,0.
*ELEMENT,TYPE=M3D4,ELSET=EALL
1,1,2,3,4
2,4,3,5,6
*NSET,NSET=EAVES
1,2,5,6
*NSET,NSET=RIDGE
3,4
*MATERIAL,NAME=STEEL
*ELASTIC
210000.,0.3
*MEMBRANE SECTION,ELSET=EALL,MATERIAL=STEEL
0.01
*BOUNDARY
EAVES,1,3
*STEP
*STATIC
*DLOAD
EALL,P,1.
*NODE PRINT,NSET=RIDGE
U
*END STEP

```

### How to run

```auto
OMP_NUM_THREADS=1 ccx job

```

### Expected

The pressure should act as it does on shells, or as label P1 does on this deck. With `EALL,P1,1.` the job finishes and both ridge nodes get U3 = 1.633406E-04. The same mesh with S4 elements and label P gives U3 = 1.653278E-04.

### Actual

The last lines of output:

```auto
 Using up to 1 cpu(s) for the stress calculation.

 Using up to 1 cpu(s) for the symmetric stiffness/mass contributions.

```

Then the process dies with SIGSEGV (exit code 139). Backtrace from lldb (the build has no debug info):

```auto
* thread #2, stop reason = EXC_BAD_ACCESS (code=2, address=0x8ef006168)
  * frame #0: 0x00000001000e5794 ccx`e_c3d_ + 36660
    frame #1: 0x00000001001be8c4 ccx`mafillsm_ + 6308
    frame #2: 0x0000000100392dd0 ccx`mafillsmmt + 1020

```

Variants, all run with the same ccx:

| change to `job.inp` | result |
| --- | --- |
| `P1` instead of `P` | finishes; ridge U3 = 1.633406E-04 |
| `P2` instead of `P` | finishes; ridge U3 = -1.617476E-04 (opposite sense) |
| `*DLOAD` with `P` or `P2` moved into a second step (first step empty) | finishes; ridge U3 = 1.633406E-04 |
| one flat M3D4R, M3D8 or M3D8R element, all nodes pinned, `P` | SIGSEGV in `e_c3d_`, as above |
| one C3D8 or CPS4 element with `EALL,P,1.` | SIGSEGV in `e_c3d_`, as above |
| the M3D3 pyramid below, `P` | finishes without a message; apex U = 0 exactly (with `P1`: U3 = 1.030662E-04) |
| one flat M3D6 element, all nodes pinned, `P` | finishes; all reaction forces exactly 0 (with `P1` they are not) |

> **M3D3 deck (load silently lost)**
>
> ```auto
> ** Four M3D3 membrane elements forming a pyramid. The base nodes are
> ** pinned; the apex node 5 is free. Pressure 1 with label P.
> *NODE
> 1,0.,0.,0.
> 2,1.,0.,0.
> 3,1.,1.,0.
> 4,0.,1.,0.
> 5,0.5,0.5,0.5
> *ELEMENT,TYPE=M3D3,ELSET=EALL
> 1,1,2,5
> 2,2,3,5
> 3,3,4,5
> 4,4,1,5
> *NSET,NSET=BASE
> 1,2,3,4
> *NSET,NSET=APEX
> 5
> *MATERIAL,NAME=STEEL
> *ELASTIC
> 210000.,0.3
> *MEMBRANE SECTION,ELSET=EALL,MATERIAL=STEEL
> 0.01
> *BOUNDARY
> BASE,1,3
> *STEP
> *STATIC
> *DLOAD
> EALL,P,1.
> *NODE PRINT,NSET=APEX
> U
> *END STEP
> 
> ```

### Where it goes wrong

- **dloads.f.** On a shell, any pressure label becomes P1. dloads.f recognises a shell by `lakon(l)(1:1).eq.'S'` (before expansion) or `lakon(l)(7:7).eq.'L'` (after expansion). This is in both the element branch and the element-set branch (master lines 373–374 and 495–496). A membrane keeps its lakon `M3D…` until gen3delem expands it. calinput calls gen3delem only after it has read all the cards of the first step. In the first step the membrane therefore matches neither test, and the label stays as typed. In later steps the lakon is `C3D8 L`, `C3D6 L`, etc., so P works there.
- **The label check in dloads.f** accepts `P ` with no face number for any element type.
- **e\_c3d.f** then computes the face number as `ig=ichar(sideload(id)(2:2))-48` (master line 1320). For a blank this is -16, and `ifaceq(i,ig)` is read out of bounds. For hexahedra this crashes. For the wedges that M3D3 and M3D6 expand into, the load is lost.

A possible fix:

- in dloads.f, treat unexpanded membranes like shells, e.g. also test `lakon(l)(1:3).eq.'M3D'`;
- reject a pressure label without a face number for elements that are neither shells nor membranes.

### Workaround

On membranes in the first step, use label P1. That is what ccx uses for shells, and for membranes in later steps. Alternatively, apply the pressure in a later step.

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [October 19, 2026, 8:35am UTC](https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188/3 "2026-10-19T08:35:57Z")

</div>

Both issues confirmed (using official build of ccx 2.23 on Windows), need GitHub ticket(s).

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

         1 0.000000E+00 0.000000E+00 0.000000E+00
         2 -9.482293E-02 4.763955E+10 -1.329184E-05
         3 9.594657E+10 -1.858124E+10 0.000000E+00
         4 0.000000E+00 4.009147E-02 0.000000E+00
         5 -1.052164E-01 -4.763955E+10 -1.950264E-04
         6 8.845739E+10 2.607042E+10 0.000000E+00
         7 -4.782123E-02 2.381978E+10 0.000000E+00
         8 4.797329E+10 1.452916E+10 0.000000E+00
         9 -5.213798E-02 -2.381978E+10 0.000000E+00
        10 4.422870E+10 -1.078457E+10 0.000000E+00
        11 0.000000E+00 1.971598E-02 0.000000E+00
        12 1.411020E-01 2.350782E-02 0.000000E+00
        13 9.220198E+10 3.744588E+09 0.000000E+00

```

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

         1 1.182222E-01 9.630397E-04 -1.804112E-16
         2 3.423924E-01 2.019036E-01 0.000000E+00
         3 8.711579E-02 1.850464E-01 2.081668E-16
         4 0.000000E+00 1.865804E-02 0.000000E+00
         5 1.690953E-01 9.648740E-02 0.000000E+00
         6 2.190309E-01 1.953883E-01 0.000000E+00
         7 4.790977E-02 8.742099E-02 0.000000E+00
         8 4.123189E-02 9.603720E-02 0.000000E+00
         9 0.000000E+00 1.034195E-02 0.000000E+00

```

```auto
 STEP 1

 Static analysis was selected

 Decascading the MPC's

 Determining the structure of the matrix:
 Using up to 1 cpu(s) for setting up the structure of the matrix.
 number of equations
 30
 number of nonzero lower triangular matrix elements
 291

 Using up to 1 cpu(s) for the stress calculation.

 Using up to 1 cpu(s) for the symmetric stiffness/mass contributions.

```

---

<div class="post-metadata">

**Author:** ![Sandervdb](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sandervdb](https://calculix.discourse.group/u/Sandervdb)\
**Post date:** [October 19, 2026, 8:38am UTC](https://calculix.discourse.group/t/quadratic-membranes-m3d6-m3d8-m3d8r-fail-the-uniaxial-patch-test-and-two-m3d8r-elements-form-a-mechanism/4188/4 "2026-10-19T08:38:58Z")

</div>

Posted

> <https://github.com/Dhondtguido/CalculiX/issues/215>
>
> Forum topic: https://calculix.discourse.group/t/4188
> 
> \## Summary
> 
> Quadratic memb…rane elements give wrong in-plane displacements under plain uniaxial tension with consistent nodal forces:
> 
> \- Two M3D8R elements form a mechanism. Displacements reach 1e11 where 0.12 is exact, and ccx gives no warning.
> \- Two M3D6 elements are 3.65 times too soft. The error does not shrink with the thickness.
> \- Two M3D8 elements are 1.3 % too soft at t = 0.1 and 2.83 times too soft at t = 1.
> 
> The same meshes are exact with S8R and S6 shells, and the linear membranes M3D4, M3D4R and M3D3 are exact on the same strip. The manual (6.2.17, 6.2.18) describes M3D6, M3D8 and M3D8R as S6, S8 and S8R with hinges, so their in-plane response should match those shells.
> 
> \## Version
> 
> ccx 2.23 (conda-forge build pl5321h484372f\_2, macOS arm64). The routines involved, gen3dmembrane.f and the membrane parts of gen3dnor.f, are the same on master.
> 
> \## 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 before the one linked above (searched 19 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
> 
> \`membrane\_quad.inp\`: a 2 x 1 strip of two M3D8R elements.
> 
> \`\`\`
> \*\* Uniaxial tension of a 2 x 1 strip of two 8-node membranes, thickness 0.1.
> \*\* E = 1000, nu = 0; total force F = 6 on the edge x = 2, split 1:4:1.
> \*\* Exact: sigma = F/(t W) = 60, u\_x(x = 2) = sigma L / E = 0.12, u\_y = 0.
> \*NODE, NSET=NALL
> 1, 0.0, 0.0, 0.0
> 2, 1.0, 0.0, 0.0
> 3, 2.0, 0.0, 0.0
> 4, 0.0, 1.0, 0.0
> 5, 1.0, 1.0, 0.0
> 6, 2.0, 1.0, 0.0
> 7, 0.5, 0.0, 0.0
> 8, 1.5, 0.0, 0.0
> 9, 0.5, 1.0, 0.0
> 10, 1.5, 1.0, 0.0
> 11, 0.0, 0.5, 0.0
> 12, 1.0, 0.5, 0.0
> 13, 2.0, 0.5, 0.0
> \*ELEMENT, TYPE=M3D8R, ELSET=EALL
> 1, 1, 2, 5, 4, 7, 12, 9, 11
> 2, 2, 3, 6, 5, 8, 13, 10, 12
> \*MATERIAL, NAME=MAT
> \*ELASTIC
> 1000.0, 0.0
> \*MEMBRANE SECTION, ELSET=EALL, MATERIAL=MAT
> 0.1
> \*BOUNDARY
> 1, 1, 2
> 4, 1, 1
> 11, 1, 1
> NALL, 3, 3
> \*STEP
> \*STATIC
> \*CLOAD
> 3, 1, 1.0
> 13, 1, 4.0
> 6, 1, 1.0
> \*NODE PRINT, NSET=NALL
> U
> \*END STEP
> \`\`\`
> 
> \`membrane\_tri.inp\`: a unit square of two M3D6 elements.
> 
> \`\`\`
> \*\* Uniaxial tension of a unit square of two 6-node membranes, thickness 0.1.
> \*\* E = 1000, nu = 0; total force F = 6 on the edge x = 1, split 1:4:1.
> \*\* Exact: sigma = F/(t W) = 60, u\_x(x = 1) = sigma L / E = 0.06, u\_y = 0.
> \*NODE, NSET=NALL
> 1, 0.0, 0.0, 0.0
> 2, 1.0, 0.0, 0.0
> 3, 1.0, 1.0, 0.0
> 4, 0.0, 1.0, 0.0
> 5, 0.5, 0.0, 0.0
> 6, 1.0, 0.5, 0.0
> 7, 0.5, 0.5, 0.0
> 8, 0.5, 1.0, 0.0
> 9, 0.0, 0.5, 0.0
> \*ELEMENT, TYPE=M3D6, ELSET=EALL
> 1, 1, 2, 3, 5, 6, 7
> 2, 1, 3, 4, 7, 8, 9
> \*MATERIAL, NAME=MAT
> \*ELASTIC
> 1000.0, 0.0
> \*MEMBRANE SECTION, ELSET=EALL, MATERIAL=MAT
> 0.1
> \*BOUNDARY
> 1, 1, 2
> 4, 1, 1
> 9, 1, 1
> NALL, 3, 3
> \*STEP
> \*STATIC
> \*CLOAD
> 2, 1, 1.0
> 6, 1, 4.0
> 3, 1, 1.0
> \*NODE PRINT, NSET=NALL
> U
> \*END STEP
> \`\`\`
> 
> \## How to run
> 
> \`\`\`
> ccx membrane\_quad
> ccx membrane\_tri
> \`\`\`
> 
> For the comparisons, change only the element type: M3D8R to M3D8, or M3D8R to S8R and M3D6 to S6 (the shells with \`\*SHELL SECTION\` in place of \`\*MEMBRANE SECTION\`).
> 
> \## Expected
> 
> Uniaxial stress, σ = F/(t·W) = 6/(0.1·1) = 60:
> 
> \- \`membrane\_quad\`: u\_x = σL/E = 60·2/1000 = \*\*0.12\*\* at nodes 3, 6 and 13, and u\_y = 0.
> \- \`membrane\_tri\`: u\_x = 60·1/1000 = \*\*0.06\*\* at nodes 2, 3 and 6, and u\_y = 0.
> 
> \## Actual
> 
> Both runs end with "Job finished" and exit code 0, with no warning. SPOOLES does not report a singular matrix either.
> 
> \`membrane\_quad\` with M3D8R, \`.dat\`:
> 
> \`\`\`
> 3 1.137162E+11 1.402544E+11 8.080501E-06
> 6 1.495488E+11 -1.760870E+11 1.318492E-05
> 13 1.316325E+11 -1.791629E+10 0.000000E+00
> \`\`\`
> 
> \`membrane\_tri\` with M3D6, \`.dat\`. Node 1 is fixed in x and y but is reported with u\_x = 0.118:
> 
> \`\`\`
> 1 1.182222E-01 9.630397E-04 7.345822E-17
> 2 3.423924E-01 2.019036E-01 -4.740099E-18
> 3 8.711579E-02 1.850464E-01 -2.898568E-17
> 6 2.190309E-01 1.953883E-01 0.000000E+00
> \`\`\`
> 
> Edge displacement u\_x for each element type:
> 
> | deck, thickness t | element | u\_x | exact |
> |---|---|---|---|
> | quad, 0.1 | M3D8R | 1.316325E+11 | 0.12 |
> | quad, 0.1 | M3D8 | 1.215276E-01 (+1.3 %) | 0.12 |
> | quad, 1.0 | M3D8 | 3.396809E-02 (2.83 x) | 0.012 |
> | quad, 0.1 and 1.0 | S8R | exact | 0.12, 0.012 |
> | tri, 0.1 | M3D6 | 2.190309E-01 (3.65 x) | 0.06 |
> | tri, 0.01 | M3D6 | 2.184323E+00 (3.64 x) | 0.6 |
> | tri, 0.1 | S6 | 6.000000E-02 | 0.06 |
> | 2 x 1 strip, 0.1 | M3D4, M3D4R, M3D3 | exact | 0.12 |
> 
> A single unit-square element under the same load is also off. M3D8R is 0.67 % too soft and M3D8 0.50 % at t = 0.1; at t = 1 they are 2.0 and 1.74 times too soft.
> 
> \## Where it goes wrong
> 
> Each membrane element gets its own three expanded nodes per node: bottom n\_1, middle n\_2 and top n\_3. gen3dnor.f merges normals only when neither element is a membrane:
> 
> \`\`\`fortran
> & (lakon(iel(j))(1:1).ne.'M').and.
> & (lakon(iel(jact))(1:1).ne.'M').and.
> \`\`\`
> 
> Those expanded nodes are connected to the membrane node n only by the hinge that gen3dmembrane.f generates:
> 
> \`\`\`fortran
> ! generating a hinge at a node of a membrane element
> !
> ! u(n\_1)+u(n\_3)=2\*u(n)
> \`\`\`
> 
> At a corner node of a quadratic membrane, n\_2 is a node of the expanded element: nodes 13 to 15 of the C3D15, nodes 17 to 20 of the C3D20(R). The hinge does not contain it. Only gen3dboun.f ties it, with \`u(n\_2)=u(n)\`, and only in directions that carry an SPC at a node that belongs to a single element. So n\_2 is an unloaded node internal to each element:
> 
> \- With n\_2 free, each corner of the expanded element can bulge through the thickness, so the element itself is too soft; this is not only a question of how a corner force is split. With the edge displacement prescribed instead of a force (no loads at all), the edge reactions of the two-element M3D8 strip sum to 3.44 instead of 6 at t = 1 and to 5.97 at t = 0.1. For M3D8R they sum to 5.96, and the model is not singular in this case. The reactions are still split 1:4:1. For M3D8 the error grows with (t/L)²; for M3D6 it stays near 3.6 times at any thickness.
> \- For C3D20R, the free nodes 17 to 20 add an hourglass mode. Each element has its own nodes, so no neighbour suppresses it.
> 
> To check this, I rebuilt both decks by hand from C3D20R, C3D20 and C3D15 elements, each element with nodes of its own, tied by \`\*EQUATION\`s. With exactly the constraints listed above, the hand-built models reproduce every M3D6 and M3D8 number in the table to all printed digits; for M3D8R they are singular as well.
> 
> Adding u(n\_2) = u(n) at every corner node of every element gives exactly 0.12 and 0.06 in these patch tests, for M3D8R too. For M3D6 and M3D8, generating that equation in gen3dmembrane for the corner nodes is the fix. For M3D8R it is not enough on its own.
> \- Each C3D20R still has a zero-energy mode that lives only in its own through-thickness nodes: u = ζ·(a ξ(η² − 1/3), −b η(ξ² − 1/3), 0), with a and b the half-sides. It has zero strain at all 2×2×2 integration points, and it satisfies both the hinge and the mid-node tie.
> \- The patch tests don't excite it. A self-balanced pair of forces on one corner's expanded nodes gives |u| = 1.7e12 with no warning; the C3D20 version of the same model gives 0.0053.
> \- Uniform tension on 80 × 80 and 100 × 100 M3D8R strips is up to 4e-4 off with the mid-node tie alone.
> 
> Suppressing that mode as well makes M3D8R stable and exact, for example with one more equation per element against it. It leaves a flat element's stiffness unchanged to 1e-12.
> 
> \## Workaround
> 
> Use the linear membranes M3D4, M3D4R or M3D3, which are exact in these tests. S6, S8 or S8R shells are also exact in-plane, if their bending stiffness is acceptable.

> <https://github.com/Dhondtguido/CalculiX/issues/216>
>
> Forum topic: https://calculix.discourse.group/t/4188/2
> 
> \### Summary
> 
> In the firs…t step ccx does not handle a \*DLOAD pressure on membrane elements the way it handles one on shells. With label P (no face number, which the manual allows for shells, and membranes follow the shell rules):
> 
> \- M3D4, M3D4R, M3D8 and M3D8R make ccx segfault during matrix assembly;
> \- M3D3 and M3D6 lose the load without any message (the solution is exactly zero).
> 
> In the first step, P2 also pushes the opposite way to P1. From the second step on, the same cards behave as they do on shells: P, P1 and P2 all act like P1.
> 
> The same unchecked label also crashes ccx on solid and plane elements. \*DLOAD with P and no face number on C3D8 or CPS4 gives a segfault in the same place. The manual requires a face number for these elements, so ccx should stop with an \*ERROR.
> 
> \### Version
> 
> ccx 2.23 (conda-forge build pl5321h484372f\_2, macOS arm64). The code involved (see below) is unchanged on master (9ba5d76c).
> 
> \### 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 before the one linked above (searched 19 Oct 2026). Not fixed: the code involved is unchanged on master. conda-forge's latest 2.23 build (pl5321hd17ca8b\_8) no longer segfaults on the M3D4 deck above, but loses the pressure without a message instead (ridge U3 = 0 instead of 1.633406E-04). M3D8 and M3D8R still crash there (bus error), and M3D3 still loses the load.
> 
> \### Minimal input
> 
> \`job.inp\`: two M3D4 elements forming a gable roof, with the eaves pinned:
> 
> \`\`\`
> \*\* Two M3D4 membrane elements forming a gable roof. The four eave nodes
> \*\* are pinned; the ridge nodes 3 and 4 are free. Pressure 1 with label P.
> \*NODE
> 1,0.,0.,0.
> 2,1.,0.,0.
> 3,1.,0.5,0.5
> 4,0.,0.5,0.5
> 5,1.,1.,0.
> 6,0.,1.,0.
> \*ELEMENT,TYPE=M3D4,ELSET=EALL
> 1,1,2,3,4
> 2,4,3,5,6
> \*NSET,NSET=EAVES
> 1,2,5,6
> \*NSET,NSET=RIDGE
> 3,4
> \*MATERIAL,NAME=STEEL
> \*ELASTIC
> 210000.,0.3
> \*MEMBRANE SECTION,ELSET=EALL,MATERIAL=STEEL
> 0.01
> \*BOUNDARY
> EAVES,1,3
> \*STEP
> \*STATIC
> \*DLOAD
> EALL,P,1.
> \*NODE PRINT,NSET=RIDGE
> U
> \*END STEP
> \`\`\`
> 
> \### How to run
> 
> \`\`\`
> OMP\_NUM\_THREADS=1 ccx job
> \`\`\`
> 
> \### Expected
> 
> The pressure should act as it does on shells, or as label P1 does on this deck. With \`EALL,P1,1.\` the job finishes and both ridge nodes get U3 = 1.633406E-04. The same mesh with S4 elements and label P gives U3 = 1.653278E-04.
> 
> \### Actual
> 
> The last lines of output:
> 
> \`\`\`
> Using up to 1 cpu(s) for the stress calculation.
> 
> Using up to 1 cpu(s) for the symmetric stiffness/mass contributions.
> 
> \`\`\`
> 
> Then the process dies with SIGSEGV (exit code 139). Backtrace from lldb (the build has no debug info):
> 
> \`\`\`
> \* thread #2, stop reason = EXC\_BAD\_ACCESS (code=2, address=0x8ef006168)
> \* frame #0: 0x00000001000e5794 ccx\`e\_c3d\_ + 36660
> frame #1: 0x00000001001be8c4 ccx\`mafillsm\_ + 6308
> frame #2: 0x0000000100392dd0 ccx\`mafillsmmt + 1020
> \`\`\`
> 
> Variants, all run with the same ccx:
> 
> | change to \`job.inp\` | result |
> |---|---|
> | \`P1\` instead of \`P\` | finishes; ridge U3 = 1.633406E-04 |
> | \`P2\` instead of \`P\` | finishes; ridge U3 = -1.617476E-04 (opposite sense) |
> | \`\*DLOAD\` with \`P\` or \`P2\` moved into a second step (first step empty) | finishes; ridge U3 = 1.633406E-04 |
> | one flat M3D4R, M3D8 or M3D8R element, all nodes pinned, \`P\` | SIGSEGV in \`e\_c3d\_\`, as above |
> | one C3D8 or CPS4 element with \`EALL,P,1.\` | SIGSEGV in \`e\_c3d\_\`, as above |
> | the M3D3 pyramid below, \`P\` | finishes without a message; apex U = 0 exactly (with \`P1\`: U3 = 1.030662E-04) |
> | one flat M3D6 element, all nodes pinned, \`P\` | finishes; all reaction forces exactly 0 (with \`P1\` they are not) |
> 
> \<details\>\<summary\>M3D3 deck (load silently lost)\</summary\>
> 
> \`\`\`
> \*\* Four M3D3 membrane elements forming a pyramid. The base nodes are
> \*\* pinned; the apex node 5 is free. Pressure 1 with label P.
> \*NODE
> 1,0.,0.,0.
> 2,1.,0.,0.
> 3,1.,1.,0.
> 4,0.,1.,0.
> 5,0.5,0.5,0.5
> \*ELEMENT,TYPE=M3D3,ELSET=EALL
> 1,1,2,5
> 2,2,3,5
> 3,3,4,5
> 4,4,1,5
> \*NSET,NSET=BASE
> 1,2,3,4
> \*NSET,NSET=APEX
> 5
> \*MATERIAL,NAME=STEEL
> \*ELASTIC
> 210000.,0.3
> \*MEMBRANE SECTION,ELSET=EALL,MATERIAL=STEEL
> 0.01
> \*BOUNDARY
> BASE,1,3
> \*STEP
> \*STATIC
> \*DLOAD
> EALL,P,1.
> \*NODE PRINT,NSET=APEX
> U
> \*END STEP
> \`\`\`
> 
> \</details\>
> 
> \### Where it goes wrong
> 
> \- \*\*dloads.f.\*\* On a shell, any pressure label becomes P1. dloads.f recognises a shell by \`lakon(l)(1:1).eq.'S'\` (before expansion) or \`lakon(l)(7:7).eq.'L'\` (after expansion). This is in both the element branch and the element-set branch (master lines 373–374 and 495–496). A membrane keeps its lakon \`M3D…\` until gen3delem expands it. calinput calls gen3delem only after it has read all the cards of the first step. In the first step the membrane therefore matches neither test, and the label stays as typed. In later steps the lakon is \`C3D8 L\`, \`C3D6 L\`, etc., so P works there.
> \- \*\*The label check in dloads.f\*\* accepts \`P \` with no face number for any element type.
> \- \*\*e\_c3d.f\*\* then computes the face number as \`ig=ichar(sideload(id)(2:2))-48\` (master line 1320). For a blank this is -16, and \`ifaceq(i,ig)\` is read out of bounds. For hexahedra this crashes. For the wedges that M3D3 and M3D6 expand into, the load is lost.
> 
> A possible fix:
> 
> \- in dloads.f, treat unexpanded membranes like shells, e.g. also test \`lakon(l)(1:3).eq.'M3D'\`;
> \- reject a pressure label without a face number for elements that are neither shells nor membranes.
> 
> \### Workaround
> 
> On membranes in the first step, use label P1. That is what ccx uses for shells, and for membranes in later steps. Alternatively, apply the pressure in a later step.
