 {
 	std::stringstream out;
 	out << caseFolder << "/grid";
-	std::ofstream f(out.str().c_str());
-
-	f << D.nx << std::endl;
-	for(int i=0; i<D.nx+1; i++)
-		f << D.x[i] << '\n';
-	f << '\n';
-	
-	f << D.ny << '\n';
-	for(int j=0; j<D.ny+1; j++)
-		f << D.y[j] << '\n';
-
-	f.close();
+	std::ofstream file(out.str().c_str(), ios::binary);
+	file.write((char*)(&D.nx), sizeof(int));
+	file.write((char*)(&D.x[0]), (D.nx+1)*sizeof(real));
+	file.write((char*)(&D.ny), sizeof(int));
+	file.write((char*)(&D.y[0]), (D.ny+1)*sizeof(real));
+	file.close();
 }
 
 template <>

{
	std::string path;
	std::stringstream out;

	out << caseFolder << '/' << std::setfill('0') << std::setw(7) << n;
	path = out.str();

#include <boundaryCondition.h>

using std::string;
using std::ios;

/// convert string to real number or integer
template <typename T>
