Skip to content

Commit

Permalink
Define FacetArea(interval) == 1.0 in geometry lowering.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Oct 19, 2016
1 parent f5ac78d commit 68bcdfb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ufl/algorithms/apply_geometry_lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
ReferenceNormal,
ReferenceCellVolume, ReferenceFacetVolume,
CellVolume, FacetArea,
SpatialCoordinate)
SpatialCoordinate,
FloatValue)
# FacetJacobianInverse,
# FacetOrientation, QuadratureWeight,

Expand Down Expand Up @@ -142,6 +143,7 @@ def facet_jacobian_determinant(self, o):
return o

domain = o.ufl_domain()
#tdim = domain.topological_dimension()
FJ = self.facet_jacobian(FacetJacobian(domain))
detFJ = determinant_expr(FJ)

Expand Down Expand Up @@ -209,12 +211,17 @@ def facet_area(self, o):
return o

domain = o.ufl_domain()
tdim = domain.topological_dimension()
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 facet area of an affine cell.")
return o

# Area of "facet" of interval (i.e. "area" of a vertex) is defined as 1.0
if tdim == 1:
return FloatValue(1.0)

r = self.facet_jacobian_determinant(FacetJacobianDeterminant(domain))
r0 = ReferenceFacetVolume(domain)
return abs(r * r0)
Expand Down

0 comments on commit 68bcdfb

Please sign in to comment.