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: str

    a name to give to the coordinate system

  • basis: Any

    a basis for the coordinate system

  • matrix: np.ndarray | None

    an 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 | None

    a 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: CoordinateSystem

    The basis for the representation of matrix

 

@property
origin(self): 
  • :returns: np.ndarray

    The 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.ndarray

    mat

 

@property
inverse(self): 

The inverse of the representation in the basis. None is shorthand for the inverse or pseudoinverse of matrix.

  • :returns: np.ndarray

    inv

 

@property
dimension(self): 

The dimension of the coordinate system. None means unspecified dimension

  • :returns: int or None

    dim

 

converter(self, system): 

Gets the converter from the current system to a new system

  • system: CoordinateSystem

    the target CoordinateSystem

  • :returns: CoordinateSystemConverter

    converter object

 

convert_coords(self, coords, system, **kw): 

Converts coordiantes from the current coordinate system to system

  • coords: CoordinateSet

    No description…

  • system: CoordinateSystem

    No description…

  • kw: Any

    options 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.ndarray

    No description…

  • :returns: np.ndarray

    No 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: Any

    No description…

  • order: Any

    No description…

  • coordinates: Any

    No description…

  • finite_difference_options: Any

    No description…

  • :returns: np.ndarray

    derivative 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: CoordinateSystem

    the 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] | None

    a spec of which coordinates to generate derivatives for (None means all)

  • mesh_spacing: float | np.ndarray

    the spacing to use when displacing

  • prep: None | function

    a function for pre-validating the generated coordinate values and grids

  • fd_options: Any

    options to be passed straight through to FiniteDifferenceFunction

  • :returns: np.ndarray

    derivative tensor

 

__repr__(self): 

Provides a clean representation of a CoordinateSystem for printing

  • :returns: str

    No description…

Examples


Edit Examples or Create New Examples
Edit Template or Create New Template
Edit Docstrings