← Back to team overview

dolfin team mailing list archive

Re: Boundary terms in Dolfin

 

On Thu, Jul 07, 2005 at 08:11:00PM +0200, jhoffman@xxxxxxxxxxx wrote:
> >> I agree that we should support both, although 2 would be the only one
> >> avoiding checking (for Karin & Johan) as far as I understand.
> >
> > It depends on what the user wants. If someone calls
> >
> >    FEM::applyBC(..., mesh, ...)
> >
> > then we have to iterate over the entire boundary. On the other hand,
> > if someone calls
> >
> >    FEM::applyBC(..., boundary, ...)
> >
> > then we only have to loop over that portion of the boundary.
> 
> Yes, but doesn't this involve checking if we are on the "boundary" by
> comparing boundary ID's?

Only when generating the boundary. The implementation of the first
function will look like

    void applyBC(..., mesh, ...)
    {
        Boundary boundary(mesh);
        applyBC(..., boundary, ...);
    }

When a boundary is generated, we have to iterate over the entire mesh
and detect which entities are on the boundary. (This is automatically
detected by the algorithms in BoundaryInit.)

But when we iterate over entities (like edges) on a Boundary, then we
really just iterate over the entities on the Boundary (not iterating
over the entire mesh and skipping the interior).

Also note that if we assemble more than once, then the boundary has to
be computed only the first time (this is automatically handled by the
Mesh class, it knows if the boundary has already been computed).

/Anders




Follow ups

References