tet_valid Function

function tet_valid(msh, ic)

Uses

  • proc~~tet_valid~~UsesGraph proc~tet_valid tet_valid module~class_vector class_vector proc~tet_valid->module~class_vector module~tools_mesh_optimize tools_mesh_optimize proc~tet_valid->module~tools_mesh_optimize module~class_connectivity class_connectivity proc~tet_valid->module~class_connectivity module~class_psblas class_psblas proc~tet_valid->module~class_psblas module~class_vertex class_vertex proc~tet_valid->module~class_vertex module~class_mesh class_mesh proc~tet_valid->module~class_mesh module~class_vector->module~class_psblas module~tools_mesh_optimize->module~class_connectivity module~tools_mesh_optimize->module~class_vertex module~tools_mesh_optimize->module~class_mesh module~class_bc class_bc module~tools_mesh_optimize->module~class_bc module~class_iterating class_iterating module~tools_mesh_optimize->module~class_iterating module~class_connectivity->module~class_psblas module~class_stopwatch class_stopwatch module~class_psblas->module~class_stopwatch module~tools_psblas tools_psblas module~class_psblas->module~tools_psblas module~class_vertex->module~class_vector module~class_vertex->module~class_psblas module~class_mesh->module~class_vector module~class_mesh->module~class_connectivity module~class_mesh->module~class_psblas module~class_mesh->module~class_vertex module~class_cell class_cell module~class_mesh->module~class_cell module~class_keytable class_keytable module~class_mesh->module~class_keytable module~class_surface class_surface module~class_mesh->module~class_surface module~class_least_squares class_least_squares module~class_mesh->module~class_least_squares psb_base_mod psb_base_mod module~class_mesh->psb_base_mod module~grid_interface grid_interface module~class_mesh->module~grid_interface module~class_face class_face module~class_mesh->module~class_face module~class_stopwatch->module~tools_psblas module~class_stopwatch->psb_base_mod module~class_cell->module~class_psblas module~class_bc->module~class_psblas module~class_motion class_motion module~class_bc->module~class_motion module~class_bc_math class_bc_math module~class_bc->module~class_bc_math module~class_bc_wall class_bc_wall module~class_bc->module~class_bc_wall module~tools_psblas->psb_base_mod psb_krylov_mod psb_krylov_mod module~tools_psblas->psb_krylov_mod psb_prec_mod psb_prec_mod module~tools_psblas->psb_prec_mod module~class_surface->module~class_connectivity module~class_cylinder class_cylinder module~class_surface->module~class_cylinder module~class_plane class_plane module~class_surface->module~class_plane module~class_least_squares->module~class_connectivity module~class_least_squares->module~class_psblas module~class_iterating->module~class_psblas module~units_interface units_interface module~grid_interface->module~units_interface module~object_interface object_interface module~grid_interface->module~object_interface module~class_face->module~class_psblas module~class_motion->module~class_vector module~class_motion->module~class_psblas module~class_cylinder->module~class_vector module~class_cylinder->module~class_psblas module~class_cylinder->module~class_vertex module~class_bc_math->module~class_psblas module~class_bc_wall->module~class_vector module~class_bc_wall->module~class_psblas module~class_bc_wall->module~class_mesh module~class_bc_wall->module~class_bc_math module~class_dimensions class_dimensions module~class_bc_wall->module~class_dimensions module~class_material class_material module~class_bc_wall->module~class_material module~units_interface->module~object_interface module~class_plane->module~class_vector module~class_plane->module~class_psblas module~class_dimensions->module~class_psblas module~class_material->module~class_psblas matlib matlib module~class_material->matlib

Arguments

Type IntentOptional AttributesName
type(mesh), intent(in) :: msh
integer, intent(in) :: ic

Return Value logical


Calls

proc~~tet_valid~~CallsGraph proc~tet_valid tet_valid interface~right_handed right_handed proc~tet_valid->interface~right_handed

Contents

Source Code


Source Code

FUNCTION tet_valid(msh,ic)

    USE class_psblas
    USE class_connectivity
    USE class_mesh
    USE class_vector
    USE class_vertex
    USE tools_mesh_optimize, ONLY: right_handed


    IMPLICIT NONE
    !
    LOGICAL                :: tet_valid
    TYPE(mesh), INTENT(IN) :: msh            ! the mesh structure
    INTEGER, INTENT(IN)    :: ic             ! the cell ID number
    !
    REAL(psb_dpk_)      :: vtx1(3),vtx2(3),vtx3(3),vtx4(3)
    INTEGER ::  iv1, iv2, iv3, iv4
    INTEGER, POINTER :: iv2c(:) => NULL()
    INTEGER :: valid_flag,ierr

    ! Get vertex indices
    CALL msh%v2c%get_ith_conn(iv2c,ic)
    iv1 = iv2c(1)
    iv2 = iv2c(2)
    iv3 = iv2c(3)
    iv4 = iv2c(4)

    vtx1 = msh%verts(iv1)%position_()
    vtx2 = msh%verts(iv2)%position_()
    vtx3 = msh%verts(iv3)%position_()
    vtx4 = msh%verts(iv4)%position_()

    valid_flag = right_handed(vtx1, vtx2, vtx3, vtx4)

    IF ( valid_flag == 1) THEN
        tet_valid = .TRUE.
    ELSE
        tet_valid = .FALSE.
    ENDIF

END FUNCTION tet_valid