On 5/30/19 9:06 AM, 'Maxi Miller' via deal.II User Group wrote: > 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?
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: bange...@colostate.edu www: http://www.math.colostate.edu/~bangerth/ -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c18480e7-aab9-53ab-1c28-53b68f890765%40colostate.edu. For more options, visit https://groups.google.com/d/optout.