Re: [Meep-discuss] Puzzling results for reflection spectrum

2015-02-10 Thread Gib Bogle
Hi Filip,

Thanks for your response.  This is how the run is carried out:

(run-sources+
(stop-when-fields-decayed 
50 
Ez
(vector3 0 0 (- 0 z_plane_src))
1.0e3
)
)

It looks to me as if the simulation ends as soon as the pulse ends, and the 
actual duration of the simulation is the same in the two cases (with and 
without the antenna).   This is what the output shows at the end:
...
on time step 1997 (time=49.925), 3.06965 s/step
on time step 1999 (time=49.975), 3.04618 s/step
field decay(t = 50.025): 0.00198287709153593 / 0.00198287709153593 = 1.0
run 0 finished at t = 50.025 (2001 timesteps)
creating output file "./metal-reflected-flux.h5"...

Since there is only the simple metal scatterer, with absorbing boundaries all 
around, I do not believe there are any resonances.

From: Filip Dominec [filip.domi...@gmail.com]
Sent: Wednesday, 11 February 2015 10:49 a.m.
To: Gib Bogle
Cc: meep-discuss@ab-initio.mit.edu
Subject: Re: [Meep-discuss] Puzzling results for reflection spectrum

Hi, if you properly divide the reflected amplitude by the incident
amplitude, the reflection of a linear system should indeed be the
same, independent of the source duration and spectrum.
If it is not, one possible cause may be that you clip the time record
while the source was still running, or the structure was still
retaining some energy in resonances. What happens if you run the
simulation for 2x and 3x longer time?
Filip

2015-02-10 22:30 GMT+01:00, Gib Bogle :
> I am getting puzzling inconsistencies between results for the reflection
> spectrum of a scatterer when I vary the width of the Gaussian pulse.  Since
> I am a beginner this probably stems from my lack of understanding of
> something.
>
> The scattering antenna is a metal loop with a small gap (i.e. the loop is
> not closed).  The conductor cross-section is rectangular, 0.2 wide and 0.1
> thick (all Meep units).  The inner radius is 0.868, and the gap is 0.2.  The
> antenna lies in the xy plane, centred at the origin.
>
> The region size is 4p x 4p x 6p, where p=6, and the PML thickness is p.  The
> plane wave source is located at the lower edge of the PML, i.e. at z = -2p,
> and the flux plane is at z = -p, halfway between the wave source and the
> antenna.  The frequency I am interested in is 5.5 GHz, i.e. a Meep frequency
> of 0.1833 with a Meep unit distance of 0.01m.  This corresponds to a Meep
> wavelength of 5.456, which explains why I am using p=6.
>
> I am using resolution=20.  The Gaussian pulse that is exciting the
> reflection has a centre frequency of 0.1833, and I have simulated various
> pulse widths, always with nfreq=100.  With df=0.1 the reflection spectrum
> has a well-defined minimum at (0.139, 1.3E-06), and a flat local minimum at
> (0.181, 8.35E-6).  With df=0.2 there is just a very flat minimum at (0.178,
> 1.97E-6), and with df=0.3 a minimum at (0.1, 1.61E-6).  Zooming in with
> df=0.05 shows just the local minimum at (0.183, 8.4E-6), more like a point
> of inflection.
>
> Are these results surprising?  Am I making an obvious mistake?  I would be
> grateful for guidance.
>
> Thanks
> Gib
>

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


Re: [Meep-discuss] Gaissian Distribution of Phase

2015-02-10 Thread Filip Dominec
Hi, currently I do not have the example you mention, but surely you
can make a focused beam from an oblique beam, by introducing a
*quadratic* term into the imaginary part of the exponential that
defines the source amplitude.
If you wish to build a focused *gaussian* beam, you will also wish to
modify the amplitude in the exponent.
Filip


2015-01-07 13:05 GMT+01:00, Yousuf Khan :
> Dear Steven and meep users,
> I already saw some examples of oblique source by introducing a phase shift
> in source function. Is it possible to construct a focused source by Gaussian
> distribution of phase ? If yes, can anybody give an example
> please. Regards,
> Yousuf Khan

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


Re: [Meep-discuss] Puzzling results for reflection spectrum

2015-02-10 Thread Filip Dominec
Hi, if you properly divide the reflected amplitude by the incident
amplitude, the reflection of a linear system should indeed be the
same, independent of the source duration and spectrum.
If it is not, one possible cause may be that you clip the time record
while the source was still running, or the structure was still
retaining some energy in resonances. What happens if you run the
simulation for 2x and 3x longer time?
Filip

2015-02-10 22:30 GMT+01:00, Gib Bogle :
> I am getting puzzling inconsistencies between results for the reflection
> spectrum of a scatterer when I vary the width of the Gaussian pulse.  Since
> I am a beginner this probably stems from my lack of understanding of
> something.
>
> The scattering antenna is a metal loop with a small gap (i.e. the loop is
> not closed).  The conductor cross-section is rectangular, 0.2 wide and 0.1
> thick (all Meep units).  The inner radius is 0.868, and the gap is 0.2.  The
> antenna lies in the xy plane, centred at the origin.
>
> The region size is 4p x 4p x 6p, where p=6, and the PML thickness is p.  The
> plane wave source is located at the lower edge of the PML, i.e. at z = -2p,
> and the flux plane is at z = -p, halfway between the wave source and the
> antenna.  The frequency I am interested in is 5.5 GHz, i.e. a Meep frequency
> of 0.1833 with a Meep unit distance of 0.01m.  This corresponds to a Meep
> wavelength of 5.456, which explains why I am using p=6.
>
> I am using resolution=20.  The Gaussian pulse that is exciting the
> reflection has a centre frequency of 0.1833, and I have simulated various
> pulse widths, always with nfreq=100.  With df=0.1 the reflection spectrum
> has a well-defined minimum at (0.139, 1.3E-06), and a flat local minimum at
> (0.181, 8.35E-6).  With df=0.2 there is just a very flat minimum at (0.178,
> 1.97E-6), and with df=0.3 a minimum at (0.1, 1.61E-6).  Zooming in with
> df=0.05 shows just the local minimum at (0.183, 8.4E-6), more like a point
> of inflection.
>
> Are these results surprising?  Am I making an obvious mistake?  I would be
> grateful for guidance.
>
> Thanks
> Gib
>

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] Puzzling results for reflection spectrum

2015-02-10 Thread Gib Bogle
I am getting puzzling inconsistencies between results for the reflection 
spectrum of a scatterer when I vary the width of the Gaussian pulse.  Since I 
am a beginner this probably stems from my lack of understanding of something.

The scattering antenna is a metal loop with a small gap (i.e. the loop is not 
closed).  The conductor cross-section is rectangular, 0.2 wide and 0.1 thick 
(all Meep units).  The inner radius is 0.868, and the gap is 0.2.  The antenna 
lies in the xy plane, centred at the origin.

The region size is 4p x 4p x 6p, where p=6, and the PML thickness is p.  The 
plane wave source is located at the lower edge of the PML, i.e. at z = -2p, and 
the flux plane is at z = -p, halfway between the wave source and the antenna.  
The frequency I am interested in is 5.5 GHz, i.e. a Meep frequency of 0.1833 
with a Meep unit distance of 0.01m.  This corresponds to a Meep wavelength of 
5.456, which explains why I am using p=6.

I am using resolution=20.  The Gaussian pulse that is exciting the reflection 
has a centre frequency of 0.1833, and I have simulated various pulse widths, 
always with nfreq=100.  With df=0.1 the reflection spectrum has a well-defined 
minimum at (0.139, 1.3E-06), and a flat local minimum at (0.181, 8.35E-6).  
With df=0.2 there is just a very flat minimum at (0.178, 1.97E-6), and with 
df=0.3 a minimum at (0.1, 1.61E-6).  Zooming in with df=0.05 shows just the 
local minimum at (0.183, 8.4E-6), more like a point of inflection.

Are these results surprising?  Am I making an obvious mistake?  I would be 
grateful for guidance.

Thanks
Gib
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] h5utils writepng compile problem with libpng15

2015-02-10 Thread Tom Dodson
Gib,

There is a patch that has been distributed for this, if you'd like to
compare notes, see here (towards the bottom):
https://www.mail-archive.com/meep-discuss@ab-initio.mit.edu/msg05241.html

Tom

On Mon, Jan 19, 2015 at 6:26 PM, Gib Bogle  wrote:

> It took me a while to track down the fix for the error: "dereferencing
> pointer to incomplete type" when compiling h5topng.c with libpng version >=
> 15.  I realize that this has been solved before, but the relevant messages
> are buried and not easily decyphered.  I am posting this to save another
> from wasting as much time on it as I did.
>
> There was a change in libpng, at version 15 I believe, that makes two lines
> in writepng.c fail.  This is how I fixed the errors (not necessarily the
> only ways):
>
> about line 312:
>  //  if (setjmp(png_ptr->jmpbuf)) {
>  if (setjmp(png_jmpbuf(png_ptr))) {
>
> about line 437:
> //   free(info_ptr->palette);
>  png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, -1);
>
> I hope this is useful.
>
> Gib
>
>
> ___
> meep-discuss mailing list
> meep-discuss@ab-initio.mit.edu
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] Black images - HDFView, and possible output phase error in Meep.

2015-02-10 Thread Tom Dodson
Steve,

I know this is about two months late, but for some reason, the meep list
just dumped a half-dozen emails in my inbox...

This is of possible interest:
https://www.mail-archive.com/meep-discuss@ab-initio.mit.edu/msg05241.html

Tom

On Wed, Dec 3, 2014 at 6:30 PM, Steve  wrote:

> Dear Steven and Meep users.
>
> I ran a short 3-d simulation with an Ez source, outputting the eps file
> and all 6 fields  - ex, ey, ez, hx, hy, and hz - at the end of the run.
> I used a single processor and did not use symmetry of any sort.
>
> Running H5topng on slices (-x 0:1:14) seemed to work but all of the
> field PNG images were Black. The h5topng .png slice images of the eps.h5
> file were white showing nothing.
>
> I looked at the .h5 files using HDFView, opening the files as image, ran
> the animation feature, and observed some very nice field images in all
> of the files, and also found that the eps.h5 file was complete.
>
> I used these commands,
> ; h5topng -x 0:1:14 -c -yarg -m1 -M12 ./cone-out/eps-00.00.h5
> ; h5topng -x 0:1:14 -R -Zc dkbluered -a yarg
> -A  ./cone-out/eps-00.00.h5 ./cone-out/ez-10.00.h5
>
>  Does anyone see an error or incompatibility in the options I used?
>
> The other thing I noticed when using HDFView to look at the field files
> is that the fields - ey, hx and hz - change phase along a vertical. That
> is, where the fields are black and white on the left side, they are
> white and black on the right side.
>
> I suspect a bug in the Meep processing of these field outputs. If
> necessary, I can provide a test control file to reproduce this
> condition.
>
> Steve
>
>
>
> ___
> meep-discuss mailing list
> meep-discuss@ab-initio.mit.edu
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] how to define a invariable complex refractive index?

2015-02-10 Thread Filip Dominec
Dear Liu,
from the principle of FDTD computation, there is no other way how to
define complex refractive index than to include dispersion. Either you
may introduce a Drude term (conductivity), or some high-frequency
Lorentzian.
More details are here:
http://ab-initio.mit.edu/wiki/index.php/Material_dispersion_in_Meep
Filip

2014-12-06 13:47 GMT, liu :
> Hi, everyone,
>
>
> 1) I want to define a wavelength independent complex refractive index in
>
>
> meep, for example, n= 5+0.05i. Because I just want to simulate the
> absorption
>
>
> of the materials, so we do not need Drude model. But how to define it in
>
>
> meep?
>
>
>
>
> 2) Can meep calculate two-photon absorption? how to define the two-photon
> absorption parameters?
>
>
>
>
> Thank you!
>
>
>
>
>
>

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


Re: [Meep-discuss] meep and python-meep on OS-X

2015-02-10 Thread Filip Dominec
Thank you, Glenn, great job.
I will be happy to add a link to your post!
Filip

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] meep and python-meep on OS-X

2015-02-10 Thread glenn
Hi all,

I started out trying meep on Linux to see if it would do what I wanted. At 
first, I used the Scheme interface, but didn’t like it, so I followed the 
instructions at http://www.fzu.cz/~dominecf/meep/index.html 
 to install the python interface. 
That works well, but my main OS is OS-X (Yosemite), so I worked at getting 
python-meep working in that environment.This post details how I went about 
getting that to work. In the end, I had an rich environment that I’m familiar 
with and I don’t have to boot back and forth between OSes as I do my day’s 
work. As a bonus, meep executes slightly faster on the identical hardware! 

First, install Xcode from the App Store and command line tools using the 
terminal: xcode-select --install

Next, install home-brew:

ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install 
)"

Finish the homebrew installation with:
brew doctor
brew update

Install packages needed to build meep:
brew install guile
brew install —with-mpi homebrew/science/hdf5
brew install homebrew/science/openblas fftw h5utils
brew install pkg-config
brew install swig
brew install automake
brew install autoconf

Log in as a user with admin privileges. 

Download libctl library from ab-initio: 
http://ab-initio.mit.edu/libctl/libctl-3.2.2.tar.gz 
.

Unpack that, cd into libctl-3.2.2 and do the usual 
./configure 
make 
sudo make install

Get meep from github: 
git clone https://github.com/stevengj/meep 


In the cloned code (on 2/1/15), some files needed to be modified to get swig to 
work properly. Specifically, the cloned libctl/Makefile.am caused broken 
libctl/meep_swig_bug_workaround.i, libctl/meep_enum_renames.i and 
libctl/meep_renames.i to be created.

To fix that I modified two lines in libctl/Makefile.am:
the line after “meep_swig_bug_workaround.i: $(LIBHDRS)” was changed from
-> (echo "// AUTOMATICALLY GENERATED -- DO NOT EDIT"; grep -h friend 
$(LIBHDRS) | sed 's/^ *friend \+[A-Za-z_0-9:<>]\+[* ]\+\([A-Za-z_0-9:]*\) 
*(.*$$/%ignore \1;/' | grep "%ignore" | sort -u;) > $@
to
-> (echo "// AUTOMATICALLY GENERATED -- DO NOT EDIT"; grep -h friend 
$(LIBHDRS) | sed 's/^ *friend  *[[:alpha:]_][[:alnum:]_]*  
*\([[:alpha:]_][[:alnum:]_]*\) *(.*/%ignore \1;/' | grep "%ignore" | sort -u;) 
> $@
the line after “meep_enum_renames.i: $(LIBHDRS)” was changed from
-> (echo "// AUTOMATICALLY GENERATED -- DO NOT EDIT"; for f in 
$(LIBHDRS); do egrep "^enum" $$f | sed 's/enum \+\([A-Za-z_0-9:]\+\).*$$/\1/g' 
| while read enum; do cat $$f | tr -d '\n' | sed 's/.*enum \+'$${enum}' 
*{\([^}]*\)}.*/\1/g' | sed 's/= *[0-9]\+//g' |tr -d ' \t' | tr ',' '\n' | sed 
's/^.*$$/'"%rename(meep_$${enum}_\0) meep::\0;/g"; echo; done; done;) > $@
to
-> (echo "// AUTOMATICALLY GENERATED -- DO NOT EDIT";for f in 
$(LIBHDRS); do egrep "^enum" $$f | sed 's/enum  *\([^}][^}]*\).*};/\1/g' | tr 
-d "{" | sed 's/, */ /g' | sed 's/ *= *[[:digit:]][[:digit:]]*//g'| while read 
-a array; do varname=$${array[0]};unset "array[0]";for varvalue in 
$${array[@]};do echo "%rename(meep_$${varname}_$$varvalue) meep::$$varvalue;"; 
done;done;done;) > $@

That resulted in good libctl/meep_swig_bug_workaround.i and 
libctl/meep_enum_renames.i when make was run, but to fix libctl/meep_renames.i, 
I punted and just copied that file over from a meep 1.2.1 distribution. 

For the instructions that follow, I used 
http://www.fzu.cz/~dominecf/meep/index.html 
 as a guide and made modifications 
to get things to work on OS-X.

Cd into meep and execute
export CFLAGS=" -fPIC"; export CXXFLAGS=" -fPIC"; export FFLAGS="-fPIC" 
export CPPFLAGS="-I/usr/local/include" 
export LD_RUN_PATH="/usr/local/lib"
./autogen.sh —-with-mpi --enable-maintainer-mode --enable-shared 
--prefix=/usr/local 
make  &&  sudo make install

That should take care of the basic meep, but I find it much more convenient to 
deal with Python than Scheme, so I installed python-meep, which started with a 
download of 
https://launchpad.net/python-meep/1.4/1.4/+download/python-meep-1.4.2.tar 
. 
The resulting files seemed to require some modification to install in 
/usr/local directories and to work properly:
in setup-mpi.py inserted after line 9: import numpy as np
in setup-mpi.py changed the last line to: 
include_dirs=includeDir+[np.get_include()]
in setup-mpi.py changed line 16 to: includeDir = ["/usr/local/include”]
in setup-mpi.py changed line 17 to: includeDir = ["/usr/local/lib”]

[Meep-discuss] Doubt regarding calculation of Q-factor(in-plane or out-of-plane)

2015-02-10 Thread #SHAMPY MANSHA#
Dear Steven and other MEEP users,


When using the harminv to calculate the Q-factors, are we calculating the 
in-plane or out-of-plane or overall Q-factor?

For example in calculation of Q-factor for ring resonator given in  the 
tutorial 
(http://ab-initio.mit.edu/wiki/index.php/Meep_Tutorial#Modes_of_a_ring_resonator)
 , are we calculating the in-plane or out-of-plane Q-factor or it gives the 
overall Q-factor?


Thanks

Shampy

NTU,Singapore

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Meep performance is typically bound by memory bandwidth; DIY Meep server or Amazon EC2

2015-02-10 Thread Robin Whittle
I read this article, which appears to be relevant to Meep and other
programs which pre-calculate the material parameters for each cell in
the simulation, and then read this from RAM during the simulation process.

  Performance of FDTD Method CPU Implementations for Simulation of
  Electromagnetic Processes
  Dmitry L. Markovich, Konstantin S. Ladutenko, and Pavel A. Belov
  Progress In Electromagnetics Research, Vol. 139, 655–670, 2013
  http://www.jpier.org/PIER/pier139/38.13031910.pdf

(It also mentions another approach, as used in the Lumerical FDTD
software, in which the material characteristics are calculated on the
fly, rather than stored, which uses less RAM and more CPU power.)

They show that the performance is bound primarily by the bandwidth
between the one or more CPU devices (whatever it is which plugs into a
socket - since it may contain one or two chips) and the main memory of
the machine - such as DDR3 RAM.  The number of cores, the computational
power of the cores, and likewise cache size and speed does not seem to
be so important.

With multi-socket motherboards and/or with "CPUs" (whatever it is which
plugs into a single socket) containing two chips, with their required
interconnect, I guess "memory bandwidth" would involving not just the
ability of a single "CPU" (or chip within a two chip Opteron G34 socket
"CPU") to read and write the 1 to 4 x 32 wide DDR3 DIMMs, but also the
ability of the cores in the various chips to use the interconnect to
read and write the memory which is connected to other chips.


In principle it would be possible to run the machine with a smaller
amount of RAM and use a massive swap file.  This would be very slow
indeed for conventional hard drives, even if they were exotic and
expensive.

It would be faster, though still much slower than with the required
amount of RAM) with the swap file on one or more SSDs (multiple SSDs in
RAID 0, I guess).  Since this would be driving the SSDs as fast as they
could go, writing a substantial fraction of the drive's capacity for
every time-cycle of simulation, I suspect the SSDs would only last a few
months.  For instance, an Intel 240GB SSD stops working after 700TB of
writes, which is only 3k writes to the entire capacity of the drive:


http://techreport.com/review/26523/the-ssd-endurance-experiment-casualties-on-the-way-to-a-petabyte


For those who are contemplating large simulations and don't have access
to a cluster, and who are thinking of what hardware to acquire (other
than building a cluster with as much total RAM as possible), one option
would be to find a motherboard which can accommodate a lot of RAM in
terms of sockets of 8GB, 16GB or 32GB DDR3 DIMMs, with as wide an
interface to that RAM as possible.

G34 socket Opterons drive four 32 bit DIMMs at once.  Some motherboards
have four sockets, with each Opteron (internally two chips each) driving
four channels of DIMMs, usually with 2 DIMM sockets per channel, for a
total of 32 sockets.  This means the bandwidth is 16 x 32 bits at
whatever speed the DIMMs run at.  The capacity of the motherboard would
then be 32 DIMM x 8 / 16 / 32GB = 256 / 512 / 1024 GB.  For instance:

  http://www.supermicro.com/Aplus/motherboard/Opteron6100/SR56x0/H8QGi-F.cfm

The 6100 series CPUs, such as with 8 cores, are inexpensive on eBay, at
least for the lower speed ones - and it seems that CPU speed is not the
limiting factor.

The cost of building a 512GB RAM system is probably $6k including MB,
CPUs and suitable power supply, since the RAM alone would be 32 x $120.
 A 1024GB system would be vastly more expensive, since I couldn't easily
find 32GB DDR3 for less than $578.  That would be a total of $20k.


Alternatively, the money could be spent on renting compute capacity,
such as Amazon EC2 r3.8xlarge with 244GB per server, 32 virtual CPUs (I
guess dual 8 core Xeon with hyperthreading) and 10G Ethernet:

  http://aws.amazon.com/ec2/instance-types/

These use 32nm E5-2670 Xeons running at 2.6GHz.  The cost is $2.80 per
hour.  There are newer "C4" instances intended for HPC, but the maximum
amount of memory per instance is 60GB.

If the Meep problem was partitioned correctly 2 x 2 x 2 to run on 8
servers, then this would provide, in theory, 244 x 8 = 1952GB for $22.40
an hour.

I am inclined to learn how to use Meep with a machine such as a dual
Xeon server with 48 or 64GB of RAM, and when I am more confident, scale
up the problem to run on Amazon or other servers.

  - Robin













___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Black images - HDFView, and possible output phase error in Meep.

2015-02-10 Thread Steve
Dear Steven and Meep users.

I ran a short 3-d simulation with an Ez source, outputting the eps file
and all 6 fields  - ex, ey, ez, hx, hy, and hz - at the end of the run.
I used a single processor and did not use symmetry of any sort.

Running H5topng on slices (-x 0:1:14) seemed to work but all of the
field PNG images were Black. The h5topng .png slice images of the eps.h5
file were white showing nothing.

I looked at the .h5 files using HDFView, opening the files as image, ran
the animation feature, and observed some very nice field images in all
of the files, and also found that the eps.h5 file was complete.

I used these commands,
; h5topng -x 0:1:14 -c -yarg -m1 -M12 ./cone-out/eps-00.00.h5
; h5topng -x 0:1:14 -R -Zc dkbluered -a yarg
-A  ./cone-out/eps-00.00.h5 ./cone-out/ez-10.00.h5

 Does anyone see an error or incompatibility in the options I used?
 
The other thing I noticed when using HDFView to look at the field files
is that the fields - ey, hx and hz - change phase along a vertical. That
is, where the fields are black and white on the left side, they are
white and black on the right side.

I suspect a bug in the Meep processing of these field outputs. If
necessary, I can provide a test control file to reproduce this
condition.

Steve



___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] how to define a invariable complex refractive index?

2015-02-10 Thread liu
Hi, everyone,


1) I want to define a wavelength independent complex refractive index in 


meep, for example, n= 5+0.05i. Because I just want to simulate the absorption 


of the materials, so we do not need Drude model. But how to define it in 


meep?




2) Can meep calculate two-photon absorption? how to define the two-photon 
absorption parameters?  




Thank you!


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Plane wave propagation through interface not satisfying Fresnel coefficients

2015-02-10 Thread Gupta, Ratnesh (GE Global Research, Consultant)
Hi all,

I tried simulating simple plane wave propagating from one material to another. 
The geometry is 2D. The interface is infinitely extended in the plane 
transverse to the direction of propagation. I used two block structures 
simulating the two materials with PML at the boundaries.

Since the angle of incidence is zero, most of the plane wave is expected to 
propagate right through the interface as the analytical calculation for Fresnel 
transmission is around 0.76. While the results shows that almost all the field 
is reflected back. Calculating the flux in the simulation showed the 
transmission to be 0.07.

Please Help!

Thanks.

Best regards,
Ratnesh
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] h5utils writepng compile problem with libpng15

2015-02-10 Thread Gib Bogle
It took me a while to track down the fix for the error: "dereferencing
pointer to incomplete type" when compiling h5topng.c with libpng version >=
15.  I realize that this has been solved before, but the relevant messages
are buried and not easily decyphered.  I am posting this to save another
from wasting as much time on it as I did.

There was a change in libpng, at version 15 I believe, that makes two lines
in writepng.c fail.  This is how I fixed the errors (not necessarily the
only ways):

about line 312:
 //  if (setjmp(png_ptr->jmpbuf)) {
 if (setjmp(png_jmpbuf(png_ptr))) {

about line 437:
//   free(info_ptr->palette);
 png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, -1);

I hope this is useful.

Gib


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] harminv with reflector

2015-02-10 Thread Sophia Fox

Hello,

So I have a dielectric block with a reflector at the base modelled as  
a PEC boundary condition and PMLs around the remaining sides of the  
block. On the top of the block is a periodic array of cylinders and  
the source is inside the block directly below the center cylinder and  
above the PEC. The source is an Ex gaussian dipole with df of 0.04.


So I want to look at resonances inside one of the cylinders and I use  
harminv to measure the Ex field inside the center of one cylinder. I  
make sure harminv is used after the sources are switched off i.e.  
(after-sources+ 300, and I measure the Ex field.


In the results, I get several resonances but some of the Q-factors are  
negative and quite large. The decay rate is larger than the error (by  
an order of 10). I will try increasing the resolution, running for  
longer time and turning on subpixel averaging but I have also read  
that manually setting the start-point can avoid this problem but I  
don't really know what I would set this to - I guess reflections off  
the PEC are causing some of this so should I set the start point to  
e.g. 100 timesteps after source has turned off if the other options do  
not work?


Thanks!
Sophia



___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] Resonant frequency different from analytical solution

2015-02-10 Thread Steve

Dear Steven and meep users,

I have modeled a simple cylindrical RF cavity resonator. Dimensions are
Length 0.1223642686 meters, Dia = 0.0754898000 meters using perfect
metal, and a characteristic length, a = 0.01. The TE 1,1,1 mode resonant
frequency analytical solution for this cavity is 2.45 GHz. Excited using
Ez and in cylindrical coordinates, Meep/Harminv calculates resonant
frequency as 1.87 GHz. WHY?

