On Sep 16, 2014, at 1:33 PM, John Ball <ballman2...@gmail.com> wrote: > 1. I will need to use subpixel averaging only when a pixel is intersected by > one of the triangles in my 3D mesh. In order to use this information, I need > the overloaded eff_chi1inv_row method to know the parameters of that plane. > An easy (but dirty) way to do this would be to allocate the plane parameters > on the same level as main (effectively making them global), so that when > eps() is evaluated, I can set the plane parameters, and the overloaded > eff_chi1inv_row would pick them up when it proceeds. I think this should work > because set_epsilon gets called separately for each grid point. However, like > I said, this seems pretty dirty--is there a better way to do this?
Well, if you don’t want to use globals you can always put any necessary data as fields of your meep::material_function subclass. For example, see how libctl/structure.cpp does it (with “class geom_epsilon”). > 2. Why is it called chi1inv, when the value being calculated is referred to > as epsilon^-1 in the linked paper, as well as elsewhere? What am I missing? Just to distinguish it from the nonlinear parts of epsilon (chi2 and chi3). We couldn’t think of a better name, though it is actually 1/(1+chi1) where chi1=χ⁽¹⁾ is the first-order susceptibility. —SGJ _______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss