Just redirect information output using ofstream.
For example,
.... ofstream file1("first.txt"); file1<<u[]; .... ofstream file2("second.txt"); file2<<w[]; .....
file1 and file2 denote the stream the info will follow, while first.txt and second.txt are just arbitrary used to name the files on disk
We could save info block wise like in here, (file1<< u[]) or use a loop to save data.