Write a custom Field or Disturbance¶
Draft
This guide is scaffolded. The outline below marks what it should cover.
Most extensions are a new Disturbance on an
existing Field — a new gravity source, a new flow.
A genuinely new physical kind is a new Field subclass.
To cover¶
- New disturbance (common case) — subclass
Disturbance, implementcontribute_at_sym(point, t), set thecombiningflag (additive / averaged / projected), add it to the field instance. - Estimable disturbance — carry
State/Noisedeclarations so the disturbance becomes an EKF-estimated state (asCraftWindBubbledoes). - Body-anchored disturbance — emit it from a
FieldSourcepart so it rides a craft. - New field kind (rare) — subclass
Field/SuperposedField, define the value type and the_scale/_project_combinehooks if the value is compound (seeFluidField/FluidState).
Source material¶
- Reference: Fields
- Concepts: Fields and disturbances
- Code:
manta/fields/base.py,manta/fields/gravity.py(simple disturbances),manta/fields/fluid.py(compound value)