Comments (3)
Dear Jonpry, this is a result of some older changes in the codes. Thanks, I will try to fix that.
from python-meep-utils.
The script below might be helpful, I archived it from the old repo.
class Wedge_model(meep_utils.AbstractMeepModel): #{{{
""" Array of circular metallic wires along electric field
FD 2013-07-13
"""
def cell_centers(self):
""" Helper function for stacked multilayered metamaterials """
return np.arange(-self.monzd*(self.cells-1)/2, self.monzd*(self.cells-1)/2+1e-12, self.monzd)
## alternatively: add surrounding two cells to compare the propagation _inside_ a metamaterial
#return np.arange(-self.monzd*(self.cells+1)/2, self.monzd*(self.cells+1)/2+1e-12, self.monzd)
def __init__(self, comment="TiO2", simtime=10e-12, resolution=3e-6, cells=1, monzc=0e-6, Kx=0, Ky=0, padding=50e-6,
radius=10e-6, yspacing=100e-6, zspacing=100e-6, monzd=200e-6, epsilon=100):
meep_utils.AbstractMeepModel.__init__(self) ## Base class initialisation
self.simulation_name = "Wedge" ##
self.register_locals(locals()) ## Remember the parameters
## Initialization of materials used
if 'TiO2' in comment:
self.materials = [meep_materials.material_TiO2_THz(where = self.where_wire)]
elif 'STO' in comment:
self.materials = [meep_materials.material_STO_THz(where = self.where_wire)]
elif 'DielLossless' in comment:
self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.0)]
elif 'DielLoLoss' in comment:
self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.005)]
elif 'Diel' in comment:
self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.05)]
else:
self.materials = [meep_materials.material_Metal_THz(where = self.where_wire)]
## Dimension constants for the simulation
#self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
self.pml_thickness = 20e-6
self.size_x = resolution/1.8
self.size_y = 2200e-6
self.size_z = 2000e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness
## constants for the simulation
(self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc - padding, (monzd*cells)/2+monzc + padding)
self.simtime = simtime # [s]
self.srcWidth = 3000e9
self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8) ## cutoff for oblique incidence
self.interesting_frequencies = (0., 2000e9)
#meep_utils.plot_eps(self.materials, freq_range=(1e10, 1e14), plot_conductivity=True)
self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
def where_wire(self, r):
y,z = r.y(), r.z()
if z < self.size_z*(-.3) or z+y/2>0:
return 0
yy,zz = np.arccos(np.cos(y/self.yspacing*np.pi*2))*self.yspacing/(np.pi*2), np.arccos(np.cos(z/self.zspacing*np.pi*2))*self.zspacing/(np.pi*2)
if (yy**2+zz**2)**.5 < self.radius:
return self.return_value
return 0
from python-meep-utils.
In fact, you can retrieve any form of the script from the project history by browsing my old commits and using git checkout.
The purpose of removing it is not to conceal anything from you, but to maintain some minimum standard of quality of published software. If I recall correctly, the script did not work as I expected. It is on my to-do list to fix it.
from python-meep-utils.
Related Issues (10)
- 'No module named 'meep_mpi' HOT 1
- passing params on command line HOT 8
- Incompatibility with HDF5 lib in Fedora23+ HOT 4
- "np" shortcut is used instead of "mpirun" HOT 1
- LDOS computation in python-meep returns <Swig Object of type 'double *'>, cannot access from Python HOT 17
- MPI synchronisation freezes in ca 1% of simulations
- h5utils not compiling with Cygwin HOT 1
- numpy.float64 object cannot be interpreted as an index
- port to new Python API? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-meep-utils.