Newer
Older
#include <cstdlib>
#include <iostream>
#include "libmesh/libmesh.h"
#include "libmesh/mesh.h"
using namespace libMesh;
int main(int argc, char* argv[]) {
LibMeshInit init(argc, argv);
if (argc < 4) {
libmesh_error_msg("Usage: " << argv[0] << " -d 2 in.mesh [-o out.mesh]");
}
const unsigned int dim = std::atoi(argv[2]);
Mesh mesh(init.comm());
std::string input_filename = argv[3];
mesh.read(argv[3]);
mesh.print_info();
if (argc >= 6 && std::string("-o") == argv[4]) {
// We may need XDR support compiled in to read binary .xdr files
std::string output_filename = argv[5];
mesh.write(argv[5]);
}
return EXIT_SUCCESS;
}