00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef MEDMEM_REMAPPER_HXX_ 00021 #define MEDMEM_REMAPPER_HXX_ 00022 00023 #include "MEDMEM_Mesh.hxx" 00024 #include "MEDMEM_Field.hxx" 00025 #include "MEDMEM.hxx" 00026 #include "MEDNormalizedUnstructuredMesh.hxx" 00027 #include "MEDNormalizedUnstructuredMesh.txx" 00028 #include "InterpKernelMatrix.hxx" 00029 #include "InterpolationOptions.hxx" 00030 00031 00032 00033 class MEDMEM_EXPORT MEDMEM_REMAPPER : public INTERP_KERNEL::InterpolationOptions 00034 { 00035 public: 00036 MEDMEM_REMAPPER(); 00037 virtual ~MEDMEM_REMAPPER(); 00038 int prepare(const MEDMEM::MESH& source_mesh, const MEDMEM::MESH& target_mesh, const char *method); 00039 void transfer(const MEDMEM::FIELD<double>& source_field, MEDMEM::FIELD<double>& target_field); 00040 void reverseTransfer(MEDMEM::FIELD<double>& source_field, const MEDMEM::FIELD<double>& target_field); 00041 MEDMEM::FIELD<double> * transferField(const MEDMEM::FIELD<double>& source_field); 00042 MEDMEM::FIELD<double> * reverseTransferField(const MEDMEM::FIELD<double>& target_field); 00043 void printMatrixInfo(); 00044 int setOptionDouble(const std::string& key, double value); 00045 int setOptionInt(const std::string& key, int value); 00046 int setOptionString(const std::string& key, std::string& value); 00047 private : 00048 INTERP_KERNEL::Matrix<double, INTERP_KERNEL::ALL_FORTRAN_MODE>* _matrix; 00049 MEDMEM::FIELD<double>* getSupportVolumes(const MEDMEM::SUPPORT& support); 00050 std::vector<double> _deno_multiply; 00051 std::vector<double> _deno_reverse_multiply; 00052 int _nb_rows; 00053 int _nb_cols; 00054 string _sourceFieldType; 00055 string _targetFieldType; 00056 const MEDMEM::MESH * _sourceMesh; 00057 const MEDMEM::MESH * _targetMesh; 00058 const MEDMEM::SUPPORT * _sourceSupport; 00059 const MEDMEM::SUPPORT * _targetSupport; 00060 }; 00061 00062 00063 #endif /*REMAPPER_HXX_*/