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.

Mesh with SW-NE diagonals

More
2 years 2 months ago #4198 by shasha
 Hi,everyone! I want to generate  a mesh with  SW-NE diagonals(below a code for mesh with WN-ES diagonals).
###############################from ngsolve import *
import ngsolve.meshes as ngm
import netgen.geom2d as geom2d
from netgen.geom2d import SplineGeometry


i = 2
mapping = lambda x,y : (x,y)
mesh = ngm.MakeStructured2DMesh(quads=False, nx = 2**i ,ny = 2**i, mapping=mapping)
Draw(mesh)

Best
Shasha Wang

    
More
2 years 2 months ago - 2 years 2 months ago #4200 by hvwahl
Replied by hvwahl on topic Mesh with SW-NE diagonals
Hi Shasha,

you can use the flip_triangles keyword argument for this, i.e, mesh = ngm.MakeStructured2DMesh(quads=False, nx = 2**i ,ny = 2**i, flip_triangles=True).

Best wishes,
Henry
Last edit: 2 years 2 months ago by hvwahl.
The following user(s) said Thank You: shasha
Time to create page: 0.136 seconds