← Back to team overview

fenics team mailing list archive

Re: New feature: integration over regions

 

On Wed, Jan 30, 2013 at 09:54:39AM +0100, Martin Sandve Alnæs wrote:
>    In addition to integration over the entire domain, explained in another
>    post, we have introduced a concept called 'regions' in ufl. For this
>    post, assume a single mesh. Support for multiple meshes will get some
>    attention in the future.
>    The ufl language changes for expressing domain relations is work in
>    progress, but some useful features are already possible in trunk. We
>    keep the concept of disjoint numbered subdomains, which can be easily
>    represented as a single meshfunction in dolfin, having a single integer
>    label for each cell. In addition we introduce the concept of a region,
>    which is the union of any number of subdomains. Thus regions of one
>    domain can be overlapping by including some of the same subdomain(s).
>    With some automatic symbolic manipulation in ufl, we can now express
>    integrals over overlapping regions with zero additional cost at
>    assembly time.

Nice!

>    Here's the currently simplest syntax for integrals over regions:
>    # Define regions as tuples of subdomain labels
>    DL, DM, DR = (1,2), (2,), (2,3) # ***

I guess 'DM = 2' will also work fine here? It will be passed to dx(DM)
so that will result in an integral over subdomain 2.

>    # Define new measures associated with the interior domains
>    dx = Measure("dx")[domains]
>    # Make forms for equation
>    a = u*v*dx() + alpha*dot(grad(u), grad(v))*dx() # Integrals over entire
>    domain

Is the '()' necessary here in 'dx()'? Will it work with just dx?

--
Anders


>    L = f*v*dx(DR) + g*v*dx(DL) - (f+g)/2*v*dx(DM) # Integrals over regions
>    For the full running code, see this demo in the latest dolfin:
>
>    demo/undocumented/overlapping-regions/python/demo_overlapping-regions.p
>    y
>    Martin

> _______________________________________________
> Mailing list: https://launchpad.net/~fenics
> Post to     : fenics@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~fenics
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References