Re: [Libmesh-users] Boundary Integration

 Re: [Libmesh-users] Boundary Integration From: John Peterson - 2009-03-10 17:54:15 ```On Tue, Mar 10, 2009 at 11:51 AM, Andrea Hawkins wrote: > Hello- > > In looking at the examples that include boundary integration, I just had a > question of how something is working. > > For discussion I will consider example 5. The loops for test and trial > functions run over i,j=0 to phi_face.size() which makes sense, but I'm > wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't > think the element dof corresponds to the side-trial function number. Is > there something that happens in fe_face->reinit() or something? All the same basis functions and numbering are used, the quadrature rule is changed (I think!) -- John ```

 [Libmesh-users] Boundary Integration From: Andrea Hawkins - 2009-03-10 17:52:00 ```Hello- In looking at the examples that include boundary integration, I just had a question of how something is working. For discussion I will consider example 5. The loops for test and trial functions run over i,j=0 to phi_face.size() which makes sense, but I'm wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't think the element dof corresponds to the side-trial function number. Is there something that happens in fe_face->reinit() or something? Thanks! Andrea ```
 Re: [Libmesh-users] Boundary Integration From: John Peterson - 2009-03-10 17:54:15 ```On Tue, Mar 10, 2009 at 11:51 AM, Andrea Hawkins wrote: > Hello- > > In looking at the examples that include boundary integration, I just had a > question of how something is working. > > For discussion I will consider example 5. The loops for test and trial > functions run over i,j=0 to phi_face.size() which makes sense, but I'm > wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't > think the element dof corresponds to the side-trial function number. Is > there something that happens in fe_face->reinit() or something? All the same basis functions and numbering are used, the quadrature rule is changed (I think!) -- John ```
 Re: [Libmesh-users] Boundary Integration From: Andrea Hawkins - 2009-03-10 18:01:14 ```Right... But if you think about a 2D element with local dofs as numbered here 3 ------------ 2 | | | | 0 ------------- 1 If the side between dof 2 and 3 is on the boundary, in that loop I don't think you should be adding to Ke(0,0), right? But you will be. Or have I completely over thought this? On Tue, Mar 10, 2009 at 12:54 PM, John Peterson wrote: > On Tue, Mar 10, 2009 at 11:51 AM, Andrea Hawkins > wrote: > > Hello- > > > > In looking at the examples that include boundary integration, I just had > a > > question of how something is working. > > > > For discussion I will consider example 5. The loops for test and trial > > functions run over i,j=0 to phi_face.size() which makes sense, but I'm > > wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't > > think the element dof corresponds to the side-trial function number. Is > > there something that happens in fe_face->reinit() or something? > > All the same basis functions and numbering are used, the quadrature > rule is changed (I think!) > > -- > John > ```
 Re: [Libmesh-users] Boundary Integration From: Roy Stogner - 2009-03-10 18:03:01 ```On Tue, 10 Mar 2009, Andrea Hawkins wrote: > For discussion I will consider example 5. The loops for test and trial > functions run over i,j=0 to phi_face.size() which makes sense, but I'm > wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't > think the element dof corresponds to the side-trial function number. They do correspond. > Is there something that happens in fe_face->reinit() or something? What happens is that phi_face includes all element shape functions, even when they're 0 on the entire face boundary. I guess the choice was between adding a bunch of zeros vs. indexing through an extra indirection layer, and libMesh went with simpler code over negligably better assembly performance. --- Roy ```
 Re: [Libmesh-users] Boundary Integration From: Andrea Hawkins - 2009-03-10 18:05:01 ```Ah. I see. So the extra guys are just set to 0. Thank you very much! Andrea On Tue, Mar 10, 2009 at 1:02 PM, Roy Stogner wrote: > > On Tue, 10 Mar 2009, Andrea Hawkins wrote: > > For discussion I will consider example 5. The loops for test and trial >> functions run over i,j=0 to phi_face.size() which makes sense, but I'm >> wondering about the value being added to Ke(i,j) and Fe(i) as I wouldn't >> think the element dof corresponds to the side-trial function number. >> > > They do correspond. > > Is there something that happens in fe_face->reinit() or something? >> > > What happens is that phi_face includes all element shape functions, > even when they're 0 on the entire face boundary. I guess the choice > was between adding a bunch of zeros vs. indexing through an extra > indirection layer, and libMesh went with simpler code over > negligably better assembly performance. > --- > Roy > ```
 Re: [Libmesh-users] Boundary Integration From: John Peterson - 2009-03-10 18:07:57 ```On Tue, Mar 10, 2009 at 12:04 PM, Andrea Hawkins wrote: > Ah. I see. So the extra guys are just set to 0. > > Thank you very much! Yeah, and actually it also works out well for boundary integrals involving derivatives since (as in your figure above) dphi(0) has support on the boundary face. -- John ```
 Re: [Libmesh-users] Boundary Integration From: Derek Gaston - 2009-03-10 18:21:46 ```On Mar 10, 2009, at 12:02 PM, Roy Stogner wrote: > What happens is that phi_face includes all element shape functions, > even when they're 0 on the entire face boundary. I guess the choice > was between adding a bunch of zeros vs. indexing through an extra > indirection layer, and libMesh went with simpler code over > negligably better assembly performance. Also... don't forget non-lagrange elements which could have wacky support on boundaries. In general I think there's no better way than to just evaluate all of the shape functions at the quadrature points and use what comes out. Derek ```
 Re: [Libmesh-users] Boundary Integration From: Roy Stogner - 2009-03-10 18:57:24 ```On Tue, 10 Mar 2009, Derek Gaston wrote: > On Mar 10, 2009, at 12:02 PM, Roy Stogner wrote: > >> What happens is that phi_face includes all element shape functions, >> even when they're 0 on the entire face boundary. I guess the choice >> was between adding a bunch of zeros vs. indexing through an extra >> indirection layer, and libMesh went with simpler code over >> negligably better assembly performance. > > Also... don't forget non-lagrange elements which could have wacky > support on boundaries. Wacky but still well-defined: even for non-Lagrange dofs, if the dof isn't located on a node on face S, the corresponding shape function has no support on face S. But even then you've got to be careful; bases like the monomials may have no support on interfaces (because they're discontinuous there!) but you may still want to integrate them there (e.g. to measure that jump discontinuity). Using every element basis function is just safer, and even when it's really wasteful (high p elements) it's not really wasteful (you're just doing it on O(N^2/3) boundary elements, tops) > In general I think there's no better way than to just evaluate all > of the shape functions at the quadrature points and use what comes > out. In specific cases there's often a better way, but in general there's rarely a safer way. --- Roy ```