# Path: sucemfem/Consts.py
# Z0 = mu0*c0                              


import numpy as np
import dolfin
import sucemfem.PostProcessing.ntff_expressions as ntff_expressions
from dolfin import curl, cross, dx, ds, Constant, dot
from sucemfem.Consts import Z0, c0
            return self.N_form
        except AttributeError:
            pass
        # Set up magnetic field and equivalent electric current forms
        H_r = -curl(self.E_i)/(self.k0*Z0)
        H_i = curl(self.E_r)/(self.k0*Z0)
        J_r = cross(self.n, H_r)
        J_i = cross(self.n, H_i)
        #------------------------------
        # Set up form for far field potential N
        theta_hat = self.theta_hat
        phi_hat = self.phi_hat
        phase = self.phase
        N_r = J_r*dolfin.cos(phase) - J_i*dolfin.sin(phase)
        N_i = J_r*dolfin.sin(phase) + J_i*dolfin.cos(phase)
        # UFL does not seem to like vector valued functionals, so we split the
        # final functional from into theta and phi components
        self.N_form = dict(
            r_theta=dot(theta_hat, N_r)*ds,
            r_phi=dot(phi_hat, N_r)*ds,
            i_theta=dot(theta_hat, N_i)*ds,
            i_phi=dot(phi_hat, N_i)*ds)
        return self.N_form

    def get_L_form(self):
        try:
            return self.L_form
        except AttributeError:
            pass
        # Set up equivalent magnetic current forms

# Path: sucemfem/Consts.py
# Z0 = mu0*c0                              


# Path: sucemfem/PostProcessing/surface_ntff.py
import numpy as np
import dolfin
import sucemfem.PostProcessing.ntff_expressions as ntff_expressions
from dolfin import curl, cross, dx, ds, Constant, dot
from sucemfem.Consts import Z0, c0

            return self.N_form
        except AttributeError:
            pass
        # Set up magnetic field and equivalent electric current forms
        H_r = -curl(self.E_i)/(self.k0*Z0)
        H_i = curl(self.E_r)/(self.k0*Z0)
        J_r = cross(self.n, H_r)
        J_i = cross(self.n, H_i)
        #------------------------------
        # Set up form for far field potential N
        theta_hat = self.theta_hat
        phi_hat = self.phi_hat
        phase = self.phase
        N_r = J_r*dolfin.cos(phase) - J_i*dolfin.sin(phase)
        N_i = J_r*dolfin.sin(phase) + J_i*dolfin.cos(phase)
        # UFL does not seem to like vector valued functionals, so we split the
        # final functional from into theta and phi components
        self.N_form = dict(
            r_theta=dot(theta_hat, N_r)*ds,
            r_phi=dot(phi_hat, N_r)*ds,
            i_theta=dot(theta_hat, N_i)*ds,
            i_phi=dot(phi_hat, N_i)*ds)
        return self.N_form

    def get_L_form(self):
        try:
            return self.L_form
        except AttributeError:
            pass
        # Set up equivalent magnetic current forms

        M_r = -cross(self.n, self.E_r)