Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector), | dimension(:) | :: | Surf | |||
integer, | intent(in) | :: | Nsides | |||
logical, | intent(out) | :: | IsCoPlanar | |||
real(kind=r64), | intent(out) | :: | MaxDist | |||
integer, | intent(out) | :: | ErrorVertex |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CalcCoPlanarNess(Surf,NSides,IsCoPlanar,MaxDist,ErrorVertex)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN June 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine provides the calculation to determine if the
! surface is planar or not.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! Eric W. Weisstein. "Coplanar." From MathWorld--A Wolfram Web Resource.
! http://mathworld.wolfram.com/Coplanar.html
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
type (vector), dimension(:) :: Surf
integer, intent(in) :: Nsides
logical, intent(out) :: IsCoPlanar
real(r64), intent(out) :: MaxDist
integer, intent(out) :: ErrorVertex
! SUBROUTINE PARAMETER DEFINITIONS:
real(r64), PARAMETER :: DistTooSmall=1.d-4
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
integer vert
type (planeeq) NewellPlane
logical plerror
real(r64) dist
IsCoPlanar=.true.
MaxDist=0.0d0
ErrorVertex=0
! Use first three to determine plane
CALL PlaneEquation(Surf,Nsides,NewellPlane,plerror)
do vert=1,Nsides
dist=Pt2Plane(surf(vert),NewellPlane)
if (abs(dist) > MaxDist) then
MaxDist=ABS(dist)
ErrorVertex=vert
endif
enddo
if (abs(MaxDist) > DistTooSmall) IsCoPlanar=.false.
RETURN
END SUBROUTINE CalcCoPlanarNess