vecfor
VecFor, Vector algebra class for Fortran poor people.
This derived type is useful for manipulating vectors in 3D space. The components of the vectors are reals with parametrized kind as defined by the library module. The components are defined in a three-dimensional cartesian frame of reference. All the vectorial math procedures (cross, dot products, parallel...) assume a three-dimensional cartesian frame of reference. The operators of assignment (=), multiplication (*), division (/), sum (+) and subtraction (-) have been overloaded. Furthermore the dot and cross products have been defined. Therefore this module provides a far-complete algebra based on Vector derived type.
Source: src/lib/vecfor.F90
Dependencies
Re-exports
| Name | Kind | Module | Description |
|---|---|---|---|
angle | function | vecfor_RPP | Calculate the angle (rad) between two vectors. |
barycentric_tetrahedron | function | vecfor_RPP | Barycentric coordinates of p in the tetrahedron pt1, pt2, pt3, pt4: ratios of signed sub-volumes, so p = sum(l(i)*pt(i)), sum(l) = 1, all in [0, 1] inside (the point-in-cell test of donor search). |
barycentric_triangle | function | vecfor_RPP | Barycentric coordinates of p (of its projection onto the plane) in the triangle pt1, pt2, pt3: p = l(1)*pt1 + l(2)*pt2 + l(3)*pt3 with sum(l) = 1; all in [0, 1] inside the triangle (Ericson's method, the 2x2 determinants by Kahan's algorithm). |
closest_point_triangle | subroutine | vecfor_RPP | Point q of the triangle a, b, c closest to p, and the feature it lies on: 1, 2, 3 the vertices a, b, c; 4, 5, 6 the edges ab, bc, ca; 7 the face (Ericson's Voronoi-region test, the region signs by Kahan's algorithm). For a signed distance to a mesh, sign |p - q| with the angle-weighted pseudo-normal of that feature (face normal on the face, an average over the faces sharing an edge or a vertex otherwise). |
crossproduct_accurate | function | vecfor_RPP | Cross product a .cross. b with each component as accurate as one rounding allows (up to 2 ulps): every component a_i * b_j - a_j * b_i by Kahan's algorithm with a fused multiply-add. The .cross. operator rounds both products first and can lose all digits when they nearly cancel (nearly parallel vectors, sliver faces). |
distance_to_line | function | vecfor_RPP | Calculate the distance (scalar) to line defined by the 2 points. |
distance_to_plane | function | vecfor_RPP | Calculate the distance (signed, scalar) to plane defined by the 3 points. |
distance_vectorial_to_plane | function | vecfor_RPP | Calculate the distance (vectorial) to plane defined by the 3 points. |
dotproduct_accurate | function | vecfor_RPP | Dot product a .dot. b as if computed in twice the working precision, then rounded (Ogita, Rump, Oishi 2005, Dot2: products by TwoProduct with a fused multiply-add, sums by TwoSum). The .dot. operator can lose every digit when the products nearly cancel. |
face_normal3 | function | vecfor_RPP | Calculate the normal of the face defined by the 3 points. |
face_normal4 | function | vecfor_RPP | Calculate the normal of the face defined by 4 points. |
iolen | function | vecfor_RPP | Compute IO length. |
is_collinear | function | vecfor_RPP | Return true if the point is collinear with other two given points. |
is_concyclic | function | vecfor_RPP | Return true if the point is concyclic with other three given points. |
mirror_matrix | function | vecfor_RPP | Return the mirror matrix (Householder's matrix) given normal of the mirroring plane. |
normalized | function | vecfor_RPP | Return a normalized copy of vector. |
normalized_checked | subroutine | vecfor_RPP | Normalize a into c only when its norm is above min_norm (default smallRPP): ok tells which. |
normL2 | function | vecfor_RPP | Return the norm L2 of vector. |
polygon_vector_area | function | vecfor_RPP | Vector area of the polygon pts(1), ..., pts(n) (vertices in order, closed implicitly): half the sum of (pts(i) - pts(1)) .cross. (pts(i+1) - pts(1)). Its norm is the area of a planar polygon, its direction the normal by the right-hand rule; it does not depend on the origin, and the outward vector areas of the faces of a closed polyhedron sum to zero (the discrete geometric conservation law of finite volumes). |
projection_onto_plane | function | vecfor_RPP | Calculate the projection of point onto plane defined by 3 points. |
rotation_matrix | function | vecfor_RPP | Return the rotation matrix given axis and angle of ratation. |
sq_norm | function | vecfor_RPP | Return the square of the norm of vector. |
tetrahedron_volume | function | vecfor_RPP | Signed volume of the tetrahedron pt1, pt2, pt3, pt4: (pt2 - pt1) .dot. ((pt3 - pt1) .cross. (pt4 - pt1)) / 6, positive when pt4 lies on the side where (pt2 - pt1) .cross. (pt3 - pt1) points (right-handed order). |
triangle_area | function | vecfor_RPP | Area of the triangle pt1, pt2, pt3: half the norm of (pt2 - pt1) .cross. (pt3 - pt1). |
ex | parameter | vecfor_RPP | X direction versor. |
ey | parameter | vecfor_RPP | Y direction versor. |
ez | parameter | vecfor_RPP | Z direction versor. |
vector | type | vecfor_RPP | Vector class. |
angle_dev | function | vecfor_RPP | Device-callable angle (radians) between a and b: angle without its polymorphic array constructor ([self%normalized(), other%normalized()], a host-only runtime call on the device): both versors by normalized_dev, then atan2(normL2(v1.cross.v2), v1.dot.v2) as on the host. |
assign_vector_dev | subroutine | vecfor_RPP | Device-callable vector = vector. Subroutine form is mandatory because Fortran assignment overloads must be subroutines, and the user-defined assign_vector TBP is unreachable from device code. |
barycentric_tetrahedron_dev | subroutine | vecfor_RPP | Device-callable barycentric_tetrahedron, the coordinates as an intent(out) argument. |
barycentric_triangle_dev | subroutine | vecfor_RPP | Device-callable barycentric_triangle, the coordinates as an intent(out) argument. |
closest_point_triangle_dev | subroutine | vecfor_RPP | Device-callable closest_point_triangle. |
crossproduct_accurate_dev | subroutine | vecfor_RPP | Device-callable crossproduct_accurate. |
crossproduct_dev | subroutine | vecfor_RPP | Device-callable cross product, subroutine form. |
distance_to_line_dev | function | vecfor_RPP | Device-callable distance of the point a from the line through pt1 and pt2: distance_to_line, normL2((a - pt1).cross.(a - pt2)) / normL2(pt2 - pt1) open-coded. |
distance_to_plane_dev | function | vecfor_RPP | Device-callable signed distance of the point a from the plane through pt1, pt2, pt3: distance_to_plane, the unit face normal dotted with a - pt1, open-coded. |
distance_vectorial_to_plane_dev | subroutine | vecfor_RPP | Device-callable vectorial distance of the point a from the plane through pt1, pt2, pt3: distance_vectorial_to_plane, normal * (normal.dot.(a - pt1)) open-coded. |
dotproduct_accurate_dev | function | vecfor_RPP | Device-callable dotproduct_accurate. |
dotproduct_dev | function | vecfor_RPP | Device-callable dot product. CPU consumers should keep using a .dot. b or a%dotproduct(b); this entry point is for device kernel code only. |
face_normal3_dev | subroutine | vecfor_RPP | Device-callable normal of the triangle pt1, pt2, pt3: face_normal3 open-coded. With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the triangle. |
face_normal4_dev | subroutine | vecfor_RPP | Device-callable normal of the quadrilateral pt1, pt2, pt3, pt4: face_normal4 open-coded (cross product of the diagonals). With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the quadrilateral. |
is_collinear_dev | function | vecfor_RPP | Device-callable test of the point a on the line through pt1 and pt2: is_collinear, the distance from the line not above ZeroRPP + tolerance (0 when absent). |
is_concyclic_dev | function | vecfor_RPP | Device-callable test of the points a, pt1, pt2, pt3 on one circle: is_concyclic (Ptolemy's inequality) open-coded, against smallRPP + tolerance (0 when absent). |
matrixproduct_dev | subroutine | vecfor_RPP | Device-callable matrix product c = matrix .matrix. a, subroutine form of matrixproduct. |
mirror_by_matrix_dev | subroutine | vecfor_RPP | Device-callable in-place mirroring by matrix, call a%mirror(matrix=): mirror_by_matrix, matrixproduct_dev applied to a. |
mirror_by_normal_dev | subroutine | vecfor_RPP | Device-callable in-place mirror image across the plane of normal normal, call a%mirror(normal=): mirror_by_normal, the mirror_matrix_dev matrix applied with matrixproduct_dev. |
mirror_matrix_dev | subroutine | vecfor_RPP | Device-callable mirror matrix: mirror_matrix with the matrix as an intent(out) argument. |
normalize_dev | subroutine | vecfor_RPP | Device-callable in-place normalization call a%normalize(): normalize open-coded. |
normalized_checked_dev | subroutine | vecfor_RPP | Device-callable normalized_checked: same arithmetic, same optional min_norm. |
normalized_dev | subroutine | vecfor_RPP | Device-callable normalized copy c = a%normalized(): normalized open-coded, the norm guarded by smallRPP as in normalize. |
normL2_dev | function | vecfor_RPP | Device-callable norm L2: normL2 open-coded. |
orthogonal_dev | subroutine | vecfor_RPP | Device-callable component of a orthogonal to b, c = a .ortho. b: orthogonal, a - (a .paral. b). |
parallel_dev | subroutine | vecfor_RPP | Device-callable component of a parallel to b, c = a .paral. b: parallel open-coded, (a.dot.b) * normalized(b) / normL2(b) in the same order (the normalization guarded by smallRPP, the divisor not, as on the host). |
polygon_vector_area_dev | subroutine | vecfor_RPP | Device-callable polygon_vector_area, with the number of vertices explicit. |
projection_onto_plane_dev | subroutine | vecfor_RPP | Device-callable projection of the point a onto the plane through pt1, pt2, pt3: projection_onto_plane, a - distance_vectorial_to_plane. |
R8P_mul_vector_dev | subroutine | vecfor_RPP | Device-callable real(R8P) * vector, subroutine form. |
rotate_by_axis_angle_dev | subroutine | vecfor_RPP | Device-callable in-place rotation about axis by angle, call a%rotate(axis=, angle=): rotate_by_axis_angle, the rotation_matrix_dev matrix applied with matrixproduct_dev. |
rotate_by_matrix_dev | subroutine | vecfor_RPP | Device-callable in-place rotation by matrix, call a%rotate(matrix=): rotate_by_matrix, matrixproduct_dev applied to a. |
rotation_matrix_dev | subroutine | vecfor_RPP | Device-callable rotation matrix: rotation_matrix with the matrix as an intent(out) argument. |
angle_R8P_dev | function | vecfor_R8P | Device-callable angle (radians) between a and b: angle_R8P without its polymorphic array constructor ([self%normalized(), other%normalized()], a host-only runtime call on the device): both versors by normalized_dev, then atan2(normL2(v1.cross.v2), v1.dot.v2) as on the host. |
barycentric_tetrahedron_R8P_dev | subroutine | vecfor_R8P | Device-callable barycentric_tetrahedron_R8P, the coordinates as an intent(out) argument. |
barycentric_triangle_R8P_dev | subroutine | vecfor_R8P | Device-callable barycentric_triangle_R8P, the coordinates as an intent(out) argument. |
closest_point_triangle_R8P_dev | subroutine | vecfor_R8P | Device-callable closest_point_triangle_R8P. |
crossproduct_accurate_R8P_dev | subroutine | vecfor_R8P | Device-callable crossproduct_accurate_R8P. |
distance_to_line_R8P_dev | function | vecfor_R8P | Device-callable distance of the point a from the line through pt1 and pt2: distance_to_line_R8P, normL2((a - pt1).cross.(a - pt2)) / normL2(pt2 - pt1) open-coded. |
distance_to_plane_R8P_dev | function | vecfor_R8P | Device-callable signed distance of the point a from the plane through pt1, pt2, pt3: distance_to_plane_R8P, the unit face normal dotted with a - pt1, open-coded. |
distance_vectorial_to_plane_R8P_dev | subroutine | vecfor_R8P | Device-callable vectorial distance of the point a from the plane through pt1, pt2, pt3: distance_vectorial_to_plane_R8P, normal * (normal.dot.(a - pt1)) open-coded. |
dotproduct_accurate_R8P_dev | function | vecfor_R8P | Device-callable dotproduct_accurate_R8P. |
face_normal3_R8P_dev | subroutine | vecfor_R8P | Device-callable normal of the triangle pt1, pt2, pt3: face_normal3_R8P open-coded. With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the triangle. |
face_normal4_R8P_dev | subroutine | vecfor_R8P | Device-callable normal of the quadrilateral pt1, pt2, pt3, pt4: face_normal4_R8P open-coded (cross product of the diagonals). With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the quadrilateral. |
is_collinear_R8P_dev | function | vecfor_R8P | Device-callable test of the point a on the line through pt1 and pt2: is_collinear_R8P, the distance from the line not above ZeroRPP + tolerance (0 when absent). |
is_concyclic_R8P_dev | function | vecfor_R8P | Device-callable test of the points a, pt1, pt2, pt3 on one circle: is_concyclic_R8P (Ptolemy's inequality) open-coded, against smallRPP + tolerance (0 when absent). |
mirror_by_matrix_R8P_dev | subroutine | vecfor_R8P | Device-callable in-place mirroring by matrix, call a%mirror(matrix=): mirror_by_matrix, matrixproduct_dev applied to a. |
mirror_by_normal_R8P_dev | subroutine | vecfor_R8P | Device-callable in-place mirror image across the plane of normal normal, call a%mirror(normal=): mirror_by_normal, the mirror_matrix_dev matrix applied with matrixproduct_dev. |
normalize_R8P_dev | subroutine | vecfor_R8P | Device-callable in-place normalization call a%normalize(): normalize open-coded. |
normalized_checked_R8P_dev | subroutine | vecfor_R8P | Device-callable normalized_checked_R8P: same arithmetic, same optional min_norm. |
normalized_R8P_dev | subroutine | vecfor_R8P | Device-callable normalized copy c = a%normalized(): normalized_R8P open-coded, the norm guarded by smallRPP as in normalize. |
normL2_R8P_dev | function | vecfor_R8P | Device-callable norm L2: normL2_R8P open-coded. |
orthogonal_R8P_dev | subroutine | vecfor_R8P | Device-callable component of a orthogonal to b, c = a .ortho. b: orthogonal, a - (a .paral. b). |
parallel_R8P_dev | subroutine | vecfor_R8P | Device-callable component of a parallel to b, c = a .paral. b: parallel open-coded, (a.dot.b) * normalized(b) / normL2(b) in the same order (the normalization guarded by smallRPP, the divisor not, as on the host). |
polygon_vector_area_R8P_dev | subroutine | vecfor_R8P | Device-callable polygon_vector_area_R8P, with the number of vertices explicit. |
projection_onto_plane_R8P_dev | subroutine | vecfor_R8P | Device-callable projection of the point a onto the plane through pt1, pt2, pt3: projection_onto_plane_R8P, a - distance_vectorial_to_plane. |
rotate_by_axis_angle_R8P_dev | subroutine | vecfor_R8P | Device-callable in-place rotation about axis by angle, call a%rotate(axis=, angle=): rotate_by_axis_angle, the rotation_matrix_dev matrix applied with matrixproduct_dev. |
rotate_by_matrix_R8P_dev | subroutine | vecfor_R8P | Device-callable in-place rotation by matrix, call a%rotate(matrix=): rotate_by_matrix, matrixproduct_dev applied to a. |
sq_norm_R8P_dev | function | vecfor_R8P | Device-callable square of the norm L2: sq_norm_R8P open-coded. |
tetrahedron_volume_R8P_dev | function | vecfor_R8P | Device-callable tetrahedron_volume_R8P. |
triangle_area_R8P_dev | function | vecfor_R8P | Device-callable triangle_area_R8P. |
vector_mul_R8P_dev | subroutine | vecfor_RPP | Device-callable vector * real(R8P), subroutine form. |
sq_norm_dev | function | vecfor_RPP | Device-callable square of the norm L2: sq_norm open-coded. |
tetrahedron_volume_dev | function | vecfor_RPP | Device-callable tetrahedron_volume. |
triangle_area_dev | function | vecfor_RPP | Device-callable triangle_area. |
vector_sub_vector_dev | subroutine | vecfor_RPP | Device-callable vector - vector, subroutine form. |
vector_sum_vector_dev | subroutine | vecfor_RPP | Device-callable vector + vector, subroutine form. |
angle_R4P | function | vecfor_R4P | Calculate the angle (rad) between two vectors. |
barycentric_tetrahedron_R4P | function | vecfor_R4P | Barycentric coordinates of p in the tetrahedron pt1, pt2, pt3, pt4: ratios of signed sub-volumes, so p = sum(l(i)*pt(i)), sum(l) = 1, all in [0, 1] inside (the point-in-cell test of donor search). |
barycentric_triangle_R4P | function | vecfor_R4P | Barycentric coordinates of p (of its projection onto the plane) in the triangle pt1, pt2, pt3: p = l(1)*pt1 + l(2)*pt2 + l(3)*pt3 with sum(l) = 1; all in [0, 1] inside the triangle (Ericson's method, the 2x2 determinants by Kahan's algorithm). |
closest_point_triangle_R4P | subroutine | vecfor_R4P | Point q of the triangle a, b, c closest to p, and the feature it lies on: 1, 2, 3 the vertices a, b, c; 4, 5, 6 the edges ab, bc, ca; 7 the face (Ericson's Voronoi-region test, the region signs by Kahan's algorithm). For a signed distance to a mesh, sign |p - q| with the angle-weighted pseudo-normal of that feature (face normal on the face, an average over the faces sharing an edge or a vertex otherwise). |
crossproduct_accurate_R4P | function | vecfor_R4P | Cross product a .cross. b with each component as accurate as one rounding allows (up to 2 ulps): every component a_i * b_j - a_j * b_i by Kahan's algorithm with a fused multiply-add. The .cross. operator rounds both products first and can lose all digits when they nearly cancel (nearly parallel vectors, sliver faces). |
distance_to_line_R4P | function | vecfor_R4P | Calculate the distance (scalar) to line defined by the 2 points. |
distance_to_plane_R4P | function | vecfor_R4P | Calculate the distance (signed, scalar) to plane defined by the 3 points. |
distance_vectorial_to_plane_R4P | function | vecfor_R4P | Calculate the distance (vectorial) to plane defined by the 3 points. |
dotproduct_accurate_R4P | function | vecfor_R4P | Dot product a .dot. b as if computed in twice the working precision, then rounded (Ogita, Rump, Oishi 2005, Dot2: products by TwoProduct with a fused multiply-add, sums by TwoSum). The .dot. operator can lose every digit when the products nearly cancel. |
face_normal3_R4P | function | vecfor_R4P | Calculate the normal of the face defined by the 3 points. |
face_normal4_R4P | function | vecfor_R4P | Calculate the normal of the face defined by 4 points. |
iolen_R4P | function | vecfor_R4P | Compute IO length. |
is_collinear_R4P | function | vecfor_R4P | Return true if the point is collinear with other two given points. |
is_concyclic_R4P | function | vecfor_R4P | Return true if the point is concyclic with other three given points. |
mirror_matrix_R4P | function | vecfor_R4P | Return the mirror matrix (Householder's matrix) given normal of the mirroring plane. |
normalized_checked_R4P | subroutine | vecfor_R4P | Normalize a into c only when its norm is above min_norm (default smallRPP): ok tells which. |
normalized_R4P | function | vecfor_R4P | Return a normalized copy of vector. |
normL2_R4P | function | vecfor_R4P | Return the norm L2 of vector. |
polygon_vector_area_R4P | function | vecfor_R4P | Vector area of the polygon pts(1), ..., pts(n) (vertices in order, closed implicitly): half the sum of (pts(i) - pts(1)) .cross. (pts(i+1) - pts(1)). Its norm is the area of a planar polygon, its direction the normal by the right-hand rule; it does not depend on the origin, and the outward vector areas of the faces of a closed polyhedron sum to zero (the discrete geometric conservation law of finite volumes). |
projection_onto_plane_R4P | function | vecfor_R4P | Calculate the projection of point onto plane defined by 3 points. |
rotation_matrix_R4P | function | vecfor_R4P | Return the rotation matrix given axis and angle of ratation. |
sq_norm_R4P | function | vecfor_R4P | Return the square of the norm of vector. |
tetrahedron_volume_R4P | function | vecfor_R4P | Signed volume of the tetrahedron pt1, pt2, pt3, pt4: (pt2 - pt1) .dot. ((pt3 - pt1) .cross. (pt4 - pt1)) / 6, positive when pt4 lies on the side where (pt2 - pt1) .cross. (pt3 - pt1) points (right-handed order). |
triangle_area_R4P | function | vecfor_R4P | Area of the triangle pt1, pt2, pt3: half the norm of (pt2 - pt1) .cross. (pt3 - pt1). |
ex_R4P | parameter | vecfor_R4P | X direction versor. |
ey_R4P | parameter | vecfor_R4P | Y direction versor. |
ez_R4P | parameter | vecfor_R4P | Z direction versor. |
vector_R4P | type | vecfor_R4P | Vector class. |
angle_R4P_dev | function | vecfor_R4P | Device-callable angle (radians) between a and b: angle_R4P without its polymorphic array constructor ([self%normalized(), other%normalized()], a host-only runtime call on the device): both versors by normalized_dev, then atan2(normL2(v1.cross.v2), v1.dot.v2) as on the host. |
assign_vector_R4P_dev | subroutine | vecfor_R4P | Device-callable vector = vector. Subroutine form is mandatory because Fortran assignment overloads must be subroutines, and the user-defined assign_vector TBP is unreachable from device code. |
barycentric_tetrahedron_R4P_dev | subroutine | vecfor_R4P | Device-callable barycentric_tetrahedron_R4P, the coordinates as an intent(out) argument. |
barycentric_triangle_R4P_dev | subroutine | vecfor_R4P | Device-callable barycentric_triangle_R4P, the coordinates as an intent(out) argument. |
closest_point_triangle_R4P_dev | subroutine | vecfor_R4P | Device-callable closest_point_triangle_R4P. |
crossproduct_accurate_R4P_dev | subroutine | vecfor_R4P | Device-callable crossproduct_accurate_R4P. |
crossproduct_R4P_dev | subroutine | vecfor_R4P | Device-callable cross product, subroutine form. |
distance_to_line_R4P_dev | function | vecfor_R4P | Device-callable distance of the point a from the line through pt1 and pt2: distance_to_line_R4P, normL2((a - pt1).cross.(a - pt2)) / normL2(pt2 - pt1) open-coded. |
distance_to_plane_R4P_dev | function | vecfor_R4P | Device-callable signed distance of the point a from the plane through pt1, pt2, pt3: distance_to_plane_R4P, the unit face normal dotted with a - pt1, open-coded. |
distance_vectorial_to_plane_R4P_dev | subroutine | vecfor_R4P | Device-callable vectorial distance of the point a from the plane through pt1, pt2, pt3: distance_vectorial_to_plane_R4P, normal * (normal.dot.(a - pt1)) open-coded. |
dotproduct_accurate_R4P_dev | function | vecfor_R4P | Device-callable dotproduct_accurate_R4P. |
dotproduct_R4P_dev | function | vecfor_R4P | Device-callable dot product. CPU consumers should keep using a .dot. b or a%dotproduct(b); this entry point is for device kernel code only. |
face_normal3_R4P_dev | subroutine | vecfor_R4P | Device-callable normal of the triangle pt1, pt2, pt3: face_normal3_R4P open-coded. With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the triangle. |
face_normal4_R4P_dev | subroutine | vecfor_R4P | Device-callable normal of the quadrilateral pt1, pt2, pt3, pt4: face_normal4_R4P open-coded (cross product of the diagonals). With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the quadrilateral. |
is_collinear_R4P_dev | function | vecfor_R4P | Device-callable test of the point a on the line through pt1 and pt2: is_collinear_R4P, the distance from the line not above ZeroRPP + tolerance (0 when absent). |
is_concyclic_R4P_dev | function | vecfor_R4P | Device-callable test of the points a, pt1, pt2, pt3 on one circle: is_concyclic_R4P (Ptolemy's inequality) open-coded, against smallRPP + tolerance (0 when absent). |
matrixproduct_R4P_dev | subroutine | vecfor_R4P | Device-callable matrix product c = matrix .matrix. a, subroutine form of matrixproduct. |
mirror_by_matrix_R4P_dev | subroutine | vecfor_R4P | Device-callable in-place mirroring by matrix, call a%mirror(matrix=): mirror_by_matrix, matrixproduct_dev applied to a. |
mirror_by_normal_R4P_dev | subroutine | vecfor_R4P | Device-callable in-place mirror image across the plane of normal normal, call a%mirror(normal=): mirror_by_normal, the mirror_matrix_dev matrix applied with matrixproduct_dev. |
mirror_matrix_R4P_dev | subroutine | vecfor_R4P | Device-callable mirror matrix: mirror_matrix_R4P with the matrix as an intent(out) argument. |
normalize_R4P_dev | subroutine | vecfor_R4P | Device-callable in-place normalization call a%normalize(): normalize open-coded. |
normalized_checked_R4P_dev | subroutine | vecfor_R4P | Device-callable normalized_checked_R4P: same arithmetic, same optional min_norm. |
normalized_R4P_dev | subroutine | vecfor_R4P | Device-callable normalized copy c = a%normalized(): normalized_R4P open-coded, the norm guarded by smallRPP as in normalize. |
normL2_R4P_dev | function | vecfor_R4P | Device-callable norm L2: normL2_R4P open-coded. |
orthogonal_R4P_dev | subroutine | vecfor_R4P | Device-callable component of a orthogonal to b, c = a .ortho. b: orthogonal, a - (a .paral. b). |
parallel_R4P_dev | subroutine | vecfor_R4P | Device-callable component of a parallel to b, c = a .paral. b: parallel open-coded, (a.dot.b) * normalized(b) / normL2(b) in the same order (the normalization guarded by smallRPP, the divisor not, as on the host). |
polygon_vector_area_R4P_dev | subroutine | vecfor_R4P | Device-callable polygon_vector_area_R4P, with the number of vertices explicit. |
projection_onto_plane_R4P_dev | subroutine | vecfor_R4P | Device-callable projection of the point a onto the plane through pt1, pt2, pt3: projection_onto_plane_R4P, a - distance_vectorial_to_plane. |
R8P_mul_vector_R4P_dev | subroutine | vecfor_R4P | Device-callable real(R8P) * vector, subroutine form. |
rotate_by_axis_angle_R4P_dev | subroutine | vecfor_R4P | Device-callable in-place rotation about axis by angle, call a%rotate(axis=, angle=): rotate_by_axis_angle, the rotation_matrix_dev matrix applied with matrixproduct_dev. |
rotate_by_matrix_R4P_dev | subroutine | vecfor_R4P | Device-callable in-place rotation by matrix, call a%rotate(matrix=): rotate_by_matrix, matrixproduct_dev applied to a. |
rotation_matrix_R4P_dev | subroutine | vecfor_R4P | Device-callable rotation matrix: rotation_matrix_R4P with the matrix as an intent(out) argument. |
sq_norm_R4P_dev | function | vecfor_R4P | Device-callable square of the norm L2: sq_norm_R4P open-coded. |
tetrahedron_volume_R4P_dev | function | vecfor_R4P | Device-callable tetrahedron_volume_R4P. |
triangle_area_R4P_dev | function | vecfor_R4P | Device-callable triangle_area_R4P. |
vector_mul_R8P_R4P_dev | subroutine | vecfor_R4P | Device-callable vector * real(R8P), subroutine form. |
vector_sub_vector_R4P_dev | subroutine | vecfor_R4P | Device-callable vector - vector, subroutine form. |
vector_sum_vector_R4P_dev | subroutine | vecfor_R4P | Device-callable vector + vector, subroutine form. |
angle_R8P | function | vecfor_R8P | Calculate the angle (rad) between two vectors. |
barycentric_tetrahedron_R8P | function | vecfor_R8P | Barycentric coordinates of p in the tetrahedron pt1, pt2, pt3, pt4: ratios of signed sub-volumes, so p = sum(l(i)*pt(i)), sum(l) = 1, all in [0, 1] inside (the point-in-cell test of donor search). |
barycentric_triangle_R8P | function | vecfor_R8P | Barycentric coordinates of p (of its projection onto the plane) in the triangle pt1, pt2, pt3: p = l(1)*pt1 + l(2)*pt2 + l(3)*pt3 with sum(l) = 1; all in [0, 1] inside the triangle (Ericson's method, the 2x2 determinants by Kahan's algorithm). |
closest_point_triangle_R8P | subroutine | vecfor_R8P | Point q of the triangle a, b, c closest to p, and the feature it lies on: 1, 2, 3 the vertices a, b, c; 4, 5, 6 the edges ab, bc, ca; 7 the face (Ericson's Voronoi-region test, the region signs by Kahan's algorithm). For a signed distance to a mesh, sign |p - q| with the angle-weighted pseudo-normal of that feature (face normal on the face, an average over the faces sharing an edge or a vertex otherwise). |
crossproduct_accurate_R8P | function | vecfor_R8P | Cross product a .cross. b with each component as accurate as one rounding allows (up to 2 ulps): every component a_i * b_j - a_j * b_i by Kahan's algorithm with a fused multiply-add. The .cross. operator rounds both products first and can lose all digits when they nearly cancel (nearly parallel vectors, sliver faces). |
distance_to_line_R8P | function | vecfor_R8P | Calculate the distance (scalar) to line defined by the 2 points. |
distance_to_plane_R8P | function | vecfor_R8P | Calculate the distance (signed, scalar) to plane defined by the 3 points. |
distance_vectorial_to_plane_R8P | function | vecfor_R8P | Calculate the distance (vectorial) to plane defined by the 3 points. |
dotproduct_accurate_R8P | function | vecfor_R8P | Dot product a .dot. b as if computed in twice the working precision, then rounded (Ogita, Rump, Oishi 2005, Dot2: products by TwoProduct with a fused multiply-add, sums by TwoSum). The .dot. operator can lose every digit when the products nearly cancel. |
face_normal3_R8P | function | vecfor_R8P | Calculate the normal of the face defined by the 3 points. |
face_normal4_R8P | function | vecfor_R8P | Calculate the normal of the face defined by 4 points. |
iolen_R8P | function | vecfor_R8P | Compute IO length. |
is_collinear_R8P | function | vecfor_R8P | Return true if the point is collinear with other two given points. |
is_concyclic_R8P | function | vecfor_R8P | Return true if the point is concyclic with other three given points. |
mirror_matrix_R8P | function | vecfor_R8P | Return the mirror matrix (Householder's matrix) given normal of the mirroring plane. |
normalized_checked_R8P | subroutine | vecfor_R8P | Normalize a into c only when its norm is above min_norm (default smallRPP): ok tells which. |
normalized_R8P | function | vecfor_R8P | Return a normalized copy of vector. |
normL2_R8P | function | vecfor_R8P | Return the norm L2 of vector. |
polygon_vector_area_R8P | function | vecfor_R8P | Vector area of the polygon pts(1), ..., pts(n) (vertices in order, closed implicitly): half the sum of (pts(i) - pts(1)) .cross. (pts(i+1) - pts(1)). Its norm is the area of a planar polygon, its direction the normal by the right-hand rule; it does not depend on the origin, and the outward vector areas of the faces of a closed polyhedron sum to zero (the discrete geometric conservation law of finite volumes). |
projection_onto_plane_R8P | function | vecfor_R8P | Calculate the projection of point onto plane defined by 3 points. |
rotation_matrix_R8P | function | vecfor_R8P | Return the rotation matrix given axis and angle of ratation. |
sq_norm_R8P | function | vecfor_R8P | Return the square of the norm of vector. |
tetrahedron_volume_R8P | function | vecfor_R8P | Signed volume of the tetrahedron pt1, pt2, pt3, pt4: (pt2 - pt1) .dot. ((pt3 - pt1) .cross. (pt4 - pt1)) / 6, positive when pt4 lies on the side where (pt2 - pt1) .cross. (pt3 - pt1) points (right-handed order). |
triangle_area_R8P | function | vecfor_R8P | Area of the triangle pt1, pt2, pt3: half the norm of (pt2 - pt1) .cross. (pt3 - pt1). |
ex_R8P | parameter | vecfor_R8P | X direction versor. |
ey_R8P | parameter | vecfor_R8P | Y direction versor. |
ez_R8P | parameter | vecfor_R8P | Z direction versor. |
vector_R8P | type | vecfor_R8P | Vector class. |
assign_vector_R8P_dev | subroutine | vecfor_R8P | Device-callable vector = vector. Subroutine form is mandatory because Fortran assignment overloads must be subroutines, and the user-defined assign_vector TBP is unreachable from device code. |
crossproduct_R8P_dev | subroutine | vecfor_R8P | Device-callable cross product, subroutine form. |
dotproduct_R8P_dev | function | vecfor_R8P | Device-callable dot product. CPU consumers should keep using a .dot. b or a%dotproduct(b); this entry point is for device kernel code only. |
matrixproduct_R8P_dev | subroutine | vecfor_R8P | Device-callable matrix product c = matrix .matrix. a, subroutine form of matrixproduct. |
mirror_matrix_R8P_dev | subroutine | vecfor_R8P | Device-callable mirror matrix: mirror_matrix_R8P with the matrix as an intent(out) argument. |
R8P_mul_vector_R8P_dev | subroutine | vecfor_R8P | Device-callable real(R8P) * vector, subroutine form. |
rotation_matrix_R8P_dev | subroutine | vecfor_R8P | Device-callable rotation matrix: rotation_matrix_R8P with the matrix as an intent(out) argument. |
vector_mul_R8P_R8P_dev | subroutine | vecfor_R8P | Device-callable vector * real(R8P), subroutine form. |
vector_sub_vector_R8P_dev | subroutine | vecfor_R8P | Device-callable vector - vector, subroutine form. |
vector_sum_vector_R8P_dev | subroutine | vecfor_R8P | Device-callable vector + vector, subroutine form. |
angle_R16P | function | vecfor_R16P | Calculate the angle (rad) between two vectors. |
barycentric_tetrahedron_R16P | function | vecfor_R16P | Barycentric coordinates of p in the tetrahedron pt1, pt2, pt3, pt4: ratios of signed sub-volumes, so p = sum(l(i)*pt(i)), sum(l) = 1, all in [0, 1] inside (the point-in-cell test of donor search). |
barycentric_triangle_R16P | function | vecfor_R16P | Barycentric coordinates of p (of its projection onto the plane) in the triangle pt1, pt2, pt3: p = l(1)*pt1 + l(2)*pt2 + l(3)*pt3 with sum(l) = 1; all in [0, 1] inside the triangle (Ericson's method, the 2x2 determinants by Kahan's algorithm). |
closest_point_triangle_R16P | subroutine | vecfor_R16P | Point q of the triangle a, b, c closest to p, and the feature it lies on: 1, 2, 3 the vertices a, b, c; 4, 5, 6 the edges ab, bc, ca; 7 the face (Ericson's Voronoi-region test, the region signs by Kahan's algorithm). For a signed distance to a mesh, sign |p - q| with the angle-weighted pseudo-normal of that feature (face normal on the face, an average over the faces sharing an edge or a vertex otherwise). |
crossproduct_accurate_R16P | function | vecfor_R16P | Cross product a .cross. b with each component as accurate as one rounding allows (up to 2 ulps): every component a_i * b_j - a_j * b_i by Kahan's algorithm with a fused multiply-add. The .cross. operator rounds both products first and can lose all digits when they nearly cancel (nearly parallel vectors, sliver faces). |
distance_to_line_R16P | function | vecfor_R16P | Calculate the distance (scalar) to line defined by the 2 points. |
distance_to_plane_R16P | function | vecfor_R16P | Calculate the distance (signed, scalar) to plane defined by the 3 points. |
distance_vectorial_to_plane_R16P | function | vecfor_R16P | Calculate the distance (vectorial) to plane defined by the 3 points. |
dotproduct_accurate_R16P | function | vecfor_R16P | Dot product a .dot. b as if computed in twice the working precision, then rounded (Ogita, Rump, Oishi 2005, Dot2: products by TwoProduct with a fused multiply-add, sums by TwoSum). The .dot. operator can lose every digit when the products nearly cancel. |
face_normal3_R16P | function | vecfor_R16P | Calculate the normal of the face defined by the 3 points. |
face_normal4_R16P | function | vecfor_R16P | Calculate the normal of the face defined by 4 points. |
iolen_R16P | function | vecfor_R16P | Compute IO length. |
is_collinear_R16P | function | vecfor_R16P | Return true if the point is collinear with other two given points. |
is_concyclic_R16P | function | vecfor_R16P | Return true if the point is concyclic with other three given points. |
mirror_matrix_R16P | function | vecfor_R16P | Return the mirror matrix (Householder's matrix) given normal of the mirroring plane. |
normalized_checked_R16P | subroutine | vecfor_R16P | Normalize a into c only when its norm is above min_norm (default smallRPP): ok tells which. |
normalized_R16P | function | vecfor_R16P | Return a normalized copy of vector. |
normL2_R16P | function | vecfor_R16P | Return the norm L2 of vector. |
polygon_vector_area_R16P | function | vecfor_R16P | Vector area of the polygon pts(1), ..., pts(n) (vertices in order, closed implicitly): half the sum of (pts(i) - pts(1)) .cross. (pts(i+1) - pts(1)). Its norm is the area of a planar polygon, its direction the normal by the right-hand rule; it does not depend on the origin, and the outward vector areas of the faces of a closed polyhedron sum to zero (the discrete geometric conservation law of finite volumes). |
projection_onto_plane_R16P | function | vecfor_R16P | Calculate the projection of point onto plane defined by 3 points. |
rotation_matrix_R16P | function | vecfor_R16P | Return the rotation matrix given axis and angle of ratation. |
sq_norm_R16P | function | vecfor_R16P | Return the square of the norm of vector. |
tetrahedron_volume_R16P | function | vecfor_R16P | Signed volume of the tetrahedron pt1, pt2, pt3, pt4: (pt2 - pt1) .dot. ((pt3 - pt1) .cross. (pt4 - pt1)) / 6, positive when pt4 lies on the side where (pt2 - pt1) .cross. (pt3 - pt1) points (right-handed order). |
triangle_area_R16P | function | vecfor_R16P | Area of the triangle pt1, pt2, pt3: half the norm of (pt2 - pt1) .cross. (pt3 - pt1). |
ex_R16P | parameter | vecfor_R16P | X direction versor. |
ey_R16P | parameter | vecfor_R16P | Y direction versor. |
ez_R16P | parameter | vecfor_R16P | Z direction versor. |
vector_R16P | type | vecfor_R16P | Vector class. |
angle_R16P_dev | function | vecfor_R16P | Device-callable angle (radians) between a and b: angle_R16P without its polymorphic array constructor ([self%normalized(), other%normalized()], a host-only runtime call on the device): both versors by normalized_dev, then atan2(normL2(v1.cross.v2), v1.dot.v2) as on the host. |
assign_vector_R16P_dev | subroutine | vecfor_R16P | Device-callable vector = vector. Subroutine form is mandatory because Fortran assignment overloads must be subroutines, and the user-defined assign_vector TBP is unreachable from device code. |
barycentric_tetrahedron_R16P_dev | subroutine | vecfor_R16P | Device-callable barycentric_tetrahedron_R16P, the coordinates as an intent(out) argument. |
barycentric_triangle_R16P_dev | subroutine | vecfor_R16P | Device-callable barycentric_triangle_R16P, the coordinates as an intent(out) argument. |
closest_point_triangle_R16P_dev | subroutine | vecfor_R16P | Device-callable closest_point_triangle_R16P. |
crossproduct_accurate_R16P_dev | subroutine | vecfor_R16P | Device-callable crossproduct_accurate_R16P. |
crossproduct_R16P_dev | subroutine | vecfor_R16P | Device-callable cross product, subroutine form. |
distance_to_line_R16P_dev | function | vecfor_R16P | Device-callable distance of the point a from the line through pt1 and pt2: distance_to_line_R16P, normL2((a - pt1).cross.(a - pt2)) / normL2(pt2 - pt1) open-coded. |
distance_to_plane_R16P_dev | function | vecfor_R16P | Device-callable signed distance of the point a from the plane through pt1, pt2, pt3: distance_to_plane_R16P, the unit face normal dotted with a - pt1, open-coded. |
distance_vectorial_to_plane_R16P_dev | subroutine | vecfor_R16P | Device-callable vectorial distance of the point a from the plane through pt1, pt2, pt3: distance_vectorial_to_plane_R16P, normal * (normal.dot.(a - pt1)) open-coded. |
dotproduct_accurate_R16P_dev | function | vecfor_R16P | Device-callable dotproduct_accurate_R16P. |
dotproduct_R16P_dev | function | vecfor_R16P | Device-callable dot product. CPU consumers should keep using a .dot. b or a%dotproduct(b); this entry point is for device kernel code only. |
face_normal3_R16P_dev | subroutine | vecfor_R16P | Device-callable normal of the triangle pt1, pt2, pt3: face_normal3_R16P open-coded. With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the triangle. |
face_normal4_R16P_dev | subroutine | vecfor_R16P | Device-callable normal of the quadrilateral pt1, pt2, pt3, pt4: face_normal4_R16P open-coded (cross product of the diagonals). With norm present (any value, as on the host) the normal is normalized, otherwise its length is the area of the quadrilateral. |
is_collinear_R16P_dev | function | vecfor_R16P | Device-callable test of the point a on the line through pt1 and pt2: is_collinear_R16P, the distance from the line not above ZeroRPP + tolerance (0 when absent). |
is_concyclic_R16P_dev | function | vecfor_R16P | Device-callable test of the points a, pt1, pt2, pt3 on one circle: is_concyclic_R16P (Ptolemy's inequality) open-coded, against smallRPP + tolerance (0 when absent). |
matrixproduct_R16P_dev | subroutine | vecfor_R16P | Device-callable matrix product c = matrix .matrix. a, subroutine form of matrixproduct. |
mirror_by_matrix_R16P_dev | subroutine | vecfor_R16P | Device-callable in-place mirroring by matrix, call a%mirror(matrix=): mirror_by_matrix, matrixproduct_dev applied to a. |
mirror_by_normal_R16P_dev | subroutine | vecfor_R16P | Device-callable in-place mirror image across the plane of normal normal, call a%mirror(normal=): mirror_by_normal, the mirror_matrix_dev matrix applied with matrixproduct_dev. |
mirror_matrix_R16P_dev | subroutine | vecfor_R16P | Device-callable mirror matrix: mirror_matrix_R16P with the matrix as an intent(out) argument. |
normalize_R16P_dev | subroutine | vecfor_R16P | Device-callable in-place normalization call a%normalize(): normalize open-coded. |
normalized_checked_R16P_dev | subroutine | vecfor_R16P | Device-callable normalized_checked_R16P: same arithmetic, same optional min_norm. |
normalized_R16P_dev | subroutine | vecfor_R16P | Device-callable normalized copy c = a%normalized(): normalized_R16P open-coded, the norm guarded by smallRPP as in normalize. |
normL2_R16P_dev | function | vecfor_R16P | Device-callable norm L2: normL2_R16P open-coded. |
orthogonal_R16P_dev | subroutine | vecfor_R16P | Device-callable component of a orthogonal to b, c = a .ortho. b: orthogonal, a - (a .paral. b). |
parallel_R16P_dev | subroutine | vecfor_R16P | Device-callable component of a parallel to b, c = a .paral. b: parallel open-coded, (a.dot.b) * normalized(b) / normL2(b) in the same order (the normalization guarded by smallRPP, the divisor not, as on the host). |
polygon_vector_area_R16P_dev | subroutine | vecfor_R16P | Device-callable polygon_vector_area_R16P, with the number of vertices explicit. |
projection_onto_plane_R16P_dev | subroutine | vecfor_R16P | Device-callable projection of the point a onto the plane through pt1, pt2, pt3: projection_onto_plane_R16P, a - distance_vectorial_to_plane. |
R8P_mul_vector_R16P_dev | subroutine | vecfor_R16P | Device-callable real(R8P) * vector, subroutine form. |
rotate_by_axis_angle_R16P_dev | subroutine | vecfor_R16P | Device-callable in-place rotation about axis by angle, call a%rotate(axis=, angle=): rotate_by_axis_angle, the rotation_matrix_dev matrix applied with matrixproduct_dev. |
rotate_by_matrix_R16P_dev | subroutine | vecfor_R16P | Device-callable in-place rotation by matrix, call a%rotate(matrix=): rotate_by_matrix, matrixproduct_dev applied to a. |
rotation_matrix_R16P_dev | subroutine | vecfor_R16P | Device-callable rotation matrix: rotation_matrix_R16P with the matrix as an intent(out) argument. |
sq_norm_R16P_dev | function | vecfor_R16P | Device-callable square of the norm L2: sq_norm_R16P open-coded. |
tetrahedron_volume_R16P_dev | function | vecfor_R16P | Device-callable tetrahedron_volume_R16P. |
triangle_area_R16P_dev | function | vecfor_R16P | Device-callable triangle_area_R16P. |
vector_mul_R8P_R16P_dev | subroutine | vecfor_R16P | Device-callable vector * real(R8P), subroutine form. |
vector_sub_vector_R16P_dev | subroutine | vecfor_R16P | Device-callable vector - vector, subroutine form. |
vector_sum_vector_R16P_dev | subroutine | vecfor_R16P | Device-callable vector + vector, subroutine form. |