Create function on center points of mesh, with same ordering as a quadrature degree 1 function would

Question:
With a 2D mesh, triangular elements and quadrature degree=1 all the integration points should be defined exactly in the center of each element. How do I create a space (e.g. (“CG”, 1)) on these center points?
And how do I keep the ordering the same as that of the quadrature space, such that I can directly do something like quadrature_space.x.array[:] = CG_center_space.x.array[:]?

Background:
I have a 2D mechanical problem where I’m solving a type of phase field and a mechanical problem on the same domain in a staggered approach. I use a quadrature space degree=1 for the mechanical problem.
The phase field initial values are defined by values from the constitutive models, and after updating the phase field, its field variable then modifies the properties of the constitutive model. Because of this setup, I would ideally like to have the phase field in the same ‘space’ as the constitutive model. However, I can’t use a quadrature element since we can’t take its derivative when its degree > 0. I think it is possible to define e.g. a (“CG”, 1) space for the phase field, and then constantly project between the two spaces, but this seems cumbersome.

A first order Lagrange space will not have a degree of freedom in the center of a cell, as this is not how they are defined (DefElement)

This means that CG_center_space == quadrature_space.

I mean that the gauss point of a triangular element with one gauss point is in the center.

Either way, I realized that what I want is not possible, as the dual graph of a triangular mesh is itself not a triangular mesh.

Therefore I think that I will have to constantly project back and forth between the two spaces.

Please note that if you are not moving your mesh, you can cache the LU factorization of the projection (or just the assembly of the mass matrix if you are using an iterative solver), which means that it doesn’t need to be very expensive.

1 Like

So you want to make a delauny triangulation of the midpoints of each cell?

Yes, that’s a way to frame what I originally thought would be a better solution, but I think that it is impossible without adding extra nodes in addition to the midpoints when all are triangular elements.

I think it should be possible to make such a triangulation (I’ve not tested it though, might be that you need another triangulation algorithm than Delauney).