MeshKit  1.0
cubit_io.cpp
Go to the documentation of this file.
00001 #include "meshkit/Mesh.hpp"
00002 #include <iomanip>
00003 
00004 #include "meshkit/JaalMoabConverter.hpp"
00005 
00006 using namespace Jaal;
00007 
00008 int MeshImporter ::cubit_file(const string &fname)
00009 {
00010   const char *file_name = fname.c_str();
00011 
00012   int ierr;
00013   iMesh_Instance imesh = 0;
00014   iMesh_newMesh( NULL, &imesh, &ierr, 0 );
00015   if (iBase_SUCCESS != ierr) {
00016     return 0;
00017   }
00018   
00019   iBase_EntitySetHandle root_set;
00020   iMesh_getRootSet( imesh, &root_set, &ierr );
00021   if (iBase_SUCCESS != ierr) {
00022     iMesh_dtor( imesh, &ierr );
00023     return 0;
00024   }
00025   
00026   iMesh_load( imesh, root_set, file_name, 0, &ierr, strlen(file_name), 0 );
00027   if (iBase_SUCCESS != ierr) {
00028     iMesh_dtor( imesh, &ierr );
00029     return 0;
00030   }
00031 
00032   JaalMoabConverter jm;
00033   jm.fromMOAB(imesh, mesh, root_set);
00034 
00035   return 0;
00036 }
00037 
00038 //##############################################################################
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines