diff --git a/src/modules/init/moduleInput.f90 b/src/modules/init/moduleInput.f90 index fe278eb..e9d3947 100644 --- a/src/modules/init/moduleInput.f90 +++ b/src/modules/init/moduleInput.f90 @@ -1344,6 +1344,13 @@ MODULE moduleInput ! Specific assignments per type select type(bound) + type is(boundaryEMFloating) + if (associated(physicalSurfaces(ps)%EM, bound)) then + bound%edges = [bound%edges, physicalSurfaces(ps)%edges] + bound%nEdges = size(bound%edges) + + end if + type is(boundaryEMFreeCurrent) if (associated(physicalSurfaces(ps)%EM, bound)) then bound%edges = [bound%edges, physicalSurfaces(ps)%edges] diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index 8890b60..12d3efa 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -1089,6 +1089,7 @@ MODULE moduleMesh real(8):: invC ! Inverse of the capacitance of the surface real(8):: charge ! Charge accumulated on surface type(meshEdgePointer), allocatable:: edges(:) !Array with edges + integer:: nEdges contains ! boundaryEMGeneric DEFERRED PROCEDURES procedure, pass:: apply => applyFloating diff --git a/src/modules/mesh/moduleMesh@boundaryEM.f90 b/src/modules/mesh/moduleMesh@boundaryEM.f90 index ded0181..094d671 100644 --- a/src/modules/mesh/moduleMesh@boundaryEM.f90 +++ b/src/modules/mesh/moduleMesh@boundaryEM.f90 @@ -252,7 +252,7 @@ submodule(moduleMesh) boundaryEM select type(self) type is(boundaryEMFloating) - do e = 1, size(self%edges) + do e = 1, self%nEdges edge => self%edges(e)%obj chargeTau = 0.0d0