Struct openfoamparser_rust::FoamMesh[][src]

pub struct FoamMesh {
    pub path: PathBuf,
    pub boundary: HashMap<String, Boundary>,
    pub points: Vec<Point3<f64>>,
    pub faces: Vec<Vec<usize>>,
    pub cell_faces: Vec<Vec<usize>>,
    pub owners: Vec<usize>,
    pub neighbors: Vec<i64>,
    pub cell_neighbors: Vec<Vec<i64>>,
    pub cell_centers: Option<Vec<Point3<f64>>>,
    // some fields omitted
}

Fields

path: PathBufboundary: HashMap<String, Boundary>points: Vec<Point3<f64>>faces: Vec<Vec<usize>>

A face is defined as a list of point indices. Each face also is represented in the list of owners and neighbors.

cell_faces: Vec<Vec<usize>>owners: Vec<usize>

Indices of the cell that is the owner of the respective face.

neighbors: Vec<i64>

Indices of neighboring cells for each internal face.

cell_neighbors: Vec<Vec<i64>>cell_centers: Option<Vec<Point3<f64>>>

Implementations

impl FoamMesh[src]

pub fn new<P: AsRef<Path>>(path: P) -> Result<FoamMesh, Error>[src]

pub fn read_cell_centers<P: AsRef<Path>>(
    &mut self,
    filename: P
) -> Result<(), Error>
[src]

Read cell center coordinates from the given file (e.g., 0/C).

Such a file can be generated by running postProcess -func 'writeCellCentres' -time 0.

pub fn num_inner_faces(&self) -> usize[src]

pub fn num_cells(&self) -> usize[src]

pub fn cell_neighbor_cells(&self, cell_id: usize) -> Option<&Vec<i64>>[src]

Return the indices of neighbor cells of the cell with index cell_id.

pub fn is_cell_on_boundary(
    &self,
    cell_id: usize,
    bd_name: Option<String>
) -> bool
[src]

Check if a cell is on a boundary.

Run-time complexity is in O(n), where n is the maximum number of neighbors of a cell.

pub fn is_face_on_boundary(
    &self,
    face_id: usize,
    bd_name: Option<String>
) -> bool
[src]

Check if a face is a boundary face (in O(1)).

pub fn boundary_cells(&self, bd_name: &str) -> Vec<usize>[src]

Get cell IDs of cells on a given boundary. Returns an empty vector if the named boundary does not exist.

pub fn parse_scalars<P: AsRef<Path>, T: FromStr>(
    filename: P,
    skip: usize
) -> Result<Vec<T>, Error>
[src]

Parse scalar values from a given ASCII file.

Expects a file in the following format:

// …

11360
(
42
0
3
// …
)

pub fn parse_faces<P: AsRef<Path>>(
    filename: P,
    skip: usize
) -> Result<Vec<Vec<usize>>, Error>
[src]

Parse faces from a given ASCII file. Each face is a list of point indices.

Expects a file in the following format:

// …

11360
(
4(1 42 1723 1682)
3(2 3 4)
// …
)

pub fn parse_points<P: AsRef<Path>>(
    filename: P,
    skip: usize
) -> Result<Vec<Point3<f64>>, Error>
[src]

Parse mesh point data from a given ASCII file.

Expects a file in the following format:

// …

5043
(
(42 0 1)
(3 2.001 13.37)
// …
)

pub fn parse_boundary<P: AsRef<Path>>(
    filename: P,
    skip: usize
) -> Result<HashMap<String, Boundary>, Error>
[src]

Parse an OpenFOAM boundary definition file.

Expects a file in the following format:

// …

3
(
    inlet
    {
        type            patch;
        nFaces          605;
        startFace       971201;
    }
    outlet
    {
        type            patch;
        nFaces          605;
        startFace       971806;
    }
    walls
    {
        type            patch;
        nFaces          23848;
        startFace       972411;
    }
)

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,