Init for edges changed. Now, input

This commit is contained in:
Jorge Gonzalez 2026-02-13 10:58:31 +01:00
commit 6b96d56c9d
6 changed files with 49 additions and 69 deletions

View file

@ -100,16 +100,15 @@ MODULE moduleMesh1DCart
!EDGE FUNCTIONS
!Init edge element
SUBROUTINE initEdge1DCart(self, n, p, bt, physicalSurface)
USE moduleSpecies
SUBROUTINE initEdge1DCart(self, n, p, bt)
USE moduleSpecies, only: nSpecies
USE moduleErrors
IMPLICIT NONE
CLASS(meshEdge1DCart), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nSpecies)
REAL(8), DIMENSION(1:3):: r1
INTEGER:: s
@ -125,17 +124,13 @@ MODULE moduleMesh1DCart
self%normal = (/ 1.D0, 0.D0, 0.D0 /)
!Boundary index
self%boundary => boundaries(bt)
ALLOCATE(self%fboundary(1:nSpecies))
!Boundary particle linking
allocate(self%boundariesParticle(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
CALL pointBoundaryFunction(self, s)
do s = 1, nSpecies
self%boundariesParticle(s)%obj => boundariesParticle(bt(s))%obj
END DO
!Physical Surface
self%physicalSurface = physicalSurface
end do
END SUBROUTINE initEdge1DCart

View file

@ -100,16 +100,15 @@ MODULE moduleMesh1DRad
!EDGE FUNCTIONS
!Init edge element
SUBROUTINE initEdge1DRad(self, n, p, bt, physicalSurface)
USE moduleSpecies
SUBROUTINE initEdge1DRad(self, n, p, bt)
USE moduleSpecies, only:nSpecies
USE moduleErrors
IMPLICIT NONE
CLASS(meshEdge1DRad), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nSpecies)
REAL(8), DIMENSION(1:3):: r1
INTEGER:: s
@ -125,17 +124,13 @@ MODULE moduleMesh1DRad
self%normal = (/ 1.D0, 0.D0, 0.D0 /)
!Boundary index
self%boundary => boundaries(bt)
ALLOCATE(self%fboundary(1:nSpecies))
!Boundary particle linking
allocate(self%boundariesParticle(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
CALL pointBoundaryFunction(self, s)
do s = 1, nSpecies
self%boundariesParticle(s)%obj => boundariesParticle(bt(s))%obj
END DO
!Physical Surface
self%physicalSurface = physicalSurface
end do
END SUBROUTINE initEdge1DRad

View file

@ -140,16 +140,15 @@ MODULE moduleMesh2DCart
!EDGE FUNCTIONS
!Init edge element
SUBROUTINE initEdge2DCart(self, n, p, bt, physicalSurface)
USE moduleSpecies
SUBROUTINE initEdge2DCart(self, n, p, bt)
USE moduleSpecies, only:nSpecies
USE moduleErrors
IMPLICIT NONE
CLASS(meshEdge2DCart), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nSpecies)
REAL(8), DIMENSION(1:3):: r1, r2
INTEGER:: s
@ -169,17 +168,13 @@ MODULE moduleMesh2DCart
0.D0 /)
self%normal = self%normal/NORM2(self%normal)
!Boundary index
self%boundary => boundaries(bt)
ALLOCATE(self%fboundary(1:nSpecies))
!Boundary particle linking
allocate(self%boundariesParticle(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
CALL pointBoundaryFunction(self, s)
do s = 1, nSpecies
self%boundariesParticle(s)%obj => boundariesParticle(bt(s))%obj
END DO
!Physical surface
self%physicalSurface = physicalSurface
end do
END SUBROUTINE initEdge2DCart

View file

@ -140,7 +140,7 @@ MODULE moduleMesh2DCyl
!EDGE FUNCTIONS
!Init edge element
SUBROUTINE initEdge2DCyl(self, n, p, bt, physicalSurface)
SUBROUTINE initEdge2DCyl(self, n, p, bt)
USE moduleSpecies
USE moduleErrors
USE moduleConstParam, ONLY: PI
@ -149,8 +149,7 @@ MODULE moduleMesh2DCyl
CLASS(meshEdge2DCyl), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nsPecies)
REAL(8), DIMENSION(1:3):: r1, r2
INTEGER:: s
@ -178,17 +177,13 @@ MODULE moduleMesh2DCyl
0.D0 /)
self%normal = self%normal/NORM2(self%normal)
!Boundary index
self%boundary => boundaries(bt)
ALLOCATE(self%fboundary(1:nSpecies))
!Boundary particle linking
allocate(self%boundariesParticle(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
CALL pointBoundaryFunction(self, s)
do s = 1, nSpecies
self%boundariesParticle(s)%obj => boundariesParticle(bt(s))%obj
END DO
!Physical surface
self%physicalSurface = physicalSurface
end do
END SUBROUTINE initEdge2DCyl

View file

@ -103,8 +103,8 @@ MODULE moduleMesh3DCart
!EDGE FUNCTIONS
!Init surface element
SUBROUTINE initEdge3DCartTria(self, n, p, bt, physicalSurface)
USE moduleSpecies
SUBROUTINE initEdge3DCartTria(self, n, p, bt)
USE moduleSpecies, only: nSpecies
USE moduleErrors
USE moduleMath
USE moduleRefParam, ONLY: L_ref
@ -113,8 +113,7 @@ MODULE moduleMesh3DCart
CLASS(meshEdge3DCartTria), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nSpecies)
REAL(8), DIMENSION(1:3):: r1, r2, r3
REAL(8), DIMENSION(1:3):: vec1, vec2
INTEGER:: s
@ -143,17 +142,13 @@ MODULE moduleMesh3DCart
self%surface = 1.D0/L_ref**2 !TODO: FIX THIS WHEN MOVING TO 3D
!Boundary index
self%boundary => boundaries(bt)
ALLOCATE(self%fBoundary(1:nSpecies))
!Boundary particle linking
allocate(self%boundariesParticle(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
CALL pointBoundaryFunction(self, s)
do s = 1, nSpecies
self%boundariesParticle(s)%obj => boundariesParticle(bt(s))%obj
END DO
!Physical surface
self%physicalSurface = physicalSurface
end do
END SUBROUTINE initEdge3DCartTria

View file

@ -87,9 +87,8 @@ MODULE moduleMesh
! Surface of edge
REAL(8):: surface = 0.D0
!Pointer to boundary per species
TYPE(boundaryCont), POINTER:: boundariesParticle(:)
TYPE(boundaryPointer), allocatable:: boundariesParticle(:)
!Physical surface for the edge
INTEGER:: physicalSurface
CONTAINS
!DEFERED PROCEDURES
PROCEDURE(initEdge_interface), DEFERRED, PASS:: init
@ -117,14 +116,14 @@ MODULE moduleMesh
ABSTRACT INTERFACE
!Inits the edge parameters
SUBROUTINE initEdge_interface(self, n, p, bt, physicalSurface)
SUBROUTINE initEdge_interface(self, n, p, bt)
use moduleSpecies, only:nSpecies
IMPORT:: meshEdge
CLASS(meshEdge), INTENT(out):: self
INTEGER, INTENT(in):: n
INTEGER, INTENT(in):: p(:)
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
INTEGER, INTENT(in):: bt(1:nSpecies)
END SUBROUTINE initEdge_interface
@ -779,6 +778,12 @@ MODULE moduleMesh
END TYPE boundaryCont
type:: boundaryPointer
class(boundaryGeneric), pointer:: obj
contains
end type boundaryPointer
!Number of boundaries
INTEGER:: nBoundaries = 0
!Array for boundaries