-
Notifications
You must be signed in to change notification settings - Fork 119
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
removing objects doesn't reset grid permittivity #4
Comments
Thanks for bringing that up! It's indeed something I haven't implemented yet [read: haven't really though of so far;) ]. I'll see what I can do in the coming days! cheers! |
by the way... i'm having a ton of fun with this code. in case it gives you more motivation to keep working on it, I wanted to share a small simulation i did with it. thanks again |
Hey that's really cool! Thanks 😊 Right now I'm near the end of my PhD, so development of this library is kinda on hold until I've submitted, but after that I'll definitely resume working on it! Also... the examples folder in this library is quite empty.. If you're willing to share your code, you're definitely welcome to make a pull request and upload your simulation 😉 |
The following methods are tested to work: ``` grid.objects.pop(idx) del grid.objects[idx] del grid.object_name ```
Objects can now be removed from the grid. I made it so that the naive implementation you tried just works, for example
all work. To implement this, I had to change the behavior of each object. Internally, when adding an object to the grid, it will only encode the difference between its inverse permittivity and the global inverse permittivity in the grid (instead of encoding the full inverse permittivity and setting the grid index to zero at the object's location). By implementing it this way, objects can safely be removed from the grid without affecting the global grid index. |
thanks! |
opened again as previous solution introduced bugs in the PML (#6) |
Hello Sir, how do you manage to see the filed at every time , like how did you made the movie? |
@Kiranalu I don't know how the OP did it, but something like this might work (untested):
and then use something like ffmpeg to make the .png images into a movie. Matplotlib also has an animation module that might be easier, but I haven't tried it. Good luck! |
@Kiranalu There's an even easier method; use the pyEVTK library and Paraview!
Paraview makes very pretty videos. |
Very cool project! I look forward to seeing where it goes.
Small observation here, after playing around a little bit:
When you add an object, and then later remove it, you end up with a section of the grid with altered permittivity, but without an object present in the visualization. Lacking a
grid.remove_object()
method, I naively just popped the object fromgrid.objects
... and usedgrid.reset()
. but obviously, that doesn't undo the changes to the grid that occurred when the object was registered.I'd definitely understand if support for removing items (rather than just re-instantiating a new grid) was low priority for now, but just figured I'd mention it.
thanks again!
The text was updated successfully, but these errors were encountered: