:py:mod:`bempp.api.utils.helpers` ================================= .. py:module:: bempp.api.utils.helpers .. autoapi-nested-parse:: Various helper routines. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: bempp.api.utils.helpers.MemProfiler Functions ~~~~~~~~~ .. autoapisummary:: bempp.api.utils.helpers.create_unique_id bempp.api.utils.helpers.align_array bempp.api.utils.helpers.assign_parameters bempp.api.utils.helpers.promote_to_double_precision bempp.api.utils.helpers.serialise_list_of_lists bempp.api.utils.helpers.get_type bempp.api.utils.helpers.numba_decorate bempp.api.utils.helpers.get_mass_matrix bempp.api.utils.helpers.get_inverse_mass_matrix Attributes ~~~~~~~~~~ .. autoapisummary:: bempp.api.utils.helpers.TypeContainer .. py:function:: create_unique_id() Create a unique id. .. py:function:: align_array(arr, dtype, order) Make sure that an array is contiguous and aligned with the right type. If order='F' use Fortran order. If order='C' use C order. .. py:function:: assign_parameters(parameters) Assign a parameter object based on input. If parameters is None return the global_parameters object. Otherwise, return the parameters object again. .. py:function:: promote_to_double_precision(array) Convert an array to real or complex double precision. .. py:function:: serialise_list_of_lists(array) Serialise a list of lists (or other iterable). Returns a tuple (new_array, index_ptr), such that array[j] = new_array[index_ptr[j] : index_ptr[j + 1]] .. py:data:: TypeContainer .. py:function:: get_type(precision) Return a TypeContainer depending on the given precision. .. py:class:: MemProfiler Context manager to measure mem usage in bytes. .. py:method:: __enter__() Enter. .. py:method:: __exit__(*args) Exit. .. py:function:: numba_decorate(fun) Decorate a function for Numba. .. py:function:: get_mass_matrix(domain, dual_to_range) Directly get a mass matrix. Frequently, operations need a discrete mass matrix. This method provides it and if possible uses the mass matrix attribute from the corresponding function space in order to allow quick caching. .. py:function:: get_inverse_mass_matrix(domain, dual_to_range) Quickly get an inverse mass matrix operator. Uses the cached version from a function space if possible.