Git Product home page Git Product logo

mpb's Issues

configure without libctl and guile

I would like to compile MPB to use it as a C++ library. However, the configure script keeps throwing guile-not-on-the-path error.

Is there a way to compile this library without libctl and guile?

Thanks.

Configure script does not fail on macOS Sierra

Yesterday's problem has been resolved. The configure script will run properly with:

export LDFLAGS=-L/usr/local/lib
export CPPFLAGS=-I/usr/local/include

There is no need to try to add the path /usr/local/opt/fftw/lib to the LDFLAGS or the analogous path to .../include for CPPFLAGS. Attempting to do so results in the error described in issue #20

HDF5

Hi,
I am a newer to MPB. I have a question, how can I input a complicated photonic crystal structure (such as helix) to MPB? If I input it through a HDF5 file, how can I generate the file?
Thanks very much!
Hang

get-bfield & get-tot-pwr; unbound variable

In running the 1.6-dev version, with an anisotropic permeability, I encounter the following errors when invoking any utility that callsget-bfield, e.g. when calling get-tot-pwr:

ERROR: Unbound variable: get-bfield

Below is a semi-minimal example .ctl-file which illustrates the problem when timesym="timebroken" (the problem is obviously absent when timesym="timeinvariant", although it is also impossible to call get-tot-pwr in that case):

; define default variable values editable from command-line call
(define-param timesym "timebroken")

(set! num-bands 16)
(set! resolution 32)

; define material properties [based on input timesym, evaluated by if-statment (cond)]
(cond ((string=? timesym "timeinvariant")  ; time-invariant isotropic dielectric response
          (define matprops (make dielectric (epsilon 13)))  )
      ((string=? timesym "timebroken")     ; time-broken anisotropic response
          (define matprops (make medium-anisotropic (epsilon-diag 13 13 13) (epsilon-offdiag 0 0 0)
                                                    (mu-diag 1 1 1) (mu-offdiag 0+0.40i 0 0) ))   )
)
; define a simple cylinder-in-square-lattice geometry
(set! geometry-lattice (make lattice (size 1 1 no-size)   (basis1 1 0) (basis2 0 1)))
(set! geometry (list (make cylinder (center 0 0 0) (radius 0.1) (height infinity)
                                    (material matprops))))

; list of k-points in FBZ
(set! k-points (list (vector3 0 0 0)     ; Gamma
                     (vector3 0.5 0 0)   ; M
                     (vector3 0.5 0.5 0) ; X
                     (vector3 0 0 0)))   ; Gamma
(set! k-points (interpolate 15 k-points))

; function to compute the participation ratio of each band
(define (participation-ratio band-index)
    (cond ((string=? timesym "timeinvariant")    ; including just a D*E contribution
                (get-dfield band-index) (compute-field-energy))
          ((string=? timesym "timebroken") ; including both D*E and B*H contributions
                (get-tot-pwr band-index))
    )
    (let ( (numer (expt (compute-energy-integral (lambda (u eps r)      u  ) ) 2) )   ; numerator   (int |u|)^2
           (denom       (compute-energy-integral (lambda (u eps r) (* u u) ) )    ) ) ; denominator (int |u|^2)
          (print "participation ratio: " (/ numer denom) " (band " band-index ")\n")
    )
)

(run-tm participation-ratio) ; run tm-calculation

The error also emerges if I use, say, (get-bfield band-index) (compute-field-energy) instead of (get-tot-pwr band-index)

I'm puzzled by this error, since I thought 3a0ac15 would facilitate this usage?

No "tefreqs:" line in the output from the tutorial...

Hello,
I started going through the tutorial for "Our first band structure" and I couldn't help but notice that
my output for ms.run_te() doesn't have the tefreqs: line, that is, my output looks like this:

Initializing eigensolver data
Computing 8 bands with 1e-07 tolerance
16 k-points
Vector3<0.0, 0.0, 0.0>
Vector3<0.1, 0.0, 0.0>
Vector3<0.2, 0.0, 0.0>
Vector3<0.30000000000000004, 0.0, 0.0>
Vector3<0.4, 0.0, 0.0>
Vector3<0.5, 0.0, 0.0>
Vector3<0.5, 0.1, 0.0>
Vector3<0.5, 0.2, 0.0>
Vector3<0.5, 0.30000000000000004, 0.0>
Vector3<0.5, 0.4, 0.0>
Vector3<0.5, 0.5, 0.0>
Vector3<0.4, 0.4, 0.0>
Vector3<0.3, 0.3, 0.0>
Vector3<0.19999999999999996, 0.19999999999999996, 0.0>
Vector3<0.09999999999999998, 0.09999999999999998, 0.0>
Vector3<0.0, 0.0, 0.0>
elapsed time for initialization: 0.0027337074279785156
Outputting epsilon.h5...
elapsed time for k point: 0.16631245613098145
elapsed time for k point: 0.04373908042907715
elapsed time for k point: 0.24829554557800293
elapsed time for k point: 0.03610086441040039
elapsed time for k point: 0.06210970878601074
elapsed time for k point: 0.055446624755859375
elapsed time for k point: 0.04317760467529297
elapsed time for k point: 0.05084419250488281
elapsed time for k point: 0.04191470146179199
elapsed time for k point: 0.027718544006347656
elapsed time for k point: 0.025140047073364258
elapsed time for k point: 0.027942419052124023
elapsed time for k point: 0.03310561180114746
elapsed time for k point: 0.04081010818481445
elapsed time for k point: 0.060736656188964844
elapsed time for k point: 0.20693731307983398
Band 1 range: 0.0 at Vector3<0.0, 0.0, 0.0> to 0.49683586573979743 at Vector3<0.5, 0.5, 0.0>
Band 2 range: 0.4415884758922276 at Vector3<0.5, 0.0, 0.0> to 0.5931405182467208 at Vector3<0.5, 0.5, 0.0>
Band 3 range: 0.5931535893551052 at Vector3<0.5, 0.5, 0.0> to 0.7732265678658415 at Vector3<0.0, 0.0, 0.0>
Band 4 range: 0.6791690135255335 at Vector3<0.5, 0.5, 0.0> to 0.80968916620506 at Vector3<0.3, 0.3, 0.0>
Band 5 range: 0.8241814492203078 at Vector3<0.5, 0.30000000000000004, 0.0> to 0.922996527814745 at Vector3<0.0, 0.0, 0.0>
Band 6 range: 0.8819770936729684 at Vector3<0.5, 0.5, 0.0> to 1.0291597307232732 at Vector3<0.5, 0.0, 0.0>
Band 7 range: 0.8819818143162569 at Vector3<0.5, 0.5, 0.0> to 1.0860733972501748 at Vector3<0.5, 0.0, 0.0>
Band 8 range: 1.0878690870671277 at Vector3<0.5, 0.0, 0.0> to 1.1142329750945672 at Vector3<0.1, 0.0, 0.0>
Gap from band 2 (0.5931405182467208) to band 3 (0.5931535893551052), 0.0022036876522750046%
Gap from band 4 (0.80968916620506) to band 5 (0.8241814492203078), 1.773981719045087%
Gap from band 7 (1.0860733972501748) to band 8 (1.0878690870671277), 0.16520122587482305%
total elapsed time for run: 1.212172269821167
done

Has the output changed overtime, or my package is not working properly?
I installed it through Conda.

Kind regards

Python MPB interface seems to round down for lattice vector size

When I create a lattice object using the Python MPB interface and have a lattice vector component less than 1, it seems to round it down to zero. For example:
geometry_lattice = mp.Lattice(size=mp.Vector3(0.25, 2, 2))
ms = mpb.ModeSolver(..., geometry_lattice=geometry_lattice, ...)

In the output file it then says:
Lattice vectors: (0, 0, 0) (0, 2, 0) (0, 0, 2)

which creates all sorts of issues during execution of my program. It works fine using the Scheme interface, so I am guessing it's a bug / rounding error in the Python implementation?

Thanks!

inputting k- points

When I went through the program for the calculation of photonic band gap of diamond structure (data analysis tutorial of MPB) I noticed that the k- points that are used:
(vector3 0 0.5 0.5) ; X
(vector3 0 0.625 0.375) ; U
(vector3 0 0.5 0) ; L
(vector3 0 0 0) ; Gamma
(vector3 0 0.5 0.5) ; X
(vector3 0.25 0.75 0.5) ; W
(vector3 0.375 0.75 0.375) ; K
But when I searched in literature found that there is a small difference in the k-points:
(vector3 0.5 0 0.5) ; X
(vector3 0.625 0.25 0.625) ; U
(vector3 0.5 0.5 0.5) ; L
(vector3 0 0 0) ; Gamma
(vector3 0.5 0 0.5) ; X
(vector3 0.5 0.25 0.75) ; W
(vector3 0.375 0.375 0.75) ; K
[High-throughput electronic band structure calculations:
challenges and tools, Wahyu Setyawan and Stefano Curtarolo]
I run the program with both the set of k-points and the gap i obtained is 10.869% and 11.0109% respectively.
Why is it so?

MPI build segfaults in `make check`

I'm trying to build MPB 1.5 with:

  • the Intel C Compiler 2015 update 2
  • Intel's MPI distribution (which I think is MVAPICH-based)
  • HDF5 1.8.15-patch1 (built with MPI enabled with the above compilers)
  • libctl 3.2.2
  • guile 2.0.11
  • libbdwgc 7.4.2 (required for Guile)
  • FFTW 3.3.4 (built with MPI enabled with the above compilers)

The ordinary serial build and version using --with-inv-symmetry build fine and pass the make check tests, but the make check for the ordinary MPI build fails with the output shown below:

make[3]: Entering directory `/tmp/tmp.SoK8cAONll/mpb-1.5/mpb'
./mpb_mpi ../examples/check.ctl
**************************************************************************
 Test case: Square lattice of dielectric rods in air.
**************************************************************************
init-params: initializing eigensolver data
Computing 8 bands with 1.000000e-09 tolerance.
Working in 2 dimensions.
Grid size is 32 x 32 x 1.
Solving for 8 bands at a time.
Creating Maxwell data...
Allocating fields...
Mesh size is 3.
Lattice vectors:
     (1, 0, 0)
     (0, 1, 0)
     (0, 0, 1)
Cell volume = 1
Reciprocal lattice vectors (/ 2 pi):
     (1, 0, 0)
     (-0, 1, -0)
     (0, -0, 1)
Geometric objects:
     cylinder, center = (0,0,0)
          radius 0.2, height 1e+20, axis (0, 0, 1)
          dielectric constant epsilon = 11.56
Geometric object tree has depth 1 and 1 object nodes (vs. 1 actual objects)
Initializing dielectric function...
16 k-points:
     (0,0,0)
     (0.1,0,0)
     (0.2,0,0)
     (0.3,0,0)
     (0.4,0,0)
     (0.5,0,0)
     (0.5,0.1,0)
     (0.5,0.2,0)
     (0.5,0.3,0)
     (0.5,0.4,0)
     (0.5,0.5,0)
     (0.4,0.4,0)
     (0.3,0.3,0)
     (0.2,0.2,0)
     (0.1,0.1,0)
     (0,0,0)
Solving for band polarization: te.
Initializing fields to random numbers...
elapsed time for initialization: 0 seconds.
epsilon: 1-11.56, mean 2.327, harm. mean 1.1441, 14.5508% > 1, 12.5663% "fill"
Outputting check-epsilon...
solve_kpoint (0,0,0):
tefreqs:, k index, k1, k2, k3, kmag/2pi, te band 1, te band 2, te band 3, te band 4, te band 5, te band 6, te band 7, te band 8
Solving for bands 2 to 8...
make[3]: *** [check-local] Segmentation fault (core dumped)
make[3]: Leaving directory `/tmp/tmp.SoK8cAONll/mpb-1.5/mpb'
make[2]: *** [check-am] Error 2

Since I figured it might be useful, I hooked up gdb and took a look at the stack trace in the core dump, and got the following:

Core was generated by `./mpb_mpi ../examples/check.ctl'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000023f8870 in ?? ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.el7.x86_64 gmp-6.0.0-11.el7.x86_64 libffi-3.0.13-11.el7.x86_64 libunistring-0.9.3-9.el7.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 readline-6.2-9.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0  0x00000000023f8870 in ?? ()
#1  0x00007fe093ad65bc in fftw_execute_r2r () from /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/mkl/lib/intel64/libmkl_intel_lp64.so
#2  0x00000000004637b7 in maxwell_compute_fft (dir=<optimized out>, d=<optimized out>, array_in=<optimized out>, array_out=<optimized out>, 
    howmany=<optimized out>, stride=<optimized out>, dist=<optimized out>) at maxwell_op.c:242
#3  maxwell_compute_d_from_H (d=0x7fffd2a4dfb0, Hin=..., dfield=0x7fe093f6e040, cur_band_start=-1812537280, cur_num_bands=37610592) at maxwell_op.c:417
#4  0x0000000000462ce4 in maxwell_operator (Xin=..., Xout=..., data=0x7fffd2a4dfb0, is_current_eigenvector=-1812537280, Work=...) at maxwell_op.c:1145
#5  0x0000000000451fc5 in eigensolver_lagrange (Y=..., eigenvals=<optimized out>, A=<optimized out>, Adata=<optimized out>, K=<optimized out>, 
    Kdata=<optimized out>, constraint=<optimized out>, constraint_data=<optimized out>, L=<optimized out>, Ldata=<optimized out>, lag=<optimized out>, 
    Work=<optimized out>, nWork=<optimized out>, tolerance=<optimized out>, num_iterations=<optimized out>, flags=68) at eigensolver.c:348
#6  eigensolver (Y=..., eigenvals=0x7fffd2a4dfb0, A=0x7fe093f6e040, Adata=0x7fe093f6e040, K=0x23de460, Kdata=0x2, constraint=0x2, 
    constraint_data=0x7fe000000000, Work=0x3f1b400000000000, nWork=0, tolerance=<unavailable>, num_iterations=0x40855d9f4b2bdd17, flags=1) at eigensolver.c:780
#7  0x000000000041db57 in solve_kpoint (kvector=...) at mpb.c:691
#8  0x00000000004474bb in solve_kpoint_aux (arg_scm_0=0x7fffd2a4dfb0) at ctl-io.c:2511
#9  0x00007fe0900b9bba in vm_regular_engine (vm=0x7fffd2a4dfb0, program=0x7fe093f6e040, argv=0x1a94678, nargs=4486272) at vm-i-system.c:855
#10 0x00007fe0900295b3 in scm_primitive_eval (exp=0x2111e30) at eval.c:692
#11 0x00007fe09004b3cb in scm_primitive_load (filename=<optimized out>) at load.c:124
#12 0x00007fe0900b9bba in vm_regular_engine (vm=0x7fffd2a4dfb0, program=0x7fe093f6e040, argv=0x1a941f0, nargs=-1878740240) at vm-i-system.c:855
#13 0x00007fe090028fd7 in scm_call_1 (proc=0x1cfccf0, arg1=0x21a38e0) at eval.c:486
#14 0x0000000000421c2a in main_entry (main_entry_data=0x7fffd2a4dfb0, argc=-1812537280, argv=0x7fe093f6e040) at main.c:292
#15 0x00007fe090045fad in invoke_main_func (body_data=0x7fffd2a4eed0) at init.c:336
#16 0x00007fe09001f71a in c_body (d=0x7fffd2a4ee20) at continuations.c:517
#17 0x00007fe0900b9baa in vm_regular_engine (vm=0x7fffd2a4dfb0, program=0x7fe093f6e040, argv=0x1a940b8, nargs=-1878540448) at vm-i-system.c:858
#18 0x00007fe0900290f3 in scm_call_4 (proc=0x1b70c30, arg1=arg1@entry=0x404, arg2=<optimized out>, arg3=<optimized out>, arg4=<optimized out>) at eval.c:507
#19 0x00007fe09009f1c9 in scm_catch_with_pre_unwind_handler (key=key@entry=0x404, thunk=<optimized out>, handler=<optimized out>, 
    pre_unwind_handler=<optimized out>) at throw.c:73
#20 0x00007fe09009f2cf in scm_c_catch (tag=tag@entry=0x404, body=body@entry=0x7fe09001f710 <c_body>, body_data=body_data@entry=0x7fffd2a4ee20, 
    handler=handler@entry=0x7fe09001faf0 <c_handler>, handler_data=handler_data@entry=0x7fffd2a4ee20, 
    pre_unwind_handler=pre_unwind_handler@entry=0x7fe09001f8a0 <pre_unwind_handler>, pre_unwind_handler_data=0x1b16ff0) at throw.c:207
#21 0x00007fe09001fe91 in scm_i_with_continuation_barrier (body=body@entry=0x7fe09001f710 <c_body>, body_data=body_data@entry=0x7fffd2a4ee20, 
    handler=handler@entry=0x7fe09001faf0 <c_handler>, handler_data=handler_data@entry=0x7fffd2a4ee20, 
    pre_unwind_handler=pre_unwind_handler@entry=0x7fe09001f8a0 <pre_unwind_handler>, pre_unwind_handler_data=0x1b16ff0) at continuations.c:455
#22 0x00007fe09001ff25 in scm_c_with_continuation_barrier (func=<optimized out>, data=<optimized out>) at continuations.c:551
#23 0x00007fe09009cb2c in with_guile_and_parent (base=0x7fffd2a4ee80, data=0x7fffd2a4eea0) at threads.c:906
#24 0x00007fe08f192851 in GC_call_with_stack_base (fn=0x7fffd2a4dfb0, fn@entry=0x7fe09009cae0 <with_guile_and_parent>, arg=0x7fe093f6e040, 
    arg@entry=0x7fffd2a4eea0) at misc.c:1840
#25 0x00007fe09009cf18 in scm_i_with_guile_and_parent (parent=<optimized out>, data=data@entry=0x7fffd2a4eea0, 
    func=func@entry=0x7fe090045f90 <invoke_main_func>) at threads.c:949
#26 scm_with_guile (func=func@entry=0x7fe090045f90 <invoke_main_func>, data=data@entry=0x7fffd2a4eed0) at threads.c:955
#27 0x00007fe090046155 in scm_boot_guile (argc=<optimized out>, argv=<optimized out>, main_func=<optimized out>, closure=<optimized out>) at init.c:319
#28 0x0000000000421036 in main (argc=2, argv=0x7fffd2a4f068) at main.c:319
(gdb) 

And the ldd output looks like this:

$ ldd mpb_mpi
    linux-vdso.so.1 =>  (0x00007fff11744000)
    libmkl_intel_lp64.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007f940ecba000)
    libmkl_intel_thread.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/mkl/lib/intel64/libmkl_intel_thread.so (0x00007f940d899000)
    libmkl_core.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/mkl/lib/intel64/libmkl_core.so (0x00007f940bd3b000)
    libiomp5.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libiomp5.so (0x00007f940b9fe000)
    libguile-2.0.so.22 => /home/uccaiki/mpb_buildscript/test_build/lib/libguile-2.0.so.22 (0x00007f940b66f000)
    libffi.so.6 => /lib64/libffi.so.6 (0x00007f940b456000)
    libunistring.so.0 => /lib64/libunistring.so.0 (0x00007f940b13e000)
    libgmp.so.10 => /lib64/libgmp.so.10 (0x00007f940aec7000)
    libltdl.so.7 => /shared/ucl/apps/libtool/2.4.6/lib/libltdl.so.7 (0x00007f940acbd000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f940aa85000)
    libgc.so.1 => /home/uccaiki/mpb_buildscript/test_build/lib/libgc.so.1 (0x00007f940a80e000)
    libhdf5.so.10 => /home/uccaiki/mpb_buildscript/test_build/lib/libhdf5.so.10 (0x00007f940a240000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f940a029000)
    libfftw3_mpi.so.3 => /home/uccaiki/mpb_buildscript/test_build/lib/libfftw3_mpi.so.3 (0x00007f9409e11000)
    libfftw3.so.3 => /home/uccaiki/mpb_buildscript/test_build/lib/libfftw3.so.3 (0x00007f9409a85000)
    libimf.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libimf.so (0x00007f94095c9000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f94092c7000)
    libifport.so.5 => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libifport.so.5 (0x00007f940909a000)
    libifcore.so.5 => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libifcore.so.5 (0x00007f9408d67000)
    libsvml.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libsvml.so (0x00007f9407e94000)
    libirc.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libirc.so (0x00007f9407c39000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9407a1c000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f9407818000)
    libmpifort.so.12 => /shared/ucl/apps/intel/2015/impi/5.0.3.048/intel64/lib/libmpifort.so.12 (0x00007f940758f000)
    libmpi.so.12 => /shared/ucl/apps/intel/2015/impi/5.0.3.048/intel64/lib/libmpi.so.12 (0x00007f9406e03000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f9406bfb000)
    libgcc_s.so.1 => /shared/ucl/apps/gcc/4.9.2/lib64/libgcc_s.so.1 (0x00007f94069e4000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f9406622000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f940f5cf000)
    libfreebl3.so => /lib64/libfreebl3.so (0x00007f940641f000)
    libirng.so => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libirng.so (0x00007f9406217000)
    libintlc.so.5 => /shared/ucl/apps/intel/2015/composer_xe_2015.2.164/compiler/lib/intel64/libintlc.so.5 (0x00007f9405fbc000)

Annoyingly, it looks like the MKL library contains symbols that match the names of FFTW ones, which are getting in the way. Maybe they're wrappers? I'm not using the actual interface wrapper libraries, which are in a different object file not linked here. I'm not sure if this is causing the problem, since I'm not sure if that final level is actually an FFTW object, but I was wondering if anyone had any suggestions or had seen this before?

I guess I could just rebuild everything with the GNU compilers and OpenBLAS, but I'd rather not if possible...

diamond.ctl file

Dear mpb users

I was wondering if mpb is able to calculate angle- dependence bandstructure or not? for example at diamond.ctl file, is it possible to calculate the bandstructure when the incident light in air is at 50 degrees?

Cheers

language used in mpb

Is it necessary to use scheme language when writing a program in MPB? Or can we use some other language like fortran?

Segmentation fault on numpy/matplotlib import

Minimal example:

import math
import numpy as np
import meep as mp
from meep import mpb


geometry_lattice = mp.Lattice(size=mp.Vector3(1, 1),
                              basis1=mp.Vector3(math.sqrt(3) / 2, 0.5),
                              basis2=mp.Vector3(math.sqrt(3) / 2, -0.5))
geometry = [mp.Cylinder(0.2, material=mp.Medium(epsilon=12))]
k_points = [
    mp.Vector3(),               # Gamma
    mp.Vector3(y=0.5),          # M
]

ms = mpb.ModeSolver(
    geometry=geometry,
    geometry_lattice=geometry_lattice,
    k_points=k_points)

ms.run_te()

When running this code (I have a fresh meep conda environment from conda create -n mp -c chogan -c conda-forge pymeep), I'm getting a segmentation fault:

Initializing eigensolver data
Computing 1 bands with 1e-07 tolerance
Working in 2 dimensions.
Grid size is 10 x 10 x 1.
Solving for 1 bands at a time.
Creating Maxwell data...
Mesh size is 3.
Lattice vectors:
     (0.866025, 0.5, 0)
     (0.866025, -0.5, 0)
     (0, 0, 1)
Cell volume = 0.866025
Reciprocal lattice vectors (/ 2 pi):
     (0.57735, 1, -0)
     (0.57735, -1, 0)
     (-0, 0, 1)
Geometric objects:
     cylinder, center = (0,0,0)
          radius 0.2, height 1e+20, axis (0, 0, 1)
Geometric object tree has depth 1 and 1 object nodes (vs. 1 actual objects)
Initializing epsilon function...
Allocating fields...
Solving for band polarization: tm.
Initializing fields to random numbers...
2 k-points
  Vector3<0.0, 0.0, 0.0>
  Vector3<0.0, 0.5, 0.0>
elapsed time for initialization: 0.0009262561798095703
epsilon: 1-12, mean 2.59614, harm. mean 1.21562, 23% > 1, 14.5104% "fill"
Outputting seg-fault-epsilon.h5...
solve_kpoint (0,0,0):
tmfreqs:, k index, k1, k2, k3, kmag/2pi, tm band 1
tmfreqs:, 1, 0, 0, 0, 0, 0
elapsed time for k point: 0.00011920928955078125
solve_kpoint (0,0.5,0):
Solving for bands 1 to 1...
Segmentation fault (core dumped)

With numpy import line commented out, the code runs fine. It's also fine if I move the import after import meet as mp. I saw exactly the same behaviour with matplotlib instead of numpy, so I suppose it might be anything internally importing numpy.

Also, surprisingly (?), if I reduce the list of k-vectors to just the Gamma point:

k_points = [
    mp.Vector3(),               # Gamma
]

The script exits without an error. But then if I specify num_bands>1:

ms = mpb.ModeSolver(
    geometry=geometry,
    geometry_lattice=geometry_lattice,
    k_points=k_points,
    num_bands=2)

Segfault is back again...
FWIW, below is the output of conda list:

backcall                  0.1.0                    py36_0  
blas                      1.0                         mkl  
bleach                    2.1.3                    py36_0  
ca-certificates           2018.4.16                     0    conda-forge
certifi                   2018.4.16                py36_0    conda-forge
click                     6.7                        py_1    conda-forge
cycler                    0.10.0           py36h93f1223_0  
dbus                      1.13.2               h714fa37_1  
decorator                 4.3.0                    py36_0  
entrypoints               0.2.3            py36h1aec115_2  
expat                     2.2.5                he0dffb1_0  
fftw                      3.3.7                         0    conda-forge
fontconfig                2.12.6               h49f89f6_0  
freetype                  2.8                  hab7d2ae_1  
glib                      2.56.1               h000015b_0  
gmp                       6.1.2                h6c8ec71_1  
gsl                       2.2.1                h0c605f7_3  
gst-plugins-base          1.14.0               hbbd80ab_1  
gstreamer                 1.14.0               hb453b48_1  
h5py                      2.8.0            py36hb794570_1    conda-forge
h5utils                   1.13                          1    chogan
harminv                   1.4.1                         4    chogan
hdf5                      1.10.2                        0    conda-forge
hdf5-parallel             1.10.2                        0    chogan
html5lib                  1.0.1            py36h2f9c1c0_0  
icu                       58.2                 h9c2bf20_1  
intel-openmp              2018.0.3                      0  
ipykernel                 4.8.2                    py36_0  
ipython                   6.4.0                    py36_0  
ipython_genutils          0.2.0            py36hb52b0d5_0  
jedi                      0.12.0                   py36_1  
jinja2                    2.10             py36ha16c418_0  
jpeg                      9b                   h024ee3a_2  
jsonschema                2.6.0            py36h006f8b5_0  
jupyter_client            5.2.3                    py36_0  
jupyter_core              4.4.0            py36h7c827e3_0  
jupyterlab                0.32.1                   py36_0  
jupyterlab_launcher       0.10.5                   py36_0  
kiwisolver                1.0.1            py36h764f252_0  
libctl                    4.1.1                         0    chogan
libedit                   3.1.20170329         h6b74fdf_2  
libffi                    3.2.1                hd88cf55_4  
libgcc                    7.2.0                h69d50b8_2  
libgcc-ng                 7.2.0                hdf63c60_3  
libgfortran               3.0.0                         1  
libgfortran-ng            7.2.0                hdf63c60_3  
libopenblas               0.2.20               h9ac9557_7  
libpng                    1.6.34                        0    conda-forge
libsodium                 1.0.16               h1bed415_0  
libstdcxx-ng              7.2.0                hdf63c60_3  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.8                hf84eae3_0  
livereload                2.5.2                      py_0    conda-forge
markdown                  2.6.11                     py_0    conda-forge
markupsafe                1.0              py36hd9260cd_1  
matplotlib                2.2.2            py36h0e671d2_1  
mistune                   0.8.3            py36h14c3975_1  
mkdocs                    0.17.5                     py_0    conda-forge
mkl                       2018.0.3                      1  
mkl_fft                   1.0.2                    py36_0    conda-forge
mkl_random                1.0.1                    py36_0    conda-forge
mpb                       1.6.2                         3    chogan
nbconvert                 5.3.1            py36hb41ffb7_0  
nbformat                  4.4.0            py36h31c9010_0  
ncurses                   6.1                  hf484d3e_0  
notebook                  5.5.0                    py36_0  
numpy                     1.14.5           py36hcd700cb_3  
numpy-base                1.14.5           py36hdbf6ddf_3  
openblas                  0.2.20                        8    conda-forge
openmpi                   2.0.2                         0    conda-forge
openssl                   1.0.2o                        0    conda-forge
pandoc                    2.2.1                h629c226_0  
pandocfilters             1.4.2            py36ha6701b7_1  
parso                     0.2.1                    py36_0  
pcre                      8.42                 h439df22_0  
pexpect                   4.6.0                    py36_0  
pickleshare               0.7.4            py36h63277f8_0  
pip                       9.0.3                    py36_0    conda-forge
prompt_toolkit            1.0.15           py36h17d85b1_0  
ptyprocess                0.6.0                    py36_0  
pygments                  2.2.0            py36h0d3125c_0  
pymeep                    1.5              py36h7f3c865_0    conda-forge
pyparsing                 2.2.0            py36hee85983_1  
pyqt                      5.9.2            py36h751905a_0  
python                    3.6.5                hc3d631a_2  
python-dateutil           2.7.3                    py36_0  
python-markdown-math      0.6                        py_0    conda-forge
pytz                      2018.5                   py36_0  
pyyaml                    3.12                     py36_1    conda-forge
pyzmq                     17.0.0           py36h14c3975_0  
qt                        5.9.5                h7e424d6_0  
readline                  7.0                  ha6073c6_4  
scipy                     1.1.0            py36hfc37229_0  
send2trash                1.5.0                    py36_0  
setuptools                39.2.0                   py36_0    conda-forge
simplegeneric             0.8.1                    py36_2  
sip                       4.19.8           py36hf484d3e_0  
six                       1.11.0                   py36_1    conda-forge
sqlite                    3.24.0               h84994c4_0  
terminado                 0.8.1                    py36_1  
testpath                  0.3.1            py36h8cadb63_0  
tk                        8.6.7                         0    conda-forge
tornado                   4.5.3                    py36_0    conda-forge
traitlets                 4.3.2            py36h674d592_0  
wcwidth                   0.1.7            py36hdf4376a_0  
webencodings              0.5.1            py36h800622e_1  
wheel                     0.31.0                   py36_0    conda-forge
xz                        5.2.3                         0    conda-forge
yaml                      0.1.7                         0    conda-forge
zeromq                    4.2.5                h439df22_0  
zlib                      1.2.11               h470a237_3    conda-forge

Compiling on Fedora21

Hi Steven,

I was compiling mpb on Fedora 21 and ran into some issues with LIBCTL

I made a few patches I think are easy enough to merge:

Modification to configure.ac so that lib.ctl can be found: (inspired from the patch for MEEP)
https://github.com/hmaarrfk/meep-rpm/blob/master/mpb-Fedoralibctl.patch

Modifications to automake so that ctl.h can be found:
https://github.com/hmaarrfk/meep-rpm/blob/master/mpb-testCTL.patch
https://github.com/hmaarrfk/meep-rpm/blob/master/mpb-utilsCTL.patch

Honestly, I am not an export with automake so I'm note sure If I included the modifications in the correct locations.

Hope it helps

Cylindrical Coordinates

How difficult would it be to implement a cylindrical coordinate system? i.e. for calculating bent waveguide modes?

Python Data Analysis tutorial not reproducible

The code for "The Source of the TM Gap: Examining the Modes" does not run in mpb 1.5. I copied the top snippet (mpb-tri-rods.py), the epsilon conversion and the part starting with def get_efields(ms, band):, so the code looks like this:

import math
import meep as mp
from meep import mpb
import numpy as np
import matplotlib.pyplot as plt

num_bands = 8
resolution = 32
geometry_lattice = mp.Lattice(size=mp.Vector3(1, 1),
                              basis1=mp.Vector3(math.sqrt(3) / 2, 0.5),
                              basis2=mp.Vector3(math.sqrt(3) / 2, -0.5))
geometry = [mp.Cylinder(0.2, material=mp.Medium(epsilon=12))]
k_points = [
    mp.Vector3(),               # Gamma
    mp.Vector3(y=0.5),          # M
    mp.Vector3(1 / -3, 1 / 3),  # K
    mp.Vector3(),               # Gamma
]
k_points = mp.interpolate(4, k_points)

ms = mpb.ModeSolver(
    geometry=geometry,
    geometry_lattice=geometry_lattice,
    k_points=k_points,
    resolution=resolution,
    num_bands=num_bands
)
ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3), mpb.fix_efield_phase,
          mpb.output_efield_z))
ms.run_te()


md = mpb.MPBData(rectify=True, periods=3, resolution=32)
eps = ms.get_epsilon()
converted_eps = md.convert(eps)

def get_efields(ms, band):
    efields.append(ms.get_efield(band, bloch_phase=True))

ms.run_tm(mpb.output_at_kpoint(mp.Vector3(1 / -3, 1 / 3), mpb.fix_efield_phase,
          get_efields))

# Create an MPBData instance to transform the efields
md = mpb.MPBData(rectify=True, resolution=32, periods=3)

converted = []
for f in efields:
    # Get just the z component of the efields
    f = f[:, :, 2]
    converted.append(md.convert(f))

for i, f in enumerate(converted):
    plt.subplot(331 + i)
    plt.contour(converted_eps.T, cmap='binary')
    plt.imshow(np.real(f).T, interpolation='spline36', cmap='RdBu', alpha=0.9)
    plt.axis('off')

plt.show()

It raises the following exception:

Traceback (most recent call last):
  File "mode-plot-tutorial.py", line 41, in <module>
    get_efields))
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 825, in run_zodd
    self.run_parity(mp.ODD_Z, True, *band_functions)
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 799, in run_parity
    f(self, band)
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 1191, in _output_at_kpoint
    band_func(ms, which_band)
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 1180, in _combine
    apply_band_func(ms, f, which_band)
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 1172, in apply_band_func
    apply_band_func_thunk(ms, band_func, which_band, which_band == 1)
  File "/home/adam/Miniconda3-4.4.10-Linux-x86_64/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py", line 1168, in apply_band_func_thunk
    band_func(ms, which_band)
  File "mode-plot-tutorial.py", line 38, in get_efields
    efields.append(ms.get_efield(band, bloch_phase=True))
NameError: name 'efields' is not defined

If I initialise efields=[]:

Traceback (most recent call last):
  File "mode-plot-tutorial.py", line 51, in <module>
    f = f[:, :, 2]
IndexError: index 2 is out of bounds for axis 2 with size 1

If I change the offending line to f = f[..., 0, 2] (the last axis has size=3), I finally get sensible results, although there are some spurious lines on one of the pillars:
figure_1

I'll submit a PR later to fix this example.

configure script fails on macOS Sierra

While trying to configure mpb-1.5 with

./configure -v LIBS=-ldl LDFLAGS=-L/usr/local/opt/fftw/lib-L/usr/local/lib CPPFLAGS=-I/usr/local/opt/fftw/include-I/usr/local/include

the script exits with

configure:16941: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary.

fftw was installed with home-brew which puts symbolic links in /usr/local/opt/fftw. The libraries appear to be where they are supposed to be. The only other error message generated by the configure script was
conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found.

I don't know what conftest.c does (I presume it is a configuration test), but whatever it does it appears to be missing a header file. I don't know if conftest.c is relevant to the problem of the configure script not being able to find the fftw libraries.

I have also done
export LDFLAGS=/usr/local/lib:/usr/local/opt/fftw/lib and similarly for CPPFLAGS.
All to no avail.

cat config.log|grep warning shows
ld: warning: directory not found for option '-L/usr/local/lib-L/usr/local/opt/fftw/lib'

ld cannot find these directories that certainly do exist.

error " no such file or directory"

Hello,

Is there anybody who can help me with a problem. I need to calculate DOS of a diamond structure using the diamond.ctl at the example. I do as follow:

mpb diamond.ctl >& diamond.out
mpb include dos.scm
but after this I got this error:
" Backtrace:
In ice-9/boot-9.scm:
160: 4 [catch #t #<catch-closure 563db32de620> ...]
In unknown file:
?: 3 [apply-smob/1 #<catch-closure 563db32de620>]
In ice-9/eval.scm:
432: 2 [eval # #]
432: 1 [eval # #]
In unknown file:
?: 0 [primitive-load "include"]

ERROR: In procedure primitive-load:
ERROR: In procedure open-file: No such file or directory: "include"
"

I really appreciate it if you let me know what is the problem. even I have tried different notation with (, ' ," .
but it did not work yet.

Error during the installation of MPB

While installing mpb-1.6.1 I encountered with the following error:
configure: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary.
I tried with sentenv LDFLAGS "-L/usr/local/lib"
sentenv CPPFLAGS "-I/usr/loal/include"
but it is not helping.
I am kind of new with Linux and programming.
I know you have already answered these types of questions, i tried all those possible ways and still unable to proceed.
fftw-wisdom tool for FFTW version 3.3.3.

FFTW and MPI compilation

It seem that the configure script fails when given the argument
--with-mpi
if we do not also give it the argument
--with-fftw2

fix extra-process problem for mpb-split

Dear Steven

"mpb-split N ..." will submit N+1 processes with the first process submitted twice.
This can be fixed by chaning "i=0" to be "i=1" in the follow code. Thanks!

######################
./mpb interactive?=false k-split-index=0 k-split-num=$* &
subprocesses="$subprocesses $!"
i=0
while test expr $i \< $1 = 1; do
./mpb interactive?=false k-split-index=$i k-split-num=$* > $tmpname.$i &
subprocesses="$subprocesses $!"
i=expr $i + 1
done

mpb 1.5 installation on osx 10.10.4

It seems when I try to configure MPB, I get the following error, even though I had done "brew install fftw" ran without errors:

configure: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary.

I did in fact set my LDFLAGS and CPPFLAGs before running ./configure:
export LDFLAGS=-L/usr/local/opt/fftw/lib
export CPPFLAGS=-I/usr/local/opt/fftw/include

Error encountered while installing MPB

Hi sir,
I tried installing MPB using the script from this site. While making file from line numer 71, some errors were encountered.

sh autogen.sh --with-pic CC=mpicc LIBS=-ldl --with-inv-symmetry

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --force
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --force-missing
configure.ac:25: installing './compile'
configure.ac:21: installing './missing'
mpb/Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --force
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --force-missing
configure.ac:25: installing './compile'
configure.ac:21: installing './missing'
mpb/Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --force
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --force-missing
configure.ac:25: installing './compile'
configure.ac:21: installing './missing'
mpb/Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... mpicc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mpicc accepts -g... yes
checking for mpicc option to accept ISO C89... none needed
checking whether mpicc understands -c and -o together... yes
checking dependency style of mpicc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by mpicc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from mpicc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... mpicc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if mpicc supports -fno-rtti -fno-exceptions... no
checking for mpicc option to produce PIC... -fPIC -DPIC
checking if mpicc PIC flag -fPIC -DPIC works... yes
checking if mpicc static flag -static works... no
checking if mpicc supports -c -o file.o... yes
checking if mpicc supports -c -o file.o... (cached) yes
checking whether the mpicc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for g77... no
checking for xlf... no
checking for f77... f77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether f77 accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for f77 option to produce PIC... -fPIC
checking if f77 PIC flag -fPIC works... yes
checking if f77 static flag -static works... yes
checking if f77 supports -c -o file.o... yes
checking if f77 supports -c -o file.o... (cached) yes
checking whether the f77 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for perl... /usr/bin/perl
checking for vendor cc to be used instead of gcc... 
checking for cc... mpicc
checking whether we are using the GNU C compiler... (cached) yes
checking whether mpicc accepts -g... (cached) yes
checking for mpicc option to accept ISO C89... (cached) none needed
checking whether mpicc understands -c and -o together... (cached) yes
checking dependency style of mpicc... (cached) gcc3
*********************** INVERSION SYM. ***********************
checking for sqrt in -lm... yes
checking how to get verbose linking output from f77... -v
checking for Fortran 77 libraries of f77...  -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lgfortran -lm -ldl -lquadmath
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking for fftw_execute in -lfftw3... yes
checking if sgemm_ is being linked in already... no
checking for sgemm_ in -lopenblas... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... yes
checking for dgemm_ in -ldgemm... no
checking for sgemm_ in -lmkl... no
checking for sgemm_ in -framework vecLib... no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) yes
checking for sgemm_ in -lessl... no
checking for sgemm_ in -lblas... (cached) yes
checking for cheev_... no
checking for cheev_ in -llapack... yes
checking for deflate in -lz... yes
checking for H5Pcreate in -lhdf5... no
configure: WARNING: Couldn't find the HDF5 library!!  Switching to --without-hdf5.
checking for guile... yes
checking for guile-config... guile-config
checking if linking to guile works... yes
checking libguile.h usability... yes
checking libguile.h presence... yes
checking for libguile.h... yes
checking guile/gh.h usability... no
checking guile/gh.h presence... no
checking for guile/gh.h... no
checking for scm_make_smob_type... yes
checking for scm_array_get_handle... yes
checking for scm_is_array... yes
checking for SCM_SMOB_PREDICATE... yes
checking for SCM_SMOB_DATA... yes
checking for SCM_NEWSMOB... yes
checking how to activate readline in Guile... ice-9 readline
checking for libctl dir... /usr/local/share/libctl
checking for gen-ctl-io... gen-ctl-io
checking for ctl_get_vector3 in -lctl... yes
checking ctl.h usability... yes
checking ctl.h presence... yes
checking for ctl.h... yes
checking whether libctl version is at least 3.2.1... ok
checking for libctl_quiet feature... yes
checking for basename in -lgen... no
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
checking for nlopt_minimize in -lnlopt... no
checking for ANSI C header files... (cached) yes
checking for unistd.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for nlopt.h... (cached) no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for getopt... yes
checking for strncmp... yes
checking whether calling BLAS zdotc works... yes
checking for bash... /bin/bash
checking for feenableexcept... yes
checking whether feenableexcept declaration is usable... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating src/Makefile
config.status: creating src/util/Makefile
config.status: creating src/matrices/Makefile
config.status: creating src/matrixio/Makefile
config.status: creating src/maxwell/Makefile
config.status: creating mpb/Makefile
config.status: creating mpb/mpb.scm
config.status: creating mpb/mpb-split-preinstall
config.status: creating utils/Makefile
config.status: creating config.h
config.status: creating src/mpbconf.h
config.status: src/mpbconf.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

root@ubuntu:/home/arpit/install/mpb# make && make check && sudo make installmake all-recursive

make[1]: Entering directory '/home/arpit/install/mpb'
Making all in src
make[2]: Entering directory '/home/arpit/install/mpb/src'
make  all-recursive
make[3]: Entering directory '/home/arpit/install/mpb/src'
Making all in util
make[4]: Entering directory '/home/arpit/install/mpb/src/util'
make  all-am
make[5]: Entering directory '/home/arpit/install/mpb/src/util'
  CC       debug_malloc.lo
  CC       mpi_utils.lo
mpi_utils.c: In function ‘mpi_begin_critical_section’:
mpi_utils.c:186:15: warning: unused variable ‘status’ [-Wunused-variable]
    MPI_Status status;
               ^
mpi_utils.c: In function ‘mpi_end_critical_section’:
mpi_utils.c:194:35: warning: unused parameter ‘tag’ [-Wunused-parameter]
 void mpi_end_critical_section(int tag)
                                   ^
  CCLD     libutil.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[5]: Leaving directory '/home/arpit/install/mpb/src/util'
make[4]: Leaving directory '/home/arpit/install/mpb/src/util'
Making all in matrices
make[4]: Entering directory '/home/arpit/install/mpb/src/matrices'
  CC       libmatrices_la-blasglue.lo
  CC       libmatrices_la-eigensolver.lo
  CC       libmatrices_la-eigensolver_davidson.lo
  CC       libmatrices_la-eigensolver_utils.lo
  CC       libmatrices_la-evectmatrix.lo
  CC       libmatrices_la-linmin.lo
  CC       libmatrices_la-matrices.lo
  CC       libmatrices_la-minpack2-linmin.lo
  CC       libmatrices_la-sqmatrix.lo
  CCLD     libmatrices.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/arpit/install/mpb/src/matrices'
Making all in matrixio
make[4]: Entering directory '/home/arpit/install/mpb/src/matrixio'
  CC       libmatrixio_a-evectmatrixio.o
  CC       libmatrixio_a-fieldio.o
  CC       libmatrixio_a-matrixio.o
matrixio.c: In function ‘write_attr’:
matrixio.c:82:36: warning: unused parameter ‘id’ [-Wunused-parameter]
 static void write_attr(matrixio_id id, matrixio_id_ type_id,
                                    ^
matrixio.c:82:53: warning: unused parameter ‘type_id’ [-Wunused-parameter]
 static void write_attr(matrixio_id id, matrixio_id_ type_id,
                                                     ^
matrixio.c:83:23: warning: unused parameter ‘space_id’ [-Wunused-parameter]
          matrixio_id_ space_id,
                       ^
matrixio.c:84:22: warning: unused parameter ‘name’ [-Wunused-parameter]
          const char *name, const void *val)
                      ^
matrixio.c:84:40: warning: unused parameter ‘val’ [-Wunused-parameter]
          const char *name, const void *val)
                                        ^
matrixio.c: In function ‘open_attr’:
matrixio.c:111:60: warning: unused parameter ‘type_id’ [-Wunused-parameter]
 static matrixio_id open_attr(matrixio_id id, matrixio_id_ *type_id,
                                                            ^
matrixio.c:112:23: warning: unused parameter ‘space_id’ [-Wunused-parameter]
         matrixio_id_ *space_id, const char *name)
                       ^
matrixio.c:112:45: warning: unused parameter ‘name’ [-Wunused-parameter]
         matrixio_id_ *space_id, const char *name)
                                             ^
matrixio.c: In function ‘read_attr’:
matrixio.c:137:35: warning: unused parameter ‘id’ [-Wunused-parameter]
 static void read_attr(matrixio_id id, matrixio_id attr_id,
                                   ^
matrixio.c:137:51: warning: unused parameter ‘attr_id’ [-Wunused-parameter]
 static void read_attr(matrixio_id id, matrixio_id attr_id,
                                                   ^
matrixio.c:138:22: warning: unused parameter ‘mem_type_id’ [-Wunused-parameter]
         matrixio_id_ mem_type_id, void *val)
                      ^
matrixio.c:138:41: warning: unused parameter ‘val’ [-Wunused-parameter]
         matrixio_id_ mem_type_id, void *val)
                                         ^
matrixio.c: In function ‘close_attr’:
matrixio.c:150:36: warning: unused parameter ‘id’ [-Wunused-parameter]
 static void close_attr(matrixio_id id, matrixio_id attr_id)
                                    ^
matrixio.c:150:52: warning: unused parameter ‘attr_id’ [-Wunused-parameter]
 static void close_attr(matrixio_id id, matrixio_id attr_id)
                                                    ^
matrixio.c: In function ‘matrixio_write_string_attr’:
matrixio.c:164:45: warning: unused parameter ‘id’ [-Wunused-parameter]
 void matrixio_write_string_attr(matrixio_id id, const char *name,
                                             ^
matrixio.c:164:61: warning: unused parameter ‘name’ [-Wunused-parameter]
 void matrixio_write_string_attr(matrixio_id id, const char *name,
                                                             ^
matrixio.c:165:17: warning: unused parameter ‘val’ [-Wunused-parameter]
     const char *val)
                 ^
matrixio.c: In function ‘matrixio_write_data_attr’:
matrixio.c:183:43: warning: unused parameter ‘id’ [-Wunused-parameter]
 void matrixio_write_data_attr(matrixio_id id, const char *name,
                                           ^
matrixio.c:183:59: warning: unused parameter ‘name’ [-Wunused-parameter]
 void matrixio_write_data_attr(matrixio_id id, const char *name,
                                                           ^
matrixio.c:184:22: warning: unused parameter ‘val’ [-Wunused-parameter]
          const real *val, int rank, const int *dims)
                      ^
matrixio.c:184:31: warning: unused parameter ‘rank’ [-Wunused-parameter]
          const real *val, int rank, const int *dims)
                               ^
matrixio.c:184:48: warning: unused parameter ‘dims’ [-Wunused-parameter]
          const real *val, int rank, const int *dims)
                                                ^
matrixio.c: In function ‘matrixio_read_string_attr’:
matrixio.c:219:45: warning: unused parameter ‘id’ [-Wunused-parameter]
 char *matrixio_read_string_attr(matrixio_id id, const char *name)
                                             ^
matrixio.c:219:61: warning: unused parameter ‘name’ [-Wunused-parameter]
 char *matrixio_read_string_attr(matrixio_id id, const char *name)
                                                             ^
matrixio.c: In function ‘matrixio_read_data_attr’:
matrixio.c:256:43: warning: unused parameter ‘id’ [-Wunused-parameter]
 real *matrixio_read_data_attr(matrixio_id id, const char *name,
                                           ^
matrixio.c:256:59: warning: unused parameter ‘name’ [-Wunused-parameter]
 real *matrixio_read_data_attr(matrixio_id id, const char *name,
                                                           ^
matrixio.c:257:15: warning: unused parameter ‘rank’ [-Wunused-parameter]
          int *rank, int max_rank, int *dims)
               ^
matrixio.c:257:25: warning: unused parameter ‘max_rank’ [-Wunused-parameter]
          int *rank, int max_rank, int *dims)
                         ^
matrixio.c:257:40: warning: unused parameter ‘dims’ [-Wunused-parameter]
          int *rank, int max_rank, int *dims)
                                        ^
matrixio.c: In function ‘matrixio_create_’:
matrixio.c:335:60: warning: unused parameter ‘parallel’ [-Wunused-parameter]
 static matrixio_id matrixio_create_(const char *fname, int parallel)
                                                            ^
matrixio.c: In function ‘matrixio_open_’:
matrixio.c:389:47: warning: unused parameter ‘fname’ [-Wunused-parameter]
 static matrixio_id matrixio_open_(const char *fname, int read_only, int paralle
                                               ^
matrixio.c:389:58: warning: unused parameter ‘read_only’ [-Wunused-parameter]
 static matrixio_id matrixio_open_(const char *fname, int read_only, int paralle
                                                          ^
matrixio.c:389:73: warning: unused parameter ‘parallel’ [-Wunused-parameter]
 atic matrixio_id matrixio_open_(const char *fname, int read_only, int parallel)
                                                                       ^
matrixio.c: In function ‘matrixio_close’:
matrixio.c:428:33: warning: unused parameter ‘id’ [-Wunused-parameter]
 void matrixio_close(matrixio_id id)
                                 ^
matrixio.c: In function ‘matrixio_create_sub’:
matrixio.c:447:17: warning: unused parameter ‘name’ [-Wunused-parameter]
     const char *name, const char *description)
                 ^
matrixio.c:447:35: warning: unused parameter ‘description’ [-Wunused-parameter]
     const char *name, const char *description)
                                   ^
matrixio.c: In function ‘matrixio_close_sub’:
matrixio.c:481:37: warning: unused parameter ‘id’ [-Wunused-parameter]
 void matrixio_close_sub(matrixio_id id)
                                     ^
matrixio.c: In function ‘matrixio_open_dataset’:
matrixio.c:491:19: warning: unused parameter ‘name’ [-Wunused-parameter]
       const char *name,
                   ^
matrixio.c:492:11: warning: unused parameter ‘rank’ [-Wunused-parameter]
       int rank, const int *dims)
           ^
matrixio.c:492:28: warning: unused parameter ‘dims’ [-Wunused-parameter]
       int rank, const int *dims)
                            ^
matrixio.c: In function ‘matrixio_create_dataset’:
matrixio.c:530:21: warning: unused parameter ‘name’ [-Wunused-parameter]
         const char *name, const char *description,
                     ^
matrixio.c:530:39: warning: unused parameter ‘description’ [-Wunused-parameter]
         const char *name, const char *description,
                                       ^
matrixio.c:531:13: warning: unused parameter ‘rank’ [-Wunused-parameter]
         int rank, const int *dims)
             ^
matrixio.c:531:30: warning: unused parameter ‘dims’ [-Wunused-parameter]
         int rank, const int *dims)
                              ^
matrixio.c: In function ‘matrixio_close_dataset’:
matrixio.c:591:41: warning: unused parameter ‘data_id’ [-Wunused-parameter]
 void matrixio_close_dataset(matrixio_id data_id)
                                         ^
matrixio.c: In function ‘matrixio_dataset_exists’:
matrixio.c:598:41: warning: unused parameter ‘id’ [-Wunused-parameter]
 int matrixio_dataset_exists(matrixio_id id, const char *name)
                                         ^
matrixio.c:598:57: warning: unused parameter ‘name’ [-Wunused-parameter]
 int matrixio_dataset_exists(matrixio_id id, const char *name)
                                                         ^
matrixio.c: In function ‘matrixio_dataset_delete’:
matrixio.c:611:42: warning: unused parameter ‘id’ [-Wunused-parameter]
 void matrixio_dataset_delete(matrixio_id id, const char *name)
                                          ^
matrixio.c:611:58: warning: unused parameter ‘name’ [-Wunused-parameter]
 void matrixio_dataset_delete(matrixio_id id, const char *name)
                                                          ^
matrixio.c: In function ‘matrixio_write_real_data’:
matrixio.c:620:43: warning: unused parameter ‘data_id’ [-Wunused-parameter]
 void matrixio_write_real_data(matrixio_id data_id,
                                           ^
matrixio.c:621:21: warning: unused parameter ‘local_dims’ [-Wunused-parameter]
          const int *local_dims, const int *local_start,
                     ^
matrixio.c:621:44: warning: unused parameter ‘local_start’ [-Wunused-parameter]
          const int *local_dims, const int *local_start,
                                            ^
matrixio.c:622:14: warning: unused parameter ‘stride’ [-Wunused-parameter]
          int stride,
              ^
matrixio.c:623:16: warning: unused parameter ‘data’ [-Wunused-parameter]
          real *data)
                ^
matrixio.c: In function ‘matrixio_read_real_data’:
matrixio.c:781:43: warning: unused parameter ‘id’ [-Wunused-parameter]
 real *matrixio_read_real_data(matrixio_id id,
                                           ^
matrixio.c:782:22: warning: unused parameter ‘name’ [-Wunused-parameter]
          const char *name,
                      ^
matrixio.c:783:15: warning: unused parameter ‘rank’ [-Wunused-parameter]
          int *rank, int *dims,
               ^
matrixio.c:783:26: warning: unused parameter ‘dims’ [-Wunused-parameter]
          int *rank, int *dims,
                          ^
matrixio.c:784:14: warning: unused parameter ‘local_dim0’ [-Wunused-parameter]
          int local_dim0, int local_dim0_start,
              ^
matrixio.c:784:30: warning: unused parameter ‘local_dim0_start’ [-Wunused-parameter]
          int local_dim0, int local_dim0_start,
                              ^
matrixio.c:785:14: warning: unused parameter ‘stride’ [-Wunused-parameter]
          int stride,
              ^
matrixio.c:786:16: warning: unused parameter ‘data’ [-Wunused-parameter]
          real *data)
                ^
matrixio.c: At top level:
matrixio.c:82:13: warning: ‘write_attr’ defined but not used [-Wunused-function]
 static void write_attr(matrixio_id id, matrixio_id_ type_id,
             ^
matrixio.c:111:20: warning: ‘open_attr’ defined but not used [-Wunused-function]
 static matrixio_id open_attr(matrixio_id id, matrixio_id_ *type_id,
                    ^
matrixio.c:137:13: warning: ‘read_attr’ defined but not used [-Wunused-function]
 static void read_attr(matrixio_id id, matrixio_id attr_id,
             ^
matrixio.c:150:13: warning: ‘close_attr’ defined but not used [-Wunused-function]
 static void close_attr(matrixio_id id, matrixio_id attr_id)
             ^
matrixio.c:310:14: warning: ‘add_fname_suffix’ defined but not used [-Wunused-function]
 static char *add_fname_suffix(const char *fname)
              ^
matrixio.c:332:12: warning: ‘matrixio_critical_section_tag’ defined but not used [-Wunused-variable]
 static int matrixio_critical_section_tag = 0;
            ^
  AR       libmatrixio.a
ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/arpit/install/mpb/src/matrixio'
Making all in maxwell
make[4]: Entering directory '/home/arpit/install/mpb/src/maxwell'
  CC       libmaxwell_la-maxwell.lo
  CC       libmaxwell_la-maxwell_constraints.lo
  CC       libmaxwell_la-maxwell_eps.lo
In file included from maxwell_eps.c:29:0:
maxwell_eps.c: In function ‘set_maxwell_dielectric’:
xyz_loop.h:47:46: error: ‘k2’ undeclared (first use in this function)
                  case 2: i1 = i1_; i2 = i2_; k2 = 0; break; \
                                              ^
maxwell_eps.c:421:6: note: in expansion of macro ‘LOOP_XYZ’
      LOOP_XYZ(md) {
      ^
xyz_loop.h:47:46: note: each undeclared identifier is reported only once for each function it appears in
                  case 2: i1 = i1_; i2 = i2_; k2 = 0; break; \
                                              ^
maxwell_eps.c:421:6: note: in expansion of macro ‘LOOP_XYZ’
      LOOP_XYZ(md) {
      ^
xyz_loop.h:39:15: warning: unused variable ‘n1’ [-Wunused-variable]
           int n1 = md->nx, n2 = md->ny, n3 = md->nz, i1_, i2_, i1, i2, i3; \
               ^
maxwell_eps.c:421:6: note: in expansion of macro ‘LOOP_XYZ’
      LOOP_XYZ(md) {
      ^
maxwell_eps.c:404:27: warning: unused variable ‘rank’ [-Wunused-variable]
      int n_other, n_last, rank;
                           ^
maxwell_eps.c:404:19: warning: unused variable ‘n_last’ [-Wunused-variable]
      int n_other, n_last, rank;
                   ^
maxwell_eps.c:404:10: warning: unused variable ‘n_other’ [-Wunused-variable]
      int n_other, n_last, rank;
          ^
maxwell_eps.c:395:16: warning: unused variable ‘k’ [-Wunused-variable]
      int i, j, k;
                ^
maxwell_eps.c:395:13: warning: unused variable ‘j’ [-Wunused-variable]
      int i, j, k;
             ^
maxwell_eps.c:395:10: warning: unused variable ‘i’ [-Wunused-variable]
      int i, j, k;
          ^
maxwell_eps.c: At top level:
maxwell_eps.c:181:12: warning: ‘sym_matrix_eq’ defined but not used [-Wunused-function]
 static int sym_matrix_eq(symmetric_matrix V1, symmetric_matrix V2, double tol)
            ^
Makefile:420: recipe for target 'libmaxwell_la-maxwell_eps.lo' failed
make[4]: *** [libmaxwell_la-maxwell_eps.lo] Error 1
make[4]: Leaving directory '/home/arpit/install/mpb/src/maxwell'
Makefile:547: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/arpit/install/mpb/src'
Makefile:404: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/arpit/install/mpb/src'
Makefile:421: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/arpit/install/mpb'
Makefile:353: recipe for target 'all' failed
make: *** [all] Error 2

stack overflow in mpb v1.5

If many (thousands) of k-points are written to the .ctl file, stack overflow occurs when executing the file with mpb v1.5 (the same file runs fine with mpb v1.4.2).

Backtrace:
In ice-9/psyntax.scm:
2736: 19 [match-each-any (# # # # ...) (()) #f]
2736: 18 [match-each-any (# # # # ...) (()) #f]
2736: 17 [match-each-any (# # # # ...) (()) #f]
2736: 16 [match-each-any (# # # # ...) (()) #f]
2736: 15 [match-each-any (# # # # ...) (()) #f]
2736: 14 [match-each-any (# # # # ...) (()) #f]
2736: 13 [match-each-any (# # # # ...) (()) #f]
2736: 12 [match-each-any (# # # # ...) (()) #f]
2736: 11 [match-each-any (# # # # ...) (()) #f]
2736: 10 [match-each-any (# # # # ...) (()) #f]
2736: 9 [match-each-any (# # # # ...) (()) #f]
2736: 8 [match-each-any (# # # # ...) (()) #f]
2736: 7 [match-each-any (# # # # ...) (()) #f]
2736: 6 [match-each-any (# # # # ...) (()) #f]
2736: 5 [match-each-any (# # # # ...) (()) #f]
2736: 4 [match-each-any (# # # # ...) (()) #f]
2736: 3 [match-each-any (# # # # ...) (()) #f]
2736: 2 [match-each-any (# # # # ...) (()) #f]
2736: 1 [match-each-any (# # # # ...) (()) #f]
2736: 0 [match-each-any (# # # # ...) (()) #f]

ice-9/psyntax.scm:2736:21: In procedure match-each-any:
ice-9/psyntax.scm:2736:21: Throw to key vm-error' with args (vm-run "VM: Stack overflow" ())'.

A minimal working example is attached (renamed to .txt to allow attachment).

mwe.txt

Issue with band_min in find_k

Hello,

I am having an issue with calling get_efield (and other get_Xfield functions) for certain values of band_min set by find_k.

In other words, if I first use find_k to solve for a set of eigenmodes:
ms.find_k(mp.NO_PARITY, 1/1.55, band_min=1, band_max=2, kdir=...)
and then I try to retrieve the electric field of the 2nd band:
E2 = ms.get_efield(2)
MPB returns the following errors from pympb.cpp (lines 1444-1452):
Must have 1 <= band index <= num_bands (1)
get_dfield must be called before get-efield-from-dfield!

However, if I set band_min=2 in find_k:
ms.find_k(mp.NO_PARITY, 1/1.55, band_min=2, band_max=2, kdir=...)
then getting the 2nd band's field profile (as shown above) works without any errors.

It seems that the errors occur when band_min != band number (value given to get_efield). Is this behavior consistent with the intended usage of get_efield and find_k?

Thanks for your help

Extract Corresponding Eigenvectors

I am extracting the supported modes of a simple slab waveguide. I can extract the eigenmodes using the output variables (i.e. ms.freqs). Is it possible to get their corresponding eigenvectors as well? I'd like to view their mode profiles.

provide dominant planewave component

For various calculations, it would be convenient to have a function to return the dominant planewave component. That is, find the G vector corresponding to the biggest amplitude planewave (in the planewave expansion of an eigenmode), and return k+G (the corresponding planewave wavevector).

Has to be implemented at the C level, as a new function in src/maxwell, but should be straightforward since we already have all the requisite information.

(Would help with NanoComp/meep#476, for example.)

ModeSolver_findk() return empty list

According to the Python User Interface documentation, running find_k should print the following:

kvals: omega, band-min, band-max, kdir1, kdir2, kdir3, k magnitudes...

Running the function as follows,

freq_k = ms.find_k(p=mp.NO_PARITY, omega=0.2, band_min = 1, band_max = 2, korig_and_kdir = [mp.Vector3(),mp.Vector3(1,-1)], tol=1e-4, kmag_guess = 0.25, kmag_max = 1, kmag_min=0);

prints the following

kvals:, 0.2, 1, 2, 0.0, 0.0, 0.0, 0.5000000000000001, -0.5000000000000001, 0.0, 0.34854881011633443, 0.2278306828707655

As far as I can tell, kdir1 refers to korig, kdir2 refers to kdir, and kdir3 is missing. As a result, the list of magnitudes returned is empty. My guess is that the function is recognizing the actual k magnitudes (0.34854881011633443, 0.2278306828707655) as kdir3.

How can I get the find_k() function to actually return a list of k magnitude values, and what is the "kdir3" supposed to refer to in the printed kvals line?

Eigen mode calculation for 3D

Dear MPB users,

I am fresh to MPB (just a few weeks). When I am trying to calculate the band-structure of 3D lattice with different lattice constants ax=ay=14*az, I just could not get the result as expected (such as a band-gap in z direction); but I could not figure out what is the mistake in the code (attached at the end).

Basically, I am looking at a bragg-graded cylindrical fiber in z direction with perimittivity, 1 + epsilon_1 - epsilon_2cos(2betaz), and radius 5 \mu m, with beta = 4 \mu m^-1; and 3D lattice is obtained by a 2D square stack of the cylindrical fibers in x-y plane with ax=ax=14pi/4.

Thanks
-----------------------------code----------------------------------------------------------------------------------------------
import math
import meep as mp
from meep import mpb

this is the structure for the bragg-graded optical fiber

pi = math.pi
scalratio = 4/pi # redefine of the unit
#lac = pi/wavecon
htenlac = 1/20 # here we use 10 layer
tenlac = 2*htenlac # thickness of the layer

geometry_lattice = mp.Lattice(
basis_size=mp.Vector3(14,14,1),
basis1=mp.Vector3(1,0,0),
basis2=mp.Vector3(0,1,0),
basis3=mp.Vector3(0,0,1)
)

vlist = [
mp.Vector3(0,0,0),
mp.Vector3(0,0,0.5)
]

k_points = mp.interpolate(20,vlist)

eps1 = math.pow((1+1.12),2)-1
eps2 = 0.2
r = 5*scalratio

diel1 = mp.Medium(epsilon=1+(eps1-eps2))
diel2 = mp.Medium(epsilon=1+(eps1-eps2math.cos(2pitenlac)))
diel3 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi2tenlac)))
diel4 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi3tenlac)))
diel5 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi4tenlac)))
diel6 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi5tenlac)))
diel7 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi6tenlac)))
diel8 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi7tenlac)))
diel9 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi8tenlac)))
diel10 = mp.Medium(epsilon=1+(eps1-eps2
math.cos(2pi9*tenlac)))

geometry = [mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,0.5tenlac),material=diel1),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,1.5
tenlac),material=diel2),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,2.5tenlac),material=diel3),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,3.5
tenlac),material=diel4),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,4.5tenlac),material=diel5),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,-4.5
tenlac),material=diel6),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,-3.5tenlac),material=diel7),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,-2.5
tenlac),material=diel8),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,-1.5tenlac),material=diel9),
mp.Cylinder(radius=r,axis=mp.Vector3(0,0,1),height=tenlac,center=mp.Vector3(0,0,-0.5
tenlac),material=diel10)]

resolution = 64
mesh_size = 3
num_bands = 20

ms = mpb.ModeSolver(
geometry_lattice=geometry_lattice,
k_points=k_points,
geometry=geometry,
resolution=resolution,
num_bands=num_bands,
mesh_size=mesh_size
)

ms.run(mpb.output_at_kpoint(mp.Vector3(0, 0, 0.5), mpb.output_dpwr))

Operator Formulation for Lossy Materials

Does MPB cite any papers that describe how it formulates and discretizes its operator of which it finds the eigenvalues?

Several papers take common Maxwell operator formulations and "upgrade" them (or modify them) to enable lossy materials or even materials with perfectly matched boundary layers.

configure *.h5 files' location

Hi, Is it possible to configure *.h5 files location when I run mpb /home/user/mpb/input.ctl > /home/user/mpb/output.out? I'm asking because mpb saves files to /home/user/.
I'm using mpb 1.4.2. I didn't found it a solution in your documentation, maybe I missed it, but it will be very cool if you'll help me with this issue.

convergence never achieved

Hi,
I am new to this software and I am trying to learn following the Tutorial on http://mpb.readthedocs.io/en/latest/
But I found that the example on the tutorial doesn't converge:

#python interface
import math
import meep as mp
from meep import mpb
num_bands = 8
k_points = [mp.Vector3(),          # Gamma
            mp.Vector3(0.5),       # X
            mp.Vector3(0.5, 0.5),  # M
            mp.Vector3()]          # Gamma
k_points = mp.interpolate(4, k_points)
geometry = [mp.Cylinder(0.2, material=mp.Medium(epsilon=12))]
geometry_lattice = mp.Lattice(size=mp.Vector3(1, 1))
resolution = 32
ms = mpb.ModeSolver(num_bands=num_bands,
                    k_points=k_points,
                    geometry=geometry,
                    geometry_lattice=geometry_lattice,
                    resolution=resolution)
ms.run_te()

with output:

Using MPI version 3.1, 1 processes
/usr/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Initializing eigensolver data
Computing 8 bands with 1e-07 tolerance
Working in 2 dimensions.
Grid size is 32 x 32 x 1.
Solving for 8 bands at a time.
Creating Maxwell data...
Mesh size is 3.
Lattice vectors:
     (1, 0, 0)
     (0, 1, 0)
     (0, 0, 1)
Cell volume = 1
Reciprocal lattice vectors (/ 2 pi):
     (1, -0, 0)
     (-0, 1, -0)
     (0, -0, 1)
Geometric objects:
     cylinder, center = (0,0,0)
          radius 0.2, height 1e+20, axis (0, 0, 1)
Geometric object tree has depth 1 and 1 object nodes (vs. 1 actual objects)
Initializing epsilon function...
Allocating fields...
Solving for band polarization: te.
Initializing fields to random numbers...
16 k-points
  Vector3<0.0, 0.0, 0.0>
  Vector3<0.1, 0.0, 0.0>
  Vector3<0.2, 0.0, 0.0>
  Vector3<0.30000000000000004, 0.0, 0.0>
  Vector3<0.4, 0.0, 0.0>
  Vector3<0.5, 0.0, 0.0>
  Vector3<0.5, 0.1, 0.0>
  Vector3<0.5, 0.2, 0.0>
  Vector3<0.5, 0.30000000000000004, 0.0>
  Vector3<0.5, 0.4, 0.0>
  Vector3<0.5, 0.5, 0.0>
  Vector3<0.4, 0.4, 0.0>
  Vector3<0.3, 0.3, 0.0>
  Vector3<0.19999999999999996, 0.19999999999999996, 0.0>
  Vector3<0.09999999999999998, 0.09999999999999998, 0.0>
  Vector3<0.0, 0.0, 0.0>
elapsed time for initialization: 0.0021317005157470703
epsilon: 1-12, mean 2.38229, harm. mean 1.1448, 14.5508% > 1, 12.5663% "fill"
Outputting test-epsilon.h5...
solve_kpoint (0,0,0):
tefreqs:, k index, k1, k2, k3, kmag/2pi, te band 1, te band 2, te band 3, te band 4, te band 5, te band 6, te band 7, te band 8
Solving for bands 2 to 8...
    iteration 1669: trace = -238.2665500285033 (0.0029309% change)
    iteration 3335: trace = -286.1366693047255 (0.00929301% change)
    iteration 4828: trace = -351.1395813981682 (0.000940119% change)
    iteration 6218: trace = -373.8172154693463 (0% change)
    iteration 7781: trace = -373.8172154693463 (0% change)
    iteration 9535: trace = -373.8172154693463 (0% change)
    iteration 11066: trace = -373.8172154693463 (0% change)
    iteration 12403: trace = -373.8172154693463 (0% change)
    [basically same thing]
    iteration 96214: trace = -373.8172154693463 (0% change)
    iteration 97570: trace = -373.8172154693463 (0% change)
    iteration 99042: trace = -373.8172154693463 (0% change)
CHECK failure on line 792 of eigensolver.c: failure to converge after 100000 iterations

I also tested scheme interface

(set! num-bands 8)
(set! k-points (list (vector3 0 0 0)     ; Gamma
                     (vector3 0.5 0 0)   ; X
                     (vector3 0.5 0.5 0) ; M
                     (vector3 0 0 0)))   ; Gamma
(set! k-points (interpolate 4 k-points))
(set! geometry (list (make cylinder 
                       (center 0 0 0) (radius 0.2) (height infinity)
                       (material (make dielectric (epsilon 12))))))
(set! geometry-lattice (make lattice (size 1 1 no-size)))
(set! resolution 32)
(run-tm output-efield-z)

which gives:

    iteration 1459: trace = -292.8719429104186 (0.00424713% change)
    iteration 2806: trace = -331.7931898493883 (0.00215185% change)
    iteration 4060: trace = -344.2735133549883 (4.21278e-08% change)
    iteration 5550: trace = -354.9683484713888 (0.00024155% change)
    iteration 6854: trace = -363.982975802125 (0.0134399% change)
    iteration 8222: trace = -386.695806161881 (1.51465e-05% change)
    iteration 9586: trace = -394.1701382007935 (0.000110996% change)
    iteration 10801: trace = -404.1938414217796 (8.78195e-05% change)
    iteration 12224: trace = -417.3664902667314 (0.00386399% change)
    iteration 13470: trace = -427.4754599831633 (0.000496504% change)
    iteration 14814: trace = -434.338741735673 (6.3373e-06% change)
    iteration 16343: trace = -434.3593488512388 (0% change)
    iteration 17673: trace = -434.3593488512388 (0% change)
    iteration 19006: trace = -434.3593488512388 (0% change)
    iteration 20510: trace = -434.3593488512388 (0% change)
    [same thing]
    iteration 98111: trace = -434.3593488512388 (0% change)
    iteration 99796: trace = -434.3593488512388 (0% change)
CHECK failure on line 792 of eigensolver.c: failure to converge after 100000 iterations

Any suggestion what I can check?
Thank you!

autogen.sh fails

I'm having a couple problems installing mpb on Cygwin. Recently, I tried to use this repo and got the following:

$ bash ./autogen.sh
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: configure.ac: not using Gettext
autoreconf-2.69: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf-2.69: failed to run aclocal: No such file or directory
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: configure.ac: not using Gettext
autoreconf-2.69: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf-2.69: failed to run aclocal: No such file or directory
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: configure.ac: not using Gettext
autoreconf-2.69: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf-2.69: failed to run aclocal: No such file or directory
./autogen.sh: line 21: ./configure: No such file or directory

Prior to this, I tried v1.5, but found a problem when make tried to build sphere_quad. I found that issue reported in libctl issue 2, but couldn't follow the solution provided. A fix was said to be included in the next release, so I tried the git repo.

installation of MPB

Is it necessary to install MPI for HDF5 to work properly? I installed HDF5-1.80.20,
Features:

          Parallel HDF5: no
     High Level library: yes
           Threadsafety: no
    Default API Mapping: v18

With Deprecated Public Symbols: yes
I/O filters (external): deflate(zlib)
MPE: no
Direct VFD: no
dmalloc: no
Clear file buffers before write: yes
Using memory checker: no
Function Stack Tracing: no
Strict File Format Checks: no
Optimization Instrumentation: no
[saranya@localhost hdf5-1.8.20]$

And I reconfigured MPB. But it's still showing that compiled without HDF when I tried to run the program.

matrixio: cannot output "bragg1-h.k01.b01.y.tm" (compiled without HDF)
Outputting fields to bragg1-h.k01.b01.y.tm...
matrixio: cannot output "bragg1-h.k01.b02.y.tm" (compiled without HDF)
Outputting fields to bragg1-h.k01.b02.y.tm...
matrixio: cannot output "bragg1-h.k01.b03.y.tm" (compiled without HDF)
Outputting fields to bragg1-h.k01.b03.y.tm...

Seg fault with Intel's MKL and parallel MPB

Intel's MKL library and parallel MPB do not seem to get along very well. I get segmentation fault during make check.

Outputting check-epsilon...
solve_kpoint (0,0,0):
tefreqs:, k index, k1, k2, k3, kmag/2pi, te band 1, te band 2, te band 3, te band 4, te band 5, te band 6, te band 7, te band 8
Solving for bands 2 to 8...
[node253:27731] *** Process received signal ***
[node253:27731] Signal: Segmentation fault (11)
[node253:27731] Signal code: Invalid permissions (2)
[node253:27731] Failing at address: 0x2331420
[node253:27731] [ 0] /lib64/libpthread.so.0() [0x336060f710]
[node253:27731] [ 1] [0x2331420]
[node253:27731] *** End of error message ***

However, the serial version of MPB seems to work fine with Intel's MKL.

The parallel MPB and OPENBLAS also work well.

I was just wondering why parallel MPB won't work with MKL. If this is related to fftw3 issue (an earlier issue, which is now closed), I am not sure why serial version works just fine with MKL.

I am currently using gcc 4.8.5, Intel 2015 MKL, and mpb 1.5

Field normalization of first band at zero wave vector

Hi Steven,

When checking the normalization of E and H I get the following odd behavior when k-points is (vector3 0 0 0) . Using the .ctl-file below, I calculate the overlap between the nth and mth bands (in the DnEm and BnHm sense) and get (TM-calculation with µ = 1 and ε = 13 cylinders; only real part of overlap shown):

---DE overlaps---
             m = 1,       m = 2,       m = 3,       m = 4,       m = 5
n = 1 |   0.00    ,    0.00    ,    0.00    ,    0.00    ,    0.00    
n = 2 |   0.00    ,     1.0    ,    2.64E-16,    2.01E-16,    2.91E-16
n = 3 |   0.00    ,    2.36E-16,     1.0    ,    1.39E-17,   -2.78E-17
n = 4 |   0.00    ,    2.01E-16,    1.39E-17,     1.0    ,    3.38E-16
n = 5 |   0.00    ,    3.19E-16,   -3.47E-17,    3.38E-16,     1.0    

---BH overlaps---
             m = 1,       m = 2,       m = 3,       m = 4,       m = 5
n = 1 |    1.0    ,    2.51E-19,    9.02E-19,    2.68E-19,   -2.51E-18
n = 2 |   2.51E-19,    1.00    ,    5.00E-16,   -6.83E-16,    8.90E-16
n = 3 |   9.02E-19,    5.00E-16,    1.00    ,    1.39E-15,   -4.20E-16
n = 4 |   2.68E-19,   -6.83E-16,    1.39E-15,     1.0    ,    5.00E-16
n = 5 |  -2.51E-18,    8.90E-16,   -4.20E-16,    5.00E-16,    1.00    

The issue is in the left column/top row of the DE calculations. For more complicated geometries, I also get strange results for the BH term.
[If the permeability mu is not a unity matrix, this column/row is not zero, but a small value (10-2-10-6); in complicated geometries the DE+BH overlap sums to ~6 instead of 2]

If I change k-points to, say, (vector3 1e-4 0 0) the problem is remedied:

---DE overlaps---
             m = 1,       m = 2,       m = 3,       m = 4,       m = 5
n = 1 |   1.00    ,   -1.92E-12,    3.91E-12,    2.00E-12,    9.02E-13
n = 2 |  -1.92E-12,    1.00    ,    1.11E-16,   -3.61E-16,    1.73E-16
n = 3 |   3.91E-12,    1.11E-16,    1.00    ,   -4.72E-16,   -1.67E-16
n = 4 |   2.00E-12,   -3.61E-16,   -4.72E-16,    1.00    ,    2.01E-16
n = 5 |   9.02E-13,    1.73E-16,   -1.11E-16,    2.01E-16,     1.0    

---BH overlaps---
             m = 1,       m = 2,       m = 3,       m = 4,       m = 5
n = 1 |    1.0    ,    4.89E-12,    3.69E-11,   -2.37E-11,    1.84E-10
n = 2 |   4.89E-12,     1.0    ,   -1.39E-09,    3.99E-09,   -6.80E-10    
n = 3 |   3.69E-11,   -1.39E-09,     1.0    ,   -2.23E-09,    2.12E-11   
n = 4 |  -2.37E-11,    3.99E-09,   -2.23E-09,     1.0    ,   -2.63E-09   
n = 5 |   1.84E-10,   -6.80E-10,    2.12E-11,   -2.63E-09,     1.0      

Is this issue arising because the solution to the k = 0 case is trivial (ω = 0)? I suppose it is not a big issue, but it is slightly worrying e.g. for super cell calculations if overlap integrals between all bands are needed (= what I am doing).

Thanks!
-Thomas

.ctl file

(the BH overlap is left out; trivial repetitions)

(use-modules (ice-9 format)) ; load 'format' to allow precise control of print output

; define default variable values editable from command-line call
(define-param timesym "timebroken")

(set! num-bands 5)
(set! resolution 32)

; define material properties [based on input timesym, evaluated by if-statment (cond)]
(define matprops
(cond ((string=? timesym "timeinvariant")  ; time-invariant isotropic dielectric response
          (make dielectric (epsilon 13)))
      ((string=? timesym "timebroken")     ; time-broken anisotropic response
          (make medium-anisotropic (epsilon-diag 13 13 13) (epsilon-offdiag 0 0 0)
                                                    (mu-diag 1 1 1) (mu-offdiag 0+0.40i 0 0) )
      )
))

; define a simple cylinder-in-square-lattice geometry
(set! geometry-lattice (make lattice (size 1 1 no-size)   (basis1 1 0) (basis2 0 1)))
(set! geometry (list (make cylinder (center 0 0 0) (radius 0.1) (height infinity)
                                     (material matprops))))
 
(set! k-points (list (vector3 0 0 0))) ; k-point at Gamma

; function to compute band overlaps
(define (get-overlaps)
   ; function to calculate overlap between D_n and E_m or B_n and H_m
   (define (DEorBH-integrand r DB-n EH-m)  (vector3-cdot DB-n EH-m) )
   ; create a list for loop (1,2,3,...,num-bands)
   (define iter-list (list-tail (iota (+ 1 num-bands)) 1))

   ; loop over the list twice and calculate the required integrals along the way; first DE terms
   (print "\n\n---DE overlaps---\n\t  ")
   (map (lambda (m) (print "   m = " m ",    " )) iter-list)
   (map  (lambda (n)
            (print "\nn = " n " |\t")
            (get-dfield n)
            (let  ((D-n (field-copy cur-field)))
                  (map  (lambda (m)
                           (get-efield m)
                           (let  ((E-m (field-copy cur-field)))
                                 (let  ((overlap (integrate-fields DEorBH-integrand D-n E-m)))
                                       (print (format #f "~10,2,2g" (real-part overlap)) ",  ")
                                 )
                           )
                        )
                  iter-list )
            )
         )
    iter-list )
   (print "\n\n") ; clear a line
)

(run-tm get-overlaps) ; run tm-calculation, calculate overlaps at the end

Separate normalization question

Perhaps I should be opening a separate issue for this, but it's more of a question than an issue: I was wondering if the normalization-choices: ∫ DE dr = ∫ BH dr = 1 imply that E and H are normalized independently of each other? I.e. are ∇×E ≠ iωB and ∇×H ≠ -iωD?
I'm interested in calculating integrals of the type

<n|f|m> = ∫ Fn(r)M(r)f(r)Fm(r) dr

with the 6-vector F = (E; H), some scalar function f, and the usual weight matrix M = diag(ε, μ). If E and H are normalized independently, it seems to me that a naive construction of F via get-efield and get-hfield would lead to trouble. Is this correctly understood?

I don't suppose there's an option which would enable a normalization in the 6-vector sense, i.e. in a sense such that ε|E|2 + µ|H|2 integrates to unity, which is simultaneously consistent with ∇×E = iωB and ∇×H = -iωD?

2 problems when using MPB

Hi Steven,
Thank u so much for your helpful work firstly.
As a newie to MPB, I get two problems when using MPB:

1.If output the E-field, we have both real and imaginary part, as what is mentioned in MPB DATA ANALYSIS TUTORIAL: "The real and imaginary parts of the fields correspond to what the fields look like at half-period intervals in time"
My first question is : why is the imaginary part is the the field after half-period interval compared with real part? Is this a mathematical result(the output of the eigenvector with both real and imaginary part)?
I checked the Developer Information and went through the code roughly but didn't get the answer.

2.The second quesion is about the resolution. Becoz I got a problem that if I improve the resolution to a very high level,e.g. set the resolution at 256 for a 2D case, the plot of the efield with 'h5topng' is distorted and strange, very different from those at resolution of 32 or 64.
So I wonder if there would be something wrong if the resolution is too high from the theory?

I do hope these questions are non-trivial, but make me know if they are stupid:)
Thank you.

Cheers,
Hanrong

`mkdocs` config not compatible with version 0.17.5

When trying to build using mkdocs.yml form master with mkdocs-0.17.5, all pages in documentation are empty. In 0.17.0 the old theme config syntax was deprecated. To be compatible with the current version, the syntax should be:

theme:
  name: readthedocs
  custom_dir: mpb-mkdocs-theme

PR: #60.

mpb

I have already installed MPB with out HDF5. But now I want install HDF5. But i could not find any configure file. Can I run MPB and get all data without HDF5?

make error: No rule to make target `sphere-quad.h', needed by `all'.

Hi Steven,

I tried to install mpb on a linux system. "./configure" is successful but "make" doesn't go through and I got the following err message:

make all-recursive
make[1]: Entering directory /home/fwang/mpb' Making all in src make[2]: Entering directory/home/fwang/mpb/src'
make all-recursive
make[3]: Entering directory /home/fwang/mpb/src' Making all in util make[4]: Entering directory/home/fwang/mpb/src/util'
make[4]: *** No rule to make target sphere-quad.h', needed byall'. Stop.
make[4]: Leaving directory /home/fwang/mpb/src/util' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory/home/fwang/mpb/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/fwang/mpb/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/fwang/mpb'
make: *** [all] Error 2

Error in installation on my mac

Hello everyone,

I'm trying to install MPB on my mac. I've installed all the necessary prerequisites, I think. I download the mpb-1.5-2.tar, I've run the ./configure without any problem, but when I run make I get the following errors:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
cp -f mpbconf.h mpb.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in util
  CC       sphere-quad.o
  CCLD     sphere_quad
(echo "/* This file was automatically generated --- DO NOT EDIT */"; echo; ../../src/util/sphere_quad) > sphere-quad.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CC       debug_malloc.lo
  CC       mpi_utils.lo
mpi_utils.c:101:15: warning: unused variable 'status' [-Wunused-variable]
          MPI_Status status;
                     ^
