pg_utils.sympy_supp.vector_calculus_3d.OrthogonalCoordinates3D
- class pg_utils.sympy_supp.vector_calculus_3d.OrthogonalCoordinates3D(x1, x2, x3, x1_name=None, x2_name=None, x3_name=None)[source]
Bases:
object
Base class for orthogonal curvilinear coordinates in 3D
Example: define a Cartesian system:
x, y, z = sympy.symbols("x y z") cart3d = OrthogonalCoordinates3D(x, y, z, x1_name='x', x2_name='y', x3_name='z')
OrthogonalCoordinates3D implements indexing. The coordinates can be retrieved in two different ways (following last example):
>>> cart3d.y # invoking coordinate by name y >>> cart3d[1] # invoking coordinate by index y
Computational utilities of OrthogonalCoordinates3D, such as grad, curl etc., are all abstract methods; therefore, the class is intended to be inherited and used, instead of being used directly.
- __init__(x1, x2, x3, x1_name=None, x2_name=None, x3_name=None) None [source]
Constructor
- Parameters:
Methods
__init__
(x1, x2, x3[, x1_name, x2_name, x3_name])Constructor
curl
(vector_in, **kwargs)Compute curl/rot of a vector
div
(vector_in, **kwargs)Compute divergence of a vector
grad
(scalar_in, **kwargs)Compute gradient of a scalar
laplacian
(tensor_in[, rank])Compute Laplacian of a tensor
transform_to
(tensor_in, new_sys[, coeffs_new])Transform to other coordinate systems
Attributes
Setter/getter interface for the coordinates, indexable
- laplacian(tensor_in, rank=0, **kwargs)[source]
Compute Laplacian of a tensor
abstract method, to be overriden
- transform_to(tensor_in, new_sys: OrthogonalCoordinates3D, coeffs_new=False)[source]
Transform to other coordinate systems
abstract method, to be overriden