Skip to content

Commit

Permalink
Merge pull request #29 from paulxshen/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
paulxshen authored Mar 31, 2024
2 parents 134c82c + 09ab154 commit 040477a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Working draft of a differentiable FDTD engine for inverse design in photonics, acoustics & RF.

Documentation at https://github.io/differentiable-fdtd-beta-prerelease

Documentation at https://paulxshen.github.io/Luminescent.jl/
Discussion & updates at https://discourse.julialang.org/t/pre-ann-differentiable-fdtd-for-inverse-design-in-photonics-acoustics-and-rf/105405/12
![a](bend-pre.gif)
![b](bend-post.gif)
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ power_profile = F.(real.(Jy .* conj.(Mz)))
power_profile /= norm(power_profile)

if ongpu
using CUDA, Flux
@assert CUDA.functional()
using Flux
# using CUDA
# @assert CUDA.functional()
u0, model, static_mask, μ, σ, σm, field_padding, source_instances =
gpu.((u0, model, static_mask, μ, σ, σm, field_padding, source_instances))
merge!(configs, (; u0, field_padding, source_instances))
Expand Down
5 changes: 3 additions & 2 deletions examples/periodic_scattering/periodic_scattering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ p = apply(geometry_staggering; p...)

# move to gpu
if dogpu
using CUDA, Flux
@assert CUDA.functional()
using Flux
# using CUDA
# @assert CUDA.functional()
u0, p, field_padding, source_instances = gpu.((u0, p, field_padding, source_instances))
end

Expand Down
Binary file modified examples/periodic_scattering/periodic_scattering.mp4
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
We simulate a quarter wavelength antenna above conductor ground plane and compute its nearfield radiation pattern
=#

using UnPack, LinearAlgebra, GLMakie
using UnPack, LinearAlgebra, GLMakie, CoordinateTransformations
using GLMakie: volume
using Luminescent, LuminescentVisualization

Expand Down Expand Up @@ -45,8 +45,9 @@ p = apply(geometry_staggering, p)

# move to gpu
if dogpu
using CUDA, Flux
@assert CUDA.functional()
using Flux
# using CUDA
# @assert CUDA.functional()
u0, p, field_padding, source_instances = gpu.((u0, p, field_padding, source_instances))
end

Expand Down
11 changes: 8 additions & 3 deletions makedocs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Prerelease. First stable release planned for April . Until then, accuracy not validated. Report bugs on [Github](https://github.com/paulxshen/Luminescent.jl) - we usually respond within a day
## Overview
Generative design meets Maxwell's Equations. Differentiable FDTD package for inverse design & topology optimization in semiconductor photonics, acoustics and RF. GPU and automatic differentiation (AD) compatible. Uses AD by `Zygote.jl` for adjoint optimization. Integrates with [`Jello.jl`](https://github.com/paulxshen/Jello.jl) to generate length scale controlled paramaterized geometry . Staggered Yee grid update with fully featured boundary conditions & sources in 1d/2d/3d. Customizable physics to potentially incorporate dynamics like heat transfer, charge transport.
Generative design meets Maxwell's Equations. GPU and automatic differentiation (AD) compatible FDTD package in Julia for inverse design & topology optimization in semiconductor photonics, acoustics and RF. Uses AD by `Zygote.jl` for adjoint optimization. Integrates with [`Jello.jl`](https://github.com/paulxshen/Jello.jl) to generate length scale controlled paramaterized geometry . Staggered Yee grid update with fully featured boundary conditions & sources in 1d/2d/3d. Customizable physics to potentially incorporate dynamics like heat transfer, charge transport.
## Gallery

### Generative Inverse design of compact silicon photonics splitter
Expand All @@ -13,12 +13,17 @@ Generative design meets Maxwell's Equations. Differentiable FDTD package for inv
![](assets/periodic_scattering.mp4)
Please star us on [Github](https://github.com/paulxshen/Luminescent.jl) if you like our work :)
## Installation
Install via
Install Julia preferably with VSCODE. Then add our package via
```
using Pkg
Pkg.add(url="https://github.com/paulxshen/Luminescent.jl")
Pkg.add(url="https://github.com/paulxshen/LuminescentVisualization.jl")
```
`LuminescentVisualization.jl` contains visualization utilities
`LuminescentVisualization.jl` contains visualization utilities. If you're running tutorials also add
```
]add UnPack, BSON,DataStructures, StatsBase, Zygote, Jello, GLMakie, CoordinateTransformations,AbbreviatedStackTraces,CUDA,Flux
```
Omit CUDA if you don't have NVidia GPU
## Quickstart
Please refer to the first tutorial
## People
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Pkg
# ]add UnPack, BSON,DataStructures, StatsBase, Documenter,ImageTransformations,Interpolations, Zygote, Optim,ArrayPadding, Porcupine, Jello, GLMakie, Functors, Lazy,AbbreviatedStackTraces,ReverseStackTraces,CUDA,Flux
# ]add UnPack, BSON,DataStructures, StatsBase, Documenter,ImageTransformations,Interpolations, Zygote, Optim,ArrayPadding, Porcupine, Jello, GLMakie, Functors, CoordinateTransformations,Lazy,AbbreviatedStackTraces,ReverseStackTraces,CUDA,Flux
# Pkg.add(url="https://github.com/paulxshen/ArrayPadding.jl")
Pkg.add(url="https://github.com/paulxshen/Jello.jl")
# Pkg.add(url="https://github.com/paulxshen/Jello.jl")

# Pkg.add(url="https://github.com/paulxshen/Porcupine.jl")
# Pkg.add(url="https://github.com/paulxshen/Luminescent.jl")
# Pkg.add(url="https://github.com/paulxshen/LuminescentVisualization.jl")
Pkg.add(url="https://github.com/paulxshen/Luminescent.jl")
Pkg.add(url="https://github.com/paulxshen/LuminescentVisualization.jl")

0 comments on commit 040477a

Please sign in to comment.