示例#1
0
        def nxcurlS(qbx_forced_limit):

            return sym.n_cross(
                sym.curl(
                    sym.S(knl,
                          sym.cse(sym.tangential_to_xyz(density_sym), "jxyz"),
                          qbx_forced_limit=qbx_forced_limit)))
示例#2
0
def get_sym_maxwell_point_source(kernel, jxyz, k):
    r"""Return a symbolic expression that, when bound to a
    :class:`pytential.source.PointPotentialSource` will yield
    a field satisfying Maxwell's equations.

    Uses the sign convention :math:`\exp(-i \omega t)` for the time dependency.

    This will return an object of six entries, the first three of which
    represent the electric, and the second three of which represent the
    magnetic field. This satisfies the time-domain Maxwell's equations
    as verified by :func:`sumpy.point_calculus.frequency_domain_maxwell`.
    """
    # This ensures div A = 0, which is simply a consequence of div curl S=0.
    # This means we use the Coulomb gauge to generate this field.

    A = sym.curl(sym.S(kernel, jxyz, k=k, qbx_forced_limit=None))

    # https://en.wikipedia.org/w/index.php?title=Maxwell%27s_equations&oldid=798940325#Alternative_formulations
    # (Vector calculus/Potentials/Any Gauge)
    # assumed time dependence exp(-1j*omega*t)
    return sym.flat_obj_array(1j * k * A, sym.curl(A))
示例#3
0
def get_sym_maxwell_point_source(kernel, jxyz, k):
    r"""Return a symbolic expression that, when bound to a
    :class:`pytential.source.PointPotentialSource` will yield
    a field satisfying Maxwell's equations.

    Uses the sign convention :math:`\exp(-i \omega t)` for the time dependency.

    This will return an object of six entries, the first three of which
    represent the electric, and the second three of which represent the
    magnetic field. This satisfies the time-domain Maxwell's equations
    as verified by :func:`sumpy.point_calculus.frequency_domain_maxwell`.
    """
    # This ensures div A = 0, which is simply a consequence of div curl S=0.
    # This means we use the Coulomb gauge to generate this field.

    A = sym.curl(sym.S(kernel, jxyz, k=k, qbx_forced_limit=None))

    # https://en.wikipedia.org/w/index.php?title=Maxwell%27s_equations&oldid=798940325#Alternative_formulations
    # (Vector calculus/Potentials/Any Gauge)
    # assumed time dependence exp(-1j*omega*t)
    return sym.join_fields(
        1j*k*A,
        sym.curl(A))
示例#4
0
    def scattered_volume_field(self, Jt, rho, qbx_forced_limit=None):
        """
        This will return an object array of six entries, the first three of which
        represent the electric, and the second three of which represent the
        magnetic field. This satisfies the time-domain Maxwell's equations
        as verified by :func:`sumpy.point_calculus.frequency_domain_maxwell`.
        """
        Jxyz = sym.cse(sym.tangential_to_xyz(Jt), "Jxyz")

        A = sym.S(self.kernel, Jxyz, k=self.k, qbx_forced_limit=qbx_forced_limit)
        phi = sym.S(self.kernel, rho, k=self.k, qbx_forced_limit=qbx_forced_limit)

        E_scat = 1j*self.k*A - sym.grad(3, phi)
        H_scat = sym.curl(A)

        return sym.flat_obj_array(E_scat, H_scat)
示例#5
0
    def scattered_volume_field(self, Jt, rho, qbx_forced_limit=None):
        """
        This will return an object array of six entries, the first three of which
        represent the electric, and the second three of which represent the
        magnetic field. This satisfies the time-domain Maxwell's equations
        as verified by :func:`sumpy.point_calculus.frequency_domain_maxwell`.
        """
        Jxyz = sym.cse(sym.tangential_to_xyz(Jt), "Jxyz")

        A = sym.S(self.kernel, Jxyz, k=self.k, qbx_forced_limit=qbx_forced_limit)
        phi = sym.S(self.kernel, rho, k=self.k, qbx_forced_limit=qbx_forced_limit)

        E_scat = 1j*self.k*A - sym.grad(3, phi)
        H_scat = sym.curl(A)

        return sym.join_fields(E_scat, H_scat)
示例#6
0
        def nxcurlS(qbx_forced_limit):

            return sym.n_cross(sym.curl(sym.S(
                knl,
                sym.cse(sym.tangential_to_xyz(density_sym), "jxyz"),
                qbx_forced_limit=qbx_forced_limit)))
示例#7
0
 def curl_S(dens):
     return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit=None, k=k))
示例#8
0
 def curl_S(dens, k):
     return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit="avg", k=k))
示例#9
0
 def j_operator(self, loc, Jt):
     Jxyz = cse(tangential_to_xyz(Jt), "Jxyz")
     return xyz_to_tangential(
             loc*0.5*Jxyz - sym.n_cross(
                 sym.curl(sym.S(self.kernel, Jxyz, k=self.k,
                     qbx_forced_limit="avg"))))
示例#10
0
 def curl_S(dens):
     return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit=None, k=k))
示例#11
0
 def curl_S(dens, k):
     return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit="avg", k=k))
示例#12
0
 def j_operator(self, loc, Jt):
     Jxyz = cse(tangential_to_xyz(Jt), "Jxyz")
     return xyz_to_tangential(
             loc*0.5*Jxyz - sym.n_cross(
                 sym.curl(sym.S(self.kernel, Jxyz, k=self.k,
                     qbx_forced_limit="avg"))))