Using Bloch boundary conditions for a general eigenvalue problem

Hi,

I am trying to run a custom Finite Element Linearized Solver with bloch boundary conditions. I am using only select components of DOLFINx as my FEM framework. Therefore, the setup doesn’t allow me to provide a clean MWE, apologies for that. But my question is more general anyways, regarding the “dolfinx_mpc” library. I was able to implement periodic boundary conditions successfully in my code using:

mpc = MultiPointConstraint(self.__FEMSpaces.VMixed)
mpc.create_periodic_constraint_topological(self.__FEMSpaces.VMixed.sub(0), self.boundaries, 4, periodic_relation, bcs)
mpc.finalize()

However, from here, I’m unfortunately unsure how to add a phase factor to extend the periodic boundary condition into a Bloch boundary condition. Is there already a way to achieve this in the “dolfinx_mpc” library? Can anyone help me with this?

Thank you very much!

You can send in a scale factor to create_periodic constraint:
https://jsdokken.com/dolfinx_mpc/docs/api.html#dolfinx_mpc.MultiPointConstraint.create_periodic_constraint_topological

1 Like

Thank you! So if I’m working with a 45-degree wedge, would I then set “scale” like this scale = np.exp(1j * np.pi / 4) or define it like this scale = np.sqrt(2)/2 + 1j * np.sqrt(2)/2?

I think either of those should be fine.

Just one more question, thank you so much! :smiley:
Imagine I’m working with a 3D cylindrical flow domain and trying to use a wedge shape. In this case, the two boundary facets I want to connect via Bloch boundary conditions would share the axis as an edge. Do you see a problem with this?

You should exclude that degree of freedom from the MPC.

An alternative approach for this would be to make the mesh itself periodic.

I’ve just done some work on this in

The drawback is that you would need to use a DG type space to enforce inter cell continuity, so it might be more work than it is worth for your usecase.

For the first option: I would have to do that outside of create_periodic_constraint_topological using the mesh tag, correct? Or is there an easier way to do it directly within the MPC functions?

What kind of function space are you planning to use?

If you are using P1, you can simply use a list of tagged vertices, instead of facets, and then exclude the vertex in question prior to the search.

If you are using another function space, I would consider setting a DirichletBC at that vertex, as I guess a natural condition there does not necessarily make sense (what does u(x)=u(x) mean?)
Then by supplying the Dirichlet bc to the create_periodic_constraint_topological, that dof will be ignored.

I see, thank you for the reply Jørgen! I am using a mixed function space. Here is a visualisation of my domain:


If my boundaries are 2D, is it still possible to set a Dirichlet BC at the 1D axis? And does the dolfinx_mpc even work for vectors? What I mean is, if I have two boundaries (see picture), where the slave surface is simply a rotated version of the master surface, and I have a vectorial quantity on the master surface, say in the direction of the master surface’s normal, will the MPC project the quantity in the direction of the slave surface’s normal? Or will it still use the direction of the vector from the master surface’s normal when applying it to the slave surface? Thank you so much

Dolfinx MPC is very generic, and most constraint can be applied (though some require more work than others).

Yes.

See for instance the examples in https://fenics2021.com/slides/dokken.pdf

As your constraint is fairly specific, and would depend on the angle of the wedge, I don’t have a constructor that does this out of the box.
However, it should be possible to construct, given that you have the angle between the two surfaces.

I am rather unexperienced with FEM, hence I am not sure if I would be able to construct this by myself. Thats why I was thinking to use cylindrical coordinates, which would solve my problem.
Do you think it would be enough to just transform the coordinates in dolfinx.mesh.Geometry of an existing mesh. Or would it mess up everything (FacetTags, etc.) and I would have to change the dolfinx.mesh.Topology as well? Thanks!!

I don’t quite get how you can use an existing dolfinx mesh (square or cube) to map your problem.

Sorry for the confusion! I already have my mesh as a dolfinx mesh in cartesian coordinates. Can I just transform the Dofs’ Coordinates (dolfinx.mesh.Geometry.x) without changing anything else of the mesh? (I have my equations already set up for cylindrical)