Skip to content

Commit

Permalink
Merge pull request #185 from vincentcasseau/main
Browse files Browse the repository at this point in the history
Apps/Connector: fix test cases
  • Loading branch information
vincentcasseau authored Sep 18, 2024
2 parents da77ca4 + 8878c3c commit dae5670
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions Cassiopee/Apps/test/IBMOutletControlPressure_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import Connector.IBM as X_IBM
import os

test.TOLERANCE = 5.e-7
LOCAL = test.getLocal()
FastC.MX_SYNCHRO= 1761

Expand Down
16 changes: 8 additions & 8 deletions Cassiopee/Connector/Connector/OversetDataElsA.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ def _setSeqInterpolations(a, depth=2, double_wall=0, storage='inverse', prefixFi
isperiodic = periodicZones[nozd]
if isperiodic == 2:
print('Periodic interpolation from +theta: %d.'%interpType.shape[0])
interpType = 102*numpy.ones((interpType.shape[0]),numpy.int32)
interpType = 102*numpy.ones((interpType.shape[0]), Internal.E_NpyInt)
elif isperiodic == 3:
print('Periodic interpolation from -theta: %d.'%interpType.shape[0])
interpType = 103*numpy.ones((interpType.shape[0]),numpy.int32)
interpType = 103*numpy.ones((interpType.shape[0]), Internal.E_NpyInt)
resInterp[5][nozd] = interpType
zdonor = Internal.getNodesFromName(a,zdonorname)[0]
# ----------------------------------------
Expand Down Expand Up @@ -411,8 +411,8 @@ def _setSeqInterpolations(a, depth=2, double_wall=0, storage='inverse', prefixFi
else: listEXdir[donorId]=[EXdir]

else: # no interpolation domain found
if depth == 2: indicesOrphan = numpy.array(interpCells[1][3],dtype='int32')
elif depth == 1: indicesOrphan = numpy.array(EXPts[1][3],dtype='int32')
if depth == 2: indicesOrphan = numpy.array(interpCells[1][3], dtype=Internal.E_NpyInt)
elif depth == 1: indicesOrphan = numpy.array(EXPts[1][3], dtype=Internal.E_NpyInt)
# on cree une zone subregion avec les pts orphelins
nameSubRegion='Orphan_'+z[0]
z[2].append([nameSubRegion, None, [],'ZoneSubRegion_t'])
Expand Down Expand Up @@ -451,7 +451,7 @@ def _interpInverseStorage(zname, zdonor, nozd, resInterp, depth):
indRcv = resInterp[0][nozd]; interpCoef=resInterp[3][nozd];
interpVol=resInterp[4][nozd]; interpType=resInterp[5][nozd]
indicesExtrap = resInterp[6][nozd];
if depth == 2: EXdir=numpy.array([],numpy.int32)
if depth == 2: EXdir=numpy.array([], Internal.E_NpyInt)
elif depth == 1: EXdir = resInterp[8][nozd]
cellIndExtrap = indicesExtrap; cellIndOrphan = indicesOrphan
coef=interpCoef; vol=interpVol; interptype=interpType
Expand All @@ -477,7 +477,7 @@ def _interpDirectStorage(z, zdonorname, nozd, resInterp, depth):
indRcv = resInterp[0][nozd]; interpCoef=resInterp[3][nozd]
interpVol=resInterp[4][nozd]; interpType=resInterp[5][nozd]
indicesExtrap = resInterp[6][nozd];
if depth == 2: EXdir=numpy.array([],numpy.int32)
if depth == 2: EXdir=numpy.array([], Internal.E_NpyInt)
elif depth == 1: EXdir = resInterp[8][nozd]
cellIndExtrap = indicesExtrap; cellIndOrphan = indicesOrphan
coef = interpCoef; vol = interpVol; interptype = interpType
Expand Down Expand Up @@ -722,7 +722,7 @@ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended')
v2 = v.split(':',1)[1]
if variables.index(v) == len(variables)-1: vars2=vars2+v2
else: vars2=vars2+v2+','
cellRcvPara = numpy.arange(cellRcv.shape[0],dtype=numpy.int32)
cellRcvPara = numpy.arange(cellRcv.shape[0], dtype=Internal.E_NpyInt)
rcvField = numpy.empty((donorArray[1].shape[0],cellRcv.shape[0]), order='F')
rcvArray = [vars2,rcvField,cellRcv.shape[0],1,1] # tableau monodimensionnel
else: # zone receveuse sur le processeur locale
Expand Down Expand Up @@ -762,7 +762,7 @@ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended')
cellDonorEX = cellDonorListEX[1]
if cellDonorEX.size != 0:
cellRcvEX = Internal.getNodeFromName1(s,'FaceListDonor')[1]
cellRcvEXdummy=numpy.arange(cellRcvEX.shape[0], dtype=numpy.int32)
cellRcvEXdummy=numpy.arange(cellRcvEX.shape[0], dtype=Internal.E_NpyInt)
EXdir = Internal.getNodeFromName1(s,'FaceDirection')[1]
interpDonorEX = idEX[1]
cellVolEX = Internal.getNodeFromName1(s,'FaceInterpolantsVol')[1]
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Connector/test/computeFrictionVelocityPT_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

nb_node = 3

zsize = numpy.empty((1,3), numpy.int32, order='F')
zsize = numpy.empty((1,3), Internal.E_NpyInt, order='F')
zsize[0,0] = nb_node; zsize[0,1] = 0; zsize[0,2] = 0
z = Internal.newZone(name='IBW_Wall',zsize=zsize,ztype='Unstructured')
coord_node = Internal.newGridCoordinates(parent = z)
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Connector/test/extractIBMWallFieldsPT_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Blanking
bodies = [[s]]
BM = numpy.array([[1]],numpy.int32)
BM = numpy.array([[1]],Internal.E_NpyInt)
t = X.blankCells(t,bodies,BM,blankingType='center_in')
X._setHoleInterpolatedPoints(t,depth=-2)
# Dist2Walls
Expand Down
7 changes: 4 additions & 3 deletions Cassiopee/Connector/test/setIBCDataPT_t1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# - setIBCData (pyTree) -
import Converter.PyTree as C
import Converter.Internal as Internal
import Generator.PyTree as G
import Connector.PyTree as X
import Post.PyTree as P
Expand All @@ -16,7 +17,7 @@

# Blanking
bodies = [[s]]
BM = N.array([[1]], N.int32)
BM = N.array([[1]], Internal.E_NpyInt)
t = X.blankCells(t, bodies, BM, blankingType='center_in')
t = X.setHoleInterpolatedPoints(t, depth=-1)
# Dist2Walls
Expand All @@ -33,7 +34,7 @@
t = C.newPyTree(['Base', a])
# Blanking
bodies = [[s]]
BM = N.array([[1]],N.int32)
BM = N.array([[1]], Internal.E_NpyInt)
t = X.blankCells(t,bodies,BM,blankingType='node_in')
t = X.setHoleInterpolatedPoints(t,depth=-1)
# Dist2Walls
Expand All @@ -51,7 +52,7 @@

# Blanking
bodies = [[s]]
BM = N.array([[1]],N.int32)
BM = N.array([[1]], Internal.E_NpyInt)
t = X.blankCells(t,bodies,BM,blankingType='center_in')
t = X.setHoleInterpolatedPoints(t,depth=-1)
t = X.setHoleInterpolatedPoints(t,depth= 2)
Expand Down

0 comments on commit dae5670

Please sign in to comment.