source:
issm/oecreview/Archive/23390-24306/ISSM-24249-24250.diff
Last change on this file was 24307, checked in by , 5 years ago | |
---|---|
File size: 3.5 KB |
-
../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
7 7 8 8 9 9 def gmshplanet(* varargin): 10 #GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh. From demo /sphere.geo10 #GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh. From demo/sphere.geo 11 11 # 12 # Available options (for more details see ISSM website http: / / issm.jpl.nasa.gov /):12 # Available options (for more details see ISSM website http://issm.jpl.nasa.gov/): 13 13 # 14 14 # - radius: radius of the planet in km 15 15 # - resolution: resolution in km … … 48 48 fid.write('Point(2) = {radius, 0.0, 0.0, resolution};\n') 49 49 fid.write('Point(3) = {0, radius, 0.0, resolution};\n') 50 50 fid.write('Circle(1) = {2, 1, 3};\n') 51 fid.write('Point(4) = { - 52 fid.write('Point(5) = {0, - 51 fid.write('Point(4) = { -radius, 0, 0.0, resolution};\n') 52 fid.write('Point(5) = {0, -radius, 0.0, resolution};\n') 53 53 fid.write('Circle(2) = {3, 1, 4};\n') 54 54 fid.write('Circle(3) = {4, 1, 5};\n') 55 55 fid.write('Circle(4) = {5, 1, 2};\n') 56 fid.write('Point(6) = {0, 0, - 56 fid.write('Point(6) = {0, 0, -radius, resolution};\n') 57 57 fid.write('Point(7) = {0, 0, radius, resolution};\n') 58 58 fid.write('Circle(5) = {3, 1, 6};\n') 59 59 fid.write('Circle(6) = {6, 1, 5};\n') … … 63 63 fid.write('Circle(10) = {7, 1, 4};\n') 64 64 fid.write('Circle(11) = {4, 1, 6};\n') 65 65 fid.write('Circle(12) = {6, 1, 2};\n') 66 fid.write('Line Loop(13) = {2, 8, - 66 fid.write('Line Loop(13) = {2, 8, -10};\n') 67 67 fid.write('Surface(14) = {13};\n') 68 68 fid.write('Line Loop(15) = {10, 3, 7};\n') 69 69 fid.write('Surface(16) = {15};\n') 70 fid.write('Line Loop(17) = { - 8, -9, 1};\n')70 fid.write('Line Loop(17) = { -8, -9, 1};\n') 71 71 fid.write('Surface(18) = {17};\n') 72 fid.write('Line Loop(19) = { - 11, -2, 5};\n')72 fid.write('Line Loop(19) = { -11, -2, 5};\n') 73 73 fid.write('Surface(20) = {19};\n') 74 fid.write('Line Loop(21) = { - 5, - 12, -1};\n')74 fid.write('Line Loop(21) = { -5, -12, -1};\n') 75 75 fid.write('Surface(22) = {21};\n') 76 fid.write('Line Loop(23) = { - 76 fid.write('Line Loop(23) = { -3, 11, 6};\n') 77 77 fid.write('Surface(24) = {23};\n') 78 fid.write('Line Loop(25) = { - 78 fid.write('Line Loop(25) = { -7, 4, 9};\n') 79 79 fid.write('Surface(26) = {25};\n') 80 fid.write('Line Loop(27) = { - 4, 12, -6};\n')80 fid.write('Line Loop(27) = { -4, 12, -6};\n') 81 81 fid.write('Surface(28) = {27};\n') 82 82 fid.write('Surface Loop(29) = {28, 26, 16, 14, 20, 24, 22, 18};\n') 83 83 fid.write('Volume(30) = {29};\n') … … 106 106 107 107 #call gmsh 108 108 if options.exist('refine'): 109 subprocess.call('gmsh - tol 1e-8 - 2 sphere.geo -bgm sphere.pos', shell=True)109 subprocess.call('gmsh -tol 1e-8 -2 sphere.geo -bgm sphere.pos', shell=True) 110 110 else: 111 111 #call gmsh 112 subprocess.call('gmsh - tol 1e-8 -2 sphere.geo', shell=True)112 subprocess.call('gmsh -tol 1e-8 -2 sphere.geo', shell=True) 113 113 114 114 #import mesh: {{{ 115 115 fid = open('sphere.msh', 'r')
Note:
See TracBrowser
for help on using the repository browser.