First step of performance improvement
Finalysing first step of performance improvement focusing on reducing iteration CPU time by improving calculation of basic element functions, which took a lot of the CPU time
This commit is contained in:
parent
7b7a5c45ca
commit
746c5bea09
13 changed files with 260 additions and 252 deletions
|
|
@ -41,7 +41,6 @@ MODULE moduleMesh1DCart
|
|||
CLASS(meshNode), POINTER:: n1 => NULL(), n2 => NULL()
|
||||
!Connectivity to adjacent elements
|
||||
CLASS(meshElement), POINTER:: e1 => NULL(), e2 => NULL()
|
||||
REAL(8):: arNodes(1:2)
|
||||
CONTAINS
|
||||
!meshCell DEFERRED PROCEDURES
|
||||
PROCEDURE, PASS:: init => initCell1DCartSegm
|
||||
|
|
@ -60,7 +59,7 @@ MODULE moduleMesh1DCart
|
|||
PROCEDURE, PASS:: phy2log => phy2logSegm
|
||||
PROCEDURE, PASS:: neighbourElement => neighbourElementSegm
|
||||
!PARTICLUAR PROCEDURES
|
||||
PROCEDURE, PASS, PRIVATE:: area => areaSegm
|
||||
PROCEDURE, PASS, PRIVATE:: vol => volumeSegm
|
||||
|
||||
END TYPE meshCell1DCartSegm
|
||||
|
||||
|
|
@ -100,7 +99,7 @@ MODULE moduleMesh1DCart
|
|||
END FUNCTION getCoord1DCart
|
||||
|
||||
!EDGE FUNCTIONS
|
||||
!Inits edge element
|
||||
!Init edge element
|
||||
SUBROUTINE initEdge1DCart(self, n, p, bt, physicalSurface)
|
||||
USE moduleSpecies
|
||||
USE moduleBoundary
|
||||
|
|
@ -133,7 +132,7 @@ MODULE moduleMesh1DCart
|
|||
CALL pointBoundaryFunction(self, s)
|
||||
|
||||
END DO
|
||||
|
||||
|
||||
!Physical Surface
|
||||
self%physicalSurface = physicalSurface
|
||||
|
||||
|
|
@ -162,7 +161,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END FUNCTION intersection1DCart
|
||||
|
||||
!Calculates a 'random' position in edge
|
||||
!Calculate a 'random' position in edge
|
||||
FUNCTION randPosEdge(self) RESULT(r)
|
||||
CLASS(meshEdge1DCart), INTENT(in):: self
|
||||
REAL(8):: r(1:3)
|
||||
|
|
@ -173,7 +172,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
!VOLUME FUNCTIONS
|
||||
!SEGMENT FUNCTIONS
|
||||
!Init segment element
|
||||
!Init element
|
||||
SUBROUTINE initCell1DCartSegm(self, n, p, nodes)
|
||||
USE moduleRefParam
|
||||
IMPLICIT NONE
|
||||
|
|
@ -194,9 +193,7 @@ MODULE moduleMesh1DCart
|
|||
self%x = (/ r1(1), r2(1) /)
|
||||
|
||||
!Assign node volume
|
||||
CALL self%area()
|
||||
self%n1%v = self%n1%v + self%arNodes(1)
|
||||
self%n2%v = self%n2%v + self%arNodes(2)
|
||||
CALL self%vol()
|
||||
|
||||
CALL OMP_INIT_LOCK(self%lock)
|
||||
|
||||
|
|
@ -237,7 +234,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END FUNCTION randPos1DCartSegm
|
||||
|
||||
!Computes element functions at point Xi
|
||||
!Compute element functions at point Xi
|
||||
PURE FUNCTION fPsiSegm(Xi, nNodes) RESULT(fPsi)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -317,7 +314,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END FUNCTION gatherMFSegm
|
||||
|
||||
!Computes element local stiffness matrix
|
||||
!Compute element local stiffness matrix
|
||||
PURE FUNCTION elemKSegm(self, nNodes) RESULT(localK)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -348,7 +345,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END FUNCTION elemKSegm
|
||||
|
||||
!Computes the local source vector for a force f
|
||||
!Compute the local source vector for a force f
|
||||
PURE FUNCTION elemFSegm(self, nNodes, source) RESULT(localF)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -422,8 +419,8 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END SUBROUTINE neighbourElementSegm
|
||||
|
||||
!Computes element area
|
||||
PURE SUBROUTINE areaSegm(self)
|
||||
!Compute element vol
|
||||
PURE SUBROUTINE volumeSegm(self)
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshCell1DCartSegm), INTENT(inout):: self
|
||||
|
|
@ -433,22 +430,22 @@ MODULE moduleMesh1DCart
|
|||
REAL(8):: fPsi(1:2)
|
||||
|
||||
self%volume = 0.D0
|
||||
self%arNodes = 0.D0
|
||||
!1D 1 point Gauss Quad Integral
|
||||
Xi = 0.D0
|
||||
dPsi = self%dPsi(Xi, 2)
|
||||
pDer = self%partialDer(2, dPsi)
|
||||
detJ = self%detJac(pDer)
|
||||
fPsi = self%fPsi(Xi, 2)
|
||||
!Computes total volume of the cell
|
||||
!Compute total volume of the cell
|
||||
self%volume = detJ*2.D0
|
||||
!Computes volume per node
|
||||
self%arNodes = fPsi*self%volume
|
||||
!Compute volume per node
|
||||
self%n1%v = self%n1%v + fPsi(1)*self%volume
|
||||
self%n2%v = self%n2%v + fPsi(2)*self%volume
|
||||
|
||||
END SUBROUTINE areaSegm
|
||||
END SUBROUTINE volumeSegm
|
||||
|
||||
!COMMON FUNCTIONS FOR 1D VOLUME ELEMENTS
|
||||
!Computes element Jacobian determinant
|
||||
!Compute element Jacobian determinant
|
||||
PURE FUNCTION detJ1DCart(pDer) RESULT(dJ)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -459,7 +456,7 @@ MODULE moduleMesh1DCart
|
|||
|
||||
END FUNCTION detJ1DCart
|
||||
|
||||
!Computes element Jacobian inverse matrix (without determinant)
|
||||
!Compute element Jacobian inverse matrix (without determinant)
|
||||
PURE FUNCTION invJ1DCart(pDer) RESULT(invJ)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -575,7 +572,7 @@ MODULE moduleMesh1DCart
|
|||
elemA%e1 => elemB
|
||||
elemB%e2 => elemA
|
||||
|
||||
!Revers the normal to point inside the domain
|
||||
!Rever the normal to point inside the domain
|
||||
elemB%normal = - elemB%normal
|
||||
|
||||
END IF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue