From db287b50778f60aa4669a8720cea0c22afd7d047 Mon Sep 17 00:00:00 2001 From: antjost Date: Mon, 17 Jun 2024 13:06:56 +0200 Subject: [PATCH 1/7] [IBM] Add rectilinear mesh capabilities to Connector/IBM.py IBM prep approach. Copy functionality from Apps/IBM.py. --- Cassiopee/Connector/Connector/IBM.py | 58 ++++++++++++++++++++++------ Cassiopee/Generator/Generator/IBM.py | 43 ++++++++++++++++++++- 2 files changed, 87 insertions(+), 14 deletions(-) diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index 6dbcf1645..d57cbf8aa 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -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 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -138,10 +165,11 @@ def _computeMeshInfo(t): 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 @@ -180,12 +208,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) @@ -213,7 +243,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) @@ -426,7 +456,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): @@ -470,6 +501,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) @@ -561,17 +594,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) @@ -584,7 +618,7 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, _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) + wallAdaptF42=wallAdaptF42, blankingF42=blankingF42,listF1save=listF1save) C._initVars(t, '{centers:cellNIBC}={centers:cellN}') diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index 3d8c5dafb..e98dcbbb3 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -363,7 +363,9 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[], tbox=None, snearsf=None, check=True, to=None, ext=2, - expand=3, dfarDir=0, check_snear=False, mode=0): + expand=3, dfarDir=0, check_snear=False, mode=0, + tbOneOver=None, listF1save = []): + import KCore.test as test # list of dfars if dfarList == []: zones = Internal.getZones(tb) @@ -455,7 +457,7 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] del o # fill vmin + merge in parallel - res = octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=1000000) + res = octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=1000000,tbOneOver=tbOneOver) del p if parento is not None: for po in parento: del po @@ -466,6 +468,14 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] C._addState(t, 'EquationDimension', dimPb) + ##Keep F1 regions - for F1 & F42 synergy + if tbOneOver: + tbF1 = Internal.getNodesFromNameAndType(tbOneOver, '*KeepF1*', 'CGNSBase_t') + tbbBTmp = G.BB(tbF1) + interDict_scale = X.getIntersectingDomains(tbbBTmp, t) + for kk in interDict_scale: + for kkk in interDict_scale[kk]: listF1save.append(kkk) + # Add xzones for ext tbb = Cmpi.createBBoxTree(t) interDict = X.getIntersectingDomains(tbb) @@ -473,6 +483,35 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] del tbb Cmpi._addXZones(t, graph, variables=[], cartesian=True) + #Turn Cartesian grid into a rectilinear grid + test.printMem(">>> cart grids --> rectilinear grids [start]") + listDone = [] + if tbOneOver: + tbb = G.BB(t) + if dimPb==2: + T._addkplane(tbb) + T._contract(tbb, (0,0,0), (1,0,0), (0,1,0), 0.01) + + ##RECTILINEAR REGION + ##Select regions that need to be coarsened + tbbB = G.BB(tbOneOver) + interDict_scale = X.getIntersectingDomains(tbbB, tbb) + ##Avoid a zone to be coarsened twice + for i in interDict_scale: + (b,btmp) = Internal.getParentOfNode(tbOneOver,Internal.getNodeByName(tbOneOver,i)) + checkOneOver = Internal.getNodeByName(b,".Solver#define") ##Needed for F1 & F42 approach + if checkOneOver: + b = Internal.getNodeByName(b,".Solver#define") + oneoverX = int(Internal.getNodeByName(b, 'dirx')[1]) + oneoverY = int(Internal.getNodeByName(b, 'diry')[1]) + oneoverZ = int(Internal.getNodeByName(b, 'dirz')[1]) + for z in interDict_scale[i]: + if z not in listDone: + zLocal = Internal.getNodeFromName(t,z) + T._oneovern(zLocal, (oneoverX,oneoverY,oneoverZ)); + listDone.append(z) + test.printMem(">>> cart grids --> rectilinear grids [end]") + zones = Internal.getZones(t) coords = C.getFields(Internal.__GridCoordinates__, zones, api=2) if symmetry==0: extBnd = 0 From 322dc0d9d6beb94b7dc3ee5f61164366bb2526e6 Mon Sep 17 00:00:00 2001 From: antjost Date: Mon, 17 Jun 2024 13:55:37 +0200 Subject: [PATCH 2/7] [IBM] Add more info of the output of the IBM mesh & project size for extrude. --- Cassiopee/Connector/Connector/IBM.py | 31 ++++++++++++++------ Cassiopee/Generator/Generator/IBM.py | 42 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index d57cbf8aa..4ac7edd59 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -130,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 @@ -142,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) @@ -157,9 +173,8 @@ 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 diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index e98dcbbb3..6f8d6b0f3 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -1089,3 +1089,45 @@ def buildParentOctrees__(o, tb, snears=None, snearFactor=4., dfar=10., dfarList= return OCTREEPARENTS + +def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): + """Predicts the final size of the mesh when extruding 2D to 3D in the z-direction. + 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) + if isinstance(t, str): + h = Filter.Handle(t) + t = h.loadFromProc(loadVariables=False) + h._loadVariables(t, var=['CoordinateX']) + + + for z in Internal.getZones(t): + name_zone = z[0] + if not isCartesianExtrude: + if dictNz is not None: Nk = int(dictNz[name_zone]) + else: Nk = NPas-1 + else: + h = abs(C.getValue(z,'CoordinateX',0)-C.getValue(z,'CoordinateX',1)) + NPas_local = int(round(span/h)/4) + if NPas_local < 2: + print("WARNING:: MPI rank %d || Zone %s has Nz=%d and is being clipped to Nz=2"%(rank,z[0],NPas_local)) + NPas_local = 2 + Nk = NPas_local + Nk += 1 + NPTS[rank] += C.getNPts(z)/2*(Nk+4) + NCELLS[rank] += C.getNCells(z)*(Nk+3) + NPTS_noghost[rank] += C.getNPts(C.rmGhostCells(z, z, 2))*Nk + NCELLS_noghost[rank] += C.getNCells(C.rmGhostCells(z, z, 2))*(Nk-1) + NPTS = Cmpi.allreduce(NPTS ,op=Cmpi.SUM) + NCELLS = Cmpi.allreduce(NCELLS,op=Cmpi.SUM) + NPTS_noghost = Cmpi.allreduce(NPTS_noghost ,op=Cmpi.SUM) + NCELLS_noghost = Cmpi.allreduce(NCELLS_noghost,op=Cmpi.SUM) + if rank ==0: + print('Projected mesh size with ghost: {} million points & {} million cells'.format(numpy.sum(NPTS)/1.e6,numpy.sum(NCELLS)/1.e6)) + print('Projected mesh size without ghost: {} million points & {} million cells'.format(numpy.sum(NPTS_noghost)/1.e6,numpy.sum(NCELLS_noghost)/1.e6)) + return None + From e12e2db885aba0598acd7c2f641271cead2676ca Mon Sep 17 00:00:00 2001 From: antjost <124277807+antjost@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:01:55 +0200 Subject: [PATCH 3/7] Update IBM.py add space after commas --- Cassiopee/Connector/Connector/IBM.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index 4ac7edd59..9147a279c 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -183,7 +183,7 @@ def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tin 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., + yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1., tbOneOver=None): import Generator.IBM as G_IBM @@ -230,7 +230,7 @@ def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tin 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, - tbOneOver=tbOneOver,listF1save = listF1save) + tbOneOver=tbOneOver, listF1save = listF1save) Internal._rmNodesFromName(tb,"SYM") if balancing and Cmpi.size > 1: _redispatch__(t=t) @@ -258,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,listF1save = listF1save) + wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save = listF1save) Cmpi.barrier() _redispatch__(t=t) if verbose: printTimeAndMemory__('blank by IBC bodies', time=python_time.time()-pt0) @@ -609,13 +609,13 @@ 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.,listF1save=[]): + 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,listF1save=listF1save) + 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, @@ -633,7 +633,7 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, _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,listF1save=listF1save) + wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save) C._initVars(t, '{centers:cellNIBC}={centers:cellN}') From c86309a266330da4e3e357196bde9dffb6a0c9f9 Mon Sep 17 00:00:00 2001 From: antjost <124277807+antjost@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:09:43 +0200 Subject: [PATCH 4/7] Update IBM.py add space between comma & argument. --- Cassiopee/Generator/Generator/IBM.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index 6f8d6b0f3..42f71019b 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -457,7 +457,7 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] del o # fill vmin + merge in parallel - res = octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=1000000,tbOneOver=tbOneOver) + res = octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=1000000, tbOneOver=tbOneOver) del p if parento is not None: for po in parento: del po @@ -797,7 +797,7 @@ def addRefinementZones(o, tb, tbox, snearsf, vmin, dim): return Internal.getNodeFromType2(to, 'Zone_t') # only in generateIBMMeshPara and generateCartMesh__ -def octree2StructLoc__(o, parento=None, vmin=21, ext=0, optimized=0, sizeMax=4e6,tbOneOver=None): +def octree2StructLoc__(o, parento=None, vmin=21, ext=0, optimized=0, sizeMax=4e6, tbOneOver=None): sizeMax=int(sizeMax) dim = Internal.getZoneDim(o) if dim[3] == 'QUAD': dimPb = 2 @@ -954,7 +954,7 @@ def octree2StructLoc__(o, parento=None, vmin=21, ext=0, optimized=0, sizeMax=4e6 for i in range(NBases): ZONEStbOneOverTmp[i] = T.mergeCart(ZONEStbOneOverTmp[i][0]+ZONEStbOneOverTmp[i][1]+ZONEStbOneOverTmp[i][2]+ \ ZONEStbOneOverTmp[i][3]+ZONEStbOneOverTmp[i][4]+ZONEStbOneOverTmp[i][5]+ \ - ZONEStbOneOverTmp[i][6]+ZONEStbOneOverTmp[i][7],sizeMax=sizeMax) + ZONEStbOneOverTmp[i][6]+ZONEStbOneOverTmp[i][7], sizeMax=sizeMax) zones +=ZONEStbOneOverTmp[i] del ZONEStbOneOver del ZONEStbOneOverTmp @@ -970,7 +970,7 @@ def octree2StructLoc__(o, parento=None, vmin=21, ext=0, optimized=0, sizeMax=4e6 if ZONEStbOneOver is not None: for i in range(NBases): ZONEStbOneOverTmp[i] = T.mergeCart(ZONEStbOneOverTmp[i][0]+ZONEStbOneOverTmp[i][1]+ \ - ZONEStbOneOverTmp[i][2]+ZONEStbOneOverTmp[i][3],sizeMax=sizeMax) + ZONEStbOneOverTmp[i][2]+ZONEStbOneOverTmp[i][3], sizeMax=sizeMax) zones +=ZONEStbOneOverTmp[i] del ZONEStbOneOver del ZONEStbOneOverTmp From 0bdf16fe4951dead45a6bc97da65f74d2b91a513 Mon Sep 17 00:00:00 2001 From: benoit128 Date: Mon, 17 Jun 2024 15:03:15 +0200 Subject: [PATCH 5/7] All: update install and conf.py for docs --- .gitignore | 4 ++-- Cassiopee/CPlot/doc/install | 6 +++--- Cassiopee/CPlot/doc/source/conf.py | 2 +- Cassiopee/Compressor/doc/install | 6 +++--- Cassiopee/Compressor/doc/source/conf.py | 2 +- Cassiopee/Connector/doc/install | 6 +++--- Cassiopee/Connector/doc/source/conf.py | 2 +- Cassiopee/Converter/doc/install | 6 +++--- Cassiopee/Converter/doc/source/conf.py | 2 +- Cassiopee/Dist2Walls/doc/install | 6 +++--- Cassiopee/Dist2Walls/doc/source/conf.py | 2 +- Cassiopee/Distributor2/doc/install | 6 +++--- Cassiopee/Distributor2/doc/source/conf.py | 2 +- Cassiopee/Generator/doc/install | 6 +++--- Cassiopee/Generator/doc/source/conf.py | 2 +- Cassiopee/Geom/doc/install | 8 ++++---- Cassiopee/Geom/doc/source/conf.py | 2 +- Cassiopee/Initiator/doc/install | 6 +++--- Cassiopee/Initiator/doc/source/conf.py | 2 +- Cassiopee/Intersector/doc/install | 6 +++--- Cassiopee/Intersector/doc/source/conf.py | 2 +- Cassiopee/KCore/doc/install | 6 +++--- Cassiopee/KCore/doc/source/conf.py | 2 +- Cassiopee/Modeler/doc/install | 6 +++--- Cassiopee/Modeler/doc/source/conf.py | 2 +- Cassiopee/OCC/doc/install | 6 +++--- Cassiopee/OCC/doc/source/conf.py | 2 +- Cassiopee/Post/doc/install | 6 +++--- Cassiopee/Post/doc/source/conf.py | 2 +- Cassiopee/RigidMotion/doc/install | 6 +++--- Cassiopee/RigidMotion/doc/source/conf.py | 2 +- Cassiopee/Transform/doc/install | 6 +++--- Cassiopee/Transform/doc/source/conf.py | 2 +- Cassiopee/XCore/doc/install | 23 +++++++---------------- 34 files changed, 74 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 2b9fe9076..d523fba4e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Cassiopee/CPlot/doc/install b/Cassiopee/CPlot/doc/install index 656bf8ab1..3f79024fb 100755 --- a/Cassiopee/CPlot/doc/install +++ b/Cassiopee/CPlot/doc/install @@ -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 diff --git a/Cassiopee/CPlot/doc/source/conf.py b/Cassiopee/CPlot/doc/source/conf.py index ccd502612..280628465 100644 --- a/Cassiopee/CPlot/doc/source/conf.py +++ b/Cassiopee/CPlot/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Compressor/doc/install b/Cassiopee/Compressor/doc/install index 3d08e91fa..9e9be8a39 100755 --- a/Cassiopee/Compressor/doc/install +++ b/Cassiopee/Compressor/doc/install @@ -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 diff --git a/Cassiopee/Compressor/doc/source/conf.py b/Cassiopee/Compressor/doc/source/conf.py index 176a3106c..de50b5058 100644 --- a/Cassiopee/Compressor/doc/source/conf.py +++ b/Cassiopee/Compressor/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Connector/doc/install b/Cassiopee/Connector/doc/install index f6f6bea7e..34140cf2a 100755 --- a/Cassiopee/Connector/doc/install +++ b/Cassiopee/Connector/doc/install @@ -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 diff --git a/Cassiopee/Connector/doc/source/conf.py b/Cassiopee/Connector/doc/source/conf.py index 2d23091ee..e144df711 100644 --- a/Cassiopee/Connector/doc/source/conf.py +++ b/Cassiopee/Connector/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Converter/doc/install b/Cassiopee/Converter/doc/install index c56f26ef3..fdfc1aec5 100755 --- a/Cassiopee/Converter/doc/install +++ b/Cassiopee/Converter/doc/install @@ -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 diff --git a/Cassiopee/Converter/doc/source/conf.py b/Cassiopee/Converter/doc/source/conf.py index a5e722fa4..3fa9b8f18 100644 --- a/Cassiopee/Converter/doc/source/conf.py +++ b/Cassiopee/Converter/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Dist2Walls/doc/install b/Cassiopee/Dist2Walls/doc/install index 0bf79da15..d490bcf7e 100755 --- a/Cassiopee/Dist2Walls/doc/install +++ b/Cassiopee/Dist2Walls/doc/install @@ -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 diff --git a/Cassiopee/Dist2Walls/doc/source/conf.py b/Cassiopee/Dist2Walls/doc/source/conf.py index 0d1989b52..55b470773 100644 --- a/Cassiopee/Dist2Walls/doc/source/conf.py +++ b/Cassiopee/Dist2Walls/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Distributor2/doc/install b/Cassiopee/Distributor2/doc/install index 602f9c62b..ca0a346a6 100644 --- a/Cassiopee/Distributor2/doc/install +++ b/Cassiopee/Distributor2/doc/install @@ -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 diff --git a/Cassiopee/Distributor2/doc/source/conf.py b/Cassiopee/Distributor2/doc/source/conf.py index eb3fe814f..87a8e5c8b 100644 --- a/Cassiopee/Distributor2/doc/source/conf.py +++ b/Cassiopee/Distributor2/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Generator/doc/install b/Cassiopee/Generator/doc/install index 70e313e40..1b44698a1 100755 --- a/Cassiopee/Generator/doc/install +++ b/Cassiopee/Generator/doc/install @@ -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/Generator" # 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 diff --git a/Cassiopee/Generator/doc/source/conf.py b/Cassiopee/Generator/doc/source/conf.py index b9ddd57cb..1d2dc56b8 100644 --- a/Cassiopee/Generator/doc/source/conf.py +++ b/Cassiopee/Generator/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Geom/doc/install b/Cassiopee/Geom/doc/install index 32f06132d..d17a3b681 100755 --- a/Cassiopee/Geom/doc/install +++ b/Cassiopee/Geom/doc/install @@ -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/Geom" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else - echo 'install: install in $CASSIOPEE/Dist/doc' - echo 'install : install in directory .' + echo 'install: install locally' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/Geom/doc/source/conf.py b/Cassiopee/Geom/doc/source/conf.py index dab202c5c..eb5eb059d 100644 --- a/Cassiopee/Geom/doc/source/conf.py +++ b/Cassiopee/Geom/doc/source/conf.py @@ -229,7 +229,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. diff --git a/Cassiopee/Initiator/doc/install b/Cassiopee/Initiator/doc/install index e01b073c5..827eb3307 100755 --- a/Cassiopee/Initiator/doc/install +++ b/Cassiopee/Initiator/doc/install @@ -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/Initiator" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/Initiator/doc/source/conf.py b/Cassiopee/Initiator/doc/source/conf.py index 6fac7eeae..0e0422501 100644 --- a/Cassiopee/Initiator/doc/source/conf.py +++ b/Cassiopee/Initiator/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Intersector/doc/install b/Cassiopee/Intersector/doc/install index e223c0e39..409af63ec 100755 --- a/Cassiopee/Intersector/doc/install +++ b/Cassiopee/Intersector/doc/install @@ -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/Intersector" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/Intersector/doc/source/conf.py b/Cassiopee/Intersector/doc/source/conf.py index 883a9c11e..db731c5f9 100644 --- a/Cassiopee/Intersector/doc/source/conf.py +++ b/Cassiopee/Intersector/doc/source/conf.py @@ -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. diff --git a/Cassiopee/KCore/doc/install b/Cassiopee/KCore/doc/install index 055a5c8f7..6bd030701 100755 --- a/Cassiopee/KCore/doc/install +++ b/Cassiopee/KCore/doc/install @@ -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/Cassiopee" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/KCore/doc/source/conf.py b/Cassiopee/KCore/doc/source/conf.py index 4ac3fd2a9..8e91adbb2 100644 --- a/Cassiopee/KCore/doc/source/conf.py +++ b/Cassiopee/KCore/doc/source/conf.py @@ -218,7 +218,7 @@ # The name of an image file (relative to this directory) to place at the top of # the title page. -latex_logo = "../../../../../UserGuides/logo-onera-ident.png" +latex_logo = "../../../../../docs/logo-onera-ident.png" # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. diff --git a/Cassiopee/Modeler/doc/install b/Cassiopee/Modeler/doc/install index ded446115..f5accf604 100755 --- a/Cassiopee/Modeler/doc/install +++ b/Cassiopee/Modeler/doc/install @@ -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/Modeler" # 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 diff --git a/Cassiopee/Modeler/doc/source/conf.py b/Cassiopee/Modeler/doc/source/conf.py index 620ead74d..5aab6c28b 100644 --- a/Cassiopee/Modeler/doc/source/conf.py +++ b/Cassiopee/Modeler/doc/source/conf.py @@ -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. diff --git a/Cassiopee/OCC/doc/install b/Cassiopee/OCC/doc/install index f9399a0a6..9c931dc7b 100755 --- a/Cassiopee/OCC/doc/install +++ b/Cassiopee/OCC/doc/install @@ -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/OCC" # 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 diff --git a/Cassiopee/OCC/doc/source/conf.py b/Cassiopee/OCC/doc/source/conf.py index 2746952d4..faa7a92bb 100644 --- a/Cassiopee/OCC/doc/source/conf.py +++ b/Cassiopee/OCC/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Post/doc/install b/Cassiopee/Post/doc/install index d1d69e02b..1f3514bc0 100755 --- a/Cassiopee/Post/doc/install +++ b/Cassiopee/Post/doc/install @@ -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/Post" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/Post/doc/source/conf.py b/Cassiopee/Post/doc/source/conf.py index 9ef3ed15c..da7a5b918 100644 --- a/Cassiopee/Post/doc/source/conf.py +++ b/Cassiopee/Post/doc/source/conf.py @@ -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. diff --git a/Cassiopee/RigidMotion/doc/install b/Cassiopee/RigidMotion/doc/install index 0bdec8ad8..d37974136 100755 --- a/Cassiopee/RigidMotion/doc/install +++ b/Cassiopee/RigidMotion/doc/install @@ -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/RigidMotion" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/RigidMotion/doc/source/conf.py b/Cassiopee/RigidMotion/doc/source/conf.py index 459e60b1a..3b1231ebb 100644 --- a/Cassiopee/RigidMotion/doc/source/conf.py +++ b/Cassiopee/RigidMotion/doc/source/conf.py @@ -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. diff --git a/Cassiopee/Transform/doc/install b/Cassiopee/Transform/doc/install index 062db78c5..d97d2a64a 100755 --- a/Cassiopee/Transform/doc/install +++ b/Cassiopee/Transform/doc/install @@ -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/Transform" # Destination des release notes - DEST3="$CASSIOPEE/web/Download" + DEST3="$CASSIOPEE/docs/Download" else echo 'install: install locally' - echo 'install : install in web/doc.' + echo 'install : install in docs/doc.' exit fi diff --git a/Cassiopee/Transform/doc/source/conf.py b/Cassiopee/Transform/doc/source/conf.py index 593fac535..26f7b35fa 100644 --- a/Cassiopee/Transform/doc/source/conf.py +++ b/Cassiopee/Transform/doc/source/conf.py @@ -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. diff --git a/Cassiopee/XCore/doc/install b/Cassiopee/XCore/doc/install index ffb69f281..543056a39 100755 --- a/Cassiopee/XCore/doc/install +++ b/Cassiopee/XCore/doc/install @@ -8,32 +8,23 @@ then fi PRODUCTION=0 # Destination docs - DEST="$CASSIOPEE/Dist/doc" + DEST="./doc" # Destination tests unitaires - DEST2="$DEST/Examples/Cassiopee" - # Destination des release notes - DEST3="$DEST" -elif ([ $# -eq 1 ]) -then - PRODUCTION=0 - # Destination docs - DEST="$1/doc" - # Destination tests unitaires - DEST2="$DEST/Examples/Cassiopee" + DEST2="$DEST/Examples/XCore" # Destination des release notes DEST3="$DEST" elif ([ $# -eq 2 ]) then PRODUCTION=1 # Destination docs - DEST="$CASSIOPEE/WWW/cassiopee-web" + DEST="$CASSIOPEE/docs/doc" # Destination tests unitaires - DEST2="$DEST/Examples/Cassiopee" + DEST2="$DEST/Examples/XCore" # Destination des release notes - DEST3="$CASSIOPEE/WWW/Main/Download" + DEST3="$CASSIOPEE/docs/Download" else - echo 'install: install in $CASSIOPEE/Dist/doc' - echo 'install : install in directory .' + echo 'install: install locally' + echo 'install 1 2: install in docs/doc.' exit fi From fdeb0363aec7616cc91b8d3916f1470c92d65c25 Mon Sep 17 00:00:00 2001 From: benoit128 Date: Mon, 17 Jun 2024 15:35:29 +0200 Subject: [PATCH 6/7] Generator: change mapedge behaviour if extrema are not set --- Cassiopee/Connector/Connector/IBM.py | 10 ++--- Cassiopee/Generator/Generator/IBM.py | 14 +++--- Cassiopee/Geom/Geom/MapEdge.py | 66 +++++++++++++++++++++------- 3 files changed, 63 insertions(+), 27 deletions(-) diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index 9147a279c..1c14e172b 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -155,7 +155,7 @@ def _computeMeshInfo(t): 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: + if rank == 0: NcellsTot = numpy.sum(NCELLS) ncells_percent= [] for i in range(NP): @@ -230,7 +230,7 @@ def prepareIBMDataPara(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tin 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, - tbOneOver=tbOneOver, listF1save = listF1save) + tbOneOver=tbOneOver, listF1save=listF1save) Internal._rmNodesFromName(tb,"SYM") if balancing and Cmpi.size > 1: _redispatch__(t=t) @@ -258,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, listF1save = listF1save) + wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save) Cmpi.barrier() _redispatch__(t=t) if verbose: printTimeAndMemory__('blank by IBC bodies', time=python_time.time()-pt0) @@ -631,8 +631,8 @@ 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, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, listF1save=listF1save) C._initVars(t, '{centers:cellNIBC}={centers:cellN}') diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index 42f71019b..c47497bbf 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -364,7 +364,7 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[], tbox=None, snearsf=None, check=True, to=None, ext=2, expand=3, dfarDir=0, check_snear=False, mode=0, - tbOneOver=None, listF1save = []): + tbOneOver=None, listF1save=[]): import KCore.test as test # list of dfars if dfarList == []: @@ -468,7 +468,7 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] C._addState(t, 'EquationDimension', dimPb) - ##Keep F1 regions - for F1 & F42 synergy + # Keep F1 regions - for F1 & F42 synergy if tbOneOver: tbF1 = Internal.getNodesFromNameAndType(tbOneOver, '*KeepF1*', 'CGNSBase_t') tbbBTmp = G.BB(tbF1) @@ -483,7 +483,7 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] del tbb Cmpi._addXZones(t, graph, variables=[], cartesian=True) - #Turn Cartesian grid into a rectilinear grid + # Turn Cartesian grid into a rectilinear grid test.printMem(">>> cart grids --> rectilinear grids [start]") listDone = [] if tbOneOver: @@ -492,11 +492,11 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] T._addkplane(tbb) T._contract(tbb, (0,0,0), (1,0,0), (0,1,0), 0.01) - ##RECTILINEAR REGION - ##Select regions that need to be coarsened + ## RECTILINEAR REGION + ## Select regions that need to be coarsened tbbB = G.BB(tbOneOver) interDict_scale = X.getIntersectingDomains(tbbB, tbb) - ##Avoid a zone to be coarsened twice + ## Avoid a zone to be coarsened twice for i in interDict_scale: (b,btmp) = Internal.getParentOfNode(tbOneOver,Internal.getNodeByName(tbOneOver,i)) checkOneOver = Internal.getNodeByName(b,".Solver#define") ##Needed for F1 & F42 approach @@ -523,7 +523,7 @@ def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[] Cmpi._rmXZones(t) coords = None; zones = None - if symmetry==0: + if symmetry == 0: _addBCOverlaps(t, bbox=bb) _addExternalBCs(t, bbox=bb, dimPb=dimPb) else: diff --git a/Cassiopee/Geom/Geom/MapEdge.py b/Cassiopee/Geom/Geom/MapEdge.py index 37cad4fbb..753c406f3 100644 --- a/Cassiopee/Geom/Geom/MapEdge.py +++ b/Cassiopee/Geom/Geom/MapEdge.py @@ -304,29 +304,64 @@ def enforceh__(a, N, h): href = h N = D.getLength(a)/(factorMoy*href)+1 N = int(T.kround(N)) + hl[:] = hl[:]*href else: href = D.getLength(a)/((N-1.)*factorMoy) - hl[:] = hl[:]*href + hl[:] = hl[:]*href else: hl = a[1][pos] npts = hl.size # Calcul h1s, h2s, i1s, i2s h1s=[]; h2s=[]; Ps=[]; i1s=[]; i2s=[] h1 = -1; h2 = -1; i1 = -1; i2 = -1 + + # compute h + vol = G.getVolumeMap(a) + vol = C.center2Node(vol) + vol = vol[1].ravel('k') + + # introduce delta h step (input:delta) + #firstH = -1 + #for i in range(0, npts): + # hi = hl[i] + # if hi > 1.e-12: firstH = i; break + #lastH = -1 + #for i in range(npts-1, -1, -1): + # hi = hl[i] + # if hi > 1.e-12: lastH = i; break + #a1 = None; a2 = None + #if firstH > delta and lastH < npts-delta: + # a1 = T.subzone(a, (1,1,1), (firstH-delta,-1,-1)) + # a2 = T.subzone(a, (lastH+delta,1,1), (-1,-1,-1)) + # a = T.subzone(a, (firstH-delta,1,1), (lastH+delta,-1,-1)) + #elif firstH > delta: + # a1 = T.subzone(a, (1,1,1), (firstH-delta,-1,-1)) + # a = T.subzone(a, (firstH-delta,1,1), (-1,-1,-1)) + #elif lastH < npts-delta: + # a = T.subzone(a, (firstH-delta,1,1), (-1,-1,-1)) + # a2 = T.subzone(a, (lastH+delta,1,1), (-1,-1,-1)) + for i in range(npts): hi = hl[i] - if hi == 0. and i == npts-1: hi = h1 + if i == 0: # set first h1 + i1 = 0; h1 = hi + if hi == 0.: h1 = vol[0] + continue + if hi == 0. and i == npts-1: + hi = h1 # extrapolation + hi = vol[npts-1] + if hi > 1.e-12: - if i == 0: i1 = 0; h1 = hi - if i > 0: - if i1 == -1: i1 = 0; i2 = i; h1 = hi; h2 = hi - if h1 > 0: i2 = i; h2 = hi - sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) - Li = D.getLength(sub) - Pi = Li*1./(0.5*(h1+h2)+1.e-12) - i1s.append(i1); i2s.append(i2) - h1s.append(h1/Li); h2s.append(h2/Li) - Ps.append(Pi) - i1 = i2; h1 = h2 + #if i1 == -1: i1 = 0; i2 = i; h1 = hi; h2 = hi # propagate hi from inside if not set on borders + # keep border h if not set + i2 = i; h2 = hi + sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) + Li = D.getLength(sub) + Pi = Li*1./(0.5*(h1+h2)+1.e-12) + i1s.append(i1); i2s.append(i2) + h1s.append(h1/Li); h2s.append(h2/Li) + Ps.append(Pi) + i1 = i2; h1 = h2 + Pt = 0. for x in range(len(h1s)): Pi = Ps[x] @@ -344,10 +379,11 @@ def enforceh__(a, N, h): sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) d = buildDistrib(h1, h2, Ps[x]) c = G.map(sub, d) - if h < -0.5: - setH(c, 0, sub[1][pos,0]); setH(c, -1, sub[1][pos,-1]) + #if h < -0.5: # pourquoi? + # setH(c, 0, sub[1][pos,0]); setH(c, -1, sub[1][pos,-1]) out.append(c) out = T.join(out) + out = C.rmVars(out, ['h']) return out # Enforce h at ind (STRUCT) From e51f4f6b2118e8eb3e07dfeb18dbd7c7e9043a9d Mon Sep 17 00:00:00 2001 From: BconstantMMK Date: Mon, 17 Jun 2024 17:47:52 +0200 Subject: [PATCH 7/7] Connector: less intrusive print adaptForRansLES --- Cassiopee/Connector/Connector/OversetData.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Cassiopee/Connector/Connector/OversetData.py b/Cassiopee/Connector/Connector/OversetData.py index 356ee0e6d..c15f4a4f4 100644 --- a/Cassiopee/Connector/Connector/OversetData.py +++ b/Cassiopee/Connector/Connector/OversetData.py @@ -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, \