Ignore:
Timestamp:
08/25/20 00:32:13 (5 years ago)
Author:
jdquinn
Message:

CHG: Saving chnages so that Basile has access to potential fix to solidearthmodel class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/rifts/meshprocessoutsiderifts.py

    r24213 r25455  
    11import numpy as np
     2
     3from ContourToMesh import ContourToMesh
    24from ElementsFromEdge import ElementsFromEdge
    35import MatlabFuncs as m
    4 from ContourToMesh import ContourToMesh
    56
    67
    78def meshprocessoutsiderifts(md, domainoutline):
    8     """
    9     MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
     9    """MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
    1010
    11        Usage:
    12           md = meshprocessoutsiderifts(md, domain)
    13 
     11    Usage:
     12        md = meshprocessoutsiderifts(md, domain)
    1413    """
    1514
     
    5352                elements = np.concatenate((elements, nextelement))
    5453                #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]]
    5655
    5756            #take the list of elements on one side of the rift that connect to the tip,
     
    6463            #replace tip in elements
    6564            newelements = md.mesh.elements[elements - 1, :]
    66             pos = np.nonzero(newelements == tip)
     65            pos = np.nonzero(newelements == tip)[0]
    6766            newelements[pos] = num
    6867            md.mesh.elements[elements - 1, :] = newelements
     
    8180    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
    8281    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] = True
     82    md.mesh.vertexonboundary = np.zeros(np.size(md.mesh.x), int)
     83    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = 1
    8584    md.rifts.numrifts = np.length(md.rifts.riftstruct)
    8685
     
    8887
    8988
    90 def isconnected(elements, A, B):  # {{{
    91     """
    92     ISCONNECTED: are two nodes connected by a triangulation?
     89def isconnected(elements, A, B):  #{{{
     90    """ISCONNECTED: are two nodes connected by a triangulation?
    9391
    94        Usage: flag = isconnected(elements, A, B)
    95 
     92    Usage:
     93        flag = isconnected(elements, A, B)
    9694    """
    9795
     
    103101
    104102    return flag
    105     # }}}
     103    #}}}
Note: See TracChangeset for help on using the changeset viewer.