open_viewmin.filter_tree_plot.utilities.calculations#

General calculation utilities.

Module Contents#

Functions#

calculate_from_one_vector_field_and_one_scalar_field(...)

calculate_from_scalar_field(plotter, ...[, mesh_name])

Create callable that will apply a calculation to a scalar dataset.

calculate_from_tensor_field(plotter, ...[, mesh_name])

Create callable that will apply a calculation to a dataset of

calculate_from_two_vector_fields(plotter, ...[, mesh_name])

calculate_from_vector_field(plotter, ...[, mesh_name])

Create callable that will apply a calculation to a vector dataset.

di(arr, array_dims[, flatten, component, data_stride])

Gradient

dij(arr, array_dims[, flatten, data_stride])

Hessian

einstein_sum(sum_str, *arrays[, reshape])

Increase flexibility of numpy.einsum, for convenience in calculating

list_to_xyzmat(arr, dims)

matrix_times_transpose(arr)

safe_inverse(arr)

take inverse x->1/x but with 0->0

transpose_times_matrix(arr)

xyzmat_to_list(arr)

Attributes#

levi_civita

open_viewmin.filter_tree_plot.utilities.calculations.calculate_from_one_vector_field_and_one_scalar_field(plotter, vector_field_name, scalar_field_name, operation_string, mesh_name='fullmesh')#
open_viewmin.filter_tree_plot.utilities.calculations.calculate_from_scalar_field(plotter, scalar_field_name, operation_string, mesh_name='fullmesh')#

Create callable that will apply a calculation to a scalar dataset.

Parameters:
  • plotter (open_viewmin.FilterTreePlot) –

  • scalar_field_name (str) – Name of scalar dataset

  • operation_string (“gradient” or “Laplacian”) – String key for calculation

  • mesh_name (str, optional) – Name of mesh from which to extract dataset

Return type:

callable()

open_viewmin.filter_tree_plot.utilities.calculations.calculate_from_tensor_field(plotter, tensor_field_name, operation_string, mesh_name='fullmesh')#

Create callable that will apply a calculation to a dataset of Hermitian, rank-2 tensors.

Parameters:
  • plotter (open_viewmin.FilterTreePlot) –

  • tensor_field_name (str) – Name of tensor dataset

  • operation_string ('eigvalsh' or 'eigh') – String key for calculation

  • mesh_name (str, optional) – Name of mesh from which to extract dataset

Return type:

callable()

open_viewmin.filter_tree_plot.utilities.calculations.calculate_from_two_vector_fields(plotter, vector_field1_name, vector_field2_name, operation_string, mesh_name='fullmesh')#
open_viewmin.filter_tree_plot.utilities.calculations.calculate_from_vector_field(plotter, vector_field_name, operation_string, mesh_name='fullmesh')#

Create callable that will apply a calculation to a vector dataset.

Parameters:
  • plotter (open_viewmin.FilterTreePlot) –

  • vector_field_name (str) – Name of vector dataset

  • operation_string (‘x’, ‘y’, ‘z’, ‘|x|’, ‘|y|’, ‘|z|’, ‘div’, or ‘curl’) – String key for calculation

  • mesh_name (str, optional) – Name of mesh from which to extract dataset

Return type:

callable()

open_viewmin.filter_tree_plot.utilities.calculations.di(arr, array_dims, flatten=False, component=None, data_stride=1)#

Gradient

open_viewmin.filter_tree_plot.utilities.calculations.dij(arr, array_dims, flatten=False, data_stride=1)#

Hessian

open_viewmin.filter_tree_plot.utilities.calculations.einstein_sum(sum_str, *arrays, reshape=True)#

Increase flexibility of numpy.einsum, for convenience in calculating datasets

open_viewmin.filter_tree_plot.utilities.calculations.list_to_xyzmat(arr, dims)#
open_viewmin.filter_tree_plot.utilities.calculations.matrix_times_transpose(arr)#
open_viewmin.filter_tree_plot.utilities.calculations.safe_inverse(arr)#

take inverse x->1/x but with 0->0

open_viewmin.filter_tree_plot.utilities.calculations.transpose_times_matrix(arr)#
open_viewmin.filter_tree_plot.utilities.calculations.xyzmat_to_list(arr)#
open_viewmin.filter_tree_plot.utilities.calculations.levi_civita#