step: backfill some documentation
This commit is contained in:
@@ -12,6 +12,7 @@ pub use support::{
|
||||
VolumeSamplePos,
|
||||
};
|
||||
|
||||
// TODO: make the fields private and hide behind a constructor?
|
||||
pub struct StepEContext<'a, R, M> {
|
||||
pub inv_feature_size: R,
|
||||
pub time_step: R,
|
||||
@@ -23,6 +24,9 @@ pub struct StepEContext<'a, R, M> {
|
||||
}
|
||||
|
||||
impl<'a, R: Real, M: Material<R>> StepEContext<'a, R, M> {
|
||||
/// given the simulation resoures (material, stimulus, fields),
|
||||
/// advance the `e` field at the provided index.
|
||||
/// this is a good toplevel function to use if you don't care about any of the details.
|
||||
pub fn step_flat_view<RM, RF, WF>(
|
||||
meta: SimMeta<R>,
|
||||
mat: &RM,
|
||||
@@ -59,6 +63,7 @@ impl<'a, R: Real, M: Material<R>> StepEContext<'a, R, M> {
|
||||
e_matrix[idx] = new_e;
|
||||
}
|
||||
|
||||
/// return the e field for this cell at `t=t_{now} + \delta t`
|
||||
pub fn step_e(self) -> Vec3<R> {
|
||||
let twice_eps0 = R::twice_eps0();
|
||||
let deltas = self.in_h.delta_h();
|
||||
@@ -90,6 +95,9 @@ pub struct StepHContext<'a, R, M> {
|
||||
}
|
||||
|
||||
impl<'a, R: Real, M: Material<R>> StepHContext<'a, R, M> {
|
||||
/// given the simulation resoures (material, stimulus, fields),
|
||||
/// advance the `h` field at the provided index.
|
||||
/// this is a good toplevel function to use if you don't care about any of the details.
|
||||
pub fn step_flat_view<RM, RF, WF>(
|
||||
meta: SimMeta<R>,
|
||||
mat: &RM,
|
||||
@@ -131,6 +139,7 @@ impl<'a, R: Real, M: Material<R>> StepHContext<'a, R, M> {
|
||||
m_matrix[idx] = new_m;
|
||||
}
|
||||
|
||||
/// return the `(h, m)` fields for this cell at `t=t_{now} + \delta t`
|
||||
pub fn step_h(self) -> (Vec3<R>, Vec3<R>) {
|
||||
let mu0 = R::mu0();
|
||||
let mu0_inv = R::mu0_inv();
|
||||
|
Reference in New Issue
Block a user