Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Improved interpolation nodes for RT and N1curl elements. #52

Merged

Conversation

wence-
Copy link
Collaborator

@wence- wence- commented Jun 10, 2020

This is mostly work by @FabianL1908

Addresses #40.

@wence- wence- force-pushed the wence/feature/interpolation-nodes branch from d4b679a to 5278b42 Compare June 10, 2020 16:22
Copy link
Collaborator Author

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some drive-by comments.

FIAT/brezzi_douglas_marini.py Outdated Show resolved Hide resolved
FIAT/brezzi_douglas_marini.py Outdated Show resolved Hide resolved
FIAT/brezzi_douglas_marini.py Outdated Show resolved Hide resolved
FIAT/brezzi_douglas_marini.py Outdated Show resolved Hide resolved
FIAT/functional.py Show resolved Hide resolved
FIAT/functional.py Outdated Show resolved Hide resolved
FIAT/nedelec.py Outdated Show resolved Hide resolved
FIAT/nedelec_second_kind.py Show resolved Hide resolved
@rckirby
Copy link
Contributor

rckirby commented Jun 15, 2020

Is there a "pure FIAT"-level test we could devise that would test these new nodes are a thing?

FIAT/brezzi_douglas_marini.py Outdated Show resolved Hide resolved
FIAT/check_format_variant.py Outdated Show resolved Hide resolved
FIAT/check_format_variant.py Outdated Show resolved Hide resolved
FIAT/check_format_variant.py Outdated Show resolved Hide resolved
FIAT/nedelec.py Outdated Show resolved Hide resolved
FIAT/nedelec.py Outdated Show resolved Hide resolved
@wence-
Copy link
Collaborator Author

wence- commented Jun 26, 2020

@FabianL1908 I think the only outstanding question here is if we can test these elements in FIAT. We could add these variants to the test/unit/test_fiat.py file (since they continue to be nodal).

@FabianL1908
Copy link
Contributor

@wence- I added the tests for the new variants. They were actually helpful since helped me to spot a small bug. Do you think that are enough tests or do you have more in mind?

@wence-
Copy link
Collaborator Author

wence- commented Jun 29, 2020

Do you think that are enough tests or do you have more in mind?

Maybe check that the error-checking for specifying quadrature for the integral representation by hand that is too low works. Since the code is repeated, you only need to do it for one element I think.

You can do this by doing:

import pytest


def test_....():
   with pytest.raises(WhateverTheExceptionWas):
       MakeElement(cell, ..., variant="integral(degree-that-is-too-low)")

@FabianL1908
Copy link
Contributor

I have added the test for two elements, since the bound is slightly different for N1curl and N2curl.

FIAT/brezzi_douglas_marini.py Show resolved Hide resolved
FIAT/nedelec.py Show resolved Hide resolved
FIAT/raviart_thomas.py Show resolved Hide resolved
test/unit/test_fiat.py Show resolved Hide resolved
@wence- wence- force-pushed the wence/feature/interpolation-nodes branch 2 times, most recently from 9074289 to 5074ada Compare July 14, 2020 11:09
@wence-
Copy link
Collaborator Author

wence- commented Jul 14, 2020

I rebased and squashed things, and addressed the final comments. I think this is good to go.

Although the existing FIAT functionals are fine for tabulation and
hence normal finite element assembly, they under-integrate for the
purposes of interpolation. This results in sub-optimal convergence in
the H(div/curl) norm of the interpolation error, which should be (for
example)

   ||u - I_q u||_H(div, T) \le C h^q |u|_H^{q+1}(T)

for RTq elements.

To fix this, implement the dual basis using "textbook" integral moment
functionals (even on edges).

These functionals are selected by creating the element with an
appropriate variant string on construction.
@wence- wence- force-pushed the wence/feature/interpolation-nodes branch from 5074ada to 21b447d Compare July 14, 2020 11:13
@wence- wence- merged commit d9aac42 into FEniCS:master Jul 21, 2020
@wence- wence- deleted the wence/feature/interpolation-nodes branch July 21, 2020 11:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants