I am dumb

The Poisson equation was not working because I didn't finish
implementing the new type of BCs. Dirichlet is probably untested. I
should stop doing shitty developments and no testing.
This commit is contained in:
Jorge Gonzalez 2025-07-18 16:31:52 +02:00
commit a2f9957f32
2 changed files with 13 additions and 21 deletions

View file

@ -22,7 +22,6 @@ MODULE moduleOutput
!Type for EM data in node
TYPE emNode
CHARACTER(:), ALLOCATABLE:: type
REAL(8):: phi
REAL(8):: B(1:3)

View file

@ -11,7 +11,6 @@ MODULE moduleEM
CONTAINS
PROCEDURE(applyEM_interface), DEFERRED, PASS:: apply
!PROCEDURE, PASS:: update !only for time dependent boundary conditions or maybe change apply????? That might be better.
END TYPE boundaryEMGeneric
@ -168,8 +167,8 @@ MODULE moduleEM
INTEGER:: n, ni
DO n = 1, self%nNodes
self%nodes(n)%obj%emData%phi = self%potential
vectorF(self%nodes(n)%obj%n) = self%nodes(n)%obj%emData%phi
self%nodes(n)%obj%emData%phi = self%potential
vectorF(self%nodes(n)%obj%n) = self%nodes(n)%obj%emData%phi
END DO
@ -189,8 +188,8 @@ MODULE moduleEM
timeFactor = self%temporalProfile%get(DBLE(timeStep)*tauMin)
DO n = 1, self%nNodes
self%nodes(n)%obj%emData%phi = self%potential * timeFactor
vectorF(self%nodes(n)%obj%n) = self%nodes(n)%obj%emData%phi
self%nodes(n)%obj%emData%phi = self%potential * timeFactor
vectorF(self%nodes(n)%obj%n) = self%nodes(n)%obj%emData%phi
END DO
@ -211,11 +210,11 @@ MODULE moduleEM
INTEGER:: e, i, ni, b
CLASS(meshNode), POINTER:: node
! !$OMP SINGLE
!$OMP SINGLE
vectorF = 0.D0
! !$OMP END SINGLE
!$OMP END SINGLE
! !$OMP DO REDUCTION(+:vectorF)
!$OMP DO REDUCTION(+:vectorF)
DO e = 1, mesh%numCells
nNodes = mesh%cells(e)%obj%nNodes
nodes = mesh%cells(e)%obj%getNodes(nNodes)
@ -247,21 +246,15 @@ MODULE moduleEM
DEALLOCATE(nodes, rho)
END DO
! !$OMP END DO
!$OMP END DO
!Apply boundary conditions
! !$OMP DO
DO i = 1, mesh%numNodes
node => mesh%nodes(i)%obj
!$OMP SINGLE
do b = 1, nBoundaryEM
call boundaryEM(b)%obj%apply(vectorF)
SELECT CASE(node%emData%type)
CASE ("dirichlet")
vectorF(i) = node%emData%phi
END SELECT
END DO
! !$OMP END DO
end do
!$OMP END SINGLE
END SUBROUTINE assembleSourceVector