This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Clarification on periodic boundary conditions (meshes with non-matching vertices and details of the map() method)

+2 votes

I have a few general questions on how to set up periodic boundary conditions. (I hope it is ok to post these together in a single question in this forum; otherwise I'm happy to ask them separately.)

Let's assume I have a rectangular domain represented by an irregular mesh and I'd like to apply PBCs in x-direction, i.e. identify the left and right sides of the domain. However, due to the irregularity of the mesh there is no exact correspondence between the vertices on the left boundary and those on the right boundary. From looking at the Poisson demo with PBCs this does not seem to matter. However, the answer to this question seems to imply that such a correspondence must exist. So my first question is: do I need to take care that mesh vertices on the periodic boundaries match up? Or is dolfin clever enough to deal with general meshes?

Secondly, which cases does the map() method of my PeriodicBoundary class need to cover? In particular, for which vertices will it be called? I would have thought that it is only called for the vertices on the boundary that are to be identified with the other side (e.g. the vertices on the right bounday in the rectangular domain). However, adding print statements to my map() function shows that it is called for many more vertices, including ones that lie inside the domain. So my second question is: what should those points be mapped to? In the answer to this question there are two examples, where the first one shows a mapping to some invalid values (here: -1000) whereas the second one doesn't even cover that case. So I'm a bit confused what needs to be mapped and where. Any clarification would be much appreciated. Many thanks!

asked Jun 14, 2014 by Maximilian Albert FEniCS User (1,750 points)

1 Answer

0 votes
 
Best answer

The vertices on periodic boundaries need to match up.

The map for periodic boundary conditions needs to match facets (checked using the midpoint). This should would fine for polygons. It can lead to problems when approximating other shapes where you want to constrain dofs to each other.

answered Jun 23, 2014 by Garth N. Wells FEniCS Expert (35,930 points)
selected Jun 24, 2014 by Maximilian Albert

Many thanks Garth!

...