// terminal node : return list of elements intersecting bb
if (_terminal)
{
- for (mcIdType i=0; i<_nbelems; i++)
+ for (ConnType i=0; i<_nbelems; i++)
{
const double* const bb_ptr=_bb+_elems[i]*2*dim;
bool intersects = true;
double precision, double tolerance,
double medianLine, int printLevel);
public:
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
void intersectCells(ConnType icellT,
const std::vector<ConnType>& icellsS, MyMatrix& res);
};
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP0P0<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP0P0<MyMeshType,MyMatrix>
::getNumberOfRowsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP0P0<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP0P0<MyMeshType,MyMatrix>
::getNumberOfColsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshS.getNumberOfElements();
{
typename MyMatrix::value_type& resRow = res[icellT];
std::vector<double> coordsT;
- int t, nbSegT = 1 + BASE_INTERSECTOR::getRealTargetCoordinates(icellT,coordsT);
+ ConnType t, nbSegT = 1 + BASE_INTERSECTOR::getRealTargetCoordinates(icellT,coordsT);
for ( t = 0; t < nbSegT; ++t )
for(typename std::vector<ConnType>::const_iterator
iter=icellsS.begin(); iter!=icellsS.end(); iter++)
{
- int iS = *iter;
+ ConnType iS = *iter;
std::vector<double> coordsS;
- int s, nbSegS = 1 + BASE_INTERSECTOR::getRealSourceCoordinates(iS,coordsS);
+ ConnType s, nbSegS = 1 + BASE_INTERSECTOR::getRealSourceCoordinates(iS,coordsS);
for ( s = 0; s < nbSegS; ++s )
{
double surf = BASE_INTERSECTOR::intersectSegments(&coordsT[0] + t*SPACEDIM,
public:
void intersectCells(ConnType icellT,
const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP0P1<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP0P1<MyMeshType,MyMatrix>
::getNumberOfRowsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP0P1<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP0P1<MyMeshType,MyMatrix>
::getNumberOfColsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshS.getNumberOfElements();
{
std::vector<typename BASE_INTERSECTOR::TDualSegment> segmentsT;
BASE_INTERSECTOR::getDualSegments( icellT, BASE_INTERSECTOR::_meshT, segmentsT);
- for ( int t = 0; t < (int)segmentsT.size(); ++t )
+ for ( ConnType t = 0; t < (ConnType)segmentsT.size(); ++t )
{
typename MyMatrix::value_type& resRow = res[ OTT<ConnType,numPol>::ind2C( segmentsT[t]._nodeId )];
for(typename std::vector<ConnType>::const_iterator
iter=icellsS.begin(); iter!=icellsS.end(); iter++)
{
- int iS = *iter;
+ ConnType iS = *iter;
std::vector<double> coordsS;
- int s, nbSegS = 1 + BASE_INTERSECTOR::getRealSourceCoordinates(iS,coordsS);
+ ConnType s, nbSegS = 1 + BASE_INTERSECTOR::getRealSourceCoordinates(iS,coordsS);
for ( s = 0; s < nbSegS; ++s )
{
double surf = BASE_INTERSECTOR::intersectSegments(&segmentsT[t]._coords[0],
double precision, double tolerance, double medianLine, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P0<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP1P0<MyMeshType,MyMatrix>
::getNumberOfRowsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P0<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP1P0<MyMeshType,MyMatrix>
::getNumberOfColsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshS.getNumberOfNodes();
typename MyMatrix::value_type& resRow = res[ icellT ];
std::vector<typename BASE_INTERSECTOR::TDualSegment> segmentsS;
std::vector<double> coordsT;
- int t, nbSegT = 1 + BASE_INTERSECTOR::getRealTargetCoordinates(icellT,coordsT);
+ ConnType t, nbSegT = 1 + BASE_INTERSECTOR::getRealTargetCoordinates(icellT,coordsT);
for ( t = 0; t < nbSegT; ++t )
for(typename std::vector<ConnType>::const_iterator
iter=icellsS.begin(); iter!=icellsS.end(); iter++)
{
- int iS = *iter;
+ ConnType iS = *iter;
BASE_INTERSECTOR::getDualSegments( OTT<ConnType,numPol>::ind2C(iS),
BASE_INTERSECTOR::_meshS, segmentsS);
- for ( int s = 0; s < (int)segmentsS.size(); ++s )
+ for ( ConnType s = 0; s < (ConnType)segmentsS.size(); ++s )
{
double surf = BASE_INTERSECTOR::intersectSegments(&segmentsS[s]._coords[0],
&coordsT[0] + t*SPACEDIM);
if(surf!=0.)
{
- int nS = segmentsS[s]._nodeId;
+ ConnType nS = segmentsS[s]._nodeId;
typename MyMatrix::value_type::const_iterator iterRes=resRow.find(nS);
if(iterRes==resRow.end())
resRow.insert(std::make_pair(nS,surf));
public:
void intersectCells(ConnType icellT,
const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P1<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP1P1<MyMeshType,MyMatrix>
::getNumberOfRowsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P1<MyMeshType,MyMatrix>
+ typename MyMeshType::MyConnType CurveIntersectorP1P1<MyMeshType,MyMatrix>
::getNumberOfColsOfResMatrix() const
{
return BASE_INTERSECTOR::_meshS.getNumberOfNodes();
{
std::vector<typename BASE_INTERSECTOR::TDualSegment> segmentsT, segmentsS;
BASE_INTERSECTOR::getDualSegments( icellT, BASE_INTERSECTOR::_meshT, segmentsT);
- for ( int t = 0; t < (int)segmentsT.size(); ++t )
+ for ( ConnType t = 0; t < (ConnType)segmentsT.size(); ++t )
{
typename MyMatrix::value_type& resRow = res[ OTT<ConnType,numPol>::ind2C( segmentsT[t]._nodeId )];
for(typename std::vector<ConnType>::const_iterator
iter=icellsS.begin(); iter!=icellsS.end(); iter++)
{
- int iS = *iter;
+ ConnType iS = *iter;
BASE_INTERSECTOR::getDualSegments( OTT<ConnType,numPol>::ind2C(iS),
BASE_INTERSECTOR::_meshS, segmentsS);
- for ( int s = 0; s < (int)segmentsS.size(); ++s )
+ for ( ConnType s = 0; s < (ConnType)segmentsS.size(); ++s )
{
double surf = BASE_INTERSECTOR::intersectSegments(&segmentsT[t]._coords[0],
&segmentsS[s]._coords[0]);
if(surf!=0.)
{
- int nS = segmentsS[s]._nodeId;
+ ConnType nS = segmentsS[s]._nodeId;
typename MyMatrix::value_type::const_iterator iterRes=resRow.find(nS);
if(iterRes==resRow.end())
resRow.insert(std::make_pair(nS,surf));
double medianLine, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
private:
static void AppendValueInMatrix(MyMatrix& res, ConnType nodeIdT, ConnType nodeIdS0, double val0, ConnType nodeIdS1, double val1);
static void AppendValueInMatrix2(typename MyMatrix::value_type& resRow, ConnType nodeIdS0, double val0);
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType CurveIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return CurveIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int CurveIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType CurveIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return CurveIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
typedef typename MyMeshType::MyConnType ConnType;
public:
IntegralUniformIntersectorP0(const MyMeshType& mesh, bool isAbs);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
void intersectCells(ConnType targetCell, const std::vector<ConnType>& srcCells, MyMatrix& res);
};
typedef typename MyMeshType::MyConnType ConnType;
public:
IntegralUniformIntersectorP1(const MyMeshType& mesh, bool isAbs);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
void intersectCells(ConnType targetCell, const std::vector<ConnType>& srcCells, MyMatrix& res);
};
}
}
template<class MyMeshType, class MyMatrix>
- int IntegralUniformIntersectorP0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType IntegralUniformIntersectorP0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
if(IntegralUniformIntersector<MyMeshType,MyMatrix>::_from_to)
return 1;
}
template<class MyMeshType, class MyMatrix>
- int IntegralUniformIntersectorP0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType IntegralUniformIntersectorP0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
if(IntegralUniformIntersector<MyMeshType,MyMatrix>::_from_to)
return IntegralUniformIntersector<MyMeshType,MyMatrix>::_mesh.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int IntegralUniformIntersectorP1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType IntegralUniformIntersectorP1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
if(IntegralUniformIntersector<MyMeshType,MyMatrix>::_from_to)
return 1;
}
template<class MyMeshType, class MyMatrix>
- int IntegralUniformIntersectorP1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType IntegralUniformIntersectorP1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
if(IntegralUniformIntersector<MyMeshType,MyMatrix>::_from_to)
return IntegralUniformIntersector<MyMeshType,MyMatrix>::_mesh.getNumberOfNodes();
for(ConnType i=0;i<nbelem;i++)
{
INTERP_KERNEL::NormalizedCellType t=IntegralUniformIntersector<MyMeshType,MyMatrix>::_mesh.getTypeOfElement(OTT<ConnType,numPol>::indFC(i));
- int lgth=connIndx[i+1]-connIndx[i];
+ ConnType lgth=connIndx[i+1]-connIndx[i];
const ConnType *locConn=conn+OTT<ConnType,numPol>::ind2C(connIndx[i]);
double val=computeVolSurfOfCell<ConnType,numPol,MyMeshType::MY_SPACEDIM>(t,locConn,lgth,coords);
if(t==NORM_TRI3)
val/=4.;
else
throw INTERP_KERNEL::Exception("Invalid cell type detected : must be TRI3 or TETRA4 ! ");
- for(int j=0;j<lgth;j++)
+ for(ConnType j=0;j<lgth;j++)
IntegralUniformIntersector<MyMeshType,MyMatrix>::putValueIn(OTT<ConnType,numPol>::coo2C(locConn[j]),val,res);
}
}
INTERPKERNEL_EXPORT Interpolation2D3D();
INTERPKERNEL_EXPORT Interpolation2D3D(const InterpolationOptions& io);
template<class MyMeshType, class MyMatrixType>
- int interpolateMeshes(const MyMeshType& srcMesh,
+ typename MyMeshType::MyConnType interpolateMeshes(const MyMeshType& srcMesh,
const MyMeshType& targetMesh,
MyMatrixType& matrix,
const std::string& method);
*
*/
template<class MyMeshType, class MyMatrixType>
- ConnType Interpolation2D3D::interpolateMeshes(const MyMeshType& srcMesh,
+ typename MyMeshType::MyConnType Interpolation2D3D::interpolateMeshes(const MyMeshType& srcMesh,
const MyMeshType& targetMesh,
MyMatrixType& matrix,
const std::string& method)
InterpolationCU(const InterpolationOptions & io);
template<class MyCMeshType, class MyUMeshType, class MatrixType>
- int interpolateMeshes(const MyCMeshType& meshS, const MyUMeshType& meshT, MatrixType& result, const char *method);
+ typename MyCMeshType::MyConnType interpolateMeshes(const MyCMeshType& meshS, const MyUMeshType& meshT, MatrixType& result, const char *method);
template<class MyUMeshType, class MyCMeshType, class MatrixType>
- int interpolateMeshesRev(const MyUMeshType& meshS, const MyCMeshType& meshT, MatrixType& result, const char *method);
+ typename MyUMeshType::MyConnType interpolateMeshesRev(const MyUMeshType& meshS, const MyCMeshType& meshT, MatrixType& result, const char *method);
};
}
//================================================================================
template<class MyCMeshType, class MyUMeshType, class MatrixType>
- ConnType InterpolationCU::interpolateMeshes(const MyCMeshType& src_mesh,
+ typename MyCMeshType::MyConnType InterpolationCU::interpolateMeshes(const MyCMeshType& src_mesh,
const MyUMeshType& tgt_mesh,
MatrixType& result,
const char * method)
{
typedef typename MyCMeshType::MyConnType CConnType;
+ typedef typename MyUMeshType::MyConnType UConnType;
if ( std::string("P0P0") != method )
throw Exception("Only P0P0 method is implemented so far");
}
// create empty maps for all target elements
result.resize( intersector->getNumberOfRowsOfResMatrix() );
- const ConnType ret = intersector->getNumberOfColsOfResMatrix();
+ const CConnType ret = intersector->getNumberOfColsOfResMatrix();
const double* src_coords[ dim ];
- ConnType src_nb_coords[ dim ];
- std::map< double, ConnType> src_coord_to_index[ dim ];
+ CConnType src_nb_coords[ dim ];
+ std::map< double, CConnType> src_coord_to_index[ dim ];
for ( int j = 0; j < dim; ++j )
{
src_coords [j] = src_mesh.getCoordsAlongAxis( _TMIC( j ));
src_nb_coords[j] = static_cast<CConnType>(src_mesh.nbCellsAlongAxis ( _TMIC( j ))) + 1;
- for (ConnType i = 0; i < src_nb_coords[j]; ++i )
+ for (CConnType i = 0; i < src_nb_coords[j]; ++i )
src_coord_to_index[j].insert( std::make_pair( src_coords[j][i], i ));
}
- const ConnType tgtu_nb_cells = tgt_mesh.getNumberOfElements();
+ const UConnType tgtu_nb_cells = tgt_mesh.getNumberOfElements();
IntersectorCU<MyCMeshType, MyUMeshType, MatrixType> bbHelper(src_mesh, tgt_mesh);
double bb[2*dim];
// loop on unstructured tgt cells
- for(ConnType iT=0; iT<tgtu_nb_cells; iT++)
+ for(UConnType iT=0; iT<tgtu_nb_cells; iT++)
{
result[ iT ].clear();
// find structured src cells intersecting iT cell
std::vector< std::vector< CConnType > > structIndices(1);
- std::map< double, ConnType>::iterator coo_ind;
+ typename std::map< double, CConnType>::iterator coo_ind;
for ( int j = 0; j < dim; ++j )
{
coo_ind = src_coord_to_index[j].lower_bound( bb[2*j+1] - eps );
if ( coo_ind == src_coord_to_index[j].end() )
--coo_ind;
- ConnType max_i = coo_ind->second;
+ CConnType max_i = coo_ind->second;
coo_ind = src_coord_to_index[j].upper_bound( bb[2*j ] + eps );
if ( coo_ind != src_coord_to_index[j].begin() )
--coo_ind;
- ConnType min_i = coo_ind->second;
+ CConnType min_i = coo_ind->second;
std::vector< std::vector< CConnType > > newStructIndices;
for ( unsigned int iInd = 0; iInd < structIndices.size(); ++iInd )
{
- for ( ConnType i = min_i; i < max_i; ++i )
+ for ( CConnType i = min_i; i < max_i; ++i )
{
std::vector< CConnType > index = structIndices[iInd];
index.push_back( i );
//================================================================================
template<class MyUMeshType, class MyCMeshType, class MatrixType>
- ConnType InterpolationCU::interpolateMeshesRev(const MyUMeshType& meshS, const MyCMeshType& meshT, MatrixType& result, const char *method)
+ typename MyUMeshType::MyConnType InterpolationCU::interpolateMeshesRev(const MyUMeshType& meshS, const MyCMeshType& meshT, MatrixType& result, const char *method)
{
+ typedef typename MyCMeshType::MyConnType CConnType;
+ typedef typename MyUMeshType::MyConnType UConnType;
+
MatrixType revResult;
- ConnType sizeT = interpolateMeshes( meshT, meshS, revResult, method );
- ConnType sizeS = revResult.size();
+ CConnType sizeT = interpolateMeshes( meshT, meshS, revResult, method );
+ UConnType sizeS = revResult.size();
result.resize( sizeT );
- for ( ConnType iS = 0; iS < sizeS; ++iS )
+ for ( CConnType iS = 0; iS < sizeS; ++iS )
{
typename MatrixType::value_type & row = revResult[iS];
typename MatrixType::value_type::iterator iT_surf = row.begin();
\r
// Main function to interpolate\r
template<class MyMeshType, class MatrixType>\r
- int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT,\r
+ typename MyMeshType::MyConnType interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT,\r
MatrixType& result, const std::string& method);\r
\r
};\r
*/
template<class RealCurve>
template<class MyMeshType, class MatrixType>
- int InterpolationCurve<RealCurve>::interpolateMeshes (const MyMeshType& myMeshS,
+ typename MyMeshType::MyConnType InterpolationCurve<RealCurve>::interpolateMeshes (const MyMeshType& myMeshS,
const MyMeshType& myMeshT,
MatrixType& result,
const std::string& method)
/****************************************************/
long start_intersection = clock();
const ConnType *connIndxT = myMeshT.getConnectivityIndexPtr();
- for(int iT=0; iT<nbMailleT; iT++)
+ for(ConnType iT=0; iT<nbMailleT; iT++)
{
int nb_nodesT = connIndxT[iT+1] - connIndxT[iT];
- std::vector<int> intersecting_elems;
+ std::vector<ConnType> intersecting_elems;
double bb[2*SPACEDIM];
intersector->getElemBB(bb,myMeshT,OTT<ConnType,numPol>::indFC(iT),nb_nodesT);
my_tree.getIntersectingElems(bb, intersecting_elems);
intersector->intersectCells(iT,intersecting_elems,result);
counter += intersecting_elems.size();
}
- int ret = intersector->getNumberOfColsOfResMatrix();
+ ConnType ret = intersector->getNumberOfColsOfResMatrix();
delete intersector;
if (InterpolationOptions::getPrintLevel() >= 1)
\r
// Main function to interpolate triangular and quadratic meshes\r
template<class MyMeshType, class MatrixType>\r
- int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);\r
+ typename MyMeshType::MyConnType interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);\r
public:\r
bool doRotate() const { return asLeafInterpPlanar().doRotate(); }\r
double medianPlane() const { return asLeafInterpPlanar().medianPlane(); }\r
*/
template<class RealPlanar>
template<class MyMeshType, class MatrixType>
- int InterpolationPlanar<RealPlanar>::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const std::string& method)
+ typename MyMeshType::MyConnType InterpolationPlanar<RealPlanar>::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const std::string& method)
{
static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
typedef typename MyMeshType::MyConnType ConnType;
/* Loop on the target cells - core of the algorithm */
/****************************************************/
long start_intersection=clock();
- long nbelem_type=myMeshT.getNumberOfElements();
+ ConnType nbelem_type=myMeshT.getNumberOfElements();
const ConnType *connIndxT=myMeshT.getConnectivityIndexPtr();
- for(int iT=0; iT<nbelem_type; iT++)
+ for(ConnType iT=0; iT<nbelem_type; iT++)
{
int nb_nodesT=connIndxT[iT+1]-connIndxT[iT];
- std::vector<int> intersecting_elems;
+ std::vector<ConnType> intersecting_elems;
double bb[2*SPACEDIM];
intersector->getElemBB(bb,myMeshT,OTT<ConnType,numPol>::indFC(iT),nb_nodesT);
my_tree.getIntersectingElems(bb, intersecting_elems);
counter+=intersecting_elems.size();
intersecting_elems.clear();
}
- int ret=intersector->getNumberOfColsOfResMatrix();
+ ConnType ret=intersector->getNumberOfColsOfResMatrix();
delete intersector;
if (InterpolationOptions::getPrintLevel() >=1)
{
public:
Intersector3DP0P0(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfRowsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP0P0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP0P0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_target_mesh.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP0P0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP0P0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_src_mesh.getNumberOfElements();
}
{
public:
Intersector3DP0P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfRowsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP0P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP0P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_target_mesh.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP0P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP0P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_src_mesh.getNumberOfElements();
}
{
public:
Intersector3DP1P0(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfRowsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P0<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_target_mesh.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P0<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_src_mesh.getNumberOfNodes();
}
{
public:
Intersector3DP1P0Bary(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfRowsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P0Bary<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P0Bary<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_target_mesh.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P0Bary<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P0Bary<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_src_mesh.getNumberOfNodes();
}
{
public:
Intersector3DP1P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfRowsOfResMatrix() const;
+ typename MyMeshType::MyConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_target_mesh.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int Intersector3DP1P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Intersector3DP1P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return Intersector3D<MyMeshType,MyMatrix>::_src_mesh.getNumberOfNodes();
}
void getUElemBB(double* bb, UConnType iP);
void getUCoordinates(UConnType icell, std::vector<double>& coords);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ UConnType getNumberOfRowsOfResMatrix() const;
+ CConnType getNumberOfColsOfResMatrix() const;
void intersectCells(CConnType icellU, const std::vector<CConnType>& icellC, MyMatrix& res);
double intersectGeometry(CConnType icellT, const std::vector<CConnType>& icellC) { return asLeaf().intersectGeometry(icellT,icellC); }
protected:
const MyUMeshType& _meshU;
const double * _coordsC[SPACEDIM];
- int _nbCellsC[SPACEDIM];
+ CConnType _nbCellsC[SPACEDIM];
const MyCMeshType& _meshC;
};
}
_CU_TEMPLATE
- int _INTERSECTOR_CU_::getNumberOfRowsOfResMatrix() const
+ typename MyUMeshType::MyConnType _INTERSECTOR_CU_::getNumberOfRowsOfResMatrix() const
{
return _meshU.getNumberOfElements();
}
_CU_TEMPLATE
- int _INTERSECTOR_CU_::getNumberOfColsOfResMatrix() const
+ typename MyCMeshType::MyConnType _INTERSECTOR_CU_::getNumberOfColsOfResMatrix() const
{
return static_cast<CConnType>(_meshC.getNumberOfElements());
}
public:
MappedBarycentric2DIntersectorP1P1(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double md3DSurf, double minDot3DSurf, double medianPlane, double precision, int orientation);
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
if(SPACEDIM==3)
PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&CoordsS[0],&CoordsTTmp[0],ToConnType(CoordsS.size())/SPACEDIM,nbOfNodesT);
const ConnType *startOfCellNodeConnT=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
- for(int nodeIdT=0;nodeIdT<nbOfNodesT;nodeIdT++)
+ for(ConnType nodeIdT=0;nodeIdT<nbOfNodesT;nodeIdT++)
{
typename MyMatrix::value_type& resRow=res[OTT<ConnType,numPol>::ind2C(startOfCellNodeConnT[nodeIdT])];
if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&CoordsTTmp[nodeIdT*SPACEDIM],&CoordsS[0],4,PlanarIntersector<MyMeshType,MyMatrix>::_precision) )
resLoc[3] = mco[0] * (1.-mco[1]);
const ConnType *startOfCellNodeConnS=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[*iter]);
- for(int nodeIdS=0;nodeIdS<4;nodeIdS++)
+ for(ConnType nodeIdS=0;nodeIdS<4;nodeIdS++)
{
if(fabs(resLoc[nodeIdS])>PlanarIntersector<MyMeshType,MyMatrix>::_precision)
{
}
template<class MyMeshType, class MyMatrix>
- int MappedBarycentric2DIntersectorP1P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType MappedBarycentric2DIntersectorP1P1<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int MappedBarycentric2DIntersectorP1P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType MappedBarycentric2DIntersectorP1P1<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
Planar2D1DIntersectorP0P0(const MyMeshType& meshT, const MyMeshType& meshS,
double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
const typename PlanarIntersector<MyMeshType,MyMatrix>::DuplicateFacesType* getIntersectFaces() const
{
return &_intersect_faces;
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
- int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
- int Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
void Planar2D1DIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
{
- int nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
+ ConnType nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
typename MyMatrix::value_type& resRow=res[icellT];
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
- int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
+ ConnType iS=*iter;
+ ConnType nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
bool isColinear = false;
double surf=intersectGeometry1D(OTT<ConnType,numPol>::indFC(icellT),OTT<ConnType,numPol>::indFC(iS),
nbNodesT,nbNodesS, isColinear);
}
else
{
- std::set<int> targetCellSet;
+ std::set<ConnType> targetCellSet;
targetCellSet.insert(icellT);
_intersect_faces.insert(std::make_pair(iS, targetCellSet));
}
protected:
PlanarIntersectorP0P0(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
/*!
* Contrary to intersectCells method here icellS and icellT are \b not in \b C mode but in mode of MyMeshType.
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
- int PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
- int PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P0Intersector>
void PlanarIntersectorP0P0<MyMeshType,MyMatrix,ConcreteP0P0Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
{
- int nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
+ ConnType nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
typename MyMatrix::value_type& resRow=res[icellT];
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
- int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
+ ConnType iS=*iter;
+ ConnType nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
double surf=intersectGeometry(OTT<ConnType,numPol>::indFC(icellT),OTT<ConnType,numPol>::indFC(iS),nbNodesT,nbNodesS);
surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
if(surf!=0.)
PlanarIntersectorP0P1(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
/*!
* Contrary to intersectCells method here icellS and icellT are \b not in \b C mode but in mode of MyMeshType.
*/
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P1Intersector>
- int PlanarIntersectorP0P1<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P1Intersector>
- int PlanarIntersectorP0P1<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P1Intersector>
void PlanarIntersectorP0P1<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
{
- int nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
+ ConnType nbNodesT=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT];
double triangle[9];
double quadrangle[12];
std::vector<double> sourceCellCoords;
int orientation=1;
const ConnType *startOfCellNodeConn=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
- for(int nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
+ for(ConnType nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
{
ConnType curNodeTInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[nodeIdT]);
std::copy(PlanarIntersector<MyMeshType,MyMatrix>::_coordsT+curNodeTInCmode*SPACEDIM,
typename MyMatrix::value_type& resRow=res[curNodeTInCmode];
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
+ ConnType iS=*iter;
PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(iS),sourceCellCoords);
- for(int subTriT=1;subTriT<=nbNodesT-2;subTriT++)
+ for(ConnType subTriT=1;subTriT<=nbNodesT-2;subTriT++)
{
std::copy(PlanarIntersector<MyMeshType,MyMatrix>::_coordsT+OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[(nodeIdT+subTriT)%nbNodesT])*SPACEDIM,
PlanarIntersector<MyMeshType,MyMatrix>::_coordsT+OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[(nodeIdT+subTriT)%nbNodesT])*SPACEDIM+SPACEDIM,
PlanarIntersectorP0P1Bary(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
/*!
* Contrary to intersectCells method here icellS and icellT are \b not in \b C mode but in mode of MyMeshType.
*/
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P1Intersector>
- int PlanarIntersectorP0P1Bary<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1Bary<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix, class ConcreteP0P1Intersector>
- int PlanarIntersectorP0P1Bary<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1Bary<MyMeshType,MyMatrix,ConcreteP0P1Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
}
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
std::vector<double> srcCellCoords,srcCellCoordsTmp,nodeCeffs;
- int iS=*iter;
+ ConnType iS=*iter;
NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(iS));
bool isSourceQuad=CellModel::GetCellModel(tS).isQuadratic();
PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(iS),srcCellCoords);
std::vector<double> *srcCoords(&srcCellCoords);
- int srcNbNodes = ToConnType(srcCellCoords.size())/SPACEDIM;
+ ConnType srcNbNodes = ToConnType(srcCellCoords.size())/SPACEDIM;
if(SPACEDIM==3)
{
srcCellCoordsTmp=srcCellCoords;
public:
PlanarIntersectorP0P1PL(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double md3DSurf, double minDot3DSurf, double medianPlane, double precision, int orientation);
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
const ConnType *startOfCellNodeConnT=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
std::vector<double> coordsTarget;
PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),coordsTarget);
- int nbNodesT=ToConnType(coordsTarget.size())/SPACEDIM;
+ ConnType nbNodesT=ToConnType(coordsTarget.size())/SPACEDIM;
ii=0;
for(typename std::vector<ConnType>::const_iterator iter2=icellsS.begin();iter2!=icellsS.end();iter2++,ii++)
{
std::vector<double> tmpTarget(coordsTarget);
if(SPACEDIM==3)
PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&tmpSource[0],&tmpTarget[0],ToConnType(tmpSource.size())/SPACEDIM,nbNodesT);
- for(int nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
+ for(ConnType nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
{
if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],ToConnType(tmpSource.size())/SPACEDIM,PlanarIntersector<MyMeshType,MyMatrix>::_precision))
{
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP0P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP0P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP0P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfElements();
}
PlanarIntersectorP1P0(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
/*!
* Contrary to intersectCells method here icellS and icellT are \b not in \b C mode but in mode of MyMeshType.
*/
}
template<class MyMeshType, class MyMatrix, class ConcreteP1P0Intersector>
- int PlanarIntersectorP1P0<MyMeshType,MyMatrix,ConcreteP1P0Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P0<MyMeshType,MyMatrix,ConcreteP1P0Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix, class ConcreteP1P0Intersector>
- int PlanarIntersectorP1P0<MyMeshType,MyMatrix,ConcreteP1P0Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P0<MyMeshType,MyMatrix,ConcreteP1P0Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
typename MyMatrix::value_type& resRow=res[icellT];
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
+ ConnType iS=*iter;
int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
const ConnType *startOfCellNodeConn=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS]);
for(int nodeIdS=0;nodeIdS<nbNodesS;nodeIdS++)
PlanarIntersectorP1P0Bary(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
/*!
* Contrary to intersectCells method here icellS and icellT are \b not in \b C mode but in mode of MyMeshType.
*/
}
PLAN_INTER_TEMPLATE
- int PLAN_INTERSECTOR::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PLAN_INTERSECTOR::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
}
PLAN_INTER_TEMPLATE
- int PLAN_INTERSECTOR::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PLAN_INTERSECTOR::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
// target cell data
PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),tgtCellCoords);
std::vector<double> * tgtCoords = & tgtCellCoords;
- int tgtNbNodes = ToConnType(tgtCellCoords.size())/SPACEDIM;
+ ConnType tgtNbNodes = ToConnType(tgtCellCoords.size())/SPACEDIM;
NormalizedCellType tT=PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getTypeOfElement(OTT<ConnType,numPol>::indFC(icellT));
bool isTargetQuad=CellModel::GetCellModel(tT).isQuadratic();
// treat each source triangle
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
+ ConnType iS=*iter;
PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(iS),srcTriaCoords);
const ConnType *startOfCellNodeConn=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS]);
if(SPACEDIM==3)
public:
PlanarIntersectorP1P0PL(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double md3DSurf, double minDot3DSurf, double medianPlane, double precision, int orientation);
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP1P0PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P0PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfElements();
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP1P0PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P0PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
PlanarIntersectorP1P1(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
public:
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
double intersectGeometryGeneral(const std::vector<double>& targetCoords, const std::vector<double>& sourceCoords) { return asLeaf().intersectGeometryGeneral(targetCoords,sourceCoords); }
protected:
}
template<class MyMeshType, class MyMatrix, class ConcreteP1P1Intersector>
- int PlanarIntersectorP1P1<MyMeshType,MyMatrix,ConcreteP1P1Intersector>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P1<MyMeshType,MyMatrix,ConcreteP1P1Intersector>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix, class ConcreteP1P1Intersector>
- int PlanarIntersectorP1P1<MyMeshType,MyMatrix,ConcreteP1P1Intersector>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P1<MyMeshType,MyMatrix,ConcreteP1P1Intersector>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
typename MyMatrix::value_type& resRow=res[curNodeTInCmode];
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
- int iS=*iter;
+ ConnType iS=*iter;
int nbNodesS=PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS+1]-PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS];
const ConnType *startOfCellNodeConnS=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[iS]);
for(int nodeIdS=0;nodeIdS<nbNodesS;nodeIdS++)
public:
PlanarIntersectorP1P1PL(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double md3DSurf, double minDot3DSurf, double medianPlane, double precision, int orientation);
void intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res);
- int getNumberOfRowsOfResMatrix() const;
- int getNumberOfColsOfResMatrix() const;
+ ConnType getNumberOfRowsOfResMatrix() const;
+ ConnType getNumberOfColsOfResMatrix() const;
};
}
{
std::vector<double> CoordsT;
PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
- int nbOfNodesT=ToConnType(CoordsT.size())/SPACEDIM;
+ ConnType nbOfNodesT=ToConnType(CoordsT.size())/SPACEDIM;
for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
{
NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(*iter));
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfRowsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getNumberOfNodes();
}
template<class MyMeshType, class MyMatrix>
- int PlanarIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
+ typename MyMeshType::MyConnType PlanarIntersectorP1P1PL<MyMeshType,MyMatrix>::getNumberOfColsOfResMatrix() const
{
return PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getNumberOfNodes();
}
const CellModel& cellModelCell=CellModel::GetCellModel(normCellType);
const MyMeshType& src_mesh = Intersector3D<MyMeshType,MyMatrixType>::_src_mesh;
unsigned nbOfNodes4Type=cellModelCell.isDynamic() ? src_mesh.getNumberOfNodesOfElement(cellSrcIdx) : cellModelCell.getNumberOfNodes();
- int *polyNodes=new int[nbOfNodes4Type];
+ mcIdType *polyNodes=new mcIdType[nbOfNodes4Type];
double **polyCoords = new double*[nbOfNodes4Type];
for(int i = 0;i<(int)nbOfNodes4Type;++i)
{
// we could store mapping local -> global numbers too, but not sure it is worth it
- const int globalNodeNum = getGlobalNumberOfNode(i, OTT<ConnType,numPol>::indFC(*iterCellS), src_mesh);
- polyNodes[i] = globalNodeNum;
+ const ConnType globalNodeNum = getGlobalNumberOfNode(i, OTT<ConnType,numPol>::indFC(*iterCellS), src_mesh);
+ polyNodes[i] = ToIdType( globalNodeNum );
polyCoords[i] = const_cast<double*>(src_mesh.getCoordinatesPtr()+MyMeshType::MY_SPACEDIM*globalNodeNum);
}
{
std::size_t nbOfFaces=std::count(connec,connec+lgth,-1)+1;
double volume=0.;
- const int *work=connec;
+ const ConnType *work=connec;
for(std::size_t iFace=0;iFace<nbOfFaces;iFace++)
{
- const int *work2=std::find(work+1,connec+lgth,-1);
+ const ConnType *work2=std::find(work+1,connec+lgth,-1);
std::size_t nbOfNodesOfCurFace=std::distance(work,work2);
double areaVector[3]={0.,0.,0.};
for(std::size_t ptId=0;ptId<nbOfNodesOfCurFace;ptId++)
{
std::size_t nbOfFaces=std::count(connec,connec+lgth,-1)+1;
res[0]=0.; res[1]=0.; res[2]=0.;
- const int *work=connec;
+ const ConnType *work=connec;
for(std::size_t i=0;i<nbOfFaces;i++)
{
- const int *work2=std::find(work+1,connec+lgth,-1);
+ const ConnType *work2=std::find(work+1,connec+lgth,-1);
int nbOfNodesOfCurFace=(int)std::distance(work,work2);
// projection to (u,v) of each faces of polyh to compute integral(x^2/2) on each faces.
double normal[3];
work=connec;
for(std::size_t i=0;i<nbOfFaces;i++)
{
- const int *work2=std::find(work+1,connec+lgth,-1);
+ const ConnType *work2=std::find(work+1,connec+lgth,-1);
int nbOfNodesOfCurFace=(int)std::distance(work,work2);
double normal[3];
areaVectorOfPolygon<ConnType,numPol>(work,nbOfNodesOfCurFace,coords,normal);