-// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDLoaderTypemaps.i"
#include "SauvReader.hxx"
#include "SauvWriter.hxx"
+#include "MeshFormatReader.hxx"
+#include "MeshFormatWriter.hxx"
using namespace MEDCoupling;
%}
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
+%newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate;
%newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
%newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
%newobject MEDCoupling::SauvReader::New;
%newobject MEDCoupling::SauvReader::loadInMEDFileDS;
+
%newobject MEDCoupling::MEDFileMeshStruct::New;
%newobject MEDCoupling::MEDMeshMultiLev::prepare;
%newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
%newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
%newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
+%newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
+%newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
+%newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
+
%feature("unref") MEDFileMesh "$this->decrRef();"
%feature("unref") MEDFileUMesh "$this->decrRef();"
%feature("unref") MEDFileCMesh "$this->decrRef();"
public:
MEDFileMeshReadSelector();
MEDFileMeshReadSelector(unsigned int code);
+ mcIdType getNumberOfCoordsLoadSessions();
+ void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
unsigned int getCode() const;
void setCode(unsigned int newCode);
bool isCellFamilyFieldReading() const;
MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
void forceComputationOfParts() const;
+ void computeRevNum() const;
//
void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
void setCoords(DataArrayDouble *coords);
static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
void setMesh(MEDCouplingCurveLinearMesh *m);
+ int getSpaceDimension() const;
+ int getMeshDimension() const;
%extend
{
MEDFileCurveLinearMesh()
MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
%extend
{
+ static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
+ {
+ std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
+ convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
+ convertPyToVectorVectorPairInt(dtsPy,dts2);
+ std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
+ return ret.retn();
+ }
+
MEDFileFieldMultiTS()
{
return MEDFileFieldMultiTS::New();
}
}
};
+
+ class MeshFormatReader
+ {
+ public:
+ MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
+ MeshFormatReader();
+ MEDFileData* loadInMedFileDS();
+ void setMeshName(const std::string& theMeshName);
+ std::string getMeshName() const;
+ void setFile(const std::string& theFileName);
+ void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
+ std::vector<std::string> getFieldFileNames() const;
+ };
+ class MeshFormatWriter
+ {
+ public:
+ MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
+ MeshFormatWriter();
+ void setMeshFileName(const std::string& meshFileName);
+ std::string getMeshFileName() const;
+ void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
+ std::vector<std::string> getFieldFileNames() const;
+ void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
+ void write();
+ };
+
}
%pythoncode %{