- edited description
CellVolume and FacetArea for quad and hex domains are not handled in UFLACS
Currently CellVolume
, FacetArea
are not handled for quadrilateral and hexahedral cells with UFLACS representation.
Resulting in error Missing handler for type CellVolume/FacetArea/Circumradius
.
from ufl/algorithms/apply_geometry_lowering.py
def cell_volume(self, o):
if self._preserve_types[o._ufl_typecode_]:
return o
domain = o.ufl_domain()
if not domain.is_piecewise_linear_simplex_domain():
# Don't lower for non-affine cells, instead leave it to
# form compiler
warning("Only know how to compute the cell volume of an affine cell.")
return o
r = self.jacobian_determinant(JacobianDeterminant(domain))
r0 = ReferenceCellVolume(domain)
return abs(r * r0)
CellVolume
and FacetArea
work with TSFC representation.
Comments (8)
-
reporter -
Not sure if
Circumradius
is even meaningful for non-simplex cell types, since they generally do not have a circumscribed circle/sphere. -
As Mikos says, forget
Circumradius
. Quantity which is meaningful for all (affine) cells is a diameter of cellK
defined as\sup_{x,y\in K} \dist(x, y)
.BTW the definition of cell size in DOLFIN
def CellSize(mesh): """Return function cell size for given mesh.""" return 2.0*ufl.Circumradius(_mesh2domain(mesh))
is really c*cked up. See the meaningless docstring.
CellSize
should be set diameter and it should be documented what it does. -
Are you aware of the edge size quantities
MinCellEdgeLength, MaxCellEdgeLength, MinFacetEdgeLength, MaxFacetEdgeLength
in UFL? Do these work with quads and hexes? -
reporter These do not work as well.
-
Okay, let's forget
Circumradius
in this thread. This is aboutCellVolume
andFacetArea
. See#164for a suggestion of good "cell size" measure. -
-
assigned issue to
FacetArea
is easy for quads as facet is simplex.CellVolume
of quads andFacetArea
of hexes by bisection into two triangles.CellVolume
of hexes by section into tetrahedrons. New UFL nodesPhysicalCellVertices
,PhysicalCellEdgeVectors
,PhysicalFacetEdgeVectors
will be useful for that. Code generation for them here https://bitbucket.org/fenics-project/ffc/branch/jan/feature-cell-diameter#Lffc/uflacs/backends/ffc/access.pyT286. -
assigned issue to
-
- removed responsible
- Log in to comment