← Back to team overview

dolfin team mailing list archive

Re: FWD: Re: your mail

 

On Sun, Jan 06, 2008 at 04:19:46AM -0500, Hatef Monajemi wrote:
> Dear Prof. Anders Logg
> 
> I have a question for you regarding Dolfin and I would appreciate if 
> you help me with that.
> I am a little bit confused about:
> 1-how you define the Dirichlet Boundry condition for a specific problem 
> in 
> main.cpp
> 2-how do you form that subdomain.xml.gz file
>
> is there any article or source which can help me with that?

A Dirichlet boundary condition is specified by three things:

  1. A function g (such that u = g on the boundary)
  2. The mesh
  3. The piece of the mesh boundary to set the condition on

So:

  DirichletBC bc(u0, mesh, boundary);

Then apply the bc to a linear system:

  bc.apply(A, b);

You can do more involved stuff like setting a boundary condition only
for a component/subsystem etc. You can apply several bcs to one system

  bc0.apply(A, b);
  bc1.apply(A, b);

The boundary is specified either by a subclass of SubDomain (which
must overload inside()) or by a MeshFunction<uint> over the facets of
the boundary. The mesh function can be created either manually (but
then using SubDomain is probably easier) or it can be created using
the graphical front-end MeshBuilder which can be obtained by

  hg clone http://www.fenics.org/dev/meshbuilder

The documentation is currently very sparse, but there are quite a few
demos in src/demo in the DOLFIN source tree (both for C++ and Python).

We really need to get started at brushing up the manual some time
soon.

-- 
Anders


References