← Back to team overview

dolfin team mailing list archive

Re: [Question #148401]: min(a, b, c) functions in a ufl file for C++

 

Question #148401 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/148401

    Status: Open => Answered

Mikael Mortensen proposed the following answer:

min is a built in python function. Use conditional instead and define your own min function like:

from ufl import conditional

def ufl_min(a, b):
    return conditional(lt(a, b), a, b)

min(a, b, c) is then ufl_min(a, ufl_min(b, c))

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.