Skip to content

Commit

Permalink
avoid more rep
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCornejo committed Dec 2, 2024
1 parent bfc73c3 commit 27bc673
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,21 +267,15 @@ void LinearTrussElement<TDimension, TNNodes>::GetFirstDerivativesShapeFunctionsV
GetGeometry().ShapeFunctionsLocalGradients(dN_de, coord);

if constexpr (Dimension == 2) {
if constexpr (NNodes == 2) {
rdN_dX[0] = dN_de(0, 0);
rdN_dX[2] = dN_de(1, 0);
} else { // 3N
rdN_dX[0] = dN_de(0, 0);
rdN_dX[2] = dN_de(1, 0);
rdN_dX[0] = dN_de(0, 0);
rdN_dX[2] = dN_de(1, 0);
if constexpr (NNodes == 3) {
rdN_dX[4] = dN_de(2, 0);
}
} else {
if constexpr (NNodes == 2) {
rdN_dX[0] = dN_de(0, 0);
rdN_dX[3] = dN_de(1, 0);
} else { // 3N
rdN_dX[0] = dN_de(0, 0);
rdN_dX[3] = dN_de(1, 0);
rdN_dX[0] = dN_de(0, 0);
rdN_dX[3] = dN_de(1, 0);
if constexpr (NNodes == 3) {
rdN_dX[6] = dN_de(2, 0);
}
}
Expand Down

0 comments on commit 27bc673

Please sign in to comment.