pub fn check_ids_and_kind(mesh: &Mesh) -> Result<(), StrError> {
    let npoint = mesh.points.len();
    for i in 0..npoint {
        if mesh.points[i].id != i {
            return Err("incorrect point id found; ids must be sequential");
        }
    }
    for i in 0..mesh.cells.len() {
        if mesh.cells[i].id != i {
            return Err("incorrect cell id found; ids must be sequential");
        }
        if mesh.cells[i].points.len() != mesh.cells[i].kind.nnode() {
            return Err("number of cell points does not correspond to kind.nnode()");
        }
        for p in &mesh.cells[i].points {
            if *p >= npoint {
                return Err("the id of a point specified in the points list of a cell is out of bounds");
            }
        }
    }
    Ok(())
}
/// Checks if the IDs of points and cells are sequential and within bounds
///
/// This function checks that:
///
/// 1. The position of a point in the points vector matches the id of the point
/// 2. The position of a cell in the cells vector matches the id of the cell
/// 3. The number of points of a cell matches the [crate::shapes::GeoKind]
/// 4. The points of a cell are within the range of available points; i.e., 0 and npoint
Checks if the IDs of points and cells are sequential and within bounds
This function checks that.

1. The position of a point in the points vector matches the id of the point
2. The position of a cell in the cells vector matches the id of the cell
3. The number of points of a cell matches the [crate::shapes::GeoKind]
4. The points of a cell are within the range of available points; i.e., 0 and npoint
Checks if the IDs of points and cells are sequential and within bounds This function checks that . 1 . The position of a point in the points vector matches the id of the point 2 . The position of a cell in the cells vector matches the id of the cell 3 . The number of points of a cell matches the [ crate :: shapes :: GeoKind ] 4 . The points of a cell are within the range of available points ; i . e . 0 and npoint
pub fn check_ids_and_kind(mesh: &Mesh) -> Result<(), StrError> {
    let npoint = mesh.points.len();
    for i in 0..npoint {
        if mesh.points[i].id != i {
            return Err("incorrect point id found; ids must be sequential");
        }
    }
    for i in 0..mesh.cells.len() {
        if mesh.cells[i].id != i {
            return Err("incorrect cell id found; ids must be sequential");
        }
        if mesh.cells[i].points.len() != mesh.cells[i].kind.nnode() {
            return Err("number of cell points does not correspond to kind.nnode()");
        }
        for p in &mesh.cells[i].points {
            if *p >= npoint {
                return Err("the id of a point specified in the points list of a cell is out of bounds");
            }
        }
    }
    Ok(())
}
pub fn check_ids_and_kind ( mesh : & Mesh ) -> Result < ( ) , StrError > { let npoint = mesh . points . len ( ) ; for i in 0 .. npoint { if mesh . points [ i ] . id != i { return Err ( " " ) ; } } for i in 0 .. mesh . cells . len ( ) { if mesh . cells [ i ] . id != i { return Err ( " " ) ; } if mesh . cells [ i ] . points . len ( ) != mesh . cells [ i ] . kind . nnode ( ) { return Err ( " " ) ; } for p in & mesh . cells [ i ] . points { if * p >= npoint { return Err ( " " ) ; } } } Ok ( ( ) ) }
Checks if the IDs of points and cells are sequential and within bounds
This function checks that:
Checks if the IDs of points and cells are sequential and within bounds This function checks that :
mesh
&Mesh
mesh
&Mesh