source: issm/oecreview/Archive/15392-16133/ISSM-15994-15995.diff

Last change on this file was 16134, checked in by Mathieu Morlighem, 12 years ago

Added Archive/15392-16133

File size: 1.5 KB
RevLine 
[16134]1Index: ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
2===================================================================
3--- ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py (revision 15994)
4+++ ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py (revision 15995)
5@@ -26,12 +26,14 @@
6 #User provided Front.exp, use it
7 if not os.path.exists(icefrontfile):
8 raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % icefrontfile)
9- [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
10- vertexonicefront=numpy.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1))
11+ [incontour,dum]=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
12+ vertexonicefront=numpy.logical_and(md.mesh.vertexonboundary,incontour.reshape(-1))
13 else:
14 #Guess where the ice front is
15- vertexonfloatingice=numpy.logical(md.mask.groundedice_levelset<0.)
16- vertexonicefront=numpy.logical_and(md.mesh.vertexonboundary,vertexonfloatingice)
17+ vertexonfloatingice=numpy.zeros((md.mesh.numberofvertices,1))
18+ pos=numpy.nonzero(numpy.sum(md.mask.groundedice_levelset[md.mesh.elements-1]<0.,axis=1) >0.)[0]
19+ vertexonfloatingice[md.mesh.elements[pos].astype(int)-1]=1.
20+ vertexonicefront=numpy.logical_and(numpy.reshape(md.mesh.vertexonboundary,(-1,1)),vertexonfloatingice>0.)
21
22 # pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
23 pos=numpy.nonzero(numpy.logical_and(md.mesh.vertexonboundary,numpy.logical_not(vertexonicefront)))[0]
Note: See TracBrowser for help on using the repository browser.