Skip to content

Commit

Permalink
Git merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentcasseau committed Jun 17, 2024
2 parents 6138620 + bf48b72 commit a985c3f
Show file tree
Hide file tree
Showing 38 changed files with 285 additions and 129 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ __pycache__
core.*
setup.cfg
Dist
web/doc/Examples
web/Download
docs/doc/Examples
docs/Download
Cassiopee/KCore/merge.l
Cassiopee/XCore/merge.l
Cassiopee/KCore/buildInfo.py
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/CPlot/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/CPlot"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/CPlot/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Compressor/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/Compressor"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Compressor/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
93 changes: 71 additions & 22 deletions Cassiopee/Connector/Connector/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ def getIBCDName(proposedName):
(ibcname,__IBCNameServer__)=C.getUniqueName(proposedName, __IBCNameServer__)
return ibcname


#====================================================================================
#Add .Solver#Define with dirx,diry, & dirz to the base of the tboneover. tboneover is the
#PyTree that defines the region in space wherein a one over n coarsening will be pursued
#during the automatic cartesian grid generator of FastIBC.
#IN: FileName: name of the file. tboneover is read in this function.
#IN: oneOver: list of list of dirx,diry,dirz for each base in tboneover. E.g. oneOver=[[1,1,2],[1,2,1],[2,1,1]]
# for a tboneover with 3 bases where the 1st base has dirx=1, diry=1, & dirz=2
# 2nd base has dirx=1, diry=2, & dirz=1
# 3rd base has dirx=2, diry=1, & dirz=1
#OUT: Nothing. Rewrite tboneover with the same FileName as that original used
##NOTE # 1: To be run SEQUENTIALLY ONLY. This is ok as we are dealing with a surface geometry which tend to be
## relatively small.
##NOTE # 2: Generation of tboneover is similar to that used for tbox.
def _addOneOverLocally(FileName,oneOver):
count = 0
t_local = C.convertFile2PyTree(FileName)
for b in Internal.getBases(t_local):
Internal._createUniqueChild(b, '.Solver#define', 'UserDefinedData_t')
n = Internal.getNodeFromName1(b, '.Solver#define')
Internal._createUniqueChild(n, 'dirx', 'DataArray_t', value=oneOver[count][0])
Internal._createUniqueChild(n, 'diry', 'DataArray_t', value=oneOver[count][1])
Internal._createUniqueChild(n, 'dirz', 'DataArray_t', value=oneOver[count][2])
count+=1
C.convertPyTree2File(t_local,FileName)
return None

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## MACRO FUNCTIONS
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -103,7 +130,11 @@ def computeMeshInfo__(z, dim):
def _computeMeshInfo(t):
np_total, nc_total, nf_total, nzones = 0,0,0,0
nc0, nc1, nc2 = 0,0,0


NP = Cmpi.size
rank = Cmpi.rank
NPTS = numpy.zeros(NP)
NCELLS = numpy.zeros(NP)
for z in Internal.getZones(t):
cellN = Internal.getNodeFromName(z, 'cellN')[1]
c0 = numpy.count_nonzero(cellN == 0); nc0 += c0
Expand All @@ -115,10 +146,22 @@ def _computeMeshInfo(t):
np_total += np
nc_total += nc
nf_total += nf
nzones += 1

Cmpi.barrier()
print("Info: mesh info for rank {}: number of points: {:.2f}M / number of cells: {:.2f}M".format(Cmpi.rank, np_total/1.e6, nc_total/1.e6))
nzones += 1

zNoGhost = C.rmGhostCells(z, z, 2)
NPTS[rank] += C.getNPts(zNoGhost)
NCELLS[rank] += C.getNCells(zNoGhost)

