<s> from SimPEG import Utils , np <EOL> from BaseMesh import BaseRectangularMesh <EOL> from DiffOperators import DiffOperators <EOL> from InnerProducts import InnerProducts <EOL> length2D = lambda x : ( x [ : , <NUM_LIT:0> ] ** <NUM_LIT:2> + x [ : , <NUM_LIT:1> ] ** <NUM_LIT:2> ) ** <NUM_LIT:0.5> <EOL> length3D = lambda x : ( x [ : , <NUM_LIT:0> ] ** <NUM_LIT:2> + x [ : , <NUM_LIT:1> ] ** <NUM_LIT:2> + x [ : , <NUM_LIT:2> ] ** <NUM_LIT:2> ) ** <NUM_LIT:0.5> <EOL> normalize2D = lambda x : x / np . kron ( np . ones ( ( <NUM_LIT:1> , <NUM_LIT:2> ) ) , Utils . mkvc ( length2D ( x ) , <NUM_LIT:2> ) ) <EOL> normalize3D = lambda x : x / np . kron ( np . ones ( ( <NUM_LIT:1> , <NUM_LIT:3> ) ) , Utils . mkvc ( length3D ( x ) , <NUM_LIT:2> ) ) <EOL> class CurvilinearMesh ( BaseRectangularMesh , DiffOperators , InnerProducts ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = Utils . SimPEGMetaClass <EOL> _meshType = '<STR_LIT>' <EOL> def __init__ ( self , nodes ) : <EOL> assert type ( nodes ) == list , "<STR_LIT>" <EOL> assert len ( nodes ) > <NUM_LIT:1> , "<STR_LIT>" <EOL> for i , nodes_i in enumerate ( nodes ) : <EOL> assert isinstance ( nodes_i , np . ndarray ) , ( "<STR_LIT>" % i ) <EOL> assert nodes_i . shape == nodes [ <NUM_LIT:0> ] . shape , ( "<STR_LIT>" % i ) <EOL> assert len ( nodes [ <NUM_LIT:0> ] . shape ) == len ( nodes ) , "<STR_LIT>" <EOL> assert len ( nodes [ <NUM_LIT:0> ] . shape ) > <NUM_LIT:1> , "<STR_LIT>" <EOL> BaseRectangularMesh . __init__ ( self , np . array ( nodes [ <NUM_LIT:0> ] . shape ) - <NUM_LIT:1> , None ) <EOL> self . _gridN = np . ones ( ( nodes [ <NUM_LIT:0> ] . size , self . dim ) ) <EOL> for i , node_i in enumerate ( nodes ) : <EOL> self . _gridN [ : , i ] = Utils . mkvc ( node_i . astype ( float ) ) <EOL> def gridCC ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridCC is None : <EOL> self . _gridCC = np . concatenate ( [ self . aveN2CC * self . gridN [ : , i ] for i in range ( self . dim ) ] ) . reshape ( ( - <NUM_LIT:1> , self . dim ) , order = '<STR_LIT:F>' ) <EOL> return self . _gridCC <EOL> return locals ( ) <EOL> _gridCC = None <EOL> gridCC = property ( ** gridCC ( ) ) <EOL> def gridN ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridN is None : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> return self . _gridN <EOL> return locals ( ) <EOL> _gridN = None <EOL> gridN = property ( ** gridN ( ) ) <EOL> def gridFx ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridFx is None : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> if self . dim == <NUM_LIT:2> : <EOL> XY = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : , : - <NUM_LIT:1> ] + n [ : , <NUM_LIT:1> : ] ) ) for n in N ] <EOL> self . _gridFx = np . c_ [ XY [ <NUM_LIT:0> ] , XY [ <NUM_LIT:1> ] ] <EOL> elif self . dim == <NUM_LIT:3> : <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT> * ( n [ : , : - <NUM_LIT:1> , : - <NUM_LIT:1> ] + n [ : , : - <NUM_LIT:1> , <NUM_LIT:1> : ] + n [ : , <NUM_LIT:1> : , : - <NUM_LIT:1> ] + n [ : , <NUM_LIT:1> : , <NUM_LIT:1> : ] ) ) for n in N ] <EOL> self . _gridFx = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridFx <EOL> return locals ( ) <EOL> _gridFx = None <EOL> gridFx = property ( ** gridFx ( ) ) <EOL> def gridFy ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridFy is None : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> if self . dim == <NUM_LIT:2> : <EOL> XY = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : - <NUM_LIT:1> , : ] + n [ <NUM_LIT:1> : , : ] ) ) for n in N ] <EOL> self . _gridFy = np . c_ [ XY [ <NUM_LIT:0> ] , XY [ <NUM_LIT:1> ] ] <EOL> elif self . dim == <NUM_LIT:3> : <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT> * ( n [ : - <NUM_LIT:1> , : , : - <NUM_LIT:1> ] + n [ : - <NUM_LIT:1> , : , <NUM_LIT:1> : ] + n [ <NUM_LIT:1> : , : , : - <NUM_LIT:1> ] + n [ <NUM_LIT:1> : , : , <NUM_LIT:1> : ] ) ) for n in N ] <EOL> self . _gridFy = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridFy <EOL> return locals ( ) <EOL> _gridFy = None <EOL> gridFy = property ( ** gridFy ( ) ) <EOL> def gridFz ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridFz is None and self . dim == <NUM_LIT:3> : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT> * ( n [ : - <NUM_LIT:1> , : - <NUM_LIT:1> , : ] + n [ : - <NUM_LIT:1> , <NUM_LIT:1> : , : ] + n [ <NUM_LIT:1> : , : - <NUM_LIT:1> , : ] + n [ <NUM_LIT:1> : , <NUM_LIT:1> : , : ] ) ) for n in N ] <EOL> self . _gridFz = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridFz <EOL> return locals ( ) <EOL> _gridFz = None <EOL> gridFz = property ( ** gridFz ( ) ) <EOL> def gridEx ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridEx is None : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> if self . dim == <NUM_LIT:2> : <EOL> XY = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : - <NUM_LIT:1> , : ] + n [ <NUM_LIT:1> : , : ] ) ) for n in N ] <EOL> self . _gridEx = np . c_ [ XY [ <NUM_LIT:0> ] , XY [ <NUM_LIT:1> ] ] <EOL> elif self . dim == <NUM_LIT:3> : <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : - <NUM_LIT:1> , : , : ] + n [ <NUM_LIT:1> : , : , : ] ) ) for n in N ] <EOL> self . _gridEx = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridEx <EOL> return locals ( ) <EOL> _gridEx = None <EOL> gridEx = property ( ** gridEx ( ) ) <EOL> def gridEy ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridEy is None : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> if self . dim == <NUM_LIT:2> : <EOL> XY = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : , : - <NUM_LIT:1> ] + n [ : , <NUM_LIT:1> : ] ) ) for n in N ] <EOL> self . _gridEy = np . c_ [ XY [ <NUM_LIT:0> ] , XY [ <NUM_LIT:1> ] ] <EOL> elif self . dim == <NUM_LIT:3> : <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : , : - <NUM_LIT:1> , : ] + n [ : , <NUM_LIT:1> : , : ] ) ) for n in N ] <EOL> self . _gridEy = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridEy <EOL> return locals ( ) <EOL> _gridEy = None <EOL> gridEy = property ( ** gridEy ( ) ) <EOL> def gridEz ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if self . _gridEz is None and self . dim == <NUM_LIT:3> : <EOL> N = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> XYZ = [ Utils . mkvc ( <NUM_LIT:0.5> * ( n [ : , : , : - <NUM_LIT:1> ] + n [ : , : , <NUM_LIT:1> : ] ) ) for n in N ] <EOL> self . _gridEz = np . c_ [ XYZ [ <NUM_LIT:0> ] , XYZ [ <NUM_LIT:1> ] , XYZ [ <NUM_LIT:2> ] ] <EOL> return self . _gridEz <EOL> return locals ( ) <EOL> _gridEz = None <EOL> gridEz = property ( ** gridEz ( ) ) <EOL> def vol ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if ( self . _vol is None ) : <EOL> if self . dim == <NUM_LIT:2> : <EOL> A , B , C , D = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> ) <EOL> normal , area = Utils . faceInfo ( np . c_ [ self . gridN , np . zeros ( ( self . nN , <NUM_LIT:1> ) ) ] , A , B , C , D ) <EOL> self . _vol = area <EOL> elif self . dim == <NUM_LIT:3> : <EOL> A , B , C , D , E , F , G , H = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> ) <EOL> vol1 = ( Utils . volTetra ( self . gridN , A , B , D , E ) + <EOL> Utils . volTetra ( self . gridN , B , E , F , G ) + <EOL> Utils . volTetra ( self . gridN , B , D , E , G ) + <EOL> Utils . volTetra ( self . gridN , B , C , D , G ) + <EOL> Utils . volTetra ( self . gridN , D , E , G , H ) ) <EOL> vol2 = ( Utils . volTetra ( self . gridN , A , F , B , C ) + <EOL> Utils . volTetra ( self . gridN , A , E , F , H ) + <EOL> Utils . volTetra ( self . gridN , A , H , F , C ) + <EOL> Utils . volTetra ( self . gridN , C , H , D , A ) + <EOL> Utils . volTetra ( self . gridN , C , G , H , F ) ) <EOL> self . _vol = ( vol1 + vol2 ) / <NUM_LIT:2> <EOL> return self . _vol <EOL> return locals ( ) <EOL> _vol = None <EOL> vol = property ( ** vol ( ) ) <EOL> def area ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if ( self . _area is None or self . _normals is None ) : <EOL> if ( self . dim == <NUM_LIT:2> ) : <EOL> xy = self . gridN <EOL> A , B = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nNx , self . nCy ] ) ) <EOL> edge1 = xy [ B , : ] - xy [ A , : ] <EOL> normal1 = np . c_ [ edge1 [ : , <NUM_LIT:1> ] , - edge1 [ : , <NUM_LIT:0> ] ] <EOL> area1 = length2D ( edge1 ) <EOL> A , D = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nCx , self . nNy ] ) ) <EOL> edge2 = xy [ A , : ] - xy [ D , : ] <EOL> normal2 = np . c_ [ edge2 [ : , <NUM_LIT:1> ] , - edge2 [ : , <NUM_LIT:0> ] ] <EOL> area2 = length2D ( edge2 ) <EOL> self . _area = np . r_ [ Utils . mkvc ( area1 ) , Utils . mkvc ( area2 ) ] <EOL> self . _normals = [ normalize2D ( normal1 ) , normalize2D ( normal2 ) ] <EOL> elif ( self . dim == <NUM_LIT:3> ) : <EOL> A , E , F , B = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nNx , self . nCy , self . nCz ] ) ) <EOL> normal1 , area1 = Utils . faceInfo ( self . gridN , A , E , F , B , average = False , normalizeNormals = False ) <EOL> A , D , H , E = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nCx , self . nNy , self . nCz ] ) ) <EOL> normal2 , area2 = Utils . faceInfo ( self . gridN , A , D , H , E , average = False , normalizeNormals = False ) <EOL> A , B , C , D = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nCx , self . nCy , self . nNz ] ) ) <EOL> normal3 , area3 = Utils . faceInfo ( self . gridN , A , B , C , D , average = False , normalizeNormals = False ) <EOL> self . _area = np . r_ [ Utils . mkvc ( area1 ) , Utils . mkvc ( area2 ) , Utils . mkvc ( area3 ) ] <EOL> self . _normals = [ normal1 , normal2 , normal3 ] <EOL> return self . _area <EOL> return locals ( ) <EOL> _area = None <EOL> area = property ( ** area ( ) ) <EOL> def normals ( ) : <EOL> doc = """<STR_LIT>""" <EOL> def fget ( self ) : <EOL> if ( self . _normals is None ) : <EOL> self . area <EOL> if self . dim == <NUM_LIT:2> : <EOL> return normalize2D ( np . r_ [ self . _normals [ <NUM_LIT:0> ] , self . _normals [ <NUM_LIT:1> ] ] ) <EOL> elif self . dim == <NUM_LIT:3> : <EOL> normal1 = ( self . _normals [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] + self . _normals [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] + self . _normals [ <NUM_LIT:0> ] [ <NUM_LIT:2> ] + self . _normals [ <NUM_LIT:0> ] [ <NUM_LIT:3> ] ) / <NUM_LIT:4> <EOL> normal2 = ( self . _normals [ <NUM_LIT:1> ] [ <NUM_LIT:0> ] + self . _normals [ <NUM_LIT:1> ] [ <NUM_LIT:1> ] + self . _normals [ <NUM_LIT:1> ] [ <NUM_LIT:2> ] + self . _normals [ <NUM_LIT:1> ] [ <NUM_LIT:3> ] ) / <NUM_LIT:4> <EOL> normal3 = ( self . _normals [ <NUM_LIT:2> ] [ <NUM_LIT:0> ] + self . _normals [ <NUM_LIT:2> ] [ <NUM_LIT:1> ] + self . _normals [ <NUM_LIT:2> ] [ <NUM_LIT:2> ] + self . _normals [ <NUM_LIT:2> ] [ <NUM_LIT:3> ] ) / <NUM_LIT:4> <EOL> return normalize3D ( np . r_ [ normal1 , normal2 , normal3 ] ) <EOL> return locals ( ) <EOL> _normals = None <EOL> normals = property ( ** normals ( ) ) <EOL> def edge ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if ( self . _edge is None or self . _tangents is None ) : <EOL> if ( self . dim == <NUM_LIT:2> ) : <EOL> xy = self . gridN <EOL> A , D = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nCx , self . nNy ] ) ) <EOL> edge1 = xy [ D , : ] - xy [ A , : ] <EOL> A , B = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nNx , self . nCy ] ) ) <EOL> edge2 = xy [ B , : ] - xy [ A , : ] <EOL> self . _edge = np . r_ [ Utils . mkvc ( length2D ( edge1 ) ) , Utils . mkvc ( length2D ( edge2 ) ) ] <EOL> self . _tangents = np . r_ [ edge1 , edge2 ] / np . c_ [ self . _edge , self . _edge ] <EOL> elif ( self . dim == <NUM_LIT:3> ) : <EOL> xyz = self . gridN <EOL> A , D = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nCx , self . nNy , self . nNz ] ) ) <EOL> edge1 = xyz [ D , : ] - xyz [ A , : ] <EOL> A , B = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nNx , self . nCy , self . nNz ] ) ) <EOL> edge2 = xyz [ B , : ] - xyz [ A , : ] <EOL> A , E = Utils . indexCube ( '<STR_LIT>' , self . vnC + <NUM_LIT:1> , np . array ( [ self . nNx , self . nNy , self . nCz ] ) ) <EOL> edge3 = xyz [ E , : ] - xyz [ A , : ] <EOL> self . _edge = np . r_ [ Utils . mkvc ( length3D ( edge1 ) ) , Utils . mkvc ( length3D ( edge2 ) ) , Utils . mkvc ( length3D ( edge3 ) ) ] <EOL> self . _tangents = np . r_ [ edge1 , edge2 , edge3 ] / np . c_ [ self . _edge , self . _edge , self . _edge ] <EOL> return self . _edge <EOL> return locals ( ) <EOL> _edge = None <EOL> edge = property ( ** edge ( ) ) <EOL> def tangents ( ) : <EOL> doc = "<STR_LIT>" <EOL> def fget ( self ) : <EOL> if ( self . _tangents is None ) : <EOL> self . edge <EOL> return self . _tangents <EOL> return locals ( ) <EOL> _tangents = None <EOL> tangents = property ( ** tangents ( ) ) <EOL> def plotGrid ( self , ax = None , nodes = False , faces = False , centers = False , edges = False , lines = True , showIt = False ) : <EOL> """<STR_LIT>""" <EOL> import matplotlib . pyplot as plt <EOL> import matplotlib <EOL> from mpl_toolkits . mplot3d import Axes3D <EOL> mkvc = Utils . mkvc <EOL> axOpts = { '<STR_LIT>' : '<STR_LIT>' } if self . dim == <NUM_LIT:3> else { } <EOL> if ax is None : ax = plt . subplot ( <NUM_LIT> , ** axOpts ) <EOL> NN = self . r ( self . gridN , '<STR_LIT:N>' , '<STR_LIT:N>' , '<STR_LIT:M>' ) <EOL> if self . dim == <NUM_LIT:2> : <EOL> if lines : <EOL> X1 = np . c_ [ mkvc ( NN [ <NUM_LIT:0> ] [ : - <NUM_LIT:1> , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ <NUM_LIT:1> : , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : - <NUM_LIT:1> , : ] ) * np . nan ] . flatten ( ) <EOL> Y1 = np . c_ [ mkvc ( NN [ <NUM_LIT:1> ] [ : - <NUM_LIT:1> , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ <NUM_LIT:1> : , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : - <NUM_LIT:1> , : ] ) * np . nan ] . flatten ( ) <EOL> X2 = np . c_ [ mkvc ( NN [ <NUM_LIT:0> ] [ : , : - <NUM_LIT:1> ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , <NUM_LIT:1> : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , : - <NUM_LIT:1> ] ) * np . nan ] . flatten ( ) <EOL> Y2 = np . c_ [ mkvc ( NN [ <NUM_LIT:1> ] [ : , : - <NUM_LIT:1> ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , <NUM_LIT:1> : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , : - <NUM_LIT:1> ] ) * np . nan ] . flatten ( ) <EOL> X = np . r_ [ X1 , X2 ] <EOL> Y = np . r_ [ Y1 , Y2 ] <EOL> ax . plot ( X , Y , '<STR_LIT>' ) <EOL> if centers : <EOL> ax . plot ( self . gridCC [ : , <NUM_LIT:0> ] , self . gridCC [ : , <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> elif self . dim == <NUM_LIT:3> : <EOL> X1 = np . c_ [ mkvc ( NN [ <NUM_LIT:0> ] [ : - <NUM_LIT:1> , : , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ <NUM_LIT:1> : , : , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : - <NUM_LIT:1> , : , : ] ) * np . nan ] . flatten ( ) <EOL> Y1 = np . c_ [ mkvc ( NN [ <NUM_LIT:1> ] [ : - <NUM_LIT:1> , : , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ <NUM_LIT:1> : , : , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : - <NUM_LIT:1> , : , : ] ) * np . nan ] . flatten ( ) <EOL> Z1 = np . c_ [ mkvc ( NN [ <NUM_LIT:2> ] [ : - <NUM_LIT:1> , : , : ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ <NUM_LIT:1> : , : , : ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ : - <NUM_LIT:1> , : , : ] ) * np . nan ] . flatten ( ) <EOL> X2 = np . c_ [ mkvc ( NN [ <NUM_LIT:0> ] [ : , : - <NUM_LIT:1> , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , <NUM_LIT:1> : , : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , : - <NUM_LIT:1> , : ] ) * np . nan ] . flatten ( ) <EOL> Y2 = np . c_ [ mkvc ( NN [ <NUM_LIT:1> ] [ : , : - <NUM_LIT:1> , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , <NUM_LIT:1> : , : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , : - <NUM_LIT:1> , : ] ) * np . nan ] . flatten ( ) <EOL> Z2 = np . c_ [ mkvc ( NN [ <NUM_LIT:2> ] [ : , : - <NUM_LIT:1> , : ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ : , <NUM_LIT:1> : , : ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ : , : - <NUM_LIT:1> , : ] ) * np . nan ] . flatten ( ) <EOL> X3 = np . c_ [ mkvc ( NN [ <NUM_LIT:0> ] [ : , : , : - <NUM_LIT:1> ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , : , <NUM_LIT:1> : ] ) , mkvc ( NN [ <NUM_LIT:0> ] [ : , : , : - <NUM_LIT:1> ] ) * np . nan ] . flatten ( ) <EOL> Y3 = np . c_ [ mkvc ( NN [ <NUM_LIT:1> ] [ : , : , : - <NUM_LIT:1> ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , : , <NUM_LIT:1> : ] ) , mkvc ( NN [ <NUM_LIT:1> ] [ : , : , : - <NUM_LIT:1> ] ) * np . nan ] . flatten ( ) <EOL> Z3 = np . c_ [ mkvc ( NN [ <NUM_LIT:2> ] [ : , : , : - <NUM_LIT:1> ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ : , : , <NUM_LIT:1> : ] ) , mkvc ( NN [ <NUM_LIT:2> ] [ : , : , : - <NUM_LIT:1> ] ) * np . nan ] . flatten ( ) <EOL> X = np . r_ [ X1 , X2 , X3 ] <EOL> Y = np . r_ [ Y1 , Y2 , Y3 ] <EOL> Z = np . r_ [ Z1 , Z2 , Z3 ] <EOL> ax . plot ( X , Y , '<STR_LIT:b>' , zs = Z ) <EOL> ax . set_zlabel ( '<STR_LIT>' ) <EOL> ax . grid ( True ) <EOL> ax . set_xlabel ( '<STR_LIT>' ) <EOL> ax . set_ylabel ( '<STR_LIT>' ) <EOL> if showIt : plt . show ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> nc = <NUM_LIT:5> <EOL> h1 = np . cumsum ( np . r_ [ <NUM_LIT:0> , np . ones ( nc ) / ( nc ) ] ) <EOL> nc = <NUM_LIT:7> <EOL> h2 = np . cumsum ( np . r_ [ <NUM_LIT:0> , np . ones ( nc ) / ( nc ) ] ) <EOL> h3 = np . cumsum ( np . r_ [ <NUM_LIT:0> , np . ones ( nc ) / ( nc ) ] ) <EOL> dee3 = True <EOL> if dee3 : <EOL> X , Y , Z = Utils . ndgrid ( h1 , h2 , h3 , vector = False ) <EOL> M = CurvilinearMesh ( [ X , Y , Z ] ) <EOL> else : <EOL> X , Y = Utils . ndgrid ( h1 , h2 , vector = False ) <EOL> M = CurvilinearMesh ( [ X , Y ] ) <EOL> print M . r ( M . normals , '<STR_LIT:F>' , '<STR_LIT>' , '<STR_LIT>' ) </s>
