pub struct SurfaceField<T: Clone> {
pub name: String,
pub mesh: Arc<FvMesh>,
pub internal: Field<T>,
pub boundary: Vec<PatchField<T>>,
}Expand description
A surface field: one value per internal face in the internal field, plus
one PatchField per boundary patch.
Mirrors Foam::surfaceScalarField / Foam::SurfaceField<Type>.
§Why internal has length n_internal_faces, not n_faces
In OpenFOAM, surfaceScalarField.internalField() only covers the internal
faces; boundary-face values live in boundaryField()[patch]. This matches
the LDU matrix structure: lower and upper arrays have length
n_internal_faces.
Fields§
§name: StringField name (diagnostic label, e.g. "phi").
mesh: Arc<FvMesh>Mesh this field is defined on.
internal: Field<T>Face values for all internal faces; length == mesh.n_internal_faces.
boundary: Vec<PatchField<T>>One entry per boundary patch; boundary[i].values has length
mesh.patches[i].size.
Implementations§
Source§impl<T: Clone> SurfaceField<T>
impl<T: Clone> SurfaceField<T>
Sourcepub fn new(
name: impl Into<String>,
mesh: Arc<FvMesh>,
internal: Field<T>,
boundary: Vec<PatchField<T>>,
) -> Self
pub fn new( name: impl Into<String>, mesh: Arc<FvMesh>, internal: Field<T>, boundary: Vec<PatchField<T>>, ) -> Self
Assemble a surface field from its internal-face values and per-patch
boundary fields. In debug builds, asserts that internal has length
mesh.n_internal_faces and that boundary has one entry per patch.
Source§impl SurfaceField<f64>
impl SurfaceField<f64>
Source§impl SurfaceField<Vector3>
impl SurfaceField<Vector3>
Source§impl<T: Clone + Default> SurfaceField<T>
impl<T: Clone + Default> SurfaceField<T>
Sourcepub fn face_value(&self, f: usize) -> T
pub fn face_value(&self, f: usize) -> T
Value at any face: internal face → from internal; boundary face →
from the appropriate patch’s values.
Trait Implementations§
Source§impl<T> Add for SurfaceField<T>
impl<T> Add for SurfaceField<T>
Source§impl<T> Div<f64> for SurfaceField<T>
impl<T> Div<f64> for SurfaceField<T>
Source§impl<T: Mul<f64, Output = T> + Clone> Mul<SurfaceField<T>> for f64
impl<T: Mul<f64, Output = T> + Clone> Mul<SurfaceField<T>> for f64
Source§type Output = SurfaceField<T>
type Output = SurfaceField<T>
* operator.Source§fn mul(self, rhs: SurfaceField<T>) -> SurfaceField<T>
fn mul(self, rhs: SurfaceField<T>) -> SurfaceField<T>
* operation. Read more