face_normal4 Function

public elemental function face_normal4(pt1, pt2, pt3, pt4, norm) result(normal)

Calculate the normal of the face defined by 4 points.

The convention for the points numeration is the following:

 3.----------.2
  |          |
  |          |
  |          |
  |          |
 4.----------.1

The normal is calculated by the cross product of the diagonal d13 for the diagonal d24: d13 x d24. The normal is normalized if the variable norm is passed (with any value).

 type(vector) :: pt(0:4)

 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(4) = ex + ey
 pt(0) = pt(1)%face_normal4(pt1=pt(1), pt2=pt(2), pt3=pt(3), pt4=pt(4), norm='y')
 print "(3(F3.1,1X))", abs(pt(0)%x), abs(pt(0)%y), abs(pt(0)%z)
 type(vector) :: pt(0:4)

 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(4) = ex + ey
 pt(0) = face_normal4(pt1=pt(1), pt2=pt(2), pt3=pt(3), pt4=pt(4), norm='y')
 print "(3(F3.1,1X))", abs(pt(0)%x), abs(pt(0)%y), abs(pt(0)%z)

Arguments

TypeIntentOptionalAttributesName
type(vector), intent(in) :: pt1

First face point.

type(vector), intent(in) :: pt2

Second face point.

type(vector), intent(in) :: pt3

Third face point.

type(vector), intent(in) :: pt4

Fourth face point.

character(len=1), intent(in), optional :: norm

If ‘norm’ is passed as argument the normal is normalized.

Return Value type(vector)

Face normal.


Calls

proc~~face_normal4~~CallsGraph proc~face_normal4 face_normal4 proc~normalized normalized proc~face_normal4->proc~normalized

Called by

proc~~face_normal4~~CalledByGraph proc~face_normal4 face_normal4 program~volatile_doctest~34 volatile_doctest program~volatile_doctest~34->proc~face_normal4

Contents

None