#endif
%newobject MEDLoader::ReadUMeshFromFile;
+%newobject MEDLoader::ReadFieldDouble;
%newobject MEDLoader::ReadFieldDoubleCell;
+%newobject MEDLoader::ReadFieldDoubleNode;
class MEDLoader
{
static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName);
%extend
{
- static PyObject *GetCellFieldIterations(const char *fileName, const char *fieldName)
+ static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName)
{
- std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,fieldName);
+ std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
+
+ static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName)
+ {
+ std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
+ static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName)
+ {
+ std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
int rk=0;
for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
return ret;
}
}
- //std::vector< std::pair<int,int> > GetNodeFieldIterations(const char *fileName, const char *fieldName);
static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDouble(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
static void WriteUMesh(const char *fileName, ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
static void WriteField(const char *fileName, ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, ParaMEDMEM::MEDCouplingFieldDouble *f);