array = array 153 return ct, c_size_t ( len (o )) 154 else : 155 return (c_int * len (o ))(*o ), c_size_t ( len (o )) 156 157 def _ivectorsize (o ): 158 if use_numpy : 159 array = numpy. ndim != 1 ): 150 raise Exception ( "Invalid data for input vector of integers" ) 151 ct = array. gmshFree (ptr ) 144 return v 145 146 def _ivectorint (o ): 147 if use_numpy : 148 array = numpy. gmshFree (ptr ) 138 return v 139 140 def _ovectorvectorpair (ptr, size, n ): 141 v =. gmshFree (ptr ) 132 return v 133 134 def _ovectorvectordouble (ptr, size, n ): 135 v =. gmshFree (ptr ) 126 return v 127 128 def _ovectorvectorsize (ptr, size, n ): 129 v =. gmshFree (ptr ) 120 return v 121 122 def _ovectorvectorint (ptr, size, n ): 123 v =. gmshFree (ptr ) 115 return v 116 117 def _ovectorstring (ptr, size ): 118 v = list ( _ostring ( cast (ptr, c_char_p )) for i in range (size )) 119 lib. gmshFree, ptr ) 112 else : 113 v = list (ptr for i in range (size )) 114 lib. as_array (ptr, (size, )) 111 weakreffinalize (v, lib. gmshFree (ptr ) 103 return v 104 105 def _ovectordouble (ptr, size ): 106 if use_numpy : 107 if size = 0 : 108 lib. gmshFree, ptr ) 100 else : 101 v = list (ptr for i in range (size )) 102 lib. as_array (ptr, (size, )) 99 weakreffinalize (v, lib. gmshFree (ptr ) 91 return v 92 93 def _ovectorsize (ptr, size ): 94 if use_numpy : 95 if size = 0 : 96 lib. gmshFree, ptr ) 88 else : 89 v = list (ptr for i in range (size )) 90 lib. as_array (ptr, (size, )) 87 weakreffinalize (v, lib. gmshFree (ptr ) 79 return v 80 81 def _ovectorint (ptr, size ): 82 if use_numpy : 83 if size = 0 : 84 lib. gmshFree (s ) 74 return sp 75 76 def _ovectorpair (ptr, size ): 77 v = list ((ptr, ptr ) for i in range (size // 2 )) 78 lib.
weakref import finalize as weakreffinalize 65 use_numpy = True 66 except : 67 pass 68 69 # Utility functions, not part of the Gmsh Python API 70 71 def _ostring (s ): 72 sp = s.
system () = "Windows" : 47 libpath = find_library ( "gmsh-4.10" ) 48 if not libpath : 49 libpath = find_library ( "gmsh" ) 50 else : 51 libpath = find_library ( "gmsh" ) 52 53 lib = CDLL (libpath ) 54 55 try_numpy = True # set this to False to never use numpy 56 57 use_numpy = False 58 if try_numpy : 59 try : 60 import numpy 61 try : 62 from weakref import finalize as weakreffinalize 63 except : 64 from backports. join (moduledir, libname ) 45 if not os. join (libdir, "Lib", libname ) 43 if not os.
dirname (moduledir )) 39 40 libpath = os. dirname (moduledir )) 36 else : 37 libname = "libgmsh.so.4.10" 38 libdir = os. system () = "Darwin" : 34 libname = "libgmsh.4.10.dylib" 35 libdir = os.
system () = "Windows" : 31 libname = "gmsh-4.10.dll" 32 libdir = os. util import find_library 16 import signal 17 import os 18 import platform 19 from math import pi 20 21 GMSH_API_VERSION = "4.10.5" 22 GMSH_API_VERSION_MAJOR = 4 23 GMSH_API_VERSION_MINOR = 10 24 GMSH_API_VERSION_PATCH = 5 25 26 _version_ = GMSH_API_VERSION 27 28 oldsig = signal. 13 14 from ctypes import * 15 from ctypes. See 12 # `tutorials/python' and `examples/api' for tutorials and examples. 9 # 10 # By design, the Gmsh Python API is purely functional, and only uses elementary 11 # Python types (as well as `numpy' arrays if `numpy' is available). 7 # 8 # Do not edit this file directly: it is automatically generated by `api/gen.py'. 5 6 # This file defines the Gmsh Python API (v4.10.5).
Remacle 2 # 3 # See the LICENSE.txt file in the Gmsh root directory for license information.
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers.Īlternatively you can here view or download the uninterpreted source code file.įor more information about "gmsh.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 4.10.4_vs_4.10.5.ġ # Gmsh - Copyright (C) 1997-2022 C.