## libmesh-users

 RE: [Libmesh-users] Constraint matrix for boundary conditions From: KIRK, BENJAMIN (JSC-EG) (NASA) - 2005-01-07 14:43:34 It's not clear that you need to use the constraint matrix for this = case... For example, consider Laplace's problem in 2D: =20 - div(grad(u)) =3D 0 with u=3Dg on some part of the boundary, du/dn=3Dh on the remainder. In the weak statement you perform integration-by-parts, and the term = du/dn appears in a boundary integral and you can use this to impose a Neumann = BC in the RHS of the system. See, for example, http://cfdlab.ae.utexas.edu/~benkirk/seminar/talk.pdf, Especially page = 4. In a similar way, Robin BCs can be implemented by letting h =3D alpha u = + beta du/dn. In this case you have two boundary terms that contribute to the system matrix. For implementation, you simply need to define a finite element object = that lives on the boundary and can be used to integrate along the edge to = provide the required term. Clear? Unfortunately, none of the examples show this. If you have any more questions let me know, it would be straightforward to modify ex14 to = show this procedure since it has the exact solution's derivative available. Regardless, we should probably do that since it seems silly to have 14 examples, all with Dirichlet BCs! -Ben =20 -----Original Message----- From: libmesh-users-admin@... [mailto:libmesh-users-admin@...] On Behalf Of Michael Schindler Sent: Friday, January 07, 2005 3:26 AM To: libmesh-users@... Subject: [Libmesh-users] Constraint matrix for boundary conditions Hello, I would like to enforce non-Dirichlet boundary conditions via the = constraint matrix. Does someone have an example how to implement this for e.g. = Neumann or Robin BC? Thanks, Michael. --=20 "A mathematician is a device for turning coffee into theorems" Paul Erd=F6s. ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a = FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and = FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Libmesh-users mailing list Libmesh-users@... https://lists.sourceforge.net/lists/listinfo/libmesh-users 
 Re: [Libmesh-users] Constraint matrix for boundary conditions From: Michael Schindler - 2005-01-07 15:05:06 Hello Ben, On 07.01.05, KIRK, BENJAMIN (JSC-EG) (NASA) wrote: > For example, consider Laplace's problem in 2D: > > - div(grad(u)) = 0 > > with u=g on some part of the boundary, du/dn=h on the remainder. > > In the weak statement you perform integration-by-parts, and the term du/dn > appears in a boundary integral and you can use this to impose a Neumann BC > in the RHS of the system. See, for example, > http://cfdlab.ae.utexas.edu/~benkirk/seminar/talk.pdf, Especially page 4. Do you mean just to replace du/dn in the boundary integral by h in order to "enforce" du/dn = h ?? This would be the FEM standard procedure, I guess. Exactly at this point I have some doubts. Consider a different setup, where I add the equation du/dn = h weighted with some penalty, to the linear system to be solved. This works quite well. The first prodecure is equivalent to this penalty-procedure, if one sets the penalty to -1 which is not a really good value for a penalty. > It's not clear that you need to use the constraint matrix for this case... Therefore, I wanted to look for an alternative approach to enforce the boundary condition -- and came across the constraint matrices. > For implementation, you simply need to define a finite element object that > lives on the boundary and can be used to integrate along the edge to provide > the required term. Clear? Yes, clear. For an element I would get a constraining equation (again for the case dn/du = h) h = \sum_i w_i u_i where u_i are the degrees of freedom and w_i are some weights determined by the geometry of the element. Now comes the next difficulty. I have an idea how the method DofMap::constrain_matrix_and_vector works. It creates a matrix C from the constraints and uses these constraints while inserting the correct values into the big system matrix. I would expect this _only_ to work for h = 0. Do I miss something here? > Unfortunately, none of the examples show this. If you have any more > questions let me know, it would be straightforward to modify ex14 to show > this procedure since it has the exact solution's derivative available. > Regardless, we should probably do that since it seems silly to have 14 > examples, all with Dirichlet BCs! This would be great! Thanks, Michael. -- "A mathematician is a device for turning coffee into theorems" Paul Erdös.