Skip to content

Commit b22f660

Browse files
author
cassiope
committed
Docs: updating docs (cassiope bot)
1 parent 5567d83 commit b22f660

25 files changed

+449
-92
lines changed

Cassiopee/KCore/doc/source/Geom.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ List of functions
4040
Geom.polyline
4141
Geom.circle
4242
Geom.naca
43+
Geom.profile
4344
Geom.spline
4445
Geom.nurbs
4546
Geom.bezier
@@ -265,6 +266,29 @@ A polyline is defined as a C0 i-array which contains only the polyline points (w
265266

266267
---------------------------------------
267268

269+
.. py:function:: Geom.profile(name=None)
270+
271+
Create a wing profile of given name.
272+
The name must be of type "series/profile".
273+
If name is not provided, list available profiles.
274+
275+
:param name: profile name
276+
:type name: string of type "series/profile"
277+
:return: a profile
278+
:rtype: one array/zone (1D STRUCT)
279+
280+
*Example of use:*
281+
282+
* `Creation of a profile (array) <Examples/Geom/profile.py>`_:
283+
284+
.. literalinclude:: ../build/Examples/Geom/profile.py
285+
286+
* `Creation of a profile (pyTree) <Examples/Geom/profilePT.py>`_:
287+
288+
.. literalinclude:: ../build/Examples/Geom/profilePT.py
289+
290+
---------------------------------------
291+
268292
.. py:function:: Geom.spline(Pts, order=3, N=100, M=100, density=-1)
269293
270294
Create a Spline curve/surface using control points defined by Pts.

docs/doc/Converter.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3497,7 +3497,7 @@ <h3>Array / PyTree common manipulations</h3>
34973497
<h3>Array / PyTree analysis</h3>
34983498
<dl class="py function">
34993499
<dt class="sig sig-object py" id=".Converter.diffArrays">
3500-
<span class="sig-prename descclassname"><span class="pre">Converter.</span></span><span class="sig-name descname"><span class="pre">diffArrays</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">removeCoordinates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span></dt>
3500+
<span class="sig-prename descclassname"><span class="pre">Converter.</span></span><span class="sig-name descname"><span class="pre">diffArrays</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">removeCoordinates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">atol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.e-11</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rtol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.</span></span></em><span class="sig-paren">)</span></dt>
35013501
<dd><p>Given a solution in a and a solution in b, both defined on the same mesh,
35023502
return the differences.</p>
35033503
<dl class="field-list simple">
@@ -3506,6 +3506,8 @@ <h3>Array / PyTree analysis</h3>
35063506
<li><p><strong>a</strong> (<em>[</em><em>list</em><em> of </em><em>arrays</em><em>] or </em><em>[</em><em>pyTree</em><em>, </em><em>base</em><em>, </em><em>zone</em><em>, </em><em>list</em><em> of </em><em>zones</em><em>]</em>) &#8211; input data 1</p></li>
35073507
<li><p><strong>b</strong> (<em>[</em><em>list</em><em> of </em><em>arrays</em><em>] or </em><em>[</em><em>pyTree</em><em>, </em><em>base</em><em>, </em><em>zone</em><em>, </em><em>list</em><em> of </em><em>zones</em><em>]</em>) &#8211; input data 2</p></li>
35083508
<li><p><strong>removeCoordinates</strong> (<em>boolean</em>) &#8211; if True, remove original coordinates (pyTree)</p></li>
3509+
<li><p><strong>atol</strong> (<em>float</em>) &#8211; absolute tolerance</p></li>
3510+
<li><p><strong>rtol</strong> (<em>float</em>) &#8211; relative tolerance</p></li>
35093511
</ul>
35103512
</dd>
35113513
<dt class="field-even">Return type<span class="colon">:</span></dt>

docs/doc/Examples/Connector/prepAMRFull_t1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# - prepAMRFull (pyTree) -
12
import Converter.PyTree as C
23
import Geom.IBM as D_IBM
34
import Connector.AMR as X_AMR
@@ -39,9 +40,9 @@
3940
X_AMR.prepareAMRIBM(tb, levelMax, vmins, dim, IBM_parameters, OutputAMRMesh=True, check=False, localDir=LOCAL, fileName='tIBM.cgns')
4041

4142
tAMR = C.convertFile2PyTree(LOCAL+'tAMRMesh.cgns')
42-
test.testT(tAMR,1)
43+
test.testT(tAMR, 1)
4344
del tAMR
4445

4546
tIBM = C.convertFile2PyTree(LOCAL+'tIBM.cgns')
46-
test.testT(tIBM,2)
47+
test.testT(tIBM, 2)
4748
del tIBM
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# - createGlobalHook (array) -
22
import Converter as C
3+
import Generator as G
34
import KCore.test as test
45

5-
test.stdTestA(C.createGlobalHook, 'faceCenters', 1)
6-
test.stdTestA(C.createGlobalHook, 'faceCenters', 0)
6+
a = G.cartNGon((0,0,0), (1,1,1), (10,10,10))
7+
b = G.cartNGon((9,0,0), (1,1,1), (10,10,10))
8+
hook = C.createGlobalHook([a,b], function='faceCenters')
9+
test.testO(hook, 1)

docs/doc/Examples/Converter/createGlobalHook_t2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import Converter as C
33
import KCore.test as test
44

5-
test.stdTestA(C.createGlobalHook, 'nodes',1)
6-
test.stdTestA(C.createGlobalHook, 'nodes',0)
5+
test.stdTestA(C.createGlobalHook, 'nodes', 1)
6+
test.stdTestA(C.createGlobalHook, 'nodes', 0)

docs/doc/Examples/Converter/createGlobalHook_t3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import Converter as C
33
import KCore.test as test
44

5-
test.stdTestA(C.createGlobalHook, 'elementCenters',1)
6-
test.stdTestA(C.createGlobalHook, 'elementCenters',0)
5+
test.stdTestA(C.createGlobalHook, 'elementCenters', 1)
6+
test.stdTestA(C.createGlobalHook, 'elementCenters', 0)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# - getValue (array) -
2+
import Converter as C
3+
import Generator.PyTree as GP
4+
import Converter.PyTree as CP
5+
import KCore.test as test
6+
7+
# test on array3
8+
a = GP.cart((0,0,0), (1,1,1), (10,10,10))
9+
f = CP.getFields('GridCoordinates', a, api=3)[0]
10+
ret = C.getValue(f, 12)
11+
#C.setValue(f, 12, ret)
12+
test.testO(ret, 1)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# - setValue (array) -
2+
import Converter as C
3+
import Generator.PyTree as GP
4+
import Converter.PyTree as CP
5+
import KCore.test as test
6+
7+
# test on array3
8+
a = GP.cart((0,0,0), (1,1,1), (10,10,10))
9+
f = CP.getFields('GridCoordinates', a, api=3)[0]
10+
C.setValue(f, 12, (1,2,3))
11+
ret = C.getValue(f, 12)
12+
test.testO(ret, 1)

docs/doc/Examples/Generator/getVolumeMapPT_t1.py

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,103 @@
22
import Generator.PyTree as G
33
import Converter.PyTree as C
44
import Geom.PyTree as D
5-
import KCore.test as T
5+
import KCore.test as test
66

7-
# Test 3D structure
7+
# --- Structured grids ---
8+
# 3D structured
89
a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,3))
910
a = C.addBC2Zone(a, 'wall1','BCWall','jmin')
1011
a = C.addBC2Zone(a, 'match1','BCMatch','imin',a,'imax',[1,2,3])
1112
a = C.addBC2Zone(a, 'match2','BCMatch','imax',a,'imin',[1,2,3])
1213
a = C.fillEmptyBCWith(a,'overlap','BCOverlap')
1314
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
1415
vol = G.getVolumeMap(a)
15-
T.testT(vol, 1)
16+
test.testT(vol, 1)
1617

17-
# Test 2D structure
18+
# 2D structured
1819
a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
1920
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
2021
vol = G.getVolumeMap(a)
21-
T.testT(vol, 2)
22+
test.testT(vol, 2)
2223

23-
# Test 1D structure
24+
# 1D structured
2425
a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (1,1,10))
2526
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
2627
vol = G.getVolumeMap(a)
27-
T.testT(vol, 7)
28+
test.testT(vol, 7)
2829

29-
# Test 1d non-structure bar
30+
# --- BE ---
31+
# 1d unstructured bar
3032
a = D.line((0,0,0), (1,0,0),11)
3133
a2 = C.convertArray2Tetra(a)
3234
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
3335
vol = G.getVolumeMap(a)
34-
T.testT(vol, 8)
36+
test.testT(vol, 8)
3537

36-
37-
# Test 2d non-structure hexa
38+
# 2D unstructured quad
3839
a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
3940
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
4041
vol = G.getVolumeMap(a)
41-
T.testT(vol, 3)
42+
test.testT(vol, 3)
4243

43-
# Test 3d non-structure hexa
44+
# 3D unstructured hexa
4445
a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,10))
4546
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
4647
vol = G.getVolumeMap(a)
47-
T.testT(vol, 4)
48+
test.testT(vol, 4)
4849

49-
# Test 2d non-structure tetra
50+
# 2D unstructured tri
5051
a = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
5152
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
5253
vol = G.getVolumeMap(a)
53-
T.testT(vol, 5)
54+
test.testT(vol, 5)
5455

55-
# Test 3d non-structure tetra
56+
# 3D unstructured tetra
5657
a = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,10))
5758
a = C.initVars(a,'Density',1.); a = C.initVars(a,'centers:cellN',1.)
5859
vol = G.getVolumeMap(a)
59-
T.testT(vol, 6)
60+
test.testT(vol, 6)
61+
62+
# 3D unstructured pyra
63+
a = G.cartPyra((0., 0., 0.), (1., 1., 1.), (5, 5, 5))
64+
G._getVolumeMap(a)
65+
test.testT(a,9)
66+
67+
# 3D unstructured penta
68+
a = G.cartPenta((0., 0., 0.), (1., 1., 1.), (5, 5, 5))
69+
G._getVolumeMap(a)
70+
test.testT(a,10)
71+
72+
"""
73+
# 1D unstructured ME
74+
a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (5,1,1))
75+
b = G.cartHexa((0.4,0.,0.), (0.1,0.1,0.2), (1,10,1))
76+
c = G.cartHexa((0.8,0.,0.), (0.1,0.1,0.2), (4,1,1))
77+
d = G.cartHexa((0.4,-0.9,0.), (0.1,0.1,0.2), (1,1,12))
78+
a = C.mergeConnectivity([a, b, c, d], None)
79+
#G._getVolumeMap(a)
80+
#test.testT(a,11)
81+
82+
# --- ME ---
83+
# 2D unstructured ME: tri-quad-tri
84+
# |
85+
# tri
86+
a = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (5,10,1))
87+
b = G.cartHexa((0.4,0.,0.), (0.1,0.1,0.2), (5,10,1))
88+
c = G.cartTetra((0.8,0.,0.), (0.1,0.1,0.2), (5,10,1))
89+
d = G.cartTetra((0.4,-0.9,0.), (0.1,0.1,0.2), (5,10,1))
90+
a = C.mergeConnectivity([a, b, c, d], None)
91+
#G._getVolumeMap(a)
92+
#test.testT(a,12)
93+
94+
# 3D unstructured ME: tetra - pyra
95+
# | |
96+
# penta hexa
97+
a = G.cartTetra((0.,0.4,0.), (0.1,0.1,0.1), (5,5,5))
98+
b = G.cartPyra((0.4,0.4,0.), (0.1,0.1,0.1), (5,5,5))
99+
c = G.cartPenta((0.,0.,0.), (0.1,0.1,0.1), (5,5,5))
100+
d = G.cartHexa((0.4,0.,0.), (0.1,0.1,0.1), (5,5,5))
101+
a = C.mergeConnectivity([a, b, c, d], None)
102+
#G._getVolumeMap(a)
103+
#test.testT(a,13)
104+
"""

docs/doc/Examples/Generator/getVolumeMapPT_t2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import Converter.PyTree as C
44
import KCore.test as T
55

6-
# Test 3D structure
6+
# 3D structured
77
a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,3))
88
a = C.addBC2Zone(a, 'wall1','BCWall','jmin')
99
a = C.addBC2Zone(a, 'match1','BCMatch','imin',a,'imax',[1,2,3])
@@ -15,39 +15,39 @@
1515
t = G.getVolumeMap(t)
1616
T.testT(t,1)
1717

18-
# Test 2D structure
18+
# 2D structured
1919
a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
2020
t = C.newPyTree(['Base',2]); t[2][1][2].append(a)
2121
t[2][1] = C.addState(t[2][1], 'Mach', 0.6)
2222
t = C.initVars(t,'Density',2.); t = C.initVars(t,'centers:cellN',1.)
2323
t = G.getVolumeMap(t)
2424
T.testT(t,2)
2525

26-
# Test 2d non-structure hexa
26+
# 2D unstructured quad
2727
a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
2828
t = C.newPyTree(['Base',2]); t[2][1][2].append(a)
2929
t[2][1] = C.addState(t[2][1], 'Mach', 0.6)
3030
t = C.initVars(t,'Density',2.); t = C.initVars(t,'centers:cellN',1.)
3131
t = G.getVolumeMap(t)
3232
T.testT(t,3)
3333

34-
# Test 3d non-structure hexa
34+
# 3D unstructured hexa
3535
a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,10))
3636
t = C.newPyTree(['Base']); t[2][1][2].append(a)
3737
t[2][1] = C.addState(t[2][1], 'Mach', 0.6)
3838
t = C.initVars(t,'Density',2.); t = C.initVars(t,'centers:cellN',1.)
3939
t = G.getVolumeMap(t)
4040
T.testT(t,4)
4141

42-
# Test 2d non-structure tri
42+
# 2D unstructured tri
4343
a = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1))
4444
t = C.newPyTree(['Base',2]); t[2][1][2].append(a)
4545
t[2][1] = C.addState(t[2][1], 'Mach', 0.6)
4646
t = C.initVars(t,'Density',2.); t = C.initVars(t,'centers:cellN',1.)
4747
t = G.getVolumeMap(t)
4848
T.testT(t,5)
4949

50-
# Test 3d non-structure tetra
50+
# 3D unstructured tetra
5151
a = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,10))
5252
t = C.newPyTree(['Base']); t[2][1][2].append(a)
5353
t[2][1] = C.addState(t[2][1], 'Mach', 0.6)

0 commit comments

Comments
 (0)