Re: [Meep-discuss] Python vs Scheme.

2019-05-23 Thread Christopher Hogan
Hi Galaa,

geometric_object_duplicates returns a list, so your geometry list ends up
being [[...], Block, [...]]. This list just needs to be flattened so it
doesn't have any nested lists. One way to do that is to use Python's '*'
operator to unpack the lists:

geometry = [*mp.geometric_object_duplicates(...), mp.Block(...), *
mp.geometric_object_duplicates(...)]

Chris

On Thu, May 23, 2019 at 8:46 AM Galaa Badrakh 
wrote:

> Gi All,
>
> I am trying to evaluate following block but getting error "
> AttributeError: 'list' object has no attribute 'material' ". What I am
> doing wrong? The same block in Scheme interface is working.
>
> geometry = [mp.geometric_objects_duplicates(mp.Vector3(0, 0, 3), 0, 3,
> [layer1, layer2]),
>
> mp.Block(mp.Vector3(mp.inf,mp.inf,2.0), 
> center=mp.Vector3(0.0,0.0,-6.0),material=mp.Medium(epsilon=n0)),
> mp.geometric_objects_duplicates(mp.Vector3(0, 0, 3),
> 0, 5, [layer3, layer4])]
>
>
> Thanks in advance!
>
> G
> ___
> 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] oblique-source.py return error(invalid direction in add_eigenmode_source)

2019-05-22 Thread Christopher Hogan
I believe the oblique-source.py example requires Meep 1.9 or later. You can
create an environment for parallel pymeep 1.9 like so (note that the pymeep
packages are now hosted on the conda-forge channel instead of chogan):

$ conda create -n mp1.9 -c conda-forge pymeep=*=mpi_mpich_*
$ conda activate mp1.9


Chris

On Wed, May 22, 2019 at 7:23 AM ei ru <37zi...@gmail.com> wrote:

> Dear meep Users,
>
> When I run the example code of tutorial (
> https://github.com/NanoComp/meep/blob/master/python/examples/oblique-source.py
>  )
> ,
>  I get the error saying nvalid direction in add_eigenmode_source.
> The log is below.
> I currently use pymeep-parallel  of version 1.7.0 which is build from
> py36_nomklh39e3cac_1  [nomkl]  chogan.
> If you have any idea how to fix this, please let me know.
> Thank you.
>
> ##
> Using MPI version 3.1, 1 processes
> ---
> Initializing structure...
> Working in 2D dimensions.
> Computational cell is 14 x 14 x 0 with resolution 50
>  block, center = (0,0,0)
>   size (1e+20,1,1e+20)
>   axes (0.939693,0.34202,0), (-0.34202,0.939693,0), (0,0,1)
>   dielectric constant epsilon diagonal = (12,12,12)
> time for set_epsilon = 2.01864 s
> ---
> meep: invalid direction in add_eigenmode_source
> application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
> [unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1
> :
> system msg for write_line failure : Bad file descripto
> 
> ___
> 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] geom_fix_object_list compile error

2019-05-03 Thread Christopher Hogan
Hi Roque,

`geom_fix_object_list` was introduced in libctl 4.2.0, so Meep 1.9 requires
libctl >= 4.2.0.

Chris

On Fri, May 3, 2019 at 9:17 AM Roque Madrigal  wrote:

> Dear all
>
> I am trying install meep 1.9  in Arch Linux with options:
>
> export CFLAGS=" -fPIC -lctlgeom "
> export CPPFLAGS="-fPIC -lctlgeom"
> export LIBS="-lctlgeom "
> ./configure --prefix=/usr/ --enable-shared --with-mpi
>
> make
>
> I got the following error message:
>
>
>
>   CXX  GDSIIgeom.lo
>   CXX  step_generic_stride1.lo
>   CXXLDsphere_quad
> meepgeom.cpp: En el constructor
> ‘meep_geom::geom_epsilon::geom_epsilon(geometric_object_list,
> meep_geom::material_type_list, const meep::volume&)’:
> meepgeom.cpp:393:3: error: ‘geom_fix_object_list’ no se declaró en este
> ámbito
>geom_fix_object_list(geometry);
>^~~~
> meepgeom.cpp:393:3: nota: suggested alternative: ‘geom_fix_objects0’
>geom_fix_object_list(geometry);
>^~~~
>geom_fix_objects0
> meepgeom.cpp: En la función miembro static ‘static void
> meep_geom::fragment_stats::init_libctl(meep_geom::material_type, bool,
> meep::grid_volume*, vector3, vector3, geometric_object_list*)’:
> meepgeom.cpp:1692:3: error: ‘geom_fix_object_list’ no se declaró en este
> ámbito
>geom_fix_object_list(*geom_);
>^~~~
> meepgeom.cpp:1692:3: nota: suggested alternative: ‘geom_fix_objects0’
>geom_fix_object_list(*geom_);
>^~~~
>geom_fix_objects0
>
> Thanks
>
> Regards
>
>
> Roque
>
>
> ___
> 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] output_dft function doesn't work?

2019-05-03 Thread Christopher Hogan
Hi Quang,

Are you using a parallel HDF5 (built with MPI)? How did you install meep
(built from source, conda package (release or nightly))?

I'm guessing it's some kind of deadlock when using MPI and parallel HDF5
since get_dft_array works, although I am unable to reproduce the hang. Are
you able to post the full simulation so I can debug further?

Chris

On Thu, May 2, 2019 at 5:12 PM Quang Nguyen  wrote:

> Hello all,
>
>
>
> I am looking to calculate the E-fields for my simulation as a function of
> frequency. To do so I add a dft field monitor using mp.add_dft_fields(…)
> and I attempt to get the data it records by using sim.output_dft(…).
> However, it appears the output_dft function doesn’t work.
>
>
>
> My simulation normally takes a few minutes to run, e.g. when computing
> just the flux. However, by calling output_dft it continues to run for hours
> without completing. I have tested outputting a fraction of the results
> using get_dft_array instead, and in that case the simulation will finish as
> normal and output the desired data. Thus, I believe my monitor is set up
> correctly and it is simply the output_dft function that is not working
> properly. The total data set is rather large, so I would like to use
> output_dft if possible since the .h5 file is relatively easy to work with
> for large data sets.
>
>
>
> For reference, below is some pseudocode of the relevant lines:
>
>
>
> dft_fields = sim.add_dft_fields([mp.Ex], fmin, fmax, nfreq,
> center=mp.Vector3(), size=mp.Vector3(sx,sy,sz-2*t_PML))
>
> sim.run(…)
>
> sim.output_dft(dft_fields, 'test')
>
>
>
> The above does not work and continues running forever as stated
> previously. In contrast, the following does work:
>
>
>
> dft_fields = sim.add_dft_fields([mp.Ex], fmin, fmax, nfreq,
> center=mp.Vector3(), size=mp.Vector3(sx,sy,sz-2*t_PML))
>
> sim.run(…)
>
> for i in range(nfreq):
>
> ex_data = sim.get_dft_array(dft_fields, mp.Ex, i)
>
> print("dft:, {}".format(ex_data))
>
>
>
> Actually the data set is long enough that the printed output has ellipses
> omitting a large part of the data, but leaving that aside, it does output
> something. The output_dft function does not. Any help would be greatly
> appreciated.
> ___
> 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] Run function, comparing total flux at different intervals

2019-03-25 Thread Christopher Hogan
Oh, right. You have to use the 'global' keyword so Python knows it isn't a
local variable (this only works in python3)

def flux1_step(sim)
global flux1
flux1 = ...

Chris

On Mon, Mar 25, 2019 at 10:48 AM Karl-Johan Olofsson <
karol...@student.liu.se> wrote:

> I doesn't get it to work. The step functions doesn't seem to redefine
> flux1 and flux2 properly. If I print out flux1,2 in the ratio_test function
> it keep printing out the initiated values for some reason.
>
>
> Karl-Johan
> ------
> *Från:* Christopher Hogan 
> *Skickat:* den 25 mars 2019 11:51:40
> *Till:* Karl-Johan Olofsson
> *Kopia:* meep-discuss@ab-initio.mit.edu
> *Ämne:* Re: [Meep-discuss] Run function, comparing total flux at
> different intervals
>
> I haven't tested this, but something like this should work. The key is to
> use global variables.
>
> sim = ...
> total_flux = ...
> flux1 = 0
> flux2 = 0
>
> def output_power(sim):
> return mp.get_fluxes(total_flux)[0]
>
> def flux1_step(sim):
> flux1 = output_power(sim)
>
> def flux2_step(sim):
> flux2 = output_power(sim)
>
> def ratio_test()
> return abs(flux2 / flux1 - 1) < 0.01
>
> sim.run(mp.at_every(3, flux1_step), mp.at_every(5, flux2_step),
> until=ratio_test)
>
>
> On Fri, Mar 22, 2019 at 9:09 AM Karl-Johan Olofsson <
> karol...@student.liu.se> wrote:
>
> Hello!
>
> I am attempting to implement a stopping criteria that compares the total
> flux at two different points in time, and when the difference between the
> total power radiated is small, I want to stop the simulation. I seem to be
> misunderstanding the programming aspect of it all, I attemped a very basic
> implementation this way:
>
>
> def output_power(sim):
> return(mp.get_fluxes(flux_total))
>
> def ratio_test(Flux1,Flux2):
> if abs(Flux2/Flux1-1)<0.01:
> return True
>
> else:
> return False
>
> ..
>
> sim.run(flux1=mp.at_every(3,output_power),
> flux2=mp.at_every(5,output_power),
> until=ratio_test(flux1,flux2))
>
> -
>
> But it clearly doesn't work. (It returns
> ValueError: Unrecognized keyword arguments: dict_keys(['flux1', 'flux2']))
>
> How would I go about to implement this. Or maybe you have some more
> sophisticated way to solve the stop condition for my simulation?
>
> Karl-Johan
>
>
>
>
> ___
> 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] Run function, comparing total flux at different intervals

2019-03-25 Thread Christopher Hogan
I haven't tested this, but something like this should work. The key is to
use global variables.

sim = ...
total_flux = ...
flux1 = 0
flux2 = 0

def output_power(sim):
return mp.get_fluxes(total_flux)[0]

def flux1_step(sim):
flux1 = output_power(sim)

def flux2_step(sim):
flux2 = output_power(sim)

def ratio_test()
return abs(flux2 / flux1 - 1) < 0.01

sim.run(mp.at_every(3, flux1_step), mp.at_every(5, flux2_step),
until=ratio_test)


On Fri, Mar 22, 2019 at 9:09 AM Karl-Johan Olofsson 
wrote:

> Hello!
>
> I am attempting to implement a stopping criteria that compares the total
> flux at two different points in time, and when the difference between the
> total power radiated is small, I want to stop the simulation. I seem to be
> misunderstanding the programming aspect of it all, I attemped a very basic
> implementation this way:
>
>
> def output_power(sim):
> return(mp.get_fluxes(flux_total))
>
> def ratio_test(Flux1,Flux2):
> if abs(Flux2/Flux1-1)<0.01:
> return True
>
> else:
> return False
>
> ..
>
> sim.run(flux1=mp.at_every(3,output_power),
> flux2=mp.at_every(5,output_power),
> until=ratio_test(flux1,flux2))
>
> -
>
> But it clearly doesn't work. (It returns
> ValueError: Unrecognized keyword arguments: dict_keys(['flux1', 'flux2']))
>
> How would I go about to implement this. Or maybe you have some more
> sophisticated way to solve the stop condition for my simulation?
>
> Karl-Johan
>
>
>
>
> ___
> 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] still having problems installing

2019-03-21 Thread Christopher Hogan
I can't say if this is expected since I don't use a Mac, but I think once
you run the line "plt.show()" you will see the plot.

On Thu, Mar 21, 2019 at 10:06 AM Saeed younis  wrote:

