MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / MakeGeometry

Function MakeGeometry

py_tutorials/adaptive.py:24–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22#
23
24def MakeGeometry():
25 geometry = SplineGeometry()
26
27 # point coordinates ...
28 pnts = [ (0,0), (1,0), (1,0.6), (0,0.6), \
29 (0.2,0.6), (0.8,0.6), (0.8,0.8), (0.2,0.8), \
30 (0.5,0.15), (0.65,0.3), (0.5,0.45), (0.35,0.3) ]
31 pnums = [geometry.AppendPoint(*p) for p in pnts]
32
33 # start-point, end-point, boundary-condition, domain on left side, domain on right side:
34 lines = [ (0,1,1,1,0), (1,2,2,1,0), (2,5,2,1,0), (5,4,2,1,2), (4,3,2,1,0), (3,0,2,1,0), \
35 (5,6,2,2,0), (6,7,2,2,0), (7,4,2,2,0), \
36 (8,9,2,3,1), (9,10,2,3,1), (10,11,2,3,1), (11,8,2,3,1) ]
37
38 for p1,p2,bc,left,right in lines:
39 geometry.Append( ["line", pnums[p1], pnums[p2]], bc=bc, leftdomain=left, rightdomain=right)
40 return geometry
41
42
43

Callers 1

adaptive.pyFile · 0.70

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected