Skip to main content
added 87 characters in body
Source Link
user21
  • 40.7k
  • 8
  • 114
  • 170

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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.:

enter image description here

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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.

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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:

enter image description here

added 673 characters in body
Source Link
user21
  • 40.7k
  • 8
  • 114
  • 170

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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.

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

Update 12.2 (user21):

More graphics primitives and operations have been added. Please see the updated Using OpenCascadeLink tutorial.

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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.

added 239 characters in body
Source Link
user21
  • 40.7k
  • 8
  • 114
  • 170

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

Update 12.2 (user21):

More graphics primitives and operations have been added. Please see the updated Using OpenCascadeLink tutorial.

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

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
]]

badmesh

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]]

enter image description here

mesh = ToElementMesh[region, 
   "BoundaryMeshGenerator" -> {"OpenCascade"}];
Through[{Min, Mean}[Join @@ mesh["Quality"]]]

{0.0458246, 0.695077}

mesh["Wireframe"["MeshElement" -> "MeshElements", 
  "MeshElementStyle" -> FaceForm@LightBlue]]

enter image description here

Update 12.2 (user21):

More graphics primitives and operations have been added. Please see the updated Using OpenCascadeLink tutorial.

Update to show new functionaitly from 12.1
Source Link
user21
  • 40.7k
  • 8
  • 114
  • 170
Loading
added example
Source Link
Pinti
  • 6.6k
  • 1
  • 19
  • 49
Loading
Source Link
Pinti
  • 6.6k
  • 1
  • 19
  • 49
Loading