Attached, there is a script which defines a periodic cube of length L and a structured cube mesh (Joachim posted this somewhere in the forum).
However, I cannot transfer the periodicity to the cube mesh.
This problem is already in 2D. I generally do not know how to tell a manually generated mesh that it should have periodic facetsâŚ
The only thing you do have to do is to set the vertex identification for all your periodic points. This is done by the function mesh.AddPointIdentification. It takes the point identifications of the two points, the identification number (1 based, which periodic boundary itâs on if you have multiple ones) and the identification type (which is 2 for periodic). If you change your first loop where you add the points to
pids = []
for i in range(N+1):
for j in range(N+1):
for k in range(N+1):
pids.append (mesh.Add(MeshPoint(Pnt(L*i/N, L*j/N, L*k/N))))
if k is 0:
slave = pids[-1]
if k is N:
mesh.AddPointIdentification(pids[-1],slave,identnr=1,type=2)
it works for me. Iâve attached the file with a simple h1 test.
Another tip: If you select in the gui the mesh in the visualization and then go to View-> Viewing options->Mesh and disable âshow filled trianglesâ and enable âshow identified pointsâ you can see if your point identification is correct. This helps a lot when debugging
The test also works on my computer and the âshow identified pointsâ is also very neat
If I see this correctly, the mesh is now periodic only in one direction.
Somehow, I cannot identify the points in a second direction.
I always end up with identifying one corner point with all points on the opposite faceâŚ
So, could you please tell me how to extend the periodicity in one direction to periodicity in, letâs say, all directions?
if you identify the other directions, make sure you increase the âidentnrâ when you use
mesh.AddPointIdentification(...,identnr=2,type=2)
This function creates an array with identifications for the vertices of two opposite faces.
If you now use the same âidentnrâ for the identification of two other faces, you overwrite some data.
I actually have sort of a follow-up question on manually generated meshes.
In the script in this discussion, each face gets a name via e.g. FaceDescriptor(âŚ, bc=1), right?
So this name in form of [int list] is used to specify Dirichlet boundaries, the Set() operator, or billinear form integrator which act only on part of the boundary.
If I use the integer list, I get the following warning:
warning: Boundaries( [int list] ) is deprecated, pls generate Region
So, how can I generate regions (I guess named in form of strings?) for the boundary faces in this example?
This is a bit messy⌠A quickfix is to set names for all boundary conditions. I will discuss a nice solution with Joachim when heâs back in Vienna.
Best
Christopher