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