1 // Copyright (C) 2009-2014 OPEN CASCADE
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.
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 // File : IntersectorCU.hxx
20 // Created : Thu Dec 17 12:30:17 2009
21 // Author : Edward AGAPOV (eap)
24 #ifndef __IntersectorCU_HXX__
25 #define __IntersectorCU_HXX__
27 #include "TargetIntersector.hxx"
28 #include "NormalizedUnstructuredMesh.hxx"
30 namespace INTERP_KERNEL
32 template<class MyCMeshType, class MyUMeshType, class MyMatrix> class _StabIntersector;
34 template<class MyCMeshType, class MyUMeshType, class MyMatrix, class ConcreteIntersector=_StabIntersector<MyCMeshType,MyUMeshType,MyMatrix> >
35 class IntersectorCU : public TargetIntersector<MyCMeshType,MyMatrix>
38 static const int SPACEDIM=MyCMeshType::MY_SPACEDIM;
39 static const int MESHDIM=MyCMeshType::MY_MESHDIM;
40 typedef typename MyUMeshType::MyConnType UConnType;
41 typedef typename MyCMeshType::MyConnType CConnType;
43 //! \addtogroup InterpKerGrpIntCU @{
44 IntersectorCU(const MyCMeshType& meshS, const MyUMeshType& meshT);
46 virtual ~IntersectorCU();
47 void getUElemBB(double* bb, UConnType iP);
48 void getUCoordinates(UConnType icell, std::vector<double>& coords);
50 int getNumberOfRowsOfResMatrix() const;
51 int getNumberOfColsOfResMatrix() const;
52 void intersectCells(CConnType icellU, const std::vector<CConnType>& icellC, MyMatrix& res);
53 double intersectGeometry(CConnType icellT, const std::vector<CConnType>& icellC) { return asLeaf().intersectGeometry(icellT,icellC); }
55 ConcreteIntersector& asLeaf() { return static_cast<ConcreteIntersector&>(*this); }
58 const UConnType *_connectU;
59 const UConnType *_connIndexU;
60 const double * _coordsU;
61 const MyUMeshType& _meshU;
63 const double * _coordsC[SPACEDIM];
64 int _nbCellsC[SPACEDIM];
65 const MyCMeshType& _meshC;
68 // class to enable usage of IntersectorCU not for intersection but for access to data it encapsulates
69 template<class MyCMeshType, class MyUMeshType, class MyMatrix>
70 class _StabIntersector: public IntersectorCU<MyCMeshType, MyUMeshType, MyMatrix, _StabIntersector<MyCMeshType, MyUMeshType, MyMatrix> >
73 _StabIntersector(const MyCMeshType& meshS, const MyUMeshType& meshT) : IntersectorCU<MyCMeshType, MyUMeshType, MyMatrix, _StabIntersector<MyCMeshType, MyUMeshType, MyMatrix> >(meshS, meshT) {}
74 double intersectGeometry(typename MyUMeshType::MyConnType icellT, const std::vector<typename MyCMeshType::MyConnType>& icellC) { throw Exception("You must provide an intersector as the 4-th template argument of IntersectorCU"); return 0; }