Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
paulxshen committed Apr 2, 2024
1 parent 6a95723 commit 25f0c33
Show file tree
Hide file tree
Showing 35 changed files with 456 additions and 50 deletions.
Binary file modified antennapattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-03-31T12:12:09","documenter_version":"1.3.0"}}
{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-04-02T16:09:24","documenter_version":"1.3.0"}}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · Luminescent.jl</title><meta name="title" content="Home · Luminescent.jl"/><meta property="og:title" content="Home · Luminescent.jl"/><meta property="twitter:title" content="Home · Luminescent.jl"/><meta name="description" content="Documentation for Luminescent.jl."/><meta property="og:description" content="Documentation for Luminescent.jl."/><meta property="twitter:description" content="Documentation for Luminescent.jl."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>Luminescent.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#Overview"><span>Overview</span></a></li><li><a class="tocitem" href="#Gallery"><span>Gallery</span></a></li><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Quickstart"><span>Quickstart</span></a></li><li><a class="tocitem" href="#People"><span>People</span></a></li></ul></li><li><a class="tocitem" href="guide/">Guide</a></li><li><span class="tocitem">Tutorials</span><ul><li><a class="tocitem" href="periodic_scattering/">Periodic Scattering</a></li><li><a class="tocitem" href="quarter_wavelength_antenna/">Quarter Wavelength Antenna</a></li><li><a class="tocitem" href="inverse_design_waveguide_bend/">Inverse Design Waveguide Bend</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/paulxshen/fdtd" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/paulxshen/fdtd/blob/master/makedocs/src/index.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Home"><a class="docs-heading-anchor" href="#Home">Home</a><a id="Home-1"></a><a class="docs-heading-anchor-permalink" href="#Home" title="Permalink"></a></h1><p>Prerelease. First stable release planned for April . Until then, accuracy not validated. Report bugs on <a href="https://github.com/paulxshen/Luminescent.jl">Github</a> - we usually respond within a day</p><h2 id="Overview"><a class="docs-heading-anchor" href="#Overview">Overview</a><a id="Overview-1"></a><a class="docs-heading-anchor-permalink" href="#Overview" title="Permalink"></a></h2><p>Generative design meets Maxwell&#39;s Equations. GPU and automatic differentiation (AD) compatible FDTD package in Julia for inverse design &amp; topology optimization in semiconductor photonics, acoustics and RF. Uses AD by <code>Zygote.jl</code> for adjoint optimization. Integrates with <a href="https://github.com/paulxshen/Jello.jl"><code>Jello.jl</code></a> to generate length scale controlled paramaterized geometry . Staggered Yee grid update with fully featured boundary conditions &amp; sources in 1d/2d/3d. Customizable physics to potentially incorporate dynamics like heat transfer, charge transport.</p><h2 id="Gallery"><a class="docs-heading-anchor" href="#Gallery">Gallery</a><a id="Gallery-1"></a><a class="docs-heading-anchor-permalink" href="#Gallery" title="Permalink"></a></h2><h3 id="Generative-Inverse-design-of-compact-silicon-photonics-splitter"><a class="docs-heading-anchor" href="#Generative-Inverse-design-of-compact-silicon-photonics-splitter">Generative Inverse design of compact silicon photonics splitter</a><a id="Generative-Inverse-design-of-compact-silicon-photonics-splitter-1"></a><a class="docs-heading-anchor-permalink" href="#Generative-Inverse-design-of-compact-silicon-photonics-splitter" title="Permalink"></a></h3><p><video src="assets/inverse_design_signal_splitter.mp4" controls="true" title><a href="assets/inverse_design_signal_splitter.mp4"></a></video></p><h3 id="Quarter-wavelength-antenna-radiating-above-conductive-ground-plane"><a class="docs-heading-anchor" href="#Quarter-wavelength-antenna-radiating-above-conductive-ground-plane">Quarter wavelength antenna radiating above conductive ground plane</a><a id="Quarter-wavelength-antenna-radiating-above-conductive-ground-plane-1"></a><a class="docs-heading-anchor-permalink" href="#Quarter-wavelength-antenna-radiating-above-conductive-ground-plane" title="Permalink"></a></h3><p><video src="assets/quarter_wavelength_antenna.mp4" controls="true" title><a href="assets/quarter_wavelength_antenna.mp4"></a></video></p><h3 id="Simulation-of-plane-wave-scattering-on-Periodic-array"><a class="docs-heading-anchor" href="#Simulation-of-plane-wave-scattering-on-Periodic-array">Simulation of plane wave scattering on Periodic array</a><a id="Simulation-of-plane-wave-scattering-on-Periodic-array-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation-of-plane-wave-scattering-on-Periodic-array" title="Permalink"></a></h3><p><video src="assets/periodic_scattering.mp4" controls="true" title><a href="assets/periodic_scattering.mp4"></a></video> Please star us on <a href="https://github.com/paulxshen/Luminescent.jl">Github</a> if you like our work :)</p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>Install Julia preferably with VSCODE. Then add our package via </p><pre><code class="nohighlight hljs">using Pkg
Pkg.add(url=&quot;https://github.com/paulxshen/Luminescent.jl&quot;)
Pkg.add(url=&quot;https://github.com/paulxshen/LuminescentVisualization.jl&quot;)</code></pre><p><code>LuminescentVisualization.jl</code> contains visualization utilities. If you&#39;re running tutorials also add</p><pre><code class="nohighlight hljs">]add UnPack, BSON,DataStructures, StatsBase, Zygote, Jello, GLMakie, CoordinateTransformations,AbbreviatedStackTraces,CUDA,Flux</code></pre><p>Omit CUDA if you don&#39;t have NVidia GPU</p><h2 id="Quickstart"><a class="docs-heading-anchor" href="#Quickstart">Quickstart</a><a id="Quickstart-1"></a><a class="docs-heading-anchor-permalink" href="#Quickstart" title="Permalink"></a></h2><p>Please refer to the first tutorial </p><h2 id="People"><a class="docs-heading-anchor" href="#People">People</a><a id="People-1"></a><a class="docs-heading-anchor-permalink" href="#People" title="Permalink"></a></h2><h3 id="Community"><a class="docs-heading-anchor" href="#Community">Community</a><a id="Community-1"></a><a class="docs-heading-anchor-permalink" href="#Community" title="Permalink"></a></h3><p>Discussion &amp; updates at <a href="https://discourse.julialang.org/t/pre-ann-differentiable-fdtd-for-inverse-design-in-photonics-acoustics-and-rf/105405/12">Julia Discourse</a></p><h3 id="Contributors"><a class="docs-heading-anchor" href="#Contributors">Contributors</a><a id="Contributors-1"></a><a class="docs-heading-anchor-permalink" href="#Contributors" title="Permalink"></a></h3><p>Paul Shen &lt;pxshen@alumni.stanford.edu&gt; </p><p>Consulting and technical support available </p><p>2024 (c) Paul Shen </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="guide/">Guide »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 31 March 2024 12:12">Sunday 31 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Pkg.add(url=&quot;https://github.com/paulxshen/LuminescentVisualization.jl&quot;)</code></pre><p><code>LuminescentVisualization.jl</code> contains visualization utilities. If you&#39;re running tutorials also add</p><pre><code class="nohighlight hljs">]add UnPack, BSON,DataStructures, StatsBase, Zygote, Jello, GLMakie, CoordinateTransformations,AbbreviatedStackTraces,CUDA,Flux</code></pre><p>Omit CUDA if you don&#39;t have NVidia GPU</p><h2 id="Quickstart"><a class="docs-heading-anchor" href="#Quickstart">Quickstart</a><a id="Quickstart-1"></a><a class="docs-heading-anchor-permalink" href="#Quickstart" title="Permalink"></a></h2><p>Please refer to the first tutorial </p><h2 id="People"><a class="docs-heading-anchor" href="#People">People</a><a id="People-1"></a><a class="docs-heading-anchor-permalink" href="#People" title="Permalink"></a></h2><h3 id="Community"><a class="docs-heading-anchor" href="#Community">Community</a><a id="Community-1"></a><a class="docs-heading-anchor-permalink" href="#Community" title="Permalink"></a></h3><p>Discussion &amp; updates at <a href="https://discourse.julialang.org/t/pre-ann-differentiable-fdtd-for-inverse-design-in-photonics-acoustics-and-rf/105405/12">Julia Discourse</a></p><h3 id="Contributors"><a class="docs-heading-anchor" href="#Contributors">Contributors</a><a id="Contributors-1"></a><a class="docs-heading-anchor-permalink" href="#Contributors" title="Permalink"></a></h3><p>Paul Shen &lt;pxshen@alumni.stanford.edu&gt; </p><p>Consulting and technical support available </p><p>2024 (c) Paul Shen </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="guide/">Guide »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Tuesday 2 April 2024 16:09">Tuesday 2 April 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file modified docs/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/search_index.js

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/inverse_design_waveguide_bend/layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ h = hwg + 2hm
# hwg = 0.25


sig = savemodes("$(@__DIR__)/modes.bson", dx, λ, wwg, hwg, wm, hm, ϵ1, ϵ2)
sig = rectmodes("$(@__DIR__)/modes.bson", dx, λ, wwg, hwg, wm, hm, ϵ1, ϵ2)
ports = [
(; c=[lwg - lm, w - wm - wd / 2], lb=[0, -wwg / 2 - wm], ub=[0, wwg / 2 + wm], n=[1, 0]),
(; c=[l - lm - ld / 2, wm], lb=[-wwg / 2 - wm, 0], ub=[wwg / 2 + wm, 0], n=[0, -1]),
Expand Down
Binary file removed examples/inverse_design_waveguide_bend/mode.bson
Binary file not shown.
Binary file removed examples/inverse_design_waveguide_bend/model.bson
Binary file not shown.
Binary file removed examples/inverse_design_waveguide_bend/modes.bson
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
We simulate a quarter wavelength antenna above conductor ground plane and compute its nearfield radiation pattern
=#

using UnPack, LinearAlgebra, GLMakie, CoordinateTransformations, NearestNeighbors
using UnPack, LinearAlgebra, GLMakie, CoordinateTransformations, NearestNeighbors, Random
using GLMakie: volume
# using Luminescent, LuminescentVisualization
using Luminescent, LuminescentVisualization

# if running directly without module # hide
include("$(pwd())/src/main.jl") # hide
include("$(pwd())/../LuminescentVisualization.jl/src/main.jl") # hide
# include("$(pwd())/src/main.jl") # hide
# include("$(pwd())/../LuminescentVisualization.jl/src/main.jl") # hide

Random.seed!
name = "quarter_wavelength_antenna"
F = Float32
dogpu = false
T = 8.0 # simulation duration in [periods]
nx = 20
nx = 30
dx = 1.0 / nx # pixel resolution in [wavelengths]

l = 2 # simulation domain lxlxl box
Expand Down Expand Up @@ -83,7 +84,7 @@ cfs = CartesianFromSpherical()
rvecs = reshape(cfs.(splat(Spherical).(zip(r[i], θ * ones(n)', ones(m) * ϕ'))), m, n)
fig = surface(getindex.(rvecs, 1), getindex.(rvecs, 2), getindex.(rvecs, 3),)
display(fig)
save("antennapattern.png", fig)
save("$(@__DIR__)/antennapattern.png", fig)

#=
![](assets/antennapattern.png)
Expand Down
Binary file not shown.
5 changes: 3 additions & 2 deletions makedocs/docs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ xcopy /Y makedocs\build\* docs
@REM xcopy /Y examples\*\*.mp4 makedocs\src\assets
xcopy /Y examples\periodic_scattering\*.mp4 makedocs\src\assets
xcopy /Y examples\quarter_wavelength_antenna\*.mp4 makedocs\src\assets
xcopy /Y examples\slab_waveguide\*.mp4 makedocs\src\assets
xcopy /Y examples\inverse_design_signal_splitter\*.mp4 makedocs\src\assets
xcopy /Y examples\quarter_wavelength_antenna\*.png makedocs\src\assets
@REM xcopy /Y examples\slab_waveguide\*.mp4 makedocs\src\assets
xcopy /Y examples\inverse_design_waveguide_bend\*.mp4 makedocs\src\assets
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 25f0c33

Please sign in to comment.