Enum Grid3

Source
pub enum Grid3 {
    Regular {
        size: Vector3,
        count: [u32; 3],
    },
    Tensor {
        u: Array<Scalar>,
        v: Array<Scalar>,
        w: Array<Scalar>,
    },
}
Expand description

Defines a 3D grid spacing and size.

Variants§

§

Regular

Regularly spaced cells.

<sodipodi:namedview id=“namedview7” pagecolor=“#ffffff” bordercolor=“#000000” borderopacity=“0.25” inkscape:pageshadow=“2” inkscape:pageopacity=“0.0” inkscape:pagecheckerboard=“0” inkscape:deskcolor=“#d1d1d1” inkscape:document-units=“mm” showgrid=“false” inkscape:zoom=“5.6568544” inkscape:cx=“237.14593” inkscape:cy=“365.04387” inkscape:window-width=“2481” inkscape:window-height=“1417” inkscape:window-x=“71” inkscape:window-y=“-8” inkscape:window-maximized=“1” inkscape:current-layer=“layer4” /> c c c c c c a u b b b b a a a a v w A 3D regular grid with size [a, b, c] and count [5, 4, 6]

Fields

§size: Vector3

The block size in the U and V axes. All must be greater than zero.

§count: [u32; 3]

The number of cells in the U, V, and W axes. All must be greater than zero.

§

Tensor

Tensor cells, where each row, column, and layer can have a different size. All sizes must be greater than zero.

<sodipodi:namedview id=“namedview7” pagecolor=“#ffffff” bordercolor=“#000000” borderopacity=“0.25” inkscape:pageshadow=“2” inkscape:pageopacity=“0.0” inkscape:pagecheckerboard=“0” inkscape:deskcolor=“#d1d1d1” inkscape:document-units=“mm” showgrid=“false” inkscape:zoom=“11.313709” inkscape:cx=“163.73941” inkscape:cy=“384.40091” inkscape:window-width=“2481” inkscape:window-height=“1417” inkscape:window-x=“71” inkscape:window-y=“-8” inkscape:window-maximized=“1” inkscape:current-layer=“layer4” /> c₅ c₄ c₃ c₂ c₁ c₀ a₀ u b₀ b₁ b₂ b₃ a₁ a₂ a₃ a₄ v w A 3D tensor grid w = [ c₀ c₁ c₂ c₃ c₄ c₅ ] v = [ b₀ b₁ b₃ b₃ ] u = [ a₀ a₁ a₂ a₃ a₄ ]

Fields

§u: Array<Scalar>

Array with Scalar type storing the size of each cell along the U axis. These sizes must be greater than zero.

§v: Array<Scalar>

Array with Scalar type storing the size of each cell along the V axis. These sizes must be greater than zero.

§w: Array<Scalar>

Array with Scalar type storing the size of each cell along the W axis. These sizes must be greater than zero.

Implementations§

Source§

impl Grid3

Source

pub fn from_size_and_count(size: Vector3, count: [u32; 3]) -> Self

Create a 3D regular grid from the block size and count.

Source

pub fn from_arrays(u: Array<Scalar>, v: Array<Scalar>, w: Array<Scalar>) -> Self

Create a 3D tensor grid from the size arrays.

Source

pub fn count(&self) -> [u32; 3]

Returns the number of blocks in each axis.

Source

pub fn flat_count(&self) -> u64

Returns the total number of blocks.

Source

pub fn flat_corner_count(&self) -> u64

Returns the total number of block corners.

Trait Implementations§

Source§

impl Clone for Grid3

Source§

fn clone(&self) -> Grid3

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Grid3

Source§

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

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

impl Default for Grid3

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Grid3

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Grid3

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Grid3

Source§

fn eq(&self, other: &Grid3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Grid3

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Validate for Grid3

Source§

fn validate(&mut self) -> Result<Problems, Problems>

Call to validate the object, returning errors and warnings. Read more
Source§

impl StructuralPartialEq for Grid3

Auto Trait Implementations§

§

impl Freeze for Grid3

§

impl RefUnwindSafe for Grid3

§

impl Send for Grid3

§

impl Sync for Grid3

§

impl Unpin for Grid3

§

impl UnwindSafe for Grid3

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, dst: *mut u8)

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

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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 = 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,