3 #include "libmesh/libmesh_common.h" 5 #ifdef LIBMESH_HAVE_UNISTD_H 21 std::ifstream infile (filename.c_str());
23 libmesh_error_msg_if(!infile.is_open(),
"Error opening file " << filename);
27 for (
unsigned int i=0; i != timesteps+1; ++i)
28 infile.getline(buf, 1024);
29 libmesh_error_msg_if(!infile.good(),
"Error reading line from file " << filename);
30 unsigned int length = cast_int<unsigned int>(infile.tellg());
34 int err = truncate(filename.c_str(), length);
35 libmesh_error_msg_if(
err != 0,
"Error truncating file " << filename);
41 outfile << varname <<
" = [" << std::endl;
void start_output(unsigned int timesteps, std::string filename, std::string varname)
The libMesh namespace provides an interface to certain functionality in the library.