-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
static const char msg0[]="No coordinates specified !";
std::ostringstream ret;
+ if(!_cm)
+ {
+ ret << "No geometric type specified" << std::endl;
+ return ret.str();
+ }
ret << "Single static geometic type (" << _cm->getRepr() << ") unstructured mesh with name : \"" << getName() << "\"\n";
ret << "Description of mesh : \"" << getDescription() << "\"\n";
int tmpp1,tmpp2;
std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *nodal << " should be in [0," << nbOfNodes << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),coeff));
+ std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,coeff));
}
return ret.retn();
}
{
mcIdType curConnLgth=(*it)->getNodalConnectivityLength();
const mcIdType *curC=(*it)->_conn->begin();
- cPtr=std::transform(curC,curC+curConnLgth,cPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+ cPtr=std::transform(curC,curC+curConnLgth,cPtr,std::bind(std::plus<mcIdType>(),std::placeholders::_1,offset));
offset+=(*it)->getNumberOfNodes();
}
//
void MEDCoupling1SGTUMesh::reprQuickOverview(std::ostream& stream) const
{
- stream << "MEDCoupling1SGTUMesh C++ instance at " << this << ". Type=" << _cm->getRepr() << ". Name : \"" << getName() << "\".";
+ stream << "MEDCoupling1SGTUMesh C++ instance at " << this << ". Type=";
+ if(!_cm)
+ {
+ stream << "Not set";
+ return ;
+ }
+ stream << _cm->getRepr() << ". Name : \"" << getName() << "\".";
stream << " Mesh dimension : " << getMeshDimension() << ".";
if(!_coords)
{ stream << " No coordinates set !"; return ; }
{
for(int j=0;j<nbOfNodesPerCell;j++,conn++)
{
- *std::find_if(revNodalPtr+revNodalIndxPtr[*conn],revNodalPtr+revNodalIndxPtr[*conn+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+ *std::find_if(revNodalPtr+revNodalIndxPtr[*conn],revNodalPtr+revNodalIndxPtr[*conn+1],std::bind(std::equal_to<mcIdType>(),std::placeholders::_1,-1))=eltId;
}
}
}
if(!c1->isEqualWithoutConsideringStr(*c2))
return false;
return true;
- c1=_conn_indx; c2=otherC->_conn_indx;
- if(c1==c2)
- return true;
- if(!c1 || !c2)
- return false;
- if(!c1->isEqualWithoutConsideringStr(*c2))
- return false;
- return true;
}
/*!
std::string MEDCoupling1DGTUMesh::simpleRepr() const
{
static const char msg0[]="No coordinates specified !";
+ if(!_cm)
+ return std::string("Cell type not specified");
std::ostringstream ret;
ret << "Single dynamic geometic type (" << _cm->getRepr() << ") unstructured mesh with name : \"" << getName() << "\"\n";
ret << "Description of mesh : \"" << getDescription() << "\"\n";
std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *nodal << " should be in [0," << nbOfNodes << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./double(nodali[1]-nodali[0])));
+ std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./double(nodali[1]-nodali[0])));
}
}
else
}
}
if(nbOfNod!=0)
- std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./nbOfNod));
+ std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./nbOfNod));
else
{
std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell (polyhedron) : no nodes in cell #" << i << " !";
void MEDCoupling1DGTUMesh::reprQuickOverview(std::ostream& stream) const
{
- stream << "MEDCoupling1DGTUMesh C++ instance at " << this << ". Type=" << _cm->getRepr() << ". Name : \"" << getName() << "\".";
+ stream << "MEDCoupling1DGTUMesh C++ instance at " << this << ". Type=";
+ if(!_cm)
+ {
+ stream << "Not defined";
+ return ;
+ }
+ stream << _cm->getRepr() << ". Name : \"" << getName() << "\".";
stream << " Mesh dimension : " << getMeshDimension() << ".";
if(!_coords)
{ stream << " No coordinates set !"; return ; }
{
mcIdType nodeId=conn[conni[eltId]+j];
if(nodeId!=-1)
- *std::find_if(revNodalPtr+revNodalIndxPtr[nodeId],revNodalPtr+revNodalIndxPtr[nodeId+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+ *std::find_if(revNodalPtr+revNodalIndxPtr[nodeId],revNodalPtr+revNodalIndxPtr[nodeId+1],std::bind(std::equal_to<mcIdType>(),std::placeholders::_1,-1))=eltId;
}
}
}
* Finds nodes not used in any cell and returns an array giving a new id to every node
* by excluding the unused nodes, for which the array holds -1. The result array is
* a mapping in "Old to New" mode.
- * \param [out] nbrOfNodesInUse - number of node ids present in the nodal connectivity.
* \return DataArrayIdType * - a new instance of DataArrayIdType. Its length is \a
* this->getNumberOfNodes(). It holds for each node of \a this mesh either -1
* if the node is unused or a new id else. The caller is to delete this