MeshKit  1.0
example_jaalquad.cpp
Go to the documentation of this file.
00001 
00016 #include "meshkit/MKCore.hpp"
00017 #include "meshkit/ModelEnt.hpp"
00018 #include "meshkit/MeshOp.hpp"
00019 #include "meshkit/iGeom.hpp"
00020 #include "meshkit/iMesh.hpp"
00021 #include "meshkit/Matrix.hpp"
00022 #include "meshkit/SizingFunction.hpp"
00023 #include "meshkit/QuadMesh.hpp"
00024 
00025 #ifdef HAVE_ACIS
00026 #define TEST_QUADFACE "quadface.sat"
00027 #elif defined(HAVE_OCC)
00028 #define TEST_QUADFACE "quadface.stp"
00029 #endif
00030 
00031 using namespace MeshKit;
00032 
00033 MKCore* core = 0;
00034 int main()
00035 {
00036     core = new MKCore(); // Start up MK
00037     moab::Interface* moab = core->moab_instance();
00038     std::string filename = (std::string) MESH_DIR + "/" + TEST_QUADFACE;
00039     core->load_geometry(filename.c_str());
00040     core->populate_model_ents(0, -1, -1);
00041 
00042     // get the tris
00043     MEntVector tris, dum;
00044     core->get_entities_by_dimension(2, dum);
00045     tris.push_back(*dum.rbegin());
00046 
00047     // run tri to quad mesher
00048     (MeshKit::QuadMesher*) core->construct_meshop( "QuadMesher", tris );
00049     double size = 1.1;
00050     SizingFunction esize(core, -1, size);
00051     tris[0]->sizing_function_index(esize.core_index());
00052 
00053     core->setup_and_execute();
00054 
00055     // removing tri's
00056     moab::Range tri;
00057     moab->get_entities_by_type( 0, moab::MBTRI, tri );
00058     if(tri.size() != 0)
00059         moab->delete_entities(tri);
00060 
00061     core->save_mesh("jaalquad.vtk");
00062     return 0;
00063 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines