The version of Petsc installed on my machine has PetscScalar set to be complex. I am making a matrix which has all real entries.
Something like the following code compiles:
PetscScalar value_for_matrix; value_for_matrix=some+expression+that*returns_PetscReal;
Is the real value returned by the right hand side put into the real part of the PetscScalar value?
If this doesn't work, how should I put a PetscReal value into the real part of a complex PetscScalar?