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

Enable dt estimate for quads/hexes, extend tests for it #338

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

@inducer inducer changed the title Enable dt estimate for Quads/Hexes, extend tests for it. Enable dt estimate for Quads/Hexes, extend tests for it Apr 26, 2024
@inducer
Copy link
Owner Author

inducer commented Apr 26, 2024

Well... for some very innocuous-looking changes, this has some very exciting-looking failures. 😬

@MTCam
Copy link
Collaborator

MTCam commented Apr 26, 2024

Well... for some very innocuous-looking changes, this has some very exciting-looking failures. 😬

I forgot about these. At some point I had worked out a plan for how to fix these tests, but now have turned away too long to remember. I'll have another look.

@inducer inducer changed the title Enable dt estimate for Quads/Hexes, extend tests for it Enable dt estimate for quads/hexes, extend tests for it Apr 29, 2024
@@ -256,11 +271,10 @@ def dt_geometric_factors(
actx = dcoll._setup_actx
volm_discr = dcoll.discr_from_dd(dd)

r_fac = dcoll.dim
if any(not isinstance(grp, SimplexElementGroupBase)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check for supported element types instead.

@inducer
Copy link
Owner Author

inducer commented May 1, 2024

@MTCam Now all the remaining failures are numerical in nature, illustrating (I think) that this does not find a valid time step estimate for tensor product elements even for wave.

@MTCam
Copy link
Collaborator

MTCam commented May 1, 2024

@MTCam Now all the remaining failures are numerical in nature, illustrating (I think) that this does not find a valid time step estimate for tensor product elements even for wave.

If we adjust the sketchy fudge factor in the wave operator's rk4 estimate to 0.23 for TPE. I think it passes. That fudge factor is dependent on element type.

I think I also added a skip for the dim=1 tests for TPEs as there is no 1D TPE.

Comment on lines 246 to 259
For non-simplicial elements, we use the following formula for a mean
cell size measure:

.. math::

r_D = \frac{2~d~V}{\sum_{i=1}^{N_{faces}} F_i},

where :math:`d` is the topological dimension, :math:`V` is the cell volume,
and :math:`F_i` are the areas of each face of the cell. Other valid choices
here include the shortest, longest, average of the cell diagonals, or edges.
The value returned by this routine (i.e. the cell volume divided by the
average cell face area) is bounded by the extrema of the cell edge lengths,
is straightforward to calculate regardless of element shape, and jibes well
with the foregoing calculation for simplicial elements.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MTCam says this inaccurate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed up now.

Comment on lines 158 to 159
@pytest.mark.parametrize("tpe", [False, True])
def test_wave_dt_estimate(actx_factory, dim, degree, tpe, visualize=False):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also try with anisotropic meshes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm attempting to add some gmsh-generated meshes to the tests, but both simplices and tensor product fail when I use those meshes. (3c4ebea)

Comment on lines 171 to 175
mesh = mgen.generate_regular_rect_mesh(
a=a[:dim], b=b[:dim],
nelements_per_axis=(3,)*dim)
nelements_per_axis=(3,)*dim,
group_cls=group_cls)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe go warped?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you won't be super impressed by what I've done in 7b8f37b to get passing warped mesh tests, but please take a look and we can discuss.

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