Boundaries (EM and particles) can now be updated at every iteration

This commit is contained in:
Jorge Gonzalez 2026-03-06 20:00:46 +01:00
commit ecb1364d6a
5 changed files with 115 additions and 34 deletions

View file

@ -89,6 +89,8 @@ submodule(moduleMesh) boundaryEM
call self%temporalProfile%convert(1.D0/ti_ref, 1.D0)
self%update => updateDirichletTime
end select
END SUBROUTINE initDirichletTime
@ -118,17 +120,42 @@ submodule(moduleMesh) boundaryEM
CLASS(boundaryEMDirichletTime), INTENT(in):: self
REAL(8), INTENT(inout):: vectorF(:)
REAL(8):: timeFactor
integer:: n
timeFactor = self%temporalProfile%get(DBLE(timeStep)*tauMin)
DO n = 1, self%nNodes
self%nodes(n)%obj%emData%phi = self%potential * timeFactor
self%nodes(n)%obj%emData%phi = self%potential * self%timeFactor
vectorF(self%nodes(n)%obj%n) = self%nodes(n)%obj%emData%phi
END DO
END SUBROUTINE applyDirichletTime
module subroutine updateDirichletTime(self)
implicit none
class(boundaryEMGeneric), intent(inout):: self
select type(self)
type is(boundaryEMDirichletTime)
self%timeFactor = self%temporalProfile%get(DBLE(timeStep)*tauMin)
end select
end subroutine updateDirichletTime
module subroutine boundariesEM_update()
implicit none
integer:: b
do b = 1, nBoundariesEM
if (associated(boundariesEM(b)%obj%update)) then
call boundariesEM(b)%obj%update
end if
end do
end subroutine boundariesEM_update
end submodule boundaryEM