# AceGen/ AceFEM: Wrong number of nodes?

I am trying to create an element T1 (linear triangle) to solve the steady, incompressible Navier-Stokes equations. Therefore, my SMSTemplate command reads as follows

SMSTemplate[
"SMSTopology"-> "T1",
"SMSNoNodes"->6,
"SMSDOFGlobal"->{2,2,2,1,1,1},
"SMSNodeID"->{"D","D","D","p","p","p"},
"SMSDomainDataNames"->{"nu -kinematic viscosity","rho -density"},
"SMSSymmetricTangent"->False,
"SMSCharSwitch"->{"output"}
];


including a linear interpolation for velocity "D" and pressure "p". In total, this leads to 9 degrees of freedom at 6 nodes per element. Afterwards, I defined subroutines for Gauss points, discretization and constitutive equations to use the SMSStandardModule "Tangent and residual". The residual vector 'p' has then a size of 9 and the stiffness matrix 's' of 9x9. But if I start AceFEM, define a boundary value problem and start the analysis with SMTAnalysis, the following error message occurs:

Does someone know this problem or have an idea? Moreover, I am unsure what the output 'Nodes: {1,4,2}' means.

If you want me to give you more of my code, just let me know.

Since you defined in the element that you have $$SMSNoNodes==6$$, you have to provide 6 nodes when you generate the element in AceFEM. It seems that You defined mesh "T1" so one element was allocated global indices $$\{1,4,6\}$$

If you want displacement nodes and pressure nodes at same points (i.e. triangle corners), you have to specify that pressure nodes are to be placed on corners, this you can do with additional option in $$SMSTemplate$$:

"SMSAdditionalNodes" ->  Hold[({#1, #2, #3} &)]


which means you have 6 nodes but the last 3 nodes are ADDED automaticvally by ACeFEM on same position as displacement nodes, so you only need to provide 3.

Just for info, if you had Second order dispalcemet and linear pressure (6+3 nodes), you can use T1 linear element and specify that middle nodes for dis. and corner nodes for pressure are added automatically:

"SMSAdditionalNodes" -> Hold[({(#1 + #2)/2, (#2 + #3)/2, (#3 + #1)/2, #1, #2, #3} &)]


You can check more in help in $$SMSTemplate$$, there is a link to: "Cubic triangle, Additional nodes" in $$SMSAdditionalNodes$$ option.

• Thanks a lot! Now it works. 2 days ago