-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
std::transform(dimsP2NotRefined.begin(),dimsP2NotRefined.end(),factors.begin(),dimsP2Refined.begin(),std::multiplies<mcIdType>());
std::vector< std::pair<mcIdType,mcIdType> > p2RefinedAbs(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dimsP2NotRefined));
std::vector<mcIdType> dimsP2RefinedGhost(dimsP2Refined.size());
- std::transform(dimsP2Refined.begin(),dimsP2Refined.end(),dimsP2RefinedGhost.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));
+ std::transform(dimsP2Refined.begin(),dimsP2Refined.end(),dimsP2RefinedGhost.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));
MCAuto<DataArrayDouble> fineP2(DataArrayDouble::New()); fineP2->alloc(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(dimsP2RefinedGhost),dataOnP2->getNumberOfComponents());
MEDCouplingIMesh::SpreadCoarseToFineGhost(dataOnP2,dimsP2NotRefined,fineP2,p2RefinedAbs,factors,ghostLev);
if(isConservative)
{
mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(factors));
- std::transform(fineP2->begin(),fineP2->end(),fineP2->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+ std::transform(fineP2->begin(),fineP2->end(),fineP2->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
}
//
UpdateNeighborsOfOneWithTwoInternal(ghostLev,p1->getMesh()->getFather()->getFactors(),p1pp,p2pp,dataOnP1,fineP2);
mcIdType dim(ToIdType(factors.size()));
std::vector<mcIdType> dimsCoarse(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(p1));//[3,2]
std::transform(dimsCoarse.begin(),dimsCoarse.end(),factors.begin(),dimsCoarse.begin(),std::multiplies<mcIdType>());//[12,8]
- std::transform(dimsCoarse.begin(),dimsCoarse.end(),dimsCoarse.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));//[14,10]
+ std::transform(dimsCoarse.begin(),dimsCoarse.end(),dimsCoarse.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));//[14,10]
std::vector< std::pair<mcIdType,mcIdType> > rangeCoarse(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dimsCoarse));//[(0,14),(0,10)]
std::vector<mcIdType> fakeFactors(dim,1);
//
{
bool cutFound(false); cutPlace=-1;// do not set axisId before to be sure that cutFound was set to true
const std::vector< std::pair<mcIdType,mcIdType> >& part(patchToBeSplit->getConstPart());
- mcIdType sign,minimumPatchLength(bso.getMinimumPatchLength());
+ mcIdType sign=0,minimumPatchLength(bso.getMinimumPatchLength());
const mcIdType dim(patchToBeSplit->getDimension());
std::vector<mcIdType> zeroCrossDims(dim,-1);
if(isConservative)
{
mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(getFactors()));
- std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+ std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
}
}
if(isConservative)
{
mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(getFactors()));
- std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+ std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
}
}
*
* \param [in] patchId - The id of the patch \a cellFieldOnThis has to be put on.
* \param [in] cellFieldOnThis - The array of the cell field on \c this->getImageMesh() to be projected to patch having id \a patchId.
- * \param [in,out] cellFieldOnPatch - The array of the cell field on the requested patch to be filled.
* \param [in] ghostLev - The size of the ghost zone (must be >=0 !)
* \param [in] arrsOnPatches - \b WARNING arrsOnPatches[patchId] is \b NOT \b const. All others are const.
*
{
std::vector<mcIdType> st(_mesh->getCellGridStructure());
std::vector< std::pair<mcIdType,mcIdType> > p(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(st));
- std::transform(st.begin(),st.end(),st.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSz));
+ std::transform(st.begin(),st.end(),st.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSz));
MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(p,ghostSz);
MCAuto<DataArrayDouble> ret(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,arr,p));
return ret.retn();
/*!
* This method creates a multi level patches split at once.
- * This method calls as times as size of \a bso createPatchesFromCriterion. Size of \a bso and size of \a factors must be the same !
+ * This method calls as many times as size of \a bso createPatchesFromCriterion. Size of \a bso and size of \a factors must be the same !
* \b WARNING, after the call the number of levels in \a this is equal to bso.size() + 1 !
*
- * \param [in] bso
- * \param [in] criterion
- * \param [in] factors
+ * \param [in] bso vector of BoxSplittingOptions
+ * \param [in] criterion DataArrayDouble
+ * \param [in] factors vector of vector of factors
* \param [in] eps - See DataArrayDouble::toVectorOfBool for more information about the semantic of eps.
*
* \sa createPatchesFromCriterion