I don’t have a code yet but the commands for a capsule and a disk in the FEM packages exist already. What is not obvious is how can I set up the boundary between the disk and the capsule to be seamless. Not a sharp boundary but I want to create a smooth curvature when moving from the disk surface to the vertical wall of the capsule. I don’t think I have the slightest idea on how to do it. Thanks for helping.
How Can I draw a capsule (FEM) and a disk inside of it with a smooth boundary that have a curvature?
I assume the “disk” is a cylindrical disk. Maybe you can union something like the following with your other regions.
With[{
ir = 3,(* inner radius *)
rc = 1,(* radius of curvature *)
\[Rho] = Sqrt[x^2 + y^2]},
collar =
ir^2 <= \[Rho]^2 <= (ir + rc -
Piecewise[{{Sqrt[rc^2 - (\[Rho] - ir - rc)^2 - (z + 1)^2],
rc^2 - (\[Rho] - ir - rc)^2 - (z + 1)^2 > 0}}, 0])^2 && -1 <=
z <= 0
]
reg = ImplicitRegion[collar, {{x, -4, 4}, {y, -4, 4}, {z, -1, 0}}];
Needs["NDSolve`FEM`"];
emesh = ToElementMesh[reg]
emesh["Wireframe"]
Thank you Michael for the feedback. very nice and simple. Actually what I was looking for is even simpler. And yes a circular disk. Maybe I was not clear enough. The disk should be inside the capsule (sorry;-)). I was thinking that instead of putting the disk whose diameter is equal to the inner diameter of the capsule, is there a routine of smoothing the boundary between the disk edge and the inner wall of the capsule. I hope this is clearer.
