upper incomplete gamma function in fenics
and Ctrl+F "gamma" doesn't find anything relevant. Depending on your purpose, you might be able to get away with wrapping SciPy's function in a user-defined Expression. For example, if $a$ is a constant, and $x$ is a spatial coordinate, you could do something like this:
from dolfin import * from scipy.special import gammaincc as scipyGamma mesh = UnitIntervalMesh(10) a = 1.0 class UpperIncompleteGamma(Expression): def eval(self,values,x): values = scipyGamma(a,x) # can be used in UFL gamma = UpperIncompleteGamma(degree=2) # test: x = 1.234 fenicsGamma = [0.0,] gamma.eval(fenicsGamma,Point(x)) print("scipy: "+str(scipyGamma(a,x))) print("fenics: "+str(fenicsGamma))
EDIT: Note that SciPy's version is "regularized", if that matters:
It looks like a normalizing factor of $\Gamma(a)$.