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.

Graded meshes

More
2 years 7 months ago #3962 by alex_sch
Graded meshes was created by alex_sch
Hi,

I am solving the classical L-shaped domain and wanted to generate a graded mesh where grading is radial in nature emanating from the origin as the singularity lies at the origin. I wanted to know how to specify the grading with respect to the origin.

The code that generated this simple mesh without grading:

from ngsolve import *
import netgen.geom2d as geom2d;
geo = geom2d.SplineGeometry()
p1 = geo.AppendPoint (0,0)
p2 = geo.AppendPoint (1,0)
p3 = geo.AppendPoint (1,1)
p4 = geo.AppendPoint (-1,1)
p5 = geo.AppendPoint (-1,-1)
p6 = geo.AppendPoint (0,-1)


geo.Append (["line", p1, p2], bc=1)
geo.Append (["line", p2, p3], bc=1)
geo.Append (["line", p3, p4], bc=1)
geo.Append (["line", p4, p5], bc=1)
geo.Append (["line", p5, p6], bc=1)
geo.Append (["line", p6, p1], bc=1)

mesh = Mesh( geo.GenerateMesh(maxh=0.1))


Regards
Alex
More
2 years 7 months ago #3964 by joachim
Replied by joachim on topic Graded meshes
you can specify a smaller mesh-size at points and segments, like
Code:
p1 = geo.AppendPoint (0,0, maxh=0.01)

Joachim
Time to create page: 0.149 seconds