Improved some general things using pointers.
This commit is contained in:
parent
ec128902ad
commit
46348c86ee
9 changed files with 45 additions and 40 deletions
|
|
@ -5,10 +5,16 @@ MODULE moduleMesh
|
|||
USE moduleBoundary
|
||||
IMPLICIT NONE
|
||||
|
||||
!Parent of Node element
|
||||
TYPE, PUBLIC, ABSTRACT:: meshNode
|
||||
!Node index
|
||||
!Generic mesh element
|
||||
TYPE, PUBLIC, ABSTRACT:: meshElement
|
||||
!Index
|
||||
INTEGER:: n = 0
|
||||
CONTAINS
|
||||
|
||||
END TYPE meshElement
|
||||
|
||||
!Parent of Node element
|
||||
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshElement):: meshNode
|
||||
!Node volume
|
||||
REAL(8):: v = 0.D0
|
||||
!Output values
|
||||
|
|
@ -44,26 +50,26 @@ MODULE moduleMesh
|
|||
!Containers for nodes in the mesh
|
||||
TYPE:: meshNodeCont
|
||||
CLASS(meshNode), ALLOCATABLE:: obj
|
||||
CONTAINS
|
||||
|
||||
END TYPE meshNodeCont
|
||||
|
||||
!Type for array of boundary functions (one per species)
|
||||
TYPE, PUBLIC:: fBoundaryGeneric
|
||||
PROCEDURE(boundary_interface), POINTER, NOPASS:: apply => NULL()
|
||||
CONTAINS
|
||||
|
||||
END TYPE
|
||||
|
||||
!Parent of Edge element
|
||||
TYPE, PUBLIC, ABSTRACT:: meshEdge
|
||||
!Element index
|
||||
INTEGER:: n = 0
|
||||
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshElement):: meshEdge
|
||||
!Connectivity to vols
|
||||
CLASS(meshVol), POINTER:: e1 => NULL(), e2 => NULL()
|
||||
!Normal vector
|
||||
REAL(8):: normal(1:3)
|
||||
!Weight for random injection of particles
|
||||
REAL(8):: weight = 1.D0
|
||||
!Pointer to boundary element
|
||||
!Pointer to boundary type
|
||||
TYPE(boundaryCont), POINTER:: boundary
|
||||
!Array of functions for boundary conditions
|
||||
TYPE(fBoundaryGeneric), ALLOCATABLE:: fBoundary(:)
|
||||
|
|
@ -98,7 +104,7 @@ MODULE moduleMesh
|
|||
|
||||
END FUNCTION getNodesEdge_interface
|
||||
|
||||
!Returns the intersecction between an edge and a line defined by point r0 and vector v0
|
||||
!Returns the intersecction between an edge and a line defined by point r0
|
||||
PURE FUNCTION intersectionEdge_interface(self, r0) RESULT(r)
|
||||
IMPORT:: meshEdge
|
||||
CLASS(meshEdge), INTENT(in):: self
|
||||
|
|
@ -136,9 +142,7 @@ MODULE moduleMesh
|
|||
END TYPE meshEdgeCont
|
||||
|
||||
!Parent of Volume element
|
||||
TYPE, PUBLIC, ABSTRACT:: meshVol
|
||||
!Volume index
|
||||
INTEGER:: n = 0
|
||||
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshElement):: meshVol
|
||||
!Maximum collision rate
|
||||
REAL(8):: sigmaVrelMax = 0.D0
|
||||
!Volume
|
||||
|
|
@ -211,10 +215,10 @@ MODULE moduleMesh
|
|||
END FUNCTION elemF_interface
|
||||
|
||||
SUBROUTINE nextElement_interface(self, xi, nextElement)
|
||||
IMPORT:: meshVol
|
||||
IMPORT:: meshVol, meshElement
|
||||
CLASS(meshVol), INTENT(in):: self
|
||||
REAL(8), INTENT(in):: xi(1:3)
|
||||
CLASS(*), POINTER, INTENT(out):: nextElement
|
||||
CLASS(meshElement), POINTER, INTENT(out):: nextElement
|
||||
|
||||
END SUBROUTINE nextElement_interface
|
||||
|
||||
|
|
@ -343,6 +347,7 @@ MODULE moduleMesh
|
|||
!Find next cell for particle
|
||||
RECURSIVE SUBROUTINE findCell(self, part, oldCell)
|
||||
USE moduleSpecies
|
||||
USE moduleErrors
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -350,7 +355,7 @@ MODULE moduleMesh
|
|||
CLASS(meshVol), OPTIONAL, INTENT(in):: oldCell
|
||||
CLASS(particle), INTENT(inout), TARGET:: part
|
||||
REAL(8):: xi(1:3)
|
||||
CLASS(*), POINTER:: nextElement
|
||||
CLASS(meshElement), POINTER:: nextElement
|
||||
|
||||
xi = self%phy2log(part%r)
|
||||
!Checks if particle is inside 'self' cell
|
||||
|
|
@ -389,7 +394,8 @@ MODULE moduleMesh
|
|||
END IF
|
||||
|
||||
CLASS DEFAULT
|
||||
WRITE(*,*) "ERROR, CHECK findCell"
|
||||
WRITE (*, "(A, I6)") "Element = ", self%n
|
||||
CALL criticalError("No connectivity found for element", "findCell")
|
||||
|
||||
END SELECT
|
||||
END IF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue