Init for boundaries particles

This commit is contained in:
Jorge Gonzalez 2026-02-16 20:05:23 +01:00
commit 6f8656bc21
6 changed files with 80 additions and 40 deletions

View file

@ -794,27 +794,46 @@ MODULE moduleInput
SUBROUTINE readBoundary(config)
use moduleMesh
USE moduleErrors
USE moduleSpecies
use moduleSpecies, only: nSpecies
USE moduleList, ONLY: partSurfaces
USE json_module
IMPLICIT NONE
TYPE(json_file), INTENT(inout):: config
INTEGER:: b
CHARACTER(2):: iString
CHARACTER(:), ALLOCATABLE:: object
integer:: b, s
character(2):: iString
character(:), allocatable:: object
character(len=100), allocatable:: speciesNames(:)
LOGICAL:: found
CALL config%info('boundary', found, n_children = nBoundary)
! Read models of particles
CALL config%info('boundaries.particles.models', found, n_children = nBoundary)
ALLOCATE(boundaries(1:nBoundary))
DO b = 1, nBoundary
WRITE(iString, '(i2)') b
object = 'boundary(' // TRIM(iString) // ')'
object = 'boundary.particles.models(' // TRIM(iString) // ')'
call boundaries(i)%init(config, object, b)
END DO
! Read linking
CALL config%info('boundaries.particles.linking', found, n_children = nPhysicalSurfaces)
allocate(boundaryParticlesLinking(1:nPhysicalSurfaces))
allocate(speciesNames(1:nSpecies))
do b = 1, nPhysicalSurfaces
write(iString, '(i2)') b
object = 'boundary.particles.linking(' // trim(iString) // ')'
call config%get(object // '.physicalSurfaces', boundaryParticlesLinking(b)%physicalSurface, found)
call config%get(object // '.models', speciesNames, found)
allocate(boundaryParticlesLinking(b)%speciesIndex(1:nSpecies))
do s = 1, nSpecies
boundaryParticlesLinking(b)%speciesIndex(s) = boundaryParticlesName_to_Index(speciesNames(s))
end do
end do
!Init the list of particles from surfaces
CALL OMP_INIT_LOCK(partSurfaces%lock)