32 #include "libmesh/libmesh.h" 34 #include "libmesh/mesh.h" 39 int main (
int argc,
char ** argv)
53 libmesh_error_msg_if(argc < 4,
"Usage: " << argv[0] <<
" -d 2 in.mesh [-o out.mesh]");
56 const unsigned int dim =
58 libmesh_error_msg_if(
dim > 3,
"Usage: " << argv[0] <<
" -d 2 in.mesh [-o out.mesh]");
61 libmesh_example_requires(
dim <= LIBMESH_DIM,
"2D/3D support");
68 const std::string input_filename = argv[3];
69 #ifndef LIBMESH_HAVE_XDR 70 libmesh_example_requires(input_filename.rfind(
".xdr") >=
71 input_filename.size(),
"XDR support");
85 const std::string output_filename =
87 #ifndef LIBMESH_HAVE_XDR 88 libmesh_example_requires(output_filename.rfind(
".xdr") >=
89 output_filename.size(),
"XDR support");
T command_line_next(std::string name, T default_value)
Use GetPot's search()/next() functions to get following arguments from the command line...
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false)=0
Interfaces for reading/writing a mesh to/from a file.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
int main(int argc, char **argv)
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
The libMesh namespace provides an interface to certain functionality in the library.
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
virtual void write(const std::string &name)=0
bool on_command_line(std::string arg)
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.