The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
the_environment::dist Interface Reference

Internal distance calculation backend engine. More...

Collaboration diagram for the_environment::dist:

Public Member Functions

elemental real(srp) function dist_scalar (x1, x2, y1, y2, z1, z2)
 Calculate distance between 3D or 2D points. This is a function engine for use within type bound procedures. Example (dist_scalar): More...
 
pure real(srp) function dist_vector_nd (cvector1, cvector2)
 Calculate distance between N-dimensional points. This is a function engine for use within other type bound procedures. More...
 

Detailed Description

Internal distance calculation backend engine.

Definition at line 757 of file m_env.f90.

Member Function/Subroutine Documentation

◆ dist_scalar()

elemental real(srp) function the_environment::dist::dist_scalar ( real(srp), intent(in)  x1,
real(srp), intent(in)  x2,
real(srp), intent(in)  y1,
real(srp), intent(in)  y2,
real(srp), intent(in), optional  z1,
real(srp), intent(in), optional  z2 
)

Calculate distance between 3D or 2D points. This is a function engine for use within type bound procedures. Example (dist_scalar):

dist(1.0,10.0, 2.0,20.0, 3.0,30.0 )
Note
This version accepts individual scalar coordinates.
Note that it is an elemental function, accepting also arrays (should have equal size and shape for elemental operations).

Definition at line 5633 of file m_env.f90.

◆ dist_vector_nd()

pure real(srp) function the_environment::dist::dist_vector_nd ( real(srp), dimension(:), intent(in)  cvector1,
real(srp), dimension(:), intent(in)  cvector2 
)

Calculate distance between N-dimensional points. This is a function engine for use within other type bound procedures.

Returns
the distance between two N-dimensional vectors.
Parameters
cvectorN-dimensional vectors for the two points we calculate the distance between. For a 3D case the vercors look like: x = cvector(1), y = cvector(2), z = cvector(3). Example dist_vector:
dist( [1.0, 2.0, 3.0], [10.0, 20.0, 30.0] )
Note
This version accepts vectors of coordinates for each of the two objects.
Warning
The shapes and sizes of the two arrays must be equal

Definition at line 5666 of file m_env.f90.


The documentation for this interface was generated from the following file: