>
> Well, to impose a Neumann BC on part of the boundary you should only add
> Neumann BC terms to the entries of the rhs vector corresponding to dofs on
> the relevant part of the boundary. So you'd need to detect which part of the
> boundary you're on and add the Neumann BC terms accordingly. Have a look at
> ex13 for an example usage of boundary IDs for this kind of purpose. For more
> complicated domains, I typically generate a mesh using gmsh, which enables
> you to specify boundary IDs (using a gmsh "physical").
>
> In principle 1D is the same except that in that simpler case the Neumann
> term is not an integral so you don't need a boundary quadrature rule etc...
> Also there are only 2 boundary elements in a 1D mesh so you could easily
> determine which boundary element you're on by testing the value of
> elem->centroid() or something.
>
> If you can't get it to work, then just send your BC code fragment to the
> list...
>
> - Dave
>
This is what I've tried. The Dirichlet BC works fine but the plot of the
solution implies that something's terriby wrong with the Neumann B.C :
for(unsigned int s=0; s<elem->n_sides(); s++)
{
{
Ke(s,s) += penalty;
short int bc_id = mesh.boundary_info->boundary_id (elem,s);
if (bc_id == 0) //Left end : Dirichlet BC
Fe(s) += 2*penalty;
else if (bc_id == 1) //Right end : Neumann BC
Fe(s) += - 0.5;
}
}
What am I doing incorrectly?
Thanks
Ted
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users