> ok...my mistake actually ... i was told this before ...
>
> anyways...i tried running line by line and got to line #34
> plt.figure()
>
> it was executed without error but i got a python "something" in the mac
> dash (the icon is a circle with a helicopter rotor like something inside
> it)...this thing does not open when i click it
>
> i don't want to proceed with the rest of the code before knowing this is
> what to be expected, is it?
>
> --
> *From:* Christopher Hogan 
> *Sent:* Thursday, March 21, 2019 1:42 PM
> *To:* Saeed younis
> *Cc:* meep-discuss@ab-initio.mit.edu
> *Subject:* Re: [Meep-discuss] still having problems installing
>
> Sorry. I sent the message prematurely.
>
> You have to type `python` at the terminal prompt, and then you will be in
> an interactive python session and can type the example code:
>
> $ python
> [GCC 7.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>>  import meep as mp
> etc.
>
>
> On Thu, Mar 21, 2019 at 8:40 AM Christopher Hogan 
> wrote:
>
> Hi,
>
> You can't execute python code directly in a bash terminal. If you want an
> interactive python prompt, you have to type `python`
>
> On Thu, Mar 21, 2019 at 8:38 AM Saeed younis  wrote:
>
> hi Chris,
>
> i opened a fresh terminal and inserted
>
> conda activate mp
>
> to get the (mp) thing ...
>
> then, trying to run the code in example:
> meep <https://github.com/NanoComp/meep>/python
> <https://github.com/NanoComp/meep/tree/master/python>/examples
> <https://github.com/NanoComp/meep/tree/master/python/examples>/
> *straight-waveguide.py*
>
> the code fails at the first line as:
>
> Last login: Thu Mar 21 14:22:52 on console
> g29younis:~ BakarooX$ conda activate mp
> (mp) g29younis:~ BakarooX$ from __future__ import division
> from: can't read /var/mail/__future__
> (mp) g29younis:~ BakarooX$
>
> why is this?
>
> thnx
>
> --
> *From:* Christopher Hogan 
> *Sent:* Thursday, March 21, 2019 12:27 PM
> *To:* Saeed younis
> *Cc:* meep-discuss@ab-initio.mit.edu
> *Subject:* Re: [Meep-discuss] still having problems installing
>
> Hi Saeed,
>
> It appears to be working correctly.
>
> ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?
>
>
> You can run different examples as you please. Each file is self-contained
> and will not affect the previous run.
>
> Chris
>
> On Thu, Mar 21, 2019 at 4:52 AM Saeed younis  wrote:
>
> hi Chris,
>
> thnx for the assistance.
>
> i have tried running the code pieces you provided in your email and here
> is what they prompted (below the line), could you please go over it and
> tell me if you spot anything out of the ordinary?
>
> ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?
>
> thnx
> __
>
> Last login: Thu Mar 21 10:34:00 on ttys000
> g29younis:~ BakarooX$ conda activate base
> (base) g29younis:~ BakarooX$
> (base) g29younis:~ BakarooX$ conda create -n mp -c conda-forge pymeep
>
> CondaValueError: prefix already exists: /miniconda3/envs/mp
>
> (base) g29younis:~ BakarooX$ conda activate mp
> (mp) g29younis:~ BakarooX$ echo "backend: TkAgg" >>
> ~/.matplotlib/matplotlibrc
> (mp) g29younis:~ BakarooX$ git clone https://github.com/NanoComp/meep.git
> Cloning into 'meep'...
> remote: Enumerating objects: 14885, done.
> remote: Total 14885 (delta 0), reused 0 (delta 0), pack-reused 14885
> Receiving objects: 100% (14885/14885), 24.32 MiB | 5.96 MiB/s, done.
> Resolving deltas: 100% (11459/11459), done.
> (mp) g29younis:~ BakarooX$ cd meep
> (mp) g29younis:meep BakarooX$ git checkout v1.8.0
> Note: checking out 'v1.8.0'.
>
> You are in 'detached HEAD' state. You can look around, make experimental
> changes and commit them, and you can discard any commits you make in this
> state without impacting any branches by performing another checkout.
>
> If you want to create a new branch to retain commits you create, you may
> do so (now or later) by using -b with the checkout command again. Example:
>
>   git checkout -b 
>
> HEAD is now at f33ee48 rename size to eliminate std::size conflict in C++17
> (

Re: [Meep-discuss] still having problems installing

2019-03-21 Thread Christopher Hogan
Sorry. I sent the message prematurely.

You have to type `python` at the terminal prompt, and then you will be in
an interactive python session and can type the example code:

$ python
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>  import meep as mp
etc.


On Thu, Mar 21, 2019 at 8:40 AM Christopher Hogan 
wrote:

> Hi,
>
> You can't execute python code directly in a bash terminal. If you want an
> interactive python prompt, you have to type `python`
>
> On Thu, Mar 21, 2019 at 8:38 AM Saeed younis  wrote:
>
>> hi Chris,
>>
>> i opened a fresh terminal and inserted
>>
>> conda activate mp
>>
>> to get the (mp) thing ...
>>
>> then, trying to run the code in example:
>> meep <https://github.com/NanoComp/meep>/python
>> <https://github.com/NanoComp/meep/tree/master/python>/examples
>> <https://github.com/NanoComp/meep/tree/master/python/examples>/
>> *straight-waveguide.py*
>>
>> the code fails at the first line as:
>>
>> Last login: Thu Mar 21 14:22:52 on console
>> g29younis:~ BakarooX$ conda activate mp
>> (mp) g29younis:~ BakarooX$ from __future__ import division
>> from: can't read /var/mail/__future__
>> (mp) g29younis:~ BakarooX$
>>
>> why is this?
>>
>> thnx
>>
>> --
>> *From:* Christopher Hogan 
>> *Sent:* Thursday, March 21, 2019 12:27 PM
>> *To:* Saeed younis
>> *Cc:* meep-discuss@ab-initio.mit.edu
>> *Subject:* Re: [Meep-discuss] still having problems installing
>>
>> Hi Saeed,
>>
>> It appears to be working correctly.
>>
>> ps: now that i ran an example, if i want to run a different example, can
>> i run it strait away or should i do something before?
>>
>>
>> You can run different examples as you please. Each file is self-contained
>> and will not affect the previous run.
>>
>> Chris
>>
>> On Thu, Mar 21, 2019 at 4:52 AM Saeed younis  wrote:
>>
>> hi Chris,
>>
>> thnx for the assistance.
>>
>> i have tried running the code pieces you provided in your email and here
>> is what they prompted (below the line), could you please go over it and
>> tell me if you spot anything out of the ordinary?
>>
>> ps: now that i ran an example, if i want to run a different example, can
>> i run it strait away or should i do something before?
>>
>> thnx
>> __
>>
>> Last login: Thu Mar 21 10:34:00 on ttys000
>> g29younis:~ BakarooX$ conda activate base
>> (base) g29younis:~ BakarooX$
>> (base) g29younis:~ BakarooX$ conda create -n mp -c conda-forge pymeep
>>
>> CondaValueError: prefix already exists: /miniconda3/envs/mp
>>
>> (base) g29younis:~ BakarooX$ conda activate mp
>> (mp) g29younis:~ BakarooX$ echo "backend: TkAgg" >>
>> ~/.matplotlib/matplotlibrc
>> (mp) g29younis:~ BakarooX$ git clone https://github.com/NanoComp/meep.git
>> Cloning into 'meep'...
>> remote: Enumerating objects: 14885, done.
>> remote: Total 14885 (delta 0), reused 0 (delta 0), pack-reused 14885
>> Receiving objects: 100% (14885/14885), 24.32 MiB | 5.96 MiB/s, done.
>> Resolving deltas: 100% (11459/11459), done.
>> (mp) g29younis:~ BakarooX$ cd meep
>> (mp) g29younis:meep BakarooX$ git checkout v1.8.0
>> Note: checking out 'v1.8.0'.
>>
>> You are in 'detached HEAD' state. You can look around, make experimental
>> changes and commit them, and you can discard any commits you make in this
>> state without impacting any branches by performing another checkout.
>>
>> If you want to create a new branch to retain commits you create, you may
>> do so (now or later) by using -b with the checkout command again. Example:
>>
>>   git checkout -b 
>>
>> HEAD is now at f33ee48 rename size to eliminate std::size conflict in
>> C++17
>> (mp) g29younis:meep BakarooX$ cd python/examples
>> (mp) g29younis:examples BakarooX$ python 3rd-harm-1d.py
>> ---
>> Initializing structure...
>> Working in 1D dimensions.
>> Computational cell is 0 x 0 x 100 with resolution 20
>> time for set_epsilon = 0.00117016 s
>> ---
>> field decay(t = 100.050001): 4.16910083472712e-12 /
>> 4.16910083472712e-12 = 1.0
>> field decay(t = 150.075002): 1.0165409834939769e-08 /
>> 1.0165409834939769e-08 = 1.0
>> field decay(t = 200.12): 4.648720329217878e-06 /
>> 4.64872032921

Re: [Meep-discuss] still having problems installing

2019-03-21 Thread Christopher Hogan
Hi,

You can't execute python code directly in a bash terminal. If you want an
interactive python prompt, you have to type `python`

On Thu, Mar 21, 2019 at 8:38 AM Saeed younis  wrote:

> hi Chris,
>
> i opened a fresh terminal and inserted
>
> conda activate mp
>
> to get the (mp) thing ...
>
> then, trying to run the code in example:
> meep <https://github.com/NanoComp/meep>/python
> <https://github.com/NanoComp/meep/tree/master/python>/examples
> <https://github.com/NanoComp/meep/tree/master/python/examples>/
> *straight-waveguide.py*
>
> the code fails at the first line as:
>
> Last login: Thu Mar 21 14:22:52 on console
> g29younis:~ BakarooX$ conda activate mp
> (mp) g29younis:~ BakarooX$ from __future__ import division
> from: can't read /var/mail/__future__
> (mp) g29younis:~ BakarooX$
>
> why is this?
>
> thnx
>
> --
> *From:* Christopher Hogan 
> *Sent:* Thursday, March 21, 2019 12:27 PM
> *To:* Saeed younis
> *Cc:* meep-discuss@ab-initio.mit.edu
> *Subject:* Re: [Meep-discuss] still having problems installing
>
> Hi Saeed,
>
> It appears to be working correctly.
>
> ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?
>
>
> You can run different examples as you please. Each file is self-contained
> and will not affect the previous run.
>
> Chris
>
> On Thu, Mar 21, 2019 at 4:52 AM Saeed younis  wrote:
>
> hi Chris,
>
> thnx for the assistance.
>
> i have tried running the code pieces you provided in your email and here
> is what they prompted (below the line), could you please go over it and
> tell me if you spot anything out of the ordinary?
>
> ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?
>
> thnx
> __
>
> Last login: Thu Mar 21 10:34:00 on ttys000
> g29younis:~ BakarooX$ conda activate base
> (base) g29younis:~ BakarooX$
> (base) g29younis:~ BakarooX$ conda create -n mp -c conda-forge pymeep
>
> CondaValueError: prefix already exists: /miniconda3/envs/mp
>
> (base) g29younis:~ BakarooX$ conda activate mp
> (mp) g29younis:~ BakarooX$ echo "backend: TkAgg" >>
> ~/.matplotlib/matplotlibrc
> (mp) g29younis:~ BakarooX$ git clone https://github.com/NanoComp/meep.git
> Cloning into 'meep'...
> remote: Enumerating objects: 14885, done.
> remote: Total 14885 (delta 0), reused 0 (delta 0), pack-reused 14885
> Receiving objects: 100% (14885/14885), 24.32 MiB | 5.96 MiB/s, done.
> Resolving deltas: 100% (11459/11459), done.
> (mp) g29younis:~ BakarooX$ cd meep
> (mp) g29younis:meep BakarooX$ git checkout v1.8.0
> Note: checking out 'v1.8.0'.
>
> You are in 'detached HEAD' state. You can look around, make experimental
> changes and commit them, and you can discard any commits you make in this
> state without impacting any branches by performing another checkout.
>
> If you want to create a new branch to retain commits you create, you may
> do so (now or later) by using -b with the checkout command again. Example:
>
>   git checkout -b 
>
> HEAD is now at f33ee48 rename size to eliminate std::size conflict in C++17
> (mp) g29younis:meep BakarooX$ cd python/examples
> (mp) g29younis:examples BakarooX$ python 3rd-harm-1d.py
> ---
> Initializing structure...
> Working in 1D dimensions.
> Computational cell is 0 x 0 x 100 with resolution 20
> time for set_epsilon = 0.00117016 s
> ---
> field decay(t = 100.050001): 4.16910083472712e-12 /
> 4.16910083472712e-12 = 1.0
> field decay(t = 150.075002): 1.0165409834939769e-08 /
> 1.0165409834939769e-08 = 1.0
> field decay(t = 200.12): 4.648720329217878e-06 /
> 4.648720329217878e-06 = 1.0
> field decay(t = 250.125): 0.0005182735319569587 / 0.0005182735319569587 =
> 1.0
> field decay(t = 300.150003): 0.013974697322011669 /
> 0.013974697322011669 = 1.0
> field decay(t = 350.175): 0.07995289002032732 / 0.07995289002032732 = 1.0
> field decay(t = 400.25): 0.17867229467477655 /
> 0.17867229467477655 = 1.0
> field decay(t = 450.225): 0.23241654769547887 / 0.23241654769547887 = 1.0
> field decay(t = 500.25): 0.18817882350661239 / 0.23241654769547887 =
> 0.8096618996043756
> field decay(t = 550.275): 0.014319414613175686 / 0.23241654769547887 =
> 0.06161099437694745
> field decay(t = 600.30001): 0.0003754598154438489 /
> 0.23241654769547887 = 0.0016154607714756648
> field decay(t = 650.325): 2.9312708100424914e-06 / 0.23241654769547887 =
> 1.261214332244172e-05
>

Re: [Meep-discuss] still having problems installing

2019-03-21 Thread Christopher Hogan
Hi Saeed,

It appears to be working correctly.

ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?


You can run different examples as you please. Each file is self-contained
and will not affect the previous run.

Chris

On Thu, Mar 21, 2019 at 4:52 AM Saeed younis  wrote:

> hi Chris,
>
> thnx for the assistance.
>
> i have tried running the code pieces you provided in your email and here
> is what they prompted (below the line), could you please go over it and
> tell me if you spot anything out of the ordinary?
>
> ps: now that i ran an example, if i want to run a different example, can i
> run it strait away or should i do something before?
>
> thnx
> __
>
> Last login: Thu Mar 21 10:34:00 on ttys000
> g29younis:~ BakarooX$ conda activate base
> (base) g29younis:~ BakarooX$
> (base) g29younis:~ BakarooX$ conda create -n mp -c conda-forge pymeep
>
> CondaValueError: prefix already exists: /miniconda3/envs/mp
>
> (base) g29younis:~ BakarooX$ conda activate mp
> (mp) g29younis:~ BakarooX$ echo "backend: TkAgg" >>
> ~/.matplotlib/matplotlibrc
> (mp) g29younis:~ BakarooX$ git clone https://github.com/NanoComp/meep.git
> Cloning into 'meep'...
> remote: Enumerating objects: 14885, done.
> remote: Total 14885 (delta 0), reused 0 (delta 0), pack-reused 14885
> Receiving objects: 100% (14885/14885), 24.32 MiB | 5.96 MiB/s, done.
> Resolving deltas: 100% (11459/11459), done.
> (mp) g29younis:~ BakarooX$ cd meep
> (mp) g29younis:meep BakarooX$ git checkout v1.8.0
> Note: checking out 'v1.8.0'.
>
> You are in 'detached HEAD' state. You can look around, make experimental
> changes and commit them, and you can discard any commits you make in this
> state without impacting any branches by performing another checkout.
>
> If you want to create a new branch to retain commits you create, you may
> do so (now or later) by using -b with the checkout command again. Example:
>
>   git checkout -b 
>
> HEAD is now at f33ee48 rename size to eliminate std::size conflict in C++17
> (mp) g29younis:meep BakarooX$ cd python/examples
> (mp) g29younis:examples BakarooX$ python 3rd-harm-1d.py
> ---
> Initializing structure...
> Working in 1D dimensions.
> Computational cell is 0 x 0 x 100 with resolution 20
> time for set_epsilon = 0.00117016 s
> ---
> field decay(t = 100.050001): 4.16910083472712e-12 /
> 4.16910083472712e-12 = 1.0
> field decay(t = 150.075002): 1.0165409834939769e-08 /
> 1.0165409834939769e-08 = 1.0
> field decay(t = 200.12): 4.648720329217878e-06 /
> 4.648720329217878e-06 = 1.0
> field decay(t = 250.125): 0.0005182735319569587 / 0.0005182735319569587 =
> 1.0
> field decay(t = 300.150003): 0.013974697322011669 /
> 0.013974697322011669 = 1.0
> field decay(t = 350.175): 0.07995289002032732 / 0.07995289002032732 = 1.0
> field decay(t = 400.25): 0.17867229467477655 /
> 0.17867229467477655 = 1.0
> field decay(t = 450.225): 0.23241654769547887 / 0.23241654769547887 = 1.0
> field decay(t = 500.25): 0.18817882350661239 / 0.23241654769547887 =
> 0.8096618996043756
> field decay(t = 550.275): 0.014319414613175686 / 0.23241654769547887 =
> 0.06161099437694745
> field decay(t = 600.30001): 0.0003754598154438489 /
> 0.23241654769547887 = 0.0016154607714756648
> field decay(t = 650.325): 2.9312708100424914e-06 / 0.23241654769547887 =
> 1.261214332244172e-05
> field decay(t = 700.35): 1.8599873539004834e-07 / 0.23241654769547887 =
> 8.002818096831515e-07
> run 0 finished at t = 700.35 (28014 timesteps)
> harmonics:, 1, 1.0, 10.948940867211189, 0.1363383540846079
>
> Elapsed run time = 1.0114 s
>
> Field time usage:
>  connecting chunks: 0.000177145 s
>  time stepping: 0.416068 s
>  communicating: 0.0331552 s
> Fourier transforming: 0.0204654 s
>everything else: 0.43869 s
>
> (mp) g29younis:examples BakarooX$
>
>
> --
> *From:* Christopher Hogan 
> *Sent:* Wednesday, March 20, 2019 1:45 PM
> *To:* Saeed younis
> *Cc:* meep-discuss@ab-initio.mit.edu
> *Subject:* Re: [Meep-discuss] still having problems installing
>
> Hi Saeed,
>
> Please describe the issue you experienced with the conda package so I can
> help troubleshoot.
>
> Here are the line-by-line instructions for getting a working Meep
> enviornment:
>
> You already have miniconda installed, so first ensure you have the base
> environment active:
>
> $ conda activate base
>
> Next, create an environment called "mp" for your meep installation. Note
> that

Re: [Meep-discuss] still having problems installing

2019-03-20 Thread Christopher Hogan
Hi Saeed,

Please describe the issue you experienced with the conda package so I can
help troubleshoot.

Here are the line-by-line instructions for getting a working Meep
enviornment:

You already have miniconda installed, so first ensure you have the base
environment active:

$ conda activate base

Next, create an environment called "mp" for your meep installation. Note
that this environment will be completely isolated from everything else on
your system, so you don't have to worry about conflicting installations.

$ conda create -n mp -c conda-forge pymeep

Activate the environment (this must be done each time you open a terminal).

$ conda activate mp

Now your terminal prompt will have a (mp) in front of it, indicating that
the "mp" environment is active.

Next, as described in the documentation (
https://meep.readthedocs.io/en/latest/Installation/#conda-packages)
matplotlib requires an extra step on Mac. We must set the backend to TkAgg

$ echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc

Now we need the example scripts from the github repo. Clone the repo if you
haven't already:

$ git clone https://github.com/NanoComp/meep.git
$ cd meep

We need to ensure that the examples correspond to the same version of meep
that we installed (1.8.0).

$ git checkout v1.8.0
$ cd python/examples

Run some examples

$ python 3rd-harm-1d.py

If you experience any issues, please send detailed reports of the errors.

Chris





On Wed, Mar 20, 2019 at 5:34 AM Saeed younis  wrote:

> when i run brew doctor i get the following:
>
> Warning: "config" scripts exist outside your system or Homebrew
> directories.
> `./configure` scripts often look for *-config scripts to determine if
> software packages are installed, and what additional flags to use when
> compiling and linking.
>
> Having additional scripts in your path can confuse software installed via
> Homebrew if the config script overrides a system or Homebrew provided
> script of the same name. We found the following "config" scripts:
>   /miniconda3/bin/python3.7-config
>   /miniconda3/bin/python3.7m-config
>   /miniconda3/bin/python3-config
>   /miniconda3/bin/ncursesw6-config
>   /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
>   /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
>   /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
>
> Warning: Unbrewed header files were found in /usr/local/include.
> If you didn't put them there on purpose they could cause problems when
> building Homebrew formulae, and may need to be deleted.
>
> Unexpected header files:
>   /usr/local/include/ffi.h
>   /usr/local/include/ffitarget.h
>
> can this cause a problem? how to deal with that?
>
> thnx
>
>
> --
> *From:* meep-discuss  on behalf
> of Saeed younis 
> *Sent:* Wednesday, March 20, 2019 10:27 AM
> *To:* meep-discuss@ab-initio.mit.edu
> *Subject:* [Meep-discuss] still having problems installing
>
> hi,
>
> i have tried the simple (conda) approach and the source code approach for
> installing meep...i do get some progress but at the end of the day plots
> are not generated even for the simplest of examples...i think i have done
> something wrong during installations or that the installations got mixed up
> somehow and cause an error
>
> i would therefore want to completely remove everything that i have
> installed and start fresh with someone helping me through a step-by-step
> installation (and i really need line-by-line help)
>
> would someone be welling to do that please?
>
> could someone suggest a way to first make sure that i uninstall every last
> component of what i have installed?
>
> i have installed Pyhton 3.7 and miniconda and followed john's instructions
> for the installations on sierra regarding installing several packages from
> through homebrew
>
> i have a mac osx mojave 10.14.3
>
> thnx in advance folks
> ___
> 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] PyMeep output duplicate messages

2019-03-11 Thread Christopher Hogan
Hi,

You need to wrap your file io code in a block like this
```
if mp.am_master():
f=open()
f.write()
f.close()
```
so that only the master process does the writing.

Chris


On Mon, Mar 11, 2019 at 1:32 PM ei ru <37zi...@gmail.com> wrote:

> When I use print for file in pymeep, it makes duplicate messsages.
> For example, following file(run.py) with command << mpirun -np 3 python
> run.py >> makes file named hogehoge.
> The output file, hogehoge contains "fugafugafugafugafuga".
> However, what I want is "fugafuga".
> PyMeep output duplicately.
> How can I use pymeep correctly?
>
> Any other output file, for example E-field is ok.
>
> ---code of run.py-
>
> import meep as mp
> cell = mp.Vector3(16,8,0)
> geometry = [mp.Block(mp.Vector3(mp.inf,1,mp.inf),
>  center=mp.Vector3(),
>  material=mp.Medium(epsilon=12))]
> sources = [mp.Source(mp.ContinuousSource(frequency=0.15),
>  component=mp.Ez,
>  center=mp.Vector3(-7,0))]
> pml_layers = [mp.PML(1.0)]
> resolution = 10
> sim = mp.Simulation(cell_size=cell,
> boundary_layers=pml_layers,
> geometry=geometry,
> sources=sources,
> resolution=resolution)
> sim.run(until=200)
>
> f=open("hogehoge","a")
> f.write("fugafuga")
> f.close()
>
> ___
> 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] Memory issues with parallel meep - bad_alloc

2019-03-08 Thread Christopher Hogan
Hi Thomas,

Have you examined the memory footprint of the serial simulation at
resolution 36? If it's less than 8 GB, then I would assume the parallel
version with 4 processors would fit in memory. If the serial version is
using significantly less than 6 or 7GB, it may be a bug. Feel free to send
me a reproducer.

(32GB RAM + 32GB swap on a 32GB Ubuntu 18.04 machine).


I assume the third "32GB" here is redundant, and not a typo for 32-bit. On
a 32 bit OS, of course, you can't address more than 4GB of memory.

Chris


On Thu, Mar 7, 2019 at 7:39 AM Thomas AUZINGER  wrote:

> Dear all,
>
> To speed up my simulations, I switched from pymeep to pymeep-parallel
> (latest version freshly installed from conda). Now, I run into memory
> allocation problems that I do not really understand.
>
> Previously on pymeep, I was running a simulation with a resolution up to
> 80.
> With pymeep-parallel, I manage to run the same simulation with a
> resolution of 30 (calling it via any of the 'python ...', 'mpirun -np 1
> python ...', and 'mpirun -np 4 python ...').
> It seems that the parallelization is working fine and looking at a
> system monitor, the simulation is not using more than 1GB of RAM.
>
> When I increase the resolution slightly to 36 (or higher), the
> simulation crashes before even reaching the output line 'Initializing
> structure' with the error message
>
> > terminate called after throwing an instance of 'std::bad_alloc'
> Before this, the processes consume all the available memory (32GB RAM +
> 32GB swap on a 32GB Ubuntu 18.04 machine).
>
> Is this a known problem or is there a way to debug this?
>
> All the best,
> Thomas
>
>
> ___
> 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] problem in make on mac OSX Mojave

2019-03-05 Thread Christopher Hogan
Hi Saeed,

Can you described the issue you experienced with the conda packages?

Chris

On Tue, Mar 5, 2019 at 8:28 AM Saeed younis  wrote:

> hi all,
>
> i am new to mac, and new to unix etc...
>
> i am trying to install meep on my mac mini which has an OSX mojave 10.14.3
>
> i have tried the "miniconda way" and that did not work so i'm trying to
> install things step by step according to a post by John Weiner (relating to
> installation on mac OSX Sierra). i have passed the ./configure stage and
> now stuck in the "make" (i am running everything through the terminal)
>
> when i try to run
>
> make LDFLAGS=”-L/path/to/ffi -lffi”   ​(according to the recommendation
> by John)
>
> i get the following error(s):
>
> Undefined symbols for architecture x86_64:
>   "_ffi_call", referenced from:
>   _scm_i_foreign_call in libguile_2.0_la-foreign.o
>   "_ffi_closure_alloc", referenced from:
>   _scm_procedure_to_pointer in libguile_2.0_la-foreign.o
> .
> .
> .
> .
>
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[3]: *** [libguile-2.0.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
> all the "undefined symbols" have "ffi" in them
>
> what this could be? and how can i solve it? (reminder i'm working through
> terminal so i'll appreciate it if solutions involving for example Xcode
> will be tiresomely detailed as i'm completely novice in these things)
>
> thnx in advance
>
> ___
> 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] fail to compile c++ demo code

2019-02-25 Thread Christopher Hogan
Hi,

Try adding `-lctlgeom` (provided by libctl) when invoking g++.

Chris

On Fri, Feb 22, 2019 at 8:39 PM Yikai Kan  wrote:

> Dear all,
>
> I try to compile the c++ demo code flux.cpp with:
> export LD_LIBRARY_PATH=$HOME/usr/lib:$LD_LIBRARY_PATH
> export LD_RUN_PATH=$HOME/usr/lib:$LD_RUN_PATH
> g++ -I$HOME/usr/include -L$HOME/usr/lib -Wl,-rpath=$HOME/usr/lib -lmeep
> -lhdf5 -lz -lm flux.cpp
>
> I got the following error message:
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `display_geometric_object_info'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `vector3_plus'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `geometry_center'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `dimensions'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `normal_to_fixed_object'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `display_geom_box_tree'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `unit_vector3'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `create_geom_box_tree0'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `make_sphere'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `object_of_point_in_tree'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `vector3_equal'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `geom_box_tree_stats'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to `cvector3_equal'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `box_overlap_with_object'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `default_material'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `geometry_lattice'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `ensure_periodicity'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `adaptive_integration'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `geom_fix_object_list'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `geom_initialize'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `destroy_geom_box_tree'
> /home/ykkan2018/usr/lib/libmeep.so: undefined reference to
> `material_of_unshifted_point_in_tree_inobject'
> collect2: error: ld returned 1 exit status
>
> Does anyone know how to solve this problem?
> This is how I configure meep during installation:
> ./configure CC=mpicc CXX=mpic++ CPPFLAGS=-I/home/ykkan2018/usr/include
>  LDFLAGS=-L/home/ykkan2018/usr/lib --with-mpi --without-python
> --without-scheme --without-libctl
> --prefix=/home/ykkan2018/usr
>
> Thank you for your help.
>
> Regards,
> Yikai Kan
>
> ___
> 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] Import error after installation on Xubuntu / conda

2019-02-19 Thread Christopher Hogan
Hi,

> I installed it as suggested on the website:
> conda install -c chogan -c conda-forge pymeep

The documentation recommends creating a new conda environment for each
version of pymeep you install. This often solves dependency issues (in your
case MPB 1.7 is required).

$ conda create -n mp1.7 -c chogan -c conda-forge pymeep
$ conda activate mp1.7

Chris


On Tue, Feb 19, 2019 at 9:00 AM Jonathan  wrote:

> Hey,
>
> I encountered a strange error, when installing meep using conda on
> Xubuntu 18.4. When I import meep, it prints:
>
> Python 3.7.2 (default, Dec 29 2018, 06:19:36)
> [GCC 7.3.0] :: Anaconda, Inc. on linux
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import meep
> Traceback (most recent call last):
>File "", line 1, in 
>File
> "/home/kleinj/miniconda3/lib/python3.7/site-packages/meep/__init__.py",
> line 8, in 
>  from . import _meep
> ImportError:
> /home/kleinj/miniconda3/lib/python3.7/site-packages/meep/../../../libmeep.so.12:
>
> undefined symbol: maxwell_dominant_planewave
>
>
>
> I installed it as suggested on the website:
>
> conda install -c chogan -c conda-forge pymeep
>
>
> The libraries I have currently installed are:
>
> # packages in environment at /home/kleinj/miniconda3:
> #
> # NameVersion   Build  Channel
> asn1crypto0.24.0   py37_0
> blas  1.0 mkl
> ca-certificates   2018.11.29   ha4d7672_0conda-forge
> certifi   2018.11.29py37_1000conda-forge
> cffi  1.11.5   py37he75722e_1
> chardet   3.0.4py37_1
> conda 4.6.4py37_0conda-forge
> conda-env 2.6.0 1
> cryptography  2.5  py37h1ba5d50_0
> fftw  3.3.8h7b6447c_3
> gsl   2.4  h14c3975_4
> h5py  2.9.0py37h7918eee_0
> h5utils   1.13  4chogan
> harminv   1.4.1 4chogan
> hdf5  1.10.4   hb1b8bf9_0
> hdf5-parallel 1.10.22chogan
> idna  2.8  py37_0
> intel-openmp  2019.1  144
> libctl4.2.0h14c3975_0chogan
> libedit   3.1.20181209 hc058e9b_0
> libffi3.2.1hd88cf55_4
> libgcc-ng 8.2.0hdf63c60_1
> libgfortran   3.0.0 1conda-forge
> libgfortran-ng7.3.0hdf63c60_0
> libopenblas   0.3.3h5a2b251_3
> libpng1.6.36   hbc83047_0
> libstdcxx-ng  8.2.0hdf63c60_1
> mkl   2019.1  144
> mkl_fft   1.0.10   py37ha843d7b_0
> mkl_random1.0.2py37hd81dba3_0
> mpb   1.6.2 4chogan
> mpi   1.0   mpichconda-forge
> mpich 3.2.1 h1c2f66e_1008conda-forge
> ncurses   6.1  he6710b0_1
> numpy 1.15.4   py37h7e9f1db_0
> numpy-base1.15.4   py37hde5b4d6_0
> openblas  0.3.3 h9ac9557_1001conda-forge
> openssl   1.1.1ah14c3975_1000conda-forge
> pip   19.0.1   py37_0
> pycosat   0.6.3py37h14c3975_0
> pycparser 2.19 py37_0
> pymeep1.7.0py37hda9ffc6_2conda-forge
> pyopenssl 19.0.0   py37_0
> pysocks   1.6.8py37_0
> python3.7.2h0371630_0
> readline  7.0  h7b6447c_5
> requests  2.21.0   py37_0
> ruamel_yaml   0.15.46  py37h14c3975_0
> scipy 1.2.0py37h7c811a0_0
> setuptools40.8.0   py37_0
> six   1.12.0   py37_0
> sqlite3.26.0   h7b6447c_0
> tk8.6.8hbc83047_0
> urllib3   1.24.1   py37_0
> wheel 0.32.3   py37_0
> xz5.2.4h14c3975_4
> yaml  0.1.7had09818_2
> zlib  1.2.11   

Re: [Meep-discuss] Far Field Flux using python flux function in 3D

2019-02-19 Thread Christopher Hogan
Karl-Johan,

It's possible that your package already has the feature Ardavan mentioned
(I haven't updated the nightly packages to reflect the new version yet). Go
ahead and try it. If it doesn't work, then you should be able to run `conda
update -c chogan/label/dev -c chogan -c conda-forge pymeep-parallel` to get
the latest (assuming you're using the parallel version. If you're using the
serial version, the new feature won't help).

Chris

On Tue, Feb 19, 2019 at 3:04 AM Karl-Johan Olofsson 
wrote:

> So the script finished in about 4 hours. So in order to install version
> 1.8, do I have to build it from source? If that's the case, is there any
> estimation when the conda pymeep package is uploaded (on conda-forge)?
>
> Karl-Johan
> --
> *Från:* Karl-Johan Olofsson
> *Skickat:* den 18 februari 2019 19:11:07
> *Till:* Christopher Hogan
> *Kopia:* meep-discuss@ab-initio.mit.edu
> *Ämne:* SV: [Meep-discuss] Far Field Flux using python flux function in 3D
>
>
> So all the volumes looks as following
>
>
> volx=mp.Volume(center=mp.Vector3(r,0,0),size=mp.Vector3(2*r,0,0),dims=3)
> ...
>
>
> I also set res_ff = 1
>
>
> The code finishes the time stepping but has been stuck calculating the far
> field flux for about 2 hours now for a sim cell (4,4,4) resolution=40 and
> time=5. So something seems to not be working properly.
>
>
> Karl-Johan
> --
> *Från:* Christopher Hogan 
> *Skickat:* den 18 februari 2019 12:10:40
> *Till:* Karl-Johan Olofsson
> *Kopia:* meep-discuss@ab-initio.mit.edu
> *Ämne:* Re: [Meep-discuss] Far Field Flux using python flux function in 3D
>
> Hi,
>
> Can you try passing an extra keyword argument, `dims=3` to the Volume
> constructors for volx, volmx, voly, etc.?
>
> Chris
>
> On Mon, Feb 18, 2019 at 6:53 AM Karl-Johan Olofsson <
> karol...@student.liu.se> wrote:
>
> Hello! I downloaded pymeep 1.7.1 dev version recently from conda-forge and
> been trying to use the far field flux function but I can't get it to work
> in 3D. Here is a snipet of the relevant code:
>
>
> nearfieldregion1=mp.Near2FarRegion(
> center=mp.Vector3(0,0,-sz/2+2*padding),
> size=mp.Vector3(sx/2-padding*2,sy/2-padding*2,0),
> direction=mp.Z,
> weight=-1)
>
> nearfieldregion6=mp.Near2FarRegion(
> center=mp.Vector3(0,0,sz/2-2*padding),
> size=mp.Vector3(sx/2-padding*2,sy/2-padding*2,0),
> direction=mp.Z)
>
> nearfieldregion2=mp.Near2FarRegion(
> center=mp.Vector3(sx/2-padding*2,0,0),
> size=mp.Vector3(0,sy/2-padding*2,sz/2-padding*2),
> direction=mp.X)
>
> nearfieldregion3=mp.Near2FarRegion(
> center=mp.Vector3(-sx/2+padding*2,0,0),
> size=mp.Vector3(0,sy/2-padding*2,sz/2-padding*2),
> direction=mp.X,
> weight=-1)
>
> nearfieldregion4=mp.Near2FarRegion(
> center=mp.Vector3(0,sy/2-padding*2,0),
> size=mp.Vector3(sx/2-padding*2,0,sz/2-padding*2),
> direction=mp.Y)
>
> nearfieldregion5=mp.Near2FarRegion(
> center=mp.Vector3(0,-sy/2+padding*2,0),
> size=mp.Vector3(sx/2-padding*2,0,sz/2-padding*2),
> direction=mp.Y,
> weight=-1)
>
>
>  
> nearfield=sim.add_near2far(fcen,df,nfreq,nearfieldregion1,nearfieldregion2,nearfieldregion3,
> nearfieldregion4,nearfieldregion5,nearfieldregion6)
>
>  r=20
>
> volx=mp.Volume(center=mp.Vector3(r,0,0),size=mp.Vector3(0,2*r,2*r))
>   volmx=mp.Volume(center=mp.Vector3(-r,0,0),size=mp.Vector3(0,2*r,2*r))
> voly=mp.Volume(center=mp.Vector3(0,r,0),size=mp.Vector3(2*r,0,2*r))
> volmy=mp.Volume(center=mp.Vector3(0,-r,0),size=mp.Vector3(2*r,0,2*r))
> volz=mp.Volume(center=mp.Vector3(0,0,r),size=mp.Vector3(2*r,2*r,0))
> volmz=mp.Volume(center=mp.Vector3(0,0,-r),size=mp.Vector3(2*r,2*r,0))
>
> res_ff=5
>
> ff_flux = nearfield1.flux(mp.X,volx,res_ff) -
> nearfield.flux(mp.X,volmx,res_ff)[0]+ nearfield.flux(mp.Y,voly,res_ff)[0]-
> nearfield.flux(mp.Y,volmy,res_ff)[0]+ nearfield.flux(mp.Z,volz,res_ff)[0]-
> nearfield.flux(mp.Z,volmz,res_ff)[0]
>
>  I get the error
> "meep: wrong dimensionality in green2d" when running the code.
>
> Warm greetings,
> Karl-Johan
>
>
>
> ___
> 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
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] geometry material attribute is not working

2019-02-04 Thread Christopher Hogan
The `fused_quartz` material has epsilon=1, which is the same as the
background default material, which is why nothing shows up in the plot.
Changing the material to `mp.Medium(epsilon=12)`, for example, displays the
geometry correctly.

On Fri, Feb 1, 2019 at 9:46 PM Bao Nguyen  wrote:

> Hello,
>
> I just installed Meep and I'm currently trying to play around with the
> material option but it is not working.
> Basically, I copied the tutorial on the wave guide and modified the
> material. When I tried to plot the dielectric material, it didn't show
> anything but the background. I've tried this for different materials and
> the results are the same.
> I have copied my program below.
> Thank you in advance for your help.
>
> ---
> from __future__ import division
>
> import meep as mp
> from meep.materials import fused_quartz
> cell = mp.Vector3(16,8)
>
> geometry = [mp.Block(mp.Vector3(mp.inf,1,mp.inf),
>  center=mp.Vector3(),
>  material= fused_quartz)]
>
> sources = [mp.Source(mp.ContinuousSource(frequency=0.15),
>  component=mp.Ez,
>  center=mp.Vector3(-7,0))]
>
> pml_layers = [mp.PML(1.0)]
>
> resolution = 10
>
> sim = mp.Simulation(cell_size=cell,
> boundary_layers=pml_layers,
> geometry=geometry,
> sources=sources,
> resolution=resolution)
>
> sim.run(until=200)
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> eps_data = sim.get_array(center=mp.Vector3(), size=cell,
> component=mp.Dielectric)
> plt.figure()
> plt.imshow(eps_data.transpose(), interpolation='spline36', cmap='binary')
> plt.axis('off')
> plt.show()
> -
> ___
> 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] Class methods as materials functions

2019-01-30 Thread Christopher Hogan
Hi Ian,

Setting attributes on class methods is not allowed in Python, but you can
get around this by putting your material function in the `__call__` method
of your class. That makes your class instance callable just like a
function. However, this will require the changes in PR #691 (
https://github.com/NanoComp/meep/pull/691) before it will work.

Chris

On Tue, Jan 29, 2019 at 2:39 PM Ian Sage  wrote:

> I am able to tailor Meep sources by using a src_func, and have no
> problem writing that function either as a plain standalone, or as a
> class method. The latter is often handy if only to avoid a proliferation
> of global variables etc. Equally, I can create custom materials by
> providing a material_function - provided I write this as a standalone.
> If I try to implement a material_function as a class method, I see an
> error thrown by the line defining the GeometricObject, which ends in:
>
> File "/usr/local/lib/python3.5/site-packages/meep/geom.py", line 391, in
> __init__
>  super(Block, self).__init__(**kwargs)
>File "/usr/local/lib/python3.5/site-packages/meep/geom.py", line 306,
> in __init__
>  material.eps = False
> AttributeError: 'method' object has no attribute 'eps'
>
> Is it possible to use a class method as a materials_function? Do I need
> a different idiom?
>
> Many thanks for any advice,
>
> Ian
>
>
> ___
> 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] Python MPB Documentation problem (or not)?

2019-01-21 Thread Christopher Hogan
Hi John,

You have an extra `ms.output_epsilon()` call in the `run` function.
`output_epsilon` isn't a band function, so you can only call it before or
after `run`.

Chris

On Mon, Jan 21, 2019 at 2:35 PM John Weiner  wrote:

> Hi again Chris,
>
> Sorry to bother you again, but I’m still having some trouble (not the same
> trouble).
> Here is what I do to output epsilon.h5 when running the ModeSolver in
>  pythonmpb.
>
> Import meep.mpb as mpb
> …
> ms = mpb.ModeSolver(num_bands=num_bands,
> k_points=k_points,
> geometry=geometry,
> geometry_lattice=geometry_lattice,
> resolution=resolution)
> ms.init_params(mp.ODD_Z,True) #the odd parity in z is due to the Hz
> component.  According to the docs, this should be equivalent to ms.run_tm(…)
> ms.output_epsilon()
>
> ms.run(ms.output_epsilon(),mpb.output_at_kpoint(mp.Vector3(0.5,0,0),mpb.output_hfield_z))
>
> This actually does generate the epsilon.h5 file, but there is some other
> problem that stops the solver after it starts.
>
> Here is the error message I get…
>
> Traceback (most recent call last):
>   File "first_band_structure.py", line 29, in 
>
> ms.run(ms.output_epsilon(),mpb.output_at_kpoint(mp.Vector3(0.5,0,0),mpb.output_hfield_z))
>   File
> "/Users/johnweiner/miniconda3/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py",
> line 814, in run
> self.run_parity(mp.NO_PARITY, True, *band_functions)
>   File
> "/Users/johnweiner/miniconda3/envs/mp/lib/python3.6/site-packages/meep/mpb/solver.py",
> line 788, in run_parity
> num_args = get_num_args(f)
>   File
> "/Users/johnweiner/miniconda3/envs/mp/lib/python3.6/site-packages/meep/simulation.py",
> line 35, in get_num_args
> return func.__code__.co_argcount
> AttributeError: 'NoneType' object has no attribute '__code__'
>
> On Jan 21, 2019, at 2:27 PM, John Weiner  wrote:
>
> Thanks Chris, much obliged.
>
> John
>
> Envoyé de mon iPhone
>
> Le 21 janv. 2019 à 14:25, Christopher Hogan  a écrit :
>
> Hi John,
>
> Outputting epsilon.h5 used to be the default for Python, but that was
> changed in PR #401 (https://github.com/NanoComp/meep/pull/401) as a
> response to issue 387 (https://github.com/NanoComp/meep/issues/387). It
> looks like the documentation was never updated. I'll take care of that.
>
> To output epsilon, you can do the following:
>
> ```
> import meep.mpb as mpb
>
> ms = mpb.ModeSolver(...)
> ms.init_params(...) # See documentation for an explanation of the arguments
> ms.output_epsilon()
> ```
>
> You can also call `ms.output_epsilon()` after any of the `run` functions.
>
> Chris
>
> On Mon, Jan 21, 2019 at 11:55 AM John Weiner  wrote:
>
>> Meep and MPB Users and Developers,
>>
>> I have been experimenting with the python version of MPB and found in the
>> Run Functions section of the MPB Documentation on readthedocs the following
>> statement under ModeSolver.run(*band_func)
>>
>> This runs the simulation described by the input parameters (see above),
>> with no constraints on the polarization of the solution. That is, it reads
>> the input parameters, initializes the simulation, and solves for the
>> requested eigenstates of each k-point. *The dielectric function is
>> outputted to* epsilon.h5*before any eigenstates are computed *(my
>> emphasis).
>>
>> However, when I invoke the mode solver with a python line such as,
>>
>> ms.run_tm(mpb.output_at_kpoint(mp.Vector3(0.5,0,0),mpb.output_hfield_z))
>>
>> epsilon.h5 does not appear to be output.  The hz field files in h5
>> format were output as expected.  Several attempts to obtain epsilon.h5 by
>> various tactics were unsuccessful.  I did notice that running the scheme 
>> version
>> DOES generate the epsilon.h5 file without an explicit argument in the run
>> command.
>>
>> Is there a problem with the documentation, with the code or with me?
>>
>> Best regards,
>>
>> John
>> ___
>> 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] Python MPB Documentation problem (or not)?

2019-01-21 Thread Christopher Hogan
Hi John,

Outputting epsilon.h5 used to be the default for Python, but that was
changed in PR #401 (https://github.com/NanoComp/meep/pull/401) as a
response to issue 387 (https://github.com/NanoComp/meep/issues/387). It
looks like the documentation was never updated. I'll take care of that.

To output epsilon, you can do the following:

```
import meep.mpb as mpb

ms = mpb.ModeSolver(...)
ms.init_params(...) # See documentation for an explanation of the arguments
ms.output_epsilon()
```

You can also call `ms.output_epsilon()` after any of the `run` functions.

Chris

On Mon, Jan 21, 2019 at 11:55 AM John Weiner  wrote:

> Meep and MPB Users and Developers,
>
> I have been experimenting with the python version of MPB and found in the
> Run Functions section of the MPB Documentation on readthedocs the following
> statement under ModeSolver.run(*band_func)
>
> This runs the simulation described by the input parameters (see above),
> with no constraints on the polarization of the solution. That is, it reads
> the input parameters, initializes the simulation, and solves for the
> requested eigenstates of each k-point. *The dielectric function is
> outputted to* epsilon.h5*before any eigenstates are computed *(my
> emphasis).
>
> However, when I invoke the mode solver with a python line such as,
>
> ms.run_tm(mpb.output_at_kpoint(mp.Vector3(0.5,0,0),mpb.output_hfield_z))
>
> epsilon.h5 does not appear to be output.  The hz field files in h5 format
> were output as expected.  Several attempts to obtain epsilon.h5 by various
> tactics were unsuccessful.  I did notice that running the scheme version
> DOES generate the epsilon.h5 file without an explicit argument in the run
> command.
>
> Is there a problem with the documentation, with the code or with me?
>
> Best regards,
>
> John
> ___
> 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] A problem in installing Meep

2019-01-14 Thread Christopher Hogan
Hello,

If you can't get the CentOS instructions here (
https://meep.readthedocs.io/en/latest/Build_From_Source/#centos-7) to work,
then I suggest you install the pre-built conda package. Details can be
found here:
https://meep.readthedocs.io/en/latest/Installation/#conda-packages

Chris

On Sat, Jan 12, 2019 at 9:20 AM Villanelle <2105936...@qq.com> wrote:

> Hello All,
>
> I am trying to install Meep on my computer, but there is something wrong
> happened. I used the tutorials for Centos7 on the official website.
>
> If I run
>
> python/Makefile.am:113:installing './py-compile'
>
> I received the message
>
> ..py-compile: line 118: python3: command not found
>
>  Because I haven't any experience with Meep I have no idea how I should 
> proceed.
>
> Thanks in advance for any hints
>
> Villanelle
>
>
>
> ___
> 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] Installation problem on ubuntu 16.04

2018-12-31 Thread Christopher Hogan
Hi,

libctlgeom was not found, which is part of libctl. So, either libctl is not
installed, or was not installed with --enable-shared, or was installed into
a non-standard location. If the latter is the case, you can add
--with-libctl=/your/path/to/libctl/share to the Meep autogen.sh flags.

On Sat, Dec 29, 2018 at 9:10 PM Aly Refay  wrote:

> Hello,
>
> First, thank you for the free MEEP.
>
> I have a problem installing it on an ubuntu 16.04 machine, I am following
> the instructions on
>
> https://github.com/stevengj/meep/blob/master/doc/docs/Build_From_Source.md#building-from-source
>
> Every thing runs smoothly except for the last step. When I try to run
> "
>
> sh autogen.sh --enable-shared --with-mpi PYTHON=python3 \
> CC=mpicc CXX=mpic++ LDFLAGS="${MY_LDFLAGS}" CPPFLAGS="${MY_CPPFLAGS}"
>
> "
> I receive the following message
> " configure: error: libctlgeom was not found, is required for Python
> interface "
> can you please tell me how to fix this?
>
> thanks in advance
> Aly
> ___
> 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] missing LDOS global variable (beginner question)

2018-10-24 Thread Christopher Hogan
Hi Christoph,

The documentation is incorrect. The data is actually stored in the
`ldos_data` member of the `Simulation` object. See
meep/python/tests/ldos.py for an example. I'll update the docs.

Thanks for catching this,

Chris

On Wed, Oct 24, 2018 at 2:25 PM, Christoph Kleinhans <
christ...@kleinhans-web.de> wrote:

> Dear Meep users,
>
> I calculate in py_meep the ldos for a Gaussian Source and when I
> understand the documentation correct, I simply run it like this:
>
>
> def ldos_calculation():
> sim = ...#Simulation object with Gaussian Source and Bloch
> periodicity
> sim.run(mp.dft_ldos(fcen,df,nfreq), 
> until_after_sources=mp.stop_when_fields_decayed(50,
> mp.Hz, pt, 1e-6))
>
> if __name__ == '__main__':
> ldos_calcualtion()
>
>
> I get the output in the console for nfreq, but there is no global variable
> dft_ldos_data which I can access.
> Tried it also in different ways in the newest official release and in the
> nightly build - no global variable.
>
> Hopefully someone got time to answer me that question.
> Thanks.
>
> Best Regards
> Christoph
>
>
> ___
> 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] Problem with absolutely clean install?

2018-10-18 Thread Christopher Hogan
Hi Doug,

As of Meep 1.5, the get_array prototype now looks like this:

get_array(vol=None, center=None, size=None component=mp.Ez, cmplx=False,
arr=None)

It allows you to specify a region by either a volume, or a center and size.
You probably want

eps_data = sim.get_array(center=mp.Vector3(), size=cell,
component=mp.Dielectric)

The full documentation is under "Array Slices" at
https://meep.readthedocs.io/en/latest/Python_User_Interface/

Chris

On Thu, Oct 18, 2018 at 4:11 PM, Doug McKnight  wrote:

> Hello,
> I'm sure I'm doing something stupid, or have forgotten about something I
> did last time I installed Meep.
>
> I have set up an absolutely fresh, un-messed-with Ubuntu 18.04 (virtual)
> system.
> I followed the exact steps for the miniconda install. Namely
>
> wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O 
> miniconda.sh
> bash miniconda.sh -b -p export 
> PATH=/bin:$PATHconda create -n mp -c chogan -c conda-forge 
> pymeepsource activate mp
>
> All is apparently fine, but when I try to run a file that works fine on my 
> other Ubuntu 18.04 system,
> that I installed about 6 or 8 months ago, I get the following error triggered 
> by simulation.get_array
> Traceback (most recent call last):
>   File "edgeTest.py", line 65, in 
> eps_data = sim.get_array(mp.Vector3(), cell, mp.Dielectric)
>   File 
> "/home/doug/miniconda3/envs/mp/lib/python3.6/site-packages/meep/simulation.py",
>  line 1307, in get_array
> self.fields.get_array_slice_dimensions(v, dim_sizes)
>   File 
> "/home/doug/miniconda3/envs/mp/lib/python3.6/site-packages/meep/__init__.py", 
> line 3520, in get_array_slice_dimensions
> return _meep.fields_get_array_slice_dimensions(self, where, dims, data)
> NotImplementedError: Wrong number or type of arguments for overloaded 
> function 'fields_get_array_slice_dimensions'.
>   Possible C/C++ prototypes are:
> meep::fields::get_array_slice_dimensions(meep::volume const &,size_t 
> [3],void *)
> meep::fields::get_array_slice_dimensions(meep::volume const &,size_t [3])
>
>
> Has something changed in get_array? What am I missing here?
>
> Thanks,
> Doug
>
>
>
> ___
> 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] Version problem with dynamic library

2018-10-11 Thread Christopher Hogan
Hi John,

When I create a new environment with pymeep-parallel, and run `otool -L
/path/to/miniconda/envs/pmp/bin/h5topng` , I see

 @rpath/libpng16.16.dylib (compatibility version 52.0.0, current version
52.0.0)

And everything works as expected. Could you try recreating the environment?

$ source deactivate
$ conda env remove -n pmp
$ conda create -n pmp -c chogan/label/dev -c chogan -c conda-forge
pymeep-parallel
$ source activate pmp

It's also possible that you installed a package that required a different
version of libpng. `conda list` should show

libpng1.6.35   ha92aebf_2conda-forge

If the "conda-forge" channel is missing in the `conda list` output for
libpng, then you have a version from the "defaults" channel.

Chris

On Thu, Oct 11, 2018 at 2:22 AM, John Weiner  wrote:

> Dear Meep users, developers and maintainers,
>
> Trying to invoke h5topng today, while running python meep, I ran into this
> problem.  Is there an updated version of libpng?
>
> Best regards,  John
>
> dyld: Library not loaded: @rpath/libpng16.16.dylib
>   Referenced from: /Users/johnweiner/miniconda3/envs/pmp/bin/h5topng
>   Reason: Incompatible library version: h5topng requires version 52.0.0 or
> later, but libpng16.16.dylib provides version 51.0.0
> Abort trap: 6
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] ./configure gets error

2018-10-04 Thread Christopher Hogan
You can try running `sh autogen.sh`, which runs autoreconf and configure
with appropriate options. It looks like the AM_INIT_AUTOMAKE macro was not
expanded. Do you have automake installed? Which version? Which OS are you
on?

Chris

On Thu, Oct 4, 2018 at 5:29 AM, ei ru <37zi...@gmail.com> wrote:

> Dear MEEP users.
> I tried to install meep.
> However it gets errors.
>
> I execute the commands in the following way
>
> git clone https://github.com/stevengj/meep
> sudo apt-get install libtool
> autoconf
> ./configure
>
> However it gets
> ./configure: line 2300: syntax error near unexpected token `foreign'
> ./configure: line 2300: `AM_INIT_AUTOMAKE(foreign color-tests
> parallel-tests silent-rules 1.11)'
>
> Please help me.
> 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 mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] Compiling MEEP inside Anaconda environment with mkl

2018-09-19 Thread Christopher Hogan
Hi Colton,

> A quick request of Christopher Hogan, would you be able to provide an
up-to-date guile package through your channel?

I've uploaded guile 2.2.4 packages for Linux and MacOS to my chogan channel.

Regards,

Chris

On Thu, Aug 16, 2018 at 10:56 PM, Colton Bukowsky  wrote:

> A quick request of Christopher Hogan, would you be able to provide an
> up-to-date guile package through your channel? I am relying on the channel
> 'tsnyder' right now, and it looks abandoned.
>
> I thought this would be the best place to share this script. It took me a
> while to get this working, but with GNU compilers it looks like one can
> install MEEP, contained to an Anaconda Python environment. The motivation
> for this was to not require sudo access for any part of the installation.
> Not included in the script, you will need an Anaconda environment and your
> preferred version of gcc. I used gcc-7 in order to be able to target the
> latest Intel skylake optimizations. If you are unfamiliar with these, don't
> uncomment the specified lines. I saved this as "gnucompile_MEEP.sh" in my
> home directory. Compiled on Ubuntu 16.04. Good Luck!
>
> ___SCRIPT BELOW__
> #!/bin/bash
> # c...@caltech.edu Aug 2018
> # This might not be the easiest way to compile a system specific MEEP
> installation isolated in
> # an anaconda environment. I imagine that some parts are incorrect or
> redundant, but
> # all tests and checks pass as of Aug 1, 2018.
>
> # This uses the mkl libraries from intel, which are default with the
> anaconda packages -- one might get better performance using intel's conda
> channel
> # This would be done by using '-c intel' when installing and the
> descending precedence of channels
>
> set -e # set the script to fail completely if a command has an error
>
> # Hard coding the number of cpus to use; this might be different if you
> don't have more than 4 cores or would like to use more.
> export NPROCS=4
>
> # Pass the environment name as the only argument to the script
> # For a fresh installation, you'll want to run
> # user@local $~ gnucompile_MEEP.sh mycompiledMEEPenv -rcenv
> # If you only want to compile (or re-compile after updates, hence '-rcXXX'
> prefix) portions of the suite into an existing conda environment
> # you can pass the options below, e.g. to only compile h5py and meep from
> source:
> # `gnucompile_MEEP.sh mycompiledMEEPenv -rch5py -rcmeep`
> RCHDF5=false
> RCOPENMPI=false
> RCH5PY=false
> RCMPI4PY=false
> RCGSL=false
> RCENV=false
> RCFFTW=false
> RCH5UTILS=false
> RCHARMINV=false
> RCLIBCTL=false
> RCMPB=false
> RCMEEP=false
> RCMEEPALL=false
> RUNFINALTESTS=true
> export SRCBUILDDIR="${HOME}/gnu_src_build"
> COMPILERS="gnu"
> export CONDATRGTENV="compiledMEEP"
>
> while [ -n "$1" ];
> do
>   case "$1" in
> -rchdf5) RCHDF5=true;
>   RCH5PY=true;;
> -rch5py) RCH5PY=true;;
> -rcopenmpi) RCOPENMPI=true;;
> -rcmpi4py) RCMPI4PY=true;;
> -rcgsl) RCGSL=true;;
> -rcenv) RCENV=true;
>   RCOPENMPI=true;
>   RCHDF5=true;
>   RCH5PY=true;
>   RCMPI4PY=true;
>   RCFFTW=true;
>   RCGSL=true;
>   RCHARCMINV=true;
>   RCLIBCTL=true;
>   RCH5UTILS=true;
>   RCMPB=true;
>   RCMEEP=true;;
> -source-dir) export SRCBUILDDIR=$2;
>   shift;;
> -n) export CONDATRGTENV=$2;
>   shift;;
> -j) export NPROCS=$2;
>   shift;;
> -rcfftw) RCFFTW=true;;
> -rcharminv) RCHARMINV=true;;
> -rclibctl) RCLIBCTL=true;;
> -rch5utils) RCH5UTILS=true;;
> -rcmpb) RCMPB=true;;
> -rcmeep) RCMEEP=true;;
> -rcmeep-all) RCENV=false;
>   RCHARCMINV=true;
>   RCLIBCTL=true;
>   RCH5UTILS=true;
>   RCMPB=true;
>   RCMEEP=true;;
> -no-final-tests) RUNFINALTESTS=false;;
> -rcall) RCOPENMPI=true;
>   RCHDF5=true;
>   RCGSL=true;
>   RCMPI4PY=true;
>   RCH5PY=true;
>   RCFFTW=true;
>   RCHARCMINV=true;
>   RCLIBCTL=true;
>   RCH5UTILS=true;
>   RCMPB=true;
>   RCMEEP=true;;
> esac
> shift
> done
> source $HOME/anaconda3/bin/activate base
> if $RCENV;
> then
>   conda env remove -n "$CONDATRGTENV" -y || true
>   conda create -n $CONDATRGTENV --override-channels -c chogan -c defaults
> -c conda-forge -c tsnyder python=3.6 mkl libpng numpy scipy cython autoconf
> automake libtool swig cmake libffi six guile pip setuptools jupyter ipython
> ipyparallel jupyter_contrib_nbextensions PyHamcrest 
> jupyter_nbextensions_configurator
> matplotlib -y;
> source $HOME/anaconda3/bin/a

Re: [Meep-discuss] Does get_array(...) synchronize the magnetic field?

2018-09-18 Thread Christopher Hogan
Hi Thomas,

> I just want to know if calls to get_array(...) synchronize the magnetic
field.

Looking at the code, it appears the answer is no. You can use the
synchronization functions described here:

https://meep.readthedocs.io/en/latest/Synchronizing_the_Magnetic_and_Electric_Fields/#synchronization-functions

Chris

On Tue, Sep 18, 2018 at 10:21 AM, Thomas AUZINGER 
wrote:

> Hi,
>
> As in the subject, I just want to know if calls to get_array(...)
> synchronize the magnetic field. If not, how would I ensure that before
> calling get_array(...)?
>
> All the best,
> Thomas
>
>
> ___
> 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] materials_library module

2018-09-17 Thread Christopher Hogan
Hi John,

As of meep 1.6, the materials_library.py file has been integrated into the
meep package itself, and can be accessed via meep.materials. It is likely
that you have an older version of the pymeep package installed. You can
update to 1.6 with the command `conda update -c chogan -c conda-forge
pymeep`. The old materials_library.py now lives at meep/python/materials.py
in the repo.

Chris

On Sun, Sep 16, 2018 at 3:40 PM, John Weiner  wrote:

> Thanks Thomas for this script.  I will try it out ASAP and report the
> results.
>
> Best regards,
>
> John
>
>
> On 16 Sep 2018, at 22:36, Thomas AUZINGER  wrote:
>
> Dear John,
>
> I had the same problem and after some attempts to find a reproducible way
> to identify the path where the materials library should be located, I gave
> up and pulled the file directly from its repository. For this, I wrote the
> following script:
>
> import os
> import urllib.request
>
> def download_material_library(folderpath):
> # Download materials library directly from online repository.
> module_name = 'materials_library.py'
> url = ('https://github.com/stevengj/meep/raw/master/python/examples/'
> +
>module_name)
> filepath = os.path.join(folderpath, module_name)
> if not os.path.exists(filepath):
> try:
> content = urllib.request.urlopen(url).read()
> except urllib.request.URLError:
> print('Failed to download materials library.')
> raise
> with open(filepath, 'bw') as library_file:
> library_file.write(content)
>
> In the file where you want to use the library, you add
>
>
> import os
> import meep as mp
> import ABOVE_SCRIPT
>
> ABOVE_SCRIPT.download_material_library(os.path.dirname(__file__))
> from CURRENT_PACKAGE import materials_library  # pylint:
> disable=wrong-import-position
>
> You just have to select names for ABOVE_SCRIPT and CURRENT_PACKAGE. The
> last line should import materials_library, which was downloaded by the
> command above it.
> This script checks if materials_library already exists and avoids
> redownloading it. Thus, the file can become outdated. Just delete it to
> redownload it.
>
> Cheers,
> Thomas
>
> On 16-Sep-18 21:36, John Weiner wrote:
>
>
>
> Dear meep users, maintainers and developers,
>
> Today I was experimenting with the materials_library.py which can be found
> in the /examples subdirectory, installed via the conda package.  As a first
> step I tried to run one of the examples that uses the library,
> refl-quartz.py.
>
> The first two lines of this script are:
>
> import meep as mp
> from meep.materials import fused_quartz
>
> which, according to the docs, should work.  When I run the script,
> however, I get an error message,
>
> Traceback (most recent call last):
>   File "refl-quartz.py", line 2, in 
> from meep.materials import fused_quartz
> ModuleNotFoundError: No module named ‘meep.materials’
>
> I tried using a few other “home-made” scripts with the same result.
> Apparently the module cannot be found or I am using the wrong syntax.
>
> The python version of meep is installed in the miniconda3/ directory,
> following the instructions by Chris Hogan, and the mp environment is
> activated.  Everything else works as it should, and I have run several of
> the other tutorials (refl-angular.py, bent_waveguide.py) without any
> problems.  The problem therefore seems to be confined to the meep.materials
> module.
>
> I would greatly appreciate any suggestion that might relieve my perplexity.
>
> Best regards,
>
> John
>
>
> ___
> meep-discuss mailing 
> listmeep-disc...@ab-initio.mit.eduhttp://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
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] General problem with frequency-domain solver

2018-09-06 Thread Christopher Hogan
Hi Christoph,

You mentioned you are using the conda packages, but are you using the
official release or the nightly builds?

If you install the nightly build form the channel "chogan/label/dev" as
described here
, then
you can run the files in python/examples (including solve-cw.py) directly
from the HEAD of the master branch. However, if you installed the latest
official release (1.5) from the "chogan" channel, then you will need to use
the version of the examples that correspond to that release.
 You can check out the the 1.5 version as follows:

$ cd meep
$ git checkout v1.5.0

I hope that helps,

Chris

On Thu, Sep 6, 2018 at 3:32 PM, Christoph Kleinhans <
christ...@kleinhans-web.de> wrote:

> Dear Meep Users,
>
>
> in Python, having a plane wave gaussian source, propagating in different
> angles on a Lorentz-Drude structure and measuring the reflection at the
> different angles, is working just perfect, but:
>
>
> When it comes to frequency-domain solver with a CW (without Lorentz-Drude
> Material) or to LDOS calculation, Meep is giving me following error:
>
> For example, when I use the frequency-domain solver:
> AttributeError: 'Simulation' object has no attribute 'init_sim'
>
>
> The Simulation object is initialized in my memory. I first thought I had
> an mistake in my Python script, but even the frequency-domain tutorial
> script gives me that error message.
>
>
> I have tried different versions of meep, also meep-parallel, always the
> same error.
>
> I am running Meep on newest Ubuntu distrubution with an AMD processor and
> the Meep versions are always installed by using miniconda.
>
>
> Can someone give me a hint what could be wrong, or how I can pull further
> information out of my system to find the problem?
>
>
> Regards
> Christoph
>
> ___
> 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] follow up to question on path to materials_library.py

2018-08-17 Thread Christopher Hogan
Hi John,

My questions are:
> 1. Which, if any, of these paths is preferred?
> 2. How often is the materials_library updated with new materials or
> better data for old materials?  When this happens, is it posted on the
> GitHub site?
> 3. Is there any reason NOT to edit one's personal copy of the
> materials_library, to add materials of interest, say, graphene?


1. Since the materials_library.py file may depend on specific features of
the library, you should always use the version that matches your library.
To facilitate this, I've rebuilt the conda packages to include
materials_library.py in /env/share/meep. The next Meep
release will likely add the materials library directly to the python
package, which would enable something like `from meep.materials_library
import Si`. If you're building from the master branch, then you should use
the copy of materials_library.py in the master branch.

2. Based on the commit history, materials_library.py has been updated a few
times per month lately. If you use the nightly conda packages, you will get
the latest version in the "share" directory described above. Look for it to
be importable from the meep package in the nightly builds soon.

3. As you pointed out, it would be better to have a user materials library
so it doesn't get erased on updating or cause merge conflicts.

Chris

On Fri, Aug 17, 2018 at 8:07 AM, John Weiner  wrote:

> I found another, simpler path, ~/pymeep/examples/materials_library.py,
> which is is included in the meep github respository.  Any changes or
> updates would be, I presume, included automatically using the git clone
> meep command.
>
> Specifying ~/pymeep/examples as the path-to-materiais_library should keep
> the library up to date.
>
> Since the materials_library.py is just another python script file, I see
> no reason why it could not or should not be edited for any particular user
> purpose.
>
> However, if one does that, when and if the meep repository is git cloned
> again, the customized materials_library.py would have to be overwritten.
> Might be better to keep any customization in a separately named file such
> as my_materials_library.py or something like that.
>
> John
>
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] h5topng triggers core dump in mp and mp_test environments

2018-08-15 Thread Christopher Hogan
Hi John,

I had to rebuild the h5utils package because conda forge released a new
version of hdf5. It should work now if you do the following:

# make sure you're in the root environment
source deactivate

# Remove the old environments
conda env remove -n mp
conda env remove -n mp_test

# Recreate them
conda create -n mp -c chogan -c conda-forge pymeep
conda create -n mp_test -c chogan/label/dev -c chogan -c conda-forge pymeep

Thanks for reporting,

Chris


On Wed, Aug 15, 2018 at 7:44 AM, John Weiner  wrote:

> Dear Chris and meep-discussion:
>
> I have run into a seemingly strange problem with h5topng, the program in
> h5utils that converts h5 files to png.  While working on a python tutorial
> file in the parallel python meep environment (pmp) h5topng works with no
> problem.  However, when working with the identical python file in the
> serial python meep environment (mp), I trigger a core dump when invoking
> h5topng.  The error message claims that the headers version is 1.10.1 while
> the library version is 1.10.2., and the fact that the versions don't match
> triggers the core dump.
>
> &
>
> (mp_test) john@Samba:~/pymeep/examples/myexamples$ h5topng -t 229 -R -Zc
> dkbluered -a yarg -A right_angle_waveguide-eps-00.00.h5
> right_angle_waveguide-ez.h5
> Warning! ***HDF5 library version mismatched error***
> The HDF5 header files used to compile this application do not match
> the version used by the HDF5 library to which this application is linked.
> Data corruption or segmentation faults may occur if the application
> continues.
> This can happen when an application was compiled by one version of HDF5 but
> linked with a different version of static or shared HDF5 library.
> You should recompile the application or check your shared library related
> settings such as 'LD_LIBRARY_PATH'.
> You can, at your own risk, disable this warning by setting the environment
> variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
> Setting it to 2 or higher will suppress the warning messages totally.
> Headers are 1.10.1, library is 1.10.2
>
> &
>
> The LD_LIBRARY_PATH is not set and "which h5topng" shows that the command
> points to the appropriate path for ~/miniconda/envs/mp and
> ~/miniconda/envs/pmp.
>
>
> I don't understand why I'm getting the core dump in the mp environment
> (and in the mp_test environment) but not in the pmp environment.
>
> Any suggestions would be greatly appreciated.
>
> Best regards,
>
> John
>
>
___
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 return different result

2018-08-13 Thread Christopher Hogan
Maybe you need to call (reset-meep) between (func true) and (func false).

Chris

On Wed, Aug 8, 2018 at 8:30 AM, 37 zigen <37zi...@gmail.com> wrote:

> Dear meep users.
>
> I tried to run simulation multiple times.
> However, it shows different result wheather I run the code below as it is
> or I run the code with commenting out (func false) and then run once more
> with commenting out (func true) and undoing the commenting out of (func
> false)
>
> Does anyone know why?
>
> Thank you for reading.
>
> Sincerely.
>
>
> *(define-param sx 30) ; size of cell in X direction
>   *
> *(define-param sy 30) ; size of cell in Y direction
>   *
> *(set! geometry-lattice (make lattice (size sx sy no-size)))*
> * ;(define-param no-obstacle? true) ;*
> *(define-param fcen 0.25) ; pulse center frequency
>*
> *(define-param df 0.2); pulse width (in frequency)
> *
> *(define-param nfreq 100) ; number of frequencies at which to compute
> flux *
>
>
> *(define func*
> *  (lambda(no-obstacle?) *
> *(define trans 0)*
> *(define refl 0)*
>
>
> *(set! geometry*
> *   (if (not no-obstacle?)*
> *   (list*
> *(make block*
> * (center 0 0)*
> * (size 0.1 28 infinity)*
> * (material (make medium (epsilon 1)(D-conductivity 0.00765)))*
> * )*
> *)*
> *   (list*
> *(make block*
> * (center 0 0)*
> * (size  infinity infinity infinity)*
> * (material (make dielectric (epsilon 1)))*
> * )*
> *)*
> *   )*
> *   )*
>
> *(set! sources (list*
> *(make source*
> *  (src (make gaussian-src (frequency fcen) (fwidth df)))*
> *  (component Ez)*
> *  (center -14 0)*
> *  (size 0 28*
> *(set! pml-layers (list (make pml (thickness 1.0*
> *(set-param! resolution 20)*
>
> *(set! trans ; transmitted flux
> *
> *   (add-flux fcen df nfreq*
> * (make flux-region*
> *   (center 10 0 0) (size 0 28)*
> *   )*
> * )*
> *   )*
>
> *(set! refl ; reflected flux
>  *
> *   (add-flux fcen df nfreq*
> * (make flux-region *
> *   (center -10 0 0) (size 0 28)*
> *   )*
> * )*
> *   )*
>
>
> *;(if (not no-obstacle?) (load-minus-flux "refl-flux" refl))*
>
> * ;(run-sources+ 500 (at-beginning output-epsilon)(to-appended "ez"
> (at-every 1 output-efield-z)))*
> *(run-sources+ *
> * (stop-when-fields-decayed 50 Ez*
> *(if no-obstacle? (vector3 0 0 0)*
> *(vector3 0 0 0)*
> *)*
> *1e-3))*
> *(if no-obstacle? (save-flux "refl-flux" refl))*
> *(display-fluxes trans refl)*
>
> *)*
> *  )*
>
> *(func true)*
> *(func false)*
>
> ___
> 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] Install from git clone - another fail

2018-08-07 Thread Christopher Hogan
Thanks for info Ian,

I assume you're using Python 3.7, which changed the return type of
`PyUnicode_AsUTF8` from `char*` to `const char*`. I've fixed this in PR
456: https://github.com/stevengj/meep/pull/456

Chris

On Tue, Aug 7, 2018 at 4:59 AM, Ian Sage  wrote:

> On Arch linux, installing from git through the AUR packages, I now see a
> problem reminiscent of (but different from) John's:
>
> In file included from meep-python.cpp:3794:
> typemap_utils.cpp: In function ‘std::__cxx11::string
> py_class_name_as_string(PyObject*)’:
> typemap_utils.cpp:21:51: error: invalid conversion from ‘const char*’ to
> ‘char*’ [-fpermissive]
>  #define PyObject_ToCharPtr(n) PyUnicode_AsUTF8(n)
>^~~
> This follows an update of harminv, libctl, h5utils, mpb without problems,
> motivated by a compiler libraries update.
>
> Any clues?
>
> Many thanks,
>
> Ian
> On 02/08/18 06:24, John Weiner wrote:
>
> Meep.hpp:1275:78 error: invalid conversion from ‘meep::component*’ to
> ‘int’ -fpermissive:
> chunk loop filed components (fc, grid, shift, phase, S, sh,
> components.data(), components.size()) {}
>
>
>
>
> ___
> 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] Install from git clone - another fail

2018-08-07 Thread Christopher Hogan
Hi Ian,

> installing from git through the AUR packages

I'm confused. Did you build from the git sources or install an AUR package?
Or is there an AUR package out there that builds from git sources? I would
need to know the details of how you built/installed meep. Also, which
 compiler and version are you using?

Thanks,

Chris


On Tue, Aug 7, 2018 at 4:59 AM, Ian Sage  wrote:

> On Arch linux, installing from git through the AUR packages, I now see a
> problem reminiscent of (but different from) John's:
>
> In file included from meep-python.cpp:3794:
> typemap_utils.cpp: In function ‘std::__cxx11::string
> py_class_name_as_string(PyObject*)’:
> typemap_utils.cpp:21:51: error: invalid conversion from ‘const char*’ to
> ‘char*’ [-fpermissive]
>  #define PyObject_ToCharPtr(n) PyUnicode_AsUTF8(n)
>^~~
> This follows an update of harminv, libctl, h5utils, mpb without problems,
> motivated by a compiler libraries update.
>
> Any clues?
>
> Many thanks,
>
> Ian
> On 02/08/18 06:24, John Weiner wrote:
>
> Meep.hpp:1275:78 error: invalid conversion from ‘meep::component*’ to
> ‘int’ -fpermissive:
> chunk loop filed components (fc, grid, shift, phase, S, sh,
> components.data(), components.size()) {}
>
>
>
>
> ___
> 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] getting parallel python meep up and running

2018-08-06 Thread Christopher Hogan
Hi John,

> I got the MPI error about init being disallowed, etc.  I think this
problem has been observed and discussed earlier.

Can you elaborate on this? What was the exact error message you saw? If the
conda package is having MPI problems, it is likely because it's trying to
use a different MPI on the system rather than the one that is bundled in
the conda environment. I would double check that `which mpirun` points to
the mpirun in your conda environment, and make sure you don't have any
variables (PATH, LD_LIBRARY_PATH, etc.) pointing to specific MPI
installations in your .bashrc or similar.

For the second error, it looks like it's loading an older version of Meep
instead of the one in the conda environment. I would check your .bashrc for
anything pointing to an old meep and make sure PYTHONPATH is unset. You can
also run `ldd
~/.conda/envs/pmp_test/lib/python3.6/site-packages/meep/_meep.so` to make
sure it's linking with the correct libmeep.so. I verified that both the 1.5
release, and the development package work on a clean Ubuntu 18.04.

Chris

On Sat, Aug 4, 2018 at 9:01 AM, John Weiner  wrote:

> Hello to all,
>
> Having gotten the impression that  future development of meep will be
> essentially in python meep, I have taken the first tentative baby steps to
> get python meep working on my pc Ubuntu box.  Scheme meep, both stand-alone
> and parallel, is now working on this box running Ubuntu 18.04 LTS.
>
> Using the CONDA package, I was able to install one-core python meep
> without incident.  It works.
>
> Then I tried to install the parallel version using the instructions at
> https://meep.readthedocs.io/en/latest/Installation/#conda-packages, and
> in particular,
>
> conda create -n pmp -c chogan -c conda-forge pymeep-parallelsource activate 
> pmp
>
> But when I tried to run a .py script using
>
> mpirun -np 2 python foo.py,
>
> I got the MPI error about init being disallowed, etc.  I think this
> problem has been observed and discussed earlier.
>
> I then tried the nightly builds and was able to create the environment
> pmp_test.  When I entered the same mpirun command line as above, I got the
> following message,
>
>  File "", line 1, in 
>   File 
> "/home/john/.conda/envs/pmp_test/lib/python3.6/site-packages/meep/__init__.py",
> line 8, in 
> from . import _meep
> ImportError: 
> /home/john/.conda/envs/pmp_test/lib/python3.6/site-packages/meep/_meep.so:
> undefined symbol: _ZN4meep6fields17add_volume_sourceENS_9componentERKNS_
> 8src_timeERKNS_6volumeEPKcS9_St7complexIdE
>
> I thought that maybe the first line in the foo.py file,
>
> import meep as mp
>
> was not correct.  So I deleted it and ran the script again.  Then I got
> the error message,
>
> Traceback (most recent call last):
>   File "straight_waveguide.py", line 2, in 
> cell = mp.Vector3(16, 8, 0)
> NameError: name 'mp' is not defined
>
> which I take to mean that maybe the meep library is not "imported" without
> the import command or there is some more serious problem in the meep
> library.
>
> I don't know what to do to move forward with python parallel meep and
> would appreciate any help.
>
> Best regards,
>
> John
>
>
>
>
> ___
> 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] Meep install from git clone on ubuntu 17.10

2018-08-06 Thread Christopher Hogan
Hi John,

This is fixed in https://github.com/stevengj/meep/pull/451.

Thanks for pointing it out.

Chris

On Thu, Aug 2, 2018 at 12:24 AM, John Weiner  wrote:

> Dear developers and maintainers,
>
> I decided this morning to update my meep installation on a pc ubuntu box
> running 17.10 using “git clone” from the GitHub.  Everything proceeded
> normally until the make file.  The following error ensued:
>
> Meep.hpp:1275:78 error: invalid conversion from ‘meep::component*’ to
> ‘int’ -fpermissive:
> chunk loop filed components (fc, grid, shift, phase, S, sh,
> components.data(), components.size()) {}
>
> The error occurs again with components.size() at meep.hpp:1275:97.
>
> Installation of harminv, libctl, h5utils, mpb, appear to make and make
> check, and make install normally following git clone downloads.
>
> Any suggestions would be greatly appreciated.
>
> Best regards,
>
> John
>
> ___
> 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] guile >=2.0.12

2018-08-06 Thread Christopher Hogan
Hi John,

Yes, that's correct. Any guile version should work if you're building with
the latest sources on the master branch.

Chris

On Sat, Aug 4, 2018 at 3:38 PM, John Weiner  wrote:

> Dear Christopher, Ardavan and Steve,
>
> I saw on the stevengj/meep GitHub site that
> Fix SWIG garbage collection issue for Guile >= 2.0.12 #419
>
> and
> Fix garbage collection for guile >= 2.0.12 #1288
>
> appears to be fixed.  Does this mean that the restriction on using no
> guile version >2.0.11 has been lifted and that guile no longer has to be
> built from 2.0.11 sources?
>
> Best regards,
>
> John
>
> ___
> 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] Pymeep geometries using epsilon_func

2018-07-11 Thread Christopher Hogan
Hi,

If you return a `Medium` in your epsilon function, then you have to pass it
to the `Simulation` with the `material_function` keyword argument instead
of `epsilon_func`. See the section titled "material functions" under the
`Medium` documentation here:
http://meep.readthedocs.io/en/latest/Python_User_Interface/#medium.
Additionally, I think you want `epsilon_function` to check `if
vector.norm() < 1` instead of `vector.unit()`?

Chris

On Wed, Jul 11, 2018 at 4:19 AM, Karl-Johan Olofsson <
karol...@student.liu.se> wrote:

> Hello. I would like to draw a hexagonal pyramid in MEEP using the python
> interface. My first idea was to use a hexagonal prism and then use blocks
> to "cut" the pyramid shape. That proved to be quite the nuisance so I
> decided to use the epsilon function to draw the shape instead. Any ideas
> what the best way might be?
>
>
> Anyway, attempting to draw a simple circle using the epsilon function
> gives me segmentation fault, please see the code below:
>
> import meep as mp
> import numpy as np
> import matplotlib.pyplot as plt
> import math as math
>
> sxy=10
> resolution=10
> cell=mp.Vector3(sxy,sxy,0)
>
> def epsilon_function(vector):
>
> if vector.unit() < 1:
>
> return mp.Medium(epsilon=2)
>
> else:
>
> return mp.Medium(epsilon=1)
>
> sim=mp.Simulation(cell_size=cell,
> #geometry=geometry,
> epsilon_func=epsilon_function,
> resolution=resolution)
>
> sim.run(until=1)
>
> eps_data = sim.get_array(center=mp.Vector3(), size=cell,
> component=mp.Dielectric)
> plt.figure(dpi=100)
> plt.imshow(eps_data.transpose(), interpolation='spline36',  cmap='binary')
> plt.axis('on')
> plt.show()
>
> Any help would be greatly appreciated
>
> Karl-Johan
>
>
>
> ___
> 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] Resetting the origin in Python interface

2018-06-21 Thread Christopher Hogan
Hi,

There is currently no way to set the origin from Python, but the line
responsible for centering it is here:
https://github.com/stevengj/meep/blob/master/python/simulation.py#L574. If
you comment out that line (running `make install` if necessary), you should
get the behavior you're looking for.

Chris

On Sun, Jun 17, 2018 at 10:45 AM, Jonathan  wrote:

> Hello,
>
> usually in meep, the center of the simulation is at (0,0,0). This means,
> that when the scene has a size of (10, 10, 10), the coordinate system will
> be from (-5, -5, -5) to (5, 5, 5). I would like to change the origin so
> that the scene would be from (0,0,0) to (10,10,10).
>
> I have to deal quite a bit with the raw fields of the simulation, which
> are accessed as arrays with indexes starting at 0. To map meep coordinates
> to field coordinates I thus have to account for the resolution (simple
> scaling factor) and the offsetted origin, for which I need to know also the
> extend of the scene. This makes accessing values cumbersome, the code gets
> longer and more error prone.
>
> I have searched the documentation and the python files but found no option
> to change the origin. However, the 2010 meep paper states in 2.1 "The
> origin of the coordinate system is an arbitrary ivec that can be set by the
> user". Is this still possible in today's version of meep? If so, is is also
> possible through the python interface?
>
> A related question: A very similar behavior is found when specifying
> geometry or sources. Often, i know the bounding box coordinates of objects
> but then have to convert them to the origin/extend representation, a
> process in which you can easily flip a sign and you always have to double
> check if everything look correct. Is there a way to change this behavior?
>
> With kind regards,
>
> Jonathan Klein
>
>
> ___
> 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

[Meep-discuss] Meep 1.5 conda packages now available

2018-06-21 Thread Christopher Hogan
Hello,

New conda packages are available for the PyMeep 1.5 release.

To create a conda environment with serial pymeep:
$ conda create -n mp -c chogan -c conda-forge pymeep
$ source activate mp

For the MPI version:
$ conda create -n pmp -c chogan -c conda-forge pymeep-parallel
$ source activate pmp

Additionally, we now have nightly developer builds available under the
'dev' label:
$ conda create -n mpdev -c chogan/label/dev -c chogan -c conda-forge pymeep
$ source activate mpdev

Or
$conda create -n pmpdev -c chogan/label/dev -c chogan -c conda-forge
pymeep-parallel
$ source activate pmpdev

See the documentation
 for
more information.

Thanks,

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

Re: [Meep-discuss] Can't run bend waveguide simulation - AttributeError

2018-06-04 Thread Christopher Hogan
Hi,

The conda packages are a bit outdated at the moment. We are working on
releasing new versions, but in the meantime, running the bend-flux.py
example from the master branch would require building from source.  You
could checkout the version of the examples that corresponds with the conda
installation like this:

$ git checkout v1.4.3

Then every example would work.

Chris

On Sat, Jun 2, 2018 at 9:01 AM, Thibault JOUSSE 
wrote:

> Hi everyone,
>
> I am getting the following error when I run the file bend-flux.py I
> have downloaded from github (meep/python/bend-flux.py) :
>
>Traceback (most recent call last):
>  File "/home/thibault/TIPE/bend.py", line 52, in 
>straight_refl_data = sim.get_flux_data(refl)
>AttributeError: 'Simulation' object has no attribute 'get_flux_data'
>
>Field time usage:
>connnecting chunks: 0.0659251 s
> time stepping: 4.92044 s
> communicating: 0.411649 s
>Fourier transforming: 1.9925 s
>   everything else: 0.164349 s
>
>[Finished in 12.0s with exit code 1]
>
> I'm running it in a miniconda3 env (OS : Solus GNOME, up-to-date),
> which was set up following the Installation guide (https://meep.readthe
> docs.io/en/latest/Installation/#conda-packages).
>
> I have checked simulation.py in my meep directory and it appears that
> it doesn't have the get_flux_data function.
> Could you help me fixing my installation, which appears to be outdated
> even after setting it up using the documentation ?
>
> Thanks in advance,
> Thibault.
>
> ___
> 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] Meep 1.4.3 Conda packages

2018-05-14 Thread Christopher Hogan
Hi Munehiro,

The conda package is in a state of transition as we finalize the latest
release. The correct installation command is

$ conda create -n pmp -c chogan -c conda-forge pymeep-parallel nomkl

Sorry for the confusion.

Chris

On Sun, May 13, 2018 at 11:13 PM, Munehiro Nishida <
mnish...@hiroshima-u.ac.jp> wrote:

> Dear Chris,
>
> I installed your pymeep-parallel package using
>
> $ conda create -n pmp -c chogan -c defaults -c conda-forge pymeep-parallel
>
> and found "HDF5 library version mismatched error" at runtime
>  (Headers are 1.10.1, library is 1.10.2).
>
> The error could be circumvented by setting 'HDF5_DISABLE_VERSION_CHECK'
> environment variable to 1 as the error message suggested, but
> it might be better to rebuild the packages.
>
> Best regards,
> Munehiro
>
> On 2018年02月03日 05:44, Chris Hogan wrote:
>
> Hello,
>
> New Conda packages corresponding to the Meep 1.4.3 release have been
> posted. These are available for Python 2.7 and 3.6 on Linux and MacOS. With
> the Conda package manager, installation is as simple as
>
> $ conda create -n meep -c chogan -c defaults -c conda-forge pymeep
>
> or for the MPI version
>
> $ conda create -n pmeep -c chogan -c defaults -c conda-forge
> pymeep-parallel
>
> If you already have an environment with a pymeep package isntalled, you
> can update to the latest release with
>
> $ conda update -c chogan pymeep
>
> See the "Installation -> Conda Packages" section of the documentation for
> more information.
>
> Chris
>
>
> ___
> meep-discuss mailing 
> listmeep-disc...@ab-initio.mit.eduhttp://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
>
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] CustomSource for defined current possible?

2018-05-03 Thread Christopher Hogan
Hi,

For an example of using CustomSource, see
meep/python/tests/source.py:test_custom_source on line 94.

Chris



On Thu, May 3, 2018 at 11:28 AM, KOHLMANN Hannes  wrote:

> Hello,
>
>
>
> I want to simulate the propagation effects of EM waves generated by a
> lightning stroke, for which usually an I(z,t) is given (lightning channel
> current).
>
> Is there any way to tell PyMeep that the source is a current I (and not
> Ex, Hx, etc)?
>
> If not, then I think the only way to find something descriptive for the
> lightning channel would be to calculate the  corresponding
>
> Hy and use this as a source, right?
>
>
>
> Also, for a custom function, I guess I will need meep.CustomSource and the
> src_func as parameter. But I haven’t figured out yet how put those
> parameters together, because I haven’t found any example (maybe I have
> overseen something in the docs). Could you give me a short one, please?
>
>
>
> Thanks in advance!
>
>
>
> Best regards,
>
> Hannes
>
> ___
> 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] Problems in the meep installation process & python bindings

2018-04-18 Thread Christopher Hogan
Hi Hannes,

The build instructions are specific to Ubuntu 16.04 and haven't been tested
on 17.10. If you don't have a good reason to build from source, then I
would highly recommend using the Conda package. This should get you up and
running with just a few commands. Details can be found here
<https://meep.readthedocs.io/en/latest/Installation/#conda-packages>.

Chris

On Wed, Apr 18, 2018 at 7:58 AM, KOHLMANN Hannes <h.kohlm...@ove.at> wrote:

> Hello Chris, hello all!
>
>
>
> Now I returned to the beginning of the installation process in order to do
> it following the “building from source” instructions. Still, at the end of
> having done all that trying around for 3 hours, I am not able to do
> meep.Vector3(…) or something equivalent (meep has no such attribute) after
> having done
>
> “import meep” in python3.
>
>
>
> My installation steps I will summarize as follows:
>
>
>
> 1)  I installed libpng-dev instead of libpng16-dev, as the latter is
> deprecated, and the rest of all the packages and libraries
>
> 2)  I installed libpython3.6-dev, because I only have python27 and
> python36 on my system
>
> 3)  I installed harminv via apt-get because there were some errors
> when trying to build it manually.
>
> 4)  h5utils from apt
>
> 5)  mpb I tried to build following the instructions, resulting in the
> obtrusive error, that BLAS was not found. I tried quite everything to set
> –with-blas=… or anything for the build process to find the necessary files.
> No success. Also there was little help asking google, since this MPB BLAS
> problem usually ends with “what does the config.log say?” without any
> further treatment.
> à so I ended up installing mpb from apt and continued.
>
> 6)  pip3 seems to be broken in Ubuntu, when I do pip3 install, I get
> the error: in from pip import main à main not found
> Then I did all the stuff with pip install instead of pip3 install after
> having checked which pip version it was, giving as a result:
>
> hannes@Ubuntu:~$ pip --version
>
> pip 10.0.0 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
> …which is basically what I want, I guess (as opposed to python 2.7)!
>
> If I don’t do the pip install steps, where will it lead to errors when
> working with meep later?
>
> 7)  Last but not least I tried to install meep as described in the
> Building from source description. First the error came that Fortran 77
> compiler was not found. I installed gfortran from apt and the error was
> gone. After that the error occurred that  pympb.h is not found. That was
> the only thing that somehow made sense to me, since from the apt manager
> there will be an old version installed, not yet supporting python bindings.
> So then I went back to the mpb installation part to install it from hand.
> And: this time without the BLAS not found error (I guess that it may have
> found it because of the previously installed mpb from the apt manager).
>
> 8)  After having successfully built mpb, finally meep also got
> through without errors.
>
> 9)  I set the environment variable export 
> PYTHONPATH=/usr/local/lib/python3.6/site-packages
> in .profile
>
> 10)   I start python3 in the same shell where I just finished installing
> meep
>
> 11)   import meep works
>
> 12)   meep.Vector3(16,8,0) à meep has no attribute Vector3()
>
> 13)   closed shell and reopened & ran python3 again, imported meep à now
> meep was not found, although I configured the PYTHONPATH
>
>
>
> I thought, that maybe through the installation processes via apt there may
> be the problem that –enable-shared was not set during the installation.
>
> I just ran the whole building script again where all the lib sharing is
> enabled à this time without a single error (no BLAS errors, no fortran
> errors, etc).
>
> But still, when I start python3, it cannot find meep.
>
>
>
> My Ubuntu version is 17.10
>
> Unfortunately my Linux foo is too weak and I have only little ideas where
> to begin to search for problems. I also don’t know if it can actually work
> to install first packages via apt and then trying to build everything from
> hand once again and installing it as I did in the last step …
>
> My goal is actually just to successfully execute:
>
>
>
> python3
>
> >>import meep
>
> >>cell = meep.Vector3(16,8,0) … for example
>
> >>
>
>
>
> I would be very glad, if someone could give me some hints if or where I do
> something profoundly wrong.
>
>
>
> Thank you very much in advance & best regards,
>
> Hannes
>
>
>
> *Von:* Christopher Hogan [mailto:ho...@simpetus.com]
>

Re: [Meep-discuss] help on cond and define

2018-04-17 Thread Christopher Hogan
Hi,

You might try defining your variables outside of the conditional
statements, and then (set! ...) them within the conditionals instead of
calling (define-param ...) within conditionals.

Chris

On Tue, Apr 17, 2018 at 4:08 AM, leonard Monniello <
leonard.monnie...@u-psud.fr> wrote:

> Dear kind meepers,
>
> I used to run a code that was working quite fine, but returns now an
> error.
> The code part of the code that is not working is in the form:
>
> *(define-param band? false) *
> *(cond ((equal? band? false)(define-param supercell-x 80)) *
> *(else (define-param supercell-x 1)) *
>
> I want to use conditional definitions to be able to control externally the
> type of computation I wanna run and also the different parameters, as I
> have this kind of line in other places of the script.
>
> The error returned is:
>
> *definition in expression context, where definitions are not allowed, in
> form (define supercell-x (if (defined? (quote supercell-x)) supercell-x
> 80))*
>
> Though I don't really understand what I'm supposed to do with it. Should I
> copy this syntax or try to avoid it ?
>
> Another example later on in my file, which I use to set the output file
> names:
> *(cond ((equal? grandguide? true)*
> *(define Guide (string-append "W" (number->string (+ 1 (* 2
> decal))) "r" (number->string r*
> *(else (define Guide ""))*
> *)*
>
> If you have any idea how to rewrite this, it would be very helpful.
>
> Thank you
>
> Léonard
>
> ___
> 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] libctlgeom was not found

2018-04-11 Thread Christopher Hogan
Hi,

The Python interface requires the shared library, libctlgeom.so. You can
build it by adding the "--enable-shared" flag when you run autogen.sh while
building libctl.

Full build instructions can be found here:
http://meep.readthedocs.io/en/latest/Installation/#building-from-source

Chris

On Wed, Apr 11, 2018 at 7:50 AM, KOHLMANN Hannes  wrote:

> Hello everyone,
>
>
>
> I am facing a problem with ./configure after having done ./autoconfig.sh
> from the official MEEP repository.
>
> The error is the following:
>
> configure: error: libctlgeom was not found, is required for Python
> interface
>
>
>
> I installed the libctl package from https://github.com/stevengj/libctl,
>
> After doing so, I located the directory, where these files are:
>
> hannes@Ubuntu:~/meep$ locate libctlgeom
>
> /usr/local/lib/libctlgeom.a
>
> /usr/local/lib/libctlgeom.la
>
> …while the install folder (like mentioned on the repository page of
> libctl) is:
>
> /usr/local/share/libctl
>
>
>
> Now I tried to do the following with the configure file of the meep
> package:
>
> ./configure –with-libctl=/usr/local/share/libctl
>
> … but unfortunately without success. The same error occurs. Is is maybe
> because the libctlgeom.a / .la are in a different directory?
>
> How can I solve this problem?
>
>
>
> As I am not such a Linux expert and don’t know how to proceed further, I
> wanted to ask for help this way.
>
>
>
> Thanks a lot in advance & best regards,
>
> Hannes Kohlmann
>
> ___
> 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] Python material_function and extra_materials

2018-04-10 Thread Christopher Hogan
Hi,

There was a bug in the code that converts the Python list of
`extra_materials` to C++.

This PR should fix it: https://github.com/stevengj/meep/pull/277

Thanks for catching that.

Chris

On Mon, Apr 9, 2018 at 4:58 PM, Ian Sage  wrote:

> I have no problems using a material_function to set an index which
> varies with position. However, the construct fails if my function
> returns materials_library.Al even if I include this in an
> extra_materials list (either in the initialization of the simulation or
> as a separate assignment). The simulation runs without error, but the
> metal is seemingly absent.
>
> All is well if I just assign a Block material as materials_library.Al
>
> Are these (material_function; extra_materials) constructs fully
> implemented? If so, do they need a special syntax?
>
> I am running meep-git-1.4.3.r76 on Arch.
>
> Thanks,
>
> Ian
>
>
> ___
> 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] The direction of sources and the use of a method field_energy _in_box(box)

2018-03-19 Thread Christopher Hogan
Hi Jiangcheng,

the instruction of the method field_energy_in_box points out it only has
> one parameter but it requires two (another calls d) when I use the method


Thanks for pointing this out. It was an inconsistency with the scheme
interface, and is fixed in PR 239: https://github.com/stevengj/meep/pull/239

Chris

On Sun, Mar 18, 2018 at 9:44 PM, 盛建诚  wrote:

> Dear meep users,
> I just want to calculate the transmission efficiency of a waveguide and I
> don't know why there is not a attribute of direction in the attribute list
> of sources. In this case,the energy of sources spreads out and how can I
> calculate the efficiency?Additionally , the instruction of the method
> field_energy_in_box  points out it only has one parameter but it requires
> two (another calls d) when I use the method, what's the function of
> parameter d?
> wish to get your help,thanks a lot !
> Best,
> Jiangcheng
>
>
> ___
> 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] Possible bug in output_png parallel operation?

2018-03-12 Thread Christopher Hogan
Hi Ian,

I am unable to reproduce this issue. Parallel output_png seems to work
correctly with the latest master and with the conda packages. My only
suggestion would be to rebuild, or try the conda package.

Chris

On Sat, Mar 10, 2018 at 6:20 AM, Ian Sage  wrote:

> I am running a simple 2d simulation using the latest de8571e commit code
> on Arch Linux. The python file is named gaussian_beam.py and output is
> by the output_png instruction:
>
> sim.run(mp.at_beginning(mp.output_epsilon), mp.at_every(0.1,
> mp.output_png(mp.Ez, '-c bluered -Z')), until=t)
>
> If I do: "python gaussian_beam.py" or "mpirun -N 1 python
> gaussian_beam.py", all is well. But if I use "mpirun -N 2 python
> gaussian_beam.py", I see a huge sequence of errors, beginning:
>
> creating output file "./gaussian_beam-eps-00.00.h5"...
> creating output file "./gaussian_beam-ez-00.10.h5"...
> HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
>   #000: H5F.c line 586 in H5Fopen(): unable to open file
> major: File accessibilty
> minor: Unable to open file
>   #001: H5Fint.c line 1305 in H5F_open(): unable to lock the file
> major: File accessibilty
> minor: Unable to open file
>   #002: H5FD.c line 1839 in H5FD_lock(): driver lock request failed
> major: Virtual File Layer
> minor: Can't update object
>   #003: H5FDsec2.c line 940 in H5FD_sec2_lock(): unable to lock file,
> errno = 11, error message = 'Resource temporarily unavailable'
> major: File accessibilty
> minor: Bad file ID accessed
> h5topng error: error opening HD5 file
> creating output file "./gaussian_beam-ez-00.20.h5"...
> HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
>
> All the error messages seem to come from thread 0.
> If I change the step function to write to hdf5:
>
> sim.run(mp.at_beginning(mp.output_epsilon), mp.to_appended("ez",
> mp.at_every(0.1, mp.output_efield_z)), until=t)
>
> there is no error reported.
>
> I am not certain, whether this is a new issue with the latest commit, or
> if it also affects earlier versions.
>
> Hope that's useful to someone!
>
> Ian
>
> ___
> 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