Jonathan,

> So, on to the issue of mesh partitioning...It actually appears that
> the partitioning is being done correctly, but the writing of
> subdomain_id's is not working well.  I have isolated the problem (at
> least I think) to the case when the FilteredDataOut class is used.  I
> wrote a small test program that just creates a grid, partitions it,
> and then writes the partitioning to d2 intermediate files.  If I loop
> over the cells and write cell->subdomain_id() to the screen,
> everything is fine.  Also, GridTools::get_subdomain_association
> returns correct information.
>
> If I write data in serial, that is, using DataOut<dim> on one process,
> then this information is written correctly into the d2 intermediate
> files.  If I instead write using FilteredDataOut<dim> using all
> processes, I see incorrect data in the d2 intermediate files.  Thus,
> the problem does not appear to be with metis, getting a vector of cell
> subdomain_id's, dataout, or merging the files, but in something when
> FilteredDataOut is used.

Does this happen with the unmodified step-18?

I believe I understand what is happening in this case. DataOut loops over all 
cells and keeps track of the index of each cell so that it can pick out 
elements from cell data vectors (such as the vector of subdomain_ids, as 
opposed to node data vectors such as solutions); this works fine as long as 
we loop over all cells, but it falls on its face if we only loop over a 
subset since the global index of a cell is not the same as its number within 
the stream of filtered cells.

That's a bug; the DataOut class will have to keep a side table of which cell 
has which index regardless of the order in which we traverse it. In essence, 
what the build_patches function should do is something like this:

  void build_patches ()
  {
    save user indices
    index = 0;
    for (cell=begin_active; cell!=end; ++cell, ++index)
      cell->set_user_index (index);

    do all work as before, but where we used the cell index previously by
    counting up an index, now use cell->user_index() instead

    restore user indices
  }

If you want to, feel free to poke around in the code a tad to see if you can 
figure out where these changes have to be made. If you can't seem to get 
anywhere, let me know and I'll fix this once I'm back from travel the week 
after next.

Best
 W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to