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

WIP: New vector interpolations and mappings #798

Draft
wants to merge 168 commits into
base: master
Choose a base branch
from

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Sep 23, 2023

Implements Hcurl (Nedelec) and Hdiv (RaviartThomas and BrezziDouglasMarini) interpolations and the associated mappings.

To ensure that the infrastructure works well, I would aim to have the following here

  • Tests for H(div) and H(curl) on reference element
  • Continuity testing for mapped H(div) and H(curl)
  • Test Dirichlet BC for all interpolations
  • Tutorial with H(div) elements: preview
  • Tutorial with H(curl) elements preview
  • Test reinit without gradients

Possible tutorials/validations

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2023

Codecov Report

Attention: Patch coverage is 85.78947% with 27 lines in your changes missing coverage. Please review.

Project coverage is 92.36%. Comparing base (5153307) to head (f5f3f97).

Files with missing lines Patch % Lines
src/FEValues/FunctionValues.jl 65.30% 17 Missing ⚠️
src/interpolations.jl 92.36% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #798      +/-   ##
==========================================
- Coverage   93.57%   92.36%   -1.22%     
==========================================
  Files          39       39              
  Lines        6071     6259     +188     
==========================================
+ Hits         5681     5781     +100     
- Misses        390      478      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

docs/src/devdocs/mapping.md Outdated Show resolved Hide resolved
function reference_shape_value(ip::RaviartThomas{2, RefTriangle, 2}, ξ::Vec{2}, i::Int)
x, y = ξ
# Face 1 (keep ordering, flip sign)
i == 1 && return Vec(4x * (2x - 1), 2y * (4x - 1)) / 2
Copy link
Member Author

Choose a reason for hiding this comment

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

The division by 2 compared to defelement gives an identity for the line integral of 1/num_edge_dofs, such that setting the actual dof-values to 1 results in a unit flux. @termi-official: Do you see any issues by scaling the shape functions like this?

Copy link
Member Author

@KnutAM KnutAM Nov 22, 2024

Choose a reason for hiding this comment

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

The advantage is that this way, we don't have to do strange modifications to the values when applying boundary conditions in _update!, only checking the sign of the edge/facet.
See also tests at the end of test_interpolations.jl

Comment on lines +269 to +277
# Required properties of shape value Nⱼ of an edge-elements (Hcurl) on an edge with direction v, length L, and dofs ∈ 𝔇
# 1) Unit property: ∫(Nⱼ ⋅ v f(s) dS) = 1/length(𝔇) ∀ ∈ 𝔇
# Must hold for
# length(𝔇) ≥ 1: f(s) = 1
# length(𝔇) = 2: f(s) = 1 - s or f(s) = s for 1st and 2nd dof, respectively.
# Additionally, should be zero for
# length(𝔇) = 2: f(s) = s or f(s) = 1 - s for 1st and 2nd dof, respectively.
# s is the path parameter ∈[0,1] along the positive direction of the path.
# 2) Zero along other edges: Nⱼ ⋅ v = 0 if j∉𝔇
Copy link
Member Author

Choose a reason for hiding this comment

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

Associated test definitions for comment above for Hcurl

Comment on lines +314 to +322
# Required properties of shape value Nⱼ of an edge-elements (Hdiv) on an edge with normal n, length L, and dofs ∈ 𝔇
# 1) Unit property: ∫(Nⱼ ⋅ n f(s) dS) = 1/length(𝔇) ∀ j ∈ 𝔇
# Must hold for
# length(𝔇) ≥ 1: f(s) = 1
# length(𝔇) = 2: f(s) = 1 - s or f(s) = s for 1st and 2nd dof, respectively.
# Additionally, should be zero for
# length(𝔇) = 2: f(s) = s or f(s) = 1 - s for 1st and 2nd dof, respectively.
# s is the path parameter ∈[0,1] along the positive direction of the path.
# 2) Zero normal component on other edges: Nⱼ ⋅ n = 0 if j∉𝔇
Copy link
Member Author

Choose a reason for hiding this comment

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

Associated test definitions for comment above for Hdiv

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

Successfully merging this pull request may close these issues.

Support for H(curl) and H(div) elements
5 participants