bempp_cl.api.utils.helpers ========================== .. py:module:: bempp_cl.api.utils.helpers .. autoapi-nested-parse:: Various helper routines. Classes ------- .. autoapisummary:: bempp_cl.api.utils.helpers.TypeContainer bempp_cl.api.utils.helpers.MemProfiler Functions --------- .. autoapisummary:: bempp_cl.api.utils.helpers.create_unique_id bempp_cl.api.utils.helpers.align_array bempp_cl.api.utils.helpers.assign_parameters bempp_cl.api.utils.helpers.promote_to_double_precision bempp_cl.api.utils.helpers.serialise_list_of_lists bempp_cl.api.utils.helpers.get_type bempp_cl.api.utils.helpers.numba_decorate bempp_cl.api.utils.helpers.get_mass_matrix bempp_cl.api.utils.helpers.get_inverse_mass_matrix Module Contents --------------- .. 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:class:: TypeContainer Bases: :py:obj:`tuple` .. py:attribute:: real .. py:attribute:: complex .. py:attribute:: opencl .. 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:attribute:: _process .. py:attribute:: start :value: 0 .. py:attribute:: end :value: 0 .. py:attribute:: interval :value: 0 .. 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.