def __init__(self, a, mat_i, mat_m, mat_0, n): self.n0 = n self.n1 = n self.shape = (3 * self.n0 * self.n1, 3 * self.n0 * self.n1) self.dtype = np.float64 transform = fft.create_real((self.n0, self.n1)) self.green = green.filtered(mat_0.green_operator(), transform.ishape, 1., transform) aux_i = operators.isotropic_4((mat_i.k - mat_0.k) / 2., (mat_i.g - mat_0.g) / 2., dim=2) aux_m = operators.isotropic_4((mat_m.k - mat_0.k) / 2., (mat_m.g - mat_0.g) / 2., dim=2) op_loc = np.empty(transform.ishape, dtype=object) imax = int(np.ceil(n * a - 0.5)) for i0 in range(self.n0): for i1 in range(self.n1): if (i0 < imax) and (i1 < imax): op_loc[i0, i1] = aux_i else: op_loc[i0, i1] = aux_m self.eps2tau = operators.BlockDiagonalOperator2D(op_loc)
def greend(self, greenc, n, h, transform=None): return filtered(greenc, n, h, transform)