## Re: [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions

 Re: [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions From: Karen Lee - 2010-02-20 05:07:36 ```Thanks for your response! On Fri, Feb 19, 2010 at 6:01 PM, Roy Stogner wrote: > > On Fri, 19 Feb 2010, Karen Lee wrote: > > const Real value = exact_solution(xf, yf); >> >> is the line that gives the value, so if I wanted to impose that the >> values at the boundary are 0, I just put 0 instead right? >> > > Right. In fact, in a linear system like ex3 the whole residual drops > out in this case, and homogeneous Dirichlet boundaries only end up > affecting your matrix. For nonlinear systems things are trickier > depending on your solver; see ex18 for an example. > > > My system is linear, so I'll just set things to 0. > The other thing is, I'm not sure whether BoundaryMesh can just locate >> the boundary. I use tetgen .node and .ele files, and it >> doesn't seem that the .face files are read by libmesh, and so I'm >> wondering how it's able to locate the boundary... Or do I add >> some tags and say that certain nodes and elements are on the boundary? >> > > The boundary is currently implicitly defined: if an element doesn't > have a neighbor on one side, that side is a boundary side. If a node > is on a boundary side, that node is a boundary node. > > That works fine for most domains, which are the interior of their own > closure. If you've got something more complicated, let us know, but > don't be too optimistic. We currently break when refining domains > with infinitely thin slits, for one embarrassing example. > My domain has no holes. Should be ok I guess =) Thanks, Karen ```

 [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions From: Karen Lee - 2010-02-19 22:40:44 ```Dear Libmesh users, I'm wondering how we can impose boundary conditions. I'm looking at example 3, and it says that it handles the Dirichlet BC by a penalty function. I wanted to check that: const Real value = exact_solution(xf, yf); is the line that gives the value, so if I wanted to impose that the values at the boundary are 0, I just put 0 instead right? The other thing is, I'm not sure whether BoundaryMesh can just locate the boundary. I use tetgen .node and .ele files, and it doesn't seem that the .face files are read by libmesh, and so I'm wondering how it's able to locate the boundary... Or do I add some tags and say that certain nodes and elements are on the boundary? Thank you so much, Karen ```
 Re: [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions From: John Peterson - 2010-02-19 23:05:40 ```On Fri, Feb 19, 2010 at 4:40 PM, Karen Lee wrote: > Dear Libmesh users, > > I'm wondering how we can impose boundary conditions. I'm looking at example > 3, and it says that it handles the Dirichlet BC by a penalty function. I > wanted to check that: > > const Real value = exact_solution(xf, yf); > > is the line that gives the value, so if I wanted to impose that the > values at the boundary are 0, I just put 0 instead right? That's right. > The other thing is, I'm not sure whether BoundaryMesh can just locate > the boundary. I use tetgen .node and .ele files, and it > doesn't seem that the .face files are read by libmesh, and so I'm > wondering how it's able to locate the boundary... Or do I add > some tags and say that certain nodes and elements are on the boundary? Libmesh determines elements which are on the boundary automatically. After the Mesh::find_neighbors routine, which is usually called from the Mesh::prepare_for_use function, elements with NULL neighbors are boundary elements. We do not maintain a separate list of such elements, though, as far as I know. -- John ```
 Re: [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions From: Roy Stogner - 2010-02-19 23:06:02 ```On Fri, 19 Feb 2010, Karen Lee wrote: > const Real value = exact_solution(xf, yf); > > is the line that gives the value, so if I wanted to impose that the > values at the boundary are 0, I just put 0 instead right? Right. In fact, in a linear system like ex3 the whole residual drops out in this case, and homogeneous Dirichlet boundaries only end up affecting your matrix. For nonlinear systems things are trickier depending on your solver; see ex18 for an example. > The other thing is, I'm not sure whether BoundaryMesh can just locate > the boundary. I use tetgen .node and .ele files, and it > doesn't seem that the .face files are read by libmesh, and so I'm > wondering how it's able to locate the boundary... Or do I add > some tags and say that certain nodes and elements are on the boundary? The boundary is currently implicitly defined: if an element doesn't have a neighbor on one side, that side is a boundary side. If a node is on a boundary side, that node is a boundary node. That works fine for most domains, which are the interior of their own closure. If you've got something more complicated, let us know, but don't be too optimistic. We currently break when refining domains with infinitely thin slits, for one embarrassing example. --- Roy ```
 Re: [Libmesh-users] Question about BoundaryInfo and implementing boundary conditions From: Karen Lee - 2010-02-20 05:07:36 ```Thanks for your response! On Fri, Feb 19, 2010 at 6:01 PM, Roy Stogner wrote: > > On Fri, 19 Feb 2010, Karen Lee wrote: > > const Real value = exact_solution(xf, yf); >> >> is the line that gives the value, so if I wanted to impose that the >> values at the boundary are 0, I just put 0 instead right? >> > > Right. In fact, in a linear system like ex3 the whole residual drops > out in this case, and homogeneous Dirichlet boundaries only end up > affecting your matrix. For nonlinear systems things are trickier > depending on your solver; see ex18 for an example. > > > My system is linear, so I'll just set things to 0. > The other thing is, I'm not sure whether BoundaryMesh can just locate >> the boundary. I use tetgen .node and .ele files, and it >> doesn't seem that the .face files are read by libmesh, and so I'm >> wondering how it's able to locate the boundary... Or do I add >> some tags and say that certain nodes and elements are on the boundary? >> > > The boundary is currently implicitly defined: if an element doesn't > have a neighbor on one side, that side is a boundary side. If a node > is on a boundary side, that node is a boundary node. > > That works fine for most domains, which are the interior of their own > closure. If you've got something more complicated, let us know, but > don't be too optimistic. We currently break when refining domains > with infinitely thin slits, for one embarrassing example. > My domain has no holes. Should be ok I guess =) Thanks, Karen ```