}
}
-void MEDCouplingRemapper::printMatrix(const std::vector<std::map<int,double> >& m)
+void MEDCouplingRemapper::PrintMatrix(const std::vector<std::map<int,double> >& m)
{
int id=0;
for(std::vector<std::map<int,double> >::const_iterator iter1=m.begin();iter1!=m.end();iter1++,id++)
std::cout << std::endl;
}
}
+
+const std::vector<std::map<int,double> >& MEDCouplingRemapper::getCrudeMatrix() const
+{
+ return _matrix;
+}
MEDCOUPLINGREMAPPER_EXPORT bool setOptionDouble(const std::string& key, double value);
MEDCOUPLINGREMAPPER_EXPORT bool setOptionString(const std::string& key, const std::string& value);
public:
- MEDCOUPLINGREMAPPER_EXPORT static void printMatrix(const std::vector<std::map<int,double> >& m);
+ MEDCOUPLINGREMAPPER_EXPORT const std::vector<std::map<int,double> >& getCrudeMatrix() const;
+ MEDCOUPLINGREMAPPER_EXPORT static void PrintMatrix(const std::vector<std::map<int,double> >& m);
private:
int prepareUU(const char *method) throw(INTERP_KERNEL::Exception);
int prepareEE(const char *method) throw(INTERP_KERNEL::Exception);
%include "MEDCoupling.i"
%include "InterpolationOptions.hxx"
-%include "MEDCouplingRemapper.hxx"
+
+namespace ParaMEDMEM
+{
+ class MEDCouplingRemapper : public TimeLabel, public INTERP_KERNEL::InterpolationOptions
+ {
+ private:
+ void updateTime() const;
+ public:
+ MEDCouplingRemapper();
+ ~MEDCouplingRemapper();
+ int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method) throw(INTERP_KERNEL::Exception);
+ int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target) throw(INTERP_KERNEL::Exception);
+ void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
+ void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
+ bool setOptionInt(const std::string& key, int value);
+ bool setOptionDouble(const std::string& key, double value);
+ bool setOptionString(const std::string& key, const std::string& value);
+ %extend
+ {
+ PyObject *getCrudeMatrix() const
+ {
+ const std::vector<std::map<int,double> >& m=self->getCrudeMatrix();
+ std::size_t sz=m.size();
+ PyObject *ret=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ const std::map<int,double>& row=m[i];
+ PyObject *ret0=PyDict_New();
+ for(std::map<int,double>::const_iterator it=row.begin();it!=row.end();it++)
+ PyDict_SetItem(ret0,PyInt_FromLong((*it).first),PyFloat_FromDouble((*it).second));
+ PyList_SetItem(ret,i,ret0);
+ }
+ return ret;
+ }
+ }
+ };
+}