Commit Graph

57 Commits

Author SHA1 Message Date
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
5d61765a84 Move the Driver away from the builder pattern and use mutators instead 2020-09-07 17:46:42 -07:00
14fa68bfb2 Snapshot and decimate before rendering; add an explicit boundary layer 2020-09-07 17:42:05 -07:00
b7716d2dea Repurpose mat::Conductor to mat::Static
This will allow taking a material-independent snapshot of the SimState.
2020-09-06 12:18:31 -07:00
d26b4197af Introduce a Driver abstraction to encapsulate the SimState and the Renderers 2020-09-06 11:24:48 -07:00
3b1397e90c Implement a NullRenderer 2020-09-05 23:41:28 -07:00
fc14961d32 Render simulations to the terminal and to disk simultaneously 2020-09-05 17:43:51 -07:00
861d7430e2 Tune some rendering constants 2020-09-05 14:44:26 -07:00
8e71e02ac1 Fix clippy errors 2020-09-04 16:49:24 -07:00
6d7bb5becb Generalize rendering into a trait 2020-09-04 16:12:33 -07:00
99cb824a36 Implement a mp4 renderer 2020-09-03 22:34:56 -07:00
aff8764114 Implement a BH-curve material (example material is 3R1)
NB: I think there are some errors needing to be worked out, but at least
it doesn't crash!
2020-08-27 23:41:57 -07:00
6ac0dafa47 Have the GenericMaterial be an enum to make it easier to replace the ferromagnet model 2020-08-27 12:51:12 -07:00
c68964403d Fix COMSOL ferromagnet model, and make a new example for it
I'm a little skeptical of it as a model, though.
2020-08-22 22:35:45 -07:00
f4d8ffdf34 Untested ferromagnetic model
It's pretty basic.
2020-08-22 21:55:27 -07:00
dff8166906 Format these math comments so that they render properly for a tex-aware editor
Also document an error in the current logic
2020-08-16 20:14:46 -07:00
72c2ee599e Track the simulation time, and configure the feature size 2020-07-31 19:01:00 -07:00
5e4699b3e6 Fix the conductivity error (was calculating the wrong timestep)
Also, use f64 and force them to be real.
2020-07-31 18:46:19 -07:00
5388658b00 Add [broken] conductivity support
It doesn't seem to be solved by using f64
2020-07-31 18:03:40 -07:00
56cc5980dd Demo a B-imulse, because it behaves more symmetrically 2020-07-25 00:27:58 -07:00
1d9aa738ac Render just the B field: it gives a better visualization here 2020-07-24 23:39:07 -07:00
2e92980113 Buffer the rendering for better framerates; create a more useful example 2020-07-24 23:25:16 -07:00
5360d2c6d3 Add a 2d color-based renderer 2020-07-16 00:31:20 -07:00
b890d8dc3a Fix the math errors so that 2d simulations appear to now conserve energy. 2020-07-15 23:34:51 -07:00