My lattice is large enough, my pml layer is large enough (Both are more
than double the minimum) and I get the same answer from meep for
resolutions ranging from 4 up to 720. I have systematically calculated
analytical solutions for cavity resonance up to TE 5,5 and TM 5,5, 60
frequency calculations. There are no analytical solutions for resonance
of this cavity below 2.45 GHz either TE or TM mode. Where should I look
next for resonance at 2.45 GHz from meep?

Steve


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] how to define a invariable complex refractive index?

2015-02-10 Thread liu
Hi, everyone,


1) I want to define a wavelength independent complex refractive index in 


meep, for example, n= 5+0.05i. Because I just want to simulate the absorption 


of the materials, so we do not need Drude model. But how to define it in 


meep?




2) Can meep calculate two-photon absorption? how to define the two-photon 
absorption parameters?  




Thank you!





___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Laguerre Gaussian beam Source

2015-02-10 Thread Kenan Cicek
Hi Everyone,

I wonder if we can use custom source which is Laguerre Gaussian beams or a
source file in meep ?

Thanks a lot !

Kenan

-- 

*PhD Std. Kenan CICEK*
*Faculty of Engineering Queen's Building room 2.8 *
*University of Bristol *
*Bristol BS8 1TR, UK*
*Tel (+44) 0117 331 5456*
* E-mail: ee...@bristol.ac.uk *
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Regarding Forces in CGS or SI units.