mpi_utils.c:109:35: warning: unused parameter 'tag' [-Wunused-parameter]
void mpi_end_critical_section(int tag)
                                  ^
2 warnings generated.
  CCLD     libutil.la
Making all in matrices
  CC       libmatrices_la-blasglue.lo
  CC       libmatrices_la-eigensolver.lo
  CC       libmatrices_la-eigensolver_davidson.lo
  CC       libmatrices_la-eigensolver_utils.lo
  CC       libmatrices_la-evectmatrix.lo
  CC       libmatrices_la-linmin.lo
linmin.c:29:9: warning: keyword is hidden by macro definition [-Wkeyword-macro]
#define double linmin_real
        ^
1 warning generated.
  CC       libmatrices_la-matrices.lo
  CC       libmatrices_la-minpack2-linmin.lo
minpack2-linmin.c:77:9: warning: keyword is hidden by macro definition
      [-Wkeyword-macro]
#define double linmin_real
        ^
1 warning generated.
  CC       libmatrices_la-sqmatrix.lo
  CCLD     libmatrices.la
Making all in matrixio
  CC       libmatrixio_a-evectmatrixio.o
  CC       libmatrixio_a-fieldio.o
  CC       libmatrixio_a-matrixio.o
matrixio.c:469:17: warning: expression result unused [-Wunused-value]
          IF_EXCLUSIVE(0,if (id.parallel) MPI_Barrier(MPI_COMM_WORLD));
                       ^
