#include "moab/Core.hpp"
#include <iostream>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ MESH_DIR
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
- Examples
- HelloMOAB.cpp.
Definition at line 23 of file HelloMOAB.cpp.
24 {
25
26 Interface* mb = new( std::nothrow ) Core;
27 if( NULL == mb ) return 1;
28
29
30 if( argc > 1 )
31 {
32
33 test_file_name = argv[1];
34 }
35
36
37 ErrorCode rval = mb->load_mesh( test_file_name.c_str() );MB_CHK_ERR( rval );
38
39
40 Range verts;
41 rval = mb->get_entities_by_type( 0, MBVERTEX, verts );MB_CHK_ERR( rval );
42
43
44 Range edges;
45 rval = mb->get_entities_by_type( 0, MBEDGE, edges );MB_CHK_ERR( rval );
46
47
48 Range faces;
49 rval = mb->get_entities_by_dimension( 0, 2, faces );MB_CHK_ERR( rval );
50
51
52 Range elems;
53 rval = mb->get_entities_by_dimension( 0, 3, elems );MB_CHK_ERR( rval );
54
55
56 cout << "Number of vertices is " << verts.size() << endl;
57 cout << "Number of edges is " << edges.size() << endl;
58 cout << "Number of faces is " << faces.size() << endl;
59 cout << "Number of elements is " << elems.size() << endl;
60
61 delete mb;
62
63 return 0;
64 }
References ErrorCode, moab::Core::get_entities_by_dimension(), moab::Core::get_entities_by_type(), moab::Core::load_mesh(), mb, MB_CHK_ERR, MBEDGE, MBVERTEX, moab::Range::size(), and test_file_name.
◆ test_file_name
string test_file_name = string( MESH_DIR ) + string( "/3k-tri-sphere.vtk" ) |