Changeset 26354
- Timestamp:
- 07/20/21 01:10:59 (4 years ago)
- Location:
- issm/trunk-jpl/src/m/mesh/planet/gmsh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
r26220 r26354 39 39 fid=fopen('sphere.geo','w'); 40 40 41 fprintf(fid,'Mesh.Algorithm = 1;\n'); 41 fprintf(fid,'Mesh.Algorithm = 1;\n'); % MeshAdapt 42 fprintf(fid,'Mesh.RandomFactor = 1e-10;\n'); 42 43 if exist(options,'refine'), 43 fprintf(fid,'Mesh.Algorithm = 7;\n'); 44 fprintf(fid,'Mesh.CharacteristicLengthFromPoints= 0;\n'); 45 fprintf(fid,'Mesh.SmoothRatio= 3;\n'); 46 fprintf(fid,'Mesh.RemeshAlgorithm= 1;\n'); 44 fprintf(fid,'Mesh.Algorithm = 7;\n'); % BAMG 45 fprintf(fid,'Mesh.CharacteristicLengthFromPoints = 0;\n'); 46 fprintf(fid,'Mesh.SmoothRatio = 3;\n'); 47 if gmshmajorversion == 3, 48 fprintf(fid,'Mesh.RemeshAlgorithm = 1;\n'); 49 end 47 50 end 48 51 fprintf(fid,'resolution=%g;\n',resolution); -
issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
r26344 r26354 25 25 26 26 # Get Gmsh version 27 subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"27 subproc_args = 'gmsh -info 2>&1 | command grep \'Version\' | sed -e \'s/Version[[:blank:]]*:[[:blank:]]//\' | cut -d \'.\' -f1' 28 28 subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 29 29 outs, errs = subproc.communicate() 30 30 if errs != '': 31 raise Exception( "gmshplanet: call to gmsh failed: {}".format(errs))31 raise Exception('gmshplanet: call to gmsh failed: {}'.format(errs)) 32 32 gmshmajorversion = int(outs) 33 33 if gmshmajorversion not in [3, 4]: 34 raise RuntimeError( "gmshplanet: Gmsh major version {} not supported!".format(gmshmajorversion))34 raise RuntimeError('gmshplanet: Gmsh major version {} not supported!'.format(gmshmajorversion)) 35 35 36 36 # Process options … … 47 47 fid = open('sphere.geo', 'w') 48 48 49 fid.write('Mesh.Algorithm = 1;\n') 49 fid.write('Mesh.Algorithm = 1;\n') # MeshAdapt 50 fid.write('Mesh.RandomFactor = 1e-10;\n') 50 51 if options.exist('refine'): 51 fid.write('Mesh.Algorithm = 7;\n') 52 fid.write('Mesh.Algorithm = 7;\n') # BAMG 52 53 fid.write('Mesh.CharacteristicLengthFromPoints = 0;\n') 53 54 fid.write('Mesh.SmoothRatio = 3;\n') 54 fid.write('Mesh.RemeshAlgorithm = 1;\n') 55 if gmshmajorversion == 3: 56 fid.write('Mesh.RemeshAlgorithm = 1;\n') 55 57 fid.write('resolution = %g;\n' % resolution) 56 58 fid.write('radius = %g;\n' % radius)
Note:
See TracChangeset
for help on using the changeset viewer.