Changeset 27174
- Timestamp:
- 08/02/22 02:44:42 (3 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
r27158 r27174 14 14 % md.mesh=gmshplanet('radius',6000,'resolution',100); 15 15 % md.mesh=gmshplanet('radius',6000,'resolution',100); 16 17 %Find path to gmsh 18 paths = {[issmdir() 'bin/gmsh'],... 19 [issmdir() 'externalpackages/gmsh/install/gmsh'],... 20 ['/usr/bin/gmsh']... 21 }; 22 gmshpath = ''; 23 for i=paths 24 if exist(i{1},'file'), 25 gmshpath = i{1}; 26 break; 27 end 28 end 29 if isempty(gmshpath), 30 error('gmsh not found, make sure it is properly installed'); 31 end 16 32 17 33 % Get Gmsh version … … 51 67 52 68 % NOTE: 53 % - The default format in Gmsh 3 is "msh2". Rather than conditionally 54 % modifying our parsing scheme for Gmsh 4, for now, we simply set the 69 % - The default format in Gmsh 3 is "msh2". Rather than conditionally 70 % modifying our parsing scheme for Gmsh 4, for now, we simply set the 55 71 % 'Mesh.MshFileVersion' option. 56 % - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 57 % equal number of nodes and elements being produced under macOS and Linux 72 % - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 73 % equal number of nodes and elements being produced under macOS and Linux 58 74 % at certain resolutions using certain meshing algorithms. 59 75 % … … 142 158 143 159 % Call gmsh 160 % 161 % NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 162 % modifying our parsing scheme for Gmsh 4, for now, we simply set the 163 % "-format" option. 164 % 144 165 if exist(options,'refine'), 145 166 system(['gmsh -2 sphere.geo -bgm sphere.pos']); … … 195 216 %}}} 196 217 197 %a little technicality here. the mesh generate is not exactly on the 198 %sphere. we create lat,long coordinates, and reproject on an exact sphere. 218 %a little technicality here. the mesh generate is not exactly on the 219 %sphere. we create lat,long coordinates, and reproject on an exact sphere. 199 220 mesh.r=sqrt(mesh.x.^2+mesh.y.^2+mesh.z.^2); 200 221 201 %make sure we don't have south and north pole: 222 %make sure we don't have south and north pole: 202 223 pos=find(mesh.x==0 & mesh.y==0); 203 224 mesh.lat = asind(mesh.z./mesh.r); -
issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
r27119 r27174 26 26 subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) 27 27 outs, errs = subproc.communicate() 28 if ((not isinstance(errs, bytes)) & (errs != '')) or (isinstance(errs, bytes) & (errs.decode() != '')): 28 try: 29 strErrs = errs.decode() 30 except AttributeError: #this is not a byte variable, let's assume string 31 strErrs = errs 32 if strErrs != '': 29 33 raise Exception('gmshplanet: call to gmsh failed: {}'.format(errs)) 30 34 gmshmajorversion = int(outs)
Note:
See TracChangeset
for help on using the changeset viewer.