Function Repository Resource:

# BoundaryElementMeshJoin

Join multiple boundaries to form a single boundary ElementMesh

Contributed by: Oliver Rübenkönig
 ResourceFunction["BoundaryElementMeshJoin"][bmesh1,bmesh2,…] returns a boundary ElementMesh consisting of joined boundary MeshRegion or ElementMesh objects bmeshi.

## Details and Options

ResourceFunction["BoundaryElementMeshJoin"] accepts the options for ToBoundaryMesh.
Inputs can be either MeshRegion or ElementMesh objects.

## Examples

### Basic Examples (4)

Load the Finite Element Method package:

 In[1]:=

Define two boundary meshes:

 In[2]:=

Join the two:

 In[3]:=
 Out[3]=

Visualize the resulting boundary ElementMesh:

 In[4]:=
 Out[4]=

### Scope (7)

Create boundary element meshes directly:

 In[5]:=

Join the boundary meshes:

 In[6]:=
 Out[6]=

Visualize the resulting boundary ElementMesh:

 In[7]:=
 Out[7]=

Generate a full ElementMesh with the internal circle boundary:

 In[8]:=
 Out[8]=

Create three boundary meshes:

 In[9]:=

Join the boundary meshes:

 In[10]:=
 Out[10]=

Visualize the resulting boundary ElementMesh:

 In[11]:=
 Out[11]=

Generate a full ElementMesh with the internal line boundary and a region hole in the box:

 In[12]:=
 Out[12]=

Create two boundary meshes:

 In[13]:=

Join the boundary meshes:

 In[14]:=
 Out[14]=

Visualize the resulting boundary ElementMesh:

 In[15]:=
 Out[15]=

Generate a full ElementMesh with the internal boundaries:

 In[16]:=
 Out[16]=

Create two boundary meshes:

 In[17]:=

Join the boundary meshes:

 In[18]:=
 Out[18]=

Visualize the resulting boundary ElementMesh:

 In[19]:=
 Out[19]=

Generate a full ElementMesh with an internal boundary at the connection:

 In[20]:=
 Out[20]=

Create two boundary meshes:

 In[21]:=

Join the boundary meshes:

 In[22]:=
 Out[22]=

Visualize the resulting boundary ElementMesh:

 In[23]:=
 Out[23]=

Generate a full ElementMesh with the internal boundaries:

 In[24]:=
 Out[24]=

Generate a full ElementMesh with the internal boundaries and a region hole:

 In[25]:=
 Out[25]=

Create two boundary meshes in 3D:

 In[26]:=

Join the boundary meshes:

 In[27]:=
 Out[27]=

Visualize the resulting boundary ElementMesh:

 In[28]:=
 Out[28]=

Generate a full ElementMesh with the internal ball boundary:

 In[29]:=
 Out[29]=

Create two boundary meshes in 3D:

 In[30]:=

Join the boundary meshes:

 In[31]:=
 Out[31]=

Visualize the resulting boundary ElementMesh:

 In[32]:=
 Out[32]=

Generate a full ElementMesh:

 In[33]:=
 Out[33]=

### Applications (2)

Use an image to generate a mesh that has material regions. Set up the image:

 In[34]:=

Find the image components:

 In[35]:=

Generate mesh regions:

 In[36]:=
 Out[36]=

Generate boundary ElementMesh objects and join them:

 In[37]:=
 Out[37]=

Visualize the boundary ElementMesh:

 In[38]:=
 Out[38]=

Find the centroids of the meshes:

 In[39]:=
 Out[39]=

Generate the full ElementMesh with region markers:

 In[40]:=
 Out[40]=

Solve a PDE with different coefficient values in the different material regions:

 In[41]:=

Visualize the solution:

 In[42]:=
 Out[42]=

Create two boundary meshes in 3D:

 In[43]:=

Join the meshes:

 In[44]:=
 Out[44]=

Visualize the boundary ElementMesh:

 In[45]:=
 Out[45]=

Numerically integrate over the boundary ElementMesh:

 In[46]:=
 Out[46]=

### Possible Issues (6)

Sometimes the boundary mesh quality is not good enough to generate a full ElementMesh. Create two boundary ElementMesh objects:

 In[47]:=

Join the boundary meshes:

 In[48]:=
 Out[48]=

Visualize the resulting boundary ElementMesh:

 In[49]:=
 Out[49]=

Generate a full ElementMesh with the internal circle boundary:

 In[50]:=
 Out[50]=

In that case, generate a small offset at the intersecting boundary:

 In[51]:=

Generate a full ElementMesh with the internal circle boundary:

 In[52]:=
 Out[52]=

OliverRubenkonig

## Version History

• 1.0.0 – 20 January 2020