Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

adjusted mesh size in particular direction

More
5 years 4 months ago - 5 years 3 months ago #1358 by asilalahi
Hi,

Lets say i want to refine the mesh in the region 1 and/or 3 near the membrane(region 2), I can do this by creating 4 cylindrical surfaces:

geo = CSGeometry()
cube1 = OrthoBrick(Pnt(0,0,0), Pnt(1400,1400,1600))
cyl1 = Cylinder(Pnt(700,700,0), Pnt(700,700,1600),180)
dom1 = cyl1 * cube1


cyl2 = Cylinder(Pnt(700,700,0), Pnt(700,700,1600),200)
gab2 = cyl2 * cube1
dom2 = gab2 - cyl1


cyl3 = Cylinder(Pnt(700,700,0), Pnt(700,700,1600),210)
gab3 = cyl3 * cube1
dom3 = gab3 - cyl2

cyl4 = Cylinder(Pnt(700,700,0), Pnt(700,700,1600),700)
gab4 = cyl4 * cube1
dom4 = gab4 - cyl3

geo.Add(dom1)
geo.Add(dom2)
geo.Add(dom3)
geo.Add(dom4)

n = 4
slices = [i/n for i in range(1,n)]

geo.CloseSurfaces(cyl1,cyl2,slices)
geo.CloseSurfaces(cyl2,cyl3,slices)
geo.SetBoundingBox(Pnt (-6000, -6000, -6000), Pnt(6000, 6000, 6000))
ngmesh = geo.GenerateMesh(maxh=500)
ZRefinement(ngmesh, geo)

But the above script will create 4 regions, instead of 3.
Is it possible to create an imaginary cylindrical surface (not part of physical region) and slices/refine between that surface and another surface? Or am i better off with modifying the 4 region indices in output "*.vol" file to be 3 region indices ?

Another question is related to the prism constructed between the two surfaces. If the cyl1 and cyl2 facing surfaces are quite paralel (lets say r1=200 and r2=205), then i will get nice parallel triangular prisms between the two surfaces like below:

Attachment not found



However if the r1=200 and r2=230, then the two facing tetrahedral surfaces are not quite paralel, then the prisms between look quite funny. like bellow:

[attachment=undefined]not_paralel.jpg[/attachment]


For my research, i need to have parallel prisms between the surfaces. Is there a way to modify such that we have all parallel triangular prisms. I dont mind if there is small void of volume created by doing so, because in my project, the most important things occur near this membrane and it decays exponentially outward.


Best,
Alex
Last edit: 5 years 3 months ago by asilalahi. Reason: additional questions
Time to create page: 0.099 seconds