How to enforce DOFs to have the same values in AceFEM?

I want to make simulation of shearing of one cubic finite element as in the code below. How can I constrain all horizontal displacements (in X direction) of nodes "X"==L to have the same values?

<< AceFEM;
L = 10;
SMTInputData[];
"cube", {"ML:", "SE", "D3", "H1", "DF", "HY", "H1",
"D", {{"NeoHooke", "WA"}}}, {"E *" -> 21000 }];
SMTAddEssentialBoundary[{"X" == L  & , 3 -> -L/2}];
SMTAddEssentialBoundary[{"X" == 0  &, 1 -> 0, 2 -> 0, 3 -> 0}];
SMTMesh["cube",
"H1", {1, 1,
1}, {{{{0, 0, 0}, {L, 0, 0}}, {{0, L, 0}, {L, L, 0}}}, {{{0, 0,
L}, {L, 0, L}}, {{0, L, L}, {L, L, L}}}}];
SMTAnalysis[];
SMTEquilibriumPaths["Method" -> "Newton", "Steps" -> "Adaptive",
"\[Lambda]Max" -> 1, "Show" -> "Window"];
SMTSimulationReport[];
SMTShowMesh["DeformedMesh" -> True]


Below there is a figure with deformation obtained from the above code. As you can see displacements in horizontal direction are different fot the top and bottom nodes on right side. My question is how can I tie the nodes to obtain a result denoted with red lines (i.e. the right side of the cube vertical not inclined).

• Your code is quite hard to read. In particular, I found the construction of your While` condition, with multiple statements piled together, pretty hard to disentangle. Do you think you could reduce this down to a simpler example that showcases your problem? Dec 21, 2023 at 16:07
• MarcoB, thanks for your comment, I have changed the code and the description. I hope that now the problem is understood. Dec 21, 2023 at 17:13