In my opinion one thing that is still missing for really useful FEM framework is better quality of meshing (of Boolean representations of geometries) in 3D (ToElementMesh
). I know this is not an easy task, but I would still like to include it on wishlist.
For example:
Get["NDSolve`FEM`"]
box = Cuboid[{0, 0, 0}, {1, 1, 1}];
holes = Thread@Ball[{{1., 0.5, 0.5}, {1., 1., 0.5}, {1., 1., 1.}}, 0.2];
reg = Fold[RegionDifference, box, holes];
bounds = RegionBounds[reg];
mesh = ToElementMesh[
reg,
bounds,
MaxCellMeasure -> 0.05
]
Through[{Min, Mean}[Join @@ mesh["Quality"]]]
(* {0.000165709, 0.319868} *)
mesh["Wireframe"[
"MeshElement" -> "MeshElements",
"MeshElementStyle" -> FaceForm@LightBlue
]]
The resulting mesh has quite poor quality.
Update 12.1 (user21):
In version 12.1 you can use:
bmesh = ToBoundaryMesh[region,
"BoundaryMeshGenerator" -> {"OpenCascade"}];
groups = bmesh["BoundaryElementMarkerUnion"];
temp = Most[Range[0, 1, 1/(Length[groups])]];
colors = ColorData["BrightBands"][#] & /@ temp;
bmesh["Wireframe"["MeshElementStyle" -> FaceForm /@ colors]]
mesh = ToElementMesh[region,
"BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]
{0.0458246, 0.695077}
mesh["Wireframe"["MeshElement" -> "MeshElements",
"MeshElementStyle" -> FaceForm@LightBlue]]
Update 12.2 (user21):
More graphics primitives and operations have been added. Please see the updated Using OpenCascadeLink tutorial.
Update 12.3 (user21):
The "OpenCascade" boundary mesh generator is now the default for boolean regions in 3D. So this is now sufficient:
ToElementMesh[region];
Besides that the OpenCascadeLink has been improved and extended. Among other things it now has two application examples showing the creation of CAD models: a simple book shelf bracket and a complicated Helical bevel gear.: