Averaging Over Element for Mixed Formulations

Hello everyone,

I am trying to model mixed formulation for hyperelasticity with mean dilatation formulation. The mean dilatation procedure is based on an arbitrary volume V, which after discretization will inevitably become the volume of each element. For example;

So, it is need to done in element level rather than performing in material level. How can it be done in FEniCS ? Currently I am trying to model this averaging over element by DG=0, but i am not sure if it works as same. Thanks.

Is there any advice ?

Can u try to use CellAvg from ufl.restriction, see the example here: https://fenicsproject.org/qa/9746/cell-mean-of-a-function-used-in-a-ufl-form/index.html

At least with 2018.1.0, the CellAvg seems to be moved somewhere else.

You may try:

from ufl.operators import cell_avg

j_bar_dx = cell_avg(j) * dx

Hope this helps.