Skip to content

Commit

Permalink
Converter: add tests for write
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Jun 20, 2024
1 parent ebbc64f commit 4fcfa9a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Cassiopee/Converter/test/convertPyTree2FilePT_t1.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# - convertPyTree2File (pyTree) -
# - formated tecplot -
import Converter.PyTree as C
import Generator.PyTree as G
import KCore.test as test

LOCAL = test.getLocal()

# Struct - OK
# Struct
z = G.cart((0,0,0), (1,1,1), (10,10,10))
C.convertPyTree2File(z, LOCAL+'/out1.tp')
test.testF(LOCAL+'/out1.tp', 1)

# BE - OK
# BE
z = G.cartHexa((0,0,0), (1,1,1), (10,10,10))
C.convertPyTree2File(z, LOCAL+'/out2.tp')
test.testF(LOCAL+'/out2.tp', 2)
Expand Down
1 change: 1 addition & 0 deletions Cassiopee/Converter/test/convertPyTree2FilePT_t2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# - convertPyTree2File (pyTree) -
# - openfoam -
import Converter.PyTree as C
import Generator.PyTree as G
import KCore.test as test
Expand Down
19 changes: 19 additions & 0 deletions Cassiopee/Converter/test/convertPyTree2FilePT_t3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# - convertPyTree2File (pyTree) -
# - cedre -
import Converter.PyTree as C
import Generator.PyTree as G
import KCore.test as test

LOCAL = test.getLocal()

# NGON3
z = G.cartNGon((0,0,0), (1,1,1), (10,10,10), api=1)
C._fillEmptyBCWith(z, 'far', 'BCFarfield')
C.convertPyTree2File(z, LOCAL+'/out1.d')
test.testF(LOCAL+'/out1.d', 1)

# NGON4
z = G.cartNGon((0,0,0), (1,1,1), (10,10,10), api=3)
C._fillEmptyBCWith(z, 'far', 'BCFarfield')
C.convertPyTree2File(z, LOCAL+'/out2.d')
test.testF(LOCAL+'/out2.d', 1)
34 changes: 34 additions & 0 deletions Cassiopee/Converter/test/convertPyTree2FilePT_t4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# - convertPyTree2File (pyTree) -
# - binary tecplot -
import Converter.PyTree as C
import Generator.PyTree as G
import KCore.test as test

LOCAL = test.getLocal()

# Struct
z = G.cart((0,0,0), (1,1,1), (10,10,10))
C.convertPyTree2File(z, LOCAL+'/out1.plt')
test.testF(LOCAL+'/out1.plt', 1)

# BE
z = G.cartHexa((0,0,0), (1,1,1), (10,10,10))
C.convertPyTree2File(z, LOCAL+'/out2.plt')
test.testF(LOCAL+'/out2.plt', 2)

# ME - output HEXA
#a = G.cartHexa((0,0,0), (1,1,1), (10,10,10))
#b = G.cartTetra((9,0,0), (1,1,1), (10,10,10))
#z = C.mergeConnectivity(a, b, boundary=0)
#C.convertPyTree2File(z, LOCAL+'/out3.plt')
#test.testF(LOCAL+'/out3.plt', 3)

# NGON3
z = G.cartNGon((0,0,0), (1,1,1), (10,10,10), api=1)
C.convertPyTree2File(z, LOCAL+'/out4.plt')
test.testF(LOCAL+'/out4.plt', 4)

# NGON4
z = G.cartNGon((0,0,0), (1,1,1), (10,10,10), api=3)
C.convertPyTree2File(z, LOCAL+'/out5.plt')
test.testF(LOCAL+'/out5.plt', 5)
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
-- Useful git shortcuts --
# -- Useful git shortcuts --

## prety display of git log

alias gitlog="git log --all --graph --pretty=format:'%C(auto)%d%Creset %C(Yellow) %h %Creset|| %C(Cyan) %as %Creset || %C(dim magenta) %an %Creset|| %s'"

0 comments on commit 4fcfa9a

Please sign in to comment.