-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 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
#include "MEDCouplingUMesh.hxx"
#include "MEDCoupling1GTUMesh.hxx"
-#include "MEDCouplingMemArray.txx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingSkyLineArray.hxx"
#include "CellModel.hxx"
/// @cond INTERNAL
const INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::MEDMEM_ORDER[N_MEDMEM_ORDER] = { INTERP_KERNEL::NORM_POINT1, INTERP_KERNEL::NORM_SEG2, INTERP_KERNEL::NORM_SEG3, INTERP_KERNEL::NORM_SEG4, INTERP_KERNEL::NORM_POLYL, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_TRI7, INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_QUAD9, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QPOLYG, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_PYRA5, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_HEXGP12, INTERP_KERNEL::NORM_TETRA10, INTERP_KERNEL::NORM_PYRA13, INTERP_KERNEL::NORM_PENTA15, INTERP_KERNEL::NORM_HEXA20, INTERP_KERNEL::NORM_HEXA27, INTERP_KERNEL::NORM_POLYHED };
+const int MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
/// @endcond
MEDCouplingUMesh *MEDCouplingUMesh::New()
{
std::ostringstream oss;
oss << "MEDCouplingUMesh::checkConsistency : cell << #" << i<< " with type Type " << cm.getRepr() << " in 'this' whereas meshdim == " << meshDim << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfNodesInCell=ptrI[i+1]-ptrI[i]-1;
if(!cm.isDynamic())
std::ostringstream oss;
oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with static Type '" << cm.getRepr() << "' has " << cm.getNumberOfNodes();
oss << " nodes whereas in connectivity there is " << nbOfNodesInCell << " nodes ! Looks very bad !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
if(cm.isQuadratic() && cm.isDynamic() && meshDim == 2)
if (nbOfNodesInCell % 2 || nbOfNodesInCell < 4)
std::ostringstream oss;
oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with quadratic type '" << cm.getRepr() << "' has " << nbOfNodesInCell;
oss << " nodes. This should be even, and greater or equal than 4!! Looks very bad!";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
for(const int *w=ptr+ptrI[i]+1;w!=ptr+ptrI[i+1];w++)
{
if(nodeId>=nbOfNodes)
{
std::ostringstream oss; oss << "Cell #" << i << " is built with node #" << nodeId << " whereas there are only " << nbOfNodes << " nodes in the mesh !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else if(nodeId<-1)
{
std::ostringstream oss; oss << "Cell #" << i << " is built with node #" << nodeId << " in connectivity ! sounds bad !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
else
{
if((INTERP_KERNEL::NormalizedCellType)(ptr[ptrI[i]])!=INTERP_KERNEL::NORM_POLYHED)
{
std::ostringstream oss; oss << "Cell #" << i << " is built with node #-1 in connectivity ! sounds bad !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
{
std::ostringstream oss; oss << "MEDCouplingUMesh::insertNextCell : Trying to push a " << cm.getRepr() << " cell with a size of " << size;
oss << " ! Expecting " << cm.getNumberOfNodes() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int idx=_nodal_connec_index->back();
int val=idx+size+1;
std::ostringstream oss; oss << "MEDCouplingUMesh::insertNextCell : cell type " << cm.getRepr() << " has a dimension " << cm.getDimension();
oss << " whereas Mesh Dimension of current UMesh instance is set to " << _mesh_dim << " ! Please invoke \"setMeshDimension\" method before or invoke ";
oss << "\"MEDCouplingUMesh::New\" static method with 2 parameters name and meshDimension !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
const INTERP_KERNEL::CellModel& _cm;
};
+class MicroEdgesGenerator2D
+{
+public:
+ MicroEdgesGenerator2D(const INTERP_KERNEL::CellModel& cm):_cm(cm) { }
+ unsigned getNumberOfSons2(const int *conn, int lgth) const { return _cm.getNumberOfMicroEdges(); }
+ unsigned fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, INTERP_KERNEL::NormalizedCellType& typeOfSon) const { return _cm.fillMicroEdgeNodalConnectivity(sonId,nodalConn,sonNodalConn,typeOfSon); }
+ static const int DELTA=1;
+private:
+ const INTERP_KERNEL::CellModel& _cm;
+};
+
+class MicroEdgesGenerator3D
+{
+public:
+ MicroEdgesGenerator3D(const INTERP_KERNEL::CellModel& cm):_cm(cm) { }
+ unsigned getNumberOfSons2(const int *conn, int lgth) const { return _cm.getNumberOfMicroEdges(); }
+ unsigned fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, INTERP_KERNEL::NormalizedCellType& typeOfSon) const { return _cm.fillMicroEdgeNodalConnectivity(sonId,nodalConn,sonNodalConn,typeOfSon); }
+ static const int DELTA=2;
+private:
+ const INTERP_KERNEL::CellModel& _cm;
+};
+
/// @endcond
/*!
return buildDescendingConnectivityGen<MinusTwoSonsGenerator>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
}
+/*!
+ * This method computes the micro edges constituting each cell in \a this. Micro edge is an edge for non quadratic cells. Micro edge is an half edge for quadratic cells.
+ * This method works for both meshes with mesh dimenstion equal to 2 or 3. Dynamical cells are not supported (polygons, polyhedrons...)
+ *
+ * \sa explode3DMeshTo1D, buildDescendingConnectiviy
+ */
+MEDCouplingUMesh *MEDCouplingUMesh::explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
+{
+ checkFullyDefined();
+ switch(getMeshDimension())
+ {
+ case 2:
+ return buildDescendingConnectivityGen<MicroEdgesGenerator2D>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
+ case 3:
+ return buildDescendingConnectivityGen<MicroEdgesGenerator2D>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
+ default:
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::explodeMeshIntoMicroEdges : Only 2D and 3D supported !");
+ }
+}
+
/*!
* Creates a new MEDCouplingUMesh containing cells, of dimension one less than \a
* this->getMeshDimension(), that bound cells of \a this mesh. In
ComputeNeighborsOfCellsAdv(desc,descIndx,revDesc,revDescIndx,neighbors,neighborsIndx);
}
+void MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI, MCAuto<DataArrayInt>& cellNeigh, MCAuto<DataArrayInt>& cellNeighIndex) const
+{
+ if(!nodeNeigh || !nodeNeighI)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : null pointer !");
+ checkConsistencyLight();
+ nodeNeigh->checkAllocated(); nodeNeighI->checkAllocated();
+ nodeNeigh->checkNbOfComps(1,"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : node neigh");
+ nodeNeighI->checkNbOfComps(1,"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : node neigh index");
+ nodeNeighI->checkNbOfTuples(1+getNumberOfNodes(),"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : invalid length");
+ int nbCells(getNumberOfCells());
+ const int *c(_nodal_connec->begin()),*ci(_nodal_connec_index->begin()),*ne(nodeNeigh->begin()),*nei(nodeNeighI->begin());
+ cellNeigh=DataArrayInt::New(); cellNeigh->alloc(0,1); cellNeighIndex=DataArrayInt::New(); cellNeighIndex->alloc(1,1); cellNeighIndex->setIJ(0,0,0);
+ for(int i=0;i<nbCells;i++)
+ {
+ std::set<int> s;
+ for(const int *it=c+ci[i]+1;it!=c+ci[i+1];it++)
+ if(*it>=0)
+ s.insert(ne+nei[*it],ne+nei[*it+1]);
+ s.erase(i);
+ cellNeigh->insertAtTheEnd(s.begin(),s.end());
+ cellNeighIndex->pushBackSilent(cellNeigh->getNumberOfTuples());
+ }
+}
+
/*!
* This method is called by MEDCouplingUMesh::computeNeighborsOfCells. This methods performs the algorithm
* of MEDCouplingUMesh::computeNeighborsOfCells.
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
oss << " in range [0," << nbOfCells << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
oss << " in range [0," << nbOfCells << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
for(int cellId=0;cellId<nbOfCells;cellId++)
if(std::count(c+ci[i]+1,c+ci[i+1],-1)!=0)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron BUT it has NOT exactly 1 face !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
std::size_t n2=std::distance(c+ci[i]+1,c+ci[i+1]);
if(n2%2!=0)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron with 1 face but there is a mismatch of number of nodes in face should be even !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int n1=(int)(n2/2);
newci[i+1]=7*n1+2+newci[i];//6*n1 (nodal length) + n1+2 (number of faces) - 1 (number of '-1' separator is equal to number of faces -1) + 1 (for cell type)
DataArrayInt *MEDCouplingUMesh::computeFetchedNodeIds() const
{
checkConnectivityFullyDefined();
- int nbOfCells=getNumberOfCells();
- const int *connIndex=_nodal_connec_index->getConstPointer();
- const int *conn=_nodal_connec->getConstPointer();
- const int *maxEltPt=std::max_element(_nodal_connec->begin(),_nodal_connec->end());
- int maxElt=maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1;
+ const int *maxEltPt(std::max_element(_nodal_connec->begin(),_nodal_connec->end()));
+ int maxElt(maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1);
std::vector<bool> retS(maxElt,false);
- for(int i=0;i<nbOfCells;i++)
- for(int j=connIndex[i]+1;j<connIndex[i+1];j++)
- if(conn[j]>=0)
- retS[conn[j]]=true;
- int sz=0;
- for(int i=0;i<maxElt;i++)
- if(retS[i])
- sz++;
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc(sz,1);
- int *retPtr=ret->getPointer();
- for(int i=0;i<maxElt;i++)
- if(retS[i])
- *retPtr++=i;
- return ret;
+ computeNodeIdsAlg(retS);
+ return DataArrayInt::BuildListOfSwitchedOn(retS);
}
/*!
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computeNodeIdsAlg : In cell #" << i << " presence of node id " << conn[j] << " not in [0," << nbOfNodes << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::getNodeIdsInUse : In cell #" << i << " presence of node id " << conn[j] << " not in [0," << nbOfNodes << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
nbrOfNodesInUse=(int)std::count(traducer,traducer+nbOfNodes,1);
std::ostringstream oss; oss << "MEDCouplingUMesh::areCellsIncludedIn : only following policies are possible : ";
std::copy(possibleCompType,possibleCompType+sizeof(possibleCompType)/sizeof(int),std::ostream_iterator<int>(oss," "));
oss << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
MCAuto<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
arr=o2n->subArray(nbOfCells);
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfCellsToModify=(int)std::distance(cellIdsBg,cellIdsEnd);
if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfCells=getNumberOfCells();
bool easyAssign=true;
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : On pos #" << std::distance(cellIdsBg,it) << " id is equal to " << *it << " which is not in [0," << nbOfCells << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
if(easyAssign)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfCellsToModify=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::setPartOfMySelfSlice : ");
if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfCells=getNumberOfCells();
bool easyAssign=true;
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : On pos #" << i << " id is equal to " << it << " which is not in [0," << nbOfCells << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
if(easyAssign)
DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const
{
typedef MCAuto<DataArrayInt> DAInt;
+ typedef MCAuto<MEDCouplingUMesh> MCUMesh;
checkFullyDefined();
otherDimM1OnSameCoords.checkFullyDefined();
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : meshes do not share the same coords array !");
if(otherDimM1OnSameCoords.getMeshDimension()!=getMeshDimension()-1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : the mesh given in other parameter must have this->getMeshDimension()-1 !");
- DataArrayInt *cellIdsRk0=0,*cellIdsRk1=0;
- findCellIdsLyingOn(otherDimM1OnSameCoords,cellIdsRk0,cellIdsRk1);
- DAInt cellIdsRk0Auto(cellIdsRk0),cellIdsRk1Auto(cellIdsRk1);
- DAInt s0=cellIdsRk1->buildComplement(cellIdsRk0->getNumberOfTuples());
- s0->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
- MCAuto<MEDCouplingUMesh> m0Part=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0->begin(),s0->end(),true));
- DAInt s1=m0Part->computeFetchedNodeIds();
- DAInt s2=otherDimM1OnSameCoords.computeFetchedNodeIds();
- DAInt s3=s2->buildSubstraction(s1);
- cellIdsRk1->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
+
+ // Checking star-shaped M1 group:
+ DAInt dt0=DataArrayInt::New(),dit0=DataArrayInt::New(),rdt0=DataArrayInt::New(),rdit0=DataArrayInt::New();
+ MCUMesh meshM2 = otherDimM1OnSameCoords.buildDescendingConnectivity(dt0, dit0, rdt0, rdit0);
+ DAInt dsi = rdit0->deltaShiftIndex();
+ DAInt idsTmp0 = dsi->findIdsNotInRange(-1, 3);
+ if(idsTmp0->getNumberOfTuples())
+ throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group: group is too complex: some points (or edges) have more than two connected segments (or faces)!");
+ dt0=0; dit0=0; rdt0=0; rdit0=0; idsTmp0=0;
+
+ // Get extreme nodes from the group (they won't be duplicated), ie nodes belonging to boundary cells of M1
+ DAInt xtremIdsM2 = dsi->findIdsEqual(1); dsi = 0;
+ MCUMesh meshM2Part = static_cast<MEDCouplingUMesh *>(meshM2->buildPartOfMySelf(xtremIdsM2->begin(), xtremIdsM2->end(),true));
+ DAInt xtrem = meshM2Part->computeFetchedNodeIds();
+ // Remove from the list points on the boundary of the M0 mesh (those need duplication!)
+ dt0=DataArrayInt::New(),dit0=DataArrayInt::New(),rdt0=DataArrayInt::New(),rdit0=DataArrayInt::New();
+ MCUMesh m0desc = buildDescendingConnectivity(dt0, dit0, rdt0, rdit0); dt0=0; dit0=0; rdt0=0;
+ dsi = rdit0->deltaShiftIndex();
+ DAInt boundSegs = dsi->findIdsEqual(1); // boundary segs/faces of the M0 mesh
+ MCUMesh m0descSkin = static_cast<MEDCouplingUMesh *>(m0desc->buildPartOfMySelf(boundSegs->begin(),boundSegs->end(), true));
+ DAInt fNodes = m0descSkin->computeFetchedNodeIds();
+ // In 3D, some points on the boundary of M0 still need duplication:
+ DAInt notDup = 0;
+ if (getMeshDimension() == 3)
+ {
+ DAInt dnu1=DataArrayInt::New(), dnu2=DataArrayInt::New(), dnu3=DataArrayInt::New(), dnu4=DataArrayInt::New();
+ MCUMesh m0descSkinDesc = m0descSkin->buildDescendingConnectivity(dnu1, dnu2, dnu3, dnu4);
+ dnu1=0;dnu2=0;dnu3=0;dnu4=0;
+ DataArrayInt * corresp=0;
+ meshM2->areCellsIncludedIn(m0descSkinDesc,2,corresp);
+ DAInt validIds = corresp->findIdsInRange(0, meshM2->getNumberOfCells());
+ corresp->decrRef();
+ if (validIds->getNumberOfTuples())
+ {
+ MCUMesh m1IntersecSkin = static_cast<MEDCouplingUMesh *>(m0descSkinDesc->buildPartOfMySelf(validIds->begin(), validIds->end(), true));
+ DAInt notDuplSkin = m1IntersecSkin->findBoundaryNodes();
+ DAInt fNodes1 = fNodes->buildSubstraction(notDuplSkin);
+ notDup = xtrem->buildSubstraction(fNodes1);
+ }
+ else
+ notDup = xtrem->buildSubstraction(fNodes);
+ }
+ else
+ notDup = xtrem->buildSubstraction(fNodes);
+
+ // Now compute cells around group (i.e. cells where we will do the propagation to identify the two sub-sets delimited by the group)
+ DAInt m1Nodes = otherDimM1OnSameCoords.computeFetchedNodeIds();
+ DAInt dupl = m1Nodes->buildSubstraction(notDup);
+ DAInt cellsAroundGroup = getCellIdsLyingOnNodes(dupl->begin(), dupl->end(), false); // false= take cell in, even if not all nodes are in notDup
+
//
- MCAuto<MEDCouplingUMesh> m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellIdsRk1->begin(),cellIdsRk1->end(),true));
+ MCUMesh m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellsAroundGroup->begin(),cellsAroundGroup->end(),true));
int nCells2 = m0Part2->getNumberOfCells();
DAInt desc00=DataArrayInt::New(),descI00=DataArrayInt::New(),revDesc00=DataArrayInt::New(),revDescI00=DataArrayInt::New();
- MCAuto<MEDCouplingUMesh> m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
+ MCUMesh m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
+
// Neighbor information of the mesh without considering the crack (serves to count how many connex pieces it is made of)
DataArrayInt *tmp00=0,*tmp11=0;
MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc00,descI00,revDesc00,revDescI00, tmp00, tmp11);
DataArrayInt *idsTmp=0;
bool b=m01->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp);
DAInt ids(idsTmp);
- if(!b)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : the given mdim-1 mesh in other is not a constituent of this !");
// 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):
MEDCouplingUMesh::RemoveIdsFromIndexedArrays(ids->begin(),ids->end(),desc00,descI00);
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate(): internal error - too many iterations.");
DAInt cellsToModifyConn1_torenum=cellsToModifyConn0_torenum->buildComplement(neighI00->getNumberOfTuples()-1);
- cellsToModifyConn0_torenum->transformWithIndArr(cellIdsRk1->begin(),cellIdsRk1->end());
- cellsToModifyConn1_torenum->transformWithIndArr(cellIdsRk1->begin(),cellIdsRk1->end());
+ cellsToModifyConn0_torenum->transformWithIndArr(cellsAroundGroup->begin(),cellsAroundGroup->end());
+ cellsToModifyConn1_torenum->transformWithIndArr(cellsAroundGroup->begin(),cellsAroundGroup->end());
//
cellIdsNeededToBeRenum=cellsToModifyConn0_torenum.retn();
cellIdsNotModified=cellsToModifyConn1_torenum.retn();
- nodeIdsToDuplicate=s3.retn();
+ nodeIdsToDuplicate=dupl.retn();
}
/*!
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::renumberNodesInConn(map) : presence in connectivity for cell #" << i << " of node #" << node << " : Not in map !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::getTypeOfCell : Requesting type of cell #" << cellId << " but it should be in [0," << _nodal_connec_index->getNbOfElems()-1 << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice : On pos #" << i << " input cell id =" << work << " should be in [0," << ncell << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(newConnIPtr[0],1);
{
free(connIndexRet);
std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoords : On pos #" << std::distance(begin,work) << " input cell id =" << *work << " should be in [0," << ncell << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
int *connRet=(int *)malloc(connIndexRet[nbOfElemsRet]*sizeof(int));
checkFullyDefined();
if(getMeshDimension()!=2 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf works on umeshes with meshdim equal to 2 and spaceDim equal to 3 !");
- MCAuto<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
+ MCAuto<DataArrayInt> candidates(getCellIdsCrossingPlane(origin,vec,eps));
if(candidates->empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf : No 3D surf cells in this intercepts the specified plane considering bounding boxes !");
std::vector<int> nodes;
- DataArrayInt *cellIds1D=0;
- MCAuto<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
+ DataArrayInt *cellIds1D(0);
+ MCAuto<MEDCouplingUMesh> subMesh(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
subMesh->findNodesOnPlane(origin,vec,eps,nodes);
- MCAuto<DataArrayInt> desc1=DataArrayInt::New();
- MCAuto<DataArrayInt> descIndx1=DataArrayInt::New();
- MCAuto<DataArrayInt> revDesc1=DataArrayInt::New();
- MCAuto<DataArrayInt> revDescIndx1=DataArrayInt::New();
- MCAuto<MEDCouplingUMesh> mDesc1=subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
+ MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> mDesc1(subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));//meshDim==1 spaceDim==3
mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
//
return ret.retn();
}
+MCAuto<MEDCouplingUMesh> MEDCouplingUMesh::clipSingle3DCellByPlane(const double origin[3], const double vec[3], double eps) const
+{
+ checkFullyDefined();
+ if(getMeshDimension()!=3 || getSpaceDimension()!=3)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
+ if(getNumberOfCells()!=1)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane works only on mesh containing exactly one cell !");
+ //
+ std::vector<int> nodes;
+ findNodesOnPlane(origin,vec,eps,nodes);
+ MCAuto<DataArrayInt> desc1(DataArrayInt::New()),desc2(DataArrayInt::New()),descIndx1(DataArrayInt::New()),descIndx2(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDesc2(DataArrayInt::New()),revDescIndx1(DataArrayInt::New()),revDescIndx2(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> mDesc2(buildDescendingConnectivity(desc2,descIndx2,revDesc2,revDescIndx2));//meshDim==2 spaceDim==3
+ revDesc2=0; revDescIndx2=0;
+ MCAuto<MEDCouplingUMesh> mDesc1(mDesc2->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));//meshDim==1 spaceDim==3
+ revDesc1=0; revDescIndx1=0;
+ DataArrayInt *cellIds1D(0);
+ mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
+ MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
+ std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
+ for(const int *it=cellIds1D->begin();it!=cellIds1D->end();it++)
+ cut3DCurve[*it]=-1;
+ mDesc1->split3DCurveWithPlane(origin,vec,eps,cut3DCurve);
+ std::vector< std::pair<int,int> > cut3DSurf(mDesc2->getNumberOfCells());
+ AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,mDesc2->getNodalConnectivity()->begin(),mDesc2->getNodalConnectivityIndex()->begin(),
+ mDesc1->getNodalConnectivity()->begin(),mDesc1->getNodalConnectivityIndex()->begin(),
+ desc1->begin(),descIndx1->begin(),cut3DSurf);
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+ connI->pushBackSilent(0); conn->alloc(0,1);
+ {
+ MCAuto<DataArrayInt> cellIds2(DataArrayInt::New()); cellIds2->alloc(0,1);
+ assemblyForSplitFrom3DSurf(cut3DSurf,desc2->begin(),descIndx2->begin(),conn,connI,cellIds2);
+ if(cellIds2->empty())
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane !");
+ }
+ 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())
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane : cell is not clipped !");
+ for(std::size_t i=0;i<sz;i++)
+ {
+ conn->pushBackSilent((int)INTERP_KERNEL::NORM_POLYGON);
+ conn->insertAtTheEnd(res[i].begin(),res[i].end());
+ connI->pushBackSilent(conn->getNumberOfTuples());
+ }
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
+ ret->setCoords(mDesc1->getCoords());
+ ret->setConnectivity(conn,connI,true);
+ int nbCellsRet(ret->getNumberOfCells());
+ //
+ MCAuto<DataArrayDouble> vec2(DataArrayDouble::New()); vec2->alloc(1,3); std::copy(vec,vec+3,vec2->getPointer());
+ MCAuto<MEDCouplingFieldDouble> ortho(ret->buildOrthogonalField());
+ MCAuto<DataArrayDouble> ortho2(ortho->getArray()->selectByTupleIdSafeSlice(0,1,1));
+ MCAuto<DataArrayDouble> dott(DataArrayDouble::Dot(ortho2,vec2));
+ MCAuto<DataArrayDouble> ccm(ret->computeCellCenterOfMass());
+ MCAuto<DataArrayDouble> occm;
+ {
+ MCAuto<DataArrayDouble> pt(DataArrayDouble::New()); pt->alloc(1,3); std::copy(origin,origin+3,pt->getPointer());
+ occm=DataArrayDouble::Substract(ccm,pt);
+ }
+ vec2=DataArrayDouble::New(); vec2->alloc(nbCellsRet,3);
+ vec2->setPartOfValuesSimple1(vec[0],0,nbCellsRet,1,0,1,1); vec2->setPartOfValuesSimple1(vec[1],0,nbCellsRet,1,1,2,1); vec2->setPartOfValuesSimple1(vec[2],0,nbCellsRet,1,2,3,1);
+ MCAuto<DataArrayDouble> dott2(DataArrayDouble::Dot(occm,vec2));
+ //
+ const int *cPtr(ret->getNodalConnectivity()->begin()),*ciPtr(ret->getNodalConnectivityIndex()->begin());
+ MCAuto<MEDCouplingUMesh> ret2(MEDCouplingUMesh::New("Clip3D",3));
+ ret2->setCoords(mDesc1->getCoords());
+ MCAuto<DataArrayInt> conn2(DataArrayInt::New()),conn2I(DataArrayInt::New());
+ conn2I->pushBackSilent(0); conn2->alloc(0,1);
+ std::vector<int> cell0(1,(int)INTERP_KERNEL::NORM_POLYHED);
+ std::vector<int> cell1(1,(int)INTERP_KERNEL::NORM_POLYHED);
+ if(dott->getIJ(0,0)>0)
+ {
+ cell0.insert(cell0.end(),cPtr+1,cPtr+ciPtr[1]);
+ std::reverse_copy(cPtr+1,cPtr+ciPtr[1],std::inserter(cell1,cell1.end()));
+ }
+ else
+ {
+ cell1.insert(cell1.end(),cPtr+1,cPtr+ciPtr[1]);
+ std::reverse_copy(cPtr+1,cPtr+ciPtr[1],std::inserter(cell0,cell0.end()));
+ }
+ for(int i=1;i<nbCellsRet;i++)
+ {
+ if(dott2->getIJ(i,0)<0)
+ {
+ if(ciPtr[i+1]-ciPtr[i]>=4)
+ {
+ cell0.push_back(-1);
+ cell0.insert(cell0.end(),cPtr+ciPtr[i]+1,cPtr+ciPtr[i+1]);
+ }
+ }
+ else
+ {
+ if(ciPtr[i+1]-ciPtr[i]>=4)
+ {
+ cell1.push_back(-1);
+ cell1.insert(cell1.end(),cPtr+ciPtr[i]+1,cPtr+ciPtr[i+1]);
+ }
+ }
+ }
+ conn2->insertAtTheEnd(cell0.begin(),cell0.end());
+ conn2I->pushBackSilent(conn2->getNumberOfTuples());
+ conn2->insertAtTheEnd(cell1.begin(),cell1.end());
+ conn2I->pushBackSilent(conn2->getNumberOfTuples());
+ ret2->setConnectivity(conn2,conn2I,true);
+ ret2->checkConsistencyLight();
+ ret2->writeVTK("ret2.vtu");
+ ret2->orientCorrectlyPolyhedrons();
+ return ret2;
+}
+
/*!
* Finds cells whose bounding boxes intersect a given plane.
* \param [in] origin - 3 components of a point defining location of the plane.
MCAuto<DataArrayDouble> coo=_coords->deepCopy();
double normm2(sqrt(vec2[0]*vec2[0]+vec2[1]*vec2[1]+vec2[2]*vec2[2]));
if(normm2/normm>1e-6)
- MEDCouplingPointSet::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer());
+ DataArrayDouble::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer(),coo->getPointer());
MCAuto<MEDCouplingUMesh> mw=clone(false);//false -> shallow copy
mw->setCoords(coo);
mw->getBoundingBox(bbox);
int nbCells=getNumberOfCells();
if(nbCells<1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::isContiguous1D : this method has a sense for non empty mesh !");
- const int *connI=_nodal_connec_index->getConstPointer();
- const int *conn=_nodal_connec->getConstPointer();
+ const int *connI(_nodal_connec_index->begin()),*conn(_nodal_connec->begin());
int ref=conn[connI[0]+2];
for(int i=1;i<nbCells;i++)
{
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoint : only mesh dimension 2 and 1 are implemented !");
checkFullyDefined();
if((int)std::distance(ptBg,ptEnd)!=spaceDim)
- { std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+ { std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str()); }
DataArrayInt *ret1=0;
MCAuto<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,C_DEALLOC,1,spaceDim);
MCAuto<DataArrayDouble> ret0=distanceToPoints(pts,ret1);
if(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().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
checkFullyDefined();
int nbCells=getNumberOfCells();
void MEDCouplingUMesh::convertQuadraticCellsToLinear()
{
checkFullyDefined();
- int nbOfCells=getNumberOfCells();
+ int nbOfCells(getNumberOfCells());
int delta=0;
- const int *iciptr=_nodal_connec_index->getConstPointer();
+ const int *iciptr=_nodal_connec_index->begin();
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=getTypeOfCell(i);
}
if(delta==0)
return ;
- MCAuto<DataArrayInt> newConn=DataArrayInt::New();
- MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
- const int *icptr=_nodal_connec->getConstPointer();
+ MCAuto<DataArrayInt> newConn(DataArrayInt::New()),newConnI(DataArrayInt::New());
+ const int *icptr(_nodal_connec->begin());
newConn->alloc(getNodalConnectivityArrayLen()-delta,1);
newConnI->alloc(nbOfCells+1,1);
- int *ocptr=newConn->getPointer();
- int *ociptr=newConnI->getPointer();
+ int *ocptr(newConn->getPointer()),*ociptr(newConnI->getPointer());
*ociptr=0;
_types.clear();
for(int i=0;i<nbOfCells;i++,ociptr++)
MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
int nbOfCells=getNumberOfCells();
int nbOfNodes=getNumberOfNodes();
- const int *cPtr=_nodal_connec->getConstPointer();
- const int *icPtr=_nodal_connec_index->getConstPointer();
+ const int *cPtr=_nodal_connec->begin();
+ const int *icPtr=_nodal_connec_index->begin();
int lastVal=0,offset=nbOfNodes;
for(int i=0;i<nbOfCells;i++,icPtr++)
{
const int *c1DPtr=conn1D->begin();
const int *c1DIPtr=conn1DI->begin();
int nbOfCells=getNumberOfCells();
- const int *cPtr=_nodal_connec->getConstPointer();
- const int *icPtr=_nodal_connec_index->getConstPointer();
+ const int *cPtr=_nodal_connec->begin();
+ const int *icPtr=_nodal_connec_index->begin();
int lastVal=0;
for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++)
{
const int *c1DPtr=conn1D->begin();
const int *c1DIPtr=conn1DI->begin();
int nbOfCells=getNumberOfCells();
- const int *cPtr=_nodal_connec->getConstPointer();
- const int *icPtr=_nodal_connec_index->getConstPointer();
+ const int *cPtr=_nodal_connec->begin();
+ const int *icPtr=_nodal_connec_index->begin();
int lastVal=0,offset=coordsTmpSafe->getNumberOfTuples();
for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++)
{
MCAuto<DataArrayInt> conn2DSafe(conn2D),conn2DISafe(conn2DI);
const int *c1DPtr=conn1D->begin(),*c1DIPtr=conn1DI->begin(),*c2DPtr=conn2D->begin(),*c2DIPtr=conn2DI->begin();
int nbOfCells=getNumberOfCells();
- const int *cPtr=_nodal_connec->getConstPointer();
- const int *icPtr=_nodal_connec_index->getConstPointer();
+ const int *cPtr=_nodal_connec->begin();
+ const int *icPtr=_nodal_connec_index->begin();
int lastVal=0,offset=coordsTmpSafe->getNumberOfTuples();
for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++,desc2IPtr++)
{
if(typ2==INTERP_KERNEL::NORM_ERROR)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertLinearCellsToQuadratic3D1 : On cell #" << i << " the linear cell type does not support advanced quadratization !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
types.insert(typ2); newConn->pushBackSilent(typ2);
newConn->pushBackValsSilent(cPtr+icPtr[0]+1,cPtr+icPtr[1]);
if(mdim<1 || mdim>3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areOnlySimplexCells : only available with meshes having a meshdim 1, 2 or 3 !");
int nbCells=getNumberOfCells();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
for(int i=0;i<nbCells;i++)
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connI[i]]);
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
- const int *oldc=_nodal_connec->getConstPointer();
- const int *ci=_nodal_connec_index->getConstPointer();
+ const int *oldc=_nodal_connec->begin();
+ const int *ci=_nodal_connec_index->begin();
for(int i=0;i<nbOfCells;i++,ci++)
{
if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4)
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
- const int *oldc=_nodal_connec->getConstPointer();
- const int *ci=_nodal_connec_index->getConstPointer();
+ const int *oldc=_nodal_connec->begin();
+ const int *ci=_nodal_connec_index->begin();
for(int i=0;i<nbOfCells;i++,ci++)
{
if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4)
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
- const int *oldc=_nodal_connec->getConstPointer();
- const int *ci=_nodal_connec_index->getConstPointer();
+ const int *oldc=_nodal_connec->begin();
+ const int *ci=_nodal_connec_index->begin();
for(int i=0;i<nbOfCells;i++,ci++)
{
if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_HEXA8)
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
- const int *oldc=_nodal_connec->getConstPointer();
- const int *ci=_nodal_connec_index->getConstPointer();
+ const int *oldc=_nodal_connec->begin();
+ const int *ci=_nodal_connec_index->begin();
for(int i=0;i<nbOfCells;i++,ci++)
{
if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_HEXA8)
MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
revDesc1=0; revDescIndx1=0;
mDesc->tessellate2D(eps);
- subDivide2DMesh(mDesc->_nodal_connec->getConstPointer(),mDesc->_nodal_connec_index->getConstPointer(),desc1->getConstPointer(),descIndx1->getConstPointer());
+ subDivide2DMesh(mDesc->_nodal_connec->begin(),mDesc->_nodal_connec_index->begin(),desc1->begin(),descIndx1->begin());
setCoords(mDesc->getCoords());
}
INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=1.e-10;
int nbCells=getNumberOfCells();
int nbNodes=getNumberOfNodes();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coords=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coords=_coords->begin();
std::vector<double> addCoo;
std::vector<int> newConn;//no direct DataArrayInt because interface with Geometric2D
MCAuto<DataArrayInt> newConnI(DataArrayInt::New());
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::subDivide2DMesh : On polygon #" << i << " edgeid #" << j << " subedges mismatch : end subedge k!=start subedge k+1 !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
if(getMeshDimension()!=2 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("Invalid mesh to apply are2DCellsNotCorrectlyOriented on it : must be meshDim==2 and spaceDim==3 !");
int nbOfCells=getNumberOfCells();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coordsPtr=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coordsPtr=_coords->begin();
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
if(getMeshDimension()!=2 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("Invalid mesh to apply orientCorrectly2DCells on it : must be meshDim==2 and spaceDim==3 !");
int nbOfCells(getNumberOfCells()),*conn(_nodal_connec->getPointer());
- const int *connI(_nodal_connec_index->getConstPointer());
- const double *coordsPtr(_coords->getConstPointer());
+ const int *connI(_nodal_connec_index->begin());
+ const double *coordsPtr(_coords->begin());
bool isModified(false);
for(int i=0;i<nbOfCells;i++)
{
if(mdim!=2 && mdim!=1)
throw INTERP_KERNEL::Exception("Invalid mesh to apply changeOrientationOfCells on it : must be meshDim==2 or meshDim==1 !");
int nbOfCells(getNumberOfCells()),*conn(_nodal_connec->getPointer());
- const int *connI(_nodal_connec_index->getConstPointer());
+ const int *connI(_nodal_connec_index->begin());
if(mdim==2)
{//2D
for(int i=0;i<nbOfCells;i++)
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("Invalid mesh to apply arePolyhedronsNotCorrectlyOriented on it : must be meshDim==3 and spaceDim==3 !");
int nbOfCells=getNumberOfCells();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coordsPtr=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coordsPtr=_coords->begin();
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
throw INTERP_KERNEL::Exception("Invalid mesh to apply orientCorrectlyPolyhedrons on it : must be meshDim==3 and spaceDim==3 !");
int nbOfCells=getNumberOfCells();
int *conn=_nodal_connec->getPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coordsPtr=_coords->getConstPointer();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coordsPtr=_coords->begin();
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
catch(INTERP_KERNEL::Exception& e)
{
std::ostringstream oss; oss << "Something wrong in polyhedron #" << i << " : " << e.what();
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
//
int nbOfCells=getNumberOfCells();
int *conn=_nodal_connec->getPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coo=getCoords()->getConstPointer();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coo=getCoords()->begin();
MCAuto<DataArrayInt> cells(DataArrayInt::New()); cells->alloc(0,1);
for(int i=0;i<nbOfCells;i++)
{
throw INTERP_KERNEL::Exception("Invalid mesh to apply findAndCorrectBadOriented3DCells on it : must be meshDim==3 and spaceDim==3 !");
int nbOfCells=getNumberOfCells();
int *conn=_nodal_connec->getPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coordsPtr=_coords->getConstPointer();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coordsPtr=_coords->begin();
MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
for(int i=0;i<nbOfCells;i++)
{
{
if(getMeshDimension()!=2 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("Invalid mesh to apply getFastAveragePlaneOfThis on it : must be meshDim==2 and spaceDim==3 !");
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coordsPtr=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coordsPtr=_coords->begin();
INTERP_KERNEL::areaVectorOfPolygon<int,INTERP_KERNEL::ALL_C_MODE>(conn+1,connI[1]-connI[0]-1,coordsPtr,vec);
std::copy(coordsPtr+3*conn[1],coordsPtr+3*conn[1]+3,pos);
}
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coo=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coo=_coords->begin();
double tmp[12];
for(int i=0;i<nbOfCells;i++,pt++)
{
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coo=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coo=_coords->begin();
double tmp[12];
for(int i=0;i<nbOfCells;i++,pt++)
{
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coo=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coo=_coords->begin();
double tmp[12];
for(int i=0;i<nbOfCells;i++,pt++)
{
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const double *coo=_coords->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
+ const double *coo=_coords->begin();
double tmp[12];
for(int i=0;i<nbOfCells;i++,pt++)
{
}
/*!
- * This method aggregate the bbox of each cell and put it into bbox parameter.
+ * This method aggregate the bbox of each cell and put it into bbox parameter (xmin,xmax,ymin,ymax,zmin,zmax).
*
* \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
* For all other cases this input parameter is ignored.
bbox[2*i]=std::numeric_limits<double>::max();
bbox[2*i+1]=-std::numeric_limits<double>::max();
}
- const double *coordsPtr(_coords->getConstPointer());
- const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+ const double *coordsPtr(_coords->begin());
+ const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
for(int i=0;i<nbOfCells;i++)
{
int offset=connI[i]+1;
if(kk==0)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::getBoundingBoxForBBTree : cell #" << i << " contains no valid nodeId !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
return ret.retn();
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic : This method should be applied on mesh with mesh dimension equal to 2 and space dimension also equal to 2!");
MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
- const double *coords(_coords->getConstPointer());
- const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+ const double *coords(_coords->begin());
+ const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
for(int i=0;i<nbOfCells;i++,bbox+=4,connI++)
{
const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*connI]));
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic : This method should be applied on mesh with mesh dimension equal to 1 and space dimension also equal to 2!");
MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
- const double *coords(_coords->getConstPointer());
- const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+ const double *coords(_coords->begin());
+ const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
for(int i=0;i<nbOfCells;i++,bbox+=4,connI++)
{
const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*connI]));
std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const
{
checkConnectivityFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
const int *work=connI;
int nbOfCells=getNumberOfCells();
std::size_t n=getAllGeoTypes().size();
{
std::ostringstream oss; oss << "MEDCouplingUMesh::getDistributionOfTypes : Type " << INTERP_KERNEL::CellModel::GetCellModel(typ).getRepr();
oss << " is not contiguous !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
types.insert(typ);
ret[3*i]=typ;
MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nb,1);
int *retPtr=ret->getPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
- const int *conn=_nodal_connec->getConstPointer();
+ const int *connI=_nodal_connec_index->begin();
+ const int *conn=_nodal_connec->begin();
int nbOfCells=getNumberOfCells();
const int *i=connI;
int kk=0;
{
std::ostringstream oss; oss << "MEDCouplingUMesh::checkTypeConsistencyAndContig : the section " << kk << " points to the profile #" << idInIdsPerType;
oss << ", and this profile contains a value " << *k << " should be in [0," << nbOfCellsOfCurType << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
{
std::ostringstream oss; oss << "MEDCouplingUMesh::checkTypeConsistencyAndContig : at section " << kk << " of code it points to the array #" << idInIdsPerType;
oss << " should be in [0," << idsPerType.size() << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
i=j;
if(profile->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::splitProfilePerType : input profile should have exactly one component !");
checkConnectivityFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector<int> typeRangeVals(1);
idsInPflPerType2.push_back(tmp3);
code[3*i]=(int)types[castId];
code[3*i+1]=tmp3->getNumberOfTuples();
- MCAuto<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->getConstPointer(),tmp3->getConstPointer()+tmp3->getNumberOfTuples());
+ MCAuto<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->begin(),tmp3->begin()+tmp3->getNumberOfTuples());
if(!tmp4->isIota(typeRangeVals[castId+1]-typeRangeVals[castId]))
{
tmp4->copyStringInfoFrom(*profile);
MCAuto<DataArrayInt> tmp1=DataArrayInt::New();
MCAuto<MEDCouplingUMesh> ret1=buildDescendingConnectivity(desc,descIndx,tmp0,tmp1);
MCAuto<DataArrayInt> ret0=ret1->sortCellsInMEDFileFrmt();
- desc->transformWithIndArr(ret0->getConstPointer(),ret0->getConstPointer()+ret0->getNbOfElems());
+ desc->transformWithIndArr(ret0->begin(),ret0->begin()+ret0->getNbOfElems());
MCAuto<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
tmp->setConnectivity(tmp0,tmp1);
- tmp->renumberCells(ret0->getConstPointer(),false);
+ tmp->renumberCells(ret0->begin(),false);
revDesc=tmp->getNodalConnectivity();
revDescIndx=tmp->getNodalConnectivityIndex();
DataArrayInt *ret=0;
ret->getMaxValue(tmp2);
ret->decrRef();
std::ostringstream oss; oss << "MEDCouplingUMesh::emulateMEDMEMBDC : input N-1 mesh present a cell not in descending mesh ... Id of cell is " << tmp2 << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
nM1LevMeshIds=ret;
//
{
checkConnectivityFullyDefined();
MCAuto<DataArrayInt> ret=getRenumArrForMEDFileFrmt();
- renumberCells(ret->getConstPointer(),false);
+ renumberCells(ret->begin(),false);
return ret.retn();
}
bool MEDCouplingUMesh::checkConsecutiveCellTypes() const
{
checkFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
std::set<INTERP_KERNEL::NormalizedCellType> types;
for(const int *i=connI;i!=connI+nbOfCells;)
bool MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
{
checkFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
if(nbOfCells==0)
return true;
{
checkConnectivityFullyDefined();
int nbOfCells=getNumberOfCells();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
MCAuto<DataArrayInt> tmpa=DataArrayInt::New();
MCAuto<DataArrayInt> tmpb=DataArrayInt::New();
tmpa->alloc(nbOfCells,1);
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*i]);
std::ostringstream oss; oss << "MEDCouplingUMesh::getLevArrPerCellTypes : Cell #" << std::distance(connI,i);
oss << " has a type " << cm.getRepr() << " not in input array of type !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
nbPerType=tmpb.retn();
{
checkFullyDefined();
computeTypes();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
std::vector<INTERP_KERNEL::NormalizedCellType> types;
for(const int *i=connI;i!=connI+nbOfCells && (types.size()!=_types.size());)
std::vector<MEDCouplingUMesh *> MEDCouplingUMesh::splitByType() const
{
checkConnectivityFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
std::vector<MEDCouplingUMesh *> ret;
for(const int *i=connI;i!=connI+nbOfCells;)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : this contains a single geo type (" << cm.getRepr() << ") but ";
oss << "this type is dynamic ! Only static geometric type is possible for that type ! call convertNodalConnectivityToDynamicGeoTypeMesh instead !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
int nbCells=getNumberOfCells();
int typi=(int)typ;
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : there something wrong in cell #" << i << " ! The type of cell is not those expected, or the length of nodal connectivity is not those expected (" << nbNodesPerCell-1 << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
return connOut.retn();
for(std::size_t i=0;i<m1ssm.size();i++)
m1ssmfinal[renum->getIJ(i,0)]=m1ssm[i];
MCAuto<MEDCouplingUMesh> ret0=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmfinal);
- szOfCellGrpOfSameType=ret1->renumber(renum->getConstPointer());
- idInMsOfCellGrpOfSameType=ret2->renumber(renum->getConstPointer());
+ szOfCellGrpOfSameType=ret1->renumber(renum->begin());
+ idInMsOfCellGrpOfSameType=ret2->renumber(renum->begin());
return ret0.retn();
}
DataArrayInt *MEDCouplingUMesh::keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const
{
checkFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connIndex=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connIndex=_nodal_connec_index->begin();
MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(const int *w=begin;w!=end;w++)
if((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*w]]==type)
DataArrayInt *MEDCouplingUMesh::convertCellArrayPerGeoType(const DataArrayInt *da) const
{
checkFullyDefined();
- const int *conn=_nodal_connec->getConstPointer();
- const int *connI=_nodal_connec_index->getConstPointer();
+ const int *conn=_nodal_connec->begin();
+ const int *connI=_nodal_connec_index->begin();
int nbOfCells=getNumberOfCells();
std::set<INTERP_KERNEL::NormalizedCellType> types(getAllGeoTypes());
int *tmp=new int[nbOfCells];
ret->alloc(da->getNumberOfTuples(),da->getNumberOfComponents());
ret->copyStringInfoFrom(*da);
int *retPtr=ret->getPointer();
- const int *daPtr=da->getConstPointer();
+ const int *daPtr=da->begin();
int nbOfElems=da->getNbOfElems();
for(int k=0;k<nbOfElems;k++)
retPtr[k]=tmp[daPtr[k]];
{
std::ostringstream oss; oss << "MEDCouplingUMesh::keepSpecifiedCells : Request on type " << type << " at place #" << std::distance(idsPerGeoTypeBg,work) << " value " << *work;
oss << ". It should be in [0," << szOfType << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
MCAuto<DataArrayInt> idsTokeep=DataArrayInt::New(); idsTokeep->alloc(sz+(int)std::distance(idsPerGeoTypeBg,idsPerGeoTypeEnd),1);
int *idsPtr=idsTokeep->getPointer();
{
int ncell=getNumberOfCells();
std::vector<bool> ret(ncell);
- const int *cI=getNodalConnectivityIndex()->getConstPointer();
- const int *c=getNodalConnectivity()->getConstPointer();
+ const int *cI=getNodalConnectivityIndex()->begin();
+ const int *c=getNodalConnectivity()->begin();
for(int i=0;i<ncell;i++)
{
INTERP_KERNEL::NormalizedCellType typ=(INTERP_KERNEL::NormalizedCellType)c[cI[i]];
ret->alloc(nbOfCells,spaceDim);
ret->copyStringInfoFrom(*getCoords());
double *ptToFill=ret->getPointer();
- const int *nodal=_nodal_connec->getConstPointer();
- const int *nodalI=_nodal_connec_index->getConstPointer();
- const double *coor=_coords->getConstPointer();
+ const int *nodal=_nodal_connec->begin();
+ const int *nodalI=_nodal_connec_index->begin();
+ const double *coor=_coords->begin();
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[i]];
int nbOfNodes=getNumberOfNodes();
ret->alloc(nbOfCells,spaceDim);
double *ptToFill=ret->getPointer();
- const int *nodal=_nodal_connec->getConstPointer();
- const int *nodalI=_nodal_connec_index->getConstPointer();
- const double *coor=_coords->getConstPointer();
+ const int *nodal=_nodal_connec->begin();
+ const int *nodalI=_nodal_connec_index->begin();
+ const double *coor=_coords->begin();
for(int i=0;i<nbOfCells;i++,ptToFill+=spaceDim)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[i]];
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *conn << " should be in [0," << nbOfNodes << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
int nbOfNodesInCell=nodalI[i+1]-nodalI[i]-1;
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of cell with no nodes !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell polyhedron cell #" << i << " presence of nodeId #" << *it << " should be in [0," << nbOfNodes << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
if(!s.empty())
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on polyhedron cell #" << i << " there are no nodes !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
ret->alloc(nbOfTuple,spaceDim);
double *ptToFill=ret->getPointer();
double *tmp=new double[spaceDim];
- const int *nodal=_nodal_connec->getConstPointer();
- const int *nodalI=_nodal_connec_index->getConstPointer();
- const double *coor=_coords->getConstPointer();
+ const int *nodal=_nodal_connec->begin();
+ const int *nodalI=_nodal_connec_index->begin();
+ const double *coor=_coords->begin();
for(const int *w=begin;w!=end;w++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[*w]];
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computePlaneEquationOf3DFaces : invalid 2D cell #" << i << " ! This cell points to an invalid nodeId : " << nodeId << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::computePlaneEquationOf3DFaces : invalid 2D cell #" << i << " ! Must be constitued by more than 3 nodes !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
INTERP_KERNEL::inverseMatrix(matrix,4,matrix2);
retPtr[0]=matrix2[3]; retPtr[1]=matrix2[7]; retPtr[2]=matrix2[11]; retPtr[3]=matrix2[15];
* \throw If \a a[ *i* ]->getMeshDimension() < 0.
* \throw If the meshes in \a a are of different dimension (getMeshDimension()).
*/
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const std::vector<const MEDCouplingUMesh *>& a)
{
std::size_t sz=a.size();
if(sz==0)
if(!a[ii])
{
std::ostringstream oss; oss << "MEDCouplingUMesh::MergeUMeshes : item #" << ii << " in input array of size "<< sz << " is empty !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
std::vector< MCAuto<MEDCouplingUMesh> > bb(sz);
std::vector< const MEDCouplingUMesh * > aa(sz);
/// @cond INTERNAL
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(const std::vector<const MEDCouplingUMesh *>& a)
{
if(a.empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::MergeUMeshes : input array must be NON EMPTY !");
for(it=a.begin();it!=a.end();it++)
{
int curNbOfCell=(*it)->getNumberOfCells();
- const int *curCI=(*it)->_nodal_connec_index->getConstPointer();
- const int *curC=(*it)->_nodal_connec->getConstPointer();
+ const int *curCI=(*it)->_nodal_connec_index->begin();
+ const int *curC=(*it)->_nodal_connec->begin();
cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind2nd(std::plus<int>(),offset));
for(int j=0;j<curNbOfCell;j++)
{
if(!meshes[ii])
{
std::ostringstream oss; oss << "MEDCouplingUMesh::MergeUMeshesOnSameCoords : item #" << ii << " in input array of size "<< meshes.size() << " is empty !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
const DataArrayDouble *coords=meshes.front()->getCoords();
int meshDim=meshes.front()->getMeshDimension();
int offset=0;
for(iter=meshes.begin();iter!=meshes.end();iter++)
{
- const int *nod=(*iter)->getNodalConnectivity()->getConstPointer();
- const int *index=(*iter)->getNodalConnectivityIndex()->getConstPointer();
+ const int *nod=(*iter)->getNodalConnectivity()->begin();
+ const int *index=(*iter)->getNodalConnectivityIndex()->begin();
int nbOfCells=(*iter)->getNumberOfCells();
int meshLgth2=(*iter)->getNodalConnectivityArrayLen();
nodalPtr=std::copy(nod,nod+meshLgth2,nodalPtr);
corr.resize(meshes.size());
std::size_t nbOfMeshes=meshes.size();
int offset=0;
- const int *o2nPtr=o2n->getConstPointer();
+ const int *o2nPtr=o2n->begin();
for(std::size_t i=0;i<nbOfMeshes;i++)
{
DataArrayInt *tmp=DataArrayInt::New();
{
std::ostringstream oss; oss << " MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords : Item #" << std::distance(meshes.begin(),it) << " inside the vector of length " << meshes.size();
oss << " has no coordinate array defined !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
{
std::ostringstream oss; oss << " MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords : Item #" << std::distance(meshes.begin(),it) << " inside the vector of length " << meshes.size();
oss << " is null !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
MCAuto<DataArrayDouble> res=DataArrayDouble::Aggregate(coords);
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords : In input vector of unstructured meshes of size " << meshes.size() << " the element #" << std::distance(meshes.begin(),it) << " is null !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
if(s.size()!=1)
{
std::ostringstream oss; oss << "MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords : In input vector of unstructured meshes of size " << meshes.size() << ", it appears that they do not share the same instance of DataArrayDouble for coordiantes ! tryToShareSameCoordsPermute method can help to reach that !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
const DataArrayDouble *coo=*(s.begin());
if(!coo)
MCAuto<DataArrayInt> o2n=DataArrayInt::ConvertIndexArrayToO2N(oldNbOfNodes,comm->begin(),commI->begin(),commI->end(),newNbOfNodes);
if(oldNbOfNodes==newNbOfNodes)
return ;
- MCAuto<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->getConstPointer(),newNbOfNodes);
+ MCAuto<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->begin(),newNbOfNodes);
for(std::vector<MEDCouplingUMesh *>::const_iterator it=meshes.begin();it!=meshes.end();it++)
{
- (*it)->renumberNodesInConn(o2n->getConstPointer());
+ (*it)->renumberNodesInConn(o2n->begin());
(*it)->setCoords(newCoords);
}
}
for(int i=0;i<nbFaces;i++,vPtr+=3,pPtr++)
{
const int *endFaceConn=std::find(stFaceConn,end,-1);
- ComputeVecAndPtOfFace(eps,coords->getConstPointer(),stFaceConn,endFaceConn,vPtr,pPtr);
+ ComputeVecAndPtOfFace(eps,coords->begin(),stFaceConn,endFaceConn,vPtr,pPtr);
stFaceConn=endFaceConn+1;
}
pPtr=p->getPointer(); vPtr=v->getPointer();
DataArrayInt *comm1=0,*commI1=0;
v->findCommonTuples(eps,-1,comm1,commI1);
MCAuto<DataArrayInt> comm1Auto(comm1),commI1Auto(commI1);
- const int *comm1Ptr=comm1->getConstPointer();
- const int *commI1Ptr=commI1->getConstPointer();
+ const int *comm1Ptr=comm1->begin();
+ const int *commI1Ptr=commI1->begin();
int nbOfGrps1=commI1Auto->getNumberOfTuples()-1;
res->pushBackSilent((int)INTERP_KERNEL::NORM_POLYHED);
//
DataArrayInt *comm2=0,*commI2=0;
tmpgrp2->findCommonTuples(eps,-1,comm2,commI2);
MCAuto<DataArrayInt> comm2Auto(comm2),commI2Auto(commI2);
- const int *comm2Ptr=comm2->getConstPointer();
- const int *commI2Ptr=commI2->getConstPointer();
+ const int *comm2Ptr=comm2->begin();
+ const int *commI2Ptr=commI2->begin();
int nbOfGrps2=commI2Auto->getNumberOfTuples()-1;
for(int j=0;j<nbOfGrps2;j++)
{
MCAuto<MEDCouplingUMesh> mm3=static_cast<MEDCouplingUMesh *>(mm2->buildPartOfMySelf(ids2->begin(),ids2->end(),true));
MCAuto<DataArrayInt> idsNodeTmp=mm3->zipCoordsTraducer();
MCAuto<DataArrayInt> idsNode=idsNodeTmp->invertArrayO2N2N2O(mm3->getNumberOfNodes());
- const int *idsNodePtr=idsNode->getConstPointer();
+ const int *idsNodePtr=idsNode->begin();
double center[3]; center[0]=pPtr[pointId]*vPtr[3*vecId]; center[1]=pPtr[pointId]*vPtr[3*vecId+1]; center[2]=pPtr[pointId]*vPtr[3*vecId+2];
double vec[3]; vec[0]=vPtr[3*vecId+1]; vec[1]=-vPtr[3*vecId]; vec[2]=0.;
double norm=vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2];
}
mm3->changeSpaceDimension(2);
MCAuto<MEDCouplingUMesh> mm4=mm3->buildSpreadZonesWithPoly();
- const int *conn4=mm4->getNodalConnectivity()->getConstPointer();
- const int *connI4=mm4->getNodalConnectivityIndex()->getConstPointer();
+ const int *conn4=mm4->getNodalConnectivity()->begin();
+ const int *connI4=mm4->getNodalConnectivityIndex()->begin();
int nbOfCells=mm4->getNumberOfCells();
for(int k=0;k<nbOfCells;k++)
{
std::pair<int,int> p1(bgFace[j],bgFace[(j+1)%nbOfEdgesInFace]);
std::pair<int,int> p2(p1.second,p1.first);
if(std::find(edgesOK.begin(),edgesOK.end(),p1)!=edgesOK.end())
- { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+ { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str()); }
if(std::find(edgesFinished.begin(),edgesFinished.end(),p1)!=edgesFinished.end() || std::find(edgesFinished.begin(),edgesFinished.end(),p2)!=edgesFinished.end())
- { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+ { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str()); }
std::list< std::pair<int,int> >::iterator it=std::find(edgesOK.begin(),edgesOK.end(),p2);
if(it!=edgesOK.end())
{
DataArrayInt *MEDCouplingUMesh::buildUnionOf2DMeshLinear(const MEDCouplingUMesh *skin, const DataArrayInt *n2o) const
{
int nbOfNodesExpected(skin->getNumberOfNodes());
- const int *n2oPtr(n2o->getConstPointer());
+ const int *n2oPtr(n2o->begin());
MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
skin->getReverseNodalConnectivity(revNodal,revNodalI);
- const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
- const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
- const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
+ const int *revNodalPtr(revNodal->begin()),*revNodalIPtr(revNodalI->begin());
+ const int *nodalPtr(skin->getNodalConnectivity()->begin());
+ const int *nodalIPtr(skin->getNodalConnectivityIndex()->begin());
MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
int *work(ret->getPointer()); *work++=INTERP_KERNEL::NORM_POLYGON;
if(nbOfNodesExpected<1)
{
int nbOfNodesExpected(skin->getNumberOfNodes());
int nbOfTurn(nbOfNodesExpected/2);
- const int *n2oPtr(n2o->getConstPointer());
+ const int *n2oPtr(n2o->begin());
MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
skin->getReverseNodalConnectivity(revNodal,revNodalI);
- const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
- const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
- const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
+ const int *revNodalPtr(revNodal->begin()),*revNodalIPtr(revNodalI->begin());
+ const int *nodalPtr(skin->getNodalConnectivity()->begin());
+ const int *nodalIPtr(skin->getNodalConnectivityIndex()->begin());
MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
int *work(ret->getPointer()); *work++=INTERP_KERNEL::NORM_QPOLYG;
if(nbOfNodesExpected<1)
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildUnionOf3DMesh : meshdimension, spacedimension must be equal to 2 !");
MCAuto<MEDCouplingUMesh> m=computeSkin();
- const int *conn=m->getNodalConnectivity()->getConstPointer();
- const int *connI=m->getNodalConnectivityIndex()->getConstPointer();
+ const int *conn=m->getNodalConnectivity()->begin();
+ const int *connI=m->getNodalConnectivityIndex()->begin();
int nbOfCells=m->getNumberOfCells();
MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(m->getNodalConnectivity()->getNumberOfTuples(),1);
int *work=ret->getPointer(); *work++=INTERP_KERNEL::NORM_POLYHED;
MEDCoupling::DataArrayInt* indexr=MEDCoupling::DataArrayInt::New();
MEDCoupling::DataArrayInt* revConn=MEDCoupling::DataArrayInt::New();
this->getReverseNodalConnectivity(revConn,indexr);
- const int* indexr_ptr=indexr->getConstPointer();
- const int* revConn_ptr=revConn->getConstPointer();
+ const int* indexr_ptr=indexr->begin();
+ const int* revConn_ptr=revConn->begin();
const MEDCoupling::DataArrayInt* index;
const MEDCoupling::DataArrayInt* conn;
conn=this->getNodalConnectivity(); // it includes a type as the 1st element!!!
index=this->getNodalConnectivityIndex();
int nbCells=this->getNumberOfCells();
- const int* index_ptr=index->getConstPointer();
- const int* conn_ptr=conn->getConstPointer();
+ const int* index_ptr=index->begin();
+ const int* conn_ptr=conn->begin();
//creating graph arcs (cell to cell relations)
//arcs are stored in terms of (index,value) notation
int nbOfCells=getNumberOfCells();
if(nbOfCells<=0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::writeVTK : the unstructured mesh has no cells !");
- static const int PARAMEDMEM2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
ofs << " <" << getVTKDataSetType() << ">\n";
ofs << " <Piece NumberOfPoints=\"" << getNumberOfNodes() << "\" NumberOfCells=\"" << nbOfCells << "\">\n";
ofs << " <PointData>\n" << pointData << std::endl;
}
ofs << " </Points>\n";
ofs << " <Cells>\n";
- const int *cPtr=_nodal_connec->getConstPointer();
- const int *cIPtr=_nodal_connec_index->getConstPointer();
+ const int *cPtr=_nodal_connec->begin();
+ const int *cIPtr=_nodal_connec_index->begin();
MCAuto<DataArrayInt> faceoffsets=DataArrayInt::New(); faceoffsets->alloc(nbOfCells,1);
MCAuto<DataArrayInt> types=DataArrayInt::New(); types->alloc(nbOfCells,1);
MCAuto<DataArrayInt> offsets=DataArrayInt::New(); offsets->alloc(nbOfCells,1);
w4=std::copy(c.begin(),c.end(),w4);
}
}
- types->transformWithIndArr(PARAMEDMEM2VTKTYPETRADUCER,PARAMEDMEM2VTKTYPETRADUCER+INTERP_KERNEL::NORM_MAXTYPE+1);
+ types->transformWithIndArr(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+INTERP_KERNEL::NORM_MAXTYPE+1);
types->writeVTK(ofs,8,"UInt8","types",byteData);
offsets->writeVTK(ofs,8,"Int32","offsets",byteData);
if(szFaceOffsets!=0)
// Step 3:
std::vector<int> cr,crI; //no DataArrayInt because interface with Geometric2D
std::vector<int> cNb1,cNb2; //no DataArrayInt because interface with Geometric2D
- BuildIntersecting2DCellsFromEdges(eps,m1,desc1->getConstPointer(),descIndx1->getConstPointer(),intersectEdge1,colinear2,m2,desc2->getConstPointer(),descIndx2->getConstPointer(),intersectEdge2,addCoo,
+ BuildIntersecting2DCellsFromEdges(eps,m1,desc1->begin(),descIndx1->begin(),intersectEdge1,colinear2,m2,desc2->begin(),descIndx2->begin(),intersectEdge2,addCoo,
/* outputs -> */addCoordsQuadratic,cr,crI,cNb1,cNb2);
// Step 4: Prepare final result:
std::vector<double>& addCoordsQuadratic, std::vector<int>& cr, std::vector<int>& crI, std::vector<int>& cNb1, std::vector<int>& cNb2)
{
static const int SPACEDIM=2;
- const double *coo1(m1->getCoords()->getConstPointer());
- const int *conn1(m1->getNodalConnectivity()->getConstPointer()),*connI1(m1->getNodalConnectivityIndex()->getConstPointer());
+ const double *coo1(m1->getCoords()->begin());
+ const int *conn1(m1->getNodalConnectivity()->begin()),*connI1(m1->getNodalConnectivityIndex()->begin());
int offset1(m1->getNumberOfNodes());
- const double *coo2(m2->getCoords()->getConstPointer());
- const int *conn2(m2->getNodalConnectivity()->getConstPointer()),*connI2(m2->getNodalConnectivityIndex()->getConstPointer());
+ const double *coo2(m2->getCoords()->begin());
+ const int *conn2(m2->getNodalConnectivity()->begin()),*connI2(m2->getNodalConnectivityIndex()->begin());
int offset2(offset1+m2->getNumberOfNodes());
int offset3(offset2+((int)addCoords.size())/2);
MCAuto<DataArrayDouble> bbox1Arr(m1->getBoundingBoxForBBTree()),bbox2Arr(m2->getBoundingBoxForBBTree());
catch(INTERP_KERNEL::Exception& e)
{
std::ostringstream oss; oss << "Error when computing residual of cell #" << i << " in source/m1 mesh ! Maybe the neighbours of this cell in mesh are not well connected !\n" << "The deep reason is the following : " << e.what();
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
for(std::map<int,INTERP_KERNEL::Node *>::const_iterator it=mappRev.begin();it!=mappRev.end();it++)
MCAuto<DataArrayInt> _d(DataArrayInt::New()),_dI(DataArrayInt::New());
MCAuto<DataArrayInt> _rD(DataArrayInt::New()),_rDI(DataArrayInt::New());
MCAuto<MEDCouplingUMesh> m_points(buildDescendingConnectivity(_d, _dI, _rD, _rDI));
- const int *d(_d->getConstPointer()), *dI(_dI->getConstPointer());
- const int *rD(_rD->getConstPointer()), *rDI(_rDI->getConstPointer());
+ const int *d(_d->begin()), *dI(_dI->begin());
+ const int *rD(_rD->begin()), *rDI(_rDI->begin());
MCAuto<DataArrayInt> _dsi(_rDI->deltaShiftIndex());
- const int * dsi(_dsi->getConstPointer());
+ const int * dsi(_dsi->begin());
MCAuto<DataArrayInt> dsii = _dsi->findIdsNotInRange(0,3);
m_points=0;
if (dsii->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::conformize2D : This method only works for meshes with spaceDim=2 and meshDim=2 !");
MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));
- const int *c(mDesc->getNodalConnectivity()->getConstPointer()),*ci(mDesc->getNodalConnectivityIndex()->getConstPointer()),*rd(revDesc1->getConstPointer()),*rdi(revDescIndx1->getConstPointer());
+ const int *c(mDesc->getNodalConnectivity()->begin()),*ci(mDesc->getNodalConnectivityIndex()->begin()),*rd(revDesc1->begin()),*rdi(revDescIndx1->begin());
MCAuto<DataArrayDouble> bboxArr(mDesc->getBoundingBoxForBBTree());
const double *bbox(bboxArr->begin()),*coords(getCoords()->begin());
int nCell(getNumberOfCells()),nDescCell(mDesc->getNumberOfCells());
static const int SPACEDIM=2;
INTERP_KERNEL::QUADRATIC_PLANAR::_precision=eps;
INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps;
- const int *c1(m1Desc->getNodalConnectivity()->getConstPointer()),*ci1(m1Desc->getNodalConnectivityIndex()->getConstPointer());
+ const int *c1(m1Desc->getNodalConnectivity()->begin()),*ci1(m1Desc->getNodalConnectivityIndex()->begin());
// Build BB tree of all edges in the tool mesh (second mesh)
MCAuto<DataArrayDouble> bbox1Arr(m1Desc->getBoundingBoxForBBTree()),bbox2Arr(m2Desc->getBoundingBoxForBBTree());
const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin());
{
int offset1=m1->getNumberOfNodes();
int ncell=m2->getNumberOfCells();
- const int *c=m2->getNodalConnectivity()->getConstPointer();
- const int *cI=m2->getNodalConnectivityIndex()->getConstPointer();
- const double *coo=m2->getCoords()->getConstPointer();
- const double *cooBis=m1->getCoords()->getConstPointer();
+ const int *c=m2->getNodalConnectivity()->begin();
+ const int *cI=m2->getNodalConnectivityIndex()->begin();
+ const double *coo=m2->getCoords()->begin();
+ const double *cooBis=m1->getCoords()->begin();
int offset2=offset1+m2->getNumberOfNodes();
intersectEdge.resize(ncell);
for(int i=0;i<ncell;i++,cI++)
checkFullyDefined();
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::assemblyForSplitFrom3DSurf works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
- const int *nodal3D=_nodal_connec->getConstPointer();
- const int *nodalIndx3D=_nodal_connec_index->getConstPointer();
- int nbOfCells=getNumberOfCells();
+ const int *nodal3D(_nodal_connec->begin()),*nodalIndx3D(_nodal_connec_index->begin());
+ int nbOfCells(getNumberOfCells());
for(int i=0;i<nbOfCells;i++)
{
std::map<int, std::set<int> > m;
}
}
+void InsertNodeInConnIfNecessary(int nodeIdToInsert, std::vector<int>& conn, const double *coords, double eps)
+{
+ std::vector<int>::iterator it(std::find(conn.begin(),conn.end(),nodeIdToInsert));
+ if(it!=conn.end())
+ return ;
+ std::size_t sz(conn.size());
+ std::size_t found(std::numeric_limits<std::size_t>::max());
+ for(std::size_t i=0;i<sz;i++)
+ {
+ int pt0(conn[i]),pt1(conn[(i+1)%sz]);
+ double v1[3]={coords[3*pt1+0]-coords[3*pt0+0],coords[3*pt1+1]-coords[3*pt0+1],coords[3*pt1+2]-coords[3*pt0+2]},v2[3]={coords[3*nodeIdToInsert+0]-coords[3*pt0+0],coords[3*nodeIdToInsert+1]-coords[3*pt0+1],coords[3*nodeIdToInsert+2]-coords[3*pt0+2]};
+ double normm(sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]));
+ std::transform(v1,v1+3,v1,std::bind2nd(std::multiplies<double>(),1./normm));
+ std::transform(v2,v2+3,v2,std::bind2nd(std::multiplies<double>(),1./normm));
+ double v3[3];
+ v3[0]=v1[1]*v2[2]-v1[2]*v2[1]; v3[1]=v1[2]*v2[0]-v1[0]*v2[2]; v3[2]=v1[0]*v2[1]-v1[1]*v2[0];
+ double normm2(sqrt(v3[0]*v3[0]+v3[1]*v3[1]+v3[2]*v3[2])),dotTest(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]);
+ if(normm2<eps)
+ if(dotTest>eps && dotTest<1.-eps)
+ {
+ found=i;
+ break;
+ }
+ }
+ if(found==std::numeric_limits<std::size_t>::max())
+ throw INTERP_KERNEL::Exception("InsertNodeInConnIfNecessary : not found point !");
+ conn.insert(conn.begin()+(found+1)%sz,nodeIdToInsert);
+}
+
+void SplitIntoToPart(const std::vector<int>& conn, int pt0, int pt1, std::vector<int>& part0, std::vector<int>& part1)
+{
+ std::size_t sz(conn.size());
+ std::vector<int> *curPart(&part0);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ int nextt(conn[(i+1)%sz]);
+ (*curPart).push_back(nextt);
+ if(nextt==pt0 || nextt==pt1)
+ {
+ if(curPart==&part0)
+ curPart=&part1;
+ else
+ curPart=&part0;
+ (*curPart).push_back(nextt);
+ }
+ }
+}
+
+/*!
+ * this method method splits cur cells 3D Surf in sub cells 3DSurf using the previous subsplit. This method is the last one used to clip.
+ */
+void MEDCouplingUMesh::buildSubCellsFromCut(const std::vector< std::pair<int,int> >& cut3DSurf,
+ const int *desc, const int *descIndx, const double *coords, double eps,
+ std::vector<std::vector<int> >& res) const
+{
+ checkFullyDefined();
+ if(getMeshDimension()!=3 || getSpaceDimension()!=3)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSubCellsFromCut works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
+ const int *nodal3D(_nodal_connec->begin()),*nodalIndx3D(_nodal_connec_index->begin());
+ int nbOfCells(getNumberOfCells());
+ if(nbOfCells!=1)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSubCellsFromCut works only with single cell presently !");
+ for(int i=0;i<nbOfCells;i++)
+ {
+ int offset(descIndx[i]),nbOfFaces(descIndx[i+1]-offset),start(-1),end(-1);
+ for(int j=0;j<nbOfFaces;j++)
+ {
+ const std::pair<int,int>& p=cut3DSurf[desc[offset+j]];
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)nodal3D[nodalIndx3D[i]]));
+ int sz=nodalIndx3D[i+1]-nodalIndx3D[i]-1;
+ INTERP_KERNEL::AutoPtr<int> tmp(new int[sz]);
+ INTERP_KERNEL::NormalizedCellType cmsId;
+ unsigned nbOfNodesSon(cm.fillSonCellNodalConnectivity2(j,nodal3D+nodalIndx3D[i]+1,sz,tmp,cmsId));
+ std::vector<int> elt((int *)tmp,(int *)tmp+nbOfNodesSon);
+ if(p.first!=-1 && p.second!=-1)
+ {
+ if(p.first!=-2)
+ {
+ InsertNodeInConnIfNecessary(p.first,elt,coords,eps);
+ InsertNodeInConnIfNecessary(p.second,elt,coords,eps);
+ std::vector<int> elt1,elt2;
+ SplitIntoToPart(elt,p.first,p.second,elt1,elt2);
+ res.push_back(elt1);
+ res.push_back(elt2);
+ }
+ else
+ res.push_back(elt);
+ }
+ else
+ res.push_back(elt);
+ }
+ }
+}
+
/*!
* This method compute the convex hull of a single 2D cell. This method tries to conserve at maximum the given input connectivity. In particular, if the orientation of cell is not clockwise
* as in MED format norm. If definitely the result of Jarvis algorithm is not matchable with the input connectivity, the result will be copied into \b nodalConnecOut parameter and
int *arrIPtr=arrIndx->getPointer();
*arrIPtr++=0;
int previousArrI=0;
- const int *arrPtr=arr->getConstPointer();
+ const int *arrPtr=arr->begin();
std::vector<int> arrOut;//no utility to switch to DataArrayInt because copy always needed
for(int i=0;i<nbOfGrps;i++,arrIPtr++)
{
if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : input arrays must have exactly one component !");
std::size_t sz=std::distance(idsOfSelectBg,idsOfSelectEnd);
- const int *arrInPtr=arrIn->getConstPointer();
- const int *arrIndxPtr=arrIndxIn->getConstPointer();
+ const int *arrInPtr=arrIn->begin();
+ const int *arrIndxPtr=arrIndxIn->begin();
int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
if(nbOfGrps<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " ! Must be in [0," << nbOfGrps << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
if(lgth>=work[-1])
*work=lgth;
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " and at this pos arrIndxIn[" << *idsIt;
oss << "+1]-arrIndxIn[" << *idsIt << "] < 0 ! The input index array is bugged !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
arro->alloc(lgth,1);
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " arrIndx[" << *idsIt << "] must be >= 0 and arrIndx[";
oss << *idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
arrOut=arro.retn();
if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input arrays must have exactly one component !");
int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArraysSlice : Input slice ");
- const int *arrInPtr=arrIn->getConstPointer();
- const int *arrIndxPtr=arrIndxIn->getConstPointer();
+ const int *arrInPtr=arrIn->begin();
+ const int *arrIndxPtr=arrIndxIn->begin();
int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
if(nbOfGrps<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
if(lgth>=work[-1])
*work=lgth;
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
oss << "+1]-arrIndxIn[" << idsIt << "] < 0 ! The input index array is bugged !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
arro->alloc(lgth,1);
{
std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
oss << idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
arrOut=arro.retn();
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
std::vector<bool> v(nbOfTuples,true);
int offset=0;
- const int *arrIndxInPtr=arrIndxIn->getConstPointer();
- const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
{
if(*it>=0 && *it<nbOfTuples)
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArrays : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
- srcArrIndexPtr=srcArrIndex->getConstPointer();
+ srcArrIndexPtr=srcArrIndex->begin();
arrIo->alloc(nbOfTuples+1,1);
arro->alloc(arrIn->getNumberOfTuples()+offset,1);
- const int *arrInPtr=arrIn->getConstPointer();
- const int *srcArrPtr=srcArr->getConstPointer();
+ const int *arrInPtr=arrIn->begin();
+ const int *srcArrPtr=srcArr->begin();
int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
int *arroPtr=arro->getPointer();
for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : presence of null pointer in input parameter !");
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- const int *arrIndxInPtr=arrIndxIn->getConstPointer();
- const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
int *arrInOutPtr=arrInOut->getPointer();
- const int *srcArrPtr=srcArr->getConstPointer();
+ const int *srcArrPtr=srcArr->begin();
for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
{
if(*it>=0 && *it<nbOfTuples)
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " id (idsOfSelectBg[" << std::distance(idsOfSelectBg,it)<< "]) is " << *it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
if(*seedElt>=0 && *seedElt<nbOfTuples)
{ fetched[*seedElt]=true; fetched2[*seedElt]=true; }
else
- { std::ostringstream oss; oss << "MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg : At pos #" << i << " of seeds value is " << *seedElt << "! Should be in [0," << nbOfTuples << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+ { std::ostringstream oss; oss << "MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg : At pos #" << i << " of seeds value is " << *seedElt << "! Should be in [0," << nbOfTuples << ") !"; throw INTERP_KERNEL::Exception(oss.str()); }
}
- const int *arrInPtr=arrIn->getConstPointer();
- const int *arrIndxPtr=arrIndxIn->getConstPointer();
+ const int *arrInPtr=arrIn->begin();
+ const int *arrIndxPtr=arrIndxIn->begin();
int targetNbOfDepthPeeling=nbOfDepthPeeling!=-1?nbOfDepthPeeling:std::numeric_limits<int>::max();
std::vector<int> idsToFetch1(seedBg,seedEnd);
std::vector<int> idsToFetch2;
MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
int offset=0;
- const int *arrIndxInPtr=arrIndxIn->getConstPointer();
- const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSlice : ");
int it=start;
for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
- srcArrIndexPtr=srcArrIndex->getConstPointer();
+ srcArrIndexPtr=srcArrIndex->begin();
arrIo->alloc(nbOfTuples+1,1);
arro->alloc(arrIn->getNumberOfTuples()+offset,1);
- const int *arrInPtr=arrIn->getConstPointer();
- const int *srcArrPtr=srcArr->getConstPointer();
+ const int *arrInPtr=arrIn->begin();
+ const int *srcArrPtr=srcArr->begin();
int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
int *arroPtr=arro->getPointer();
for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : presence of null pointer in input parameter !");
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- const int *arrIndxInPtr=arrIndxIn->getConstPointer();
- const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
int *arrInOutPtr=arrInOut->getPointer();
- const int *srcArrPtr=srcArr->getConstPointer();
+ const int *srcArrPtr=srcArr->begin();
int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : ");
int it=start;
for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
else
{
std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ throw INTERP_KERNEL::Exception(oss.str());
}
}
}
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSpreadZonesWithPoly : meshdimension supported are [2,3] ! Not implemented yet for others !");
}
- ret->insertNextCell((INTERP_KERNEL::NormalizedCellType)cell->getIJSafe(0,0),cell->getNumberOfTuples()-1,cell->getConstPointer()+1);
+ ret->insertNextCell((INTERP_KERNEL::NormalizedCellType)cell->getIJSafe(0,0),cell->getNumberOfTuples()-1,cell->begin()+1);
}
//
ret->finishInsertingCells();
*/
std::vector<DataArrayInt *> MEDCouplingUMesh::partitionBySpreadZone() const
{
- int nbOfCellsCur=getNumberOfCells();
- std::vector<DataArrayInt *> ret;
- if(nbOfCellsCur<=0)
- return ret;
DataArrayInt *neigh=0,*neighI=0;
computeNeighborsOfCells(neigh,neighI);
MCAuto<DataArrayInt> neighAuto(neigh),neighIAuto(neighI);
+ return PartitionBySpreadZone(neighAuto,neighIAuto);
+}
+
+std::vector<DataArrayInt *> MEDCouplingUMesh::PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
+{
+ if(!arrIn || !arrIndxIn)
+ throw INTERP_KERNEL::Exception("PartitionBySpreadZone : null input pointers !");
+ arrIn->checkAllocated(); arrIndxIn->checkAllocated();
+ int nbOfTuples(arrIndxIn->getNumberOfTuples());
+ if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1 || nbOfTuples<1)
+ throw INTERP_KERNEL::Exception("PartitionBySpreadZone : invalid arrays in input !");
+ int nbOfCellsCur(nbOfTuples-1);
+ std::vector<DataArrayInt *> ret;
+ if(nbOfCellsCur<=0)
+ return ret;
std::vector<bool> fetchedCells(nbOfCellsCur,false);
std::vector< MCAuto<DataArrayInt> > ret2;
int seed=0;
while(seed<nbOfCellsCur)
{
int nbOfPeelPerformed=0;
- ret2.push_back(ComputeSpreadZoneGraduallyFromSeedAlg(fetchedCells,&seed,&seed+1,neigh,neighI,-1,nbOfPeelPerformed));
+ ret2.push_back(ComputeSpreadZoneGraduallyFromSeedAlg(fetchedCells,&seed,&seed+1,arrIn,arrIndxIn,-1,nbOfPeelPerformed));
seed=(int)std::distance(fetchedCells.begin(),std::find(fetchedCells.begin()+seed,fetchedCells.end(),false));
}
for(std::vector< MCAuto<DataArrayInt> >::iterator it=ret2.begin();it!=ret2.end();it++)
if(nodalConnec && nodalConnecIndex)
{
types.clear();
- const int *conn(nodalConnec->getConstPointer()),*connIndex(nodalConnecIndex->getConstPointer());
+ const int *conn(nodalConnec->begin()),*connIndex(nodalConnecIndex->begin());
int nbOfElem(nodalConnecIndex->getNbOfElems()-1);
if(nbOfElem>0)
for(const int *pt=connIndex;pt!=connIndex+nbOfElem;pt++)
MEDCouplingUMeshCellEntry *MEDCouplingUMeshCellByTypeIterator::nextt()
{
- const int *c=_mesh->getNodalConnectivity()->getConstPointer();
- const int *ci=_mesh->getNodalConnectivityIndex()->getConstPointer();
+ const int *c=_mesh->getNodalConnectivity()->begin();
+ const int *ci=_mesh->getNodalConnectivityIndex()->begin();
if(_cell_id<_nb_cell)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)c[ci[_cell_id]];