NPTS = Cmpi.allreduce(NPTS ,op=Cmpi.SUM)
NCELLS = Cmpi.allreduce(NCELLS,op=Cmpi.SUM)
print("Info: mesh info for rank {}: number of points: {:.2f}M / number of cells: {:.2f}M".format(rank, np_total/1.e6, nc_total/1.e6),flush=True)
if rank == 0:
NcellsTot = numpy.sum(NCELLS)
ncells_percent= []
for i in range(NP):
ncells_percent.append(NCELLS[i]/NcellsTot*100)
print('Info: Rank {} has {:.3f}e06 points & {:.3f}e06 cells & {} % of cells - no ghost cells'.format(i,int(NPTS[i])/1e06,int(NCELLS[i])/1e06,round(ncells_percent[i],2)),flush=True)
print('Info: Range of % of cells: {} - {}'.format(round(min(ncells_percent),2),round(max(ncells_percent),2)),flush=True)
Cmpi.barrier()

np_total = Cmpi.allreduce(np_total, op=Cmpi.SUM)
Expand All @@ -130,18 +173,18 @@ def _computeMeshInfo(t):
natures = [ncx/float(nc_total)*100. for ncx in [nc2, nc1, nc0]]

if Cmpi.rank == 0:
print("Info: global mesh info: Interpolated cells (cellN 2): {:.2f}%, Computed cells (cellN 1): {:.2f}%, Blanked cells (cellN 0): {:.2f}%".format(*natures))
print("Info: global mesh info: total number of points: {:.2f}M / total number of cells: {:.2f}M".format(np_total/1.e6, nc_total/1.e6))

print("Info: global mesh info: Interpolated cells (cellN 2): {:.2f}%, Computed cells (cellN 1): {:.2f}%, Blanked cells (cellN 0): {:.2f}%".format(*natures),flush=True)
print("Info: global mesh info: total number of points: {:.2f}M / total number of cells: {:.2f}M".format(np_total/1.e6, nc_total/1.e6),flush=True)
Cmpi.barrier()

return None

def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=None,
snears=0.01, snearsf=None, dfar=10., dfarDir=0, dfarList=[], vmin=21, depth=2, frontType=1, mode=0,
IBCType=1, verbose=True,
check=False, balancing=False, distribute=False, twoFronts=False, cartesian=False,
yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.):
snears=0.01, snearsf=None, dfar=10., dfarDir=0, dfarList=[], vmin=21, depth=2, frontType=1, mode=0,
IBCType=1, verbose=True,
check=False, balancing=False, distribute=False, twoFronts=False, cartesian=False,
yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.,
tbOneOver=None):

import Generator.IBM as G_IBM
import time as python_time
Expand Down Expand Up @@ -180,12 +223,14 @@ def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tin
#===================
# STEP 1 : GENERATE MESH
#===================
listF1save = []
if t_in is None:
if verbose: pt0 = python_time.time(); printTimeAndMemory__('generate Cartesian mesh', time=-1)
test.printMem("Info: prepareIBMDataPara: generate Cartesian mesh [start]")
t = G_IBM.generateIBMMeshPara(tb, vmin=vmin, snears=snears, dimPb=dimPb, dfar=dfar, dfarList=dfarList, tbox=tbox,
snearsf=snearsf, check=check, to=to, ext=depth+1,
expand=expand, dfarDir=dfarDir, check_snear=False, mode=mode)
snearsf=snearsf, check=check, to=to, ext=depth+1,
expand=expand, dfarDir=dfarDir, check_snear=False, mode=mode,
tbOneOver=tbOneOver, listF1save=listF1save)
Internal._rmNodesFromName(tb,"SYM")

if balancing and Cmpi.size > 1: _redispatch__(t=t)
Expand Down Expand Up @@ -213,7 +258,7 @@ def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tin
_blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth,
Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts,
heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42,
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42)
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save)
Cmpi.barrier()
_redispatch__(t=t)
if verbose: printTimeAndMemory__('blank by IBC bodies', time=python_time.time()-pt0)
Expand Down Expand Up @@ -426,7 +471,8 @@ def _dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1.
# OUT: (optional) centers:cellNIBC_2, centers:cellNFront_2 fields for second image points
#=========================================================================
def _blankingIBM__(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1.,
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.):
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.,
listF1save=[]):

