diff --git a/Cassiopee/Apps/Apps/Fast/IBM.py b/Cassiopee/Apps/Apps/Fast/IBM.py index 4a5303de1..26780da43 100644 --- a/Cassiopee/Apps/Apps/Fast/IBM.py +++ b/Cassiopee/Apps/Apps/Fast/IBM.py @@ -398,10 +398,10 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): Usage: loads(t, NPas, span, dictNz, isCartesianExtrude)""" NP = Cmpi.size rank = Cmpi.rank - NPTS = numpy.zeros(NP) - NCELLS = numpy.zeros(NP) - NPTS_noghost = numpy.zeros(NP) - NCELLS_noghost = numpy.zeros(NP) + NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NPTS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) if isinstance(t, str): h = Filter.Handle(t) t = h.loadFromProc(loadVariables=False) @@ -582,15 +582,15 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span Internal.createUniqueChild(Conn, name, 'GridConnectivity1to1_t') tmp1 = Internal.getNodeFromName(Conn, name) Internal.setValue(tmp1, z[0]) - datap = numpy.empty( (3,2) , numpy.int32) + datap = numpy.empty( (3,2) , dtype=Internal.E_NpyInt) datap[0,0]=1+ng;datap[1,0]=1+ng;datap[2,0]=ktg datap[0,1]=zdim[0,0]-ng;datap[1,1]=zdim[1,0]-ng;datap[2,1]= ktg Internal.createUniqueChild(tmp1 ,'PointRange', 'IndexRange_t',datap) - datap = numpy.empty( (3,2) , numpy.int32) + datap = numpy.empty( (3,2) , dtype=Internal.E_NpyInt) datap[0,0]=1+ng;datap[1,0]=1+ng;datap[2,0]=ktgD datap[0,1]=zdim[0,0]-ng;datap[1,1]=zdim[1,0]-ng;datap[2,1]= ktgD Internal.createUniqueChild(tmp1 ,'PointRangeDonor', 'IndexRange_t',datap) - datap = numpy.empty( 3 , numpy.int32) + datap = numpy.empty( 3 , dtype=Internal.E_NpyInt) datap[0]=1;datap[1]=2;datap[2]=3 Internal.createUniqueChild(tmp1 ,'Transform', '"int[IndexDimension]"',datap) Internal.createUniqueChild(tmp1 ,'GridConnectivityProperty', 'GridConnectivityProperty_t') @@ -827,8 +827,8 @@ def _distribute(t_in, tc_in, NP, algorithm='graph', tc2_in=None): # Check number of points and cells per zone & in total #==================================================================================== def _checkNcellsNptsPerProc(ts, NP, isAtCenter=False): - NPTS = numpy.zeros(NP) - NCELLS = numpy.zeros(NP) + NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) ##Done by zone for flexibility for z in Internal.getZones(ts): proc_num = Cmpi.getProc(z) @@ -845,7 +845,7 @@ def _checkNcellsNptsPerProc(ts, NP, isAtCenter=False): ncells_percent=[] if Cmpi.rank == 0: for i in range(NP): - ncells_percent.append(NCELLS[i]/NcellsTot*100) + ncells_percent.append(NCELLS[i]/NcellsTot*100.) if isAtCenter: print('Rank {} has {} cells & {} % of cells'.format(i,int(NCELLS[i]),round(ncells_percent[i],2))) else: print('Rank {} has {} points & {} cells & {} % of cells'.format(i,int(NPTS[i]),int(NCELLS[i]),round(ncells_percent[i],2))) diff --git a/Cassiopee/Apps/Apps/Mesh/Dragon.py b/Cassiopee/Apps/Apps/Mesh/Dragon.py index 473bd0171..7e9a7a5f4 100644 --- a/Cassiopee/Apps/Apps/Mesh/Dragon.py +++ b/Cassiopee/Apps/Apps/Mesh/Dragon.py @@ -243,7 +243,7 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. # Blanking with delta surface print('Blanking octree width delta...') - BM = numpy.array([[1]]) + BM = numpy.array([[1]], dtype=Internal.E_NpyInt) t = X.blankCells(t, [s2], BM, blankingType='center_in', delta=1.e-12, XRaydim1=xrayDim1, XRaydim2=xrayDim2) if check: C.convertPyTree2File(t, directory_tmp_files+'blanked.cgns') diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index 42c82de1b..5266e639c 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -135,8 +135,8 @@ def _computeMeshInfo(t): NP = Cmpi.size rank = Cmpi.rank - NPTS = numpy.zeros(NP) - NCELLS = numpy.zeros(NP) + NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) for z in Internal.getZones(t): cellN = Internal.getNodeFromName(z, 'cellN')[1] c0 = numpy.count_nonzero(cellN == 0); nc0 += c0 @@ -1922,8 +1922,8 @@ def getIBMFrontType0__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB=0. dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] @@ -1936,8 +1936,8 @@ def getIBMFrontType0__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB=0. dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] @@ -2538,8 +2538,8 @@ def getIBMFrontType0Old__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] else: @@ -2561,8 +2561,8 @@ def getIBMFrontType0Old__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] @@ -2586,8 +2586,8 @@ def getIBMFrontType0Old__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] @@ -2602,8 +2602,8 @@ def getIBMFrontType0Old__(tc, frontvar, dim, isFront2=False, frontType=0, SHIFTB dmin = C.getMaxValue(front, 'TurbulentDistance') if Cmpi.KCOMM is not None: - dmin = numpy.array([dmin]) - dmin_max = numpy.zeros(1) + dmin = numpy.array([dmin], dtype=numpy.float64) + dmin_max = numpy.zeros(1, dtype=numpy.float64) Cmpi.KCOMM.Allreduce(dmin, dmin_max, Cmpi.MAX) dmin = dmin_max[0] @@ -2696,8 +2696,8 @@ def _computeKcurvParameter(tc, tb): y_extrados = numpy.delete(y_extrados, pos) nPts = len(x_extrados) - y1_extrados = numpy.zeros(nPts) - y2_extrados = numpy.zeros(nPts) + y1_extrados = numpy.zeros(nPts, dtype=numpy.float64) + y2_extrados = numpy.zeros(nPts, dtype=numpy.float64) # derivee premiere y1 # schema decentre pour CL diff --git a/Cassiopee/Connector/Connector/OversetData.py b/Cassiopee/Connector/Connector/OversetData.py index 3edbcda90..0fdda0999 100644 --- a/Cassiopee/Connector/Connector/OversetData.py +++ b/Cassiopee/Connector/Connector/OversetData.py @@ -541,10 +541,10 @@ def _setIBCDataForZone__(z, zonesDnr, correctedPts, wallPts, interpPts, loc='nod # direct: on stocke dans aR # inverse: on stocke dans aD #---------------------------------- - PL = numpy.array([],numpy.int32) - PLD = numpy.array([],numpy.int32) - EXTRAP = numpy.array([],numpy.int32) - INTERPTYPE = numpy.array([],numpy.int32) + PL = numpy.array([],dtype=Internal.E_NpyInt) + PLD = numpy.array([], dtype=Internal.E_NpyInt) + EXTRAP = numpy.array([], dtype=Internal.E_NpyInt) + INTERPTYPE = numpy.array([], dtype=Internal.E_NpyInt) CFS = numpy.array([],numpy.float64) VOL = numpy.array([],numpy.float64) ORPHAN = resInterp[5] @@ -711,10 +711,10 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP # direct: on stocke dans aR # inverse: on stocke dans aD #---------------------------------- - PL = numpy.array([],numpy.int32) - PLD = numpy.array([],numpy.int32) - EXTRAP = numpy.array([],numpy.int32) - INTERPTYPE = numpy.array([],numpy.int32) + PL = numpy.array([], dtype=Internal.E_NpyInt) + PLD = numpy.array([], dtype=Internal.E_NpyInt) + EXTRAP = numpy.array([], dtype=Internal.E_NpyInt) + INTERPTYPE = numpy.array([], dtype=Internal.E_NpyInt) CFS = numpy.array([],numpy.float64) VOL = numpy.array([],numpy.float64) ORPHAN = resInterp[5] @@ -828,10 +828,10 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP # direct: on stocke dans aR # inverse: on stocke dans aD #---------------------------------- - PL = numpy.array([],numpy.int32) - PLD = numpy.array([],numpy.int32) - EXTRAP = numpy.array([],numpy.int32) - INTERPTYPE = numpy.array([],numpy.int32) + PL = numpy.array([], dtype=Internal.E_NpyInt) + PLD = numpy.array([], dtype=Internal.E_NpyInt) + EXTRAP = numpy.array([], dtype=Internal.E_NpyInt) + INTERPTYPE = numpy.array([], dtype=Internal.E_NpyInt) CFS = numpy.array([],numpy.float64) VOL = numpy.array([],numpy.float64) ORPHAN = resInterp2[5] @@ -1332,18 +1332,18 @@ def _setInterpDataChimera(aR, aD, order=2, penalty=1, nature=0, extrap=1, ninterploc = resInterp[0][noz].size if ninterploc>0: # domaine d'interpolation if storage == 'direct': - if resInterp[4][noz].size == 0: extrapPts = numpy.array([],numpy.int32) + if resInterp[4][noz].size == 0: extrapPts = numpy.array([], dtype=Internal.E_NpyInt) else: extrapPts = resInterp[4][noz] - if resInterp[6] == []: EXdir = numpy.array([],numpy.int32) + if resInterp[6] == []: EXdir = numpy.array([], dtype=Internal.E_NpyInt) else: EXdir = resInterp[6][noz] _createInterpRegion__(z, zonesDnr[noz][0], resInterp[0][noz], resInterp[1][noz], resInterp[3][noz], \ resInterp[2][noz], numpy.array([],numpy.float64), \ extrapPts, resInterp[5], tag='Receiver', loc=locR, EXDir=EXdir) else: # inverse - if resInterp[4][noz].size == 0: extrapPts = numpy.array([],numpy.int32) + if resInterp[4][noz].size == 0: extrapPts = numpy.array([], dtype=Internal.E_NpyInt) else: extrapPts = resInterp[4][noz] - if resInterp[6] == []: EXdir = numpy.array([],numpy.int32) + if resInterp[6] == []: EXdir = numpy.array([], dtype=Internal.E_NpyInt) else: EXdir = resInterp[6][noz] _createInterpRegion__(zonesDnr[noz], z[0], resInterp[1][noz], resInterp[0][noz], resInterp[3][noz], \ resInterp[2][noz], numpy.array([],numpy.float64), \ @@ -1426,10 +1426,10 @@ def _setInterpDataConservative__(aR, aD, storage='direct'): index = resInterp[4][noi] resInterp[4][noi]=indicesRcvOrig[index] orphanPts = resInterp[4] - else: orphanPts = numpy.array([],numpy.int32) + else: orphanPts = numpy.array([], dtype=Internal.E_NpyInt) - extrapPts = numpy.array([],numpy.int32) - EXdir = numpy.array([],numpy.int32) + extrapPts = numpy.array([], dtype=Internal.E_NpyInt) + EXdir = numpy.array([], dtype=Internal.E_NpyInt) # 3. stockage dans l'arbre # on recupere les bons indices de pts interpoles (indcell ds interpPts) @@ -1444,8 +1444,8 @@ def _setInterpDataConservative__(aR, aD, storage='direct'): extrapPts, orphanPts, tag='Receiver', loc=locR, EXDir=EXdir) else: # inverse - extrapPts = numpy.array([],numpy.int32) - EXdir = numpy.array([],numpy.int32) + extrapPts = numpy.array([], dtype=Internal.E_NpyInt) + EXdir = numpy.array([], dtype=Internal.E_NpyInt) zd = allDnrZones[dnrname] _createInterpRegion__(zd, zr[0], resInterp[1][noz], resInterp[0][noz], resInterp[3][noz], \ resInterp[2][noz], numpy.array([],numpy.float64), \ @@ -1473,10 +1473,10 @@ def _setInterpDataForGhostCellsNGon__(aR, aD, storage='inverse', loc='centers'): if storage!='inverse': print("WARNING: Connector.OversetData.__setInterpDataForGhostCellsNGon__: only valid for storage='inverse'.") - indicesExtrap = numpy.array([],numpy.int32) - indicesOrphan = numpy.array([],numpy.int32) + indicesExtrap = numpy.array([], dtype=Internal.E_NpyInt) + indicesOrphan = numpy.array([], dtype=Internal.E_NpyInt) vols = numpy.array([],numpy.float64) - EXdir = numpy.array([],numpy.int32) + EXdir = numpy.array([], dtype=Internal.E_NpyInt) prefix = 'ID_' for zp in Internal.getZones(aR): zname = zp[0] @@ -1551,10 +1551,10 @@ def _setInterpDataForGhostCellsStruct__(aR, aD, storage='direct', loc='nodes'): try: import Converter.GhostCells as GhostCells except: raise ImportError("setInterpDataForGhostCellsStruct__ requires Converter.GhostCells module.") # empty numpy arrays for zonesubregion nodes - indicesExtrap = numpy.array([], numpy.int32) - indicesOrphan = numpy.array([], numpy.int32) + indicesExtrap = numpy.array([], dtype=Internal.E_NpyInt) + indicesOrphan = numpy.array([], dtype=Internal.E_NpyInt) vols = numpy.array([], numpy.float64) - EXdir = numpy.array([], numpy.int32) + EXdir = numpy.array([], dtype=Internal.E_NpyInt) if loc == 'nodes': locR = 0; locS = 'Vertex' else: locR = 1; locS = 'CellCenter' @@ -1743,12 +1743,12 @@ def _adaptForRANSLES__(tR, tD, dictOfModels=None): if model_zr != 'None' and model_zd != 'None': if (model_zr=='NSTurbulent' or model_zd=='NSTurbulent') and model_zr != model_zd: - datap = numpy.ones(1, numpy.int32) + datap = numpy.ones(1, dtype=Internal.E_NpyInt) Internal.createUniqueChild(s, 'RANSLES', 'DataArray_t', datap) print("Info: _adaptForRANSLES__: {}/{} <-> {}/{}".format(zr[0], model_zr, zd[0], model_zd)) if (model_zr=='LBMLaminar' or model_zd=='LBMLaminar') and model_zr != model_zd: - datap = numpy.ones(1, numpy.int32) + datap = numpy.ones(1, dtype=Internal.E_NpyInt) Internal.createUniqueChild(s, 'NSLBM', 'DataArray_t', datap) print("Info: _adaptForNSLBM__: {}/{} <-> {}/{}".format(zr[0], model_zr, zd[0], model_zd)) @@ -2706,14 +2706,14 @@ def cellN2OversetHoles(t, append=False): nb = 0 for i in range(cellN.size): if cellN[i] == 0: nb += 1 - pointList = numpy.empty((cellDim,nb), dtype=numpy.int32, order='F' ) + pointList = numpy.empty((cellDim,nb), dtype=Internal.E_NpyInt, order='F' ) connector.cellN2OversetHolesStruct(pointList, cellN, im, jm, cellDim, cellN.size) # Unstructured zone else: nb = 0 for i in range(cellN.size): if cellN[i] == 0: nb += 1 - pointList = numpy.empty((1,nb), dtype=numpy.int32) + pointList = numpy.empty((1,nb), dtype=Internal.E_NpyInt) connector.cellN2OversetHolesUnStruct(pointList, cellN, cellN.size) if nb != 0: # Push OversetHoles Node @@ -2780,11 +2780,11 @@ def setOversetHoles(z, indices): # cree la deltaList if type == 1: pointList = indices - elif type == 2: pointList = numpy.array(indices, dtype=numpy.int32) + elif type == 2: pointList = numpy.array(indices, dtype=Internal.E_NpyInt) elif type == 3: pointList = numpy.concatenate(indices) elif type == 4: b = [] - for i in indices: b.append(numpy.array(indices, dtype=numpy.int32)) + for i in indices: b.append(numpy.array(indices, dtype=Internal.E_NpyInt)) pointList = numpy.concatenate(b) # Push OversetHoles Node diff --git a/Cassiopee/Connector/Connector/PyTree.py b/Cassiopee/Connector/Connector/PyTree.py index 24270d2be..7a81f1886 100644 --- a/Cassiopee/Connector/Connector/PyTree.py +++ b/Cassiopee/Connector/Connector/PyTree.py @@ -94,15 +94,15 @@ def _connectMatchNGON__(a, tol, dim, glob, allExtFaces=None, allExtIndices=None, faceListR = allListRcvFaces[nm] faceListD = allListDnrFaces[nm] if periodic == 1: - tsign = numpy.array([signT,signT,signT]) - rsign = numpy.array([signR,signR,signR]) + tsign = numpy.array([signT,signT,signT], dtype=numpy.float64) + rsign = numpy.array([signR,signR,signR], dtype=numpy.float64) C._addBC2Zone(zones[noz1],name1,'BCMatch',faceList=faceListR,\ zoneDonor=z2OppName, faceListDonor=faceListD,tol=tol,\ rotationCenter=rotationCenter, rotationAngle=rsign*rotationAngle,\ translation=tsign*Translation, unitAngle=unitAngle) - tsign = numpy.array([-signT,-signT,-signT]) - rsign = numpy.array([-signR,-signR,-signR]) + tsign = numpy.array([-signT,-signT,-signT], dtype=numpy.float64) + rsign = numpy.array([-signR,-signR,-signR], dtype=numpy.float64) C._addBC2Zone(zones[noz2],name2,'BCMatch',faceList=faceListD,\ zoneDonor=z1OppName, faceListDonor=faceListR,tol=tol,\ rotationCenter=rotationCenter, rotationAngle=rsign*rotationAngle,\ diff --git a/Cassiopee/Connector/Connector/cellN2OversetHoles.cpp b/Cassiopee/Connector/Connector/cellN2OversetHoles.cpp index 4df018b0c..7a70cb94e 100644 --- a/Cassiopee/Connector/Connector/cellN2OversetHoles.cpp +++ b/Cassiopee/Connector/Connector/cellN2OversetHoles.cpp @@ -41,11 +41,11 @@ PyObject* K_CONNECTOR::cellN2OversetHolesStruct(PyObject* self, PyObject* args) // Get CellN array PyArrayObject* cellNatureField = (PyArrayObject*)CellN; - double* cellN = (double*)PyArray_DATA(cellNatureField); + E_Float* cellN = (E_Float*)PyArray_DATA(cellNatureField); // Get PointList array PyArrayObject* pointListArray = (PyArrayObject*)PointList; - int* pointList = (int*)PyArray_DATA(pointListArray); + E_Int* pointList = (E_Int*)PyArray_DATA(pointListArray); // Local values E_Int nb = 0; @@ -124,11 +124,11 @@ PyObject* K_CONNECTOR::cellN2OversetHolesUnStruct(PyObject* self, // Get CellN array PyArrayObject* cellNatureField = (PyArrayObject*)CellN; - double* cellN = (double*)PyArray_DATA(cellNatureField); + E_Float* cellN = (E_Float*)PyArray_DATA(cellNatureField); // Get PointList array PyArrayObject* pointListArray = (PyArrayObject*)PointList; - int* pointList = (int*)PyArray_DATA(pointListArray); + E_Int* pointList = (E_Int*)PyArray_DATA(pointListArray); // Local values E_Int nb = 0; diff --git a/Cassiopee/Converter/Converter/Mpi4py.py b/Cassiopee/Converter/Converter/Mpi4py.py index f717717d9..69eaf7173 100644 --- a/Cassiopee/Converter/Converter/Mpi4py.py +++ b/Cassiopee/Converter/Converter/Mpi4py.py @@ -600,7 +600,7 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, reduction=True, # Calcule l'intersection de deux bbox #============================================================================= def GetIntersectionBbox(bbox1, bbox2): - Ibbox = numpy.zeros(6) + Ibbox = numpy.zeros(6, dtype=numpy.float64) Ibbox[0:3] = [max(bbox1[i],bbox2[i]) for i in range(3)] Ibbox[3:6] = [min(bbox1[i],bbox2[i]) for i in range(3,6)] return Ibbox diff --git a/Cassiopee/Converter/Converter/PyTree.py b/Cassiopee/Converter/Converter/PyTree.py index 8e91da190..1bfab0bbd 100755 --- a/Cassiopee/Converter/Converter/PyTree.py +++ b/Cassiopee/Converter/Converter/PyTree.py @@ -6442,12 +6442,12 @@ def _patchArrayForCenter2NodeNK1__(fields, a): if dim[0] == 'Structured' and nk == 2 and s == ni*nj: if isinstance(fp, list): # array2/3 for n, fl in enumerate(fp): - b = numpy.empty( (ni*nj*2) ) + b = numpy.empty( (ni*nj*2), dtype=numpy.float64 ) b[0:ni*nj] = fl[0:ni*nj] b[ni*nj:2*ni*nj] = fl[0:ni*nj] fp[n] = b else: - b = numpy.empty( (nfld, ni*nj*2) ) + b = numpy.empty( (nfld, ni*nj*2), dtype=numpy.float64 ) b[:,0:ni*nj] = fp[:,0:ni*nj] b[:,ni*nj:2*ni*nj] = fp[:,0:ni*nj] f[1] = b; f[4] = 2 diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index 0925eb5c0..00d2acdcc 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -1082,10 +1082,10 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): Usage: loads(t, NPas, span, dictNz, isCartesianExtrude)""" NP = Cmpi.size rank = Cmpi.rank - NPTS = numpy.zeros(NP) - NCELLS = numpy.zeros(NP) - NPTS_noghost = numpy.zeros(NP) - NCELLS_noghost = numpy.zeros(NP) + NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NPTS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) if isinstance(t, str): h = Filter.Handle(t) t = h.loadFromProc(loadVariables=False) diff --git a/Cassiopee/Generator/Generator/PolyC1.py b/Cassiopee/Generator/Generator/PolyC1.py index 14995e3d6..67caec9e5 100644 --- a/Cassiopee/Generator/Generator/PolyC1.py +++ b/Cassiopee/Generator/Generator/PolyC1.py @@ -48,11 +48,15 @@ def polyC1Mesher(curve, h, yplus, density, splitCrit=10., dalpha=5.,depth=1): nghb = N.zeros((ne,2), dtype=E_NpyInt); nghb[:] = -1 # no de la courbe voisine nghbind = N.zeros((ne,2), dtype=E_NpyInt) # index corresp. sur la courbe voisine # coord des pts de contact - xpts = N.zeros((ne,2)); ypts = N.zeros((ne,2)) ; zpts = N.zeros((ne,2)) + xpts = N.zeros((ne,2), dtype=N.float64) + ypts = N.zeros((ne,2), dtype=N.float64) + zpts = N.zeros((ne,2), dtype=N.float64) # courbure au pts de contact - cpts = N.zeros((ne,2)) + cpts = N.zeros((ne,2), dtype=N.float64) # normale aux points de contact - surfxpts = N.zeros((ne,2)); surfypts = N.zeros((ne,2)); surfzpts = N.zeros((ne,2)) + surfxpts = N.zeros((ne,2), dtype=N.float64) + surfypts = N.zeros((ne,2), dtype=N.float64) + surfzpts = N.zeros((ne,2), dtype=N.float64) # Calcul des coord. des Pts de contact entre courbes C1 for c in range(ne): diff --git a/Cassiopee/Generator/doc/source/Generator.rst b/Cassiopee/Generator/doc/source/Generator.rst index 4e3441bc4..7e33785cd 100644 --- a/Cassiopee/Generator/doc/source/Generator.rst +++ b/Cassiopee/Generator/doc/source/Generator.rst @@ -1206,10 +1206,10 @@ Cartesian grid generators Operations on meshes ----------------------- -.. py:function:: Generator.close(a, tol=1.e-12, suppressDegeneratedNGons=False) +.. py:function:: Generator.close(a, tol=1.e-12, rmOverlappingPts=True, rmOrphanPts=True, rmDuplicatedFaces=True, rmDuplicatedElts=True, rmDegeneratedFaces=True, rmDegeneratedElts=True, indices=None) Close a mesh defined by array a. Points of that mesh which are distant of tol maximum to one another are merged. For unstructured zones, connectivity is - cleaned (removal of unreferenced vertices, multiply defined elements and faces) + cleaned (removal of unreferenced and duplicated vertices, multiply-defined or totally degenerated faces and elements). If indices=[], the vertex indirection table following mesh cleaning is returned. Exists also as in place version (_close) that modifies a and returns None. @@ -1217,8 +1217,20 @@ Operations on meshes :type a: array or pyTree :param tol: merging points tolerance :type tol: float - :param suppressDegeneratedNGons: enables the removal of degenerated ngons - :type suppressDegeneratedNGons: boolean + :param rmOverlappingPts: whether to remove overlapping points within a radius of tol + :type rmOverlappingPts: boolean + :param rmOrphanPts: whether to remove orphan (unreferenced) points + :type rmOrphanPts: boolean + :param rmDuplicatedFaces: whether to remove duplicated faces + :type rmDuplicatedFaces: boolean + :param rmDuplicatedElts: whether to remove duplicated elements + :type rmDuplicatedElts: boolean + :param rmDegeneratedFaces: whether to remove degenerated faces + :type rmDegeneratedFaces: boolean + :param rmDegeneratedElts: whether to remove degenerated elements + :type rmDegeneratedElts: boolean + :param indices: vertex indirection table following mesh cleaning + :type indices: [array, list of arrays] :return: modified reference copy of t :rtype: array or pyTree