Storing additional information at the DOF unrelated to the system you are solving

30 views
Skip to first unread message

Bruno Blais

unread,
Jun 29, 2019, 12:04:47 PM6/29/19
to deal.II User Group
Hello everyone, I hope you are well.
I have a quick question which I cannot seem to wrap my hear around. I think it will sound confused, but anyway.
Let's say I am solving for a scalar equation. I would have a triangulation, then a DoFHandler and a FESystem with a multiplicity of one.
I can loop over the cells and assemble my equations.

Now, let's say I wanted to have an additional property that would be  a vector defined at the nodes of my triangulation using the positions of the nodes.
However, this vector would not be used to be interpolated at the gauss points, but would be use to cut the cells and do other geometric manipulations.
I could define another DoFHandler , and FESystem, but then when I loop over the cells, there would be nothing to make sure that my DOF on both equations are numbered in the same way.
However, I cannot defined another vector using the FESystem of my scalar equation, because the multiplicity is not the same.
What would be the best way to proceed?

TLDR: I would like to store additional information at the position of the DOFs, without including them in my vector of unknown, but I would still want to be able to know their position.
Is this doable?
Thanks!
Bruno


Daniel Arndt

unread,
Jun 29, 2019, 1:54:03 PM6/29/19
to deal.II User Group
Bruno,


Hello everyone, I hope you are well.
I have a quick question which I cannot seem to wrap my hear around. I think it will sound confused, but anyway.
Let's say I am solving for a scalar equation. I would have a triangulation, then a DoFHandler and a FESystem with a multiplicity of one.
I can loop over the cells and assemble my equations.
If you only have a scalar equation, there is no need to use FESystem but you can do that of course.
 
Now, let's say I wanted to have an additional property that would be  a vector defined at the nodes of my triangulation using the positions of the nodes.
However, this vector would not be used to be interpolated at the gauss points, but would be use to cut the cells and do other geometric manipulations.
I could define another DoFHandler , and FESystem, but then when I loop over the cells, there would be nothing to make sure that my DOF on both equations are numbered in the same way.
However, I cannot defined another vector using the FESystem of my scalar equation, because the multiplicity is not the same.
What would be the best way to proceed?
I am not quite sure to understand what you are asking for. The support points only coincide for FE_Q(1) elements with the nodes of the triangulation.
Normally, you would associate the entries of a Vector with the finite element vector defined by the degrees of freedom (and the ansatz space), but you can also store different information.
You are talking about two equations. What is the second equation and how is it related to the first one? Can you give an example how you want to use the Vectors?

Best,
Daniel

Bruno Blais

unread,
Jul 1, 2019, 7:40:52 AM7/1/19
to deal.II User Group
Dear Daniel,
I am sorry, my question truly was unclear.
Let's say I solve a first equation for Velocity, and I would like to use this velocity in another equation for advection-diffusion of say Temperature.
I would first set-up my DOF and FE system for my velocity equation and solve it and set-up by DOF and FE system for my Temperature.
However, how would I be able to set up an additional space to store my velocity at the nodes that are related to my Temperature FESystem without introducing additional unknown in my  temperature equations (Since velocity is known after all) and without assuming that both my temperature and velocity equation are numbered in the same exact fashion? 

Best
Bruno

Daniel Arndt

unread,
Jul 1, 2019, 8:52:46 AM7/1/19
to deal.II User Group
Bruno.

Let's say I solve a first equation for Velocity, and I would like to use this velocity in another equation for advection-diffusion of say Temperature.
I would first set-up my DOF and FE system for my velocity equation and solve it and set-up by DOF and FE system for my Temperature.
However, how would I be able to set up an additional space to store my velocity at the nodes that are related to my Temperature FESystem without introducing additional unknown in my  temperature equations (Since velocity is known after all) and without assuming that both my temperature and velocity equation are numbered in the same exact fashion? 

For assemling a bilinear form you typically don't nees the support points of the ansatz functions but their evaluations in the quadrature points.
In your case, I would simply use two DoFHandler objects (one for each system of equations) and loop over both of them for the temperature equations.

Best,
Daniel

Bruno Blais

unread,
Jul 1, 2019, 11:14:32 AM7/1/19
to deal.II User Group
Dear Daniel,
I understand, it perfectly makes sense.
I had not thought about using two different FEValues when looping over the cells.
Thank you very much!
Best
Bruno

Wolfgang Bangerth

unread,
Jul 1, 2019, 11:26:36 AM7/1/19
to dea...@googlegroups.com, Bruno Blais

Bruno,
another option is to just pack all of your variables into one FESystem and
DoFHandler, and solve the linear systems related to each variable one at a
time. That's basically the difference between step-31 and step-32: The former
has two DoFHandlers, one for the flow variables and one for the temperature,
and builds linear systems corresponding to each DoFHandler; on the other hand,
step-32 has only one DoFHandler that deals with *all* variables (velocity,
pressure, temperature), but when it comes time to build and solve linear
systems, it does so for only a subset of the variables.

Specifically, in the case of step-32, we set up a 3x3 block system matrix, and
when we build/solve the linear system for the flow problem, we just look at
the top left 2x2 set of blocks, whereas when we do the temperature problem, we
only look at the bottom right block of the matrix.

This approach can easily also deal with variables for which you don't want to
solve anything at all: You just add them to the FESystem and DoFHandler, but
when you set up the matrix, you just leave the corresponding matrix blocks
empty. You'll just have to come up with a different way of getting information
into the corresponding blocks of the solution vector.

Best
W.

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

Reply all
Reply to author
Forward
0 new messages