I am trying to do something fairly simple somehow I have made it hard. Is there an example of how to send a 3D array to a binary file?
It depends on the object representation of your 3D array. If it's a PETSc
Mat, you want to look at
MatView; if it's a
Vec, you want to look at
VecView. The links are to PETSc documentation, and each of the links has a list of relevant examples. They may not be exactly what you're looking for, but they should be close; in general, you're looking for something like a "View" type command. If these suggestions don't help, I suggest e-mailing the PETSc user list.