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

Support for H(curl) and H(div) elements #569

Open
termi-official opened this issue Dec 21, 2022 · 1 comment · May be fixed by #798
Open

Support for H(curl) and H(div) elements #569

termi-official opened this issue Dec 21, 2022 · 1 comment · May be fixed by #798

Comments

@termi-official
Copy link
Member

termi-official commented Dec 21, 2022

I just open an issue on this, because it came up again on slack and I think we should keep track of this.

Currently it is not straight forward to implement H(curl) or H(div) elements, but it is a feature that is asked for rather often. Canonical examples are Nedelec (for H(curl)) and Raviart-Thomas (for H(div)). To support these elements, I think there are two assumptions made in the code that have to be investigated.

  1. I think it is assumed that one of the "dim" parameters controls the vector length for the evaluated, while for the actual evaluation of basis functions on a reference element is seems to be assumed that a scalar is returned (
    for comp in 1:dim
    N_comp = zeros(T, dim)
    N_comp[comp] = N_temp
    N[basefunc_count, qp] = Vec{dim,T}((N_comp...,))
    dN_comp = zeros(T, dim, dim)
    dN_comp[comp, :] = dNdξ_temp
    dNdξ[basefunc_count, qp] = Tensor{2,dim,T}((dN_comp...,))
    basefunc_count += 1
    end
    ). This is also reflected in the dof distribution (e.g. here
    for d in 1:dh.field_dims[fi]
    @debug println(" adding dof#$nextdof")
    push!(dh.cell_dofs, nextdof)
    nextdof += 1
    end
    ), which leads to the wrong number of dofs for the mentioned elements.
  2. The mapping of basis functions is "broken" for such elements. They require special Piola mappings to conserve special properties (see e.g. https://defelement.com/ciarlet.html). We should be able to fix this rather easily by equipping each interpolation with a trait, which dispatches to the correct mapping if the basis function is evaluated. The trait system will also be useful for more exotic problems, as for example when the problem itself is matrix valued.

To test these we can add two new examples. One for the curl-curl problem from electromagnetics and one for the mixed Poisson problem, such that we also cover how to implement discontinuous Galerkin methods. Please note that the later is a bit more problematic, because we do not have a good framework to operate on interior faces yet.

@termi-official
Copy link
Member Author

In https://github.com/juhanikataja/afemproblem/blob/main/runme.jl is a prototype for a RT element which can help in designing a better interface.

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

Successfully merging a pull request may close this issue.

1 participant