- Timestamp:
- 08/25/20 00:32:13 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.py
r24213 r25455 1 1 import numpy as np 2 3 from ContourToMesh import ContourToMesh 2 4 from ElementsFromEdge import ElementsFromEdge 3 5 import MatlabFuncs as m 4 from ContourToMesh import ContourToMesh5 6 6 7 7 8 def meshprocessoutsiderifts(md, domainoutline): 8 """ 9 MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline 9 """MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline 10 10 11 Usage: 12 md = meshprocessoutsiderifts(md, domain) 13 11 Usage: 12 md = meshprocessoutsiderifts(md, domain) 14 13 """ 15 14 … … 53 52 elements = np.concatenate((elements, nextelement)) 54 53 #new B: 55 B = md.mesh.elements[nextelement - 1, np.nonzero(np.logical_not(m.ismember(md.mesh.elements[nextelement - 1, :], np.array([A, B])))) ]54 B = md.mesh.elements[nextelement - 1, np.nonzero(np.logical_not(m.ismember(md.mesh.elements[nextelement - 1, :], np.array([A, B]))))[0]] 56 55 57 56 #take the list of elements on one side of the rift that connect to the tip, … … 64 63 #replace tip in elements 65 64 newelements = md.mesh.elements[elements - 1, :] 66 pos = np.nonzero(newelements == tip) 65 pos = np.nonzero(newelements == tip)[0] 67 66 newelements[pos] = num 68 67 md.mesh.elements[elements - 1, :] = newelements … … 81 80 md.mesh.numberofelements = np.size(md.mesh.elements, axis=0) 82 81 md.mesh.numberofvertices = np.size(md.mesh.x) 83 md.mesh.vertexonboundary = np.zeros(np.size(md.mesh.x), bool)84 md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True82 md.mesh.vertexonboundary = np.zeros(np.size(md.mesh.x), int) 83 md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = 1 85 84 md.rifts.numrifts = np.length(md.rifts.riftstruct) 86 85 … … 88 87 89 88 90 def isconnected(elements, A, B): # {{{ 91 """ 92 ISCONNECTED: are two nodes connected by a triangulation? 89 def isconnected(elements, A, B): #{{{ 90 """ISCONNECTED: are two nodes connected by a triangulation? 93 91 94 Usage: flag = isconnected(elements, A, B)95 92 Usage: 93 flag = isconnected(elements, A, B) 96 94 """ 97 95 … … 103 101 104 102 return flag 105 # 103 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.