(n,x0,x1,periodic=False)
| 16 | mesh.Add (Element1D(elpids,index=1)) |
| 17 | |
| 18 | def SegMesh(n,x0,x1,periodic=False): |
| 19 | mesh = Mesh(dim=1) |
| 20 | pids = [] |
| 21 | for i in range(n+1): |
| 22 | pids.append (mesh.Add (MeshPoint(Pnt(x0+(x1-x0)*i/n, 0, 0)))) |
| 23 | AddEdgeEls(0,1,1,n,pids,mesh) |
| 24 | mesh.Add (Element0D( pids[0], index=1)) |
| 25 | mesh.Add (Element0D( pids[n], index=2)) |
| 26 | mesh.SetBCName(0,"left") |
| 27 | mesh.SetBCName(1,"right") |
| 28 | if periodic == True: |
| 29 | mesh.AddPointIdentification(pids[0],pids[n],1,2) |
| 30 | return mesh |
| 31 | |
| 32 | # create a hexagonal mesh with corner points on the unit circle |
| 33 | def MakeHexagonalMesh2D(maxh=0.1): |
no test coverage detected