2015-02-10 Thread Steve
Dear Steven and fellow meep users,

I have calculated Flux = 0.0219609359 and Force = 14.0166101794. Now I
would like to convert to SI units. I've looked in meep-discuss and in
the tutorial, where I found this:

"Finally, we must mention that the MST computed by Meep does not include
a factor of 1/2, which is necessary if correctly defining the force in
cgs units, and therefore should be added in post processing." 

That's good to know, and I have looked up the dimensions of force (1 N =
1 kg⋅m/s2) and watts, (J/s = kg·m2/s3). It looks like mass drops out of
the ratio, Force/Flux, but just how does one convert Flux and Force to
SI units? Isn't there an upper limit on force to be obtained from flux?

Thanks for your help.

Steve Russell


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Gaissian Distribution of Phase

2015-02-10 Thread Yousuf Khan
Dear Steven and meep users,
I already saw some examples of oblique source by introducing a phase shift in 
source function. Is it possible to construct a focused source by Gaussian 
distribution of phase ? If yes, can anybody give an example please. Regards,
Yousuf Khan___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

[Meep-discuss] Needed addition to Meep Optical Forces tutorial example.

2015-02-10 Thread Steve
Dear Steven and Meep users,

The Optical Forces tutorial
http://ab-initio.mit.edu/wiki/index.php/Meep_Tutorial/Optical_forces
cries for the addition of one very helpful sentence following the quote
below.

"Finally, we must mention that the MST computed by Meep does not include
a factor of 1/2, which is necessary if correctly defining the force in
cgs units, and therefore should be added in post processing." 

The added sentence could read something like this: "For example, with
the parameters used in this tutorial, the Flux and Force in cgs units
are  and ."

The author must calculate and insert  and  of course and
anything that is unclear about the parameters used could be highlighted.

With these two numbers a lot of head-scratching about plane wave forces
and reflections could be avoided. I hope someone knowledgeable also
thinks this would be a very helpful addition to the tutorial. 

Steve Russell


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


Re: [Meep-discuss] Not compiled with HDF5, required for HDF5 output

2015-02-10 Thread Ongun Arisev
David Lively  writes:

