Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mfem.jit extension #159

Merged
merged 57 commits into from
Jan 4, 2023
Merged

mfem.jit extension #159

merged 57 commits into from
Jan 4, 2023

Conversation

sshiraiwa
Copy link
Member

@sshiraiwa sshiraiwa commented Dec 16, 2022

This PR expands mfem.jit feature to generate Numba-JIT compiled coefficient. It includes

  1. dependency : creates a coefficient which depends on other coefficient
  2. time-dependence.
  3. more user-friendly parameter passing: JIT function is passed a numpy-like array instead
    of pointer. Thus it is not necessary to call carray/farray inside a user function.
  4. complex number: creates a pair of coefficients which returns real and imaginary part

(usage)
sdim = mesh.SpaceDimension()
@scalar(td=False, params={}, complex=False, dependency=None, interface='simple',
debug=False)
@vector(shape=None, td=False, params={}, complex=False, dependency=None,
interface='simple', debug=False)
@matrix(shape=None, td=False, params={}, complex=False, dependency=None,
interface='simple', debug=False)

shape: shape of return value
td: time-dependence (False: stationary, True: time-dependent
complex: complex coefficient
depenency: dependency to other coefficient
interface: calling proceture
'simple': vector/matric function returns the result by value more pythonic (this is the default behavior)
'c++': vector/matric function returns the result by parameter like C++
other options: one can pass a tuple of (caller, signature) pair to create a custom
interface
debug: extra debug print

TODO:

  • Update README
  • Update Examples

@sshiraiwa sshiraiwa added the in-test-with-mfem-master trigger a workflow to test using MFEM master label Jan 3, 2023
@sshiraiwa
Copy link
Member Author

Merging this to mfem_45_dev to test

@sshiraiwa sshiraiwa merged commit 6462c36 into mfem_45_dev Jan 4, 2023
@sshiraiwa sshiraiwa deleted the numba_jit_extension_dev branch January 4, 2023 19:26
@sshiraiwa sshiraiwa restored the numba_jit_extension_dev branch January 4, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in-test-with-mfem-master trigger a workflow to test using MFEM master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant