From: michael Date: Sat, 10 Oct 2020 22:47:26 +0000 (+0200) Subject: Trying to compile with option -DMEDCOUPLING_USE_64BIT_IDS=ON on medCoupling-master X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=69819c7c86e015e5bcd08e88e0c4b8f9cdae1153;p=tools%2Fsolverlab.git Trying to compile with option -DMEDCOUPLING_USE_64BIT_IDS=ON on medCoupling-master --- diff --git a/CDMATH/IJKmesh/inc/IJKMesh.hxx b/CDMATH/IJKmesh/inc/IJKMesh.hxx index e997137..1f7c612 100644 --- a/CDMATH/IJKmesh/inc/IJKMesh.hxx +++ b/CDMATH/IJKmesh/inc/IJKMesh.hxx @@ -35,7 +35,7 @@ namespace MEDCoupling class MEDFileCMesh; class MEDCouplingMesh; class MEDCouplingIMesh; -class DataArrayInt32; +class DataArrayInt64; } namespace ParaMEDMEM { @@ -356,7 +356,7 @@ private: //---------------------------------------------------------------- /* * The list of node groups. */ - std::vector _nodeGroups; + std::vector _nodeGroups; /* * The mesh MEDCouplingIMesh */ diff --git a/CDMATH/mesh/inc/Mesh.hxx b/CDMATH/mesh/inc/Mesh.hxx index a3f8a28..4c524ef 100644 --- a/CDMATH/mesh/inc/Mesh.hxx +++ b/CDMATH/mesh/inc/Mesh.hxx @@ -25,7 +25,7 @@ class MEDFileUMesh; class MEDCouplingMesh; class MEDCouplingIMesh; class MEDCouplingUMesh; -class DataArrayInt32; +class DataArrayInt64; } namespace ParaMEDMEM { @@ -237,7 +237,11 @@ public: //---------------------------------------------------------------- std::vector getDXYZ() const ;// for structured meshes +#ifdef MEDCoupling_VERSION_VERSION_GREATER_9_4 + std::vector getCellGridStructure() const;// for structured meshes +#else std::vector getCellGridStructure() const;// for structured meshes +#endif /** * \brief surcharge operator = @@ -278,7 +282,7 @@ public: //---------------------------------------------------------------- * \brief return the list of node groups * @return _nodeGroups */ - std::vector getNodeGroups( void ) const ; + std::vector getNodeGroups( void ) const ; /* * Functions to extract boundary nodes and faces Ids @@ -387,7 +391,11 @@ private: //---------------------------------------------------------------- double _zMax; +#ifdef MEDCoupling_VERSION_VERSION_GREATER_9_4 + std::vector _nxyz; +#else std::vector _nxyz; +#endif std::vector _dxyz; /* @@ -442,7 +450,7 @@ private: //---------------------------------------------------------------- /* * The list of node groups. */ - std::vector _nodeGroups; + std::vector _nodeGroups; /* * The mesh MEDCoupling */ diff --git a/CDMATH/mesh/src/Field.cxx b/CDMATH/mesh/src/Field.cxx index 699285d..df1fe99 100755 --- a/CDMATH/mesh/src/Field.cxx +++ b/CDMATH/mesh/src/Field.cxx @@ -68,10 +68,10 @@ void Field::buildFieldMemoryStructure() { _field=MEDCouplingFieldDouble::New(ON_CELLS); array->alloc(_mesh.getNumberOfFaces(),_numberOfComponents); - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descI=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescI=DataArrayInt::New(); + DataArrayInt64 *desc=DataArrayInt64::New(); + DataArrayInt64 *descI=DataArrayInt64::New(); + DataArrayInt64 *revDesc=DataArrayInt64::New(); + DataArrayInt64 *revDescI=DataArrayInt64::New(); MEDCouplingUMesh *m3=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); _field->setMesh(m3); desc->decrRef(); diff --git a/CDMATH/mesh/src/Mesh.cxx b/CDMATH/mesh/src/Mesh.cxx index fce9fbf..817d5bb 100644 --- a/CDMATH/mesh/src/Mesh.cxx +++ b/CDMATH/mesh/src/Mesh.cxx @@ -104,7 +104,7 @@ Mesh::Mesh( const MEDCoupling::MEDCouplingIMesh* mesh ) double *originPtr = new double[_spaceDim]; double *dxyzPtr = new double[_spaceDim]; - int *nodeStrctPtr = new int[_spaceDim]; + mcIdType *nodeStrctPtr = new mcIdType[_spaceDim]; for(int i=0;i<_spaceDim;i++) { @@ -552,10 +552,10 @@ Mesh::setGroups( const MEDFileUMesh* medmesh, MEDCouplingUMesh* mu) for (unsigned int i=0;i nonEmptyGrp(medmesh->getGrpNonEmptyLevels(groupName)); + vector nonEmptyGrp(medmesh->getGrpNonEmptyLevels(groupName)); //We check if the group has a relative dimension equal to -1 //before call to the function getGroup(-1,groupName.c_str()) - vector::iterator it = find(nonEmptyGrp.begin(), nonEmptyGrp.end(), -1); + vector::iterator it = find(nonEmptyGrp.begin(), nonEmptyGrp.end(), -1); if (it != nonEmptyGrp.end()) { cout<<"Boundary face group named "<< groupName << " found"<getNodeGroupArr( groupName ); - const int *nodeids=nodeGroup->getConstPointer(); + DataArrayInt64 * nodeGroup=medmesh->getNodeGroupArr( groupName ); + const mcIdType *nodeids=nodeGroup->getConstPointer(); if(nodeids!=NULL) { @@ -659,10 +659,10 @@ MEDCouplingUMesh* Mesh::setMesh( void ) //---------------------------------------------------------------------- { - DataArrayInt *desc = DataArrayInt::New(); - DataArrayInt *descI = DataArrayInt::New(); - DataArrayInt *revDesc = DataArrayInt::New(); - DataArrayInt *revDescI = DataArrayInt::New(); + DataArrayInt64 *desc = DataArrayInt64::New(); + DataArrayInt64 *descI = DataArrayInt64::New(); + DataArrayInt64 *revDesc = DataArrayInt64::New(); + DataArrayInt64 *revDescI = DataArrayInt64::New(); MEDCouplingUMesh* mu = _mesh->buildUnstructured(); mu->unPolyze(); @@ -671,11 +671,11 @@ Mesh::setMesh( void ) MEDCouplingUMesh* mu2=mu->buildDescendingConnectivity2(desc,descI,revDesc,revDescI);//mesh of dimension N-1 containing the cell interfaces - const int *tmp = desc->getConstPointer(); - const int *tmpI=descI->getConstPointer(); + const long int *tmp = desc->getConstPointer(); + const long int *tmpI=descI->getConstPointer(); - const int *tmpA =revDesc->getConstPointer(); - const int *tmpAI=revDescI->getConstPointer(); + const long int *tmpA =revDesc->getConstPointer(); + const long int *tmpAI=revDescI->getConstPointer(); //const int *work=tmp+tmpI[id];//corresponds to buildDescendingConnectivity @@ -707,22 +707,22 @@ Mesh::setMesh( void ) DataArrayDouble *coo = mu->getCoords() ; const double *cood=coo->getConstPointer(); - DataArrayInt *revNode =DataArrayInt::New(); - DataArrayInt *revNodeI=DataArrayInt::New(); + DataArrayInt64 *revNode =DataArrayInt64::New(); + DataArrayInt64 *revNodeI=DataArrayInt64::New(); mu->getReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN =revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const long int *tmpN =revNode->getConstPointer(); + const long int *tmpNI=revNodeI->getConstPointer(); - DataArrayInt *revCell =DataArrayInt::New(); - DataArrayInt *revCellI=DataArrayInt::New(); + DataArrayInt64 *revCell =DataArrayInt64::New(); + DataArrayInt64 *revCellI=DataArrayInt64::New(); mu2->getReverseNodalConnectivity(revCell,revCellI) ; - const int *tmpC =revCell->getConstPointer(); - const int *tmpCI=revCellI->getConstPointer(); + const long int *tmpC =revCell->getConstPointer(); + const long int *tmpCI=revCellI->getConstPointer(); - const DataArrayInt *nodal = mu2->getNodalConnectivity() ; - const DataArrayInt *nodalI = mu2->getNodalConnectivityIndex() ; - const int *tmpNE =nodal->getConstPointer(); - const int *tmpNEI=nodalI->getConstPointer(); + const DataArrayInt64 *nodal = mu2->getNodalConnectivity() ; + const DataArrayInt64 *nodalI = mu2->getNodalConnectivityIndex() ; + const long int *tmpNE =nodal->getConstPointer(); + const long int *tmpNEI=nodalI->getConstPointer(); _numberOfCells = mu->getNumberOfCells() ; _cells = new Cell[_numberOfCells] ; @@ -736,14 +736,14 @@ Mesh::setMesh( void ) _indexFacePeriodicSet=false; //Definition used if _meshDim =3 to determine the edges - DataArrayInt *desc2 =DataArrayInt::New(); - DataArrayInt *descI2=DataArrayInt::New(); - DataArrayInt *revDesc2 =DataArrayInt::New(); - DataArrayInt *revDescI2=DataArrayInt::New(); - DataArrayInt *revNode2 =DataArrayInt::New(); - DataArrayInt *revNodeI2=DataArrayInt::New(); - const int *tmpN2 ; - const int *tmpNI2; + DataArrayInt64 *desc2 =DataArrayInt64::New(); + DataArrayInt64 *descI2=DataArrayInt64::New(); + DataArrayInt64 *revDesc2 =DataArrayInt64::New(); + DataArrayInt64 *revDescI2=DataArrayInt64::New(); + DataArrayInt64 *revNode2 =DataArrayInt64::New(); + DataArrayInt64 *revNodeI2=DataArrayInt64::New(); + const long int *tmpN2 ; + const long int *tmpNI2; MEDCouplingUMesh* mu3; if (_meshDim == 1) @@ -764,14 +764,14 @@ Mesh::setMesh( void ) { for( int id=0;id<_numberOfCells;id++ ) { - const int *work=tmp+tmpI[id]; + const long int *work=tmp+tmpI[id]; int nbFaces=tmpI[id+1]-tmpI[id]; int nbVertices=mu->getNumberOfNodesInCell(id) ; Cell ci( nbVertices, nbFaces, surf[id], Point(coorBary[id], 0.0, 0.0) ) ; - std::vector nodeIdsOfCell ; + std::vector nodeIdsOfCell ; mu->getNodeIdsOfCell(id,nodeIdsOfCell) ; for( int el=0;elgetNumberOfNodesInCell(id) ; @@ -867,7 +867,7 @@ Mesh::setMesh( void ) Cell ci( nbVertices, nbFaces, surf[id], p ) ; /* Filling cell nodes */ - std::vector nodeIdsOfCell ; + std::vector nodeIdsOfCell ; mu->getNodeIdsOfCell(id,nodeIdsOfCell) ; for( int el=0;el2 && _spaceDim==_meshDim) @@ -986,7 +986,7 @@ Mesh::setMesh( void ) if (nbCells==1) _boundaryFaceIds.push_back(id); - const int *workv=tmpNE+tmpNEI[id]+1; + const long int *workv=tmpNE+tmpNEI[id]+1; int nbNodes= tmpNEI[id+1]-tmpNEI[id]-1; Face fi; @@ -1023,11 +1023,11 @@ Mesh::setMesh( void ) coorP[d] = cood[k+d]; Point p(coorP[0],coorP[1],coorP[2]) ; - const int *workc=tmpN+tmpNI[id]; + const long int *workc=tmpN+tmpNI[id]; int nbCells=tmpNI[id+1]-tmpNI[id]; - const int *workf=tmpC+tmpCI[id]; + const long int *workf=tmpC+tmpCI[id]; int nbFaces=tmpCI[id+1]-tmpCI[id]; - const int *workn; + const long int *workn; int nbNeighbourNodes; if (_meshDim == 1) { @@ -1151,7 +1151,7 @@ Mesh::Mesh( double xmin, double xmax, int nx, std::string meshName ) double *originPtr = new double[_spaceDim]; double *dxyzPtr = new double[_spaceDim]; - int *nodeStrctPtr = new int[_spaceDim]; + mcIdType *nodeStrctPtr = new mcIdType[_spaceDim]; originPtr[0]=xmin; nodeStrctPtr[0]=nx+1; @@ -1169,18 +1169,18 @@ Mesh::Mesh( double xmin, double xmax, int nx, std::string meshName ) delete [] dxyzPtr; delete [] nodeStrctPtr; - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descI=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescI=DataArrayInt::New(); + DataArrayInt64 *desc=DataArrayInt64::New(); + DataArrayInt64 *descI=DataArrayInt64::New(); + DataArrayInt64 *revDesc=DataArrayInt64::New(); + DataArrayInt64 *revDescI=DataArrayInt64::New(); MEDCouplingUMesh* mu=_mesh->buildUnstructured(); MEDCouplingUMesh *mu2=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); - const int *tmp=desc->getConstPointer(); - const int *tmpI=descI->getConstPointer(); + const long int *tmp=desc->getConstPointer(); + const long int *tmpI=descI->getConstPointer(); - const int *tmpA =revDesc->getConstPointer(); - const int *tmpAI=revDescI->getConstPointer(); + const long int *tmpA =revDesc->getConstPointer(); + const long int *tmpAI=revDescI->getConstPointer(); _eltsTypes=mu->getAllGeoTypesSorted(); @@ -1212,7 +1212,7 @@ Mesh::Mesh( double xmin, double xmax, int nx, std::string meshName ) Point p(coorBary[id],0.0,0.0) ; Cell ci( nbVertices, nbVertices, lon[id], p ) ; - std::vector nodeIdsOfCell ; + std::vector nodeIdsOfCell ; mu->getNodeIdsOfCell(id,nodeIdsOfCell) ; for( int el=0;el 0.0) ? -1.0 : 1.0; int nbFaces=tmpI[id+1]-tmpI[id]; - const int *work=tmp+tmpI[id]; + const long int *work=tmp+tmpI[id]; for( int el=0;elgetReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN=revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const long int *tmpN=revNode->getConstPointer(); + const long int *tmpNI=revNodeI->getConstPointer(); for( int id=0;id<_numberOfNodes;id++ ) { std::vector coo ; mu->getCoordinatesOfNode(id,coo); Point p(coo[0],0.0,0.0) ; - const int *workc=tmpN+tmpNI[id]; + const long int *workc=tmpN+tmpNI[id]; int nbCells=tmpNI[id+1]-tmpNI[id]; int nbFaces=1; - const int *workn=tmpA+tmpAI[id]; + const long int *workn=tmpA+tmpAI[id]; int nbNeighbourNodes=tmpAI[id+1]-tmpAI[id]; Node vi( nbCells, nbFaces, nbNeighbourNodes, p ) ; @@ -1328,7 +1328,7 @@ Mesh::Mesh( std::vector points, std::string meshName ) MEDCouplingUMesh * mesh1d = MEDCouplingUMesh::New(meshName, 1); mesh1d->allocateCells(nx - 1); double * coords = new double[nx]; - int * nodal_con = new int[2]; + long int * nodal_con = new long int[2]; coords[0]=points[0]; for(int i=0; i points, std::string meshName ) _mesh=mesh1d; - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descI=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescI=DataArrayInt::New(); + DataArrayInt64 *desc=DataArrayInt64::New(); + DataArrayInt64 *descI=DataArrayInt64::New(); + DataArrayInt64 *revDesc=DataArrayInt64::New(); + DataArrayInt64 *revDescI=DataArrayInt64::New(); MEDCouplingUMesh* mu=_mesh->buildUnstructured(); MEDCouplingUMesh *mu2=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); @@ -1377,7 +1377,7 @@ Mesh::Mesh( std::vector points, std::string meshName ) Point p(coorBary[id],0.0,0.0) ; Cell ci( nbVertices, nbVertices, lon[id], p ) ; - std::vector nodeIdsOfCell ; + std::vector nodeIdsOfCell ; mu->getNodeIdsOfCell(id,nodeIdsOfCell) ; for( int el=0;el points, std::string meshName ) //Suppress the following since tmpN=tmpA - DataArrayInt *revNode=DataArrayInt::New(); - DataArrayInt *revNodeI=DataArrayInt::New(); + DataArrayInt64 *revNode=DataArrayInt64::New(); + DataArrayInt64 *revNodeI=DataArrayInt64::New(); mu->getReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN=revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const long int *tmpN=revNode->getConstPointer(); + const long int *tmpNI=revNodeI->getConstPointer(); _numberOfNodes = mu->getNumberOfNodes() ; _nodes = new Node[_numberOfNodes] ; @@ -1406,10 +1406,10 @@ Mesh::Mesh( std::vector points, std::string meshName ) std::vector coo ; mu->getCoordinatesOfNode(id,coo); Point p(coo[0],0.0,0.0) ; - const int *workc=tmpN+tmpNI[id]; + const long int *workc=tmpN+tmpNI[id]; int nbCells=tmpNI[id+1]-tmpNI[id]; int nbFaces=1; - const int *workn=tmpN+tmpNI[id]; + const long int *workn=tmpN+tmpNI[id]; int nbNeighbourNodes=tmpNI[id+1]-tmpNI[id]; Node vi( nbCells, nbFaces, nbNeighbourNodes, p ) ; int nbVertices=1; @@ -1488,7 +1488,7 @@ Mesh::Mesh( double xmin, double xmax, int nx, double ymin, double ymax, int ny, double *originPtr = new double[_spaceDim]; double *dxyzPtr = new double[_spaceDim]; - int *nodeStrctPtr = new int[_spaceDim]; + mcIdType *nodeStrctPtr = new mcIdType[_spaceDim]; originPtr[0]=xmin; originPtr[1]=ymin; @@ -1565,7 +1565,7 @@ Mesh::Mesh( double xmin, double xmax, int nx, double ymin, double ymax, int ny, double *originPtr = new double[_spaceDim]; double *dxyzPtr = new double[_spaceDim]; - int *nodeStrctPtr = new int[_spaceDim]; + mcIdType *nodeStrctPtr = new mcIdType[_spaceDim]; originPtr[0]=xmin; originPtr[1]=ymin; @@ -1634,7 +1634,7 @@ Mesh::getDXYZ() const return _dxyz; } -std::vector +std::vector Mesh::getCellGridStructure() const { if(!_isStructured) @@ -1834,7 +1834,7 @@ Mesh::getNameOfNodeGroups( void ) const return _nodeGroupNames; } -vector +vector Mesh::getNodeGroups( void ) const { return _nodeGroups;