Obtaining meshes that are continuous across a circular boundary

More
7 years 3 months ago #150 by Gregory
I am using the Python interface to netgen to create surface meshes for circular discs using geo = CSGeometry etc. I am finding it to be very useful.

I now need to mesh what could be visualised as two circular coins of different sizes put together concentrically. The larger coin has an annular structure on one face with no mesh in the central area where it touches the smaller coin. The smaller coin is fully meshed. There is a special requirement that the mesh points on the edges give continuity of the surface mesh (triangles) if the two coins are put together. I need to create a separate .vol mesh file for each coin.

Could anyone provide me with a code snippet to do this? I downloaded and compiled the latest NGsolve (6.1-experimental).

Andrew.
More
7 years 2 months ago #155 by Gregory
I found out how to mesh the contact planes of the coins after seeing this tutorial (code below):

web.pdx.edu/~gjay/teaching/mth610_2015.2/TutorialNGSpy.html

How to I extend the mesh over the Cylindrical sides and backs of the coins to form 3D meshes?



from netgen.geom2d import SplineGeometry

def Circle(geom,r, bc, left, right, maxh):

disc_pnts = [ ( r, 0), ( r, r), ( 0, r), (-r, r), (-r, 0), (-r, -r), ( 0, -r), ( r, -r) ]

disc_pnums = [geom.AppendPoint(*p) for p in disc_pnts]

curves = [ (disc_pnums[0], disc_pnums[1], disc_pnums[2]),
(disc_pnums[2], disc_pnums[3], disc_pnums[4]),
(disc_pnums[4], disc_pnums[5], disc_pnums[6]),
(disc_pnums[6], disc_pnums[7], disc_pnums[0]) ]

for p0,p1,p2 in curves:
geom.Append( ["spline3", p0,p1,p2],
bc=bc, leftdomain=left, rightdomain=right, maxh=maxh)
return geom

geo = SplineGeometry()
geo = Circle(geo, 4.0, 1, 0, 1, 0.1)
geo = Circle(geo, 5.0, 2, 1, 0, 1.0)
ngmesh = geo.GenerateMesh()
ngmesh.Save("large_coin_face.vol")

geo2 = SplineGeometry()
geo2 = Circle(geo2, 4.0, 3, 1, 0, 0.1)
ngmesh = geo2.GenerateMesh()
ngmesh.Save("small_coin_face.vol")
Time to create page: 0.124 seconds