Skip to content

Commit

Permalink
Fix, test generate_urchin
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Apr 15, 2024
1 parent 7fdec36 commit d155e01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 5 additions & 7 deletions meshmode/mesh/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,10 @@ def generate_torus(
# {{{ get_urchin

def refine_mesh_and_get_urchin_warper(
order: int, m: int, n: int, est_rel_interp_tolerance: float,
min_rad: float = 0.2,
uniform_refinement_rounds: int = 0) -> Mesh:
order: int, m: int, n: int, est_rel_interp_tolerance: float,
min_rad: float = 0.2,
uniform_refinement_rounds: int = 0
) -> Tuple[Refiner, Callable[[Mesh], Mesh]]:
"""
:arg order: order of the (simplex) elements.
:arg m: order of the spherical harmonic :math:`Y^m_n`.
Expand Down Expand Up @@ -1028,15 +1029,12 @@ def warp_mesh(mesh: Mesh) -> Mesh:
hi = np.max(nodes_sph)
del nodes_sph

from functools import partial
unwarped_mesh = warp_and_refine_until_resolved(
refiner,
warp_mesh,
est_rel_interp_tolerance)

return refiner, partial(
warp_mesh,
node_vertex_consistency_tolerance=est_rel_interp_tolerance)
return refiner, warp_mesh


def generate_urchin(
Expand Down
4 changes: 4 additions & 0 deletions test/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,10 @@ def separated(x, y):
# }}}


def test_urchin():
mgen.generate_urchin(3, 2, 4, 1e-4)


if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
Expand Down

0 comments on commit d155e01

Please sign in to comment.