}
MEDFileCMeshL2 loaderl2;
loaderl2.loadAll(fid,mid,mName,dt,it);
- setAxType(loaderl2.getAxType());
+ setAxType(axType);
MEDCouplingCMesh *mesh=loaderl2.getMesh();
mesh->incrRef();
_cmesh=mesh;
MEDLoaderBase::safeStrCpy2(c.c_str(),MED_SNAME_SIZE-1,comp+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
- // MED_CARTESIAN and not MEDFileMeshL2::TraduceAxisTypeRev(getAxType()) ! Yes it is not a bug. The discrimination is done in MEDmeshGridTypeWr.
- MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MED_CARTESIAN,comp,unit));
+ MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxType()),comp,unit));
if(_univ_wr_status)
MEDFILESAFECALLERWR0(MEDmeshUniversalNameWr,(fid,maa));
MEDFILESAFECALLERWR0(MEDmeshGridTypeWr,(fid,maa,MEDFileMeshL2::TraduceAxisTypeRevStruct(getAxType())));
int naxis(MEDmeshnAxis(fid,i+1));
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
- MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,i+1,nommaa,&spaceDim,&dim,&type_maillage,maillage_description,dtunit,&stype,&nstep,&axistype,axisname,axisunit));
-
+ MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,i+1,nommaa,&spaceDim,&dim,&type_maillage,maillage_description,dtunit,&stype,&nstep,&axistype,axisname,axisunit));
dtunit1=MEDLoaderBase::buildStringFromFortran(dtunit,sizeof(dtunit));
std::string cur=MEDLoaderBase::buildStringFromFortran(nommaa,sizeof(nommaa));
ms.push_back(cur);
return MED_CARTESIAN_GRID;
case AX_CYL:
return MED_POLAR_GRID;
+ case AX_SPHER:
+ return MED_POLAR_GRID;
default:
- throw INTERP_KERNEL::Exception("MEDFileMeshL2::TraduceAxisTypeRevStruct : only Cartesian and Cylindrical supported by MED file !");
+ throw INTERP_KERNEL::Exception("MEDFileMeshL2::TraduceAxisTypeRevStruct : unrecognized axis type !");
}
}
#
ms=MEDFileMeshes() ; ms.pushMesh(mm)
fields=MEDFileFields() ; fields.pushField(fmts)
- #ms.write(fname,2) ; fields.write(fname,0)
- # WARNING for the moment we do not reread fname ! It is not a hidden bug it is just to wait EF control. Coming soon.
+ ms.write(fname,2) ; fields.write(fname,0)
+ #
+ del mm,fmts,fields,ms
+ ms=MEDFileMeshes(fname)
+ fields=MEDFileFields(fname,False)
ms.cartesianizeMe()
#
fields.removeFieldsWithoutAnyTimeStep()
self.assertTrue(v.isEqual(DataArrayDouble([0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3]),1e-14))
pass
pass
-
+
def test38(self):
""" Introduction of non cartesian meshes management. Here spherical."""
fname="ForMEDReader38.med"
#
ms=MEDFileMeshes() ; ms.pushMesh(mm)
fields=MEDFileFields() ; fields.pushField(fmts)
- #ms.write(fname,2) ; fields.write(fname,0)
- # WARNING for the moment we do not reread fname ! It is not a hidden bug it is just to wait EF control. Coming soon.
+ ms.write(fname,2) ; fields.write(fname,0)
+ #
+ del mm,fmts,fields,ms
+ ms=MEDFileMeshes(fname)
+ fields=MEDFileFields(fname,False)
ms.cartesianizeMe()
#
fields.removeFieldsWithoutAnyTimeStep()
fields=MEDFileFields() ; fields.pushField(fmts)
ms.write(fname,2) ; fields.write(fname,0)
#
+ del mm,fmts,fields,ms
+ ms=MEDFileMeshes(fname)
+ fields=MEDFileFields(fname,False)
+ #
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fields=MEDFileFields(fname,False)
fields.removeFieldsWithoutAnyTimeStep()