Description: read a mesh, get the entities.
HelloMOAB is a simple test file which is used to read meshes from VTK file and test how many entities there are.
To run: ./HelloMOAB [meshfile]
(default values can run if users don't specify a mesh file)
#include <iostream>
using namespace std;
#ifndef MESH_DIR
#define MESH_DIR "."
#endif
int main(
int argc,
char** argv )
{
Interface*
mb =
new( std::nothrow ) Core;
if( NULL ==
mb )
return 1;
if( argc > 1 )
{
}
Range verts;
Range edges;
Range faces;
rval =
mb->get_entities_by_dimension( 0, 2, faces );
MB_CHK_ERR( rval );
Range elems;
rval =
mb->get_entities_by_dimension( 0, 3, elems );
MB_CHK_ERR( rval );
cout << "Number of vertices is " << verts.size() << endl;
cout << "Number of edges is " << edges.size() << endl;
cout << "Number of faces is " << faces.size() << endl;
cout << "Number of elements is " << elems.size() << endl;
return 0;
}