Hi all,
when i run FEniCS, i receive two warning message shown on below. can anyone provide some help to fix them?
WARNING: user expression has not supplied value_shape method or an element. Assuming scalar element.
Calling FFC just-in-time (JIT) compiler, this may take some time.
WARNING: The number of integration points for each cell will be: 144
Consider using the option 'quadrature_degree' to reduce the number of points
I am assuming that you are creating a subclass of UserExpression in your code.
When doing so, you must declare the shape of the expression (for it to be able to select appropriate ufl element, i.e. FiniteElement, VectorElement, TensorElement and so on, see this) like this example. By default it expects a scalar expression
import dolfin as dol
class Delta_Function(dol.UserExpression):
'''Some user defined expression'''
def __init__(self, *args):
dol.UserExpression.__init__(self)
def eval(self, *args):
values[0] = # code to define user expression
def value_shape(self):
return ()
This should take care of your first warning. For the second warning, you can manually set the quadrature_degree for e.g. (Edit: you should set the degree only after knowing what’s best for your problem since this will affect the fidelity of your FE solution)
Please supply a minimal working example, that can be run on any other system to reproduce the warnings. @bhaveshshrimali’s answer is a good answer, but to really decide what quadrature degree you should use one needs a full example.