]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Tue, 12 Apr 2011 12:11:43 +0000 (12:11 +0000)
committerageay <ageay>
Tue, 12 Apr 2011 12:11:43 +0000 (12:11 +0000)
src/MEDLoader/MEDFileMesh.cxx

index 6a026ac2471e146586b9c206ba769050bbc73faf..954263df4ade5009550d6806f930f125ce7dfd68 100644 (file)
@@ -1634,8 +1634,28 @@ void MEDFileCMesh::write(const char *fileName, int mode) const throw(INTERP_KERN
       const DataArrayDouble *da=_cmesh->getCoordsAt(i);
       MEDmeshGridIndexCoordinateWr(fid,maa,_iteration,_order,_time,i+1,da->getNumberOfTuples(),da->getConstPointer());
     }
+  //
+  med_geometry_type geoTypeReq=MED_NONE;
+  switch(spaceDim)
+    {
+    case 3:
+      geoTypeReq=MED_HEXA8;
+      break;
+    case 2:
+      geoTypeReq=MED_QUAD4;
+      break;
+    case 1:
+      geoTypeReq=MED_SEG2;
+      break;
+    case 0:
+      geoTypeReq=MED_POINT1;
+      break;
+    default:
+      throw INTERP_KERNEL::Exception("Invalid spacedim detected for cartesian mesh ! Must be in (1,2,3) !");
+    }
+  //
   if((const DataArrayInt *)_fam_cells)
-    MEDmeshEntityFamilyNumberWr(fid,maa,_iteration,_order,MED_CELL,MED_GEO_ALL,_fam_cells->getNumberOfTuples(),_fam_cells->getConstPointer());
+    MEDmeshEntityFamilyNumberWr(fid,maa,_iteration,_order,MED_CELL,geoTypeReq,_fam_cells->getNumberOfTuples(),_fam_cells->getConstPointer());
   if((const DataArrayInt *)_fam_nodes)
     MEDmeshEntityFamilyNumberWr(fid,maa,_iteration,_order,MED_NODE,MED_NONE,_fam_nodes->getNumberOfTuples(),_fam_nodes->getConstPointer());
   //