Almost done with EM, not to modify the EM module itself

This commit is contained in:
Jorge Gonzalez 2026-02-18 15:14:59 +01:00
commit d211ed9a71
13 changed files with 165 additions and 97 deletions

View file

@ -1,5 +1,29 @@
submodule(moduleMesh) boundaryEM
CONTAINS
function boundaryEMName_to_Index(boundaryName) result(bp)
use moduleErrors
implicit none
character(:), allocatable:: boundaryName
integer:: bp
integer:: b
bp = 0
do b = 1, nBoundaries
if (boundaryName == boundariesEM(b)%obj%name) then
bp = boundariesEM(b)%obj%n
end if
end do
if (bp == 0) then
call criticalError('Boundary ' // boundaryName // ' not found', 'boundaryEMName_to_Index')
end if
end function boundaryEMName_to_Index
subroutine addNodes(self, nodes)
implicit none
@ -159,7 +183,7 @@ submodule(moduleMesh) boundaryEM
CLASS(boundaryEMDirichlet), INTENT(in):: self
REAL(8), INTENT(inout):: vectorF(:)
INTEGER:: n, ni
integer:: n
DO n = 1, self%nNodes
self%nodes(n)%obj%emData%phi = self%potential
@ -178,7 +202,7 @@ submodule(moduleMesh) boundaryEM
CLASS(boundaryEMDirichletTime), INTENT(in):: self
REAL(8), INTENT(inout):: vectorF(:)
REAL(8):: timeFactor
INTEGER:: n, ni
integer:: n
timeFactor = self%temporalProfile%get(DBLE(timeStep)*tauMin)
@ -190,7 +214,7 @@ submodule(moduleMesh) boundaryEM
END SUBROUTINE applyDirichletTime
function physicalSurface_to_boundaryEMId(boundaryArray,physicalSurface) result(b)
function physicalSurface_to_boundaryEMId(boundaryArray, physicalSurface) result(b)
implicit none
type(boundaryEMLinking):: boundaryArray(:)
@ -198,9 +222,10 @@ submodule(moduleMesh) boundaryEM
integer:: b
integer:: bt
b = 0
do bt=1, nPhysicalSurfaces
if (boundaryArray(bt)%physicalSurface == physicalSurface) then
b = boundaryArray(bt)%boundary%n
b = boundaryArray(bt)%model%n
exit