genericROM.BasicAlgorithms.NNOMPA module

CallOptimizer(integrands_s, integrals, max_iter=None)[source]

Exemple of scipy optimizer wrapper (here lsq_linear)

Parameters:
  • integrands_s (array_like, sparse matrix of LinearOperator, shape (m, n)) – Design matrix. Can be scipy.sparse.linalg.LinearOperator.

  • integrals (array_like, shape (m,)) – Target vector.

  • max_iter (None or int, optional) – Maximum number of iterations before termination. If None (default), it is set to the number of variables for method='bvls'.

Returns:

res – see the class scipy.optimize.OptimizeResult

Return type:

OptimizeResult

NNOMPA(integrationWeights, integrands, integrals, normIntegrals, tolerance, reducedIntegrationPointsInitSet, maxIter=10000, nRandom=1)[source]

NonNegative Othogonal Matching Pursuit Algorithm [1]. Modified with possibility to add random integration points.

Parameters:
  • integrationWeights (np.ndarray) – of size (numberOfIntegrationPoints,), dtype = float. Weights of the truth quadrature

  • integrands (np.ndarray) – of size (numberOfIntegrands,numberOfIntegrationPoints), dtype = float. Functions we look to integrated accurately with fewer integration points. Usually, the integrands are already reduced, and numberOfIntegrands is the product of the number of reduced integrand modes and the number of modes of the ReducedOrderBasis

  • integrals (np.ndarray) – of size (numberOfIntegrands,), dtype = float. High-fidelity integral computed using the truth integration scheme

  • normIntegrals (float) – np.linalg.norm(integrals), already computed in mordicus use

  • tolerance (float) – upper bound for the accuracy of the reduced integration scheme on the provided integrands

  • reducedIntegrationPointsInitSet (np.ndarray) – of size (numberOfInitReducedIntegratonPoints,), dtype = int. Initial guess for the indices of the reducedIntegrationScheme (can be empty)

  • maxIter (int, optional) – Maximum iteration for the matching pursuit algorithm

  • nRandom (int, optional) – number of random points added at each iteration

Returns:

  • np.ndarray of size (numberOfReducedIntegrationPoints,), dtype = int – indices of the kepts integration points (reducedIntegrationPoints)

  • np.ndarray of size (numberOfReducedIntegrationPoints,), dtype = float – weights associated to the kepts integration points (reducedIntegrationWeights)

References

[1] J. Hernandez, M.A. Caicedo-Silva and A.F. Ferre. Dimensional hyper- reduction of nonlinear finite element models via empirical cubature, 2016. URL: https://www.researchgate.net/publication/309323670_Dimensional_hyp er-reduction_of_nonlinear_finite_element_models_via_empirical_cubature.