pub fn check_face_normals(
    mesh: &Mesh,
    faces: &HashMap<FaceKey, Face>,
    solutions: &HashMap<FaceKey, [f64; 3]>,
    tolerance: f64,
) -> Result<(), StrError> {
    let ksi = &[0.0, 0.0, 0.0];
    let mut normal = Vector::new(mesh.ndim);
    for (face_key, solution) in solutions {
        let face = faces.get(face_key).ok_or("cannot find face_key in faces map")?;
        let mut pad = Scratchpad::new(mesh.ndim, face.kind)?;
        set_pad_coords(&mut pad, &face.points, mesh);
        op::calc_normal_vector(&mut normal, &mut pad, ksi)?;
        for i in 0..mesh.ndim {
            if f64::abs(normal[i] - solution[i]) > tolerance {
                return Err("wrong face normal vector found");
            }
        }
    }
    Ok(())
}
/// Checks if normal vectors of some faces are correct
Checks if normal vectors of some faces are correct
Checks if normal vectors of some faces are correct
pub fn check_face_normals(
    mesh: &Mesh,
    faces: &HashMap<FaceKey, Face>,
    solutions: &HashMap<FaceKey, [f64; 3]>,
    tolerance: f64,
) -> Result<(), StrError> {
    let ksi = &[0.0, 0.0, 0.0];
    let mut normal = Vector::new(mesh.ndim);
    for (face_key, solution) in solutions {
        let face = faces.get(face_key).ok_or("cannot find face_key in faces map")?;
        let mut pad = Scratchpad::new(mesh.ndim, face.kind)?;
        set_pad_coords(&mut pad, &face.points, mesh);
        op::calc_normal_vector(&mut normal, &mut pad, ksi)?;
        for i in 0..mesh.ndim {
            if f64::abs(normal[i] - solution[i]) > tolerance {
                return Err("wrong face normal vector found");
            }
        }
    }
    Ok(())
}
pub fn check_face_normals ( mesh : & Mesh , faces : & HashMap < FaceKey , Face > , solutions : & HashMap < FaceKey , [ f64 ; 3 ] > , tolerance : f64 , ) -> Result < ( ) , StrError > { let ksi = & [ 0.0 , 0.0 , 0.0 ] ; let mut normal = Vector :: new ( mesh . ndim ) ; for ( face_key , solution ) in solutions { let face = faces . get ( face_key ) . ok_or ( " " ) ? ; let mut pad = Scratchpad :: new ( mesh . ndim , face . kind ) ? ; set_pad_coords ( & mut pad , & face . points , mesh ) ; op :: calc_normal_vector ( & mut normal , & mut pad , ksi ) ? ; for i in 0 .. mesh . ndim { if f64 :: abs ( normal [ i ] - solution [ i ] ) > tolerance { return Err ( " " ) ; } } } Ok ( ( ) ) }
Checks if normal vectors of some faces are correct
Checks if normal vectors of some faces are correct
mesh
&Mesh
faces
&HashMap<FaceKey, Face>
solutions
&HashMap<FaceKey, [f64; 3]>
tolerance
f64
mesh
&Mesh
faces
&HashMap<FaceKey, Face>
solutions
&HashMap<FaceKey, [f64; 3]>
tolerance
f64