> 
> 
> Thanks, Arthur. I finally managed to get this working yesterday. I 
couldn't find a prebuilt binary for our installation that contained H5 
support, so I had to build Meep from the source.Tracking down all of the 
nested library requirements - - meep needs h5utils which needs hdf5 which 
needs blah blah blah - was a bit of a chore as there doesn't seem to be a 
comprehensive list anywhere. Fortunately, the INSTALL and README files with 
each library were helpful in iteratively building a list. My (Hopefully) 
Comprehensive Meep Install Process:
> ---#1. Required libraries:jpeg-8b 
(libjpg)
> libpng-1.4.4
> gmp-5.0.1guile-1.8.7h5utils-1.12.1hdf5-1.8.5-patch1libctl-3.1libmatheval-
1.1.7libtool-2.4mvapich2-1.4.1.meep-1.1.1# The configure/make/install order 
was, I think:libtool
> libjpglibpnggmplibmathevallibctlguilehdf5h5utilsand, finally, Meep.# I 
created a ~/install/meep_requirements folder, into which I downloaded each 
required tar file:cd ~/install/meep_requirements
> wget http:///tar.gz# I may have the order slightly 
off, but the ./configure script in each install will generate warnings when 
a library cannot be found, in which case that dependency (obviously) must 
be built first.# Also, as Arthur said, it's important to set the 
environment flags (Linux syntax):#1. As Arthur said, set the required 
environment variables for compilation and linking. These are used by gcc, 
mpicc and make:export CPPFLAGS="-I/usr/include -I~/include" #separate 
multiple folders with spaces and prefix each with -I (capital i)export 
LD_FLAGS="-L/usr/lib -L~/lib" # separate multiple folders with spaces and 
prefix each with -L
> export LD_LIBRARY="/usr/lib:~/lib" # separate multiple entries with a 
colon, just as when setting the PATH environment variable.#2 build each 
library in turncd ~/install/meep_requirements/jpeg-8b
> ./configure --prefix=/home/myUserName# When compiling each library in 
turn, if you are not installing into the default /usr/* folders, be sure to 
add the option "--prefix=" when running each ./configure 
script../configure --prefix=/home/myUserNamemakemake install# The configure 
script will prefix each reference to lib or include with give entry. It's 
not necessary to pass "--prefix" to "make," "make check" or "make 
install".# If you're using Meep in parallel, when building hdf5, be sure to 
use mpicc from your MPI library installation. Before building hdf5, set the 
environment variable:export CC="/usr/mpi/gcc/mvapich2-1.4.1/bin/mpicc"
> ./configure --with-parallelmakemake install# Be sure to clear this 
setting after building hdf5. export CC=# Call meep. I created an ~/mpi 
folder containing configuration data common to all MPI processes (for 
mvapich2 - this may vary for different MPI libaries):cat 
~/mpi/machinesinode1inode2inode3inode4inode5inode6inode7inode8inode9inode10
inode11inode12inode13inode14inode15inode16# I created a shell script called 
"go" to run simulations with all required parameterscat ~/meep/gotime 
/usr/mpi/gcc/mvapich2-1.4.1/bin/mpirun_rsh -ssh -np 128 -hostfile 
/users/myUserName/mpi/machines /path/to/meep-mpi/binary  $1 | tee $1.out# 
This is called via:~/meep/go myFile.ctl#Bada-bing, bada-boom, the sim 
should be running.#We had some issues getting Infiniband running (required 
by mvapich). Our administrator took care of those issues so I'm not sure 
exactly what was involved. We also had to generate RSA keys for each user 
for each node in the cluster so that MPI could ssh into each node when 
starting processes and not be prompted for a password.#Also, for MPD (MPI 
daemon, which must be running on all nodes), you may require "secret word" 
file in the user's home directory. Filename and contents depend on the MPI 
library used. For mvapich, I created:cat 
~/.mpd.confMPD_SECRETWORD=PutAnythingHere# If your home directory is shared 
amongst nodes, as it should be for all of this to work, that file only 
needs to be created once.I realize this is a very verbose post, and the 
list may not be the appropriate place to post this, but it contains much 
information which, as far as I can tell, is not available in the wiki. 
Hopefully it will help someone else in the future.Cheers,David
> On Wed, Nov 24, 2010 at 7:47 AM, Arthur Thijssen  wrote:
> Hi David,
>  
> During configure you will get a warning stating that the required 
libraries were not detected at the given location and MEEP will compile 
without hdf5 support. You need to check the configure output carefully. 
> 
> 
>  
> I always set the LDFLAGS and CPPFLAGS, for me this would be:
>   
> export LDFLAGS="-L/usr/local/gnu_builds/blas -
L/usr/local/gnu_builds/lapack -L/usr/local/gnu_builds/hdf5/mpi/lib -
L/usr/local/gnu_builds/harminv/lib -
L/usr/local/gnu_builds/libctl/lib"export CPPFLAGS="-
I/usr/local/gnu_builds/gsl/include -I/usr/local/gnu_builds/gsl-1.13/include 
-I/usr/local/gnu_builds/hdf5/mpi/include -
I/usr/local/gnu_builds/libctl/include -
I/

[Meep-discuss] Problem with installation

2015-02-10 Thread Marc Zöller
I have a problem installing meep and mpb on my fedora system. The  
problem is a file named ctlgeom.h which can't be found by include  
. It is present on the system and if I change the include  
to include  (including the actual path to the file)  
it is working. But this is only a workaround for the test since it  
would meen editing all files where the file is referenced.

Anyone an idea where the problem might be located?

Regards and a happy festive season.

Marc Zöller

--

Marc Zöller
Universität Paderborn
Fakultät für Naturwissenschaften
Department Chemie

Warburger Str. 100
33098 Paderborn
Raum J3.305

Tel: 05251-60-2578
Fax: 05251-60-4208
EMail: mzoel...@mail.upb.de


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] how to define a invariable complex refractive index?

2015-02-10 Thread liu
Hi, everyone,


1) I want to define a wavelength independent complex refractive index in 


meep, for example, n= 5+0.05i. Because I just want to simulate the absorption 


of the materials, so we do not need Drude model. But how to define it in 


meep?




2) Can meep calculate two-photon absorption? how to define the two-photon 
absorption parameters?  




Thank you!___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss