← Back to team overview

dolfin team mailing list archive

Re: assembly on sub domains

 

Ok i've got it, i think this shoud be the way:

void dolfin::assemble(GenericTensor& A, Form& form, Mesh& mesh,
               const MeshFunction<dolfin::uint>& cell_domains,
                const MeshFunction<dolfin::uint>&exterior_facet_domains,
                const MeshFunction<dolfin::uint>& interior_facet_domains) ?

But still,  I have to pass 3 MeshFunction's ? even if we only need one,
(but that isn't a problem).

Thanks.

-- 
Nuno David Lopes

On Wednesday 07 May 2008, Anders Logg wrote:
> On Wed, May 07, 2008 at 10:10:02AM +0100, Nuno David Lopes wrote:
> > >Anders Logg
> > >Mon, 28 Jan 2008 02:00:43 -0800
> > >
> > >>On Fri, Jan 25, 2008 at 10:55:27AM -0500, Jake Ostien wrote:
> > >> I have a question about general usage of SubDomains.  I have a problem
> > >> where I would really like to partition a domain (via some criterion)
> > >> into 2 sub domains, and then assemble the global system as two
> > >> separate assemblies over the sub domains.  The context here is for
> > >> plasticity, initially I have a domain that is elastic but evolves such
> > >> that there are two regions (elastic + plastic).  I am currently not
> > >> dealing with this in a very elegant manner, and I was hoping that if I
> > >> could somehow generate an elastic sub domain and a plastic sub domain,
> > >> I could more efficiently assemble.  Does that sound possible
> > >> currently, or could I add something like that in?  Eventually I think
> > >> we'd like to extend the concept to assembly over facets on the
> > >> boundary of the elastic/plastic interface as well, but this might be a
> > >> good first step.
> > >>
> > >> Jake
> > >
> > >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)
> >
> > But how could we link the subdomains markers defined in a MeshFunction
> > with the variational form in the cpp.
>
> You link these when you assemble by passing the subdomains as
> arguments to the assembler. This won't work if you are using the
> LinearPDE class, since it is currently unaware of subdomains.
> So you must assemble the matrix and vector manually (by calling
> assemble).







Follow ups

References