Rewriting surfaces and boundaries

This commit is contained in:
Jorge Gonzalez 2026-02-19 20:23:13 +01:00
commit 1b32dfdfd6
6 changed files with 170 additions and 152 deletions

View file

@ -136,15 +136,14 @@ MODULE moduleMesh
ABSTRACT INTERFACE
!Inits the edge parameters
subroutine initEdge_interface(self, n, p, btPart, btEM)
subroutine initEdge_interface(self, n, p, physicalSurface)
use moduleSpecies, only:nSpecies
import:: meshEdge
class(meshEdge), intent(out):: self
integer, intent(in):: n
integer, intent(in):: p(:)
integer, intent(in):: btPart(1:nSpecies)
integer, intent(in):: btEM
integer, intent(in):: physicalSurface
end subroutine initEdge_interface
@ -182,6 +181,12 @@ MODULE moduleMesh
END TYPE meshEdgeCont
! Array of pointers to edges.
type:: meshEdgePointer
class(meshEdge), pointer:: obj
end type meshEdgePointer
!Parent of cell element
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshElement):: meshCell
!Number of nodes in the cell
@ -811,18 +816,10 @@ MODULE moduleMesh
end type boundaryParticlePointer
type boundaryParticleLinking
integer:: physicalSurface
integer, allocatable, dimension(:):: speciesIndex
end type boundaryParticleLinking
!Number of boundaries
INTEGER:: nBoundaries = 0, nPhysicalSurfaces = 0
INTEGER:: nBoundaries = 0
!Array for boundaries
TYPE(boundaryParticleCont), ALLOCATABLE, TARGET:: boundariesParticle(:)
!Array for linking boundaries
type(boundaryParticleLinking), allocatable, dimension(:):: boundariesParticleLinking
! BOUNDARY ELECTROMAGNETIC DEFINITIONS
! Generic type for electromagnetic boundary conditions
@ -857,6 +854,12 @@ MODULE moduleMesh
end subroutine addNodes
module function boundaryEMName_to_Index(boundaryName) result(bp)
character(:), allocatable:: boundaryName
integer:: bp
end function boundaryEMName_to_Index
end interface
abstract interface
@ -879,6 +882,7 @@ MODULE moduleMesh
end interface
! Extended types
TYPE, EXTENDS(boundaryEMGeneric):: boundaryEMDirichlet
REAL(8):: potential
@ -919,35 +923,34 @@ MODULE moduleMesh
END TYPE boundaryEMCont
type:: boundaryEMLinking
integer:: physicalSurface
class(boundaryEMGeneric), pointer:: model => null()
end type boundaryEMLinking
INTEGER:: nBoundariesEM
TYPE(boundaryEMCont), ALLOCATABLE, target:: boundariesEM(:)
type(boundaryEMLinking), allocatable, dimension(:):: boundariesEMLinking
!Information of charge and reference parameters for rho vector
REAL(8), ALLOCATABLE:: qSpecies(:)
! PHYSICAL SURFACES LINKING TO MESH ELEMENTS
! Link physical surface to edges
type:: physicalSurface
integer:: index
class(meshNodePointer), allocatable:: nodes(:)
class(meshEdgePointer), allocatable:: edges(:)
class(boundaryParticlePointer), allocatable:: particles(:)
class(boundaryEMGeneric), pointer:: EM => null()
end type
integer:: nPhysicalSurfaces
type(physicalSurface), allocatable:: physicalSurfaces(:)
! Get ID from array based on physical surface
interface physicalSurface_to_id
module function physicalSurface_to_boundaryParticleId(boundaryArray, physicalSurface) result(b)
type(boundaryParticleLinking):: boundaryArray(:)
integer:: physicalSurface
integer:: b
interface
module function physicalSurface_to_index(ps) result(index)
integer:: ps
integer:: index
end function physicalSurface_to_boundaryParticleId
end function physicalSurface_to_index
module function physicalSurface_to_boundaryEMId(boundaryArray, physicalSurface) result(b)
type(boundaryEMLinking):: boundaryArray(:)
integer:: physicalSurface
integer:: b
end function physicalSurface_to_boundaryEMId
end interface physicalSurface_to_id
end interface
END MODULE moduleMesh