Struct openfoamparser::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: PathBuf
boundary: 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]
&mut self,
filename: P
) -> Result<(), Error>
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]
&self,
cell_id: usize,
bd_name: Option<String>
) -> bool
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]
&self,
face_id: usize,
bd_name: Option<String>
) -> bool
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]
filename: P,
skip: usize
) -> Result<Vec<T>, Error>
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]
filename: P,
skip: usize
) -> Result<Vec<Vec<usize>>, Error>
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]
filename: P,
skip: usize
) -> Result<Vec<Point3<f64>>, Error>
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]
filename: P,
skip: usize
) -> Result<HashMap<String, Boundary>, Error>
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
impl RefUnwindSafe for FoamMesh
impl Send for FoamMesh
impl Sync for FoamMesh
impl Unpin for FoamMesh
impl UnwindSafe for FoamMesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,