Issue with triangles fixed

Now they give the right electric field.

I have to change 2DCyl.

However, there was some insonsistency between the change of coordinates in phy2log and the Jacobian for the K matrix. I fixed it putting a transpose() in phy2log, but I don't like that solution.

I need to review the basic procedure of phy2log.
This commit is contained in:
Jorge Gonzalez 2025-08-03 20:46:12 +02:00
commit 102fd013f3

View file

@ -520,7 +520,7 @@ MODULE moduleMesh2DCart
fPsi = self%fPsi(XiO, 4)
f(1:2) = (/ DOT_PRODUCT(fPsi,self%x), &
DOT_PRODUCT(fPsi,self%y) /) - r(1:2)
Xi = XiO - MATMUL(invJ, f)/detJ
Xi = XiO - MATMUL(transpose(invJ), f)/detJ
conv = MAXVAL(DABS(Xi-XiO),1)
XiO = Xi
@ -831,14 +831,14 @@ MODULE moduleMesh2DCart
REAL(8):: deltaR(1:3)
REAL(8):: dPsi(1:3, 1:3)
REAL(8):: pDer(1:3, 1:3)
REAL(8):: invJ(1:3, 1:3), detJ
REAL(8):: invJ(1:3, 1:3), detJ
!Direct method to convert coordinates
Xi = 0.D0
deltaR = (/ r(1) - self%x(1), r(2) - self%y(1), 0.D0 /)
dPsi = self%dPsi(Xi, 3)
pDer = self%partialDer(3, dPsi)
invJ = self%invJac(pDer)
invJ = transpose(self%invJac(pDer))
detJ = self%detJac(pDer)
Xi = MATMUL(invJ,deltaR)/detJ
@ -915,8 +915,8 @@ MODULE moduleMesh2DCart
invJ = 0.D0
invJ(1, 1:2) = (/ pDer(2,2), -pDer(1,2) /)
invJ(2, 1:2) = (/ -pDer(2,1), pDer(1,1) /)
invJ(1, 1:2) = (/ pDer(2,2), -pDer(2,1) /)
invJ(2, 1:2) = (/ -pDer(1,2), pDer(1,1) /)
invJ(3, 3) = 1.D0
END FUNCTION invJ2DCart