X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingRemapper.hxx;h=2904d5d9ae20ee374d9c2f49681300f59093b630;hb=0c9d48870957c4a9f6f82fc8e2c569780a5f886b;hp=41948c2fbedd5b3eae0dcbb84a6fafa1b42f8637;hpb=f87b8b7eedc847c6f614e722b8e9d0552046ffba;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingRemapper.hxx b/src/MEDCoupling/MEDCouplingRemapper.hxx index 41948c2fb..2904d5d9a 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.hxx +++ b/src/MEDCoupling/MEDCouplingRemapper.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2013 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 @@ -25,6 +25,8 @@ #include "MEDCouplingTimeLabel.hxx" #include "InterpolationOptions.hxx" #include "MEDCouplingNatureOfField.hxx" +#include "MEDCouplingAutoRefCountObjectPtr.hxx" + #include "InterpKernelException.hxx" #include @@ -33,46 +35,66 @@ namespace ParaMEDMEM { class MEDCouplingMesh; - class MEDCouplingUMesh; class MEDCouplingFieldDouble; class MEDCouplingFieldTemplate; } namespace ParaMEDMEM { + typedef enum + { + IK_ONLY_PREFERED = 0, + NOT_IK_ONLY_PREFERED = 1, + IK_ONLY_FORCED = 2, + NOT_IK_ONLY_FORCED =3 + } InterpolationMatrixPolicy; + class MEDCouplingRemapper : public TimeLabel, public INTERP_KERNEL::InterpolationOptions { public: MEDCOUPLINGREMAPPER_EXPORT MEDCouplingRemapper(); MEDCOUPLINGREMAPPER_EXPORT ~MEDCouplingRemapper(); - MEDCOUPLINGREMAPPER_EXPORT int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); + MEDCOUPLINGREMAPPER_EXPORT int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method); + MEDCOUPLINGREMAPPER_EXPORT int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target); + MEDCOUPLINGREMAPPER_EXPORT void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue); + MEDCOUPLINGREMAPPER_EXPORT void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField); + MEDCOUPLINGREMAPPER_EXPORT void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue); + MEDCOUPLINGREMAPPER_EXPORT MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue); + MEDCOUPLINGREMAPPER_EXPORT MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue); MEDCOUPLINGREMAPPER_EXPORT bool setOptionInt(const std::string& key, int value); MEDCOUPLINGREMAPPER_EXPORT bool setOptionDouble(const std::string& key, double value); MEDCOUPLINGREMAPPER_EXPORT bool setOptionString(const std::string& key, const std::string& value); + MEDCOUPLINGREMAPPER_EXPORT int getInterpolationMatrixPolicy() const; + MEDCOUPLINGREMAPPER_EXPORT void setInterpolationMatrixPolicy(int newInterpMatPol); // - MEDCOUPLINGREMAPPER_EXPORT int nullifiedTinyCoeffInCrudeMatrixAbs(double maxValAbs) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT int nullifiedTinyCoeffInCrudeMatrix(double scaleFactor) throw(INTERP_KERNEL::Exception); - MEDCOUPLINGREMAPPER_EXPORT double getMaxValueInCrudeMatrix() const throw(INTERP_KERNEL::Exception); + MEDCOUPLINGREMAPPER_EXPORT int nullifiedTinyCoeffInCrudeMatrixAbs(double maxValAbs); + MEDCOUPLINGREMAPPER_EXPORT int nullifiedTinyCoeffInCrudeMatrix(double scaleFactor); + MEDCOUPLINGREMAPPER_EXPORT double getMaxValueInCrudeMatrix() const; public: MEDCOUPLINGREMAPPER_EXPORT const std::vector >& getCrudeMatrix() const; + MEDCOUPLINGREMAPPER_EXPORT int getNumberOfColsOfMatrix() const; MEDCOUPLINGREMAPPER_EXPORT static void PrintMatrix(const std::vector >& m); private: - int prepareUU(const char *method) throw(INTERP_KERNEL::Exception); - int prepareEE(const char *method) throw(INTERP_KERNEL::Exception); - int prepareUC(const char *method) throw(INTERP_KERNEL::Exception); - int prepareCU(const char *method) throw(INTERP_KERNEL::Exception); - int prepareCC(const char *method) throw(INTERP_KERNEL::Exception); + int prepareInterpKernelOnly(); + int prepareInterpKernelOnlyUU(); + int prepareInterpKernelOnlyEE(); + int prepareInterpKernelOnlyUC(); + int prepareInterpKernelOnlyCU(); + int prepareInterpKernelOnlyCC(); + // + int prepareNotInterpKernelOnly(); + int prepareNotInterpKernelOnlyGaussGauss(); + // + static int CheckInterpolationMethodManageableByNotOnlyInterpKernel(const std::string& method); + // + bool isInterpKernelOnlyOrNotOnly() const; void updateTime() const; + void checkPrepare() const; + std::string checkAndGiveInterpolationMethodStr(std::string& srcMeth, std::string& trgMeth) const; void releaseData(bool matrixSuppression); - void transferUnderground(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, bool isDftVal, double dftValue) throw(INTERP_KERNEL::Exception); + void transferUnderground(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, bool isDftVal, double dftValue); void computeDeno(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField); - void computeDenoFromScratch(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField) throw(INTERP_KERNEL::Exception); + void computeDenoFromScratch(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField); void computeProduct(const double *inputPointer, int inputNbOfCompo, bool isDftVal, double dftValue, double *resPointer); void computeReverseProduct(const double *inputPointer, int inputNbOfCompo, double dftValue, double *resPointer); void buildFinalInterpolationMatrixByConvolution(const std::vector< std::map >& m1D, @@ -86,10 +108,9 @@ namespace ParaMEDMEM static void ComputeColSumAndRowSum(const std::vector >& matrixDeno, std::vector >& deno, std::vector >& denoReverse); private: - MEDCouplingMesh *_src_mesh; - MEDCouplingMesh *_target_mesh; - std::string _src_method; - std::string _target_method; + MEDCouplingAutoRefCountObjectPtr _src_ft; + MEDCouplingAutoRefCountObjectPtr _target_ft; + InterpolationMatrixPolicy _interp_matrix_pol; NatureOfField _nature_of_deno; unsigned int _time_deno_update; std::vector > _matrix;