dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #16619
Expression class
I've done some experimental work on figuring out a proper quadrature
element from a given C++ expression in the Python Expression class (in
expression.py).
UFL and FFC now handle quadrature elements with unspecified degree,
although we may need to fine-tune how the degree is selected by FFC.
There are two main obstacles to getting this working:
1. Understanding all the magic in expression.py. For example, what
does __new__ on line 533 do. It gets an element argument or extracts
it from the function space, but I don't see that it's being used.
2. Figuring out the correct shape for the quadrature element. This is
impossible to extract from the C++ expression string, so we either
need to specify a mesh argument to the constructor of Expression:
f = Expression("sin(x[0])", mesh)
or perhaps leave the domain shape undefined in UFL. This might break a
whole range of things in UFL for operations that depend on the shape,
like the gradient.
On the other hand, that may be good since quadrature elements can't be
differentiated anyway. That way, UFL can give a sensible error message
when the form is defined: "Unable to do this operation since it is not
supported for quadrature functions."
I can take a look at (2) but I really need help with (1). Hake?
The repository is here now:
http://bitbucket.org/dolfin/dolfin/
Btw, Garth and I have discussed the possibility of moving the
repositories from fenics.org to Bitbucket. Less to maintain and we
don't need to rely on the good will of someones IT support (which may
not be indefinite).
--
Anders
Attachment:
signature.asc
Description: Digital signature
Follow ups