Enable dt estimate for quads/hexes, extend tests for it#338
Enable dt estimate for quads/hexes, extend tests for it#338
Conversation
2f3a604 to
cc6bc8f
Compare
Co-authored-by: Andreas Kloeckner <[email protected]>
cc6bc8f to
b3eff8b
Compare
|
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. |
grudge/dt_utils.py
Outdated
| volm_discr = dcoll.discr_from_dd(dd) | ||
|
|
||
| r_fac = dcoll.dim | ||
| if any(not isinstance(grp, SimplexElementGroupBase) |
There was a problem hiding this comment.
Should check for supported element types instead.
|
@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. |
| 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. |
test/test_dt_utils.py
Outdated
| @pytest.mark.parametrize("tpe", [False, True]) | ||
| def test_wave_dt_estimate(actx_factory, dim, degree, tpe, visualize=False): |
There was a problem hiding this comment.
Also try with anisotropic meshes.
There was a problem hiding this comment.
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)
test/test_dt_utils.py
Outdated
| 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) | ||
|
|
There was a problem hiding this comment.
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.
cc @MTCam
TensorProductElementGroupBase.bases_1dmeshmode#409