-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgis.py
62 lines (42 loc) · 1.36 KB
/
gis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
* DEMO-0 --- a simple example demonstrating the construction
* of 2-d. geometry and user-defined mesh-size constraints.
*
* These examples call to JIGSAW via its api.-lib. interface.
*
* Writes "case_0x.vtk" files on output for vis. in PARAVIEW.
*
"""
import os
import numpy as np
import jigsawpy
def gis(src_path, dst_path):
opts = jigsawpy.jigsaw_jig_t()
geom = jigsawpy.jigsaw_msh_t()
mesh = jigsawpy.jigsaw_msh_t()
hfun = jigsawpy.jigsaw_msh_t()
#------------------------------------ define JIGSAW geometry
geom.mshID = "euclidean-mesh"
geom.ndims = +2
jigsawpy.loadmsh("mesh_12_14_withBdry.msh", geom)
jigsawpy.loadmsh("mesh-HFUN.msh", hfun)
#------------------------------------ build mesh via JIGSAW!
print("Call libJIGSAW: gis")
opts.verbosity = +1
opts.hfun_scal = "absolute"
opts.hfun_hmax = float("inf")
opts.hfun_hmin = float(0.0)
opts.mesh_dims = +2 # 2-dim. simplexes
opts.optm_qlim = +.9375
opts.mesh_top1 = True
opts.geom_feat = True
jigsawpy.lib.jigsaw(opts, geom, mesh, hfun=hfun)
scr2 = jigsawpy.triscr2( # "quality" metric
mesh.point["coord"],
mesh.tria3["index"])
print("Saving gis.vtk file.")
jigsawpy.savevtk(os.path.join(
dst_path, "gis.vtk"), mesh)
return
if __name__ == "__main__":
gis("", "./")