Esempio n. 1
0
 def __init__(self, mat_i, mat_m, mat_0, n, a=0.5, dim=3):
     self.mat_i = mat_i
     self.mat_m = mat_m
     self.n = n
     shape = tuple(itertools.repeat(n, dim))
     # ...
     # End: init
     # Begin: create (C_i - C_0) and (C_m - C_0)
     # ...
     delta_C_i = isotropic_4(dim*(mat_i.k-mat_0.k),
                             2*(mat_i.g-mat_0.g), dim)
     delta_C_m = isotropic_4(dim*(mat_m.k-mat_0.k),
                             2*(mat_m.g-mat_0.g), dim)
     # ...
     # End: create (C_i - C_0) and (C_m - C_0)
     # Begin: create local operator ε ↦ (C-C_0):ε
     # ...
     ops = np.empty(shape, dtype=object)
     ops[:, :] = delta_C_m
     imax = int(np.ceil(n*a-0.5))
     ops[:imax, :imax] = delta_C_i
     self.eps_to_tau = operators.BlockDiagonalOperator2D(ops)
     # ...
     # End: create local operator ε ↦ (C-C_0):ε
     # Begin: create non-local operator ε ↦ Γ_0[ε]
     # ...
     self.green = green.truncated(mat_0.green_operator(),
                                  shape, 1.,
                                  fft.create_real(shape))
Esempio n. 2
0
 def __init__(self, mat_i, mat_m, mat_0, n, a=0.5, dim=3):
     self.mat_i = mat_i
     self.mat_m = mat_m
     self.n = n
     shape = tuple(itertools.repeat(n, dim))
     # ...
     # End: init
     # Begin: create (C_i - C_0) and (C_m - C_0)
     # ...
     delta_C_i = isotropic_4(dim * (mat_i.k - mat_0.k), 2 * (mat_i.g - mat_0.g), dim)
     delta_C_m = isotropic_4(dim * (mat_m.k - mat_0.k), 2 * (mat_m.g - mat_0.g), dim)
     # ...
     # End: create (C_i - C_0) and (C_m - C_0)
     # Begin: create local operator ε ↦ (C-C_0):ε
     # ...
     ops = np.empty(shape, dtype=object)
     ops[:, :] = delta_C_m
     imax = int(np.ceil(n * a - 0.5))
     ops[:imax, :imax] = delta_C_i
     self.eps_to_tau = operators.BlockDiagonalOperator2D(ops)
     # ...
     # End: create local operator ε ↦ (C-C_0):ε
     # Begin: create non-local operator ε ↦ Γ_0[ε]
     # ...
     self.green = green.truncated(mat_0.green_operator(), shape, 1.0, fft.create_real(shape))
Esempio n. 3
0
    def __init__(self, a, mat_i, mat_m, mat_0, n, comm=MPI.COMM_WORLD):
        transform = fft.create_real((n, n), comm)
        self.n0 = transform.ishape[0]
        self.n1 = transform.ishape[1]
        self.offset0 = transform.offset0
        self.green = green.truncated(mat_0.green_operator(),
                                               (n, n), 1., transform)
        aux_i = operators.isotropic_4(1. / (2. * (mat_i.k - mat_0.k)),
                                      1. / (2. * (mat_i.g - mat_0.g)),
                                      dim=2)
        aux_m = operators.isotropic_4(1. / (2. * (mat_m.k - mat_0.k)),
                                      1. / (2. * (mat_m.g - mat_0.g)),
                                      dim=2)

        ops = np.empty(transform.ishape, dtype=object)
        ops[:, :] = aux_m
        imax = int(np.ceil(n * a - 0.5))
        ops[:imax - self.offset0, :imax] = aux_i

        self.tau2eps = operators.BlockDiagonalOperator2D(ops)
Esempio n. 4
0
 def greend(self, greenc, n, h, transform=None):
     return truncated(greenc, n, h, transform)
 def greend(self, greenc, n, h, transform=None):
     return truncated(greenc, n, h, transform)
Esempio n. 6
0
def truncated_factory():
    return truncated(material.create(1.0, 0.3, 2).green_operator(),
                     (128, 128),
                     1.)