Wolfgang,

That is exactly what I need! But unfortunately I currently use version 
9.1.1 and I think this was introduced in 9.2.0 
(https://github.com/dealii/dealii/commit/0ec6aa676a27956a07f513585f407a954678ae52#diff-ca64fff9c161a88a3b72134cb89731e3bf3ce3b758ff386ef120d07e24312c65).

Is there any other alternative (that I can use on 9.1.1)? Otherwise I will 
have to update the installation.

On Thursday, May 27, 2021 at 7:01:12 PM UTC+5:30 Wolfgang Bangerth wrote:

> On 5/26/21 10:20 PM, [email protected] wrote:
> > 
> > I have a quantity which has a single value in a cell. Let me call this 
> an 
> > "average". I want to be able to access the average of neighbouring cells 
> from 
> > every cell.
> > 
> > What data structure can I use?
> > 
> > Since don't have mesh refinement, I was thinking of mapping this average 
> to 
> > the cell index and using a parallel vector for storage. However, 
> > LA::MPI::Vector probably will not work because cell numbering is not 
> > continuous within a subdomain. Also, I couldn't find any function that 
> can 
> > reorder the cells which may enable use of LA::MPI::Vector.
> > 
> > In the worst case, I can make a regular LA::MPI::Vector (using dofs) and 
> set 
> > the average to all dofs in a cell. I hope there is an alternative.
>
> You are looking for cell->global_active_cell_index(), which is documented 
> like so:
>
> /**
> * Return a globally unique cell index for the current cell,
> * assuming it is not artificial. The value is identical to
> * active_cell_index() if the cell is part of a serial
> * triangulation.
> *
> * In the context of parallel triangulations, locally-owned cells
> * are enumerated contiguously within each subdomain of the
> * mesh. This ensures that the index returned by this function can
> * be used as the index into vectors with a total of
> * Triangulation::n_globally_active_cells() entries, and for which
> * every process stores a contiguous part. If such a cell-data
> * vector has been set up with
> * parallel::TriangulationBase::global_active_cell_index_partitioner(),
> * the index returned by this function can then be used to access
> * the correct vector entry.
> */
> types::global_cell_index
> global_active_cell_index() const;
>
> Best
> W.
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6609e416-842e-4ebf-8329-77153b051848n%40googlegroups.com.

Reply via email to