#ifndef __MEDCOUPLING_MCTYPE_HXX__
#define __MEDCOUPLING_MCTYPE_HXX__
-typedef long Int64;
-
-typedef int Int32;
+namespace MEDCoupling
+{
+ typedef long Int64;
+ typedef int Int32;
+}
#define DataArrayInt DataArrayInt32
{
}
-MEDCouplingCMesh::MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy)
+MEDCouplingCMesh::MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy)
{
- if(deepCopy)
+ if(deepCpy)
{
if(other._x_array)
_x_array=other._x_array->deepCopy();
MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
private:
MEDCouplingCMesh();
- MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCopy);
+ MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy);
~MEDCouplingCMesh();
void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
std::string getVTKDataSetType() const;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDCouplingCurveLinearMesh.hxx"
#include "MEDCouplingPointSet.hxx"
{
}
-MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy),_structure(other._structure)
+MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy),_structure(other._structure)
{
- if(deepCopy)
+ if(deepCpy)
{
if((const DataArrayDouble *)other._coords)
_coords=other._coords->deepCopy();
void getBarycenterAndOwnerMeshDim1(DataArrayDouble *bary) const;
private:
MEDCouplingCurveLinearMesh();
- MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCopy);
+ MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy);
~MEDCouplingCurveLinearMesh();
void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
std::string getVTKDataSetType() const;
_discr_per_cell->checkAllocated();
if(_discr_per_cell->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but with nb of components different from 1 !");
- if(_discr_per_cell->getNumberOfTuples()!=vol->getNumberOfTuples())
+ if(_discr_per_cell->getNumberOfTuples()!=(int)vol->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but mismatch between nb of cells of mesh and size of spatial disr array !");
MCAuto<DataArrayInt> offset=getOffsetArr(mesh);
MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(getNumberOfTuples(mesh),1);
* \endif
* \sa clone()
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const
{
- MEDCouplingTimeDiscretization *tdo=timeDiscr()->buildNewTimeReprFromThis(td,deepCopy);
+ MEDCouplingTimeDiscretization *tdo=timeDiscr()->buildNewTimeReprFromThis(td,deepCpy);
MCAuto<MEDCouplingFieldDiscretization> disc;
if(_type)
disc=_type->clone();
{
}
-MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy):MEDCouplingFieldT<double>(other,deepCopy)
+MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCpy):MEDCouplingFieldT<double>(other,deepCpy)
{
}
if(!disc2)
throw INTERP_KERNEL::Exception("convertQuadraticCellsToLinear : Not a ON_GAUSS_PT field");
std::set<INTERP_KERNEL::NormalizedCellType> gt2(umesh->getAllGeoTypes());
- const DataArrayDouble *arr(getArray());
std::vector< MCAuto<DataArrayInt> > cellIdsV;
std::vector< MCAuto<MEDCouplingUMesh> > meshesV;
std::vector< MEDCouplingGaussLocalization > glV;
ptsInReal=gl.localizePtsInRefCooForEachCell(vorCellsForCurDisc->getCoords(),subMesh);
}
int nbPtsPerCell(vorCellsForCurDisc->getNumberOfNodes());
- for(std::size_t i=0;i<ids.size();i++)
+ for(std::size_t j=0;j<ids.size();j++)
{
MCAuto<MEDCouplingUMesh> elt(vorCellsForCurDisc->clone(false));
- MCAuto<DataArrayDouble> coo(ptsInReal->selectByTupleIdSafeSlice(i*nbPtsPerCell,(i+1)*nbPtsPerCell,1));
- elt->setCoords(coo);
- cells[ids[i]]=elt;
+ MCAuto<DataArrayDouble> coo4(ptsInReal->selectByTupleIdSafeSlice(j*nbPtsPerCell,(j+1)*nbPtsPerCell,1));
+ elt->setCoords(coo4);
+ cells[ids[j]]=elt;
}
}
std::vector< const MEDCouplingUMesh * > cellsPtr(VecAutoToVecOfCstPt(cells));
MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(double vmin, double vmax) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *nodeToCellDiscretization() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *cellToNodeDiscretization() const;
MEDCOUPLING_EXPORT MEDCouplingFieldInt *convertToIntField() const;
private:
MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td);
MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td);
- MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy);
+ MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCpy);
MEDCouplingFieldDouble(NatureOfField n, MEDCouplingTimeDiscretization *td, MEDCouplingFieldDiscretization *type);
MCAuto<MEDCouplingFieldDouble> voronoizeGen(const Voronizer *vor, double eps) const;
MEDCouplingTimeDiscretization *timeDiscr();
{
}
-MEDCouplingFieldFloat::MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCopy):MEDCouplingFieldT<float>(other,deepCopy)
+MEDCouplingFieldFloat::MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCpy):MEDCouplingFieldT<float>(other,deepCpy)
{
}
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const;
protected:
MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td);
- MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCopy);
+ MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCpy);
MEDCouplingFieldFloat(NatureOfField n, MEDCouplingTimeDiscretizationFloat *td, MEDCouplingFieldDiscretization *type);
MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td);
~MEDCouplingFieldFloat() { }
{
}
-MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy):MEDCouplingFieldT<int>(other,deepCopy)
+MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCpy):MEDCouplingFieldT<int>(other,deepCpy)
{
}
MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbPts*nbCells,outDim);
double *retPtr(ret->getPointer());
- if(dim!=ptsInRefCoo->getNumberOfComponents())
+ if(dim!=(int)ptsInRefCoo->getNumberOfComponents())
throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !");
const std::vector<double>& wg(getWeights());
INTERP_KERNEL::GaussCoords calculator;
{
MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getType()));
- if(getDimension()!=cm.getDimension())
+ if(getDimension()!=(int)cm.getDimension())
throw INTERP_KERNEL::Exception("BuildRefCell : dimension mistmatch !");
coo->alloc(cm.getNumberOfNodes(),getDimension());
std::copy(_ref_coord.begin(),_ref_coord.end(),coo->getPointer());
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDCouplingIMesh.hxx"
#include "MEDCouplingCMesh.hxx"
_structure[0]=0; _structure[1]=0; _structure[2]=0;
}
-MEDCouplingIMesh::MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy),_space_dim(other._space_dim),_axis_unit(other._axis_unit)
+MEDCouplingIMesh::MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy),_space_dim(other._space_dim),_axis_unit(other._axis_unit)
{
_origin[0]=other._origin[0]; _origin[1]=other._origin[1]; _origin[2]=other._origin[2];
_dxyz[0]=other._dxyz[0]; _dxyz[1]=other._dxyz[1]; _dxyz[2]=other._dxyz[2];
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the parameters 1 or 3 are NULL or not allocated !");
int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseSt)),nbOfTuplesInFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(fineLocInCoarse));
int nbCompo(fineDA->getNumberOfComponents());
- if(coarseDA->getNumberOfComponents()!=nbCompo)
+ if((int)coarseDA->getNumberOfComponents()!=nbCompo)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the number of components of fine DA and coarse one mismatches !");
if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size())
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !");
std::vector<int> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<int>(),2*ghostSize));
int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
int nbCompo(fineDA->getNumberOfComponents());
- if(coarseDA->getNumberOfComponents()!=nbCompo)
+ if((int)coarseDA->getNumberOfComponents()!=nbCompo)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : the number of components of fine DA and coarse one mismatches !");
if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size())
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !");
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the parameters 1 or 3 are NULL or not allocated !");
int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseSt)),nbOfTuplesInFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(fineLocInCoarse));
int nbCompo(fineDA->getNumberOfComponents());
- if(coarseDA->getNumberOfComponents()!=nbCompo)
+ if((int)coarseDA->getNumberOfComponents()!=nbCompo)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the number of components of fine DA and coarse one mismatches !");
if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size())
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !");
std::vector<int> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<int>(),2*ghostSize));
int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
int nbCompo(fineDA->getNumberOfComponents());
- if(coarseDA->getNumberOfComponents()!=nbCompo)
+ if((int)coarseDA->getNumberOfComponents()!=nbCompo)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : the number of components of fine DA and coarse one mismatches !");
if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size())
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !");
std::vector<int> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<int>(),2*ghostSize));
int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
int nbCompo(fineDA->getNumberOfComponents());
- if(coarseDA->getNumberOfComponents()!=nbCompo)
+ if((int)coarseDA->getNumberOfComponents()!=nbCompo)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : the number of components of fine DA and coarse one mismatches !");
if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size())
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !");
{
}
-MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id)
+MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCpy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id)
{
- if(deepCopy)
+ if(deepCpy)
{
_mesh2D=other._mesh2D->clone(true);
_mesh1D=other._mesh1D->clone(true);
private:
MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D);
- MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy);
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCpy);
MEDCouplingMappedExtrudedMesh();
void computeExtrusion(const MEDCouplingUMesh *mesh3D);
void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D);
void DataArray::copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other)
{
- int nbOfCompo=getNumberOfComponents();
+ std::size_t nbOfCompo(getNumberOfComponents());
std::size_t partOfCompoToSet=compoIds.size();
- if((int)partOfCompoToSet!=other.getNumberOfComponents())
+ if(partOfCompoToSet!=other.getNumberOfComponents())
throw INTERP_KERNEL::Exception("Given compoIds has not the same size as number of components of given array !");
for(std::size_t i=0;i<partOfCompoToSet;i++)
- if(compoIds[i]>=nbOfCompo || compoIds[i]<0)
+ if(compoIds[i]>=(int)nbOfCompo || compoIds[i]<0)
{
std::ostringstream oss; oss << "Specified component id is out of range (" << compoIds[i] << ") compared with nb of actual components (" << nbOfCompo << ")";
throw INTERP_KERNEL::Exception(oss.str().c_str());
*/
void DataArray::setInfoOnComponents(const std::vector<std::string>& info)
{
- if(getNumberOfComponents()!=(int)info.size())
+ if(getNumberOfComponents()!=info.size())
{
std::ostringstream oss; oss << "DataArray::setInfoOnComponents : input is of size " << info.size() << " whereas number of components is equal to " << getNumberOfComponents() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
*/
void DataArray::setInfoAndChangeNbOfCompo(const std::vector<std::string>& info)
{
- if(getNumberOfComponents()!=(int)info.size())
+ if(getNumberOfComponents()!=info.size())
{
if(!isAllocated())
_info_on_compo=info;
void DataArray::checkNbOfComps(int nbOfCompo, const std::string& msg) const
{
- if(getNumberOfComponents()!=nbOfCompo)
+ if((int)getNumberOfComponents()!=nbOfCompo)
{
std::ostringstream oss; oss << msg << " : mismatch number of components : expected " << nbOfCompo << " having " << getNumberOfComponents() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
if(!other)
throw INTERP_KERNEL::Exception("DataArrayDouble::findClosestTupleId : other instance is NULL !");
checkAllocated(); other->checkAllocated();
- int nbOfCompo=getNumberOfComponents();
+ std::size_t nbOfCompo(getNumberOfComponents());
if(nbOfCompo!=other->getNumberOfComponents())
{
std::ostringstream oss; oss << "DataArrayDouble::findClosestTupleId : number of components in this is " << nbOfCompo;
throw INTERP_KERNEL::Exception("DataArrayDouble::computeNbOfInteractionsWith : input array is NULL !");
if(!isAllocated() || !otherBBoxFrmt->isAllocated())
throw INTERP_KERNEL::Exception("DataArrayDouble::computeNbOfInteractionsWith : this and input array must be allocated !");
- int nbOfComp(getNumberOfComponents()),nbOfTuples(getNumberOfTuples());
+ std::size_t nbOfComp(getNumberOfComponents());
+ int nbOfTuples(getNumberOfTuples());
if(nbOfComp!=otherBBoxFrmt->getNumberOfComponents())
{
std::ostringstream oss; oss << "DataArrayDouble::computeNbOfInteractionsWith : this number of components (" << nbOfComp << ") must be equal to the number of components of input array (" << otherBBoxFrmt->getNumberOfComponents() << ") !";
if(a.empty())
throw INTERP_KERNEL::Exception("DataArrayDouble::Aggregate : input list must contain at least one NON EMPTY DataArrayDouble !");
std::vector<const DataArrayDouble *>::const_iterator it=a.begin();
- int nbOfComp=(*it)->getNumberOfComponents();
+ std::size_t nbOfComp((*it)->getNumberOfComponents());
int nbt=(*it++)->getNumberOfTuples();
for(int i=1;it!=a.end();it++,i++)
{
throw INTERP_KERNEL::Exception("DataArrayDouble::Dot : input DataArrayDouble instance is NULL !");
a1->checkAllocated();
a2->checkAllocated();
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Dot !");
int nbOfTuple=a1->getNumberOfTuples();
for(int i=0;i<nbOfTuple;i++)
{
double sum=0.;
- for(int j=0;j<nbOfComp;j++)
+ for(std::size_t j=0;j<nbOfComp;j++)
sum+=a1Ptr[i*nbOfComp+j]*a2Ptr[i*nbOfComp+j];
retPtr[i]=sum;
}
{
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DataArrayDouble::CrossProduct : input DataArrayDouble instance is NULL !");
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array crossProduct !");
if(nbOfComp!=3)
{
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DataArrayDouble::Max : input DataArrayDouble instance is NULL !");
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Max !");
int nbOfTuple=a1->getNumberOfTuples();
{
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DataArrayDouble::Min : input DataArrayDouble instance is NULL !");
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array min !");
int nbOfTuple=a1->getNumberOfTuples();
std::map<int,int> m;
for(int i=0;i<thisNbTuples;i++,thisPt++)
m[*thisPt]=i;
- if(m.size()!=thisNbTuples)
+ if((int)m.size()!=thisNbTuples)
throw INTERP_KERNEL::Exception("DataArrayInt::indicesOfSubPart : some elements appears more than once !");
for(int i=0;i<nbTuples;i++,retPt++,pt++)
{
throw INTERP_KERNEL::Exception("DataArrayInt::hasOnlyUniqueValues: must be applied on DataArrayInt with only one component, you can call 'rearrange' method before !");
int nbOfTuples(getNumberOfTuples());
std::set<int> s(begin(),end()); // in C++11, should use unordered_set (O(1) complexity)
- if (s.size() != nbOfTuples)
+ if ((int)s.size() != nbOfTuples)
return false;
return true;
}
{
std::size_t nbOfCompoExp(std::distance(tupleBg,tupleEnd));
checkAllocated();
- if(getNumberOfComponents()!=(int)nbOfCompoExp)
+ if(getNumberOfComponents()!=nbOfCompoExp)
{
std::ostringstream oss; oss << "DataArrayInt::findIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input DataArrayInt instance is NULL !");
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Aggregation !");
int nbOfTuple1=a1->getNumberOfTuples();
if(a.empty())
throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input list must be NON EMPTY !");
std::vector<const DataArrayInt *>::const_iterator it=a.begin();
- int nbOfComp=(*it)->getNumberOfComponents();
+ std::size_t nbOfComp((*it)->getNumberOfComponents());
int nbt=(*it++)->getNumberOfTuples();
for(int i=1;it!=a.end();it++,i++)
{
std::ostringstream oss; oss << Traits<T>::ArrayTypeName << "::getIJSafe : request for tupleId " << tupleId << " should be in [0," << getNumberOfTuples() << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- if(compoId<0 || compoId>=getNumberOfComponents())
+ if(compoId<0 || compoId>=(int)getNumberOfComponents())
{
std::ostringstream oss; oss << Traits<T>::ArrayTypeName << "::getIJSafe : request for compoId " << compoId << " should be in [0," << getNumberOfComponents() << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
if(isAllocated())
{
- if(nbOfTuple!=getNumberOfTuples() || nbOfCompo!=getNumberOfComponents())
+ if(nbOfTuple!=getNumberOfTuples() || nbOfCompo!=(int)getNumberOfComponents())
alloc(nbOfTuple,nbOfCompo);
}
else
{
DataArrayTemplate<T> *directRet(const_cast<DataArrayTemplate<T> *>(this));
directRet->incrRef();
- MCAuto<DataArrayTemplate<T> > ret(directRet);
- return DynamicCastSafe<DataArrayTemplate<T>,typename Traits<T>::ArrayTypeCh>(ret);
+ MCAuto<DataArrayTemplate<T> > ret2(directRet);
+ return DynamicCastSafe<DataArrayTemplate<T>,typename Traits<T>::ArrayTypeCh>(ret2);
}
else
{
- MCAuto<DataArray> ret(selectByTupleIdSafeSlice(a,b,c));
- return DynamicCastSafe<DataArray,typename Traits<T>::ArrayTypeCh>(ret);
+ MCAuto<DataArray> ret2(selectByTupleIdSafeSlice(a,b,c));
+ return DynamicCastSafe<DataArray,typename Traits<T>::ArrayTypeCh>(ret2);
}
}
const DataArrayPartDefinition *dpd(dynamic_cast<const DataArrayPartDefinition *>(pd));
if(dpd)
{
MCAuto<DataArrayInt> arr(dpd->toDAI());
- MCAuto<DataArray> ret(selectByTupleIdSafe(arr->begin(),arr->end()));
- return DynamicCastSafe<DataArray,typename Traits<T>::ArrayTypeCh>(ret);
+ MCAuto<DataArray> ret2(selectByTupleIdSafe(arr->begin(),arr->end()));
+ return DynamicCastSafe<DataArray,typename Traits<T>::ArrayTypeCh>(ret2);
}
throw INTERP_KERNEL::Exception("DataArrayTemplate<T>::selectPartDef : unrecognized part def !");
checkAllocated();
a->checkAllocated();
tuplesSelec->checkAllocated();
- int nbOfComp=getNumberOfComponents();
+ std::size_t nbOfComp(getNumberOfComponents());
if(nbOfComp!=a->getNumberOfComponents())
throw INTERP_KERNEL::Exception("DataArrayTemplate::setPartOfValuesAdv : This and a do not have the same number of components !");
if(tuplesSelec->getNumberOfComponents()!=2)
checkAllocated();
a->checkAllocated();
tuplesSelec->checkAllocated();
- int nbOfComp(getNumberOfComponents());
+ std::size_t nbOfComp(getNumberOfComponents());
if(nbOfComp!=a->getNumberOfComponents())
throw INTERP_KERNEL::Exception("DataArrayTemplate::setContigPartOfSelectedValues : This and a do not have the same number of components !");
if(tuplesSelec->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayTemplate::setContigPartOfSelectedValuesSlice : input DataArray aBase is not a DataArrayDouble !");
checkAllocated();
a->checkAllocated();
- int nbOfComp(getNumberOfComponents());
+ std::size_t nbOfComp(getNumberOfComponents());
const char msg[]="DataArrayDouble::setContigPartOfSelectedValuesSlice";
int nbOfTupleToWrite(DataArray::GetNumberOfItemGivenBES(bg,end2,step,msg));
if(nbOfComp!=a->getNumberOfComponents())
this->checkAllocated();
if(this->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayDouble::isUniform : must be applied on DataArrayDouble with only one component, you can call 'rearrange' method before !");
- int nbOfTuples(this->getNumberOfTuples());
const T *w(this->begin()),*end2(this->end());
const T vmin(val-eps),vmax(val+eps);
for(;w!=end2;w++)
if(a.empty())
throw INTERP_KERNEL::Exception("DataArrayChar::Aggregate : input list must be NON EMPTY !");
std::vector<const DataArrayChar *>::const_iterator it=a.begin();
- int nbOfComp=(*it)->getNumberOfComponents();
+ std::size_t nbOfComp((*it)->getNumberOfComponents());
int nbt=(*it++)->getNumberOfTuples();
for(int i=1;it!=a.end();it++,i++)
{
{
}
-MEDCouplingPointSet::MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCopy):MEDCouplingMesh(other),_coords(0)
+MEDCouplingPointSet::MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCpy):MEDCouplingMesh(other),_coords(0)
{
if(other._coords)
- _coords=other._coords->performCopyOrIncrRef(deepCopy);
+ _coords=other._coords->performCopyOrIncrRef(deepCpy);
}
MEDCouplingPointSet::~MEDCouplingPointSet()
{
protected:
MEDCOUPLING_EXPORT MEDCouplingPointSet();
- MEDCOUPLING_EXPORT MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCopy);
+ MEDCOUPLING_EXPORT MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCpy);
MEDCOUPLING_EXPORT ~MEDCouplingPointSet();
public:
MEDCOUPLING_EXPORT void updateTime() const;
_my_map.clear();
}
-void GlobalDict::setKeyValue(const std::string& key, const std::string& value)
+void GlobalDict::setKeyValue(const std::string& key, const std::string& val)
{
std::map<std::string, std::string>::const_iterator it(_my_map.find(key));
if(it!=_my_map.end())
oss << "GlobalDict::setKeyValue : key \"" << key << "\" already exists !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- _my_map[key]=value;
+ _my_map[key]=val;
}
-void GlobalDict::setKeyValueForce(const std::string& key, const std::string& value)
+void GlobalDict::setKeyValueForce(const std::string& key, const std::string& val)
{
- _my_map[key]=value;
+ _my_map[key]=val;
}
std::string GlobalDict::printSelf() const
MEDCOUPLING_EXPORT std::vector<std::string> keys() const;
MEDCOUPLING_EXPORT void erase(const std::string& key);
MEDCOUPLING_EXPORT void clear();
- MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& value);
- MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& value);
+ MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& val);
+ MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& val);
MEDCOUPLING_EXPORT std::string printSelf() const;
private:
GlobalDict() { }
{
}
-MEDCouplingStructuredMesh::MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCopy):MEDCouplingMesh(other)
+MEDCouplingStructuredMesh::MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCpy):MEDCouplingMesh(other)
{
}
conn->alloc(4*n1*n2,1);
int *cp(conn->getPointer());
std::size_t pos(0);
- for(int j=0;j<n2;j++)
- for(int i=0;i<n1;i++,pos++)
+ for(std::size_t j=0;j<n2;j++)
+ for(std::size_t i=0;i<n1;i++,pos++)
{
cp[4*pos+0]=i+1+j*(n1+1);
cp[4*pos+1]=i+j*(n1+1);
conn->alloc(8*n1*n2*n3,1);
int *cp(conn->getPointer());
std::size_t pos(0);
- for(int k=0;k<n3;k++)
- for(int j=0;j<n2;j++)
- for(int i=0;i<n1;i++,pos++)
+ for(std::size_t k=0;k<n3;k++)
+ for(std::size_t j=0;j<n2;j++)
+ for(std::size_t i=0;i<n1;i++,pos++)
{
int tmp=(n1+1)*(n2+1);
cp[8*pos+0]=i+1+j*(n1+1)+k*tmp;
static int ZipNodeStructure(const int *nodeStBg, const int *nodeStEnd, int zipNodeSt[3]);
protected:
MEDCOUPLING_EXPORT MEDCouplingStructuredMesh();
- MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCopy);
+ MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCpy);
MEDCOUPLING_EXPORT ~MEDCouplingStructuredMesh();
};
}
protected:
TimeHolder() { }
TimeHolder(const TimeHolder& other):_time_unit(other._time_unit) { }
+ virtual ~TimeHolder() { }
private:
std::string _time_unit;
};
DAInt neighIInit00(tmp11);
// Neighbor information of the mesh WITH the crack (some neighbors are removed):
DataArrayInt *idsTmp=0;
- bool b=m01->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp);
+ m01->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp);
DAInt ids(idsTmp);
// In the neighbor information remove the connection between high dimension cells and its low level constituents which are part
// of the frontier given in parameter (i.e. the cells of low dimension from the group delimiting the crack):
* Copy constructor. If 'deepCopy' is false \a this is a shallow copy of other.
* If 'deeCpy' is true all arrays (coordinates and connectivities) are deeply copied.
*/
-MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy):MEDCouplingPointSet(other,deepCopy),_mesh_dim(other._mesh_dim),
+MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy):MEDCouplingPointSet(other,deepCpy),_mesh_dim(other._mesh_dim),
_nodal_connec(0),_nodal_connec_index(0),
_types(other._types)
{
if(other._nodal_connec)
- _nodal_connec=other._nodal_connec->performCopyOrIncrRef(deepCopy);
+ _nodal_connec=other._nodal_connec->performCopyOrIncrRef(deepCpy);
if(other._nodal_connec_index)
- _nodal_connec_index=other._nodal_connec_index->performCopyOrIncrRef(deepCopy);
+ _nodal_connec_index=other._nodal_connec_index->performCopyOrIncrRef(deepCpy);
}
MEDCouplingUMesh::~MEDCouplingUMesh()
std::vector<std::vector<int> > res;
buildSubCellsFromCut(cut3DSurf,desc2->begin(),descIndx2->begin(),mDesc1->getCoords()->begin(),eps,res);
std::size_t sz(res.size());
- if(res.size()==mDesc1->getNumberOfCells() && sameNbNodes)
+ if((int)res.size()==mDesc1->getNumberOfCells() && sameNbNodes)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane : cell is not clipped !");
for(std::size_t i=0;i<sz;i++)
{
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoints works only for spaceDim=meshDim+1 !");
if(meshDim!=2 && meshDim!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoints : only mesh dimension 2 and 1 are implemented !");
- if(pts->getNumberOfComponents()!=spaceDim)
+ if((int)pts->getNumberOfComponents()!=spaceDim)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoints : input pts DataArrayDouble has " << pts->getNumberOfComponents() << " components whereas it should be equal to " << spaceDim << " (mesh spaceDimension) !";
throw INTERP_KERNEL::Exception(oss.str());
private: // all private methods are impl in MEDCouplingUMesh_internal.cxx
MEDCouplingUMesh();
- MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy);
+ MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy);
~MEDCouplingUMesh();
void checkFullyDefined() const;
void checkConnectivityFullyDefined() const;
newCoords=a->getCoords()->selectByTupleId(tmp->begin(),tmp->end());
}
const double *cPtr(newCoords->begin());
- for(int i=0;i<newCoords->getNumberOfTuples();i++,cPtr+=2)
+ for(int j=0;j<newCoords->getNumberOfTuples();j++,cPtr+=2)
{
std::set<int> zeCandidates;
{
zeCandidates.insert(*it4);
}
}
- std::set<int> tmp,newElementsToDo;
- std::set_difference(zeCandidates.begin(),zeCandidates.end(),elemsDone.begin(),elemsDone.end(),std::inserter(tmp,tmp.begin()));
- std::set_union(elemsToDo.begin(),elemsToDo.end(),tmp.begin(),tmp.end(),std::inserter(newElementsToDo,newElementsToDo.begin()));
+ std::set<int> tmp2,newElementsToDo;
+ std::set_difference(zeCandidates.begin(),zeCandidates.end(),elemsDone.begin(),elemsDone.end(),std::inserter(tmp2,tmp2.begin()));
+ std::set_union(elemsToDo.begin(),elemsToDo.end(),tmp2.begin(),tmp2.end(),std::inserter(newElementsToDo,newElementsToDo.begin()));
elemsToDo=newElementsToDo;
}
//