Comments (3)
No, when adding an object to the grid, the inverse_permittivity at the location of the object is set to zero:
Line 86 in 73afcb8
This means that effectively, only the second update equation is used at the location of the object.
from fdtd.
Hi flaport,
In that sense, wasn't it better if the method _register_grid
in object.py
set the permittivity of the object directly in the grid. Repeating calculations can be critical when the simulation size is bigger.
from fdtd.
That's a fair point and in fact nothing is stopping you to do exactly that... Just do an in-place index replacement within inverse_epsilon...
The reason that I chose the Object route is that back in the day I was working on simulating photo-refractive crystals in which I was also modeling the electro-optic effect. Moreover those objects required non-diagonal epsilon elements which is a much more expensive update. Going the object-route allowed me to just have those expensive update equations in a localized component and still use the quick update equations everywhere else in the grid.
That said, for normal use cases a replacement in the grid is a much better approach and I agree we should probably make that the default.
from fdtd.
Related Issues (20)
- is the pytorch backend differentiable? HOT 3
- Unit correction HOT 1
- parallel computation HOT 2
- Error using Cuda HOT 1
- Polarization of plane source HOT 2
- How should I implement pattern lighting? HOT 1
- Is fdtd suitable for antenna design? HOT 1
- How do I define a custom electromagnetic field profile as source, like the Import Source in the Lumerical FDTD?
- Hello! How to obtain the phase of electromagnetic field?
- ffmpeg not installed? HOT 15
- `RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!` HOT 7
- Loading Spatial Distributions HOT 1
- Polarization for Linear Source
- Version on pypi doesn't have commit "don't use bd.float directly for type casting" and is erroring HOT 1
- The kernel appears to have died. It will restart automatically.
- Simulation of metals (complex refractive index) HOT 3
- development dependencies not downloading HOT 2
- fdtd.backend and fdtd.set_backend errors HOT 1
- Problem on running with fdtd.set_backend("torch") HOT 10
- Where to obtain Total field Array HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fdtd.