# How to generate such a complicated 3D object in AceFEM?

I would like to simulate a specimen with the following shape in AceFEM. I know that I have to create each part separately and call SMTMesh multiple times but I really don't know how to create the object with the rounded edge.

What I have done so far is:

(*The long part*)
{Lx1 , Ly1 , Lz1} = {2 , 0.5 , 30}
points1 = {{0 , 0 , 0} , {Lx1 , 0 , 0} , {Lx1 , Ly1 , 0} , {0 , Ly1 ,
0} , {0 , 0 , Lz1} , {Lx1 , 0 , Lz1} , {Lx1 , Ly1  , Lz1} , {0 ,
Ly1 , Lz1}};
SMTAddMesh[Hexahedron[points1] , "A" , "H2S" , {4 , 4 , 32}];

(*The short part*)
{Lx2 , Ly2 , Lz2} = {4 , 0.5 , 5};
points2 = {{0 , 0 , 0} , {Lx2 , 0 , 0} , {Lx2 , Ly2 , 0} , {0 , Ly2 ,
0} , {0 , 0 , Lz1 + Lz2} , {Lx2 , 0 , Lz1 + Lz2} , {Lx2 , Ly2  ,
Lz1 + Lz2} , {0 , Ly2 , Lz1 + Lz2}};
SMTAddMesh[Hexahedron[points2] , "A" , "H2S" , {4 , 4 , 4}];


So just remains the middle part, which has a more complicated shape.

This is a quick and dirty solution... I recommend that you adjust it so that each piece of information (e.g. number of elements through thickness) is specified on one place only. For the curved section of geometry I have chosen a cosine curve, which is tangential to both straight sections.

{x1, y1, z1} = {2, 0.5, 5};
points1 = {
{0, 0, 0}, {x1, 0, 0}, {x1, y1, 0}, {0, y1, 0},
{0, 0, z1},{x1, 0, z1}, {x1, y1, z1}, {0, y1, z1}
};

{x3, y3, z3} = {4, 0.5, 5};
points2 = {
{0,0,z1 + z2},{x3,0,z1 + z2},{x3,y3,z1 + z2},{0,y3,z1+z2},
{0, 0,z1+z2+z3},{x3, 0,z1+z2+z3},{x3, y3,z1+z2+z3},{0, y3, z1+z2+z3}
};

z2 = 4; (* Dimension of curved part in "Z" direction *)
n = 10;(* Number of raster points in "Z" direction *)
raster = N@{
{
Table[{0, 0, z + z1}, {z, 0, z2, z2/n}],
Table[{x1 + (x3 - x1) (1 - Cos[(z/z2)*Pi])/2, 0, z + z1}, {z, 0, z2, z2/n}]
},
{
Table[{0, y1, z + z1}, {z, 0, z2, z2/n}],
Table[{x1 + (x3 - x1) (1 - Cos[(z/z2)*Pi])/2, y1, z + z1}, {z, 0, z2, z2/n}]
}
};


<<AceFEM
SMTInputData[];
`