if(!isDynamic())
return _nb_of_little_sons;
else//polyhedron
- return FromIdType<unsigned>(lgth-std::count(conn,conn+lgth,-1))/2;
+ return FromIdType<unsigned>(lgth-ToIdType(std::count(conn,conn+lgth,-1)/2));
}
/*!
}
const mcIdType *where2=std::find(where,nodalConn+lgth,-1);
std::copy(where,where2,sonNodalConn);
- return FromIdType<unsigned>(where2-where);
+ return (unsigned)(where2-where);
}
else
throw INTERP_KERNEL::Exception("CellModel::fillSonCellNodalConnectivity2 : no sons on NORM_POLYL !");
where++;
}
const mcIdType *where2=std::find(where,nodalConn+lgth,-1);
- return FromIdType<unsigned>(where2-where);
+ return (unsigned)(where2-where);
}
else
throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !");
idIns1.push_back(std::pair<mcIdType,std::pair<bool,mcIdType> >(edgeId1,std::pair<bool,mcIdType>(descBg1[j]>0,offset1)));// it exists an edge into pol1 given by tuple (idIn1,direct1) that is colinear at edge 'edgeId' in pol2
//std::pair<edgeId1); direct1=descBg1[j]>0;
}
- offset1+=intersectEdges1[edgeId1].size()/2;//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2
+ offset1+=ToIdType(intersectEdges1[edgeId1].size()/2);//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2
}
directos=idIns1.empty();
}
bool direction11,found=false;
bool direct1;//store if needed the direction in 1
mcIdType offset2;
- std::size_t nbOfSubEdges1;
+ mcIdType nbOfSubEdges1;
for(std::vector<std::pair<mcIdType,std::pair<bool,mcIdType> > >::const_iterator it=idIns1.begin();it!=idIns1.end() && !found;it++)
{
mcIdType idIn1=(*it).first;//store if needed the cell id in 1
direct1=(*it).second.first;
offset1=(*it).second.second;
const std::vector<mcIdType>& subEdge1PossiblyAlreadyIn1=intersectEdges1[idIn1];
- nbOfSubEdges1=subEdge1PossiblyAlreadyIn1.size()/2;
+ nbOfSubEdges1=ToIdType(subEdge1PossiblyAlreadyIn1.size()/2);
offset2=0;
- for(std::size_t k=0;k<nbOfSubEdges1 && !found;k++)
+ for(mcIdType k=0;k<nbOfSubEdges1 && !found;k++)
{//perform a loop on all subedges of pol1 that includes edge 'edgeId' of pol2. For the moment we iterate only on subedges of ['idIn1']... To improve
if(subEdge1PossiblyAlreadyIn1[2*k]==idBg && subEdge1PossiblyAlreadyIn1[2*k+1]==idEnd)
{ direction11=true; found=true; }
mcIdType idIn1=edgeId1;
bool direct1=descBg1[j]>0;
const std::vector<mcIdType>& subEdge1PossiblyAlreadyIn1=intersectEdges1[idIn1];
- std::size_t nbOfSubEdges1=subEdge1PossiblyAlreadyIn1.size()/2;
+ mcIdType nbOfSubEdges1=ToIdType(subEdge1PossiblyAlreadyIn1.size()/2);
mcIdType offset2=0;
bool found=false;
- for(std::size_t kk=0;kk<nbOfSubEdges1 && !found;kk++)
+ for(mcIdType kk=0;kk<nbOfSubEdges1 && !found;kk++)
{
found=(subEdge1PossiblyAlreadyIn1[2*kk]==idBg && subEdge1PossiblyAlreadyIn1[2*kk+1]==idEnd) || (subEdge1PossiblyAlreadyIn1[2*kk]==idEnd && subEdge1PossiblyAlreadyIn1[2*kk+1]==idBg);
if(!found)
}
if(found)
{
- ElementaryEdge *e=pol1[FromIdType<int>(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))];
+ ElementaryEdge *e=pol1[(int)(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))];
e->getPtr()->declareOn();
}
}
}
- offset1+=intersectEdges1[edgeId1].size()/2;//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2
+ offset1+=ToIdType(intersectEdges1[edgeId1].size()/2);//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2
}
}
}
std::set<mcIdType> nodes(conn,conn+lgth);
nodes.erase(-1);
std::size_t nbOfNodes=nodes.size();
- mcIdType magicNumber=100*nbOfNodes+nbOfFaces;
+ std::size_t magicNumber=100*nbOfNodes+nbOfFaces;
switch(magicNumber)
{
case 806:
std::vector< std::pair<mcIdType,mcIdType> >::iterator it=std::find(oppEdges.begin(),oppEdges.end(),pInOpp);
if(it==oppEdges.end())//the opposite edge of side face is not found opposite face ... maybe problem of orientation of polyhedron
return false;
- mcIdType pos2=std::distance(oppEdges.begin(),it);
+ mcIdType pos2=ToIdType(std::distance(oppEdges.begin(),it));
mcIdType offset=pos-pos2;
if(offset<0)
offset+=lgthBaseFace;
}
case NORM_POLYHED:
{
- mcIdType nbOfFaces(ToIdType(std::count(nodalConnBg,nodalConnEnd,-1)+1));
+ std::size_t nbOfFaces(std::count(nodalConnBg,nodalConnEnd,-1)+1);
std::size_t nbOfTetra(std::distance(nodalConnBg,nodalConnEnd)-nbOfFaces+1);
addCoords.resize((nbOfFaces+1)*3);
tetrasNodalConn.resize(nbOfTetra*4);
const mcIdType *work(nodalConnBg);
double *tmp(&addCoords[0]),*tmp2(&addCoords[3*nbOfFaces]);
tmp2[0]=0.; tmp2[1]=0.; tmp2[2]=0.;
- for(mcIdType i=0;i<nbOfFaces;i++,tmp+=3)
+ for(unsigned int i=0;i<nbOfFaces;i++,tmp+=3)
{
tmp[0]=0.; tmp[1]=0.; tmp[2]=0.;
- mcIdType nbOfNodesOfFace(std::distance(work,std::find(work,nodalConnEnd,-1)));
- for(mcIdType j=0;j<nbOfNodesOfFace;j++,conn+=4)
+ std::size_t nbOfNodesOfFace(std::distance(work,std::find(work,nodalConnEnd,-1)));
+ for(unsigned int j=0;j<nbOfNodesOfFace;j++,conn+=4)
{
- conn[0]=work[j]; conn[1]=work[(j+1)%nbOfNodesOfFace]; conn[2]=-(i+1); conn[3]=-(nbOfFaces+1);
+ conn[0]=work[j]; conn[1]=work[(j+1)%nbOfNodesOfFace]; conn[2]=-(i+1); conn[3]=ToIdType(-(nbOfFaces+1));
tmp[0]+=coords[3*work[j]+0]; tmp[1]+=coords[3*work[j]+1]; tmp[2]+=coords[3*work[j]+2];
}
- double nbNF = FromIdType<double>(nbOfNodesOfFace);
+ double nbNF = (double)nbOfNodesOfFace;
tmp[0]/=nbNF; tmp[1]/=nbNF; tmp[2]/=nbNF;
tmp2[0]+=tmp[0]; tmp2[1]+=tmp[1]; tmp2[2]+=tmp[2];
work+=nbOfNodesOfFace+1;
}
- double nbF = FromIdType<double>(nbOfFaces);
+ double nbF = (double)nbOfFaces;
tmp2[0]/=nbF; tmp2[1]/=nbF; tmp2[2]/=nbF;
return ;
}