meas: Energy: allow non-meas code to query a simulation's energy

this is especially useful in test
This commit is contained in:
2022-08-23 16:37:31 -07:00
parent f47c713e0e
commit dcd7079c5f

View File

@@ -615,7 +615,7 @@ impl Energy {
region: Box::new(region),
}
}
fn data<S: AbstractSim>(&self, state: &S) -> f32 {
pub(crate) fn data<S: AbstractSim>(&self, state: &S) -> f32 {
// Potential energy stored in a E/M field:
// https://en.wikipedia.org/wiki/Magnetic_energy
// https://en.wikipedia.org/wiki/Electric_potential_energy#Energy_stored_in_an_electrostatic_field_distribution