# To Output Element Stiffness Matrix for 3D element

**URL:** <https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013>\
**Category:** Uncategorized\
**Created:** [January 8, 2024, 3:53pm UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013 "2024-01-08T15:53:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)\
**Post date:** [January 8, 2024, 3:53pm UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/1 "2024-01-08T15:53:19Z")

</div>

Dear Calculix Community,

I am reaching out to seek assistance regarding an issue I have encountered while attempting to output the element stiffness matrix for 3D element in Calculix using the substructure approach.

I have created a inputfile for a single hexahedral element 4 nodes are fixed and 4 opposite nodes are loaded along x.

I have defined this single element as a substructure and trying to output element stiffness, but getting a \*WARNING: no degrees of freedom in the model (see attachments). I have also attached input file.

I appreciate your time and attention to this matter. Thank you in advance for your support.

Looking forward to your prompt response.

Thanks,  
Anoop

\*\*  
\*\* Heading +++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Heading  
Hash: T8RZsaOT, Date: 01/08/2024, Unit system: MM\_TON\_S\_C  
\*\*  
\*\* Nodes +++++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Node  
1, 0.00000000E+000, 0.00000000E+000, 1.00000000E+000  
2, 0.00000000E+000, 1.00000000E+000, 1.00000000E+000  
3, 0.00000000E+000, 1.00000000E+000, 0.00000000E+000  
4, 0.00000000E+000, 0.00000000E+000, 0.00000000E+000  
5, 2.00000000E+000, 0.00000000E+000, 1.00000000E+000  
6, 2.00000000E+000, 1.00000000E+000, 1.00000000E+000  
7, 2.00000000E+000, 1.00000000E+000, 0.00000000E+000  
8, 2.00000000E+000, 0.00000000E+000, 0.00000000E+000  
\*\*  
\*\* Elements ++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Element, Type=C3D8, Elset=Solid\_part-1  
1, 4, 3, 2, 1, 8, 7, 6, 5  
\*Nset, Nset=Internal\_Selection-1\_Fixed-1  
1, 2, 3, 4  
\*Nset, Nset=Internal\_Selection-1\_Concentrated\_Force-1  
5, 6, 7, 8  
\*Elset, Elset=Internal\_Selection-1\_Solid\_Section-1  
Solid\_part-1  
\*Material, Name=Steel  
\*Elastic  
210000, 0.3  
\*Solid section, Elset=Internal\_Selection-1\_Solid\_Section-1, Material=Steel  
\*Step  
\*Static  
\*Output, Frequency=1  
\*Boundary, op=New  
\*\* Name: Fixed-1  
\*Boundary  
Internal\_Selection-1\_Fixed-1, 1, 6, 0  
\*Cload, op=New  
\*Dload, op=New  
\*\* Name: Concentrated\_Force-1  
\*Cload  
Internal\_Selection-1\_Concentrated\_Force-1, 1, 1000

\*Node file  
RF, U  
\*El file  
S, E  
\*End step

\*NSET,NSET=NALL,GENERATE  
1,8  
\*STEP  
\*SUBSTRUCTURE GENERATE  
\*RETAINED NODAL DOFS,SORTED=NO  
NALL,1,3  
\*SUBSTRUCTURE MATRIX OUTPUT,STIFFNESS=YES,OUTPUT FILE=USER DEFINED,FILE NAME=Hexahedral\_prepomax\_substructure  
\*END STEP

 ![Segmentation fault](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/2/222f798229ba1d2773a0a5a7746d7f4669a20586.png)

---

<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:** [January 8, 2024, 4:17pm UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/2 "2024-01-08T16:17:48Z")

</div>

Why do you stick to do substructure approach instead of matrix output from frequency step ? Substructures are quite specific, they require the definition of retained nodes (nodes that will be used to connect them to the rest of the model in a subsequent substructure usage analysis) among others.

---

<div class="post-metadata">

**Author:** ![Disla](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/disla/32/3548_2.png) [@Disla](https://calculix.discourse.group/u/Disla)\
**Post date:** [January 8, 2024, 5:13pm UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/3 "2024-01-08T17:13:05Z")

</div>

HI ,

I have been able to extract it with the substructure card but increasing the number of the nodes with a new element.  
It wasn’t working if i started from 1 to 8. Maybe there is some counting issue in the loop or maybe it was just me writing wrong the card and puzzling ccx. Not sure.¿?¿  
Is that your expected matrix?

```auto
** Generated by Mecway 23
*NODE
1,0,0,0
2,0.001,0,0
3,0.001,0.001,0
4,0,0.001,0
5,0,0,0.001
6,0.001,0,0.001
7,0.001,0.001,0.001
8,0,0.001,0.001
9,0,0.002,0
10,0.001,0.002,0
11,0.001,0.003,0
12,0,0.003,0
13,0,0.002,0.001
14,0.001,0.002,0.001
15,0.001,0.003,0.001
16,0,0.003,0.001
*ELEMENT,TYPE=C3D8
1,1,2,3,4,5,6,7,8
2,9,10,11,12,13,14,15,16
*NSET,NSET=Internal_Selection-1_Fixed-1
1
2
3
4
9
10
11
12
*NSET,NSET=Force
5
6
7
8
13
14
15
16
*NSET,NSET=NALL
9
10
11
12
*ELSET,ELSET=Solid_part-1
1
2
*MATERIAL,NAME=Steel
*ELASTIC,TYPE=ISOTROPIC
210000000000,0.3
*DENSITY
7850
*SOLID SECTION,ELSET=Solid_part-1,MATERIAL=Steel
*BOUNDARY
1,1,,0
1,2,,0
1,3,,0
2,3,,0
3,3,,0
4,3,,0
4,1,,0
9,1,,0
9,2,,0
9,3,,0
10,3,,0
11,3,,0
12,3,,0
12,1,,0
*STEP
*STATIC,SOLVER=PARDISO
*CLOAD
9,3,25000
10,3,25000
11,3,25000
12,3,25000
*NODE FILE,GLOBAL=YES
U,RF
*EL FILE
S,NOE
*END STEP

*NSET,NSET=NALL,GENERATE
9,16,1

*STEP
*SUBSTRUCTURE GENERATE
*RETAINED NODAL DOFS,SORTED=NO
9,1,3
10,1,3
11,1,3
12,1,3
13,1,3
14,1,3
15,1,3
16,1,3

*SUBSTRUCTURE MATRIX OUTPUT,STIFFNESS=YES,OUTPUT FILE=USER DEFINED,FILE NAME=Hexa
*END STEP

```

---

<div class="post-metadata">

**Author:** ![Disla](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/disla/32/3548_2.png) [@Disla](https://calculix.discourse.group/u/Disla)\
**Post date:** [January 9, 2024, 7:34am UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/4 "2024-01-09T07:34:27Z")

</div>

Updated Version with nodes from 1 to 8.

```auto
**
** Heading +++++++++++++++++++++++++++++++++++++++++++++++++
**
*Heading
Hash: T8RZsaOT, Date: 01/08/2024, Unit system: MM_TON_S_C
**
** Nodes +++++++++++++++++++++++++++++++++++++++++++++++++++
**
*Node
1, 0.00000000E+000, 0.00000000E+000, 1.00000000E+000
2, 0.00000000E+000, 1.00000000E+000, 1.00000000E+000
3, 0.00000000E+000, 1.00000000E+000, 0.00000000E+000
4, 0.00000000E+000, 0.00000000E+000, 0.00000000E+000
5, 2.00000000E+000, 0.00000000E+000, 1.00000000E+000
6, 2.00000000E+000, 1.00000000E+000, 1.00000000E+000
7, 2.00000000E+000, 1.00000000E+000, 0.00000000E+000
8, 2.00000000E+000, 0.00000000E+000, 0.00000000E+000
**
** Elements ++++++++++++++++++++++++++++++++++++++++++++++++
**
*Element, Type=C3D8, Elset=Solid_part-1
1, 4, 3, 2, 1, 8, 7, 6, 5
*Nset, Nset=Internal_Selection-1_Fixed-1
1, 2, 3, 4
*Nset, Nset=Internal_Selection-1_Concentrated_Force-1
5, 6, 7, 8
*Elset, Elset=Internal_Selection-1_Solid_Section-1
Solid_part-1
*Material, Name=Steel
*Elastic
210000, 0.3
*Solid section, Elset=Internal_Selection-1_Solid_Section-1, Material=Steel
*Step
*Static
*Output, Frequency=1
*Boundary, op=New
** Name: Fixed-1
*Boundary
Internal_Selection-1_Fixed-1, 1, 3, 0
*Cload, op=New
*Dload, op=New
** Name: Concentrated_Force-1
*Cload
Internal_Selection-1_Concentrated_Force-1, 1, 1000

*Node file
RF, U
*El file
S, E
*End step

*NSET,NSET=NEW,GENERATE
1,8,1
*STEP
*SUBSTRUCTURE GENERATE
*RETAINED NODAL DOFS,SORTED=NO
NEW,1,3
*SUBSTRUCTURE MATRIX OUTPUT,STIFFNESS=YES,OUTPUT FILE=USER DEFINED,FILE NAME=HexaOrigin
*END STEP

```

---

<div class="post-metadata">

**Author:** ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)\
**Post date:** [January 9, 2024, 8:21am UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/5 "2024-01-09T08:21:40Z")

</div>

Hey @Calc_em,

I want to output the element stiffness matrix, since the \* frequency step generates a global stiffness matrix, I want to output the element stiffness matrix for each element inside the domain. So I am using Substructure approach

---

<div class="post-metadata">

**Author:** ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)\
**Post date:** [January 9, 2024, 8:22am UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/6 "2024-01-09T08:22:41Z")

</div>

Hey! @Disla,

I will compare the results with mine. Thanks for the support!!!

---

<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:** [January 9, 2024, 8:34am UTC](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-for-3d-element/2013/7 "2024-01-09T08:34:22Z")

</div>

Ok, you have a single element for now so global matrix should also be fine. But if you want to use it for larger models then indeed it can be an issue.
