Spatially-Varying Properties -- Discontinuous Constant v Discontinuous Varying

I am interested in solving some mechanical problems with spatially varying material properties in FEniCSx. In the tutorials, these properties are captured using Discontinuous Constant functions (DG0). I can understand the benefit of using a discontinuous function (especially if you have truly discontinuous properties). However, I’m not sure why a specific restriction to cell-wise constant functions is used. Is this just because the tutorials were using domains with discontinuous properties? If you have a material with e.g. linearly varying properties, would it not make sense to use a DG1 function? Is there a specific reason to use constant functions that I am missing?

Thanks!

If you have a linear varying material property, you should use a continuous linear function space. If it is discontinuous, but linearly varying within each cell, use a discontinuous piecewise linear function. It is all about picking what is suitable for your problem.

Perfect, thanks so much! I wanted to make sure I wasn’t missing something and that my intuition was correct.