7 #include "GmshConfig.h"
31 #if(MED_MAJOR_NUM >= 3)
36 #define med_geometrie_element med_geometry_type
37 #define med_maillage med_mesh_type
38 #define MED_TAILLE_NOM MED_NAME_SIZE
39 #define MED_TAILLE_LNOM MED_LNAME_SIZE
40 #define MED_TAILLE_DESC MED_COMMENT_SIZE
41 #define MED_NON_STRUCTURE MED_UNSTRUCTURED_MESH
42 #define MED_LECTURE MED_ACC_RDONLY
43 #define MED_CREATION MED_ACC_CREAT
44 #define MEDouvrir MEDfileOpen
45 #define MEDversionDonner MEDlibraryNumVersion
46 #define MEDversionLire MEDfileNumVersionRd
47 #define MEDnMaa MEDnMesh
48 #define MEDfermer MEDfileClose
49 #define MEDnFam MEDnFamily
50 #define MEDfichDesEcr MEDfileCommentWr
53 med_geometrie_element msh2medElementType(
int msh)
66 case MSH_PNT:
return MED_POINT1;
70 #if(MED_MAJOR_NUM >= 4)
74 #if(MED_MAJOR_NUM >= 3)
78 default:
return MED_NONE;
82 int med2mshElementType(med_geometrie_element med)
95 case MED_POINT1:
return MSH_PNT;
99 #if(MED_MAJOR_NUM >= 4)
103 #if(MED_MAJOR_NUM >= 3)
111 int msh2medNodeIndex(
int msh,
int k)
113 med_geometrie_element med = msh2medElementType(msh);
122 #if(MED_MAJOR_NUM >= 3)
127 static const int map[4] = {0, 2, 1, 3};
131 static const int map[10] = {0, 2, 1, 3, 6, 5, 4, 7, 8, 9};
135 static const int map[8] = {0, 3, 2, 1, 4, 7, 6, 5};
139 static const int map[20] = {0, 3, 2, 1, 4, 7, 6, 5, 9, 13,
140 11, 8, 17, 19, 18, 16, 10, 15, 14, 12};
144 #if(MED_MAJOR_NUM >= 3)
146 static const int map[27] = {0, 3, 2, 1, 4, 7, 6, 5, 9,
147 13, 11, 8, 17, 19, 18, 16, 10, 15,
148 14, 12, 20, 22, 24, 23, 21, 25, 26};
153 static const int map[6] = {0, 2, 1, 3, 5, 4};
157 static const int map[15] = {0, 2, 1, 3, 5, 4, 7, 9,
158 6, 13, 14, 12, 8, 11, 10};
161 #if(MED_MAJOR_NUM >= 4)
163 static const int map[18] = {0, 2, 1, 3, 5, 4, 7, 9, 6,
164 13, 14, 12, 8, 11, 10, 16, 17, 15};
169 static const int map[5] = {0, 3, 2, 1, 4};
173 static const int map[13] = {0, 3, 2, 1, 4, 6, 10, 8, 5, 7, 12, 11, 9};
176 default:
Msg::Error(
"Unknown MED element type");
return k;
180 int med2mshNodeIndex(med_geometrie_element med,
int k)
190 #if(MED_MAJOR_NUM >= 3)
199 return msh2medNodeIndex(med2mshElementType(med), k);
201 static const int map[20] = {0, 3, 2, 1, 4, 7, 6, 5, 11, 8,
202 16, 10, 19, 9, 18, 17, 15, 12, 14, 13};
205 #if(MED_MAJOR_NUM >= 3)
207 static const int map[27] = {0, 3, 2, 1, 4, 7, 6, 5, 11,
208 8, 16, 10, 19, 9, 18, 17, 15, 12,
209 14, 13, 20, 24, 21, 23, 22, 25, 26};
214 static const int map[15] = {0, 2, 1, 3, 5, 4, 8, 6,
215 12, 7, 14, 13, 11, 9, 10};
218 #if(MED_MAJOR_NUM >= 4)
220 static const int map[18] = {0, 2, 1, 3, 5, 4, 8, 6, 12,
221 7, 14, 13, 11, 9, 10, 17, 15, 16};
226 static const int map[13] = {0, 3, 2, 1, 4, 8, 5, 9, 7, 12, 6, 11, 10};
229 default:
Msg::Error(
"Unknown MED element type");
return k;
235 med_idt fid = MEDouvrir((
char *)name.c_str(), MED_LECTURE);
237 Msg::Error(
"Unable to open file '%s'", name.c_str());
242 MEDversionDonner(&v[0], &v[1], &v[2]);
243 MEDversionLire(fid, &vf[0], &vf[1], &vf[2]);
244 Msg::Info(
"Reading MED file V%d.%d.%d using MED library V%d.%d.%d", vf[0],
245 vf[1], vf[2], v[0], v[1], v[2]);
246 if(vf[0] < 2 || (vf[0] == 2 && vf[1] < 2)) {
247 Msg::Error(
"Cannot read MED file older than V2.2");
251 std::vector<std::string> meshNames;
252 for(
int i = 0; i < MEDnMaa(fid); i++) {
253 char meshName[MED_TAILLE_NOM + 1], meshDesc[MED_TAILLE_DESC + 1];
255 med_maillage meshType;
256 #if(MED_MAJOR_NUM >= 3)
257 med_int meshDim, nStep;
258 char dtUnit[MED_SNAME_SIZE + 1];
259 char axisName[3 * MED_SNAME_SIZE + 1], axisUnit[3 * MED_SNAME_SIZE + 1];
260 med_sorting_type sortingType;
261 med_axis_type axisType;
262 if(MEDmeshInfo(fid, i + 1, meshName, &spaceDim, &meshDim, &meshType,
263 meshDesc, dtUnit, &sortingType, &nStep, &axisType, axisName,
266 if(MEDmaaInfo(fid, i + 1, meshName, &spaceDim, &meshType, meshDesc) < 0) {
268 Msg::Error(
"Unable to read mesh information");
271 meshNames.push_back(meshName);
274 if(MEDfermer(fid) < 0) {
275 Msg::Error(
"Unable to close file '%s'", name.c_str());
280 for(std::size_t i = 0; i < meshNames.size(); i++) {
285 if(!m) m =
new GModel(meshNames[i]);
294 med_idt fid = MEDouvrir((
char *)name.c_str(), MED_LECTURE);
296 Msg::Error(
"Unable to open file '%s'", name.c_str());
300 int numMeshes = MEDnMaa(fid);
301 if(meshIndex >= numMeshes) {
302 Msg::Info(
"Could not find mesh %d in MED file", meshIndex);
310 char meshName[MED_TAILLE_NOM + 1], meshDesc[MED_TAILLE_DESC + 1];
311 med_int spaceDim, nStep = 1;
312 med_maillage meshType;
313 #if(MED_MAJOR_NUM >= 3)
315 char dtUnit[MED_SNAME_SIZE + 1];
316 char axisName[3 * MED_SNAME_SIZE + 1], axisUnit[3 * MED_SNAME_SIZE + 1];
317 med_sorting_type sortingType;
318 med_axis_type axisType;
319 if(MEDmeshInfo(fid, meshIndex + 1, meshName, &spaceDim, &meshDim, &meshType,
320 meshDesc, dtUnit, &sortingType, &nStep, &axisType, axisName,
323 if(MEDmaaInfo(fid, meshIndex + 1, meshName, &spaceDim, &meshType, meshDesc) <
326 Msg::Error(
"Unable to read mesh information");
335 Msg::Warning(
"Discarding %d last meshes in multi-step MED mesh", nStep - 1);
339 if(meshType == MED_NON_STRUCTURE) {
340 Msg::Info(
"Reading %d-D unstructured mesh '%s'", spaceDim, meshName);
343 Msg::Error(
"Reading structured MED meshes is not supported");
347 MEDversionLire(fid, &vf[0], &vf[1], &vf[2]);
350 #if(MED_MAJOR_NUM >= 3)
351 med_bool changeOfCoord, geoTransform;
352 med_int numNodes = MEDmeshnEntity(
353 fid, meshName, MED_NO_DT, MED_NO_IT, MED_NODE, MED_NO_GEOTYPE,
354 MED_COORDINATE, MED_NO_CMODE, &changeOfCoord, &geoTransform);
357 MEDnEntMaa(fid, meshName, MED_COOR, MED_NOEUD, MED_NONE, MED_NOD);
360 Msg::Error(
"Could not read number of MED nodes");
367 std::vector<MVertex *> verts(numNodes);
368 std::vector<med_float> coord(spaceDim * numNodes);
369 #if(MED_MAJOR_NUM >= 3)
370 if(MEDmeshNodeCoordinateRd(fid, meshName, MED_NO_DT, MED_NO_IT,
371 MED_FULL_INTERLACE, &coord[0]) < 0) {
373 std::vector<char> coordName(spaceDim * MED_TAILLE_PNOM + 1);
374 std::vector<char> coordUnit(spaceDim * MED_TAILLE_PNOM + 1);
376 if(MEDcoordLire(fid, meshName, spaceDim, &coord[0], MED_FULL_INTERLACE,
377 MED_ALL, 0, 0, &rep, &coordName[0], &coordUnit[0]) < 0) {
379 Msg::Error(
"Could not read MED node coordinates");
383 std::vector<med_int> nodeTags(numNodes);
384 #if(MED_MAJOR_NUM >= 3)
385 if(MEDmeshEntityNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT, MED_NODE,
386 MED_NO_GEOTYPE, &nodeTags[0]) < 0)
388 if(MEDnumLire(fid, meshName, &nodeTags[0], numNodes, MED_NOEUD, MED_NONE) < 0)
392 for(
int i = 0; i < numNodes; i++)
393 verts[i] =
new MVertex(coord[spaceDim * i],
394 (spaceDim > 1) ? coord[spaceDim * i + 1] : 0.,
395 (spaceDim > 2) ? coord[spaceDim * i + 2] : 0.,
396 nullptr, nodeTags.empty() ? 0 : nodeTags[i]);
398 std::vector<med_int> nodeFamily(numNodes, 0);
399 #if(MED_MAJOR_NUM >= 3)
400 MEDmeshEntityFamilyNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT, MED_NODE,
401 MED_NONE, &nodeFamily[0]);
403 MEDfamLire(fid, meshName, &nodeFamily[0], numEle, MED_NOEUD, MED_NONE);
407 for(
int mshType = 0; mshType <
MSH_MAX_NUM + 1; mshType++) {
408 med_geometrie_element type = msh2medElementType(mshType);
409 if(type == MED_NONE)
continue;
410 #if(MED_MAJOR_NUM >= 3)
411 med_bool changeOfCoord;
412 med_bool geoTransform;
413 med_int numEle = MEDmeshnEntity(fid, meshName, MED_NO_DT, MED_NO_IT,
414 MED_CELL, type, MED_CONNECTIVITY, MED_NODAL,
415 &changeOfCoord, &geoTransform);
418 MEDnEntMaa(fid, meshName, MED_CONN, MED_MAILLE, type, MED_NOD);
420 if(numEle <= 0)
continue;
421 int numNodPerEle = type % 100;
422 std::vector<med_int>
conn(numEle * numNodPerEle);
423 #if(MED_MAJOR_NUM >= 3)
424 if(MEDmeshElementConnectivityRd(fid, meshName, MED_NO_DT, MED_NO_IT,
425 MED_CELL, type, MED_NODAL,
426 MED_FULL_INTERLACE, &
conn[0]) < 0) {
428 if(MEDconnLire(fid, meshName, spaceDim, &
conn[0], MED_FULL_INTERLACE, 0,
429 MED_ALL, MED_MAILLE, type, MED_NOD) < 0) {
434 std::vector<med_int> elementFamily(numEle, 0);
435 #if(MED_MAJOR_NUM >= 3)
436 if(MEDmeshEntityFamilyNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT,
437 MED_CELL, type, &elementFamily[0]) < 0) {
439 if(MEDfamLire(fid, meshName, &elementFamily[0], numEle, MED_MAILLE, type) <
443 "No family number for elements: using 0 as default family number");
445 std::vector<med_int> eleTags(numEle);
446 #if(MED_MAJOR_NUM >= 3)
447 if(MEDmeshEntityNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT, MED_CELL,
448 type, &eleTags[0]) < 0)
450 if(MEDnumLire(fid, meshName, &eleTags[0], numEle, MED_MAILLE, type) < 0)
453 std::map<int, std::vector<MElement *> > elements;
455 for(
int j = 0; j < numEle; j++) {
456 std::vector<MVertex *> v(numNodPerEle);
458 for(
int k = 0; k < numNodPerEle; k++) {
459 int idx =
conn[numNodPerEle * j + med2mshNodeIndex(type, k)] - 1;
460 if(idx < 0 || idx > (
int)verts.size() - 1) {
461 Msg::Error(
"Wrong node index %d in MED file", idx);
470 factory.
create(mshType, v, eleTags.empty() ? 0 : eleTags[j]);
475 if(e) elements[std::abs(elementFamily[j])].push_back(e);
484 med_int numFamilies = MEDnFam(fid, meshName);
485 if(numFamilies < 0) {
489 for(
int i = 0; i < numFamilies; i++) {
490 #if(MED_MAJOR_NUM >= 3)
492 (vf[0] == 2) ? MEDnFamily23Attribute(fid, meshName, i + 1) : 0;
493 med_int numGroups = MEDnFamilyGroup(fid, meshName, i + 1);
495 med_int numAttrib = MEDnAttribut(fid, meshName, i + 1);
496 med_int numGroups = MEDnGroupe(fid, meshName, i + 1);
498 if(numAttrib < 0 || numGroups < 0) {
499 Msg::Error(
"Could not read MED groups or attributes");
502 std::vector<med_int> attribId(numAttrib + 1);
503 std::vector<med_int> attribVal(numAttrib + 1);
504 std::vector<char> attribDes(MED_TAILLE_DESC * numAttrib + 1);
505 std::vector<char> groupNames(MED_TAILLE_LNOM * numGroups + 1);
506 char familyName[MED_TAILLE_NOM + 1];
508 #if(MED_MAJOR_NUM >= 3)
510 if(MEDfamily23Info(fid, meshName, i + 1, familyName, &attribId[0],
511 &attribVal[0], &attribDes[0], &familyNum,
512 &groupNames[0]) < 0) {
513 Msg::Error(
"Could not read info for MED2 family %d", i + 1);
518 if(MEDfamilyInfo(fid, meshName, i + 1, familyName, &familyNum,
519 &groupNames[0]) < 0) {
520 Msg::Error(
"Could not read info for MED3 family %d", i + 1);
525 if(MEDfamInfo(fid, meshName, i + 1, familyName, &familyNum, &attribId[0],
526 &attribVal[0], &attribDes[0], &numAttrib, &groupNames[0],
528 Msg::Error(
"Could not read info for MED family %d", i + 1);
541 for(
int j = 0; j < numGroups; j++) {
542 char tmp[MED_TAILLE_LNOM + 1];
543 strncpy(tmp, &groupNames[j * MED_TAILLE_LNOM], MED_TAILLE_LNOM);
544 tmp[MED_TAILLE_LNOM] =
'\0';
561 std::vector<GVertex *> newPoints;
562 for(
int j = 0; j < numNodes; j++) {
563 if(nodeFamily[j] == familyNum) {
566 verts[j]->x(), verts[j]->y(), verts[j]->
z());
568 if(!verts[j]->onWhat()) {
569 verts[j]->setEntity(gv);
574 newPoints.push_back(gv);
578 for(
int j = 0; j < numGroups; j++) {
579 char tmp[MED_TAILLE_LNOM + 1];
580 strncpy(tmp, &groupNames[j * MED_TAILLE_LNOM], MED_TAILLE_LNOM);
581 tmp[MED_TAILLE_LNOM] =
'\0';
585 for(std::size_t k = 0; k < newPoints.size(); k++)
586 newPoints[k]->physicals.push_back(pnum);
593 #if(MED_MAJOR_NUM >= 3)
594 bool postpro = (MEDnField(fid) > 0) ?
true :
false;
596 bool postpro = (MEDnChamp(fid, 0) > 0) ?
true :
false;
599 if(MEDfermer(fid) < 0) {
600 Msg::Error(
"Unable to close file '%s'", name.c_str());
604 return postpro ? 2 : 1;
609 fillElementsMED(med_int family, std::vector<T *> &elements,
610 std::vector<med_int> &
conn, std::vector<med_int> &fam,
611 std::vector<med_int> &
tags, med_geometrie_element &type)
613 if(elements.empty())
return;
614 int msh = elements[0]->getTypeForMSH();
615 type = msh2medElementType(msh);
616 if(type == MED_NONE) {
620 for(std::size_t i = 0; i < elements.size(); i++) {
621 elements[i]->setVolumePositive();
622 for(std::size_t j = 0; j < elements[i]->getNumVertices(); j++)
624 elements[i]->getVertex(msh2medNodeIndex(msh, j))->getIndex());
625 fam.push_back(family);
626 tags.push_back(elements[i]->getNum());
630 static void writeElementsMED(med_idt &fid,
const char *meshName,
631 std::vector<med_int> &
conn,
632 std::vector<med_int> &fam,
633 std::vector<med_int> &
tags,
634 med_geometrie_element type)
636 if(fam.empty())
return;
637 #if(MED_MAJOR_NUM >= 3)
638 if(MEDmeshElementWr(fid, meshName, MED_NO_DT, MED_NO_IT, 0., MED_CELL, type,
639 MED_NODAL, MED_FULL_INTERLACE, (med_int)fam.size(),
640 &
conn[0], MED_FALSE,
nullptr, MED_TRUE, &
tags[0],
641 MED_TRUE, &fam[0]) < 0)
643 if(MEDelementsEcr(fid, meshName, (med_int)3, &
conn[0], MED_FULL_INTERLACE, 0,
644 MED_FAUX, &
tags[0], MED_VRAI, &fam[0], (med_int)fam.size(),
645 MED_MAILLE, type, MED_NOD) < 0)
651 double scalingFactor)
653 #if (MED_MAJOR_NUM >= 4) || ((MED_MAJOR_NUM >= 3) && (MED_MINOR_NUM >= 3))
655 med_int major = MED_MAJOR_NUM, minor = MED_MINOR_NUM,
656 release = MED_RELEASE_NUM;
659 Msg::Info(
"Forcing MED file version to %d.%d", major, minor);
661 med_idt fid = MEDfileVersionOpen((
char *)name.c_str(), MED_ACC_CREAT, major,
664 med_idt fid = MEDouvrir((
char *)name.c_str(), MED_CREATION);
667 Msg::Error(
"Unable to open file '%s'", name.c_str());
672 if(MEDfichDesEcr(fid, (
char *)
"MED file generated by Gmsh") < 0) {
677 std::string strMeshName =
getName();
678 if(strMeshName.empty())
679 strMeshName =
"untitled";
680 const char *meshName = (
char *)strMeshName.c_str();
683 #if(MED_MAJOR_NUM >= 3)
684 char dtUnit[MED_SNAME_SIZE + 1] =
"";
685 char axisName[3 * MED_SNAME_SIZE + 1] =
"";
686 char axisUnit[3 * MED_SNAME_SIZE + 1] =
"";
687 if(MEDmeshCr(fid, meshName, 3, 3, MED_UNSTRUCTURED_MESH,
688 "Mesh created with Gmsh", dtUnit, MED_SORT_DTIT, MED_CARTESIAN,
689 axisName, axisUnit) < 0) {
691 if(MEDmaaCr(fid, meshName, 3, MED_NON_STRUCTURE,
692 (
char *)
"Mesh created with Gmsh") < 0) {
708 std::vector<GEntity *> entities;
711 std::map<GEntity *, int> families;
715 #if(MED_MAJOR_NUM >= 3)
716 if(MEDfamilyCr(fid, meshName,
"F_0", 0, 0,
"") < 0)
718 if(MEDfamCr(fid, meshName, (
char *)
"F_0", 0, 0, 0, 0, 0, 0, 0) < 0)
724 for(std::size_t i = 0; i < entities.size(); i++) {
725 if(saveAll || entities[i]->physicals.size()) {
726 int num = -((int)families.size() + 1);
727 families[entities[i]] = num;
728 std::ostringstream fs;
729 fs << entities[i]->dim() <<
"D_" << entities[i]->tag();
730 std::string familyName =
"F_" + fs.str();
731 std::string groupName;
732 for(
unsigned j = 0; j < entities[i]->physicals.size(); j++) {
736 std::ostringstream gs;
737 gs << entities[i]->dim() <<
"D_" << entities[i]->physicals[j];
738 groupName +=
"G_" + gs.str();
744 if(j) groupName.resize((j + 1) * MED_TAILLE_LNOM,
' ');
746 #if(MED_MAJOR_NUM >= 3)
747 if(MEDfamilyCr(fid, meshName, familyName.c_str(), (med_int)num,
748 (med_int)entities[i]->physicals.size(),
749 groupName.c_str()) < 0)
751 if(MEDfamCr(fid, meshName, (
char *)familyName.c_str(), (med_int)num, 0,
752 0, 0, 0, (
char *)groupName.c_str(),
753 (med_int)entities[i]->physicals.size()) < 0)
755 Msg::Error(
"Could not create MED family %d", num);
762 std::vector<med_float> coord;
763 std::vector<med_int> fam;
764 std::vector<med_int>
tags;
765 for(std::size_t i = 0; i < entities.size(); i++) {
766 for(std::size_t j = 0; j < entities[i]->mesh_vertices.size(); j++) {
767 MVertex *v = entities[i]->mesh_vertices[j];
769 coord.push_back(v->
x() * scalingFactor);
770 coord.push_back(v->
y() * scalingFactor);
771 coord.push_back(v->
z() * scalingFactor);
781 #if(MED_MAJOR_NUM >= 3)
782 if(MEDmeshNodeWr(fid, meshName, MED_NO_DT, MED_NO_IT, 0.,
783 MED_FULL_INTERLACE, (med_int)fam.size(), &coord[0],
784 MED_FALSE,
"", MED_TRUE, &
tags[0], MED_TRUE, &fam[0]) < 0)
786 char coordName[3 * MED_TAILLE_PNOM + 1] =
788 char coordUnit[3 * MED_TAILLE_PNOM + 1] =
789 "unknown unknown unknown ";
790 if(MEDnoeudsEcr(fid, meshName, (med_int)3, &coord[0], MED_FULL_INTERLACE,
791 MED_CART, coordName, coordUnit, 0, MED_FAUX, &
tags[0],
792 MED_VRAI, &fam[0], (med_int)fam.size()) < 0)
800 med_geometrie_element typ = MED_NONE;
801 std::vector<med_int>
conn, fam,
tags;
803 if(saveAll || (*it)->physicals.size())
804 fillElementsMED(families[*it], (*it)->points,
conn, fam,
tags, typ);
805 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
808 med_geometrie_element typ = MED_NONE;
809 std::vector<med_int>
conn, fam,
tags;
811 if(saveAll || (*it)->physicals.size())
812 fillElementsMED(families[*it], (*it)->lines,
conn, fam,
tags, typ);
813 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
816 med_geometrie_element typ = MED_NONE;
817 std::vector<med_int>
conn, fam,
tags;
819 if(saveAll || (*it)->physicals.size())
820 fillElementsMED(families[*it], (*it)->triangles,
conn, fam,
tags,
822 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
825 med_geometrie_element typ = MED_NONE;
826 std::vector<med_int>
conn, fam,
tags;
828 if(saveAll || (*it)->physicals.size())
829 fillElementsMED(families[*it], (*it)->quadrangles,
conn, fam,
tags,
831 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
834 med_geometrie_element typ = MED_NONE;
835 std::vector<med_int>
conn, fam,
tags;
837 if(saveAll || (*it)->physicals.size())
838 fillElementsMED(families[*it], (*it)->tetrahedra,
conn, fam,
tags,
840 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
843 med_geometrie_element typ = MED_NONE;
844 std::vector<med_int>
conn, fam,
tags;
846 if(saveAll || (*it)->physicals.size())
847 fillElementsMED(families[*it], (*it)->hexahedra,
conn, fam,
tags,
849 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
852 med_geometrie_element typ = MED_NONE;
853 std::vector<med_int>
conn, fam,
tags;
855 if(saveAll || (*it)->physicals.size())
856 fillElementsMED(families[*it], (*it)->prisms,
conn, fam,
tags, typ);
857 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
860 med_geometrie_element typ = MED_NONE;
861 std::vector<med_int>
conn, fam,
tags;
863 if(saveAll || (*it)->physicals.size())
864 fillElementsMED(families[*it], (*it)->pyramids,
conn, fam,
tags, typ);
865 writeElementsMED(fid, meshName,
conn, fam,
tags, typ);
869 if(MEDfermer(fid) < 0) {
870 Msg::Error(
"Unable to close file '%s'", name.c_str());
881 Msg::Error(
"Gmsh must be compiled with MED support to read '%s'",
888 Msg::Error(
"Gmsh must be compiled with MED support to read '%s'",
894 double scalingFactor)
896 Msg::Error(
"Gmsh must be compiled with MED support to write '%s'",