1 // Copyright (C) 2007-2012 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 #ifndef __PLANAR2D1DINTERSECTORP0P0_TXX__
20 #define __PLANAR2D1DINTERSECTORP0P0_TXX__
22 #include "Planar2D1DIntersectorP0P0.hxx"
24 namespace INTERP_KERNEL
26 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
27 Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::Planar2D1DIntersectorP0P0(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)
34 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
35 int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
37 return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
40 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
41 int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
43 return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
46 template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
47 void Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
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++)
54 int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
55 bool isColinear = false;
56 double surf=intersectGeometry1D(OTT<ConnType,numPol>::indFC(icellT),OTT<ConnType,numPol>::indFC(iS),
57 nbNodesT,nbNodesS, isColinear);
58 surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
60 resRow.insert(std::make_pair(OTT<ConnType,numPol>::indFC(iS),surf));
64 typename PlanarIntersector<MyMeshType,MyMatrix>::DuplicateFacesType::iterator intersectFacesIter = _intersect_faces.find(iS);
65 if (intersectFacesIter != _intersect_faces.end())
67 intersectFacesIter->second.insert(icellT);
71 std::set<int> targetCellSet;
72 targetCellSet.insert(icellT);
73 _intersect_faces.insert(std::make_pair(iS, targetCellSet));