Interpolation between FE_Q- and FE_Bernstein elements

23 views
Skip to first unread message

Maxi Miller

unread,
May 30, 2019, 11:06:03 AM5/30/19
to deal.II User Group
I wanted to write some functions to convert my solution from using FE_Q-elements to FE_Bernstein-elements (and back). For that I wrote two functions, convert_feQ_to_feB() and convert_feB_to_feQ() (as listed in the attachment). When converting from FE_Q-elements to FE_Bernstein-elements, I get the same values for input and output, but on the way back I get wrong values (currently I am just using a vector filled with the value 1), but I can not find the reason why the conversion back is failing. Did I forget something in the corresponding function?
Thanks!
main.cpp

Wolfgang Bangerth

unread,
May 30, 2019, 1:00:02 PM5/30/19
to dea...@googlegroups.com
I have to admit that I don't have the time right now to look at your code, but
it's really just an interpolation problem to go from FE_B to FE_Q: you need to
evaluate each shape function of the FE_B at the interpolation (=support)
points of the FE_Q. This gives you a cell-local matrix of the form
B_{ij} = \varphi_{Bernstein,j)(x_{j,Q})
(or with indices reversed -- check with the documentation).

By the way, the place to implement this is in the
FE_Q_Base::get_interpolation_matrix() function for B -> Q (see
source/fe/fe_base.cc around line 500), and maybe
FE_Q_Bernstein::get_interpolation_matrix() if you come up with a clever way to
define the operation. I know that the latter function says that you can't do
it, but I suspect that if you at least define it in a way so that the
interpolation of a function onto itself is the identity operation, and if the
interpolation of a FE_Q function onto FE_Bernstein yields the same, continuous
function, then it might still go into that place.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Maxi Miller

unread,
May 30, 2019, 4:25:59 PM5/30/19
to deal.II User Group
That means that I don't have to create that matrix myself, but rather use the matrix I get from FE_Q_*::get_interpolation_matrix()? 
The most interesting bug my code has at the moment is:
Q(a)->B(b): I get identical vectors, i.e. a == b
B(b)->Q(a): Vectors are not identical anymore, a != b
Q(a)->B(b): Even though that worked in the first round, it does not in the second, a != b
I do not understand that behavior yet.

Maxi Miller

unread,
May 30, 2019, 4:32:45 PM5/30/19
to deal.II User Group
On a second test I found out that by resetting the out-vector to 0 I get the expected output, regardless of direction. Does that make sense?
main.cpp
Reply all
Reply to author
Forward
0 new messages