| design | ||
| pkgs | ||
| .cz.toml | ||
| .editorconfig | ||
| .gitignore | ||
| .licensesnip | ||
| .pre-commit-config.yml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| cog.toml | ||
| LICENSE | ||
| README.md | ||
| rustfmt.toml | ||
hop: All-Dielectric 3D FDTD Solver w/GPU Acceleration
hop solves Maxwell's equations, for arbitrary dielectric mediums in a Yee-discretized 3D domain.
Warning
This project is currently in a prototype state. Proceed at your own risk!
Development
Development Tools
- (optional)
prekis suggested to make it easy to conform to all project rules, via pre-commits. - (optional)
cocogittois suggested to ease creating conformant commit messages, conformant changelog entries, and standardized release processing. - (optional)
licensesnipis suggested to make adding correct license headers easy.
Release Process
Releases shall proceed in the following fashion:
- Execute
cog bump --auto(nothing may be staged). This performs a few checks ex.prekon all files and a passing test-suite. - Validate that the generated tags, changelog, and bump-commit are appropriate and as expected. If anything is wrong, this is the last chance to revert.
- Do
git push origin mainandgit push origin --tags. - Publish docs, packages, create a Forgejo release
TODO. Perhaps a
Justfilethat validates the GPG signature, builds and publishes the docs to locally defined destination, builds and publishes any packages, and creates a Forgejo release using the changelog and a custom string entry - maybe even publishes a blog post somewhere too, with the custom string entry?
TODO
In-Scope
-
Bounds
- Naive
-
Sources
- EPointDipole
-
Structures
- Cuboid
- Sphere
-
Mediums
- Vacuum
- SimpleDielec
- CPML
-
Dispersive Mediums: These are "trivial" in the sense that it's "just" a function that takes aux fields / data that we've already moved into place for it. NOTE: We may want to reconsider how aux fields are updated with subpixel averaging. Also, could PMLs be made better with subpixel averaging?
-
Inhomogeneous Mediums: Requires some kind of sampling within the single-medium structure.
- Frankly, this is just another aux-field thing. No solver logic needed.
-
Nonlinear Mediums: Weirdly enough, nothing special in the solver. The medium will be doing all kinds of special stuff; namely, solving an auxiliary differential equation with substeps.
Fanciness
-
Bounds
- PEC
- PMC
- Bloch(k=0)
- Bloch(k!=0)
-
Sources
- GaussBeam
- PlaneWave
- TFSF: Not really a source, but likely best expressed as one. Think on this.
-
Structures
- Cylinder
- TriMesh
- VoxCloud
- Really just everything from https://iquilezles.org/articles/distfunctions/ .
- Also some choice common structures ex. a ring resonator.
-
Mediums
- SimpleChiral
- Lorentz
- Drude
- DrudeLorentz
- Debye
-
Medium Enhancements:
- General: Medium built from a models of P, J_f, M.
- We then split up "how do I model mediums" into "how do I model P, J_f, M".
- We keep existing mediums as-is, since they are sensible "special cases".
- Animated: Requires recomputing kernel layout on every time step with altered parameters.
- Nonlinear: This is just a P model, for use in the General medium.
- Chiral: This is just a P model, for use in the General medium. Only kink is that we need an approximation of the local value of the dual field, since chirality is fundamentally a crossover effect.
- Spatial Variation: This is just a P model, for use in the General medium.
- General: Medium built from a models of P, J_f, M.
-
Bloch periodic bounds: Much like NaivePeriodic, except a phase shift is applied, forcing fields to be complex. This is the only correct method of doing periodic boundary conditions - in fact, periodic sim results require a photonic band gap computation.
- There is a split-field formulation that allows keeping all the same real sim logic. F_real and F_imag are both kept, real and imag parts of a bloch mode - and are both updated independently (I don't know how sources fit in). Boundaries then enforce crossover, aka. phase shifting.
- That does require running the sim twice per time step, effectively. Anyway, the problem is well studied.
- See: https://arxiv.org/pdf/2007.05091
-
Subpixel Averaging: Integrate by sampling medium at various points (if it's varying). For two-medium regions, integrate by multiplying sample-point-wise SDF with sample-point-wise medium.
- Can we use Lines cretively to do this very efficiently? An interesting thought.
-
Subgrids: Needed for TFSF, but also generally useful.
-
Structure Kernel Layout Optimization: Directly use SDFs to find label cells without binning, and use the standard binned algo first. Then, refine the solution by annealing, using a cost function that rewards finding larger z-stripes.
- Experiment with loading data into Lines more aggressively, esp. in structure vectors. Each kernel thus has more data to load - and much will be strided and inefficient, yes - but can also do its actual calculations very quickly. In particular, using Z lines