Commit Graph

156 Commits

Author SHA1 Message Date
cba2e3c3d2 Change up some measurement/rendering details 2020-12-14 21:44:07 -08:00
54e414808c Add a new decimate tool to reduce time resolution of simulated output
This is useful to free up limited disk space :/
2020-12-08 22:52:34 -08:00
457337c3b1 More tools for shifting/gating stimuli 2020-12-08 22:28:54 -08:00
e105819461 CurlStimulus can now handle negative magnitudes 2020-12-08 22:19:06 -08:00
2b713bae14 Always render the last frame; also apply stimuli before rendering 2020-12-08 18:44:56 -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
5abb185fe7 Rework the stimulus so that it can be applied in parallel 2020-12-07 20:36:52 -08:00
bf3dba7f99 CurrentLoop reports the current *per cross-section* (i.e. the actual current) 2020-12-07 09:29:49 -08:00
d353026bf9 Use the _mean_ directed current for measurement. This should actually be multiplied by the cross-section area of the Region 2020-12-07 09:22:11 -08:00
82b1eea353 Add a way to measure the current directed around a closed loop 2020-12-07 09:16:07 -08:00
90e26d2445 Add a Vec3::norm method 2020-12-06 21:13:16 -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
fa23989cd9 Backfill tests for Sinusoid stimulus 2020-12-06 19:10:50 -08:00
8891020254 Have the Torus respect its center 2020-12-06 14:32:58 -08:00
2a2ad4c3a5 Change the torus tests so that they exercise units 2020-12-06 14:15:06 -08:00
4dd99fce70 Backfill tests for the Torus type 2020-12-06 13:49:31 -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
7e2046f5bd Viewer: swap PgUp/PgDown
This is more consistent with reading things top-to-bottom: page down
advances the user through some information.
2020-12-01 17:29:37 -08:00
9fe08bf1f5 PageUp/Down are used for course time navigation 2020-11-29 22:08:05 -08:00
f13c5e0e85 Improve responsiveness by folding adjacent navigations 2020-11-29 22:05:44 -08:00
9d4b0607d7 Simplify implementation of viewer's navigation
This should make it slightly easier to collapse multiple commands
2020-11-29 21:53:00 -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
9dddf6406a Define a Torus region.
I mean, actual core memories are usually toroids, so...
2020-11-29 17:43:32 -08:00
abac9be49c Viewer navigates based on natsorted paths 2020-11-29 15:08:31 -08:00
f1124dea3b viewer binary can navigate to the previous frame now 2020-11-29 14:24:12 -08:00
ed86aff504 measurements are now rendered alongside the terminal view 2020-11-29 12:27:52 -08:00
70e6cdf0cb Render to exactly the size of the terminal 2020-11-29 10:52:11 -08:00
8f8c42a853 renderer can navigate forward in time (and also in the + or - z direction)
Can't navigate backward yet
2020-11-28 13:49:30 -08:00
58fa41ce87 Viewer actually renders frames (no navigation yet) 2020-11-28 12:22:22 -08:00
156145eada Viewer actually loads simulation states (does not yet display them) 2020-11-28 12:13:25 -08:00
a96473640b Write a skeleton for the viewer (presently no-op) 2020-11-28 11:54:59 -08:00
d39a13190f Use bincode instead of CBOR to cut file size by 70%
Also use a BufWriter to significantly speed up the serialization
2020-11-27 22:37:18 -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
b9a48641c1 use lazy_static to avoid duplicating the MHCurve many times
Bumps FPS from 22 -> 26fps for my particular case
2020-10-03 22:58:18 -07:00
434ebcf34e Move the BH -> MH curve translation to make future lifetime changes easier 2020-10-03 22:23:32 -07:00
0ed1b3caed Remove duplicate MHCurves from PiecewiseFerromagnet
Speeds up my particular case from 16 fps to 22 fps :o
2020-10-03 22:16:17 -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
c33317c805 Factor out a Neighbors to package up all 6 neighbors when updating cells
This will allow more flexibility in boundary conditions.

It seems to have similar perf as passing only the 3 cells within about 2%.
2020-10-03 15:26:36 -07:00
5c8c2f6c76 Fix division by zero in UPML boundary 2020-10-03 13:58:44 -07:00
b84b8f6757 Finish the basic Stimulus implementation 2020-09-26 17:12:31 -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