@@ -49,8 +49,7 @@ void visualizeEdges(gmi_model* model, int n, const char* fileName, pcu::PCU *PCU
4949int main (int argc, char ** argv)
5050{
5151 MPI_Init (&argc, &argv);
52- {
53- pcu::PCU PCUObj = pcu::PCU (MPI_COMM_WORLD);
52+ pcu::PCU *PCUObj = new pcu::PCU (MPI_COMM_WORLD);
5453
5554 gmi_register_mesh ();
5655 gmi_register_null ();
@@ -118,7 +117,7 @@ int main(int argc, char** argv)
118117 gmi_register_cap ();
119118
120119
121- apf::Mesh2* mesh0 = apf::createMesh (m,g,& PCUObj);
120+ apf::Mesh2* mesh0 = apf::createMesh (m,g,PCUObj);
122121 apf::writeVtkFiles (" mesh_no_param" , mesh0);
123122
124123 gmi_model* model = gmi_import_cap (g);
@@ -139,15 +138,15 @@ int main(int argc, char** argv)
139138 while ( (ge = gmi_next (model, gi)) ){
140139 std::stringstream name_str;
141140 name_str << " face_" << gmi_tag (model, ge) << " _mesh" ;
142- visualizeFace (model, ge, 100 , 100 , name_str.str ().c_str (), & PCUObj);
141+ visualizeFace (model, ge, 100 , 100 , name_str.str ().c_str (), PCUObj);
143142 }
144143 gmi_end (model, gi);
145144
146145 printf (" ------------------------\n " );
147146 printf (" creating mesh with param field\n " );
148147
149148
150- apf::Mesh2* mesh = apf::createMesh (m,g,& PCUObj);
149+ apf::Mesh2* mesh = apf::createMesh (m,g,PCUObj);
151150 apf::Field* pf = apf::createFieldOn (mesh, " param_field" , apf::VECTOR);
152151 apf::Field* idf = apf::createFieldOn (mesh, " id" , apf::SCALAR);
153152 apf::MeshEntity* e;
@@ -165,7 +164,7 @@ int main(int argc, char** argv)
165164
166165 gmi_cap_stop ();
167166
168- }
167+ delete PCUObj;
169168 MPI_Finalize ();
170169}
171170
@@ -273,7 +272,7 @@ void visualizeFace(gmi_model* model, gmi_ent* entity, int n, int m, const char*
273272
274273 // make the vertexes and set the coordinates using the array
275274 std::vector<ma::Entity*> vs;
276- apf::Mesh2* mesh = apf::makeEmptyMdsMesh (gmi_load (" .null" ), 2 , false , & PCUObj);
275+ apf::Mesh2* mesh = apf::makeEmptyMdsMesh (gmi_load (" .null" ), 2 , false , PCUObj);
277276 for (size_t i = 0 ; i < ps.size (); i++) {
278277 ma::Entity* vert = mesh->createVert (0 );
279278 mesh->setPoint (vert, 0 , ps[i]);
0 commit comments