follow numpy naming convention

This commit is contained in:
Martin Diehl 2019-05-10 15:19:00 +02:00
parent 1cf6cc217d
commit b8c8c4ade6
4 changed files with 12 additions and 16 deletions

View File

@ -69,15 +69,11 @@ module math
!--------------------------------------------------------------------------------------------------
! Provide deprecated name for compatibility
interface math_crossproduct
module procedure math_cross
end interface math_crossproduct
interface math_mul3x3
module procedure math_inner
end interface math_mul3x3
public :: &
math_mul3x3, &
math_crossproduct
math_mul3x3
!---------------------------------------------------------------------------------------------------
@ -1438,7 +1434,7 @@ subroutine math_eigenValuesVectorsSym33(m,values,vectors)
vectors(1:3,2) = vectors(1:3, 2) / norm
! Calculate third eigenvector according to v[2] = v[0] x v[1]
vectors(1:3,3) = math_crossproduct(vectors(1:3,1),vectors(1:3,2))
vectors(1:3,3) = math_cross(vectors(1:3,1),vectors(1:3,2))
end subroutine math_eigenValuesVectorsSym33
@ -1761,7 +1757,7 @@ real(pReal) pure function math_areaTriangle(v1,v2,v3)
real(pReal), dimension (3), intent(in) :: v1,v2,v3
math_areaTriangle = 0.5_pReal * norm2(math_crossproduct(v1-v2,v1-v3))
math_areaTriangle = 0.5_pReal * norm2(math_cross(v1-v2,v1-v3))
end function math_areaTriangle

View File

@ -1541,7 +1541,7 @@ pure function mesh_cellCenterCoordinates(ip,el)
!--------------------------------------------------------------------------------------------------
subroutine mesh_build_ipAreas
use math, only: &
math_crossproduct
math_cross
implicit none
integer(pInt) :: e,t,g,c,i,f,n,m
@ -1576,7 +1576,7 @@ subroutine mesh_build_ipAreas
do f = 1_pInt,FE_NipNeighbors(c) ! loop over cell faces
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
normal = math_crossproduct(nodePos(1:3,2) - nodePos(1:3,1), &
normal = math_cross(nodePos(1:3,2) - nodePos(1:3,1), &
nodePos(1:3,3) - nodePos(1:3,1))
mesh_ipArea(f,i,e) = norm2(normal)
mesh_ipAreaNormal(1:3,f,i,e) = normal / norm2(normal) ! ensure unit length of area normal
@ -1595,7 +1595,7 @@ subroutine mesh_build_ipAreas
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
normals(1:3,n) = 0.5_pReal &
* math_crossproduct(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
* math_cross(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
nodePos(1:3,1+mod(n+1,m)) - nodePos(1:3,n))
normal = 0.5_pReal * sum(normals,2)
mesh_ipArea(f,i,e) = norm2(normal)

View File

@ -900,7 +900,7 @@ end function mesh_cellCenterCoordinates
!--------------------------------------------------------------------------------------------------
subroutine mesh_build_ipAreas
use math, only: &
math_crossproduct
math_cross
implicit none
integer(pInt) :: e,t,g,c,i,f,n,m
@ -933,7 +933,7 @@ subroutine mesh_build_ipAreas
do f = 1_pInt,FE_NipNeighbors(c) ! loop over cell faces
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
normal = math_crossproduct(nodePos(1:3,2) - nodePos(1:3,1), &
normal = math_cross(nodePos(1:3,2) - nodePos(1:3,1), &
nodePos(1:3,3) - nodePos(1:3,1))
mesh_ipArea(f,i,e) = norm2(normal)
mesh_ipAreaNormal(1:3,f,i,e) = normal / norm2(normal) ! ensure unit length of area normal
@ -952,7 +952,7 @@ subroutine mesh_build_ipAreas
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
normals(1:3,n) = 0.5_pReal &
* math_crossproduct(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
* math_cross(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
nodePos(1:3,1+mod(n+1,m)) - nodePos(1:3,n))
normal = 0.5_pReal * sum(normals,2)
mesh_ipArea(f,i,e) = norm2(normal)

View File

@ -1230,7 +1230,7 @@ pure function mesh_cellCenterCoordinates(ip,el)
!--------------------------------------------------------------------------------------------------
subroutine mesh_build_ipAreas
use math, only: &
math_crossproduct
math_cross
implicit none
integer(pInt) :: e,t,g,c,i,f,n,m
@ -1265,7 +1265,7 @@ subroutine mesh_build_ipAreas
do f = 1_pInt,FE_NipNeighbors(c) ! loop over cell faces
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
normal = math_crossproduct(nodePos(1:3,2) - nodePos(1:3,1), &
normal = math_cross(nodePos(1:3,2) - nodePos(1:3,1), &
nodePos(1:3,3) - nodePos(1:3,1))
mesh_ipArea(f,i,e) = norm2(normal)
mesh_ipAreaNormal(1:3,f,i,e) = normal / norm2(normal) ! ensure unit length of area normal
@ -1284,7 +1284,7 @@ subroutine mesh_build_ipAreas
nodePos(1:3,n) = mesh_cellnode(1:3,mesh_cell(FE_cellface(n,f,c),i,e))
forall(n = 1_pInt:FE_NcellnodesPerCellface(c)) &
normals(1:3,n) = 0.5_pReal &
* math_crossproduct(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
* math_cross(nodePos(1:3,1+mod(n ,m)) - nodePos(1:3,n), &
nodePos(1:3,1+mod(n+1,m)) - nodePos(1:3,n))
normal = 0.5_pReal * sum(normals,2)
mesh_ipArea(f,i,e) = norm2(normal)