Files compile but there is no linking in mesh module

This commit is contained in:
Jorge Gonzalez 2026-02-24 20:03:36 +01:00
commit 135f1f464c
7 changed files with 57 additions and 51 deletions

View file

@ -800,20 +800,20 @@ MODULE moduleInput
IMPLICIT NONE
TYPE(json_file), INTENT(inout):: config
integer:: b, s
integer:: b
character(2):: iString
character(:), allocatable:: object
character(len=100), allocatable:: speciesNames(:)
LOGICAL:: found
! Read models of particles
CALL config%info('boundaries.particles.models', found, n_children = nBoundary)
ALLOCATE(boundaries(1:nBoundary))
DO b = 1, nBoundary
CALL config%info('boundaries.particles.models', found, n_children = nBoundariesParticle)
ALLOCATE(boundariesParticle(1:nBoundariesParticle))
DO b = 1, nBoundariesParticle
WRITE(iString, '(i2)') b
object = 'boundary.particles.models(' // TRIM(iString) // ')'
call boundaries(i)%init(config, object, b)
call boundariesParticle(b)%obj%init(config, object, b)
END DO
@ -827,14 +827,14 @@ MODULE moduleInput
USE moduleOutput
USE moduleErrors
USE moduleEM
USE moduleSpecies
USE moduleSpecies, only: nSpecies
USE json_module
IMPLICIT NONE
TYPE(json_file), INTENT(inout):: config
CHARACTER(:), ALLOCATABLE:: object
LOGICAL:: found
INTEGER:: b
INTEGER:: b, s
CHARACTER(2):: bString
character(len=100), allocatable:: modelName(:)
@ -845,11 +845,11 @@ MODULE moduleInput
END IF
do b = 1, nBoundaryEM
do b = 1, nBoundariesEM
write(bString, '(I2)') b
object = 'boundaries.EM.models(' // TRIM(bString) // ')'
call boundariesEM(b)%init(config, object, b)
call boundariesEM(b)%obj%init(config, object, b)
end do
@ -879,10 +879,10 @@ MODULE moduleInput
character(:), allocatable:: object
logical:: found
integer:: ps
character(2):: psString
character(2):: psString, sSTring
integer:: nParticleModels
character(len=100), allocatable:: particleModels(:)
character(len=100):: EMModel
character(:), allocatable:: particleModel
character(:), allocatable:: EMModel
integer:: s, boundaryIndex
call config%info('physicalSurfaces', found, n_children = nPhysicalSurfaces)
@ -895,8 +895,8 @@ MODULE moduleInput
end if
do ps = 1, nPhysicalSurfaces
write(ps, '(I2)') ps
object = 'physicalSurfaces(' // TRIM(bString) // ')'
write(psString, '(I2)') ps
object = 'physicalSurfaces(' // trim(psString) // ')'
allocate(physicalSurfaces(ps)%nodes(0))
allocate(physicalSurfaces(ps)%edges(0))
@ -913,18 +913,19 @@ MODULE moduleInput
call criticalError('Not enough models for particles provided', 'readPhysicalSurfaces')
end if
call config%get(object // '.particles', particleModels, found)
allocate(physicalSurfaces(ps)%particles(1:nSpecies))
do s = 1, nSpecies
boundaryIndex = boundaryParticlesName_to_Index(particleModels(s))
physicalSurfaces(ps)%particles(s)%obj => boundaryParticles(boundaryIndex)%obj
write(sString, '(I2)') s
call config%get(object // '.particles(' // trim(sSTring) // ')', particleModel, found)
boundaryIndex = boundaryParticleName_to_Index(particleModel)
physicalSurfaces(ps)%particles(s)%obj => boundariesParticle(boundaryIndex)%obj
end do
! Link electromagnetic boundary condition
call config%get(object // '.EM', EMModel, found)
if (found) then
bouondaryIndex = boundaryEMName_to_Index(EMModel)
boundaryIndex = boundaryEMName_to_Index(EMModel)
physicalSurfaces(ps)%EM => boundariesEM(boundaryIndex)%obj
end if
@ -957,6 +958,10 @@ MODULE moduleInput
LOGICAL:: found
CHARACTER(:), ALLOCATABLE:: meshFormat, meshFile
REAL(8):: volume
integer:: b, ps, s
integer:: e
integer:: nVolColl
integer:: boundaryIndex
object = 'geometry'
@ -1170,7 +1175,7 @@ MODULE moduleInput
! Loop over all species
do s = 1, nSpecies
! If the boundary for the species is linked to the one analysing, add the edges
if (associated(physicalSurfaces(ps)%particles(s), bound)) then
if (associated(physicalSurfaces(ps)%particles(s)%obj, bound)) then
bound%edges = [bound%edges, physicalSurfaces(ps)%edges]
end if