Skip to content

Commit

Permalink
Merge pull request #165 from boutproject/master-tidy-mesh
Browse files Browse the repository at this point in the history
Small tidy of core.mesh._find_intersections
  • Loading branch information
johnomotani authored Jan 26, 2023
2 parents 3df8686 + d469abf commit dbf4b1a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions hypnotoad/core/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ def addPointAtWallToContours(self):
# should the contour intersect a wall at the upper end?
upper_wall = self.connections["upper"] is None

# Note: parallel_map will pass additional keywords to the function,
# including `equilibrium` and `psi`.
map_result = self.parallel_map(
_find_intersection,
enumerate(self.contours),
lower_wall=lower_wall,
upper_wall=upper_wall,
max_extend=max_extend,
atol=self.atol,
refine_width=self.user_options.refine_width,
)

self.contours = [x[0] for x in map_result]
Expand Down Expand Up @@ -2250,21 +2250,26 @@ def _find_intersection(
i_contour,
contour,
*,
psi,
equilibrium,
lower_wall,
upper_wall,
max_extend,
atol,
refine_width,
psi=None,
**kwargs,
):
"""
i_contour Index of contour. Only used for diagnostic output
"""
print(
f"finding wall intersections: {i_contour + 1}",
end="\r",
flush=True,
)

if psi is None:
# Get the poloidal flux from the equilibrium
psi = equilibrium.psi

# point where contour intersects the lower wall
lower_intersect = None

Expand Down

0 comments on commit dbf4b1a

Please sign in to comment.