I am trying to impose Dirichlet boundary conditions along the faces of a cube built with the cube command. On faces 5 and 6 there is a single point where the function defining the boundary condition is not defined. It seems like this is causing me issues in obtaining a solution.

I get no solution if I write:

+on(1,2,3,4,5,6, u = g)

where g is the Dirichlet boundary condition I want to impose.

I can get solutions if I just add

on(1,2,3,4, u = g)

or if I write

on(1,2,3,4, u = g) + on(5, 6, u = g1)
where g1 is smooth.

This makes me think that the problem is the discontinuity on faces 5 and 6. How can I properly impose such a boundary condition?

right, yes sorry, it’s not a discontinuity. The function g is smooth everywhere where it is defined. But there is a single point on both of the faces 5 and 6 where it is not defined.

Maybe I can replace it with some clever function.

But I’m just wondering if it’s possible to impose the boundary conditions as they are stated.

Thank you for your reply! And, yes, I agree that was definitely causing a problem, due to the function g being undefined at a single point on both the faces z = 0, 1.

I do want to apply Dirichelt BC to all of the 6 faces. I decided to use a regularisation of g on the faces z = 0, 1. Also, it seems I needed to use P1 elements rather than P2. Now, I like the solution I’m getting on a coarser mesh, but when I try to run a finer mesh I’m getting a weird error.

Have you seen this before?

FALLBACK (log once): Fallback to SW vertex processing (lineMode && (localGroupInfo & GLRGroupInfoPrimitiveEmulatedFill))
FALLBACK (log once): Fallback to SW vertex processing, m_disable_code: 800
FALLBACK (log once): Fallback to SW vertex processing in drawCore, m_disable_code: 800
FALLBACK (log once): Fallback to SW vertex for line stipple

I’m also getting some weird plots of cuts of the regularised g in my finer mesh. On the finer mesh, it’s not plotting anything in the middle. I’ve uploaded the plots. Do you have an idea if these issues are somehow related?