Projection of values

Hi, I am using software with old fenics version. I wanted to know if it’s possible to project the solutions obtained at the nodes of the mesh to the centroids of the mesh.
Also, If I have some vector values for the mesh at each centroid as a list, is it possible to project it to a vector function space and visualize it manually ?

Just do a projection from your CG-1 space into DG-0 for your first question.

I do not quite understand what you want to do in your second question. Please provide a minimal reproducible example illustrating what you have and pseudo code describing what you want to achieve.

If I project it to DG0, It will have solutions at the centroids if I am correct. How can I find the solutions for the projected space ? For the second question, I wanted to know if I have a vector solution from an external software as an array at centroids or nodes, is it possible to use that to make something like a vectorfunctionspace and export it to pvd for visualization ?

What do you mean by solutions, do you mean an array of the data and corresponding coordinates?
If so use dolfin.Function.vector().get_local() and dolfin.FunctionSpace.tabulate_dof_coordinates()`

See Assign values to the node in vectorFunctionSpace - #2 by dokken