+ MCAuto<MEDFileAnyTypeField1TS> f(MEDFileAnyTypeField1TS::New(fileName,fieldName,iteration,order));
+ {
+ MCAuto<MEDFileField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileField1TS>(f));
+ if(f1.isNotNull())
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(ReadFieldNodeT<double>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ return ret.retn();
+ }
+ }
+ {
+ MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
+ if(f1.isNotNull())
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(ReadFieldNodeT<int>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ return ret.retn();
+ }
+ }
+ {
+ MCAuto<MEDFileFloatField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileFloatField1TS>(f));
+ if(f1.isNotNull())
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldFloat> ret(ReadFieldNodeT<float>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ return ret.retn();
+ }
+ }
+ throw INTERP_KERNEL::Exception("MEDCoupling::ReadFieldNode : only FLOAT32, FLOAT64 and INT32 supported for the moment !");
+}
+
+MEDCoupling::MEDCouplingField *MEDCoupling::ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+{
+ return ReadFieldCellLike(ON_GAUSS_PT,fileName,meshName,meshDimRelToMax,fieldName,iteration,order);
+}
+
+MEDCoupling::MEDCouplingField *MEDCoupling::ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+{
+ return ReadFieldCellLike(ON_GAUSS_NE,fileName,meshName,meshDimRelToMax,fieldName,iteration,order);
+}
+
+void MEDCoupling::WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch)
+{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("WriteMesh : input mesh is null !");
+ const MEDCouplingUMesh *um(dynamic_cast<const MEDCouplingUMesh *>(mesh));
+ if(um)
+ {
+ WriteUMesh(fileName,um,writeFromScratch);
+ return ;
+ }
+ int mod=writeFromScratch?2:0;
+ const MEDCoupling1GTUMesh *um2(dynamic_cast<const MEDCoupling1GTUMesh *>(mesh));
+ if(um2)
+ {
+ MCAuto<MEDFileUMesh> mmu(MEDFileUMesh::New());
+ AssignStaticWritePropertiesTo(*mmu);
+ mmu->setMeshAtLevel(0,const_cast<MEDCoupling1GTUMesh *>(um2));
+ mmu->write(fileName,mod);
+ return ;
+ }
+ const MEDCouplingCMesh *um3(dynamic_cast<const MEDCouplingCMesh *>(mesh));
+ if(um3)
+ {
+ MCAuto<MEDFileCMesh> mmc(MEDFileCMesh::New());
+ AssignStaticWritePropertiesTo(*mmc);
+ mmc->setMesh(const_cast<MEDCouplingCMesh *>(um3));
+ mmc->write(fileName,mod);
+ return ;
+ }
+ const MEDCouplingCurveLinearMesh *um4(dynamic_cast<const MEDCouplingCurveLinearMesh *>(mesh));
+ if(um4)