Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix surface refinement #118

Merged
merged 4 commits into from
Feb 22, 2021
Merged

Fix surface refinement #118

merged 4 commits into from
Feb 22, 2021

Conversation

inducer
Copy link
Owner

@inducer inducer commented Feb 22, 2021

This adds a failing test for the ability to refine toruses and spheres without large node-vertex inconsistencies.

I'm guessing this might have to do with the work in #97. I don't yet fully understand what's going on.

cc @alexfikl

@alexfikl
Copy link
Collaborator

What's supposed to fail? It works locally.

test/test_refinement.py Outdated Show resolved Hide resolved
Co-authored-by: Alex Fikl <alexfikl@gmail.com>
@inducer
Copy link
Owner Author

inducer commented Feb 22, 2021

I get

Traceback (most recent call last):
  File "/home/andreas/src/meshmode/test/test_refinement.py", line 360, in <module>
    exec(sys.argv[1])
  File "<string>", line 1, in <module>
  File "/home/andreas/src/meshmode/test/test_refinement.py", line 349, in test_refine_surfaces
    refined_mesh = refine_uniformly(mesh, 1)
  File "/home/andreas/src/meshmode/meshmode/mesh/refinement/__init__.py", line 991, in refine_uniformly
    refiner.refine_uniformly()
  File "/home/andreas/src/meshmode/meshmode/mesh/refinement/no_adjacency.py", line 61, in refine_uniformly
    return self.refine(flags)
  File "/home/andreas/src/meshmode/meshmode/mesh/refinement/no_adjacency.py", line 227, in refine
    new_mesh = Mesh(new_vertices, new_el_groups, is_conforming=(
  File "/home/andreas/src/meshmode/meshmode/mesh/__init__.py", line 779, in __init__
    assert _test_node_vertex_consistency(
  File "/home/andreas/src/meshmode/meshmode/mesh/__init__.py", line 983, in _test_node_vertex_consistency
    assert _test_node_vertex_consistency_resampling(mesh, mgrp, tol)
  File "/home/andreas/src/meshmode/meshmode/mesh/__init__.py", line 971, in _test_node_vertex_consistency_resampling
    assert max_el_vertex_error < tol*size, max_el_vertex_error
AssertionError: 9.901371953343942

Strangely, that seems to reproduce on my laptop and nowhere else.

@alexfikl
Copy link
Collaborator

Hm, I've added a refine_uniformly to various surface tests in test_meshmode.py too and couldn't get any of them to fail (ran multiple times).

Does it fail for both the sphere and the torus?

@inducer
Copy link
Owner Author

inducer commented Feb 22, 2021

Does it fail for both the sphere and the torus?

Yeah. The fact that CI passed is further indication that this might me something to do with my environment. I'll need to investigate. Thanks for helping!

@inducer inducer marked this pull request as ready for review February 22, 2021 15:25
@inducer
Copy link
Owner Author

inducer commented Feb 22, 2021

inducer/pytential#63 is another thing that seems to be unique to my laptop. Kind of weird.

@inducer inducer merged commit becff70 into master Feb 22, 2021
@inducer inducer deleted the fix-surface-refinement branch February 22, 2021 15:35
@inducer inducer changed the title (WIP) Fix surface refinement Fix surface refinement Feb 22, 2021
@inducer
Copy link
Owner Author

inducer commented Feb 22, 2021

Very strangely, this works OK on my laptop in an environment based on conda.

@alexfikl
Copy link
Collaborator

Very strangely, this works OK on my laptop in an environment based on conda.

I'm not using conda locally, just good old venv with master from pretty much everything.

@inducer
Copy link
Owner Author

inducer commented Feb 22, 2021

On my laptop: Rebuilt my venv with the existing source trees... same result. Freshly downloaded source with fresh venv... also same result.

On dunkel: Freshly downloaded source with fresh venv... no error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants