Skip to main content

DeviceFvmState

Struct DeviceFvmState 

Source
pub struct DeviceFvmState<T: FvmScalar, B: AcceleratorBackend> { /* private fields */ }
Expand description

Persistent scalar fields used by the two-kernel conservative FVM path.

Implementations§

Source§

impl<T: FvmScalar, B: AcceleratorBackend> DeviceFvmState<T, B>

Source

pub fn upload( backend: &B, plan: &DeviceFvmPlan<B>, cell_values: &[T], face_mass_flux: &[T], boundary_values: &[T], ) -> Result<Self, AcceleratorError>

Upload persistent field data and allocate flux/residual workspaces.

Source

pub fn upload_components( backend: &B, plan: &DeviceFvmPlan<B>, components: usize, cell_values: &[T], face_mass_flux: &[T], boundary_values: &[T], ) -> Result<Self, AcceleratorError>

Upload component-major state and allocate persistent workspaces.

Source

pub fn upload_sources( &mut self, backend: &B, face_source: &[T], cell_source: &[T], ) -> Result<(), AcceleratorError>

Refresh explicit component-major face and cell source arrays.

Source

pub fn upload_boundary_overrides( &mut self, backend: &B, values: &[T], ) -> Result<(), AcceleratorError>

Enable explicit per-component Dirichlet overrides for every boundary face.

Operator evaluations normally use the values packed in the boundary policy. This method is the explicit opt-in for component-dependent Dirichlet data.

Source

pub fn clear_boundary_overrides( &mut self, backend: &B, ) -> Result<(), AcceleratorError>

Disable all explicit per-component Dirichlet overrides.

Source

pub fn components(&self) -> usize

Number of component-major fields in this state.

Source

pub fn cell_values(&self) -> &B::Buffer<T>

Read-only resident cell values.

Source

pub fn face_mass_flux(&self) -> &B::Buffer<T>

Read-only resident face mass fluxes.

Source

pub fn residual(&self) -> &B::Buffer<T>

Read-only resident residual values.

Source

pub fn gradient_x(&self) -> &B::Buffer<T>

Read-only resident x-gradient values.

Source

pub fn upload_cell_values( &mut self, backend: &B, values: &[T], ) -> Result<(), AcceleratorError>

Refresh all component-major cell values.

Source

pub fn upload_face_mass_flux( &mut self, backend: &B, values: &[T], ) -> Result<(), AcceleratorError>

Refresh the shared face mass-flux field.

Source

pub fn download_residual(&self, backend: &B) -> Result<Vec<T>, AcceleratorError>

Download the gathered residual vector.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AccumulatePathExt for T

Source§

fn accumulate_path<O, I>(path: I) -> O
where O: Orientation, I: IntoIterator<Item = O>,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.