%rename (GetTypesOfField) GetTypesOfFieldSwig;
%rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
%rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
+%rename (ReadField) ReadFieldSwig;
%inline
{
PyTuple_SetItem(ret,2,SWIG_From_int(release));
return ret;
}
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
+ return ret.retn();
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
+ return ret.retn();
+ }
- MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(PyObject *elt0) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
{
- const char MSG[]="Invalid call ReadField !\n Supported are :\n - ReadField(fileName)\n - ReadField(fileName,fieldName)\n - ReadField(fileName,fieldName,iteration,order)\n - ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order)";
- if(!elt0 || !PyTuple_Check(elt0))
- throw INTERP_KERNEL::Exception(MSG);
- int sz(PyTuple_Size(elt0));
- if(sz==1)
- {
- PyObject *o0(PyTuple_GetItem(elt0,0));
- if(PyString_Check(o0))
- {
- std::string st(PyString_AsString(o0));
- MCAuto<MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(st));
- return ret.retn();
- }
- throw INTERP_KERNEL::Exception(MSG);
- }
- if(sz==2)
- {
- PyObject *o0(PyTuple_GetItem(elt0,0)),*o1(PyTuple_GetItem(elt0,1));
- if(PyString_Check(o0) && PyString_Check(o1))
- {
- std::string st0(PyString_AsString(o0)),st1(PyString_AsString(o1));
- MCAuto<MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(st0,st1));
- return ret.retn();
- }
- throw INTERP_KERNEL::Exception(MSG);
- }
- if(sz==4)
- {
- PyObject *o0(PyTuple_GetItem(elt0,0)),*o1(PyTuple_GetItem(elt0,1)),*o2(PyTuple_GetItem(elt0,2)),*o3(PyTuple_GetItem(elt0,3));
- if(PyString_Check(o0) && PyString_Check(o1) && PyInt_Check(o2) && PyInt_Check(o3))
- {
- std::string st0(PyString_AsString(o0)),st1(PyString_AsString(o1));
- int a((int)PyInt_AS_LONG(o2)),b((int)PyInt_AS_LONG(o3));
- MCAuto<MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(st0,st1,a,b));
- return ret.retn();
- }
- throw INTERP_KERNEL::Exception(MSG);
- }
- if(sz==7)
- {
- PyObject *o0(PyTuple_GetItem(elt0,0)),*o1(PyTuple_GetItem(elt0,1)),*o2(PyTuple_GetItem(elt0,2)),*o3(PyTuple_GetItem(elt0,3)),*o4(PyTuple_GetItem(elt0,4)),*o5(PyTuple_GetItem(elt0,5)),*o6(PyTuple_GetItem(elt0,6));
- if(PyInt_Check(o0) && PyString_Check(o1) && PyString_Check(o2) && PyInt_Check(o3) && PyString_Check(o4) && PyInt_Check(o5) && PyInt_Check(o6))
- {
- int a((int)PyInt_AS_LONG(o0)),b((int)PyInt_AS_LONG(o3)),c((int)PyInt_AS_LONG(o5)),d((int)PyInt_AS_LONG(o6));
- MEDCoupling::TypeOfField aa((MEDCoupling::TypeOfField)a);
- std::string st0(PyString_AsString(o1)),st1(PyString_AsString(o2)),st2(PyString_AsString(o4));
- MCAuto<MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(aa,st0,st1,b,st2,c,d));
- return ret.retn();
- }
- throw INTERP_KERNEL::Exception(MSG);
- }
- throw INTERP_KERNEL::Exception(MSG);
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
+ return ret.retn();
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ return ret.retn();
}
PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)