13 FILE *fp =
Fopen(name.c_str(),
"w");
15 Msg::Error(
"Unable to open file '%s'", name.c_str());
23 if(saveAll || (*it)->physicals.size()) num2D += (*it)->getNumMeshElements();
25 if(saveAll || (*it)->physicals.size()) num3D += (*it)->getNumMeshElements();
29 fprintf(fp,
"%d %d %d\n", numVertices, num2D, num3D);
31 fprintf(fp,
"%d %d\n", numVertices, num2D ? num2D : num3D);
33 std::vector<GEntity *> entities;
36 for(std::size_t i = 0; i < entities.size(); i++)
37 for(std::size_t j = 0; j < entities[i]->mesh_vertices.size(); j++)
38 if(entities[i]->mesh_vertices[j]->getIndex() >= 0)
39 fprintf(fp,
"%ld %.16g %.16g %.16g\n",
40 entities[i]->mesh_vertices[j]->getIndex(),
41 entities[i]->mesh_vertices[j]->x() * scalingFactor,
42 entities[i]->mesh_vertices[j]->y() * scalingFactor,
43 entities[i]->mesh_vertices[j]->
z() * scalingFactor);
47 int numPhys = (*it)->physicals.size();
48 if(saveAll || numPhys)
49 for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++)
50 (*it)->getMeshElement(i)->writeIR3(fp, elementTagType, iElement++,
52 numPhys ? (*it)->physicals[0] : 0);
57 int numPhys = (*it)->physicals.size();
58 if(saveAll || numPhys)
59 for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++)
60 (*it)->getMeshElement(i)->writeIR3(fp, elementTagType, iElement++,
62 numPhys ? (*it)->physicals[0] : 0);