CoordinateSystem
A representation of a coordinate system. It doesn’t do much on its own but it does provide a way to unify internal, cartesian, derived type coordinates
Properties and Methods
__init__(self, name=None, basis=None, matrix=None, inverse=None, dimension=None, origin=None, coordinate_shape=None, jacobian_prep=None, converter_options=None):
Sets up the CoordinateSystem object
name:stra name to give to the coordinate system
basis:Anya basis for the coordinate system
matrix:np.ndarray | Nonean expansion coefficient matrix for the set of coordinates in its basis
dimension:Iterable[None | int]the dimension of a single configuration in the coordinate system (for validation)
jacobian_prep:function | Nonea function for preparing coordinates to be used in computing the Jacobian
coordinate_shape:iterable[int]the actual shape of a single coordinate in the coordinate system
@property
basis(self):
:returns:CoordinateSystemThe basis for the representation of
matrix
@property
origin(self):
:returns:np.ndarrayThe origin for the expansion defined by
matrix
@property
matrix(self):
The matrix representation in the CoordinateSystem.basis
None is shorthand for the identity matrix
:returns:np.ndarraymat
@property
inverse(self):
The inverse of the representation in the basis.
None is shorthand for the inverse or pseudoinverse of matrix.
:returns:np.ndarrayinv
@property
dimension(self):
The dimension of the coordinate system.
None means unspecified dimension
:returns:int or Nonedim
converter(self, system):
Gets the converter from the current system to a new system
system:CoordinateSystemthe target CoordinateSystem
:returns:CoordinateSystemConverterconverter object
convert_coords(self, coords, system, **kw):
Converts coordiantes from the current coordinate system to system
coords:CoordinateSetNo description…
system:CoordinateSystemNo description…
kw:Anyoptions to be passed through to the converter object
:returns:tuple(np.ndarray, dict)the converted coordiantes
displacement(self, amts):
Generates a displacement or matrix of displacements based on the vector or matrix amts The relevance of this method has become somewhat unclear…
amts:np.ndarrayNo description…
:returns:np.ndarrayNo description…
derivatives(self, coords, function, order=1, coordinates=None, result_shape=None, **finite_difference_options):
Computes derivatives for an arbitrary function with respect to this coordinate system.
Basically a more flexible version of jacobian.
function:AnyNo description…
order:AnyNo description…
coordinates:AnyNo description…
finite_difference_options:AnyNo description…
:returns:np.ndarrayderivative tensor
jacobian(self, coords, system, order=1, coordinates=None, converter_options=None, all_numerical=False, **finite_difference_options):
Computes the Jacobian between the current coordinate system and a target coordinate system
system:CoordinateSystemthe target CoordinateSystem
order:int | Iterable[int]the order of the Jacobian to compute, 1 for a standard, 2 for the Hessian, etc.
coordinates:None | iterable[iterable[int] | Nonea spec of which coordinates to generate derivatives for (None means all)
mesh_spacing:float | np.ndarraythe spacing to use when displacing
prep:None | functiona function for pre-validating the generated coordinate values and grids
fd_options:Anyoptions to be passed straight through to FiniteDifferenceFunction
:returns:np.ndarrayderivative tensor
__repr__(self):
Provides a clean representation of a CoordinateSystem for printing
:returns:strNo description…
Examples
Edit Examples or
Create New Examples
Edit Template or
Create New Template
Edit Docstrings