Skip to main content

VolField

Struct VolField 

Source
pub struct VolField<T: Clone> {
    pub name: String,
    pub mesh: Arc<FvMesh>,
    pub internal: Field<T>,
    pub boundary: Vec<PatchField<T>>,
}
Expand description

A volume field: one value per cell in the internal field, plus one PatchField per boundary patch.

Mirrors Foam::volScalarField / Foam::VolumeField<Type>. The internal field has length mesh.n_cells.

Fields§

§name: String

Field name (diagnostic label, e.g. "p", "U", "T").

§mesh: Arc<FvMesh>

Mesh this field is defined on.

§internal: Field<T>

Cell-centred values; length == mesh.n_cells.

§boundary: Vec<PatchField<T>>

One entry per boundary patch; boundary[i].values has length mesh.patches[i].size.

Implementations§

Source§

impl<T: Clone + Default> VolField<T>

Source

pub fn new( name: impl Into<String>, mesh: Arc<FvMesh>, internal: Field<T>, boundary: Vec<PatchField<T>>, ) -> Self

Assemble a volume field from its cell-centred values and per-patch boundary fields. In debug builds, asserts that internal has length mesh.n_cells and that boundary has one entry per patch.

Source§

impl VolField<f64>

Source

pub fn uniform(name: impl Into<String>, mesh: Arc<FvMesh>, value: f64) -> Self

Uniform scalar field over the entire domain.

Source

pub fn zeros(name: impl Into<String>, mesh: Arc<FvMesh>) -> Self

Zero-valued scalar field over the entire domain (zero-gradient boundaries).

Source§

impl VolField<Vector3>

Source

pub fn uniform( name: impl Into<String>, mesh: Arc<FvMesh>, value: Vector3, ) -> Self

Uniform vector field over the entire domain.

Source

pub fn zero(name: impl Into<String>, mesh: Arc<FvMesh>) -> Self

Zero-valued vector field over the entire domain (zero-gradient boundaries).

Trait Implementations§

Source§

impl<T> Add for VolField<T>
where T: Add<Output = T> + Clone + Default,

Source§

type Output = VolField<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Clone + Clone> Clone for VolField<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Clone> Debug for VolField<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Div<f64> for VolField<T>
where T: Mul<f64, Output = T> + Clone,

Source§

type Output = VolField<T>

The resulting type after applying the / operator.
Source§

fn div(self, s: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Mul<f64, Output = T> + Clone> Mul<VolField<T>> for f64

Source§

type Output = VolField<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: VolField<T>) -> VolField<T>

Performs the * operation. Read more
Source§

impl Mul<VolField<Vector3>> for VolScalarField

Source§

type Output = VolField<Vector3>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: VolVectorField) -> VolVectorField

Performs the * operation. Read more
Source§

impl<T> Mul<f64> for VolField<T>
where T: Mul<f64, Output = T> + Clone,

Source§

type Output = VolField<T>

The resulting type after applying the * operator.
Source§

fn mul(self, s: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> Neg for VolField<T>
where T: Neg<Output = T> + Clone,

Source§

type Output = VolField<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T> Sub for VolField<T>
where T: Sub<Output = T> + Clone + Default,

Source§

type Output = VolField<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for VolField<T>
where Field<T>: Freeze, Vec<PatchField<T>>: Freeze,

§

impl<T> RefUnwindSafe for VolField<T>

§

impl<T> Send for VolField<T>
where Field<T>: Send, Vec<PatchField<T>>: Send,

§

impl<T> Sync for VolField<T>
where Field<T>: Sync, Vec<PatchField<T>>: Sync,

§

impl<T> Unpin for VolField<T>
where Field<T>: Unpin, Vec<PatchField<T>>: Unpin,

§

impl<T> UnsafeUnpin for VolField<T>

§

impl<T> UnwindSafe for VolField<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.