Skip to content

Commit

Permalink
CPlot: update display180
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Jul 2, 2024
1 parent bc8e70c commit e737697
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
33 changes: 23 additions & 10 deletions Cassiopee/CPlot/CPlot/PyTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,23 +1199,36 @@ def display360(t, type360=0, **kwargs):
a2 = Internal.getZones(a2)[0]
a1[0] = "right"; a2[0] = "left"
locRez = exportRez.split('x')
ni = int(locRez[0]); nj = int(locRez[1])
a = G.cart((0,0,0), (1,1,1), (ni,2*nj,1))
C._addVars(a, ['r','g','b','a'])
for v in ['r','g','b','a']:
pr = Internal.getNodeFromName2(a, v)[1]
pr1 = Internal.getNodeFromName2(a1, v)[1]
pr2 = Internal.getNodeFromName2(a2, v)[1]
pr[0:ni,0:nj] = pr1[0:ni,0:nj]
pr[0:ni,nj:2*nj] = pr2[0:ni,0:nj]
if type360 == 0: # 360
ni = int(locRez[0]); nj = int(locRez[1])
a = G.cart((0,0,0), (1,1,1), (ni,2*nj,1))
C._addVars(a, ['r','g','b','a'])
for v in ['r','g','b','a']:
pr = Internal.getNodeFromName2(a, v)[1]
pr1 = Internal.getNodeFromName2(a1, v)[1]
pr2 = Internal.getNodeFromName2(a2, v)[1]
pr[0:ni,0:nj] = pr1[0:ni,0:nj]
pr[0:ni,nj:2*nj] = pr2[0:ni,0:nj]
else: # 180
ni = int(locRez[1]); nj = int(locRez[1])
a = G.cart((0,0,0), (1,1,1), (2*ni,nj,1))
C._addVars(a, ['r','g','b','a'])
for v in ['r','g','b','a']:
pr = Internal.getNodeFromName2(a, v)[1]
pr1 = Internal.getNodeFromName2(a1, v)[1]
pr2 = Internal.getNodeFromName2(a2, v)[1]
pr[0:ni,0:nj] = pr1[0:ni,0:nj]
pr[ni:2*ni,0:nj] = pr2[0:ni,0:nj]

C.convertPyTree2File(a, export) # finale
Cmpi.barrier() # wait for completion
return None

# type360=0 -> 360, mode=1 -> 180
def panorama(export, exportResolution, type360=0):
res = exportResolution.split('x')
resx = int(res[0]); resy = int(res[1])
if type360 == 0: resx = int(res[0]); resy = int(res[1])
else: resx = int(res[1]); resy = int(res[1])
import Generator.PyTree as G
import CPlot.cplot
a1 = C.convertFile2PyTree('cube_left.png')
Expand Down
1 change: 1 addition & 0 deletions Cassiopee/CPlot/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
#'sphinx.ext.githubpages'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Connector/test/IBMrectilinear_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
##ADD DIRECTION OF ONE OVER IN TB RECTILINEAR REGION
FileNameOneOver = LOCAL+'/tbOneOver.cgns'
listOneOver = [[2,1,1]]
X_IBM._addOneOverLocally(FileNameOneOver,listOneOver)
X_IBM._addOneOverLocally(FileNameOneOver, listOneOver)
tbOneOver = C.convertFile2PyTree(FileNameOneOver)

##IBM PREP
Expand All @@ -62,8 +62,8 @@
os.remove(FileNameOneOver)

##NON-REGRESSION CHECK
test.testT(t,1)
test.testT(tc,2)
test.testT(t, 1)
test.testT(tc, 2)

#C.convertPyTree2File(t ,LOCAL+'/t_check.cgns')
#C.convertPyTree2File(tc,LOCAL+'/tc_check.cgns')
Expand Down
4 changes: 2 additions & 2 deletions Cassiopee/Envs/sh_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ elif [ "$MAC" = "spiro_pgi" ]; then
module load nvhpc/22.2-gnu831-full
module load subversion/1.14.1-gnu831

else if ($MAC == "spiro_gpu") then
elif [ "$MAC" = "spiro_gpu" ]; then
#----------------------------- juno gpu ------------------------------------
export ELSAPROD=spiro_gpu
export ELSAPROD="$ELSAPROD$INTTYPE"
Expand Down Expand Up @@ -567,7 +567,7 @@ elif [ "$MAC" = "juno_gcc" ]; then
unset $(env | grep SLURM | cut -d'=' -f 1)
unset OMP_PLACES

else if ($MAC == "juno_gpu") then
elif [ "$MAC" = "juno_gpu" ]; then
#----------------------------- juno gpu ------------------------------------
export ELSAPROD=juno_gpu
export ELSAPROD="$ELSAPROD$INTTYPE"
Expand Down

0 comments on commit e737697

Please sign in to comment.