New patches: [unrevert anonymous**20051007223055] < > { hunk ./src/meep.hpp 524 void save_hdf5(h5file *file, const char *dprefix = 0); void load_hdf5(h5file *file, const char *dprefix = 0); +v v v v v v v + + void operator-=(const dft_flux &fl) { if (E && fl.E) *E -= *fl.E; if (H && fl.H) *H -= *fl.H; } +************* + void save_hdf5(fields &f, const char *fname, const char *dprefix = 0); + void load_hdf5(fields &f, const char *fname, const char *dprefix = 0); +^ ^ ^ ^ ^ ^ ^ void operator-=(const dft_flux &fl) { if (E && fl.E) *E -= *fl.E; if (H && fl.H) *H -= *fl.H; } } Context: [resolve merge conflicts stevenj@fftw.org**20051002161422] [add operator-= for dft_chunk so that we can subtract fields from two simulations in the same run without saving as hdf5 alexrod7@mit.edu**20050930225740] [added mpicxx check (from Silvestre Zabala) as well as new macro-archive tags stevenj@fftw.org**20050902185432] [slightly simplified save_hdf5 and load_hdf5 for dft_flux stevenj@fftw.org**20050902022008] [bug fix in solve_cw - check for zero current amplitudes must include all processors stevenj@fftw.org**20050902005056] [bug fix in fields::initialize - don't try to initialize non-allocated fields stevenj@fftw.org**20050808233955] [allow phasing of cylindrical radius via fields::set_rshift stevenj@fftw.org**20050808232948] [added 3-mirror-plane test stevenj@fftw.org**20050808184512] [added symmetry::operator- stevenj@fftw.org**20050808183912] [initialize mpi(argc,argv) had to be modified to pass those arguments as *references*, since MPI_Init may modify the argument list (fortunately, no changes are required to user code) stevenj@fftw.org**20050727201710] [typo (wrong return type) stevenj@fftw.org**20050726003059] [wrong format string now that m is double stevenj@fftw.org**20050726003049] [bugfix in HDF5+MPI (called H5Fopen instead of H5Fcreate) stevenj@fftw.org**20050725214323] [HDF5 check needs to use MPICXX in case HDF was compiled with MPI (and needs mpi.h for header file) stevenj@fftw.org**20050725214225] [allow non-integer values of "m" in cylindrical coordinates (you probably should only do this for cells that don't include r=0) stevenj@fftw.org**20050718225351] [slightly weakened test (now that we are truly including multiple source frequencies) stevenj@fftw.org**20050708211902] [noticed *another* apparent bug in nonlinear code for symmetry, grrr (??); disable test for now stevenj@fftw.org**20050708203636] [add more multiple-source tests to symmetry.cpp stevenj@fftw.org**20050708203604] [fix by Mihai for case with multiple source times stevenj@fftw.org**20050708002119] [another potential bug exposed by my previous patch - polariton_ex test also fails when symmetry is included, so revert with comment for now stevenj@fftw.org**20050602011931] [can't use "darcs changes" to generate ChangeLog during 'make dist', because then 'darcs check' will fail (doesn't run in darcs dir); instead, add new 'make darcs-dist' target that creates the ChangeLog stevenj@fftw.org**20050602001642] [silence warning stevenj@fftw.org**20050602001055] [silence C++ warning stevenj@fftw.org**20050602001031] [Generate ChangeLog automatically during 'make dist' stevenj@fftw.org**20050601234628] [add equal_layout method to check whether two fields/structures have same stevenj@fftw.org**20050601181523 chunking, etcetera; testcase in symmetry.cpp also add == for symmetry and signed_direction, and != for various things that already have ==. also fixed bug in symmetry.cpp (some fields were being compared to themselves rather than to symmetrized version) NOTE: THERE IS STILL A BUG IN symmetry.cpp ... nonlinear_ex() compares the field to itself rather than to a symmetrized version, and fails if the correct thing is done, which means that there may be a bug in the nonlinear code for symmetry ] [pass chunk index to chunkloop function, so that in the future we can easily write functions that e.g. compare two different fields objects stevenj@fftw.org**20050601164606] [current unit fix: field update should add current*dt, not current, to fields stevenj@fftw.org**20050601045053] [minor update to bicgstab comments stevenj@fftw.org**20050601043349] [whoops, forgot to return a value from solve_cw stevenj@fftw.org**20050601042739] [need string.h in bicgstab.cpp for memset() stevenj@fftw.org**20050601002039] [to get current(t) from dipole(t), use forward rather than backward difference (makes slightly more sense with solve_cw since many currents turn on at t = 0, and backwards difference would then give undesired spike at t=0) stevenj@fftw.org**20050601000500] [get sources directly in solve_cw; add new step_d_source to sidestep current hacks stevenj@fftw.org**20050531235504] [use solve_cw in physical.cpp instead of timestepping stevenj@fftw.org**20050531232453] [put -J on right hand side of solve_cw stevenj@fftw.org**20050531232416] [yikes, silly bug in fields::solve_cw stevenj@fftw.org**20050531223651] [allow CW sources to have complex frequencies (e.g. exponentially decaying) stevenj@fftw.org**20050531221747] [increase maxiters default to 10000 in solve_cw stevenj@fftw.org**20050531220717] [add solve_cw() variant that gets frequency from sources (and has reasonable defaults for the tolerance and maximum iterations) stevenj@fftw.org**20050531220513] [don't output so often in bicgstab stevenj@fftw.org**20050531215224] [slight tweak in bicgstab stevenj@fftw.org**20050531214900] [in fields::solve_cw, use the BiCGSTAB(L) algorithm instead of BiCGSTAB. With L >= 2, this avoids a known convergence failure in BiCGSTAB for operators (like ours) where the eigenvalues are nearly purely imaginary. Now, solve_cw converges to arbitrary tolerance (limited by numerical precision, of course) even in > 1d! Hooray, it works! stevenj@fftw.org**20050531212611] [whoops, forgot to add cw_fields.cpp stevenj@fftw.org**20050531051222] [remove (commented-out) stabilized dnrm2, which doesn't parallelize anyway stevenj@fftw.org**20050531023505] [whoops stevenj@fftw.org**20050531023410] [during phasing, don't forget to update the E boundaries as well as E stevenj@fftw.org**20050531022305] [add new fields::solve_cw method that, instead of timestepping, treats the whole FDTD system as a big linear equation (specified implicitly by the fields::step) and solves it by the stabilized bi-conjugate gradient method to get the CW response at a particular frequency. It seems to work reasonably well, except for some reason I can't fathom you can't set the tolerance very low (less then 1e-2) or it never converges in 2+ dimensions stevenj@fftw.org**20050531022006] [add FIXME comment to unnecessary allocation stevenj@fftw.org**20050519192105] [fixed slight bug ... volume::nowned() really returned the minimum nowned over all components, which is slightly less than the actual nowned for some components in cylindrical coords; changed the name to nowned_min() to reflect this, added a new nowned(component) that gives the exact nowned, and added a regression test stevenj@fftw.org**20050517205748] [rename all C++ headers to .hpp, for consistency with .cpp and for clarity stevenj@fftw.org**20050517201933] [don't re-allocate d_minus_p array at each timestep stevenj@fftw.org**20050516225239] [add possibility to change PML strength, e.g. pml(X) * 2.0 will increase PML conductivity by 2 (squaring attenuation for same thickness, in theory, albeit increasing numerical reflection) stevenj@fftw.org**20050516220320] [comment regarding accuracy of modal volume calcs stevenj@fftw.org**20050516194501] [Darcs is now right-handed (there was a bug in 1d/2d/3d that caused the curls to have the wrong signs, making the system "left-handed" and giving fluxes the wrong signs, although it didn't affect most other calculations) stevenj@fftw.org**20050516185827] [work around datatype change in HDF5 1.6.4 (grrr) stevenj@fftw.org**20050516173637] [eliminate unnecessary allocation of PML fields stevenj@fftw.org**20050516172919] [whoops, fix compilation failure for --without-hdf5 stevenj@fftw.org**20050427193347] [fixed incorrect types in hdf5 calls stevenj@fftw.org**20050425212520] [print a little more information from "aack, odd number of grid points" stevenj@fftw.org**20050425203334] [when phasing epsilon, use update_e_from_d to keep E in synch, rather than "manual" division and multiplication by inveps diagonal" stevenj@fftw.org**20050425203135] [order spherical quadrature points to maximize spatial separation (to make interface detection more efficient, in future) stevenj@fftw.org**20050425203055] [fix bug when running in cylindrical coordinates with real fields. droundy@abridgegame.org**20050502144424] [output s/step along with time-step status stevenj@fftw.org**20050205184455] [fix comment stevenj@fftw.org**20050205174616] [rename Slicing to FieldOutput (since we also count hdf5 output under this) stevenj@fftw.org**20050205172451] [more verbose output by default, with option to suppress by setting meep::quiet = true stevenj@fftw.org**20050205171911] [allocate all fields lazily (not just in 2d), ensure all field arrays are initialized to null, don't allocate imag. part for is_real, add missing is_real check to fields::initialize, various cleanups stevenj@fftw.org**20050205162251] [major surgery on connect_the_chunks stevenj@fftw.org**20050205005344 connect_the_chunks was: (a) a major performance bottleneck on multiprocessor systems (b) very difficult to modify, consisting of the same code copy-and-pasted many times (c) fairly fragile, with the loops impossible to reorder without breaking step.cc I've tried to fix all of those problems. Now, instead of calling things like locate_point O(nc^2) where np is the number of chunks, it only computes it O(nc) times, and a lot of the duplication is removed. It's also much less fragile, because the connections are stored per phase type (complex, -1, or +1) rather than in one order-sensitive array. However, this required major changes to boundaries.cpp and related code. ] [added new methods dft_flux::scale_dfts, fields::require_component, and fields::remove_sources stevenj@fftw.org**20050201002319] [prelimiary support for "D" sources, which multiply J by epsilon stevenj@fftw.org**20050127053241] [support symmetry-based reductions of geometric_volume_list for efficient computation e.g. of DFT fluxes etc stevenj@fftw.org**20050127053034] [bug fix in symmetry::phase_shift for Poynting vector stevenj@fftw.org**20050127052949] [force newline in abort messages if one is missing stevenj@fftw.org**20050127052826] [immediately flush master_printf output stevenj@fftw.org**20050126011921] [comment correction stevenj@fftw.org**20041206230409] [added new derived_component type for various quantities (Poynting vector, energy density) useful to output in get_field and output_hdf5 stevenj@fftw.org**20041206222502] [consolidated min/max/abs functions in meep_internals.h stevenj@fftw.org**20041206200807] [whoops (only compute offsets for integration on Dielectric grid) stevenj@fftw.org**20041206195550] [fixed missing namespaces stevenj@fftw.org**20041206194047] [consolidated/simplified fields::output_hdf5 interface stevenj@fftw.org**20041206192153] [add -*- C++ -*- to top of header files so that emacs will use C++ mode (even though they end with .h and not .hpp or .hh) stevenj@fftw.org**20041206184427] [rewrote hdf5 output again in terms of new generic field_function (to output an arbitrary function of the fields); also, when the Dielectric component is requested we use 3/trace(average inveps) instead of eps[i], since the former is closer to what is actually used for time-stepping stevenj@fftw.org**20041206055410] [whoops, forgot to add integrate.cpp stevenj@fftw.org**20041205192412] [rename fields::integrate to fields::loop_in_chunks, to reflect more generic nature; added *new* fields::integrate which *does* just do integration and makes it much much easier; rewrote energy_and_flux.cpp in terms of new integrate function stevenj@fftw.org**20041205190752] [faster, more easily generalized output_hdf5 based on fields::integrate stevenj@fftw.org**20041204010206 The old version of fields::output_hdf5 pre-dated fields::integrate, and had home-brewed code for looping over the chunks and symmetries and computing the output from each. Not only was this complicated (as opposed to centralizing the complexity in fields::integrate), but it also was based on fields::interpolate onto an arbitrary grid, which had the following disadvantages: * doing an arbitrary interpolation for every point in a large volume is very slow. This is a problem if we want to output often. * very hard to compute functions of more than one field component, e.g. the energy density or the average inveps dielectric, because on an arbitrary grid this requires communication in general. * hard to prevent different chunks/symmetries to write slightly overlapping data, which produces undefined results in parallel HDF5. The new code *always* outputs on the dielectric grid, which (since it is a fixed interpolation scheme) is a tight loop for each chunk, and is guaranteed by fields::integrate to be non-overlapping. Perhaps even more importantly, it will now be easy to implement output functions of more than one field component, since no communication is required for the interpolation. ] [whoops, fixed bug in last patch (vec min/max funcs) stevenj@fftw.org**20041203172535] [added more min/max functions for vec/ivec stevenj@fftw.org**20041203053708] [added snap_unit_dims to fields::integrate stevenj@fftw.org**20041203053616] [comment clarification for yee2diel_offsets stevenj@fftw.org**20041203053409] [stopgap fix for PML with non-diagonal inveps...is a longer-term, "proper" fix needed??? stevenj@fftw.org**20041202224954] [added h5file::prevent_deadlock() for deadlock-prevention hacks in exclusive-access HDF5 mode (maybe we should just ditch support for that and require HDF5 to be compiled with MPI?) stevenj@fftw.org**20041130023742] [completely revamped structure and structure_chunk initialization stevenj@fftw.org**20041130002853 In the previous version of the code, the typical initialization sequence went like this: 1) create structure (initializes chunks, evaluates epsilon) 2) set PML (re-initializes chunks, shuffles epsilon around) Step (2) is problematic because the communication of epsilon to the new chunks was performed point-by-point. Not only is this incredibly slow, but it actually causes Tungsten's MPI implementation to crash (probably because there are too many messages). Moreover, it is completely unnecessary. In the new version, the PML boundaries are specified when the structure is first created, so that the chunks need only be computed once and are never re-shuffled around. INCOMPATIBLE API CHANGE: old: structure s(vol, eps, splitting, symmetries); s.use_pml_everywhere(1.0); new: structure s(vol, eps, pml(1.0), symmetries, splitting); In general, the PML boundary regions are specified by *summing* terms of the form pml(thickness, direction, High/Low). If one or both of the last two arguments is omitted, it means *all* sides and *all* directions, respectively. So, a more complicated example is: old: structure s(vol, eps, splitting, symmetries); s.use_pml(X, High, 1.0); s.use_pml(X, Low, 1.0); s.use_pml(Y, High, 1.0); new: structure s(vol, eps, pml(1.0, X) + pml(1.0, Y, High), symmetries, splitting); To specify *no* PML, you use: structure s(vol, eps, no_pml(), symmetries, splitting); This is actually the default, if you omit the boundary-region argument along with splitting (default = 0) and symmetries (default = identity). INCOMPATIBLE API CHANGE: old: s.set_epsilon(eps, minvol, do_aniso_averaging); new: s.set_epsilon(eps, do_aniso_averaging, minvol); The default for the last two arguments is true and 0, respectively, so in the usual case where you are using this function because you want to turn on averaging (currently not the default), you just do: s.set_epsilon(eps); ] [provide high-resolution wall_time() function in lieu of clock(). Automatically print elapsed time upon program completion. Don't use exit(0) in main()...use return 0 so that ~initialize() is called. stevenj@fftw.org**20041129000135] [add stride0 function that returns 0, instead of 1, for unused dimensions, so that we can easily distinguish them from "real" dimensions in macros etc. stevenj@fftw.org**20041125010409] [don't use make_average_eps in omniguide.tex stevenj@fftw.org**20041125010339] [remove structure::make_average_eps (apparently unused, non-functional, pointless function) stevenj@fftw.org**20041124224955] [updated acx_mpi.m4 stevenj@fftw.org**20041105174513] [added another joke stevenj@fftw.org**20041030013013] [added fields::electric_energy_weighted_integral function alexrod7@mit.edu**20040820220859] [resolve conflict stevenj@fftw.org**20041029015137] [bug fix: tensor epsilon averaging missed the z component in 2d (added test case for this) alexrod7@mit.edu**20041029014829] [add fields::electric_deps_integral_in_box function for perturbation theory etc. alexrod7@mit.edu**20040809193116] [when computing max(E dot D), compute product of components *before* averaging, in closer analogue to how energy integral is computed stevenj@fftw.org**20040727222411] [add function to compute modal volume according to Purcell definition alexrod7@mit.edu**20040720193727] [removed gratuitous "inline" keyword that confused gcc 3.3 stevenj@fftw.org**20040715010203] [correct save_dft_hdf5/load_dft_hdf5 for MPI, add test case to bragg_transmission.cpp (compute reflection by subtracting DFTs) stevenj@fftw.org**20040715000219] [vec(r,z) -> veccyl(r,z); vec2d(x,y) -> vec(x,y) stevenj@fftw.org**20040714213818 as a historical artifact, the code used vec(_, _) to indicate cylindrical coordinates, while vec(_) was 1d and vec(_,_,_) was 3d. 2d was handled by vec2d(_, _). It makes much more sense to make cylindrical coordinates the exception, and so I have implemented this change. To insure that this does not introduce any bugs into Meep, I implemented the change in 2 stages. First, implement veccyl and remove vec(_, _) constructor -- the compiler catches any uses of the 2 argument vec(_,_) and I can replace them with veccyl. Second, remove vec2d and make vec(_,_) produce a 2d vector. USER CODE WILL NEED TO BE UPDATED, HOWEVER! Hopefully, the elimination of vec2d will clue people in that something has changed. ] [slight change in flux tolerance stevenj@fftw.org**20040714192217] [rename c -> Courant, make a field of structure instead of global stevenj@fftw.org**20040713233326 First of all, I renamed "c" to "Courant", since that is what it is (Courant number = dt/dx) ... it is not the speed of light, which should be 1. (I've run into bugs multiple times now from having "c" be shadowed by a local variable, e.g. for the component, and this gets rid of that forever.) Second, since people may want to change the Courant number to reduce numerical dispersion (in general, it only has to be < 1 / sqrt(#dimensions)), I made it a field of the structure class (and also of structure_chunk and fields_chunk). The default is still 0.5, however. Third, inva is no longer a field of the fields class; instead, we have a new field dt which is the timestep. This is much more intuitive and useful to the end-user (and to us) instead of having to compute Courant*inva all the time. There some minor related changes. e.g. do_harminv takes simply the sampling interval dt instead of a scale_factor and a. ] [use delete[] instead of delete in dft.cpp stevenj@fftw.org**20040713222048] [grrrr stevenj@fftw.org**20040713044136] [grrr stevenj@fftw.org**20040713042932] [set GEN_CTL_IO even --without-libctl stevenj@fftw.org*-20040713041452] [can't buld meep_wrap.cxx without libctl stevenj@fftw.org**20040713041932] [set GEN_CTL_IO even --without-libctl stevenj@fftw.org**20040713041452] [disable debugging output in integrate.cpp stevenj@fftw.org**20040713033850] [fix bug in dft_flux spectrum, support dft over list of geometric volumes in preparation for exploiting symmetry, add routine to get dft flux through surface of box stevenj@fftw.org**20040713033353] [note FIXME in dft.cpp (save_hdf5 is wrong for MPI) stevenj@fftw.org**20040701160255] [make cylindrical flux test include r=0 in interior of integration volume stevenj@fftw.org**20040630234607] [added cylindrical-coord flux test stevenj@fftw.org**20040630233806] [fields::add_dft_pt, so that we can get the dft of a point without computing field value * dV stevenj@fftw.org**20040625180304] [update for new libctl, which supports (limited) SWIG integration stevenj@fftw.org**20040622185356] [append_data option only makes sense for fields::output_hdf5 version that takes an h5file option stevenj@fftw.org**20040622000821] [various modifications to support using SWIG to help generate Guile (libctl) interface, so I don't have to muck around with smobs stevenj@fftw.org**20040621235749] [print benchmark output in easier format for grepping and tabulating stevenj@fftw.org**20040621212644] [don't use --enable-shared in darcs_test (triggers a bug with gcc 2.95, apparently) meep@ab-initio.mit.edu**20040714204512] [no need to include mymypi.h and vec.h if already included via meep.h stevenj@fftw.org**20040621042857] [vec.h and mympi.h should be installed under /usr/local/include/meep, while meep.h is installed under /usr/local/include stevenj@fftw.org**20040621042221] [lazy chunk connection: only reconnect chunks once, and do so in step_boundaries, after chunk connections have been invalidated by sources, boundary conditions, etc. stevenj@fftw.org**20040619180948] [whoops, incorrect return type on new set_origin stevenj@fftw.org**20040619001248] [only call func() once per point, and use LOOP_OVER_VOL, in initialize_field stevenj@fftw.org**20040618235951] [optimizations after profiling stevenj@fftw.org**20040618234738 After running the code with profiling (compile with -pg) and analyzing the results with gprof, I noticed that a lot of time was being wasted calling volume::io() and volume::iloc() during "startup". (This corroborated an earlier observation that the pre-time-stepping code was taking a long time, several seconds in 3d.) I've sped up this greatly by several improvements, summarized as follows: 1) Eliminate loops of the form: for (i = 0; i < v.ntot(); ++i) { ivec here = v.iloc(c, i); ... } replacing them with LOOP_OVER_VOL 2) Add special loops LOOP_OVER_VOL_OWNED and LOOP_OVER_VOL_NOTOWNED to loop just over the owned and not-owned (boundary) points, respectively. 3) io() was still taking too long, so I replaced it with a io member that is recomputed on the rare occasions when the origin is changed. To make sure that it gets recomputed, volume::origin is now private, and there are functions for getting/setting it. Plus a few other tricks/optimizations in heavily-called "startup" functions. ] [pass shift ivect instead of vec to field integrand, so that ivec coords can be computed without worrying about rounding stevenj@fftw.org**20040617215006] [whoops, bug in h5file::read_size stevenj@fftw.org**20040617175621] [accept data prefix in dft/flux load/save HDF5 stevenj@fftw.org**20040617075131] [set outdir in fields::set_output_directory(!!) stevenj@fftw.org**20040617063446] [removed unused dindex stevenj@fftw.org**20040617063358] [extra check in src_vol integrand stevenj@fftw.org**20040617063337] [add add_volume_source that assumes a constant amplitude stevenj@fftw.org**20040617063224] [update bragg_transmission for new output_hdf5 syntax, print a little output stevenj@fftw.org**20040610062906] [whoops, some fixes to previous h5file patch stevenj@fftw.org**20040610061935] [lazy HDF5 creation, closing after data extension, to avoid deadlocks for writing time data stevenj@fftw.org**20040610060550] [fixed logic bug in hdf5: need to keep a list of extensible datasets; just remembering most recent one is insufficient stevenj@fftw.org**20040610050533] [reworked HDF5 I/O api, so that file can be kept open until I/O operations are finished stevenj@fftw.org**20040610040908] [use "=", not "==" for sh tests stevenj@fftw.org**20040608213718] [lower tolerance to ignore small negative weights stevenj@fftw.org**20040608204341] [according to the GNU libc manual, you should always ignore SIGINT if the parent process wants you to stevenj@fftw.org**20040608204301] [check whether to catch and ignore SIGFPE, for darn Alpha systems that crash even on innocuous things like exp(-infinity) stevenj@fftw.org**20040608204156] [check for MPI immediately after getting C++ compiler, so that mpiCC is used for all subsequent tests (for --with-mpi) stevenj@fftw.org**20040608021332] [don't output hdf5 file in bragg_transmission test stevenj@fftw.org**20040604224155] [removed DFT volumes and fluxes from TODO (since done) stevenj@fftw.org**20040602205001] [added geometric_volume::normal_direction stevenj@fftw.org**20040602204246] [bug fixes in dft, add dft_flux feature, add test case comparing to analytical 1d Bragg transmission spectrum stevenj@fftw.org**20040602203008] [added 2d flux test stevenj@fftw.org**20040601064445] [IVEC_LOOP_WEIGHT macro cleanup stevenj@fftw.org**20040601050027] [whoops, do I remember how to compute cross products? stevenj@fftw.org**20040601015630] [as long as we have ivec::<=, we should have >=, <, and > too stevenj@fftw.org**20040601002239] [whoops, inva instead of a in fields::integrate for source volumes stevenj@fftw.org**20040601002210] [added unit_vec function to vec.h stevenj@fftw.org**20040531235808] [make sure coordinates are exact in symmetry.cpp stevenj@fftw.org**20040531224944 In symmetry.cpp, we want to check that adding symmetry to a simulation produces *exactly* the same result as the simulation without explicit use of symmetry. This, however, requires a great deal of care with floating point arithmetic. In particular, one important requirement is that the sources *exactly* obey the symmetry condition. In order for this to be true, the location of the source *as represented within floating point* must be symmetric. (Recall that floating-point can only represent base-2 rational fractions exactly, i.e. integer * 2^e.) To impose this condition, we employ two tricks: First, the resolution 'a' should be exactly representable (e.g. a power of 2) , so that no surprises occur when converting vecs to ivecs etc. Second, the coordinates, or at least those coordinates which are supposed to be symmetric, must be exactly representable. For example, suppose that something is supposed to be mirror symmetric around x=0.5. You might think that sources at x=0.2 and x=0.8 would satisfy this, but they don't because those two coordinates are not exactly representable--they are stored as 0.2+eps1 and 0.8+eps2, where eps1 and eps2 are ~1e-16, and these coordinates are not symmetric. Instead, we use e.g. x=0.25 and x=0.75, which are symmetric because they are exactly represented (1 / 2^2 and 3 / 2^2, respectively). Of course, a user code is not expected to play these games, but in such circumstances it is acceptable for the symmetric and non-symmetric simulations to differ by errors on the order of the machine precision. ] [only call alloc_f() for is_mine() chunks stevenj@fftw.org**20040531003125] [LOOP_OVER_IVECS cleanups stevenj@fftw.org**20040531003049] [replace old add_source_volume with new version based on fields::integrate stevenj@fftw.org**20040530235908] [add max() function for symmetry.cpp, when C++ doesn't provide it stevenj@fftw.org**20040529074412] [updated "known result" for polariton_energy for new fields::integrate-based energy stevenj@fftw.org**20040529070224 The new field_energy function, using fields::integrate, gives slightly different energy results from the old code. This is because of different integration weights for the boundary edges...I think the new version is more reasonable, actually. Basically, the old code just summed up the energy for every point in the cell, with uniform integration weight. The new code is almost the same, except that at the boundaries, it integrates the boundary pixels assuming linear interpolation to the points just beyond (or at) the boundary. (Points beyond the boundary are assumed zero for non-periodic boundary conditions.) I think this should be more accurate. Of course, the new result and the old result converge to one another as the resolution is increased. ] [completely replaced old flux_plane stuff with new flux_box calculation (supports 2d/3d flux integration, not just 1d) stevenj@fftw.org**20040529065155] [added fields::integrate-based flux and thermo. energy stevenj@fftw.org**20040529055307] [fields::integrate now works over an arbitrary Yee grid stevenj@fftw.org**20040529032741] [some code compression in dft.cpp stevenj@fftw.org**20040529012712] [fixes to fields::integrate and friends (+ more rigorous test), use fields::integrate for energy integration stevenj@fftw.org**20040529003027] [added dft.cpp: generic DFT volume support stevenj@fftw.org**20040528022002] [added read_chunk, read_size to h5io stevenj@fftw.org**20040528001802] [don't call globals "dirname", since this is a library function in POSIX michel@mit.edu**20040528224943] [whoops, missing close paren michel@mit.edu**20040528224102] [check for fftw2 installed as libdfftw michel@mit.edu**20040528224015] [minor tweak stevenj@fftw.org**20040527085829] [whoops stevenj@fftw.org**20040527085443] [add fields::integrate and friends (this should make it *much* easier to implement DFT volumes, integration of energy/flux, etcetera) stevenj@fftw.org**20040527082804] [comments re: src_vol stevenj@fftw.org**20040525002407] [whoops, fixed infinite loop introduced by previous patch stevenj@fftw.org**20040524215031] [Support HDF5 output of supercell (or volume not intersecting cell) for periodic boundaries stevenj@fftw.org**20040524214025] [add h5io::read and h5io::write for string data stevenj@fftw.org**20040523235029] [hdf5 output should be single-precision by default (no reason to waste a factor of 2 in space, since FDTD isn't accurate to 8 decimal places anyway), changed order of output_hdf5 etc. to be somewhat more sensible stevenj@fftw.org**20040523224354] [FIXME: thermo_energy_in_box has a comment saying it is buggy for symmetry & parallel, but it is still being called stevenj@fftw.org**20040523223158] [HDF5 epsilon output is now supported; note how we plan to implement energy density and Poynting vector output stevenj@fftw.org**20040523185415] [support Dielectric component in get_field, elsewhere; added NO_DIRECTION direction so that scalars work with symmetry; fixed fields::get_eps so that it gives same results with multiple chunks; silenced numerous gcc 3.4 compiler warnings stevenj@fftw.org**20040523185006] [silence warning in bands.cpp stevenj@fftw.org**20040523053144] [changed prototypes for output_hdf5, add option to automatically name files etc. like for slice output stevenj@fftw.org**20040523014200] [more TODO michel@mit.edu**20040520231750] [set small weight to zero for interpolation, check for negative weights michel@mit.edu**20040520214120] [lower harminv limit stevenj@fftw.org**20040520043836] [prevent harminv matrices from getting too big stevenj@fftw.org**20040520041201] [pick closest freq to converged value, instead of last one within 0.03 stevenj@fftw.org**20040520032547] [use fixed spectral density instead of fixed number of modes as default in do_harminv, to avoid singular eigenproblems and resulting instabilities, as also described in 'man harminv' stevenj@fftw.org**20040520032433] [whoops, merge pre-split harminv-related changes made with Mihai stevenj@fftw.org**20040519073638] [whoops, limit nf by maxbands, not numfreqs stevenj@fftw.org**20040519071038] [rewrite harminv support for harminv 1.1 stevenj@fftw.org**20040519035543] [bug fix: handle case where harminv returns only 1 frequency stevenj@fftw.org**20040519035246] [give error if ghc is missing in --enable-maintainer-mode stevenj@fftw.org**20040517224214] [Fix slice output bug due to buffering michel@mit.edu**20040518190653] [TODO: split harminv michel@mit.edu**20040513235253] [error if no LAPACK (disable harminv instead?), abort if try to save to HDF5 without HDF5 michel@mit.edu**20040513233258] [fixed handling of missing pkg-config and/or harminv stevenj@fftw.org**20040515051525] [use external harminv library stevenj@fftw.org**20040515042843] [fix bug: inverse symmetry is S.transform(foo,-sn), not S.transform(foo,S.multiplicity()-sn) michel@mit.edu**20040513232305] [TODO file stevenj@fftw.org**20040513223144] [support compilation without FFTW or GSL stevenj@fftw.org**20040513222011] [prevent floating-point exception from 0/0 stevenj@fftw.org**20040513221544] [added strategic calls to sync() and all_wait() to get HDF5 output working under MPI stevenj@fftw.org**20040513003436] [bug fix: h5io::write_chunk forgot to call H5Dclose stevenj@fftw.org**20040512223635] [fixes so that h5io.cpp compiles without hdf5 stevenj@fftw.org**20040512220140] [make h5test pass (trivially) in --without-hdf5 case stevenj@fftw.org**20040512214715] [workaround for bug in g++ 2.95 stevenj@fftw.org**20040512213416] [more robust checking for feenableexcept declaration stevenj@fftw.org**20040512213027] [define _GNU_SOURCE to make sure feenableexcept is declared by fenv.h stevenj@fftw.org**20040512210200] [comment re src_vol index comparison stevenj@fftw.org**20040512203945] [added h5test case for appending data (plus some cleanups/fixes in append case) stevenj@fftw.org**20040512203812] [h5io::write should only execute on master stevenj@fftw.org**20040512184353] [implemented volume sources michel@mit.edu**20040512184301] [include "meep_internals" for min() and max() functions stevenj@fftw.org**20040512075124] [whoops, forgot to include h5fields.cpp, duhh stevenj@fftw.org**20040512070607] [whoops, make sure z dir. of h5 output file is non-empty in test stevenj@fftw.org**20040512070011] [slightly smaller h5test stevenj@fftw.org**20040512065816] [get damned HDF5 test program to pass with symmetry stevenj@fftw.org**20040512065446] [support inverse transforms in symmetry::transform (denoted by -n) stevenj@fftw.org**20040512010519] [fixed chunk bug in h5io, check splitting in h5test stevenj@fftw.org**20040512002214] [3d h5test stevenj@fftw.org**20040512000435] [fixed various bugs in h5io, got first test case working stevenj@fftw.org**20040511231531] [initial h5 output support (no symmetry, not tested much) stevenj@fftw.org**20040511200251] [fix doc/meep.pdf output stevenj@fftw.org**20040511185539] [update COPYRIGHT year stevenj@fftw.org**20040511185518] [silence warnings stevenj@fftw.org**20040508044636] [non-collective interpolation stevenj@fftw.org**20040508035114] [add h5io.cpp, basic HDF5 i/o routines (not used yet) stevenj@fftw.org**20040506234913] [add nonlinear example to documentation. droundy@abridgegame.org**20040508234258] [fix bug in kerr computation. droundy@abridgegame.org**20040508233812 I was calculating inveps where I should have been calculating the fractional change in inveps. ] [split update_e_from_d into three routines. droundy@abridgegame.org**20040508205323 This is to deal with some versions of gcc that would crash trying to compile update_e_from_d. ] [add geometric_volume::intersects stevenj@fftw.org**20040508035215] [include so that we can use this header alone stevenj@fftw.org**20040506234252] [some fp constant fixes stevenj@fftw.org**20040506183958] [whoops, forgot arg for fprintf stevenj@fftw.org**20040506182619] [print "meep: " before abort message, to be GNU-ly correct stevenj@fftw.org**20040506182452] [use darcs_test for test stevenj@fftw.org**20040508044357] [turn on some basic testing. droundy@abridgegame.org**20040507231151] [fix warning. droundy@abridgegame.org**20040507230125] [try to get dependencies right in doc and tests. droundy@abridgegame.org**20040507230038] [add support for nonlinear kerr materials. droundy@abridgegame.org**20040507225645] [add additional kerr tests. droundy@abridgegame.org**20040507152005] [clean up sum_over_components ever so slightly. droundy@abridgegame.org**20040506195224] [fix bug when doing EPS slices with real fields. droundy@abridgegame.org**20040507185949] [disable libctl by default (until it is working better) stevenj@fftw.org**20040505045719] [re-ified current/dipole distinction in src_time stevenj@fftw.org**20040505031801] [FIXME: disable saturated-gain tests until divergence bug is fixed stevenj@fftw.org**20040505012120] [for symmetry to work properly, equal sources must be combined stevenj@fftw.org**20031218071046 This requires serious crap in src_time to get an equality test that works over inheritance. Also, the current O(n^2) algorithm in src_pt::add_to has got to be revised when source volumes are added. Ugh. ] [correct for current renormalization stevenj@fftw.org**20031218021027] [more backwards compatibility (tiny change in default cutoff, but is enough to fail two_dimensional.dac, grr) stevenj@fftw.org**20031218015848] [don't use last_source_time for CW sources (infinity!), print more stuff, use good limits for steady-state (with slow CW turn-on) stevenj@fftw.org**20031217233514] [slow-turn-on for is_continuous add_point_source stevenj@fftw.org**20031217233433] [fix fp exception in continuous source stevenj@fftw.org**20031217215739] [backwards compatibility for specifying continuous sources (finite last_source_time) stevenj@fftw.org**20031217204523] [split src into src_pt and src_time, with many related changes stevenj@fftw.org**20031217195447] [avoid confusion between formal params and members stevenj@fftw.org**20031218041449] [some more %lg's to replace stevenj@fftw.org**20031217195419] [missing dependency on libmeep stevenj@fftw.org**20031216233352] [input converged frequency from MPB, weaken convergence criterion (otherwise test fails because of weird error increase around a=30) stevenj@fftw.org**20031216190034] [acronym expansions stevenj@fftw.org**20031216185607] [set_epsilon already calls is_mine; no need to call it twice stevenj@fftw.org**20031215224802] [add in dependencies amongst haskell sources. droundy@civet.berkeley.edu**20040406163238] [compilation fixes, use new create_geom_box_tree0 stevenj@fftw.org**20031215231414] [in debug mode, also crash with SIGFPE on overflow (it's not good if something is blowing up) stevenj@fftw.org**20031218005305] [with --enable-debug, trap floating-point exceptions stevenj@fftw.org**20031217215655] [--enable-debug option for configure stevenj@fftw.org**20031217191120] [set_epsilon should initialize structure_c stevenj@fftw.org**20031215224503] [tee is too slow stevenj@fftw.org**20031214192320] [silence warning stevenj@fftw.org**20031214192302] [remove tests/Makefile.in (generated by automake) stevenj@fftw.org**20031214181502] [save test output in .done file stevenj@fftw.org**20031214181439] [comments and niceties stevenj@fftw.org**20031214045302] [typo in comment stevenj@fftw.org**20031214044853] [whoops, wrong index for spherical quad. stevenj@fftw.org**20031214044126] [make it easier to change resolution limits in convergence test stevenj@fftw.org**20031214043946] [damn, missed another %lg stevenj@fftw.org**20031214042425] [threevec convenience constructor stevenj@fftw.org**20031214042323] [more fleshed-out sphere quadrature for aniso. averaging stevenj@fftw.org**20031214042239] [geo_center takes reference arg. stevenj@fftw.org**20031214042211] [whoops, more %lg -> %g replacements stevenj@fftw.org**20031214041328] [%lg is incorrect in a printf statement (because of the default type-promotion rules, float arguments are always passed to printf as double in standard C/C++) stevenj@fftw.org**20031213233144] [add experimental spherical-quadrature code (not used yet) stevenj@fftw.org**20031213232902] [resolve conflicts with automake etc. droundy@civet.berkeley.edu**20031212223323] [if necesary, allocate inveps in redefine_chunks. droundy@abridgegame.org**20031210211957] [anisotropic dielectric averaging. droundy@abridgegame.org**20031209175457] [use gcc attributes to identify printf-like and abort-like functions stevenj@fftw.org**20031211212718] [use padded volume for material_function stevenj@fftw.org**20031211205753] [remember my-smob.h for make dist stevenj@fftw.org**20031211184703] [expanded material_function class stevenj@fftw.org**20031211182646 Use material_function class (renamed from epsilon_function) for both epsilon and sigma functions and, in the future, other things like nonlinearity as well. Add calls to set_volume where appropriate. ] [add libctl skeleton stevenj@fftw.org**20031211054139] [allow arbitrary epsilon_function object, not just double eps(r) stevenj@fftw.org**20031211054052] [rename material.cpp to structure.cpp stevenj@fftw.org**20031211021300] [enable compiler warnings in maintainer mode, silence/fix some cases stevenj@fftw.org**20031211014553] [residual fixes from mat->structure renaming stevenj@fftw.org**20031211005904] [mat -> structure, etc. stevenj@fftw.org**20031211004126] [don't build shared libraries by default (only with --enable-shared) stevenj@fftw.org**20031210234702] [use vpath build in test stevenj@fftw.org**20031210230600] [fix for vpath building stevenj@fftw.org**20031210230421] [don't bother with --enable-shared just for make dist stevenj@fftw.org**20031210205021] [autoreconf paranoia stevenj@fftw.org**20031210201316] [COPYING is created by autoreconf; does not need to be in repo stevenj@fftw.org**20031210200912] [am_conditional for WITH_DOC stevenj@fftw.org**20031210200243] [always make autoreconf verbose, and always replace files stevenj@fftw.org**20031210195834] [remove deleted files from dist stevenj@fftw.org**20031210195514] [whoops, handle empty $verbose stevenj@fftw.org**20031210195344] [darcs_test does 'make dist' without docs, other build fixes stevenj@fftw.org**20031210194951] [more merge recording stevenj@fftw.org**20031210194916] [stupid merging with latest pull of stupid whitespace stevenj@fftw.org**20031210184134] [record result of convert-repo (bunch of blank lines, go figure) meep@ab-initio.mit.edu**20031209231415] [use AC_F77_WRAPPERS for harminv stevenj@fftw.org**20031209230115] [use meep namespace for libmeep stevenj@fftw.org**20031209225844] [add meep.ps.gz target stevenj@fftw.org**20031209213027] [use hyperref package for building pdf stevenj@fftw.org**20031209212730] [AM_PROG_LIBTOOL is required for depcomp to be dist'ed (no mention of this in automake docs, grrr) stevenj@fftw.org**20031209205147] [grrr stevenj@fftw.org**20031209202601] [use __FILE__ for output directory stevenj@fftw.org**20031209200618] [must build libmeep too for make dist stevenj@fftw.org**20031209032557] [sigh...still trying to fix make dist dependencies stevenj@fftw.org**20031209025940] [less verbose darcs_test now that auto* works stevenj@fftw.org**20031209025641] [dist fix stevenj@fftw.org**20031209023711] [fixes to make dist (I hope) stevenj@fftw.org**20031209014821] ['make' in hsrc before 'make dist' stevenj@fftw.org**20031209012717] [darcs_test uses 'make dist' stevenj@fftw.org**20031209010403] [add meep.pc file for use with pkg-config stevenj@fftw.org**20031209005844] [use \includegraphics so that pdflatex works stevenj@fftw.org**20031208224050] [move example.cpp to doc/ stevenj@fftw.org**20031208215520] [whoop sagain stevenj@fftw.org**20031208211352] [whoops stevenj@fftw.org**20031208205333] [more verbose darcs_test stevenj@fftw.org**20031208203350] [make dist fixes stevenj@fftw.org**20031208202401] [include config.log in darcs_test output stevenj@fftw.org**20031208200058] [whoops, update test for automake'd version stevenj@fftw.org**20031208002452] [automakization stevenj@fftw.org**20031208002126] [bunch of moves stevenj@fftw.org**20031205215751] [same as before stevenj@fftw.org**20031205201317 Fix copyright year ] [fix epsilon averaging bug (again). droundy@abridgegame.org**20031205165610] [fix old epsilon averaging bugs. droundy@abridgegame.org**20031204170711 This fix changes where epsilon is evaluated in 2D and 1D. ] [Added convergence test (waveguide mode frequency in cylindrical) michel**20031204183120] [Fix memory leak in bufprint michel**20031126214110] [fix resolution scaling of 3D sources. droundy@abridgegame.org**20031203212416] [fix initialize_A (which was causing crashes). droundy@abridgegame.org**20031203212340] [reorder libraries to work on sarge. David Roundy **20031203170332] [change monitor harminv interface. droundy@abridgegame.org**20031202230737] [add support for anisotropic averaging (untested). droundy@abridgegame.org**20031202192054 Also fix a bug in the normal averaging in 3D. It was evaluating epsilon at the wrong locations. ] [fix memory leaks. droundy@abridgegame.org**20031202191643] [support anisotropic dielectrics. droundy@abridgegame.org**20031201205143] [fix the fix to sources outside of periodic cells. droundy@abridgegame.org**20031126203113] [speed up EPS output in parallel (hopefully). droundy@abridgegame.org**20031126173619] [support sources out of uservolume in periodic directions. droundy@abridgegame.org**20031125223838] [add outputting of EPS polarization slices. droundy@abridgegame.org**20031125162047] [Added Poynting vector functions to monitor and fixed comment in meep.h michel**20031125172953] [Remove printf for phasing in michel**20031125172702] [don't output zero values in EPS files to save space. droundy@abridgegame.org**20031124150502] [fix saturation condition to avoid overshooting. droundy@abridgegame.org**20031121212156] [fix 4 pi issue with polarization energies. droundy@abridgegame.org**20031121201811] [change title color again. droundy@abridgegame.org**20031118225635] [fix known_results test to work in 3D. droundy@abridgegame.org**20031119205410 Also change the component-broken energy to sum to the total energy. ] [change color of EPS title. droundy@abridgegame.org**20031118223629] [fix bugs in saturated gain. droundy@abridgegame.org**20031118210349] [output D as well as E and H in real_imaginary_slices. droundy@abridgegame.org**20031118174356] [fix parallel output in symmetry.cpp droundy@abridgegame.org**20031118171216] [fix bugs in saturation averaging. droundy@abridgegame.org**20031117233421] [test polariton symmetry in 2D as well as 1D. droundy@abridgegame.org**20031117230007] [optimize phase shift on EPS output. droundy@abridgegame.org**20031117202208] [print filename on EPS output. droundy@abridgegame.org**20031117193818] [add polariton symmetry test. droundy@abridgegame.org**20031117190901] [a few saturation bugfixes. droundy@abridgegame.org**20031114191444 This makes saturation run in multiple dimensions. However, it seems to blow up in 3D, and I don't have any idea what it does in other dimensions. ] [average energy on yee lattice when updating saturation. droundy@abridgegame.org**20031114181114] [rename generating code. droundy@abridgegame.org**20031113212529] [break timestepping into separate files. droundy@abridgegame.org**20031113210231] [Fix mpi polarizability bug. droundy@abridgegame.org**20031112161946] [sum energy over components when updating saturation. droundy@abridgegame.org**20031111235532 Note that this doesn't yet do any averaging. Most of the work was just in creating the sum over components efficiently. And yes, the code is rather scary. ] [loop over owned points when updating saturating polarization. droundy@abridgegame.org**20031111205137] [communicate polarizations. droundy@abridgegame.org**20031111184718] [add exponential distribution random number generator. droundy@abridgegame.org**20031110182154] [add random number generator. droundy@abridgegame.org**20031107184816] [add initialize from vector potential option. droundy@abridgegame.org**20031107171653] [add copy constructor for fields. droundy@abridgegame.org**20031106231834] [output D as well as E and H EPS slices. droundy@abridgegame.org**20031106215245] [make alloc_f automatically allocate all the needed fields. droundy@abridgegame.org**20031106200638] [get rid of empty for loops in generated code. droundy@abridgegame.org**20031106190921] [clean up complex loops in update_...hs droundy@abridgegame.org**20031106183416] [speed up EPS envelope output. droundy@abridgegame.org**20031106172218] [add envelope-outputting EPS option. droundy@abridgegame.org**20031106165314] [use metallic boundary conditions by default. droundy@abridgegame.org**20031105212230] [fix bug in polariton found by Chiyan. droundy@civet.berkeley.edu**20031105202801] [support vol1d and vol2d as well as volone and voltwo. droundy@abridgegame.org**20031104231429] [rewrite polarization code using code generator. droundy@abridgegame.org**20031104201032] [add two more polariton tests. droundy@civet.berkeley.edu**20031103221011] [add polariton test in 1D. droundy@abridgegame.org**Mon Nov 3 15:14:33 EST 2003] [treat source as a polarization. droundy@abridgegame.org**Mon Nov 3 13:23:03 EST 2003 This patch also contains a whole slew of gcc --pedantic inspired changes, which I'm too lazy to separate out from the critical stuff. ] [speed up 1D tests. droundy@abridgegame.org**Mon Nov 3 13:04:39 EST 2003] [don't test mpi (since I'll now test it on superjdj). droundy@abridgegame.org**Fri Oct 31 18:01:12 EST 2003] [fix array overrun bug that only bothered gcc 2.95. droundy@abridgegame.org**Fri Oct 31 14:55:59 EST 2003] [rename step_e.h to update_e_from_d.h droundy@abridgegame.org**Thu Oct 30 13:22:01 EST 2003] [generate code for update_e_from_d. droundy@abridgegame.org**Wed Oct 29 19:13:28 EST 2003] [switch to timestepping D rather than E. droundy@abridgegame.org**Wed Oct 29 17:56:27 EST 2003] [add 3D test using soon-to-be-old timestepping. droundy@abridgegame.org**Wed Oct 29 15:11:52 EST 2003] [trivial cleanup. droundy@abridgegame.org**Wed Oct 29 14:56:14 EST 2003] [add D field to fields data structure (but don't actually use it). droundy@abridgegame.org**Wed Oct 29 14:23:06 EST 2003] [TAG working version droundy@civet.berkeley.edu**Wed Oct 29 13:58:28 EST 2003] Patch bundle hash: bf93737d04573249736b848cc5356c2f16208b8f