gmsh_scripts.transform.transform

Module Contents

Classes

Transform

General transformation of Point coordinates.

Translate

Translate coordinates of the Point by the displacement

Rotate

TODO only for 3D coordinate systems

CartesianToCartesian

Convert coordinates of the Point from Cartesian to Cartesian system.

CylindricalToCartesian

Convert coordinates of the Point from Cylindrical to Cartesian system.

SphericalToCartesian

Convert coordinates of the Point from Spherical to Cartesian system.

ToroidalToCartesian

Convert coordinates of the Point from Toroidal to Cartesian system.

TokamakToCartesian

Convert coordinates of the Point from Tokamak to Cartesian system.

BlockToCartesian

Convert coordinates of the Point from Block to Cartesian system.

CartesianToCartesianByBlock

Convert coordinates of the Point from Cartesian to Cartesian system by Block coordinates.

AffineToAffine

Convert coordinates of the Point from Affine to Affine system.

AffineToCartesian

Convert coordinates of the Point from Affine to Cartesian system.

PathToCartesian

Convert coordinates of the Point from Path to Cartesian system.

LayerToCartesian

General transformation of Point coordinates.

QuarterLayerToCartesian

General transformation of Point coordinates.

AnyAsSome

Treat any coordinate system as some coordinate system without coordinates transformation

TransformationMatrix

Affine transformation matrix

Functions

reduce_transforms(transforms, point)

Apply transformations on the point.

Attributes

str2obj

gmsh_scripts.transform.transform.reduce_transforms(transforms, point)

Apply transformations on the point.

Параметры:
  • transforms (list) – Transformations

  • point (Point) – Point

Результат:

Transformed point.

Тип результата:

Point

class gmsh_scripts.transform.transform.Transform(cs_from=None, cs_to=None, cs_self=None, **kwargs)

General transformation of Point coordinates.

Параметры:
class gmsh_scripts.transform.transform.Translate(delta, **kwargs)

Bases: Transform

Translate coordinates of the Point by the displacement

Параметры:

delta (list or np.ndarray) – displacement

class gmsh_scripts.transform.transform.Rotate(origin, direction, angle, **kwargs)

Bases: Transform

TODO only for 3D coordinate systems :param origin: origin of rotation :type origin: list or np.ndarray :param direction: rotation axis :type direction: list or np.ndarray :param angle: counterclockwise angle of rotation in radians [0, 2*pi) :type angle: float

class gmsh_scripts.transform.transform.CartesianToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Cartesian to Cartesian system.

For compatibility.

class gmsh_scripts.transform.transform.CylindricalToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Cylindrical to Cartesian system.

[r, phi, z] -> [x, y, z] r - radius [0, inf), phi - azimuthal angle [0, 2*pi) (counterclockwise from X to Y), z - height

class gmsh_scripts.transform.transform.SphericalToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Spherical to Cartesian system.

[r, phi, theta] -> [x, y, z]

  • r - radius [0, inf)

  • phi - azimuthal angle [0, 2*pi) (counterclockwise from X to Y)

  • theta - polar angle [0, pi] [from top to bottom, i.e XY-plane is pi/2]

class gmsh_scripts.transform.transform.ToroidalToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Toroidal to Cartesian system.

[r, phi, theta, r2] -> [x, y, z]

r - inner radius (r < r2)

phi - inner angle [0, 2*pi)

theta - outer angle [0, 2*pi)

r2 - outer radius

class gmsh_scripts.transform.transform.TokamakToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Tokamak to Cartesian system.

[r, phi, theta, r2, kxy, kz] -> [x, y, z]

r - inner radius (r < r2)

phi - inner angle [0, 2*pi)

theta - outer angle [0, 2*pi)

r2 - outer radius

kxy - inner radius XY scale coefficient in positive outer radius direction

kz - inner radius Z scale coefficient

class gmsh_scripts.transform.transform.BlockToCartesian(cs_from=None, **kwargs)

Bases: Transform

Convert coordinates of the Point from Block to Cartesian system.

[xi, eta, zeta] -> [x, y, z]

xi, eta, zeta - local block coordinates

Параметры:

cs_from (coordinate_system.Block) – Block Coordinate System

class gmsh_scripts.transform.transform.CartesianToCartesianByBlock(block=None, block_coordinates=None, **kwargs)

Bases: Transform

Convert coordinates of the Point from Cartesian to Cartesian system by Block coordinates.

[x, y, z] -> [x, y, z] + [dx, dy, dz]

[dx, dy, dz] = [xi, eta, zeta] - block_coordinates in Cartesian system

Параметры:
  • block (block.Block) – Block object

  • block_coordinates (list or np.ndarray) – xi, eta, zeta - block local coordinates

class gmsh_scripts.transform.transform.AffineToAffine(cs_to, **kwargs)

Bases: Transform

Convert coordinates of the Point from Affine to Affine system.

[x0, y0, z0] -> [x1, y1, z1]

Параметры:

cs_to (Affine) – Affine coordinate system

class gmsh_scripts.transform.transform.AffineToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Affine to Cartesian system.

[x0, y0, z0] -> [x, y, z]

class gmsh_scripts.transform.transform.PathToCartesian(**kwargs)

Bases: Transform

Convert coordinates of the Point from Path to Cartesian system.

[x, y, u] -> [x, y, z]

u - relative path coordinate [0, 1], where 0 - start of the path, 1 - end.

x, y - Cartesian coordinates [-inf, inf] on the normal plane to direction of the path derivative at the point with relative path coordinate u.

class gmsh_scripts.transform.transform.LayerToCartesian(**kwargs)

Bases: Transform

General transformation of Point coordinates.

Параметры:
static update_coordinate(p0, pn, n0, nn, l00, l0n, ln0, lnn, lt)
class gmsh_scripts.transform.transform.QuarterLayerToCartesian(**kwargs)

Bases: Transform

General transformation of Point coordinates.

Параметры:
static update_coordinate(p0, pn, n0, nn, l00, l0n, ln0, lnn, lt)
class gmsh_scripts.transform.transform.AnyAsSome(cs_to, **kwargs)

Bases: Transform

Treat any coordinate system as some coordinate system without coordinates transformation

Параметры:

cs_to (CoordinateSystem) – some coordinate system

class gmsh_scripts.transform.transform.TransformationMatrix(matrix, **kwargs)

Bases: Transform

Affine transformation matrix

Matrix could describe translation, rotation, reflection and dilation

Параметры:

matrix (list or list of list or np.ndarray) – transformation matrix

gmsh_scripts.transform.transform.str2obj