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 198 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 homogeneous Dirichlet BC for all interpolations
  • Tutorial with H(div) elements: preview
  • Tutorial with H(curl) elements preview

Finalization plan

The diff is too large for effective review, so this PR should not be merged, but I will split it into several smaller PRs.

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2023

Codecov Report

Attention: Patch coverage is 65.16854% with 155 lines in your changes missing coverage. Please review.

Project coverage is 89.35%. Comparing base (5f20e7b) to head (5845077).

Files with missing lines Patch % Lines
src/FEValues/EdgeValues.jl 0.00% 78 Missing ⚠️
src/Quadrature/quadrature.jl 4.16% 23 Missing ⚠️
src/FEValues/boundary_integrals.jl 88.88% 22 Missing ⚠️
src/FEValues/BoundaryValues.jl 0.00% 21 Missing ⚠️
src/Dofs/ConstraintHandler.jl 92.62% 9 Missing ⚠️
src/interpolations.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #798       +/-   ##
===========================================
+ Coverage    0.00%   89.35%   +89.35%     
===========================================
  Files          39       42        +3     
  Lines        6152     6681      +529     
===========================================
+ Hits            0     5970     +5970     
+ Misses       6152      711     -5441     

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

Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to add some comments about the De-Rahm complex here for readers not familiar with the topic.

KnutAM added a commit to KnutAM/FerriteAssembly.jl that referenced this pull request Jan 20, 2025
@@ -9,9 +9,9 @@ solution for a Maxwell problem, when vectorized `Lagrange` interpolations conver

![Results for different discretizations](maxwell.png)

**Figure 1**: The results of this tutorial, showing how the analytical solution is not found when discretizing
**Figure 1**: The results of this tutorial, showing how the exact solution is not found when discretizing
Copy link
Member

Choose a reason for hiding this comment

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

Stylistic detail, but maybe we can get rid of the negation here. Maybe something like:

Suggested change
**Figure 1**: The results of this tutorial, showing how the exact solution is not found when discretizing
**Figure 1**: The results of this tutorial, showing how the approximation converges to the wrong solution when discretizing

@@ -219,28 +213,28 @@ function create_data(tr::Triangulation, fieldname::Symbol, a; f = identity)
return data
end

# ## Analytical implementation
# ## Exact implementation
Copy link
Member

Choose a reason for hiding this comment

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

Stylistic again, but exact implementation does sound off.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but it would be good to highlight that this refers to a chosen solution, not an analytical solution to an existing problem. But I'm not used to working with such "reverse" problems, so perhaps that is still conventionally called "analytical"?

Copy link
Member Author

Choose a reason for hiding this comment

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

And btw, I'll open a separate PR with the tutorials in a while.
Working on separating out the functionality changes. Just keeping this branch including all just to avoid missing anything...

Copy link
Member

Choose a reason for hiding this comment

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

You mean manufactured solution?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's different, because it is one solution that fulfills the pde, exactly so no source terms are added. The influence comes from the boundary terms...

In https://doi.org/10.1016/j.compstruc.2019.106175 they mention also "Method of exact solutions" but couldn't find any ref or explanation to this...

Copy link
Member

Choose a reason for hiding this comment

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

Ohh, I see. I found an explanation for this term here https://onlinelibrary.wiley.com/doi/pdf/10.1002/fld.660 in 3.1. So essentially we are looking for analytical solutions for corner cases of the PDE.

Copy link
Member Author

@KnutAM KnutAM Feb 6, 2025

Choose a reason for hiding this comment

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

Thanks for that paper that defines it. The statement,

In the method of exact solutions, specialized cases are identied where exact solutions
exist to a given set of governing equations. For the Euler and Navier–Stokes sets of 
equations, there are only a limited number of exact solutions. Furthermore, these 
exact solutions may not exercise all of the terms in the governing equations. For
two infnite parallel plates, one moving relative to the other (Couette flow), the 
velocity profile is linear, hence the diffusion term, a second derivative of velocity, 
is identically zero and therefore would not be fully exercised.

I guess somewhat in that direction, but here we only (as I understood the reference page) choose some field fulfilling the pde without a source term, but the boundary conditions are found by evaluating the resulting reaction loads/boundary constraints. Hence we don't find an exact/analytical solution to a simplified problem.

But since it is an exact fulfillment of the PDE, but not of the problem, I think exact makes sense. However, the header is still not good, probably better to have "Implementation of the exact solution" (or just "Exact solution").

KnutAM added a commit that referenced this pull request Feb 6, 2025
KnutAM added a commit that referenced this pull request Feb 13, 2025
KnutAM added a commit that referenced this pull request Feb 14, 2025
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