Skip to main content

CompartmentMeshManip

Trait CompartmentMeshManip 

Source
pub trait CompartmentMeshManip {
    // Required methods
    fn are_cell_neighbor(
        &self,
        cell1_id: usize,
        cell2_id: usize,
    ) -> NeighborDirection;
    fn cell_surface(&self, cell_id: usize, i_axis: OrientedAxis) -> f64;
    fn cell_volume(&self, cell_id: usize) -> f64;
    fn cell_from_coordinates(&self, coords: &Coords3) -> Option<usize>;
    fn is_point_inside(&self, cell_id: usize, point_coords: &Coords3) -> bool;
    fn cell_points(&self, cell_1d: usize) -> AxisPoints;
    fn n_maximum_interface(&self) -> usize;
    fn get_interface_plane(
        &self,
        cell1_id: usize,
        cell2_id: usize,
    ) -> (BoundedPlane, usize);
    fn cell_from_ax_points(&self, axis_points: &AxisPoints) -> Option<usize>;
    fn get_boundary(&self) -> Vec<usize>;
}
Expand description

Trait for manipulating and querying properties of cells in a compartment mesh.

Required Methods§

Source

fn are_cell_neighbor( &self, cell1_id: usize, cell2_id: usize, ) -> NeighborDirection

Determines if two cells are neighbors and returns the direction of neighborhood.

§Arguments
  • cell1_id - The ID of the first cell.
  • cell2_id - The ID of the second cell.
§Returns

A NeighborDirection indicating whether and how the cells are neighbors.

Source

fn cell_surface(&self, cell_id: usize, i_axis: OrientedAxis) -> f64

Computes the surface area of a specified cell.

§Arguments
  • cell_id - The ID of the cell.
  • axis_project - Axis index on which the surface is calculated
§Returns

The surface area of the cell as a floating-point number.

Source

fn cell_volume(&self, cell_id: usize) -> f64

Computes the volume of a specified cell.

§Arguments
  • cell_id - The ID of the cell.
§Returns

The volume of the cell as a floating-point number.

Source

fn cell_from_coordinates(&self, coords: &Coords3) -> Option<usize>

Finds the cell ID corresponding to specific 3D coordinates.

§Arguments
  • coords - A reference to a Coords3 representing the 3D coordinates.
§Returns

An Option<usize> containing the cell ID if found, or None otherwise.

Source

fn is_point_inside(&self, cell_id: usize, point_coords: &Coords3) -> bool

Checks if a point is inside a specified cell.

§Arguments
  • cell_id - The ID of the cell to check.
  • point_coords - A reference to a Coords3 representing the point’s coordinates.
§Returns

A boolean indicating whether the point is inside the cell.

Source

fn cell_points(&self, cell_1d: usize) -> AxisPoints

Retrieves the points index defining a specified cell.

§Arguments
  • cell_1d - The ID of the cell.
§Returns

An AxisPoints object containing the indices of points of the cell.

Source

fn n_maximum_interface(&self) -> usize

Returns the maximum number of interfaces a cell can have in this mesh.

§Returns

The maximum number of interfaces as a usize.

Source

fn get_interface_plane( &self, cell1_id: usize, cell2_id: usize, ) -> (BoundedPlane, usize)

Source

fn cell_from_ax_points(&self, axis_points: &AxisPoints) -> Option<usize>

Source

fn get_boundary(&self) -> Vec<usize>

Implementors§