face_normal4_R4P Function

public elemental function face_normal4_R4P(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_R4P) :: pt(0:4)

 pt(1) = ex_R4P
 pt(2) = ey_R4P
 pt(3) = ex_R4P - ey_R4P
 pt(4) = ex_R4P + ey_R4P
 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_R4P) :: pt(0:4)

 pt(1) = ex_R4P
 pt(2) = ey_R4P
 pt(3) = ex_R4P - ey_R4P
 pt(4) = ex_R4P + ey_R4P
 pt(0) = face_normal4_R4P(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_R4P), intent(in) :: pt1

First face point.

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

Second face point.

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

Third face point.

type(vector_R4P), 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_R4P)

Face normal.


Calls

proc~~face_normal4_r4p~~CallsGraph proc~face_normal4_r4p face_normal4_R4P proc~normalized_r4p normalized_R4P proc~face_normal4_r4p->proc~normalized_r4p

Called by

proc~~face_normal4_r4p~~CalledByGraph proc~face_normal4_r4p face_normal4_R4P program~volatile_doctest~476 volatile_doctest program~volatile_doctest~476->proc~face_normal4_r4p

Contents

None