Go to the documentation of this file.00001 #include <apf.h>
00002 #include <apfMesh.h>
00003 #include <gmi_mesh.h>
00004 #include <PCU.h>
00005 #include <pumi_version.h>
00006 #ifdef HAVE_SIMMETRIX
00007 #include <gmi_sim.h>
00008 #include <SimUtil.h>
00009 #include <MeshSim.h>
00010 #include <SimModel.h>
00011 #include <SimPartitionedMesh.h>
00012 #ifdef HAVE_SIMADVMESHING
00013 #include <SimAdvMeshing.h>
00014 #endif
00015 #endif
00016 #include <pcu_util.h>
00017 #include <chef.h>
00018
00022 namespace {
00023 void freeMesh(apf::Mesh* m) {
00024 m->destroyNative();
00025 apf::destroyMesh(m);
00026 }
00027 }
00028
00030 int main(int argc, char** argv)
00031 {
00032 MPI_Init(&argc,&argv);
00033 PCU_Comm_Init();
00034 PCU_Protect();
00035 if( !PCU_Comm_Self() )
00036 printf("PUMI Git hash %s\n", pumi_version());
00037 #ifdef HAVE_SIMMETRIX
00038 MS_init();
00039 SimModel_start();
00040 Sim_readLicenseFile(0);
00041 SimPartitionedMesh_start(0, 0);
00042 #ifdef HAVE_SIMADVMESHING
00043 SimAdvMeshing_start();
00044 #endif
00045 gmi_sim_start();
00046 gmi_register_sim();
00047 #endif
00048 gmi_register_mesh();
00049 gmi_model* g = 0;
00050 apf::Mesh2* m = 0;
00051 chef::cook(g,m);
00052 freeMesh(m);
00053 #ifdef HAVE_SIMMETRIX
00054 gmi_sim_stop();
00055 #ifdef HAVE_SIMADVMESHING
00056 SimAdvMeshing_stop();
00057 #endif
00058 SimPartitionedMesh_stop();
00059 Sim_unregisterAllKeys();
00060 SimModel_stop();
00061 MS_exit();
00062 #endif
00063 PCU_Comm_Free();
00064 MPI_Finalize();
00065 }
00066