Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
paulxshen committed Jan 7, 2025
1 parent c382afc commit d5a4d1d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
1 change: 0 additions & 1 deletion luminescent/luminescent/sol.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# import dill
import GPUtil
from pprint import pprint
import os
import subprocess
Expand Down
2 changes: 1 addition & 1 deletion luminescent/luminescent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def material_voxelate(c, dl, zmin, zmax, layers, layer_stack, path):
os.makedirs(dir, exist_ok=True)
with contextlib.redirect_stdout(None):
stltovoxel.convert_file(
os.path.join(path, f'{k}_{l1}_{l2}.stl'), os.path.join(dir, 'output.png'), voxel_size=dl, pad=0)
os.path.join(path, f'{k}_{l1}_{l2}.stl'), os.path.join(dir, 'output.png'), voxel_size=dl/2, pad=0)
layer_stack_info[k] = {
"layer": (l1, l2),
"zmin": d.zmin,
Expand Down
2 changes: 1 addition & 1 deletion luminescent/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='luminescent', # Your package name
version='0.4.1', # Your package version
version='0.4.3', # Your package version
description='A description of your package',
author='Paul Shen',
author_email='[email protected]',
Expand Down
1 change: 1 addition & 0 deletions src/pic/run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function picrun(path; array=Array, kw...)
for (k, v) = pairs(layer_stack)
a = stack(map(sort(collect(readdir(joinpath(temp, string(k)), join=true)))) do file
a = Nf.(Gray.(FileIO.load(file)))
a = downsample(a, 2)
reverse(a', dims=2)
end)
# a = a[Base.OneTo.(min.(size(a), sz))...]
Expand Down
18 changes: 11 additions & 7 deletions src/sim/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ function f2(((u, mf), p, (dt, field_diffdeltas, field_diffpadvals, source_instan
bell(t, dt)
# @time u = update(u, p, t, dt, field_diffdeltas, field_diffpadvals, source_instances;)
u = update(u, p, t, dt, field_diffdeltas, field_diffpadvals, source_instances;)
mf += [[
ks = @ignore_derivatives [keys(u.E)..., keys(u.H)...]
mf += [
begin
c = dt / T * cispi(-2(t - t0) / λ)
ks = @ignore_derivatives [keys(u.E)..., keys(u.H)...]
@nogradvars c, ks
namedtuple([k => (field(u, k, m) * c) for k = ks])
end for λ = wavelengths(m)
] for m = monitor_instances]
um = namedtuple(ks .=> field.((u,), ks, (m,)))
[
begin
c = dt / T * cispi(-2(t - t0) / λ)
@nogradvars c
c * um
end for λ = wavelengths(m)
]
end for m = monitor_instances]
((u, mf), p, (dt, field_diffdeltas, field_diffpadvals, source_instances), (t0, T, monitor_instances))
end

Expand Down

0 comments on commit d5a4d1d

Please sign in to comment.