diff --git a/grudge/symbolic/operators.py b/grudge/symbolic/operators.py index c4afc0ec32d0d2d1b8a1ecb79003cf919bd5ca18..77f735b912b79079b963aaffd867fe0f46d5f503 100644 --- a/grudge/symbolic/operators.py +++ b/grudge/symbolic/operators.py @@ -742,6 +742,26 @@ def h_max_from_volume(ambient_dim, dim=None, dd=None): ) )**(1.0/dim) +def h_min_from_volume(ambient_dim, dim=None, dd=None): + """Defines a characteristic length based on the volume of the elements. + This length may not be representative if the elements have very high + aspect ratios. + """ + + import grudge.symbolic.primitives as prim + if dd is None: + dd = prim.DD_VOLUME + dd = prim.as_dofdesc(dd) + + if dim is None: + dim = ambient_dim + + return NodalMin(dd_in=dd)( + ElementwiseSumOperator(dd)( + MassOperator(dd_in=dd)(prim.Ones(dd)) + ) + )**(1.0/dim) + # }}} # vim: foldmethod=marker