Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot geometry directly (without discretization) #1824

Closed
stevengj opened this issue Nov 10, 2021 · 3 comments · Fixed by #1827
Closed

plot geometry directly (without discretization) #1824

stevengj opened this issue Nov 10, 2021 · 3 comments · Fixed by #1827

Comments

@stevengj
Copy link
Collaborator

stevengj commented Nov 10, 2021

Would be nice to be able to plot the geometry directly, without creating the structure object and the discretization first (which can be slow for large simulations).

It's pretty tricky to implement in its full generality for all possible objects, but would be easy to support a subset of objects (e.g. prisms and other objects aligned with the grid).

The get_epsilon_grid function actually implements one possible version of this functionality, and we could simply plot it.

cc @joamatab

@smartalecH
Copy link
Collaborator

The main geometric plotting function is found here:

def plot_eps(sim,ax,output_plane=None,eps_parameters=None,frequency=0):

You can add all the new code there.

All the boundaries, monitors, sources, etc. are already implemented generically.

@stevengj
Copy link
Collaborator Author

For example, we could just add a resolution argument to sim.plot2d — if that is passed, then instead of initializing the structure it calls get_epsilon_grid instead .

@smartalecH
Copy link
Collaborator

And the key is that get_epsilon_grid only pulls the 2D slice at the specified resolution (where normally you have to initialize everything at the full resolution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants