diff --git a/src/modules/init/moduleInput.f90 b/src/modules/init/moduleInput.f90 index 93bb51f..be92b31 100644 --- a/src/modules/init/moduleInput.f90 +++ b/src/modules/init/moduleInput.f90 @@ -1361,6 +1361,16 @@ MODULE moduleInput end do + type is(boundaryEMFloating) + ! Loop over all physical surfaces + do ps = 1, nPhysicalSurfaces + ! If the boundary for the species is linked to the one analysing, add the edges + if (associated(physicalSurfaces(ps)%EM, bound)) then + bound%nodes = [bound%nodes, physicalSurfaces(ps)%nodes] + end if + + end do + end select bound%nNodes = size(bound%nodes) diff --git a/src/modules/mesh/moduleMesh@boundaryEM.f90 b/src/modules/mesh/moduleMesh@boundaryEM.f90 index 5e30627..3b52c78 100644 --- a/src/modules/mesh/moduleMesh@boundaryEM.f90 +++ b/src/modules/mesh/moduleMesh@boundaryEM.f90 @@ -173,9 +173,36 @@ submodule(moduleMesh) boundaryEM ! Update subroutine updateFloating(self) + use moduleMesh, only: qSpecies, meshNode + implicit none + class(boundaryEMGeneric), intent(inout):: self + integer:: n, s + integer, allocatable:: nodes(:) + class(meshNode), pointer:: node + real(8):: momNode, momNodeTotal, totalCurrent + + totalCurrent = 0.0d0 select type(self) type is(boundaryEMFloating) + do n = 1, self%nNodes + momNodeTotal = 0.0d0 + + node => self%nodes(n)%obj + + do s = 1, nSpecies + print *, s, node%output(s)%mom + momNode = norm2(node%output(s)%mom) + + momNodeTotal = momNodeTotal + qSpecies(s) * momNode + + end do + + totalCurrent = totalCurrent + momNodeTotal + + end do + + print *, totalCurrent end select