dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07826
Re: assembly on sub domains
Are there any demos of Neumann boundary conditions implementation as in
dolfin-manual:
"It is also possible to define g only on 1 and specify an integral over
the boundary subset 1 in the form file." ???
Can't find anything about subdomains treatment in ffc form files vs
assembling in dolfin cpp file.
Thanks in advance!
On Wednesday 07 May 2008, Nuno David Lopes wrote:
> >You can define a form as a sum of contributions from different
> >subdomains, for example:
> >
> >dx0 = Integral("cell", 0)
> >dx1 = Integral("cell", 1)
> >
> >a = v*u*dx0 + dot(grad(v), grad(u))*dx1
> >
> >This gives two terms, one of which will be used in subdomain 0 and the
> >other in subdomain 1.
> >
> >Subdomains can be specified in DOLFIN by creating a subclass of
> >SubDomain and overloading the inside() function, or by specifying a
> >MeshFunction<uint> over the cells of the mesh.
> >
> >You can also have integrals over arbitrary facets of the domain, like
> >for example the boundary between your two subdomains. You can have
> >several such integrals:
> >
> > ds0 = Integral("exterior facet", 0)
> > ds1 = Integral("exterior facet", 1)
> > ds2 = Integral("exterior facet", 2)
> >
> > dS0 = Integral("interior facet", 0)
> > dS1 = Integral("interior facet", 1)
> > dS2 = Integral("interior facet", 2)
> >
> >--
> >Anders
>
> But how could we link the subdomains markers defined in a MeshFunction
> with the variational form in the cpp.
> Example:
>
> I have in a "Foo.form" something like:
> -------------------------------------------------------------------
> P1=FiniteElement("Lagrange","tetrahedron",1)
>
> f=Function(P1)
>
> dx0 = Integral("cell", 0)
> dx1 = Integral("cell", 1)
>
> a = f*v*u*dx0 + dot(grad(v), grad(u))*dx1
> ------------------------------------------------------------------
> and in "main.cpp" something like
> ---------------------------------------------------------------------------
>------------------------------- MeshFunction<unsigned int>
> b_subdomains(mesh,"b_subdomains.xml");
> //Boundary subdomain markers
>
> MeshFunction<unsigned int> v_subdomains(mesh,"v_subdomains.xml");
> //Volume subdomain (0 and 1) markers
>
> Function f(mesh,10.0);
> FooBilinearForm a( f );//constructors for finite element form's (Problem
> here)
> ---------------------------------------------------------------------------
>-------------------------------- I'm missing something...
>
> Shouldn't
> FooBilinearForm a( f );
> be replaced by something like
> FooBilinearForm a( f ,v_subdomains); ?
--
Nuno David Lopes
Follow ups
References