From: Bernard Sécherà Date: Wed, 14 Oct 2020 12:13:25 +0000 (+0200) Subject: update for MEDCoupling 64 bits X-Git-Tag: V9_6_0~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f99264872e945c7d0a2f39588dc3ff7e4c692e55;p=tools%2Fsolverlab.git update for MEDCoupling 64 bits --- diff --git a/CDMATH/IJKmesh/inc/IJKMesh.hxx b/CDMATH/IJKmesh/inc/IJKMesh.hxx index e997137..d2182c5 100644 --- a/CDMATH/IJKmesh/inc/IJKMesh.hxx +++ b/CDMATH/IJKmesh/inc/IJKMesh.hxx @@ -35,11 +35,11 @@ namespace MEDCoupling class MEDFileCMesh; class MEDCouplingMesh; class MEDCouplingIMesh; -class DataArrayInt32; +class DataArrayIdType; } namespace ParaMEDMEM { -class DataArrayInt; +class DataArrayIdType; } #include #include "NormalizedGeometricTypes" @@ -356,7 +356,7 @@ private: //---------------------------------------------------------------- /* * The list of node groups. */ - std::vector _nodeGroups; + std::vector _nodeGroups; /* * The mesh MEDCouplingIMesh */ diff --git a/CDMATH/IJKmesh/src/Field.cxx b/CDMATH/IJKmesh/src/Field.cxx index 8169ba8..23c4073 100644 --- a/CDMATH/IJKmesh/src/Field.cxx +++ b/CDMATH/IJKmesh/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(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descI=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescI=DataArrayIdType::New(); MEDCouplingUMesh *m3=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); _field->setMesh(m3); desc->decrRef(); diff --git a/CDMATH/IJKmesh/src/IJKMesh.cxx b/CDMATH/IJKmesh/src/IJKMesh.cxx index b214fac..5559c2d 100644 --- a/CDMATH/IJKmesh/src/IJKMesh.cxx +++ b/CDMATH/IJKmesh/src/IJKMesh.cxx @@ -619,7 +619,7 @@ Mesh::getNameOfNodeGroups( void ) const return _nodeGroupNames; } -vector +vector Mesh::getNodeGroups( void ) const { return _nodeGroups; diff --git a/CDMATH/mesh/inc/Mesh.hxx b/CDMATH/mesh/inc/Mesh.hxx index a3f8a28..5a9deff 100644 --- a/CDMATH/mesh/inc/Mesh.hxx +++ b/CDMATH/mesh/inc/Mesh.hxx @@ -8,6 +8,10 @@ #ifndef MESH_HXX_ #define MESH_HXX_ +#include "MEDCouplingUMesh.hxx" +#include "MEDCouplingIMesh.hxx" +#include "MEDCouplingFieldDouble.hxx" + /** * Mesh class is defined by * - case 1: file name of mesh med file (general unstructured) @@ -25,11 +29,11 @@ class MEDFileUMesh; class MEDCouplingMesh; class MEDCouplingIMesh; class MEDCouplingUMesh; -class DataArrayInt32; +class DataArrayIdType; } namespace ParaMEDMEM { -class DataArrayInt; +class DataArrayIdType; } #include #include "NormalizedGeometricTypes" @@ -237,7 +241,7 @@ public: //---------------------------------------------------------------- std::vector getDXYZ() const ;// for structured meshes - std::vector getCellGridStructure() const;// for structured meshes + std::vector getCellGridStructure() const;// for structured meshes /** * \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,7 @@ private: //---------------------------------------------------------------- double _zMax; - std::vector _nxyz; + std::vector _nxyz; std::vector _dxyz; /* @@ -442,7 +446,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..ad36403 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(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descI=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescI=DataArrayIdType::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..b1eb216 100644 --- a/CDMATH/mesh/src/Mesh.cxx +++ b/CDMATH/mesh/src/Mesh.cxx @@ -10,13 +10,9 @@ #include "Cell.hxx" #include "Face.hxx" +#include "CdmathException.hxx" #include "MEDFileMesh.hxx" #include "MEDLoader.hxx" -#include "MEDCouplingUMesh.hxx" -#include "MEDCouplingIMesh.hxx" -#include "MEDCouplingFieldDouble.hxx" - -#include "CdmathException.hxx" #include #include @@ -104,7 +100,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 +548,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(); + DataArrayIdType * nodeGroup=medmesh->getNodeGroupArr( groupName ); + const mcIdType *nodeids=nodeGroup->getConstPointer(); if(nodeids!=NULL) { @@ -659,10 +655,10 @@ MEDCouplingUMesh* Mesh::setMesh( void ) //---------------------------------------------------------------------- { - DataArrayInt *desc = DataArrayInt::New(); - DataArrayInt *descI = DataArrayInt::New(); - DataArrayInt *revDesc = DataArrayInt::New(); - DataArrayInt *revDescI = DataArrayInt::New(); + DataArrayIdType *desc = DataArrayIdType::New(); + DataArrayIdType *descI = DataArrayIdType::New(); + DataArrayIdType *revDesc = DataArrayIdType::New(); + DataArrayIdType *revDescI = DataArrayIdType::New(); MEDCouplingUMesh* mu = _mesh->buildUnstructured(); mu->unPolyze(); @@ -671,11 +667,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 mcIdType *tmp = desc->getConstPointer(); + const mcIdType *tmpI=descI->getConstPointer(); - const int *tmpA =revDesc->getConstPointer(); - const int *tmpAI=revDescI->getConstPointer(); + const mcIdType *tmpA =revDesc->getConstPointer(); + const mcIdType *tmpAI=revDescI->getConstPointer(); //const int *work=tmp+tmpI[id];//corresponds to buildDescendingConnectivity @@ -707,22 +703,22 @@ Mesh::setMesh( void ) DataArrayDouble *coo = mu->getCoords() ; const double *cood=coo->getConstPointer(); - DataArrayInt *revNode =DataArrayInt::New(); - DataArrayInt *revNodeI=DataArrayInt::New(); + DataArrayIdType *revNode =DataArrayIdType::New(); + DataArrayIdType *revNodeI=DataArrayIdType::New(); mu->getReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN =revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const mcIdType *tmpN =revNode->getConstPointer(); + const mcIdType *tmpNI=revNodeI->getConstPointer(); - DataArrayInt *revCell =DataArrayInt::New(); - DataArrayInt *revCellI=DataArrayInt::New(); + DataArrayIdType *revCell =DataArrayIdType::New(); + DataArrayIdType *revCellI=DataArrayIdType::New(); mu2->getReverseNodalConnectivity(revCell,revCellI) ; - const int *tmpC =revCell->getConstPointer(); - const int *tmpCI=revCellI->getConstPointer(); + const mcIdType *tmpC =revCell->getConstPointer(); + const mcIdType *tmpCI=revCellI->getConstPointer(); - const DataArrayInt *nodal = mu2->getNodalConnectivity() ; - const DataArrayInt *nodalI = mu2->getNodalConnectivityIndex() ; - const int *tmpNE =nodal->getConstPointer(); - const int *tmpNEI=nodalI->getConstPointer(); + const DataArrayIdType *nodal = mu2->getNodalConnectivity() ; + const DataArrayIdType *nodalI = mu2->getNodalConnectivityIndex() ; + const mcIdType *tmpNE =nodal->getConstPointer(); + const mcIdType *tmpNEI=nodalI->getConstPointer(); _numberOfCells = mu->getNumberOfCells() ; _cells = new Cell[_numberOfCells] ; @@ -736,14 +732,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; + DataArrayIdType *desc2 =DataArrayIdType::New(); + DataArrayIdType *descI2=DataArrayIdType::New(); + DataArrayIdType *revDesc2 =DataArrayIdType::New(); + DataArrayIdType *revDescI2=DataArrayIdType::New(); + DataArrayIdType *revNode2 =DataArrayIdType::New(); + DataArrayIdType *revNodeI2=DataArrayIdType::New(); + const mcIdType *tmpN2 ; + const mcIdType *tmpNI2; MEDCouplingUMesh* mu3; if (_meshDim == 1) @@ -764,14 +760,14 @@ Mesh::setMesh( void ) { for( int id=0;id<_numberOfCells;id++ ) { - const int *work=tmp+tmpI[id]; + const mcIdType *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) ; + mcIdType nbVertices=mu->getNumberOfNodesInCell(id) ; vector coorBaryXyz(3,0); for (int d=0; d<_spaceDim; d++) @@ -867,7 +863,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;el xyzn(3,0);//Outer normal to the cell if (work[el]<0) for (int d=0; d<_spaceDim; d++) @@ -891,10 +887,10 @@ Mesh::setMesh( void ) { if(_meshDim==1)//we know in this case there are only two faces around the cell id, each face is composed of a single node {//work[0]= first face global number, work[1]= second face global number - int indexFace0=abs(work[0])-1;//=work[0] since Fortran type numbering was used, and negative sign means anticlockwise numbering - int indexFace1=abs(work[1])-1;//=work[1] since Fortran type numbering was used, and negative sign means anticlockwise numbering - int idNodeA=(tmpNE+tmpNEI[indexFace0]+1)[0];//global number of the first face node work[0]=(abs(work[0])-1) - int idNodeB=(tmpNE+tmpNEI[indexFace1]+1)[0];//global number of the second face node work[1]=(abs(work[1])-1) + mcIdType indexFace0=abs(work[0])-1;//=work[0] since Fortran type numbering was used, and negative sign means anticlockwise numbering + mcIdType indexFace1=abs(work[1])-1;//=work[1] since Fortran type numbering was used, and negative sign means anticlockwise numbering + mcIdType idNodeA=(tmpNE+tmpNEI[indexFace0]+1)[0];//global number of the first face node work[0]=(abs(work[0])-1) + mcIdType idNodeB=(tmpNE+tmpNEI[indexFace1]+1)[0];//global number of the second face node work[1]=(abs(work[1])-1) Vector vecAB(3); for(int i=0;i<_spaceDim;i++) vecAB[i]=coo->getIJ(idNodeB,i) - coo->getIJ(idNodeA,i); @@ -912,8 +908,8 @@ Mesh::setMesh( void ) for( int el=0;elgetName()<< " space dim= "<< _spaceDim <<" mesh dim= "<< _meshDim < nodeA(_spaceDim), nodeB(_spaceDim), nodeP(_spaceDim); for(int i=0;i<_spaceDim;i++) { @@ -971,8 +967,8 @@ Mesh::setMesh( void ) for (int d=0; d<_spaceDim; d++) coorBarySegXyz[d] = coorBarySeg[k+d]; Point p(coorBarySegXyz[0],coorBarySegXyz[1],coorBarySegXyz[2]) ; - const int *workc=tmpA+tmpAI[id]; - int nbCells=tmpAI[id+1]-tmpAI[id]; + const mcIdType *workc=tmpA+tmpAI[id]; + mcIdType nbCells=tmpAI[id+1]-tmpAI[id]; if (nbCells>2 && _spaceDim==_meshDim) { @@ -986,8 +982,8 @@ Mesh::setMesh( void ) if (nbCells==1) _boundaryFaceIds.push_back(id); - const int *workv=tmpNE+tmpNEI[id]+1; - int nbNodes= tmpNEI[id+1]-tmpNEI[id]-1; + const mcIdType *workv=tmpNE+tmpNEI[id]+1; + mcIdType nbNodes= tmpNEI[id+1]-tmpNEI[id]-1; Face fi; if(_spaceDim==_meshDim)//Euclidean flat mesh geometry @@ -1023,12 +1019,12 @@ Mesh::setMesh( void ) coorP[d] = cood[k+d]; Point p(coorP[0],coorP[1],coorP[2]) ; - const int *workc=tmpN+tmpNI[id]; - int nbCells=tmpNI[id+1]-tmpNI[id]; - const int *workf=tmpC+tmpCI[id]; - int nbFaces=tmpCI[id+1]-tmpCI[id]; - const int *workn; - int nbNeighbourNodes; + const mcIdType *workc=tmpN+tmpNI[id]; + mcIdType nbCells=tmpNI[id+1]-tmpNI[id]; + const mcIdType *workf=tmpC+tmpCI[id]; + mcIdType nbFaces=tmpCI[id+1]-tmpCI[id]; + const mcIdType *workn; + mcIdType nbNeighbourNodes; if (_meshDim == 1) { workn=tmpA+tmpAI[id]; @@ -1151,7 +1147,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 +1165,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(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descI=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescI=DataArrayIdType::New(); MEDCouplingUMesh* mu=_mesh->buildUnstructured(); MEDCouplingUMesh *mu2=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); - const int *tmp=desc->getConstPointer(); - const int *tmpI=descI->getConstPointer(); + const mcIdType *tmp=desc->getConstPointer(); + const mcIdType *tmpI=descI->getConstPointer(); - const int *tmpA =revDesc->getConstPointer(); - const int *tmpAI=revDescI->getConstPointer(); + const mcIdType *tmpA =revDesc->getConstPointer(); + const mcIdType *tmpAI=revDescI->getConstPointer(); _eltsTypes=mu->getAllGeoTypesSorted(); @@ -1212,7 +1208,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]; + mcIdType nbFaces=tmpI[id+1]-tmpI[id]; + const mcIdType *work=tmp+tmpI[id]; for( int el=0;elgetReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN=revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const mcIdType *tmpN=revNode->getConstPointer(); + const mcIdType *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]; - int nbCells=tmpNI[id+1]-tmpNI[id]; - int nbFaces=1; - const int *workn=tmpA+tmpAI[id]; - int nbNeighbourNodes=tmpAI[id+1]-tmpAI[id]; + const mcIdType *workc=tmpN+tmpNI[id]; + mcIdType nbCells=tmpNI[id+1]-tmpNI[id]; + mcIdType nbFaces=1; + const mcIdType *workn=tmpA+tmpAI[id]; + mcIdType nbNeighbourNodes=tmpAI[id+1]-tmpAI[id]; Node vi( nbCells, nbFaces, nbNeighbourNodes, p ) ; for( int el=0;el 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]; + mcIdType * nodal_con = new mcIdType[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(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descI=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescI=DataArrayIdType::New(); MEDCouplingUMesh* mu=_mesh->buildUnstructured(); MEDCouplingUMesh *mu2=mu->buildDescendingConnectivity(desc,descI,revDesc,revDescI); @@ -1377,7 +1373,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(); + DataArrayIdType *revNode=DataArrayIdType::New(); + DataArrayIdType *revNodeI=DataArrayIdType::New(); mu->getReverseNodalConnectivity(revNode,revNodeI) ; - const int *tmpN=revNode->getConstPointer(); - const int *tmpNI=revNodeI->getConstPointer(); + const mcIdType *tmpN=revNode->getConstPointer(); + const mcIdType *tmpNI=revNodeI->getConstPointer(); _numberOfNodes = mu->getNumberOfNodes() ; _nodes = new Node[_numberOfNodes] ; @@ -1406,11 +1402,11 @@ 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]; - int nbCells=tmpNI[id+1]-tmpNI[id]; - int nbFaces=1; - const int *workn=tmpN+tmpNI[id]; - int nbNeighbourNodes=tmpNI[id+1]-tmpNI[id]; + const mcIdType *workc=tmpN+tmpNI[id]; + mcIdType nbCells=tmpNI[id+1]-tmpNI[id]; + mcIdType nbFaces=1; + const mcIdType *workn=tmpN+tmpNI[id]; + mcIdType nbNeighbourNodes=tmpNI[id+1]-tmpNI[id]; Node vi( nbCells, nbFaces, nbNeighbourNodes, p ) ; int nbVertices=1; /* provisoire !!!!!!!!!!!!*/ @@ -1488,7 +1484,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 +1561,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 +1630,7 @@ Mesh::getDXYZ() const return _dxyz; } -std::vector +std::vector Mesh::getCellGridStructure() const { if(!_isStructured) @@ -1834,7 +1830,7 @@ Mesh::getNameOfNodeGroups( void ) const return _nodeGroupNames; } -vector +vector Mesh::getNodeGroups( void ) const { return _nodeGroups; diff --git a/CDMATH/tests/ressources/2DBrickWall/create_mesh_brickWall.py b/CDMATH/tests/ressources/2DBrickWall/create_mesh_brickWall.py index 2f7d2b2..bdd4e1e 100644 --- a/CDMATH/tests/ressources/2DBrickWall/create_mesh_brickWall.py +++ b/CDMATH/tests/ressources/2DBrickWall/create_mesh_brickWall.py @@ -88,10 +88,10 @@ def createBrickWallMesh( xmin=0., xmax=1., nx=15, ymin=0., ymax=1., ny=15,mesh_n else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DCartesien/create_mesh_of_squares_with_squares.py b/CDMATH/tests/ressources/2DCartesien/create_mesh_of_squares_with_squares.py index 1697271..edf670a 100644 --- a/CDMATH/tests/ressources/2DCartesien/create_mesh_of_squares_with_squares.py +++ b/CDMATH/tests/ressources/2DCartesien/create_mesh_of_squares_with_squares.py @@ -42,10 +42,10 @@ def mesh_rectangle_with_rectangles(xmin, xmax, nx, ymin, ymax, ny, mesh_name="Me else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DCheckerboard/create_checkerboard_2d_quad_meshes_amr.py b/CDMATH/tests/ressources/2DCheckerboard/create_checkerboard_2d_quad_meshes_amr.py index 6b2385f..0e4dc28 100644 --- a/CDMATH/tests/ressources/2DCheckerboard/create_checkerboard_2d_quad_meshes_amr.py +++ b/CDMATH/tests/ressources/2DCheckerboard/create_checkerboard_2d_quad_meshes_amr.py @@ -88,10 +88,10 @@ def createCheckerboardMesh(nb_segs_x, mesh_name=""): elif abs(y-1) < tol: ids_top.append(i) - arr_left = MC.DataArrayInt(ids_left) - arr_right = MC.DataArrayInt(ids_right) - arr_bottom = MC.DataArrayInt(ids_bottom) - arr_top = MC.DataArrayInt(ids_top) + arr_left = MC.DataArrayIdType(ids_left) + arr_right = MC.DataArrayIdType(ids_right) + arr_bottom = MC.DataArrayIdType(ids_bottom) + arr_top = MC.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DCrossTriangles/create_mesh_of_square_with_cross_triangles.py b/CDMATH/tests/ressources/2DCrossTriangles/create_mesh_of_square_with_cross_triangles.py index 110be3d..3758477 100644 --- a/CDMATH/tests/ressources/2DCrossTriangles/create_mesh_of_square_with_cross_triangles.py +++ b/CDMATH/tests/ressources/2DCrossTriangles/create_mesh_of_square_with_cross_triangles.py @@ -47,7 +47,7 @@ def mesh_square_with_cross_triangles(xmin,xmax,nx,ymin,ymax,ny,mesh_name="square nCells = myQuadMesh.getNumberOfCells() c, cI = myQuadMesh.getNodalConnectivity(), myQuadMesh.getNodalConnectivityIndex() - cNew, cINew = mc.DataArrayInt(nCells*16), mc.DataArrayInt(nCells*4+1) + cNew, cINew = mc.DataArrayIdType(nCells*16), mc.DataArrayIdType(nCells*4+1) # Et hop: cINew.iota() @@ -88,10 +88,10 @@ def mesh_square_with_cross_triangles(xmin,xmax,nx,ymin,ymax,ny,mesh_name="square else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DDiskSpiderWeb/create_mesh_diskSpiderWeb.py b/CDMATH/tests/ressources/2DDiskSpiderWeb/create_mesh_diskSpiderWeb.py index cba29c9..607f179 100644 --- a/CDMATH/tests/ressources/2DDiskSpiderWeb/create_mesh_diskSpiderWeb.py +++ b/CDMATH/tests/ressources/2DDiskSpiderWeb/create_mesh_diskSpiderWeb.py @@ -55,7 +55,7 @@ def drawPolarGrid(center_x, center_y, r0, r1, angle0, angle1, n_r, n_theta): # Ecrit le maillage 1D meshMEDFile.setMeshAtLevel(-1,mesh_1d) # Ecrit les groupes - arr_circle = mc.DataArrayInt(range(mesh_1d.getNumberOfCells())) + arr_circle = mc.DataArrayIdType(range(mesh_1d.getNumberOfCells())) arr_circle.setName("Circle") meshMEDFile.addGroup(-1, arr_circle) diff --git a/CDMATH/tests/ressources/2DDiskWithHexagons/create_mesh_diskWithHexagons.py b/CDMATH/tests/ressources/2DDiskWithHexagons/create_mesh_diskWithHexagons.py index 2161d46..a19dc4a 100644 --- a/CDMATH/tests/ressources/2DDiskWithHexagons/create_mesh_diskWithHexagons.py +++ b/CDMATH/tests/ressources/2DDiskWithHexagons/create_mesh_diskWithHexagons.py @@ -54,7 +54,7 @@ def mesh_disk_with_hexagons(xcenter=0., ycenter=0.,Radius=1.,ny=16,mesh_name="di a = cI.deltaShiftIndex() b = a - 1 myNewNbOfTuples = oldNbOfTuples - sum(b.getValues()) - o2n, newNbOfTuples = mc.DataArrayInt.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI) + o2n, newNbOfTuples = mc.DataArrayIdType.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI) print( "Have I got the right number of tuples ?" ) print( "myNewNbOfTuples = %d, newNbOfTuples = %d" % (myNewNbOfTuples, newNbOfTuples) ) assert(myNewNbOfTuples == newNbOfTuples) @@ -90,7 +90,7 @@ def mesh_disk_with_hexagons(xcenter=0., ycenter=0.,Radius=1.,ny=16,mesh_name="di # Ecrit le maillage 1D meshMEDFile.setMeshAtLevel(-1,mesh_1d) # Ecrit les groupes - arr_circle = mc.DataArrayInt(range(mesh_1d.getNumberOfCells())) + arr_circle = mc.DataArrayIdType(range(mesh_1d.getNumberOfCells())) arr_circle.setName("Circle") meshMEDFile.addGroup(-1, arr_circle) diff --git a/CDMATH/tests/ressources/2DEquilateralTriangles/create_mesh_squareWithEquilateralTriangles.py b/CDMATH/tests/ressources/2DEquilateralTriangles/create_mesh_squareWithEquilateralTriangles.py index 55c83f2..5645e29 100644 --- a/CDMATH/tests/ressources/2DEquilateralTriangles/create_mesh_squareWithEquilateralTriangles.py +++ b/CDMATH/tests/ressources/2DEquilateralTriangles/create_mesh_squareWithEquilateralTriangles.py @@ -98,10 +98,10 @@ def mesh_square_with_EquilateralTriangles(xmin=0,xmax=1,ymin=0,ymax=1,ny=10,mesh else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DFlatCrossTriangles/create_mesh_of_square_with_cross_triangles.py b/CDMATH/tests/ressources/2DFlatCrossTriangles/create_mesh_of_square_with_cross_triangles.py index 2068462..1817740 100644 --- a/CDMATH/tests/ressources/2DFlatCrossTriangles/create_mesh_of_square_with_cross_triangles.py +++ b/CDMATH/tests/ressources/2DFlatCrossTriangles/create_mesh_of_square_with_cross_triangles.py @@ -47,7 +47,7 @@ def mesh_square_with_cross_triangles(xmin,xmax,nx,ymin,ymax,ny,mesh_name="square nCells = myQuadMesh.getNumberOfCells() c, cI = myQuadMesh.getNodalConnectivity(), myQuadMesh.getNodalConnectivityIndex() - cNew, cINew = mc.DataArrayInt(nCells*16), mc.DataArrayInt(nCells*4+1) + cNew, cINew = mc.DataArrayIdType(nCells*16), mc.DataArrayIdType(nCells*4+1) # Et hop: cINew.iota() @@ -88,10 +88,10 @@ def mesh_square_with_cross_triangles(xmin,xmax,nx,ymin,ymax,ny,mesh_name="square else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DHexagons/create_mesh_squareWithHexagons.py b/CDMATH/tests/ressources/2DHexagons/create_mesh_squareWithHexagons.py index 0763442..92be56d 100644 --- a/CDMATH/tests/ressources/2DHexagons/create_mesh_squareWithHexagons.py +++ b/CDMATH/tests/ressources/2DHexagons/create_mesh_squareWithHexagons.py @@ -79,10 +79,10 @@ def mesh_square_with_hexagons(xmin=0,xmax=1,ymin=0,ymax=1,ny=14,mesh_name="squar else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DLocRefinedSquares/create_locally_refined_2d_quad_meshes_amr.py b/CDMATH/tests/ressources/2DLocRefinedSquares/create_locally_refined_2d_quad_meshes_amr.py index e49e750..7145e69 100644 --- a/CDMATH/tests/ressources/2DLocRefinedSquares/create_locally_refined_2d_quad_meshes_amr.py +++ b/CDMATH/tests/ressources/2DLocRefinedSquares/create_locally_refined_2d_quad_meshes_amr.py @@ -66,10 +66,10 @@ def createLocallyRefinedMesh(nb_segs_x, mesh_name): elif abs(y-1) < tol: ids_top.append(i) - arr_left = MC.DataArrayInt(ids_left) - arr_right = MC.DataArrayInt(ids_right) - arr_bottom = MC.DataArrayInt(ids_bottom) - arr_top = MC.DataArrayInt(ids_top) + arr_left = MC.DataArrayIdType(ids_left) + arr_right = MC.DataArrayIdType(ids_right) + arr_bottom = MC.DataArrayIdType(ids_bottom) + arr_top = MC.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DLongRectangles/create_mesh_of_rectangle_with_rectangles.py b/CDMATH/tests/ressources/2DLongRectangles/create_mesh_of_rectangle_with_rectangles.py index 9fb8dc1..f96459f 100644 --- a/CDMATH/tests/ressources/2DLongRectangles/create_mesh_of_rectangle_with_rectangles.py +++ b/CDMATH/tests/ressources/2DLongRectangles/create_mesh_of_rectangle_with_rectangles.py @@ -42,10 +42,10 @@ def mesh_rectangle_with_rectangles(xmin, xmax, nx, ymin, ymax, ny, mesh_name="Me else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DRightTriangles/create_mesh_right_triangles.py b/CDMATH/tests/ressources/2DRightTriangles/create_mesh_right_triangles.py index 252435c..8864295 100644 --- a/CDMATH/tests/ressources/2DRightTriangles/create_mesh_right_triangles.py +++ b/CDMATH/tests/ressources/2DRightTriangles/create_mesh_right_triangles.py @@ -90,10 +90,10 @@ def mesh_square_with_RightTriangles(xmin=0,xmax=1.,ymin=0,ymax=1.,nx=10,ny=10,me else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DSkinnyTriangles/create_mesh_of_rectangle_with_right_triangles.py b/CDMATH/tests/ressources/2DSkinnyTriangles/create_mesh_of_rectangle_with_right_triangles.py index b73ce67..da8d377 100644 --- a/CDMATH/tests/ressources/2DSkinnyTriangles/create_mesh_of_rectangle_with_right_triangles.py +++ b/CDMATH/tests/ressources/2DSkinnyTriangles/create_mesh_of_rectangle_with_right_triangles.py @@ -54,10 +54,10 @@ def mesh_square_with_regular_triangles(xmin,xmax,nx,ymin,ymax,ny,mesh_name="squa else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/2DdiskWithSquares/create_mesh_diskWithSquares.py b/CDMATH/tests/ressources/2DdiskWithSquares/create_mesh_diskWithSquares.py index 7a3d3a3..0c02e27 100644 --- a/CDMATH/tests/ressources/2DdiskWithSquares/create_mesh_diskWithSquares.py +++ b/CDMATH/tests/ressources/2DdiskWithSquares/create_mesh_diskWithSquares.py @@ -80,7 +80,7 @@ def mesh_disk_with_squares(xcenter=0.,ycenter=0., Radius=1.,n=17,mesh_name="disk # Ecrit le maillage 1D meshMEDFile.setMeshAtLevel(-1,mesh_1d) # Ecrit les groupes - arr_circle = mc.DataArrayInt(range(mesh_1d.getNumberOfCells())) + arr_circle = mc.DataArrayIdType(range(mesh_1d.getNumberOfCells())) arr_circle.setName("Circle") meshMEDFile.addGroup(-1, arr_circle) diff --git a/CDMATH/tests/ressources/3DHexahedra/create_mesh_of_cube_with_cuboids.py b/CDMATH/tests/ressources/3DHexahedra/create_mesh_of_cube_with_cuboids.py index 4bc20b9..baec532 100644 --- a/CDMATH/tests/ressources/3DHexahedra/create_mesh_of_cube_with_cuboids.py +++ b/CDMATH/tests/ressources/3DHexahedra/create_mesh_of_cube_with_cuboids.py @@ -64,12 +64,12 @@ def mesh_cube_with_cuboids(xmin,xmax,nx,ymin,ymax,ny,zmin, zmax, nz, mesh_name=" else: raise ValueError("Pb with boundary construction : barycenter does not belong to any border group") - arr_left = mc.DataArrayInt(ids_left) - arr_right = mc.DataArrayInt(ids_right) - arr_bottom = mc.DataArrayInt(ids_bottom) - arr_top = mc.DataArrayInt(ids_top) - arr_front = mc.DataArrayInt(ids_front) - arr_back = mc.DataArrayInt(ids_back) + arr_left = mc.DataArrayIdType(ids_left) + arr_right = mc.DataArrayIdType(ids_right) + arr_bottom = mc.DataArrayIdType(ids_bottom) + arr_top = mc.DataArrayIdType(ids_top) + arr_front = mc.DataArrayIdType(ids_front) + arr_back = mc.DataArrayIdType(ids_back) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/3DLocRefinedCubes/create_locally_refined_3d_quad_meshes_amr.py b/CDMATH/tests/ressources/3DLocRefinedCubes/create_locally_refined_3d_quad_meshes_amr.py index 10807dc..2ed1d62 100644 --- a/CDMATH/tests/ressources/3DLocRefinedCubes/create_locally_refined_3d_quad_meshes_amr.py +++ b/CDMATH/tests/ressources/3DLocRefinedCubes/create_locally_refined_3d_quad_meshes_amr.py @@ -71,12 +71,12 @@ def createLocallyRefinedMesh(nb_segs_x, mesh_name): elif abs(z-1) < tol: ids_front.append(i) - arr_left = MC.DataArrayInt(ids_left) - arr_right = MC.DataArrayInt(ids_right) - arr_bottom = MC.DataArrayInt(ids_bottom) - arr_top = MC.DataArrayInt(ids_top) - arr_back = MC.DataArrayInt(ids_back) - arr_front = MC.DataArrayInt(ids_front) + arr_left = MC.DataArrayIdType(ids_left) + arr_right = MC.DataArrayIdType(ids_right) + arr_bottom = MC.DataArrayIdType(ids_bottom) + arr_top = MC.DataArrayIdType(ids_top) + arr_back = MC.DataArrayIdType(ids_back) + arr_front = MC.DataArrayIdType(ids_front) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/scripts/convert_gmsh_to_med.py b/CDMATH/tests/ressources/scripts/convert_gmsh_to_med.py index 2f4a902..82aa133 100755 --- a/CDMATH/tests/ressources/scripts/convert_gmsh_to_med.py +++ b/CDMATH/tests/ressources/scripts/convert_gmsh_to_med.py @@ -136,12 +136,12 @@ for i, coord in enumerate(barycenters): elif abs(z-1) < tol: ids_front.append(i) -arr_left = MC.DataArrayInt(ids_left) -arr_right = MC.DataArrayInt(ids_right) -arr_bottom = MC.DataArrayInt(ids_bottom) -arr_top = MC.DataArrayInt(ids_top) -arr_back = MC.DataArrayInt(ids_back) -arr_front = MC.DataArrayInt(ids_front) +arr_left = MC.DataArrayIdType(ids_left) +arr_right = MC.DataArrayIdType(ids_right) +arr_bottom = MC.DataArrayIdType(ids_bottom) +arr_top = MC.DataArrayIdType(ids_top) +arr_back = MC.DataArrayIdType(ids_back) +arr_front = MC.DataArrayIdType(ids_front) arr_left.setName("Left") arr_right.setName("Right") diff --git a/CDMATH/tests/ressources/scripts/convert_typ_to_med.py b/CDMATH/tests/ressources/scripts/convert_typ_to_med.py index 2018f57..c84cbed 100644 --- a/CDMATH/tests/ressources/scripts/convert_typ_to_med.py +++ b/CDMATH/tests/ressources/scripts/convert_typ_to_med.py @@ -32,7 +32,7 @@ def read_typ2(fichier, nom_med): nb_vois = ri.deltaShiftIndex() for i in range(mf.getNumberOfCells()): if nb_vois[i] == 1: g.append(i) - grp = ml.DataArrayInt.New(g) + grp = ml.DataArrayIdType.New(g) grp.setName("boundary") mm.addGroup(-1, grp) @@ -106,7 +106,7 @@ def read_typ3(fichier, nom_med): nb_vois = ri.deltaShiftIndex() for i in range(mf.getNumberOfCells()): if nb_vois[i] == 1: g.append(i) - grp = ml.DataArrayInt.New(g) + grp = ml.DataArrayIdType.New(g) grp.setName("boundary") mm.addGroup(-1, grp) diff --git a/CDMATH/tests/ressources/scripts/weird_mesh.py b/CDMATH/tests/ressources/scripts/weird_mesh.py index 57958ba..b26afcb 100644 --- a/CDMATH/tests/ressources/scripts/weird_mesh.py +++ b/CDMATH/tests/ressources/scripts/weird_mesh.py @@ -76,7 +76,7 @@ def getWeirdMesh(xmin, xmax, ymin, ymax, lx, ly, str, func=None, extr=-1, unpo=F for idx, b in enumerate(bf): if abs(b[i] - [[xmin, xmax], [ymin, ymax], [0., 1.]][i][j]) < 1e-5: g.append(idx) - grp = ml.DataArrayInt.New(g) + grp = ml.DataArrayIdType.New(g) grp.setName(noms_cl[i][j]) mm.addGroup(-1, grp) diff --git a/CDMATH/tests/swig/BoySurface/VTKnewReader.py b/CDMATH/tests/swig/BoySurface/VTKnewReader.py index fcf57d6..e6e96cd 100644 --- a/CDMATH/tests/swig/BoySurface/VTKnewReader.py +++ b/CDMATH/tests/swig/BoySurface/VTKnewReader.py @@ -172,19 +172,19 @@ class VTURawReader: m.setCoords(coo) # connectivity offsets=np.memmap(fd,dtype=rd._type_off,mode='r',offset=ref+rd._off_off,shape=(rd._nb_cells,)) - offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayInt(rd._nb_cells+1) ; offsets2.setIJ(0,0,0) - offsets2[1:]=DataArrayInt([int(o) for o in offsets]) + offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayIdType(rd._nb_cells+1) ; offsets2.setIJ(0,0,0) + offsets2[1:]=DataArrayIdType([int(o) for o in offsets]) offsets3=offsets2.deltaShiftIndex() ; offsets2=offsets3.deepCopy() ; offsets3+=1 ; offsets3.computeOffsetsFull() offsets=offsets3 - tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsetsFull() - tmp1=DataArrayInt.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1) + tmp1=DataArrayIdType(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsetsFull() + tmp1=DataArrayIdType.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1) conn=np.memmap(fd,dtype=rd._type_conn,mode='r',offset=ref+rd._off_conn,shape=(connLgth,)) conn=self.__swapIfNecessary(rd._bo,conn) - types=np.array(types,dtype='int32') ; types=DataArrayInt(types) ; + types=np.array(types,dtype='int32') ; types=DataArrayIdType(types) ; types.transformWithIndArr(self.VTKTypes_2_MC) - conn2=DataArrayInt(offsets.back()) + conn2=DataArrayIdType(offsets.back()) conn2[offsets[0:-1]]=types - conn2[tmp1]=DataArrayInt([int(c) for c in conn]) + conn2[tmp1]=DataArrayIdType([int(c) for c in conn]) m.setConnectivity(conn2,offsets,True) m.checkConsistencyLight() ; mm=MEDFileUMesh() ; mm.setMeshAtLevel(0,m) ; ms.pushMesh(mm) # Fields on nodes and on cells