Skip to content

Commit

Permalink
Merge pull request #147 from antjost/devTboxUnified
Browse files Browse the repository at this point in the history
[IBM] Move the split of tbOneOver & tbF1 from tbox into the macro IBM functions and not in the overarching prepareIBMData function. Done as part of the IBM clean up of 2024.
  • Loading branch information
benoit128 authored Aug 29, 2024
2 parents bdaa9b5 + 20a4653 commit 487f8dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
13 changes: 1 addition & 12 deletions Cassiopee/Connector/Connector/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,6 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N
if Reynolds < 1.e5: frontType = 1
else: Reynolds = 1.e6

## tbox = tbox(area refinement)[legacy tbox] + tb(area for one over)[tbOneOver] + tb(zones to keep as F1)[tbF1]
## here we divide tbox into tbOneOverF1 (tbOneOver + tbF1) & tbox; tbox will henceforth only consist of the area that will be refined.
## Note: tb(zones to keep as F1)[tbF1] is still in development, is experimental, & subject to major/minor changes with time. Please use with a lot of caution & see A.Jost @ DAAA/DEFI [28/08/2024] as
## there is no non-regression test case yet available.
tbOneOverF1 = None
if tbox:
tbOneOverF1 = Internal.getNodesFromNameAndType(tbox, '*OneOver*', 'CGNSBase_t') + Internal.getNodesFromNameAndType(tbox, '*KeepF1*', 'CGNSBase_t')
tbox = Internal.rmNodesByName(Internal.rmNodesByName(tbox, '*OneOver*'), '*KeepF1*')
if len(Internal.getBases(tbox))==0: tbox=None

if frontType == 42: expand= 4

dimPb = Internal.getNodeFromName(tb, 'EquationDimension')
Expand Down Expand Up @@ -255,8 +245,7 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N
test.printMem("Info: prepareIBMData: generate Cartesian mesh [start]")
t = G_IBM.generateIBMMesh(tbLocal, vmin=vmin, snears=snears, dimPb=dimPb, dfars=dfars, tbox=tbox,
snearsf=snearsf, check=check, to=to, ext=depth+1,
expand=expand, dfarDir=dfarDir, octreeMode=octreeMode,
tbOneOverF1=tbOneOverF1)
expand=expand, dfarDir=dfarDir, octreeMode=octreeMode)
Internal._rmNodesFromName(tb,"SYM")

if balancing and Cmpi.size > 1: _redispatch__(t=t)
Expand Down
21 changes: 14 additions & 7 deletions Cassiopee/Generator/Generator/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,19 +677,26 @@ def buildParentOctrees__(o, tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., d
# main function
def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0,
tbox=None, snearsf=None, check=False, to=None,
ext=2, expand=3, octreeMode=0, tbOneOverF1=None):
ext=2, expand=3, octreeMode=0):
import KCore.test as test
# refinementSurfFile: surface meshes describing refinement zones
if tbox is not None:
if isinstance(tbox, str): tbox = C.convertFile2PyTree(tbox)
else: tbox = tbox

##Split tbOneOverF1 into tbOneOver (rectilinear region) & tbF1 (WM F1 approach region)
tbOneOver= None
tbF1 = None
if tbOneOverF1:
tbOneOver= Internal.getNodesFromNameAndType(tbOneOverF1, '*OneOver*', 'CGNSBase_t')
tbF1 = Internal.getNodesFromNameAndType(tbOneOverF1, '*KeepF1*' , 'CGNSBase_t')
## tbox = tbox(area refinement)[legacy tbox] + tb(area for one over)[tbOneOver] + tb(zones to keep as F1)[tbF1]
## here we divide tbox into tbOneOver (rectilinear region) & tbF1 (WM F1 approach region) & tbox; tbox will henceforth only consist of the area that will be refined.
## Note: tb(zones to keep as F1)[tbF1] is still in development, is experimental, & subject to major/minor changes with time. Please use with a lot of caution & see A.Jost @ DAAA/DEFI [28/08/2024] as
## there is no non-regression test case yet available.
tbOneOverF1 = None
tbOneOver = None
tbF1 = None
if tbox:
tbOneOver = Internal.getNodesFromNameAndType(tbox, '*OneOver*', 'CGNSBase_t')
tbF1 = Internal.getNodesFromNameAndType(tbox, '*KeepF1*' , 'CGNSBase_t')
tbOneOverF1 = tbOneOver+tbF1
tbox = Internal.rmNodesByName(Internal.rmNodesByName(tbox, '*OneOver*'), '*KeepF1*')
if len(Internal.getBases(tbox))==0: tbox=None

# Octree identical on all procs
if to is not None:
Expand Down

0 comments on commit 487f8dd

Please sign in to comment.