romtools.hyper_reduction.deim#

Implementation of DEIM technique for hyper-reduction

Functions

deim_get_approximation_matrix(...)

Given a function basis \(\mathbf{U}\) and sample indices defining \(\mathbf{P}\), we compute

deim_get_indices(U[, comm])

Implementation of the discrete empirical method as described in Algorithm 1 of S.

deim_get_test_basis(test_basis, ...[, comm])

Given a test basis \(\mathbf{\Phi}\), a function basis \(\mathbf{U}\), and sample indices defining \(\mathbf{P}\), we compute

multi_state_deim_get_indices(U[, comm])

Version of DEIM for multi-state systems.

multi_state_deim_get_test_basis(test_basis, ...)

For multistate systems. Constructs an independent DEIM basis for each state variable using uniform sample indices :param test_basis: \((n_{var}, m, k)\) array, where \(n_{var}\) is the number of state variables, \(m\) is the number of DOFs and \(k\) is the number of basis functions. Test basis in projection scheme :param function_basis: \((n_{var}, m, n)\) array, where \(n_{var}\) is the number of state variables, \(m\) is the number of DOFs and \(n\) is the number of basis functions. Basis for function to be approximated. :param sample_indices: \((n_s, )\) array, where \(n_s\) is the number of sample points. Sampling points.

romtools.hyper_reduction.deim.deim_get_approximation_matrix(function_basis, sample_indices)[source]#

Given a function basis \(\mathbf{U}\) and sample indices defining \(\mathbf{P}\), we compute

\[\mathbf{U} \mathrm{pinv}( \mathbf{P}^T \mathbf{U})\]

which comprises the matrix needed for the DEIM approximation to \(\mathbf{f}\)

Parameters:
  • function_basis\((m, n)\) array, where \(m\) is the number of DOFs and \(n\) the number of basis functions. Basis for function to be approximated.

  • sample_indices\((n_s, )\) array, where \(n_s\) is the number of sample points. Sampling points.

Returns:

\((n, n_s)\) array. DEIM approximation basis

Return type:

deim_matrix

romtools.hyper_reduction.deim.deim_get_indices(U, comm=None)[source]#

Implementation of the discrete empirical method as described in Algorithm 1 of S. Chaturantabut and D. C. Sorensen, “Discrete Empirical Interpolation for nonlinear model reduction,” doi: 10.1109/CDC.2009.5400045.

:param \(\mathbf{U} \in \mathbb{R}^{m \times n}\): \(m\) is the number of DOFs and

\(n\) is the number of samples. Function basis in matrix format.

Parameters:
  • where\(m\) is the number of DOFs and \(n\) is the number of samples. Function basis in matrix format.

  • comm – Optional communicator object. If none, algorithm assumes shared-memory data.

Returns:

\(\mathrm{indices} \in \mathbb{I}^{n}\): sample mesh indices

else:

sample mesh local indices and the corresponding owing ranks

Return type:

if comm==None

romtools.hyper_reduction.deim.deim_get_test_basis(test_basis, function_basis, sample_indices, comm=None)[source]#

Given a test basis \(\mathbf{\Phi}\), a function basis \(\mathbf{U}\), and sample indices defining \(\mathbf{P}\), we compute

\[[ \mathbf{\Phi}^T \mathbf{U} \mathrm{pinv}( \mathbf{P}^T \mathbf{U}) ]^T\]

which comprises the “test basis” for the DEIM approximation for \(\mathbf{\Phi}^T \mathbf{f}\)

Parameters:
  • test_basis\((m, k)\) array, where \(m\) is the number of DOFs and \(k\) is the number of basis functions. Test basis in projection scheme

  • function_basis\((m, n)\) array, where \(m\) is the number of DOFs and \(n\) is the number of basis functions. Basis for function to be approximated.

  • sample_indices\((n_s, )\) array, where \(n_s\) is the number of sample points. Sampling points.

  • comm – Optional communicator object. If none, algorithm assumes shared-memory data.

Returns:

\((n_s, k)\) array, where

\(n_s\) is the number of sample points and \(k\) the number of basis functions. DEIM test basis matrix.

Return type:

deim_test_basis

romtools.hyper_reduction.deim.multi_state_deim_get_indices(U, comm=None)[source]#

Version of DEIM for multi-state systems.

We perform DEIM on each state variable, and then return the union of all indices. Repeated indices are removed.

:param \(\mathbf{U} \in \mathbb{R}^{l \times m \times n}\): \(l\) is the number of variables,

\(m\) is the number of DOFs and \(n\) the number of samples. Multi-dimensional function basis in tensor format.

Parameters:

where\(l\) is the number of variables, \(m\) is the number of DOFs and \(n\) the number of samples. Multi-dimensional function basis in tensor format.

Returns:

\(\mathrm{indices} \in \mathbb{I}^{n}\): sample mesh indices

else:

sample mesh local indices and the corresponding owing ranks

Return type:

if comm==None

romtools.hyper_reduction.deim.multi_state_deim_get_test_basis(test_basis, function_basis, sample_indices)[source]#

For multistate systems. Constructs an independent DEIM basis for each state variable using uniform sample indices :param test_basis: \((n_{var}, m, k)\) array, where

\(n_{var}\) is the number of state variables, \(m\) is the number of DOFs and \(k\) is the number of basis functions. Test basis in projection scheme

Parameters:
  • function_basis\((n_{var}, m, n)\) array, where \(n_{var}\) is the number of state variables, \(m\) is the number of DOFs and \(n\) is the number of basis functions. Basis for function to be approximated.

  • sample_indices\((n_s, )\) array, where \(n_s\) is the number of sample points. Sampling points.

Returns:

\((n_{var}, n_s, k)\) array, where

\(n_{var}\) is the number of state variables, \(n_s\) is the number of sample points, and \(k\) the number of basis functions. DEIM test basis matrix.

Return type:

deim_test_basis