← Back to team overview

dolfin team mailing list archive

Re: assembly on sub domains

 

[for the mailing list]

Nuno David Lopes wrote:
On Thursday 08 May 2008, you wrote:
It helps me to think about it this way.  Count the number of ds terms in
your form file.  If you have n terms, then any facet marked with (n-1)
or larger will *NOT* get assembled.  So if you have 3 exterior
subdomains (ds0, ds1, ds2 in your form file), then  the relevant markers
will be 0, 1, and 2, and any number 3 or greater will not have an
integral associated with it and therefore will not get assembled.  So if
I were you I might consider the following logic.

  /// first, since there are no dS terms
  int_facet_domains = 0;

  /// set all exterior facets to some number greater than the number of
ds terms
  ext_facet_domains = 4;

  /// loop over facets
  for (FacetIterator facet(mesh); !facet.end(); ++facet) {

    /// Check if we have an exterior facet
    if ( facet->numEntities(mesh.topology().dim()) != 2 ) {
      if (first non-zero neumann condition) ext_facet_domains(*facet) = 0;
      if (second non-zero neumann condition) ext_facet_domains(*facet) = 1;
    }
  }


It makes sense...in this way we don't have to care with the zero neumann boundary.
  assemble(A,a,mesh, cell_domains, ext_facet_domains, int_facets_domains);

Here I am assuming that you are imposing you Dirichlet BC strongly.  If
not (if you have the Dirichlet BC defined in your form file) add another
ext_facet_domains(*facet) in the above loop.

I'm imposing strongly.

If i want to use different markers for the interior facets then i should
considerer 2 different MeshFunctions   with the correct order.
0..n-1 for interior
0..n-1 for exterior
??
Yes.  Remember that there is a one-to-one correspondence with the domain
number in the form file and the marker number in the MeshFunction.  If
ds0 = Integral("exterior facet", 0), and ds1 = Integral("exterior
facet", 1) then the facets on ds0 need to be marked with 0 in
ext_facet_domains, and the facets on ds1 need to be marked with 1 in
ext_facet_domains etc.

And again, if you don't use dS in your forms, the assembler will not take
into account the third meshfunction, so it could be whatever you want,
right?
Yes, that's right.

Hope this is helpful.
Jake


It's Very Helpful!!!



References