Question on constraint equations

Hello NGSolve developers,

How can constraint equations be implemented in NGSolve? For example, please see the attached toy problem. It is a rectangular block in 2D rotated 30 degrees from the X-axis. A Dirichlet condition on displacements (vector field “u”) is to be applied on the left edge (boundary “B4” in the toy model). The condition to be imposed is u.n = 0 (displacements normal to the edge are to be set to 0).
So the equivalent constraint equation on the edge degrees of freedom is:
[tex]u_x n_x + u_y n_y = 0, [/tex] where [tex]u_x, u_y[/tex] are the components of the displacement vector and [tex]n_x, n_y[/tex] are the the components of the normal vector on edge “B4”.

Please let me know how this can be implemented in NGSolve. I need to apply similar BCs on curved surfaces.

Thank you,
Anand

Attachment: rotated_rect_2020-03-03.py

Attachment: rotated_rect_2020-03-03-2.py

Attachment: rotated_rect_2020-03-03-3.py

Attachment: rotated_rect_2020-03-03-4.py

Hi Anand,

a quick (but dirty) approach would be to add the constraint equation as a penalty

``````n = specialcf.normal(mesh.dim)
...
a += Variation(  1e6*(u*n)**2*ds("B4")  )``````

Best,
Michael

Hi Michael,

I agree that approach can weakly enforce Dirichlet BCs as required. There is an issue I foresee specifically for the kind of problems I’m working on.

1. I have a formulation that already uses Lagrange multipliers to impose certain conservation constraints.

2. The governing equations are posed in mixed form. So such constraints have to be imposed on both displacements and tractions (Neumann BCs related to stress at the boundary surfaces).

Using the penalty approach to apply constraints to a system with the above characteristics will likely affect the system of equations adversely. If possible, I’d prefer not to degrade the linear algebraic system with additional penalty constraints.

Is there a different approach to implement the constraint equations? (I am fine even if it’s painful to implement

Thank you,
Anand

Hi Anand,

you can use also a Lagrange multiplier to enforce the boundary condition instead of a penalty.
I’m not aware of another possibility as the VectorH1 is organized in Cartesian coordinates.

Maybe if you use an HDiv-conforming HDG method. There the (displacement) vector field is automatically split into its normal and tangential components. However, you would need to adapt your problem, see this tutorial.

Best
Michael

Hi Michael,

Yes, I can use Lagrange multipliers but these come with similar challenges in terms of matrix conditioning - I’ll mostly end up doing this.

I was just wondering if NGSolve had any utility to impose constraint equations at the linear algebraic level (like using the constraint relation matrix and then condensing out the slave DOFs).

Thank you for the link to the HDG tutorial. I’ll take a look at it to see if that is feasible in my case.

Thank you,
Anand