Accessing cells from a shared face for DG

64 views
Skip to first unread message

Nectarios

unread,
Feb 20, 2016, 1:11:33 PM2/20/16
to deal.II User Group
Dear all,

I am trying to assemble the Laplace matrix for the Symmetric Interior Penalty DG method as in step-39 without the aid of meshworker.

I want to be able to use the functions in the existing "includes/integrators/laplace.h" header file. I have no issue when looping over cells in assembling the Dirichlet form by calling the "cell_matrix" function but when trying to loop over the interior faces to call the "ip_matrix" function I need to know the finite element values on the cells that share that face.

I am wondering if in deal ii there is the capability from an interior face to access those two cells  . Also it will be good to be able to distinguish which of the two cells is the one that the normal vector to the face is emanating from (e.g. K+). I searched the documentation (geometry info) but wasn't able to find something.  

The reason I need this is because I prefer to loop separately over cells, interior faces and boundary faces when I assemble my matrices just like meshworker does in Step-39.  

Thank you very much.

Nectarios
Message has been deleted

Daniel Arndt

unread,
Feb 20, 2016, 7:40:30 PM2/20/16
to deal.II User Group
Dear Nectarios,

you can take a look at an old version of step-12
https://www.dealii.org/6.1.0/doxygen/deal.II/step_12.html
before MeshWorker is used there.
What you basically do for the inner edges is to use two FEFaceValues objects for the cell and its neighbor. After initializing the first FEFaceValues object on the cell you are on you need to find the correct face on the neighbor cell and initialize the second FEFaceValues object. Of course, there are lots of different cases that you need to tale into account if the cells are differently refined.

Best,
Daniel

Nectarios Papanicolaou

unread,
Feb 21, 2016, 8:23:56 AM2/21/16
to dea...@googlegroups.com
Dear Daniel,

Thank you very much for quick reply and help. What I want to be able to do is access the cells sharing a particular face while looping over the entire interior face list meaning that at that moment I am not on a cell. 

Sorry if I didn't phrase my question that clearly in my previous post but this is what I would like to know:

"Does a face know which cells share it e.g. face->K+ face->k-.? Is this information built in the geometry of the mesh?"

Once again, many thanks.

Best,

Nectarios

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/4ll9rpM1Zto/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wolfgang Bangerth

unread,
Feb 21, 2016, 9:59:57 AM2/21/16
to dea...@googlegroups.com
On 02/21/2016 07:23 AM, Nectarios Papanicolaou wrote:
>
> "Does a face know which cells share it e.g. face->K+ face->k-.? Is this
> information built in the geometry of the mesh?"

No. You can only ever go from higher dimensional objects to lower dimensional
objects, e.g., cells->faces, faces->vertices, but not the other way around.

In all cases I've seen over the past 15 years, it was always easily possible
to restructure an algorithm so that it is written as a loop over all cells,
and then did something on the faces of these cells (or edges, or vertices).
This is definitely the way to go.

Best
W.

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

Nectarios Papanicolaou

unread,
Feb 21, 2016, 10:37:12 AM2/21/16
to dea...@googlegroups.com
Dear Wolfgang

Thank you very much for your swift reply. It is indeed possible to restructure my code like the old step-12 or the current step-30 but it would have been more convenient in the context of my current application to do it the way I described in my post. I will of course follow your advice.

Once again, many thanks for your valuable help.

Best Regards.

Nectarios

David Wells

unread,
Feb 21, 2016, 6:03:11 PM2/21/16
to deal.II User Group
Hi Nectarios,

A while back I make my own version of step-12, also without MeshWorker. I put it online at

https://github.com/drwells/dealii-step-12a

You might find it useful to look at.

Thanks,
David Wells

Wolfgang Bangerth

unread,
Feb 21, 2016, 6:09:35 PM2/21/16
to dea...@googlegroups.com
On 02/21/2016 05:03 PM, David Wells wrote:
>
> A while back I make my own version of step-12, also without MeshWorker. I put
> it online at
>
> https://github.com/drwells/dealii-step-12a
>
> You might find it useful to look at.

I've been asked about something like this so many times that it might actually
be worthwhile reviving a version of step-12 without MeshWorker into a tutorial
program of its own.

What I keep hearing from those who ask for it is that MeshWorker is great when
assembling linear systems for "simple" problems, but that it turns out to be
exceedingly difficult to pass information down for more complicated problems
-- e.g., if a problem is nonlinear and needs to evaluate a previous solution,
or a solution from a different mesh, or a different DoFHandler.

I'm not familiar with MeshWorker, so I don't have great insight into whether
these comments are correct. But I keep hearing them, and we have nobody left
on the mailing list who could provide the answers to questions, or the
necessary documentation, to improve the situation.

So, David, if you wanted to submit this program as a tutorial, then I would
see value in it.

David Wells

unread,
Feb 21, 2016, 9:29:59 PM2/21/16
to deal.II User Group
Yes, I would be willing to do this, but it will probably have to wait until the end of the semester. Perhaps it could be the new step-19.

Thanks,
David Wells

Wolfgang Bangerth

unread,
Feb 21, 2016, 9:38:16 PM2/21/16
to dea...@googlegroups.com
On 02/21/2016 08:29 PM, David Wells wrote:
> Yes, I would be willing to do this, but it will probably have to wait until
> the end of the semester. Perhaps it could be the new step-19.

Yes, step-19 is already on the chopping block:
https://github.com/dealii/dealii/issues/2046
:-)

Nectarios Papanicolaou

unread,
Feb 22, 2016, 11:19:06 AM2/22/16
to dea...@googlegroups.com
Hi David,

Thanks a lot for your help. Really appreciate it.

Best,

Nectarios

--

David Wells

unread,
Feb 22, 2016, 6:57:16 PM2/22/16
to deal.II User Group
Nectarios,

Glad to help. Let me know if you have any questions on my work.


Thanks,
David Wells

On Saturday, February 20, 2016 at 1:11:33 PM UTC-5, Nectarios wrote:
Reply all
Reply to author
Forward
0 new messages