### Integral conservation of adapted function?

294

views

0

Hello,

it appears that adaptation of a function to a refined mesh does not preserve the integral of the function.

The following code produces two different results for me:

it appears that adaptation of a function to a refined mesh does not preserve the integral of the function.

The following code produces two different results for me:

```
print(str(assemble(u0*dx)))
refined_mesh = refine(mesh, cell_markers)
adapt(u0,refined_mesh)
dx = Measure("dx",domain =refined_mesh)
print(str(assemble(u0*dx)))
```

Is this a typical behavior or am I doing something wrong?

Community: FEniCS Project

### 1 Answer

0

To answer my own question: Since my plan was to use "adapt" really to adapt the mesh, i.e. not only refine it, but also achieve some kind of coarsening, I started in every timestep from the coarsest mesh and refined it. Afterwards I adapted the solution to the refined mesh. However, that means that it can occur that the solution needs to be interpolated from finer to coarser parts of the grid. Then there is an interpolation error leading to the loss of integral conservation.

As a follow up question: Is it possible to prevent this, meaning using the integral conservation as constraint for adapting the function?

As a follow up question: Is it possible to prevent this, meaning using the integral conservation as constraint for adapting the function?

Please login to add an answer/comment or follow this question.

I put together a 'MWE' based on the Cahn-Hilliard Demo.

The first few Iterations, the integral value stays the same and afterwards it changes, but only if I use Mesh adaptation.