Meaning of MultiMesh

HI guys,

I just tried to draw multimesh by using under simple code.

from dolfin import *
from mshr import *
from vedo.dolfin import plot as vplot

# First mesh setting
rect1 = Rectangle( Point(0,0), Point(1,1) )
circ1 = Circle( Point(0.25,0.25), 0.03, 30)
circ2 = Circle( Point(0.75,0.25), 0.03, 30)
circ3 = Circle( Point(0.25,0.75), 0.03, 30)
circ4 = Circle( Point(0.75,0.75), 0.03, 30)

domain1 = rect1 - circ1 - circ2 - circ3 -circ4
mesh1 = generate_mesh(domain1,20)


# Second mesh setting
rect2 = Rectangle( Point(0,0), Point(1,1) )
ccirc1 = Circle( Point(0.35,0.35), 0.03, 30)
ccirc2 = Circle( Point(0.65,0.35), 0.03, 30)
ccirc3 = Circle( Point(0.35,0.65), 0.03, 30)
ccirc4 = Circle( Point(0.65,0.65), 0.03, 30)
domain2 = rect2 - ccirc1 - ccirc2 - ccirc3 - ccirc4
mesh2 = generate_mesh(domain2,20)

# MultiMesh part
multimesh=MultiMesh()
multimesh.add(mesh1)
multimesh.add(mesh2)
multimesh.build()
n = multimesh.num_parts()
for i in range(n):
    vplot(multimesh.part(i), at=i, N=n, wireframe=1, lw=2, c=i)

And this is the following image.

Here are my questions.

  1. What is the meaning of two colors, yellow and orange? And how do they relate to each other?
  2. Once I find out the numerical solutions of left picture, how does it relate with right image’s numerical solutions?
  3. Can anybody give me a simple example code of finding numerical solutions using multimesh?

There are several demos, such as: Bitbucket
along with several papers:
A multimesh finite element method for the Navier–Stokes equations based on projection methods - ScienceDirect,
Multimesh finite element methods: Solving PDEs on multiple intersecting meshes - ScienceDirect,
https://epubs.siam.org/doi/abs/10.1137/18M1189208
that goes through the meaning of the different meshes, how they relate etc.
I also have a repository
GitHub - jorgensd/MultiMeshShapeOpt_code: Code used in "Shape Optimization using the Finite Element Method for Multiple Meshes Using Nitsche Coupling.
with documented code used in: https://epubs.siam.org/doi/abs/10.1137/18M1189208

1 Like

No special meaning, as you set in vplot(... c=i),
c is the color number (0=gold, 1=orange …), you can choose any color by string name too.

1 Like