Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / INTERP_KERNEL / Interpolation2D1D.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __INTERPOLATION2D1D_HXX__
21 #define __INTERPOLATION2D1D_HXX__
22
23 #include "Interpolation.hxx"
24 #include "Planar2D1DIntersectorP0P0.hxx"
25 #include "NormalizedUnstructuredMesh.hxx"
26 #include "InterpolationOptions.hxx"
27
28 namespace INTERP_KERNEL
29 {
30   /*!
31    * Contrary to its name this class deals with 1D mesh in source and 2D mesh in target.
32    * The meshdim of 'MyMeshType' in input is ignored that's why 'meshS' and 'meshT'
33    * have the same type.
34    * '_duplicate_faces' attribute stores duplicated faces in the following format.
35    * The key of '_duplicate_faces' represents the 1D cellId that is shared by
36    * more than one 2D target cell, and the value of '_duplicate_faces'
37    * the 2D target cells. The size of the value of '_duplicate_faces' is more than or equal to 2.
38    */
39   class Interpolation2D1D : public Interpolation<Interpolation2D1D>
40   {
41   public:
42     typedef std::map<int,std::set<int> > DuplicateFacesType;
43
44     Interpolation2D1D() { setOrientation(2); }
45     Interpolation2D1D(const InterpolationOptions& io):Interpolation<Interpolation2D1D>(io) { }
46   public:
47
48     // Main function to interpolate triangular and quadratic meshes
49     template<class MyMeshType, class MatrixType>
50     int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const char *method);
51     DuplicateFacesType retrieveDuplicateFaces() const
52     {
53       return _duplicate_faces;
54     }
55   private:
56     DuplicateFacesType _duplicate_faces;
57   private:
58     double _dim_caracteristic;
59   };
60 }
61
62 #endif