pub(crate) fn extract_all_faces(mesh: &Mesh) -> MapFaceToCells {
    assert_eq!(mesh.ndim, 3);
    let mut faces = HashMap::new();
    mesh.cells.iter().for_each(|cell| {
        if cell.kind.ndim() == 3 {
            for f in 0..cell.kind.nface() {
                let mut face_key: FaceKey = if cell.kind.face_nnode() > 3 {
                    (
                        cell.points[cell.kind.face_node_id(f, 0)],
                        cell.points[cell.kind.face_node_id(f, 1)],
                        cell.points[cell.kind.face_node_id(f, 2)],
                        cell.points[cell.kind.face_node_id(f, 3)],
                    )
                } else {
                    (
                        cell.points[cell.kind.face_node_id(f, 0)],
                        cell.points[cell.kind.face_node_id(f, 1)],
                        cell.points[cell.kind.face_node_id(f, 2)],
                        mesh.points.len(),
                    )
                };
                sort4(&mut face_key);
                let data = faces.entry(face_key).or_insert(Vec::new());
                data.push((cell.id, f));
            }
        }
    });
    faces
}
/// Extracts all faces (internal and boundary)
///
/// # Output
///
/// * Returns a map relating face keys to `Vec<(cell_id, f)>` where:
///     - `cell_id` -- is the id of the cell sharing the face
///     - `f` -- is the cell's local face index
///
/// # Panics
///
/// 1. It panics if `mesh.ndim != 3` (i.e., this function works in 3D only)
Extracts all faces (internal and boundary)
Extracts all faces ( internal and boundary )
pub(crate) fn extract_all_faces(mesh: &Mesh) -> MapFaceToCells {
    assert_eq!(mesh.ndim, 3);
    let mut faces = HashMap::new();
    mesh.cells.iter().for_each(|cell| {
        if cell.kind.ndim() == 3 {
            for f in 0..cell.kind.nface() {
                let mut face_key: FaceKey = if cell.kind.face_nnode() > 3 {
                    (
                        cell.points[cell.kind.face_node_id(f, 0)],
                        cell.points[cell.kind.face_node_id(f, 1)],
                        cell.points[cell.kind.face_node_id(f, 2)],
                        cell.points[cell.kind.face_node_id(f, 3)],
                    )
                } else {
                    (
                        cell.points[cell.kind.face_node_id(f, 0)],
                        cell.points[cell.kind.face_node_id(f, 1)],
                        cell.points[cell.kind.face_node_id(f, 2)],
                        mesh.points.len(),
                    )
                };
                sort4(&mut face_key);
                let data = faces.entry(face_key).or_insert(Vec::new());
                data.push((cell.id, f));
            }
        }
    });
    faces
}
pub ( crate ) fn extract_all_faces ( mesh : & Mesh ) -> MapFaceToCells { assert_eq ! ( mesh ndim 3 ) ; let mut faces = HashMap :: new ( ) ; mesh . cells . iter ( ) . for_each ( | cell | { if cell . kind . ndim ( ) == 3 { for f in 0 .. cell . kind . nface ( ) { let mut face_key : FaceKey = if cell . kind . face_nnode ( ) > 3 { ( cell . points [ cell . kind . face_node_id ( f , 0 ) ] , cell . points [ cell . kind . face_node_id ( f , 1 ) ] , cell . points [ cell . kind . face_node_id ( f , 2 ) ] , cell . points [ cell . kind . face_node_id ( f , 3 ) ] , ) } else { ( cell . points [ cell . kind . face_node_id ( f , 0 ) ] , cell . points [ cell . kind . face_node_id ( f , 1 ) ] , cell . points [ cell . kind . face_node_id ( f , 2 ) ] , mesh . points . len ( ) , ) } ; sort4 ( & mut face_key ) ; let data = faces . entry ( face_key ) . or_insert ( Vec :: new ( ) ) ; data . push ( ( cell . id , f ) ) ; } } } ) ; faces }
Extracts all faces (internal and boundary)
Extracts all faces ( internal and boundary )
mesh
&Mesh
mesh
&Mesh
output
Returns a map relating face keys to `Vec<(cell_id, f)>` where:
`cell_id` -- is the id of the cell sharing the face
`f` -- is the cell's local face index
Returns a map relating face keys to ` Vec< ( cell_id f ) > ` where : ` cell_id ` -- is the id of the cell sharing the face ` f ` -- is the cell ' s local face index
panics
1. It panics if `mesh.ndim != 3`
1 . It panics if ` mesh . ndim ! = 3 `