# Index out of bound error in AceFEM

I have written an AceGEN code for a 3D element. The degrees of freedom at each point are 4, 3 spatial displacements and one additional degree of freedom that acts like temperature, i.e. for the initialization part I wrote

Xi \[DoubleRightTee]
SMSReal[Array[nd$$[#1 , "X" , 1] & , nNodes], 0 , 10]; Yi \[DoubleRightTee] SMSReal[Array[nd$$[#1 , "X" , 2] & , nNodes], 0 , 10];
Zi \[DoubleRightTee]
SMSReal[Array[nd$$[#1 , "X" , 3] & , nNodes], 0 , 10]; ui \[DoubleRightTee] SMSReal[Array[nd$$[#1 , "at" , 1] &, nNodes], -0.1 , 0.1];
vi \[DoubleRightTee]
SMSReal[Array[nd$$[#1 , "at" , 2] &, nNodes], -0.1 , 0.1]; wi \[DoubleRightTee] SMSReal[Array[nd$$[#1 , "at" , 3] &, nNodes], -0.1 , 0.1];
\[Eta]bari \[DoubleRightTee]
SMSReal[Array[nd$$[#1 , "at" , 4] & , nNodes]];  The AceGen code compiles completely. However, when it comes to the AceFEM to do the job the following error occurs. Index out of bounds error while executing user subroutine SKR of element 3Dpseudoelasticity (possible bug in the symbolic description of the element!!). Description : Index in expression:nd$$[..,at,j] has value: 4. Index bounds are min=1 max=3. Source code identification: \$D144\$ Version: 6.811 Windows (27 Nov 16) (MMA 10.4) Module: SMTBoundCheck

I saw the debugging session in the help documentation and it says that this is the problem of nd that cannot exceed 3. So I was wondering how to fix this problem and add a new degree of freedom to the problem.

• It is difficult to identify the source of error without the whole example (AceGen code and AceFEM code). Meanwhile you can see some examples of coupled thermomechanocal elements in this thesis on page 91. Commented Oct 23, 2017 at 7:33
• Thanks for your comment and also the thesis. The problem is the number of degrees of freedoms that can not exceed 3, if they are going to be defined as "at". I was wondering if I should use another command for defining the additional degrees of freedoms. Commented Oct 23, 2017 at 7:53
• I think that number of DOF per node can exceed 3, but they should be identified accordingly. Have you checked that you have correct options enabled in SMSTemplate? Another example of thermo-mechanical element is in Lectures.nb that you can download from the home page. Commented Oct 23, 2017 at 8:26
• I actually solved the problem. The only thing that I should do, as you said, is to specify the SMSDOFGlobal in the SMSTemplate. So now I set it to 4 for all nodes and it is working correctly. Commented Oct 23, 2017 at 8:33
• @Pinti can we find the .nb files? they could be useful to test the algorithms in MMA Commented Aug 8, 2019 at 18:31

This is a general comment turned into an answer.

With coupled (thermo-mechanical) elements you have to be careful when setting up basic element topology and corresponding node positions, nodal DOF and node IDs. They should be specified in the beginning of AceGen element code in SMSTemplate (see its documentation page).

For example, this is an excerpt of 2D coupled element, taken from "Lectures.nb" from home page.

SMSTemplate[
"SMSTopology" -> "Q1",
"SMSNoNodes" -> 8,
"SMSDOFGlobal" -> {2, 2, 2, 2, 1, 1, 1, 1},
"SMSAdditionalNodes" -> Hold[{#1, #2, #3, #4} &],
"SMSNodeID" -> {"D", "D", "D", "D", "T -M", "T -M", "T -M", "T -M"},
"SMSSegments" -> {{1, 2, 3, 4}},
...(* other options *)

];

• Thanks for the answer. Commented Oct 23, 2017 at 9:03
• @Pinti "Lectures.nb" cannot be found in ACEFEM home page. Commented Apr 14, 2021 at 9:50