snear_min = 10e10
for z in Internal.getZones(tb):
Expand Down Expand Up @@ -470,6 +516,8 @@ def _blankingIBM__(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e
X._setHoleInterpolatedPoints(t,depth=depth,dir=0,loc='centers',cellNName='cellNMin',addGC=False)

for z in Internal.getZones(t):
if z[0] in listF1save: continue

h = abs(C.getValue(z,'CoordinateX',0)-C.getValue(z,'CoordinateX',1))
if yplus > 0.:
height = G_IBM_Height.computeModelisationHeight(Re=Reynolds, yplus=yplus, L=Lref)
Expand Down Expand Up @@ -561,17 +609,18 @@ def findIsoFront(cellNFront, Dist_1, Dist_2):
return None

def blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., twoFronts=False,
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.):
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1., listF1save=[]):
"""Blank the computational tree by IBC bodies for IBM pre-processing."""
tp = Internal.copyRef(t)
_blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth,
Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts,
heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42,
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42)
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save)
return tp

def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., twoFronts=False,
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.):
correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.,
listF1save=[]):
"""Blank the computational tree by IBC bodies for IBM pre-processing."""
if dimPb == 2:
T._addkplane(tb)
Expand All @@ -582,9 +631,9 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6,
C._initVars(t, 'centers:cellN', 1.)

_blankingIBM__(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth,
Reynolds=Reynolds, yplus=yplus, Lref=Lref,
heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42,
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42)
Reynolds=Reynolds, yplus=yplus, Lref=Lref,
heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42,
wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save)

C._initVars(t, '{centers:cellNIBC}={centers:cellN}')

Expand Down
5 changes: 2 additions & 3 deletions Cassiopee/Connector/Connector/OversetData.py
Original file line number Diff line number Diff line change
Expand Up @@ -1726,16 +1726,15 @@ def _adaptForRANSLES__(tR, tD, dictOfModels=None):
model_zr = dictOfModels[zr[0]]

if model_zr != 'None' and model_zd != 'None':
print("Info: _adaptForRANSLES__: {}/{} <-> {}/{}".format(zr[0], model_zr, zd[0], model_zd))

if (model_zr=='NSTurbulent' or model_zd=='NSTurbulent') and model_zr != model_zd:
print("Info: _adaptForRANSLES__: {}/{} <-> {}/{}".format(zr[0], model_zr, zd[0], model_zd))
datap = numpy.ones(1, numpy.int32)
Internal.createUniqueChild(s, 'RANSLES', 'DataArray_t', datap)

if (model_zr=='LBMLaminar' or model_zd=='LBMLaminar') and model_zr != model_zd:
print("Info: _adaptForRANSLES__: {}/{} <-> {}/{}".format(zr[0], model_zr, zd[0], model_zd))
datap = numpy.ones(1, numpy.int32)
Internal.createUniqueChild(s, 'NSLBM', 'DataArray_t', datap)

return None

def _createInterpRegion__(z, zname, pointlist, pointlistdonor, interpCoef, interpType, interpVol, indicesExtrap, indicesOrphan, \
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Connector/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/Connector"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Connector/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Converter/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/Converter"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Converter/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Dist2Walls/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/Dist2Walls"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Dist2Walls/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Distributor2/doc/install
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ elif ([ $# -eq 2 ])
then
PRODUCTION=1
# Destination docs
DEST="$CASSIOPEE/web/doc"
DEST="$CASSIOPEE/docs/doc"
# Destination tests unitaires
DEST2="$DEST/Examples/Distributor2"
# Destination des release notes
DEST3="$CASSIOPEE/web/Download"
DEST3="$CASSIOPEE/docs/Download"
else
echo 'install: install locally'
echo 'install 1 2: install in web/doc.'
echo 'install 1 2: install in docs/doc.'
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Distributor2/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "../../../../web/Images/logo-onera-ident.png"
latex_logo = "../../../../docs/Images/logo-onera-ident.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
Loading

0 comments on commit a985c3f

Please sign in to comment.