Skip to content
Snippets Groups Projects
Commit 1a4d368e authored by Alexandru Fikl's avatar Alexandru Fikl
Browse files

add a h_min value as well

parent 40d609d6
No related branches found
No related tags found
1 merge request!69DG on Surfaces
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment