$$ \gdef\pd#1#2{\frac{\partial #1}{\partial #2}} \gdef\d#1{\, \mathrm{d}#1} \gdef\dx{\d{x}} \gdef\tr#1{\operatorname{tr} (#1)} $$ $$ \gdef\norm#1{\left \lVert #1 \right\rVert} \gdef\seminorm#1{| #1 |} $$ $$ \gdef\vec#1{\mathbf{\boldsymbol{#1}}} \gdef\dvec#1{\bar{\vec #1}} $$

Type Alias fenris::mesh::Mesh3d

source ·
pub type Mesh3d<T, Connectivity> = Mesh<T, U3, Connectivity>;

Aliased Type§

struct Mesh3d<T, Connectivity> { /* private fields */ }

Implementations§

source§

impl<T, D, Connectivity> Mesh<T, D, Connectivity>where T: Scalar, D: DimName, DefaultAllocator: Allocator<T, D>,

source

pub fn vertices_mut(&mut self) -> &mut [OPoint<T, D>]

source

pub fn vertices(&self) -> &[OPoint<T, D>]

source

pub fn connectivity(&self) -> &[Connectivity]

source

pub fn from_vertices_and_connectivity( vertices: Vec<OPoint<T, D>>, connectivity: Vec<Connectivity> ) -> Self

Construct a mesh from vertices and connectivity.

The provided connectivity is expected only to return valid (i.e. in-bounds) indices, but this can not be trusted. Users of the mesh are permitted to panic if they encounter invalid indices, but unchecked indexing may easily lead to undefined behavior.

In other words, if the connectivity references indices out of bounds, then the code is incorrect. However, since this can be done exclusively with safe code, unchecked or unsafe indexing in which the user is trusted to provide valid indices may produce undefined behavior.Therefore, the connectivity must always be checked.

source§

impl<T, D, Connectivity> Mesh<T, D, Connectivity>where T: Scalar, D: DimName, DefaultAllocator: Allocator<T, D>, Connectivity: CellConnectivity<T, D>,

source

pub fn get_cell(&self, index: usize) -> Option<Connectivity::Cell>

source

pub fn cell_iter<'a>(&'a self) -> impl 'a + Iterator<Item = Connectivity::Cell>

source§

impl<T, D, C> Mesh<T, D, C>where T: Scalar, D: DimName, C: Connectivity, C::FaceConnectivity: Connectivity, DefaultAllocator: Allocator<T, D>,

source

pub fn find_boundary_cells(&self) -> Vec<usize>

Finds cells that have at least one boundary face.

source

pub fn find_boundary_faces(&self) -> Vec<(C::FaceConnectivity, usize, usize)>

Finds faces which are only connected to exactly one cell, along with the connected cell index and the local index of the face within that cell.

source

pub fn find_boundary_vertices(&self) -> Vec<usize>

Returns a sorted list of vertices that are determined to be on the boundary.

A vertex is considered to be a part of the boundary if it belongs to a boundary face.

source§

impl<T, D, C> Mesh<T, D, C>where T: Real, D: DimName, DefaultAllocator: Allocator<T, D>,

source

pub fn translate(&mut self, translation: &OVector<T, D>)

Translates all vertices of the mesh by the given translation vector.

source

pub fn translated(self, translation: &OVector<T, D>) -> Self

Consumes the mesh and returns it translated by the given translation vector.

source

pub fn transform_vertices<F>(&mut self, transformation: F)where F: FnMut(&mut OPoint<T, D>),

Transform all vertices of the mesh by the given transformation function.

source

pub fn transform_all_vertices<F>(&mut self, transformation: F)where F: FnMut(&mut [OPoint<T, D>]),

source§

impl<T, D, C> Mesh<T, D, C>where T: Scalar, D: DimName, C: ConnectivityMut, DefaultAllocator: Allocator<T, D>,

source

pub fn keep_cells(&self, cell_indices: &[usize]) -> Self

Returns a new mesh in which only the desired cells are kept. The vertices are removed or relabeled as necessary.

source§

impl<T, D, C> Mesh<T, D, C>where T: Scalar, D: DimName, C: Connectivity, C::FaceConnectivity: ConnectivityMut, DefaultAllocator: Allocator<T, D>,

source

pub fn extract_surface_mesh(&self) -> Mesh<T, D, C::FaceConnectivity>

Constructs a new mesh from the surface cells of the mesh.

The orientation of the faces are preserved.

