pub fn check_jacobian(mesh: &Mesh) -> Result<(), StrError> {
    let ksi = [ONE_BY_3, ONE_BY_3, ONE_BY_3];
    for cell in &mesh.cells {
        let mut pad = Scratchpad::new(mesh.ndim, cell.kind)?;
        set_pad_coords(&mut pad, &cell.points, mesh);
        let det_jac = op::calc_jacobian(&mut pad, &ksi)?;
        if geo_case(cell.kind.ndim(), mesh.ndim) == GeoCase::Shell {
            assert_eq!(det_jac, DET_JAC_NOT_AVAILABLE);
        } else {
            if det_jac < 0.0 {
                return Err("negative determinant of Jacobian found");
            }
        }
    }
    Ok(())
}
/// Checks if the determinants of the Jacobian of all cells are non-negative
Checks if the determinants of the Jacobian of all cells are non-negative
Checks if the determinants of the Jacobian of all cells are non - negative
pub fn check_jacobian(mesh: &Mesh) -> Result<(), StrError> {
    let ksi = [ONE_BY_3, ONE_BY_3, ONE_BY_3];
    for cell in &mesh.cells {
        let mut pad = Scratchpad::new(mesh.ndim, cell.kind)?;
        set_pad_coords(&mut pad, &cell.points, mesh);
        let det_jac = op::calc_jacobian(&mut pad, &ksi)?;
        if geo_case(cell.kind.ndim(), mesh.ndim) == GeoCase::Shell {
            assert_eq!(det_jac, DET_JAC_NOT_AVAILABLE);
        } else {
            if det_jac < 0.0 {
                return Err("negative determinant of Jacobian found");
            }
        }
    }
    Ok(())
}
pub fn check_jacobian ( mesh : & Mesh ) -> Result < ( ) , StrError > { let ksi = [ ONE_BY_3 , ONE_BY_3 , ONE_BY_3 ] ; for cell in & mesh . cells { let mut pad = Scratchpad :: new ( mesh . ndim , cell . kind ) ? ; set_pad_coords ( & mut pad , & cell . points , mesh ) ; let det_jac = op :: calc_jacobian ( & mut pad , & ksi ) ? ; if geo_case ( cell . kind . ndim ( ) , mesh . ndim ) == GeoCase :: Shell { assert_eq ! ( det_jac DET_JAC_NOT_AVAILABLE ) ; } else { if det_jac < 0.0 { return Err ( " " ) ; } } } Ok ( ( ) ) }
Checks if the determinants of the Jacobian of all cells are non-negative
Checks if the determinants of the Jacobian of all cells are non - negative
mesh
&Mesh
mesh
&Mesh