matrixio.c:58:32: note: expanded from macro 'IF_EXCLUSIVE'
#  define IF_EXCLUSIVE(yes,no) yes
                               ^~~
matrixio.c:472:17: warning: expression result unused [-Wunused-value]
          IF_EXCLUSIVE(0,if (id.parallel) MPI_Barrier(MPI_COMM_WORLD));
                       ^
matrixio.c:58:32: note: expanded from macro 'IF_EXCLUSIVE'
#  define IF_EXCLUSIVE(yes,no) yes
                               ^~~
matrixio.c:516:23: warning: comparison of integers of different signs: 'hsize_t'
      (aka 'unsigned long long') and 'const int' [-Wsign-compare]
          CHECK(dims_copy[i] == dims[i],
                ~~~~~~~~~~~~ ^  ~~~~~~~
./../util/check.h:37:12: note: expanded from macro 'CHECK'
     if (!(condition))  { \
           ^~~~~~~~~
matrixio.c:552:17: warning: expression result unused [-Wunused-value]
          IF_EXCLUSIVE(0,if (id.parallel) MPI_Barrier(MPI_COMM_WORLD));
                       ^
matrixio.c:58:32: note: expanded from macro 'IF_EXCLUSIVE'
#  define IF_EXCLUSIVE(yes,no) yes
                               ^~~
matrixio.c:837:28: warning: comparison of integers of different signs: 'hsize_t'
      (aka 'unsigned long long') and 'int' [-Wsign-compare]
               CHECK(dims_copy[i] == dims[i],
                     ~~~~~~~~~~~~ ^  ~~~~~~~
./../util/check.h:37:12: note: expanded from macro 'CHECK'
     if (!(condition))  { \
           ^~~~~~~~~
5 warnings generated.
  AR       libmatrixio.a
Making all in maxwell
  CC       libmaxwell_la-maxwell.lo
  CC       libmaxwell_la-maxwell_constraints.lo
  CC       libmaxwell_la-maxwell_eps.lo
maxwell_eps.c:180:12: warning: unused function 'sym_matrix_eq'
      [-Wunused-function]
static int sym_matrix_eq(symmetric_matrix V1, symmetric_matrix V2, double tol)
           ^
1 warning generated.
  CC       libmaxwell_la-maxwell_op.lo
maxwell_op.c:163:12: warning: unused variable 'rarray_in' [-Wunused-variable]
     real *rarray_in = (real *) array_in;
           ^
maxwell_op.c:165:12: warning: unused variable 'rarray_out' [-Wunused-variable]
     real *rarray_out = (real *) array_out;
           ^
maxwell_op.c:577:50: warning: unused parameter 'd' [-Wunused-parameter]
void maxwell_vectorfield_otherhalf(maxwell_data *d, scalar_complex *field,
                                                 ^
maxwell_op.c:577:69: warning: unused parameter 'field' [-Wunused-parameter]
void maxwell_vectorfield_otherhalf(maxwell_data *d, scalar_complex *field,
                                                                    ^
maxwell_op.c:578:13: warning: unused parameter 'phasex' [-Wunused-parameter]
                                   real phasex, real phasey, real phasez)
                                        ^
maxwell_op.c:578:26: warning: unused parameter 'phasey' [-Wunused-parameter]
                                   real phasex, real phasey, real phasez)
                                                     ^
maxwell_op.c:578:39: warning: unused parameter 'phasez' [-Wunused-parameter]
                                   real phasex, real phasey, real phasez)
                                                                  ^
maxwell_op.c:781:51: warning: unused parameter 'd' [-Wunused-parameter]
void maxwell_cscalarfield_otherhalf(maxwell_data *d, scalar_complex *field,
                                                  ^
maxwell_op.c:781:70: warning: unused parameter 'field' [-Wunused-parameter]
void maxwell_cscalarfield_otherhalf(maxwell_data *d, scalar_complex *field,
                                                                     ^
maxwell_op.c:782:14: warning: unused parameter 'phasex' [-Wunused-parameter]
                                    real phasex, real phasey, real phasez)
                                         ^
maxwell_op.c:782:27: warning: unused parameter 'phasey' [-Wunused-parameter]
                                    real phasex, real phasey, real phasez)
                                                      ^
maxwell_op.c:782:40: warning: unused parameter 'phasez' [-Wunused-parameter]
                                    real phasex, real phasey, real phasez)
                                                                   ^
maxwell_op.c:982:50: warning: unused parameter 'd' [-Wunused-parameter]
void maxwell_scalarfield_otherhalf(maxwell_data *d, real *field)
                                                 ^
maxwell_op.c:982:59: warning: unused parameter 'field' [-Wunused-parameter]
void maxwell_scalarfield_otherhalf(maxwell_data *d, real *field)
                                                          ^
14 warnings generated.
  CC       libmaxwell_la-maxwell_pre.lo
  CCLD     libmaxwell.la
  CCLD     libmpb.la
Making all in tests
  CC       malloctest.o
  CCLD     malloctest
  CC       blastest.o
  CCLD     blastest
  CC       eigs_test.o
eigs_test.c:248:51: warning: unused parameter 'data' [-Wunused-parameter]
void Aop(evectmatrix Xin, evectmatrix Xout, void *data,
                                                  ^
eigs_test.c:249:7: warning: unused parameter 'is_current_eigenvector'
      [-Wunused-parameter]
         int is_current_eigenvector, evectmatrix Work)
             ^
eigs_test.c:249:43: warning: unused parameter 'Work' [-Wunused-parameter]
         int is_current_eigenvector, evectmatrix Work)
                                                 ^
eigs_test.c:258:54: warning: unused parameter 'data' [-Wunused-parameter]
void Ainvop(evectmatrix Xin, evectmatrix Xout, void *data,
                                                     ^
eigs_test.c:259:18: warning: unused parameter 'Y' [-Wunused-parameter]
            evectmatrix Y, real *eigenvals, sqmatrix YtY)
                        ^
eigs_test.c:259:27: warning: unused parameter 'eigenvals' [-Wunused-parameter]
            evectmatrix Y, real *eigenvals, sqmatrix YtY)
                                 ^
