case CARTESIAN:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret=MEDFileCMesh::New();
- ret->loadCMeshFromFile(fid,ms.front().c_str(),dt,it);
+ ret->loadCMeshFromFile(fid,ms.front().c_str(),dt,it,mrs);
return (MEDFileCMesh *)ret.retn();
}
case CURVE_LINEAR:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret=MEDFileCurveLinearMesh::New();
- ret->loadCLMeshFromFile(fid,ms.front().c_str(),dt,it);
+ ret->loadCLMeshFromFile(fid,ms.front().c_str(),dt,it,mrs);
return (MEDFileCurveLinearMesh *)ret.retn();
}
default:
case CARTESIAN:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret=MEDFileCMesh::New();
- ret->loadCMeshFromFile(fid,mName,dt,it);
+ ret->loadCMeshFromFile(fid,mName,dt,it,mrs);
return (MEDFileCMesh *)ret.retn();
}
case CURVE_LINEAR:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret=MEDFileCurveLinearMesh::New();
- ret->loadCLMeshFromFile(fid,mName,dt,it);
+ ret->loadCLMeshFromFile(fid,mName,dt,it,mrs);
return (MEDFileCurveLinearMesh *)ret.retn();
}
default:
* \throw If there is no meshes in the file.
* \throw If the mesh in the file is not a Cartesian one.
*/
-MEDFileCMesh *MEDFileCMesh::New(const char *fileName) throw(INTERP_KERNEL::Exception)
+MEDFileCMesh *MEDFileCMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- return new MEDFileCMesh(fid,ms.front().c_str(),dt,it);
+ return new MEDFileCMesh(fid,ms.front().c_str(),dt,it,mrs);
}
/*!
* \throw If there is no mesh with given attributes in the file.
* \throw If the mesh in the file is not a Cartesian one.
*/
-MEDFileCMesh *MEDFileCMesh::New(const char *fileName, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+MEDFileCMesh *MEDFileCMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- return new MEDFileCMesh(fid,mName,dt,it);
+ return new MEDFileCMesh(fid,mName,dt,it,mrs);
}
std::size_t MEDFileCMesh::getHeapMemorySize() const
{
}
-MEDFileCMesh::MEDFileCMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+MEDFileCMesh::MEDFileCMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
try
{
- loadCMeshFromFile(fid,mName,dt,it);
+ loadCMeshFromFile(fid,mName,dt,it,mrs);
}
catch(INTERP_KERNEL::Exception& e)
{
throw e;
}
-void MEDFileCMesh::loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+void MEDFileCMesh::loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
ParaMEDMEM::MEDCouplingMeshType meshType;
int dummy0,dummy1;
return new MEDFileCurveLinearMesh;
}
-MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName) throw(INTERP_KERNEL::Exception)
+MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- return new MEDFileCurveLinearMesh(fid,ms.front().c_str(),dt,it);
+ return new MEDFileCurveLinearMesh(fid,ms.front().c_str(),dt,it,mrs);
}
-MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- return new MEDFileCurveLinearMesh(fid,mName,dt,it);
+ return new MEDFileCurveLinearMesh(fid,mName,dt,it,mrs);
}
std::size_t MEDFileCurveLinearMesh::getHeapMemorySize() const
{
}
-MEDFileCurveLinearMesh::MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+MEDFileCurveLinearMesh::MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
try
{
- loadCLMeshFromFile(fid,mName,dt,it);
+ loadCLMeshFromFile(fid,mName,dt,it,mrs);
}
catch(INTERP_KERNEL::Exception& e)
{
MEDFileStructuredMesh::writeStructuredLL(fid,maa);
}
-void MEDFileCurveLinearMesh::loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
+void MEDFileCurveLinearMesh::loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception)
{
ParaMEDMEM::MEDCouplingMeshType meshType;
int dummy0,dummy1;
friend class MEDFileMesh;
public:
static MEDFileCMesh *New();
- static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
std::size_t getHeapMemorySize() const;
MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
MEDFileCMesh();
void synchronizeTinyInfoOnLeaves() const;
- MEDFileCMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
- void loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
+ MEDFileCMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception);
+ void loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception);
private:
MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> _cmesh;
};
friend class MEDFileMesh;
public:
static MEDFileCurveLinearMesh *New();
- static MEDFileCurveLinearMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
std::size_t getHeapMemorySize() const;
MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
private:
MEDFileCurveLinearMesh();
- MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
+ MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception);
const MEDCouplingStructuredMesh *getStructuredMesh() const;
void synchronizeTinyInfoOnLeaves() const;
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
- void loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);//to imp
+ void loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception);//to imp
private:
MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> _clmesh;
};
virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
%extend
{
- MEDFileMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
- {
- return MEDFileMesh::New(fileName);
- }
-
- MEDFileMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
- {
- return MEDFileMesh::New(fileName,mName,dt,it);
- }
-
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
class MEDFileUMesh : public MEDFileMesh
{
public:
- static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
- static MEDFileUMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New();
~MEDFileUMesh();
int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
%extend
{
- MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileUMesh::New(fileName,mName,dt,it);
+ return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
}
- MEDFileUMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileUMesh::New(fileName);
+ return MEDFileUMesh::New(fileName,mrs);
}
MEDFileUMesh()
{
public:
static MEDFileCMesh *New();
- static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileCMesh::New();
}
- MEDFileCMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileCMesh::New(fileName);
+ return MEDFileCMesh::New(fileName,mrs);
}
- MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileCMesh::New(fileName,mName,dt,it);
+ return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
}
PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
{
public:
static MEDFileCurveLinearMesh *New();
- static MEDFileCurveLinearMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileCurveLinearMesh::New();
}
- MEDFileCurveLinearMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileCurveLinearMesh::New(fileName);
+ return MEDFileCurveLinearMesh::New(fileName,mrs);
}
- MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
- return MEDFileCurveLinearMesh::New(fileName,mName,dt,it);
+ return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
}
PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
def testBasicConstructors(self):
fname="Pyfile18.med"
- m=MEDFileMesh(fname)
- m=MEDFileMesh(fname,"ExampleOfMultiDimW",-1,-1)
- m=MEDFileMesh(fname)
+ m=MEDFileMesh.New(fname)
+ m=MEDFileMesh.New(fname,"ExampleOfMultiDimW",-1,-1)
+ m=MEDFileMesh.New(fname)
m=MEDFileUMesh(fname,"ExampleOfMultiDimW",-1,-1)
m=MEDFileUMesh(fname)
m=MEDFileUMesh()