Commit Graph

86 Commits

Author SHA1 Message Date
0f56d0390e Rename Cell -> Sample 2021-06-07 15:26:26 -07:00
cd0debb209 Remove some unused imports; cleanup
The `Cell` type in sim.rs could be further improved:
it doesn't need to be parameterized over Material. It
should actually be renamed to `Sample`, and directly encode
the magnetization, etc.
2021-06-07 15:20:02 -07:00
9f6d92c5fc Parameterize Vec3 over Real type. BROKEN TESTS
sim::pml_boundary_conditions_{x,y,z} are broken, among others.
Unsure if this is new. I don't see an obvious cause yet.
2021-06-07 14:23:07 -07:00
84a92ad572 Cast the simulation to_static before rendering it to disk to save space 2021-06-06 01:21:28 -07:00
a0765e3ec0 Parameterize 2d geometry types over the Float type
I'll work toward parameterizing more geometry (Vec3); this
is just a starting point.
2021-06-06 01:02:28 -07:00
40d1239cc1 Fix off-by-one error in measurement printing 2021-06-05 21:17:38 -07:00
3021bd025f Add more controls to the viewer (scale and field display mode) 2021-06-03 20:42:10 -07:00
cb0c899194 Remove PML
There are still a few references to it, but it doesn't really exist in
the simulation proper.

The existing implementation is confusing and ineffective (broken?).
Upcoming patches will work to replace it with a more workable
implementation.

Also moves the Material::is_vacuum method to be on a helper trait.
That's just a point of hygeine. Meant to split it out to a separate
patch but messed up (-:
2021-05-29 13:06:40 -07:00
dc5f448853 Switch default visualizations when rendering 2021-04-24 15:55:46 -07:00
886462c8b0 Toy with an idealized ferromagnet 2020-12-17 22:22:25 -08:00
4b86a6f721 Merge branch 'parameterize-renderer' 2020-12-17 16:42:06 -08:00
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
32ac179464 Serialize the simulation without monomorphizing it
This does shave ~20% off the serialized size. But it actually bloats
gzip'd size by 30%. Unclear as to why, yet.
2020-12-17 01:12:10 -08:00
b309849e04 Parameterize the Renderer trait over GenericSim to avoid taking it dynamically
Notably, this allows the SerializerRenderer to serialize the actual
state to disk, as-is. That'll allow for more compact images, and
potentially also a way to resume simulations.

I expect the viewer will be broken for new simulations, initially.
2020-12-16 23:23:54 -08:00
6362b5a60e parallelize render_scalar_field 2020-12-15 14:19:29 -08:00
cba2e3c3d2 Change up some measurement/rendering details 2020-12-14 21:44:07 -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
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
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
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
55d6171325 Add units to the different Vec3 "types" (Meters and Index, so far) 2020-09-26 17:05:15 -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
bef423ce38 Rename Point -> Vec2 to distinguish it clearly from any 3d object 2020-09-26 13:25:49 -07:00
caa276295d Move vec3.rs -> vec.rs in preparation for adding a 2d vec 2020-09-26 13:19:25 -07:00
2627852a39 Eradicate SimSnapshot
We do everything it achieved via the GenericSim trait, now.
2020-09-25 20:18:43 -07:00
cae84222c0 Rendering now mostly uses the GenericSim 2020-09-25 20:15:39 -07:00
a931252e9c Convert render system to sample the simulation at a fixed resolution; no more decimation 2020-09-25 19:40:49 -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
f21c43d655 Misc measurement improvements 2020-09-20 21:56:30 -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
1d303df409 Fix rendering to render (Bx,By,Ez). Also fix an infinite loop due to rounding errors in MHCurve 2020-09-18 22:22:54 -07:00
8a70276c78 Make measurements also be 3d 2020-09-18 17:11:05 -07:00
a1f5b96ae1 Model the H/B field in 3d, mostly 2020-09-17 22:53:12 -07:00
c0174b6483 Rename flt::Priv/Pub to Real and Flt
It's a little more readable
2020-09-13 22:45:02 -07:00
f50dbf7d4e Make the float depth compile-time configurable 2020-09-13 22:38:00 -07:00
6664fea7c2 Use unchecked floats for release builds 2020-09-13 18:22:58 -07:00
53da11c874 Assorted minor aesthetic touchups 2020-09-13 17:19:44 -07:00
b4b0fde8af Use ndarray's parallelism features
It's easier to read, and it also gets 10-30% perf improvement for
Driver::step
2020-09-12 20:37:31 -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