Skip to main content

Module fields

Module fields 

Source
Expand description

Layer 2 — field containers (VolField/SurfaceField), boundary conditions, and field-level tensor algebra. Field types: the discretised quantities carried on the mesh.

This module holds the data containers the FV operators read and write:

  • Field — a flat Vec<T> with element-wise arithmetic; the raw storage with no mesh or dimension bookkeeping (mirrors Foam::Field<Type>).
  • boundary — boundary conditions (BoundaryCondition) and per-patch boundary values (PatchField).
  • VolField (and the Vol*Field aliases) — cell-centred volume fields: one value per cell plus one PatchField per boundary patch.
  • SurfaceField (and the Surface*Field aliases) — face fields: one value per internal face plus one PatchField per boundary patch.
  • vol_field_algebra — pure per-element tensor algebra (tr, symm, dev, …) lifted to whole volume fields.
  • parallel — the same element-wise algebra and the field reductions, dispatched on ComputeBackend so a large mesh can use every CPU core. One entry point per operation; multi-threading is behind the crate’s parallel feature and the serial path is the trusted reference.

Physical units are not tracked at this layer; a field simply carries f64, Vector3, Tensor, or SymmTensor values in whatever SI units the caller assigns them.

Re-exports§

pub use field::Field;
pub use field::ScalarField;
pub use field::SymmTensorField;
pub use field::TensorField;
pub use field::VectorField;
pub use parallel::field_parallel_crossover;
pub use parallel::should_parallelise;
pub use boundary::*;
pub use surface_field::*;
pub use vol_field::*;

Modules§

boundary
Boundary conditions and per-patch boundary field values.
field
parallel
Backend-dispatched kernels for the element-wise field algebra.
surface_field
vol_field
vol_field_algebra
Field-level (GeometricField) tensor algebra.