Data postprocessing with two dof handlers

29 views
Skip to first unread message

Konrad Wiśniewski

unread,
Oct 1, 2019, 12:23:15 PM10/1/19
to deal.II User Group

 Hi! 


I'm looking for quick advise. In my calculations I solve two equations (in 2D) consecutively: the Poisson equation where I obtain electric field E, and then I solve the continuity equation where I obtain e.g. density of electrons n. I want to get current that is j = CnE where C is a constant (I need to use one variable from first and one from second equation). Problem is that in Poisson equation I've used Raviart-Thomas finite elements and in Continuity equation I've used discontinuous elements (FE_DGQ) and the position of dofs in this two methods do not coincide with each other (RT dofs are placed on the faces of a cell when DGQ on the vertexes). My question is: how do you wisely combine two dof handlers to produce a new variable which I want to visualize on the same mesh?

E.g: How to extrapolate the values from RT-elements to vertexes, then for each vertex calculate current j, and then add current variable to the solution in the way that I will be able to visualize it in paraview?


Bonus question: I'm not sure now but I may need to have two different triangulations in those equations, so even the cells will differ one from another (however the overall domain will remain the same). How should I deal with this situation?

Wolfgang Bangerth

unread,
Oct 1, 2019, 5:12:22 PM10/1/19
to dea...@googlegroups.com
On 10/1/19 10:23 AM, Konrad Wiśniewski wrote:
>
> I'm looking for quick advise. In my calculations I solve two equations (in 2D)
> consecutively: the Poisson equation where I obtain electric field *E*, and
> then I solve the continuity equation where I obtain e.g. density of electrons
> *n*. I want to get current that is *j* = C*nE* where C is a constant (I need
> to use one variable from first and one from second equation). Problem is that
> in Poisson equation I've used Raviart-Thomas finite elements and in Continuity
> equation I've used discontinuous elements (FE_DGQ) and the position of dofs in
> this two methods do not coincide with each other (RT dofs are placed on the
> faces of a cell when DGQ on the vertexes). My question is: how do you wisely
> combine two dof handlers to produce a new variable which I want to visualize
> on the same mesh?

The location of nodes for the two elements doesn't actually matter --
everything the DataOut class produces is located at the vertices of the cells.

When you say "combine", do you mean that you want to compute the derived
quantity using something like a DataPostprocessor? If that's the case, you'll
have to create a single DoFHandler that stores both fields (via an FESystem
that has both the FE_RT and the FE_DGQ element) and a single solution vector
that contains both components of the solution. You can then use a
DataPostprocessor.

On the other hand, if all you want to do is visualize both fields at the same
time, then the easiest may simply be to write the two solutions into their own
files, and load both files in Visit or Paraview.


> E.g: How to extrapolate the values from RT-elements to vertexes, then for each
> vertex calculate current *j*, and then add current variable to the solution in
> the way that I will be able to visualize it in paraview?

This sounds like you want to compute 'j' in a DataPostprocessor and just send
the result into a VTK file.


> Bonus question: I'm not sure now but I may need to have two different
> triangulations in those equations, so even the cells will differ one from
> another (however the overall domain will remain the same). How should I deal
> with this situation?

Output things into separate files and visualize them at the same time.

Best
W.


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

Reply all
Reply to author
Forward
0 new messages