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

View file

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

View file

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

View file

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

View file

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

View file

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