#include "moab/Core.hpp"
#include <iostream>
#include <memory>
#include <string>
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
- Examples
- HelloMOAB.cpp.
Definition at line 35 of file HelloMOAB.cpp.
40 auto moab = std::make_unique< Core >();
43 std::cerr <<
"Error: Failed to create MOAB instance\n";
48 const std::string mesh_file =
52 MB_CHK_SET_ERR(
moab->load_mesh( mesh_file.c_str() ),
"Error: Could not load mesh file: " << mesh_file );
55 Range vertices, edges, faces, elements;
62 const auto print_entity_count = [](
const std::string& name,
const auto& range ) {
63 std::cout <<
"Number of " << name <<
": " << range.size() <<
"\n";
66 print_entity_count(
"vertices", vertices );
67 print_entity_count(
"edges ", edges );
68 print_entity_count(
"faces ", faces );
69 print_entity_count(
"elements", elements );
73 catch(
const std::exception& e )
75 std::cerr <<
"Error: " << e.what() <<
"\n";
80 std::cerr <<
"Error: Unknown exception occurred\n";
References anonymous_namespace{HelloMOAB.cpp}::DEFAULT_MESH_FILE, MB_CHK_ERR, MB_CHK_SET_ERR, MBEDGE, MBVERTEX, and MESH_DIR.