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

C1 continuous functionspace (hermite) for interval and quad mesh in dolfinx #869

Open
bagla0 opened this issue Oct 25, 2024 · 2 comments
Open

Comments

@bagla0
Copy link

bagla0 commented Oct 25, 2024

dolfinx.fem.functionspace(mesh_r, basix.ufl.element(
    "HER", 'interval', 2, shape=(3, )))
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File /usr/lib/python3/dist-packages/basix/finite_element.py:903, in string_to_family(family, cell)
    902 try:
--> 903     return families[family]
    904 except KeyError:

KeyError: 'HER'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[6], line 1
----> 1 dolfinx.fem.functionspace(mesh_r, basix.ufl.element(
      2     "HER", 'interval', 2, shape=(3, )))

File /usr/lib/python3/dist-packages/basix/ufl.py:1988, in element(family, cell, degree, lagrange_variant, dpc_variant, discontinuous, shape, symmetry, dtype)
   1985     if family == "DPC":
   1986         discontinuous = True
-> 1988     family = _basix.finite_element.string_to_family(family, cell.name)
   1990 # Default variant choices
   1991 EF = _basix.ElementFamily

File /usr/lib/python3/dist-packages/basix/finite_element.py:905, in string_to_family(family, cell)
    903     return families[family]
    904 except KeyError:
--> 905     raise ValueError(f"Unknown element family: {family} with cell type {cell}")

ValueError: Unknown element family: HER with cell type interval

Similarly for quad mesh,

dolfinx.fem.functionspace(mesh, basix.ufl.element(
    "HER", 'quadrilateral', 2, shape=(3, )))
ValueError: Unknown element family: HER with cell type quadrilateral

I don't find any option to implement C1 continuity requirement for dolfinx. Can you provide a way to solve this issue which is available and tested?

@mscroggs
Copy link
Member

A Hermite Basix element can be created using basix.create_element but C1 continuous elements are not yet supported in FFCx so these will not work with DOLFINx

@bagla0
Copy link
Author

bagla0 commented Oct 25, 2024

Thanks @mscroggs for the quick response.

Is there any example or method available in dolfinx, where they solved this C1 requirement through an alternative way? My weak form contains second order derivative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants