Geom: Geometry Definition
Version: 2.4 (29/03/2017)
Author: Onera

Preamble
In this module, a geometry is defined discretely
with a great number of points. A geometry can be a i-array or a BAR-array
for 2D simulations and a i,j-array, a QUAD-array or a TRI-array for 3D
simulations. A polyline is defined as a C0 i-array which contains
only the polyline points (with no extra discretization points). Geometry
is stored in a Converter array (as defined in Converter documentation)
or in a zone of a CGNS/python tree (pyTree), following the selected
interface.
This module is part of Cassiopee, a free open-source
pre- and post-processor for CFD simulations.
To use it with the Converter array interface, you must import the
Geom module:
import Geom as D
Then, in the following, a is an array, and A a list of arrays.
To use it with the pyTree interface, you must import the module:
import Geom.PyTree as D
Then, in the following, a is a zone node and A is a list of zone nodes
or a complete pyTree.
Analytical geometries
D.point: create a point of coordinates x,y,z:
a = D.point( (x,y,z) )
Example of use: point creation (array),
point creation (pyTree).
D.naca: create a naca i-array with less than N points and of thickness e
(e=12, 15...) in the (x,y) plane:
a = D.naca(e, N=101)
Example of use: naca creation (array),
naca creation (pyTree).
D.line: create a line i-array between point (x1,y1,z1) and point (x2,y2,z2),
discretized with N points:
a = D.line((x1,y1,z1), (x2,y2,z2), N=100)
Example of use: line creation (array),
line creation (pyTree).
D.polyline: create a polyline i-array from a list of points [(x1,y1,z1),(x2,y2,z2),...,(xN,yN,zN)], containing no extra discretization points:
a = D.polyline([(x1,y1,z1),(x2,y2,z2),...,(xN,yN,zN)])
Example of use: polyline creation (array),
polyline creation (pyTree).
D.circle: create an i-array made of a portion of circle with N points of center C,
radius R, between angles tetas and tetae (in degrees) in the (x,y) plane:
a = D.circle((xc,yc,zc), R, tetas=0, tetae=360, N=100)
Example of use: circle creation (array),
circle creation (pyTree).
D.bezier: create a Bezier i-array or i,j-array using control points.
Either the number of points or the point density can be specified.
Control points coordinates are defined in a i-array or a i,j-array
designated here by c:
a = D.bezier(c, N=100, M=100) .or. a = D.bezier(c, density=10.)
Example of use: curve defined by Bezier (array),
curve defined by Bezier (pyTree).
D.spline: create a spline i-array or i,j-array of using
control points. Control points coordinates are defined in a i-array or
i,j-array. Order is the order of spline:
a = D.spline(c, order=3, N=100, M=100) .or. a = D.spline(c, order=3, density=10.)
Example of use: splines examples (array),
spline curve creation (pyTree).
D.nurbs: create a NURBS i-array or i,j-array using
control points and associated weights.
Control points coordinates and weight are defined in a i-array or i,j-array.
Order is the order of basis functions:
a = D.nurbs(c, weight, order=3, N=100, M=100) .or. a = D.nurbs(c, weight, order=3, density=10.)
Example of use: NURBS examples (array),
NURBS examples (pyTree).
D.curve: create an i-array from a user defined parametric function:
a = D.curve(f, N=100)
Example of use: curve creation (array),
curve creation (pyTree).
D.cone: create a i,j-array made of a cone with NxN points of center C, basis
Radius Rb, top Radius Rt and height H:
a = D.cone((xc,yc,zc), Rb, Rt, H, N=100)
Example of use: cone creation (array),
cone creation (pyTree).
D.sphere: create a sphere of center C and radius R, made of an i,j-array with Nx2N
points:
a = D.sphere((xc,yc,zc), R, N=100)
Example of use: sphere creation (array),
sphere creation (pyTree).
D.sphere6: create a sphere of center C and
radius R, made of 6 i,j-arrays with 6xNxN points:
A = D.sphere6((xc,yc,zc), R, N=100)
Example of use: sphere6 creation (array),
sphere6 creation (pyTree).
D.sphereYinYang: create a sphere of center C and radius R, made of 2 overlapping i,j-arrays:
A = D.sphereYinYang((xc,yc,zc), R, N=100)
Example of use: sphereYinYang creation (array),
sphereYinYang creation (pyTree).
D.torus: create an i,j-array (NRxNr points) made of a portion of a torus of center C, axis Z and radii R
(main radius) and r (tube radius) between the angles alphas and alphae (on the XY-plane)
and between betas and betae (on the RZ-plane):
A = D.torus((xc,yc,zc), R, r,
alphas=0, alphae=360, betas=0, betae=360, NR=100, Nr=100)
Example of use: torus creation (array),
torus creation (pyTree).
D.triangle: create a TRI-array made of a single triangle with 3 points
P1, P2, P3:
a = D.triangle((x1,y1,z1), (x2,y2,z2), (x3,y3,z3))
Example of use: triangle creation (array),
triangle creation (pyTree).
D.quadrangle: create a QUAD-array made of a single quadrangle with 4 points
P1, P2, P3, P4:
a = D.quadrangle((x1,y1,z1), (x2,y2,z2), (x3,y3,z3), (x4,y4,z4))
Example of use: quadrangle creation (array),
quadrangle creation (pyTree).
D.surface: create a i,j-array from a user defined parametric function:
a = D.surface(f, N=100)
Example of use: surface creation (array),
surface creation (pyTree).
D.text1D: create i-arrays describing a given text, offset is the space between
letters, font is the font name ('text1'), smooth is an integer
indicating letter smoothness (0-4):
A = D.text1D(text, font='text1', smooth=0, offset=0.5)
Example of use: 1D Text creation (array),
1D Text creation (pyTree).
D.text2D: create a TRI-array describing given text in 2D:
a = D.text2D(text, font='text1', smooth=0, offset=0.5)
Example of use: 2D Text creation (array),
2D Text creation (pyTree).
D.text3D: create a TRI-array describing given text in 3D:
a = D.text3D(text, font='text1', smooth=0, offset=0.5)
Example of use: 3D Text creation (array),
3D Text creation (pyTree).
Simple operations on geometries
D.addSeparationLine: for two i-arrays a and b in contact, provides a list two i-arrays,
with b defined in both arrays:
A = T.addSeparationLine(a, b)
Example of use: add line separation between 2 meshes (array),
add line separation between 2 meshes (pyTree).
Surface (volume) mesh from curve (surface) mesh
D.lineGenerate: create a surface geometry by driving an i-array with an i-array curve or a set of curves.
The initial i-array is in m, the driving curve is c,
the resulting i,j-array is in a:
a = D.lineGenerate(m, c)
Example of use: surface mesh creation (array),
surface mesh creation (pyTree).
D.axisym: create an axisymmetrical mesh from one of its borders.
The input array a can be an (i,j) structured array, a "TRI" or "QUAD" unstructured array.
Output array is respectively an (i,j,k) array, a "PENTA" or an "HEXA" array.
Rotation center and axis are (xo,yo,zo) and (nx,ny,nz), teta is the azimuthal sector, nteta is the number
of discretisation points in the azimuthal direction. A 1D curve describing
the r a function of theta can alternatively be specified:
b = D.axisym(a, (xo,yo,zo), (nx,ny,nz), teta=360., Nteta=360) .or.
b = D.axisym(a, (xo,yo,zo), (nx,ny,nz), rmod=c)
Example of use: axisymmetric mesh generation (array),
axisymmetric mesh generation (pyTree).
D.volumeFromCrossSections: create a volume mesh from cross-section curves in the (x,y) plane.
One curve (defined by a BAR-array) per cross-section is required. C
must be a list of those curves corresponding to the different
cross-sections of the solid body at different elevation z.
a is the volume of the solid body:
a = D.volumeFromCrossSections(C)
Example of use: volume creation from cross-sections (array),
volume creation from cross-sections (pyTree).
Information on geometries
D.getLength: return the length of an i-array or a BAR-array:
l = D.getLength(a) .or. l = getLength(A)
In the case of a list of meshes, the total length is returned.
Example of use: line length (array),
line length (pyTree).
D.getDistantIndex: return the index of the point distant of a signed distance l
from point indexed ind in an i-array.
Index starts at 1:
index = D.getDistantIndex(a, ind, l)
Example of use: distant index (array),
distant index (pyTree).
D.getNearestPointIndex: let a point P be defined by (x,y,z). Return the index and the square
distance of the nearest point of P in a:
(index, d2) = D.getNearestPointIndex(a, (x,y,z)) .or.
(index, d2) = D.getNearestPointIndex(A, (x,y,z)) .or.
[(index, d2)] = D.getNearestPointIndex(A, [(x,y,z)])
Example of use: nearest point index (array),
nearest point index (pyTree).
D.getCurvilinearAbscissa: return the curvilinear abscissa for all points of an i-array or
a BAR-array:
b = D.getCurvilinearAbscissa(a)
Example of use: curvilinear abscissa (array),
curvilinear abscissa (pyTree).
D.getDistribution: return the curvilinear abscissa for all points of a structured i-array in a coordinate form:
b = D.getDistribution(a)
Example of use: getDistribution (array),
getDistribution (pyTree).
D.getSharpestAngle: return the sharpest angle (in degrees and in [0-360]) for all nodes of an
unstructured surface.
The returned angle is the sharpest angle between pairs of adjacent
elements to which the node belongs to:
b = D.getSharpestAngle(a) .or. B = D.getSharpestAngle(A)
Example of use: sharpest angle (array),
sharpest angle (pyTree).
D.getCurvatureAngle: return the curvature angle (in degrees and in [0-360]) of all nodes of
an i-array or a BAR-array. The returned angle is the angle between edges belonging to node:
b = D.getCurvatureAngle(a) .or. B = D.getCurvatureAngle(A)
Example of use: curvature angle (array),
curvature angle (pyTree).
D.getCurvatureRadius: return the curvature radius of all the points in an i-array. This radius
is signed positive for convex regions, negative for concave regions:
b = D.getCurvatureRadius(a) .or. B = D.getCurvatureRadius(A)
Example of use: curvature radius (array),
curvature radius (pyTree).
D.getCurvatureHeight: return the curvature height 'hmax' of all nodes of
a 1D array (structured or BAR) or a 2D array ((i,j)-array, TRI or QUAD):
b = D.getCurvatureHeight(a) .or. B = D.getCurvatureHeight(A)
Example of use: curvature height (array),
curvature height (pyTree).
D.getTangent: return the unitary tangent vector of all nodes of
a 1D array (only structured):
b = D.getTangent(a) .or. B = D.getTangent(A)
Example of use: getTangent (array),
getTangent (pyTree).
Return to main userguide