question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Meep improvements

See original GitHub issue
  • how can we plot refractive index colorbar on meep?
  • how can we use plot2D when the simulation is 3d?
import gdsfactory.simulation.gmeep as gm
import gdsfactory.simulation as sim
import meep as mp
import gdsfactory as gf

nm = 1e-3

c = gf.components.mmi1x2(cross_section=gf.cross_section.nitride)
fig = c.plot()

# How can we plot the epsilon or refractive index?
sim = gm.get_simulation(c, is_3d=False)['sim']
sim.plot2D(output_plane=mp.Volume(size=sim.cell_size, center=mp.Vector3(0, 0, 0*nm)))

# This does not work
sim = gm.get_simulation(c, is_3d=True)['sim']
sim.plot2D()

@SkandanC @smartalech @HelgeGehring

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
smartalecHcommented, Oct 26, 2022

how can we use plot2D when the simulation is 3d?

@HelgeGehring is right. The idea is you need to pass a plane to visualize (specified by a Volume object).

how can we use plot2D when the simulation is 3d?

The output of plot2D() returns the axis handle of the plot. You should be able to loop through this handle until you find the relevant imshow data structure, which you can then use to create a colorbar.

I don’t have any examples offhand… the last time I actually did this was when I wrote the function 3+ years ago…

1reaction
smartalecHcommented, Oct 27, 2022

Would it be a good idea to do have something similar to gf.simulation.add_simulation_markers() but with a transparent box added which represents the PML? I feel like this could be useful in creating 3D scenes of Meep sim objects.

Sure that’d be great. Meep PRs are always welcome. 3D rendering with python has come a long way since we first added visualization support to meep.

Read more comments on GitHub >

github_iconTop Results From Across the Web

improved Apple silicon support · Issue #1853 · NanoComp/meep
I now have an Apple M4 laptop, and I've verified that Meep master and all of its dependencies build from source. I've also...
Read more >
Department of the Air Force launches pilot program to ... - SAF/IE
Initial estimates show that employing MEEP can improve energy intensity – or the mission effectiveness per gallon of fuel – by 3%.
Read more >
Parallel Meep - MEEP Documentation
The following benchmarking results show load-balancing improvements from a parallel run on a shared compute cluster in a datacenter. The per-core working times ......
Read more >
Home | MEEP
A software development tool and experimentation platform to enable software readiness for new hardware. MEEP enables software development, accelerating software ...
Read more >
The Massachusetts Education Equity Partnership | MEEP
MEEP is a collective effort of civil rights, social justice, ... by the SOA results in dramatic improvement in learning experiences and outcomes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found