interpolation over rectilinear grid. Faster.

这个提交包含在:
jasminium
2019-08-27 13:48:11 +01:00
父节点 eb94f4ed94
当前提交 06dc1b6f4b
共有 3 个文件被更改,包括 7 次插入17 次删除

查看文件

@@ -636,14 +636,9 @@ class PrecursorNodes(PrecusorNodes2dBase):
def interpolate_to_sub_grid(self, field, coords): def interpolate_to_sub_grid(self, field, coords):
x, z, x_sg, z_sg = coords x, z, x_sg, z_sg = coords
ex_t = np.transpose(field) interp_f = interpolate.RectBivariateSpline(x, z, field, kx=self.interpolation, ky=self.interpolation)
f = interpolate.interp2d(x, z, ex_t, kind=self.interpolation) f_i = interp_f(x_sg, z_sg)
#f = interpolate.RectBivariateSpline(x, z, field) return f_i
ex_inter_t = f(x_sg, z_sg)
ex_inter = np.transpose(ex_inter_t)
#ex_inter = ex_inter_t
return ex_inter
class PlaneError(Exception): class PlaneError(Exception):

查看文件

@@ -741,14 +741,9 @@ class PrecursorNodes(PrecusorNodes2dBase):
def interpolate_to_sub_grid(self, field, coords): def interpolate_to_sub_grid(self, field, coords):
x, z, x_sg, z_sg = coords x, z, x_sg, z_sg = coords
ex_t = np.transpose(field) interp_f = interpolate.RectBivariateSpline(x, z, field, kx=self.interpolation, ky=self.interpolation)
f = interpolate.interp2d(x, z, ex_t, kind=self.interpolation) f_i = interp_f(x_sg, z_sg)
#f = interpolate.RectBivariateSpline(x, z, field) return f_i
ex_inter_t = f(x_sg, z_sg)
ex_inter = np.transpose(ex_inter_t)
#ex_inter = ex_inter_t
return ex_inter
class PlaneError(Exception): class PlaneError(Exception):

查看文件

@@ -177,7 +177,7 @@ class SubGridHSG(SubGridBase):
is_os_sep=3, is_os_sep=3,
pml_separation=4, pml_separation=4,
subgrid_pml_thickness=6, subgrid_pml_thickness=6,
interpolation='linear', interpolation=1,
filter=True, filter=True,
**kwargs): **kwargs):
"""Constructor.""" """Constructor."""