示例#1
0
    def setBackgroundField(self, Inc, Dec, Btot):

        Bx = Btot*np.cos(Inc/180.*np.pi)*np.sin(Dec/180.*np.pi)
        By = Btot*np.cos(Inc/180.*np.pi)*np.cos(Dec/180.*np.pi)
        Bz = -Btot*np.sin(Inc/180.*np.pi)

        self.B0 = np.r_[Bx, By, Bz]
示例#2
0
    def setBackgroundField(self, Inc, Dec, Btot):

        Bx = Btot * np.cos(Inc / 180. * np.pi) * np.sin(Dec / 180. * np.pi)
        By = Btot * np.cos(Inc / 180. * np.pi) * np.cos(Dec / 180. * np.pi)
        Bz = -Btot * np.sin(Inc / 180. * np.pi)

        self.B0 = np.r_[Bx, By, Bz]
示例#3
0
 def simpleFail(x):
     return np.sin(x), -sdiag(np.cos(x))
示例#4
0
 def simpleFunction(x):
     return np.sin(x), lambda xi: sdiag(np.cos(x)) * xi
示例#5
0
 def simplePass(x):
     return np.sin(x), sdiag(np.cos(x))
示例#6
0
 
 #%% Create a 2D mesh along axis of Tx end points and keep z-discretization    
 dx = np.min( [ np.min(mesh.hx), np.min(mesh.hy) ])
 nc = np.ceil(dl_len/dx)+3
 
 padx = dx*np.power(1.4,range(1,15))
 
 # Creating padding cells
 h1 = np.r_[padx[::-1], np.ones(nc)*dx , padx]
 
 # Create mesh with 0 coordinate centerer on the ginput points in cell center
 mesh2d = Mesh.TensorMesh([h1, mesh.hz], x0=(-np.sum(padx)-dx/2,mesh.x0[2]))
 
 # Create array of points for interpolating from 3D to 2D mesh
 xx = Tx[0][0,0] + mesh2d.vectorCCx * np.cos(azm)
 yy = Tx[0][1,0] + mesh2d.vectorCCx * np.sin(azm)
 zz = mesh2d.vectorCCy
 
 [XX,ZZ] = np.meshgrid(xx,zz)
 [YY,ZZ] = np.meshgrid(yy,zz)
 
 xyz2d = np.c_[mkvc(XX),mkvc(YY),mkvc(ZZ)]
 
 #plt.scatter(xx,yy,s=20,c='y')
 
 
 F = interpolation.NearestNDInterpolator(mesh.gridCC,model)
 m2D = np.reshape(F(xyz2d),[mesh2d.nCx,mesh2d.nCy]).T
 
  
 #==============================================================================
示例#7
0
文件: test_utils.py 项目: KyuboNoh/HY
 def simpleFail(x):
     return np.sin(x), -sdiag(np.cos(x))
示例#8
0
文件: test_utils.py 项目: KyuboNoh/HY
 def simpleFunction(x):
     return np.sin(x), lambda xi: sdiag(np.cos(x))*xi
示例#9
0
文件: test_utils.py 项目: KyuboNoh/HY
 def simplePass(x):
     return np.sin(x), sdiag(np.cos(x))