-
Notifications
You must be signed in to change notification settings - Fork 6
restructuring of Interpolators #30
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
Conversation
…iciently evaluated many times on subsets
|
Probably it is nicer if the interpolations are accessible via FESpace.interpolators[AT_NODES] instead of FESSpace[AT_NODES]? |
…now also used for interior Hdiv dofs, new FluxEvaluator evaluates normal/tangential fluxes for Hdiv/Hcurl boundary dofs)
…y NodalInterpolator and ensure_moments! by MomentInterpolator and many custom interpolatioon in non-H1 finite elements by a common new FunctionalInterpolator structure; now every finite element interpolation is a composition of these three interpolating structures
…ctionals in the FunctionInterpolator) that ensure that downstream tests work again
src/interpolators.jl
Outdated
| basis functions of the moments of type FEType_ref and with moments_operator. In the bestapprox mode | ||
| the mass matrix instead is formed from the scalar product of the interior basis functions. | ||
| """ | ||
| function MomentInterpolator(FE::FESpace{Tv, Ti, FEType, APT}, AT::Type{<:AssemblyType}, xgrid = FE.dofgrid; operator = Identity, FEType_ref = :auto, FEType_moments = :auto, moments_operator = operator, moments_dofs = Int[], bestapprox = false, order = 0, coffset::Int = -1, componentwise = true, kwargs...) where {Tv, Ti, FEType <: AbstractFiniteElement, APT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reformat to a vertical argument list
src/interpolators.jl
Outdated
| end | ||
|
|
||
| ## check if mass matrix can be computed once or needs to be recomputed on every mesh | ||
| if FEType_ref <: AbstractH1FiniteElement && !(FEType_ref <: AbstractH1FiniteElementWithCoefficients) && FEType_moments <: AbstractH1FiniteElement && moments_operator == Identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
| if FEType_ref <: AbstractH1FiniteElement && !(FEType_ref <: AbstractH1FiniteElementWithCoefficients) && FEType_moments <: AbstractH1FiniteElement && moments_operator == Identity | |
| if FEType_ref <: AbstractH1FiniteElement && | |
| !(FEType_ref <: AbstractH1FiniteElementWithCoefficients) && | |
| FEType_moments <: AbstractH1FiniteElement && | |
| moments_operator == Identity |
src/interpolators.jl
Outdated
| AT::Type{<:AssemblyType} = ON_FACES, | ||
| xgrid = FE.dofgrid; | ||
| bonus_quadorder = 0, | ||
| operator = NormalFlux, nfluxes = 0, dofs = [], mean = false, kwargs...) where {Tv, Ti, FEType <: AbstractFiniteElement, APT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistent vertical list
test/test_interpolators.jl
Outdated
| H1Pk{2, 2, 5}, | ||
| ] | ||
| ExpectedOrders2D = [0, 1, 0, 0, 1, 1, 1, 2, 2, 3, 4, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5] | ||
| ExpectedOrders2D = [0, 1, 0, 0, 1, 1, 1, 2, 2, 3, 4, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be replaced by an array of pairs [ FEspace => expected_order ] ... 😄
| println("error2 without kernel = $error2 (result = $result)") | ||
|
|
||
| return max(error1, error2) ≈ 0 | ||
| return max(error1, error2) < 1e-15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, approx 0 is just = 0.
Note that x ≈ 0 (i.e., comparing to zero with the default tolerances) is equivalent to x == 0
|
Please
|
goal: efficient evaluation of many calls of interpolation on subsets (like in periodic coupling matrix generation)
outcome: completely replaced old point_evaluation!, point_evaluation_broken! by NodalInterpolator and ensure_moments! by MomentInterpolator and many custom interpolatioon in non-H1 finite elements by a common new FunctionalInterpolator structure; now every finite element interpolation is a composition of these three
interpolating structures that should perform much better in the goal scenario, since they keep all necessary data to run an evaluation