]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/INTERP_KERNEL/PlanarIntersectorP0P0.txx
Salome HOME
Merge from V6_main_20120808 08Aug12
[tools/medcoupling.git] / src / INTERP_KERNEL / PlanarIntersectorP0P0.txx
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 #ifndef __PLANARINTERSECTORP0P0_TXX__
20 #define __PLANARINTERSECTORP0P0_TXX__
21
22 #include "PlanarIntersectorP0P0.hxx"
23
24 namespace INTERP_KERNEL
25 {
26   template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
27   PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::PlanarIntersectorP0P0(const MyMeshType& meshT, const MyMeshType& meshS,
28                                                                                             double dimCaracteristic, double precision, double md3DSurf, double medianPlane,
29                                                                                             bool doRotate, int orientation, int printLevel):
30     PlanarIntersector<MyMeshType,MyMatrix>(meshT,meshS,dimCaracteristic,precision,md3DSurf,medianPlane,doRotate,orientation,printLevel)
31   {
32   }
33
34   template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
35   int PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
36   {
37     return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
38   }
39
40   template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
41   int PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
42   {
43     return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
44   }
45
46   template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
47   void PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
48   {
49     int nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
50     typename MyMatrix::value_type& resRow=res[icellT];
51     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
52       {
53         int iS=*iter;
54         int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
55         double surf=intersectGeometry(OTT<ConnType,numPol>::indFC(icellT),OTT<ConnType,numPol>::indFC(iS),nbNodesT,nbNodesS);
56         surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
57         if(surf!=0.)
58           resRow.insert(std::make_pair(OTT<ConnType,numPol>::indFC(iS),surf));
59       }
60   }
61 }
62
63 #endif