Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Static Public Member Functions | List of all members
parallel::distributed::CellDataTransfer< dim, spacedim, VectorType >::CoarseningStrategies Struct Reference

#include <deal.II/distributed/cell_data_transfer.h>

Static Public Member Functions

static VectorType::value_type check_equality (const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
 
static VectorType::value_type sum (const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
 
static VectorType::value_type mean (const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
 

Detailed Description

template<int dim, int spacedim = dim, typename VectorType = Vector<double>>
struct parallel::distributed::CellDataTransfer< dim, spacedim, VectorType >::CoarseningStrategies

When data is transferred during coarsening, it is not trivial to decide how to handle data of child cells which will be coarsened. Or in other words, which data should be stored in the corresponding parent cell.

In this struct, we offer a few strategies that cope with this problem. Such strategies can be passed to the CellDataTransfer and parallel::distributed::CellDataTransfer constructors.

Definition at line 148 of file cell_data_transfer.h.

Member Function Documentation

◆ check_equality()

template<int dim, int spacedim = dim, typename VectorType = Vector<double>>
static VectorType::value_type parallel::distributed::CellDataTransfer< dim, spacedim, VectorType >::CoarseningStrategies::check_equality ( const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &  parent,
const VectorType input_vector 
)
inlinestatic

Check if data on all children match, and return value of the first child.

\[ d_{K_p} = d_{K_c} \qquad \forall K_c \text{ children of } K_p \]

Definition at line 156 of file cell_data_transfer.h.

◆ sum()

template<int dim, int spacedim = dim, typename VectorType = Vector<double>>
static VectorType::value_type parallel::distributed::CellDataTransfer< dim, spacedim, VectorType >::CoarseningStrategies::sum ( const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &  parent,
const VectorType input_vector 
)
inlinestatic

Return the sum over all processors of the value t. This function is collective over all processors given in the communicator. If deal.II is not configured for use of MPI, this function simply returns the value of t. This function corresponds to the MPI_Allreduce function, i.e. all processors receive the result of this operation.

Note
Sometimes, not all processors need a result and in that case one would call the MPI_Reduce function instead of the MPI_Allreduce function. The latter is at most twice as expensive, so if you are concerned about performance, it may be worthwhile investigating whether your algorithm indeed needs the result everywhere.
This function is only implemented for certain template arguments T, namely float, double, int, unsigned int.

Definition at line 180 of file cell_data_transfer.h.

◆ mean()

template<int dim, int spacedim = dim, typename VectorType = Vector<double>>
static VectorType::value_type parallel::distributed::CellDataTransfer< dim, spacedim, VectorType >::CoarseningStrategies::mean ( const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &  parent,
const VectorType input_vector 
)
inlinestatic

The function or difference of functions is integrated on each cell \(K\):

\[ E_K = \int_K \sum_c (\hat{f}_c - f_c) \, w_c = \int_K \sum_c e_c \, w_c \]

and summed up to get

\[ E = \sum_K E_K = \int_\Omega \sum_c (\hat{f}_c - f_c) \, w_c \]

or, for \(w \equiv 1\):

\[ E = \int_\Omega (\hat{f} - f) = \int_\Omega e. \]

Note: This differs from what is typically known as the mean of a function by a factor of \(\frac{1}{|\Omega|}\). To compute the mean you can also use compute_mean_value(). Finally, pay attention to the sign: if \(\hat{f}=0\), this will compute the negative of the mean of \(f\).

Definition at line 200 of file cell_data_transfer.h.


The documentation for this struct was generated from the following file: