Changeset 14098
- Timestamp:
- 12/05/12 09:34:29 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
r13991 r14098 25 25 if not os.path.exists(icefrontfile): 26 26 raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile) 27 [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x .reshape(-1,1),md.mesh.y.reshape(-1,1),icefrontfile,'node',2)27 [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2) 28 28 nodeonicefront=numpy.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1)) 29 29 else: -
issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
r13991 r14098 27 27 if not os.path.exists(icefrontfile): 28 28 raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % icefrontfile) 29 [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x .reshape(-1,1),md.mesh.y.reshape(-1,1),icefrontfile,'node',2)29 [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2) 30 30 vertexonicefront=numpy.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1)) 31 31 else: -
issm/trunk-jpl/src/m/geometry/FlagElements.py
r13992 r14098 47 47 else: 48 48 #ok, flag elements 49 [flag,dum]=ContourToMesh(md.mesh.elements[:,0:3].copy(),md.mesh.x .reshape(-1,1),md.mesh.y.reshape(-1,1),region,'element',1)49 [flag,dum]=ContourToMesh(md.mesh.elements[:,0:3].copy(),md.mesh.x,md.mesh.y,region,'element',1) 50 50 flag=flag.astype(bool) 51 51 -
issm/trunk-jpl/src/m/mesh/ComputeMetric.m
r13482 r14098 13 13 lambda1=0.5*((a+d)+sqrt(4.*b.^2+(a-d).^2)); 14 14 lambda2=0.5*((a+d)-sqrt(4.*b.^2+(a-d).^2)); 15 pos1=find(lambda1==0 );16 pos2=find(lambda2==0 );17 pos3=find(b==0 & lambda1==lambda2);15 pos1=find(lambda1==0.); 16 pos2=find(lambda2==0.); 17 pos3=find(b==0. & lambda1==lambda2); 18 18 19 19 %Modify the eigen values to control the shape of the elements -
issm/trunk-jpl/src/m/mesh/ComputeMetric.py
r14095 r14098 19 19 lambda1=0.5*((a+d)+numpy.sqrt(4.*b**2+(a-d)**2)) 20 20 lambda2=0.5*((a+d)-numpy.sqrt(4.*b**2+(a-d)**2)) 21 pos1=numpy.nonzero(lambda1==0 )[0]22 pos2=numpy.nonzero(lambda2==0 )[0]23 pos3=numpy.nonzero(numpy.logical_and(b==0 ,lambda1==lambda2))[0]21 pos1=numpy.nonzero(lambda1==0.)[0] 22 pos2=numpy.nonzero(lambda2==0.)[0] 23 pos3=numpy.nonzero(numpy.logical_and(b==0.,lambda1==lambda2))[0] 24 24 25 25 #Modify the eigen values to control the shape of the elements -
issm/trunk-jpl/src/m/mesh/bamg.py
r13991 r14098 92 92 #Checks that all holes are INSIDE the principle domain outline 93 93 if i: 94 flags=ContourToNodes(domaini['x'] .reshape(-1,1),domaini['y'].reshape(-1,1),domainfile,0)94 flags=ContourToNodes(domaini['x'],domaini['y'],domainfile,0) 95 95 if numpy.any(numpy.logical_not(flags)): 96 96 raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain") … … 118 118 119 119 #detect whether all points of the rift are inside the domain 120 flags=ContourToNodes(rifti['x'] .reshape(-1,1),rifti['y'].reshape(-1,1),domain[0],0)120 flags=ContourToNodes(rifti['x'],rifti['y'],domain[0],0) 121 121 if numpy.all(numpy.logical_not(flags)): 122 122 raise RuntimeError("one rift has all its points outside of the domain outline") -
issm/trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.py
r14015 r14098 16 16 17 17 #first, flag nodes that belong to the domain outline 18 flags=ContourToMesh(md.mesh.elements,md.mesh.x .reshape(-1,1),md.mesh.y.reshape(-1,1),domainoutline,'node',0)18 flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0) 19 19 20 20 tips=rift.tips -
issm/trunk-jpl/src/m/mesh/rifts/meshprocessrifts.py
r13991 r14098 49 49 50 50 #In case we have rifts that open up the domain outline, we need to open them: 51 [flags,dum]=ContourToMesh(md.mesh.elements,md.mesh.x .reshape(-1,1),md.mesh.y.reshape(-1,1),domainoutline,'node',0)51 [flags,dum]=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0) 52 52 found=0 53 53 for rift in md.rifts.riftstruct: -
issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
r14097 r14098 108 108 /*retrieve dimensions: */ 109 109 ndim=PyArray_NDIM((const PyArrayObject*)py_matrix); 110 if(ndim!=2)_error_("expecting an MxN matrix in input!"); 111 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 112 M=dims[0]; N=dims[1]; 110 if (ndim==2) { 111 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 112 M=dims[0]; N=dims[1]; 113 } 114 else if (ndim==1) { 115 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 116 M=dims[0]; N=1; 117 } 118 else 119 _error_("expecting an MxN matrix or M vector in input!"); 113 120 114 121 if (M && N) { … … 141 148 142 149 else 143 _error_("unrecognized pyarray type in input!");150 _error_("unrecognized float pyarray type in input!"); 144 151 } 145 152 else … … 178 185 /*retrieve dimensions: */ 179 186 ndim=PyArray_NDIM((const PyArrayObject*)py_matrix); 180 if(ndim!=2)_error_("expecting an MxN matrix in input!"); 181 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 182 M=dims[0]; N=dims[1]; 187 if (ndim==2) { 188 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 189 M=dims[0]; N=dims[1]; 190 } 191 else if (ndim==1) { 192 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 193 M=dims[0]; N=1; 194 } 195 else 196 _error_("expecting an MxN matrix or M vector in input!"); 183 197 184 198 if (M && N) { … … 211 225 212 226 else 213 _error_("unrecognized pyarray type in input!");227 _error_("unrecognized long pyarray type in input!"); 214 228 } 215 229 else
Note:
See TracChangeset
for help on using the changeset viewer.