SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
chef.cc
Go to the documentation of this file.
1 #include <apf.h>
2 #include <apfMesh.h>
3 #include <gmi_mesh.h>
4 #include <PCU.h>
5 #include <lionPrint.h>
6 #include <pumi_version.h>
7 #ifdef HAVE_SIMMETRIX
8 #include <gmi_sim.h>
9 #include <SimUtil.h>
10 #include <MeshSim.h>
11 #include <SimModel.h>
12 #include <SimPartitionedMesh.h>
13 #ifdef HAVE_SIMADVMESHING
14 #include <SimAdvMeshing.h>
15 #endif
16 #endif
17 #include <pcu_util.h>
18 #include <chef.h>
19 
23 namespace {
24  void freeMesh(apf::Mesh* m) {
25  m->destroyNative();
27  }
28 }
29 
31 int main(int argc, char** argv)
32 {
33  MPI_Init(&argc,&argv);
34  PCU_Comm_Init();
35  PCU_Protect();
36  lion_set_verbosity(1);
37  if( !PCU_Comm_Self() ) {
38  lion_oprint(1,"PUMI Git hash %s\n", pumi_version());
39  lion_oprint(1,"PUMI version %s Git hash %s\n", pumi_version(), pumi_git_sha());
40  }
41 #ifdef HAVE_SIMMETRIX
42  MS_init();
43  SimModel_start();
44  Sim_readLicenseFile(0);
45  SimPartitionedMesh_start(0, 0);
46 #ifdef HAVE_SIMADVMESHING
47  SimAdvMeshing_start();
48 #endif
49  gmi_sim_start();
50  gmi_register_sim();
51 #endif
53  gmi_model* g = 0;
54  apf::Mesh2* m = 0;
55  chef::cook(g,m);
56  freeMesh(m);
57 #ifdef HAVE_SIMMETRIX
58  gmi_sim_stop();
59 #ifdef HAVE_SIMADVMESHING
60  SimAdvMeshing_stop();
61 #endif
62  SimPartitionedMesh_stop();
63  Sim_unregisterAllKeys();
64  SimModel_stop();
65  MS_exit();
66 #endif
67  PCU_Comm_Free();
68  MPI_Finalize();
69 }
70 
The APF Field interface.
int main(int argc, char **argv)
run the operations requested in &quot;adapt.inp&quot;
Definition: chef.cc:31
The Chef interface.
void destroyMesh(Mesh *m)
Destroys an apf::Mesh.
the basic structure for all GMI models
Definition: gmi.h:112
Interface to a mesh part.
Definition: apfMesh.h:103
GMI meshmodel interface.
virtual void destroyNative()=0
actually destroy the underlying mesh data structure
int PCU_Comm_Free(void)
Frees all PCU library structures.
Definition: pcu.c:77
int PCU_Comm_Init(void)
Initializes the PCU library.
Definition: pcu.c:58
Extended mesh interface for modification.
Definition: apfMesh2.h:29
The APF Mesh interface.
int PCU_Comm_Self(void)
Returns the communication rank of the calling thread.
Definition: pcu.c:98
void gmi_register_mesh(void)
register the meshmodel reader for .dmg files