eigs_test.c:259:47: warning: unused parameter 'YtY' [-Wunused-parameter]
            evectmatrix Y, real *eigenvals, sqmatrix YtY)
                                                     ^
eigs_test.c:269:55: warning: unused parameter 'data' [-Wunused-parameter]
void Cop_old(evectmatrix Xin, evectmatrix Xout, void *data,
                                                      ^
eigs_test.c:270:15: warning: unused parameter 'Y' [-Wunused-parameter]
         evectmatrix Y, real *eigenvals, sqmatrix YtY)
                     ^
eigs_test.c:270:24: warning: unused parameter 'eigenvals' [-Wunused-parameter]
         evectmatrix Y, real *eigenvals, sqmatrix YtY)
                              ^
eigs_test.c:294:51: warning: unused parameter 'data' [-Wunused-parameter]
void Cop(evectmatrix Xin, evectmatrix Xout, void *data,
                                                  ^
eigs_test.c:295:16: warning: unused parameter 'Y' [-Wunused-parameter]
          evectmatrix Y, real *eigenvals, sqmatrix YtY)
                      ^
12 warnings generated.
  CCLD     eigs_test
  CC       maxwell_test.o
  CCLD     maxwell_test
  CC       normal_vectors.o
normal_vectors.c:128:6: error: use of undeclared identifier 'material_type'
     material_type m = { 0 };
     ^
normal_vectors.c:133:24: error: use of undeclared identifier 'm'
              o = make_sphere(m, c, myurand(0.5,1.5));
                              ^
normal_vectors.c:136:26: error: use of undeclared identifier 'm'
              o = make_cylinder(m, c, myurand(0.5,1.5), myurand(0.5,1.5),
                                ^
normal_vectors.c:140:22: error: use of undeclared identifier 'm'
              o = make_cone(m, c, myurand(0.5,1.5), myurand(0.5,1.5),
                            ^
normal_vectors.c:144:23: error: use of undeclared identifier 'm'
              o = make_block(m, c, 
                             ^
normal_vectors.c:153:27: error: use of undeclared identifier 'm'
              o = make_ellipsoid(m, c, 
                                 ^
6 errors generated.
make[2]: *** [normal_vectors.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I've searched through similar problems of other users, but I haven't resolved the problem. Do you have any suggestions?

Thank you for your time,
Konstantinos Paschaloudis

Inputting dielectric contant

How do I specify the dielectric constant of the medium? what if I want to fill my structure with some other material?

FCC

Dear Steven

Considering angle -dependence bandstructure problem, I read the section you suggested ,"(See the section on refraction in chapter 10 of http://ab-initio.mit.edu/book/)". To simply the problem, I have considered an specific direction ( like an incident light at specific (Tetha , Phi)). I chose Gamma-W direction and sweep k-point along a plane in this direction inside the BZ. After obtaining the eignfrequencies (w), I have applied the condition

K_||= nw*sin(tetha)/c

K_|| is the horizontal component of k vectors which have been sweeped on the palne inside the BZ. Is the approach correct ?
But I did not get the result yet. I am not sure what point I am missing.

Cheers

material-func does not take µ values

Dear Steven,

I found that geometries defined by material-func is not compatible with the \mu material definition.
All materials defined this way have \mu = 1.

segmentation fault

I have installed mpb-1.4.2 at a linux (redHat) server (HP ProLiant 64b), but when I tried to run the examples (.ctl files) I get always the erros message: Segmentation fault. Only with number of bands equal to 1, I get results without errors.

Does not build with `--with-inv-symmetry`

I'm trying to build latest MPB 1.6-dev (Latest commit 7a96dd0 on Apr 28) with:

  • gcc (SUSE Linux) 4.8.5
  • Open MPI 1.10.3
  • OpenBLAS-0.2.19 (built with GNU Fortran (SUSE Linux) 4.8.5)
  • HDF5 1.10.1 (built with MPI enabled with the above compilers)
  • guile 2.2.2
  • libctl 3.2.2
  • FFTW 3.3.6-pl2 (built with MPI enabled with the above compilers)

The serial build and MPI build without using --with-inv-symmetry build fine and pass the make check tests, but make fails when --with-inv-symmetry is specified with the output shown below (serial version):

make  all-recursive
make[1]: Entering directory '/hmi/hsa/tarballs/mpb'
Making all in src
make[2]: Entering directory '/hmi/hsa/tarballs/mpb/src'
cp -f mpbconf.h mpbi.h
make  all-recursive
make[3]: Entering directory '/hmi/hsa/tarballs/mpb/src'
Making all in util
make[4]: Entering directory '/hmi/hsa/tarballs/mpb/src/util'
make  all-am
make[5]: Entering directory '/hmi/hsa/tarballs/mpb/src/util'
  CC       debug_malloc.lo
  CC       mpi_utils.lo
mpi_utils.c: In function 'mpi_begin_critical_section':
mpi_utils.c:186:15: warning: unused variable 'status' [-Wunused-variable]
    MPI_Status status;
               ^
mpi_utils.c: In function 'mpi_end_critical_section':
mpi_utils.c:194:35: warning: unused parameter 'tag' [-Wunused-parameter]
 void mpi_end_critical_section(int tag)
                                   ^
  CCLD     libutil.la
  CC       sphere-quad.o
  CCLD     sphere_quad
make[5]: Leaving directory '/hmi/hsa/tarballs/mpb/src/util'
make[4]: Leaving directory '/hmi/hsa/tarballs/mpb/src/util'
Making all in matrices
make[4]: Entering directory '/hmi/hsa/tarballs/mpb/src/matrices'
  CC       libmatrices_la-blasglue.lo
In file included from blasglue.c:40:0:
blasglue.c:72:28: error: conflicting types for 'dgeev_'
 #  define FR(x,X) F77_FUNC(d##x, D##X)
                            ^
../../config.h:22:29: note: in definition of macro 'F77_FUNC'
 #define F77_FUNC(name,NAME) name ## _
                             ^
blasglue.c:121:13: note: in expansion of macro 'FR'
 extern void FR(geev,GEEV) (char *jobvl, char *jobvr, int *n,
             ^
blasglue.c:62:29: note: previous declaration of 'dgeev_' was here
 #    define F(x,X) F77_FUNC(d##x, D##X)
                             ^
../../config.h:22:29: note: in definition of macro 'F77_FUNC'
 #define F77_FUNC(name,NAME) name ## _
                             ^
blasglue.c:117:13: note: in expansion of macro 'F'
 extern void F(geev,GEEV) (char *jobvl, char *jobvr, int *n,
             ^
blasglue.c: In function 'lapackglue_geev':
blasglue.c:338:20: warning: passing argument 14 of 'dgeev_' from incompatible pointer type [enabled by default]
                    work, &lwork, rwork, &info);
                    ^
In file included from blasglue.c:40:0:
blasglue.c:72:28: note: expected 'int *' but argument is of type 'real *'
 #  define FR(x,X) F77_FUNC(d##x, D##X)
                            ^
../../config.h:22:29: note: in definition of macro 'F77_FUNC'
 #define F77_FUNC(name,NAME) name ## _
                             ^
blasglue.c:121:13: note: in expansion of macro 'FR'
 extern void FR(geev,GEEV) (char *jobvl, char *jobvr, int *n,
             ^
blasglue.c:338:20: error: too many arguments to function 'dgeev_'
                    work, &lwork, rwork, &info);
                    ^
In file included from blasglue.c:40:0:
blasglue.c:72:28: note: declared here
 #  define FR(x,X) F77_FUNC(d##x, D##X)
                            ^
../../config.h:22:29: note: in definition of macro 'F77_FUNC'
 #define F77_FUNC(name,NAME) name ## _
                             ^
blasglue.c:121:13: note: in expansion of macro 'FR'
 extern void FR(geev,GEEV) (char *jobvl, char *jobvr, int *n,
             ^
Makefile:404: recipe for target 'libmatrices_la-blasglue.lo' failed
make[4]: *** [libmatrices_la-blasglue.lo] Error 1
make[4]: Leaving directory '/hmi/hsa/tarballs/mpb/src/matrices'
Makefile:536: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/hmi/hsa/tarballs/mpb/src'
Makefile:392: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/hmi/hsa/tarballs/mpb/src'
Makefile:409: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/hmi/hsa/tarballs/mpb'
Makefile:340: recipe for target 'all' failed
make: *** [all] Error 2

Building http://ab-initio.mit.edu/mpb/mpb-1.5.tar.gz from April 2, 2014 using --with-inv-symmetry works. The changes made to blasglue.c with commit 4041c4a on May 13, 2016 seem to be relevant.

I'm attaching my config.h just in case: config.h.txt

mpb-mpi fails to execute find-k

Dear All,

May be it is a bug, may be not. However, all copies of MPB installed on my computers are affected.

When I run MPB as "mpirun -np 1 mpb-mpi strip.ctl" it executes well and produces expected results.

However, when I try to use two or more nodes by running "mpirun -np 2 mpb-mpi strip.ctl" or "mpirun -np 3 mpb-mpi strip.ctl", MPB interrupts and throws out the error message:

Solving for bands 1 to 4...
CHECK failure on line 233 of maxwell_op.c: Failure creating FFTW3 plans
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
CHECK failure on line 233 of maxwell_op.c: Failure creating FFTW3 plans
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 1

= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= EXIT CODE: 1
= CLEANING UP REMAINING PROCESSES

= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

Best wishes

pavlo

ps:

  1. MPI version of MPB has been build in the way suggested in MPB installation instructions.
  2. mpb-mpi --version returns
    mpb_mpi 1.5, Copyright (C) 1999-2012, MIT
    Using libctl 3.2.2 and Guile 2.0.9.
  3. Reproduced on Ubuntu 13.10, Centos 6.5, Centos 7, Scientific Linux 6.5. Other systems are likely affected.
  4. mpirun -info
    HYDRA build details:
    Version: 3.0.4
  5. FFTW versions 2.1.5 and 3.3.4 have been build with MPI support
  6. gcc --version
    gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)

(dot-eigenvectors ...) changes eigenvectors when mu_inv != null

Calling (dot-eigenvectors ev band-start) for some set of eigenvectors ev appears to effect a change to the computed eigenvectors when mu_inv is not null (i.e. when μ1, equivalently when BH).
Accordingly, after calling (dot-eigenvectors ...) in a μ1 case, subsequent calls to e.g. (get-eigenvector ...) yield unpredictable results. This does not happen when μ = 1.

The issue is illustrated by the (unfortunately, somewhat lengthy) example below:

(use-modules (ice-9 format)) ; allow control of print output formatting

; ----- basic, shared properties of both calculations (square lattice)
(set! geometry-lattice (make lattice (size 1 1 no-size)
                         (basis1 1 0)
                         (basis2 0 1)))

(set! k-points (list (vector3 0.125 0.125 0))) ; arbitrary k-point

(set! resolution 32)
(set! num-bands 6)

; ----- mu = 1 calculation & overlaps
(define matprops (make dielectric (epsilon 13)))
(set! geometry (list (make cylinder (center 0 0 0)
                                    (radius 0.13)
                                    (height infinity)
                                    (material matprops))))

(run-tm)

(define overlaps1 (dot-eigenvectors (get-eigenvectors 1 num-bands) 1))
(define overlaps2 (dot-eigenvectors (get-eigenvectors 1 num-bands) 1))

; ----- mu \noteq 1 calculation & overlaps
(define matprops (make medium-anisotropic (epsilon-diag 13 13 13)
                                          (epsilon-offdiag 0 0 0)
                                          (mu-diag 1 1 1)
                                          (mu-offdiag 0+0.40i 0 0)))
(set! geometry (list (make cylinder (center 0 0 0)
                                    (radius 0.13)
                                    (height infinity)
                                    (material matprops))))
(run-tm)

(define overlaps-mu1 (dot-eigenvectors (get-eigenvectors 1 num-bands) 1))
(define overlaps-mu2 (dot-eigenvectors (get-eigenvectors 1 num-bands) 1))


; ----- function for printing magnitude of sqmatrix object neatly
(define (print-sqmatrix-magnitude matrix size)
        (map (lambda (i1)
                (map (lambda (i2)
                        (print (format #f "~10,2,2g" (magnitude (sqmatrix-ref matrix i1 i2)) ", "))
                     ) (iota size))
                (print "\n")
             ) (iota size))
)
; ----- test orthonormalization, i.e. that <Bi|Hj>=delta_ij
(print "\n--- In the case mu = 1, dot-eigenvectors works perfectly ---\n")
(print "1st call:\n") (print-sqmatrix-magnitude overlaps1 num-bands)
(print "2nd call:\n") (print-sqmatrix-magnitude overlaps2 num-bands) (print "\n")

(print "\n--- In the case mu \\noteq 1, dot-eigenvectors CHANGES the  ---\n"
         "--- eigenvectors - subsequent calls to dot-eigenvectors do ---\n"
         "--- not yield the same results:                            ---\n")
(print "1st call:\n") (print-sqmatrix-magnitude overlaps-mu1 num-bands)
(print "2nd call:\n") (print-sqmatrix-magnitude overlaps-mu2 num-bands)

which yields the results (which are wrong only in the second call to (dot-eigenvectors ...) in the μ1 case)

--- In the case mu = 1, dot-eigenvectors works perfectly ---
1st call:
  1.00      2.04E-14  2.29E-14  2.06E-14  7.40E-15  5.06E-15
  2.04E-14  1.00      3.01E-14  2.94E-14  1.82E-14  8.14E-14
  2.29E-14  3.01E-14  1.00      1.16E-14  1.64E-14  6.45E-14
  2.06E-14  2.94E-14  1.16E-14  1.00      2.48E-14  4.33E-14
  7.40E-15  1.82E-14  1.64E-14  2.48E-14  1.00      5.70E-14
  5.06E-15  8.14E-14  6.45E-14  4.33E-14  5.70E-14  1.00
2nd call:
  1.00      2.04E-14  2.29E-14  2.06E-14  7.40E-15  5.06E-15
  2.04E-14  1.00      3.01E-14  2.94E-14  1.82E-14  8.14E-14
  2.29E-14  3.01E-14  1.00      1.16E-14  1.64E-14  6.45E-14
  2.06E-14  2.94E-14  1.16E-14  1.00      2.48E-14  4.33E-14
  7.40E-15  1.82E-14  1.64E-14  2.48E-14  1.00      5.70E-14
  5.06E-15  8.14E-14  6.45E-14  4.33E-14  5.70E-14  1.00


--- In the case mu \noteq 1, dot-eigenvectors CHANGES the  ---
--- eigenvectors - subsequent calls to dot-eigenvectors do ---
--- not yield the same results:                            ---
1st call:
  1.00      9.66E-14  5.49E-14  5.42E-14  8.08E-14  7.39E-14
  9.67E-14  1.00      4.40E-13  1.33E-13  4.62E-13  2.18E-13
  5.49E-14  4.40E-13  1.00      5.60E-13  5.20E-13  4.44E-13
  5.42E-14  1.33E-13  5.60E-13   1.0      6.79E-13  5.78E-13
  8.08E-14  4.62E-13  5.20E-13  6.79E-13   1.0      2.95E-13
  7.39E-14  2.18E-13  4.44E-13  5.78E-13  2.95E-13   1.0
2nd call:                                                      <<< (issue here)
   1.0      9.36E-03  6.81E-02  9.62E-02  5.95E-02  8.86E-03   <<< (issue here)
  9.36E-03   1.1      6.49E-02  4.65E-02  3.46E-02  5.02E-02   <<< (issue here) 
  6.81E-02  6.49E-02  0.89      0.10      2.74E-02  3.31E-02   <<< (issue here)
  9.62E-02  4.65E-02  0.10       1.4      0.22      0.11       <<< (issue here)
  5.95E-02  3.46E-02  2.74E-02  0.22       1.1      4.07E-02   <<< (issue here)
  8.86E-03  5.02E-02  3.31E-02  0.11      4.07E-02   1.1       <<< (issue here)

Another consequence is that calling e.g. (get-bfield ...) or (get-hfield ...) after calling (dot-eigenvectors ...) will differ from calling them before (dot-eigenvectors ...).

I imagine the fix must lie somewhere in lines 293-319 of matrix-smob.c but, after much staring, I haven't been able to see what would cause this.

(In principle, I could make do with (integrate-fields ...), (get-hfield ...), & (get-bfield ...) combinations, but they are quite a bit slower)

Thanks!

python configuration option not recognised by mkdocs

When running mkdocs serve (mkdocs 0.17.5) I'm getting a warning:

WARNING -  Config value: 'python'. Warning: Unrecognised configuration name: python 

Is this option used anywhere? Perhaps it was deprecated and changed name?

support x parity constraints

Right now we only support y and z parity. The reason for this is that, on distributed-memory machines, the x dimension is distributed and doing the parity constraint is painful because it requires communication.

However, it would be straightforward to implement an x-parity constraint that worked only in serial mode and gave an error for parallel calculations.

The relevant code for y and z parity is in:

https://github.com/stevengj/mpb/blob/master/src/maxwell/maxwell_constraints.c

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.