Mesh conformity at periodic boundary conditions

Hi all,

I’ve tried to read most posts of this forum regarding periodic boundary conditions and I’ve also taken a look at the code in charge of pairing periodic faces but I still have a small question:

Is it mandatory that the nodes of all periodically paired faces share the same transformation vector? i.e. the vector that joins each of these nodes with their opposites should be the same for all nodes of the periodic BC? This is not easy to impose in GMSH unless special care is taken when defining curves, loops, surfaces, etc. as GMSH may reorder the node to face connectivity, even if one uses the Periodic token to define the entities…

To explain it with pseudocode

def _pair_periodic_fluid_faces(self, bpart, resid):
    ...
    lfpts = np.array([[nodepts[n] for n in fn] for fn in lfnodes])
    rfpts = np.array([[nodepts[n] for n in fn] for fn in rfnodes])

    lfidx = fuzzysort(lfpts.mean(axis=1).T, range(len(lfnodes)))
    rfidx = fuzzysort(rfpts.mean(axis=1).T, range(len(rfnodes)))

    diff = (lfpts[lfidx] - rfpts[rfidx]).reshape(-1, 3)
    (diff == diff[0]).all()

Does the return value of (diff == diff[0]).all() need to be True?

If that is the case, I think that the code would be benefit from checking if the periodic bcs nodes are correctly matched during the import (I can take care of that). For example, if my tests are correct, the euler_vortex_2d.msh mesh does not fulfil the periodic conformity condition (the coutte_flow_2d.msh mesh does not show the same problem). Although, again, I don’t know if PyFR manages to deal with such issue when generating the flux points connectivity, so maybe this periodic conformity condition is not needed.

Thank you for your help,

Gonzalo

The only requirement for periodic faces is that there exists a constant vector u such that given any location l on the left hand side face that r + u yields the corresponding point on the right hand side face. How individual nodes are arranged on these faces does not matter.

Thank you @fdw, I was a bit confused with the definition of periodic boundaries when first I read [1] but now I see that the mesh connectivity at periodic BCs does not need to match in a node by node basis. That makes periodic mesh generation in GMSH a bit easier. Thank you again.

I don’t know if you can maybe answer this small question for me: is the flux points’ connectivity found by just ordering the face points position in the physical space of each face using fuzzysort in _srtd_face_fpts (and then calling get_opt_view_perm)? If that is the case, that’s a very nice solution. I didn’t know that such method could work.

Yes, we simply sort the points in physical space in order to obtain a unique ordering irrespective of how the points are indexed on the face. It works extremely well and is vastly simpler than other approaches I’ve seen.

2 Likes