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.

But I do not think that it is applicable for a function in mixed formulation. It changes the ufl type of the quantity. So I cannot use it in the free energy form.

I guess you can try to use cell_avg on the sub function J in the mixed-form function. For instance if J is the zero-th component of this function, then

j = your_function.sub(0)
j_bar_dx = cell_avg(j) * dx

If this doesn’t work, you can also try

j_function, other_function = your_function.split()
j_bar_dx = cell_avg(j_function) * dx