From 4fcfa9afea42a810352d476c4bd4a1f2b3d5e57f Mon Sep 17 00:00:00 2001 From: benoit128 Date: Thu, 20 Jun 2024 12:01:59 +0200 Subject: [PATCH] Converter: add tests for write --- .../Converter/test/convertPyTree2FilePT_t1.py | 5 +-- .../Converter/test/convertPyTree2FilePT_t2.py | 1 + .../Converter/test/convertPyTree2FilePT_t3.py | 19 +++++++++++ .../Converter/test/convertPyTree2FilePT_t4.py | 34 +++++++++++++++++++ .../Git/{GitShortcuts => GitShortcuts.md} | 5 ++- 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 Cassiopee/Converter/test/convertPyTree2FilePT_t3.py create mode 100644 Cassiopee/Converter/test/convertPyTree2FilePT_t4.py rename docs/developers/Git/{GitShortcuts => GitShortcuts.md} (72%) diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py index 77ba18336..5c2443018 100644 --- a/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py @@ -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) diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t2.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t2.py index 54f7ac90f..fdb0edfc6 100644 --- a/Cassiopee/Converter/test/convertPyTree2FilePT_t2.py +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t2.py @@ -1,4 +1,5 @@ # - convertPyTree2File (pyTree) - +# - openfoam - import Converter.PyTree as C import Generator.PyTree as G import KCore.test as test diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t3.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t3.py new file mode 100644 index 000000000..00c78f219 --- /dev/null +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t3.py @@ -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) diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py new file mode 100644 index 000000000..66200000b --- /dev/null +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py @@ -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) diff --git a/docs/developers/Git/GitShortcuts b/docs/developers/Git/GitShortcuts.md similarity index 72% rename from docs/developers/Git/GitShortcuts rename to docs/developers/Git/GitShortcuts.md index e36d23264..79779fae3 100644 --- a/docs/developers/Git/GitShortcuts +++ b/docs/developers/Git/GitShortcuts.md @@ -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'"