Skip to content

Commit

Permalink
modify Jcheck for Jacobian J=h/|Bp|
Browse files Browse the repository at this point in the history
  • Loading branch information
HarukiST committed Sep 20, 2024
1 parent 575226c commit a25caac
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions hypnotoad/core/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,16 +1078,12 @@ def calcMetric(self):
self.g_23 = self.bpsign * self.dphidy * self.Rxy**2

# check Jacobian is OK
Jcheck = (
self.bpsign
* 1.0
/ numpy.sqrt(
self.g11 * self.g22 * self.g33
+ 2.0 * self.g12 * self.g13 * self.g23
- self.g11 * self.g23**2
- self.g22 * self.g13**2
- self.g33 * self.g12**2
)
Jcheck = 1.0 / numpy.sqrt(
self.g11 * self.g22 * self.g33
+ 2.0 * self.g12 * self.g13 * self.g23
- self.g11 * self.g23**2
- self.g22 * self.g13**2
- self.g33 * self.g12**2
)
# ignore grid points at X-points as J should diverge there (as Bp->0)
if Jcheck._corners_array is not None:
Expand Down

0 comments on commit a25caac

Please sign in to comment.