Commit Graph

80 Commits

Author SHA1 Message Date
d8ae766099 Add a bunch of .round()s before conversions
Previously this was leading to inconsistencies when using f32 v.s. f64
2020-12-17 15:09:53 -08:00
75fde43aa7 Get another 25% perf bump by optimizing material layouts 2020-12-16 14:30:52 -08:00
41572f5285 Optimize GenericMaterial layout
Shaving off 2 floats, i.e. 16 bytes. Brings a 3-4% overall perf
increase. Should be possible to shave another 16 bytes.
2020-12-16 14:04:30 -08:00
737ae1b872 Add diagnostics binary for showing things like material parameters 2020-12-16 13:53:39 -08:00
c9b4ab5b6e More reactive z navigation 2020-12-16 00:10:16 -08:00
6362b5a60e parallelize render_scalar_field 2020-12-15 14:19:29 -08:00
b3aba7658b Add a magnetic loop measurement 2020-12-14 21:54:33 -08:00
cba2e3c3d2 Change up some measurement/rendering details 2020-12-14 21:44:07 -08:00
e105819461 CurlStimulus can now handle negative magnitudes 2020-12-08 22:19:06 -08:00
f5f90a7a15 Fix a bunch of warnings 2020-12-07 22:55:24 -08:00
e0056d8c85 Make the Driver able to handle any Material 2020-12-07 22:51:00 -08:00
f1c9334322 Don't recalculate inv_feature_size in every work unit
This shaves nearly 1% off the total simulation time
2020-12-07 22:05:20 -08:00
82b1eea353 Add a way to measure the current directed around a closed loop 2020-12-07 09:16:07 -08:00
d9176cdf06 Non-uniform current stimuli can be specified easier 2020-12-06 20:56:34 -08:00
d619383fb9 Make Current measurement serializable
Note that this REALLY slows it down, since it forces the Region to be
Boxed.

It might make sense at some point to consider introducing a RegionBitmap
type. Maybe keep the original Region type -- for serializing -- but
cache a Bitmap version where perf matters more.
2020-12-06 19:54:02 -08:00
8d4a3a91fe Fix broken tests + misc cleanup
Move all the examples which don't compile to the `old/` directory.
2020-12-06 13:31:13 -08:00
28c734a4c5 Add a Current stimulus to the wrapped torus 2020-11-29 21:52:52 -08:00
1f44605714 Add an example for a "wrapped torus": that is, a ferromagnet torus with wire loops around it
Still missing:
- stimulus to inject a current onto one of the wire loops
- measurement to measure current on the other wire loop
2020-11-29 18:25:34 -08:00
ed86aff504 measurements are now rendered alongside the terminal view 2020-11-29 12:27:52 -08:00
2c042810d8 Implement a 'SerializerRenderer' output format
It's CBOR, which seems to pack not so efficiently (250*250*20 * 12
floats takes 400 MB per frame, whereas this many doubles could pack into
120 MB). serde_cbor also seems to be extremely slow: taking multiple
minutes per frame. This could be parallelized to be less problematic
though (it already is -- just bump the parallelism).

Might be worth testing other formats.
2020-11-27 22:11:53 -08:00
9d15e126a7 Cleanup
AKA I made these changes a month ago but forgot to commit them and don't
really want to figure out what they did.
2020-11-27 21:22:42 -08:00
1a9093315a Basic support for plotly backend
NOTE: this requires you to clone `plotly`, copy the
`plotly_kaleido` folder to be adjacent to this one, and then run `cargo
build --release` from within that plotly_kaleido folder.
2020-10-09 21:51:34 -07:00
f2ba6fdd1b Troubleshoot toroid2.5d 2020-10-09 20:41:38 -07:00
4ac48bd3f1 Minor cleanup to Render size 2020-10-03 22:13:59 -07:00
0642f52172 Fix some issues related to the Courant number
step_h was using the wrong timestep; fixing it caused update issues
based on the Courant number being 1.0, i.e. too large. Reducing it to
\sqrt{3}/3 fixes stability issues. Unfortunately, a non-Unity Courant
value prevents me from using the ideal Absorbing Boundary Condition I
had just implemented, so that's been disabled.
2020-10-03 19:44:30 -07:00
5c8c2f6c76 Fix division by zero in UPML boundary 2020-10-03 13:58:44 -07:00
55d6171325 Add units to the different Vec3 "types" (Meters and Index, so far) 2020-09-26 17:05:15 -07:00
00f22c95d0 WIP Stimulus system 2020-09-26 15:50:34 -07:00
9a0f778db5 UPML boundary now applies to z dimension 2020-09-26 15:13:30 -07:00
d39db969b5 Consolidate Vec/Coord into the geom submodule
Also add the missing coord.rs to version control...
It should have been checked in earlier
2020-09-26 14:09:41 -07:00
452141dd0d Change meas.rs to use meter coordinates instead of pixel coordinates 2020-09-26 14:01:10 -07:00
729f9f77a6 Make the Region trait 3d-ready 2020-09-26 13:39:34 -07:00
bef423ce38 Rename Point -> Vec2 to distinguish it clearly from any 3d object 2020-09-26 13:25:49 -07:00
fa0e30a2a6 Make Coord 3d 2020-09-25 21:04:16 -07:00
6d77c85179 Abstract coordinates behind a Coord type
This will allow adding another dimension to the coordinate, more easily.
2020-09-22 11:23:58 -07:00
2549ac9940 step_h uses optional left/down nodes.
This will be handy for implementing 3d, because the world with depth=1
(i.e. no neighboring xy planes) will behave the same as a 2d simulation.
2020-09-22 08:56:41 -07:00
253ffe585f Fix current measurement 2020-09-20 11:53:05 -07:00
d713c79bbd Improve the UPML parameters by properly summing the axis conductivities in the corners 2020-09-19 20:10:10 -07:00
f6e4ed8cb9 Add a UPML boundary condition (needs improving in the corners, though) 2020-09-19 20:02:11 -07:00
ae93101676 Allow conductivity to be specified as a vector
This is necessary to implement UPML boundary conditions
2020-09-19 19:33:11 -07:00
a7899d9be1 Add a toroid example where the B field is actually directed circularly inside the toroid
This is a more accurate simulation of a core memory.
Presently, trying to characterize the device: understand how the drive
current, and sizing, affects switching time.
2020-09-18 22:23:37 -07:00
f50dbf7d4e Make the float depth compile-time configurable 2020-09-13 22:38:00 -07:00
d4334565a7 Add an example where the ferromagnet is a ring around the conductor 2020-09-13 18:33:31 -07:00
75008a6bd5 Consolidate duplicate 3r1 material definitions into mat::db module 2020-09-13 18:32:43 -07:00
53da11c874 Assorted minor aesthetic touchups 2020-09-13 17:19:44 -07:00
cb9f413710 Add energy measurement 2020-09-13 17:08:33 -07:00
0fc973b409 Toy around with some other setups.
It's weird (maybe), that the behavior of the ferromagnet is to _prevent_ H
from getting very large
2020-09-09 22:41:41 -07:00
4d8ef1c9f3 Add a measurement for magnetization 2020-09-07 21:58:07 -07:00
d611e822dd Add a 'Measurement' concept, e.g. to display current at a point. 2020-09-07 20:14:41 -07:00
fbca8622df Remove usize casts 2020-09-07 17:54:50 -07:00