Anyone using the "assemble on subdomain" function?

Asked by Martin Sandve Alnæs on 2013-01-29

I see in Assembler.h there's a function for assembling a form on a subdomain:

    /// Assemble tensor from given form on subdomain
    ///
    /// *Arguments*
    /// A (_GenericTensor_)
    /// The tensor to assemble.
    /// a (_Form_)
    /// The form to assemble the tensor from.
    /// sub_domain (_SubDomain_)
    /// The subdomain to assemble on.
    void assemble(GenericTensor& A, const Form& a,
                  const SubDomain& sub_domain);

This is most likely broken now, since it is implemented by filling meshfunctions with 0. However no tests have picked this up. Does anyone use it? I don't think it's a very good idea to do it this way anyway, it adds further to the confusion around where domains are defined.

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Sandve Alnæs
Solved:
2013-01-29
Last query:
2013-01-29
Last reply:
2013-01-29
Anders Logg (logg) said : #1

On Tue, Jan 29, 2013 at 01:21:01PM -0000, Martin Sandve Alnæs wrote:
> New question #220443 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/220443
>
> I see in Assembler.h there's a function for assembling a form on a subdomain:
>
> /// Assemble tensor from given form on subdomain
> ///
> /// *Arguments*
> /// A (_GenericTensor_)
> /// The tensor to assemble.
> /// a (_Form_)
> /// The form to assemble the tensor from.
> /// sub_domain (_SubDomain_)
> /// The subdomain to assemble on.
> void assemble(GenericTensor& A, const Form& a,
> const SubDomain& sub_domain);
>
> This is most likely broken now, since it is implemented by filling
> meshfunctions with 0. However no tests have picked this up. Does
> anyone use it? I don't think it's a very good idea to do it this way
> anyway, it adds further to the confusion around where domains are
> defined.

Yes, I think it is ok to remove it.

In general, we should strive to have one interface for most
algorithms and instead abstract the different ways to send in data
into a common class/concept.

In the case of subdomains, I suggest we make it so that subdomains
must always be marked as part of a form and the assembler will only
care about that.

Then there can be different ways to mark subdomains as part of a form:
using existing markers from a mesh, from a MeshFunction or from a
SubDomain, but each of those will require an explicit call from the
user.

--
Anders

I'm trying to remove them all, there are similar functions in symmetricassembler, then I'll see what happens...

Anders Logg (logg) said : #3

On Tue, Jan 29, 2013 at 02:11:10PM -0000, Martin Sandve Alnæs wrote:
> Question #220443 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/220443
>
> Martin Sandve Alnæs posted a new comment:
> I'm trying to remove them all, there are similar functions in
> symmetricassembler, then I'll see what happens...

While you're at it, could you also merge all the assemblers into one?
Note that you also need to make sure that the OpenMP assembler scales
well in hybrid mode with MPI. :-)

--
Anders

You should be a comedian :) Tests are looking good, so I'm pushing this change later today. It's in lp:~martinal/dolfin/work for now, together with some other bugfixes related to full domain integration.

Garth Wells (garth-wells) said : #5

On 29 January 2013 14:31, Anders Logg
<email address hidden> wrote:
> Question #220443 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/220443
>
> Anders Logg proposed the following answer:
> On Tue, Jan 29, 2013 at 02:11:10PM -0000, Martin Sandve Alnæs wrote:
>> Question #220443 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/220443
>>
>> Martin Sandve Alnæs posted a new comment:
>> I'm trying to remove them all, there are similar functions in
>> symmetricassembler, then I'll see what happens...
>
> While you're at it, could you also merge all the assemblers into one?
> Note that you also need to make sure that the OpenMP assembler scales
> well in hybrid mode with MPI. :-)
>

I'll clean up the assemblers as soon as I get the new
periodic/constraints in place (which is coming along nicely).

Garth

> --
> Anders
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

... oops, pushed it now anyway by accident :) But as I said, all tests built and passed locally.

Anders Logg (logg) said : #7

On Tue, Jan 29, 2013 at 03:06:00PM -0000, Martin Sandve Alnæs wrote:
> Question #220443 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/220443
>
> Martin Sandve Alnæs posted a new comment:
> ... oops, pushed it now anyway by accident :) But as I said, all tests
> built and passed locally.

:-)

--
Anders