Trait Implementations§

source§

impl<T, D, Connectivity> BoundedGeometry<T> for Mesh<T, D, Connectivity>where T: Real, D: DimName, DefaultAllocator: Allocator<T, D>, Connectivity: CellConnectivity<T, D>, Connectivity::Cell: BoundedGeometry<T, Dimension = D>,

source§

impl<T, D, C> BoundsForElementInSpace<T> for Mesh<T, D, C>where T: Scalar, D: SmallDim, C: ElementConnectivity<T, GeometryDim = D>, C::Element: BoundsForElement<T>, DefaultAllocator: ElementConnectivityAllocator<T, C>,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex20Connectivity>, Hex20Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex27Connectivity>, Hex27Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex8Connectivity>, Hex8Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Quad4d2Connectivity>, Quad4d2Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Quad9d2Connectivity>, Quad9d2Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet10Connectivity>, Tet10Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet20Connectivity>, Tet20Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet4Connectivity>, Tet4Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tri3d2Connectivity>, Tri3d2Connectivity>where T: Real,

source§

impl<T> CanonicalMassQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tri6d2Connectivity>, Tri6d2Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex20Connectivity>, Hex20Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex27Connectivity>, Hex27Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Hex8Connectivity>, Hex8Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Quad4d2Connectivity>, Quad4d2Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Quad9d2Connectivity>, Quad9d2Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet10Connectivity>, Tet10Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet20Connectivity>, Tet20Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tet4Connectivity>, Tet4Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tri3d2Connectivity>, Tri3d2Connectivity>where T: Real,

source§

impl<T> CanonicalStiffnessQuadrature for Mesh<T, ConnectivityGeometryDim<T, Tri6d2Connectivity>, Tri6d2Connectivity>where T: Real,

source§

impl<T: Clone + Scalar, D, Connectivity: Clone> Clone for Mesh<T, D, Connectivity>where D: DimName + Clone, DefaultAllocator: Allocator<T, D>,

source§

fn clone(&self) -> Mesh<T, D, Connectivity>

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<T, D, C> ClosestPointInElementInSpace<T> for Mesh<T, D, C>where T: Scalar, D: SmallDim, C: ElementConnectivity<T, GeometryDim = D>, C::Element: ClosestPointInElement<T>, DefaultAllocator: BiDimAllocator<T, C::GeometryDim, C::ReferenceDim>,

source§

fn closest_point_in_element( &self, element_index: usize, p: &OPoint<T, Self::GeometryDim> ) -> ClosestPoint<T, Self::ReferenceDim>

source§

impl<T: Debug + Scalar, D, Connectivity: Debug> Debug for Mesh<T, D, Connectivity>where D: DimName + Debug, DefaultAllocator: Allocator<T, D>,

source§

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

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

impl<'de, T, D, Connectivity> Deserialize<'de> for Mesh<T, D, Connectivity>where D: DimName, DefaultAllocator: Allocator<T, D>, <DefaultAllocator as Allocator<T, D>>::Buffer: Deserialize<'de>, Connectivity: Deserialize<'de>, T: Deserialize<'de> + Scalar,

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<T, D, C> ElementConnectivityAssembler for Mesh<T, D, C>where T: Scalar, D: DimName, C: Connectivity, DefaultAllocator: Allocator<T, D>,

source§

fn solution_dim(&self) -> usize

source§

fn num_elements(&self) -> usize

source§

fn num_nodes(&self) -> usize

source§

fn element_node_count(&self, element_index: usize) -> usize

source§

fn populate_element_nodes(&self, output: &mut [usize], element_index: usize)

source§

fn map_element_nodes<F>( self, new_num_nodes: usize, f: F ) -> MapElementNodes<Self, F>where Self: Sized,

Returns an adapter that modifies element node indices according to the provided function. Read more
source§

impl<T, D, C> FiniteElementConnectivity for Mesh<T, D, C>where T: Scalar, C: ElementConnectivity<T, GeometryDim = D>, D: SmallDim, DefaultAllocator: ElementConnectivityAllocator<T, C>,

source§

fn num_elements(&self) -> usize

source§

fn num_nodes(&self) -> usize

source§

fn element_node_count(&self, element_index: usize) -> usize

source§

fn populate_element_nodes(&self, nodes: &mut [usize], element_index: usize)

source§

impl<T, D, C> FiniteElementSpace<T> for Mesh<T, D, C>where T: Scalar, D: SmallDim, C: ElementConnectivity<T, GeometryDim = D>, C::ReferenceDim: SmallDim, DefaultAllocator: ElementConnectivityAllocator<T, C>,

