Hi Jean-Paul,

wow, thanks for the quick answer.
Your approach is really elegant. It should work in principle. 
I will try out to get around the FEFieldFunction and get back to this 
thread afterwards.


Best,
Andreas



Am Mittwoch, 28. September 2016 10:40:19 UTC+2 schrieb Jean-Paul Pelteret:
>
> Hi Andreas,
>
> I've had to do something similar in a different context. You could compute 
> the L2-projection of the solution gradient using VectorTools::project. 
> You'd need to define a new DoFHandler for the gradient components and 
> define a function that returns the value of the solution gradient at any 
> point using, for example, an FEFieldFunction. If you use FE_Q's for the 
> gradient solution components then the resulting gradient field will be 
> continuous as well. Depending on the problem size, this above may be a 
> (relatively) expensive to evaluate. If appropriate (and correct) you could 
> consider using a hp::DoFHandler and not assign gradient DoFs in the regions 
> away from the boundary. By manually implementing the projection problem 
> you'd be able to do away with the "rather slow" FEFieldFunction.
>
> I hope this helps,
> J-P
>
> On Wednesday, September 28, 2016 at 10:18:30 AM UTC+2, Andreas Krämer 
> wrote:
>>
>> Hi everybody,
>>
>> I am currently implementing a semi-Lagrangian advection solver in deal.II.
>>
>> Everything works fine in periodic domains, but now I want to define 
>> boundary conditions that depend on the gradient of the solution at the 
>> boundary.
>> When I use Lagrangian FE_Q elements, the gradients are discontinuous at 
>> cell interfaces, giving me a gradient that is non-unique at edges/vertices.
>>
>> Is there a way to obtain a unique gradient?
>>
>> Of course, I could work around this by taking the average gradient over 
>> all cells that contain the DoF, but 
>> (a) this seems like fudging and 
>> (b) I would need to iterate over all neighbors (and neighbors of 
>> neighbors) to calculate the gradients at a edge or vertex.
>>
>> Does anybody know a neater solution?
>> I noticed that cubic splines are implemented in 1D, but going to 2D seems 
>> cumbersome - and I would be probably running into (b), again.
>>
>> Thanks in advance.
>>
>> Best,
>> Andreas
>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to