Commit Graph

98 Commits

Author SHA1 Message Date
0e98f8582a add some more caching around the state file & geometry calculations
able to process a simulation in ~2 seconds in the optimistic path
2022-02-01 18:31:47 -08:00
ce39c1f50b buffer-proto5: auto-measure the extrema for M/H
also, introduce a `Time` abstraction and allow for more precisely
simulating just a specific time range.

the Sim-related traits still need updating to better integrate this.
2022-01-11 18:23:07 -08:00
fe5eab5e43 improve verification for buffer_proto5
verify that different pieces of the sim are properly connected.
2022-01-11 14:03:46 -08:00
26c4a5403f Split SampleableSim out from GenericSim.
`SampleableSim` will be Box-able; GenericSim can be allowed to not be
Box-able.
2021-08-22 19:20:40 -07:00
6239b5bb18 Update dependencies.
`cargo bench` still doesn't work :|
2021-08-07 17:09:12 -07:00
eecf848875 Remove plotly
Git/crates.io version of plotly had some bugs which were patched locally.
But this added extra maintenance and I haven't used the plotly renderer for some time.
So, remove plotly & reintegrate it only when we need it.
2021-07-25 13:21:16 -07:00
42fca8ae2b Validate the CsvRenderer 2021-06-15 00:47:59 -07:00
1a6f13e271 Add an (untested) way to persist measurements to disk 2021-06-15 00:15:04 -07:00
aa5d38b0fb Add ability to save/resume a simulation to a state file 2021-06-14 21:04:08 -07:00
3249ecd412 SerializerRenderer supports more use-cases
e.g. not casting to StaticSim; different file names
2021-06-14 20:46:22 -07:00
e02a062dda Steps per frame is configurable per-renderer 2021-06-14 20:09:52 -07:00
490afbc4da Remove Real from src/sim.rs 2021-06-09 15:28:22 -07:00
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