InterpolationOptions::getPrecision(),
InterpolationOptions::getOrientation());
break;
- case PointLocator2D:
+ case PointLocator:
intersector=new PointLocator2DIntersector<MyMeshType,MatrixType,PlanarIntersectorP0P0>(myMeshT, myMeshS, _dim_caracteristic,
InterpolationOptions::getMaxDistance3DSurfIntersect(),
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrecision(),
InterpolationOptions::getOrientation());
break;
- case PointLocator2D:
+ case PointLocator:
intersector=new PlanarIntersectorP0P1PL<MyMeshType,MatrixType>(myMeshT, myMeshS, _dim_caracteristic,
InterpolationOptions::getMaxDistance3DSurfIntersect(),
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrecision(),
InterpolationOptions::getOrientation());
break;
- case PointLocator2D:
+ case PointLocator:
intersector=new PlanarIntersectorP1P0PL<MyMeshType,MatrixType>(myMeshT, myMeshS, _dim_caracteristic,
InterpolationOptions::getMaxDistance3DSurfIntersect(),
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrecision(),
InterpolationOptions::getOrientation());
break;
- case PointLocator2D:
- throw INTERP_KERNEL::Exception("Invalid intersector (PointLocator2D) for P1P0Bary !");
+ case PointLocator:
+ throw INTERP_KERNEL::Exception("Invalid intersector (PointLocator) for P1P0Bary !");
break;
}
}
InterpolationOptions::getPrecision(),
InterpolationOptions::getOrientation());
break;
- case PointLocator2D:
+ case PointLocator:
intersector=new PlanarIntersectorP1P1PL<MyMeshType,MatrixType>(myMeshT, myMeshS, _dim_caracteristic,
InterpolationOptions::getMaxDistance3DSurfIntersect(),
InterpolationOptions::getMedianPlane(),
template<class MyMeshType, class MyMatrix>
class Intersector3D : public TargetIntersector<MyMeshType,MyMatrix>
{
+ public:
+ static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
+ static const int MESHDIM=MyMeshType::MY_MESHDIM;
+ typedef typename MyMeshType::MyConnType ConnType;
+ static const NumberingPolicy numPol=MyMeshType::My_numPol;
public:
Intersector3D(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
+ void getRealTargetCoordinates(ConnType icellT, std::vector<double>& coordsT) const;
+ void getRealSourceCoordinates(ConnType icellT, std::vector<double>& coordsT) const;
+ const ConnType *getStartConnOfTargetCell(ConnType icellT) const;
+ const ConnType *getStartConnOfSourceCell(ConnType icellS) const;
+ void getConnOfSourceCell(ConnType icellS, typename std::vector<ConnType>& res) const;
protected:
const MyMeshType& _target_mesh;
const MyMeshType& _src_mesh;
#include "Intersector3D.hxx"
+#include <algorithm>
+
namespace INTERP_KERNEL
{
template<class MyMeshType, class MyMatrix>
{
}
-
+ /*!
+ * @param icellT in format of MyMeshType.
+ */
+ template<class MyMeshType, class MyMatrix>
+ void Intersector3D<MyMeshType,MyMatrix>::getRealTargetCoordinates(ConnType icellT, std::vector<double>& coordsT) const
+ {
+ const ConnType *myConectT=_target_mesh.getConnectivityPtr();
+ const ConnType *myConIndexT=_target_mesh.getConnectivityIndexPtr();
+ const double *myCoordsT=_target_mesh.getCoordinatesPtr();
+ int nbNodesT=myConIndexT[OTT<ConnType,numPol>::ind2C(icellT)+1]-myConIndexT[OTT<ConnType,numPol>::ind2C(icellT)];
+ coordsT.resize(SPACEDIM*nbNodesT);
+ for (ConnType iT=0; iT<nbNodesT; iT++)
+ for(int idim=0; idim<SPACEDIM; idim++)
+ coordsT[SPACEDIM*iT+idim]=myCoordsT[SPACEDIM*OTT<ConnType,numPol>::coo2C(myConectT[OTT<ConnType,numPol>::conn2C(myConIndexT[OTT<ConnType,numPol>::ind2C(icellT)]+iT)])+idim];
+ }
+
+ /*!
+ * @param icellT in format of MyMeshType.
+ */
+ template<class MyMeshType, class MyMatrix>
+ void Intersector3D<MyMeshType,MyMatrix>::getRealSourceCoordinates(ConnType icellS, std::vector<double>& coordsS) const
+ {
+ const ConnType *myConectS=_src_mesh.getConnectivityPtr();
+ const ConnType *myConIndexS=_src_mesh.getConnectivityIndexPtr();
+ const double *myCoordsS=_src_mesh.getCoordinatesPtr();
+ int nbNodesS=myConIndexS[OTT<ConnType,numPol>::ind2C(icellS)+1]-myConIndexS[OTT<ConnType,numPol>::ind2C(icellS)];
+ coordsS.resize(SPACEDIM*nbNodesS);
+ for (ConnType iS=0; iS<nbNodesS; iS++)
+ for(int idim=0; idim<SPACEDIM; idim++)
+ coordsS[SPACEDIM*iS+idim]=myCoordsS[SPACEDIM*OTT<ConnType,numPol>::coo2C(myConectS[OTT<ConnType,numPol>::conn2C(myConIndexS[OTT<ConnType,numPol>::ind2C(icellS)]+iS)])+idim];
+ }
+
+ /*!
+ * @param icellT in C format.
+ * @return is in format of MyMeshType
+ */
+ template<class MyMeshType, class MyMatrix>
+ const typename MyMeshType::MyConnType *Intersector3D<MyMeshType,MyMatrix>::getStartConnOfTargetCell(ConnType icellT) const
+ {
+ const ConnType *myConectT=_target_mesh.getConnectivityPtr();
+ const ConnType *myConIndexT=_target_mesh.getConnectivityIndexPtr();
+ return myConectT+OTT<ConnType,numPol>::conn2C(myConIndexT[icellT]);
+ }
+
+ /*!
+ * @param icellT in C format.
+ * @return is in format of MyMeshType
+ */
+ template<class MyMeshType, class MyMatrix>
+ const typename MyMeshType::MyConnType *Intersector3D<MyMeshType,MyMatrix>::getStartConnOfSourceCell(ConnType icellS) const
+ {
+ const ConnType *myConectS=_src_mesh.getConnectivityPtr();
+ const ConnType *myConIndexS=_src_mesh.getConnectivityIndexPtr();
+ return myConectS+OTT<ConnType,numPol>::conn2C(myConIndexS[icellS]);
+ }
+
+ /*!
+ * @param icellS in format of MyMeshType.
+ * @param res ; out param in format of MyMeshType.
+ */
+ template<class MyMeshType, class MyMatrix>
+ void Intersector3D<MyMeshType,MyMatrix>::getConnOfSourceCell(ConnType icellS, typename std::vector<ConnType>& res) const
+ {
+ const ConnType *myConectS=_src_mesh.getConnectivityPtr();
+ const ConnType *myConIndexS=_src_mesh.getConnectivityIndexPtr();
+ ConnType start=myConIndexS[OTT<ConnType,numPol>::ind2C(icellS)];
+ ConnType end=myConIndexS[OTT<ConnType,numPol>::ind2C(icellS)+1];
+ int nbNodesS=end-start;
+ res.resize(nbNodesS);
+ std::copy(myConectS+OTT<ConnType,numPol>::conn2C(start),myConectS+OTT<ConnType,numPol>::conn2C(end),res.begin());
+ }
}
#endif