# -*- coding: utf-8 -*- """ Created on Thu Oct 29 08:41:07 2015 @author: tho """ # add path # test dielectric function # import modules import numpy as np import matplotlib.pyplot as plt from mnpbempp.material import material as material reload(material) # name of material mat = 'silver' # construct dielectric functions epsc = material.epsconst(0.85 + 0.9j) epsd = material.epsdrude(mat) epst = material.epstable(mat) enei = np.linspace(200, 1000, num=100) # plot plt.plot(enei, np.real(epsc(enei)), '.', enei, np.imag(epsc(enei)), '.') plt.figure() plt.plot(enei, np.real(epsd(enei)), '.b', enei, np.real(epst(enei)), '.r') plt.figure() plt.plot(enei, np.imag(epsd(enei)), '.b', enei, np.imag(epst(enei)), '.r')
import mnpbempp.particle reload(mnpbempp.bemsolver.bemret) # options for bempp bempp.api.global_parameters.assembly.boundary_operator_assembly_type = 'dense' # energy of planewave excitation (eV) ene = np.arange(1, 3.51, 0.1 ) # wavelength in nm enei = 1240.0/ene # number of wavelength values n = enei.shape[0] # make table of dielecric functions import mnpbempp.material.material as material epsd = material.epsdrude( 'silver' ) epsc = material.epsconst( 1 ) # store sourounding medium in first entry of list ( needed by some routines ) epstab = [ epsc, epsd ] # make array for scattering data ext = np.array(enei, float) # import grid from file grid = bempp.api.import_grid('/data/tho/disk2.msh') # create comparticle object p = mnpbempp.particle.comparticle( epstab, grid ) # create bemsolver for particle bem = mnpbempp.bemsolver.bemret.bemret( p ) # create excitation
# -*- coding: utf-8 -*- """ Created on Thu Oct 29 08:41:07 2015 @author: tho """ # add path # test dielectric function # import modules import numpy as np import matplotlib.pyplot as plt from mnpbempp.material import material as material reload(material) # name of material mat = 'silver' # construct dielectric functions epsc = material.epsconst( 0.85+0.9j ) epsd = material.epsdrude( mat ) epst = material.epstable( mat ) enei = np.linspace( 200, 1000, num = 100 ) # plot plt.plot( enei, np.real( epsc( enei ) ),'.', enei, np.imag( epsc( enei ) ),'.' ) plt.figure() plt.plot( enei, np.real( epsd( enei ) ), '.b', enei, np.real( epst( enei ) ), '.r' ) plt.figure() plt.plot( enei, np.imag( epsd( enei ) ), '.b', enei, np.imag( epst( enei ) ), '.r' )