1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
20 #ifndef __PLANAR2D1DINTERSECTORP0P0_TXX__
21 #define __PLANAR2D1DINTERSECTORP0P0_TXX__
23 #include "Planar2D1DIntersectorP0P0.hxx"
25 namespace INTERP_KERNEL
27 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
28 Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::Planar2D1DIntersectorP0P0(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)
35 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
36 int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
38 return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
41 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
42 int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
44 return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
47 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
48 void Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
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++)
55 int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
56 bool isColinear = false;
57 double surf=intersectGeometry1D(OTT<ConnType,numPol>::indFC(icellT),OTT<ConnType,numPol>::indFC(iS),
58 nbNodesT,nbNodesS, isColinear);
59 surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
61 resRow.insert(std::make_pair(OTT<ConnType,numPol>::indFC(iS),surf));
65 typename PlanarIntersector<MyMeshType,MyMatrix>::DuplicateFacesType::iterator intersectFacesIter = _intersect_faces.find(iS);
66 if (intersectFacesIter != _intersect_faces.end())
68 intersectFacesIter->second.insert(icellT);
72 std::set<int> targetCellSet;
73 targetCellSet.insert(icellT);
74 _intersect_faces.insert(std::make_pair(iS, targetCellSet));