§

type GeometryDim = D

§

type ReferenceDim = <C as ElementConnectivity<T>>::ReferenceDim

source§

fn populate_element_basis( &self, element_index: usize, basis_values: &mut [T], reference_coords: &OPoint<T, Self::ReferenceDim> )

source§

fn populate_element_gradients( &self, element_index: usize, gradients: MatrixViewMut<'_, T, Self::ReferenceDim, Dyn>, reference_coords: &OPoint<T, Self::ReferenceDim> )

source§

fn element_reference_jacobian( &self, element_index: usize, reference_coords: &OPoint<T, Self::ReferenceDim> ) -> OMatrix<T, Self::GeometryDim, Self::ReferenceDim>

Compute the Jacobian of the transformation from the reference element to the given element at the given reference coordinates.
source§

fn map_element_reference_coords( &self, element_index: usize, reference_coords: &OPoint<T, Self::ReferenceDim> ) -> OPoint<T, Self::GeometryDim>

Maps reference coordinates to physical coordinates in the element.
source§

fn diameter(&self, element_index: usize) -> T

The diameter of the finite element. Read more
source§

impl<'a, T> From<&'a Mesh<T, Const<3>, Hex8Connectivity>> for Mesh3d<T, Hex20Connectivity>where T: Real,

source§

fn from(initial_mesh: &'a Mesh3d<T, Hex8Connectivity>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a Mesh<T, Const<3>, Hex8Connectivity>> for Mesh3d<T, Hex27Connectivity>where T: Real,

source§

fn from(initial_mesh: &'a Mesh3d<T, Hex8Connectivity>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a Mesh<T, Const<3>, Hex8Connectivity>> for Tet4Mesh<T>where T: Real,

source§

fn from(hex_mesh: &'a HexMesh<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a Mesh<T, Const<3>, Tet10Connectivity>> for Mesh3d<T, Tet4Connectivity>where T: Real,

source§

fn from(initial_mesh: &'a Mesh3d<T, Tet10Connectivity>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a Mesh<T, Const<3>, Tet4Connectivity>> for Mesh3d<T, Tet10Connectivity>where T: Real,

source§

fn from(initial_mesh: &'a Mesh3d<T, Tet4Connectivity>) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Real> From<&'a Mesh<T, Const<3>, Tet4Connectivity>> for Tet20Mesh<T>

source§

fn from(tet4_mesh: &'a Tet4Mesh<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T, D, C> GeometryCollection<'a> for Mesh<T, D, C>where T: Scalar, D: DimName, C: CellConnectivity<T, D>, DefaultAllocator: Allocator<T, D>,

§

type Geometry = <C as CellConnectivity<T, D>>::Cell

source§

fn num_geometries(&self) -> usize

source§

fn get_geometry(&'a self, index: usize) -> Option<Self::Geometry>

source§

impl<T: PartialEq + Scalar, D, Connectivity: PartialEq> PartialEq<Mesh<T, D, Connectivity>> for Mesh<T, D, Connectivity>where D: DimName + PartialEq, DefaultAllocator: Allocator<T, D>,

source§

fn eq(&self, other: &Mesh<T, D, Connectivity>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, D, Connectivity> Serialize for Mesh<T, D, Connectivity>where D: DimName, DefaultAllocator: Allocator<T, D>, <DefaultAllocator as Allocator<T, D>>::Buffer: Serialize, Connectivity: Serialize, T: Serialize + Scalar,

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<T: Eq + Scalar, D, Connectivity: Eq> Eq for Mesh<T, D, Connectivity>where D: DimName + Eq, DefaultAllocator: Allocator<T, D>,

source§

impl<'a, T, D, C> GeometricFiniteElementSpace<'a, T> for Mesh<T, D, C>where T: Scalar, D: SmallDim, C: CellConnectivity<T, D> + ElementConnectivity<T, GeometryDim = D>, DefaultAllocator: ElementConnectivityAllocator<T, C>,

source§

impl<T: Scalar, D, Connectivity> StructuralEq for Mesh<T, D, Connectivity>where D: DimName, DefaultAllocator: Allocator<T, D>,

source§

impl<T: Scalar, D, Connectivity> StructuralPartialEq for Mesh<T, D, Connectivity>where D: DimName, DefaultAllocator: Allocator<T, D>,